summaryrefslogtreecommitdiff
path: root/modLoader/auxiliary.gsc
diff options
context:
space:
mode:
authorrafa_99 <raroma09@gmail.com>2022-02-23 05:14:43 +0000
committerrafa_99 <raroma09@gmail.com>2022-02-23 05:14:43 +0000
commit9c93a21c0f337cfb6ce652b1a51e83bd87fbf614 (patch)
tree07c2c9ec3294e03133e42c6c5138cf92ca839d5d /modLoader/auxiliary.gsc
parent04c627f9b3db553a3f8d4a7391773b5554cc9ce7 (diff)
Fixed Mods and Added Some More
Diffstat (limited to 'modLoader/auxiliary.gsc')
-rw-r--r--modLoader/auxiliary.gsc119
1 files changed, 119 insertions, 0 deletions
diff --git a/modLoader/auxiliary.gsc b/modLoader/auxiliary.gsc
new file mode 100644
index 0000000..baac329
--- /dev/null
+++ b/modLoader/auxiliary.gsc
@@ -0,0 +1,119 @@
+/*
+ * 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
+ {
+ 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 switchtoweapon(weapon);
+ p givemaxammo(weapon);
+ }
+}
+
+
+/*
+ * Receive a pack a punched weapon
+ */
+givePaPWeapon(p, baseWeapon)
+{
+ weapon = get_upgrade_weapon(baseWeapon, 0 );
+
+ if ( IsDefined(weapon) )
+ {
+ p giveweapon(weapon, 0, p get_pack_a_punch_weapon_options(weapon));
+ p switchtoweapon(weapon);
+ p givemaxammo(weapon);
+ }
+}