• 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!

Solved King promoting to non-vocation the second time

Muzzy

New Member
Joined
Jul 8, 2008
Messages
125
Reaction score
1
Hey again,

A problem that others have had, but I didn't see anyone write out a solution they had.

XMLs I believe might be important to include:

Code:
		if(isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then
			local promotedVoc = getPromotedVocation(getPlayerVocation(cid))
			if(getPlayerStorageValue(cid, 30018) == TRUE) then
				npcHandler:say("You are already promoted!", cid)
			elseif(getPlayerLevel(cid) < parameters.level) then
				npcHandler:say("I am sorry, but I can only promote you once you have reached level " .. parameters.level .. ".", cid)
			elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
				npcHandler:say("You do not have enough money!", cid)
			else
				doPlayerSetVocation(cid, promotedVoc)
				npcHandler:say(parameters.text, cid)
			end
		else
			npcHandler:say("You need a premium account in order to get promoted.", cid)
		end
		npcHandler:resetNpc()
		return true
	end

Here's where I think the problem lies, but I don't understand anything. o.o

Code:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
	<vocation id="0" clientid="0" name="None" description="none" gaincap="10" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="0">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="2.0"/>
		<skill id="2" multiplier="2.0"/>
		<skill id="3" multiplier="2.0"/>
		<skill id="4" multiplier="2.0"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="1" clientid="3" name="Sorcerer" description="a sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="1">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="2.0"/>
		<skill id="2" multiplier="2.0"/>
		<skill id="3" multiplier="2.0"/>
		<skill id="4" multiplier="2.0"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="2" clientid="4" name="Druid" description="a druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="2">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="1.8"/>
		<skill id="2" multiplier="1.8"/>
		<skill id="3" multiplier="1.8"/>
		<skill id="4" multiplier="1.8"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="3" clientid="2" name="Paladin" description="a paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="3">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.2"/>
		<skill id="1" multiplier="1.2"/>
		<skill id="2" multiplier="1.2"/>
		<skill id="3" multiplier="1.2"/>
		<skill id="4" multiplier="1.1"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="4" clientid="1" name="Knight" description="a knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="4">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.1"/>
		<skill id="1" multiplier="1.1"/>
		<skill id="2" multiplier="1.1"/>
		<skill id="3" multiplier="1.1"/>
		<skill id="4" multiplier="1.4"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="5" clientid="3" name="Master Sorcerer" description="a master sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="1">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="2.0"/>
		<skill id="2" multiplier="2.0"/>
		<skill id="3" multiplier="2.0"/>
		<skill id="4" multiplier="2.0"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="6" clientid="4" name="Elder Druid" description="an elder druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="2">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="1.8"/>
		<skill id="2" multiplier="1.8"/>
		<skill id="3" multiplier="1.8"/>
		<skill id="4" multiplier="1.8"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="7" clientid="2" name="Royal Paladin" description="a royal paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="3">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.2"/>
		<skill id="1" multiplier="1.2"/>
		<skill id="2" multiplier="1.2"/>
		<skill id="3" multiplier="1.2"/>
		<skill id="4" multiplier="1.1"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="8" clientid="1" name="Elite Knight" description="an elite knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="4">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.1"/>
		<skill id="1" multiplier="1.1"/>
		<skill id="2" multiplier="1.1"/>
		<skill id="3" multiplier="1.1"/>
		<skill id="4" multiplier="1.4"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
		</vocation>
</vocations>

My vocations. Nothing custom here.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="King Auberon" script="data/npc/scripts/promotion.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="332" head="21" body="87" legs="107" feet="95" addons="0"/>
    <parameters>
        <parameter key="message_greet" value="Welcome to my humble keep, |PLAYERNAME|."/>
        <parameter key="message_farewell" value="Strive for the top, warrior."/>
        <parameter key="module_keywords" value="1" />
        <parameter key="keywords" value="hail king;job" />
        <parameter key="keyword_reply1" value="Welcome to my humble keep, |PLAYERNAME|." />
        <parameter key="keyword_reply2" value="I am King Auberon, protector of life and deliverer of justice. But don't let's let that cloak my altruism, friend. How can I be of help?" />

        <parameter key="module_shop" value="1"/>
        <parameter key="shop_sellable" value="" />
        <parameter key="shop_buyable" value="" />
    </parameters>
</npc>

The criminal in question.

Thanks in advance!
~Muzzy
 
Do you mean second promotion, after the first promotion master sorcerer, elder druid, royal paladin and elite knight?
You need those vocations in vocations.xml.
XML:
	<vocation id="5" clientid="3" name="Epic Master Sorcerer" description="an epic master sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="5">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="2.0"/>
		<skill id="2" multiplier="2.0"/>
		<skill id="3" multiplier="2.0"/>
		<skill id="4" multiplier="2.0"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="6" clientid="4" name="Epic Elder Druid" description="an epic elder druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="6">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="1.8"/>
		<skill id="2" multiplier="1.8"/>
		<skill id="3" multiplier="1.8"/>
		<skill id="4" multiplier="1.8"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="7" clientid="2" name="Epic Royal Paladin" description="an epic royal paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="7">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.2"/>
		<skill id="1" multiplier="1.2"/>
		<skill id="2" multiplier="1.2"/>
		<skill id="3" multiplier="1.2"/>
		<skill id="4" multiplier="1.1"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="8" clientid="1" name="Epic Elite Knight" description="an epic elite knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="8">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.1"/>
		<skill id="1" multiplier="1.1"/>
		<skill id="2" multiplier="1.1"/>
		<skill id="3" multiplier="1.1"/>
		<skill id="4" multiplier="1.4"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
Or if you don't want a second promotion, remove that option in promotion.lua.
 
Or if you don't want a second promotion, remove that option in promotion.lua.

Thanks for the answer! How do I choose to remove it? It all looks very messy to me, and I figured at least somewhere it'd say secondpromo or something.

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 = 'Shall you bestow our village with the sum of 20,000 gold, then I will promote you to match your kindness. Are you willing?'})
	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, text = 'Thank you, truly. You are now promoted, warrior.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I hope a time comes when you are.', reset = true})
 
npcHandler:addModule(FocusModule:new())
 
Change this
Lua:
		if(isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then
			local promotedVoc = getPromotedVocation(getPlayerVocation(cid))
			if(getPlayerStorageValue(cid, 30018) == TRUE) then
				npcHandler:say("You are already promoted!", cid)
			elseif(getPlayerLevel(cid) < parameters.level) then
				npcHandler:say("I am sorry, but I can only promote you once you have reached level " .. parameters.level .. ".", cid)
			elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
				npcHandler:say("You do not have enough money!", cid)
			else
				doPlayerSetVocation(cid, promotedVoc)
				npcHandler:say(parameters.text, cid)
			end
		else
			npcHandler:say("You need a premium account in order to get promoted.", cid)
		end
For this
Lua:
		if(isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then
			local promotedVoc = getPromotedVocation(getPlayerVocation(cid))
			if(getPlayerStorageValue(cid, 30018) >= 1) then
				npcHandler:say("You are already promoted!", cid)
			elseif(getPlayerLevel(cid) < parameters.level) then
				npcHandler:say("I am sorry, but I can only promote you once you have reached level " .. parameters.level .. ".", cid)
			elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
				npcHandler:say("You do not have enough money!", cid)
			else
				doPlayerSetVocation(cid, promotedVoc)
				npcHandler:say(parameters.text, cid)
				setPlayerStorageValue(cid, 30018, 1)
			end
		else
			npcHandler:say("You need a premium account in order to get promoted.", cid)
		end
 
Solved! Thanks a lot! :)

You people always impress me with how you have a solution for everything. Hat off for you, good sir.
 
Last edited:
Back
Top