• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Transmitting Debuff upon Death

Status
Not open for further replies.
Level 2
Joined
Feb 27, 2013
Messages
17
Hi,
I have encountered a problem while i was creating my map. I wanted to create a spell that did damage over time on a unit and slow their attack speed. Well that is simple enough. The catch is that I want the Debuff to "transmit" to another unit in a certain AoE upon the death of the previously affected target (much like the Dark Channel ability in Mass Effect 3 if someone know that game). My problem is that i don't know how to detect, upon death, if the unit had the debuff in order to create another dummy caster and re-cast the spell on another random unit near the dying one.
Can someone help me solving this problem, possibly using GUI triggers (because i don't know how to write code in Jass) ?

Thanks in advance and sorry for my bad English.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
you could add the target into unit variable - I'll call it Debuff_unit, then, when a unit dies, you check if the triggering unit is Debuff_unit. If yes, you have your unit and you can transmit the debuff onto new unit and save that new unit as Debuff_unit.

You would also need another trigger, which removes the debuff or nulls the Debuff_unit variable.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You can add the unit into a unit group. Then periodically (every 0.5 seconds or so) pick units in the group and if the unit doesn't have the buff, remove it from the group.

When a unit dies and it is in the group, it had the buff.

Naturally this isn't fool proof method since the is 0...0.5 seconds time window in which the unit can be debuffed, the time between a check and dying.
 
Level 2
Joined
Feb 27, 2013
Messages
17
Like the idea of Nichilus but it became difficoult once i had to clear the Debuff_unit variable if the debuff ended before the death of the unit. The idea of Maker is also neat and now i'm going to try it, while i try to come up with a solution for Nichilus variable thing.

Thank you both!

EDIT I'm trying using Maker method but it seems that i cannot get that to work. This is the map. If you want to see the trigger, you have to go in the trigger editor > Avatar > Dark Channel
 

Attachments

  • Prova.w3x
    345.7 KB · Views: 52
Last edited:
Level 2
Joined
Feb 27, 2013
Messages
17
Got an Awesome (maybe) idea. When my skill is cast, i can spawn with a trigger a dummy unit that will cast Black Arrow on the target of my debuff ability. The black arrow will have the same duration of my debuff. At the end of it, if the target dies, with a "normal" Black Arrow ability, a dark servant is spawned. In MY version of Black Arrow, a dummy unit, specifically created for this trigger will spawn, with an expiration time of like, 0.1 sec. Then i'll create a trigger that will check when a unit dies, if that unit is the spawned dummy of black arrow. After that, a normal dummy will spawn, recasting the debuff ability on a random target near the dead "dummy servant".
Can this work?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
lol, dds much easier, if you don't want to, then you need the black arrow ability to spawn some dummy unit, then detect when this dummy unit enters the playable map area, when it does, create a dark servant for owner of dummy unit, also have the dummy cast the spell
on a random unit in an aoe
 
Level 2
Joined
Feb 27, 2013
Messages
17
The fact is that i'm not that proficient with dds and i had this idea out of the blue >.<. Thanks anyway guys, really appreciated it, +Rep to you all!
 
Status
Not open for further replies.
Top