Postado Abril 2, 2015 10 anos Fala galera, preciso de um npc que venda a segunda promotion, e esse npc só vai ter na area vip, ou seja só vip pode ter a segunda promotion, segue o código da promotion que eu criei se tiver algo errado por favor me corrijam. <vocation id="9" clientid="3" name="Noble Master Sorcerer" description="a noble master sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="20" gainmanaticks="1" gainmanaamount="50" manamultiplier="1.1" attackspeed="1500" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="1"> <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="2.0"/> <skill id="1" multiplier="2.5"/> <skill id="2" multiplier="2.5"/> <skill id="3" multiplier="2.5"/> <skill id="4" multiplier="2.5"/> <skill id="5" multiplier="2.0"/> <skill id="6" multiplier="1.6"/> </vocation> <vocation id="10" clientid="4" name="Noble Elder Druid" description="an noble elder druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="20" gainmanaticks="1" gainmanaamount="50" manamultiplier="1.1" attackspeed="1500" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="2"> <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="2.0"/> <skill id="1" multiplier="2.3"/> <skill id="2" multiplier="2.3"/> <skill id="3" multiplier="2.3"/> <skill id="4" multiplier="2.3"/> <skill id="5" multiplier="2.0"/> <skill id="6" multiplier="1.6"/> </vocation> <vocation id="11" clientid="2" name="Noble Royal Paladin" description="a noble royal paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="2" gainhpamount="25" gainmanaticks="1" gainmanaamount="35" manamultiplier="1.4" attackspeed="1400" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="3"> <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.7"/> <skill id="1" multiplier="1.7"/> <skill id="2" multiplier="1.7"/> <skill id="3" multiplier="1.7"/> <skill id="4" multiplier="1.6"/> <skill id="5" multiplier="1.6"/> <skill id="6" multiplier="1.6"/> </vocation> <vocation id="12" clientid="1" name="Noble Elite Knight" description="an noble elite knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="1" gainhpamount="30" gainmanaticks="1" gainmanaamount="20" manamultiplier="3.0" attackspeed="1300" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="4"> <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> <skill id="0" multiplier="1.6"/> <skill id="1" multiplier="1.6"/> <skill id="2" multiplier="1.6"/> <skill id="3" multiplier="1.6"/> <skill id="4" multiplier="1.9"/> <skill id="5" multiplier="1.6"/> <skill id="6" multiplier="1.6"/> </vocation> Essa promotion upara os skills mais rapidamente, eu alterei nos skill id, não sei se ta certo, mas pela lógica eu axo que eh ali mesmo, enfim o sistema vip que eu uso usa a storage 9999 se ajudar, esse eh o meu vip system:https://otland.net/threads/vip-system-the-forgotten-server-1-0.224910/#post-2163589 Gostaria de um npc que de a segunda promotion só se o player tiver vip, por dinheiro normal do jogo, e que quando acabasse a vip, voltasse a ser promotion 1 (master sorcerer, etc..) e que só consiga ter a promotion 2 se tiver a promotion 1, lembrando que eu uso TFS 1.0, obrigado desde já! Editado Abril 2, 2015 10 anos por Andreselos1988 (veja o histórico de edições)
Postado Abril 3, 2015 10 anos local money = xxxx -- Quanto vai custar local storage = 14542 -- Não mexer 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 function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end player = Player(cid) if player:getStorageValue(storage) == 1 then npcHandler:say('you have already received the promotion', cid) return true end if msgcontains(msg:lower(), 'promotion') then npcHandler:say('you are sure?', cid) npcHandler.topic[cid] = 1 end if msgcontains(msg:lower, 'yes') and npcHandler.topic[cid] == 1 then if isInArray({5, 6, 7, 8}, player:getVocation()) then if player:getVipDays() >= 1 then if player:removeMoney(money) then npcHandler:say('you just received a new promotion', cid) player:setVocation(player:getVocation() + 4) player:setStorageValue(storage, 1) npcHandler.topic[cid] = 0 else npcHandler:say('you no have money', cid) npcHandler.topic[cid] = 0 end else npcHandler:say('You do not have any vip days.', cid) npcHandler.topic[cid] = 0 end else npcHandler:say('you no have first promotion', cid) npcHandler.topic[cid] = 0 end elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then NpcHandler:say('Bye!!', cid) npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) em creaturescripts : function onLogin(cid) local storage = 14542; player = Player(cid); if player:getVipDays() == 0 and player:getStorageValue(storage) == 1 then player:setVocation(player:getVocation() - 4) player:setStorageValue(storage, - 1) end return true end Editado Abril 3, 2015 10 anos por Summ (veja o histórico de edições)
Postado Abril 3, 2015 10 anos Autor local money = xxxx, -- Quanto vai custar local storage = 14542, -- Não mexer 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 function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end player = Player(cid) if player:getStorageValue(storage) == 1 then npcHandler:say('you have already received the promotion', cid) return true end if msgcontains(msg:lower(), 'promotion') then npcHandler:say('you are sure?', cid)] npcHandler.topic[cid] = 1 end if msgcontains(msg:lower, 'yes') and npcHandler.topic[cid] == 1 then if isInArray({5, 6, 7, 8}, player:getVocation()) then if player:getVipDays() >= 1 then if player:removeMoney(money) then npcHandler:say('you just received a new promotion', cid) player:setVocation(player:getVocation() + 4) player:setStorageValue(storage, 1) npcHandler.topic[cid] = 0 else npcHandler:say('you no have money', cid) npcHandler.topic[cid] = 0 end else npcHandler:say('You do not have any vip days.', cid) npcHandler.topic[cid] = 0 end else npcHandler:say('you no have first promotion', cid) npcHandler.topic[cid] = 0 end elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then NpcHandler:say('Bye!!', cid) npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) em creaturescripts : function onLogin(cid) local storage = 14542; player = Player(cid); if player:getVipDays() == 0 and player:getStorageValue(storage) == 1 then player:setVocation(player:getVocation() - 4) player:setStorageValue(storage, - 1) end return true end Obrigado vou testar, aonde ta local storage = 14542, -- Não mexer pode colocar 9999?
Postado Abril 3, 2015 10 anos Cara deixa a storage que tá ... se trocar vai dar problema e pra que tu quer mudar pra essa storage "9999"?
Postado Abril 3, 2015 10 anos Autor Cara deixa a storage que tá ... se trocar vai dar problema e pra que tu quer mudar pra essa storage "9999"? Okay nao mudei nada, porem ta dando esse erro na distro [Warning - NpcScript::NpcScript] Can not load script: Queen Alice.lua data/npc/scripts/Queen Alice.lua:2: unexpected symbol near 'local' ps: eu queria trocar pra 9999 pq é a storage da vip, e eu pensei que essa linha tinha algo a ver.. Editado Abril 3, 2015 10 anos por Andreselos1988 (veja o histórico de edições)
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.