• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

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:
Level 7
Joined
Aug 13, 2007
Messages
309
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