[Trigger] Help with a Spell

Status
Not open for further replies.
Level 2
Joined
Jan 30, 2016
Messages
16
Help with a Spell [SOLVED]

Hello guys.I'd like to ask for help here,since i've been trying to fix that for a day and whatever i try,it doesn't works.Basically,i'm trying to make a spell that fires a fire ball (like the catapult atack).
The problem is that it doesn't change its height.
And yes,i checked if it's a flying unit.I am certain the problem is with the trigger,but i have no idea how to fix it :D.

  • Fire Ball
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to |cFFFFFF11Fire Ball|r
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FB_Index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Fire Ball Loop <gen>
        • Else - Actions
      • Set FB_Index[1] = (FB_Index[1] + 1)
      • Set FB_Index[2] = (FB_Index[2] + 1)
      • Set FB_On[FB_Index[2]] = True
      • Set FB_Caster[FB_Index[2]] = (Casting unit)
      • Set FB_Point[1] = (Position of FB_Caster[FB_Index[2]])
      • Set FB_Point[2] = (Target point of ability being cast)
      • Set FB_Distance[FB_Index[2]] = (Distance between FB_Point[1] and FB_Point[2])
      • Set FB_Facing[FB_Index[2]] = (Angle from FB_Point[1] to FB_Point[2])
      • Set FB_Offset[FB_Index[2]] = 20.00
      • Set FB_MidDistance[FB_Index[2]] = ((FB_Distance[FB_Index[2]] / 2.00) - 30.00)
      • Set FB_AreaofDamage[FB_Index[2]] = (200.00 + (20.00 x (Real((Level of |cFFFFFF11Fire Ball|r for FB_Caster[FB_Index[2]])))))
      • Set FB_Size[FB_Index[2]] = (40.00 + (6.00 x (Real((Level of |cFFFFFF11Fire Ball|r for FB_Caster[FB_Index[2]])))))
      • Set FB_Height[FB_Index[2]] = 30.00
      • Set FB_Damage[FB_Index[2]] = ((20.00 x (Real((Level of |cFFFFFF11Fire Ball|r for FB_Caster[FB_Index[2]])))) + ((Real((Level of |cFFFFFF11Fire Ball|r for FB_Caster[FB_Index[2]]))) x (0.50 x (Real((Intelligence of FB_Caster[FB_Index[2]] (Include bonuses)))))))
      • Unit - Create 1 Dummy for (Owner of FB_Caster[FB_Index[2]]) at FB_Point[1] facing FB_Facing[FB_Index[2]] degrees
      • Set FB_Dummy[FB_Index[2]] = (Last created unit)
      • Special Effect - Create a special effect attached to the chest of FB_Dummy[FB_Index[2]] using GreatElderHydraMoltenBreathV.196.mdx
      • Set FB_Effect[FB_Index[2]] = (Last created special effect)
      • Animation - Change FB_Dummy[FB_Index[2]]'s size to (FB_Size[FB_Index[2]]%, FB_Size[FB_Index[2]]%, FB_Size[FB_Index[2]]%) of its original size
      • Animation - Change FB_Dummy[FB_Index[2]] flying height to FB_Height[FB_Index[2]] at 0.00
      • Custom script: call RemoveLocation ( udg_FB_Point[1])
      • Custom script: call RemoveLocation ( udg_FB_Point[2])


  • Fire Ball Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer FB_Index[3]) from 1 to FB_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FB_On[FB_Index[3]] Equal to True
            • Then - Actions
              • Set FB_Point[3] = (Position of FB_Dummy[FB_Index[3]])
              • Set FB_Point[4] = (FB_Point[3] offset by FB_Offset[FB_Index[3]] towards FB_Facing[FB_Index[3]] degrees)
              • Unit - Move FB_Dummy[FB_Index[3]] instantly to FB_Point[4]
              • Set FB_Distance[FB_Index[3]] = (FB_Distance[FB_Index[3]] - FB_Offset[FB_Index[3]])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FB_Distance[FB_Index[3]] Less than or equal to 0.00
                • Then - Actions
                  • Set FB_Group = (Units within FB_AreaofDamage[FB_Index[3]] of FB_Point[4] matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is A flying unit) Equal to False)) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an
                  • Unit Group - Pick every unit in FB_Group and do (Actions)
                    • Loop - Actions
                      • Unit - Cause FB_Caster[FB_Index[3]] to damage (Matching unit), dealing FB_Damage[FB_Index[3]] damage of attack type Spells and damage type Lightning
                      • Special Effect - Create a special effect attached to the chest of (Matching unit) using Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl
                  • Unit - Kill FB_Dummy[FB_Index[3]]
                  • Special Effect - Destroy FB_Effect[FB_Index[3]]
                  • Set FB_Index[1] = (FB_Index[1] - 1)
                  • Custom script: call DestroyGroup ( udg_FB_Group)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • FB_MidDistance[FB_Index[3]] Less than or equal to 0.00
                    • Then - Actions
                      • Set FB_Height[FB_Index[3]] = ((Current flying height of FB_Dummy[FB_Index[3]]) - 1.00)
                      • Animation - Change FB_Dummy[FB_Index[3]] flying height to FB_Height[FB_Index[3]] at 0.00
                    • Else - Actions
                      • Set FB_Height[FB_Index[3]] = ((Current flying height of FB_Dummy[FB_Index[3]]) + 1.00)
                      • Animation - Change FB_Dummy[FB_Index[3]] flying height to FB_Height[FB_Index[3]] at 0.00
              • Custom script: call RemoveLocation ( udg_FB_Point[3])
              • Custom script: call RemoveLocation ( udg_FB_Point[4])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FB_Index[1] Equal to 0
                • Then - Actions
                  • Set FB_On[FB_Index[3]] = False
                  • Set FB_Index[2] = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Last edited:
Level 2
Joined
Jan 30, 2016
Messages
16
What is its movement type? I know you said it is already a flying unit, but Im assuming youre going off what "Targeted as" is set to, which is not the same as movement type.

Dummy_zpsdnhtyyz9.png


I thin,this is what you are asking for :p

EDIT:I tried changing the dummy to a gryphon rider without altering his values and he didn't change his flying height aswell
 
Level 2
Joined
Jan 30, 2016
Messages
16
Could you test it with more than 1 instance running at once and tell me what happens?

Oh...it isn't mui...when i cast 2 spells,1 of the dummies freezes

EDIT:I managed to make it mui and i found the problem(no idea how to fix it,though).It's the formula to change the flying height.If i just set the flying height to 500 it works perfectly fine.But if i was to use a variable and a formula to make it increase it's height in a loop,it just doesn't work.
 
Last edited:
Hrmm I'm not entirely sure then. From what I can see, if you are only giving the loop 1 index, the loop will instantly turn off after the Distance[] is less than or equal to 0.00 because Else - Actions (where you actually only change the height) will only run after the next iteration, which will not happen since Index[1] is decremented to 0.
 
Level 2
Joined
Jan 30, 2016
Messages
16
Hrmm I'm not entirely sure then. From what I can see, if you are only giving the loop 1 index, the loop will instantly turn off after the Distance[] is less than or equal to 0.00 because Else - Actions (where you actually only change the height) will only run after the next iteration, which will not happen since Index[1] is decremented to 0.

hmm,well...everything works.I mean,that it doesn't turn off.It finishes all given tasks.I changed the formula to just 500(change unit flying height to 500) and it works perfectly fine.But when i tell it to change flying height to current-1 or current+1 nothing happens.I tried using sin/cos/tan,but i have no idea what formula to use with them :D...i found paladon's jump system and am trying to understand it,so i can use sin/cos/tan.But the problem there is,that the unit starts from the ground and end on the ground and thus if i were to add +30 height,it would start from the caster's face height,but wouldnt end on the ground height :xxd:
I've also tried to make the spell with tinkerer's rocket spell,but the problem there is that the dummy uses the spell with 1 sec delay after the caster.So if you could tell me just how to "delete"that delay,i'd be eternally grateful :thumbs_up:

EDIT:I managed to solve it by increasing the Rate at which the flying height will be changed to 10000.Since the Rate was set to 0,the height was changing with 0 per second.The trigger runs 1/0.02 times per second and thus this was the minimum Rate i could set it to.
Thanks for noting my trigger wasn't mui,KILLCIDE :)
 
Last edited:
Status
Not open for further replies.
Top