From f7027dd5e69ebe2ac073033e5328ba5c9bf51283 Mon Sep 17 00:00:00 2001 From: rafa_99 Date: Sun, 27 Feb 2022 17:11:24 +0000 Subject: Added automatic mods installer script and updated paths --- README.md | 6 +- compiler/Compiler.exe | Bin 49664 -> 0 bytes compiler/Irony.dll | Bin 149504 -> 0 bytes images/OWtguHd.gif | Bin 64725 -> 0 bytes images/install.gif | Bin 0 -> 211324 bytes installer/Compiler.exe | Bin 0 -> 49664 bytes installer/Irony.dll | Bin 0 -> 149504 bytes installer/installMods.bat | 6 + modLoader/auxiliary.gsc | 213 -------------------------------- modLoader/main.gsc | 189 ----------------------------- modLoader/mods.gsc | 300 ---------------------------------------------- mods/auxiliary.gsc | 213 ++++++++++++++++++++++++++++++++ mods/main.gsc | 190 +++++++++++++++++++++++++++++ mods/mods.gsc | 300 ++++++++++++++++++++++++++++++++++++++++++++++ 14 files changed, 711 insertions(+), 706 deletions(-) delete mode 100644 compiler/Compiler.exe delete mode 100644 compiler/Irony.dll delete mode 100644 images/OWtguHd.gif create mode 100644 images/install.gif create mode 100644 installer/Compiler.exe create mode 100644 installer/Irony.dll create mode 100755 installer/installMods.bat delete mode 100644 modLoader/auxiliary.gsc delete mode 100644 modLoader/main.gsc delete mode 100644 modLoader/mods.gsc create mode 100644 mods/auxiliary.gsc create mode 100644 mods/main.gsc create mode 100644 mods/mods.gsc diff --git a/README.md b/README.md index a3c1c6e..05e79db 100644 --- a/README.md +++ b/README.md @@ -12,16 +12,14 @@ A bunch of mods for black ops 2 zombies ![Enabled player initial points and set to 10000](images/enabled.png) -3. Using the GSC Compiler (from GSC Toolkit), simply drag and drop your raw GSC script on top of Compiler.exe and it should spit out a compiled version. +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/OWtguHd.gif) +![Compilation Process](images/install.gif) *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)* ![Error](images/JgwqeCy.png) -4. Grab the compiled binary, and drag and drop it into `%localappdata%\Plutonium\storage\t6\scripts\zm`, if this destination does not exist, then proceed to create it. - ## Using When launching your server or a custom game, you will know if all has gone well or not if the console prints `Custom script 'scripts/mp/yourScriptName' loaded`. diff --git a/compiler/Compiler.exe b/compiler/Compiler.exe deleted file mode 100644 index 7f57215..0000000 Binary files a/compiler/Compiler.exe and /dev/null differ diff --git a/compiler/Irony.dll b/compiler/Irony.dll deleted file mode 100644 index ebb1fe5..0000000 Binary files a/compiler/Irony.dll and /dev/null differ diff --git a/images/OWtguHd.gif b/images/OWtguHd.gif deleted file mode 100644 index be6c186..0000000 Binary files a/images/OWtguHd.gif and /dev/null differ diff --git a/images/install.gif b/images/install.gif new file mode 100644 index 0000000..f8d061c Binary files /dev/null and b/images/install.gif differ diff --git a/installer/Compiler.exe b/installer/Compiler.exe new file mode 100644 index 0000000..7f57215 Binary files /dev/null and b/installer/Compiler.exe differ diff --git a/installer/Irony.dll b/installer/Irony.dll new file mode 100644 index 0000000..ebb1fe5 Binary files /dev/null and b/installer/Irony.dll differ diff --git a/installer/installMods.bat b/installer/installMods.bat new file mode 100755 index 0000000..61a874d --- /dev/null +++ b/installer/installMods.bat @@ -0,0 +1,6 @@ +@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/modLoader/auxiliary.gsc b/modLoader/auxiliary.gsc deleted file mode 100644 index 7b9da43..0000000 --- a/modLoader/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/modLoader/main.gsc b/modLoader/main.gsc deleted file mode 100644 index b194407..0000000 --- a/modLoader/main.gsc +++ /dev/null @@ -1,189 +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/modLoader/mods.gsc b/modLoader/mods.gsc deleted file mode 100644 index 300b3b2..0000000 --- a/modLoader/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/mods/auxiliary.gsc b/mods/auxiliary.gsc new file mode 100644 index 0000000..7b9da43 --- /dev/null +++ b/mods/auxiliary.gsc @@ -0,0 +1,213 @@ +/* + * 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 new file mode 100644 index 0000000..daa4cd9 --- /dev/null +++ b/mods/main.gsc @@ -0,0 +1,190 @@ +#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 new file mode 100644 index 0000000..300b3b2 --- /dev/null +++ b/mods/mods.gsc @@ -0,0 +1,300 @@ +/* + * 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; +} -- cgit v1.2.3