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

[Spell] Damage Value With Hero Attributes

Status
Not open for further replies.

Remixer

Map Reviewer
Level 31
Joined
Feb 19, 2011
Messages
1,957
I am trying to make a map that has a unit that should deal damage with spell and the damage should be [2xHeroStr] somehow it deals it but when I get more Str the value will not go higher. What should I do? I also tried to solve problem with trigger that sets the value again every 1.00 second of time. But it still does not deal more damage. What am I doing wrong?
 

Remixer

Map Reviewer
Level 31
Joined
Feb 19, 2011
Messages
1,957
Triggers

  • Attack Dagger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Attack
          • ((Target unit of ability being cast) is A ground unit) Equal to True
        • Then - Actions
          • Unit - Cause Kanaije 0001 <gen> to damage (Target unit of ability being cast), dealing ((Real(AttackPowerInteger)) x 2.00) damage of attack type Normal and damage type Normal
          • Sound - Play AttackDagger <gen> at 80.00% volume, attached to (Target unit of ability being cast)
          • Animation - Play Kanaije 0001 <gen>'s attack1 animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Attack
          • ((Target destructible of ability being cast) is alive) Equal to True
        • Then - Actions
          • Destructible - Set life of (Target destructible of ability being cast) to ((Current life of (Target destructible of ability being cast)) - 10.00)
          • Sound - Play AttackDaggerDebris <gen> at 80.00% volume, located at (Position of (Target destructible of ability being cast)) with Z offset 0.00
          • Animation - Play Kanaije 0001 <gen>'s attack1 animation
        • Else - Actions
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Where do you set the AttackPower value?

Ah, I think he sets this "AttackPower" value single-time only, and does not update with the unit's new Strength

@OP
You should set the AttackPower each time you cast the spell, because for each unit, it has different STR you know and meanwhile, your hero could be leveled up and increase its STR, unless your game is static attribute increment (does not increase STR per level)

Since the trigger always returns the value of Kanaije (a pre-set unit) STR value, this spell does not differ if it cast by another unit, unless you replace the "Kanaije 0001 <gen>" with (Triggering unit)

The trigger more or less, should be like this:

  • Attack Dagger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set AttackPower = (Strength of Kanaije 0001 <gen> (Include bonuses))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Attack
          • ((Target unit of ability being cast) is A ground unit) Equal to True
        • Then - Actions
          • Unit - Cause Kanaije 0001 <gen> to damage (Target unit of ability being cast), dealing ((Real(AttackPowerInteger)) x 2.00) damage of attack type Normal and damage type Normal
          • Sound - Play AttackDagger <gen> at 80.00% volume, attached to (Target unit of ability being cast)
          • Animation - Play Kanaije 0001 <gen>'s attack1 animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Attack
          • ((Target destructible of ability being cast) is alive) Equal to True
        • Then - Actions
          • Destructible - Set life of (Target destructible of ability being cast) to ((Current life of (Target destructible of ability being cast)) - 10.00)
          • Sound - Play AttackDaggerDebris <gen> at 80.00% volume, located at (Position of (Target destructible of ability being cast)) with Z offset 0.00
          • Animation - Play Kanaije 0001 <gen>'s attack1 animation
        • Else - Actions
You should make that AttackPower an Integer variable, because there is no such thing as 2.5 STR of attribute in Warcraft III (the User Interface values)
 
Last edited:
Status
Not open for further replies.
Top