• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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