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

Damage check, increase and decrease

Status
Not open for further replies.
Level 1
Joined
Apr 19, 2013
Messages
1
Whats the best solution if i want to make every unit attack is checking the condition first then the damage can increase or decrease based on the elements of the attacking unit and the unit who takes the damage

for example the condition is the attacking unit elements is fire, and the attacked unit elements is water, when fire attacks water the damage of the unit is decrease by 25%, and when water attacks fire the damage increase by 150%.

i made the codes but got stuck, when my hero attack other unit, elements calculating was fine, but when i want to increase the damage of the attacker the game crash

the example of code like this


  • Set Unit
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set Attacking_Unit = (Attacking unit)
      • Trigger - Add to Damage Modifier <gen> the event (Unit - (Attacked unit) Takes damage)
  • Damage Modifier
    • Events
    • Conditions
    • Actions
      • Unit - Cause Attacking_Unit to damage (Attacked unit), dealing 100.00 damage of attack type Normal and damage type Normal
 
Status
Not open for further replies.
Top