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

[Solved] Single Target Projectile - MUI Spell

Status
Not open for further replies.
Level 4
Joined
Sep 25, 2018
Messages
81
How would I go about triggering a single targeted MUI projectile spell? The damage of the spell must be applied by a trigger as soon as the target receives a debuff.

Any help would be much appreciated!
 
Level 8
Joined
Jun 13, 2012
Messages
336
maybe check when that ability is being casted then set variables to targeted unit and run a new trigger that checks every 0.1 second if the unit has the debuff then apply that dmg.

also you might wanna do array of that variable in case it gets casted multiple times before the unit gets the debuff.
 
Level 4
Joined
Sep 25, 2018
Messages
81
  • FrostboltNukeDamage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frostbolt
    • Actions
      • -------- Unit casting the ability --------
      • Set Frostbolt_Cast = (Casting unit)
      • -------- The target of the ability --------
      • Set Frostbolt_Target = (Target unit of ability being cast)
      • -------- Dummy unit created --------
      • Unit - Create 1 Dummy (Chilled) for Neutral Extra at (Position of Frostbolt_Target) facing (Position of Frostbolt_Target)
      • Set Frostbolt_Dummy = (Last created unit)
      • Unit - Add a 2.00 second Generic expiration timer to Frostbolt_Dummy
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Frostbolt for Frostbolt_Cast) Equal to 1
        • Then - Actions
          • Wait until ((Frostbolt_Target has buff Frostbolt (Dummy Buff)) Equal to True), checking every 0.10 seconds
          • Unit - Cause Frostbolt_Cast to damage Frostbolt_Target, dealing (40.00 + ((Real((Intelligence of Frostbolt_Cast (Include bonuses)))) x 1.60)) damage of attack type Spells and damage type Magic
          • Unit - Order Frostbolt_Dummy to Undead Necromancer - Cripple Frostbolt_Target
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Frostbolt for Frostbolt_Cast) Equal to 2
            • Then - Actions
              • Wait until ((Frostbolt_Target has buff Frostbolt (Dummy Buff)) Equal to True), checking every 0.10 seconds
              • Unit - Cause Frostbolt_Cast to damage Frostbolt_Target, dealing (60.00 + ((Real((Intelligence of Frostbolt_Cast (Include bonuses)))) x 1.60)) damage of attack type Spells and damage type Magic
              • Unit - Order Frostbolt_Dummy to Undead Necromancer - Cripple Frostbolt_Target
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Frostbolt for Frostbolt_Cast) Equal to 3
                • Then - Actions
                  • Wait until ((Frostbolt_Target has buff Frostbolt (Dummy Buff)) Equal to True), checking every 0.10 seconds
                  • Unit - Cause Frostbolt_Cast to damage Frostbolt_Target, dealing (80.00 + ((Real((Intelligence of Frostbolt_Cast (Include bonuses)))) x 1.60)) damage of attack type Spells and damage type Magic
                  • Unit - Order Frostbolt_Dummy to Undead Necromancer - Cripple Frostbolt_Target
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Frostbolt for Frostbolt_Cast) Equal to 4
                    • Then - Actions
                      • Wait until ((Frostbolt_Target has buff Frostbolt (Dummy Buff)) Equal to True), checking every 0.10 seconds
                      • Unit - Cause Frostbolt_Cast to damage Frostbolt_Target, dealing (100.00 + ((Real((Intelligence of Frostbolt_Cast (Include bonuses)))) x 1.60)) damage of attack type Spells and damage type Magic
                      • Unit - Order Frostbolt_Dummy to Undead Necromancer - Cripple Frostbolt_Target
                    • Else - Actions
Ok, so this is my current code. Nothing overly complicated.

My knowledge on arrays is pretty much non existent
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
Wait Until... is in general a terrible solution and should be avoided whenever possible; instead you should use a periodic trigger (perhaps every 0.25 seconds) and then loop through all active instances to check for the buff on each one. As for how to modify your variable setups to make this MUI (and use the method I just described) you will want to use this tutorial:

Visualize: Dynamic Indexing
 
Level 4
Joined
Sep 25, 2018
Messages
81
  • ArcaneMissileCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arcane Bolt
    • Actions
      • Set ArcaneMissile_Index = (ArcaneMissile_Index + 1)
      • Set ArcaneMissile_Cast[ArcaneMissile_Index] = (Casting unit)
      • Set ArcaneMissile_Target[ArcaneMissile_Index] = (Target unit of ability being cast)
      • Set ArcaneMissile_Counter[ArcaneMissile_Index] = 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArcaneMissile_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on ArcaneMissileDamage <gen>
        • Else - Actions
  • ArcaneMissileDamage
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ArcaneMissile_Loop) from 1 to ArcaneMissile_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Arcane Bolt for ArcaneMissile_Cast[ArcaneMissile_Loop]) Equal to 1
            • Then - Actions
              • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (20.00 + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) damage of attack type Spells and damage type Magic
              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = (ArcaneMissile_Counter[ArcaneMissile_Loop] + 0.10)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Arcane Bolt for ArcaneMissile_Cast[ArcaneMissile_Loop]) Equal to 2
                • Then - Actions
                  • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (40.00 + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) damage of attack type Spells and damage type Magic
                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = (ArcaneMissile_Counter[ArcaneMissile_Loop] + 0.10)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Arcane Bolt for ArcaneMissile_Cast[ArcaneMissile_Loop]) Equal to 3
                    • Then - Actions
                      • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (60.00 + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) damage of attack type Spells and damage type Magic
                      • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = (ArcaneMissile_Counter[ArcaneMissile_Loop] + 0.10)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Arcane Bolt for ArcaneMissile_Cast[ArcaneMissile_Loop]) Equal to 4
                        • Then - Actions
                          • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (80.00 + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) damage of attack type Spells and damage type Magic
                          • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = (ArcaneMissile_Counter[ArcaneMissile_Loop] + 0.10)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 3.00
                            • Then - Actions
                              • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                              • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                              • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ArcaneMissile_Index Equal to 0
                                • Then - Actions
                                  • Trigger - Turn off (This trigger)
                                • Else - Actions
                            • Else - Actions
This is what I have so far, the damage works. It just won't do one instance of damage.
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
I use damage engines for this sort of thing, or the super simple way would be to use a dummy unit with your desired projectile to attack a target, simply change it's attack damage after you create it.

Here's my fireball spell that deals damage based on the hero's stats.

And heres the thread and link to the simple dummy unit projectile, made by a clever member
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
4,994
You're making it MUCH more complicated than it needs to be with all those nested if statements. Learn to use variables to reduce the amount of code you run; in this case you can store the level of the spell and then deal 20*LEVEL + 2*INT damage. The damage happens so many times because you never put a check in the loop to see if the unit was under the effect of the buff you wanted. This should work fine but is IMO still not a good solution, do what Devalut suggested and use a damage detection system.

What are you using the Counter variable for...? In most cases I would use an integer here to count down to 0 when it should be 'done' rather than a real that counts up to some value, but you do you.
  • For each integer ...
    • Loop - Actions
      • If (All Conditions are true) then do (Then actions) else do (Else actions)
        • If - Conditions
          • -------- either of these means the instance is 'done' --------
          • Or - Any condition is true
            • (ArcaneMissile_Target[ArcaneMissile_Loop] is dead) equal to true
            • (ArcaneMissile_Cast[ArcaneMissile_Loop] is dead) equal to true
            • ArcaneMissile_Counter[ArcaneMissile_Loop] greater than or equal to 3.00
        • Then - Actions
          • If (All conditions are true) then do (Then Actions) else do (Else actions)
            • If - Conditions
              • (ArcaneMissile_Target[ArcaneMissile_Loop] has buff YOUR_BUFF) equal to true
            • Then - Actions
              • Set LVL = Level of YOUR_SPELL for ArcaneMissile_Cast[ArcaneMissile_Loop]
              • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing ((20.00 x Real(LVL)) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) damage of attack type Spells and damage type Magic
              • -------- this next line sets up garbage collection on this instance the next the trigger runs --------
              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 3.00
            • Else - Actions
              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Loop] + 0.10
        • Else - Actions
          • -------- this is cleanup here --------
          • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
          • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
          • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
          • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
 
Level 4
Joined
Sep 25, 2018
Messages
81
Follow up to anyone who is interested. Also, not sure if this is the best way to achieve a spell amplification aura. But here we are...

  • ArcaneMissileCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arcane Missile
    • Actions
      • Set ArcaneMissile_Index = (ArcaneMissile_Index + 1)
      • Set ArcaneMissile_Cast[ArcaneMissile_Index] = (Casting unit)
      • Set ArcaneMissile_Target[ArcaneMissile_Index] = (Target unit of ability being cast)
      • Set ArcaneMissile_Counter[ArcaneMissile_Index] = 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArcaneMissile_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on ArcaneMissileDamage <gen>
        • Else - Actions
  • ArcaneMissileDamage
    • Events
      • Time - Every 0.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ArcaneMissile_Loop) from 1 to ArcaneMissile_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ArcaneMissile_Target[ArcaneMissile_Loop] has buff Arcane Missile (Dummy Buff)) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Arcane Mastery for ArcaneMissile_Cast[ArcaneMissile_Loop]) Greater than or equal to 1
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (ArcaneMissile_Cast[ArcaneMissile_Loop] has buff Arcane Mastery (Level 1)) Equal to True
                    • Then - Actions
                      • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (((20.00 x (Real((Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])))) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) x 1.20) damage of attack type Spells and damage type Magic
                      • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 1.00
                        • Then - Actions
                          • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                          • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                          • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                          • Set ArcaneMissile_Index = (ArcaneMissile_Index - 1)
                          • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ArcaneMissile_Index Equal to 0
                            • Then - Actions
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (ArcaneMissile_Cast[ArcaneMissile_Loop] has buff Arcane Mastery (Level 2)) Equal to True
                        • Then - Actions
                          • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (((20.00 x (Real((Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])))) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) x 1.30) damage of attack type Spells and damage type Magic
                          • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 1.00
                            • Then - Actions
                              • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                              • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                              • Set ArcaneMissile_Index = (ArcaneMissile_Index - 1)
                              • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ArcaneMissile_Index Equal to 0
                                • Then - Actions
                                  • Trigger - Turn off (This trigger)
                                • Else - Actions
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (ArcaneMissile_Cast[ArcaneMissile_Loop] has buff Arcane Mastery (Level 3)) Equal to True
                            • Then - Actions
                              • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (((20.00 x (Real((Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])))) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) x 1.40) damage of attack type Spells and damage type Magic
                              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 1.00
                                • Then - Actions
                                  • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                                  • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                                  • Set ArcaneMissile_Index = (ArcaneMissile_Index - 1)
                                  • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ArcaneMissile_Index Equal to 0
                                    • Then - Actions
                                      • Trigger - Turn off (This trigger)
                                    • Else - Actions
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (ArcaneMissile_Cast[ArcaneMissile_Loop] has buff Arcane Mastery (Level 4)) Equal to True
                                • Then - Actions
                                  • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (((20.00 x (Real((Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])))) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) x 1.50) damage of attack type Spells and damage type Magic
                                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 1.00
                                    • Then - Actions
                                      • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                                      • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                                      • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                                      • Set ArcaneMissile_Index = (ArcaneMissile_Index - 1)
                                      • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • ArcaneMissile_Index Equal to 0
                                        • Then - Actions
                                          • Trigger - Turn off (This trigger)
                                        • Else - Actions
                                • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (ArcaneMissile_Cast[ArcaneMissile_Loop] has buff Arcane Mastery (Level 1)) Equal to True
                    • Then - Actions
                      • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (((20.00 x (Real((Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])))) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) x 1.05) damage of attack type Spells and damage type Magic
                      • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 1.00
                        • Then - Actions
                          • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                          • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                          • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                          • Set ArcaneMissile_Index = (ArcaneMissile_Index - 1)
                          • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ArcaneMissile_Index Equal to 0
                            • Then - Actions
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (ArcaneMissile_Cast[ArcaneMissile_Loop] has buff Arcane Mastery (Level 2)) Equal to True
                        • Then - Actions
                          • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (((20.00 x (Real((Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])))) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) x 1.10) damage of attack type Spells and damage type Magic
                          • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 1.00
                            • Then - Actions
                              • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                              • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                              • Set ArcaneMissile_Index = (ArcaneMissile_Index - 1)
                              • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ArcaneMissile_Index Equal to 0
                                • Then - Actions
                                  • Trigger - Turn off (This trigger)
                                • Else - Actions
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (ArcaneMissile_Cast[ArcaneMissile_Loop] has buff Arcane Mastery (Level 3)) Equal to True
                            • Then - Actions
                              • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (((20.00 x (Real((Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])))) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) x 1.15) damage of attack type Spells and damage type Magic
                              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 1.00
                                • Then - Actions
                                  • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                                  • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                                  • Set ArcaneMissile_Index = (ArcaneMissile_Index - 1)
                                  • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ArcaneMissile_Index Equal to 0
                                    • Then - Actions
                                      • Trigger - Turn off (This trigger)
                                    • Else - Actions
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (ArcaneMissile_Cast[ArcaneMissile_Loop] has buff Arcane Mastery (Level 4)) Equal to True
                                • Then - Actions
                                  • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing (((20.00 x (Real((Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])))) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) x 1.20) damage of attack type Spells and damage type Magic
                                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 1.00
                                    • Then - Actions
                                      • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                                      • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                                      • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                                      • Set ArcaneMissile_Index = (ArcaneMissile_Index - 1)
                                      • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • ArcaneMissile_Index Equal to 0
                                        • Then - Actions
                                          • Trigger - Turn off (This trigger)
                                        • Else - Actions
                                • Else - Actions
                                  • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing ((20.00 x (Real((Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])))) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) damage of attack type Spells and damage type Magic
                                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ArcaneMissile_Counter[ArcaneMissile_Loop] Greater than or equal to 1.00
                                    • Then - Actions
                                      • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
                                      • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
                                      • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
                                      • Set ArcaneMissile_Index = (ArcaneMissile_Index - 1)
                                      • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • ArcaneMissile_Index Equal to 0
                                        • Then - Actions
                                          • Trigger - Turn off (This trigger)
                                        • Else - Actions
            • Else - Actions
 
Level 4
Joined
Sep 25, 2018
Messages
81
everyone 0 sec? is that a good thing? so the trigger is suppot to run faster than 0.00 seconds?

Well, it seems to be working fine. I tested it with 0.10 seconds and even 1 second, and it does the same thing so I cant see any problems. But then again, my knowledge on all this is rather limited.
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
Absolutely do not ever use a 0.00 periodic timer; that frequency is extremely unnecessary (0.016 is 60 fps, for reference) and all it will do is cause your game to slow down massively if a bunch of 0.00 triggers are running at the same time. You should never need to go below 0.03 and that's ~30 fps for moving units around on the screen quickly without it being jumpy. For an application like this, as I said above, 0.25 is perfectly adequate and will have no impact on performance.

Second, you are continuing to make this trigger long, complicated, and very difficult to decipher/change by refusing to use variables, loops, and simplified damage formulas like I suggested above. You didn't add any of the extra checks to see if the target/caster is dead like I suggested so the spell can still bug out that way.

Third, no this is not a particularly good way to do a spell amplification aura. It would be best to use a Damage Detection System (that's not the only one, there are many to choose from in the resources section here) to make spells like this. This will remove the need to check for the buff periodically, save the caster/target/counter, and apply a bunch of if-statements to figure out what the proper damage amp is. Instead you'll have an even that runs when a unit takes damage, and you can then check to see what unit was the source of that damage, what level each of its skills is, what buffs the damager and the damaged have, etc..


  • -------- set these on map init --------
  • Set MAX_LEVELS_OF_ARCANE_MASTERY = 4
  • Set AMBuff[1] = Arcane Mastery (Level 1)
  • Set AMBuff[2] = Arcane Mastery (Level 2)
  • Set AMBuff[3] = Arcane Mastery (Level 3)
  • Set AMBuff[4] = Arcane Mastery (Level 4)
  • -------- how much bonus damage each rank of mastery gives (0.30 = 30% bonus damage; if you put 1.30 it would be 130% bonus damage for a total of 230% of the base without AM) --------
  • Set AMBonus[1] = 0.20
  • Set AMBonus[2] = 0.30
  • Set AMBonus[3] = 0.40
  • Set AMBonus[4] = 0.50
  • ArcaneMissileDamage
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ArcaneMissile_Loop) from 1 to ArcaneMissile_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any condition is true
                • ArcaneMissile_Counter[ArcaneMissile_Loop] greater than or equal to 1.00 //This was 3.00 in the old trigger but is 1.00 in the recent trigger...?
                • (ArcaneMissile_Target[ArcaneMissile_Loop] is dead) equal to true
                • (ArcaneMissile_Cast[ArcaneMissile_Loop] is dead) equal to true
            • Then - Actions
              • -------- this is cleanup here --------
              • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
              • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
              • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
              • If (All conditions are true) then do (Then actions) else do (Else Actions)
                • If - Conditions
                  • ArcaneMissile_Loop less than or equal to 0
                • Then - Actions
                  • Trigger - Turn off (this trigger)
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ArcaneMissile_Target[ArcaneMissile_Loop] has buff Arcane Missile (Dummy Buff)) Equal to True
                • Then - Actions
                  • -------- What's the level of the spell being cast, and is the caster under the effects of any mastery buff? --------
                  • Set LVL1 = (Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])
                  • Set LVL2 = 0
                  • For each (Integer A) from 1 to MAX_LEVELS_OF_ARCANE_MASTERY do (Actions)
                    • Loop - Actions
                      • If (All conditions are true) then do (Then actions) else do (Else Actions)
                        • If - Conditions
                          • (ArcaneMissile_Target[ArcaneMissile_Loop] has buff AMBuff[(Integer A)]
                        • Then - Actions
                          • -------- This has the added benefit of always giving you the bonus from the highest level buff you are benefiting from, but doesn't allow you to stack AM buffs --------
                          • Set LVL2 = (Integer A)
                        • Else - Actions
                  • Set INT = (Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses))
                  • Set DMG = (20.00 x LVL1) + (2.00 x INT)
                  • Set DMG = (DMG x (AMBonus[LVL2] + 1.00))
                  • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing DMG damage of attack type Spells and damage type Magic
                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                • Else - Actions
                  • -------- waiting for the buff to be applied, I presume? --------
                  • -------- I still have no idea what you're using the counter variable for --------
                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Loop] + 0.10
 
Last edited:
Level 4
Joined
Sep 25, 2018
Messages
81
Absolutely do not ever use a 0.00 periodic timer; that frequency is extremely unnecessary (0.016 is 60 fps, for reference) and all it will do is cause your game to slow down massively if a bunch of 0.00 triggers are running at the same time. You should never need to go below 0.03 and that's ~30 fps for moving units around on the screen quickly without it being jumpy. For an application like this, as I said above, 0.25 is perfectly adequate and will have no impact on performance.

Second, you are continuing to make this trigger long, complicated, and very difficult to decipher/change by refusing to use variables, loops, and simplified damage formulas like I suggested above. You didn't add any of the extra checks to see if the target/caster is dead like I suggested so the spell can still bug out that way.

Third, no this is not a particularly good way to do a spell amplification aura. It would be best to use a Damage Detection System (that's not the only one, there are many to choose from in the resources section here) to make spells like this. This will remove the need to check for the buff periodically, save the caster/target/counter, and apply a bunch of if-statements to figure out what the proper damage amp is. Instead you'll have an even that runs when a unit takes damage, and you can then check to see what unit was the source of that damage, what level each of its skills is, what buffs the damager and the damaged have, etc..


  • -------- set these on map init --------
  • Set MAX_LEVELS_OF_ARCANE_MASTERY = 4
  • Set AMBuff[1] = Arcane Mastery (Level 1)
  • Set AMBuff[2] = Arcane Mastery (Level 2)
  • Set AMBuff[3] = Arcane Mastery (Level 3)
  • Set AMBuff[4] = Arcane Mastery (Level 4)
  • -------- how much bonus damage each rank of mastery gives (0.30 = 30% bonus damage; if you put 1.30 it would be 130% bonus damage for a total of 230% of the base without AM) --------
  • Set AMBonus[1] = 0.20
  • Set AMBonus[2] = 0.30
  • Set AMBonus[3] = 0.40
  • Set AMBonus[4] = 0.50
  • ArcaneMissileDamage
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ArcaneMissile_Loop) from 1 to ArcaneMissile_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any condition is true
                • ArcaneMissile_Counter[ArcaneMissile_Loop] greater than or equal to 1.00 //This was 3.00 in the old trigger but is 1.00 in the recent trigger...?
                • (ArcaneMissile_Target[ArcaneMissile_Loop] is dead) equal to true
                • (ArcaneMissile_Cast[ArcaneMissile_Loop] is dead) equal to true
            • Then - Actions
              • -------- this is cleanup here --------
              • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
              • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
              • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)
              • If (All conditions are true) then do (Then actions) else do (Else Actions)
                • If - Conditions
                  • ArcaneMissile_Loop less than or equal to 0
                • Then - Actions
                  • Trigger - Turn off (this trigger)
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ArcaneMissile_Target[ArcaneMissile_Loop] has buff Arcane Missile (Dummy Buff)) Equal to True
                • Then - Actions
                  • -------- What's the level of the spell being cast, and is the caster under the effects of any mastery buff? --------
                  • Set LVL1 = (Level of Arcane Missile for ArcaneMissile_Cast[ArcaneMissile_Loop])
                  • Set LVL2 = 0
                  • For each (Integer A) from 1 to MAX_LEVELS_OF_ARCANE_MASTERY do (Actions)
                    • Loop - Actions
                      • If (All conditions are true) then do (Then actions) else do (Else Actions)
                        • If - Conditions
                          • (ArcaneMissile_Target[ArcaneMissile_Loop] has buff AMBuff[(Integer A)]
                        • Then - Actions
                          • -------- This has the added benefit of always giving you the bonus from the highest level buff you are benefiting from, but doesn't allow you to stack AM buffs --------
                          • Set LVL2 = (Integer A)
                        • Else - Actions
                  • Set INT = (Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses))
                  • Set DMG = (20.00 x LVL1) + (2.00 x INT)
                  • Set DMG = (DMG x (AMBonus + 1.00))
                  • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing DMG damage of attack type Spells and damage type Magic
                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 1.00
                • Else - Actions
                  • -------- waiting for the buff to be applied, I presume? --------
                  • -------- I still have no idea what you're using the counter variable for --------
                  • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Loop] + 0.10

I have tried this Damage Detection System to no avail. I just don't understand it. This method you have given me just doesn't seem to work at all even after many minor alterations. From what I think I've worked out, the timer seems to be how many times it refreshes (when the trigger has been turned on) before it detects that the target has the buff. I've noticed that anything other than 0 just does nothing.
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
If you post your version of my trigger we can all look to find the error. My guess is that you gave the spell a duration of 0.01 so the buff wouldnt linger, but that duration is too short to be seen by a 0.25 timer. What’s the duration on the ability that gives the buff?
 
Level 4
Joined
Sep 25, 2018
Messages
81
If you post your version of my trigger we can all look to find the error. My guess is that you gave the spell a duration of 0.01 so the buff wouldnt linger, but that duration is too short to be seen by a 0.25 timer. What’s the duration on the ability that gives the buff?

Like you said earlier, it would just be easier if I use a damage detection system. I'm trying out the Damage Detection System you suggested but I'm have trouble making sense of what the different variables and stuff actually do. Keeping it simple at the moment with the Arcane Missile spell, but I cant seem to make it work.

  • ArcaneMissileCast
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (PDD_target has buff Arcane Missile (Dummy Buff)) Equal to True
    • Actions
      • Set PDD_amount = 0.00
      • Unit - Remove Arcane Missile (Dummy Buff) buff from PDD_target
      • Unit - Cause PDD_source to damage PDD_target, dealing ((20.00 x (Real((Level of Arcane Missile for PDD_source)))) + ((Real((Intelligence of PDD_source (Include bonuses)))) x 2.00)) damage of attack type Spells and damage type Magic
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
I don't think it's ever been clear what exactly the OP is trying to achieve with a targeted damage spell. Why do you need the target to have a buff? Are you trying to replicate something like WoW's Arcane Missile or is the name similarity entirely coincidence? I get that you want stat-based damage and for other things to be able to alter the damage dealt but those don't require the target to have a buff.

Depending on the ability you based your Arcane Missile Buff-applicator ability on the buff could show up in different ways. I would recommend acid bomb if you are using something different.
 
Level 8
Joined
Jun 13, 2012
Messages
336
  • ArcaneMissleCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arcane Bolt
    • Actions
      • Set ArcaneMissleInitialDmg = 20
      • Set ArcaneMissle_Index = (ArcaneMissle_Index + 1)
      • Set ArcaneMissle_Cast[ArcaneMissle_Index] = (Casting unit)
      • Set ArcaneMissle_Target[ArcaneMissle_Index] = (Target unit of ability being cast)
      • Set AbilityLevel[ArcaneMissle_Index] = (Level of Arcane Bolt for ArcaneMissle_Cast[ArcaneMissle_Index])
      • Trigger - Turn on ArcaneMissleDamage <gen>
  • ArcaneMissleDamage
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to ArcaneMissle_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ArcaneMissle_Target[(Integer A)] has buff Arcane DEBUFFFFFFF ) Equal to True
            • Then - Actions
              • Unit - Cause ArcaneMissle_Cast[(Integer A)] to damage ArcaneMissle_Target[(Integer A)], dealing ((Real((ArcaneMissleInitialDmg x AbilityLevel[(Integer A)]))) + ((Real((Intelligence of ArcaneMissle_Cast[(Integer A)] (Include bonuses)))) x 2.00)) damage of attack type Spells and damage type Normal
              • Custom script: set udg_ArcaneMissle_Target[GetForLoopIndexA()]= null
              • Custom script: set udg_ArcaneMissle_Cast[GetForLoopIndexA()]= null
              • Set ArcaneMissle_Index = (ArcaneMissle_Index - 1)
            • Else - Actions
      • If (ArcaneMissle_Index Equal to 0) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
Well this is what i understood the OP. I tried ti simplify this for ability damaging per level by having initian dmg x ability level since it noticed it was 20 then 40 then 60 so it grew per lvl. He can change initial damage to fit the spell or change dmg formular as he likes.
 
Last edited:
Level 4
Joined
Sep 25, 2018
Messages
81
I don't think it's ever been clear what exactly the OP is trying to achieve with a targeted damage spell. Why do you need the target to have a buff? Are you trying to replicate something like WoW's Arcane Missile or is the name similarity entirely coincidence? I get that you want stat-based damage and for other things to be able to alter the damage dealt but those don't require the target to have a buff.

Depending on the ability you based your Arcane Missile Buff-applicator ability on the buff could show up in different ways. I would recommend acid bomb if you are using something different.

The target needs the buff (which is applied when the spell lands) so the trigger knows when to apply the damage. Otherwise the damage will be instant, and the projectile effect wouldn’t make any sense. (As far as I’ve figured out anyway)

The spell is just a simple single targeted damaging nuke, the damage scaling off of your intelligence + the base damage of the spell. The spell is based off of shadow strike (for no particular reason other than it being a projectile spell). All the damage is done via a trigger so I can amplify it via other passive abilities later.

I’ve have been trying out multiple different methods of getting this spell to work correctly, and am now seeing if I can do it using the Damage Dectection System which you copied too me in an earlier reply.

The current problem I have is a lack of understanding on how the damage dectection system (which you linked) works, and how I would implement my spell using said system.
 
Level 8
Joined
Jun 13, 2012
Messages
336
The target needs the buff (which is applied when the spell lands) so the trigger knows when to apply the damage. Otherwise the damage will be instant, and the projectile effect wouldn’t make any sense. (As far as I’ve figured out anyway)

The spell is just a simple single targeted damaging nuke, the damage scaling off of your intelligence + the base damage of the spell. The spell is based off of shadow strike (for no particular reason other than it being a projectile spell). All the damage is done via a trigger so I can amplify it via other passive abilities later.

I’ve have been trying out multiple different methods of getting this spell to work correctly, and am now seeing if I can do it using the Damage Dectection System which you copied too me in an earlier reply.

The current problem I have is a lack of understanding on how the damage dectection system (which you linked) works, and how I would implement my spell using said system.

did my post help at all? I didn't tested it but it should work.
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
@neven1, what you wrote was a simplified version of my previous trigger in this thread. Now that they have clarified, it's what the OP wants but not done in a good way. I thought the OP was specifically waiting for the buff to be applied from some other source.
The target needs the buff (which is applied when the spell lands) so the trigger knows when to apply the damage.
The buff is only for timing. So you really don't NEED the buff, you just need the damage to be timed properly... which is exactly the entire point of involving the DDS to make this simpler. The problem with the trigger you posted above is that you didn't use UnitDamageTargetEx like the system tells you to when you want to deal additional damage from within an on-damage event trigger:
function UnitDamageTargetEx takes unit localSource, unit localTarget, real localAmount, boolean attack, boolean ranged, attacktype localAttackType, damagetype localDamageType, weapontype localWeaponType returns boolean
Use this function to allocate attacks from a running damage event. You can use it in exactly the same way as the standard native UnitDamageTarget. The function is designed recursive, so you can allocate as many attacks as you want. Do not use this function outside of a damage event.
So the problem was you used Unit Damage Target (in GUI) in your event response trigger, which probably caused a recursive loop and threadcrashed the damage event trigger. Instead all you needed to do was modify the damage value and the system would have dealt the modified damage for you:
  • Events
    • Game - PDD_damageEventTrigger becomes Equal to 1.00
  • Conditions
    • (PDD_target has buff Arcane Missile (Dummy Buff)) Equal to True
  • Actions
    • Unit - Remove Arcane Missile (Dummy Buff) buff from PDD_target
    • Set LVL1 = (Level of Arcane Missile for PDD_source)
    • Set LVL2 = 0
    • For each (Integer A) from 1 to MAX_LEVELS_OF_ARCANE_MASTERY do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Then actions) else do (Else Actions)
          • If - Conditions
            • (PDD_target has buff AMBuff[(Integer A)]
          • Then - Actions
            • Set LVL2 = (Integer A)
          • Else - Actions
    • Set INT = (Intelligence of PDD_source (Include bonuses))
    • Set DMG = (20.00 x LVL1) + (2.00 x INT)
    • Set DMG = (DMG x (AMBonus[LVL2] + 1.00))
    • Set PDD_amount = DMG
Also I would use Acid Bomb instead of Shadow Strike because SS has the unremoveable <amount>! that shows up next to the target. If you need to use acid bomb more than once for a base skill (because you need this method to work for multiple spells) then you can give the hero dummy abilities based on channel and then create a dummy and have IT cast the acid bomb spell on the target... but that will mess up the PDD_source variable. Food for thought.
 
Level 4
Joined
Sep 25, 2018
Messages
81
did my post help at all? I didn't tested it but it should work.

You used a slightly different damage system, so I have to change the variables in the trigger. It did work, but I couldnt replicate what I did for my spell.
 
Last edited:
Level 4
Joined
Sep 25, 2018
Messages
81
You're making it MUCH more complicated than it needs to be with all those nested if statements. Learn to use variables to reduce the amount of code you run; in this case you can store the level of the spell and then deal 20*LEVEL + 2*INT damage. The damage happens so many times because you never put a check in the loop to see if the unit was under the effect of the buff you wanted. This should work fine but is IMO still not a good solution, do what Devalut suggested and use a damage detection system.

What are you using the Counter variable for...? In most cases I would use an integer here to count down to 0 when it should be 'done' rather than a real that counts up to some value, but you do you.
  • For each integer ...
    • Loop - Actions
      • If (All Conditions are true) then do (Then actions) else do (Else actions)
        • If - Conditions
          • -------- either of these means the instance is 'done' --------
          • Or - Any condition is true
            • (ArcaneMissile_Target[ArcaneMissile_Loop] is dead) equal to true
            • (ArcaneMissile_Cast[ArcaneMissile_Loop] is dead) equal to true
            • ArcaneMissile_Counter[ArcaneMissile_Loop] greater than or equal to 3.00
        • Then - Actions
          • If (All conditions are true) then do (Then Actions) else do (Else actions)
            • If - Conditions
              • (ArcaneMissile_Target[ArcaneMissile_Loop] has buff YOUR_BUFF) equal to true
            • Then - Actions
              • Set LVL = Level of YOUR_SPELL for ArcaneMissile_Cast[ArcaneMissile_Loop]
              • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing ((20.00 x Real(LVL)) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00)) damage of attack type Spells and damage type Magic
              • -------- this next line sets up garbage collection on this instance the next the trigger runs --------
              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = 3.00
            • Else - Actions
              • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Loop] + 0.10
        • Else - Actions
          • -------- this is cleanup here --------
          • Set ArcaneMissile_Cast[ArcaneMissile_Loop] = ArcaneMissile_Cast[ArcaneMissile_Index]
          • Set ArcaneMissile_Target[ArcaneMissile_Loop] = ArcaneMissile_Target[ArcaneMissile_Index]
          • Set ArcaneMissile_Counter[ArcaneMissile_Loop] = ArcaneMissile_Counter[ArcaneMissile_Index]
          • Set ArcaneMissile_Loop = (ArcaneMissile_Loop - 1)

I have now worked out the problem I was having when trying to use this trigger. You were correct, it was to do with the duration of the buff when the spell landed. So it’s all working fine now.

Just wondering if I could create a variable for each hero, that updates with certain abilities and items which basically gives you spell amplification.
So each hero starts with +0% spell amp. If he is carrying a certain item, his spell amp updates to being +10%. While carrying this item, he then is given a buff via an aura which gives +20%. So now he has +30% spell amp.

So this spell amplification variable is like an extra stat that all the hero’s have.

So the damage on my Arcane Missile spell will look like this
  • Unit - Cause ArcaneMissile_Cast[ArcaneMissile_Loop] to damage ArcaneMissile_Target[ArcaneMissile_Loop], dealing ((20.00 x Real(LVL)) + ((Real((Intelligence of ArcaneMissile_Cast[ArcaneMissile_Loop] (Include bonuses)))) x 2.00) x (Real(SpellDamageAmp)) damage of attack type Spells and damage type Magic
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
4,994
You can totally do that but, again, it’s gonna be a real pain to do it for every spell without a DDS. It’s up to you. One of the main purposes of DDSes is to enable stat-based damage and modify damage dealt at the time of the attack.

I would store Spell Amp values in either a big real array or in a hashtable (more direct but slightly more complicated).
 
Level 4
Joined
Sep 25, 2018
Messages
81
Just trying to find a suitable tutorial on how to use arrays. I have no idea where to start.

As for the DDS. I just don't really fancy using one (I know I'm probably just making this far more difficult for myself than it has to be)
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
  1. Here's a tutorial on Indexing I found very useful "Visualize Dynamic Indexing"
  2. I'll say it again and again, use my fireball spell, If it's not to your needs at least tell me you you looked at it so I know it's still working.
  3. For the damage amplification use booleans in the above spell before the damage to check if the damage source unit has the amplifying item or buff in question and then simply add the resulting amount into the total damage.
  4. No damage systems, No indexing, Final destination - Homing missile spell
 
Level 4
Joined
Sep 25, 2018
Messages
81
You used a slightly different damage system, so I have to change the variables in the trigger. It did work, but I couldnt replicate what I did for my spell.

@Devalut, I did look at your fireball spell. I'm sorry if you thought I was ignoring you. It does still work, and it works with the DDS I used.

The Visualize Dynamic Indexing tutorial was linked by Pyrogasm and I found that very useful for getting an idea on how to create an MUI spell. I previously had no knowledge with arrays.

I'll see if I can make the damage amplification work using Booleans. Cheers :)
 
Status
Not open for further replies.
Top