• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spell Help

Status
Not open for further replies.
Level 11
Joined
Sep 14, 2009
Messages
284
Hello. I need someone to look at these triggers and find out whats wrong.

Here is the in-game spell description:
Creates two gales at each side of the target point, dealing X + (80% of Spell Power) magic damage and silencing enemies caught between them for 2 seconds.Cooldown: 9 seconds.

The spell is supposed to send two tornadoes against each other, dealing damage in a horizontal line in front of the caster.
The problem is, about 50% of the times the caster uses the spell, only one of the tornadoes appear. But sometimes both of them appear and works perfectly.

I used Bribes damage detection system to make the spell.

The spell is not supposed to be MUI.


Here are the triggers:

Trigger #1
  • HowlingGalesCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Orias - Howling Gales (Q)
    • Actions
      • Set HowlingGalesCaster = (Triggering unit)
      • Set TempGroupA = (Units in CombatRect matching ((((Matching unit) belongs to an enemy of (Owner of HowlingGalesCaster)) Equal to (==) True) and ((Level of Dummy Unit for (Matching unit)) Not equal to (!=) 1)))
      • Unit Group - Pick every unit in TempGroupA and do (Actions)
        • Loop - Actions
          • Unit - Remove Howling Gales Invalid Target from (Picked unit)
      • Custom script: call DestroyGroup(udg_TempGroupA)
      • Set HowlingGalesPoint[1] = (Target point of ability being cast)
      • Set HowlingGalesPoint[2] = (Target point of ability being cast)
      • Set TempPointA = (Target point of ability being cast)
      • Set TempPointB = (TempPointA offset by 300.00 towards ((Facing of HowlingGalesCaster) + 90.00) degrees)
      • Custom script: call RemoveLocation(udg_TempPointA)
      • Unit - Create 1 Dummy for (Owner of HowlingGalesCaster) at TempPointB facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_TempPointB)
      • Set TempUnitA = (Last created unit)
      • Unit - Add a 3.00 second Generic expiration timer to TempUnitA
      • Unit - Add Dummy - Howling Gales to TempUnitA
      • -------- - --------
      • Set TempPointA = (Target point of ability being cast)
      • Set TempPointB = (TempPointA offset by 300.00 towards ((Facing of HowlingGalesCaster) - 90.00) degrees)
      • Custom script: call RemoveLocation(udg_TempPointA)
      • Unit - Create 1 Dummy for (Owner of HowlingGalesCaster) at TempPointB facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_TempPointB)
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Dummy - Howling Gales to (Last created unit)
      • -------- - --------
      • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm HowlingGalesPoint[1]
      • Custom script: call RemoveLocation(udg_HowlingGalesPoint[1])
      • Unit - Order TempUnitA to Undead Dreadlord - Carrion Swarm HowlingGalesPoint[2]
      • Custom script: call RemoveLocation(udg_HowlingGalesPoint[2])
Trigger #2
  • HowlingGalesDmg
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Dummy - Howling Gales for DamageEventSource) Equal to (==) 1
      • (Level of Howling Gales Invalid Target for DamageEventTarget) Not equal to (!=) 1
      • AbilityMagical Equal to (==) False
      • AbilityPhysical Equal to (==) False
      • ItemDragonChainmailDmg Equal to (==) False
      • ItemObsidianCleaverDmg Equal to (==) False
    • Actions
      • Unit - Add Howling Gales Invalid Target to DamageEventTarget
      • Set AbilityAoE = True
      • Set AbilityMagical = True
      • Set TempUnitA = HowlingGalesCaster
      • Trigger - Run GetSpellPower <gen> (checking conditions)
      • Unit - Cause HowlingGalesCaster to damage DamageEventTarget, dealing ((25.00 + (55.00 x (Real((Level of Orias - Howling Gales (Q) for HowlingGalesCaster))))) + (0.80 x TempRealA)) damage of attack type Spells and damage type Unknown
      • Set AbilityMagical = False
      • Set AbilityAoE = False
      • Set TempPointA = (Position of DamageEventTarget)
      • Unit - Create 1 Dummy for (Owner of HowlingGalesCaster) at TempPointA facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_TempPointA)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Dummy - Howling Gales (Silence) to (Last created unit)
      • Unit - Set level of Dummy - Howling Gales (Silence) for (Last created unit) to (Level of Orias - Howling Gales (Q) for HowlingGalesCaster)
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze DamageEventTarget
 
Level 8
Joined
Feb 3, 2013
Messages
277
i haven't put my fingers on exactly why this wouldn't work, but it might be that if you're casting the spell too quickly the variables will override themselves, causing mess ups.

having said that:

use local variables - problem solved :)


edit:

btw some of these variables are unnecessary, why are there multiple variables referencing the Target Point of Ability Cast, you could go through the first trigger with like one point variable only
 
Level 11
Joined
Sep 14, 2009
Messages
284
@ msongyboi
How can I use local variables in this situation? Might I as well just create specific global variables for both the dummys? TempUnitA for example is used in alot of other triggers as well. But this is the one who always succesfully casts its spell though.

Also, I noticed after some testing that both of the dummys are always created, but the second dummy (which is referred to as Last created unit) is the one that sometimes does not cast its spell. Maybe this could help you know why it doesnt work?

EDIT: WOOPS. I mean the unit referred to as TempUnitA is the one bugging. So the firslt created one. I will try making a special variable just for that dummy unit.

EDIT 2: Do you mean I can remove HowlingGalesPoint1 and 2 and just use TempPointA all the time?
 
Level 8
Joined
Feb 3, 2013
Messages
277
hmm.. thats weird, do you have the link to your map? i would liek to try it

but for local variables in GUI

you can simply put them in custom scripts at the beginning of actions in a GUI trigger

like

Actions
Custom Script: local unit caster = GetTriggerUnit()
Custom Script: local point sp = GetSpellTargetPoint()

but uh.. maybe this would make your whole trigger into jass instead xD so mebe not the best idea

edit:
btw, i just tested something
i gave an unit locust and orderd it to do something via bj_lastCreatedUnit aka LastCreatedUnit (IN GUI) and it didn't work
but when i stored it to a variable it worked lmao?
so maybe there's your issue -> store the dummy unit to a variable


answer to your edit 2: yes, no reason to reference SpellTargetPoint multiple times for no reason.
 
Last edited:
Status
Not open for further replies.
Top