DANIEL: ~quests add

This commit is contained in:
John 2015-06-08 20:40:47 +03:00 committed by Loudrob
parent 2fb28f6f09
commit 5b7770abee
3 changed files with 17 additions and 5 deletions

View file

@ -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)

View file

@ -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()])

View file

@ -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: