1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Single Target Projectile - MUI Spell

Discussion in 'Triggers & Scripts' started by rkemsley, Mar 5, 2019.

  1. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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!
     
  2. neven1

    neven1

    Joined:
    Jun 13, 2012
    Messages:
    330
    Resources:
    0
    Resources:
    0
    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.
     
  3. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    • 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
     
  4. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,802
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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
     
  5. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    • 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.
     
  6. Devalut

    Devalut

    Joined:
    Feb 9, 2009
    Messages:
    779
    Resources:
    2
    Spells:
    2
    Resources:
    2
    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: Mar 6, 2019
  7. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,802
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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)
     
  8. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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
     
  9. neven1

    neven1

    Joined:
    Jun 13, 2012
    Messages:
    330
    Resources:
    0
    Resources:
    0
    everyone 0 sec? is that a good thing? so the trigger is suppot to run faster than 0.00 seconds?
     
  10. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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.
     
  11. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,802
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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: Mar 13, 2019
  12. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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.
     
  13. Devalut

    Devalut

    Joined:
    Feb 9, 2009
    Messages:
    779
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Use my fireball spell above for an example with damage engine, i used acid bomb and the trigger detects when the unit is struck by the spell with the buff on.
     
  14. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,802
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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?
     
  15. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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
     
  16. neven1

    neven1

    Joined:
    Jun 13, 2012
    Messages:
    330
    Resources:
    0
    Resources:
    0
    Wait what is the problem again?
     
  17. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,802
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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.
     
  18. neven1

    neven1

    Joined:
    Jun 13, 2012
    Messages:
    330
    Resources:
    0
    Resources:
    0
    • 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: Mar 13, 2019
  19. rkemsley

    rkemsley

    Joined:
    Sep 25, 2018
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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.
     
  20. neven1

    neven1

    Joined:
    Jun 13, 2012
    Messages:
    330
    Resources:
    0
    Resources:
    0
    did my post help at all? I didn't tested it but it should work.