• 🏆 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] Siphon Life / Mana

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
I want to make a custom Siphon skill that is cast and then works for its duration without channeling. I also want it to stack for the caster, meaning:

Caster uses siphon on enemy A
Enemy A loses 10HP/s + Caster gains 10HP/s
Caster uses siphon on enemy B before the siphon on A ends
Enemies A + B lose 10HP/s each + Caster gains 20HP/s
---
Caster uses siphon on enemy C
Enemy A loses 10HP/s + Caster gains 10HP/s
Caster uses siphon again on enemy C before siphon is finished
Siphon duration on enemy C is refreshed but still only siphons 10HP/s
 
You can do something like:
  • Trigger1
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Siphon Life/Mana
  • Actions
    • Set Unit1 = (Triggering unit)
    • Set Unit2 = (Target unit of ability being cast)
    • Unit Group - Add Unit1 to (AlreadySiphoned)
  • Trigger2
  • Events
    • Time - Every 1.00 second of game-time
  • Conditions
    • ((AlreadySiphoned) is Empty) Equal to False)
  • Actions
    • Unit - Set life of (Unit1) to (((Life of (Unit1)) + (10 * (Number of units in (AlreadySiphoned))
    • Unit Group - Pick up every unit in (AlreadySiphoned) and do (Actions)
      • Loop - Actions
        • Unit - Set life of (Picked unit) to (((Life of (Picked unit)) - 10)
Well, the part that i am stuck with, is when to remove the Unit2 from the Unit Group, so that it won't replenish any more hp for the caster.
 
Level 8
Joined
Apr 30, 2009
Messages
338
How about working with your trigger I do the following:

--Make the spell place a buff on the target for the duration.
--Set the looping trigger to run every 0.10 seconds and remove 1 health.
--Make the looping trigger check if the picked unit has the buff.
--If not, remove it from the group.

This way it would stop when a unit loses the buff or dies. Would that work then?

**Edit**
To keep the 0.10 second loop from running when there is no siphon, have trigger 1 check if the group has units; if so, turn on trigger 2.
Trigger 2 has a check at the end to see if any units are in the group; if no, turn off this trigger.
 
That is good actually! You can base the spell off cripple, to give it a buff. Then, yes, check the buff, like this (from the second trigger):
  • Trigger2
  • Events
    • Time - Every 1.00 second of game-time
  • Conditions
    • ((AlreadySiphoned) is Empty) Equal to False)
  • Actions
    • Unit - Set life of (Unit1) to (((Life of (Unit1)) + (10 * (Number of units in (AlreadySiphoned))
    • Unit Group - Pick up every unit in (AlreadySiphoned) and do (Actions)
      • Loop - Actions
        • If/Then/ Else
          • If (Conditions)
            • ((Picked unit) has Buff (x)) Equal to True
          • Then (Actions)
            • Unit - Set life of (Picked unit) to (((Life of (Picked unit)) - 10)
          • Else (Actions
            • Unit - Remove (Picked unit) from (AlreadySiphoned)
How come i couldn't think of that? :p
 
Status
Not open for further replies.
Top