• 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 Scripting XML

Freezer

New Member
Joined
Mar 14, 2013
Messages
54
Reaction score
0
Location
Germany
Hiho,
I have for e.g. a XML code:

Code:
	<!-- Attack Runes -->
	<rune name="Poison Field" id="2285" allowfaruse="1" charges="3" lvl="14" maglv="0" exhaustion="2000" groups="1,2000" icon="26" blocktype="solid" event="script" value="attack/poison field.lua"/>
	<rune name="Poison Bomb" id="2286" allowfaruse="1" charges="2" lvl="25" maglv="3" exhaustion="2000" groups="1,2000" icon="91" blocktype="solid" event="script" value="attack/poison bomb.lua"/>
	<rune name="Poison Wall" id="2289" allowfaruse="1" charges="3" lvl="29" maglv="5" exhaustion="2000" groups="1,2000" icon="26" 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" groups="1,2000" icon="25" blocktype="solid" event="script" value="attack/fire field.lua"/>
	<rune name="Firebomb" id="2305" allowfaruse="1" charges="2" lvl="27" maglv="5" exhaustion="2000" groups="1,2000" icon="17" blocktype="solid" event="script" value="attack/fire bomb.lua"/>
	<rune name="Fire Wall" id="2303" allowfaruse="1" charges="3" lvl="33" maglv="6" exhaustion="2000" groups="1,2000" icon="25" blocktype="solid" event="script" value="attack/fire wall.lua"/>
	<rune name="Soulfire" id="2308" allowfaruse="1" charges="3" lvl="27" maglv="7" exhaustion="2000" groups="1,2000" icon="50" needtarget="1" blocktype="solid" event="function" value="soulfire"/>
	<rune name="Fireball" id="2302" allowfaruse="1" charges="5" lvl="27" maglv="3" exhaustion="2000" groups="1,2000" icon="15" needtarget="1" blocktype="solid" event="script" value="attack/fireball.lua"/>
	<rune name="Great Fireball" id="2304" allowfaruse="1" charges="3" lvl="30" maglv="3" exhaustion="2000" groups="1,2000" icon="16" 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" groups="1,2000" icon="27" blocktype="solid" event="script" value="attack/energy field.lua"/>
	<rune name="Energybomb" id="2262" allowfaruse="1" charges="2" lvl="37" maglv="10" exhaustion="2000" groups="1,2000" icon="55" blocktype="solid" event="script" value="attack/energy bomb.lua"/>
	<rune name="Energy Wall" id="2279" allowfaruse="1" charges="3" lvl="41" maglv="9" exhaustion="2000" groups="1,2000" icon="33" blocktype="solid" event="script" value="attack/energy wall.lua"/>
	<rune name="Light Magic Missile" id="2287" allowfaruse="1" charges="10" lvl="15" exhaustion="2000" groups="1,2000" icon="7" 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" groups="1,2000" icon="8" 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" groups="1,2000" icon="18" blocktype="solid" event="script" value="attack/explosion.lua"/>
	<rune name="Sudden Death" id="2268" allowfaruse="1" charges="3" lvl="45" maglv="15" exhaustion="2000" groups="1,2000" icon="21" needtarget="1" blocktype="solid" event="script" value="attack/sudden death.lua"/>
	<rune name="Icicle" id="2271" allowfaruse="1" charges="5" lvl="28" maglv="3" exhaustion="2000" groups="1,2000" icon="114" needtarget="1" event="script" value="attack/icicle.lua"/>
	<rune name="Avalanche" id="2274" allowfaruse="1" charges="3" lvl="30" maglv="3" exhaustion="2000" groups="1,2000" icon="115" event="script" value="attack/avalanche.lua"/>
	<rune name="Stone Shower" id="2288" allowfaruse="1" charges="3" lvl="28" maglv="3" exhaustion="2000" groups="1,2000" icon="116" event="script" value="attack/stone shower.lua"/>
	<rune name="Thunderstorm" id="2315" allowfaruse="1" charges="3" lvl="28" maglv="3" exhaustion="2000" groups="1,2000" icon="117" event="script" value="attack/thunderstorm.lua"/>
	<rune name="Stalagmite" id="2292" allowfaruse="1" charges="10" lvl="24" maglv="3" exhaustion="2000" groups="1,2000" icon="77" needtarget="1" event="script" value="attack/stalagmite.lua"/>
	<rune name="Holy Missile" id="2295" allowfaruse="1" charges="5" lvl="27" maglv="3" exhaustion="2000" groups="1,2000" icon="130" needtarget="1" blocktype="solid" event="script" value="attack/holy missile.lua">
		<vocation name="Paladin"/>
		<vocation id="7" showInDescription="0"/>
	</rune>


As you can see there is everywhere a -> exhaustion="2000" <-
Is it possible to set exhaustion="VARIABLE1" ?
I know it from programming C you could say at the beginning int a=5; and then you can operate with the variable like y=a+a;
Do you know what I mean? I don't want to change 5000 code entrys to set the general exhausion time for like "healing class".
 
Last edited by a moderator:
No, don't think there's a simple way like in other programming languages.
Though, you can use styles.

For example, I have this at the top (within the <spell> scope)
XML:
<style name="ex">
  <item name="ex">400</item>
</style>

Then for a spell, I have this:
XML:
<instant name="Death Strike" words="exori mort" lvl="16" mana="20" prem="1" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="@style/ex" groups="1,2000" icon="87" needlearn="0" event="script" value="attack/death strike.lua">
        <vocation id="1"/>
        <vocation id="5"/>
    </instant>

This works, I have used it before.
 
Thank you for the fast reply.
It's not working for me. But this has maybe other reasons.
When I don't use your script and add manually for e.g. exhaustion="100" to sd rune it doesnt change anything :O

And yes, I saved the file and restarted the server :p

I use TFS 0.3.7 crying damson
 

You Can tell me How i can FIx This
[26/02/2016 14:12:52] Warning: [Monsters::loadMonster]. Missing summons.maxSummons. data/monster/Ferumbras.xml
[26/02/2016 14:12:52] Warning: [Monsters::loadMonster]. Missing summons.maxSummons. data/monster/Demon.xml
[26/02/2016 14:12:52] Warning: [Monsters::loadMonster]. Missing summons.maxSummons. data/monster/Necromancer.xml
[26/02/2016 14:12:52] Warning: [Monsters::loadMonster]. Missing summons.maxSummons. data/monster/Orshabaal.xml
[26/02/2016 14:12:52] Warning: [Monsters::loadMonster]. Missing summons.maxSummons. data/monster/Demonic Emperor.xml
[26/02/2016 14:12:52] Warning: [Monsters::loadMonster]. Missing summons.maxSummons. data/monster/Priestess.xml
 
Back
Top