[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
  • No one is chatting at the moment.
  • 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 The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top