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

[Spell] I need help to make a spell work.

Status
Not open for further replies.
Level 7
Joined
Dec 17, 2010
Messages
83
The spell is like:
Event: an ability has been casted
Condition: ability equal to Mending souls
The I would need help with the ''actions'' without using custom scripts if it's possible...
so, what I want to happen is --> damage casting unit for 50% of his percent life and heal the targeted ally with his 50% life.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set CUnit = (Triggering unit)
      • Set TUnit = (Target unit of ability being cast)
      • Unit - Set life of CUnit to ((Percentage life of CUnit) + 50.00)%
      • Unit - Set life of TUnit to ((Percentage life of TUnit) - 50.00)%
This won't detect the damage source, since no damage is really being dealt. If the Target unit HP becomes equal or lower than 0% i think it will die without being detected as killed by anywone. You would have to make CUnit cause damage to TUnit equal to the 50% of it's hp.
 
Level 5
Joined
Jan 5, 2012
Messages
116
I post the triggers here plus a test map to see it for yourself.

  • Mending Souls
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mending Souls
    • Actions
      • Set Cast_Unit = (Triggering unit)
      • Set Target_Unit = (Target unit of ability being cast)
      • Unit - Set life of Cast_Unit to ((Life of Cast_Unit) - (0.50 x (Max life of Cast_Unit)))
      • Unit - Set life of Target_Unit to ((Life of Target_Unit) + (0.50 x (Max life of Target_Unit)))
 

Attachments

  • Mending Souls.w3x
    15.7 KB · Views: 78
Level 12
Joined
Sep 11, 2011
Messages
1,176
I post the triggers here plus a test map to see it for yourself.

  • Mending Souls
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mending Souls
    • Actions
      • Set Cast_Unit = (Triggering unit)
      • Set Target_Unit = (Target unit of ability being cast)
      • Unit - Set life of Cast_Unit to ((Life of Cast_Unit) - (0.50 x (Max life of Cast_Unit)))
      • Unit - Set life of Target_Unit to ((Life of Target_Unit) + (0.50 x (Max life of Target_Unit)))

damage casting unit for 50% of his percent life and heal the targeted ally with his 50% life.

sorry, but you should make it (life of Cast_Unit) instead of (max life of Cast_Unit).. that's what SlayabThoR wanted to get.. (- 50% of Cast Unit's Life) for Cast Unit and (+50% of Cast Unit's Life) for Targeted Unit...


something like this

  • Mending Souls
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mending Souls
    • Actions
      • Set Cast_Unit = (Triggering unit)
      • Set Target_Unit = (Target unit of ability being cast)
      • Unit - Set life of Cast_Unit to ((Life of Cast_Unit) - (0.50 x (life of Cast_Unit)))
      • Unit - Set life of Target_Unit to ((Life of Target_Unit) + (0.50 x (life of Cast_Unit)))
That way, the Cast Unit wouldn't die for no reason and it's current life would be just decreasing by 50% (if it's HP is 500 then it would lost 250 and gave it to the Targeted Unit)
 
Level 5
Joined
Jan 5, 2012
Messages
116
I don't know if he means 50% of current life or max life.
I think the heal would be better with 50% of max life, because if it's current life, when a unit say has 10 health it will heal only 5 health...
However, the damage on Casting unit is better when calculated from his current health, since he won't be able to die from the spell.

I suggest this one:

  • Mending Souls
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mending Souls
    • Actions
      • Set Cast_Unit = (Triggering unit)
      • Set Target_Unit = (Target unit of ability being cast)
      • Unit - Set life of Cast_Unit to ((Life of Cast_Unit) - (0.50 x (Life of Cast_Unit)))
      • Unit - Set life of Target_Unit to ((Life of Target_Unit) + (0.50 x (Max life of Target_Unit)))
Now he can choose the one he prefers :D
 
Level 7
Joined
Dec 17, 2010
Messages
83
Yea but I wanted it in a special way, although thanks for the ideas so far.
Maybe to explain it better:

castin unit = Demon Hunter
Triggering unit = Priest

unit - a unit starts the efefct of an ability.
ability being cast equal to mending souls
Damage the castin unit by 50% of his current life, with this I mean, if he have 1000 hp he get's 500, if he have 500hp he get's 250...
Heals the triggering unit which is now the pirest (targeted unit) for the amount of his life lost.
Like, if he lost 500, +500 healing to priest, if he lost 250, +250 life to the targeted unit.
Thanks.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
sorry, but you should make it (life of Cast_Unit) instead of (max life of Cast_Unit).. that's what SlayabThoR wanted to get.. (- 50% of Cast Unit's Life) for Cast Unit and (+50% of Cast Unit's Life) for Targeted Unit...


something like this

  • Mending Souls
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mending Souls
    • Actions
      • Set Cast_Unit = (Triggering unit)
      • Set Target_Unit = (Target unit of ability being cast)
      • Unit - Set life of Cast_Unit to ((Life of Cast_Unit) - (0.50 x (life of Cast_Unit)))
      • Unit - Set life of Target_Unit to ((Life of Target_Unit) + (0.50 x (life of Cast_Unit)))
That way, the Cast Unit wouldn't die for no reason and it's current life would be just decreasing by 50% (if it's HP is 500 then it would lost 250 and gave it to the Targeted Unit)

BUT BUT BUT BUT BUT ... it's like what i told you on this quote ....
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
One more thing SlyabThor. Do you want damage to be pure? Because if you order to cause damage, it will be reduced by target armor, depending on your gameplay constants armor type reduction values; in that case, you would have to detect the damage dealt and heal the priest by the same amount, else, you would just deal pure damage so healing will be by the same amount
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
TwoVenomous, the problem with that is that you're not dealing any damage, but just reducing/increasing life.You have to do the math of the LifePercentage and order the Caster to deal that amount of damage to the target.
 
Level 18
Joined
May 11, 2012
Messages
2,103
Done ;)

  • Mending Souls
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mending Souls
    • Actions
      • -------- ------------------------------- Setting Variables ------------------------------- --------
      • Set TrigUnit = (Triggering unit)
      • Set TrigUnitPosition = (Position of TrigUnit)
      • Set TargetUnit = (Target unit of ability being cast)
      • Set Life_HealthTransfer = ((Life of TrigUnit) x 0.50)
      • -------- ------------------------------- Spell Actions ------------------------------- --------
      • Unit - Create 1 Dummy Mending Souls for (Owner of TrigUnit) at TrigUnitPosition facing Default building facing degrees
      • Unit - Cause (Last created unit) to damage TrigUnit, dealing Life_HealthTransfer damage of attack type Chaos and damage type Normal
      • Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
      • Special Effect - Create a special effect attached to the origin of TrigUnit using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set life of TargetUnit to ((Life of TargetUnit) + Life_HealthTransfer)
      • Special Effect - Create a special effect attached to the origin of TargetUnit using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- ------------------------------- Cleaning Leaks ------------------------------- --------
      • Custom script: call RemoveLocation(udg_TrigUnitPosition)
 
Status
Not open for further replies.
Top