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

How Would I Make an Item that Has a Chance on Hit to Cast an Ability?

Status
Not open for further replies.
Level 2
Joined
Jun 9, 2006
Messages
18
For instance, an orb that has a 5% chance on hit to hex the enemy unit into a random critter. I understand the basics of triggers and variables and such, but this confuses me.

Thanks in advance.
 
Level 5
Joined
Apr 8, 2007
Messages
116
I think this should work. (Just used your 5% chance as example)

  • Events
  • Unit - A unit is attacked
  • Conditions
  • ((Attacking unit has an item of type [name of item]) Equal to true
  • Actions
  • Set %chance = (Random integer from 1 to 100)
  • If (%chance less than or equal to 5) then do (Run whatever needed) Else do (Do nothing)
If it suceedes, create a dummy unit, that casts the hex spell on the target! :emote_smile:
 
Level 10
Joined
Jan 21, 2007
Messages
576
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has an item of type YourItem) Equal to True
    • Actions
      • Set Dice = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dice Less than or equal to 5
        • Then - Actions
          • Set L = (Position of Attacking Unit)
          • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at L facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_L)
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Hex (Neutral Hostile) to (Last created unit)
          • Unit Group - Order (Last created Unit) to Orc Shadow Hunter - Hex (Attacked unit)
        • Else - Actions
Upated.
 
Last edited:
Level 2
Joined
Jun 9, 2006
Messages
18
Thanks, but it still doesn't seem to be workin. Now the heroes with the hex item's attacks don't do any damage and it's still not hexin the target. I made the dummy unit a hero and gave it hex, but it might be because ya gotta put points in hex before it can be used it.

I didn't see a way to do this without triggers but if it's possible that'd be helpful too.
 
Level 10
Joined
Jan 21, 2007
Messages
576
Trigger is updated. You dont need to give the dummy unit an ability in world editor, make the dummy unit a flying non hero unit with the locust ability, set its mana to infin, the trigger creates the unit, gives the unit the ability, casts the ability, and destroys the unit, you should be good to go.
 
Status
Not open for further replies.
Top