• 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.

[Trigger] Attack Trigger

Status
Not open for further replies.
Level 23
Joined
Nov 29, 2006
Messages
2,482
Hm well, this should work : )

  • Rarwr
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Greater than 100.00
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
        • Else - Actions
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
would be better if you get rid of if then else and put all conditions in conditions since there are no else actions
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Spot on... I didn't notice^^

  • Rarwr
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
      • (Life of (Triggering unit)) Greater than 100.00
    • Actions
      • Unit - Order (Attacking unit) to Stop
This is how it should be!

And cherrol, how could it be less than? You said, if the attacked unit has less than 100, then you may attack him. If not, don't allow...
 
Level 11
Joined
Mar 30, 2008
Messages
666
Spot on... I didn't notice^^

  • Rarwr
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
      • (Life of (Triggering unit)) Greater than 100.00
    • Actions
      • Unit - Order (Attacking unit) to Stop
This is how it should be!

And cherrol, how could it be less than? You said, if the attacked unit has less than 100, then you may attack him. If not, don't allow...

Ok,but the first is working good.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
hm you mean this?

  • BossKill
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to YourBossType
    • Actions
      • Set tempPlayerGroup = (All allies of (Owner of (Killing unit)))
      • Player Group - Pick every player in tempPlayerGroup and do (Actions)
        • Loop - Actions
          • Player - Add 300 to (Picked player) Current gold
      • Custom script: call DestroyForce( udg_tempPlayerGroup )
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
I rather
for Each A integer from 1 to 12
if Player(integer A) is ally of Owner of Killing Unit
then give gold to Player(integer A)

And its faster than creating and destroying a force

You know what they say: always work for speed
 
Status
Not open for further replies.
Top