From 44a0f800f3a9e845acbaf6f06dca0d8e5d4db313 Mon Sep 17 00:00:00 2001 From: Rafael Marçalo Date: Mon, 20 Mar 2023 01:29:44 +0000 Subject: Updated BO2 mods --- Compiler.exe | Bin 0 -> 49664 bytes Irony.dll | Bin 0 -> 149504 bytes README.md | 15 +- images/disabled.png | Bin 17960 -> 0 bytes images/enabled.png | Bin 18247 -> 0 bytes images/install.gif | Bin 211324 -> 0 bytes installMods.bat | 4 + installer/Compiler.exe | Bin 49664 -> 0 bytes installer/Irony.dll | Bin 149504 -> 0 bytes installer/installMods.bat | 6 - mods/auxiliary.gsc | 213 ---------------------- mods/main.gsc | 188 -------------------- mods/mods.gsc | 300 ------------------------------- sneed.gsc | 443 ++++++++++++++++++++++++++++++++++++++++++++++ 14 files changed, 452 insertions(+), 717 deletions(-) create mode 100644 Compiler.exe create mode 100644 Irony.dll delete mode 100644 images/disabled.png delete mode 100644 images/enabled.png delete mode 100644 images/install.gif create mode 100755 installMods.bat delete mode 100644 installer/Compiler.exe delete mode 100644 installer/Irony.dll delete mode 100755 installer/installMods.bat delete mode 100644 mods/auxiliary.gsc delete mode 100644 mods/main.gsc delete mode 100644 mods/mods.gsc create mode 100755 sneed.gsc diff --git a/Compiler.exe b/Compiler.exe new file mode 100644 index 0000000..7f57215 Binary files /dev/null and b/Compiler.exe differ diff --git a/Irony.dll b/Irony.dll new file mode 100644 index 0000000..ebb1fe5 Binary files /dev/null and b/Irony.dll differ diff --git a/README.md b/README.md index 05e79db..257526d 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,15 @@ -# bo2-plutonium-gsc +# codmods A bunch of mods for black ops 2 zombies ## Install -1. Download the AIO Script from the releases. +1. Clone or download this repository; -2. Edit the script with your favorite text editor, and update the functions `onConnectMods` and `onSpawnMods` by uncommenting and changing up the parameters to your liking (*All the parameters that can be customized, will be documented in the function call*). +2. Edit the `sneed.gsc` file, by uncommenting them, between the MAIN and the DANGER zones respectively. +*Note: You may also want to edit some of the functions parameters in order to match your preferences.* -![Disabled Mod](images/disabled.png) - -![Enabled player initial points and set to 10000](images/enabled.png) - -3. Using the install script, simply drag and drop your raw GSC script on top of installMods.bast and it should automatically install the mods into the game mods folder. - -![Compilation Process](images/install.gif) +3. Using the install script, run installMods.bat and it should automatically install the mods into the game mods folder. *Note: If you get an error, make sure your script isn't already precompiled (open it, and if it looks like gibberish, it was already compiled)* diff --git a/images/disabled.png b/images/disabled.png deleted file mode 100644 index 812cce2..0000000 Binary files a/images/disabled.png and /dev/null differ diff --git a/images/enabled.png b/images/enabled.png deleted file mode 100644 index 0c31412..0000000 Binary files a/images/enabled.png and /dev/null differ diff --git a/images/install.gif b/images/install.gif deleted file mode 100644 index f8d061c..0000000 Binary files a/images/install.gif and /dev/null differ diff --git a/installMods.bat b/installMods.bat new file mode 100755 index 0000000..e4a4a33 --- /dev/null +++ b/installMods.bat @@ -0,0 +1,4 @@ +@echo off + +Compiler.exe sneed.gsc +move sneed-compiled.gsc %LOCALAPPDATA%\Plutonium\storage\t6\scripts\zm\sneed.gsc diff --git a/installer/Compiler.exe b/installer/Compiler.exe deleted file mode 100644 index 7f57215..0000000 Binary files a/installer/Compiler.exe and /dev/null differ diff --git a/installer/Irony.dll b/installer/Irony.dll deleted file mode 100644 index ebb1fe5..0000000 Binary files a/installer/Irony.dll and /dev/null differ diff --git a/installer/installMods.bat b/installer/installMods.bat deleted file mode 100755 index 61a874d..0000000 --- a/installer/installMods.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off - -copy "%~1" mods.gsc -Compiler.exe mods.gsc -del mods.gsc -move mods-compiled.gsc %LOCALAPPDATA%\Plutonium\storage\t6\scripts\zm\mods.gsc \ No newline at end of file diff --git a/mods/auxiliary.gsc b/mods/auxiliary.gsc deleted file mode 100644 index 7b9da43..0000000 --- a/mods/auxiliary.gsc +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Draws the counter in desired position - */ -drawCounter(counterVar, x, y, font, size) -{ - counterVar = createfontstring( font, size ); - counterVar setpoint( "CENTER", "CENTER", x, y); - counterVar.alpha = 1; - counterVar.hidewheninmenu = 1; - counterVar.hidewhendead = 1; - return counterVar; -} - -/* - * Checks if the player has entered afterlife - */ -checkAfterlife(p) -{ - if(isDefined(p.afterlife) && p.afterlife) - { - return 0.2; - } - return 1; -} - -/* - * Function that gives the player all the perks if they are available in the current map - */ -giveAllPerks(p, l, animation) -{ - if (isDefined(l.zombiemode_using_juggernaut_perk) && l.zombiemode_using_juggernaut_perk) - p doGivePerk("specialty_armorvest", animation); - if (isDefined(l._custom_perks) && isDefined(l._custom_perks["specialty_nomotionsensor"])) - p doGivePerk("specialty_nomotionsensor", animation); - if (isDefined(l.zombiemode_using_doubletap_perk) && l.zombiemode_using_doubletap_perk) - p doGivePerk("specialty_rof", animation); - if (isDefined(l.zombiemode_using_marathon_perk) && l.zombiemode_using_marathon_perk) - p doGivePerk("specialty_longersprint", animation); - if (isDefined(l.zombiemode_using_sleightofhand_perk) && l.zombiemode_using_sleightofhand_perk) - p doGivePerk("specialty_fastreload", animation); - if(isDefined(l.zombiemode_using_additionalprimaryweapon_perk) && l.zombiemode_using_additionalprimaryweapon_perk) - p doGivePerk("specialty_additionalprimaryweapon", animation); - if (isDefined(l.zombiemode_using_revive_perk) && l.zombiemode_using_revive_perk) - p doGivePerk("specialty_quickrevive", animation); - if (isDefined(l.zombiemode_using_chugabud_perk) && l.zombiemode_using_chugabud_perk) - p doGivePerk("specialty_finalstand", animation); - if (isDefined(l._custom_perks) && isDefined(l._custom_perks["specialty_grenadepulldeath"])) - p doGivePerk("specialty_grenadepulldeath", animation); - if (isDefined(l._custom_perks) && isDefined(l._custom_perks["specialty_flakjacket"]) && (l.script != "zm_buried")) - p doGivePerk("specialty_flakjacket", animation); - if (isDefined(l.zombiemode_using_deadshot_perk) && l.zombiemode_using_deadshot_perk) - p doGivePerk("specialty_deadshot", animation); - if (isDefined(l.zombiemode_using_tombstone_perk) && l.zombiemode_using_tombstone_perk) - p doGivePerk("specialty_scavenger", animation); -} - -/* - * Displays animation while giving perk - */ -doGivePerk(perk, animation) -{ - if ( animation ) - { - self endon("perk_abort_drinking"); - if (!(self hasperk(perk) || (self maps/mp/zombies/_zm_perks::has_perk_paused(perk)))) - { - gun = self maps/mp/zombies/_zm_perks::perk_give_bottle_begin(perk); - evt = self waittill_any_return("fake_death", "death", "player_downed", "weapon_change_complete"); - if (evt == "weapon_change_complete") - self thread maps/mp/zombies/_zm_perks::wait_give_perk(perk, 1); - self maps/mp/zombies/_zm_perks::perk_give_bottle_end(gun, perk); - if (self maps/mp/zombies/_zm_laststand::player_is_in_laststand() || isDefined(self.intermission) && self.intermission) - return; - self notify("burp"); - } - } - else - { - if (!(self hasperk(perk) || (self maps/mp/zombies/_zm_perks::has_perk_paused(perk)))) - { - self give_perk(perk); - } - } -} - -/* - * Displays crosshair for third person - */ -useCrosshairs(p) -{ - p.dot = drawCounter(p.dot, 0, 0, "default", 1.7); - p.dot.label = &"+"; -} - -/* - * Gives the player a custom weapon - */ -giveCustomWeapon(p, weapon) -{ - if ( isDefined(weapon) ) - { - p giveWeapon(weapon); - p givemaxammo(weapon); - } -} - - -/* - * Receive a pack a punched weapon - */ -givePaPWeapon(p, baseWeapon) -{ - if ( isDefined(baseWeapon) ) - { - weapon = get_upgrade_weapon(baseWeapon, 0 ); - if ( isDefined(weapon) ) - { - p giveweapon(weapon, 0, p get_pack_a_punch_weapon_options(weapon)); - p givemaxammo(weapon); - } - } -} - -/* - * Checks if its the initial round - */ -initialRound(l) -{ - return (l.round_number == l.start_round); -} - -/* - * Wait for the player to be revived in the initial round if is playing MotD - */ -waitMotd(p, l) -{ - if(isDefined(p.afterlife) && initialRound(l)) - { - p waittill("player_revived"); - } - - wait 1; -} - -/* - * Fixing some scenary lighting - */ -visualFix(l) -{ - if( l.script == "zm_buried" ) - { - while( 1 ) - { - self setclientdvar( "r_lightTweakSunLight", 1 ); - self setclientdvar( "r_sky_intensity_factor0", 0 ); - wait 0.05; - } - } - else if( l.script == "zm_prison" || l.script == "zm_tomb" ) - { - while( getDvar( "r_lightTweakSunLight" ) != 0 ) - { - for( i = getDvar( "r_lightTweakSunLight" ); i >= 0; i = ( i - 0.05 ) ) - { - self setclientdvar( "r_lightTweakSunLight", i ); - wait 0.05; - } - wait 0.05; - } - } - else return; -} - -/* - * Tweaks some lighting setting and enables nightmode - */ -enableNightMode(l) -{ - if( !isDefined( l.default_r_exposureValue ) ) - l.default_r_exposureValue = getDvar( "r_exposureValue" ); - if( !isDefined( l.default_r_lightTweakSunLight ) ) - l.default_r_lightTweakSunLight = getDvar( "r_lightTweakSunLight" ); - if( !isDefined( l.default_r_sky_intensity_factor0 ) ) - l.default_r_sky_intensity_factor0 = getDvar( "r_sky_intensity_factor0" ); - - self setclientdvar( "r_filmUseTweaks", 1 ); - self setclientdvar( "r_bloomTweaks", 1 ); - self setclientdvar( "r_exposureTweak", 1 ); - self setclientdvar( "vc_rgbh", "0.1 0 0.3 0" ); - self setclientdvar( "vc_yl", "0 0 0.25 0" ); - self setclientdvar( "vc_yh", "0.02 0 0.1 0" ); - self setclientdvar( "vc_rgbl", "0.02 0 0.1 0" ); - self setclientdvar( "r_exposureValue", 3.9 ); - self setclientdvar( "r_lightTweakSunLight", 1 ); - self setclientdvar( "r_sky_intensity_factor0", 0 ); - - if( l.script == "zm_buried" ) - { - self setclientdvar( "r_exposureValue", 3.5 ); - } - else if( l.script == "zm_tomb" ) - { - self setclientdvar( "r_exposureValue", 4 ); - } - else if( l.script == "zm_nuked" ) - { - self setclientdvar( "r_exposureValue", 5.6 ); - } - else if( l.script == "zm_highrise" ) - { - self setclientdvar( "r_exposureValue", 3.9 ); - } -} diff --git a/mods/main.gsc b/mods/main.gsc deleted file mode 100644 index 1d4f300..0000000 --- a/mods/main.gsc +++ /dev/null @@ -1,188 +0,0 @@ -#include common_scripts/utility; -#include maps/mp/gametypes_zm/_hud_util; -#include maps/mp/zombies/_zm; -#include maps/mp/zombies/_zm_utility; -#include maps/mp/zombies/_zm_perks; -#include maps/mp/zombies/_zm_afterlife; -#include maps/mp/zombies/_zm_weapons; - -// Loads the mods once the player connects to the server -onConnectMods(p, l) -{ - /* - * General Mods - */ - - /* - * Player is invincible - */ - // godMode(p); - - /* - * Infinte ammo - */ - // thread unlimitedAmmo(p); - - /* - * Player initial points - * - * Customizable parameters: - * points - Number of points the player will start the game (ex: 500) - */ - // setPlayerPoints(p, 500); - - /* - * Custom Mystery Box price - * - * Customizable parameters: - * price - Ammount of points required to hit the box (ex: 950) - */ - // setBoxPrice(l, 950); - - /* - * Custom alive zombies limit - * - * Customizable parameters: - * limit - Ammount of zombies alive at the same time (ex: 24) - */ - // setZombieLimit(l, 24) - - /* - * Custom buyable perk limit - * - * Customizable parameters: - * numberOfPerks - Ammount of perks the player is allowed to purchase (ex: 9) - */ - // setPerkLimit(l, 9); - - /* - * Gives all the map available perks to the player - */ - // thread perkaholic(p, l); - - /* - * Enables night mode in all maps - * - * Visual Bug: - * In MotD, while in afterlife, sparks are invisible when shot - */ - // thread nightmode(p, l); - - /* - * MotD Mods - */ - - /* - * Custom number of afterlifes - * - * Customizable parameters: - * lifes - Ammount of lifes available in afterlife (ex: 9) - * - * Visual Bug: - * If lifes parameter above 3, the in-game after-life counter wont't show the number. - */ - // catHas9Lifes(p, 9); - - /* - * Allows infinte afterlife timer - */ - // infinteAfterlifeTimer(p); - -} - -// Loads the mods once the player spawns inside the game -onSpawnMods(p, l) -{ - //////////////////////////////////////////////////////////////////////// - // Waits for the black preload screen to pass so it can load the mods // - // DO NOT TOUCH THIS LINE BELOW!! // - flag_wait( "initial_blackscreen_passed" ); // - //////////////////////////////////////////////////////////////////////// - - /* - * Gives the player a custom primary weapon - * - * Customizable parameters: - * weapon - Weapon name string available in the README.md file (ex: galil_zm (Galil)) - * upgraded - Toggle for pack-a-punched given weapon (ex: true) - */ - // thread setPrimaryWeapon(p, l, "galil_zm", true); - - /* - * Gives the player a custom secondary weapon - * - * Customizable parameters: - * weapon - Weapon name string available in the README.md file (ex: ray_gun_zm (Ray Gun)) - * upgraded - Toggle for pack-a-punched given weapon (ex: false) - */ - // thread setSecondaryWeapon(p, l, "ray_gun_zm", false); - - /* - * Gives joining players a secondary submachine gun, a couple of points and some perks - */ - // thread joinedBonus(p, l); - - /* - * Sets the player camera to the third person - * - * Customizable parameters: - * crosshair - Toggle crosshair for third person camera (ex: true) - */ - // playThirdPerson(p, true); - - /* - * Adds a zombie counter to the bottom of the screen - * - * Customizable parameters: - * x - X coordinates distance (ex: 0) - * y - Y coordinates distance (ex: 190) - */ - // thread zombieCounter(p, l, 0, 190); - - /* - * Adds a health counter to the bottom of the screen - * - * Customizable parameters: - * x - X coordinates distance (ex: 0) - * y - Y coordinates distance (ex: 190) - */ - // thread healthCounter(p, 0, 190); - - /* - * Adds a zombie and a health counter to the bottom of the screen - * - * Customizable parameters: - * x - X coordinates distance (ex: 100 & -100) - * y - Y coordinates distance (ex: 190) - */ - // thread healthCounter(p, -100, 190); - // thread zombieCounter(p, l, 100, 190); -} - -init() -{ - level thread onPlayerConnect(); -} - -onPlayerConnect() -{ - while(1) - { - level waittill("connected", player); - thread onConnectMods(player, level); - player thread onPlayerSpawned(); - } -} - -onPlayerSpawned() -{ - self endon("disconnect"); - while(1) - { - self waittill("spawned_player"); - onSpawnMods(self, level); - } -} - - - diff --git a/mods/mods.gsc b/mods/mods.gsc deleted file mode 100644 index 300b3b2..0000000 --- a/mods/mods.gsc +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Sets the new buyable perks limit - */ -setPerkLimit(l, numberOfPerks) -{ - l.perk_purchase_limit = numberOfPerks; -} - -/* - * Displays a zombie counter - */ -zombieCounter(p, l, x, y) -{ - p.zombiecounter = drawCounter(p.zombiecounter, x, y, "Objective", 1.7); - - while(1) - { - p.zombiecounter.alpha = checkAfterlife(p); - - zombies = l.zombie_total + get_current_zombie_count(); - if ( zombies > 0 ) - { - p.zombiecounter.label = &"Zombies: ^1"; - } - else - { - p.zombiecounter.label = &"Zombies: ^6"; - } - - p.zombiecounter setvalue(zombies); - wait 0.05; - } -} - -/* - * Displays a health counter - */ -healthCounter(p, x, y) -{ - p.healthcounter = drawCounter(p.healthcounter, x, y, "Objective", 1.7); - - while(1) - { - p.healthcounter.alpha = checkAfterlife(p); - - health = p.health; - if( health <= 15 ) - { - p.healthcounter.label = &"Health: ^1"; - } - else if ( health <= 50 ) - { - p.healthcounter.label = &"Health: ^3"; - } - else - { - p.healthcounter.label = &"Health: ^2"; - } - - p.healthcounter setValue(health); - wait 0.05; - } -} - -/* - * Gives all the perks available to the player - */ -perkaholic(p, l) -{ - flag_wait( "initial_blackscreen_passed" ); - waitMotd(p, l); - - if (l.round_number == 1) - { - if (isDefined(p.customPrimary) && p.customPrimary) - { - p waittill("customPrimary"); - } - - giveAllPerks(p, l, true); - } - else - { - giveAllPerks(p, l, false); - } -} - -/* - * Sets a custom box price - */ -setBoxPrice(l, price) -{ - for (i = 0; i < l.chests.size; i++) - { - level.chests[ i ].zombie_cost = price; - level.chests[ i ].old_cost = price; - } -} - -/* - * Sets the player initial points - */ -setPlayerPoints(p, points) -{ - p.score = points; -} - -/* - * Sets the afterlife counter - */ -catHas9Lifes(p, lifes) -{ - if(isDefined(p.afterlife)) - { - p.lives = lifes; - } -} - -/* - * Play in third person - */ -playThirdPerson(p, crosshair) -{ - p setClientThirdPerson(1); - - if (crosshair) - { - thread useCrosshairs(p); - } -} - -/* - * Toggle god mode on - */ -godMode(p) -{ - p enableInvulnerability(); -} - -/* - * Toggle unlimited ammo on - */ -unlimitedAmmo(p) -{ - for(;;) - { - wait 0.05; - - currentWeapon = p getcurrentweapon(); - if ( currentWeapon != "none" ) - { - p setweaponammoclip( currentWeapon, weaponclipsize(currentWeapon) ); - p givemaxammo( currentWeapon ); - } - - currentoffhand = p getcurrentoffhand(); - if ( currentoffhand != "none" ) - p givemaxammo( currentoffhand ); - } -} - -/* - * Gives later joined players, some bonuses - */ -joinedBonus(p, l) -{ - if ((l.round_number - l.start_round) >= 5 && (l.round_number - l.start_round) < 15) - { - if (isDefined(l.zombiemode_using_juggernaut_perk) && l.zombiemode_using_juggernaut_perk) - { - p doGivePerk("specialty_armorvest", false); - } - - p.score += 2500; - if (!isDefined(p.customSecondary)) - { - if (l.script == "zm_tomb") - { - setSecondaryWeapon(p, l, "mp40_zm", false); - } - else - { - setSecondaryWeapon(p, l, "mp5k_zm", false); - } - } - - } - else if ((l.round_number - l.start_round) >= 15) - { - if (isDefined(l.zombiemode_using_juggernaut_perk) && l.zombiemode_using_juggernaut_perk) - { - p doGivePerk("specialty_armorvest", false); - } - - - if (isDefined(l.zombiemode_using_doubletap_perk) && l.zombiemode_using_doubletap_perk) - { - p doGivePerk("specialty_rof", false); - } - - p.score += 7500; - if (!isDefined(p.customSecondary)) - { - if (l.script == "zm_tomb") - { - setSecondaryWeapon(p, l, "mp40_zm", true); - } - else - { - setSecondaryWeapon(p, l, "mp5k_zm", true); - } - } - } -} - -/* - * Allows Infinite Afterlife Timer - */ -infinteAfterlifeTimer(p) -{ - p.infinite_mana = 1; -} - -/* - * Sets player primary weapon - */ -setPrimaryWeapon(p, l, weapon, upgraded) -{ - p.customPrimary = true; - - waitMotd(p, l); - currentWeapon = p getcurrentweapon(); - - if ( currentWeapon != "none" ) - { - p takeweapon(currentWeapon); - } - - if ( upgraded ) - { - givePaPWeapon(p, weapon); - } - else - { - giveCustomWeapon(p, weapon); - } - - p waittill("weapon_change_complete"); - p notify("customPrimary"); -} - -/* - * Sets player primary weapon - */ -setSecondaryWeapon(p, l, weapon, upgraded) -{ - p.customSecondary = true; - - waitMotd(p, l); - offHandWeapon = p getcurrentoffhand(); - - if ( offHandWeapon != "none" ) - { - p takeweapon(offHandWeapon); - } - - if ( upgraded ) - { - givePaPWeapon(p, weapon); - } - else - { - giveCustomWeapon(p, weapon); - } -} - -/* - * Enables night mode maps - */ -nightmode(p, l) -{ - p setclientdvar( "r_dof_enable", 0 ); - p setclientdvar( "r_lodBiasRigid", -1000 ); - p setclientdvar( "r_lodBiasSkinned", -1000 ); - p setclientdvar( "r_enablePlayerShadow", 1 ); - p setclientdvar( "r_skyTransition", 1 ); - p setclientdvar( "sm_sunquality", 2 ); - p setclientdvar( "vc_fbm", "0 0 0 0" ); - p setclientdvar( "vc_fsm", "1 1 1 1" ); - p thread visualFix(l); - p thread enableNightMode(l); -} - -/* - * Sets the max zombies to a custom value - */ -setZombieLimit(l, limit) -{ - l.zombie_ai_limit = limit; -} diff --git a/sneed.gsc b/sneed.gsc new file mode 100755 index 0000000..dfde794 --- /dev/null +++ b/sneed.gsc @@ -0,0 +1,443 @@ +/* + * Black Ops 2 Plutonium + * + * Creator : Rafael Marçalo + * Project : SneedZombies + * Version : v1 + * Mode : Zombies + * Date : 2023/03/20 + * + */ + +////////////// +// INCLUDES // +////////////// + +#include common_scripts/utility; +#include maps/mp/gametypes_zm/_hud_util; +#include maps/mp/zombies/_zm; +#include maps/mp/zombies/_zm_utility; +#include maps/mp/zombies/_zm_weapons; +#include maps/mp/zombies/_zm_afterlife; +#include maps/mp/zombies/_zm_perks; + +////////// +// MAIN // +////////// + +init() // entry point +{ + // level setPerkLimit(12); // Sets the max perks allowed to be consumed per player + level thread onplayerconnect(); +} + +onplayerconnect() +{ + for(;;) + { + level waittill("connected", player); + player thread onplayerspawned(); + } +} + +onplayerspawned() +{ + self endon("disconnect"); + for(;;) + { + // self thread darkMode(); // Forces the map to have a darker color palette + // self infinteAfterlife(); // You'll get infinte time in afterlife; + self waitForLoadedLevel(); + // self thread welcomeMessage("^3 Welcome to ^1SneedZombies ^3it's time to ^1SNEED ^3some zombies and ^1FEED ^3some points"); // Shows a welcome message + // self thread zombieCounter(0, 190); // Shows the number of zombies alive, the parameters are the coordinates X and Y where the counter will appear + // self thread healthCounter(0, 190); // Shows your health, the parameters are the coordinates X and Y where the counter will appear + // level thread customMysteryBoxPrice(500); // Sets the default mystery box price, the parameters define the box price value + // self thread customStartingPoints(1000); // Sets the default player's starting points, the parameters define the players's starting points value + // self thread customPrimaryWeapon("galil_zm", true); // Gives the player a custom primary weapon, the parameters define the base weapon codename and true/false if the weapon should come upgraded or not + // self thread customSecondaryWeapon("ray_gun_zm", false); // Gives the player a custom secondary weapon, the parameters define the base weapon codename and true/false if the weapon should come upgraded or not + // level customZombieSpawnLimit(24); // Sets the max amount of spawned zombies per round + // self thread perkaholic(true); // Gives the player all the available perks in the game, the parameters define if the player should see the bottle drinking animation; + // self godMode(); // Enables player god mode + // self thread unlimitedAmmo(); // Enables the player to have unlimited ammo; + } +} + +/////////////////////// +// !! DANGER ZONE !! // +/////////////////////// + +/////////////// +// MAIN MODS // +/////////////// + +setPerkLimit(numberOfPerks) +{ + self.perk_purchase_limit = numberOfPerks; +} + +welcomeMessage(message) +{ + level waittill( "start_of_round" ); + self iprintln(message); +} + +zombieCounter(x, y) +{ + self.zombiecounter = drawCounter(self.zombiecounter, x, y, "Objective", 1.7); + + for(;;) + { + zombies = level.zombie_total + get_current_zombie_count(); + if ( zombies > 0 ) + { + self.zombiecounter.label = &"Zombies: ^1"; + } + else + { + self.zombiecounter.label = &"Zombies: ^6"; + } + + self.zombiecounter setvalue(zombies); + wait 0.05; + } +} + +healthCounter(x, y) +{ + self.healthcounter = drawCounter(self.healthcounter, x, y, "Objective", 1.7); + + for(;;) + { + if ( self checkAfterlife() ) + { + self.healthcounter.alpha = 0.2; + } + else + { + self.healthcounter.alpha = 1; + } + + health = self.health; + + if( health <= 15 ) + { + self.healthcounter.label = &"Health: ^1"; + } + else if ( self.health <= 50 ) + { + self.healthcounter.label = &"Health: ^3"; + } + else + { + self.healthcounter.label = &"Health: ^2"; + } + + self.healthcounter setValue(health); + wait 0.05; + } +} + +perkaholic(animation) +{ + if (isDefined(self.customPrimary) && self.customPrimary) + { + self waittill("customPrimary"); + } + + self giveAllPerks(animation); +} + +customMysteryBoxPrice(price) +{ + for (i = 0; i < self.chests.size; i++) + { + self.chests[ i ].zombie_cost = price; + self.chests[ i ].old_cost = price; + } +} + +customStartingPoints(points) +{ + self.score = points; +} + +customPrimaryWeapon(weapon, upgraded) +{ + self.customPrimary = true; + currentWeapon = self getcurrentweapon(); + + if ( currentWeapon != "none" ) + { + self takeweapon(currentWeapon); + } + + if ( upgraded ) + { + self givePaPWeapon(weapon); + } + else + { + self giveWeapon(weapon); + } + + self waittill("weapon_change_complete"); + self notify("customPrimary"); +} + +customSecondaryWeapon(weapon, upgraded) +{ + self.customSecondary = true; + + offHandWeapon = self getcurrentoffhand(); + + if ( offHandWeapon != "none" ) + { + self takeweapon(offHandWeapon); + } + + if ( upgraded ) + { + self givePaPWeapon(weapon); + } + else + { + self giveWeapon(weapon); + } +} + +customZombieSpawnLimit(limit) +{ + self.zombie_ai_limit = limit; +} + +godMode() +{ + self enableInvulnerability(); // ToDo: Fix when coming back from afterlife, the god mode wears off +} + +unlimitedAmmo() +{ + for(;;) + { + wait 0.05; + + currentWeapon = self getcurrentweapon(); + if ( currentWeapon != "none" ) + { + self setweaponammoclip( currentWeapon, weaponclipsize(currentWeapon) ); + self givemaxammo( currentWeapon ); + } + + currentoffhand = self getcurrentoffhand(); + + if ( currentoffhand != "none" ) + { + self givemaxammo( currentoffhand ); + } + } +} + +darkMode() +{ + self setclientdvar( "r_dof_enable", 0 ); + self setclientdvar( "r_lodBiasRigid", -1000 ); + self setclientdvar( "r_lodBiasSkinned", -1000 ); + self setclientdvar( "r_enablePlayerShadow", 1 ); + self setclientdvar( "r_skyTransition", 1 ); + self setclientdvar( "sm_sunquality", 2 ); + self setclientdvar( "vc_fbm", "0 0 0 0" ); + self setclientdvar( "vc_fsm", "1 1 1 1" ); + self thread visualFix(); + self thread enableDarkMode(); +} + +// Mob of the Dead Specific +infinteAfterlife() +{ + self.infinite_mana = 1; +} + + +/////////////////// +// AUXILIAR CODE // +/////////////////// + +waitForLoadedLevel() +{ + self waittill("spawned_player"); + flag_wait( "initial_blackscreen_passed" ); + + if ( self checkAfterlife() && level initialRound() ) + { + self waittill("player_revived"); + } + + wait 1; +} + +drawCounter(counterVar, x, y, font, size) +{ + counterVar = createfontstring( font, size ); + counterVar setpoint( "CENTER", "CENTER", x, y); + counterVar.alpha = 1; + counterVar.hidewheninmenu = 1; + counterVar.hidewhendead = 1; + return counterVar; +} + +// Level Entity +initialRound() +{ + return (self.round_number == self.start_round); +} + +// Player Entity +checkAfterlife() +{ + if( isDefined(self.afterlife) && self.afterlife ) + { + return 1; + } + return 0; +} + +doGivePerk(perk, animation) +{ + if ( animation ) + { + self endon("perk_abort_drinking"); + if (!(self hasperk(perk) || (self maps/mp/zombies/_zm_perks::has_perk_paused(perk)))) + { + gun = self maps/mp/zombies/_zm_perks::perk_give_bottle_begin(perk); + evt = self waittill_any_return("fake_death", "death", "player_downed", "weapon_change_complete"); + if (evt == "weapon_change_complete") + self thread maps/mp/zombies/_zm_perks::wait_give_perk(perk, 1); + self maps/mp/zombies/_zm_perks::perk_give_bottle_end(gun, perk); + if (self maps/mp/zombies/_zm_laststand::player_is_in_laststand() || isDefined(self.intermission) && self.intermission) + return; + self notify("burp"); + } + } + else + { + if (!(self hasperk(perk) || (self maps/mp/zombies/_zm_perks::has_perk_paused(perk)))) + { + self give_perk(perk); + } + } +} + +giveAllPerks(animation) +{ + if (isDefined(level.zombiemode_using_juggernaut_perk) && level.zombiemode_using_juggernaut_perk) + self doGivePerk("specialty_armorvest", animation); + if (isDefined(level._custom_perks) && isDefined(level._custom_perks["specialty_nomotionsensor"])) + self doGivePerk("specialty_nomotionsensor", animation); + if (isDefined(level.zombiemode_using_doubletap_perk) && level.zombiemode_using_doubletap_perk) + self doGivePerk("specialty_rof", animation); + if (isDefined(level.zombiemode_using_marathon_perk) && level.zombiemode_using_marathon_perk) + self doGivePerk("specialty_longersprint", animation); + if (isDefined(level.zombiemode_using_sleightofhand_perk) && level.zombiemode_using_sleightofhand_perk) + self doGivePerk("specialty_fastreload", animation); + if(isDefined(level.zombiemode_using_additionalprimaryweapon_perk) && level.zombiemode_using_additionalprimaryweapon_perk) + self doGivePerk("specialty_additionalprimaryweapon", animation); + if (isDefined(level.zombiemode_using_revive_perk) && level.zombiemode_using_revive_perk) + self doGivePerk("specialty_quickrevive", animation); + if (isDefined(level.zombiemode_using_chugabud_perk) && level.zombiemode_using_chugabud_perk) + self doGivePerk("specialty_finalstand", animation); + if (isDefined(level._custom_perks) && isDefined(level._custom_perks["specialty_grenadepulldeath"])) + self doGivePerk("specialty_grenadepulldeath", animation); + if (isDefined(level._custom_perks) && isDefined(level._custom_perks["specialty_flakjacket"]) && (l.script != "zm_buried")) + self doGivePerk("specialty_flakjacket", animation); + if (isDefined(level.zombiemode_using_deadshot_perk) && level.zombiemode_using_deadshot_perk) + self doGivePerk("specialty_deadshot", animation); + if (isDefined(level.zombiemode_using_tombstone_perk) && level.zombiemode_using_tombstone_perk) + self doGivePerk("specialty_scavenger", animation); +} + +giveWeapon(weapon) +{ + if ( isDefined(weapon) ) + { + + self giveWeapon(weapon); + self givemaxammo(weapon); + } +} + +givePaPWeapon(baseWeapon) +{ + if ( isDefined(baseWeapon) ) + { + weapon = get_upgrade_weapon(baseWeapon, 0); + if ( isDefined(weapon) ) + { + self giveweapon(weapon, 0, self get_pack_a_punch_weapon_options(weapon)); + self givemaxammo(weapon); + } + } +} + +visualFix() +{ + if( level.script == "zm_buried" ) + { + while( 1 ) + { + self setclientdvar( "r_lightTweakSunLight", 1 ); + self setclientdvar( "r_sky_intensity_factor0", 0 ); + wait 0.05; + } + } + else if( level.script == "zm_prison" || level.script == "zm_tomb" ) + { + while( getDvar( "r_lightTweakSunLight" ) != 0 ) + { + for( i = getDvar( "r_lightTweakSunLight" ); i >= 0; i = ( i - 0.05 ) ) + { + self setclientdvar( "r_lightTweakSunLight", i ); + wait 0.05; + } + wait 0.05; + } + } + else return; +} + +enableDarkMode() +{ + if( !isDefined( level.default_r_exposureValue ) ) + level.default_r_exposureValue = getDvar( "r_exposureValue" ); + if( !isDefined( level.default_r_lightTweakSunLight ) ) + level.default_r_lightTweakSunLight = getDvar( "r_lightTweakSunLight" ); + if( !isDefined( level.default_r_sky_intensity_factor0 ) ) + level.default_r_sky_intensity_factor0 = getDvar( "r_sky_intensity_factor0" ); + + self setclientdvar( "r_filmUseTweaks", 1 ); + self setclientdvar( "r_bloomTweaks", 1 ); + self setclientdvar( "r_exposureTweak", 1 ); + self setclientdvar( "vc_rgbh", "0.1 0 0.3 0" ); + self setclientdvar( "vc_yl", "0 0 0.25 0" ); + self setclientdvar( "vc_yh", "0.02 0 0.1 0" ); + self setclientdvar( "vc_rgbl", "0.02 0 0.1 0" ); + self setclientdvar( "r_exposureValue", 3.9 ); + self setclientdvar( "r_lightTweakSunLight", 1 ); + self setclientdvar( "r_sky_intensity_factor0", 0 ); + + if( level.script == "zm_buried" ) + { + self setclientdvar( "r_exposureValue", 3.5 ); + } + else if( level.script == "zm_tomb" ) + { + self setclientdvar( "r_exposureValue", 4 ); + } + else if( level.script == "zm_nuked" ) + { + self setclientdvar( "r_exposureValue", 5.6 ); + } + else if( level.script == "zm_highrise" ) + { + self setclientdvar( "r_exposureValue", 3.9 ); + } +} -- cgit v1.2.3