[Simple] Help with a Condition

R 3 T R O

New Member
Reaction score
12
Everything works good with the trigger, but there is 1 problem it runs even if the unit is being effected by a buff, for example one of the Buff's types that the unit gets is based off the Poison Sting (Damage) so the unit looses 1 hp per sec, now this trigger runs everytime he looses the 1 hp i dont want it to, i want it to only run if the unit is attacked by a unit of type SUMMONDED it does both, but i dont want it to run from the poison dmg!

Note: Event is when Unit[Player] takes dmg i have that in another trigger

JASS:
function HitsTakenCount takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit a = GetEventDamageSource()
    local player p = GetOwningPlayer(u)
    local integer id = GetConvertedPlayerId(p)
    local integer i4 = GetRandomInt(0,5)
    if GetRandomInt(0,7)==2 and IsUnitType(a,UNIT_TYPE_SUMMONED)==true then
        set a = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h00Y',GetUnitX(u),GetUnitY(u),0.0)
        call UnitAddAbility(a,udg_Effect[i4])
        call IssueTargetOrder(a,udg_Effectstrings[i4],u)
        call UnitApplyTimedLife(a,'Bhwd',3.0)
    endif
    set a = null
    set u = null
endfunction

//===========================================================================
function InitTrig_HitsTakenCount takes nothing returns nothing
    set gg_trg_HitsTakenCount = CreateTrigger()
    call TriggerAddAction(gg_trg_HitsTakenCount,function HitsTakenCount)
endfunction
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Is the poison caused by the summoned unit? If so, there's not much you can do except maybe [ljass]if GetEventDamage() > 2 then[/ljass], because its attack damage should be higher than the poison tick.
 

Tyrulan

Ultra Cool Member
Reaction score
37
What code are you using to detect the attack?

Jesus4Lyf's Damage system allows you to differentiate between spells and physical damage. It also allows you to see the "source" of the damage. Perhaps you'd do best to look at these.
 

R 3 T R O

New Member
Reaction score
12
What would be the easiest way to detect the dmg so just add a condition if the dmg is more than 1 how would i add that to my current condition!

would this work if GetEventDamage()>1
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top