Jump to content

[LE] Magic effect to detect when the player is in water


Recommended Posts

I'm trying to create a patch that detects when the player is standing in water, but I can't seem to get it to work correctly. I found some really old forum posts on how to do this, but for some reason, the effect doesn't seem to be firing - or at least the script isn't.

 

My current setup is an ability that is marked as a constant effect, that applies the magic effect if the player is standing in dangerous water. The effect is set as a constant effect script type, with the attached script:

Scriptname detectWaterEffectScript extends ActiveMagicEffect 

Spell Property detectSpell auto

Event OnInit()
	Debug.Trace("Loaded Spell Effect")
EndEvent

Event onEffectStart(Actor akTarget, Actor akCaster)
	Debug.Notification("Player is in water");
	akCaster.DispelSpell(detectSpell)
	self.dispel()
	Debug.Notification("Removed Spell")
	Utility.Wait(5.0)
	akCaster.addSpell(detectSpell);
endEvent

I'm not quite sure what I'm doing wrong, and any advice would be greatly appreciated.

 

Edit: Attached screenshots of spell, effect, and conditions.

Link to comment
Share on other sites

Ok, let's say we have an 'Heal Ability Spell' that fires only when the player stands or when he's in dangerous waters, waters that apply damage.


On the 'Heal Ability Spell' you add the condition "HasMagicEffect" and you target the 'Dangerous Water' magic effect.

It should look something like this:

S > HasMagicEffect > DangerousWaterEffect == 1


You are done and you don't need scripts for something that simple.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...