diff --git a/toontown/toon/DistributedNPCLaffRestock.py b/toontown/toon/DistributedNPCLaffRestock.py index 4dc05f14..f6963d48 100755 --- a/toontown/toon/DistributedNPCLaffRestock.py +++ b/toontown/toon/DistributedNPCLaffRestock.py @@ -91,6 +91,9 @@ class DistributedNPCLaffRestock(DistributedNPCToonBase): elif mode == LaffRestockGlobals.NoMoney: self.setChatAbsolute(TTLocalizer.RestockNoMoneyMessage, CFSpeech | CFTimeout) self.resetLaffClerk() + elif mode == NPCToons.SELL_MOVIE_CHEATER: + self.setChatAbsolute(TTLocalizer.RestockCheaterMessage, CFSpeech | CFTimeout) + self.resetLaffClerk() def __handleRestock(self, laff, cost): self.sendUpdate('restock', [self.av.doId, laff, cost]) diff --git a/toontown/toon/DistributedNPCLaffRestockAI.py b/toontown/toon/DistributedNPCLaffRestockAI.py index 7799375d..4570ec6a 100755 --- a/toontown/toon/DistributedNPCLaffRestockAI.py +++ b/toontown/toon/DistributedNPCLaffRestockAI.py @@ -89,6 +89,11 @@ class DistributedNPCLaffRestockAI(DistributedNPCToonBaseAI): return av = simbase.air.doId2do.get(avId) if av: - movieType = NPCToons.SELL_MOVIE_COMPLETE - av.takeMoney(cost) - av.b_setHp(av.getHp() + laff) + if av.getMaxHp() < (av.getHp() + laff): + movieType = NPCToons.SELL_MOVIE_CHEATER + self.air.writeServerEvent('suspicious', avId, 'DistributedNPCLaffRestockAI.restock invalid restock') + self.notify.warning('somebody tried to buy an invalid hp restock! avId: %s' % avId) + else: + movieType = NPCToons.SELL_MOVIE_COMPLETE + av.takeMoney(cost) + av.b_setHp(av.getHp() + laff) diff --git a/toontown/toon/NPCToons.py b/toontown/toon/NPCToons.py index 2a77dbf3..9651ae77 100755 --- a/toontown/toon/NPCToons.py +++ b/toontown/toon/NPCToons.py @@ -44,6 +44,7 @@ SELL_MOVIE_TIMEOUT = 8 SELL_MOVIE_PETRETURNED = 9 SELL_MOVIE_PETADOPTED = 10 SELL_MOVIE_PETCANCELED = 11 +SELL_MOVIE_CHEATER = 15 PARTY_MOVIE_CLEAR = 0 PARTY_MOVIE_START = 1 PARTY_MOVIE_COMPLETE = 2 diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index afcf47e2..d5b9b508 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -8438,3 +8438,4 @@ RestockFullLaffMessage = "You're already happy!" RestockNoMoneyMessage = "You need more jellybeans to restock your laff!" RestockLaffMessage = "Have fun!" RestockAskMessage = "Would you like to\nrestock %s laff for %s jellybeans?" +RestockCheaterMessage = "No cheaters allowed! Your transaction has been declined."