• 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.

[JASS] Doesn't work with damage detection system?

Status
Not open for further replies.
Level 16
Joined
Feb 22, 2006
Messages
960
So i use this damage detection system in my map, and the following trigger doesn't want to work, but why? :(

JASS:
scope wrath initializer wrathint
globals
    integer wrathcount  = 0
endglobals

private function wrathCond takes nothing returns boolean
    return GetUnitAbilityLevel(GetTriggerDamageSource(),'A000') > 0 and GetUnitState(GetTriggerDamageTarget(),UNIT_STATE_LIFE) <= 0
endfunction

private function wrathActions takes nothing returns nothing
    local unit u = GetTriggerDamageSource()
    local unit t = GetTriggerDamageTarget()
        call BJDebugMsg("test")
endfunction

private function wrathint takes nothing returns nothing
    local trigger wi = CreateTrigger()
        call TriggerAddCondition(wi,Condition(function wrathCond))
        call TriggerAddAction(wi,function wrathActions)
        call TriggerRegisterDamageEvent(wi)
    set wi = null
endfunction
endscope

I only started with this trig some seconds ago and tested it and i saw it didn't worked at all :>
 
Level 8
Joined
Jul 22, 2008
Messages
331
it should work as I can see. I am bad with writing Jass but I can read it. it's OK as I can see, Did you found error by now?

I don't know, but Maybe is that global integer. You've just defined it, nothing else.
 
Status
Not open for further replies.
Top