Turning Hex into a projectile ability

Level 8
Joined
Jul 26, 2025
Messages
40
Although this sadly isn't directly possible due to the restrictions of the world editor, I want to make a projectile ability that inflicts Hex on a unit on impact. From my own research I've found that the best way to do this is to spawn a dummy unit to cast Hex on the target, but I'm struggling to get it to work properly.

I'm currently trying to use a reworked version of Acid Bomb as my projectile ability, and when the game detects its debuff it's supposed to spawn the dummy unit to cast the ability. The problem however is that it seems to work very sporadically, and I don't know if there is a better solution for this. I've read that the Channel ability can somehow be used to facilitate things like this, but I've not been able to get it to work the way I want either.

Is there anybody who could give me a hand with this?

1782381819874.webp
 
Two options I'd consider

A/ If you use acid bomb, you can use the power of math like so:

  • Actions
    • Set VariableSet Point_Caster = (Position of (Triggering unit))
    • Set VariableSet Point_Target = (Position of (Target unit of ability being cast))
    • Wait ((Distance between Point_Caster and Point_Target) / 900.00) seconds
    • -------- Then create your dummy --------
Change 900 for the speed of the acid bomb missile then it will look seamless ingame. Problem with this one is that it's not MUI, even with arrays you'd need some indexing system if you need multiple units to cast the spell at the same time

B/ Use Channel as a base, handle the projectile with a dummy that has an attack that does 0-0 damage and the SFX of your spell, then you can easily detect it

  • Hex
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Unit-type of (Damage source)) Equal to Dummy Hex SFX
    • Actions
      • -------- Create your dummy caster as usual --------
 
The first option sadly gives the same results as my original one, it only seems to work sporadically and I frankly have no clue why that happens. It straight up does not work if the target is not currently in combat with the casting unit, and if it is it still only works half of the time.

The second one I'm not really a fan of. I didn't like the idea of having to make dummy units just to make a basic spell work in the first place, but for that solution I'll have to make two? One for the attack and one for the actual spell?
 
I'd make the dummy unit for the owner of the caster, using neutral units seems risky to me (e.g. I suppose that your Hex spell is set to target hostiles, but what if the neutral extra player doesn't consider the target player as en enemy?)

I suppose you could find a way to make it works with 1 dummy but using 2 feels easier and less prone to additional errors
 
Possibly, you could also use some projectile ability and give it high damage. For example Firebolt - although it stuns/interrupts, I don't think it matters here when you will hex the target anyway.
Detect when unit is about to take damage, as that event shows damage taken as the raw value of the spell (before any modifiers, like spell resistance, armor, etc., are applied).
You can use the specific damage value + attack/damage type to pretty much determine unique spell.
For the example below, I have modified Mountain King's Storm Bolt to deal 1000 damage and set its stun duration to 0.001 seconds. The trigger below detects that:
  • Detect Hex Bolt Hit
    • Events
      • Unit - A unit About to take damage
    • Conditions
      • (Damage From Normal Attack) Equal to False
      • (Level of Storm Bolt for (Damage source)) Greater than 0
      • (Damage taken) Equal to 1000.00
    • Actions
      • Custom script: if BlzGetEventAttackType() != ATTACK_TYPE_NORMAL or BlzGetEventDamageType() != DAMAGE_TYPE_SONIC then
      • Custom script: return
      • Custom script: endif
      • Event Response - Set Damage of Unit Damaged Event to 0.00
      • -------- create dummy, order it to cast hex --------
Few notes:
  • The event is "about to take damage", not "takes damage"
  • There is no way to compare attack/damage type via GUI, you need to use JASS/lua.
  • ATTACK_TYPE_NORMAL in JASS is attack type "Spells" in GUI
  • Storm Bolt's damage type is "Sonic"
  • Trigger nulls damage taken, as the damage taken was set to high value (exactly 1000) because it is unlikely for any other spell to deal such damage, so the amount can serve as an identifier.
 
Back
Top