<parameter key="message_greet" value="Hello, |PLAYERNAME|. If you are level 120 and pay me 10k, I can {reset} you."/>
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
if(msgcontains(msg, 'reset')) then
if getPlayerLevel(cid) => 120 and getPlayerMoney(cid) => 10000 then
doPlayerAddExperience(cid, (getExperienceForLevel(8) - getPlayerExperience(cid)))
doPlayerRemoveMoney(cid, 10000)
doPlayerAddItem(cid,2160,QUANTIA)
doPlayerAddItem(cid,1257,QUANTIA)
doPlayerSetMaxHealth(cid,500)
doPlayerSetMaxMana(cid,500)
doPlayerSetMagic(cid,0)
doPlayerSetSkill(cid, SKILL_FIST, 10)
doPlayerSetSkill(cid, SKILL_CLUB, 10)
doPlayerSetSkill(cid, SKILL_SWORD, 10)
doPlayerSetSkill(cid, SKILL_AXE, 10)
doPlayerSetSkill(cid, SKILL_DISTANCE, 10)
doPlayerSetSkill(cid, SKILL_SHIELD, 10)
doPlayerSetSkill(cid, SKILL_FISHING, 10)
selfSay('Voce resetou com sucesso!', cid)
else
elseif getPlayerLevel(cid) < 120 or getPlayerMoney(cid) < 10000 then
selfSay('Voce nao possui level 120 ou os 10k necessarios para resetar.', cid)
else
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
OBS: os comandos envolvendo skills podem não funcionar dependendo de cada servidor/distro. Teste e, caso haja erro no script, me avise.