HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help Again(will be really appreciated)

07-19-2008, 11:51 PM#1
goldendercon
Once again, I am pleading for help on a spell, If you think I'm too much of a bother, then i don't mind, well anyway here's what I've got:

6 triggers(DAMN that's many, some of you might think, and i agree with you)
1st trigger:
Collapse JASS:
function Trig_BlazingFlightInit_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000' 
endfunction

function Trig_BlazingFlightInit_Func002001 takes nothing returns boolean
    return ( I2R(GetUnitAbilityLevelSwapped('A003', GetTriggerUnit())) > 0.00 )
endfunction

function Trig_BlazingFlightInit_Func003Func003001 takes nothing returns boolean
    return ( I2R(GetUnitAbilityLevelSwapped('A003', GetTriggerUnit())) > 0.00 )
endfunction

function Trig_BlazingFlightInit_Actions takes nothing returns nothing
    local integer i = 1
    local unit F= GetTriggerUnit()
    local unit array E
    set udg_rotation= 0
    set udg_FlightCaster=GetTriggerUnit()
    if ( Trig_BlazingFlightInit_Func002001() ) then
        call StartTimerBJ( udg_BlazingFlightTimer, false, 30 )
    else
        call StartTimerBJ( udg_BlazingFlightTimer, false, 15.00 )
    endif
    loop
        exitwhen i > 4
        call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(F), PolarProjectionBJ(GetUnitLoc(F), 200.00, ( 90.00 * I2R(i) )), bj_UNIT_FACING )
        set udg_Effe_Unit[i] = GetLastCreatedUnit()
        if ( Trig_BlazingFlightInit_Func003Func003001() ) then
            call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
        else
            call UnitApplyTimedLifeBJ( 15.00, 'BTLF', GetLastCreatedUnit() )
        endif
        set i = i + 1
    endloop
    call EnableTrigger( gg_trg_FlightMovement )
endfunction

//===========================================================================
function InitTrig_BlazingFlightInit takes nothing returns nothing
    set gg_trg_BlazingFlightInit = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_BlazingFlightInit, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_BlazingFlightInit, Condition( function Trig_BlazingFlightInit_Conditions ) )
    call TriggerAddAction( gg_trg_BlazingFlightInit, function Trig_BlazingFlightInit_Actions )
    call Preload("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl")
endfunction

2nd trigger
Collapse JASS:
function Trig_FlightMovement_Actions takes nothing returns nothing
    local unit F=udg_FlightCaster
    local unit E= udg_Effe_Unit[1]
    local unit E2= udg_Effe_Unit[2]
    local unit E3= udg_Effe_Unit[3]
    local unit E4= udg_Effe_Unit[4]
    local integer D=200
    call SetUnitFlyHeightBJ( F, 450.00, 75.00 )
    call SetUnitPositionLoc( E, PolarProjectionBJ(GetUnitLoc(F), 200, ( AngleBetweenPoints(GetUnitLoc(F), GetUnitLoc(E)) + 5.00 )) )
    call SetUnitFlyHeightBJ( E, 450.00, 75.00 )
    call SetUnitPositionLoc( E2, PolarProjectionBJ(GetUnitLoc(F), 200, ( AngleBetweenPoints(GetUnitLoc(F), GetUnitLoc(E2)) - 5.00 )) )
    call SetUnitFlyHeightBJ( E2, 450.00, 75.00 )
    call SetUnitPositionLoc( E3, PolarProjectionBJ(GetUnitLoc(F), 200, ( AngleBetweenPoints(GetUnitLoc(F), GetUnitLoc(E3)) + 5.00 )) )
    call SetUnitFlyHeightBJ( E3, 450.00, 75.00 )
    call SetUnitPositionLoc( E4, PolarProjectionBJ(GetUnitLoc(F), 200, ( AngleBetweenPoints(GetUnitLoc(F), GetUnitLoc(E4)) - 5.00 )) )
    call SetUnitFlyHeightBJ( E4, 450.00, 75.00 )
endfunction

//===========================================================================
function InitTrig_FlightMovement takes nothing returns nothing
    set gg_trg_FlightMovement = CreateTrigger(  )
    call DisableTrigger( gg_trg_FlightMovement )
    call TriggerRegisterTimerEventPeriodic( gg_trg_FlightMovement, 0.04 )
    call TriggerAddAction( gg_trg_FlightMovement, function Trig_FlightMovement_Actions )
endfunction

3rd trigger
Collapse JASS:
function Trig_LeakBuster_Actions takes nothing returns nothing
    call SetUnitFlyHeightBJ( udg_FlightCaster, 1.00, 75.00 )
    set udg_Effe_Unit[1] = null
    set udg_Effe_Unit[2] = null
    set udg_Effe_Unit[3] = null
    set udg_Effe_Unit[4] = null
    set udg_FlightCaster = null
endfunction

//===========================================================================
function InitTrig_LeakBuster takes nothing returns nothing
    set gg_trg_LeakBuster = CreateTrigger(  )
    call TriggerRegisterTimerExpireEventBJ( gg_trg_LeakBuster, udg_BlazingFlightTimer )
    call TriggerAddAction( gg_trg_LeakBuster, function Trig_LeakBuster_Actions )
endfunction

4th trigger
Collapse JASS:
function Trig_GroundedCircle_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Trig_GroundedCircle_Func002001 takes nothing returns boolean
    return ( I2R(GetUnitAbilityLevelSwapped('A003', GetTriggerUnit())) > 0.00 )
endfunction

function Trig_GroundedCircle_Func003Func003001 takes nothing returns boolean
    return ( I2R(GetUnitAbilityLevelSwapped('A003', GetTriggerUnit())) > 0.00 )
endfunction

function Trig_GroundedCircle_Actions takes nothing returns nothing
    local unit C = GetTriggerUnit()
    local integer i = 1
    local integer Ie = 36
    set udg_CCaster = GetTriggerUnit()
    if ( Trig_GroundedCircle_Func002001() ) then
        call StartTimerBJ( udg_CircleTimer[1], false, 30 )
    else
        call StartTimerBJ( udg_CircleTimer[1], false, 15.00 )
    endif
    loop
        exitwhen i > Ie
        call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(C), PolarProjectionBJ(GetUnitLoc(C), 400.00, ( I2R(i) * 10.00 )), bj_UNIT_FACING )
        set udg_Circle_missile[i] = GetLastCreatedUnit()
        if ( Trig_GroundedCircle_Func003Func003001() ) then
            call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
        else
            call UnitApplyTimedLifeBJ( 15.00, 'BTLF', GetLastCreatedUnit() )
        endif
        set i = i + 1
    endloop
    call EnableTrigger( gg_trg_FlightMovement )
endfunction

//===========================================================================
function InitTrig_GroundedCircle takes nothing returns nothing
    set gg_trg_GroundedCircle = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_GroundedCircle, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_GroundedCircle, Condition( function Trig_GroundedCircle_Conditions ) )
    call TriggerAddAction( gg_trg_GroundedCircle, function Trig_GroundedCircle_Actions )
endfunction

5th trigger
Collapse JASS:
function Trig_CircleMovement_Actions takes nothing returns nothing
    local integer i=1
    local location loc=GetUnitLoc(udg_CCaster)
    local location loc2

    set udg_rotation=udg_rotation+5   

    loop
        exitwhen i>36
        set loc2=GetUnitLoc(udg_Circle_missile[i])
// Replace DistanceBetweenPoints with 400 ?
        call SetUnitPositionLoc( udg_Circle_missile[i], PolarProjectionBJ(loc, 400,  udg_rotation + i*10  ))
        call RemoveLocation(loc2)
        set i=i+1
    endloop
endfunction

//===========================================================================
function InitTrig_CircleMovement takes nothing returns nothing
    set gg_trg_CircleMovement = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_CircleMovement, 0.04 )
    call TriggerAddAction( gg_trg_CircleMovement, function Trig_CircleMovement_Actions )
endfunction

6th trigger
Collapse JASS:
function Trig_CircleNull_Actions takes nothing returns nothing
    local integer i=1
    loop
        exitwhen i>36
        set udg_Circle_missile[i] = null
        set i=i+1
    endloop
    set udg_CCaster = null
endfunction

//===========================================================================
function InitTrig_CircleNull takes nothing returns nothing
    set gg_trg_CircleNull = CreateTrigger(  )
    call TriggerRegisterTimerExpireEventBJ( gg_trg_CircleNull, udg_CircleTimer[1] )
    call TriggerAddAction( gg_trg_CircleNull, function Trig_CircleNull_Actions )
endfunction

help that will be appreciated
  • making it follow the JESP standard
  • Help with spotting bugs
  • reducing lag

all help jass or vJASS is appreciated, and I will give +rep
to the persons that will help me, even in a small way because I really appreciate any and all help given to me
07-20-2008, 02:32 AM#2
Tide-Arc Ephemera
Why are you nulling globals? As far as I know, they don't need nulling.

By the way, is this a GUI spell converted to Jass to build its efficiency 'n' stuff?
07-20-2008, 04:38 AM#3
goldendercon
well kinda, but my only problem is optimizing it and getting rid of exploitable bugs
07-20-2008, 04:40 AM#4
Tide-Arc Ephemera
Well as long as you're not referring to a value before it's set I don't see why it would bug.

EDIT!
In Trigger #2 you're leaking various locations... you need to set unit points to point variables and then null them, otherwise it leaks.
07-20-2008, 04:42 AM#5
goldendercon
okay thanks, now to get some help on making it follow the JESP standard +rep

EDIT: oh thanks, do you need a test map or anything to check the spell
07-20-2008, 04:50 AM#6
Tide-Arc Ephemera
Cleaning leaks and making configuration should assist in that.
Collapse JASS:
function Example_DamageHere takes nothing returns integer
    return 400
endfunction

function Example_RangeHere takes nothing returns real
    return 600.
endfunction

// ---
// Then you'd do stuff like whenever dealing damage you'd refer to Example_DamageHere but that's, as suggested, an example.
// Best hint could be to look at an already JESP spell and see what they've done AND read the JESP standard included.


07-20-2008, 04:53 AM#7
goldendercon
I know but i don't know vJASS, i only know JASS
07-20-2008, 05:17 AM#8
Tide-Arc Ephemera
That's where my limits meet it's end, sad to say. I use Mac and I don't have access to those fancy pizazz tools. Mayhaps someone else will be kind enough to have a look over this.
07-20-2008, 05:19 AM#9
goldendercon
awwwww...... anyways thanks for the help you've given me so far, although I have been having troubles with almost all my spells recently
07-20-2008, 05:21 AM#10
darkwulfv
Configuration functions aren't vJASS.

Just make the functions like Tide-Arc showed (putting "constant" before "function") and then use them in like normal functions.

For example:

Collapse JASS:
constant function AbilityID takes nothing returns integer
  return 'A002'
endfunction

function Blah takes nothing returns nothing
  local integer level = GetUnitAbilityLevel(GetTriggerUnit(), AbilityID())

if level > 2 then
  call DoSomething(...)
else
  call DoSomethingElse(...)
endif

endfunction

See how that works? It doesn't require vJASS, and it makes modifying spells a hell of a lot easier, either by your hand or by someone else's. (For example, say you want to change the damage of your spell after some testing. Rather than running through the spell for all instances of your damage, you can just change the constant function's return value to a different number.)

And because I'm feeling extra generous (and bored), I'll optimize some of your triggers for you.

A word of advice: Get either JASScraft or the JassNewGenPack. It makes optimizing a LOT easier.
07-20-2008, 05:33 AM#11
goldendercon
I have both, I'm just plain stupid when it comes to vJASS
07-20-2008, 05:44 AM#12
darkwulfv
This isn't vJASS. I won't use any vJASS, so you won't get confused.
EDIT: Oops, I lied. Need some vJASS for this. But it's very simple and I'll explain it, promise!

I'm working on your triggers now. I might be able to optimize into one or two triggers. I already optimized trigger one.
07-20-2008, 06:02 AM#13
goldendercon
oh thanks darkwulfv but is it possible to condense into 1 trigger? i posted a map attachment to help you
Attached Files
File type: w3xFall of Darkness1.w3x (893.2 KB)
07-20-2008, 06:29 AM#14
darkwulfv
No need for the map.

I just noticed those 6 triggers were 2 different spells, so I'll do them separately.

First: If you have JassNewGenPack, good. If not, get it! (Or this stuff won't work.)
Second: I can't guarentee these will work, but I'd be happy to fix them in the event they don't.
Third: I suck at complicated angle/projection math, and having functions that used Radians and Degrees and all that random shit threw me off. So, do me a favor (I mention this below too) and have someone check the math (post the math sections in a new topic, asking for math check) to make sure I didn't f' up somewhere.

Now then:

BEFORE: (With commentary now)
TRIGGER 1:
Collapse JASS:
//Simplified the name a bit
function Trig_BlazingFlightInit_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000' 
endfunction

//These 2 functions are made by the GUI. They are completely useless, completely uneeded
//And can be inlined immediately.
function Trig_BlazingFlightInit_Func002001 takes nothing returns boolean
    return ( I2R(GetUnitAbilityLevelSwapped('A003', GetTriggerUnit())) > 0.00 )
endfunction

function Trig_BlazingFlightInit_Func003Func003001 takes nothing returns boolean
    return ( I2R(GetUnitAbilityLevelSwapped('A003', GetTriggerUnit())) > 0.00 )
endfunction

function Trig_BlazingFlightInit_Actions takes nothing returns nothing
    local integer i = 1
    local unit F= GetTriggerUnit()
    local unit array E
    set udg_rotation= 0
    set udg_FlightCaster=GetTriggerUnit()
    //These timers? Not needed at all. All you're doing is "cleaning leaks"
    //(Which you don't actually need to "do" with your current setup.
    //Let's remove the timers now.
    if ( Trig_BlazingFlightInit_Func002001() ) then
        call StartTimerBJ( udg_BlazingFlightTimer, false, 30 )
    else
        call StartTimerBJ( udg_BlazingFlightTimer, false, 15.00 )
    endif
    
    //Lots of BJ functions here. Let's fix them! Oh, and a leak or two.
    //We can also store these dummy units in your local array without having to worry
    //About their own array.
    //Also, let's get into the habit of using X/Y values. No leaks!
    //We can also store the Owning Player of F to a local to reduce function calls.
    //PolarProjectionBJ is a terrible function. Slow, useless, and leaky. Let's optimize it.
    loop
        exitwhen i > 4
        call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(F), PolarProjectionBJ(GetUnitLoc(F), 200.00, ( 90.00 * I2R(i) )), bj_UNIT_FACING )
        set udg_Effe_Unit[i] = GetLastCreatedUnit()
        if ( Trig_BlazingFlightInit_Func003Func003001() ) then
        //Yucky BJ's.
            call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
        else
            call UnitApplyTimedLifeBJ( 15.00, 'BTLF', GetLastCreatedUnit() )
        endif
        set i = i + 1
    endloop
    call EnableTrigger( gg_trg_FlightMovement )
endfunction

//===========================================================================
//We can do a bit of simplification here.
function InitTrig_BlazingFlightInit takes nothing returns nothing
    set gg_trg_BlazingFlight = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_BlazingFlight, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_BlazingFlight, Condition( function Trig_BlazingFlightInit_Conditions ) )
    call TriggerAddAction( gg_trg_BlazingFlight, function Trig_BlazingFlightInit_Actions )
    call Preload("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl")
endfunction
TRIGGER 2
Collapse JASS:
//This trigger is being merged with the first trigger!
//Yay for optimization!

function Trig_FlightMovement_Actions takes nothing returns nothing
//None of these are needed.
    local unit F=udg_FlightCaster
    local unit E= udg_Effe_Unit[1]
    local unit E2= udg_Effe_Unit[2]
    local unit E3= udg_Effe_Unit[3]
    local unit E4= udg_Effe_Unit[4]
    //You don't even use this!
    //vvvvvvvvvvvvvvvv
    local integer D=200
    //^^^^^^^^^^^^^^^^
    //Ugh lots of BJ's. Clean clean clean!
    //You also leak massive locations every wear. Laglaglaglag.
    //It's time to use lots of x/y and math stuff. Joy.
    call SetUnitFlyHeightBJ( F, 450.00, 75.00 )
    call SetUnitPositionLoc( E, PolarProjectionBJ(GetUnitLoc(F), 200, ( AngleBetweenPoints(GetUnitLoc(F), GetUnitLoc(E)) + 5.00 )) )
    call SetUnitFlyHeightBJ( E, 450.00, 75.00 )
    call SetUnitPositionLoc( E2, PolarProjectionBJ(GetUnitLoc(F), 200, ( AngleBetweenPoints(GetUnitLoc(F), GetUnitLoc(E2)) - 5.00 )) )
    call SetUnitFlyHeightBJ( E2, 450.00, 75.00 )
    call SetUnitPositionLoc( E3, PolarProjectionBJ(GetUnitLoc(F), 200, ( AngleBetweenPoints(GetUnitLoc(F), GetUnitLoc(E3)) + 5.00 )) )
    call SetUnitFlyHeightBJ( E3, 450.00, 75.00 )
    call SetUnitPositionLoc( E4, PolarProjectionBJ(GetUnitLoc(F), 200, ( AngleBetweenPoints(GetUnitLoc(F), GetUnitLoc(E4)) - 5.00 )) )
    call SetUnitFlyHeightBJ( E4, 450.00, 75.00 )
endfunction

//===========================================================================
function InitTrig_FlightMovement takes nothing returns nothing
    set gg_trg_FlightMovement = CreateTrigger(  )
    call DisableTrigger( gg_trg_FlightMovement )
    call TriggerRegisterTimerEventPeriodic( gg_trg_FlightMovement, 0.04 )
    call TriggerAddAction( gg_trg_FlightMovement, function Trig_FlightMovement_Actions )
endfunction
Collapse JASS:
//This whole thing isn't needed!! OBLITERATE IT!

function Trig_LeakBuster_Actions takes nothing returns nothing
    call SetUnitFlyHeightBJ( udg_FlightCaster, 1.00, 75.00 )
    set udg_Effe_Unit[1] = null
    set udg_Effe_Unit[2] = null
    set udg_Effe_Unit[3] = null
    set udg_Effe_Unit[4] = null
    set udg_FlightCaster = null
endfunction

//===========================================================================
function InitTrig_LeakBuster takes nothing returns nothing
    set gg_trg_LeakBuster = CreateTrigger(  )
    call TriggerRegisterTimerExpireEventBJ( gg_trg_LeakBuster, udg_BlazingFlightTimer )
    call TriggerAddAction( gg_trg_LeakBuster, function Trig_LeakBuster_Actions )
endfunction

AFTER:

(Just a note: I'm not a supermathgeniuswhiz. So, do me a favor and have someone who is check the math on in this trigger, because all that PolarProjectionBJ and AngleBetweenPoints crap was messing me up (one was radians one was degrees, blah!)
TRIGGER 1:
Collapse JASS:
//Structs are like... data centers. They hold data so you can access them in other functions.
//They're a bit like globals, only cooler. You're going to need KaTTaNa's Handle Vars
//for this. I've provided the code for you. (In a seperate trigger)
struct BlazeFlightData
  unit caster
  unit array dummies[10]
endstruct  
  
  
//Rather than use a seperate trigger (which isn't MUI at all), we'll use a timer.  
function BlazingFlight_Callback takes nothing returns nothing
  local timer t = GetExpiredTimer()
  //This is how we grab our struct attached to the timer
  local BlazeFlightData dat = GetHandleInt(t, "BlazeData")
  //We get values from the struct similarly to how we set them.
  //"local TYPE name = localstruct.Member"
  //See below?
  //TYPE is unit, name is F, localstruct is dat (we created it above), and the member is "caster"
  local unit F = dat.caster
  local unit dummy1 = dat.dummies[1]
  local unit dummy2 = dat.dummies[2]
  local unit dummy3 = dat.dummies[3]
  local unit dummy4 = dat.dummies[4]
  local real x = GetUnitX(F)
  local real y = GetUnitY(F)
  local real x2 = 0
  local real y2 = 0
  local real angle = 0
  
    call SetUnitFlyHeight( F, 450.00, 75.00 )
    set angle = (Atan2(GetUnitY(dummy1) - y, GetUnitX(dummy1) - x)) + (bj_DEGTORAD *5.)
    set x2 = x + 200 * Cos(angle)
    set y2 = y + 200 * Sin(angle)
    call SetUnitPosition( dummy1, x2, y2)
    call SetUnitFlyHeight(dummy1, 450.00, 75.00 )
    
    set angle = (Atan2(GetUnitY(dummy2) - y, GetUnitX(dummy2) - x)) - (bj_DEGTORAD *5.)
    set x2 = x + 200 * Cos(angle)
    set y2 = y + 200 * Sin(angle)
    call SetUnitPosition( dummy2, x2, y2 )
    call SetUnitFlyHeight(dummy2, 450.00, 75.00 )
    
    set angle = (Atan2(GetUnitY(dummy3) - y, GetUnitX(dummy3) - x)) + (bj_DEGTORAD *5.)
    set x2 = x + 200 * Cos(angle)
    set y2 = y + 200 * Sin(angle)
    call SetUnitPosition(dummy3, x2, y2 )
    call SetUnitFlyHeight(dummy3, 450.00, 75.00 )
    
    set angle = (Atan2(GetUnitY(dummy4) - y, GetUnitX(dummy4) - x)) - (bj_DEGTORAD *5.)
    set x2 = x + 200 * Cos(angle)
    set y2 = y + 200 * Sin(angle)
    call SetUnitPosition(dummy4, x2, y2 )
    call SetUnitFlyHeight(dummy4, 450.00, 75.00 )
    
    set F = null
    set dummy1 = null
    set dummy2 = null
    set dummy3 = null
    set dummy4 = null
    set t = null
    call dat.destroy()
endfunction  

function BlazingFlight_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000' 
endfunction

function BlazingFlight_Actions takes nothing returns nothing
    local integer i = 1
    local unit F= GetTriggerUnit()
    local real rotation = 0
    local real x = GetUnitX(F)
    local real y = GetUnitY(F)
    local player p = GetOwningPlayer(F)
    local unit array E
    local real x2 = 0
    local real y2 = 0
    local timer t = CreateTimer()
    local real wait = 0
    //We need to create the struct in order to store things in it.
    local BlazeFlightData Data = BlazeFlightData.create()
    //Setting members of a struct is very similar to variables.
    //To do so, it's like this:
    //"NameOfLocalStruct.MemberName = Value"
    //See how it is below? 
    //The local struct is Data, the member we want to set is the caster, and the value is the triggering unit (F)
    set Data.caster = F
    
    loop
        exitwhen i > 4
        set x2 = x + 200 * Cos(90 * i) * bj_DEGTORAD
        set y2 = y + 200 * Sin(90 * i) * bj_DEGTORAD
        set E[i] = CreateUnit(p, 'h000', x2, y2, GetUnitFacing(F))
        set Data.dummies[i] = E[i]
        if GetUnitAbilityLevel(F, 'A003') > 0 then
            call UnitApplyTimedLife(E[i], 'BTLF', 30.00)
            set wait = 30.
        else
            call UnitApplyTimedLife(E[i], 'BTLF', 15.00)
            set wait = 15.
        endif
        set i = i + 1
    endloop
    
    //Structs are technically integers, so we attach it to the timer
    //(So we can reference it)
    //Like this:
    call SetHandleInt(t, "BlazeData", Data)
    call TimerStart(t, .04, true, function BlazingFlight_Callback)
    
    call PolledWait(wait)
    
    call PauseTimer(t)
    call DestroyTimer(t)
    call Data.destroy()
    
    
    //Cleanup!
    set i = 1
    loop
    exitwhen i > 4
      set E[i] = null
      set i = i + 1
    endloop
    
    set F = null
    set p = null
    set t = null
endfunction

//===========================================================================
function InitTrig_BlazingFlight takes nothing returns nothing
  local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(t, Condition( function BlazingFlight_Conditions ) )
    call TriggerAddAction(t, function BlazingFlight_Actions )
    call Preload("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl")
  set t = null
endfunction

TRIGGER 2: (only needed if you don't already have KaTTaNa's Handle Vars system)

Collapse JASS:
globals
  gamecache udg_GC = null
endglobals

library Handles

//==============================
function H2I takes handle h returns integer
    return h
    return 0
endfunction

// ===========================
function LocalVars takes nothing returns gamecache
    if(udg_GC==null)then
        call FlushGameCache(InitGameCache("GC"))
        set udg_GC = InitGameCache("GC")
    endif
    return udg_GC
endfunction

function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
    endif
endfunction

function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
    if value==false then
        call FlushStoredBoolean(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleString takes handle subject, string name, string value returns nothing
    if value==null then
        call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
    return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
    return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction

function GetHandleUnit takes handle subject, string name returns unit
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
endlibrary
07-20-2008, 06:33 AM#15
goldendercon
oh thanks but one thing, you made a mistake on this one, it is only one spell, the first one are the things that circle around the caster and the second one is the circle that orbits around the caster that stays on the ground, the first circle levitates along with the caster +rep