Magictibiaman
New Member
- Joined
- May 25, 2009
- Messages
- 371
- Reaction score
- 0
i want to make it so before you can get promoted you need to finish a quest, then you must go talk to the king.
i'm close waht did i do wrong? i need a better way to get the storage value.
i'm close waht did i do wrong? i need a better way to get the storage value.
Code:
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
queststatus1 = getPlayerStorageValue(player1.uid,6020)
queststatus2 = getPlayerStorageValue(player1.uid,6021)
if ((queststatus1 == 1) or (queststatus2 == 1)) then
local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote if you show me your {Certificate of Bravery}. Would you like to be promoted then?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 0, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
else
selfSay('You must complete the promotion quest before you can talk with me.', cid)
end
--[[
local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 200000 gold coins. Do you want me to epicize you?'})
node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
]]--
npcHandler:addModule(FocusModule:new())