HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell problem

08-22-2003, 02:58 AM#1
Jatz
How do I refer to the target of a spell. Just say I have a unit that has a spell, and so I cast that spell on an enemy unit. How do I (using a trigger) refer to the enemy unit?

I tried something like:

E: Unit - Unit starts the effect of an ability
C: Ability being cast equal to *spell*
A: Kill (Triggering unit)

and it ended up killing the caster, lol. Well im not sure if that's exactly what I did, but it was something along those lines.
08-22-2003, 03:06 AM#2
MarSara
it requires two triggers, one to set a variable to the target and another to determine when they actually cast the spell, just add this trigger and create a variable of type unit (call it SpellTarget for now)

Code:
Events:
    - A unit is issued and order targeting an object
Conditions:
Actions:
    - Set SpellTarget = TargetUnitofIssuedOrder
Then just replace your (Triggering Unit) in your trigger with SpellTarget.
08-22-2003, 03:38 AM#3
Jatz
Thanks, it worked!