Advertisement
Tonblader

Left 4 Dead 2 c7m2_barge by Tonblader V2

Jun 9th, 2023 (edited)
846
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.69 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 1150\")"), 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.         if (tick == 330)
  112.         {
  113.             SpawnZombieForCB(Vector(7518.713379 861.338257 69.788116), Vector(-3.133837 -16.284899 0.000000));
  114.         }
  115.         if (tick == 700)
  116.         {
  117.             //Zombies to common jump with vomitjar
  118.             SpawnZombieEx("infected", Vector(-399.041138 869.940369 -4.760391), Vector());
  119.             SpawnZombieEx("infected", Vector(-318.061676 889.227783 4.950500), Vector());
  120.             SpawnZombieEx("infected", Vector(-423.322083 963.873901 -40.855385), Vector());
  121.             SpawnZombieEx("infected", Vector(-284.430420 986.857788 -30.631241), Vector());
  122.         }
  123.         if (tick == 844) SendToServerConsole("nb_delete_all");
  124.         if (tick == 845)
  125.         {
  126.             SpawnZombie("tank", Vector(-945.932 1273.235 161.331), true);
  127.         }
  128.         if (tick == 913)
  129.         {
  130.             SendToServerConsole("jointeam 1");
  131.         }
  132.         if (tick == 925)
  133.         {
  134.             SendToServerConsole("jointeam 2");
  135.         }
  136.         if (tick >= 940 && tick <= 950)
  137.         {
  138.             SendToServerConsole("sb_takecontrol");
  139.         }
  140.         if (tick == 951)
  141.         {
  142.             SendToServerConsole("impulse 100"); // Turn off flashlight
  143.         }
  144.         if (tick == 943)
  145.         {
  146.             SpawnZombie("hunter", Vector(-4016.928 -49.128 0.031), true);
  147.         }
  148.         if (tick == 1130)
  149.         {
  150.             SendToServerConsole("jointeam 1");
  151.         }
  152.         if (tick == 1142)
  153.         {
  154.             SendToServerConsole("jointeam 2");
  155.         }
  156.         if (tick >= 1142 && tick <= 1150)
  157.         {
  158.             SendToServerConsole("sb_takecontrol");
  159.         }
  160.         if (tick == 1151)
  161.         {
  162.             SendToServerConsole("impulse 100"); // Turn off flashlight
  163.         }
  164.         if (tick == 1150)
  165.         {
  166.             SpawnCommon("common_male_ceda",Vector(-10702.054688 2886.989014 276.031250),Vector(5.400003 -52.465332 0.000000),1);
  167.             //Zombies :D
  168.             SpawnZombieEx("infected", Vector(-10858.789, 2889.603, 176.031), Vector(0.000, 293.453, 0.000));
  169.             SpawnZombieEx("infected", Vector(-10553.982, 2902.190, 176.031), Vector(0.000, 1.890, 0.000));
  170.             SpawnZombieEx("infected", Vector(-10375.167, 2623.118, 155.007), Vector(0.000, 280.703, 0.000));
  171.             SpawnZombieEx("infected", Vector(-10402.726, 2799.669, 191.776), Vector(0.000, 308.912, 0.000));
  172.         }
  173.     }
  174. }
  175.  
  176. if (Convars.GetFloat("nb_blind"))
  177. {
  178.     function OnGameEvent_tank_spawn(event)
  179.     {
  180.         local hPlayer = Ent(event.tankid);
  181.         CPTime(g_ST.tick + " >> Tank"); ppos(hPlayer.GetOrigin()); ZDump();
  182.     }
  183.  
  184.     function OnGameEvent_witch_spawn(event)
  185.     {
  186.         local hPlayer = Ent(event.witchid);
  187.         CPTime(g_ST.tick + " >> Witch"); ppos(hPlayer.GetOrigin()); ZDump();
  188.     }
  189.  
  190.     function OnGameEvent_player_spawn(event)
  191.     {
  192.         local hPlayer = GetPlayerFromUserID(event.userid);
  193.         if (!hPlayer.IsSurvivor() && hPlayer.GetHealth() > 1)
  194.         {
  195.             CPTime(g_ST.tick + " >> SPECIALS " + hPlayer.GetHealth()); ppos(hPlayer.GetOrigin()); ZDump();
  196.         }
  197.     }
  198. }
  199.  
  200. ::OnRestart <- function()
  201. {
  202.     SendToServerConsole("stop; record demo");
  203. }
  204.  
  205. //========================================================================================================================
  206. //ScMp
  207. //========================================================================================================================
  208.  
  209. Timer();
  210.  
  211. if (Ent(1) != Ent("!zoey"))
  212. {
  213.     SendToServerConsole("sb_add; sb_add; sb_add; sb_takecontrol zoey; nb_delete_all survivor");
  214.     SpeedrunRestart();
  215. }
  216.  
  217. SpawnItem("item0", Vector(10708.531, 2336.500, 208.281), Vector(0.000, 91.494, 0.000), 1, null, 250);
  218. SpawnItem("item14", Vector(10820.438, 2341.656, 208.719), Vector(0.000, 30.498, 90.000), 5);
  219. SpawnItem("item4", Vector(10807.156, 2349.000, 208.938), Vector(0.000, 18.018, 90.000), 5);
  220. SpawnItem("item17", Vector(10794.063, 2348.875, 209.031), Vector(0.000, 215.991, 270.000), 5);
  221. SpawnItem("item12", Vector(10759.125, 2349.531, 210.469), Vector(87.627, 202.148, 272.988), 1);
  222. SpawnItem("item12", Vector(10753.063, 2335.781, 208.094), Vector(0.000, 251.543, 0.396), 1);
  223. SpawnItem("item12", Vector(10737.625, 2339.438, 210.563), Vector(87.012, 19.512, 0.000), 1);
  224. SpawnItem("item12", Vector(10726.938, 2347.688, 210.563), Vector(87.012, 326.997, 0.000), 1);
  225. SpawnItem("item35", Vector(10671.000, 2517.000, 209.000), Vector(0.000, 300.015, 270.000), 1);
  226.  
  227. //
  228. // Custom script
  229. //
  230.  
  231. // SpawnTrigger("trigger_area1", Vector(10316.313, 1864.025, 230.637));
  232.  
  233.  
  234. RemoveItem("item24");
  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