xardas33
New Member
- Joined
- Jan 28, 2010
- Messages
- 83
- Reaction score
- 0
Hello guys, I have problem with my script. Npc should sell two promotions:
No voc -> Rookstayer
Rookstayer -> Legendary Rookstayer
Script working but not as it should... Look first at script:
So the problem is:
When i first time say "Promote" it's normally promoting me to rookstayer for 10,000 gp, when I second time say "Promote" it's promoting me to legendary rookstayer for 10,000 gp.
When i first time say "Legend" it's promoting me to rookstayer for 100,000 gp, when I second time say "Legend" it's promoting me normally to legendary rookstayer for 100,000 gp.
Main problem is why buying first promotion doesn't blocking promoting for 10,000 gp? Or i can be promoted both with pay 10,000 gp or 100,000 gp?
No voc -> Rookstayer
Rookstayer -> Legendary Rookstayer
Script working but not as it should... Look first at script:
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
local node1 = keywordHandler:addKeyword({'promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 10000 gold coins and you need 50 level. Do you want me to promote you?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 10000, level = 50, 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})
local node2 = keywordHandler:addKeyword({'legend'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can legendarize you for 100000 gold coins and you need 150 level.. Do you want me to legendarize you?'})
node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 100000, level = 150, promotion = 2, text = 'Congratulations! You are now legendarized.'})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
npcHandler:addModule(FocusModule:new())
So the problem is:
When i first time say "Promote" it's normally promoting me to rookstayer for 10,000 gp, when I second time say "Promote" it's promoting me to legendary rookstayer for 10,000 gp.
When i first time say "Legend" it's promoting me to rookstayer for 100,000 gp, when I second time say "Legend" it's promoting me normally to legendary rookstayer for 100,000 gp.
Main problem is why buying first promotion doesn't blocking promoting for 10,000 gp? Or i can be promoted both with pay 10,000 gp or 100,000 gp?