Spell Name
CAS (Close Air Support)
Spell Description
This spell is from Notd aftermath. When used the item it marks the area with a green trueshot aura and after 4-5sec 3 planes are flying to the marked area as the jets are near the area they shoot missiles to the marked area and as they are flying away... as the missles hit the floor they causes explosions in a medium sized radius
Extra Notes
I would open a notd map and copy the code but i feel its protected for a reason and its not fair to the maker
This past week I have tried to make my own but It does not work how i want it so i gave up and resorting to you fine people to assist me
This is the last thing i need for my map
THIS BELOW is an example of how notd did their spell but i tryed to use this but it don't work
I will greatly appreciate this help and include rep and Credit!
CAS (Close Air Support)
Spell Description
This spell is from Notd aftermath. When used the item it marks the area with a green trueshot aura and after 4-5sec 3 planes are flying to the marked area as the jets are near the area they shoot missiles to the marked area and as they are flying away... as the missles hit the floor they causes explosions in a medium sized radius
Extra Notes
I would open a notd map and copy the code but i feel its protected for a reason and its not fair to the maker
This past week I have tried to make my own but It does not work how i want it so i gave up and resorting to you fine people to assist me
This is the last thing i need for my map
THIS BELOW is an example of how notd did their spell but i tryed to use this but it don't work
I will greatly appreciate this help and include rep and Credit!
JASS:
function AirstrikeInbound takes nothing returns nothing
local unit u
local integer i = 1
local trigger t = GetTriggeringTrigger()
local unit u1 = GetHandleUnit(t,"u1")
local unit u2 = GetHandleUnit(t,"u2")
local unit u3 = GetHandleUnit(t,"u3")
local location exitloc = GetHandleLocation(t,"exitloc")
local location target = GetHandleLocation(t,"target")
local real flighttime = GetHandleReal(t,"flighttime")
local real xt = GetLocationX(target)
local real yt = GetLocationY(target)
local real dx = GetUnitX(u1) - xt
local real dy = GetUnitY(u1) - yt
local real dx2 = GetUnitX(u2) - xt
local real dy2 = GetUnitY(u2) - yt
local group missiles = CreateGroup()
local boolean docleanup = false
call PingMinimapEx(xt,yt,2.5,255,0,0,false)
call IssuePointOrderLoc(u1, "move", exitloc)
call IssuePointOrder(u2, "move", GetLocationX(exitloc)+150.0, GetLocationY(exitloc)-150.0)
call IssuePointOrder(u3, "move", GetLocationX(exitloc)-150.0, GetLocationY(exitloc)-150.0)
if (dx*dx+dy*dy<=3240000.0 or dx2*dx2+dy2*dy2<=3240000.0) then //1800 radius
call DisableTrigger(t)
call SetForceAllianceStateBJ( bj_FORCE_PLAYER[9], udg_UnknownEntities, bj_ALLIANCE_ALLIED )
call GeneralText(5.0, "|cfff3ad00F-22 Pilot|r : Missiles fired." )
set i = 1
loop
exitwhen i > 3
set u = CreateUnit( Player(9), 039;h00C039;, GetUnitX(GetHandleUnit(t,"u"+I2S(i)))+8.0, GetUnitY(GetHandleUnit(t,"u"+I2S(i)))+8.0 ,0 )
call IssuePointOrder(u,"attackground",xt,yt)
call GroupAddUnit(missiles,u)
set u = CreateUnit( Player(9), 039;h00C039;, GetUnitX(GetHandleUnit(t,"u"+I2S(i)))-8.0, GetUnitY(GetHandleUnit(t,"u"+I2S(i)))-8.0 ,0 )
call IssuePointOrder(u,"attackground",xt,yt)
call GroupAddUnit(missiles,u)
set i = i + 1
endloop
call StartSound(gg_snd_RPGMissile)
call PolledWait(0.25)
call StartSound(gg_snd_RPGMissile2)
call DestroyEffect(AddSpecialEffect( "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", xt, yt ))
call ArtHandler(u1,target,35,1.0,625.0,3.5,1)
call SetUnitFlyHeight(u1, 1200.00, 200.00)
call SetUnitFlyHeight(u2, 1200.00, 200.00)
call SetUnitFlyHeight(u3, 1200.00, 200.00)
call PolledWait(0.1)
call EarShockArea(xt,yt,500)
call ForGroup(missiles,function RemoveUnitAll)
call PolledWait(0.1)
set udg_myinteger = 5
call EnumDestructablesInCircleBJ(500,target,function killtree)
call SetForceAllianceStateBJ( bj_FORCE_PLAYER[9], udg_UnknownEntities, bj_ALLIANCE_UNALLIED )
call DestroyGroup(missiles)
call SetSoundPosition(gg_snd_F22Flight, xt, yt, 0)
call SetSoundVolume(gg_snd_F22Flight, 127)
call StartSound(gg_snd_F22Flight)
call PolledWait(2.5)
set docleanup = true
else
set flighttime = flighttime + 0.5
call SetHandleReal(t,"flighttime",flighttime)
endif
if (flighttime>30.0 or docleanup==true) then
call RemoveUnit(u1)
call RemoveUnit(u2)
call RemoveUnit(u3)
call RemoveLocation(target)
call RemoveLocation(exitloc)
call RemoveUnit( GetHandleUnit(t,"beacon") )
call DisableTrigger(t)
call TriggerRemoveAction(t,GetHandleTriggerAction(t,"trigac"))
call FlushHandleLocals(t)
call DestroyTrigger(t)
endif
set missiles = null
set t = null
set u1 = null
set u2 = null
set u3 = null
set exitloc = null
set target = null
endfunction
function F22RaptorEntry takes real x, real y, integer i, real r1, real r2 returns nothing
local real r = GetRandomReal(r1,r2)
local real theta = GetRandomReal(0,6.28)
local real ux = Clamp(x+r*Cos(theta),GetRectMinX(bj_mapInitialPlayableArea),GetRectMaxX(bj_mapInitialPlayableArea))
local real uy = Clamp(y+r*Sin(theta),GetRectMinY(bj_mapInitialPlayableArea),GetRectMaxY(bj_mapInitialPlayableArea))
set udg_F22Raptor[1] = CreateUnit(Player(11),i,ux,uy,theta+3.14)
set udg_F22Raptor[2] = CreateUnit(Player(11),i,ux,uy,theta+3.14)
set udg_F22Raptor[3] = CreateUnit(Player(11),i,ux,uy,theta+3.14)
endfunction
function AirstrikeConditions takes nothing returns boolean
return (GetSpellAbilityId()==039;A04J039; or GetSpellAbilityId()==039;A05H039;)
endfunction
function Airstrike takes nothing returns nothing
local integer i = 1
local location l = GetSpellTargetLoc()
local real x1 = GetLocationX(l)
local real y1 = GetLocationY(l)
local real dx
local real dy
local real len
local trigger t
local player p = GetOwningPlayer(GetTriggerUnit())
local unit u
local real r = GetRandomReal(2800.0,5000.0)
local real theta = GetRandomReal(0.0,6.28)
local real ux = Clamp(x1+r*Cos(theta),GetRectMinX(bj_mapInitialPlayableArea),GetRectMaxX(bj_mapInitialPlayableArea))
local real uy = Clamp(y1+r*Sin(theta),GetRectMinY(bj_mapInitialPlayableArea),GetRectMaxY(bj_mapInitialPlayableArea))
local unit raptor1 = CreateUnit(Player(11),039;h00B039;,ux,uy,theta+3.14)
local unit raptor2 = CreateUnit(Player(11),039;h00B039;,ux,uy,theta+3.14)
local unit raptor3 = CreateUnit(Player(11),039;h00B039;,ux,uy,theta+3.14)
local real x2 = GetUnitX(raptor1)
local real y2 = GetUnitY(raptor1)
call SetCameraQuickPosition(x1,y1)
call PingMinimapEx(x1, y1, 15.0, 204, 196, 115, false)
set u = CreateUnit(Player(8),039;n00P039;,x1,y1,0.0) //DangerZone Dummy
call UnitApplyTimedLife(u,039;Bhwd039;,15.00)
call StartSound(gg_snd_ALICEBeep)
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 10.00, "Airstrike inbound at coordinates ( " + I2S(R2I(x1)) + ", " + I2S(R2I(y1)) + " )." )
loop
exitwhen i > udg_Players
call UnitShareVision(raptor1,ConvertedPlayer(udg_Sorted<i>),true)
call UnitShareVision(raptor2,ConvertedPlayer(udg_Sorted<i>),true)
call UnitShareVision(raptor3,ConvertedPlayer(udg_Sorted<i>),true)
set i = i + 1
endloop
call StartSound(gg_snd_F22Pilot)
set dx = x1-x2
set dy = y1-y2
set len = SquareRoot(dx*dx+dy*dy+1)
set t = CreateTrigger()
call DisableTrigger(t)
call SetHandleHandle(t,"u1",raptor1)
call SetHandleHandle(t,"u2",raptor2)
call SetHandleHandle(t,"u3",raptor3)
call SetHandleHandle(t,"exitloc",Location(x1+1200*dx/len,y1+1200*dy/len))
call SetHandleHandle(t,"target",l)
call SetHandleReal(t,"flighttime", 0.0)
call SetHandleHandle(t,"beacon",CreateUnit(p,039;e00D039;,x1,y1,0.0))
call SetHandleHandle(t,"trigac", TriggerAddAction( t, function AirstrikeInbound ))
call TriggerRegisterTimerEvent(t,0.5,true)
call EnableTrigger(t)
set t = null
set u = null
set raptor1 = null
set raptor2 = null
set raptor3 = null
endfunction
//===========================================================================
function InitTrig_Airstrike takes nothing returns nothing
set gg_trg_Airstrike = CreateTrigger()
call TriggerAddCondition( gg_trg_Airstrike, Condition( function AirstrikeConditions ) )
call TriggerAddAction( gg_trg_Airstrike, function Airstrike )
endfunction</i></i></i>