scope spawnHellHounds initializer activate requires goldmineIncome
//initializer OnInit
globals
public trigger spawner
integer hellDamage = 5
endglobals
function checker takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A046' ) ) then
return false
endif
return true
endfunction
function spawnHell takes nothing returns nothing
if ( checker() ) then
call CreateNUnitsAtLocFacingLocBJ( 1, 'n008', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetSpellTargetLoc() )
call AddSpecialEffectTargetUnitBJ( "head", GetLastCreatedUnit(), "Environment\\LargeBuildingFire\\LargeBuildingFire2.mdl" )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", GetSpellTargetLoc() )
set udg_TempPoint = GetSpellTargetLoc()
call UnitApplyTimedLifeBJ( 5.00, 'BTLF', GetLastCreatedUnit() )
call ClearSelectionForPlayer( GetOwningPlayer(GetTriggerUnit()) )
call SelectUnitAddForPlayer( GetLastCreatedUnit(), GetOwningPlayer(GetTriggerUnit()) )
call RemoveLocation(udg_TempPoint)
// Below applies damage abilities scaling upon gametime
if (gameMinutes > 18 and gameMinutes <24) then
call UnitAddAbilityBJ( 'A048', GetTriggerUnit() )
elseif (gameMinutes > 18 and gameMinutes <24) then
call UnitAddAbilityBJ( 'A049', GetTriggerUnit() )
elseif (gameMinutes > 24) then
call UnitAddAbilityBJ( 'A04A', GetTriggerUnit() )
endif
//call BlzSetUnitBaseDamage( GetLastCreatedUnit(), 1000*hellDamage, 0 )
else
endif
endfunction
function activate takes nothing returns nothing
set spawner = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(spawner, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddAction(spawner, function spawnHell)
endfunction
endscope