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

[Trigger] Healing Doesnt Heal propper

Status
Not open for further replies.
Level 6
Joined
Oct 18, 2008
Messages
100
So I am creating an rpg with custom spells.

This is holy light that benefits from intelligence.
Al tough there is a problem. It only heals 67 while i setted the flat healing bonus to 100 and the unit has 32 intelect.

Some1 sees the problem in the script?
The damage dealth. on an undead is 132, which should actualy be less.

  • HolyLight
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Holy Light
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Multiple ConditionsOr - Any (Conditions) are true
            • Conditions
              • ((Owner of (Target unit of ability being cast)) is an ally of (Owner of (Triggering unit))) Equal to (==) True
              • (Owner of (Target unit of ability being cast)) Equal to (==) (Owner of (Triggering unit))
        • Then - Actions
          • Set FlatHeal = 100
          • Set HealingDone = ((Intelligence of (Triggering unit) (Include bonuses)) + FlatHeal)
          • Set HealingDone = (HealingDone x -1)
          • Set Heal = True
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(HealingDone)) damage of attack type Spells and damage type Normal
        • Else - Actions
          • Set FlatHeal = 50
          • Set DamageDone = ((FlatHeal + (Intelligence of (Triggering unit) (Include bonuses))) + (Intelligence of (Triggering unit) (Include bonuses)))
          • Set Ability = True
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(DamageDone)) damage of attack type Spells and damage type Normal
 
Level 13
Joined
Sep 13, 2010
Messages
550
Why don't you set the target unit's life simply? The problem is that it has to calculate the armor in coz you are damaging the unit.
  • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + (HealingDone))
 
Level 16
Joined
May 1, 2008
Messages
1,605
The problem is the damage action, which you using for heal, actually this " attack type Spells"

Now depends of the armor of the target, the target takes reduced damage from Spell Types. Even you make a heal with the damage action, still something is absorbed, this why the unit gets lower heal as it should.
Now you can solve this, if you change the damage actions to Heal actions (as geries said) or you go to the Game Constant settings and change in every armor type the Spell Reduction to 1.00.

Hint:
You only need one variable for healing and damage.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can use "Unit - Damage Target".
And you also can fully heal the targeted unit, how ?
Here:
  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(DamageDone)) damage of attack type Chaos and damage type Unknown
Using Chaos Attack type and Unknown OR Universal Damage Type will let the calculation to hit pure exact amount.
In other term, it is called as pure damage
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
damage type would also have to be "universal" to ignore armor.

This also does not account for units with Berserk turned on or units with Spirit Link turned on, which will modify the damage even though it is "universal" and "pure".

The only way to deal exact damage is done with SetWidgetLife (or SetUnitState, which does the same thing but more cumbersome). Nestharus uses such a technique in his Advanced Damage Event library.
 
Status
Not open for further replies.
Top