-- Aveo Script --
local knight = {4,8}
local level = getPlayerLevel(cid) - getPlayerLevel(cid) + 1
local newsvoc = math.random(1,3)
-- NPC Messages --
local npc_message ={
"You want Reset your experience and level?",
"Are you a Stronger Warrior YOU ARE SURE???",
"You dont have vocation to make this...",
"Take your new level, you have complete reset"
}
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
selfSay(npc_message[1], cid)
end
if(msgcontains(msg, 'yes')) then
selfSay(npc_message[1], cid)
talkState[talkUser] = 1
end
if (getPlayerVocation(cid,knight) > 0) then
doPlayerSetVocation(cid,newsvoc)
doPlayerAddLevel(cid,level)
doSendMagicEffect(getCreaturePosition(cid), 10)
selfSay(npc_message[4], cid)
else
doSendMagicEffect(getCreaturePosition(cid), 10)
doCreatureSay(cid, "Im Not a Real warrior :(", TALKTYPE_ORANGE_1)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())