mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-31 01:15:57 -04:00
PvP & OptionsBitmask refactor
These will need to be used in scripts to make NPCs invulnerable, conversable, always aggressive, etc.
This commit is contained in:
@@ -67,6 +67,9 @@ public class TangibleObject extends SWGObject {
|
||||
private int respawnTime = 0;
|
||||
private Point3D spawnCoordinates = new Point3D(0, 0, 0);
|
||||
|
||||
@NotPersistent
|
||||
private TangibleObject killer = null;
|
||||
|
||||
public TangibleObject(long objectID, Planet planet, String template) {
|
||||
super(objectID, planet, new Point3D(0, 0, 0), new Quaternion(1, 0, 1, 0), template);
|
||||
messageBuilder = new TangibleMessageBuilder(this);
|
||||
@@ -153,6 +156,24 @@ public class TangibleObject extends SWGObject {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getPvpStatus(int pvpStatus) {
|
||||
synchronized(objectMutex) {
|
||||
return ((pvpBitmask & pvpStatus) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPvpStatus(int pvpBitmask, boolean add) {
|
||||
synchronized(objectMutex) {
|
||||
if (pvpBitmask != 0) {
|
||||
if (add) {
|
||||
this.pvpBitmask |= pvpBitmask;
|
||||
} else {
|
||||
this.pvpBitmask &= ~pvpBitmask;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getFaction() {
|
||||
synchronized(objectMutex) {
|
||||
return faction;
|
||||
@@ -278,6 +299,18 @@ public class TangibleObject extends SWGObject {
|
||||
}
|
||||
}
|
||||
|
||||
public TangibleObject getKiller() {
|
||||
synchronized(objectMutex) {
|
||||
return killer;
|
||||
}
|
||||
}
|
||||
|
||||
public void setKiller(TangibleObject killer) {
|
||||
synchronized(objectMutex) {
|
||||
this.killer = killer;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendBaselines(Client destination) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user