AurianaValoria1 Posted July 21, 2011 Share Posted July 21, 2011 I'm working with this Varla Stone Script, and I want to add a line that makes it essentially "cursed." It functions as normal, but knocks off half of the player's health to recharge items. What would I put and where would I add it? scriptname AV1VarlaStoneScript ref container ref item ref base short max short charge Begin OnEquip let container := PlayerRef ForEach (item <- container) let base := item.GetBaseObject let max := GetObjectCharge base if (item.GetCurrentCharge < max) item.SetCurrentCharge max let charge := 1 endif loop if (charge == 1) Message "You have used a Varla Stone's power to restore your enchanted items charge, and now it is gone." PlaySound ITMWelkyndStoneUse RemoveMe else Message "Your equipment is fully charged." endif End Link to comment Share on other sites More sharing options...
fg109 Posted July 22, 2011 Share Posted July 22, 2011 Change the script to this: scriptname AV1VarlaStoneScript ref container ref item ref base float hpdrain short max short charge Begin OnEquip let container := PlayerRef ForEach (item <- container) let base := item.GetBaseObject let max := GetObjectCharge base if (item.GetCurrentCharge < max) item.SetCurrentCharge max let charge := 1 endif loop if (charge == 1) Message "You have used a Varla Stone's power to restore your enchanted items charge, and now it is gone." PlaySound ITMWelkyndStoneUse let hpdrain := (Player.GetBaseAV Health) / (-2) Player.ModAV2 Health hpdrain RemoveMe else Message "Your equipment is fully charged." endif End Link to comment Share on other sites More sharing options...
AurianaValoria1 Posted July 22, 2011 Author Share Posted July 22, 2011 Your name is definitely going in the credits of this mod. :) Thank you again! :D Link to comment Share on other sites More sharing options...
Recommended Posts