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

A unit dies - Has a specific buff

Status
Not open for further replies.
Hello guys,

Is there a way to trigger the event A unit dies with the condition Has a specific buff?

(Apparently this doesn't work since the dead unit will no longer carry any buffs)
  • Example
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) has buff Soul Burn) Equal to True
    • Actions
I wanna make a spell based on the Soul Burn Ability; that when a unit dies from Soul Burn it'll do damage to nearby units. (The killer will do damage to enemy units around the dying enemy unit from Soul Burn)

Is that doable without Jass and breaking all hell loose? :p

Thank you. :)
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
A damage detection system (or trigger based on new native) might be able to help you here. The damage instance would happen before the unit dies and loses the buff. Wouldn’t detect a unit dying from negative regeneration while also being soul burned, though.
 
Level 4
Joined
Jan 18, 2019
Messages
71
Yes, here is how I did it.

The buff is just eye-candy for the player. Simply add the unit that receives the buff to a unique i.d, and then have an event that checks for that unit(s) death. The buff can be removed manually or by timed from the debuff ability cast, so you just need to remove that I.d. after a certain amount of time.
 
Hello guys,

Is there a way to trigger the event A unit dies with the condition Has a specific buff?

(Apparently this doesn't work since the dead unit will no longer carry any buffs)
  • Example
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) has buff Soul Burn) Equal to True
    • Actions
I wanna make a spell based on the Soul Burn Ability; that when a unit dies from Soul Burn it'll do damage to nearby units. (The killer will do damage to enemy units around the dying enemy unit from Soul Burn)

Is that doable without Jass and breaking all hell loose? :p

Thank you. :)

With Damage Engine 5.2.0.0 you can do this:

  • Example
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget has buff Soul Burn) Equal to True
    • Actions
 
Thanks for the replies everyone. :)

With Damage Engine 5.2.0.0 you can do this:

  • Example
    • Events
      • Game - LethalDamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget has buff Soul Burn) Equal to True
    • Actions

Unfortunately for me, i won't be able to use Damage Engine 5.2.0.0 nor 3.8.0.0 because i'm intentionally still using the patch 1.26a for my map. :(


A damage detection system (or trigger based on new native) might be able to help you here. The damage instance would happen before the unit dies and loses the buff. Wouldn’t detect a unit dying from negative regeneration while also being soul burned, though.

Let's say i'm using Physical Damage Detection for GUI v1.3.0.0.
I tried the trigger down below but it doesn't work. (When the damage is superior than the remaining life of the afflicted unit. Imagine if the afflicted unit gets hit by Finger of Death etc)

  • Soul Burn Explosion
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (PDD_target has buff Soul Burn) Equal to True
      • (Life of PDD_target) Less than or equal to 1.00
    • Actions
Also, about the Physical Damage Detection for GUI v1.3.0.0 it says that Life Drain, Finger of Death, runed bracers and elune's grace do not work with this system. Which will ruin everything for me. (This is actually why i've been afraid to use any Damage Detection system throughout the years. They might cause more problems than they can help.)

Another thing,

  • Trigger 001
    • Events
      • Unit - Peon 0114 <gen>'s life becomes Less than or equal to 0.00
    • Conditions
      • ((Triggering unit) has buff Soul Burn) Equal to True
    • Actions
      • Game - Display to (All players) the text: Works
This actually works, even when the afflicted unit receives 999999999 damage in 1 hit it will work.
Unfortunately, the event requires a variable with a static value.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,892
Then don't be afraid to use a DDS system and read the demo, they have fixes for life drain, anti magic shield, finger of death etc., you just have to read to understand it and not implement a fear for no reason. Be more experimental!
Bribe's DDS is the best option IMO.
 
Yeah I'm not sure why you're on 1.26a, but does Damage Engine 3.8 not work on it? None of the native API was changed between 1.26a and 1.28 if I'm not mistaken, so you should be able to open it using NewGen World Editor.

Then don't be afraid to use a DDS system and read the demo, they have fixes for life drain, anti magic shield, finger of death etc., you just have to read to understand it and not implement a fear for no reason. Be more experimental!

Bribe's DDS is the best option IMO.

PDD doesn't have manual fixes for those spells.
 
Level 3
Joined
Jun 9, 2019
Messages
27
probably you be able to make a loop and save the location of the unit which going to die every 0.01 second but ofc there is better way (i am new to we)
-edit-
there is another way :using 2 trigger and 1 variable :)
trigger #1: intently on?yes
a unit finished casting of a ability
ability begin cast equals to soul burn
(maybe change this part)
put target of soul burn to a variable
then give restriction ability to the unit with no effects etc
(maybe you need to hide it idk it is possible to don't give icon to it or not)
triger #2 :intently on ?no
a unit dies (if it did not work try "start effect of restriction ")
triggering unit equals to variable
damage area ...

maybe use wait 0.01 second
kill the unit
unfortunately i can't upload triggers now but will do it later.
Beware : maybe none of these work :D5 times used maybe:D
 
Level 8
Joined
May 21, 2019
Messages
435
  • When Soul Burn starts its effect, you add the target unit to a group and track the casting player using a hashtable using the target unit as basis.
  • Then you set a trigger to remove the unit from the group using a local variable at the end of the duration.
  • If you have any dispells, then run a buff check on all units in the group whenever dispell effects are used and remove the unit from the group if it no longer has the buff.
  • Whenever a unit dies and is in the group, you run the event causing damage, finding the damaging unit using the aforementioned hashtable.

This approach doesn't require you to rely on periodic events, which can be both extremely taxing and have poor accuracy, and doesn't rely on a DDS, so you shouldn't have version issues.
 
Status
Not open for further replies.
Top