• 🏆 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!

Spawning unit when unit killed by spell

Status
Not open for further replies.
Level 2
Joined
Nov 1, 2012
Messages
12
I'm currently working on a spell based on forked lightning. Its supposed to spawn a ghoul where the unit that was killed by the spell died. To do this, do I have to make the spell itself do the damage, or create a trigger that does the damage to all the targets of the spell when its cast? Currently, I have the spell apply a buff and I have a separate trigger that when a unit dies, it checks if the triggering unit had this buff, and then if it did, spawns a unit at that location. However, this is not currently working for me. So, two main questions:

1. Should I make the damage via trigger (If so, how to apply it to all the targets of the spell not just the one clicked on) or just on the spell?

2. How would I make a unit killed by this spell's location become where a new unit spawns?

Thanks for any help you can provide!
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Forked Lightning does not apply buffs. If you insist on this ability, how about casting it via a dummy unit. Then you can check if the killer was this dummy unit to ensure it was done by Forked Lightning. To deduce to the actual caster, assign the caster to the dummy unit.
 
Level 2
Joined
Nov 1, 2012
Messages
12
I would use doom, but the spell needs to be multi target. Making the spell via a dummy unit should work, thanks, I'll try that now.

EDIT: I created a trigger that (should) make the dummy unit go to the location of the caster of the spell and then cast it on the target, which is not working:

Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Undeath
Actions
Unit - Move undeathCaster 0001 <gen> instantly to (Position of (Triggering unit))
Unit - Add undeathDummyCast to undeathCaster 0001 <gen>
Unit - Order undeathCaster 0001 <gen> to Neutral Naga Sea Witch - Forked Lightning (Target unit of ability being cast)

The spell "Undeath" is simply a dummy spell to start this trigger. The undeathDummyCast has the damage and aoe and such, and is based on forked lightning. What do I need to change so that the dummy unit will cast the spell?
 
Last edited:
Level 5
Joined
Aug 27, 2010
Messages
79
if the dummy is made to kill the target, all the kill credit will go to dummy and not the caster (this might break many systems)

u might have to trigger the whole thing,
make the spell do no damage,
on spell cast, chose x random enemies (including the spell target) and create lightning effect and damage through trigger.
 
Status
Not open for further replies.
Top