mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-10 00:13:05 -04:00
Merge branch 'master' of https://github.com/ProjectSWGCore/NGECore2
This commit is contained in:
@@ -79,7 +79,7 @@ public class BountyMissionObjective extends MissionObjective {
|
||||
if (isActivated())
|
||||
return;
|
||||
|
||||
BountyListItem bountyTarget = core.missionService.getBountyListItem(getMissionObject().getBountyObjId());
|
||||
BountyListItem bountyTarget = core.missionService.getBountyListItem(getMissionObject().getBountyMarkId());
|
||||
|
||||
if (bountyTarget == null) {
|
||||
core.missionService.handleMissionAbort(player, getMissionObject());
|
||||
@@ -87,7 +87,7 @@ public class BountyMissionObjective extends MissionObjective {
|
||||
return;
|
||||
}
|
||||
|
||||
bountyTarget.addBountyHunter(player.getObjectId());
|
||||
bountyTarget.addBountyHunter(player.getObjectID());
|
||||
|
||||
setMarkObjId(bountyTarget.getObjectID());
|
||||
|
||||
@@ -111,11 +111,7 @@ public class BountyMissionObjective extends MissionObjective {
|
||||
|
||||
player.getPlayerObject().setBountyMissionId(getMissionObject().getObjectId());
|
||||
|
||||
/*CreatureObject target = (CreatureObject) core.objectService.getObject(markObjId);
|
||||
if (target != null && target.getPlanetId() == player.getPlanetId()) {
|
||||
UpdatePVPStatusMessage upvpm = new UpdatePVPStatusMessage(player.getObjectID(), core.factionService.calculatePvpStatus(player, target), player.getFaction());
|
||||
player.getClient().getSession().write(upvpm.serialize());
|
||||
}*/
|
||||
player.updatePvpStatus();
|
||||
}
|
||||
|
||||
|
||||
@@ -133,12 +129,15 @@ public class BountyMissionObjective extends MissionObjective {
|
||||
else
|
||||
player.addBankCredits(bounty.getCreditReward());
|
||||
|
||||
bounty.removeBountyHunter(player.getObjectId());
|
||||
|
||||
notifyBountyPlacers(core, player, bounty);
|
||||
|
||||
clearActiveMissions(core, bounty);
|
||||
|
||||
core.missionService.removeBounty(markObjId);
|
||||
player.getPlayerObject().setBountyMissionId(0);
|
||||
player.updatePvpStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -152,6 +151,7 @@ public class BountyMissionObjective extends MissionObjective {
|
||||
|
||||
bounty.removeBountyHunter(player.getObjectId());
|
||||
player.getPlayerObject().setBountyMissionId(0);
|
||||
player.updatePvpStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -184,6 +184,7 @@ public class BountyMissionObjective extends MissionObjective {
|
||||
|
||||
public void clearActiveMissions(NGECore core, BountyListItem bounty) {
|
||||
bounty.getAssignedHunters().forEach(id -> {
|
||||
|
||||
CreatureObject hunter = (CreatureObject) core.objectService.getObject(id);
|
||||
|
||||
if (hunter != null) {
|
||||
@@ -204,7 +205,7 @@ public class BountyMissionObjective extends MissionObjective {
|
||||
}
|
||||
|
||||
public void checkBountyActiveStatus(NGECore core) {
|
||||
BountyListItem bountyTarget = core.missionService.getBountyListItem(getMissionObject().getBountyObjId());
|
||||
BountyListItem bountyTarget = core.missionService.getBountyListItem(getMissionObject().getBountyMarkId());
|
||||
CreatureObject player = (CreatureObject) getMissionObject().getGrandparent();
|
||||
|
||||
if (bountyTarget == null || !bountyTarget.getAssignedHunters().contains(player.getObjectId())) {
|
||||
|
||||
@@ -303,11 +303,11 @@ public class MissionObject extends IntangibleObject implements Serializable {
|
||||
this.missionId = missionId;
|
||||
}
|
||||
|
||||
public long getBountyObjId() {
|
||||
public long getBountyMarkId() {
|
||||
return bountyObjId;
|
||||
}
|
||||
|
||||
public void setBountyObjId(long bountyObjId) {
|
||||
public void setBountyMarkId(long bountyObjId) {
|
||||
this.bountyObjId = bountyObjId;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ import resources.buffs.DamageOverTime;
|
||||
import resources.common.FileUtilities;
|
||||
import resources.common.OutOfBand;
|
||||
import resources.common.ProsePackage;
|
||||
import resources.datatables.DisplayType;
|
||||
import resources.datatables.Options;
|
||||
import resources.datatables.Elemental;
|
||||
import resources.datatables.Posture;
|
||||
@@ -509,7 +510,27 @@ public class CombatService implements INetworkDispatch {
|
||||
}
|
||||
|
||||
private boolean attemptCombat(CreatureObject attacker, TangibleObject target) {
|
||||
|
||||
|
||||
if (attacker.isInStealth()) {
|
||||
attacker.setInStealth(false);
|
||||
|
||||
if (attacker.getPlayerObject() != null && attacker.getPlayerObject().getProfession().equals("spy_1a")) {
|
||||
attacker.setRadarVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (attacker.getSlottedObject("ghost") != null) {
|
||||
PlayerObject ghost = attacker.getPlayerObject();
|
||||
if (ghost.getBountyMissionId() != 0) {
|
||||
MissionObject mission = (MissionObject) core.objectService.getObject(ghost.getBountyMissionId());
|
||||
if (mission != null && mission.getBountyMarkId() == target.getObjectID()) {
|
||||
target.addDefender(attacker);
|
||||
|
||||
target.updatePvpStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(target.getDefendersList().contains(attacker) && attacker.getDefendersList().contains(target))
|
||||
return true;
|
||||
|
||||
@@ -529,7 +550,7 @@ public class CombatService implements INetworkDispatch {
|
||||
} else {
|
||||
attacker.addDefender(target); // See below comment
|
||||
}
|
||||
|
||||
|
||||
//attacker.addDefender(target); // Why do we need to add target to defender list twice?
|
||||
|
||||
return true;
|
||||
@@ -987,40 +1008,48 @@ public class CombatService implements INetworkDispatch {
|
||||
}
|
||||
|
||||
public void deathblowPlayer(CreatureObject attacker, CreatureObject target) {
|
||||
|
||||
target.stopIncapTask();
|
||||
target.setIncapTask(null);
|
||||
target.setPosture((byte) 14);
|
||||
|
||||
if (target.getSlottedObject("ghost") != null && attacker.getSlottedObject("ghost") != null) {
|
||||
boolean bountyWindow = true;
|
||||
if (target.getPlayerObject().getBountyMissionId() != 0) {
|
||||
MissionObject mission = (MissionObject) core.objectService.getObject(target.getPlayerObject().getBountyMissionId());
|
||||
if (mission != null && mission.getBountyObjId() == attacker.getObjectId()) {
|
||||
bountyWindow = false;
|
||||
target.sendSystemMessage(new OutOfBand(new ProsePackage("bounty_hunter", "bounty_failed_hunter", attacker.getCustomName())), (byte) 0);
|
||||
|
||||
ProsePackage pp = new ProsePackage("bounty_hunter", "bounty_failed_target", attacker.getCustomName());
|
||||
pp.setToCustomString("their");
|
||||
attacker.sendSystemMessage(new OutOfBand(pp), (byte) 0);
|
||||
|
||||
core.missionService.handleMissionAbort(target, mission);
|
||||
}
|
||||
} else if (attacker.getPlayerObject().getBountyMissionId() != 0) {
|
||||
|
||||
if (attacker.getPlayerObject().getBountyMissionId() != 0) { // Bounty Hunter is deathblowing (attacker)
|
||||
bountyWindow = false;
|
||||
MissionObject mission = (MissionObject) core.objectService.getObject(attacker.getPlayerObject().getBountyMissionId());
|
||||
if (mission != null && mission.getBountyObjId() == target.getObjectId()) {
|
||||
bountyWindow = false;
|
||||
ProsePackage targetProse = new ProsePackage("bounty_hunter", "bounty_success_target", attacker.getCustomName());
|
||||
targetProse.setDiInteger(mission.getCreditReward());
|
||||
target.sendSystemMessage(new OutOfBand(targetProse), (byte) 0);
|
||||
|
||||
if (mission != null && mission.getBountyMarkId() == target.getObjectID()) {
|
||||
|
||||
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);
|
||||
ProsePackage attackerPp = new ProsePackage("bounty_hunter", "bounty_success_hunter", target.getCustomName());
|
||||
attackerPp.setToCustomString("his"); // TODO: Genders
|
||||
attackerPp.setDiInteger(mission.getCreditReward());
|
||||
attacker.sendSystemMessage(new OutOfBand(attackerPp), DisplayType.Broadcast);
|
||||
|
||||
ProsePackage targetPp = new ProsePackage ("bounty_hunter", "bounty_success_hunter", attacker.getCustomName());
|
||||
targetPp.setDiInteger(mission.getCreditReward());
|
||||
target.sendSystemMessage(new OutOfBand(targetPp), DisplayType.Broadcast);
|
||||
|
||||
core.missionService.handleMissionComplete(attacker, mission);
|
||||
}
|
||||
|
||||
} else if (target.getPlayerObject().getBountyMissionId() != 0) { // Bounty Hunter is being deathblown (They're the target)
|
||||
bountyWindow = false;
|
||||
MissionObject mission = (MissionObject) core.objectService.getObject(target.getPlayerObject().getBountyMissionId());
|
||||
|
||||
if (mission != null && mission.getBountyMarkId() == attacker.getObjectID()) {
|
||||
|
||||
ProsePackage attackerPp = new ProsePackage("bounty_hunter", "bounty_failed_target", target.getCustomName());
|
||||
attackerPp.setToCustomString("his"); // TODO: Genders
|
||||
attackerPp.setDiInteger(mission.getCreditReward());
|
||||
attacker.sendSystemMessage(new OutOfBand(attackerPp), DisplayType.Broadcast);
|
||||
|
||||
ProsePackage targetPp = new ProsePackage ("bounty_hunter", "bounty_failed_hunter", attacker.getCustomName());
|
||||
target.sendSystemMessage(new OutOfBand(targetPp), DisplayType.Broadcast);
|
||||
|
||||
core.missionService.handleMissionAbort(target, mission);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(target.getDuelList().contains(attacker))
|
||||
|
||||
@@ -276,22 +276,20 @@ public class FactionService implements INetworkDispatch {
|
||||
|
||||
long targetId = target.getObjectID();
|
||||
|
||||
if (object.getSlottedObject("datapad") != null) {
|
||||
object.getSlottedObject("datapad").viewChildren(object, false, false, (mission) -> {
|
||||
if (mission instanceof MissionObject && ((MissionObject) mission).getBountyObjId() == targetId) {
|
||||
ref.set(PvpStatus.Attackable | PvpStatus.Aggressive);
|
||||
}
|
||||
});
|
||||
if (ghost != null && ghost.getBountyMissionId() != 0) {
|
||||
if (((MissionObject) core.objectService.getObject(ghost.getBountyMissionId())).getBountyMarkId() == targetId) {
|
||||
ref.set(PvpStatus.Attackable | PvpStatus.Aggressive);
|
||||
}
|
||||
}
|
||||
|
||||
if (ghost != null && ghost.getProfession().contains("smuggler") &&
|
||||
/*if (ghost != null && ghost.getProfession().contains("smuggler") &&
|
||||
target.getSlottedObject("datapad") != null) {
|
||||
target.getSlottedObject("datapad").viewChildren(target, false, false, (mission) -> {
|
||||
if (mission instanceof MissionObject && ((MissionObject) mission).getBountyObjId() == object.getObjectID()) {
|
||||
if (mission instanceof MissionObject && ((MissionObject) mission).getBountyMarkId() == object.getObjectID()) {
|
||||
ref.set(PvpStatus.Attackable);
|
||||
}
|
||||
});
|
||||
}
|
||||
}*/
|
||||
|
||||
pvpBitmask |= ref.get();
|
||||
|
||||
|
||||
@@ -516,7 +516,7 @@ public class MissionService implements INetworkDispatch {
|
||||
|
||||
mission.setMissionTemplateObject(CRC.StringtoCRC("object/tangible/mission/shared_mission_bounty_jedi_target.iff"));
|
||||
|
||||
mission.setBountyObjId(bountyTarget.getObjectID());
|
||||
mission.setBountyMarkId(bountyTarget.getObjectID());
|
||||
}
|
||||
|
||||
public enum TerminalType {;
|
||||
|
||||
Reference in New Issue
Block a user