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

Spell isn't dealing any damage!!!

Status
Not open for further replies.
Level 13
Joined
Oct 16, 2010
Messages
731
For whatever reason my spell i've made doesn't deal any damage.

The ability makes blades circle the caster and they hit enemy land units, breaking and dealing damage.

All of it works other than when the blades break they don't do any damage and I don't know why!!!

Here's the triggers:

  • Spinning Blades Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spinning Blades
    • Actions
      • Set TempUnit = (Casting unit)
      • Set TempInt = ((4 + (1 x (Level of Spinning Blades for TempUnit))) + ((Agility of TempUnit (Include bonuses)) / 50))
      • Set Spell_CasterPoint = (Position of TempUnit)
      • For each (Integer A) from 1 to TempInt, do (Actions)
        • Loop - Actions
          • Set SB_MaxIndex = (SB_MaxIndex + 1)
          • Set SB_CasterUnit[SB_MaxIndex] = TempUnit
          • Set SB_Angle[SB_MaxIndex] = ((360.00 / (Real(TempInt))) x (Real((Integer A))))
          • Set Spell_TargetPoint = (Spell_CasterPoint offset by 250.00 towards SB_Angle[SB_MaxIndex] degrees)
          • Unit - Create 1 Dummy (Spinning Blades) for (Owner of TempUnit) at Spell_TargetPoint facing (SB_Angle[SB_MaxIndex] + 90.00) degrees
          • Set SB_DummyUnit[SB_MaxIndex] = (Last created unit)
          • Set SB_Dmg[SB_MaxIndex] = ((50.00 + (50.00 x (Real((Level of Spinning Blades for SB_CasterUnit[SB_MaxIndex]))))) + ((Real((Agility of SB_CasterUnit[SB_MaxIndex] (Include bonuses)))) x (5.00 + (5.00 x (Real((Level of Spinning Blades for SB_CasterUnit[SB_MaxIndex])))))))
          • Special Effect - Create a special effect at Spell_TargetPoint using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_Spell_TargetPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SB_MaxIndex Greater than or equal to 1
        • Then - Actions
          • Trigger - Turn on Spinning Blades Loop <gen>
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Spell_CasterPoint)
  • Spinning Blades Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SB_LoopInt) from 1 to SB_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (SB_CasterUnit[SB_LoopInt] is alive) Equal to True
            • Then - Actions
              • Set Spell_CasterPoint = (Position of SB_CasterUnit[SB_LoopInt])
              • Set SB_Angle[SB_LoopInt] = (SB_Angle[SB_LoopInt] + 4.00)
              • Set Spell_TargetPoint = (Spell_CasterPoint offset by 250.00 towards SB_Angle[SB_LoopInt] degrees)
              • Unit - Move SB_DummyUnit[SB_LoopInt] instantly to Spell_TargetPoint, facing (SB_Angle[SB_LoopInt] + 90.00) degrees
              • Set Spell_UnitGroup = (Units within 100.00 of Spell_TargetPoint matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of SB_CasterUnit[SB_LoopInt])) Equal to True))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Spell_UnitGroup) Greater than or equal to 1
                • Then - Actions
                  • Set Spell_TargetUnit = (Random unit from TempUnitGroup)
                  • Unit - Cause SB_CasterUnit[SB_LoopInt] to damage Spell_TargetUnit, dealing SB_Dmg[SB_LoopInt] damage of attack type Spells and damage type Universal
                  • Unit - Kill SB_DummyUnit[SB_LoopInt]
                  • -------- DeIndex --------
                  • Set SB_Angle[SB_LoopInt] = SB_Angle[SB_MaxIndex]
                  • Set SB_CasterUnit[SB_LoopInt] = SB_CasterUnit[SB_MaxIndex]
                  • Set SB_Dmg[SB_LoopInt] = SB_Dmg[SB_MaxIndex]
                  • Set SB_DummyUnit[SB_LoopInt] = SB_DummyUnit[SB_MaxIndex]
                  • Set SB_MaxIndex = (SB_MaxIndex - 1)
                  • Set SB_LoopInt = (SB_LoopInt - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SB_MaxIndex Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
              • Custom script: call RemoveLocation(udg_Spell_CasterPoint)
              • Custom script: call RemoveLocation(udg_Spell_TargetPoint)
              • Custom script: call DestroyGroup(udg_Spell_UnitGroup)
            • Else - Actions
              • -------- DeIndex --------
              • Set SB_Angle[SB_LoopInt] = SB_Angle[SB_MaxIndex]
              • Set SB_CasterUnit[SB_LoopInt] = SB_CasterUnit[SB_MaxIndex]
              • Set SB_Dmg[SB_LoopInt] = SB_Dmg[SB_MaxIndex]
              • Set SB_DummyUnit[SB_LoopInt] = SB_DummyUnit[SB_MaxIndex]
              • Set SB_MaxIndex = (SB_MaxIndex - 1)
              • Set SB_LoopInt = (SB_LoopInt - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SB_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
EDIT: Sorted, the target was being set as a random unit from the wrong group!!!
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
Don't use integer A/B. They are slower and less efficient than your own custom integer.

Move your ITE check for when to turn on the second trigger to the top. Then change SB_MaxIndex Greater than or equal to 1 to SB_MaxIndex Greater Equal to 0
Currently it turns it on every time the trigger runs.

Anything used twice or more should be stored into a variable and the variable should be used.

Your problem is this.
  • Set Spell_TargetUnit = (Random unit from TempUnitGroup)
You use Spell_UnitGroup to store the units in and TempUnitGroup to pick the unit out of. You have to change one of these over so that you pick from the same unit group.
This will work.
  • Set Spell_TargetUnit = (Random unit from Spell_UnitGroup)
 
Status
Not open for further replies.
Top