diff --git a/toontown/spellbook/MagicWordIndex.py b/toontown/spellbook/MagicWordIndex.py index 39eddcb..a2b7a5f 100644 --- a/toontown/spellbook/MagicWordIndex.py +++ b/toontown/spellbook/MagicWordIndex.py @@ -286,7 +286,42 @@ class MaxToon(MagicWord): toon.b_setCogLevels([ToontownGlobals.MaxCogSuitLevel] * 4) return f"Successfully maxed {toon.getName()}!" + +class Inventory(MagicWord): + # by default restock the inventory + aliases = ['gags', 'inv'] + desc = 'This allows you to modify your inventory in various ways.' + execLocation = MagicWordConfig.EXEC_LOC_SERVER + arguments = [("command", str, False, ''), ("track", str, False, ""), ("level", int, False, 0), ("amount", int, False, 0)] + def handleWord(self, invoker, avId, toon, *args): + command = args[0] + # the list of words that can be used to restock the inventory + restockInvWords = ['restock', 'max', 'all', '', 'fill'] + # the list of words that can be used to empty the inventory + emptyInvWords = ['empty', 'zero', 'null', 'clear', 'none', 'reset'] + if command in restockInvWords: + toon.inventory.maxOutInv() + toon.d_setInventory(toon.inventory.makeNetString()) + return ("Maxing out inventory for " + toon.getName() + ".") + if command in emptyInvWords: + toon.inventory.zeroInv() + toon.d_setInventory(toon.inventory.makeNetString()) + return ("Zeroing inventory for " + toon.getName() + ".") + + +class SetPinkSlips(MagicWord): + # this command gives the target toon the specified amount of pink slips + # default is 255 + aliases = ["pinkslips", "fires", 'setfires'] + desc = "Gives the target toon the specified amount of pink slips." + execLocation = MagicWordConfig.EXEC_LOC_SERVER + arguments = [("amount", int, False, 255)] + + def handleWord(self, invoker, avId, toon, *args): + toon.b_setPinkSlips(args[0]) + return f"Gave {toon.getName()} {args[0]} pink slips!" + class AbortMinigame(MagicWord): aliases = ["exitgame", "exitminigame", "quitgame", "quitminigame", "skipgame", "skipminigame"] desc = "Aborts an ongoing minigame."