diff --git a/scripts/conversation/missions/deliver.py b/scripts/conversation/missions/deliver.py index f8ee5667..774e3e01 100644 --- a/scripts/conversation/missions/deliver.py +++ b/scripts/conversation/missions/deliver.py @@ -66,5 +66,5 @@ def handleCompletionStage(core, actor, npc, objective, mission): return core.conversationService.sendStopConversation(actor, npc, mission.getMissionDescription(), 'm' + str(mission.getMissionId()) + 's') - objective.complete(core, actor) + core.missionService.handleMissionComplete(actor, mission) return \ No newline at end of file diff --git a/src/resources/objectives/BountyMissionObjective.java b/src/resources/objectives/BountyMissionObjective.java index 672a8977..09a928f4 100644 --- a/src/resources/objectives/BountyMissionObjective.java +++ b/src/resources/objectives/BountyMissionObjective.java @@ -94,7 +94,7 @@ public class BountyMissionObjective extends MissionObjective { String message = "@mission/mission_bounty_informant:target_hard_" + Integer.toString(new Random().nextInt(4) + 1); CommPlayerMessage comm = new CommPlayerMessage(player.getObjectId(), new OutOfBand(new ProsePackage(message))); - comm.setTime(5000); + comm.setTime(2000); switch (bountyTarget.getFaction()) { case "neutral": comm.setModel("object/mobile/shared_dressed_assassin_mission_giver_0" + Integer.toString(new Random().nextInt(2) + 1) + ".iff"); diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index 8cc06788..d66ac23a 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -1306,6 +1306,13 @@ public class PlayerService implements INetworkDispatch { bounty = 1000000; } + if (core.getBountiesODB().contains(attacker.getObjectID())) { + if (((BountyListItem) core.getBountiesODB().get(attacker.getObjectID())).getCreditReward() >= 20000000) { + victim.sendSystemMessage("@bounty_hunter:max_bounty", DisplayType.Broadcast); + return; + } + } + // Try removing bounty amount from the bank first then cash. Remove amount accordingly if bank/cash is less than placed bounty. if (bounty > victim.getBankCredits()) { int difference = bounty - victim.getBankCredits(); @@ -1321,12 +1328,15 @@ public class PlayerService implements INetworkDispatch { if (!core.missionService.addToExistingBounty(attacker.getObjectId(), victim.getObjectId(), bounty)) core.missionService.createNewBounty(attacker, victim.getObjectId(), bounty); + + victim.sendSystemMessage("You have placed a bounty for " + bounty + " credits on the head of " + attacker.getCustomName(), (byte) 0); } } }); bountyWindow.setProperty("txtInput:NumericInteger", "true"); bountyWindow.setProperty("txtInput:MaxLength", "7"); + bountyWindow.setProperty("inputBox:Size", "306,306"); core.suiService.openSUIWindow(bountyWindow); } diff --git a/src/services/combat/CombatService.java b/src/services/combat/CombatService.java index 4276db3f..fc61e166 100644 --- a/src/services/combat/CombatService.java +++ b/src/services/combat/CombatService.java @@ -1012,12 +1012,12 @@ public class CombatService implements INetworkDispatch { targetProse.setDiInteger(mission.getCreditReward()); target.sendSystemMessage(new OutOfBand(targetProse), (byte) 0); - ProsePackage attackerProse = new ProsePackage("bounty_hunter", "bounty_success_hunter", attacker.getCustomName()); + ProsePackage attackerProse = new ProsePackage("bounty_hunter", "bounty_success_hunter", target.getCustomName()); attackerProse.setToCustomString("their"); // should be his or her: http://youtu.be/BqeDQQSETJI?t=2m19s attackerProse.setDiInteger(mission.getCreditReward()); attacker.sendSystemMessage(new OutOfBand(attackerProse), (byte) 0); - core.missionService.handleMissionAbort(target, mission); + core.missionService.handleMissionComplete(attacker, mission); } } diff --git a/src/services/mission/MissionService.java b/src/services/mission/MissionService.java index bf1f2ea4..9448401c 100644 --- a/src/services/mission/MissionService.java +++ b/src/services/mission/MissionService.java @@ -320,6 +320,15 @@ public class MissionService implements INetworkDispatch { }); } + public void handleMissionComplete(CreatureObject creature, MissionObject mission) { + MissionObjective objective = mission.getObjective(); + + if (objective == null) + return; + + objective.complete(core, creature); + } + private boolean handleMissionAccept(CreatureObject creature, MissionObject mission) { SWGObject missionBag = creature.getSlottedObject("mission_bag"); @@ -432,11 +441,14 @@ public class MissionService implements INetworkDispatch { if (bountyList.size() > 0) { boolean gotBounty = false; - while (!gotBounty) { + int attempts = 0; + while (!gotBounty && attempts < 5) { bountyTarget = getRandomBounty(); - if (bountyTarget == null || bountyTarget.getAssignedHunters().size() >= 3 || bountyTarget.getCreditReward() < 20000) + if (bountyTarget == null || bountyTarget.getAssignedHunters().size() >= 3 || bountyTarget.getCreditReward() < 20000 || bountyTarget.getObjectId() == player.getObjectId()) { + attempts++; continue; + } else gotBounty = true; }