Jak przerobic scrypt na npc sprzedajacego promocje, ale ktory bedzie reagowal tylko na polecenia vocation id 1,2,3,4
Chodzi mi o to aby zupełnie ignorował to co mowią do niego inne profesje,
poniewaz problem mam w tym ze zrobilem swoje nowe profesje, ale gdy one zakupia promocje to jest crash.
Ewentualnie zeby ignorowal vocations o id 9,10,11,12
Promotion.lua
Chodzi mi o to aby zupełnie ignorował to co mowią do niego inne profesje,
poniewaz problem mam w tym ze zrobilem swoje nowe profesje, ale gdy one zakupia promocje to jest crash.
Ewentualnie zeby ignorowal vocations o id 9,10,11,12
Promotion.lua
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({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, 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}) [
local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 1 gold coins. Do you want me to epicize you?'})
node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 1, level = 10, 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())