• 🏆 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] Soul Siphon (Math formula)

Status
Not open for further replies.
Level 3
Joined
Mar 15, 2020
Messages
48
*EDIT 2.0*

I've got yet another problem involving the same hero. This time it's math related.

I've a unit spell that drains 50% of the targets current health and converts it into mana for the caster.
  • Set VariableSet Replenish = ((Life of tempTarget) / 2.00)
That's easy enough.
The twist is that I'd like to add 10% extra for each level of another ability.

So let's say the hero ability is 5, it would then become 50%+50%=100%.
What would the proper formula to take into account if the hero first has that ability learnt and then add 10% on top of the 50% for each level the ability has?

  • D Soul Siphon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Soul Siphon (Rothin)
    • Actions
      • Set VariableSet tempTarget = (Target unit of ability being cast)
      • Set VariableSet Replenish = ((Life of tempTarget) / 2.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Soul Conduit (Rothin) for (Triggering unit)) Greater than 0
        • Then - Actions
          • Set VariableSet Replenish = (Replenish + (((Real((Level of Soul Conduit (Rothin) for (Triggering unit)))) x 100.00) / 2.00))
        • Else - Actions
      • Floating Text - Create floating text that reads (+ + (String(Replenish))) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
      • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + Replenish)
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing Replenish damage of attack type Chaos and damage type Universal
This is what I've got so far and the formula is far from correct. Do I need to make use of a conditions check at all?
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,515
  • Actions
    • Set VariableSet Level = (Level of Soul Conduit for (Triggering unit))
    • Set VariableSet Replenish = (0.50 - (0.10 x (Real(Level))))
    • Set VariableSet Replenish = ((Life of (Target unit of ability being cast)) x (1.00 - Replenish))
    • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + Replenish)
    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing Replenish damage of attack type Chaos and damage type Universal
I'm pretty sure Level will be set to 0 if Soul Conduit is unlearned.
 
Status
Not open for further replies.
Top