- Joined
- Jul 7, 2007
- Messages
- 229
This works fine in singleplayer, but the lightning effect doesn't show up in multiplayer.
This first trigger creates the effect.
And this updates the effect
This first trigger creates the effect.
JASS:
function Trig_Skeleton_King_Copy_Actions takes nothing returns nothing
// Creating the Normal Wave
set udg_Temp_Point = GetRectCenter(gg_rct_StuffSpawnsHere)
call CreateNUnitsAtLoc( udg__CurrentSpawnNumberA[udg__CurrentPhase], udg__CurrentSpawnUnitA[udg__CurrentPhase], Player(7), udg_Temp_Point, bj_UNIT_FACING )
set udg_Temp_Group = GetLastCreatedGroup()
call CreateNUnitsAtLoc( udg__CurrentSpawnNumberB[udg__CurrentPhase], udg__CurrentSpawnUnitB[udg__CurrentPhase], Player(7), udg_Temp_Point, bj_UNIT_FACING )
call GroupAddGroup( GetLastCreatedGroup(), udg_Temp_Group )
call CreateNUnitsAtLoc( udg__CurrentSpawnNumberC[udg__CurrentPhase], udg__CurrentSpawnUnitC[udg__CurrentPhase], Player(7), udg_Temp_Point, bj_UNIT_FACING )
call GroupAddGroup( GetLastCreatedGroup(), udg_Temp_Group )
call CreateNUnitsAtLoc( udg__CurrentSpawnNumberD[udg__CurrentPhase], udg__CurrentSpawnUnitD[udg__CurrentPhase], Player(7), udg_Temp_Point, bj_UNIT_FACING )
call GroupAddGroup( GetLastCreatedGroup(), udg_Temp_Group )
// Creating the Lich and Phylacteries
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 4
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLoc( 1, 'u003', Player(7), udg_Temp_Point, bj_UNIT_FACING )
set udg__Phylacteries[GetForLoopIndexA()] = GetLastCreatedUnit()
call GroupAddGroup( GetLastCreatedGroup(), udg_Temp_Group )
call SetUnitUserData( GetLastCreatedUnit(), GetForLoopIndexA() )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call CreateNUnitsAtLoc( 1, 'U002', Player(7), udg_Temp_Point, bj_UNIT_FACING )
set udg__LichKing = GetLastCreatedUnit()
set udg__LichChainTempPoint = GetUnitLoc(udg__LichKing)
call SetUnitInvulnerable( udg__LichKing, true )
call SuspendHeroXPBJ( false, udg__LichKing )
call GroupAddGroup( GetLastCreatedGroup(), udg_Temp_Group )
call RemoveLocation(udg_Temp_Point)
// Chains
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 4
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_Temp_Point = GetUnitLoc(udg__Phylacteries[GetForLoopIndexA()])
set udg__LichChains[GetForLoopIndexA()] = AddLightningEx("DRAL", true, GetLocationX(udg__LichChainTempPoint), GetLocationY(udg__LichChainTempPoint), GetLocationZ(udg__LichChainTempPoint) + 70, GetLocationX(udg_Temp_Point), GetLocationY(udg_Temp_Point), GetLocationZ(udg_Temp_Point) + 70)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
// Attack Order
call EnableTrigger( gg_trg_Update_The_Lich_Chains )
call GroupAddGroup( udg_Temp_Group, udg__CurrentWaveGroup )
set udg_Temp_Point = GetRectCenter(gg_rct_StuffIsOrderedToAttackHere)
call GroupPointOrderLocBJ( udg_Temp_Group, "attack", udg_Temp_Point )
endfunction
//===========================================================================
function InitTrig_Skeleton_King_Copy takes nothing returns nothing
set gg_trg_Skeleton_King_Copy = CreateTrigger( )
call TriggerAddAction( gg_trg_Skeleton_King_Copy, function Trig_Skeleton_King_Copy_Actions )
endfunction
And this updates the effect
JASS:
function Trig_Update_The_Lich_Chains_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 4
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_Temp_Point = GetUnitLoc(udg__Phylacteries[GetForLoopIndexA()])
set udg__LichChainTempPoint = GetUnitLoc(udg__LichKing)
call MoveLightningEx(udg__LichChains[GetForLoopIndexA()], true, GetLocationX(udg__LichChainTempPoint), GetLocationY(udg__LichChainTempPoint), GetLocationZ(udg__LichChainTempPoint) + 70, GetLocationX(udg_Temp_Point), GetLocationY(udg_Temp_Point), GetLocationZ(udg_Temp_Point) + 70)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Update_The_Lich_Chains takes nothing returns nothing
set gg_trg_Update_The_Lich_Chains = CreateTrigger( )
call DisableTrigger( gg_trg_Update_The_Lich_Chains )
call TriggerRegisterTimerEventPeriodic( gg_trg_Update_The_Lich_Chains, 0.05 )
call TriggerAddAction( gg_trg_Update_The_Lich_Chains, function Trig_Update_The_Lich_Chains_Actions )
endfunction