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

Counting Attacks

Status
Not open for further replies.
Level 8
Joined
Feb 20, 2009
Messages
268
I need some help making a trigger with GUI that will count the number of attacks a unit makes against another unit. I want it to count the attacks to five then do an action that will give the hero one point in strength..

And how do you set a maximum attribute. i Want the amount of strength to go no higher 50.

Any Ideas?
 
First, download and implement this into your map.

Then here's an example trigger.
You don't need to understand the custom scripts, it just stores an integer.

  • Display Damage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • Custom script: local integer id = GetHandleId(udg_GDD_DamageSource)
      • Custom script: local integer i = LoadInteger(udg_Hash, id, 0)
      • Custom script: if i >= 5 then
      • Hero - Modify Strength of GDD_DamageSource: Add 1
      • Custom script: call SaveInteger(udg_Hash, id, 0, 0)
      • Custom script: else
      • Custom script: call SaveInteger(udg_Hash, id, 0, i + 1)
      • Custom script: endif
You also need to create a hashtable entitled "Hash".

  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash = (Last created hashtable)
 
Status
Not open for further replies.
Top