wilwhitt56 Posted June 3, 2021 Share Posted June 3, 2021 Hello, im trying to have a shrine I made steal the health of anyone who gets close via these sigil stones inside of it. The problem is that i dont know where to start with that. do I use a trigger box and connect the sigil stones to it, which in turn have the steal life spell? Link to comment Share on other sites More sharing options...
maxarturo Posted June 4, 2021 Share Posted June 4, 2021 (edited) The less expensive way in processing level is to place a trigger box around your shrine that it will fire using the events "OnTriggerEnter()" to cast your spell and "OnTriggerLeave()" to stop it. * The spell must be constant, and to not have a visual FX. If your spell will have a Visual FX like: a trail from the shrine towards the player, then the script needs a modification. Example script: Spell Property MySpell Auto ObjectReference Property MyShrine Auto EVENT OnTriggerEnter(ObjectReference akActionRef) If ( akActionRef == Game.GetPlayer() ) MySpell.Cast(MyShrine, akActionRef) EndIf ENDEVENT EVENT OnTriggerLeave(ObjectReference akActionRef) If ( akActionRef == Game.GetPlayer() ) MyShrine.InterruptCast() EndIf ENDEVENT Have a happy modding. Edited June 4, 2021 by maxarturo Link to comment Share on other sites More sharing options...
wilwhitt56 Posted June 5, 2021 Author Share Posted June 5, 2021 It doesn't seem to be working. Can you see what I did wrong? Scriptname CGDrainShrinescript extends ObjectReference {Spell Property crVampireDrain06 AutoObjectReference Property ApoTentacleStatue01 * Auto EVENT OnTriggerEnter(ObjectReference akActionRef) If ( akActionRef == Game.GetPlayer() ) crVampireDrain06.Cast(ApoTentacleStatue01 *, akActionRef) EndIfENDEVENT EVENT OnTriggerLeave(ObjectReference akActionRef) If ( akActionRef == Game.GetPlayer() ) ApoTentacleStatue01 *.InterruptCast() EndIfENDEVENT} Link to comment Share on other sites More sharing options...
maxarturo Posted June 5, 2021 Share Posted June 5, 2021 (edited) Why did you add * and {} ?, the script didn't have them. Scriptname CGDrainShrinescript extends ObjectReference Spell Property crVampireDrain06 Auto ObjectReference Property ApoTentacleStatue01 Auto EVENT OnTriggerEnter(ObjectReference akActionRef) If ( akActionRef == Game.GetPlayer() ) crVampireDrain06.Cast(ApoTentacleStatue01, akActionRef) EndIf ENDEVENT EVENT OnTriggerLeave(ObjectReference akActionRef) If ( akActionRef == Game.GetPlayer() ) ApoTentacleStatue01.InterruptCast() EndIf ENDEVENT For the damage to be constant the spell needs to be constant. If the spell is "Fire And Forget", then the script should be as follow. Example script: Scriptname CGDrainShrinescript extends ObjectReference Spell Property crVampireDrain06 Auto ObjectReference Property ApoTentacleStatue01 Auto Actor Player EVENT OnTriggerEnter(ObjectReference akActionRef) Player = Game.GetPlayer() If ( akActionRef == Player ) SpellCast() EndIf ENDEVENT EVENT OnTriggerLeave(ObjectReference akActionRef) If ( akActionRef == Player ) UnregisterForUpdate() EndIf ENDEVENT EVENT OnUpdate() SpellCast() ENDEVENT FUNCTION SpellCast() crVampireDrain06.Cast(ApoTentacleStatue01, Player) RegisterForSingleUpdate(1.0) ENDFUNCTION You will need to modify the "RegisterForSingleUpdate(1.0)" to your likings, the value it's counted in seconds. * Don't forget to fill in the 'Property' for the spell from the drop down menu and 'Select Reference From Render Window' your shrine. EDIT: I change the last script a little. Have a happy modding. Edited June 5, 2021 by maxarturo Link to comment Share on other sites More sharing options...
Recommended Posts