Ir para conteúdo
  • Cadastre-se

(Resolvido){Pedido} Promotion automática.


Ir para solução Resolvido por Wakon,

Posts Recomendados

Olá!

 

Estou precisando de algum script, ou algum jeito de quando o player comprar premium account (isPremium) ele receber a promotion junto.

A premium é fornecida por um npc, então eu quero que quando o jogador compre a premium account a promotion venha junto. Sendo assim:

 

Um knight vire um Elite knight 

Um druid vire um Elder druid

Um sorcerer vire um Master sorcerer

um paladin vire um Royal paladin

 

Script do npc:

 

  Mostrar conteúdo oculto

 

Agradeço a atenção!  ;D 

Oi

Link para o post
Compartilhar em outros sites
  • Respostas 8
  • Created
  • Última resposta

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Posts

NPC: days = 30 vipcoins = 3031 quant = 10 local storage = 55885 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function santaNPC(cid, m

Tenta assim, tira o que eu te passei do login.lua e coloca isso no lugar: if getPlayerStorageValue(cid, 55885) <= 0 and getPlayerPremiumDays(cid) >= 1 then setPlayerStorageValue(cid, 55885, 1) doPlayerSetVocation(cid, getPlayerVocation(cid) + 4) return true end local vocstatus = getPlayerStorageValue(cid, 55885) if vocstatus == 1 and getPlayerPremiumDays(cid) >= 1 then doPlayerSetVocation(cid, getPlayerVocation(cid) + 4) end

O tópico foi movido para a área correta, preste mais atenção da próxima vez!

Leia as regras do fórum:

Hidden Content

    Give reaction to this post to see the hidden content.

Este tópico foi movido:

De: "OTServSuporte OTServSuporte de OTServ Geral"

Para: "OTServSuporte OTServSuporte de Scripts"

 

 

Em relação ao seu pedido, tente assim:

  Mostrar conteúdo oculto

Atenciosamente,

Bruno Minervino

Link para o post
Compartilhar em outros sites

Ai tem esse post que fis de uma olhadinha

http://www.tibiaking.com/forum/topic/53268-premium-automatico-do-site-tutorial/

 

se te ajudei mi ajude dando um like ^^

 
 
se te ajudei mi ajude com um like
 
post-154810-0-74779100-1428114524_thumb.        post-154810-0-22067300-1428114531_thumb.          post-154810-0-83198200-1427326965.gif
post-154810-0-48855100-1429834735.gif
 
 
 
 
0 comentários:

 

Link para o post
Compartilhar em outros sites

NPC:

days = 30
vipcoins = 3031
quant = 10
local storage = 55885


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)




function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end


function santaNPC(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if (parameters.present == true) then
if isPlayer(cid) then
if getPlayerItemCount(cid,vipcoins) >= quant and getPlayerVocation(cid) <= 4 and getPlayerVocation(cid) >= 1 then
doPlayerAddPremiumDays(cid,days)
doPlayerRemoveItem(cid,vipcoins,quant)
npcHandler:say('Obrigado, aqui estao seus 30 dias de Premium', cid)
doPlayerSendTextMessage(cid, 22, "Congratulations, you've been promoted..")
doSendMagicEffect(getPlayerPosition(cid), 12)
doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)
setPlayerStorageValue(cid, storage, 1)
elseif getPlayerItemCount(cid,vipcoins) >= quant and getPlayerVocation(cid) > 4 then
doPlayerAddPremiumDays(cid,days)
doPlayerRemoveItem(cid,vipcoins,quant)
npcHandler:say('Obrigado, aqui estao seus 30 dias de Premium', cid)
else
npcHandler:say('Voce nao tem Coins suficientes!', cid)
end
end
npcHandler:resetNpc()
return true
end
end
npcHandler:setMessage(MESSAGE_GREET, "Ola. Eu vendo dias de {Premium}.")


local noNode = KeywordNode:new({'no'}, santaNPC, {present = false})
local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true})


local node = keywordHandler:addKeyword({'premium'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce gostaria de comprar 30 dias de Premium por 10 Coins?'})
node:addChildKeywordNode(yesNode)
node:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())

Vá em "Data/Creaturescripts/scripts" abra o login.lua e adicione o seguinte:

local vocstatus = getPlayerStorageValue(cid, 55885)
if vocstatus == 1 and getPlayerPremiumDays(cid) >= 1 then
doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)
return TRUE
end

Testei aqui e tá de boa, ele tira a promotion se estiver free, caso de algum bug me fale.

Link para o post
Compartilhar em outros sites
  Em 24/03/2015 em 12:53, Tibia2015br disse:

Ai tem esse post que fis de uma olhadinha

http://www.tibiaking.com/forum/topic/53268-premium-automatico-do-site-tutorial/

 

se te ajudei mi ajude dando um like ^^

Mostrar mais  

 

Amigo, gostei do seu script e tudo mas não é exatamente o que eu quero. Quero um script que ao player comprar a premium seria adicionada automaticamente a promotion. :D

  Em 24/03/2015 em 12:57, Wakon disse:

NPC:

days = 30
vipcoins = 3031
quant = 10
local storage = 55885


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)




function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end


function santaNPC(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if (parameters.present == true) then
if isPlayer(cid) then
if getPlayerItemCount(cid,vipcoins) >= quant and getPlayerVocation(cid) <= 4 and getPlayerVocation(cid) >= 1 then
doPlayerAddPremiumDays(cid,days)
doPlayerRemoveItem(cid,vipcoins,quant)
npcHandler:say('Obrigado, aqui estao seus 30 dias de Premium', cid)
doPlayerSendTextMessage(cid, 22, "Congratulations, you've been promoted..")
doSendMagicEffect(getPlayerPosition(cid), 12)
doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)
setPlayerStorageValue(cid, storage, 1)
elseif getPlayerItemCount(cid,vipcoins) >= quant and getPlayerVocation(cid) > 4 then
doPlayerAddPremiumDays(cid,days)
doPlayerRemoveItem(cid,vipcoins,quant)
npcHandler:say('Obrigado, aqui estao seus 30 dias de Premium', cid)
else
npcHandler:say('Voce nao tem Coins suficientes!', cid)
end
end
npcHandler:resetNpc()
return true
end
end
npcHandler:setMessage(MESSAGE_GREET, "Ola. Eu vendo dias de {Premium}.")


local noNode = KeywordNode:new({'no'}, santaNPC, {present = false})
local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true})


local node = keywordHandler:addKeyword({'premium'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce gostaria de comprar 30 dias de Premium por 10 Coins?'})
node:addChildKeywordNode(yesNode)
node:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())

Vá em "Data/Creaturescripts/scripts" abra o login.lua e adicione o seguinte:

local vocstatus = getPlayerStorageValue(cid, 55885)
if vocstatus == 1 and getPlayerPremiumDays(cid) >= 1 then
doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)
return TRUE
end

Testei aqui e tá de boa, ele tira a promotion se estiver free, caso de algum bug me fale.

Expand   Mostrar mais  

 

Pelo que entendi o player compra a premium e também vem a promotion, e quando a premium acaba a promotion também acaba? Se for isso está perfeito, por que esqueci de citar no tópico pra quando a premium acabar a promotion também ser retirada  :facepalm:  Aqui não deu nenhum error amigo, está funcionando perfeitamente, mas só outra pergunta... Teria como colocar para todos personagens da conta ganharem promotion mesmo offline? 

Oi

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por xWhiteWolf
      Bom galera, tem uma coisa bem simples que nem o tibia global fez e que eu to trazendo aqui pra vocês. Trata-se de um pequeno sistema que fará você sempre virar pra direção do seu target ao atacar.
      Testado em TFS 0.3.6 Cliente 8.54.

      Imagem auto explicativa:




      Chega de atacar de costas! 

      Agora pra instalar é bem tranquilo. Abra um arquivo .lua em data\creaturescripts\scripts chamado target e coloque o seguinte conteudo dentro dele:




      Feito isso adicione essa linha no creaturescripts.xml:
      <event type="attack" name="targetCreature" script="target.lua"/> E para finalizar adicione a seguinte tag em creaturescripts\scripts\login.lua:
      registerCreatureEvent(cid, "targetCreature") Espero que vcs tenham curtido, é algo bem simples mas ninguém havia pensado nisso antes (nem o próprio Tibia), é uma coisa bem básica e que torna o jogo bem mais importante e sério. 


      EDIT:: Usem essa versão que está mais completa, na anterior se o target estivesse na diagonal ele não virava.



    • Por Kiman174
      GRIMHAVEN SEASON 4
      LAUNCHING APRIL 18TH 19:00 CEST
       
      Join our community and stay up to date:
      Official Discord Server
       
       
       
       
       
      Step into a world where passion meets innovation—welcome to Grimhaven MMORPG! Born from a heartfelt passion project, Grimhaven has evolved into an extraordinary realm where every pixel on our meticulously crafted Real Map tells a story. Leveraging the classic legacy of version 8.6 and elevated by inventive custom content, our server transcends traditional gameplay, inviting you into a living, breathing adventure at every turn.
       
       
      Explore sprawling landscapes, battle formidable foes, and uncover hidden lore as you journey through environments that blend classic mechanics with innovative systems. Every corner of Grimhaven pulses with life and mystery, inviting you to forge alliances, challenge epic quests, and redefine what you thought possible in an open Tibia server. With each update, our dedicated team pushes the envelope, ensuring that every raid, dungeon, and social encounter feels fresh and electrifying.
       
       
      Whether you're a seasoned adventurer or new to the realm, Grimhaven offers a thrilling escape into a world where the spirit of discovery and the thrill of combat come together in perfect harmony. Embrace the extraordinary—your adventure begins now in Grimhaven MMORPG!
       
       
      What Makes Grimhaven Stand Out?
       
      With over thousands of hours of development and 4000+ commits, Grimhaven stands out with its unique blend of classic and innovative MMORPG features. Built on an authentic Real Map with 8.6 mechanics and expanded with carefully designed custom content, the experience is unmatched. The server offers rates starting from 12x, stunning HD visuals, and intricately scripted quests that immerse you in a dynamic narrative. From challenging custom raid bosses to a refined item system inspired by classic action RPGs, every element is thoughtfully crafted to deliver an engaging and ever-evolving adventure, all backed by a dedicated team ensuring a top-tier gaming experience.
       
       
       
      Custom Zones :
      Explore meticulously designed zones that promise unique challenges and unparalleled rewards.
       

       
       
       
      Unique Randomly Generated Dungeons :
      As if that's not enough, brace yourselves for our unique dungeons. Each one is randomly generated, ensuring that no adventure is ever the same. The thrill of exploring the unknown awaits you in every twist and turn.
       


       

       
       


       
       
       
      Scripted and Mechanically Challenging Quests:
      Immerse yourself in intricately designed quests that push your strategic prowess and combat skills, all brought to life by the remarkable creativity of our quest designer and mapper.
       

       

       


       
       
      Mighty Bosses:
      Confront colossal adversaries, each boasting unique abilities and intricate mechanics that challenge your tactics and teamwork, turning every encounter into an unforgettable battle.
       


       
       
       
      Ancient and Mythic Monsters:
      Encounter legendary beasts, ancient guardians, and mythical creatures that not only test your skills and courage but also offer tougher challenges, richer loot drops, and enhanced experience rewards.
       

       
       
       
      Magical Attributes & Crafting:
      Discover a world of enchantment where magical items not only have a chance to drop in the wild, but can also be expertly crafted to bestow unique and powerful attributes on your gear.
       
       

       

       
       
       
      Custom Events :
      We keep the excitement rolling with unique, server-wide events that'll keep you on the edge of your seat. Expect the unexpected!
       
       



       
       
       
      This glimpse barely scratches the surface—there's a TON more content that would overwhelm this thread! To dive even deeper, visit our official wiki at Grimhaven Wiki (https://wiki.grimhaven.net) and create your account today at Latestnews - Grimhaven (https://www.grimhaven.net/) .   
       
      Gear up for an unforgettable adventure starting April 18th 19:00 CEST.
      Dive into a realm of epic rewards, heart-pounding quests, and intense PVP battles where you'll test your skills against others.
      Join a vibrant community of adventurers, embrace the thrill of discovery, and answer the call to glory on the battlefield!
    • Por Veigh
      IP: HYPEOT.COM (Versão 8.60) Por que jogar no HYPEOT? Confira nossos diferenciais: Sistema de Reset 180+ Montarias 65+ Outfits Sistema de Stage Sistema de Pesca Sistema de Refinamento Sistema de Aura Sistema de Mineração Sistema de Woodcut Sistema de Dungeons Sistema de Survival Mais de 30 Bosses de Alavancas +10 Eventos Automáticos Mais de 5 anos online com apenas 2 resets. Agora estamos de volta com força total desde 05/12! O que você está esperando? Junte-se à aventura e faça parte dessa jornada épica! Conecte-se agora mesmo e não fique de fora!
    • Por L3K0T
      Sistema de Drop Personalizado
       
      Esse sistema de loot foi projetado para adicionar um elemento de sorte e surpresa ao derrotar monstros. Sempre que um jogador derrota um monstro, há uma chance configurada para que ele solte entre 1 a 3 itens especiais, garantindo recompensas valiosas ao jogador.
       
      O sistema realiza as seguintes ações:
      Chance de Drop: A cada morte de um monstro, há uma chance configurada para dropar itens específicos. O sistema permite que sejam dropados entre 1 a 3 unidades do item, tornando o sistema mais dinâmico.
       
      Efeito Visual: Quando o loot é bem-sucedido, um efeito visual especial (ID 231) é exibido na posição exata onde o monstro foi derrotado, criando uma animação visual que destaca a recompensa.
       
      Notificação ao Jogador: Após o drop, o jogador recebe uma mensagem personalizada informando a quantidade de itens obtidos. Essa notificação aparece após 3 segundos, adicionando uma camada de imersão e evitando sobrecarregar o chat imediatamente após a morte do monstro.
       
      *Ótimo para fazer eventos de dropar certo itens para alguma missão ou resgates.
      *Uso no meu TIBIA HARRY POTTER ORIGIN
       
      VAi em creaturescripts/scripts.lua
      local function findCorpse(position) for i = 1, 255 do position.stackpos = i local corpse = getThingfromPos(position) if isCorpse(corpse.uid) then return corpse.uid end end return false end local function dropLoot(position, killer) local corpse = findCorpse(position) if not corpse then return false end local itemId = 2160 local chance = 23 if math.random(100) <= chance then local amountToDrop = math.random(1, 3) doAddContainerItem(corpse, itemId, amountToDrop) local corpsePosition = getThingPos(corpse) doSendMagicEffect(corpsePosition, 7) local function sendMessage() if isPlayer(killer) then local message = string.format("Você dropou %d Crystal Coin(s).", amountToDrop) doPlayerSendTextMessage(killer, MESSAGE_INFO_DESCR, message) end end addEvent(sendMessage, 2500) end return true end function onKill(cid, target) local position = getCreaturePosition(target) addEvent(dropLoot, 100, position, cid) return true end  
      creaturescripts.xml
      <event type="kill" name="GlobalDrops" registerTo ="GlobalDrops" event="script" value="globalDrops.lua"/> ou depende do tfs
      <event type="kill" name="GlobalDrops" event="script" value="globalDrops.lua"/>  
      Para ambos TFS registra o evento no login.lua
      registerTo ="GlobalDrops"
      feito isso.. agora todos os monstros do mapa vai cair os crystal coins de 1 há 3.
    • Por hekan19
      Olá pessoal,
       
      Estou com um problema no sistema de autoloot.
      Ao abrir um Pokémon, itens aparecem no chão. Recebo "0" no console do TFS.
       
      Obrigado pela ajuda
  • Estatísticas dos Fóruns

    96841
    Tópicos
    519583
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo