mostly concerned about the groups created
JASS:
function Trig_Doom_Mantle_Conditions takes nothing returns boolean
local integer index=0
local item indexItem
loop
set indexItem=UnitItemInSlot(GetFilterUnit(),index)
if indexItem!=null and (GetItemTypeId(indexItem)=='IC71' or GetItemTypeId(indexItem)=='I00A') and IsUnitIllusion(GetFilterUnit())==false then
return true
elseif GetUnitTypeId(GetFilterUnit())=='ninf' then
return true
endif
set index=index+1
exitwhen index>=bj_MAX_INVENTORY
endloop
return false
endfunction
function DoomMantle_Damage takes nothing returns nothing
local group g=CreateGroup()
local unit u=GetEnumUnit()
local unit p
local integer i=0
local integer index=0
call GroupEnumUnitsInRange(g,GetUnitX(u),GetUnitY(u),250.00,null)
loop
exitwhen index>5
if GetItemTypeId(UnitItemInSlot(u,index))=='IC71' or GetItemTypeId(UnitItemInSlot(u,index))=='I00A' then
set i=i+1
endif
set index=index+1
endloop
loop
set p=FirstOfGroup(g)
exitwhen p==null
if IsUnitEnemy(p,GetOwningPlayer(u)) and IsUnitType(p,UNIT_TYPE_STRUCTURE)==false and IsUnitType(p,UNIT_TYPE_MECHANICAL)==false and IsUnitType(p,UNIT_TYPE_MAGIC_IMMUNE)==false and IsUnitType(p,UNIT_TYPE_SLEEPING)==false and IsUnitInvisible(u,GetOwningPlayer(p))==false and GetUnitTypeId(p)!='ohwd' and GetUnitTypeId(p)!='o00A' then
if GetUnitTypeId(u)=='ninf' then
call UnitDamageTarget(u,p,(10.00),true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,null)
else
call UnitDamageTarget(u,p,(10.00*i),true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL,null)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Immolation\\ImmolationDamage.mdl",p,"head"))
endif
call GroupRemoveUnit(g,p)
endloop
call DestroyGroup(g)
set g=null
set u=null
set p=null
endfunction
function Trig_Doom_Mantle_Actions takes nothing returns nothing
local group g=CreateGroup()
call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,Condition(function Trig_Doom_Mantle_Conditions))
call ForGroup(g,function DoomMantle_Damage)
call DestroyGroup(g)
set g=null
endfunction
//===========================================================================
function InitTrig_Doom_Mantle takes nothing returns nothing
set gg_trg_Doom_Mantle=CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_Doom_Mantle,1.00,true)
call TriggerAddAction(gg_trg_Doom_Mantle,function Trig_Doom_Mantle_Actions)
endfunction