• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
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)))
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
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.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
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.
Top