I'm trying to make a teleport system that is in two parts.
A spell you cast at an object that damages the casters health, more so for non-mages than mages. I've about worked out the formulas for minimum and maximun damage I want and will use a random calculator for the actual damage. I was thinking of using a scripted spell effect with OnEffect Start then calculate how much damage and drain that much health from the player. The visuals I want to be like a lightning stream or a beam of light. I don't want the spell itself to do anything but damage the player so he could go around casting it on chairs and killing himself and nothing else.
Scriptname ActivationSpellEffect extends ActiveMagicEffect
Event OnEffectStar(Actor akTarget, Actor akCaster)
Calculate the damage and apply it to the caster
End Event
The second part is I want a activator that is activated only when this spell effect hits and teleports the player to a specific location.
I'm not sure about how to do that. Would I add another Event to that script like
Event OnEffectFinish(Actor akTarget, Actor akCaster)
If the target is my activator
Game.GetPlayer().MoveTo(destination)
EndIf
End Event
Or would I put some script on the stone activator?
I've done almost no scripting and no custom spells so I'm a little unsure of how to go about this. The youTube videos I've watched have been a little help but I can't find much about having spells damage the caster or about a teleport stone instead of a simple spell.