From 5b7770abee7bef1586988035597962f1cd87f949 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 8 Jun 2015 20:40:47 +0300 Subject: [PATCH] DANIEL: ~quests add --- toontown/ai/QuestManagerAI.py | 8 +++++++- toontown/building/DistributedBuildingQueryMgrAI.py | 2 +- toontown/quest/QuestMap.py | 12 +++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/toontown/ai/QuestManagerAI.py b/toontown/ai/QuestManagerAI.py index e28044af..9c63ef0e 100755 --- a/toontown/ai/QuestManagerAI.py +++ b/toontown/ai/QuestManagerAI.py @@ -128,7 +128,7 @@ class QuestManagerAI: return # Get the npcIds - fromNpcId = npc.npcId + fromNpcId = npc.npcId if npc else 0 if toNpcId == 0: toNpcId = Quests.getQuestToNpcId(questId) @@ -136,6 +136,9 @@ class QuestManagerAI: transformedRewardId = Quests.transformReward(rewardId, av) av.addQuest([questId, fromNpcId, toNpcId, rewardId, 0], transformedRewardId) + if not npc: + return + # Remove the tasks for timeout. taskMgr.remove(npc.uniqueName('clearMovie')) @@ -540,6 +543,9 @@ def quests(command, arg0=0, arg1=0): if arg0: if canCarry: if arg0 in Quests.QuestDict.keys(): + quest = Quests.QuestDict[arg0] + + simbase.air.questManager.avatarChoseQuest(invoker.doId, None, arg0, quest[5], quest[4]) return 'Added QuestID %s'%(arg0) else: return 'Invalid QuestID %s'%(arg0) diff --git a/toontown/building/DistributedBuildingQueryMgrAI.py b/toontown/building/DistributedBuildingQueryMgrAI.py index b17b13ed..e4600407 100755 --- a/toontown/building/DistributedBuildingQueryMgrAI.py +++ b/toontown/building/DistributedBuildingQueryMgrAI.py @@ -14,4 +14,4 @@ class DistributedBuildingQueryMgrAI(DistributedObjectAI.DistributedObjectAI): building = self.buildings.get(zoneId) if building is None: return - self.sendUpdateToAvatarId(avId, 'response', [context, building.isSuitBlock()]) + self.sendUpdateToAvatarId(avId, 'response', [context, building.isSuitBlock()]) \ No newline at end of file diff --git a/toontown/quest/QuestMap.py b/toontown/quest/QuestMap.py index 70f63bbf..af999021 100755 --- a/toontown/quest/QuestMap.py +++ b/toontown/quest/QuestMap.py @@ -101,7 +101,7 @@ class QuestMap(DirectFrame): del self.mapCloseButton DirectFrame.destroy(self) - def putBuildingMarker(self, pos, hpr = (0, 0, 0), mapIndex = None): + def putBuildingMarker(self, pos, hpr = (0, 0, 0), mapIndex = None, zoneId=None): marker = DirectLabel(parent=self.container, text='', text_pos=(-0.05, -0.15), text_fg=(1, 1, 1, 1), relief=None) gui = loader.loadModel('phase_4/models/parties/schtickerbookHostingGUI') icon = gui.find('**/startPartyButton_inactive') @@ -120,7 +120,13 @@ class QuestMap(DirectFrame): self.buildingMarkers.append(marker) iconNP.removeNode() gui.removeNode() - return + + if zoneId: + base.cr.buildingQueryMgr.d_isSuit(zoneId, lambda isSuit: self.updateMarkerColor(marker, isSuit)) + + def updateMarkerColor(self, marker, isSuit): + if isSuit: + marker['image_color'] = (0.4, 0.4, 0.4, 1.0) def updateQuestInfo(self): for marker in self.buildingMarkers: @@ -163,7 +169,7 @@ class QuestMap(DirectFrame): self.putBuildingMarker( base.cr.playGame.dnaStore.getDoorPosHprFromBlockNumber(blockNumber).getPos(render), base.cr.playGame.dnaStore.getDoorPosHprFromBlockNumber(blockNumber).getHpr(render), - mapIndex=mapIndex) + mapIndex=mapIndex, zoneId=zoneId) def transformAvPos(self, pos): if self.cornerPosInfo is None: