Poodletooth-iLand/toontown/toon/DistributedNPCClerkAI.py

15 lines
595 B
Python
Raw Normal View History

from DistributedNPCToonBaseAI import DistributedNPCToonBaseAI
2015-03-03 16:10:12 -06:00
class DistributedNPCClerkAI(DistributedNPCToonBaseAI):
def setInventory(self, inventory, money):
av = self.air.doId2do.get(self.air.getAvatarIdFromSender())
2015-03-03 16:10:12 -06:00
if not av:
2015-03-03 16:10:12 -06:00
return
av.b_setMoney(money if av.inventory.validatePurchase(av.inventory.makeFromNetString(inventory), av.getMoney(), money) else av.getMoney())
av.d_setInventory(av.inventory.makeNetString())
def setState(self, avId, state):
self.sendUpdate('setState', [self.air.getAvatarIdFromSender(), state])