HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

if Target of ability dies

11-04-2004, 11:31 PM#1
Sicknesslife
Hi,

i have a spell that deals 300 damage to target with JASS triggers. I have a dummy spell that does nothing, when it is cast the target of that spell recieves 3oo damage via call UnitDamageTarget. I want to know how to detect if the target of that spell dies as a direct result of the 300 damage. any help would be greatly appreciated.
11-05-2004, 03:40 AM#2
-={tWiStÄr}=-
the 2 ways that come right to mind are, check if the unit is dead like .01 seconds after the damage is dealt, or check if the units health is greater than 300 before the damage is dealt.
11-05-2004, 11:32 PM#3
Sicknesslife
so there is no, Target of ability or anything like that that you can think of?
(i appreciate the help)
11-05-2004, 11:56 PM#4
Pheonix-IV
those are the only two ways that i can think of two, theres no "target of ability dies" area.

But why do you need to know if it dies because of that 300 damage?
11-06-2004, 12:50 AM#5
Beta_Tester
how i do it in BTS is it works for me:
pseudocode BTW:

Code:
call Pick all units within 600 of casting unit ad do function DamageUnits

Code:
function DamageUnit takes unit u returns nothing
    call DamageUnit
    if health of picked unit <= 0 then
        call add player total kills = 1
        call add player gold = 15
    endif
endfunction
11-06-2004, 01:42 AM#6
Pheonix-IV
one thing you could do is run your trigger

Unit casts ect ect
Create one damager
Order damager to deal 300 damage to target of ability being cast

yadda yadda yadda. Then have after the damage trigger

If target unit of ability being cast is dead equal to true
Then do - dead stuff.
11-06-2004, 02:42 AM#7
Sicknesslife
will that work with a JASS spell? i use a dummy spell that triggers a JASS spell. The Targetunitofabilitybeingcast thing recognizes the dummy spell right so it would check if the spell that did 0 damage killed him, right? The spell itself doesn't do anything its the trigger that does, when it calls the trigger hasn't the spell already run its course, won't it not be the target of the triggers if i reference it that way?

order of events:

cast spell ....
run triggers - 300 damage
targetofspell... NO
when the triggers execute there was no target because the spell already happened

or am i missing something?
11-06-2004, 05:13 AM#8
Pheonix-IV
i dont know why you need the JASS to do the damage, but it shouldnt seperate the triggers like that, the entire spell should be 1 trigger, makes things tons easier.