• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need help

Status
Not open for further replies.
Level 3
Joined
May 28, 2012
Messages
32
Setting a max value to the amount of healead life

Hello dear community,

i've made a spell in GUI that damages all units around the hero. In addition it heals the hero for 10% of the damage dealt. My problem is, if there are too many units then he has too much self heal...so i wanted that he can heal hisself only to a specified amount. The amount should be: 50/75/100/125/150.


Example to understand my problem:

There are 5 units around the hero; the hero deals 150 damage; 10% of that damage is 15 damage, but since there are 5 units he heals himself for 75 Hitpoints (5 units x 15 dmg). But i want that the maximal cap is 50!


Now my question is: how can i set the maximal healed life?

Thank you in advance!

  • Slashing Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slashing Strike
    • Actions
      • -------- --------------------------------------------------------- --------
      • -------- ----- --------
      • -------- --------------------------------------------------------- --------
      • Set SlashingStrike_Caster = (Triggering unit)
      • Set SlashingStrike_Ability_Level = (Level of (Ability being cast) for SlashingStrike_Caster)
      • Set SlashingStrike_Location = (Position of SlashingStrike_Caster)
      • Set SlashingStrike_Direction = (Facing of SlashingStrike_Caster)
      • -------- --------------------------------------------------------- --------
      • -------- ----- --------
      • -------- --------------------------------------------------------- --------
      • Set SlashingStrike_Base_Offset = 50.00
      • Set SlashingStrike_Bonus_Offset = 20.00
      • -------- --------------------------------------------------------- --------
      • -------- ----- --------
      • -------- --------------------------------------------------------- --------
      • Set SlashingStrike_Base_Radius = 360.00
      • Set SlashingStrike_Bonus_Radius = 0.00
      • -------- --------------------------------------------------------- --------
      • -------- ----- --------
      • -------- --------------------------------------------------------- --------
      • Set SlashingStrike_Atribute = (Agility of SlashingStrike_Caster (Include bonuses))
      • Set SlashingStrike_Dmg_Multiplier = 2.00
      • -------- --------------------------------------------------------- --------
      • -------- ----- --------
      • -------- --------------------------------------------------------- --------
      • Set SlashingStrike_Total_Radius = (SlashingStrike_Base_Radius + (SlashingStrike_Bonus_Radius x (Real(SlashingStrike_Ability_Level))))
      • Set SlashingStrike_Total_Offset = (SlashingStrike_Base_Offset + (SlashingStrike_Bonus_Offset x (Real(SlashingStrike_Ability_Level))))
      • Set SlashingStrike_Total_Damage = ((SlashingStrike_Dmg_Multiplier x (Real(SlashingStrike_Atribute))) + (30.00 + (20.00 x (Real(SlashingStrike_Ability_Level)))))
      • Set SlashingStrike_Hero_Heal = (SlashingStrike_Total_Damage / 10.00)
      • -------- --------------------------------------------------------- --------
      • -------- ----- --------
      • -------- --------------------------------------------------------- --------
      • Set SlashingStrike_Damage_Location = (SlashingStrike_Location offset by SlashingStrike_Total_Offset towards SlashingStrike_Direction degrees)
      • Set SlashingStrike_Damage_Group = (Units within 300.00 of SlashingStrike_Damage_Location matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Owner of (Matching unit)) is an enemy of (Owner of SlashingStrike_Caster)) Equal to True
      • -------- --------------------------------------------------------- --------
      • -------- ----- --------
      • -------- --------------------------------------------------------- --------
      • Special Effect - Create a special effect attached to the hand, left of SlashingStrike_Caster using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the hand, right of SlashingStrike_Caster using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the hand, left of SlashingStrike_Caster using Abilities\Weapons\GargoyleMissile\GargoyleMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the hand, right of SlashingStrike_Caster using Abilities\Weapons\GargoyleMissile\GargoyleMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Create 1 Slashing Strike Dummy for (Owner of SlashingStrike_Caster) at SlashingStrike_Damage_Location facing SlashingStrike_Direction degrees
      • Unit - Kill (Last created unit)
      • -------- --------------------------------------------------------- --------
      • -------- ----- --------
      • -------- --------------------------------------------------------- --------
      • Unit Group - Pick every unit in SlashingStrike_Damage_Group and do (Actions)
        • Loop - Actions
          • Set SlashingStrike_Target = (Picked unit)
          • Unit - Cause SlashingStrike_Caster to damage SlashingStrike_Target, dealing SlashingStrike_Total_Damage damage of attack type Spells and damage type Unknown
          • Floating Text - Create floating text that reads ((String((Integer(SlashingStrike_Total_Damage)))) + !) at (Position of SlashingStrike_Target) with Z offset 0.00, using font size 10.00, color (100.00%, 40.00%, 0.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees
          • Floating Text - Change the fading age of (Last created floating text) to 0.30 seconds
          • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
          • Special Effect - Create a special effect attached to the origin of SlashingStrike_Target using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (SlashingStrike_Target is A ground unit) Equal to True
            • Then - Actions
              • -------- Hero Heal --------
              • Unit - Set life of SlashingStrike_Caster to ((Life of SlashingStrike_Caster) + SlashingStrike_Hero_Heal)
              • Special Effect - Create a special effect attached to the origin of SlashingStrike_Caster using Abilities\Spells\Human\Heal\HealTarget.mdl
              • Floating Text - Create floating text that reads (+ + (String((Integer(SlashingStrike_Hero_Heal))))) at SlashingStrike_Location with Z offset 0.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees
              • Floating Text - Change the fading age of (Last created floating text) to 0.80 seconds
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
            • Else - Actions
      • -------- --------------------------------------------------------- --------
      • -------- ----- --------
      • -------- --------------------------------------------------------- --------
      • Set SlashingStrike_Target = No unit
      • Custom script: call RemoveLocation(udg_SlashingStrike_Location)
      • Custom script: call RemoveLocation(udg_SlashingStrike_Damage_Location)
      • Custom script: call DestroyGroup(udg_SlashingStrike_Damage_Group)
 
Last edited:
It would be best if you posted your trigger here, so we can actually see how are you performing your task.

I'm pretty sure you're using GUI action: Unit - Damage Target (...) within groupenum (Pick Every Unit). If so, store the total amount of damage dealt via real variable and after the iteration is done, just do simple math and use Real Condition within If/Then/Else statement to check if your heal-value exceeds cap. If so, use the level-dependant cap instead of calculated value.
 
Level 3
Joined
May 28, 2012
Messages
32
and if the heal-value exceeds the cap? then it will happen nothin? pls tell/show me how do you mean this
 
Status
Not open for further replies.
Top