|
@@ -398,15 +398,15 @@ implemented.
|
|
Item and pet scripts
|
|
Item and pet scripts
|
|
--------------------
|
|
--------------------
|
|
|
|
|
|
-Each item in the item database has three special fields - Script , OnEquip_Script
|
|
|
|
-and OnUnequip_Script. The first is script code run every time a character equips the item,
|
|
|
|
|
|
+Each item in the item database has three special fields - Script , EquipScript
|
|
|
|
+and UnEquipScript. The first is script code run every time a character equips the item,
|
|
with the RID of the equipping character. Every time they unequip an item, all
|
|
with the RID of the equipping character. Every time they unequip an item, all
|
|
temporary bonuses given by the script commands are cleared, and all the scripts
|
|
temporary bonuses given by the script commands are cleared, and all the scripts
|
|
are executed once again to rebuild them. This also happens in several other
|
|
are executed once again to rebuild them. This also happens in several other
|
|
situations (like upon login) but the full list is currently unknown.
|
|
situations (like upon login) but the full list is currently unknown.
|
|
|
|
|
|
-OnEquip_Script is a piece of script code run whenever the item is used by a character
|
|
|
|
-by double-clicking on it. OnUnequip_Script runs whenever the
|
|
|
|
|
|
+EquipScript is a piece of script code run whenever the item is used by a character
|
|
|
|
+by double-clicking on it. UnEquipScript runs whenever the
|
|
equipment is unequip by a character
|
|
equipment is unequip by a character
|
|
|
|
|
|
Not all script commands work properly in the item scripts. Where commands and
|
|
Not all script commands work properly in the item scripts. Where commands and
|
|
@@ -4904,7 +4904,7 @@ in <time> seconds and be automatically deleted. When receiving a rental item,
|
|
the character will receive a message in their chat window. The character will
|
|
the character will receive a message in their chat window. The character will
|
|
also receive warning messages in their chat window before the item disappears.
|
|
also receive warning messages in their chat window before the item disappears.
|
|
|
|
|
|
-When rentals expire it will call the OnUnequip Script of the item. This can be used
|
|
|
|
|
|
+When rentals expire it will call the UnEquipScript of the item. This can be used
|
|
for special cases such as removing a status change or resetting a variable or state
|
|
for special cases such as removing a status change or resetting a variable or state
|
|
of the player.
|
|
of the player.
|
|
|
|
|
|
@@ -8876,8 +8876,8 @@ You can remove an item's itemscript by leaving the itemscript argument empty.
|
|
Returns 1 on success, or 0 on fail (item_id not found or new item script is invalid).
|
|
Returns 1 on success, or 0 on fail (item_id not found or new item script is invalid).
|
|
Type can optionally be used indicates which script to set (default is 0):
|
|
Type can optionally be used indicates which script to set (default is 0):
|
|
0 - Script
|
|
0 - Script
|
|
- 1 - OnEquip_Script
|
|
|
|
- 2 - OnUnequip_Script
|
|
|
|
|
|
+ 1 - EquipScript
|
|
|
|
+ 2 - UnEquipScript
|
|
|
|
|
|
Example:
|
|
Example:
|
|
setitemscript 2637,"{ if (isequipped(2236) == 0)end; if (getskilllv(26)){skill 40,1;}else{skill 26,1+isequipped(2636);} }";
|
|
setitemscript 2637,"{ if (isequipped(2236) == 0)end; if (getskilllv(26)){skill 40,1;}else{skill 26,1+isequipped(2636);} }";
|