• 🏆 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!

triggered missle not damaging

Status
Not open for further replies.
Level 4
Joined
Feb 22, 2012
Messages
74
My triggered spell is not working. It does everything correctly, except it does not deal the damage to enemy units.

Here is the spell tooltip for reference:
Fires a projectile that explodes on impact with an enemy, dealing 20-60 elemental damage based on distance. Deals maximum damage beyond 1600 range.

Range: 2400
Radius: 300
Cooldown: 2

This part is in the middle of the second trigger.

And here are my global variables so it is easier to understand:
ATElemental = Magic
DTElemental = Magic
intervalAbilityProjectile = 0.04
sorFlameSpearCollision = 40.00
sorFlameSpearDMax = 60.00
sorFlameSpearDMin = 20.00
sorFlameSpearRadius = 300.00
sorFlameSpearRange = 2400.00
sorFlameSpearScaleRange = 1600.00
sorFlameSpearSMin = 400.00
sorFlameSpearSInc = 1.50

  • Flame Spear Cast
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Cast Flame Spear
      • Set tempLoc[0] = (Position of (Triggering unit))
      • Set tempLoc[1] = (Target point of ability being cast)
      • Set tempReal[0] = (Angle from tempLoc[0] to tempLoc[1])
      • Custom script: call RemoveLocation(udg_tempLoc[1])
      • Set tempReal[1] = (sorFlameSpearSMin x intervalAbilityProjectile)
      • Set tempLoc[2] = (tempLoc[0] offset by tempReal[1] towards tempReal[0] degrees)
      • Custom script: call RemoveLocation(udg_tempLoc[0])
      • Unit - Create 1 sorFlameSpearMissle for (Owner of (Triggering unit)) at tempLoc[2] facing tempReal[0] degrees
      • Custom script: call RemoveLocation(udg_tempLoc[2])
      • Hashtable - Save Handle Of(Triggering unit) as (Key source) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save sorFlameSpearDMin as (Key damage) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save sorFlameSpearDMin as (Key mindamage) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save sorFlameSpearDMax as (Key maxdamage) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save (sorFlameSpearSMin x intervalAbilityProjectile) as (Key speed) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save sorFlameSpearSInc as (Key speedinc) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save 0.00 as (Key distance) of (Key (Last created unit)) in sorFlameSpearHash
      • Hashtable - Save tempReal[0] as (Key angle) of (Key (Last created unit)) in sorFlameSpearHash
      • Unit Group - Add (Last created unit) to sorFlameSpearMGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Flame Spear Missle <gen> is on) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: Flame Spear - On
          • Trigger - Turn on Flame Spear Missle <gen>
        • Else - Actions
  • Flame Spear Missle
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (sorFlameSpearMGroup is empty) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Flame Spear - Off
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in sorFlameSpearMGroup and do (Actions)
            • Loop - Actions
              • Set tempReal[0] = (Load (Key distance) of (Key (Picked unit)) from sorFlameSpearHash)
              • Set tempLoc[0] = (Position of (Picked unit))
              • Set tempGroup = (Units within sorFlameSpearCollision of tempLoc[0] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • tempReal[0] Greater than or equal to sorFlameSpearRange
                      • (tempGroup is empty) Equal to False
                • Then - Actions
                  • Custom script: call DestroyGroup(udg_tempGroup)
                  • Set tempInt[0] = (Key (Picked unit))
                  • Set tempReal[0] = (Load (Key damage) of tempInt[0] from sorFlameSpearHash)
                  • Set tempGroup = (Units within sorFlameSpearRadius of tempLoc[0] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (Load (Key source) of tempInt[0] in sorFlameSpea
                  • Unit Group - Pick every unit in tempGroup and do (Actions)
                    • Loop - Actions
                      • Unit - Cause (Load (Key source) of tempInt[0] in sorFlameSpearHash) to damage (Picked unit), dealing tempReal[0] damage of attack type ATElemental and damage type DTElemental
                      • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Unit Group - Remove (Picked unit) from tempGroup
                  • Custom script: call DestroyGroup(udg_tempGroup)
                  • Unit Group - Remove (Picked unit) from sorFlameSpearMGroup
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in sorFlameSpearHash
                  • Unit - Kill (Picked unit)
                • Else - Actions
                  • Custom script: call DestroyGroup(udg_tempGroup)
                  • Set tempLoc[1] = (tempLoc[0] offset by (Load (Key speed) of (Key (Picked unit)) from sorFlameSpearHash) towards (Load (Key angle) of (Key (Picked unit)) from sorFlameSpearHash) degrees)
                  • Unit - Move (Picked unit) instantly to tempLoc[1]
                  • Custom script: call RemoveLocation(udg_tempLoc[1])
                  • Hashtable - Save ((Load (Key distance) of (Key (Picked unit)) from sorFlameSpearHash) + (Load (Key speed) of (Key (Picked unit)) from sorFlameSpearHash)) as (Key distance) of (Key (Picked unit)) in sorFlameSpearHash
                  • Hashtable - Save ((Load (Key mindamage) of (Key (Picked unit)) from sorFlameSpearHash) + (((Load (Key maxdamage) of (Key (Picked unit)) from sorFlameSpearHash) - (Load (Key mindamage) of (Key (Picked unit)) from sorFlameSpearHash)) x ((Load (Key distance) of (Key (Picked unit as (Key damage) of (Key (Picked unit)) in sorFlameSpearHash
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Key damage) of (Key (Picked unit)) from sorFlameSpearHash) Greater than (Load (Key maxdamage) of (Key (Picked unit)) from sorFlameSpearHash)
                    • Then - Actions
                      • Hashtable - Save (Load (Key maxdamage) of (Key (Picked unit)) from sorFlameSpearHash) as (Key damage) of (Key (Picked unit)) in sorFlameSpearHash
                    • Else - Actions
                  • Hashtable - Save ((Load (Key speed) of (Key (Picked unit)) from sorFlameSpearHash) + (Load (Key speedinc) of (Key (Picked unit)) from sorFlameSpearHash)) as (Key speed) of (Key (Picked unit)) in sorFlameSpearHash
              • Custom script: call RemoveLocation(udg_tempLoc[0])
 

Attachments

  • sorc_test.w3x
    47 KB · Views: 44
Status
Not open for further replies.
Top