- Joined
- Dec 29, 2006
- Messages
- 994
I am trying to mae an Air Strike ability, but I don't know enough JASS to finish it completely. As it is, I just made most of it in GUI then converted it to JASS, put it into JASS craft and have been making it so you can have as many coppies of the spell going at once, but it won't work atm, and I was wondering if someone could tell me what to do, or clean it up for me if you're feeling nice ><
The main problem now: I need to select every unit in a group, set the level of an ability, make them cast the ability, remove the unit (I forgot that lie in the code ><), then check to see if the plane (gyrocopter) is outside of the ability area, and if they are remove them.
The main problem now: I need to select every unit in a group, set the level of an ability, make them cast the ability, remove the unit (I forgot that lie in the code ><), then check to see if the plane (gyrocopter) is outside of the ability area, and if they are remove them.
JASS:
function Trig_Air_Strike_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A032' ) ) then
return false
endif
return true
endfunction
function Trig_Air_Strike_Func014C takes nothing returns boolean
if ( not ( GetRandomInt(1, 2) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Air_Strike_Func015C takes nothing returns boolean
if ( not ( GetRandomInt(1, 3) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Air_Strike_Func016C takes nothing returns boolean
if ( not ( GetRandomInt(1, 4) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Air_Strike_Func017C takes nothing returns boolean
if ( not ( GetRandomInt(1, 5) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Air_Strike_Func018C takes nothing returns boolean
if ( not ( GetRandomInt(1, 6) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Air_Strike_Func020Func001Func002Func004Func002001001003 takes nothing returns boolean
return ( IsUnitInGroup(GetEnumUnit(), udg_TempUnitGroup) == true )
endfunction
function Trig_Air_Strike_Func020Func001Func002Func004C takes nothing returns boolean
if ( not ( CountUnitsInGroup(GetUnitsInRangeOfLocMatching(1000.00, udg_TempPoint, Condition(function Trig_Air_Strike_Func020Func001Func002Func004Func002001001003))) == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Air_Strike_Func020Func001C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_TempUnitGroup) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Air_Strike_Actions takes nothing returns nothing
local integer y
local integer w
local real z = GetRandomInt(0, 360)
local real x
local location a = GetSpellTargetLoc()
local location b = PolarProjectionBJ(a, 500.00, z)
local location c
local unit group d
set y = GetUnitAbilityLevelSwapped('A032', GetTriggerUnit())
if (( z) < 180 ) ) then
set x = z + 180
endif
if (( z) >= 180 ) ) then
set x = z - 180
endif
set c = PolarProjectionBJ(a, 500.00, x)
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
if ( Trig_Air_Strike_Func014C() ) then
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
else
endif
if ( Trig_Air_Strike_Func015C() ) then
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
else
endif
if ( Trig_Air_Strike_Func016C() ) then
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
else
endif
if ( Trig_Air_Strike_Func017C() ) then
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
else
endif
if ( Trig_Air_Strike_Func018C() ) then
call CreateNUnitsAtLoc( 1, 'h00W', GetOwningPlayer(GetTriggerUnit()), a), bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), d )
else
endif
call GroupPointOrderLoc (d, "move", c)
set w = 1
loop
exitwhen w > 100
if ( Trig_Air_Strike_Func020Func001C() ) then
call CreateNUnitsAtLoc( 1, 'h00X', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A031', GetLastCreatedUnit(), y )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "clusterrockets", GetUnitLoc(GetLastCreatedUnit()) )
if ( Trig_Air_Strike_Func020Func001Func002Func004C() ) then
call RemoveUnit( GetEnumUnit() )
else
endif
else
endif
set w = w + 1
endloop
endfunction
//===========================================================================
function InitTrig_Air_Strike takes nothing returns nothing
set gg_trg_Air_Strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Air_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Air_Strike, Condition( function Trig_Air_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Air_Strike, function Trig_Air_Strike_Actions )
endfunction