Seguinte eu pedi pro kra cria um npc q o kra da um item edited by me e recebe soft boots..so q é o seguinte,
eu quiria saber se tem algum geito de isso so acontecer 1 vez
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local config ={
s = 11222, -- n mexa
item = 102, -- id machet
premio = 107, -- premio id
quanty = 1, -- quantidade do premio
RemoveItem = "yes"
}
if(msgcontains(msg, 'ajuda') or msgcontains(msg, 'AJUDA')) then
if getPlayerStorageValue(cid,config.s) <= 0 then
selfSay("roubaram minha machet mágica foi um presente do meu pai, voce deseja me ajuda?", cid)
talk_state = 1
else
selfSay("Muito obrigado pela sua ajuda Voce pegou minha magic macheT? ", cid)
talk_state = 2
end
elseif (msgcontains(msg, 'sim') or msgcontains(msg, 'sim')) and talk_state == 1 then
selfSay("obrigado, acho que ela está com os anões das cavernas de Narineia, lhe {recompensaria} se fosse la buscar para min.", cid)
talk_state = 3
elseif (msgcontains(msg, 'recompensaria') or msgcontains(msg, 'RECOMPENSARIA')) and talk_state == 3 then
setPlayerStorageValue(cid, config.s, 1)
selfSay("sim tenho algo aqui que lhe intereça, mais cuidado os anões das cavernas de narineia contruiram robos de cristal muito fortes,vejo voce mais tarde...", cid)
talk_state = 0
elseif (msgcontains(msg, 'sim') or msgcontains(msg, 'PEGUEI')) and talk_state == 2 then
if getPlayerItemCount(cid, config.item) >= 1 then
selfSay("Nossa, muito obrigado... Aqui está sua recompensa.", cid)
setPlayerStorageValue(cid, config.s, 2)
doPlayerAddItem(cid, config.premio, config.quanty)
if (config.RemoveItem == "yes") then
doPlayerRemoveItem(cid, config.item, 1)
end
talk_state = 0
else
selfSay("Que pena, voce ainda não achou...", cid)
talk_state = 0
end
elseif msg:lower() == "no" and talk_state >= 1 then
selfSay("Obrigado mesmo assim...", cid)
talk_state = 0
npcHandler:resetNpc()
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
esté é o npc...
e otra coisa pq o item q eu criei n sai do chão? ele viro tipo parte do chão =/ ele é uma axe mais n sai do chão pq isso?
aqui o item
</item>
<item id="102" article="a" name="magic machet">
<attribute key="description" value="Machet dado ao campones pelo seu pai"/>
<attribute key="weight" value="8000"/>
<attribute key="defense" value="12"/>
<attribute key="attack" value="29"/>
<attribute key="weaponType" value="axe"/>
<attribute key="extradef" value="1"/>
será q é pq a machet é tipo o desenho de uma arma elementar?
(e kiria tipo se o kra ja tiver feito o npc falaria (você ja me ajudou muito obrigado