• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

[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,243
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.
 
Status
Not open for further replies.
Top