What got me thinking about this in the first place was that I thought it didn't make sense that it would immediately use a charge upon arming, since in that very instant it cannot possibly reflect a spell. It would make more sense if the first charge was used after 5 seconds had passed.
I also am not certain that it should use a charge when it actually reflects a spell. (it's nearly impossible for me to tell if it does currently, but I thought it did). Derrick pasted the code for it from the demo:
Code: Select all
ONEVENT( unequip )(object unequippedfrom)
{
detachScript(unequippedfrom, "reflctor"); // Remove effect
return(0x01);
}
ONEVENT( time , "min:**" )() // once per UO minute, or 5 seconds realtime, 20 ticks
{
if(isEquipped(this))
{
object Q4E2 = containedBy(this);
if(Q4E2 == NULL())
{
return(0x01);
}
if(!Q53Z()) // Failed to consume charge?
{
detachScript(Q4E2, "reflctor");
detachScript(this, "wearrflct");
}
else // Charge was consumed
{
attachScript(Q4E2, "reflctor"); // apply (or reapply) effect
}
}
return(0x01);
}
1) Does this code above state that a charge is used upon equipping?
2) Does this code above state that a charge is used upon actually reflecting a spell?