mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-01 02:16:15 -04:00
Merge branch 'master' into darkk_ent
This commit is contained in:
@@ -31,8 +31,8 @@ import org.apache.mina.core.buffer.IoBuffer;
|
||||
import protocol.swg.ChatSystemMessage;
|
||||
import protocol.swg.ObjControllerMessage;
|
||||
import protocol.swg.PlayMusicMessage;
|
||||
import protocol.swg.UpdatePVPStatusMessage;
|
||||
import protocol.swg.UpdatePostureMessage;
|
||||
import protocol.swg.UpdatePVPStatusMessage;
|
||||
import protocol.swg.objectControllerObjects.Animation;
|
||||
import protocol.swg.objectControllerObjects.Posture;
|
||||
|
||||
@@ -103,7 +103,7 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
|
||||
// CREO6
|
||||
private byte combatFlag = 0;
|
||||
private short level = 1;
|
||||
private short level = -1;
|
||||
private int grantedHealth = 0;
|
||||
private String currentAnimation;
|
||||
private String moodAnimation;
|
||||
@@ -261,7 +261,14 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getOptionsBitmask() {
|
||||
synchronized(objectMutex) {
|
||||
return optionsBitmask;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOptionsBitmask(int optionBitmask) {
|
||||
synchronized(objectMutex) {
|
||||
@@ -273,6 +280,14 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
notifyObservers(optionDelta, true);
|
||||
|
||||
}
|
||||
|
||||
public void addOption(int option) {
|
||||
setOptionsBitmask(getOptionsBitmask() & option);
|
||||
}
|
||||
|
||||
public void removeOption(int option) {
|
||||
setOptionsBitmask(getOptionsBitmask() |~ option);
|
||||
}
|
||||
|
||||
public byte getPosture() {
|
||||
synchronized(objectMutex) {
|
||||
@@ -298,10 +313,8 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
this.faction = faction;
|
||||
}
|
||||
|
||||
IoBuffer factionDelta = messageBuilder.buildFactionDelta(faction);
|
||||
|
||||
notifyObservers(factionDelta, true);
|
||||
|
||||
notifyObservers(messageBuilder.buildFactionDelta(faction), true);
|
||||
setPvpStatus(0, true);
|
||||
}
|
||||
|
||||
public int getFactionStatus() {
|
||||
@@ -315,10 +328,7 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
this.factionStatus = factionStatus;
|
||||
}
|
||||
|
||||
IoBuffer factionStatusDelta = messageBuilder.buildFactionStatusDelta(factionStatus);
|
||||
|
||||
notifyObservers(factionStatusDelta, true);
|
||||
|
||||
notifyObservers(messageBuilder.buildFactionStatusDelta(factionStatus), true);
|
||||
}
|
||||
|
||||
public float getHeight() {
|
||||
@@ -495,7 +505,7 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
synchronized(objectMutex) {
|
||||
this.speedMultiplierBase = speedMultiplierBase;
|
||||
}
|
||||
IoBuffer speedDelta = messageBuilder.buildSpeedModDelta(speedMultiplierBase);
|
||||
IoBuffer speedDelta = messageBuilder.buildSpeedModBaseDelta(speedMultiplierBase);
|
||||
|
||||
notifyObservers(speedDelta, true);
|
||||
|
||||
@@ -511,6 +521,9 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
synchronized(objectMutex) {
|
||||
this.speedMultiplierMod = speedMultiplierMod;
|
||||
}
|
||||
IoBuffer speedDelta = messageBuilder.buildSpeedModDelta(speedMultiplierMod);
|
||||
|
||||
notifyObservers(speedDelta, true);
|
||||
}
|
||||
|
||||
public long getListenToId() {
|
||||
@@ -929,26 +942,48 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
//destination.getSession().write(upm.serialize());
|
||||
|
||||
if(destination != getClient()) {
|
||||
UpdatePVPStatusMessage upvpm = new UpdatePVPStatusMessage(getObjectID());
|
||||
if (factionStatus == 1 && faction.equals("imperial")) {
|
||||
UpdatePVPStatusMessage upvpm = new UpdatePVPStatusMessage(getObjectID(), getPvPBitmask(), getFaction());
|
||||
|
||||
/*
|
||||
if (factionStatus == 1 && faction == "imperial") {
|
||||
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Imperial);
|
||||
upvpm.setStatus(16);
|
||||
} else if (factionStatus == 1 && faction.equals("rebel")) {
|
||||
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);
|
||||
} else if (factionStatus == 2 && faction.equals("imperial")) {
|
||||
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);
|
||||
} else if (factionStatus == 2 && faction.equals("rebel")) {
|
||||
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);
|
||||
} else if(getSlottedObject("ghost") != null) {
|
||||
upvpm.setFaction(CRC.StringtoCRC(faction));
|
||||
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(0);
|
||||
}
|
||||
upvpm.setStatus(16);
|
||||
if ((getOptionsBitmask() & 128) == 128) upvpm.setStatus(0);
|
||||
if (getOwnerId() != 0) upvpm.setStatus(256);
|
||||
}
|
||||
*/
|
||||
|
||||
destination.getSession().write(upvpm.serialize());
|
||||
}
|
||||
}
|
||||
@@ -1309,4 +1344,16 @@ public class CreatureObject extends TangibleObject implements IPersistent {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setPvPBitmask(int pvpBitmask) {
|
||||
super.setPvPBitmask(pvpBitmask);
|
||||
notifyObservers(new UpdatePVPStatusMessage(getObjectID(), getPvPBitmask(), getFaction()), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPvpStatus(int pvpBitmask, boolean add) {
|
||||
super.setPvpStatus(pvpBitmask, add);
|
||||
notifyObservers(new UpdatePVPStatusMessage(getObjectID(), getPvPBitmask(), getFaction()), false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user