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

Damage magic take no damage, but percentage of health?

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hi! I want to ask how i can create a trigger probably or a 'dummy' magic to make a damage spell do not damage, but take a percentage of health from the unit that is attacked. I need that because in my map the creatures are with different HP and i want the damage to be the same. +rep for help!!!
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I'll be basing the spell 10% from max HP, is that okay ?

EDIT:
This is what I got:
  • Magic Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to MAGIC !
    • Actions
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Set Damage = ((Integer((Max life of Target))) x (Integer(0.10)))
      • Unit - Cause Caster to damage Target, dealing (Real(Damage)) damage of attack type Spells and damage type Normal
Try it
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Caster = Unit
Target = Unit
Damage = Integer

If you want me to make the test map, I can make it
But I'm in DotA right now >.<"
For the formula... Convert to Integer than go to Life - Property -> Max Life
First, make it Arithmetic...
It's hard to explain, I'll create test map, but will be late =(
 

sPy

sPy

Level 21
Joined
Apr 10, 2009
Messages
268
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YourSpell
    • Actions
      • Set TriggeredUnits[1] = (Triggering unit)
      • Set TriggeredUnits[2] = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true ---- If you have more than 1 boss you could add this condition
            • Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Boss1
              • (Unit-type of (Target unit of ability being cast)) Equal to Boss2
        • Then - Actions
          • Set DamageValue = ((Max life of TriggeredUnits[2]) x 0.01)
          • Unit - Cause TriggeredUnits[1] to damage TriggeredUnits[2], dealing DamageValue damage of attack type Spells and damage type Normal
        • Else - Actions
          • Set DamageValue = ((Max life of TriggeredUnits[2]) x 0.10)
          • Unit - Cause TriggeredUnits[1] to damage TriggeredUnits[2], dealing DamageValue damage of attack type Spells and damage type Normal
 
Status
Not open for further replies.
Top