Okay so it gets triggered before every skill cast so you can check if you have a shield equipped etc... It recieves a value called arg1 which is the spell that is going to be cast. I also added a new function to the inventory class called isEquipped() it returns true or false if the slot you entered currently has an item in it with greater than 0 durability. The slot can be head, gloves, boots, shirt, pants, cloak, belt, shoulder, necklace, ammo, bow, rightring, leftring, rightearring, leftearring, mainhand, offhand, trinket, talisman1, talisman2, talisman3.
talisman1 is slot next to necklace
talisman2 is the first slot under necklace next to shoulder
talisman3 first slot under talisman2 next to gloves
Also with the addition of a new event I added a new test, it tests the return value to be either true of false; if it returns false then the skill that was supposed to be cast will be skipped in the rotation.
Example usage:
Code: Select all
<onPreSkillCast>
local space = "offhand"
if( arg1.Name == "KNIGHT_SHIELD_OF_ATONEMENT" or arg1.Name == "KNIGHT_WHIRLWIND_SHIELD" ) then
if( inventory:isEquipped(space) == true) then
print("Your " ..space.. " is equipped!");
return true; --Cast the skill like normal
else
print("Your " ..space.. " is'nt equipped!");
return false; --Not equipped don't cast the skill!
end
else
return true; --We are not interested in this spell so cast it like normal
end
</onPreSkillCast>
P.S. Feel free to add this to the official release just add me into the credits