alllies

Status
Not open for further replies.
Level 3
Joined
Feb 21, 2012
Messages
38
how to make a trigger as-
a unit begins casting a spell X
if used on ally will heal him by 1000 +5*casters str
if used on enemy will dmg him by 1000+5*casters str
 
Event: A unit starts the effect of an ability

Conditions: Ability being cast = YourSpellX

Actions
Set TUnit = Target Unit of Ability Being Cast
Set TUnit2 = Triggering Unit
If/Then/Else
If (Boolean Comparison) TUnit belongs to an ally of Owner of (TUnit2) = true
Then: Set Current HP of TUnit = (Curret HP of TUnit + (1000 + (5 x TUnit2 strength)))
Else: Set Current HP of TUnit = (Curret HP of TUnit - (1000 + (5 x TUnit2 strength)))
 
Event: A unit starts the effect of an ability

Conditions: Ability being cast = YourSpellX

Actions
Set TUnit = Target Unit of Ability Being Cast
Set TUnit2 = Triggering Unit
If/Then/Else
If (Boolean Comparison) TUnit belongs to an ally of Owner of (TUnit2) = true
Then: Set Current HP of TUnit = (Curret HP of TUnit + (1000 + (5 x TUnit2 strength)))
Else: Set Current HP of TUnit = (Curret HP of TUnit - (1000 + (5 x TUnit2 strength)))

Instead of setting the HP of the unit, damaging the unit is better because he can get the XP if this unit is killed or even bounty if it is enabled.
 
You're right... I just took the easy way changing the "+" for a "-".

Else: Unit - Cause TUnit2 deal (1000 + (5 x TUnit2 strength)) damage to TUnit
 
Status
Not open for further replies.
Back
Top