JASS:
function Trig_Death_Conditions takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())==039;ngzc039;or GetUnitTypeId(GetTriggerUnit())==039;ngzd039;or GetUnitTypeId(GetTriggerUnit())==039;ngza039;or GetUnitTypeId(GetTriggerUnit())==039;ngz4039;)and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function Death_SafeItems takes nothing returns nothing
local string lf5=H2Tx(GetOwningPlayer(GetTriggerUnit()))
local unit lHy=GetUnit(lf5,"ItemHolder")
local unit lqL=GetUnit(lf5,"Unitr")
local integer lxx
local integer lyy
if lHy==null then
if PlayerIsSentinel(GetOwningPlayer(lqL))then
set lxx=-3213
set lyy=3392
else
set lxx=3164
set lyy=-3275
endif
set lHy=CreateUnit(GetOwningPlayer(GetTriggerUnit()),039;e000039;,lxx,lyy,0)
call SetHandle(lf5,"ItemHolder",lHy)
endif
call UnitAddItem(lHy,GetEnumItem())
call ShowUnit(lHy,true)
endfunction
function Trig_Death_Actions takes nothing returns nothing
local location liD=GetUnitLoc(GetTriggerUnit())
local rect lMx=RectFromCenterSizeBJ(liD,300.,150.)
call EnumItemsInRectBJ(lMx,function Death_SafeItems)
call RemoveLocation(liD)
call RemoveRect(lMx)
endfunction
function InitTrig_Death takes nothing returns nothing
set gg_trg_Death=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Death,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(gg_trg_Death,Condition(function Trig_Death_Conditions))
call TriggerAddAction(gg_trg_Death,function Trig_Death_Actions)
endfunction
Already checked anything that seems bad.. but i can't find anything.. maybe it's something weird but i can't finde anything