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
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),039;h00Y039;,GetUnitX(u),GetUnitY(u),0.0)
call UnitAddAbility(a,udg_Effect[i4])
call IssueTargetOrder(a,udg_Effectstrings[i4],u)
call UnitApplyTimedLife(a,039;Bhwd039;,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