def handleFirstScreen(core, actor, npc, selection): convSvc = core.conversationService if selection == 0: prose = ProsePackage('conversation/clone_droid', 's_10') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/clone_droid', 's_12') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) option1 = ConversationOption(outOfBand2, 0) options = Vector() options.add(option1) convSvc.sendConversationOptions(actor, npc, options, handleSecondScreen) return if selection == 1: core.buffService.removeBuffFromCreature( actor, actor.getBuffByName("cloning_sickness")) core.conversationService.sendStopConversation( actor, npc, 'conversation/clone_droid', 's_14') return return
def startConversation(core, actor, npc): global coreRef coreRef = core convSvc = core.conversationService if actor.getBuffByName('cloning_sickness'): prose = ProsePackage('conversation/clone_droid', 's_6') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/clone_droid', 's_8') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/clone_droid', 's_12') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen) return else: core.conversationService.sendStopConversation( actor, npc, 'conversation/clone_droid', 's_4') return return
def lootKitScreen4(core, actor, npc): convSvc = core.conversationService prose = ProsePackage('conversation/junk_dealer_generic', 's_4d65752') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/junk_dealer_generic', 's_d347bee3') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/junk_dealer_generic', 's_b60b73f8') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 0) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleLootScreenSelection5) return
def handleLootScreenSelection6(core, actor, npc, selection): convSvc = core.conversationService prose = ProsePackage('conversation/junk_dealer_generic', 's_14efaaa2') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) if selection == 0: template = 'object/tangible/loot/collectible/kits/shared_orange_rug_kit.iff' addLootKit(core, actor, npc,template) if selection == 1: template = 'object/tangible/loot/collectible/kits/shared_blue_rug_kit.iff' addLootKit(core, actor, npc,template) if selection == 2: template = 'object/tangible/loot/collectible/kits/shared_gong_kit.iff' addLootKit(core, actor, npc,template) if selection == 3: template = 'object/tangible/loot/collectible/kits/shared_light_table_kit.iff' addLootKit(core, actor, npc,template) if selection == 4: template = 'object/tangible/loot/collectible/kits/shared_sculpture_kit.iff' addLootKit(core, actor, npc,template) return
def startConversation(core, actor, npc): convSvc = core.conversationService convSvc.sendConversationMessage( actor, npc, OutOfBand(ProsePackage('conversation/respecseller:s_31'))) options = Vector() options.add( ConversationOption( OutOfBand(ProsePackage('conversation/respecseller:s_32')), 0)) options.add( ConversationOption( OutOfBand(ProsePackage('conversation/respecseller:s_33')), 1)) convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen) return
def startConversation(core, actor, npc): convSvc = core.conversationService probotRequester = core.objectService.getObject(long(npc.getAttachment('probotRequester'))) if probotRequester is None: core.objectService.destroyObject(npc) return if probotRequester.getObjectId() != actor.getObjectId(): prose = ProsePackage('conversation/bounty_probot', 's_6') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) return mission = core.objectService.getObject(long(npc.getAttachment('attachedMission'))) if mission is None: prose = ProsePackage('conversation/bounty_probot', 's_4') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, prose) return objective = mission.getObjective() if objective is None: prose = ProsePackage('conversation/bounty_probot', 's_4') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, prose) return prose = ProsePackage('conversation/bounty_probot', 's_5') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) options = Vector() optionProse = ProsePackage('conversation/bounty_probot', 's_8') optionOOB = OutOfBand() optionOOB.addProsePackage(optionProse) options.add(ConversationOption(optionOOB, 0)) convSvc.sendConversationOptions(actor, npc, options, handleBioTransmit) return
def lootKitScreen3(core, actor, npc): convSvc = core.conversationService prose = ProsePackage('conversation/junk_dealer_generic', 's_12fe83a6') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/junk_dealer_generic', 's_e1a103e5') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) option1 = ConversationOption(outOfBand2, 0) options = Vector() options.add(option1) convSvc.sendConversationOptions(actor, npc, options, handleLootScreenSelection4) return
def startConversation(core, actor, npc): #core.lootService.prepInv(actor) global coreRef global junkDealerRef global sellItemListRef sellItemListRef = core.lootService.getSellableInventoryItems(actor) coreRef = core junkDealerRef = npc convSvc = core.conversationService prose = ProsePackage('conversation/junk_dealer_generic', 's_bef51e38') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/junk_dealer_generic', 's_54fab04f') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/junk_dealer_generic', 's_48') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) prose4 = ProsePackage('conversation/junk_dealer_generic', 's_3aa18b2d') outOfBand4 = OutOfBand() outOfBand4.addProsePackage(prose4) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) option3 = ConversationOption(outOfBand4, 1) options = Vector() options.add(option1) options.add(option2) options.add(option3) if len(core.lootService.getBuyHistory(actor,npc))!= 0: prose5 = ProsePackage('conversation/junk_dealer_generic', 's_43') outOfBand5 = OutOfBand() outOfBand5.addProsePackage(prose5) option4 = ConversationOption(outOfBand5, 1) options.add(option4) convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen) return
def handleFirstScreen(core, actor, npc, selection): convSvc = core.conversationService if selection == 0: prose = ProsePackage('conversation/clone_droid', 's_10') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/clone_droid', 's_12') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) option1 = ConversationOption(outOfBand2, 0) options = Vector() options.add(option1) convSvc.sendConversationOptions(actor, npc, options, handleSecondScreen) return if selection == 1: if actor.getLevel() <= 10: cloningFee = 100 elif actor.getLevel() >= 11: cloningFee = (((actor.getLevel() + 17) * actor.getLevel())/2) elif actor.getLevel() == 90: cloningFee = 5000 if actor.getCashCredits() >= cloningFee: core.buffService.removeBuffFromCreature(actor, actor.getBuffByName("cloning_sickness")); core.conversationService.sendStopConversation(actor, npc, 'conversation/clone_droid', 's_14') actor.setCashCredits(actor.getCashCredits() - int(cloningFee)) return elif actor.getCashCredits() <= cloningFee: core.conversationService.sendStopConversation(actor, npc, 'conversation/clone_droid', 's_16') return return
def handleFirstScreen(core, actor, npc, selection): convSvc = core.conversationService # TODO: check for prices if selection == 0: # respec convSvc.sendConversationMessage( actor, npc, OutOfBand(ProsePackage('conversation/respecseller:s_58'))) options = Vector() options.add( ConversationOption( OutOfBand(ProsePackage('conversation/respecseller:s_60')), 0)) options.add( ConversationOption( OutOfBand(ProsePackage('conversation/respecseller:s_64')), 1)) convSvc.sendConversationOptions(actor, npc, options, handleRespecScreen) if selection == 1: # expertise reset convSvc.sendConversationMessage( actor, npc, OutOfBand(ProsePackage('conversation/respecseller:s_35'))) options = Vector() options.add( ConversationOption( OutOfBand(ProsePackage('conversation/respecseller:s_71')), 0)) options.add( ConversationOption( OutOfBand(ProsePackage('conversation/respecseller:s_72')), 1)) convSvc.sendConversationOptions(actor, npc, options, handleResetScreen) return
def startConversation(core, actor, npc): global coreRef coreRef = core convSvc = core.conversationService if actor.getBuffByName('cloning_sickness'): level = int(actor.getLevel()) if level <= 10: cloningFee = 100 elif level >= 11: cloningFee = (((actor.getLevel() + 17) * actor.getLevel())/2) elif level == 90: cloningFee = 5000 convSvc.sendConversationMessage(actor, npc, OutOfBand.ProsePackage("@conversation/clone_droid:s_6", int(cloningFee))) prose1 = ProsePackage('conversation/clone_droid', 's_8') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose1) prose2 = ProsePackage('conversation/clone_droid', 's_12') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose2) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen) return else: core.conversationService.sendStopConversation(actor, npc, 'conversation/clone_droid', 's_14') return return
def lootKitScreen5a(core, actor, npc): convSvc = core.conversationService prose = ProsePackage('conversation/junk_dealer_generic', 's_3fc7eb45') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/junk_dealer_generic', 's_ee977dee') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/junk_dealer_generic', 's_8f39769') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) prose4 = ProsePackage('conversation/junk_dealer_generic', 's_fe657cdd') outOfBand4 = OutOfBand() outOfBand4.addProsePackage(prose4) prose5 = ProsePackage('conversation/junk_dealer_generic', 's_9ede4b84') outOfBand5 = OutOfBand() outOfBand5.addProsePackage(prose5) prose6 = ProsePackage('conversation/junk_dealer_generic', 's_87c5851b') outOfBand6 = OutOfBand() outOfBand6.addProsePackage(prose6) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 0) option3 = ConversationOption(outOfBand4, 0) option4 = ConversationOption(outOfBand5, 0) option5 = ConversationOption(outOfBand6, 0) options = Vector() options.add(option1) options.add(option2) options.add(option3) options.add(option4) options.add(option5) convSvc.sendConversationOptions(actor, npc, options, handleLootScreenSelection6) return
def buyBackWindowCallBack(owner, window, eventType, returnList): convSvc = coreRef.conversationService if returnList.get(0) == 0: startConversation(coreRef,owner,junkDealerRef) return #buy if eventType == 0: index = int(returnList.get(0)) buyHistory = coreRef.lootService.getBuyHistory(owner,junkDealerRef) if len(buyHistory) == 0: owner.sendSystemMessage('@loot_dealer:no_buy_back_items_found', 1) startConversation(coreRef,owner,junkDealerRef) return buyBackItem = buyHistory.get(index) if buyBackItem == None: owner.sendSystemMessage('@loot_dealer:no_buy_back_items_found', 0) startConversation(coreRef,owner,junkDealerRef) return if owner.getInventoryItemCount() >= 80: prose = ProsePackage('conversation/junk_dealer_generic', 's_47') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(owner, junkDealerRef, outOfBand) return junkDealerPrice = buyBackItem.getJunkDealerPrice() if junkDealerPrice == 0: junkDealerPrice = 20 owner.setCashCredits(owner.getCashCredits()+junkDealerPrice) if owner.getCashCredits()>=junkDealerPrice: owner.setCashCredits(owner.getCashCredits()-junkDealerPrice) inventory = owner.getSlottedObject('inventory') inventory.add(buyBackItem) owner.sendSystemMessage('You buy back ' + buyBackItem.getCustomName() + ' for %s' % junkDealerPrice + ' credits.', 0) # remove from junk dealer history coreRef.lootService.removeBoughtBackItemFromHistory(owner,junkDealerRef,buyBackItem) else: owner.sendSystemMessage('@loot_dealer:prose_no_buy_back', 0) coreRef.suiService.closeSUIWindow(owner,window.getWindowId()); handleFirstScreen(coreRef, owner, junkDealerRef, 3) return #cancel if eventType == 1: owner.sendSystemMessage('Cancel', 0) sellItem = returnList.get(0) startConversation(coreRef,owner,junkDealerRef) return #examine if eventType == 2: owner.sendSystemMessage('Ex', 0) sellItem = returnList.get(0) startConversation(coreRef,owner,junkDealerRef) owner.sendSystemMessage('Examine', 0) return
def handleSecondScreen(core, actor, npc, selection): convSvc = core.conversationService if actor.getFaction() != 'rebel' and actor.getFaction() != 'imperial': if selection == 0: actor.setFaction('imperial') actor.setFactionStatus(FactionStatus.OnLeave) prose = ProsePackage('conversation/faction_recruiter_imperial', 's_116') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_438') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) option1 = ConversationOption(outOfBand2, 0) options = Vector() options.add(option1) core.conversationService.sendStopConversation( actor, npc, 'conversation/faction_recruiter_imperial', 's_100') return if selection == 1: core.conversationService.sendStopConversation( actor, npc, 'conversation/faction_recruiter_imperial', 's_442') return return elif actor.getFaction() == 'imperial' and actor.getFactionStatus( ) == FactionStatus.OnLeave: if selection == 0: actor.setFactionStatus(FactionStatus.Combatant) core.conversationService.sendStopConversation( actor, npc, 'conversation/faction_recruiter_imperial', 's_300') return if selection == 1: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_64') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_66') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_302') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleFourthScreen) return if selection == 2: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_90') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_92') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_96') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleThirdScreen) return if selection == 3: core.conversationService.sendStopConversation( actor, npc, 'conversation/faction_recruiter_imperial', 's_95') return return elif actor.getFaction() == 'imperial' and actor.getFactionStatus( ) == FactionStatus.Combatant: if selection == 0: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_76') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_79') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_70') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleFithScreen) return if selection == 1: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_64') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_66') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_302') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleFourthScreen) return if selection == 2: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_90') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_92') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_96') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleThirdScreen) return if selection == 3: return return elif actor.getFaction() == 'imperial' and actor.getFactionStatus( ) == FactionStatus.SpecialForces: if selection == 0: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_76') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_79') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_70') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleFithScreen) return if selection == 1: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_54') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_56') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_84') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleSixthScreen) return if selection == 2: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_90') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_92') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_96') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleThirdScreen) return if selection == 3: return return
def handleFirstScreen(core, actor, npc, selection): convSvc = core.conversationService if actor.getFaction() != 'rebel' and actor.getFaction() != 'imperial': if selection == 0: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_432') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_434') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_440') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleSecondScreen) return if selection == 1: return if selection == 2: core.conversationService.sendStopConversation( actor, npc, 'conversation/faction_recruiter_imperial', 's_442') return return elif actor.getFaction() == 'imperial' and actor.getFactionStatus( ) == FactionStatus.OnLeave: if selection == 0: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_50') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_97') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_93') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) prose4 = ProsePackage('conversation/faction_recruiter_imperial', 's_88') outOfBand4 = OutOfBand() outOfBand4.addProsePackage(prose4) prose5 = ProsePackage('conversation/faction_recruiter_imperial', 's_55') outOfBand5 = OutOfBand() outOfBand5.addProsePackage(prose5) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) option3 = ConversationOption(outOfBand4, 1) option4 = ConversationOption(outOfBand5, 1) options = Vector() options.add(option1) options.add(option2) options.add(option3) options.add(option4) convSvc.sendConversationOptions(actor, npc, options, handleSecondScreen) return if selection == 1: percent = core.guildService.getGuildObject( ).getCurrentServerGCWTotalPercentMap().get( actor.getPlanet().getName()).getPercent().intValue() convSvc.sendConversationMessage( actor, npc, OutOfBand.ProsePackage( "@conversation/faction_recruiter_imperial:s_412", percent, "TO", str(100 - percent))) return if selection == 2: return return elif actor.getFaction() == 'imperial' and actor.getFactionStatus( ) == FactionStatus.Combatant: if selection == 0: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_50') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_74') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_93') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) prose4 = ProsePackage('conversation/faction_recruiter_imperial', 's_88') outOfBand4 = OutOfBand() outOfBand4.addProsePackage(prose4) prose5 = ProsePackage('conversation/faction_recruiter_imperial', 's_55') outOfBand5 = OutOfBand() outOfBand5.addProsePackage(prose5) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) option3 = ConversationOption(outOfBand4, 1) option4 = ConversationOption(outOfBand5, 1) options = Vector() options.add(option1) options.add(option2) options.add(option3) options.add(option4) convSvc.sendConversationOptions(actor, npc, options, handleSecondScreen) return if selection == 1: percent = core.guildService.getGuildObject( ).getCurrentServerGCWTotalPercentMap().get( actor.getPlanet().getName()).getPercent().intValue() convSvc.sendConversationMessage( actor, npc, OutOfBand.ProsePackage( "@conversation/faction_recruiter_imperial:s_412", percent, "TO", str(100 - percent))) return if selection == 2: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_90') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_92') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_96') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleSecondScreen) return return elif actor.getFaction() == 'imperial' and actor.getFactionStatus( ) == FactionStatus.SpecialForces: if selection == 0: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_50') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_74') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_97') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) prose4 = ProsePackage('conversation/faction_recruiter_imperial', 's_88') outOfBand4 = OutOfBand() outOfBand4.addProsePackage(prose4) prose5 = ProsePackage('conversation/faction_recruiter_imperial', 's_55') outOfBand5 = OutOfBand() outOfBand5.addProsePackage(prose5) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) option3 = ConversationOption(outOfBand4, 1) option4 = ConversationOption(outOfBand5, 1) options = Vector() options.add(option1) options.add(option2) options.add(option3) options.add(option4) convSvc.sendConversationOptions(actor, npc, options, handleSecondScreen) return if selection == 1: percent = core.guildService.getGuildObject( ).getCurrentServerGCWTotalPercentMap().get( actor.getPlanet().getName()).getPercent().intValue() convSvc.sendConversationMessage( actor, npc, OutOfBand.ProsePackage( "@conversation/faction_recruiter_imperial:s_412", percent, "TO", str(100 - percent))) return if selection == 2: return return
def handleFirstScreen(core, actor, npc, selection): convSvc = core.conversationService if selection == 0: # sell items prose = ProsePackage('conversation/junk_dealer_generic', 's_84a67771') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) sellItemListRef = core.lootService.getSellableInventoryItems(actor) if len(sellItemListRef) == 0: actor.sendSystemMessage('@loot_dealer:no_items', 1) startConversation(coreRef,actor,junkDealerRef) return # no point window = core.suiService.createSUIWindow('Script.listBox', actor, npc, 0) window.setProperty('bg.caption.lblTitle:Text', '@loot_dealer:sell_title') window.setProperty('Prompt.lblPrompt:Text', '@loot_dealer:sell_prompt') for item in sellItemListRef: window.addListBoxMenuItem(item.getCustomName(), 0); window.setProperty('btnOther:visible', 'True') window.setProperty('btnCancel:visible', 'True') window.setProperty('btnOk:visible', 'True') window.setProperty('btnOther:Text', '@loot_dealer:examine') window.setProperty('btnCancel:Text', '@cancel') window.setProperty('btnOk:Text', '@loot_dealer:btn_sell') returnList = Vector() returnList.add('List.lstList:SelectedRow') window.addHandler(0, '', Trigger.TRIGGER_OK, returnList, sellWindowCallBack) window.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnList, sellWindowCallBack) window.addHandler(2, '', Trigger.TRIGGER_UPDATE, returnList, sellWindowCallBack) core.suiService.openSUIWindow(window); return if selection == 1: # mark items window = core.suiService.createSUIWindow('Script.listBox', actor, npc, 0) window.setProperty('bg.caption.lblTitle:Text', '@loot_dealer:junk_no_sell_title') window.setProperty('Prompt.lblPrompt:Text', '@loot_dealer:junk_no_sell_desc') sellItemListRef = core.lootService.getSellableInventoryItems(actor) for item in sellItemListRef: nameString = item.getCustomName() nameString = 'TestJunkItem' if item.isNoSell(): nameString = '[*No Sell*]' + item.getCustomName() window.addListBoxMenuItem(nameString, 0) else: nameString = '[Sellable]' + item.getCustomName() window.addListBoxMenuItem(nameString, 0) window.setProperty('btnOther:visible', 'True') window.setProperty('btnCancel:visible', 'True') window.setProperty('btnOk:visible', 'True') window.setProperty('btnOther:Text', '@loot_dealer:examine') window.setProperty('btnCancel:Text', '@cancel') window.setProperty('btnOk:Text', '@loot_dealer:junk_no_sell_button') returnList = Vector() returnList.add('List.lstList:SelectedRow') #window.addHandler(0, '', Trigger.TRIGGER_OK, returnList, noSellWindowCallBack) #window.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnList, noSellWindowCallBack) window.addHandler(0, '',9, returnList, noSellWindowCallBack) window.addHandler(1, '',10, returnList, noSellWindowCallBack) window.addHandler(2, '',11, returnList, noSellWindowCallBack) core.suiService.openSUIWindow(window); return if selection == 2: lootKitScreen1(core, actor, npc) if selection == 3: # buy back buyHistory = coreRef.lootService.getBuyHistory(actor,npc) if len(buyHistory) == 0: actor.sendSystemMessage('@loot_dealer:no_buy_back_items_found', 1) startConversation(coreRef,actor,npc) return prose = ProsePackage('conversation/junk_dealer_generic', 's_44') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) window = core.suiService.createSUIWindow('Script.listBox', actor, npc, 0) window.setProperty('bg.caption.lblTitle:Text', '@loot_dealer:buy_back_title') window.setProperty('Prompt.lblPrompt:Text', '@loot_dealer:buy_back_prompt') buyHistory = core.lootService.getBuyHistory(actor,junkDealerRef) if buyHistory==None: return for item in buyHistory: junkDealerPrice = item.getJunkDealerPrice() if junkDealerPrice == 0: junkDealerPrice = 20 nameString = '[%s' % junkDealerPrice + ']' + item.getCustomName() #% window.addListBoxMenuItem(nameString, 0) window.setProperty('btnOther:visible', 'True') window.setProperty('btnCancel:visible', 'True') window.setProperty('btnOk:visible', 'True') window.setProperty('btnOther:Text', '@loot_dealer:examine') window.setProperty('btnCancel:Text', '@cancel') window.setProperty('btnOk:Text', '@loot_dealer:btn_buy_back') returnList = Vector() returnList.add('List.lstList:SelectedRow') window.addHandler(0, '', Trigger.TRIGGER_OK, returnList, buyBackWindowCallBack) window.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnList, buyBackWindowCallBack) window.addHandler(2, '', Trigger.TRIGGER_UPDATE, returnList, buyBackWindowCallBack) core.suiService.openSUIWindow(window); return
def startConversation(core, actor, npc): global coreRef global impRecruiterRef coreRef = core impRecruiterRef = npc convSvc = core.conversationService faction = actor.getFaction() factionStatus = actor.getFactionStatus() if actor.getPvpStatus(PvpStatus.GoingOvert) or actor.getPvpStatus( PvpStatus.GoingCovert): core.conversationService.sendStopConversation( actor, npc, 'conversation/faction_recruiter_imperial', 's_444') return elif actor.getFaction() != 'rebel' and actor.getFaction() != 'imperial': prose = ProsePackage('conversation/faction_recruiter_imperial', 's_414') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_428') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_85') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) options = Vector() options.add(option1) options.add(option2) convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen) return elif actor.getFaction() == 'imperial' and actor.getFactionStatus( ) == FactionStatus.OnLeave: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_80') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_49') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose3 = ProsePackage('conversation/faction_recruiter_imperial', 's_410') outOfBand3 = OutOfBand() outOfBand3.addProsePackage(prose3) prose4 = ProsePackage('conversation/faction_recruiter_imperial', 's_324') outOfBand4 = OutOfBand() outOfBand4.addProsePackage(prose4) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand3, 1) option3 = ConversationOption(outOfBand4, 1) options = Vector() options.add(option1) options.add(option2) options.add(option3) convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen) return elif actor.getFaction() == 'imperial' and actor.getFactionStatus( ) == FactionStatus.Combatant: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_310') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_49') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose4 = ProsePackage('conversation/faction_recruiter_imperial', 's_410') outOfBand4 = OutOfBand() outOfBand4.addProsePackage(prose4) prose5 = ProsePackage('conversation/faction_recruiter_imperial', 's_324') outOfBand5 = OutOfBand() outOfBand5.addProsePackage(prose5) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand4, 1) option4 = ConversationOption(outOfBand5, 1) options = Vector() options.add(option1) options.add(option2) options.add(option4) convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen) return elif actor.getFactionStatus() == FactionStatus.SpecialForces: prose = ProsePackage('conversation/faction_recruiter_imperial', 's_310') outOfBand = OutOfBand() outOfBand.addProsePackage(prose) convSvc.sendConversationMessage(actor, npc, outOfBand) prose2 = ProsePackage('conversation/faction_recruiter_imperial', 's_49') outOfBand2 = OutOfBand() outOfBand2.addProsePackage(prose2) prose4 = ProsePackage('conversation/faction_recruiter_imperial', 's_410') outOfBand4 = OutOfBand() outOfBand4.addProsePackage(prose4) prose5 = ProsePackage('conversation/faction_recruiter_imperial', 's_324') outOfBand5 = OutOfBand() outOfBand5.addProsePackage(prose5) option1 = ConversationOption(outOfBand2, 0) option2 = ConversationOption(outOfBand4, 1) option4 = ConversationOption(outOfBand5, 1) options = Vector() options.add(option1) options.add(option2) options.add(option4) convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen) return elif actor.getFaction() == 'rebel': npc.setCurrentAnimation('all_b_emt_backhand') core.conversationService.sendStopConversation( actor, npc, 'conversation/faction_recruiter_imperial', 's_308') return return