Merge pull request #531 from ProjectSWGCore/Wave_Missions

Delivery Missions
This commit is contained in:
Waverunner
2014-04-25 17:29:42 -04:00
18 changed files with 1293 additions and 451 deletions
+70
View File
@@ -0,0 +1,70 @@
from resources.common import OutOfBand
from resources.common import ProsePackage
from resources.objectives import DeliveryMissionObjective
import sys
def startConversation(core, actor, npc):
missionId = npc.getAttachment('assignedMission')
if missionId is None:
return
mission = core.objectService.getObject(missionId)
if mission is None:
return
objective = mission.getObjective()
if mission.getGrandparent().getObjectId() != actor.getObjectId() or objective is None:
core.conversationService.sendStopConversation(actor, npc, 'mission/mission_generic', 'npc_job_request_no_job')
return
if objective.getObjectivePhase() == 0:
handlePickupStage(core, actor, npc, objective, mission)
return
elif objective.getObjectivePhase() == 1:
handleDeliveryStage(core, actor, npc, objective, mission)
return
elif objective.getObjectivePhase() == 2:
handleCompletionStage(core, actor, npc, objective, mission)
return
return
def endConversation(core, actor, npc):
core.conversationService.sendStopConversation(actor, npc, 'mission/mission_generic', 'npc_job_request_no_job')
return
def handlePickupStage(core, actor, npc, objective, mission):
if objective.getMissionGiver().getObjectId() != npc.getObjectId():
endConversation(core, actor, npc)
return
core.conversationService.sendStopConversation(actor, npc, mission.getMissionDescription(), 'm' + str(mission.getMissionId()) + 'p')
objective.createDeliveryItem()
objective.update()
return
def handleDeliveryStage(core, actor, npc, objective, mission):
if objective.getDropOffNpc().getObjectId() != npc.getObjectId():
endConversation(core, actor, npc)
return
core.conversationService.sendStopConversation(actor, npc, mission.getMissionDescription(), 'm' + str(mission.getMissionId()) + 'r')
core.objectService.destroyObject(objective.getDeliveryObject())
objective.update()
return
def handleCompletionStage(core, actor, npc, objective, mission):
if objective.getMissionGiver().getObjectId() != npc.getObjectId():
endConversation(core, actor, npc)
return
core.conversationService.sendStopConversation(actor, npc, mission.getMissionDescription(), 'm' + str(mission.getMissionId()) + 's')
objective.complete()
return
-1
View File
@@ -9,7 +9,6 @@ def createRadial(core, owner, target, radials):
def handleSelection(core, owner, target, option):
if option == 26 and target:
print 'test'
core.conversationService.handleStartConversation(owner, target)
return