• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[Spell] Trigger based spell not dealing damage correctly

Status
Not open for further replies.
Level 1
Joined
May 30, 2015
Messages
5
  • Death Knight Life Transfer Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Life Transfer
    • Actions
      • Set LifeTransferCaster = (Casting unit)
      • Set LifeTransferTarget = (Target unit of ability being cast)
      • Lightning - Create a Drain Life lightning effect from source (Position of (Casting unit)) to target (Position of (Target unit of ability being cast))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • For each (Integer A) from 1 to 10, do (Actions)
            • Loop - Actions
              • Wait 1.00 seconds
              • Unit - Set life of LifeTransferTarget to ((Life of LifeTransferTarget) - ((Real((Strength of Death Knight 0124 <gen> (Include bonuses)))) - (Real((Strength of Death Knight 0124 <gen> (Include bonuses))))))
              • Unit - Set life of LifeTransferCaster to ((Life of LifeTransferCaster) - (Real((Strength of Death Knight 0124 <gen> (Include bonuses)))))
              • Lightning - Move (Last created lightning effect) to source (Position of LifeTransferCaster) and target (Position of LifeTransferTarget)
              • Special Effect - Create a special effect attached to the chest of LifeTransferTarget using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect attached to the chest of LifeTransferCaster using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
              • Special Effect - Destroy (Last created special effect)
              • Lightning - Destroy (Last created lightning effect)
        • Else - Actions
I need this spell to work like a sort of life drain except the damage is based on strength and it needs to damage the caster as well. The spell works just fine but for some reason it never deals any damage to the target. It needs to deal damage to the target equal to 2 times the strength of the hero and the hero needs to take damage equal to its strength. Damaging the hero works just fine. Any help is much appreciated!
 
Level 1
Joined
May 30, 2015
Messages
5
Well, Warcraft 3 waits and loops just don't work correctly.

Does that have to work only once at the same time?
From your Code i assume that only one Unit is able to use this Spell, cause you Refer to this preplace Death Knight.

Yes, only one unit is able to cast this spell with a cooldown of 30 seconds.
 
A working Template: Works only for one Unit at the same time, if casted again the old will be overwritten.
Here the Spells-Details:
[Box]
Not Channeled
Binds Lightning between Units
Per Second
Deals 2 x Str to Target
Deals Str to Caster​
10 sec Dur
Ends if One Unit is dead
Ends if Units Distance is above 800.
[/Box]


  • Life Transfer cast
    • Events
      • Unit - A unit Starts the effect of a Spell
    • Conditions
      • (Ability being cast) Equal Life Transfer
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Life_Drain_Reloads UnEqual 0
        • Then - Actions
          • Lightning - Destroy Life_Drain_Lightning
        • Else - Actions
      • Set Life_Drain_Intervall = 0.03
      • Set Life_Drain_Source = (Triggering unit)
      • Set Life_Drain_Target = (Target unit of ability being cast)
      • Set Life_Drain_Damage = ((Real((Kraft of Life_Drain_Source (Include bonuses)))) x Life_Drain_Intervall)
      • -------- Duration / Intervall --------
      • Set Life_Drain_Reloads = (Integer((10.00 / Life_Drain_Intervall)))
      • Set Loc = (Position of Life_Drain_Source)
      • Set Loc2 = (Position of Life_Drain_Target)
      • Lightning - Create a Todesfinger lightning effect from source Loc to target Loc2
      • Set Life_Drain_Lightning = (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Loc)
      • Custom script: call RemoveLocation(udg_Loc2)
      • Countdown-Timer - Start Life_Drain_Timer as a Einmalig timer that will expire in Life_Drain_Intervall seconds
  • Life Transfer action
    • Events
      • Time - Life_Drain_Timer expires
    • Conditions
    • Actions
      • Set Loc = (Position of Life_Drain_Source)
      • Set Loc2 = (Position of Life_Drain_Target)
      • Set Distance = (Distance between Loc and Loc2)
      • Lightning - Move Life_Drain_Lightning to source Loc and target Loc2
      • Custom script: call RemoveLocation(udg_Loc)
      • Custom script: call RemoveLocation(udg_Loc2)
      • Einheit - Cause Life_Drain_Source to damage Life_Drain_Target, dealing (2.00 x Life_Drain_Damage) damage of attack type Spell and damage type Magic
      • Einheit - Cause Life_Drain_Source to damage Life_Drain_Source, dealing Life_Drain_Damage damage of attack type Spell and damage type Magic
      • -------- Show Grafic only once a second --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life_Drain_Reloads mod 33) Equal 0
        • Then - Actions
          • Spezialeffekt - Create a special effect attached to the chest of Life_Drain_Source using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
          • Spezialeffekt - Destroy (Last created special effect)
          • Spezialeffekt - Create a special effect attached to the chest of Life_Drain_Target using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
          • Spezialeffekt - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Life_Drain_Reloads Greater as 0
          • (Life_Drain_Source is alive) Equal True
          • (Life_Drain_Target is alive) Equal True
          • Distance Smaller Equal 800.00
        • Then - Actions
          • Set Life_Drain_Reloads = (Life_Drain_Reloads - 1)
          • Countdown-Timer - Start Life_Drain_Timer as a Einmalig timer that will expire in Life_Drain_Intervall seconds
        • Else - Actions
          • Blitz - Destroy Life_Drain_Lightning
          • Set Life_Drain_Reloads = 0
Much Success with your Project. :)
 

Attachments

  • Life Transfer 1 Unit.w3x
    21.6 KB · Views: 39
Level 11
Joined
May 16, 2016
Messages
730
I need this spell to work like a sort of life drain except the damage is based on strength and it needs to damage the caster as well. The spell works just fine but for some reason it never deals any damage to the target. It needs to deal damage to the target equal to 2 times the strength of the hero and the hero needs to take damage equal to its strength. Damaging the hero works just fine. Any help is much appreciated!
This trigger is so naive.
Here is my template which allow all units to cast the life transfer not only one.
It doesn't deal damage to non-heroes because your request must depend on target's strength.
Mechanism is the target deals 2x of target's str and the caster deal 1x of target's str.
How to import manual is included.
 

Attachments

  • Channeling.w3x
    22.1 KB · Views: 32
Status
Not open for further replies.
Top