• 🏆 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] On attack problems

Status
Not open for further replies.
Level 2
Joined
Sep 16, 2009
Messages
11
OK i have done this be4 but i cant remeber how i did it?!

Basically what i want to do is, when a unit attacks it has a % chance to cast a skill on the attacked unit?!

And second one is, i want when you have a certain items, u have the glaive thrower abbilty that actaully works??!
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
The chance here is 30 %.

  • Untitled Trigger 003
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 30
        • Then - Actions
          • Set Temp_Loc_1 = (Position of (Attacking unit))
          • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at Temp_Loc_1 facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • *Possibly add the spell to the dummy*
          • *Give the dummy locust if it doesn't have it yet*
          • *Order the dummy to cast the spell*
          • Custom script: call RemoveLocation(udg_Temp_Loc_1)
        • Else - Actions
The other thing:

  • Untitled Trigger 004 Copy
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type Claws of Attack +15) Equal to True
      • ((Triggering unit) has an item of type Crown of Kings +5) Equal to True
      • ((Triggering unit) has an item of type Kelen's Dagger of Escape) Equal to True
      • (Level of Aerial Shackles for (Triggering unit)) Less than 1
    • Actions
      • Unit - Add Aerial Shackles to (Triggering unit)
  • Untitled Trigger 004 Copy Copy
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • Wait 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Aerial Shackles for (Triggering unit)) Greater than 0
          • Or - Any (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Claws of Attack +15) Equal to False
              • ((Triggering unit) has an item of type Crown of Kings +5) Equal to False
              • ((Triggering unit) has an item of type Kelen's Dagger of Escape) Equal to False
        • Then - Actions
          • Unit - Remove Aerial Shackles from (Triggering unit)
        • Else - Actions
But I'm not sure what you mean by the ability? What ability is that?
 
Last edited:
Level 2
Joined
Sep 16, 2009
Messages
11
THanks

THat worked fine!

The second thing is that when a unit attacks (ranged) it shoot target behind it to.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Like Moon Glaive for the Huntress unit?

Look at the Huntress unit in object editor, mainly the combat - weapon type. Set it to Missile (bounce).

You could create two different versions of unit(s), once with normal attack and one with the bouncing missile, and replace the unit when it acquires/loses items.
 
Status
Not open for further replies.
Top