X
Xikini
Guest
TFS 0.3.7_SVN (Crying Damson)
Trying to do some stuff with armor in movements but having some unexpected issues.
In our items.xml we can add all sorts of stuff beyond the initial armor and weight values.
For instance our plate armor looks something like this.
Things like weight, armor, slotType, all work.
However less common things such as speed and maxHealthPercent do not work when using a script
But they do work if using the standard function.
Getting extremely basic, we've tested simply using the functions provided from the source.
However it doesn't seem to load everything.
What I'm wondering.. is if we can use something other then return true,
in order to force it to use the regular function.. but still retain event="script"
Do something like this.. (I'm going way out of what I'm capable of)
I'm not entirely sure if this will be helpful.. but here is our movement.cpp
Hopefully someone understands what I'm trying to explain and may have a solution.
Cheers,
Xikini
Trying to do some stuff with armor in movements but having some unexpected issues.
In our items.xml we can add all sorts of stuff beyond the initial armor and weight values.
For instance our plate armor looks something like this.
Code:
<item id="2463" article="a plate armor" name="plate armor">
<attribute key="weight" value="100"/>
<attribute key="armor" value="10"/>
<attribute key="speed" value="-4"/>
<attribute key="maxHealthPercent" value="110"/>
<attribute key="slotType" value="body"/>
</item>
However less common things such as speed and maxHealthPercent do not work when using a script
But they do work if using the standard function.
Code:
<movevent type="Equip" level="1" itemid="2463" slot="armor" event="function" value="onEquipItem"/>
<movevent type="DeEquip" level="1" itemid="2463" slot="armor" event="function" value="onDeEquipItem"/>
However it doesn't seem to load everything.
Code:
<movevent type="Equip" level="1" itemid="2463" slot="armor" event="script" value="armor.lua"/>
<movevent type="DeEquip" level="1" itemid="2463" slot="armor" event="script" value="armor.lua"/>
Code:
function onDeEquip(cid, item, slot, boolean)
return true
end
function onEquip(cid, item, slot, boolean)
return true
end
What I'm wondering.. is if we can use something other then return true,
in order to force it to use the regular function.. but still retain event="script"
Do something like this.. (I'm going way out of what I'm capable of)
Code:
<movevent type="Equip" level="1" itemid="2463" slot="armor" event="script" value="armor.lua"/>
<movevent type="DeEquip" level="1" itemid="2463" slot="armor" event="script" value="armor.lua"/>
Code:
load function(onDeEquipItem)
load function(onEquipItem)
function onDeEquip(cid, item, slot, boolean)
return onDeEquipItem
end
function onEquip(cid, item, slot, boolean)
return onEquipItem
end
Hopefully someone understands what I'm trying to explain and may have a solution.
Cheers,
Xikini