• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Custom Spell Not Working

Level 4
Joined
Dec 19, 2023
Messages
16
Hi people,

I've been learning how to make spells on my own for sometime now and then realised the Hive has loads of tutorials. Sadly, I can't seem to figure out what's going wrong in my triggers.

It is a hero ability, copied off the Firebolt (Warlock). What is it meant to do: Shoot firebolt, hit target, create an effect, damage everything in a 250 radius for x amount of damage. Pretty basic, right? Well, here comes the "fun" part that I can't explain.

I have 1 triggers for this:
  • Events
  • Unit - A unit finishes casting an ability
  • I've changed this to the below as well and same result
  • Unit - A unit starts the effect of an ability
  • Conditions
  • (Ability being cast) equal to firebolt(TBC name)
  • Actions
  • Wait 1.00 seconds
  • Unit - Create 1 DummyUnit for (owner of triggering unit) at (position of triggering unit)
  • Unit - Add a 3.00 second generic expiration timer to (last created unit)
  • Unit - Move (Last created unit) instantly to (target point of ability being cast)
  • Special Effect - Create a special effect attached to the origin1 of (last created unit) using...
  • Unit - Cause (last created unit) to damage circular area after 0.00 seconds of radius 250 at (position of last created unit), dealing 5000 damage (testing purpose)...
  • Wait 5.00 seconds
  • Special Effect - Destroy (last created special effect)
If left like this, it doesn't deal the damage. Not even to the target.
If I set the radius to 50000 while keeping the damage as it is, it will eliminate everything off the map.
The effect isn't being displayed at all.

Any idea what I'm doing wrong? I'm sure something is wrong but can't figure it out. Help, please!
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,019
Do not use finishes casting. That is for channeled abilities and those with follow-through time. Effect is when it is fully cast and consumes mana+cooldown.

There is no target point because Firebolt doesn’t target a point. That is returning null and the unit is damaging an AoE around the map origin (0,0). Instead you would use Position of (Target unit of ability being cast).

Trying to destroy Last created special effect after a Wait is a bad idea. Any other effect made by a trigger during that wait will have overwritten that global variable and you will destroy that other effect instead. The original one you meant to destroy will also stay forever. Usually one can get away with destroying the effect immediately after creating it, which will cause it to play its death animation (if it has one) or stand animation (if it doesn’t).

Unit Damage Area is almost always a bad action to use. It does not and can not filter units in any way, so you will damage everything in the radius. That includes the caster’s own units and itself! Instead you would use a unit group to find Units within RANGE of POINT… but there’s a better way here.

Acid Bomb is a projectile with a travel time just like Firebolt, but it can also damage units nearby the initial target (and apply a debuff if you want but that’s not important here). I presume you want this spell to stun the target like Firebolt does, but if you do not then you can just use AB as the base ability and not have to dummy cast anything.

If you want a stun on the main target the simplest solution is to dummy cast an Acid Bomb at the same target from the same location the caster is at with the same projectile speed/arc for both spells. The AB spell should have no actual projectile, but you can give it impact effects to get whatever visual you were trying with the SFX (you could also give them to Firebolt I believe). They will then impact at the same time and be in sync.

If you want to stun every unit in the area, you’ll have to do the area search yourself and then actually dummy cast a bunch of invisible fire bolts (one at each target). Buffs are only visual, so giving the Firebolt buff to Acid Bomb will not make it stun.
 
Level 4
Joined
Dec 19, 2023
Messages
16
Hi Pyro!

Thank you for the tips! I've put the idea on hold until I fully understand how the triggers work with one another and hit another wall. I can't understand. It's pretty basic and should work, yet...

  • Events
  • Unit - A unit Learns a skill
  • Conditions
  • (Learned Hero Skill) Equal to TestSkill
  • Actions
  • Unit - Create 1 DummyUnit for (Owner of (Triggering Unit) at (Position of (Triggering Unit))
  • Unit - Add Entangling Roots (Neutral Hostile 1) to (last created unit)
  • Unit - Order (Last created unit) to Night Elf Tree Of Life - Entangle (Triggering unit)
I've tried will all the different types of Entangling Root abilities available yet it only creates the DummyUnit and adds the ability to it but it doesn't want to cast it.

Tried as well to Entangle different units and same result.

Can you/anyone else please help or at least point me in the right direction?
 
Level 39
Joined
Feb 27, 2007
Messages
5,019
  • Entangling roots can't target allies by default, and the dummy is spawned for the triggering player. You will need to modify the Targets Allowed field of the Entangling Roots to include allied units.
  • Tree of Life - Entangle is the order for Entangle Gold Mine. The order you actually want to use is Night Elf Keeper of the Grove - Entangling Roots.
 
Level 4
Joined
Dec 19, 2023
Messages
16
  • Entangling roots can't target allies by default, and the dummy is spawned for the triggering player. You will need to modify the Targets Allowed field of the Entangling Roots to include allied units.
  • Tree of Life - Entangle is the order for Entangle Gold Mine. The order you actually want to use is Night Elf Keeper of the Grove - Entangling Roots.
!!! That was it! The second thing, that was the issue. Gosh, you'd think I would've figured it out when it wrote "Tree of Life...Thank you, mate! Saved me a headache or two.
 
Top