• 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.

[JASS] Wc2 style Death Coil

Status
Not open for further replies.
Level 23
Joined
Nov 20, 2005
Messages
1,251
Hello. I had suggestion to edit Life Drain for this kind of spell, but what about if i build a trigger that does the trick? I thought JASS would fit better, because of leakless properties, but here's the scenario:
A unit cast the Death Coil spell, damages the target, and gets healed for the corrisponding inflicted damage.
Can someone help me with this, please?
Also, i need another trigger that heals a unit everytime it takes any damage while it's under the effect of a buff.
Thank you.
 
Level 8
Joined
Oct 3, 2008
Messages
189
Inflicted damage after armor / spell reduction and all that have been applied?

Second one in pseudocode:

When a unit receives the buff you add the "unit takes damage event" for them to the next trigger.

Code:
event: blabla is damaged.
actions: if,then,else
if unit has buff
set unit health to max of max health / unit health + X
else
remove unit event from this trigger

Will write out a proper version later today when I'm home.
 
Last edited:
Level 23
Joined
Nov 20, 2005
Messages
1,251
Do you want your spell to just do X damage and heal X; or do you want the healing to be the exact amount of damage the target received? E.g. if the enemy has a damage reduction ability like Resistant Skin they'll receive less damage.

(Also there's nothing about JASS that makes it inherently leakless.)
Yes, just the effective damage the target received. For example if the spell does 100 damage and the target had 40 health, it would heal 40hp.
 
Level 8
Joined
Oct 3, 2008
Messages
189
Code:
Reactive Healing Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Inner Fire
    Actions
        Trigger - Add to Reactive Healing Damage <gen> the event (Unit - (Target unit of ability being cast) Takes damage)

Code:
Reactive Healing Damage
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has buff Inner Fire) Equal to True
            Then - Actions
                Unit - Set life of (Triggering unit) to (Max(((Life of (Triggering unit)) + 25.00), (Max life of (Triggering unit))))
            Else - Actions
 
Status
Not open for further replies.
Top