I'm trying to make a NPC that sells the second promotion... but it doesnt works ![Stick Out Tongue :p :p](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
This is my script:
NPC The King.XML:
SCRIPT epic2.LUA
I want that this NPC:
-sells you the second promotion (epic elite knight, epic elder druid, epic master sorcerer, epic royal paladin), and requires before to be a master sorc, elite knight, royal paladin, or elder druid, for buy this epic promotion.
And if you are not a ms, ek, rp, or ed, it says you "You have to have the first promotion to be epic promoted
-this npc sells this promotion only for PREMIUM players, and if you are a FACC player, it says to you "You need PACC to buy this promotion)
Thanks... if you need to create your own script to make this npc, go ahead![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
PD: Sory for my bad english,![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
This is my script:
NPC The King.XML:
Code:
<npc name="The King" script="data/npc/scripts/epic2.lua" walkinterval="2000" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="137" head="140" body="64" legs="121" feet="76" corpse="2212"/>
<parameters>
<parameter key="message_farewell" value="Farewell |PLAYERNAME|!" />
</parameters>
</npc>
SCRIPT epic2.LUA
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
local node1 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epiczise you for 100000 gold coins. Do you want me to epiczise you?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, promotions = {[1] = 5, [2] = 6, [3] = 7, [4] = 8}, cost = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Allright then. Come back when you are ready.', reset = true})
npcHandler:addModule(FocusModule:new())
I want that this NPC:
-sells you the second promotion (epic elite knight, epic elder druid, epic master sorcerer, epic royal paladin), and requires before to be a master sorc, elite knight, royal paladin, or elder druid, for buy this epic promotion.
And if you are not a ms, ek, rp, or ed, it says you "You have to have the first promotion to be epic promoted
-this npc sells this promotion only for PREMIUM players, and if you are a FACC player, it says to you "You need PACC to buy this promotion)
Thanks... if you need to create your own script to make this npc, go ahead
PD: Sory for my bad english,