constant function Holy_Absorb_AbilID takes nothing returns integer
return 'A000'
endfunction
constant function Holy_FXDestruct_ID takes nothing returns integer
return 'B000'
endfunction
constant function Holy_FXChannelDS_ID takes nothing returns integer
return 'B001'
endfunction
constant function LightningID takes nothing returns string
return "HWPB"
endfunction
constant function SFXHPAbsorbID takes nothing returns string
return "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl"
endfunction
constant function SFXWaveMissle_ID takes nothing returns string
return "Abilities\\Spells\\Orc\\Shockwave\\ShockwaveMissile.mdl"
endfunction
constant function SFX_AttachP takes nothing returns string
return "origin"
endfunction
constant function spellduration takes nothing returns integer
return (GetUnitAbilityLevel(GetTriggerUnit(),'A000')+1)*4
endfunction
function Trig_Holy_Absorb_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function hagfilter takes nothing returns boolean
if IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) then
elseif IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD) then
elseif IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD) then
elseif IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())) then
endif
return false
endfunction
function dc_conditions takes nothing returns boolean
local timer dumt = GetExpiredTimer()
local unit caster = H2U(GetHandleUnit(dumt,"caster"))
local boolean array result
set result[1] = IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE) == false
set result[2] = IsUnitType(GetTriggerUnit(),UNIT_TYPE_MAGIC_IMMUNE) == false
set result[3] = IsUnitType(GetTriggerUnit(),UNIT_TYPE_DEAD) == false
set result[4] = IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(caster)) == false
call DestroyTimer(dumt)
set dumt = null
set caster = null
return result[1]
return result[2]
return result[3]
return result[4]
endfunction
function dc_actions takes nothing returns nothing
local unit attacked = GetTriggerUnit()
local unit attaker = GetAttacker()
local real damage = GetEventDamage()
set damage = damage + damage
endfunction
function haggroup takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real cx = GetUnitX(caster)
local real cy = GetUnitY(caster)
local real ex = GetUnitX(GetEnumUnit())
local real ey = GetUnitY(GetEnumUnit())
local trigger gg_trg_Damage_Count = CreateTrigger()
local boolexpr dc_cond = Condition(function dc_conditions)
local lightning array lfx
set lfx[1] = AddLightningEx("HWPB",true,cx,cy,50.00,ex,ey,50.00)
call TriggerRegisterAnyUnitEventBJ( gg_trg_Damage_Count,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(gg_trg_Damage_Count,dc_cond)
call TriggerAddAction(gg_trg_Damage_Count,function dc_actions)
endfunction
function Trig_Holy_Absorb_Actions takes nothing returns nothing
local timer dumt = CreateTimer()
local unit caster = GetTriggerUnit()
local group hag = CreateGroup()
local boolexpr hfilter = Condition(function hagfilter)
local real cx = GetUnitX(caster)
local real cy = GetUnitY(caster)
call GroupEnumUnitsInRange(hag,cx,cy,((GetUnitAbilityLevel(GetTriggerUnit(),'A000')*100)+400),hfilter)
call ForGroup(hag,function haggroup)
call SetHandleHandle(dumt, "caster", caster)
call DestroyGroup(hag)
set hag = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Holy_Absorb takes nothing returns nothing
local trigger gg_trg_Holy_Absorb = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( gg_trg_Holy_Absorb, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Holy_Absorb, Condition( function Trig_Holy_Absorb_Conditions ) )
call TriggerAddAction( gg_trg_Holy_Absorb, function Trig_Holy_Absorb_Actions )
endfunction