- Joined
- Mar 7, 2004
- Messages
- 27
Code:
function GetHeroSphere takes unit u returns integer
local integer i = 0
loop
exitwhen i>8
if (udg_Hero[i] == u) then
return i
else
set i=i+1
endif
endloop
return 9
endfunction
function Trig_SphereSystem_Actions takes nothing returns nothing
local integer i = 0
local unit u = GetTriggerUnit()
if ( udg_Hero[GetHeroSphere(u)] == GetAttacker() ) then
call IssueTargetOrder( udg_Sphere[GetHeroSphere(u)], "attack", udg_Sphere[GetHeroSphere(u)] )
else
if ( udg_Hero[GetHeroSphere(u)] == GetAttackedUnitBJ() ) then
return
else
if ( GetDyingUnit() == udg_Hero[GetHeroSphere(u)] ) then
call ExplodeUnitBJ( udg_Sphere[GetHeroSphere(u)] )
set udg_Sphere[GetHeroSphere(u)] = null
else
if ( GetRevivingUnit() == udg_Hero[GetHeroSphere(u)] ) then
set udg_Sphere[GetHeroSphere(u)] = CreateUnitAtLoc( Player(13), 'Hblm', GetUnitLoc(u), bj_UNIT_FACING )
call UnitAddAbilityBJ( udg_SphereAbil[GetHeroSphere(u)], udg_Sphere[GetHeroSphere(u)] )
call SetUnitInvulnerable( udg_Sphere[GetHeroSphere(u)], true )
call SetUnitPathing( udg_Sphere[GetHeroSphere(u)], false )
call SetUnitVertexColorBJ( udg_Sphere[GetHeroSphere(u)], 100, 100, 100, 100.00 )
call SetUnitPositionLoc( udg_Sphere[GetHeroSphere(u)], GetUnitLoc(udg_Hero[GetHeroSphere(u)]) )
else
loop
exitwhen i > 8
set udg_Sphere[i] = CreateUnitAtLoc( Player(13), 'Hblm', GetUnitLoc(udg_Hero[i]), bj_UNIT_FACING )
call SetUnitVertexColorBJ( udg_Sphere[i], 100, 100, 100, 100.00 )
call UnitAddAbilityBJ( udg_SphereAbil[i], udg_Sphere[i] )
call SetUnitInvulnerable( udg_Sphere[i], true )
call SetUnitPathing( udg_Sphere[i], false )
call SetUnitPositionLoc( udg_Sphere[i], GetUnitLoc(udg_Hero[i]) )
set i = i+1
endloop
endif
endif
endif
endif
set u = null
call EnableTrigger( gg_trg_SphereSystem2 )
endfunction
//===========================================================================
function InitTrig_SphereSystem takes nothing returns nothing
set gg_trg_SphereSystem = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_SphereSystem, EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterTimerEventSingle( gg_trg_SphereSystem, 25.00 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_SphereSystem, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterAnyUnitEventBJ( gg_trg_SphereSystem, EVENT_PLAYER_HERO_REVIVE_FINISH )
call TriggerAddAction( gg_trg_SphereSystem, function Trig_SphereSystem_Actions )
endfunction
-_-
Looks sound to me. (BTW, it is moving a 100% alphaed Bloodmage to the units every .1 seconds. The spheres moving work fine. These actions do not.)