summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrafa_99 <raroma09@gmail.com>2022-01-29 02:48:17 +0000
committerrafa_99 <raroma09@gmail.com>2022-01-29 02:48:17 +0000
commit31d807a247e5b20cbd11629fef3a42b03128ba84 (patch)
tree7fb280c07a0bb7775b478c09e4f8befc91eafa57
parente404b780f9882089d1bc10d4f9471ca87b2e48ba (diff)
Give all perks
-rwxr-xr-xmods/all/modLoader.gsc104
-rwxr-xr-xmods/perks/giveAllPerks.gsc87
-rwxr-xr-xmods/perks/noPerkLimit.gsc2
3 files changed, 168 insertions, 25 deletions
diff --git a/mods/all/modLoader.gsc b/mods/all/modLoader.gsc
index 060d6c1..d3047ba 100755
--- a/mods/all/modLoader.gsc
+++ b/mods/all/modLoader.gsc
@@ -3,6 +3,35 @@
#include maps/mp/zombies/_zm_utility;
#include maps/mp/zombies/_zm_perks;
+/*
+ * Function Responsible for Loading the Mods
+ * comment with // the mods you want to disable
+ * and then compile with a gsc compiler.
+ */
+modLoader(p, l)
+{
+ // Preloads tombstone before black screen after loading the map
+ activateTombstone(level);
+
+ ////////////////////////////////////////////////////////////////////////
+ // 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" ); //
+ ////////////////////////////////////////////////////////////////////////
+
+ // Mod to Remove the Perk Limit
+ thread removePerkLimit(l);
+
+ // Mod that adds a zombie counter to the bottom of the screen
+ p thread zombieCounter(p, l, 100, 190);
+
+ // Mod that adds a health counter to the bottom of the screen
+ p thread healthCounter(p, -100, 190);
+
+ // Gives all the perks available in the map to the player
+ giveAllPerks(p, l);
+}
+
init()
{
level thread onPlayerConnect();
@@ -29,34 +58,11 @@ onPlayerSpawned()
}
/*
- * Function Responsible for Loading the Mods
- * comment with // the mods you want to disable
- * and then compile with a gsc compiler.
- */
-modLoader(p, l)
-{
- // Preloads tombstone before black screen after loading the map
- activateTombstone(level);
-
- // 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
- thread removePerkLimit(l);
-
- // Mod that adds a zombie counter to the bottom of the screen
- p thread zombieCounter(p, l, 100, 190);
-
- // Mod that adds a health counter to the bottom of the screen
- p thread healthCounter(p, -100, 190);
-}
-
-/*
* Function that removes zombie limit
*/
removePerkLimit(l)
{
- l.perk_purchase_limit = 12;
+ l.perk_purchase_limit = 9;
}
/*
@@ -129,6 +135,37 @@ activateTombstone(l)
}
}
+/*
+ * 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");
+}
// Aux Functions
@@ -335,3 +372,22 @@ turn_tombstone_on()
}
}
}
+
+/*
+ * 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/giveAllPerks.gsc b/mods/perks/giveAllPerks.gsc
new file mode 100755
index 0000000..5f51192
--- /dev/null
+++ b/mods/perks/giveAllPerks.gsc
@@ -0,0 +1,87 @@
+#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 b266218..649df15 100755
--- a/mods/perks/noPerkLimit.gsc
+++ b/mods/perks/noPerkLimit.gsc
@@ -27,6 +27,6 @@ onPlayerSpawned()
flag_wait( "initial_blackscreen_passed" );
// Mod to Remove the Perk Limit
- level.perk_purchase_limit = 12;
+ level.perk_purchase_limit = 9;
}
}