HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A unit finishes casting an ability

08-19-2006, 02:43 PM#1
ShadowDestroyer
How do refer to the unit being targeted by an ability when using
Event- A unit finishes casting an ability

I have tried "target unit of ability being cast", but that only works for BEGINS casting an ability
08-19-2006, 04:16 PM#2
Mystic Prophet
I think it works for starts the effect of an ability as well. You'd have to save the target unit of ability being cast into a variable when the spell begins and then access it later when the spell ends.

If there is a another way to do it, I don't know of it.
08-21-2006, 02:56 PM#3
zeroXD
How about "unit - a unit starts the effect of an ability" then you can use "target unit of ability being cast".

Trigger:
Spell target
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to [Ability]
Collapse Actions
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing ((Real((Strength of (Triggering unit) (Include bonuses)))) x (Real((Level of [Ability] for (Triggering unit))))) damage of attack type Spells and damage type Normal

Like this.
If it is a big trigger i reccomend using a unit variable for the target.
08-21-2006, 04:53 PM#4
shadow1500
You can get the target by using the HandleVars/Tables system:
Trigger:
SetupSpellTarget
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Target unit of ability being cast) Not equal to No unit
Collapse Actions
Custom script: call SetHandleHandle( GetTriggerUnit(), "spelltarget", GetSpellTargetUnit() )
Trigger:
SomeSpell
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
(Ability being cast) Equal to Combust
Collapse Actions
Custom script: set udg_UnitVar = GetHandleUnit(GetTriggerUnit(),"spelltarget")
Unit - Cause (Triggering unit) to damage UnitVar, dealing 100.00 damage of attack type Spells and damage type Normal