[Spell] Casting two fireballs around the main target unit

Level 7
Joined
Sep 30, 2017
Messages
100
Hello,
I want to create a simple spell, basically an ability that acts like a normal fireball but shoot 2 additional Fireballs around the main target of the ability
I tried it on my one and i got it to shoot two, even though it's supposed to be three and also i don't wanted to hit any enemy a second time.

here is the trigger that I make, i don't know where the problem is really:

Screenshot 2025-04-11 194252.png
 
Level 7
Joined
Sep 30, 2017
Messages
100
I updated the condition and remove wait and still no third shoot, and yes the works show up three times.
 
Level 29
Joined
Sep 26, 2009
Messages
2,594
there doesn't seem to be anything wrong with the trigger itself.
Maybe make sure that the Darkbolt (dummy) has way higher cast range than Cultist's Darkbolt. It may be that the dummy does not reach a target.
Since you are picking units within 300 range of the target, it would make sense to set Darkbolt (dummy) cast range to be about 350.00 range longer than cultist's Darkbolt.
 
Level 7
Joined
Sep 30, 2017
Messages
100
Yes there is two types of Darkbolts, One for the Cultist which is the normal one and the Other is Darkbolts (Dummy) is for the dummy which has 9999 Cast range.

It doesn't fine fires off when the three units are standing directly next to each other.
 
Last edited:
Level 29
Joined
Sep 26, 2009
Messages
2,594
ok, I think I got it. The issue is with dummy unit creation, specifically of the second dummy unit.
The reason why it doesn't work is because you are referencing (Casting unit).
Changing this:
  • Unit - Create 1 Dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
to this:
  • Unit - Create 1 Dummy for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
fixed the issue.
As to why that happens, you can think of (Casting unit) and other such event responses as global variables. Triggering unit and I believe also Triggering player are kind of an exception as they behave more akin to local variables.
That is normally not an issue, except in your case the situation is as follows:
  • Heretic casts Darkbolt
  • This fires the "Unit starts the effect of an ability" event of Darkbolts Cast
  • (Casting unit) is set to Heretic
  • As part of the trigger, you create dummy unit, give it dummy version of Darkbolts and order dummy to cast the spell on some unit
  • Now trigger execution is paused, because by you ordering the dummy to cast a spell, you have triggered the "Unit starts the effect of an ability" event again
  • Now (Casting unit) is set to Dummy, overwriting the previous value (Heretic)
  • Conditions of Darkbolts Cast trigger are not fulfilled, the trigger does not execute its actions
  • (Casting unit) is nulled!
  • Now trigger execution of the paused trigger (heretic's cast) continues
  • You want to create second dummy, you reference (Casting unit), but that now returns null
  • You cannot create unit for null player, so nothing happens :)
 
Top