• 🏆 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] Healing target with a modified Life Drain spell

Status
Not open for further replies.
Level 9
Joined
Apr 4, 2004
Messages
519
What I'm trying to accomplish is to make a channeling spell that resembles Life Drain but with a few modifications.

1. It heals the targeted allied unit while channeling.
2. Instead of draining the caster's health, it'll consume X mana per second. Max 4 seconds.

As I understand it, the Life Drain/Mana Siphon spells won't allow this because they're hard coded to target enemy units. I've made a dummy ability for the hero based on the Channel spell, but I'm not experienced enough to make it work like I want it to.

Any and all help is appreciated. :)
 
Level 13
Joined
Jul 15, 2007
Messages
763
Drain Life can be configured to transfer the caster's health and mana to give the target health and mana respectively, i have seen a few custom maps where the spell functions like this.

You CAN'T make it give health per sec, cost mana per sec though, so you will have to trigger it if you want it like that.
 
Level 9
Joined
Apr 4, 2004
Messages
519
Indeed, which is why I need help with it. :)

It'd be nice to be able to make the spell stop if the caster runs out of mana as well. Otherwise it'd be way too abusable. :p
 
Level 9
Joined
Apr 4, 2004
Messages
519
So this is what I've got so far. It's still a work in progress but please feel free to add your contributions to it. :)

  • HealingSurge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Healing Surge (Enchanter)
    • Actions
      • Set HealingSurgeUnit = (Casting unit)
      • Set HealingSurgeTarget = (Target unit of ability being cast)
      • Trigger - Turn on HealingSurgeLoop <gen>
      • Trigger - Run HealingSurgeLoop <gen> (checking conditions)
  • HealingSurgeLoop
    • Events
      • Time - Every 0.05 seconds of the game
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of HealingSurgeUnit) equal to (Order(drain))
        • Then - Actions
          • Set HealingSurgeCount = (HealingSurgeCount +1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HealingSurgeCount Equal to 80
            • Then - Actions
              • Unit - Order HealingSurgeUnit to Stop
              • Set HealingSurgeCount = 0
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • For each (Integer HealingSurgeCount) from 1 to 80, do (Actions)
                • Loop - Actions
                  • Unit - Set life of HealingSurgeTarget to ((Life of HealingSurgeTarget) + 0.02)
                  • Unit - Set mana of HealingSurgeUnit to ((Mana of HealingSurgeUnit) - 0.02)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Mana of HealingSurgeUnit) Equal to 0
                • Then - Actions
                  • Unit - Order HealingSurgeUnit to Stop
                  • Set HealingSurgeCount = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
        • Else - Actions
I'm positive I've missed something. Unfortunately I can't think of it.

P.S

How do I add a life drain/siphon mana effect between the two units? The spell is based off of Channel and adding Lightning Effects to it does nothing. :/
 
Level 10
Joined
Apr 4, 2010
Messages
509
You will also need to check if the target gets out of range, so the link can be broken. Also you need to check if the target becomes magic immune to break the link. You also need to check if either the caster or the target is dead, otherwise the caster will drain from the dead body/the caster will drain when he is dead. Finally, you need to deal damage to the target, not drain his health, otherwise if the target dies from the health drain, the caster won't get the kill.
 
Level 9
Joined
Apr 4, 2004
Messages
519
Not sure if I understood that last part correctly?

*EDIT*

This is my current situation and there's a few problems. If the targeted unit is at max range (600), it won't be healed. And if it was in range and moves out further away it still continuously heals for the duration.

  • HealingSurgeLoop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set pHealingSurgeTarget = (Position of HealingSurgeTarget)
      • Set pHealingSurgeUnit = (Position of HealingSurgeUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of HealingSurgeUnit) Equal to (Order(drain))
          • (Distance between pHealingSurgeTarget and pHealingSurgeUnit) Less than or equal to 600.00
          • (HealingSurgeTarget is alive) Equal to True
          • (HealingSurgeUnit is alive) Equal to True
        • Then - Actions
          • Set HealingSurgeCount = (HealingSurgeCount + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • HealingSurgeCount Equal to 80
                  • (Life of HealingSurgeTarget) Equal to (Max life of HealingSurgeTarget)
                  • (Mana of HealingSurgeUnit) Equal to 0.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                • Then - Actions
                • Else - Actions
              • Game - Display to (All players) the text: STAHP
              • Unit - Order HealingSurgeUnit to Stop
              • Set HealingSurgeCount = 0
              • Custom script: call RemoveLocation (udg_pHealingSurgeTarget)
              • Custom script: call RemoveLocation (udg_pHealingSurgeUnit)
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • For each (Integer HealingSurgeCount) from 1 to 80, do (Actions)
                • Loop - Actions
                  • Unit - Set life of HealingSurgeTarget to ((Life of HealingSurgeTarget) + 0.02)
                  • Unit - Set mana of HealingSurgeUnit to ((Mana of HealingSurgeUnit) - 0.01)
        • Else - Actions
 
Last edited:
Level 10
Joined
Apr 4, 2010
Messages
509
This is not the same
  • Unit - Set life of (TARGET) to ((Life of (TARGET)) - 100.00)
as this
  • Unit - Cause (CASTER) to damage (TARGET), dealing 100.00 damage of attack type Spells and damage type Normal
EDIT: Oh, it's a friendly life drain, sorry for not reading it all, but this still applies if you want the life drain to target allies and enemies.
 
Level 9
Joined
Apr 4, 2004
Messages
519
I don't want it to cause damage, though. It's supposed to drain the caster's mana whilst healing the target's health for as long as it's channeling.
 
Level 9
Joined
Apr 4, 2004
Messages
519
I tried to change the breaking point to 700, but the caster still channels the ability after the fact. On the plus side, at the very least, the target unit doesn't heal as long as it is outside of the 700 range. :/

Current triggers:

  • HealingSurgeLoop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set pHealingSurgeTarget = (Position of HealingSurgeTarget)
      • Set pHealingSurgeUnit = (Position of HealingSurgeUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of HealingSurgeUnit) Equal to (Order(drain))
          • (Distance between pHealingSurgeTarget and pHealingSurgeUnit) Less than or equal to 700.00
          • (HealingSurgeTarget is alive) Equal to True
          • (HealingSurgeUnit is alive) Equal to True
        • Then - Actions
          • Set HealingSurgeCount = (HealingSurgeCount + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • HealingSurgeCount Equal to 80
                  • (Life of HealingSurgeTarget) Equal to (Max life of HealingSurgeTarget)
                  • (Mana of HealingSurgeUnit) Equal to 0.00
            • Then - Actions
              • Unit - Order HealingSurgeUnit to Stop
              • Game - Display to (All players) the text: STAHP
              • Custom script: call RemoveLocation (udg_pHealingSurgeTarget)
              • Custom script: call RemoveLocation (udg_pHealingSurgeUnit)
              • Set HealingSurgeCount = 0
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • For each (Integer HealingSurgeCount) from 1 to 80, do (Actions)
                • Loop - Actions
                  • Unit - Set life of HealingSurgeTarget to ((Life of HealingSurgeTarget) + 0.02)
                  • Unit - Set mana of HealingSurgeUnit to ((Mana of HealingSurgeUnit) - 0.01)
        • Else - Actions
 
Level 10
Joined
Apr 4, 2010
Messages
509
Well that was an easy fix. All I did was copy and paste something.
  • HealingSurgeLoop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set pHealingSurgeTarget = (Position of HealingSurgeTarget)
      • Set pHealingSurgeUnit = (Position of HealingSurgeUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of HealingSurgeUnit) Equal to (Order(drain))
          • (Distance between pHealingSurgeUnit and pHealingSurgeTarget) Less than or equal to 700.00
          • (HealingSurgeTarget is alive) Equal to True
          • (HealingSurgeUnit is alive) Equal to True
        • Then - Actions
          • Set HealingSurgeCount = (HealingSurgeCount + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • HealingSurgeCount Equal to 80
                  • (Life of HealingSurgeTarget) Equal to (Max life of HealingSurgeTarget)
                  • (Mana of HealingSurgeUnit) Equal to 0.00
            • Then - Actions
              • Set HealingSurgeCount = 0
              • Unit - Order HealingSurgeUnit to Stop
              • Game - Display to (All players) the text: STAHP
              • Custom script: call RemoveLocation (udg_pHealingSurgeTarget)
              • Custom script: call RemoveLocation (udg_pHealingSurgeUnit)
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • For each (Integer HealingSurgeCount) from 1 to 80, do (Actions)
                • Loop - Actions
                  • Unit - Set life of HealingSurgeTarget to ((Life of HealingSurgeTarget) + 0.02)
                  • Unit - Set mana of HealingSurgeUnit to ((Mana of HealingSurgeUnit) - 0.01)
        • Else - Actions
          • Set HealingSurgeCount = 0
          • Unit - Order HealingSurgeUnit to Stop
          • Game - Display to (All players) the text: STAHP
          • Custom script: call RemoveLocation (udg_pHealingSurgeTarget)
          • Custom script: call RemoveLocation (udg_pHealingSurgeUnit)
          • Trigger - Turn off (This trigger)
EDIT: I've attached your testmap back. I added a lighting beam. If you want to make your spells MUI, you should check out this tutorial :fp:http://www.hiveworkshop.com/forums/...orials-279/visualize-dynamic-indexing-241896/
 

Attachments

  • DarkeyTest.w3x
    14.9 KB · Views: 40
Level 9
Joined
Apr 4, 2004
Messages
519
Oh wow, was it really that easy? X_x Thanks a lot for the help! :)

I've still got the dilemma of making a lightning effect between the two units like with Siphon Mana/Life Drain. Any suggestions?
 
Level 9
Joined
Apr 4, 2004
Messages
519
Ah, thank you. I'll look into MUI, although it wouldn't be a necessity in my map. Couldn't hurt. :)
 
Level 9
Joined
Apr 4, 2004
Messages
519
Alrighty. I've dabbled a bit with Arrays and done my best to apply it to this spell.

  • HealingSurge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Healing Surge (Enchanter)
    • Actions
      • Set Spell_Index = (Spell_Index + 1)
      • Set HealingSurgeSpell[Spell_Index] = (Ability being cast)
      • Set HealingSurgeUnit[Spell_Index] = (Casting unit)
      • Set HealingSurgeTarget[Spell_Index] = (Target unit of ability being cast)
      • Set HealingSurgeCount[Spell_Index] = 0
      • Set pHealingSurgeUnit[Spell_Index] = (Position of HealingSurgeUnit[Spell_Index])
      • Set pHealingSurgeTarget[Spell_Index] = (Position of HealingSurgeTarget[Spell_Index])
      • Lightning - Create a Healing Wave - Secondary lightning effect from source pHealingSurgeUnit[Spell_Index] to target pHealingSurgeTarget[Spell_Index]
      • Set HealingSurgeLink[Spell_Index] = (Last created lightning effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Spell_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on HealingSurgeLoop <gen>
        • Else - Actions
  • HealingSurgeLoop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set pHealingSurgeUnit[Spell_Index] = (Position of HealingSurgeUnit[Spell_Index])
      • Set pHealingSurgeTarget[Spell_Index] = (Position of HealingSurgeTarget[Spell_Index])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of HealingSurgeUnit[Spell_Index]) Equal to (Order(drain))
          • (Distance between pHealingSurgeUnit[Spell_Index] and pHealingSurgeTarget[Spell_Index]) Less than or equal to 650.00
        • Then - Actions
          • Set HealingSurgeCount[Spell_Index] = (HealingSurgeCount[Spell_Index] + 1)
          • Lightning - Move HealingSurgeLink[Spell_Index] to source pHealingSurgeUnit[Spell_Index] and target pHealingSurgeTarget[Spell_Index]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • HealingSurgeCount[Spell_Index] Equal to 80
                  • (Life of HealingSurgeTarget[Spell_Index]) Equal to (Max life of HealingSurgeTarget[Spell_Index])
                  • (Mana of HealingSurgeUnit[Spell_Index]) Equal to 0.00
            • Then - Actions
              • Set HealingSurgeCount[Spell_Index] = 0
              • Unit - Order HealingSurgeUnit[Spell_Index] to Stop
              • Game - Display to (All players) the text: STAHP
              • Lightning - Destroy HealingSurgeLink[Spell_Index]
              • Set HealingSurgeCount[Spell_Index] = -1
              • Set Spell_Index = (Spell_Index - 1)
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • For each (Integer HealingSurgeCount[Spell_Index]) from 1 to 80, do (Actions)
                • Loop - Actions
                  • Unit - Set life of HealingSurgeTarget[Spell_Index] to ((Life of HealingSurgeTarget[Spell_Index]) + ((Real((Level of HealingSurgeSpell[Spell_Index] for HealingSurgeUnit[Spell_Index]))) x 0.03))
                  • Unit - Set mana of HealingSurgeUnit[Spell_Index] to ((Mana of HealingSurgeUnit[Spell_Index]) - ((Real((Level of HealingSurgeSpell[Spell_Index] for HealingSurgeUnit[Spell_Index]))) x 0.02))
        • Else - Actions
          • Set HealingSurgeCount[Spell_Index] = 0
          • Unit - Order HealingSurgeUnit[Spell_Index] to Stop
          • Game - Display to (All players) the text: STAHP
          • Lightning - Destroy HealingSurgeLink[Spell_Index]
          • Set HealingSurgeCount[Spell_Index] = -1
          • Set Spell_Index = (Spell_Index - 1)
          • Trigger - Turn off (This trigger)
The effect I'm currently getting is that once a second hero with the same spell casts Healing Surge, it replaces the previous one while retaining the Lightning Effect. Only the last cast instance of the spell will heal. I've done my best following the guide you provided but I'm a little lost at the solution of this problem. :)
 
Last edited by a moderator:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Use Damage Engine: http://www.hiveworkshop.com/forums/spells-569/gui-damage-engine-v3-5-4-1-a-201016/

That way, you don't have to trigger things like the leash.

  • Life Supplement
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to True
      • (DamageEventSource has buff Drain Life (Caster)) Equal to True
      • (DamageEventTarget has buff Drain Life (Target)) Equal to True
      • DamageEventSource is an enemy of DamageEventTarget Equal to False
    • Actions
      • If (all conditions are true)
        • If - Conditions
          • (Mana of DamageEventSource) Greater than or equal to 10.00
        • Then - Actions
          • Set DamageEventAmount = (0.00 - DamageEventAmount)
          • Unit - Set Mana of DamageEventSource to (Mana of DamageEventSource - 10.00)
        • Else - Actions
          • Set DamageEventAmount = 0.00
          • Unit - Order DamageEventSource to stop
 
Level 9
Joined
Apr 4, 2004
Messages
519
Baby steps, I think. I'm already having a hard enough time understanding my own triggers without adding another system on top of it. :p
 
Level 9
Joined
Apr 4, 2004
Messages
519
I actually tried that method after I had posted but I also screwed around with the triggers a bit so it still won't work. :/

  • HealingSurge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Healing Surge (Enchanter)
    • Actions
      • Set Spell_Index = (Spell_Index + 1)
      • Set HealingSurgeCaster[Spell_Index] = (Triggering unit)
      • Set HealingSurgeTarget[Spell_Index] = (Target unit of ability being cast)
      • Set HealingSurgeSpell[Spell_Index] = (Ability being cast)
      • Set pHealingSurgeUnit[Spell_Index] = (Position of HealingSurgeCaster[Spell_Index])
      • Set pHealingSurgeTarget[Spell_Index] = (Position of HealingSurgeTarget[Spell_Index])
      • Lightning - Create a Healing Wave - Secondary lightning effect from source pHealingSurgeUnit[Spell_Index] to target pHealingSurgeTarget[Spell_Index]
      • Set HealingSurgeLink[Spell_Index] = (Last created lightning effect)
      • Set HealingSurgeCount[Spell_Index] = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Spell_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on HealingSurgeLoop <gen>
        • Else - Actions
  • HealingSurgeLoop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HealingSurge_Loop_Integer) from 1 to Spell_Index, do (Actions)
        • Loop - Actions
          • Set pHealingSurgeUnit[Spell_Index] = (Position of HealingSurgeCaster[Spell_Index])
          • Set pHealingSurgeTarget[Spell_Index] = (Position of HealingSurgeTarget[Spell_Index])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of HealingSurgeCaster[Spell_Index]) Equal to (Order(drain))
              • (Distance between pHealingSurgeUnit[Spell_Index] and pHealingSurgeTarget[Spell_Index]) Less than or equal to 650.00
            • Then - Actions
              • Set HealingSurgeCount[Spell_Index] = (HealingSurgeCount[Spell_Index] + 1)
              • Lightning - Move HealingSurgeLink[Spell_Index] to source pHealingSurgeUnit[Spell_Index] and target pHealingSurgeTarget[Spell_Index]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • HealingSurgeCount[Spell_Index] Equal to 40
                      • (Life of HealingSurgeTarget[Spell_Index]) Equal to (Max life of HealingSurgeTarget[Spell_Index])
                      • (Mana of HealingSurgeCaster[Spell_Index]) Equal to 0.00
                • Then - Actions
                  • Set HealingSurgeCount[Spell_Index] = 0
                  • Unit - Order HealingSurgeCaster[Spell_Index] to Stop
                  • Game - Display to (All players) the text: STAHP
                  • Lightning - Destroy HealingSurgeLink[Spell_Index]
                  • Set Spell_Index = (Spell_Index - 1)
                  • Set HealingSurge_Loop_Integer = (HealingSurge_Loop_Integer - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Spell_Index Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • For each (Integer HealingSurgeCount[Spell_Index]) from 1 to 40, do (Actions)
                    • Loop - Actions
                      • Unit - Set life of HealingSurgeTarget[Spell_Index] to ((Life of HealingSurgeTarget[Spell_Index]) + ((Real((Level of HealingSurgeSpell[Spell_Index] for HealingSurgeCaster[Spell_Index]))) x 0.03))
                      • Unit - Set mana of HealingSurgeCaster[Spell_Index] to ((Mana of HealingSurgeCaster[Spell_Index]) - ((Real((Level of HealingSurgeSpell[Spell_Index] for HealingSurgeCaster[Spell_Index]))) x 0.02))
            • Else - Actions
              • Set HealingSurgeCount[Spell_Index] = 0
              • Unit - Order HealingSurgeCaster[Spell_Index] to Stop
              • Game - Display to (All players) the text: STAHP
              • Lightning - Destroy HealingSurgeLink[Spell_Index]
              • Set Spell_Index = (Spell_Index - 1)
              • Set HealingSurge_Loop_Integer = (HealingSurge_Loop_Integer - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Spell_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Last edited by a moderator:
Level 10
Joined
Apr 4, 2010
Messages
509
This part should just be Integer A
  • For each (Integer HealingSurgeCount[Spell_Index]) from 1 to 40, do (Actions)
Also, you need to de-index every variable involved. You also need to HealingSurgeLoop_Integer instead of Spell_Index for every action in the HealingSurgeLoop trigger. Just take a look at the tutorial again. If it doesn't work, compare your triggers with the tutorial triggers.
 
Level 9
Joined
Apr 4, 2004
Messages
519
Sorry I haven't been replying but life got in the way. But now I'm back and I've tried my best to update the coding for the spell. It works, to some degree, but if I have more than one instance running at the same time, the game will crash.

  • HealingSurgeSpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Healing Surge (Enchanter)
    • Actions
      • Set HS_Index = (HS_Index + 1)
      • Set HS_Caster[HS_Index] = (Triggering unit)
      • Set HS_Target[HS_Index] = (Target unit of ability being cast)
      • Set HS_Spell[HS_Index] = (Ability being cast)
      • Set HS_Counter[HS_Index] = 0
      • Set pHS_Unit[HS_Index] = (Position of HS_Caster[HS_Index])
      • Set pHS_Target[HS_Index] = (Position of HS_Target[HS_Index])
      • Lightning - Create a Healing Wave - Secondary lightning effect from source pHS_Unit[HS_Index] to target pHS_Target[HS_Index]
      • Set HS_Link[HS_Index] = (Last created lightning effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HS_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on HealingSurgeSpellLoop <gen>
        • Else - Actions
  • HealingSurgeSpellLoop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HS_Loop_Integer) from 1 to HS_Index, do (Actions)
        • Loop - Actions
          • Unit - Set mana of HS_Caster[HS_Loop_Integer] to ((Mana of HS_Caster[HS_Loop_Integer]) - (2.00 x (Real((Level of HS_Spell[HS_Index] for HS_Caster[HS_Index])))))
          • Unit - Set life of HS_Target[HS_Loop_Integer] to ((Life of HS_Target[HS_Loop_Integer]) + (3.00 x (Real((Level of HS_Spell[HS_Index] for HS_Caster[HS_Index])))))
          • Set HS_Counter[HS_Loop_Integer] = (HS_Counter[HS_Loop_Integer] + 1)
          • Set pHS_Unit[HS_Index] = (Position of HS_Caster[HS_Index])
          • Set pHS_Target[HS_Index] = (Position of HS_Target[HS_Index])
          • Lightning - Move HS_Link[HS_Index] to source pHS_Unit[HS_Index] and target pHS_Target[HS_Index]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • HS_Counter[HS_Loop_Integer] Greater than or equal to 40
                  • (HS_Caster[HS_Index] is dead) Equal to True
                  • (HS_Target[HS_Index] is dead) Equal to True
                  • (Mana of HS_Caster[HS_Index]) Less than or equal to 0.00
            • Then - Actions
              • Lightning - Destroy HS_Link[HS_Index]
              • Set HS_Caster[HS_Loop_Integer] = HS_Caster[HS_Index]
              • Set HS_Target[HS_Loop_Integer] = HS_Target[HS_Index]
              • Set HS_Counter[HS_Loop_Integer] = HS_Counter[HS_Index]
              • Set HS_Link[HS_Loop_Integer] = HS_Link[HS_Index]
              • Set HS_Link[HS_Loop_Integer] = HS_Link[HS_Index]
              • Set HS_Link[HS_Loop_Integer] = HS_Link[HS_Index]
              • Set HS_Spell[HS_Loop_Integer] = HS_Spell[HS_Index]
              • Set HS_Loop_Integer = (HS_Loop_Integer - 1)
              • Set HS_Index = (HS_Index - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HS_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Last edited by a moderator:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
You're using a primitive indexing method and are getting crashes due to mishandling of destroyed lightning handles.

Using http://www.hiveworkshop.com/forums/spells-569/gui-spell-system-v1-2-3-2-a-273415/, you can save yourself the trouble with indexing.

If either unit is moving, the lightning will look jittery. Use 0.03 instead.

These may be interesting to you:

http://www.hiveworkshop.com/forums/...0-a-204927/?prev=search=lightning&d=list&r=20
http://www.hiveworkshop.com/forums/...1-a-205105/?prev=search=lightning&d=list&r=20
 
Level 9
Joined
Apr 4, 2004
Messages
519
There's been a slight change in how the spell works now. Both the caster and the target will be able to move while the spell is active. The only problem I have is the spell crashing the game.

Bribe mentioned it's because the lightning handles aren't optimal, but I have no experience with Jass or vJass so I'm left in the dark as how to implement a viable system. :/
 
Status
Not open for further replies.
Top