teleport object

Post » Wed Feb 18, 2015 4:34 pm

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.

User avatar
Lauren Denman
 
Posts: 3382
Joined: Fri Jun 16, 2006 10:29 am

Post » Wed Feb 18, 2015 9:24 pm

Calculating the damage depends on you. We can't tell what you would consider as mage or non-mage.

Hurting the caster is easy with OnEffectStart:

Event OnEffectStart(Actor akTarget, Actor akCaster)	akCaster.DamageActorValue("Health", 10.0)EndEvent

Would do 10 damage to the Casters Health. You could also make the magic effect delivery on 'Self', the archetype 'Value Modifier' and choose 'Health' as associated Item1.

Concerning your second effect, I don't get what you mean. Is it supposed to be the same spell, one effect damaging the caster and the other one teleporting?

User avatar
Jessie
 
Posts: 3343
Joined: Sat Oct 14, 2006 2:54 am


Return to V - Skyrim