• 🏆 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!

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