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

Problem with setting base damage of a unit

Status
Not open for further replies.
Level 3
Joined
Nov 2, 2020
Messages
28
Hi i would like to know how can i make this trigger work so, what i'm trying to do is disable damage gain for intelligence heroes when gaining intelligence points.

  • Up
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
      • Player - Player 2 (Blue) Presses the Up Arrow key
      • Player - Player 3 (Teal) Presses the Up Arrow key
      • Player - Player 4 (Purple) Presses the Up Arrow key
      • Player - Player 5 (Yellow) Presses the Up Arrow key
      • Player - Player 6 (Orange) Presses the Up Arrow key
      • Player - Player 7 (Green) Presses the Up Arrow key
      • Player - Player 8 (Pink) Presses the Up Arrow key
      • Player - Player 9 (Gray) Presses the Up Arrow key
      • Player - Player 10 (Light Blue) Presses the Up Arrow key
      • Player - Player 11 (Dark Green) Presses the Up Arrow key
      • Player - Player 12 (Brown) Presses the Up Arrow key
    • Conditions
      • ((Triggering player) Current lumber) Greater than 0
    • Actions
      • Set GroupINT = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in GroupINT and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Point-value of (Picked unit)) Equal to 2
            • Then - Actions
              • Unit - Set Base Damage of (Picked unit) to (Base Damage of (Picked unit) for weapon index 1) for weapon index: 1
              • Unit - Set Base Damage of (Picked unit) to (Base Damage of (Picked unit) for weapon index 0) for weapon index: 0
            • Else - Actions
          • Hero - Modify Intelligence of (Picked unit): Add 1
          • Player - Add -1 to (Triggering player) Current lumber
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Items\AIim\AIimTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call DestroyGroup(udg_GroupINT)

Cant make the hero's damage stay as it is. The hero still gains damage.
  • Unit - Set Base Damage of (Picked unit) to (Base Damage of (Picked unit) for weapon index 1) for weapon index: 1
  • Unit - Set Base Damage of (Picked unit) to (Base Damage of (Picked unit) for weapon index 0) for weapon index: 0
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
As far as I can see, the game includes the primary stat into the base damage, so using "(Base Damage of (X))" includes both the "Data field - Base Damage" as well as the primary stat

So with this in mind, your trigger:
level 1 vanilla Blood mage (19 intelligence) (19 Base damage)
Set base damage (19) to (19)
Increase intelligence (19) to (19 + 1)
level 1 vanilla Blood mage (19 intelligence) (19 Base damage) becomes
level 1 vanilla Blood mage (20 intelligence) (20 Base damage)

So you need to set the base damage yourself rather than using "(Base Damage of (X))" or you will just keep referring to their primary stat and current base damage set in the data field.
 
Status
Not open for further replies.
Top