4 огненных способности без какого-либо механического воздействия, только silly fire moves
может сама идея пригодится кому-нибудь с доработками или просто станет вдохновением на что-то серьёзное
может сама идея пригодится кому-нибудь с доработками или просто станет вдохновением на что-то серьёзное
Melee Initialization
library MyLib
globals
private constant hashtable H = InitHashtable( )
private constant location LFZ = Location( 0.00, 0.00 )
endglobals
native UnitAlive takes unit id returns boolean
private function CreateUnitEx takes player id, integer unitid, real x, real y, real face returns unit
set bj_lastCreatedUnit = CreateUnit( id, unitid, x, y, face )
call SetUnitPathing( bj_lastCreatedUnit, false )
call UnitAddAbility( bj_lastCreatedUnit, 'Arav' )
call SetUnitX( bj_lastCreatedUnit, x )
call SetUnitY( bj_lastCreatedUnit, y )
return bj_lastCreatedUnit
endfunction
private function GetLocZ takes real x, real y returns real
call MoveLocation( LFZ, x, y )
return GetLocationZ( LFZ )
endfunction
private struct SpellS
unit caster
unit array dummy[4]
player p
real time
real timeMax
real array x[6]
real array y[6]
real array z[6]
real lastx
real lasty
endstruct
private function Move takes nothing returns nothing
local SpellS A = LoadInteger( H, GetHandleId( GetExpiredTimer( ) ), 0 )
local real array x
local real array y
local real array z
local integer i = 0
local integer k = 0
local integer count = 5
set A.time = A.time + 0.03125 / A.timeMax
loop
set x[i] = A.x[i]
set y[i] = A.y[i]
set z[i] = A.z[i]
set i = i + 1
exitwhen i > count
endloop
loop
set i = 0
loop
set x[i] = ( 1.00 - A.time ) * x[i] + A.time * x[i + 1]
set y[i] = ( 1.00 - A.time ) * y[i] + A.time * y[i + 1]
set z[i] = ( 1.00 - A.time ) * z[i] + A.time * z[i + 1]
set i = i + 1
exitwhen i > count - k
endloop
set k = k + 1
exitwhen k >= count - 1
endloop
set z[0] = z[0] - GetLocZ( x[0], y[0] )
set i = 0
loop
call SetUnitX( A.dummy[i], x[0] )
call SetUnitY( A.dummy[i], y[0] )
call SetUnitFlyHeight( A.dummy[i], z[0], 0.00 )
call SetUnitFacing( A.dummy[i], Atan2( y[0] - A.lasty, x[0] - A.lastx ) * bj_RADTODEG )
set i = i + 1
exitwhen i > 3
endloop
if A.time >= 1.00 then
call PauseTimer( GetExpiredTimer( ) )
call FlushChildHashtable( H, GetHandleId( GetExpiredTimer( ) ) )
call DestroyTimer( GetExpiredTimer( ) )
set i = 0
loop
call SetUnitAnimation( A.dummy[i], "death" )
call UnitApplyTimedLife( A.dummy[i], 'BTLF', 6.00 )
set A.dummy[i] = null
set i = i + 1
exitwhen i > 3
endloop
set A.caster = null
call A.destroy( )
else
set A.lastx = x[0]
set A.lasty = y[0]
endif
endfunction
private function Trig_Melee_Initialization_Actions takes nothing returns nothing
local timer t
local SpellS A
local real x = GetSpellTargetX( )
local real y = GetSpellTargetY( )
local real z = GetLocZ( x, y )
local real a = GetRandomReal( -bj_PI, bj_PI )
local integer i = 6
loop
set t = CreateTimer( )
set A = SpellS.create( )
set A.caster = GetTriggerUnit( )
set A.p = GetOwningPlayer( A.caster )
set A.dummy[0] = CreateUnitEx( A.p, 'u009', x, y, a * bj_RADTODEG )
set A.dummy[1] = CreateUnitEx( A.p, 'u00A', x, y, a * bj_RADTODEG )
set A.dummy[2] = CreateUnitEx( A.p, 'u00B', x, y, a * bj_RADTODEG )
set A.dummy[3] = CreateUnitEx( A.p, 'u00C', x, y, a * bj_RADTODEG )
call SetUnitAnimation( A.dummy[0], "birth" )
call QueueUnitAnimation( A.dummy[0], "stand" )
call SetUnitAnimation( A.dummy[1], "birth" )
call QueueUnitAnimation( A.dummy[1], "stand" )
call SetUnitAnimation( A.dummy[2], "birth" )
call QueueUnitAnimation( A.dummy[2], "stand" )
call SetUnitAnimation( A.dummy[3], "birth" )
call QueueUnitAnimation( A.dummy[3], "stand" )
set A.lastx = x
set A.lasty = y
set A.x[0] = x
set A.y[0] = y
set A.z[0] = z
set A.x[1] = x + 500.00 * Cos( a )
set A.y[1] = y + 500.00 * Sin( a )
set A.z[1] = z + 150.00
set A.x[2] = x + 500.00 * Cos( a + 90.00 * bj_DEGTORAD )
set A.y[2] = y + 500.00 * Sin( a + 90.00 * bj_DEGTORAD )
set A.z[2] = z + 300.00
set A.x[3] = x + 500.00 * Cos( a + 180.00 * bj_DEGTORAD )
set A.y[3] = y + 500.00 * Sin( a + 180.00 * bj_DEGTORAD )
set A.z[3] = z + 450.00
set A.x[4] = x + 500.00 * Cos( a + 270.00 * bj_DEGTORAD )
set A.y[4] = y + 500.00 * Sin( a + 270.00 * bj_DEGTORAD )
set A.z[4] = z + 600.00
set A.x[5] = x + 500.00 * Cos( a )
set A.y[5] = y + 500.00 * Sin( a )
set A.z[5] = z + 600.00
set A.time = 0.00
set A.timeMax = 1.50
call SaveInteger( H, GetHandleId( t ), 0, A )
call TimerStart( t, 0.03125, true, function Move )
set i = i - 1
exitwhen i <= 0
set a = a + bj_PI * 2.00 / 6.00
endloop
set t = null
endfunction
private function Trig_Melee_Initialization_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
set gg_trg_Melee_Initialization = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Melee_Initialization, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Melee_Initialization, Condition( function Trig_Melee_Initialization_Conditions ) )
call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction
endlibrary
Melee Initialization Copy
library MyLib1
globals
private constant hashtable H = InitHashtable( )
private constant location LFZ = Location( 0.00, 0.00 )
endglobals
native UnitAlive takes unit id returns boolean
private function CreateUnitEx takes player id, integer unitid, real x, real y, real face returns unit
set bj_lastCreatedUnit = CreateUnit( id, unitid, x, y, face )
call SetUnitPathing( bj_lastCreatedUnit, false )
call UnitAddAbility( bj_lastCreatedUnit, 'Arav' )
call SetUnitX( bj_lastCreatedUnit, x )
call SetUnitY( bj_lastCreatedUnit, y )
return bj_lastCreatedUnit
endfunction
private function GetLocZ takes real x, real y returns real
call MoveLocation( LFZ, x, y )
return GetLocationZ( LFZ )
endfunction
private struct SpellS
unit caster
unit array dummy[4]
player p
real a
real time
real timeMax
real array x[5]
real array y[5]
real array z[5]
real array d[5]
real array az[5]
endstruct
private function Move takes nothing returns nothing
local SpellS A = LoadInteger( H, GetHandleId( GetExpiredTimer( ) ), 0 )
local real array x
local real array y
local real array z
local real array d
local real array az
local integer i = 0
local integer k = 0
local integer count = 5
set A.time = A.time + 0.03125 / A.timeMax
loop
set x[i] = A.x[i]
set y[i] = A.y[i]
set z[i] = A.z[i]
set d[i] = A.d[i]
set az[i] = A.az[i]
set i = i + 1
exitwhen i > count
endloop
loop
set i = 0
loop
set x[i] = ( 1.00 - A.time ) * x[i] + A.time * x[i + 1]
set y[i] = ( 1.00 - A.time ) * y[i] + A.time * y[i + 1]
set z[i] = ( 1.00 - A.time ) * z[i] + A.time * z[i + 1]
set d[i] = ( 1.00 - A.time ) * d[i] + A.time * d[i + 1]
set az[i] = ( 1.00 - A.time ) * az[i] + A.time * az[i + 1]
set i = i + 1
exitwhen i > count - k
endloop
set k = k + 1
exitwhen k >= count - 1
endloop
set z[0] = z[0] - GetLocZ( x[0], y[0] )
set i = 0
loop
call SetUnitX( A.dummy[i], x[0] + d[0] * Sin( az[0] ) * Cos( A.a ) )
call SetUnitY( A.dummy[i], y[0] + d[0] * Sin( az[0] ) * Sin( A.a ) )
call SetUnitFlyHeight( A.dummy[i], z[0] + d[0] * Cos( az[0] ), 0.00 )
set i = i + 1
exitwhen i > 3
endloop
if A.time >= 1.00 then
call PauseTimer( GetExpiredTimer( ) )
call FlushChildHashtable( H, GetHandleId( GetExpiredTimer( ) ) )
call DestroyTimer( GetExpiredTimer( ) )
set i = 0
loop
call SetUnitAnimation( A.dummy[i], "death" )
call UnitApplyTimedLife( A.dummy[i], 'BTLF', 6.00 )
set A.dummy[i] = null
set i = i + 1
exitwhen i > 3
endloop
set A.caster = null
call A.destroy( )
endif
endfunction
private function Trig_Melee_Initialization_Actions takes nothing returns nothing
local timer t
local SpellS A
local real x = GetUnitX( GetTriggerUnit( ) )
local real y = GetUnitY( GetTriggerUnit( ) )
local real z = GetLocZ( x, y ) + 50.00
local real a = Atan2( GetSpellTargetY( ) - y, GetSpellTargetX( ) - x )
local real az = GetRandomReal( -bj_PI, bj_PI )
local integer i = 6
loop
set t = CreateTimer( )
set A = SpellS.create( )
set A.caster = GetTriggerUnit( )
set A.p = GetOwningPlayer( A.caster )
set A.dummy[0] = CreateUnitEx( A.p, 'u009', x, y, a * bj_RADTODEG )
set A.dummy[1] = CreateUnitEx( A.p, 'u00A', x, y, a * bj_RADTODEG )
set A.dummy[2] = CreateUnitEx( A.p, 'u00B', x, y, a * bj_RADTODEG )
set A.dummy[3] = CreateUnitEx( A.p, 'u00C', x, y, a * bj_RADTODEG )
call SetUnitAnimation( A.dummy[0], "birth" )
call QueueUnitAnimation( A.dummy[0], "stand" )
call SetUnitAnimation( A.dummy[1], "birth" )
call QueueUnitAnimation( A.dummy[1], "stand" )
call SetUnitAnimation( A.dummy[2], "birth" )
call QueueUnitAnimation( A.dummy[2], "stand" )
call SetUnitAnimation( A.dummy[3], "birth" )
call QueueUnitAnimation( A.dummy[3], "stand" )
set A.a = a - 90.00 * bj_DEGTORAD
set A.x[0] = x
set A.y[0] = y
set A.z[0] = z
set A.d[0] = 0.00
set A.az[0] = az
set A.x[1] = x + 200.00 * Cos( a )
set A.y[1] = y + 200.00 * Sin( a )
set A.z[1] = z
set A.d[1] = 50.00
set A.az[1] = az + 90.00 * bj_DEGTORAD
set A.x[2] = x + 400.00 * Cos( a )
set A.y[2] = y + 400.00 * Sin( a )
set A.z[2] = z + 25.00
set A.d[2] = 75.00
set A.az[2] = az + 180.00 * bj_DEGTORAD
set A.x[3] = x + 600.00 * Cos( a )
set A.y[3] = y + 600.00 * Sin( a )
set A.z[3] = z + 75.00
set A.d[3] = 125.00
set A.az[3] = az + 270.00 * bj_DEGTORAD
set A.x[4] = x + 800.00 * Cos( a )
set A.y[4] = y + 800.00 * Sin( a )
set A.z[4] = z + 150.00
set A.d[4] = 200.00
set A.az[4] = az + 360.00 * bj_DEGTORAD
set A.time = 0.00
set A.timeMax = 1.00
call SaveInteger( H, GetHandleId( t ), 0, A )
call TimerStart( t, 0.03125, true, function Move )
set i = i - 1
exitwhen i <= 0
set az = az + bj_PI * 2.00 / 6.00
endloop
set t = null
endfunction
private function Trig_Melee_Initialization_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001'
endfunction
//===========================================================================
function InitTrig_Melee_Initialization_Copy takes nothing returns nothing
set gg_trg_Melee_Initialization_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Melee_Initialization_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Melee_Initialization_Copy, Condition( function Trig_Melee_Initialization_Conditions ) )
call TriggerAddAction( gg_trg_Melee_Initialization_Copy, function Trig_Melee_Initialization_Actions )
endfunction
endlibrary
Melee Initialization Copy Copy
library MyLib2
globals
private constant hashtable H = InitHashtable( )
private constant location LFZ = Location( 0.00, 0.00 )
endglobals
native UnitAlive takes unit id returns boolean
private function CreateUnitEx takes player id, integer unitid, real x, real y, real face returns unit
set bj_lastCreatedUnit = CreateUnit( id, unitid, x, y, face )
call SetUnitPathing( bj_lastCreatedUnit, false )
call UnitAddAbility( bj_lastCreatedUnit, 'Arav' )
call SetUnitX( bj_lastCreatedUnit, x )
call SetUnitY( bj_lastCreatedUnit, y )
return bj_lastCreatedUnit
endfunction
private function GetLocZ takes real x, real y returns real
call MoveLocation( LFZ, x, y )
return GetLocationZ( LFZ )
endfunction
private struct SpellS
unit caster
unit array dummy[4]
player p
real time
real timeMax
real array x[5]
real array y[5]
real array z[5]
real array d[5]
real array a[5]
real array az[5]
real lastx
real lasty
endstruct
private function Move takes nothing returns nothing
local SpellS A = LoadInteger( H, GetHandleId( GetExpiredTimer( ) ), 0 )
local real array x
local real array y
local real array z
local real array d
local real array a
local real array az
local integer i = 0
local integer k = 0
local integer count = 5
set A.time = A.time + 0.03125 / A.timeMax
loop
set x[i] = A.x[i]
set y[i] = A.y[i]
set z[i] = A.z[i]
set d[i] = A.d[i]
set a[i] = A.a[i]
set az[i] = A.az[i]
set i = i + 1
exitwhen i > count
endloop
loop
set i = 0
loop
set x[i] = ( 1.00 - A.time ) * x[i] + A.time * x[i + 1]
set y[i] = ( 1.00 - A.time ) * y[i] + A.time * y[i + 1]
set z[i] = ( 1.00 - A.time ) * z[i] + A.time * z[i + 1]
set d[i] = ( 1.00 - A.time ) * d[i] + A.time * d[i + 1]
set a[i] = ( 1.00 - A.time ) * a[i] + A.time * a[i + 1]
set az[i] = ( 1.00 - A.time ) * az[i] + A.time * az[i + 1]
set i = i + 1
exitwhen i > count - k
endloop
set k = k + 1
exitwhen k >= count - 1
endloop
set x[0] = x[0] + d[0] * Sin( az[0] ) * Cos( a[0] )
set y[0] = y[0] + d[0] * Sin( az[0] ) * Sin( a[0] )
set z[0] = z[0] - GetLocZ( x[0], y[0] ) + d[0] * Cos( az[0] )
set i = 0
loop
call SetUnitX( A.dummy[i], x[0] )
call SetUnitY( A.dummy[i], y[0] )
call SetUnitFlyHeight( A.dummy[i], z[0], 0.00 )
call SetUnitFacing( A.dummy[i], Atan2( y[0] - A.lasty, x[0] - A.lastx ) * bj_RADTODEG )
set i = i + 1
exitwhen i > 3
endloop
if A.time >= 1.00 then
call PauseTimer( GetExpiredTimer( ) )
call FlushChildHashtable( H, GetHandleId( GetExpiredTimer( ) ) )
call DestroyTimer( GetExpiredTimer( ) )
set i = 0
loop
call SetUnitAnimation( A.dummy[i], "death" )
call UnitApplyTimedLife( A.dummy[i], 'BTLF', 6.00 )
set A.dummy[i] = null
set i = i + 1
exitwhen i > 3
endloop
set A.caster = null
call A.destroy( )
else
set A.lastx = x[0]
set A.lasty = y[0]
endif
endfunction
private function Trig_Melee_Initialization_Actions takes nothing returns nothing
local timer t
local SpellS A
local real x = GetSpellTargetX( )
local real y = GetSpellTargetY( )
local real z = GetLocZ( x, y )
local real a = GetRandomReal( -bj_PI, bj_PI )
local real az = GetRandomReal( -bj_PI, bj_PI )
local integer i = 16
loop
set t = CreateTimer( )
set A = SpellS.create( )
set A.caster = GetTriggerUnit( )
set A.p = GetOwningPlayer( A.caster )
set A.dummy[0] = CreateUnitEx( A.p, 'u009', x, y, a * bj_RADTODEG )
set A.dummy[1] = CreateUnitEx( A.p, 'u00A', x, y, a * bj_RADTODEG )
set A.dummy[2] = CreateUnitEx( A.p, 'u00B', x, y, a * bj_RADTODEG )
set A.dummy[3] = CreateUnitEx( A.p, 'u00C', x, y, a * bj_RADTODEG )
call SetUnitAnimation( A.dummy[0], "birth" )
call QueueUnitAnimation( A.dummy[0], "stand" )
call SetUnitAnimation( A.dummy[1], "birth" )
call QueueUnitAnimation( A.dummy[1], "stand" )
call SetUnitAnimation( A.dummy[2], "birth" )
call QueueUnitAnimation( A.dummy[2], "stand" )
call SetUnitAnimation( A.dummy[3], "birth" )
call QueueUnitAnimation( A.dummy[3], "stand" )
set A.lastx = x
set A.lasty = y
set A.x[0] = x
set A.y[0] = y
set A.z[0] = z
set A.d[0] = 0.00
set A.a[0] = a
set A.az[0] = az
set A.x[1] = x + 200.00 * Cos( a )
set A.y[1] = y + 200.00 * Sin( a )
set A.z[1] = z + 300.00
set A.d[1] = 250.00
set A.a[1] = a - 90.00 * bj_DEGTORAD
set A.az[1] = az + 90.00 * bj_DEGTORAD
set A.x[2] = x + 200.00 * Cos( a )
set A.y[2] = x + 200.00 * Sin( a )
set A.z[2] = z + 300.00
set A.d[2] = 350.00
set A.a[2] = a - 180.00 * bj_DEGTORAD
set A.az[2] = az + 180.00 * bj_DEGTORAD
set A.x[3] = x + 200.00 * Cos( a )
set A.y[3] = y + 200.00 * Sin( a )
set A.z[3] = z + 300.00
set A.d[3] = 300.00
set A.a[3] = a - 270.00 * bj_DEGTORAD
set A.az[3] = az + 270.00 * bj_DEGTORAD
set A.x[4] = x + 200.00 * Cos( a )
set A.y[4] = y + 200.00 * Sin( a )
set A.z[4] = z + 300.00
set A.d[4] = 300.00
set A.a[4] = a - 360.00 * bj_DEGTORAD
set A.az[4] = az + 360.00 * bj_DEGTORAD
set A.time = 0.00
set A.timeMax = GetRandomReal( 3.00, 6.00 )
call SaveInteger( H, GetHandleId( t ), 0, A )
call TimerStart( t, 0.03125, true, function Move )
set i = i - 1
exitwhen i <= 0
set az = GetRandomReal( -bj_PI, bj_PI )//az + bj_PI * 2.00 / 3.00
set a = a + bj_PI * 2.00 / 16.00
endloop
set t = null
endfunction
private function Trig_Melee_Initialization_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A002'
endfunction
//===========================================================================
function InitTrig_Melee_Initialization_Copy_Copy takes nothing returns nothing
set gg_trg_Melee_Initialization_Copy_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Melee_Initialization_Copy_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Melee_Initialization_Copy_Copy, Condition( function Trig_Melee_Initialization_Conditions ) )
call TriggerAddAction( gg_trg_Melee_Initialization_Copy_Copy, function Trig_Melee_Initialization_Actions )
endfunction
endlibrary
Melee Initialization Copy Copy 2
library MyLib3
globals
private constant hashtable H = InitHashtable( )
private constant location LFZ = Location( 0.00, 0.00 )
endglobals
native UnitAlive takes unit id returns boolean
private function CreateUnitEx takes player id, integer unitid, real x, real y, real face returns unit
set bj_lastCreatedUnit = CreateUnit( id, unitid, x, y, face )
call SetUnitPathing( bj_lastCreatedUnit, false )
call UnitAddAbility( bj_lastCreatedUnit, 'Arav' )
call SetUnitX( bj_lastCreatedUnit, x )
call SetUnitY( bj_lastCreatedUnit, y )
return bj_lastCreatedUnit
endfunction
private function GetLocZ takes real x, real y returns real
call MoveLocation( LFZ, x, y )
return GetLocationZ( LFZ )
endfunction
private struct SpellS
unit caster
unit array dummy[4]
player p
real a
real time
real timeMax
real array x[5]
real array y[5]
real array z[5]
real array d[5]
real array az[5]
endstruct
private function Move takes nothing returns nothing
local SpellS A = LoadInteger( H, GetHandleId( GetExpiredTimer( ) ), 0 )
local real array x
local real array y
local real array z
local real array d
local real array az
local integer i = 0
local integer k = 0
local integer count = 5
set A.time = A.time + 0.03125 / A.timeMax
loop
set x[i] = A.x[i]
set y[i] = A.y[i]
set z[i] = A.z[i]
set d[i] = A.d[i]
set az[i] = A.az[i]
set i = i + 1
exitwhen i > count
endloop
loop
set i = 0
loop
set x[i] = ( 1.00 - A.time ) * x[i] + A.time * x[i + 1]
set y[i] = ( 1.00 - A.time ) * y[i] + A.time * y[i + 1]
set z[i] = ( 1.00 - A.time ) * z[i] + A.time * z[i + 1]
set d[i] = ( 1.00 - A.time ) * d[i] + A.time * d[i + 1]
set az[i] = ( 1.00 - A.time ) * az[i] + A.time * az[i + 1]
set i = i + 1
exitwhen i > count - k
endloop
set k = k + 1
exitwhen k >= count - 1
endloop
set z[0] = z[0] - GetLocZ( x[0], y[0] )
set i = 0
loop
call SetUnitX( A.dummy[i], x[0] + d[0] * Sin( az[0] ) * Cos( A.a ) )
call SetUnitY( A.dummy[i], y[0] + d[0] * Sin( az[0] ) * Sin( A.a ) )
call SetUnitFlyHeight( A.dummy[i], z[0] + d[0] * Cos( az[0] ), 0.00 )
set i = i + 1
exitwhen i > 3
endloop
if A.time >= 1.00 then
call PauseTimer( GetExpiredTimer( ) )
call FlushChildHashtable( H, GetHandleId( GetExpiredTimer( ) ) )
call DestroyTimer( GetExpiredTimer( ) )
set i = 0
loop
call SetUnitAnimation( A.dummy[i], "death" )
call UnitApplyTimedLife( A.dummy[i], 'BTLF', 6.00 )
set A.dummy[i] = null
set i = i + 1
exitwhen i > 3
endloop
set A.caster = null
call A.destroy( )
endif
endfunction
private function Trig_Melee_Initialization_Actions takes nothing returns nothing
local timer t
local SpellS A
local real x = GetUnitX( GetTriggerUnit( ) )
local real y = GetUnitY( GetTriggerUnit( ) )
local real z = GetLocZ( x, y ) + 50.00
local real a = Atan2( GetSpellTargetY( ) - y, GetSpellTargetX( ) - x )
local real az = GetRandomReal( -bj_PI, bj_PI )
local integer i
local integer k = 0
loop
set i = 6
loop
set t = CreateTimer( )
set A = SpellS.create( )
set A.caster = GetTriggerUnit( )
set A.p = GetOwningPlayer( A.caster )
set A.dummy[0] = CreateUnitEx( A.p, 'u009', x, y, a * bj_RADTODEG )
set A.dummy[1] = CreateUnitEx( A.p, 'u00A', x, y, a * bj_RADTODEG )
set A.dummy[2] = CreateUnitEx( A.p, 'u00B', x, y, a * bj_RADTODEG )
set A.dummy[3] = CreateUnitEx( A.p, 'u00C', x, y, a * bj_RADTODEG )
call SetUnitAnimation( A.dummy[0], "birth" )
call QueueUnitAnimation( A.dummy[0], "stand" )
call SetUnitAnimation( A.dummy[1], "birth" )
call QueueUnitAnimation( A.dummy[1], "stand" )
call SetUnitAnimation( A.dummy[2], "birth" )
call QueueUnitAnimation( A.dummy[2], "stand" )
call SetUnitAnimation( A.dummy[3], "birth" )
call QueueUnitAnimation( A.dummy[3], "stand" )
set A.a = a - 180.00 * bj_DEGTORAD
set A.x[0] = x
set A.y[0] = y
set A.z[0] = z
set A.d[0] = 0.00
set A.az[0] = az
set A.x[1] = x + 200.00 * Cos( a )
set A.y[1] = y + 200.00 * Sin( a )
set A.z[1] = z
set A.d[1] = 50.00
set A.az[1] = az + 90.00 * bj_DEGTORAD
set A.x[2] = x + 400.00 * Cos( a )
set A.y[2] = y + 400.00 * Sin( a )
set A.z[2] = z + 25.00
set A.d[2] = 75.00
set A.az[2] = az + 180.00 * bj_DEGTORAD
set A.x[3] = x + 700.00 * Cos( a )
set A.y[3] = y + 700.00 * Sin( a )
set A.z[3] = z + 75.00
set A.d[3] = 75.00
set A.az[3] = az + 270.00 * bj_DEGTORAD
set A.x[4] = x + 600.00 * Cos( a )
set A.y[4] = y + 600.00 * Sin( a )
set A.z[4] = z + 150.00
set A.d[4] = 200.00
set A.az[4] = az + 360.00 * bj_DEGTORAD
set A.time = 0.00
set A.timeMax = 0.75
call SaveInteger( H, GetHandleId( t ), 0, A )
call TimerStart( t, 0.03125, true, function Move )
set i = i - 1
exitwhen i <= 0
set az = az + bj_PI * 2.00 / 6.00
endloop
set k = k - 1
exitwhen k <= 0
call TriggerSleepAction( 0.10 )
endloop
set t = null
endfunction
private function Trig_Melee_Initialization_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A003'
endfunction
//===========================================================================
function InitTrig_Melee_Initialization_Copy_Copy_2 takes nothing returns nothing
set gg_trg_Melee_Initialization_Copy_Copy_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Melee_Initialization_Copy_Copy_2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Melee_Initialization_Copy_Copy_2, Condition( function Trig_Melee_Initialization_Conditions ) )
call TriggerAddAction( gg_trg_Melee_Initialization_Copy_Copy_2, function Trig_Melee_Initialization_Actions )
endfunction
endlibrary
Функции мемхака возможно будут даже хуже для такого кол-ва эффектов, и тем не менее можно объединить 4 модели в одну, если так сильно нужна оптимизация