Difference between revisions of "ScriptEffectUpdate"

Jump to navigation Jump to search
42 bytes added ,  14:08, 1 July 2006
formatting
imported>Slserpent
(some code to accomplish constant scripted enchantments)
imported>Slserpent
(formatting)
 
 
 
Note: This block won't fire when used as a script effect for '''constant''' (apparel) enchantments. If you need a constant enchantment, you can use two scripts to accomplish the effect. Put one script on the item to have the enchantment and use the OnEquip and OnUnEquip to add and remove an ability. The script will look like this:▼
== Constant Enchantments ==
▲Note:Unfortunately, Thisthis block won't fire when used as a scriptscripted effect for '''constant''' (apparel) enchantments. If you need a constant enchantment, you can use two scripts to accomplish the effect. Put one script on the item to have the enchantment and use the OnEquip and OnUnEquip blocks to add and remove an ability. The script will look like this:
 
scriptname MyCoolConstantEnchScript
ref Wearer
beginBegin OnEquip
set Wearer to GetContainer
Wearer.AddSpell MyCoolConstantEnchAbility
End
beginBegin OnUnEquip
set Wearer to GetContainer
Wearer.RemoveSpell MyCoolConstantEnchAbility
endEnd
 
Then, you create the ability and give it a scripted effect. Use the ScriptEffectUpdate block in the script to run the scripted enchantment that you wanted for the item. Remember to code for speed, as this block will be run every frame as long as the player is near.
 
 
==See Also==
Anonymous user

Navigation menu