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

TalkAction Second Promotion

Status
Not open for further replies.
Im having the same problem it when i promote the value for vocations change to 0
 
Read the first post; carefully.
 
It wasn't working...
and I can't test scripts myself.

So until I get my computer back, I won't release it.
 
How can I do, for example My elite knight (Vocation ID 8) can promote into ID 15 or 16. I can work different NPCs but the NPChandler doesn't seem to allow me to branch and choose either or, and only seems to work with Promotion="2" as 8 to 12 for example. Any way to change that? or set an alternate Promotion="3" or "4" to allow me to make those vocations native to that level of promotion?

I'm using an action on an item as of now, but it doesn't seem to save because of the Promotion "system" in the npchandler module/sql. Whenever the players log out, it seems to make it back to their original promoted vocation on login.

Here's the code I'm using.

Code:
 function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerVocation(cid) == 8 then
        doPlayerSetVocation(cid, 15)
        doCreatureSay(cid, "You are now a berserker!", TALKTYPE_ORANGE_1)
    else
        doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
    end
end

I've also tried adding
Code:
 doPlayerSetPromotionLevel(cid, 2)
but it makes my vocation 0 on next login.
 
Look at my script...
Lua:
setPlayerPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1)

@Topic,
Yes, I know surely someone is going to try to make this script better & smaller.
But don't, seriously...It is annoying. Make your own thread if you want to post a script.
 
@ JDB

It worked! one issue, however.

All my elite knights get promoted to voc id 15 using this. How can I make them become voc id 16? promotion +2?
 
Last edited:
@Up,
Yes, or change { 5, 6, 7, 8 } to { 9, 10, 11, 12 }.
So if they are Voc 9, then they can only use this.
 
edit i took the npc promotion in the thread it works when saying epic but that will only change your promotion id to 2 and then somehow your voc gets changed automaticly to 0 not to 9 or 10 or 11 or 12 the slayer vocs.
When I tried give manually voc 10 (slayer sorcerer) to a guy in my server it said something about cannot find voc 46594859376 many numbers.
And server got real laggy and i had to restart.
please help

Look at Action: [WORKING] Second Promotion - OpenTibia Fans i solved this problem and released my script
 
Hmm, I updated the script, does anyone mind testing it? :huh:
 
I did the whole thing on my own.

First was, creating a NPC that gives the second promotion:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="The King" script="promotion.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="332" head="20" body="39" legs="45" feet="7" addons="0"/>
</npc>

And the script:
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 = 'I can promote you for 20.000 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})

local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 1.000.000 gold coins. Do you want me to epicize you?'})
	node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 1000000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'})
	node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})


npcHandler:addModule(FocusModule:new())

(Yes, it's the TFS script)

Now you have to edit the whole spell list!
I did it for you! Here:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<spells>
	<!-- Attack Runes -->
	<rune name="Poison Field" id="2285" allowfaruse="1" charges="3" lvl="14" maglv="0" exhaustion="2000" blocktype="solid" event="script" value="attack/poison field.lua"/>
	<rune name="Poison Bomb" id="2286" allowfaruse="1" charges="2" lvl="25" maglv="4" exhaustion="2000" blocktype="solid" event="script" value="attack/poison bomb.lua"/>
	<rune name="Poison Wall" id="2289" allowfaruse="1" charges="4" lvl="29" maglv="5" exhaustion="2000" blocktype="solid" event="script" value="attack/poison wall.lua"/>
	<rune name="Fire Field" id="2301" allowfaruse="1" charges="3" lvl="15" maglv="1" exhaustion="2000" blocktype="solid" event="script" value="attack/fire field.lua"/>
	<rune name="Firebomb" id="2305" allowfaruse="1" charges="2" lvl="27" maglv="5" exhaustion="2000" blocktype="solid" event="script" value="attack/fire bomb.lua"/>
	<rune name="Fire Wall" id="2303" allowfaruse="1" charges="4" lvl="33" maglv="6" exhaustion="2000" blocktype="solid" event="script" value="attack/fire wall.lua"/>
	<rune name="Soulfire" id="2308" allowfaruse="1" charges="3" lvl="27" maglv="7" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="attack/soul fire.lua"/>
	<rune name="Fireball" id="2302" allowfaruse="1" charges="5" lvl="27" maglv="4" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="attack/fireball.lua"/>
	<rune name="Great Fireball" id="2304" allowfaruse="1" charges="4" lvl="30" maglv="4" exhaustion="2000" blocktype="solid" event="script" value="attack/great fireball.lua"/>
	<rune name="Energy Field" id="2277" allowfaruse="1" charges="3" lvl="18" maglv="3" exhaustion="2000" blocktype="solid" event="script" value="attack/energy field.lua"/>
	<rune name="Energybomb" id="2262" allowfaruse="1" charges="2" lvl="37" maglv="10" exhaustion="2000" blocktype="solid" event="script" value="attack/energy bomb.lua"/>
	<rune name="Energy Wall" id="2279" allowfaruse="1" charges="4" lvl="41" maglv="9" exhaustion="2000" blocktype="solid" event="script" value="attack/energy wall.lua"/>
	<rune name="Light Magic Missile" id="2287" allowfaruse="1" charges="10" lvl="15" exhaustion="2000" maglv="0" needtarget="1" blocktype="solid" event="script" value="attack/light magic missile.lua"/>
	<rune name="Heavy Magic Missile" id="2311" allowfaruse="1" charges="10" lvl="25" exhaustion="2000" maglv="3" needtarget="1" blocktype="solid" event="script" value="attack/heavy magic missile.lua"/>
	<rune name="Explosion" id="2313" allowfaruse="1" charges="6" lvl="31" maglv="6" exhaustion="2000" blocktype="solid" event="script" value="attack/explosion.lua"/>
	<rune name="Sudden Death" id="2268" allowfaruse="1" charges="3" lvl="45" maglv="15" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="attack/sudden death.lua"/>
	<rune name="Icicle" id="2271" allowfaruse="1" charges="5" lvl="28" maglv="4" exhaustion="2000" needtarget="1" event="script" value="attack/icicle.lua"/>
	<rune name="Avalanche" id="2274" allowfaruse="1" charges="4" lvl="30" maglv="4" exhaustion="2000" event="script" value="attack/avalanche.lua"/>
	<rune name="Stone Shower" id="2288" allowfaruse="1" charges="4" lvl="28" maglv="4" exhaustion="2000" event="script" value="attack/stone shower.lua"/>
	<rune name="Thunderstorm" id="2315" allowfaruse="1" charges="4" lvl="28" maglv="4" exhaustion="2000" event="script" value="attack/thunderstorm.lua"/>
	<rune name="Stalagmite" id="2292" allowfaruse="1" charges="10" lvl="24" maglv="3" exhaustion="2000" needtarget="1" event="script" value="attack/stalagmite.lua"/>
	<rune name="Holy Missile" id="2295" allowfaruse="1" charges="5" lvl="27" maglv="4" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="attack/holy missile.lua">
		<vocation id="3"/>
		<vocation id="7" showInDescription="0"/>
	</rune>
	<rune name="Epic SD" id="2263" allowfaruse="1" charges="5" lvl="120" maglv="50" exhaustion="1300" needtarget="1" blocktype="solid" event="script" value="attack/epic sd.lua">
		<vocation id="9"/>
		<vocation id="10"/>
	</rune>

	<!-- Healing Runes -->
	<rune name="Antidote Rune" id="2266" allowfaruse="1" charges="1" lvl="15" maglv="0" exhaustion="1000" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/antidote rune.lua"/>
	<rune name="Intense Healing Rune" id="2265" allowfaruse="1" charges="1" lvl="15" maglv="1" exhaustion="1000" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/intense healing rune.lua"/>
	<rune name="Ultimate Healing Rune" id="2273" allowfaruse="1" charges="1" lvl="24" maglv="4" exhaustion="1000" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/ultimate healing rune.lua"/>

	<!-- Summon Runes -->
	<rune name="Convince Creature" id="2290" allowfaruse="1" charges="1" lvl="16" maglv="5" exhaustion="2000" needtarget="1" blocktype="solid" event="function" value="convince"/>
	<rune name="Animate Dead" id="2316" allowfaruse="1" charges="1" lvl="27" maglv="4" exhaustion="2000" blocktype="solid" event="script" value="summon/animate dead rune.lua"/>

	<!-- Support Runes -->
	<rune name="Desintegrate" id="2310" allowfaruse="0" charges="3" lvl="21" maglv="4" exhaustion="2000" range="1" event="script" value="support/desintegrate rune.lua"/>
	<rune name="Destroy Field" id="2261" allowfaruse="1" charges="3" lvl="17" maglv="3" exhaustion="1000" aggressive="0" range="5" event="script" value="support/destroy field rune.lua"/>
	<rune name="Chameleon" id="2291" allowfaruse="1" charges="1" lvl="27" maglv="4" exhaustion="1000" aggressive="0" selftarget="1" blocktype="solid" event="function" value="chameleon"/>
	<rune name="Magic Wall" id="2293" allowfaruse="1" charges="3" lvl="32" maglv="9" exhaustion="2000" blocktype="all" event="script" value="support/magic wall rune.lua"/>
	<rune name="Wild Growth" id="2269" allowfaruse="1" charges="2" lvl="27" maglv="8" exhaustion="2000" blocktype="all" event="script" value="support/wild growth rune.lua">
		<vocation id="2"/>
		<vocation id="6" showInDescription="0"/>
	</rune>
	<rune name="Paralyze" id="2278" allowfaruse="1" charges="1" lvl="54" maglv="18" exhaustion="2000" mana="1400" needtarget="1" blocktype="solid" event="script" value="support/paralyze rune.lua">
		<vocation id="2"/>
		<vocation id="6" showInDescription="0"/>
	</rune>

	<!-- Attack Spells -->
	<instant name="Death Strike" words="exori mort" lvl="16" mana="20" prem="1" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="attack/death strike.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</instant>
	<instant name="Flame Strike" words="exori flam" lvl="12" mana="20" prem="1" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="attack/flame strike.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</instant>
	<instant name="Energy Strike" words="exori vis" lvl="12" mana="20" prem="1" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="attack/energy strike.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</instant>
	<instant name="Whirlwind Throw" words="exori hur" lvl="15" mana="40" prem="1" range="5" needtarget="1" blockwalls="1" needweapon="1" exhaustion="2000" needlearn="0" event="script" value="attack/whirlwind throw.lua">
		<vocation id="4"/>
		<vocation id="8"/>
		<vocation id="12"/>
	</instant>
	<instant name="Fire Wave" words="exevo flam hur" lvl="18" mana="25" direction="1" exhaustion="2000" needlearn="0" event="script" value="attack/fire wave.lua">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</instant>
	<instant name="Ethereal Spear" words="exori con" lvl="23" mana="35" prem="1" range="5" needtarget="1" exhaustion="2000" blockwalls="1" needlearn="0" event="script" value="attack/ethereal spear.lua">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</instant>
	<instant name="Energy Beam" words="exevo vis lux" lvl="23" mana="40" direction="1" exhaustion="2000" needlearn="0" event="script" value="attack/energy beam.lua">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</instant>
	<instant name="Great Energy Beam" words="exevo gran vis lux" lvl="29" mana="110" direction="1" exhaustion="2000" needlearn="0" event="script" value="attack/great energy beam.lua">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</instant>
	<instant name="Groundshaker" words="exori mas" lvl="33" mana="160" prem="1" needweapon="1" exhaustion="2000" needlearn="0" event="script" value="attack/groundshaker.lua">
		<vocation id="4"/>
		<vocation id="8"/>
		<vocation id="12"/>
	</instant>
	<instant name="Berserk" words="exori" lvl="35" mana="115" prem="1" needweapon="1" exhaustion="2000" needlearn="0" event="script" value="attack/berserk.lua">
		<vocation id="4"/>
		<vocation id="8"/>
		<vocation id="12"/>	
	</instant>
	<instant name="Energy Wave" words="exevo vis hur" lvl="38" mana="170" direction="1" exhaustion="2000" needlearn="0" event="script" value="attack/energy wave.lua">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</instant>
	<instant name="Rage of the Skies" words="exevo gran mas vis" lvl="55" mana="650" selftarget="1" prem="1" exhaustion="2000" needlearn="0" event="script" value="attack/rage of the skies.lua">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</instant>
	<instant name="Fierce Berserk" words="exori gran" lvl="70" mana="340" prem="1" needweapon="1" exhaustion="2000" needlearn="0" event="script" value="attack/fierce berserk.lua">
		<vocation id="4"/>
		<vocation id="8"/>
		<vocation id="12"/>
	</instant>
		<instant name="Hells Core" words="exevo gran mas flam" lvl="60" mana="1200" prem="1" exhaustion="2000" selftarget="1" needlearn="0" event="script" value="attack/hells core.lua">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</instant>
	<instant name="Divine Missile" words="exori san" lvl="40" mana="20" prem="1" range="4" casterTargetOrDirection="1" needlearn="0" blockwalls="1" exhaustion="2000" event="script" value="attack/divine missile.lua">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</instant>
	<instant name="Divine Caldera" words="exevo mas san" lvl="50" mana="160" prem="1" selftarget="1" exhaustion="2000" needlearn="0" event="script" value="attack/divine caldera.lua">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</instant>
	<instant name="Eternal Winter" words="exevo gran mas frigo" lvl="60" mana="1200" prem="1" selftarget="1" exhaustion="2000" needlearn="0" event="script" value="attack/eternal winter.lua">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</instant>
	<instant name="Ice Strike" words="exori frigo" lvl="15" mana="20" prem="1" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="attack/ice strike.lua">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</instant>
	<instant name="Ice Wave" words="exevo frigo hur" lvl="18" mana="25" direction="1" exhaustion="2000" needlearn="0" event="script" value="attack/ice wave.lua">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</instant>
	<instant name="Terra Strike" words="exori tera" lvl="13" mana="20" prem="1" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="attack/terra strike.lua">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	
	</instant>
	<instant name="Terra Wave" words="exevo tera hur" lvl="38" mana="210" direction="1" exhaustion="2000" needlearn="0" event="script" value="attack/terra wave.lua">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</instant>
	<instant name="Wrath of Nature" words="exevo gran mas tera" lvl="55" mana="770" prem="1" selftarget="1" exhaustion="2000" needlearn="0" event="script" value="attack/wrath of nature.lua">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</instant>

	<!-- Healing Spells -->
	<instant name="Light Healing" words="exura" lvl="9" mana="20" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="healing/light healing.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
		<vocation id="12"/>
	</instant>
	<instant name="Antidote" words="exana pox" lvl="10" mana="30" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="healing/antidote.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
		<vocation id="12"/>
	</instant>
	<instant name="Intense Healing" words="exura gran" lvl="11" mana="70" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="healing/intense healing.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="9"/>
		<vocation id="10"/>
	
	</instant>
	<instant name="Heal Friend" words="exura sio" lvl="18" mana="140" prem="1" aggressive="0" needtarget="1" params="1" exhaustion="2000" needlearn="0" event="script" value="healing/heal friend.lua">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</instant>
	<instant name="Ultimate Healing" words="exura vita" lvl="20" mana="160" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="healing/ultimate healing.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
	</instant>
	<instant name="Mass Healing" words="exura gran mas res" lvl="36" mana="150" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="healing/mass healing.lua">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</instant>
	<instant name="Divine Healing" words="exura san" lvl="35" mana="210" prem="1" selftarget="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="healing/divine healing.lua">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</instant>
	<instant name="Wound Cleansing" words="exana mort" lvl="30" mana="65" prem="1" selftarget="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="healing/wound cleasing.lua">
		<vocation id="4"/>
		<vocation id="8"/>
		<vocation id="12"/>
	</instant>

	<!-- Support Spells -->
	<instant name="Light" words="utevo lux" lvl="8" mana="20" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/light.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
		<vocation id="12"/>
	</instant>
	<instant name="Find Person" words="exiva" lvl="8" mana="20" aggressive="0" params="1" exhaustion="1000" needlearn="0" event="function" value="searchPlayer">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
		<vocation id="12"/>
	</instant>
	<instant name="Magic Rope" words="exani tera" lvl="9" mana="20" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/magic rope.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
		<vocation id="12"/>
	</instant>
	<instant name="Levitate" words="exani hur" lvl="12" mana="50" prem="1" aggressive="0" exhaustion="1000" params="1" needlearn="0" event="function" value="Levitate">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
		<vocation id="12"/>
	</instant>
	<instant name="Great Light" words="utevo gran lux" lvl="13" mana="60" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/great light.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
		<vocation id="12"/>
	</instant>
	<instant name="Magic Shield" words="utamo vita" lvl="14" mana="50" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/magic shield.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
	</instant>
	<instant name="Haste" words="utani hur" lvl="14" mana="60" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/haste.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
		<vocation id="12"/>
	</instant>
	<instant name="Charge" words="utani tempo hur" lvl="25" mana="100" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/charge.lua">
		<vocation id="4"/>
		<vocation id="8"/>
		<vocation id="12"/>
	</instant>
	<instant name="Swift Foot" words="utamo tempo san" lvl="55" mana="400" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/swift foot.lua">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</instant>
	<instant name="Challenge" words="exeta res" lvl="20" mana="30" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="support/challenge.lua">
		<vocation id="8"/>
		<vocation id="12"/>
	</instant>
	<instant name="Strong Haste" words="utani gran hur" lvl="20" mana="100" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/strong haste.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</instant>
	<instant name="Creature Illusion" words="utevo res ina" lvl="23" mana="100" aggressive="0" params="1" exhaustion="1000" needlearn="0" event="function" value="Illusion">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</instant>
	<instant name="Ultimate Light" words="utevo vis lux" lvl="26" mana="140" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/ultimate light.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</instant>
	<instant name="Cancel Invisibility" words="exana ina" lvl="26" mana="200" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/cancel invisibility.lua">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</instant>
	<instant name="Invisibility" words="utana vid" lvl="35" mana="440" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/invisible.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
	</instant>
	<instant name="Sharpshooter" words="utito tempo san" lvl="60" mana="450" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/sharpshooter.lua">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</instant>
	<instant name="Protector" words="utamo tempo" lvl="55" mana="200" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/protector.lua">
		<vocation id="4"/>
		<vocation id="8"/>
		<vocation id="12"/>
	</instant>
	<instant name="Blood Rage" words="utito tempo" lvl="60" mana="290" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="support/blood rage.lua">
		<vocation id="4"/>
		<vocation id="8"/>
		<vocation id="12"/>
	</instant>

	<!-- Party Spells -->
	<instant name="Train Party" words="utito mas sio" lvl="32" mana="60" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="party/train.lua">
		<vocation id="8"/>
		<vocation id="12"/>
	</instant>
	<instant name="Protect Party" words="utamo mas sio" lvl="32" mana="90" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="party/protect.lua">
		<vocation id="7"/>
		<vocation id="11"/>
	</instant>
	<instant name="Heal Party" words="utura mas sio" lvl="32" mana="120" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="party/heal.lua">
		<vocation id="6"/>
		<vocation id="10"/>
	</instant>
	<instant name="Enchant Party" words="utori mas sio" lvl="32" mana="120" prem="1" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="party/enchant.lua">
		<vocation id="5"/>
		<vocation id="9"/>
	</instant>

	<!-- Summon Spells -->
	<instant name="Summon Creature" words="utevo res" lvl="25" params="1" exhaustion="2000" needlearn="0" event="function" value="summonMonster">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</instant>
	<instant name="Undead Legion" words="exana mas mort" lvl="30" mana="500" prem="1" exhaustion="2000" needlearn="0" event="script" value="summon/undead legion.lua">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</instant>

	<!-- Conjure Spells -->
	<conjure name="Conjure Arrow" words="exevo con" lvl="13" mana="100" soul="1" conjureId="2544" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Food" words="exevo pan" lvl="14" mana="120" soul="1" exhaustion="1000" needlearn="0" event="function" value="conjureFood">
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="10"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Poisoned Arrow" words="exevo con pox" lvl="16" mana="130" soul="2" conjureId="2545" conjureCount="7" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Conjure Bolt" words="exevo con mort" lvl="17" mana="140" soul="2" prem="1" conjureId="2543" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Conjure Sniper Arrow" words="exevo con hur" lvl="24" mana="160" soul="3" prem="1" conjureId="7364" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Explosive Arrow" words="exevo con flam" lvl="25" mana="290" soul="3" conjureId="2546" conjureCount="8" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Conjure Piercing Bolt" words="exevo con grav" lvl="33" mana="180" soul="3" prem="1" conjureId="7363" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Enchant Staff" words="exeta vis" lvl="41" mana="80" prem="1" conjureId="2433" reagentId="2401" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
		<vocation id="5"/>
		<vocation id="9"/>
	</conjure>
	<conjure name="Enchant Spear" words="exeta con" lvl="45" mana="350" soul="3" prem="1" conjureId="7367" reagentId="2389" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Power Bolt" words="exevo con vis" lvl="59" mana="800" soul="4" prem="1" conjureId="2547" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
		<vocation id="7"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Poison Field" words="adevo grav pox" lvl="14" mana="200" soul="1" reagentId="2260" conjureId="2285" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Light Magic Missile" words="adori min vis" lvl="15" mana="120" soul="1" reagentId="2260" conjureId="2287" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Fire Field" words="adevo grav flam" lvl="15" mana="240" soul="1" reagentId="2260" conjureId="2301" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Fireball" words="adori flam" lvl="27" mana="460" soul="3" prem="1" reagentId="2260" conjureId="2302" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</conjure>
	<conjure name="Energy Field" words="adevo grav vis" lvl="18" mana="320" soul="2" reagentId="2260" conjureId="2277" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Stalagmite" words="adori tera" lvl="24" mana="400" soul="2" prem="2" reagentId="2260" conjureId="2292" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Great Fireball" words="adori mas flam" lvl="30" mana="530" soul="3" reagentId="2260" conjureId="2304" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</conjure>
	<conjure name="Heavy Magic Missile" words="adori vis" lvl="25" mana="350" soul="2" reagentId="2260" conjureId="2311" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Poison Bomb" words="adevo mas pox" lvl="25" mana="520" soul="2" prem="1" reagentId="2260" conjureId="2286" conjureCount="2" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Firebomb" words="adevo mas flam" lvl="27" mana="600" soul="4" reagentId="2260" conjureId="2305" conjureCount="2" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Soulfire" words="adevo res flam" lvl="27" mana="600" soul="3" prem="1" reagentId="2260" conjureId="2308" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Poison Wall" words="adevo mas grav pox" lvl="29" mana="640" soul="3" reagentId="2260" conjureId="2289" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Explosion" words="adevo mas hur" lvl="31" mana="570" soul="4" reagentId="2260" conjureId="2313" conjureCount="6" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Fire Wall" words="adevo mas grav flam" lvl="33" mana="780" soul="4" reagentId="2260" conjureId="2303" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Energybomb" words="adevo mas vis" lvl="37" mana="880" soul="5" prem="1" reagentId="2260" conjureId="2262" conjureCount="2" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</conjure>
	<conjure name="Energy Wall" words="adevo mas grav vis" lvl="41" mana="1000" soul="5" reagentId="2260" conjureId="2279" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Sudden Death" words="adori gran mort" lvl="45" mana="985" soul="5" reagentId="2260" conjureId="2268" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</conjure>
	<conjure name="Antidote Rune" words="adana pox" lvl="15" mana="200" soul="1" reagentId="2260" conjureId="2266" conjureCount="1" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Intense Healing Rune" words="adura gran" lvl="15" mana="240" soul="2" reagentId="2260" conjureId="2265" conjureCount="1" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Ultimate Healing Rune" words="adura vita" lvl="24" mana="400" soul="3" reagentId="2260" conjureId="2273" conjureCount="1" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Convince Creature" words="adeta sio" lvl="16" mana="200" soul="3" reagentId="2260" conjureId="2290" conjureCount="1" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Animate Dead" words="adana mort" lvl="27" mana="600" soul="5" prem="1" reagentId="2260" conjureId="2316" conjureCount="1" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="9"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Chameleon" words="adevo ina" lvl="27" mana="600" soul="2" reagentId="2260" conjureId="2291" conjureCount="1" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Destroy Field" words="adito grav" lvl="17" mana="120" soul="2" reagentId="2260" conjureId="2261" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Desintegrate" words="adito tera" lvl="21" mana="200" soul="3" prem="1" reagentId="2260" conjureId="2310" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="9"/>
		<vocation id="10"/>
		<vocation id="11"/>
	</conjure>
	<conjure name="Magic Wall" words="adevo grav tera" lvl="32" mana="750" soul="5" prem="1" reagentId="2260" conjureId="2293" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</conjure>
	<conjure name="Wild Growth" words="adevo grav vita" lvl="27" mana="600" soul="5" prem="1" reagentId="2260" conjureId="2269" conjureCount="2" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Paralyze" words="adana ani" lvl="54" mana="1400" soul="3" prem="1" reagentId="2260" conjureId="2278" conjureCount="1" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Icicle" words="adori frigo" lvl="28" mana="460" soul="3" prem="1" reagentId="2260" conjureId="2271" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Avalanche" words="adori mas frigo" lvl="30" mana="530" soul="3" reagentId="2260" conjureId="2274" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Stone Shower" words="adori mas tera" lvl="28" mana="430" soul="3" prem="1" reagentId="2260" conjureId="2288" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="2"/>
		<vocation id="6"/>
		<vocation id="10"/>
	</conjure>
	<conjure name="Thunderstorm" words="adori mas vis" lvl="28" mana="430" soul="3" prem="1" reagentId="2260" conjureId="2315" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="1"/>
		<vocation id="5"/>
		<vocation id="9"/>
	</conjure>
	<conjure name="Holy Missile" words="adori san" lvl="27" mana="350" soul="3" prem="1" reagentId="2260" conjureId="2295" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
		<vocation id="3"/>
		<vocation id="7"/>
		<vocation id="9"/>
	</conjure>
</spells>


Also you have to edit the actions, like potions:

Code:
local config = {
	removeOnUse = "yes",
	splashable = "no",
	realAnimation = "yes", -- make text effect visible only for players in range 1x1
	healthMultiplier = 1.1,
	manaMultiplier = 1.3
}

config.removeOnUse = getBooleanFromString(config.removeOnUse)
config.splashable = getBooleanFromString(config.splashable)
config.realAnimation = getBooleanFromString(config.realAnimation)

local POTIONS = {
	[8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion
	[7618] = {empty = 7636, splash = 2, health = {170, 270}}, -- health potion
	[7588] = {empty = 7634, splash = 2, health = {250, 450}, level = 50, vocations = {3, 4, 7, 8, 11, 12}, vocStr = "knights and paladins"}, -- strong health potion
	[7591] = {empty = 7635, splash = 2, health = {550, 750}, level = 80, vocations = {4, 8, 12}, vocStr = "knights"}, -- great health potion
	[8473] = {empty = 7635, splash = 2, health = {850, 1050}, level = 130, vocations = {4, 8, 12}, vocStr = "knights"}, -- ultimate health potion

	[7620] = {empty = 7636, splash = 7, mana = {120, 230}}, -- mana potion
	[7589] = {empty = 7634, splash = 7, mana = {210, 300}, level = 50, vocations = {1, 2, 3, 5, 6, 7, 9, 10, 11}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion
	[7590] = {empty = 7635, splash = 7, mana = {300, 400}, level = 80, vocations = {1, 2, 5, 6, 9, 10}, vocStr = "sorcerers and druids"}, -- great mana potion

	[8472] = {empty = 7635, splash = 3, health = {200, 400}, mana = {110, 190}, level = 80, vocations = {3, 7, 11}, vocStr = "paladins"} -- great spirit potion
}

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local potion = POTIONS[item.itemid]
	if(not potion) then
		return false
	end

	if(not isPlayer(itemEx.uid)) then
		if(not config.splashable) then
			return false
		end

		if(toPosition.x == CONTAINER_POSITION) then
			toPosition = getThingPos(item.uid)
		end

		doDecayItem(doCreateItem(2016, potion.splash, toPosition))
		doTransformItem(item.uid, potion.empty)
		return true
	end

	if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return true
	end

	if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and
		not getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges))
	then
		doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1)
		return true
	end

	local health = potion.health
	if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then
		return false
	end

	local mana = potion.mana
	if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then
		return false
	end

	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	if(not realAnimation) then
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
	else
		for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do
			if(isPlayer(tid)) then
				doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid)
			end
		end
	end

	doAddCondition(cid, exhaust)
	if(not potion.empty or config.removeOnUse) then
		doRemoveItem(item.uid)
		return true
	end

	doTransformItem(item.uid, potion.empty)
	return true
end

healthMultiplier = 1.1,
manaMultiplier = 1.3
Can be changed!
 
Status
Not open for further replies.

Similar threads

Back
Top