raell5
Premium User
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() 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 vocationName = ''
if getPlayerVocation(cid) == 13-4 then
vocationName = 'Frozenhell Magician'
elseif getPlayerVocation(cid) == 14-4 then
vocationName = 'Frozenhell Shaman'
elseif getPlayerVocation(cid) == 15-4 then
vocationName = 'Frozenhell Champion'
elseif getPlayerVocation(cid) == 16-4 then
vocationName = 'Frozenhell Guardian'
else
vocationName = 'You do not match any vocation'
end
if(msgcontains(msg, 'leave')) then
if getPlayerStorageValue(cid,20008) <= 0 then
selfSay('Before I send you off, I would like to give you this small {reward} for all of your hard work.', cid)
talkState[talkUser] = 1
else
selfSay('Begone!.', cid)
doTeleportThing(cid,{x = 518, y = 840, z = 7},false)
end
elseif(msgcontains(msg, 'reward') and talkState[talkUser] == 1) then
setPlayerPromotionLevel(cid, 3)
setPlayerStorageValue(cid, 20008, 1)
selfSay('You have shown to me that you have mastered each aspect of your vocation. From this point on you may call yourself a '..vocationName..', Ask me to {leave} when you are ready.', cid)
talkState[talkUser] = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Code:
[B]After What They starling this Promotion if they die They return level 1 And Now?[/B]