Postado Agosto 18, 2019 5 anos Bom galera eu consegui criar os 2 npcs da bless de kazordoon, porém estou com algumas duvidas o primeiro npc q da o storage é esse 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 phoenix(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if getPlayerStorageValue(cid,8888888) <= -1 then npcHandler:say('So receive the blessing of the life-giving earth, pilgrim.!', cid) doSendMagicEffect(getCreaturePos(cid), 12) setPlayerStorageValue(cid,8888888, 1) end end keywordHandler:addKeyword({'bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Here you may receive the blessing {Spark of The Phoenix}'}) local node1 = keywordHandler:addKeyword({'phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'The Spark of the Phoenix is given by name and by the great pyromancer in the nearby fire temple. Do you wish to receive my part of the Spark if the Phoenix? '}) node1:addChildKeyword({'yes'}, phoenix, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then.', reset = true}) npcHandler:addModule(FocusModule:new()) o segundo npc q verifica o storage e dá a blessing é esse 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 phoenix(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local player_gold = getPlayerItemCount(cid,2148) local player_plat = getPlayerItemCount(cid,2152)*100 local player_crys = getPlayerItemCount(cid,2160)*10000 local player_money = player_gold + player_plat + player_crys if player_money >= 10000 then if doPlayerRemoveMoney(cid,10000) and getPlayerStorageValue(cid,8888888) <= 1 and getPlayerBlessing(cid, 5) then npcHandler:say('Here is your blessing!', cid) setPlayerStorageValue(cid,8888888,-1) doSendMagicEffect(getCreaturePos(cid), 12) doPlayerAddBlessing(cid, 5) end else npcHandler:say('Alright then.', cid) end if getPlayerBlessing(cid,5) == -1 then npcHandler:say('You have already blessed you with this blessing.', cid) end end local node1 = keywordHandler:addKeyword({'phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Here you may receive the blessing {Spark of Phoenix}. But we must ask of you to sacrifice 10000 gold coins. Are you still interested?.'}) node1:addChildKeyword({'yes'}, phoenix, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then.', reset = true}) npcHandler:addModule(FocusModule:new()) Eu preciso que o segundo npc venda apenas se eu NAO tiver o storage e a blessing. ( obs ele ta vendendo se eu falar toda hora) "então ele come todo o gold" preciso que ele verifique se tem os 2 e fale "voce já possui a bless tal" e se caso nao tenha nem storage nem a bless ele fale "voce deve falar com o Kawill. eu montei o script mas n consegui resolver essas 3 questoes Editado Agosto 18, 2019 5 anos por bpm91 (veja o histórico de edições)
Postado Agosto 18, 2019 5 anos Citar 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 phoenix(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local player_gold = getPlayerItemCount(cid,2148) local player_plat = getPlayerItemCount(cid,2152)*100 local player_crys = getPlayerItemCount(cid,2160)*10000 local player_money = player_gold + player_plat + player_crys if player_money >= 10000 then if doPlayerRemoveMoney(cid,10000) and getPlayerStorageValue(cid,8888888) <= 1 and getPlayerBlessing(cid, 5) then npcHandler:say('Here is your blessing!', cid) setPlayerStorageValue(cid,8888888,-1) doSendMagicEffect(getCreaturePos(cid), 12) doPlayerAddBlessing(cid, 5) end else npcHandler:say('Alright then.', cid) end if getPlayerStorageValue(cid,8888888) == 1 then npcHandler:say('Você já está abençoado.', cid) end end if getPlayerStorageValue(cid,8888888) == 0 then npcHandler:say('Fale com o Kawii.', cid) end end local node1 = keywordHandler:addKeyword({'phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Here you may receive the blessing {Spark of Phoenix}. But we must ask of you to sacrifice 10000 gold coins. Are you still interested?.'}) node1:addChildKeyword({'yes'}, phoenix, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then.', reset = true}) npcHandler:addModule(FocusModule:new()) Npc2
Postado Agosto 18, 2019 5 anos Autor @iHolloway eu consegui arrumar o segundo npc q é o pydar, mas o kawil q é o q da storage nao funciona mais ficou assim NPC PYDAR (funcionando certo e dando a bless) 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 storages = 8888888 function bless(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if getPlayerStorageValue(cid,storages) == 2 then npcHandler:say('So receive the blessing of the life-giving earth, pilgrim!', cid) doSendMagicEffect(getCreaturePos(cid), 12) setPlayerStorageValue(cid,storages, 0) end if getPlayerStorageValue(cid,storages) >= 2 then npcHandler:say('You already have this blessing.', cid) end end keywordHandler:addKeyword({'bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Here you may receive the blessing {Spark of The Phoenix}'}) local node1 = keywordHandler:addKeyword({'phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'The Spark of the Phoenix is given by name and by the great pyromancer in the nearby fire temple. Do you wish to receive my part of the Spark if the Phoenix for 10000 gold?'}) node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 10000, levelCost = 0, startLevel = 10, endLevel = 120}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Oh. You do not have enough money.'}) npcHandler:addModule(FocusModule:new()) npcHandler:addModule(FocusModule:new()) o problema está em o pydar remover a storage ao dar a bless, pra poder o kawil ( o primeiro npc) dar a storage novamente. 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 storages = 8888888 function phoenix(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if getPlayerStorageValue(cid,storages) == 0 then npcHandler:say('So receive the blessing of the life-giving earth, pilgrim!', cid) doSendMagicEffect(getCreaturePos(cid), 12) setPlayerStorageValue(cid,storages, 2) end if getPlayerStorageValue(cid,storages) >= 1 then npcHandler:say('You already have this blessing.', cid) end end keywordHandler:addKeyword({'bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Here you may receive the blessing {Spark of The Phoenix}'}) local node1 = keywordHandler:addKeyword({'phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'The Spark of the Phoenix is given by name and by the great pyromancer in the nearby fire temple. Do you wish to receive my part of the Spark if the Phoenix?'}) node1:addChildKeyword({'yes'}, phoenix, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then.', reset = true}) npcHandler:addModule(FocusModule:new()) Editado Agosto 18, 2019 5 anos por bpm91 (veja o histórico de edições)
Postado Agosto 18, 2019 5 anos Tenta aí Citar 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 storages = 8888888 function phoenix(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if getPlayerStorageValue(cid,storages) == 0 then npcHandler:say('So receive the blessing of the life-giving earth, pilgrim!', cid) doSendMagicEffect(getCreaturePos(cid), 12) setPlayerStorageValue(cid,storages, 0) end if getPlayerStorageValue(cid,storages) >= 1 then npcHandler:say('You already have this blessing.', cid) end end keywordHandler:addKeyword({'bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Here you may receive the blessing {Spark of The Phoenix}'}) local node1 = keywordHandler:addKeyword({'phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'The Spark of the Phoenix is given by name and by the great pyromancer in the nearby fire temple. Do you wish to receive my part of the Spark if the Phoenix?'}) node1:addChildKeyword({'yes'}, phoenix, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then.', reset = true}) npcHandler:addModule(FocusModule:new())
Postado Agosto 18, 2019 5 anos Autor @iHolloway mas ai ficou if getPlayerStorageValue(cid,storages) == 0 then npcHandler:say('So receive the blessing of the life-giving earth, pilgrim!', cid) doSendMagicEffect(getCreaturePos(cid), 12) setPlayerStorageValue(cid,storages, 0) se o storage é 0 o pydar nao vai vender bless porque ele só responde se vc tiver o storage. correto?
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.