From af3636f0481c5e5edadff47a20e08397dd3819f3 Mon Sep 17 00:00:00 2001 From: rafa_99 Date: Fri, 25 Feb 2022 22:45:56 +0000 Subject: New script version, improved and reworked --- README.md | 139 +++++++++++++++++++++++++++++++++--------------- images/disabled.png | Bin 0 -> 17960 bytes images/enabled.png | Bin 0 -> 18247 bytes modLoader/auxiliary.gsc | 37 ++++++++++--- modLoader/main.gsc | 107 +++++++++++++++++++++++++++++++------ modLoader/mods.gsc | 108 ++++++++++++++++++++++++++++++------- 6 files changed, 306 insertions(+), 85 deletions(-) create mode 100644 images/disabled.png create mode 100644 images/enabled.png diff --git a/README.md b/README.md index 223626d..0b53e4a 100644 --- a/README.md +++ b/README.md @@ -4,41 +4,13 @@ A bunch of mods for black ops 2 zombies ## Install -### With Pre-Compiled Mod - -Download the mod binaries from the releases and drag and drop them into `%localappdata%\Plutonium\storage\t6\scripts\zm`, if this destination does not exist, then proceed to create it. - -### Manually Compiling the Mod - -1. You can write/download any GSC of your choice. If you are writing it from scratch/have the source code, note that you will need to compile it. - -2. If you want to write from scratch you can use the code below and given on the ![plutonium forum website](https://plutonium.pw/docs/modding/loading-mods/#t6) - -``` -init() // entry point -{ - level thread onplayerconnect(); -} - -onplayerconnect() -{ - for(;;) - { - level waittill("connected", player); - player thread onplayerspawned(); - } -} - -onplayerspawned() -{ - self endon("disconnect"); - for(;;) - { - self waittill("spawned_player"); - self iprintlnbold("^2GSC from %LocalAppdata%\\Plutonium\\storage\\t6\\scripts\\zm\\test.gsc ^1(Compiled)"); - } -} -``` +1. Download the AIO Script from the releases. + +2. Edit the script with your favourite 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 costumized, will be documented in the function call*). + +![Disabled Mod](images/disabled.png) + +![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 ontop of Compiler.exe and it should spit out a compiled version. @@ -52,17 +24,96 @@ onplayerspawned() ## 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. +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`. ![Script Loaded](images/oVlCBnI.png) ## Available Mods -* Zombie Counter; -* Health Counter; -* Tombstone in Solo; -* Perkaholic(All perks in first round); -* A Cat Has 9 Lifes(Custom amount of lives in Afterlife Mode); -* Set Allowed Perk Count by Player; -* Set Initial Player Perks; -* Set Mystery Box Price; \ No newline at end of file +* GodMode; +* Infinte ammo; +* Custom player Points; +* Custom box Price; +* Custom buyable Perk Limit; +* Perkaholic; +* Custom afterlife lifes; +* Infinite time in afterlife; +* Custom primary weapon; +* Custom secondary weapon; +* Late joined player bonus; +* Zombies counter; +* Health counter; + +## Weapons List + +[Source](https://github.com/Snakelegendary/BO2-Plutonium-Modding-Guide/wiki/Weapons-List) + +|Unpacked Name (in-game)|Unpacked Name (GSC-name)|Packed Name (in-game)|packed Name (GSC-name)| +|--- |--- |--- |--- | +|AK-47|ak47_zm|Reznov's Revenge|ak47_upgraded_zm| +|AK74u|ak74u_zm, ak74u_extclip_zm (another version)|AK74fu2|ak74u_upgraded_zm, ak74u_extclip_upgraded_zm| +|AN-94|an94_zm|Actuated Neutralizer 94000|an94_upgraded_zm| +|B23R|beretta93r_zm, beretta93r_extclip_zm|B34R|beretta93r_upgraded_zm, beretta93r_extclip_upgraded_zm| +|Ballista|ballista_zm|Infused Arbalest|ballista_upgraded_zm| +|Ballistic Knife|knife_ballistic_zm, knife_ballistic_no_melee_zm, knife_ballistic_bowie_zm|The Krauss Refribrillator|knife_ballistic_upgraded_zm, knife_ballistic_no_melee_upgraded_zm, knife_ballistic_bowie_upgraded_zm| +|Barrett M82A1|barretm82_zm|Macro Annihilator|barretm82_upgraded_zm| +|Blundergat|blundergat_zm|The Sweeper|blundergat_upgraded_zm| +|Acid Gat|blundersplat_zm, blundersplat_explosive_dart_zm (explosive used for pap'ed acid gat), blundersplat_bullet_zm|Vitriolic Withering|blundersplat_upgraded_zm| +|Bowie Knife|bowie_knife_zm|N/A|N/A| +|Chicom CQB|qcw05_zm|Chicom Cataclismic Quadruple Burst|qcw05_upgraded_zm, sf_qcw05_upgraded_zm (select fire)| +|Claymore|claymore_zm|N/A|N/A| +|Colt M16A1|m16_zm|Skullcrusher|m16_gl_upgraded_zm| +|Death Machine|minigun_alcatraz_zm|Meat Grinder|minigun_alcatraz_upgraded_zm| +|DSR 50|dsr50_zm|Dead Specimen Reactor 5000|dsr50_upgraded_zm| +|Executioner|judge_zm|Voice of Justice|judge_upgraded_zm| +|FAL|fnfal_zm|WN|fnfal_upgraded_zm| +|Five-seven|fiveseven_zm|Ultra|fiveseven_upgraded_zm,| +|Five-seven Dual Wield|fivesevendw_zm, fivesevenlh_zm|Ultra & Violet|fivesevendw_upgraded_zm, fivesevenlh_upgraded_zm| +|Galil|galil_zm|Lemantation|galil_upgraded_zm| +|Galvaknuckles|tazer_knuckles_zm|N/A|N/A| +|EMP Grenade|emp_grenade_zm|N/A|N/A| +|HAMR|hamr_zm|SLDG HAMR|hamr_upgraded_zm| +|Hell's Retriever|bouncing_tomahawk_zm|Hell's Redeemer|upgraded_tomahawk_zm| +|KAP-40|kard_zm|Karmic Atom Perforator-4000|kard_upgraded_zm| +|KSG|ksg_zm|Mist Maker|ksg_upgraded_zm| +|LSAT|lsat_zm|FSIRT|lsat_upgraded_zm| +|M8A1|xm8_zm|Micro Aerator|xm8_upgraded_zm| +|M14|m14_zm|Mnesia|m14_upgraded_zm| +|M27|hk416_zm,|Mystifier|hk416_upgraded_zm| +|M1216|srm1216_zm|Mesmerizer|srm1216_upgraded_zm| +|M1911|m1911_zm|Mustang & Sally|m1911_upgraded_zm, m1911lh_upgraded_zm| +|M1927|thompson_zm|Speakeasy|thompson_upgraded_zm| +|Mauser C96|c96_zm|BOOMHILDA|c96_upgraded_zm| +|MP-40|mp40_zm, mp40_stalker_zm (diff version,fast ads walk speed)|The Afterburner|mp40_upgraded_zm, mp40_stalker_upgraded_zm| +|Monkey Bomb|cymbal_monkey_zm|N/A|N/A| +|MP5|mp5k_zm|MP115 Kollider|mp5k_upgraded_zm| +|MG08/15|mg08_zm|Magna Collider|mg08_upgraded_zm| +|MTAR|tar21_zm|Malevolent Toxonomic Anodized Redeemer|tar21_upgraded_zm| +|Olympia|rottweil72_zm|Hades|rottweil72_upgraded_zm| +|Paralyzer|slowgun_zm|Petrifier|slowgun_upgraded_zm| +|PDW-57|pdw57_zm|Predictive Death Wish 57000|pdw57_upgraded_zm| +|Python|python_zm|Cobra|python_upgraded_zm| +|RPD|rpd_zm|Relativistic Punishment Device|rpd_upgraded_zm| +|RPG|usrpg_zm|Rocket Propelled Grievance|usrpg_upgraded_zm| +|Ray Gun|ray_gun_zm|Porter's X2 Ray Gun|ray_gun_upgraded_zm| +|Remington 870 MCS|870mcs_zm|Refitted-870 Mechanical Cranium Sequencer|870mcs_upgraded_zm| +|Ray Gun Mark II|raygun_mark2_zm|Porter's Mark II Ray Gun|raygun_mark2_upgraded_zm| +|Remington New Model Army|rnma_zm|SASSAFRAS|rnma_upgraded_zm| +|Skorpion EVO|evoskorpion_zm|Evolved Death Stalker|evoskorpion_upgraded_zm| +|S12|saiga12_zm|Synthetic Dozen|saiga12_upgraded_zm| +|SMR|saritch_zm|SM1L3R|saritch_upgraded_zm, dualoptic_saritch_upgraded_zm| +|Semtex|sticky_grenade_zm|N/A|N/A| +|SCAR-H|scar_zm|ARGARTHAN REAPER|scar_upgraded_zm| +|STG-44|mp44_zm|Spatz-447+|mp44_upgraded_zm| +|SVU-AS|svu_zm|Shadowy Veil Utilizer|svu_upgraded_zm| +|Time Bomb|time_bomb_zm, time_bomb_detonator_zm|N/A|N/A| +|Type 25|type95_zm|Strain 25|type95_upgraded_zm| +|Uzi|uzi_zm|Uncle Gal|uzi_upgraded_zm| +|War Machine|m32_zm|Dystopic Demolisher|m32_upgraded_zm| +|(no name)|electrocuted_hands_zm|N/A|N/A| +|G-Strike|beacon_zm|N/A|N/A| +|WEAPON_DEFAULTWEAPON|defaultweapon_mp|N/A|N/A| +|Maxis Drone|equip_dieseldrone_zm|N/A|N/A| +|Electric Trap|equip_electrictrap_zm|N/A|N/A| +|Frag Grenade|frag_grenade_zm|N/A|N/A| +|Jet Gun|jetgun_zm|(?)|jetgun_upgraded_zm (?)| diff --git a/images/disabled.png b/images/disabled.png new file mode 100644 index 0000000..812cce2 Binary files /dev/null and b/images/disabled.png differ diff --git a/images/enabled.png b/images/enabled.png new file mode 100644 index 0000000..0c31412 Binary files /dev/null and b/images/enabled.png differ diff --git a/modLoader/auxiliary.gsc b/modLoader/auxiliary.gsc index baac329..cbe0f81 100644 --- a/modLoader/auxiliary.gsc +++ b/modLoader/auxiliary.gsc @@ -16,7 +16,7 @@ drawCounter(counterVar, x, y, font, size) */ checkAfterlife(p) { - if(isdefined(p.afterlife) && p.afterlife) + if(isDefined(p.afterlife) && p.afterlife) { return 0.2; } @@ -94,10 +94,9 @@ useCrosshairs(p) */ giveCustomWeapon(p, weapon) { - if ( IsDefined(weapon) ) + if ( isDefined(weapon) ) { p giveWeapon(weapon); - p switchtoweapon(weapon); p givemaxammo(weapon); } } @@ -108,12 +107,34 @@ giveCustomWeapon(p, weapon) */ givePaPWeapon(p, baseWeapon) { - weapon = get_upgrade_weapon(baseWeapon, 0 ); + 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); +} - if ( IsDefined(weapon) ) +/* + * 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 giveweapon(weapon, 0, p get_pack_a_punch_weapon_options(weapon)); - p switchtoweapon(weapon); - p givemaxammo(weapon); + p waittill("player_revived"); } + + wait 1; } diff --git a/modLoader/main.gsc b/modLoader/main.gsc index a958b95..e91f6fc 100644 --- a/modLoader/main.gsc +++ b/modLoader/main.gsc @@ -13,30 +13,65 @@ onConnectMods(p, l) * General Mods */ - // Player is invincible + /* + * Player is invincible + */ // godMode(p); - // Unlimited ammo + /* + * Infinte ammo + */ // thread unlimitedAmmo(p); - // Set initial player points + /* + * Player initial points + * + * Customizable parameters: + * points - Number of points the player will start the game (ex: 500) + */ // setPlayerPoints(p, 500); - // Mod that sets the box price + /* + * Custom Mystery Box price + * + * Customizable parameters: + * price - Ammount of points required to hit the box (ex: 950) + */ // setBoxPrice(l, 950); - // Mod sets a custom perk limit - // thread setPerkLimit(l, 9); + /* + * Custom buyable perk limit + * + * Customizable parameters: + * numberOfPerks - Ammount of perks the player is allowed to purchase (ex: 9) + */ + // setPerkLimit(l, 9); - // Gives all the perks available in the map to the player + /* + * Gives all the map available perks to the player + */ // thread perkaholic(p, l); /* * MotD Mods */ - // Player has 9 lifes in afterlife + /* + * 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 @@ -45,22 +80,65 @@ 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" ); // + flag_wait( "initial_blackscreen_passed" ); // //////////////////////////////////////////////////////////////////////// - // Gives joined players a submachine gun and some points + /* + * 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 and a couple of points + */ // thread joinedBonus(p, l); - // Sets the player camera to third person + /* + * Sets the player camera to the third person + * + * Customizable parameters: + * crosshair - Toggle crosshair for third person camera (ex: true) + */ // playThirdPerson(p, true); - // Mod that adds a zombie counter to the bottom of the screen + /* + * 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); - // Mod that adds a health counter to the bottom of the screen + /* + * 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); - // Mod that adds a zombie and health counters to the bottom of the screen + /* + * 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); } @@ -89,4 +167,3 @@ onPlayerSpawned() onSpawnMods(self, level); } } - diff --git a/modLoader/mods.gsc b/modLoader/mods.gsc index 34f627a..8d6e68f 100644 --- a/modLoader/mods.gsc +++ b/modLoader/mods.gsc @@ -67,16 +67,21 @@ healthCounter(p, x, y) */ perkaholic(p, l) { + flag_wait( "initial_blackscreen_passed" ); + waitMotd(p, l); + if (l.round_number == 1) { - l waittill("start_of_round"); + if (isDefined(p.customPrimary) && p.customPrimary) + { + p waittill("customPrimary"); + } + giveAllPerks(p, l, true); } else { - l waittill("start_of_round"); giveAllPerks(p, l, false); - p notify("burp"); } } @@ -159,29 +164,96 @@ unlimitedAmmo(p) */ joinedBonus(p, l) { - l waittill("start_of_round"); - if (l.round_number > 5 && l.round_number <= 15) + if ((l.round_number - l.start_round) >= 5 && (l.round_number - l.start_round) < 15) { p.score += 2500; - if (l.script == "zm_tomb") - { - giveCustomWeapon(p, "mp40_zm"); - } - else + if (!isDefined(p.customSecondary)) { - giveCustomWeapon(p, "mp5k_zm"); + if (l.script == "zm_tomb") + { + setSecondaryWeapon(p, l, "mp40_zm", false); + } + else + { + setSecondaryWeapon(p, l, "mp5k_zm", false); + } } + } - else if (l.round_number > 15) + else if ((l.round_number - l.start_round) >= 15) { p.score += 7500; - if (l.script == "zm_tomb") - { - givePaPWeapon(p, "mp40_zm"); - } - else + if (!isDefined(p.customSecondary)) { - givePaPWeapon(p, "mp5k_zm"); + 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); + } +} -- cgit v1.2.3