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

New Promotions

JulianoSMM

Like an Angel
Joined
Jan 11, 2008
Messages
20
Reaction score
0
Location
Brazil
Hiho!

I would like to know, if someone can help me to do "news promotions". I created news vocations, "night knight", noble paladin, sprite druid, dark sorcerer. So, I need a script to use in a NEW npc, that gives promote to this vocations, but first they need have the first promotion like, elite knight... etc.. Can someone help me?

Thank you
 
Last edited:
I have no idea how to make it by the new NPC system, but I have an idea, maybe you should make a chest-quest for new promotion?

//example ;>
//put this to actions/scripts/
//and ofc add to actions with UNIQUE ID NOT ACTION
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerVocation(cid) == X then
        if item.uid == XXXX then
            doPlayerSetVocation(cid,X)
	doSendMagicEffect(fromPosition, CONST_ME_HOLYDAMAGE)
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You are now a night knight!')
        end
    else
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You already picked a new vocation!')
    end
end

in line:
Code:
    if getPlayerVocation(cid) == X then
as X write a vocation number which can use a chest

in line:
Code:
        if item.uid == YYYY then
as YYYY write unique id of the chest (in map editor)

and in line:
Code:
            doPlayerSetVocation(cid,Z)
as Z write vocation that will be set after using a chest by vocation X
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local names = { 9 = "a Someone", 10 = "a boob", 11 = "an apple", 12 = "the man" }
local voc = getPlayerVocation(cid)
    if item.uid == XXXX then
        if getPlayerStorageValue(cid, 12345) ~= 1 then
            doPlayerSetVocation(cid, voc + 4)
	    doSendMagicEffect(fromPosition, CONST_ME_MAGIC_GREEN)
            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You are now "..voc[names].."!')
        else
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You already picked a new vocation!')
        end
    end
    return TRUE
end
Every voc can use it, tried table.
 
Here is script from Roxor

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerVocation(cid) == 5 then
		doPlayerSetVocation(cid, 20)
		doCreatureSay(cid, "You are now a Super Sorcerer!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 6 then
		doPlayerSetVocation(cid, 21)
		doCreatureSay(cid, "You are now a Super Druid!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 7 then
		doPlayerSetVocation(cid, 22)
		doCreatureSay(cid, "You are now a Super Paladin!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 8 then
		doPlayerSetVocation(cid, 23)
		doCreatureSay(cid, "You are now a Super Knight!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
	end
end
 
Guys I have a big problem.

The vocations quest are working but ALL players that have the second promotion, goes to third promotion without quest!

See my vocations.xml

Code:
<vocations>
	<vocation id="0" name="None" description="none" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" 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" name="Sorcerer" description="a sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="55" gainmanaticks="3" gainmanaamount="55" manamultiplier="1.1" attackspeed="2000" 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" name="Druid" description="a druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="55" gainmanaticks="3" gainmanaamount="55" manamultiplier="1.1" attackspeed="2000" 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" name="Paladin" description="a paladin" gaincap="20" gainhp="10" gainmana="10" gainhpticks="4" gainhpamount="55" gainmanaticks="4" gainmanaamount="55" manamultiplier="1.4" attackspeed="400" 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" name="Knight" description="a knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="55" gainmanaticks="6" gainmanaamount="55" manamultiplier="3.0" attackspeed="400" 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" name="Master Sorcerer" description="a master sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="55" gainmanaticks="2" gainmanaamount="55" manamultiplier="1.1" attackspeed="1000" 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" name="Elder Druid" description="an elder druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="55" gainmanaticks="2" gainmanaamount="55" manamultiplier="1.1" attackspeed="2000" 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" name="Royal Paladin" description="a royal paladin" gaincap="20" gainhp="10" gainmana="10" gainhpticks="3" gainhpamount="55" gainmanaticks="3" gainmanaamount="55" manamultiplier="1.4" attackspeed="250" 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" name="Elite Knight" description="an elite knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="55" gainmanaticks="4" gainmanaamount="55" manamultiplier="3.0" attackspeed="200" 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>
	<vocation id="9" name="Wizard" description="a wizard" gaincap="10" gainhp="10" gainmana="40" gainhpticks="4" gainhpamount="70" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="500" 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="10" name="Shaman" description="a shaman" gaincap="10" gainhp="10" gainmana="40" gainhpticks="4" gainhpamount="70" gainmanaticks="2" gainmanaamount="70" manamultiplier="1.1" attackspeed="2000" 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="11" name="Nobleman" description="a nobleman" gaincap="20" gainhp="20" gainmana="15" gainhpticks="3" gainhpamount="70" gainmanaticks="3" gainmanaamount="70" manamultiplier="1.4" attackspeed="250" 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.2"/>
		<skill id="6" multiplier="1.2"/>
	</vocation>
	<vocation id="12" name="Legionary" description="a legionary" gaincap="25" gainhp="20" gainmana="10" gainhpticks="2" gainhpamount="70" gainmanaticks="4" gainmanaamount="70" manamultiplier="3.0" attackspeed="150" 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.2"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
</vocations>

And here, the script that I'm using in the quest

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerVocation(cid) == 5 then
        if item.uid == 65535 then
            doPlayerSetVocation(cid,9)
	doSendMagicEffect(fromPosition, CONST_ME_HOLYDAMAGE)
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You are now a Wizard!')
        end
    else
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You already picked a new vocation!')
    end
end
 
my problem is that i have the promotion and all the players can use it.. but the strongs potions and all the potions that are to specifics vocs.. dont work.. how i fix it?
 
Back
Top