• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Second promotion

pablo93

New Member
Joined
Dec 18, 2009
Messages
23
Reaction score
0
I'm trying to make a NPC that sells the second promotion... but it doesnt works :p
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 :D

PD: Sory for my bad english, :)
 
I suppose you haven't edited vocations.xml so..here's the working one for that..
Change this line
Code:
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.'})
to
Code:
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, promotions = {[5] = 9, [6] = 10, [7] = 11, [8] = 12}, cost = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
Also change the lvl req as how you want it
 
I suppose you haven't edited vocations.xml so..here's the working one for that..
Change this line
Code:
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.'})
to
Code:
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, promotions = {[5] = 9, [6] = 10, [7] = 11, [8] = 12}, cost = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
Also change the lvl req as how you want it

thanks, but, you know how to make that when you are not a ms, ek, rp, or ed, it says you "You have to have the first promotion to be epic promoted
 
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({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epiczise you for 20000 gold coins. Do you want me to promote 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})
	
local node2 = 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?'})
	node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, promotions = {[5] = 9, [6] = 10, [7] = 11, [8] = 12}, cost = 100000, level = 100, text = 'Congratulations! You are now promoted.'})
	node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Allright then. Come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())

I think this should work with first and second promotion.
 

Similar threads

Back
Top