From d71d5b612366513c44ecaa3701c0e9693e78502d Mon Sep 17 00:00:00 2001 From: rafa_99 Date: Thu, 3 Feb 2022 04:14:48 +0000 Subject: Updated Mods --- mods/all/modLoader.gsc | 32 ++++++++++---- mods/mysterybox/customBoxPrice.gsc | 44 +++++++++++++++++++ mods/perks/giveAllPerks.gsc | 87 -------------------------------------- mods/perks/noPerkLimit.gsc | 12 +++++- mods/perks/perkaholic.gsc | 84 ++++++++++++++++++++++++++++++++++++ 5 files changed, 162 insertions(+), 97 deletions(-) create mode 100755 mods/mysterybox/customBoxPrice.gsc delete mode 100755 mods/perks/giveAllPerks.gsc create mode 100755 mods/perks/perkaholic.gsc diff --git a/mods/all/modLoader.gsc b/mods/all/modLoader.gsc index ef52f71..fc9785b 100755 --- a/mods/all/modLoader.gsc +++ b/mods/all/modLoader.gsc @@ -11,7 +11,7 @@ modLoader(p, l) { // Preloads tombstone before black screen after loading the map - activateTombstone(level); + //activateTombstone(l); //////////////////////////////////////////////////////////////////////// // Waits for the black preload screen to pass so it can load the mods // @@ -19,8 +19,11 @@ modLoader(p, l) flag_wait( "initial_blackscreen_passed" ); // //////////////////////////////////////////////////////////////////////// - // Mod to Remove the Perk Limit - thread removePerkLimit(l); + // Mod sets a custom Perk Limit + thread setPerkLimit(l, 12); + + // Mod that sets the box price + //setBoxPrice(l, 950); // Mod that adds a zombie counter to the bottom of the screen // p thread zombieCounter(p, l, 0, 190); @@ -31,7 +34,7 @@ modLoader(p, l) p thread healthCounter(p, -100, 190); // Gives all the perks available in the map to the player - giveAllPerks(p, l); + perkaholic(p, l); } init() @@ -60,13 +63,14 @@ onPlayerSpawned() } /* - * Function that removes zombie limit + * Function that updates perk limit */ -removePerkLimit(l) +setPerkLimit(l, numberOfPerks) { - l.perk_purchase_limit = 9; + l.perk_purchase_limit = numberOfPerks; } + /* * Function that draws a zombie counter */ @@ -140,7 +144,7 @@ activateTombstone(l) /* * Function that gives the player all the perks available */ -giveAllPerks(p, l) +perkaholic(p, l) { level waittill("start_of_round"); if (isDefined(l.zombiemode_using_juggernaut_perk) && l.zombiemode_using_juggernaut_perk) @@ -169,6 +173,18 @@ giveAllPerks(p, l) p doGivePerk("specialty_scavenger"); } +/* + * Function that 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; + } +} + // Aux Functions /* diff --git a/mods/mysterybox/customBoxPrice.gsc b/mods/mysterybox/customBoxPrice.gsc new file mode 100755 index 0000000..8749f52 --- /dev/null +++ b/mods/mysterybox/customBoxPrice.gsc @@ -0,0 +1,44 @@ +#include common_scripts/utility; +#include maps/mp/zombies/_zm_utility; + +init() +{ + level thread onPlayerConnect(); +} + +onPlayerConnect() +{ + while(1) + { + level waittill("connected", player); + player thread onPlayerSpawned(); + } +} + +onPlayerSpawned() +{ + self endon("disconnect"); + level endon("game_ended"); + while(1) + { + self waittill("spawned_player"); + + // Waits for the black preload screen to pass so it can load the mods + flag_wait( "initial_blackscreen_passed" ); + + // Mod that sets the box price + setBoxPrice(l, 950); + } +} + +/* + * Function that 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; + } +} diff --git a/mods/perks/giveAllPerks.gsc b/mods/perks/giveAllPerks.gsc deleted file mode 100755 index 5f51192..0000000 --- a/mods/perks/giveAllPerks.gsc +++ /dev/null @@ -1,87 +0,0 @@ -#include common_scripts/utility; -#include maps/mp/zombies/_zm_utility; -#include maps/mp/zombies/_zm_perks; - -init() -{ - level thread onPlayerConnect(); -} - -onPlayerConnect() -{ - while(1) - { - level waittill("connected", player); - player thread onPlayerSpawned(); - } -} - -onPlayerSpawned() -{ - self endon("disconnect"); - level endon("game_ended"); - while(1) - { - self waittill("spawned_player"); - - // Waits for the black preload screen to pass so it can load the mods - flag_wait( "initial_blackscreen_passed" ); - - // Mod to Remove the Perk Limit - level.perk_purchase_limit = 9; - - // Gives all the perks available in the map to the player - giveAllPerks(self, level); - } -} - -/* - * Function that gives the player all the perks available - */ -giveAllPerks(p, l) -{ - level waittill("start_of_round"); - if (isDefined(l.zombiemode_using_juggernaut_perk) && l.zombiemode_using_juggernaut_perk) - p doGivePerk("specialty_armorvest"); - if (isDefined(l._custom_perks) && isDefined(l._custom_perks["specialty_nomotionsensor"])) - p doGivePerk("specialty_nomotionsensor"); - if (isDefined(l.zombiemode_using_doubletap_perk) && l.zombiemode_using_doubletap_perk) - p doGivePerk("specialty_rof"); - if (isDefined(l.zombiemode_using_marathon_perk) && l.zombiemode_using_marathon_perk) - p doGivePerk("specialty_longersprint"); - if (isDefined(l.zombiemode_using_sleightofhand_perk) && l.zombiemode_using_sleightofhand_perk) - p doGivePerk("specialty_fastreload"); - if(isDefined(l.zombiemode_using_additionalprimaryweapon_perk) && l.zombiemode_using_additionalprimaryweapon_perk) - p doGivePerk("specialty_additionalprimaryweapon"); - if (isDefined(l.zombiemode_using_revive_perk) && l.zombiemode_using_revive_perk) - p doGivePerk("specialty_quickrevive"); - if (isDefined(l.zombiemode_using_chugabud_perk) && l.zombiemode_using_chugabud_perk) - p doGivePerk("specialty_finalstand"); - if (isDefined(l._custom_perks) && isDefined(l._custom_perks["specialty_grenadepulldeath"])) - p doGivePerk("specialty_grenadepulldeath"); - if (isDefined(l._custom_perks) && isDefined(l._custom_perks["specialty_flakjacket"]) && (l.script != "zm_buried")) - p doGivePerk("specialty_flakjacket"); - if (isDefined(l.zombiemode_using_deadshot_perk) && l.zombiemode_using_deadshot_perk) - p doGivePerk("specialty_deadshot"); - if (isDefined(l.zombiemode_using_tombstone_perk) && l.zombiemode_using_tombstone_perk) - p doGivePerk("specialty_scavenger"); -} - -/* - * Displays animation while giving perk - */ -doGivePerk(perk) -{ - 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"); - } -} diff --git a/mods/perks/noPerkLimit.gsc b/mods/perks/noPerkLimit.gsc index 649df15..e6fbbab 100755 --- a/mods/perks/noPerkLimit.gsc +++ b/mods/perks/noPerkLimit.gsc @@ -26,7 +26,15 @@ onPlayerSpawned() // Waits for the black preload screen to pass so it can load the mods flag_wait( "initial_blackscreen_passed" ); - // Mod to Remove the Perk Limit - level.perk_purchase_limit = 9; + // Mod sets a custom Perk Limit + thread setPerkLimit(l, 12); } } + +/* + * Function that update zombie perk limit + */ +setPerkLimit(l, numberOfPerks) +{ + l.perk_purchase_limit = numberOfPerks; +} diff --git a/mods/perks/perkaholic.gsc b/mods/perks/perkaholic.gsc new file mode 100755 index 0000000..1343476 --- /dev/null +++ b/mods/perks/perkaholic.gsc @@ -0,0 +1,84 @@ +#include common_scripts/utility; +#include maps/mp/zombies/_zm_utility; +#include maps/mp/zombies/_zm_perks; + +init() +{ + level thread onPlayerConnect(); +} + +onPlayerConnect() +{ + while(1) + { + level waittill("connected", player); + player thread onPlayerSpawned(); + } +} + +onPlayerSpawned() +{ + self endon("disconnect"); + level endon("game_ended"); + while(1) + { + self waittill("spawned_player"); + + // Waits for the black preload screen to pass so it can load the mods + flag_wait( "initial_blackscreen_passed" ); + + // Gives all the perks available in the map to the player + perkaholic(self, level); + } +} + +/* + * Function that gives the player all the perks available + */ +perkaholic(p, l) +{ + level waittill("start_of_round"); + if (isDefined(l.zombiemode_using_juggernaut_perk) && l.zombiemode_using_juggernaut_perk) + p doGivePerk("specialty_armorvest"); + if (isDefined(l._custom_perks) && isDefined(l._custom_perks["specialty_nomotionsensor"])) + p doGivePerk("specialty_nomotionsensor"); + if (isDefined(l.zombiemode_using_doubletap_perk) && l.zombiemode_using_doubletap_perk) + p doGivePerk("specialty_rof"); + if (isDefined(l.zombiemode_using_marathon_perk) && l.zombiemode_using_marathon_perk) + p doGivePerk("specialty_longersprint"); + if (isDefined(l.zombiemode_using_sleightofhand_perk) && l.zombiemode_using_sleightofhand_perk) + p doGivePerk("specialty_fastreload"); + if(isDefined(l.zombiemode_using_additionalprimaryweapon_perk) && l.zombiemode_using_additionalprimaryweapon_perk) + p doGivePerk("specialty_additionalprimaryweapon"); + if (isDefined(l.zombiemode_using_revive_perk) && l.zombiemode_using_revive_perk) + p doGivePerk("specialty_quickrevive"); + if (isDefined(l.zombiemode_using_chugabud_perk) && l.zombiemode_using_chugabud_perk) + p doGivePerk("specialty_finalstand"); + if (isDefined(l._custom_perks) && isDefined(l._custom_perks["specialty_grenadepulldeath"])) + p doGivePerk("specialty_grenadepulldeath"); + if (isDefined(l._custom_perks) && isDefined(l._custom_perks["specialty_flakjacket"]) && (l.script != "zm_buried")) + p doGivePerk("specialty_flakjacket"); + if (isDefined(l.zombiemode_using_deadshot_perk) && l.zombiemode_using_deadshot_perk) + p doGivePerk("specialty_deadshot"); + if (isDefined(l.zombiemode_using_tombstone_perk) && l.zombiemode_using_tombstone_perk) + p doGivePerk("specialty_scavenger"); +} + +/* + * Displays animation while giving perk + */ +doGivePerk(perk) +{ + 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"); + } +} -- cgit v1.2.3