Advertisement
Tonblader

Left 4 Dead 2 c7m2_barge by Tonblader V1

Jun 7th, 2023 (edited)
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.67 KB | Gaming | 0 0
  1. //Squirrel
  2.  
  3. Convars.SetValue("mp_gamemode", "coop");
  4. Convars.SetValue("z_difficulty", "Easy");
  5. Convars.SetValue("director_no_bosses", 0);
  6. Convars.SetValue("director_no_mobs", 0);
  7. Convars.SetValue("director_no_specials", 0);
  8. Convars.SetValue("z_common_limit", 5);
  9. Convars.SetValue("sb_stop", 0);
  10.  
  11. Convars.SetValue("nb_blind", 0);        // set 1 if you gonna save and script SI via triggers
  12. SendToServerConsole("nb_delete_all survivor");
  13. // DirectorStop();
  14. // EntFire("info_changelevel", "Disable");
  15.  
  16. // Total time: 42.367 seconds
  17.  
  18. function Inventory2()
  19. {
  20.     Convars.SetValue("host_timescale", 0.5);
  21.    
  22.     local hPlayer = Ent(1);
  23.     hPlayer.GiveItem("hunting_rifle");
  24.     hPlayer.GiveItem("vomitjar");
  25.     hPlayer.GiveItem("pistol_magnum");
  26.     hPlayer.GiveUpgrade(UPGRADE_INCENDIARY_AMMO);
  27.     SetAmmo(hPlayer, 0, 10, 165, 10);
  28.     SetAmmo(hPlayer, 1, 4);
  29.     hPlayer.SetHealth(85);
  30.     TeleportEntity(hPlayer, Vector(10717.046, 2431.286, 220.231), Vector(0, -140.465698, 0));
  31.     // ST_MR(hPlayer, 0, "c7m2_replay");
  32.    
  33.     //
  34.     // Custom script
  35.     //
  36.    
  37.     Convars.SetValue("st_mr_force_file", "c7m2_zoey");
  38.     Convars.SetValue("st_mr_play", Ent("!zoey").GetEntityIndex());
  39. }
  40.  
  41. ::OnEntityOutput <- function()
  42. {
  43.     if (g_ST.restart || activator == null || !activator.IsSurvivor()) return;
  44.     local client = activator.GetEntityIndex();
  45.     if (caller.GetName() == "trigger_area1")
  46.     {
  47.        
  48.     }
  49.     else if (caller.GetName() == "trigger_area2")
  50.     {
  51.  
  52.     }
  53. }
  54.  
  55. //
  56. // Custom script
  57. //
  58.  
  59. OnGameEvent_player_first_spawn <- function(params)
  60. {
  61.     local hPlayer = GetPlayerFromUserID(params.userid);
  62.    
  63.     // https://developer.valvesoftware.com/wiki/Left_4_Dead_2/Script_Functions
  64.     if (hPlayer.GetZombieType() == 3) //Hunter
  65.     {
  66.         ST_MR(hPlayer, 1, "c7m2_hunter");
  67.     }
  68.     else if (hPlayer.GetZombieType() ==  8) //Tank
  69.     {
  70.         ST_MR(hPlayer, 1, "c7m2_tank");
  71.     }
  72. }
  73. __CollectEventCallbacks(this, "OnGameEvent_", "GameEventCallbacks", RegisterScriptGameEventListener);
  74.  
  75. //
  76. // Custom script
  77. //
  78.  
  79. ::OnPlayLine <- function(hPlayer, sFileName, tick, buttons)
  80. {
  81.     if (sFileName == "c7m2_zoey" || sFileName == "default")
  82.     {
  83.         if (tick == 4)
  84.         {
  85.             Convars.SetValue("host_timescale", 1.0);
  86.             SendToServerConsole("impulse 100"); // Turn off flashlight
  87.             SendToServerConsole("nb_delete_all");
  88.             // EntFire("worldspawn", "RunScriptCode", format("ClientCommand(Ent(\"!zoey\"), \"st_mr_goto 1200\")"), 0.0);
  89.         }
  90.         if (tick == 20) SendToServerConsole("nb_delete_all");
  91.         if (tick == 50)
  92.         {
  93.             //Zombies :D
  94.             SpawnZombieEx("infected", Vector(10031.709, 1824.562, 176.031), Vector(0.000, 13.261, 0.000));
  95.             SpawnZombieEx("infected", Vector(10470.717, 2022.176, 176.031), Vector(0.000, 69.566, 0.000));
  96.             SpawnZombieEx("infected", Vector(10340.195, 2001.499, 176.031), Vector(0.000, 140.410, 0.000));
  97.             SpawnZombieEx("infected", Vector(10183.955, 1915.068, 176.031), Vector(0.000, 329.962, 0.000));
  98.         }
  99.         if (tick == 125)
  100.         {
  101.             SpawnZombieForCB(Vector(10091.949219 1417.829224 128.031250), Vector(0.126890 92.824638 0.000000));
  102.         }
  103.         if (tick == 260)
  104.         {
  105.             //Zombies :D
  106.             SpawnZombieEx("infected", Vector(7359.504, 1018.708, 51.713), Vector(0.000, 250.837, 0.000));
  107.             SpawnZombieEx("infected", Vector(7317.910, 837.570, 88.968), Vector(0.000, 239.096, 0.000));
  108.             SpawnZombieEx("infected", Vector(7639.129, 928.688, 52.257), Vector(0.000, 112.070, 0.000));
  109.             SpawnZombieEx("infected", Vector(7797.947, 499.808, 152.995), Vector(0.000, 38.836, 0.000));
  110.            
  111.         }
  112.         if (tick == 330)
  113.         {
  114.             SpawnZombieForCB(Vector(7518.713379 861.338257 69.788116), Vector(-3.133837 -16.284899 0.000000));
  115.            
  116.         }
  117.         if (tick == 700)
  118.         {
  119.             //Zombies to common jump with vomitjar
  120.             SpawnZombieEx("infected", Vector(-399.041138 869.940369 -4.760391), Vector());
  121.             SpawnZombieEx("infected", Vector(-318.061676 889.227783 4.950500), Vector());
  122.             SpawnZombieEx("infected", Vector(-423.322083 963.873901 -40.855385), Vector());
  123.             SpawnZombieEx("infected", Vector(-284.430420 986.857788 -30.631241), Vector());
  124.         }
  125.         if (tick == 844) SendToServerConsole("nb_delete_all");
  126.         if (tick == 845)
  127.         {
  128.             SpawnZombie("tank", Vector(-945.932 1273.235 161.331), true);
  129.         }
  130.         if (tick == 913)
  131.         {
  132.             SendToServerConsole("jointeam 1");
  133.         }
  134.         if (tick == 925)
  135.         {
  136.             SendToServerConsole("jointeam 2");
  137.         }
  138.         if (tick >= 940 && tick <= 950)
  139.         {
  140.             SendToServerConsole("sb_takecontrol");
  141.         }
  142.         if (tick == 951)
  143.         {
  144.             SendToServerConsole("impulse 100"); // Turn off flashlight
  145.         }
  146.         if (tick == 943)
  147.         {
  148.             SpawnZombie("hunter", Vector(-4016.928 -49.128 0.031), true);
  149.         }
  150.         if (tick == 1135)
  151.         {
  152.             SendToServerConsole("jointeam 1");
  153.         }
  154.         if (tick == 1147)
  155.         {
  156.             SendToServerConsole("jointeam 2");
  157.         }
  158.         if (tick >= 1147 && tick <= 1155)
  159.         {
  160.             SendToServerConsole("sb_takecontrol");
  161.         }
  162.         if (tick == 1156)
  163.         {
  164.             SendToServerConsole("impulse 100"); // Turn off flashlight
  165.         }
  166.         if (tick == 1215)
  167.         {
  168.             SpawnCommon("common_male_ceda",Vector(-10677.051758 2875.645264 176.031250),Vector(7.160011 -53.440674 0.000000),1);
  169.             //Zombis :D
  170.             SpawnZombieEx("infected", Vector(-10945.836, 2860.620, 176.031), Vector(0.000, 163.392, 0.000));
  171.             SpawnZombieEx("infected", Vector(-10523.620, 2991.813, 176.031), Vector(0.000, 137.626, 0.000));
  172.             SpawnZombieEx("infected", Vector(-10181.203, 2750.344, 136.031), Vector(0.000, 211.795, 0.000));
  173.             SpawnZombieEx("infected", Vector(-10272.180, 2907.811, 176.031), Vector(0.000, 104.198, 0.000));
  174.         }
  175.     }
  176. }
  177.  
  178. if (Convars.GetFloat("nb_blind"))
  179. {
  180.     function OnGameEvent_tank_spawn(event)
  181.     {
  182.         local hPlayer = Ent(event.tankid);
  183.         CPTime(g_ST.tick + " >> Tank"); ppos(hPlayer.GetOrigin()); ZDump();
  184.     }
  185.  
  186.     function OnGameEvent_witch_spawn(event)
  187.     {
  188.         local hPlayer = Ent(event.witchid);
  189.         CPTime(g_ST.tick + " >> Witch"); ppos(hPlayer.GetOrigin()); ZDump();
  190.     }
  191.  
  192.     function OnGameEvent_player_spawn(event)
  193.     {
  194.         local hPlayer = GetPlayerFromUserID(event.userid);
  195.         if (!hPlayer.IsSurvivor() && hPlayer.GetHealth() > 1)
  196.         {
  197.             CPTime(g_ST.tick + " >> SPECIALS " + hPlayer.GetHealth()); ppos(hPlayer.GetOrigin()); ZDump();
  198.         }
  199.     }
  200. }
  201.  
  202. ::OnRestart <- function()
  203. {
  204.     SendToServerConsole("stop; record demo");
  205. }
  206.  
  207. //========================================================================================================================
  208. //ScMp
  209. //========================================================================================================================
  210.  
  211. Timer();
  212.  
  213. if (Ent(1) != Ent("!zoey"))
  214. {
  215.     SendToServerConsole("sb_add; sb_add; sb_add; sb_takecontrol zoey; nb_delete_all survivor");
  216.     SpeedrunRestart();
  217. }
  218.  
  219. SpawnItem("item0", Vector(10708.531, 2336.500, 208.281), Vector(0.000, 91.494, 0.000), 1, null, 250);
  220. SpawnItem("item14", Vector(10820.438, 2341.656, 208.719), Vector(0.000, 30.498, 90.000), 5);
  221. SpawnItem("item4", Vector(10807.156, 2349.000, 208.938), Vector(0.000, 18.018, 90.000), 5);
  222. SpawnItem("item17", Vector(10794.063, 2348.875, 209.031), Vector(0.000, 215.991, 270.000), 5);
  223. SpawnItem("item12", Vector(10759.125, 2349.531, 210.469), Vector(87.627, 202.148, 272.988), 1);
  224. SpawnItem("item12", Vector(10753.063, 2335.781, 208.094), Vector(0.000, 251.543, 0.396), 1);
  225. SpawnItem("item12", Vector(10737.625, 2339.438, 210.563), Vector(87.012, 19.512, 0.000), 1);
  226. SpawnItem("item12", Vector(10726.938, 2347.688, 210.563), Vector(87.012, 326.997, 0.000), 1);
  227. SpawnItem("item35", Vector(10671.000, 2517.000, 209.000), Vector(0.000, 300.015, 270.000), 1);
  228.  
  229. //
  230. // Custom script
  231. //
  232.  
  233. // SpawnTrigger("trigger_area1", Vector(10316.313, 1864.025, 230.637));
  234.  
  235. RemoveItem("item25");
  236. SpawnItem("item25", Vector(5588.000, 769.875, 256.094), Vector(0.000, 58.491, 270.000), 1);
  237. RemoveItemEx(Vector(3056.000, 1237.000, 137.178),3);
  238. SpawnItem("item6", Vector(3056.000, 1237.000, 137.178), Vector(0.000, 181.494, 0.000), 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement