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

[Trigger] Event - Condition that detects what spell killed a hero?

Status
Not open for further replies.
Level 5
Joined
Aug 18, 2013
Messages
85
How can this be done?

Can World Edit detect the spell that killed a unit?

"Unit - EXAMPLE 0003 <gen> Dies

(Unit-type of (Killing unit)) Equal to (Unit-type of KILLER) 0007 <gen>)"


How do I trigger this?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You actually dont really have to.
All you have to do is trigger all damage over time effects.
And use dummies for every buff that will be applied on a targeted unit.
(At least all abilities that you want to catch.)

For all instant spells:
unit starts the effect of an ability
Set DamagingSpell (global variable) = ability being cast
(This is used for abilities that deal instant damage or
abilities where you do "deal (value) damage to (unit)" in a trigger with the event "a unit starts channeling/casting/the effect of an ability")

For damage over time spells:
You need a system that deals damage over time and every time before you deal the damage, you set the DamagingSpell variable to the spell given to the system.

For projectile spells:
You give all projectile spells a 0.01 duration and a unique buff.
When a unit takes damage, check for what buff the unit has and save the value to the corresponding spell.
(Apply the effect buffs via dummies.)

This is... actually... how you trigger spells.
Again you only have to trigger all spells that you want to catch.
After the damage has been taken make sure to empty the value again to prevent glitches.
 
  • Like
Reactions: XMI
There's one more method nobody's suggested however it is quite lame still interesting though... Make a dummy unit for every spell and force them to cast whatever spell you casted then cancel the spell you casted and disable it then apply a cooldown through using an ability that shares the same ability information then use like an ability such as windwalk/berserk that doesn't interrupt orders then re-enable those spells when cooldown is done and disable/remove windwalk/berserk/whatever works then just display name of unit/dummy name of killing unit to players. Technically your still triggering your spells however this would be your "easy way". :thumbs_up:
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
That dummy unit for each possible spell is kinda... well... data consuming.
Just do this:
1. Make a new map.
2. Make a custom ability.
3. Give that ability 400 levels.
4. Test the map.
5. Realize that having very much data is bad and throw away the map.

If you dont have DoT (Damage over Time) spells, then yes it is much easier, but I think that you cannot tell someone not to use DoT spells. Do you?

The system is quite simple.
You add a buff to a unit.
You save the damage that has to be done.
You save the time that the DoT will last.
You save the unit that dealt the damage.
You save the spell that was cast.
You save some more stuff that you want to retrieve.

Then you need an indexer that can handle all stuff together.
If you need it then I can make it for you.

In fact I will try to make it for myself too right now :D
 
  • Like
Reactions: XMI
Level 24
Joined
Aug 1, 2013
Messages
4,657
I mean when you start the map, you will get the feeling that it crashed.
If you are not familiar with that loading screen not showing what it does, you will eventually quit.

But if dontsnoozeondalose still really wants to have this, he must say that right here and I will make a test map with examples of all different ability types.
But I can see why he wouldnt want it because if he has a lot of abilities, then he is going to have a lot of work.

EDIT: Also for what do you want it?
What effect should happen or on what conditions?
 
Last edited:
Status
Not open for further replies.
Top