I want my npc for promotion to sell only to the players to third promotion vip
note. It's the same NPC that sells the second promotion to non-vip
note. It's the same NPC that sells the second promotion to non-vip
--------I leave the script here--------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
script promotion
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})
npcHandler:addModule(FocusModule:new())
--------Script NPC--------
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Queen Eloise" script="data/npc/scripts/Sell/promotion.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="138" head="96" body="94" legs="79" feet="115" addons="0"/>
<parameters>
<parameter key="message_greet" value="LONG LIVE THE QUEEN!"/>
<parameter key="message_farewell" value="Farewell, |PLAYERNAME|!"/>
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="hail queen;job;" />
<parameter key="keyword_reply1" value="I greet thee, my loyal subject." />
<parameter key="keyword_reply2" value="I am Queen Eloise. It is my duty to reign over this marvellous city and the lands of the north." />
<parameter key="module_shop" value="1"/>
<parameter key="shop_sellable" value="" />
<parameter key="shop_buyable" value="" />
</parameters>
</npc>