mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-21 11:03:00 -04:00
Merge pull request #531 from ProjectSWGCore/Wave_Missions
Delivery Missions
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user