• 🏆 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!

[Trigger] Damage check

Status
Not open for further replies.
Level 9
Joined
Aug 1, 2008
Messages
453
heres my trigger
  • Exp and Gold
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is A Hero) Equal to True
      • ((Attacked unit) is A Hero) Equal to True
    • Actions
      • Hero - Add 10 experience to (Attacking unit), Hide level-up graphics
      • Player - Add 5 to (Owner of (Attacking unit)) Current gold
i need a condition that make sure the unit did damage to the unit to get gold
how would i do that? please and thank u will +rep if helped
 
Level 9
Joined
Aug 1, 2008
Messages
453
its not there....

unit>generic unit event>(Takes damage isnt there)
unit>Specific unit event>(its there) but that doesnt work for what im useing it for..

i need to do it if ANY unit is attacked

where else is it if its not there...
 
Level 5
Joined
May 11, 2005
Messages
89
You will need 3 triggers. 2 to detect units and add them to the damage trigger.

This trigger detects pre-placed units:
Code:
Detect Preplaced unit
    Events
        Map initialization
    Conditions
    Actions
        Set TEMP_unitGroup = (Units in (Playable map area))
        Unit Group - Pick every unit in TEMP_unitGroup and do (Actions)
            Loop - Actions
                Trigger - Add to Damage Taken <gen> the event (Unit - (Picked unit) Takes damage)
        Custom script:   call DestroyGroup (udg_TEMP_unitGroup)

This trigger detects new units:
Code:
Detect Entering Unit
    Events
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        Trigger - Add to Damage Taken <gen> the event (Unit - (Triggering unit) Takes damage)


And this is the trigger where the damage events are added:
Code:
Damage Taken
    Events
    Conditions
        And - All (Conditions) are true
            Conditions
                ((Damage source) is A Hero) Equal to True
                ((Triggering unit) is A Hero) Equal to True
                (Damage taken) Greater than 10.00
    Actions
        Hero - Add 10 experience to (Damage source), Show level-up graphics
        Player - Add 5 to (Owner of (Damage source)) Current gold

NOTE: This will also trigger from spell damage, I'm sure you can figure out how fix that though.

This thread should have been created in the 'Triggers & Scripts' section for your future reference.
 
Status
Not open for further replies.
Top