• 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] Trouble with wait for condition unit has buff

Status
Not open for further replies.
Level 3
Joined
Sep 9, 2009
Messages
658
Hi. I wanted to enhance a bolt spell for a boss and made this trigger.

  • Banefire
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Banefire
    • Actions
      • Custom script: local unit udg_C
      • Custom script: local unit udg_T
      • Custom script: local location udg_L
      • Custom script: local real udg_D
      • Set C = (Triggering unit)
      • Set T = (Target unit of ability being cast)
      • Set D = (3000.00 x (Real((Level of Banefire for C))))
      • Wait until ((T has buff Dummy Buff ) Equal to True), checking every 0.10 seconds
      • Set L = (Position of T)
      • Special Effect - Create a special effect attached to the origin of T using Flame Burst.mdx
      • Special Effect - Destroy (Last created special effect)
      • Unit - Create 1 Dummy for (Owner of C) at L facing Default building facing degrees
      • Unit - Add Soul Burn (Banefire) to (Last created unit)
      • Unit - Set level of Soul Burn (Banefire) for (Last created unit) to (Level of Banefire for C)
      • Unit - Order (Last created unit) to Neutral Fire Lord - Soul Burn T
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Cause C to damage T, dealing D damage of attack type Chaos and damage type Universal
      • Custom script: call RemoveLocation (udg_L)
Without the wait, it works fine. But I want the bolt to hit before it does the custom damage so I searched around and found some similar problems. I tried adding a wait, having a separate periodic trigger check for the buff and still no dice.

It worked fine as it is when I first tested the map but after doing edits to the map in general, it stopped working altogether. I also checked out the projectile systems in here and none of them really suited my needs. Anyone got any ideas on how to fix this?
 
Level 8
Joined
Feb 3, 2013
Messages
277
You can add the unit do a group

Have another trigger looping through units in the group, with a periodic event

and then put an if else function

if unit has buff, call create dummy and issue target order picked unit
remove picked unit from group

endif
 
Level 3
Joined
Sep 9, 2009
Messages
658
I'll try it out. I'll post again when it works. In the mean time, this isn't really related to the topic or anything but when I tried to copy a JASS spell, the copy doesn't work.

I tried changing the names of the functions like conditions and actions but it still doesn't work. The JASS trigger refers to a global hashtable so the copy does as well. Is that the reason why the copy doesn't work? And before you ask yes I made some small edits to the copy so I need both of them to be working.

EDIT: Okay, I tried it and it works now! Thanks! Just one question, the trigger happens before the missile actually hits so I guess this means the base spell applies the buff before it the missile hits. I just have to edit the base spell now right?
 
Last edited:
Status
Not open for further replies.
Top