// Many thanks to Spikenaylor for the scripting of these planes main() { level._effect["bombexplosion"] = loadfx ("fx/explosions/spitfire_bomb_dirt.efx"); precachemodel ("xmodel/vehicle_stuka_flying"); precachemodel ("xmodel/prop_stuka_bomb"); thread wolfstuka1(); thread wolfstuka2(); thread wolfstuka3(); } // ***************************************************************************** // ***************************************************************************** wolfstuka1() { while (1) { //wait before it spawns you can change these values// wait 240 + randomint(20); //call the waypoints// stuka1start = getent ("stuka1","targetname"); stuka1end = getent ("stuka1_finish","targetname"); //spawn the stuka and set the model and add sound here// stuka1 = spawn ("script_model",(stuka1start.origin)); stuka1 setmodel("xmodel/vehicle_stuka_flying"); stuka1 playsound ("wolfsschanze2stuka"); //get the speed and heading sorted// speed = (1800 + randomint(400));//increase the first number for higher speed// dist = distance(stuka1start.origin,stuka1end.origin); time = (dist / speed); angles =vectortoangles(stuka1end.origin - stuka1start.origin);//this is no mistake it has to be in this order or the stuka will reverse// //make the stuka rotate to the right heading and get it moving// stuka1 rotateto((angles),0.001); stuka1 moveto((stuka1end.origin),time); stuka1 thread bombdrop("stuka1"); //stuka1 thread bombdrop2("stuka1"); stuka1 waittill("movedone"); //delete it and start over again// stuka1 delete(); } } bombdrop(stuka1) { // Get The target for the bomb. stuka1bombend = getent ("stuka1_bomb","targetname"); wait 2.3; //spawn the stukabomb and set the model stuka1bomb = spawn ("script_model",(self.origin)); stuka1bomb setmodel("xmodel/prop_stuka_bomb"); // set the specifics for the bomb speed =(2000); dist = distance(stuka1bomb.origin,stuka1bombend.origin); time = (dist / speed); angles =vectortoangles(stuka1bombend.origin - stuka1bomb.origin);//this is no mistake it has to be in this order or the stuka will reverse// //make the bomb rotate to the right heading and get it moving// stuka1bomb rotateto((angles),0.001); stuka1bomb moveto((stuka1bombend.origin),time); stuka1bomb playsound("mortar_incoming5"); stuka1bomb waittill("movedone"); // Play the Explosion Effect origin = stuka1bombend getorigin(); playfx (level._effect ["bombexplosion"], origin); // Play the Explosion Sound stuka1bomb playsound("artillery_explosion"); // Do the Radius Damage radiusDamage(origin + (0,0,12), 700, 400, 100); earthquake(0.3, 3, origin, 2096); //(scale, duration, source, radius) //delete it and start over again// stuka1bomb delete(); } // ***************************************************************************** // ***************************************************************************** wolfstuka2() { while (1) { //wait before it spawns you can change these values// wait 360 + randomint(20); //call the waypoints// stuka2start = getent ("stuka2","targetname"); stuka2end = getent ("stuka2_finish","targetname"); //spawn the stuka and set the model and add sound here// stuka2 = spawn ("script_model",(stuka2start.origin)); stuka2 setmodel("xmodel/vehicle_stuka_flying"); stuka2 playsound ("wolfsschanze2stuka"); //get the speed and heading sorted// speed = (2000 + randomint(500));//increase the first number for higher speed// dist = distance(stuka2start.origin,stuka2end.origin); time = (dist / speed); angles =vectortoangles(stuka2end.origin - stuka2start.origin);//this is no mistake it has to be in this order or the stuka will reverse// //make the stuka rotate to the right heading and get it moving// stuka2 rotateto((angles),0.001); stuka2 moveto((stuka2end.origin),time); stuka2 thread bombdrop2("stuka2"); stuka2 waittill("movedone"); //delete it and start over again// stuka2 delete(); } } bombdrop2(stuka2) { // Get The target for the bomb. stuka2bombend = getent ("stuka2_bomb","targetname"); wait 1.7; //spawn the stukabomb and set the model stuka2bomb = spawn ("script_model",(self.origin)); stuka2bomb setmodel("xmodel/prop_stuka_bomb"); // set the specifics for the bomb speed =(2000); dist = distance(stuka2bomb.origin,stuka2bombend.origin); time = (dist / speed); angles =vectortoangles(stuka2bombend.origin - stuka2bomb.origin);//this is no mistake it has to be in this order or the stuka will reverse// //make the bomb rotate to the right heading and get it moving// stuka2bomb rotateto((angles),0.001); stuka2bomb moveto((stuka2bombend.origin),time); stuka2bomb playsound("incoming02"); stuka2bomb waittill("movedone"); // Play the Explosion Effect origin = stuka2bombend getorigin(); playfx (level._effect ["bombexplosion"], origin); // Play the Explosion Sound stuka2bomb playsound("artillery_explosion"); // Do the Radius Damage radiusDamage(origin + (0,0,12), 500, 400, 100); earthquake(0.3, 3, origin, 2096); //(scale, duration, source, radius) //delete it and start over again// stuka2bomb delete(); } // ***************************************************************************** // ***************************************************************************** wolfstuka3() { while (1) { //wait before it spawns you can change these values// wait 480 + randomint(25); //call the waypoints// stuka3start = getent ("stuka3","targetname"); stuka3end = getent ("stuka3_finish","targetname"); //spawn the stuka and set the model and add sound here// stuka3 = spawn ("script_model",(stuka3start.origin)); stuka3 setmodel("xmodel/vehicle_stuka_flying"); stuka3 playsound ("wolfsschanze2stuka"); //get the speed and heading sorted// speed = (2000 + randomint(500));//increase the first number for higher speed// dist = distance(stuka3start.origin,stuka3end.origin); time = (dist / speed); angles =vectortoangles(stuka3end.origin - stuka3start.origin);//this is no mistake it has to be in this order or the stuka will reverse// //make the stuka rotate to the right heading and get it moving// stuka3 rotateto((angles),0.001); stuka3 moveto((stuka3end.origin),time); stuka3 thread bombdrop3("stuka3"); stuka3 waittill("movedone"); //delete it and start over again// stuka3 delete(); } } bombdrop3(stuka3) { wait 2.8; // Get The target for the bomb. stuka3bombend = getent ("stuka3_bomb","targetname"); //spawn the stukabomb and set the model stuka3bomb = spawn ("script_model",(self.origin)); stuka3bomb setmodel("xmodel/prop_stuka_bomb"); // set the specifics for the bomb speed =(2000); dist = distance(stuka3bomb.origin,stuka3bombend.origin); time = (dist / speed); angles =vectortoangles(stuka3bombend.origin - stuka3bomb.origin);//this is no mistake it has to be in this order or the stuka will reverse// //make the bomb rotate to the right heading and get it moving// stuka3bomb rotateto((angles),0.001); stuka3bomb moveto((stuka3bombend.origin),time); stuka3bomb playsound("mortar_incoming5"); stuka3bomb waittill("movedone"); // Play the Explosion Effect origin = stuka3bombend getorigin(); playfx (level._effect ["bombexplosion"], origin); // Play the Explosion Sound stuka3bomb playsound("artillery_explosion"); // Do the Radius Damage radiusDamage(origin + (0,0,12), 600, 400, 100); earthquake(0.3, 3, origin, 2096); //(scale, duration, source, radius) //delete it and start over again// stuka3bomb delete(); }