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

[tfs 0.3.6][Item don't change when unequiped, removed - onDeEquipItem function]

SonGoqu

New Member
Joined
Nov 27, 2008
Messages
64
Reaction score
0
I need a Slingshot that change on deEquip, but it don't work 100%, the equip function work buy on deEquip the item don't change back. This are the scripts:

items.xml


Lua:
	<item id="5907" article="a" name="slingshot"> 
		<attribute key="description" value="The powerfull Paladin Weapon."/>
		<attribute key="attack" value="100"/>
		<attribute key="weight" value="1200"/>
		<attribute key="weaponType" value="distance"/>
		<attribute key="shootType" value="smallstone"/>
		<attribute key="range" value="6"/>
		<attribute key="decayTo" value="12428" />
		<attribute key="duration" value="18000" />
		<attribute key="showduration" value="1" />
		<attribute key="transformDeEquipTo" value="12382" />
	</item>

-----------------------------------------------------------------------

	<item id="12382" article="a" name="slingshot">
		<attribute key="weight" value="1200" />
		<attribute key="transformEquipTo" value="5907" />
		<attribute key="stopduration" value="1" />
		<attribute key="showduration" value="1" />
	</item>

-----------------------------------------------------------------------

	<item id="12428" article="a" name="worn slingshot">
		<attribute key="description" value="Someone specialised in slingshots might be able to repair this for you." />
		<attribute key="weight" value="10" />
	</item>

movements.xml

Lua:
	<movevent event="Equip" itemid="5907" slot="shield" function="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="1"/>
	</movevent>
	<movevent type="DeEquip" itemid="5907" slot="shield" event="function" value="onDeEquipItem"/>
	<movevent type="Equip" itemid="12382" slot="shield" event="function" value="onEquipItem"/>

What is wrong here?
 
XML:
-
	<movevent type="Equip" itemid="12382" slot="hand" event="function" value="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="0"/>
	</movevent>
	<movevent type="DeEquip" itemid="12382" slot="hand" event="function" value="onDeEquipItem"/>
	<movevent type="Equip" itemid="5907" slot="hand" event="function" value="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="0"/>
	</movevent>
	<movevent type="DeEquip" itemid="5907" slot="hand" event="function" value="onDeEquipItem"/>
 
Last edited:
XML:
-
	<movevent type="Equip" itemid="12382" slot="hands" event="function" value="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="0"/>
	</movevent>
	<movevent type="DeEquip" itemid="12382" slot="hands" event="function" value="onEquipItem"/>
	<movevent type="Equip" itemid="5907" slot="hands" event="function" value="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="0"/>
	</movevent>
	<movevent type="DeEquip" itemid="5907" slot="hands" event="function" value="onDeEquipItem"/>

Dont't work , the item don't change back to 12382
 
both of it worked fine here, on 0.3.6 ;\

I have 0.3.6 TFS!

This script works but only change the item when it will be equipped (from 12382 to 5907), when unequipped don't change back (from 5907 to 12382). I want that this work at the same ways as for example the ring's. Your script won't work, when I try to equip the 12382 it dont hange to 5907, its still 12382.

Maybe something is wrong with the change items this are mine:

rt985566ip61k2fh9oxs.png


My script:

Lua:
	<movevent event="Equip" itemid="5907" slot="shield" function="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="1"/>
	</movevent>
	<movevent type="DeEquip" itemid="5907" slot="shield" event="function" value="onDeEquipItem"/>
	<movevent type="Equip" itemid="12382" slot="shield" event="function" value="onEquipItem"/>
 
ok how about you try it with shield as lot
XML:
-
	<movevent type="Equip" itemid="12382" slot="shield" event="function" value="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="0"/>
	</movevent>
	<movevent type="DeEquip" itemid="12382" slot="shield" event="function" value="onDeEquipItem"/>
	<movevent type="Equip" itemid="5907" slot="shield" event="function" value="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="0"/>
	</movevent>
	<movevent type="DeEquip" itemid="5907" slot="shield" event="function" value="onDeEquipItem"/>
it's a xml code, not a script
 
ok how about you try it with shield as lot
XML:
-
	<movevent type="Equip" itemid="12382" slot="shield" event="function" value="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="0"/>
	</movevent>
	<movevent type="DeEquip" itemid="12382" slot="shield" event="function" value="onDeEquipItem"/>
	<movevent type="Equip" itemid="5907" slot="shield" event="function" value="onEquipItem">
		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="0"/>
	</movevent>
	<movevent type="DeEquip" itemid="5907" slot="shield" event="function" value="onDeEquipItem"/>
it's a xml code, not a script

Thank You !!! Now it works ;) great !!!
 
I have an another problem with the equiped slingshot. When I put off the item and the put on, the left energy becomes a reset as it will be "brand new".

For example I fight with the slingshot (5907)and the energy is left for 125 minutes, then when I unequipp the shingshot (it changes to 12382 - the info is still "energy left for 125minutes") and equipp it back (it changes to 5907) then I see the Info: energy for 300 minutes (default energu). What can I do?
 
Back
Top