stealthbomber()
{
gun=self getcurrentweapon();
self beginLocationselection("map_artillery_selector",level.artilleryDangerMaxRadius * 1.2);
self.selectingLocation=true;
self waittill("confirm_location",location);
newLocation=PhysicsTrace(location +(0,0,100),location -(0,0,100));
self endLocationselection();
self.selectingLocation=undefined;
wait 0.5;
self switchtoweapon(gun);
Location=newLocation;
wait 1;
iprintlnbold("Stealth Bomber Inbound");
wait 1.5;
locationYaw = maps\mp\gametypes\_hardpoints::getBestPlaneDirection( location );
flightPath = getFlightPath( location, locationYaw, 0 );
level thread Move( self, flightPath,location );
}
Move( owner, flightPath, location )
{
level endon( "game_ended" );
if ( !isDefined( owner ) ) return;
start = flightpath["start"];
end=flightpath["end"];
middle=location+(0,0,1500);
spinTostart= Vectortoangles(flightPath["start"] - flightPath["end"]);
spinToEnd= Vectortoangles(flightPath["end"] - flightPath["start"]);
lb = SpawnPlane( owner, "script_model", start );
lb setModel("defaultvehicle");
lb.angles=spinToend;
lb playLoopSound("veh_mig29_dist_loop");
lb endon( "death" );
wait 3;
time = calc(1500, lb.origin, middle);
lb moveto(middle, time);
lb thread planebomb(owner,location);
wait 4;
lb moveto(end, time);
wait time;
lb notify("planedone");
lb notify("endbomb");
lb delete();
}
getFlightPath(location, locationYaw, rightOffset)
{
location = location * (1, 1, 0);
initialDirection = (0, locationYaw, 0);
planeHalfDistance = 12000;
flightPath = [];
if (isDefined(rightOffset) && rightOffset != 0) location = location + (AnglesToRight(initialDirection) * rightOffset) + (0, 0, RandomInt(300));
startPoint = (location + (AnglesToForward(initialDirection) * (-1 * planeHalfDistance)));
endPoint = (location + (AnglesToForward(initialDirection) * planeHalfDistance));
flyheight = 1500;
if (isdefined(level.airstrikeHeightScale))
{
flyheight *= level.airstrikeHeightScale;
}
flightPath["start"] = startPoint + (0, 0, flyHeight);
flightPath["end"] = endPoint + (0, 0, flyHeight);
return flightPath;
}
calc(speed, origin, moveTo)
{
return (distance(origin, moveTo) / speed);
}
GetGround(bomb)
{
return bullettrace(bomb.origin, bomb.origin - (0, 0, 1490), false, self)["position"];
}
planebomb(owner)
{
self endon("death");
self endon("disconnect");
self endon("endbomb");
wait 0.05;
for(;
{
bomb = spawn("script_model", self.origin - (0, 0, 80));
bomb setModel("aircraft_bomb");
bomb.angles = self.angles;
bomb.KillCamEnt = bomb;
thread del(bomb);
tt = GetGround(bomb);
wait 0.01;
bomb moveto(tt, 1);
bomb playsound("artillery_impact");
playRumbleOnPosition("artillery_rumble", self.origin);
earthquake(2, 2, self.origin, 2500);
thread bombact(bomb,owner);
wait .2;
}
}
del(p)
{
wait 9;
p delete();
}
bombact(bomb,owner)
{
wait 1;
Playfx(level.defboom, bomb.origin);
Playfx(level.expbullt, bomb.origin);
Playfx(level.bfx, bomb.origin);
wait 0.5;
RadiusDamage(bomb.origin, 200, 200, 200, owner, "MOD_PROJECTILE_SPLASH", "artillery_mp");
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.