Postado Março 24, 2015 10 anos 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: days = 30 vipcoins = 3031 quant = 10 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 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()) Agradeço a atenção! Oi
Postado Março 24, 2015 10 anos O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Suporte OTServ → Suporte de OTServ Geral" Para: "OTServ → Suporte OTServ → Suporte de Scripts" Em relação ao seu pedido, tente assim: 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 local days = 30 local vipcoins = 3031 local quant = 10 function santaNPC(cid, message, keywords, parameters, node) if not npcHandler:isFocused(cid) then return false end local premText = "" if parameters.present then if isPlayer(cid) then if getPlayerItemCount(cid, vipcoins) >= quant then doPlayerAddPremiumDays(cid, days) doPlayerRemoveItem(cid, vipcoins, quant) if getPlayerVocation(cid) < 5 then doPlayerSetVocation(cid, getPlayerVocation(cid) + 4) premText = " e sua Promotion." end npcHandler:say("Obrigado, aqui estao seus 30 dias de Premium" .. premText, 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()) Atenciosamente, Bruno Minervino
Postado Março 24, 2015 10 anos 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 site acesse:http://rexwar.esy.es se te ajudei mi ajude com um like canal do youtube:https://www.youtube.com/channel/ blog:http://yakinhotutoriais.blogspot.com.br/ site acesse:http://rexwar.esy.es 0 comentários:
Postado Março 24, 2015 10 anos 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. ➥ Regras | Seções OTServ | Seções BOT
Postado Março 24, 2015 10 anos Autor 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 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. 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. 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 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
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.