i want add to Jass Code
(Unit-type of (Dying unit)) Equal to footman its hfoo, better take that.
so that only if footman dies it will drop an item.
thanks
this jass code is from here
function Trig_Neutral_Hostile_Drop_Tables_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local real ux = GetUnitX(u)
local real uy = GetUnitY(u)
local itempool ip = CreateItemPool()
call ItemPoolAddItemType(ip, 'phea', 20) // Chance: 20/20
call PlaceRandomItem(ip,ux,uy)
call DestroyItemPool(ip)
set ip = null
set u = null
endfunction
//===========================================================================
function InitTrig_Neutral_Hostile_Drop_Tables takes nothing returns nothing
set gg_trg_Neutral_Hostile_Drop_Tables = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Neutral_Hostile_Drop_Tables, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Neutral_Hostile_Drop_Tables, function Trig_Neutral_Hostile_Drop_Tables_Actions )
endfunction
(Unit-type of (Dying unit)) Equal to footman its hfoo, better take that.
so that only if footman dies it will drop an item.
thanks
this jass code is from here