1. I'm aware of all the PolarProjectionBJ's and AngleBetweenPoints, DistanceBetweenPoints... that I maybe use... but please don't say anything.... because I don't know how to do that maths for it....
2. Is this a good way to code a spiralish spell? I use ABC v6.0 and it's the only way I know how to attach a struct to timer thingy... it's for my Arena
3. Spoiler is not working?
[del]4. I just realised.... it's not MUI is it? I spammed it like 10 instances, and it stuffed up? Is it because of the unit arrays?[/del]
4. If using array... is it 8192 / ARRAY NUMBER..... so is it 8192 / 10 = 819.2 instances for my spell?
2. Is this a good way to code a spiralish spell? I use ABC v6.0 and it's the only way I know how to attach a struct to timer thingy... it's for my Arena
3. Spoiler is not working?
[del]4. I just realised.... it's not MUI is it? I spammed it like 10 instances, and it stuffed up? Is it because of the unit arrays?[/del]
4. If using array... is it 8192 / ARRAY NUMBER..... so is it 8192 / 10 = 819.2 instances for my spell?
JASS:
scope EnergyVortex initializer Init
// Spiral of green or yellow energy... Similar to Light Burst
// Depletes enemy mana, but not yet completed. Effect is.
// But drain is not.
globals
private constant integer SpellID = 039;A006039;
private constant integer DumID = 039;h001039;
private constant real AOE = 400.00
private constant real Speed = 30.00
private constant real xAngSpeed = 12.00
private constant real xAOE = 250.00
endglobals
private struct EV
unit array Dummy[10]
timer t
unit Cast
player CO
real Height
real Dist
real TimeOut
private method onDestroy takes nothing returns nothing
local integer i = 0
call DestroyTimer( .t )
loop
exitwhen i == 8
call KillUnit( .Dummy[ i ] )
set i = i + 1
endloop
call ClearTimerStructA( .t )
endmethod
endstruct
private struct SD
unit array SDum[10]
timer t
real Height
real Dist
location CLoc
real array Ang[10]
real TickTock
private method onDestroy takes nothing returns nothing
local integer i = 0
call DestroyTimer( .t )
loop
exitwhen i == 8
call KillUnit( .SDum[ i ] )
set i = i + 1
endloop
call ClearTimerStructB( .t )
endmethod
endstruct
private function Cond takes nothing returns boolean
return GetSpellAbilityId() == SpellID
endfunction
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local location NewLoc
local location DumLoc
local integer i = 0
local real Angle = 0.00
local EV d = GetTimerStructA( t )
set d.TimeOut = d.TimeOut + 0.04
if ( d.Dist >= AOE ) then
set d.Height = d.Height + 25.00
loop
exitwhen i == 8
call SetUnitFlyHeight( d.Dummy<i>, d.Height, 1000.00 )
set i = i + 1
endloop
else
// ELSE ACTIONS
set d.Dist = d.Dist + 30.00
loop
exitwhen i == 8
set DumLoc = GetUnitLoc( d.Dummy<i> )
set NewLoc = PolarProjectionBJ( DumLoc, Speed, Angle )
call SetUnitPositionLoc( d.Dummy<i>, NewLoc )
set Angle = Angle + 45
set i = i + 1
call RemoveLocation( DumLoc )
call RemoveLocation( NewLoc )
endloop
endif
if ( d.TimeOut == 2 ) then
call d.destroy()
endif
set NewLoc = null
set DumLoc = null
endfunction
private function SCallback takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer i = 0
local integer II = 0
local location DumLoc
local location NewLoc
local real Angle = 0.00
local SD x = GetTimerStructB( t )
// Continous SOUND!
call IssueImmediateOrder( x.SDum<i>, "roar" )
// Ticker and Height upper.
set x.TickTock = x.TickTock + 0.04
set x.Height = x.Height + 16.00
// Constant height increase.
loop
exitwhen II == 8
call SetUnitFlyHeight( x.SDum[II], x.Height, 1000.00 )
set II = II + 1
endloop
// If the distance travelled becomes 200.
// We start spinning.
if ( x.Dist >= xAOE ) then
loop
exitwhen i == 8
set x.Ang<i> = x.Ang<i> + xAngSpeed
set DumLoc = GetUnitLoc( x.SDum[ i ] )
set NewLoc = PolarProjectionBJ( x.CLoc, 250.00, x.Ang<i> )
call SetUnitPositionLoc( x.SDum<i>, NewLoc )
set i = i + 1
endloop
// We move the units here.
else
set x.Dist = x.Dist + 20
loop
exitwhen i == 8
set DumLoc = GetUnitLoc( x.SDum[ i ] )
set NewLoc = PolarProjectionBJ( DumLoc, 20.00, Angle )
call SetUnitPositionLoc( x.SDum<i>, NewLoc )
set Angle = Angle + 45
set i = i + 1
call RemoveLocation( DumLoc )
call RemoveLocation( NewLoc )
endloop
endif
if ( x.TickTock == 2 ) then
call x.destroy()
endif
set NewLoc = null
set DumLoc = null
endfunction
private function Main takes nothing returns nothing
local EV d = EV.create()
local SD x = SD.create()
local real X
local real Y
local real Angle = 0
local integer i = 0
set d.t = CreateTimer()
set d.Height = 100.00
set d.TimeOut = 0.00
set d.Dist = 0.00
set d.Cast = GetTriggerUnit()
set d.CO = GetOwningPlayer( d.Cast )
set x.CLoc = GetUnitLoc( d.Cast )
set x.t = CreateTimer()
set x.TickTock = 0.00
set x.Dist = 0.00
set x.Height = 100.00
set x.Ang[ x ] = 0.00
set X = GetUnitX( d.Cast )
set Y = GetUnitY( d.Cast )
loop
exitwhen i == 8
set Angle = Angle + 45
set d.Dummy<i> = CreateUnit( d.CO, DumID, X, Y, Angle )
set i = i + 1
endloop
set i = 0
set Angle = 0
loop
exitwhen i == 8
set Angle = Angle + 45
set x.SDum<i> = CreateUnit( d.CO, DumID, X, Y, Angle )
set x.Ang<i> = Angle
set i = i + 1
endloop
call TimerStart( x.t, 0.04, true, function SCallback )
call SetTimerStructB(x.t, d)
call TimerStart( d.t, 0.04, true, function Callback )
call SetTimerStructA(d.t, d)
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Cond ) )
call TriggerAddAction( t, function Main )
set t = null
endfunction
endscope</i></i></i></i></i></i></i></i></i></i></i></i>