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

How to add damage to the attribute?

Status
Not open for further replies.
Level 5
Joined
Aug 27, 2008
Messages
126
Hi guys! I am using behaviour to add damage to my units. Now when I set it to 1 it gives +1 damage to the damage of the turret and +1 to the damage that the unit deals only to light units. Now.. how can I change that? I want the behaviour to add +2 to the attribute damage of the unit.

Is it impossible?
Look at the Hellion - Preigniters upgrade. I want to make it into a behaviour, so that it can be applied to a single unit many times.
 
Last edited by a moderator:
This might be useful for you: I found away to script the damage and not have them blow up. Just create a damage effect that does 0 damage of the type you want (such as normal) then you can use this to add the damage you actually want it to do:

  • Damage
    • Events
      • Unit - Any Unit takes Fatal or Non-Fatal Any damage (from Proj Dmg effects)
    • Local Variables
      • u = (Triggering unit) <Unit>
      • dmg u = (Damaging unit) <Unit>
      • cv = FixedToInt(UnitGetCustomValue(lv_dmgu, gv_CVS)) <Integer>
    • Conditions
    • Actions
      • General - Custom Script: if (lv_dmgu == null) {...
JASS:
UnitDamage(lv_dmgu, "ProjDmg", lv_u, gv_projDmg[lv_cv]);
 
Status
Not open for further replies.
Top