mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-04 05:16:21 -04:00
Merge branch 'master' of https://github.com/ProjectSWGCore/NGECore2
This commit is contained in:
@@ -43,6 +43,8 @@ import com.sleepycat.je.Transaction;
|
||||
import com.sleepycat.persist.model.Entity;
|
||||
import com.sleepycat.persist.model.NotPersistent;
|
||||
|
||||
import main.NGECore;
|
||||
|
||||
import engine.clients.Client;
|
||||
import resources.objects.Buff;
|
||||
import resources.objects.DamageOverTime;
|
||||
@@ -1135,49 +1137,7 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
//destination.getSession().write(messageBuilder.buildBaseline9());
|
||||
|
||||
if(destination != getClient()) {
|
||||
UpdatePVPStatusMessage upvpm = new UpdatePVPStatusMessage(getObjectID(), getPvPBitmask(), getFaction());
|
||||
if(getSlottedObject("ghost") != null)
|
||||
upvpm.setStatus(16);
|
||||
/*
|
||||
if (factionStatus == 1 && faction == "imperial") {
|
||||
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Imperial);
|
||||
upvpm.setStatus(16);
|
||||
if ((getOptionsBitmask() & 128) == 128) upvpm.setStatus(0);
|
||||
if (getOwnerId() != 0) upvpm.setStatus(256);
|
||||
}
|
||||
|
||||
if (factionStatus == 1 && faction == "rebel") {
|
||||
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Rebel);
|
||||
upvpm.setStatus(16);
|
||||
if ((getOptionsBitmask() & 128) == 128) upvpm.setStatus(0);
|
||||
if (getOwnerId() != 0) upvpm.setStatus(256);
|
||||
}
|
||||
|
||||
if (factionStatus == 2 && faction == "imperial") {
|
||||
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Imperial);
|
||||
upvpm.setStatus(55);
|
||||
if ((getOptionsBitmask() & 128) == 128) upvpm.setStatus(39);
|
||||
if (getOwnerId() != 0) upvpm.setStatus(295);
|
||||
}
|
||||
if (factionStatus == 2 && faction == "rebel") {
|
||||
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Rebel);
|
||||
upvpm.setStatus(55);
|
||||
if ((getOptionsBitmask() & 128) == 128) upvpm.setStatus(39);
|
||||
if (getOwnerId() != 0) upvpm.setStatus(295);
|
||||
}
|
||||
if(factionStatus == 0 && faction == "neutral") {
|
||||
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Neutral);
|
||||
upvpm.setStatus(16);
|
||||
if ((getOptionsBitmask() & 128) == 128) upvpm.setStatus(0);
|
||||
if (getOwnerId() != 0) upvpm.setStatus(256);
|
||||
} else {
|
||||
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Neutral);
|
||||
upvpm.setStatus(16);
|
||||
if ((getOptionsBitmask() & 128) == 128) upvpm.setStatus(0);
|
||||
if (getOwnerId() != 0) upvpm.setStatus(256);
|
||||
}
|
||||
*/
|
||||
|
||||
UpdatePVPStatusMessage upvpm = new UpdatePVPStatusMessage(getObjectID(), NGECore.getInstance().factionService.calculatePvpStatus(destination.getParent(), this), getFaction());
|
||||
destination.getSession().write(upvpm.serialize());
|
||||
UpdatePostureMessage upm = new UpdatePostureMessage(getObjectID(), getPosture());
|
||||
destination.getSession().write(upm.serialize());
|
||||
|
||||
@@ -210,7 +210,7 @@ public class ConnectionService implements INetworkDispatch {
|
||||
object.setSpectatorTask(null);
|
||||
}
|
||||
|
||||
core.groupService.handleGroupDisband(object);
|
||||
//core.groupService.handleGroupDisband(object); // Seefo: Temporarily moved to simulationService.handleDisconnect as a temporary fix for issue #295
|
||||
|
||||
if (core.instanceService.isInInstance(object)) {
|
||||
core.instanceService.remove(core.instanceService.getActiveInstance(object), object);
|
||||
|
||||
@@ -754,6 +754,8 @@ public class SimulationService implements INetworkDispatch {
|
||||
}
|
||||
}
|
||||
|
||||
core.groupService.handleGroupDisband(object); // Seefo: Temporarily moved from connectionService.disconnect as a temporary fix for issue #295
|
||||
|
||||
/*
|
||||
object.createTransaction(core.getCreatureODB().getEnvironment());
|
||||
core.getCreatureODB().put(object, Long.class, CreatureObject.class, object.getTransaction());
|
||||
@@ -765,7 +767,7 @@ public class SimulationService implements INetworkDispatch {
|
||||
if(core.objectService.getObject(objectId).getAttachment("disconnectTask") != null)
|
||||
core.connectionService.disconnect(client);
|
||||
}
|
||||
}, 5, TimeUnit.MINUTES);
|
||||
}, 1, TimeUnit.MINUTES);
|
||||
core.removeClient(session);
|
||||
|
||||
object.setAttachment("disconnectTask", disconnectTask);
|
||||
|
||||
@@ -26,6 +26,8 @@ import java.util.Map;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
import org.python.core.Py;
|
||||
import org.python.core.PyObject;
|
||||
|
||||
import protocol.swg.ExpertiseRequestMessage;
|
||||
|
||||
@@ -147,10 +149,32 @@ public class SkillService implements INetworkDispatch {
|
||||
}
|
||||
}
|
||||
|
||||
if(!skill.contains("expertise")) { // only mark 1 abilities in datatable need to remove abilities per script
|
||||
if (skill.contains("expertise")) {
|
||||
if (FileUtilities.doesFileExist("scripts/expertise/" + skill + ".py")) {
|
||||
PyObject method = core.scriptService.getMethod("scripts/expertise/", skill, "addAbilities");
|
||||
|
||||
if (method != null && method.isCallable()) {
|
||||
method.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(player));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (String ability : abilities) {
|
||||
creature.addAbility(ability);
|
||||
}
|
||||
|
||||
// When leveling, add all new unadded expertise abilities
|
||||
// It's up to the script to not add abilities that are already added
|
||||
for (String expertiseName : creature.getSkills()) {
|
||||
if (expertiseName.startsWith("expertise")) {
|
||||
if (FileUtilities.doesFileExist("scripts/expertise/" + expertiseName + ".py")) {
|
||||
PyObject method = core.scriptService.getMethod("scripts/expertise/", expertiseName, "addAbilities");
|
||||
|
||||
if (method != null && method.isCallable()) {
|
||||
method.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(player));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String skillMod : skillMods) {
|
||||
@@ -214,7 +238,15 @@ public class SkillService implements INetworkDispatch {
|
||||
//creature.addExpertisePoints(pointsRequired);
|
||||
}
|
||||
|
||||
if(!skill.contains("expertise")) { // only mark 1 abilities in datatable need to remove abilities per script
|
||||
if (skill.contains("expertise")) {
|
||||
if (FileUtilities.doesFileExist("scripts/expertise/" + skill + ".py")) {
|
||||
PyObject method = core.scriptService.getMethod("scripts/expertise/", skill, "removeAbilities");
|
||||
|
||||
if (method != null && method.isCallable()) {
|
||||
method.__call__(Py.java2py(core), Py.java2py(creature), Py.java2py(player));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (String ability : abilities) {
|
||||
creature.removeAbility(ability);
|
||||
}
|
||||
@@ -271,12 +303,8 @@ public class SkillService implements INetworkDispatch {
|
||||
return;
|
||||
|
||||
for(String expertiseName : expertise.getExpertiseSkills()) {
|
||||
if(expertiseName.startsWith("expertise_") && ((caluclateExpertisePoints(creature) - 1) >= 0)) // Prevent possible glitches/exploits
|
||||
{
|
||||
if(expertiseName.startsWith("expertise_") && ((caluclateExpertisePoints(creature) - 1) >= 0)) { // Prevent possible glitches/exploits
|
||||
addSkill(creature, expertiseName);
|
||||
if(!FileUtilities.doesFileExist("scripts/expertise/" + expertiseName + ".py"))
|
||||
continue;
|
||||
core.scriptService.callScript("scripts/expertise/", expertiseName, "addAbilities", core, creature, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,6 +204,10 @@ public class FactionService implements INetworkDispatch {
|
||||
int pvpBitmask = target.getPvPBitmask();
|
||||
|
||||
if (target.getSlottedObject("ghost") != null) {
|
||||
if (target.getFaction() == null || (!target.getFaction().equals("rebel") && !target.getFaction().equals("imperial"))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pvpBitmask |= PvpStatus.Player;
|
||||
|
||||
if (player.getFactionStatus() == FactionStatus.SpecialForces &&
|
||||
|
||||
Reference in New Issue
Block a user