• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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