[Spell Request] Notd Airstrike

R 3 T R O

New Member
Reaction score
12
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!

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), 'h00C', 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), 'h00C', 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()=='A04J' or GetSpellAbilityId()=='A05H')
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),'h00B',ux,uy,theta+3.14)
    local unit raptor2 = CreateUnit(Player(11),'h00B',ux,uy,theta+3.14)
    local unit raptor3 = CreateUnit(Player(11),'h00B',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),'n00P',x1,y1,0.0) //DangerZone Dummy
    call UnitApplyTimedLife(u,'Bhwd',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,&quot;u1&quot;,raptor1)
    call SetHandleHandle(t,&quot;u2&quot;,raptor2)
    call SetHandleHandle(t,&quot;u3&quot;,raptor3)
    call SetHandleHandle(t,&quot;exitloc&quot;,Location(x1+1200*dx/len,y1+1200*dy/len))
    call SetHandleHandle(t,&quot;target&quot;,l)
    call SetHandleReal(t,&quot;flighttime&quot;, 0.0)
    call SetHandleHandle(t,&quot;beacon&quot;,CreateUnit(p,&#039;e00D&#039;,x1,y1,0.0))
    call SetHandleHandle(t,&quot;trigac&quot;, 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>
 

R 3 T R O

New Member
Reaction score
12
Bump.

I Would really appreciate the help. I know it seems like allot but help out a fellow member :)
 

ZugZugZealot

New Member
Reaction score
33
A tip: For code blocks that long, you should stay how it doesn't work.

Anyways, one thing I can tell you that it's majorly lacking, is a trigger event.
JASS:
function InitTrig_Airstrike takes nothing returns nothing
    local integer i = 0 //Added
    set gg_trg_Airstrike = CreateTrigger()
    loop //Added
        exitwhen i &gt; 11 //Added
        call TriggerRegisterPlayerUnitEvent( gg_trg_Airstrike, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null ) //Added
        set i = i + 1 //Added
    endloop //Added
    call TriggerAddCondition( gg_trg_Airstrike, Condition( function AirstrikeConditions ) )
    call TriggerAddAction( gg_trg_Airstrike, function Airstrike )
endfunction


Also, you should avoid dynamic triggers (giving yourself the need to destroy triggers). I'm not sure why they're "bad", I just know that some of the biggies like Vexorian frown upon them. For this case, you could easily replace "[ljass]local trigger t[/ljass]" with "[ljass]local timer t[/ljass]"; replace "[ljass]set t = CreateTrigger()[/ljass]" with "[ljass]set t = CreateTimer()[/ljass]"; and replace "[ljass]call TriggerRegisterTimerEvent(t,0.5,true)[/ljass]" with "[ljass]call TimerStart( call TimerStart( t, 0.50, true, function AirstrikeInbound )[/ljass]"
 
General chit-chat
Help Users
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top