mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-11 01:13:05 -04:00
Merge branch 'master' of https://github.com/ProjectSWGCore/NGECore2
Conflicts: .gitignore src/main/NGECore.java src/resources/objects/creature/CreatureObject.java src/resources/objects/mission/MissionObject.java src/resources/objects/tangible/TangibleObject.java src/services/chat/Mail.java src/services/mission/MissionObjective.java src/services/object/ObjectService.java src/services/playercities/PlayerCity.java
This commit is contained in:
@@ -1,487 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
import org.apache.mina.core.buffer.SimpleBufferAllocator;
|
||||
|
||||
import resources.objects.creature.CreatureObject;
|
||||
|
||||
import com.sleepycat.persist.model.NotPersistent;
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
import engine.resources.common.CRC;
|
||||
|
||||
@Persistent(version=10)
|
||||
public class Buff implements IDelta, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@NotPersistent
|
||||
private transient SimpleBufferAllocator bufferPool = new SimpleBufferAllocator();
|
||||
private String group1, group2;
|
||||
private int priority;
|
||||
private float duration;
|
||||
private String buffName;
|
||||
private long ownerId;
|
||||
private String effect1Name, effect2Name, effect3Name, effect4Name, effect5Name;
|
||||
private float effect1Value, effect2Value, effect3Value, effect4Value, effect5Value;
|
||||
private String callback;
|
||||
private String particleEffect;
|
||||
private boolean isDebuff;
|
||||
private boolean removeOnDeath;
|
||||
private boolean isRemovableByPlayer;
|
||||
private int maxStacks;
|
||||
private boolean isPersistent;
|
||||
private boolean removeOnRespec;
|
||||
private boolean aiRemoveOnEndCombat;
|
||||
private boolean decayOnPvPDeath;
|
||||
private long startTime;
|
||||
private int totalPlayTime;
|
||||
private byte decayCounter = 0;
|
||||
@NotPersistent
|
||||
private transient ScheduledFuture<?> removalTask;
|
||||
private int stacks = 1;
|
||||
private long groupBufferId;
|
||||
private int buffCRC;
|
||||
|
||||
public Buff(Buff baseBuff, long ownerId) {
|
||||
this.buffName = baseBuff.getBuffName();
|
||||
this.buffCRC = baseBuff.getBuffCRC();
|
||||
this.group1 = baseBuff.getGroup1();
|
||||
this.group2 = baseBuff.getGroup2();
|
||||
this.priority = baseBuff.getPriority();
|
||||
this.duration = baseBuff.getDuration();
|
||||
this.effect1Name = baseBuff.getEffect1Name();
|
||||
this.effect1Value = baseBuff.getEffect1Value();
|
||||
this.effect2Name = baseBuff.getEffect2Name();
|
||||
this.effect2Value = baseBuff.getEffect2Value();
|
||||
this.effect3Name = baseBuff.getEffect3Name();
|
||||
this.effect3Value = baseBuff.getEffect3Value();
|
||||
this.effect4Name = baseBuff.getEffect4Name();
|
||||
this.effect4Value = baseBuff.getEffect4Value();
|
||||
this.effect5Name = baseBuff.getEffect5Name();
|
||||
this.effect5Value = baseBuff.getEffect5Value();
|
||||
this.callback = baseBuff.getCallback();
|
||||
this.particleEffect = baseBuff.getParticleEffect();
|
||||
this.isDebuff = baseBuff.isDebuff();
|
||||
this.removeOnDeath = baseBuff.isRemoveOnDeath();
|
||||
this.isRemovableByPlayer = baseBuff.isRemovableByPlayer();
|
||||
this.maxStacks = baseBuff.getMaxStacks();
|
||||
this.isPersistent = baseBuff.isPersistent();
|
||||
this.removeOnRespec = baseBuff.isRemoveOnRespec();
|
||||
this.aiRemoveOnEndCombat = baseBuff.isAiRemoveOnEndCombat();
|
||||
this.decayOnPvPDeath = baseBuff.isDecayOnPvPDeath();
|
||||
}
|
||||
|
||||
/*public Buff(String buffName, long ownerId) {
|
||||
|
||||
this.buffName = buffName;
|
||||
this.ownerId = ownerId;
|
||||
this.buffCRC = CRC.StringtoCRC(buffName);
|
||||
|
||||
DatatableVisitor visitor;
|
||||
|
||||
try {
|
||||
|
||||
visitor = ClientFileManager.loadFile("datatables/buff/buff.iff", DatatableVisitor.class);
|
||||
for(int i = 0; i < visitor.getRowCount(); i++) {
|
||||
|
||||
if(visitor.getObject(i, 0) != null)
|
||||
if(((String) visitor.getObject(i, 0)).equalsIgnoreCase(buffName)) {
|
||||
|
||||
group1 = (String) visitor.getObject(i, 1);
|
||||
group2 = (String) visitor.getObject(i, 2);
|
||||
priority = (int) visitor.getObject(i, 4);
|
||||
duration = (Float) visitor.getObject(i, 6);
|
||||
effect1Name = (String) visitor.getObject(i, 7);
|
||||
effect1Value = (Float) visitor.getObject(i, 8);
|
||||
effect2Name = (String) visitor.getObject(i, 9);
|
||||
effect2Value = (Float) visitor.getObject(i, 10);
|
||||
effect3Name = (String) visitor.getObject(i, 11);
|
||||
effect3Value = (Float) visitor.getObject(i, 12);
|
||||
effect4Name = (String) visitor.getObject(i, 13);
|
||||
effect4Value = (Float) visitor.getObject(i, 14);
|
||||
effect5Name = (String) visitor.getObject(i, 15);
|
||||
effect5Value = (Float) visitor.getObject(i, 16);
|
||||
callback = (String) visitor.getObject(i, 18);
|
||||
particleEffect = (String) visitor.getObject(i, 19);
|
||||
isDebuff = (Boolean) visitor.getObject(i, 22);
|
||||
removeOnDeath = (Integer) visitor.getObject(i, 25) != 0;
|
||||
isRemovableByPlayer = (Integer) visitor.getObject(i, 26) != 0;
|
||||
maxStacks = (Integer) visitor.getObject(i, 28);
|
||||
isPersistent = (Integer) visitor.getObject(i, 29) != 0;
|
||||
removeOnRespec = (Integer) visitor.getObject(i, 31) != 0;
|
||||
aiRemoveOnEndCombat = (Integer) visitor.getObject(i, 32) != 0;
|
||||
decayOnPvPDeath = (Integer) visitor.getObject(i, 33) != 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
|
||||
public Buff() { }
|
||||
|
||||
@Override
|
||||
public byte[] getBytes() {
|
||||
|
||||
IoBuffer buffer = bufferPool.allocate(28, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.putInt(CRC.StringtoCRC(buffName.toLowerCase()));
|
||||
if(duration > 0) {
|
||||
buffer.putInt((int) (totalPlayTime + getRemainingDuration()));
|
||||
buffer.putInt(0);
|
||||
buffer.putInt((int) duration);
|
||||
} else {
|
||||
buffer.putInt(-1);
|
||||
buffer.putInt(0);
|
||||
buffer.putInt(0);
|
||||
}
|
||||
buffer.putLong(ownerId);
|
||||
buffer.putInt(stacks); // stacks
|
||||
|
||||
buffer.flip();
|
||||
|
||||
return buffer.array();
|
||||
|
||||
}
|
||||
|
||||
public String getGroup1() {
|
||||
return group1;
|
||||
}
|
||||
|
||||
public void setGroup1(String group1) {
|
||||
this.group1 = group1;
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
public void setPriority(int priority) {
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
public float getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(float duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getBuffName() {
|
||||
return buffName;
|
||||
}
|
||||
|
||||
public void setBuffName(String buffName) {
|
||||
this.buffName = buffName;
|
||||
}
|
||||
|
||||
public long getOwnerId() {
|
||||
return ownerId;
|
||||
}
|
||||
|
||||
public void setOwnerId(long ownerId) {
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public String getEffect1Name() {
|
||||
return effect1Name;
|
||||
}
|
||||
|
||||
public void setEffect1Name(String effect1Name) {
|
||||
this.effect1Name = effect1Name;
|
||||
}
|
||||
|
||||
public String getEffect2Name() {
|
||||
return effect2Name;
|
||||
}
|
||||
|
||||
public void setEffect2Name(String effect2Name) {
|
||||
this.effect2Name = effect2Name;
|
||||
}
|
||||
|
||||
public String getEffect3Name() {
|
||||
return effect3Name;
|
||||
}
|
||||
|
||||
public void setEffect3Name(String effect3Name) {
|
||||
this.effect3Name = effect3Name;
|
||||
}
|
||||
|
||||
public String getEffect4Name() {
|
||||
return effect4Name;
|
||||
}
|
||||
|
||||
public void setEffect4Name(String effect4Name) {
|
||||
this.effect4Name = effect4Name;
|
||||
}
|
||||
|
||||
public String getEffect5Name() {
|
||||
return effect5Name;
|
||||
}
|
||||
|
||||
public void setEffect5Name(String effect5Name) {
|
||||
this.effect5Name = effect5Name;
|
||||
}
|
||||
|
||||
public float getEffect1Value() {
|
||||
return effect1Value;
|
||||
}
|
||||
|
||||
public void setEffect1Value(float effect1Value) {
|
||||
this.effect1Value = effect1Value;
|
||||
}
|
||||
|
||||
public float getEffect2Value() {
|
||||
return effect2Value;
|
||||
}
|
||||
|
||||
public void setEffect2Value(float effect2Value) {
|
||||
this.effect2Value = effect2Value;
|
||||
}
|
||||
|
||||
public float getEffect3Value() {
|
||||
return effect3Value;
|
||||
}
|
||||
|
||||
public void setEffect3Value(float effect3Value) {
|
||||
this.effect3Value = effect3Value;
|
||||
}
|
||||
|
||||
public float getEffect4Value() {
|
||||
return effect4Value;
|
||||
}
|
||||
|
||||
public void setEffect4Value(float effect4Value) {
|
||||
this.effect4Value = effect4Value;
|
||||
}
|
||||
|
||||
public float getEffect5Value() {
|
||||
return effect5Value;
|
||||
}
|
||||
|
||||
public void setEffect5Value(float effect5Value) {
|
||||
this.effect5Value = effect5Value;
|
||||
}
|
||||
|
||||
public String getCallback() {
|
||||
return callback;
|
||||
}
|
||||
|
||||
public void setCallback(String callback) {
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
public String getParticleEffect() {
|
||||
return particleEffect;
|
||||
}
|
||||
|
||||
public void setParticleEffect(String particleEffect) {
|
||||
this.particleEffect = particleEffect;
|
||||
}
|
||||
|
||||
public boolean isDebuff() {
|
||||
return isDebuff;
|
||||
}
|
||||
|
||||
public void setDebuff(boolean isDebuff) {
|
||||
this.isDebuff = isDebuff;
|
||||
}
|
||||
|
||||
public boolean isRemoveOnDeath() {
|
||||
return removeOnDeath;
|
||||
}
|
||||
|
||||
public void setRemoveOnDeath(boolean removeOnDeath) {
|
||||
this.removeOnDeath = removeOnDeath;
|
||||
}
|
||||
|
||||
public boolean isRemovableByPlayer() {
|
||||
return isRemovableByPlayer;
|
||||
}
|
||||
|
||||
public void setRemovableByPlayer(boolean isRemovableByPlayer) {
|
||||
this.isRemovableByPlayer = isRemovableByPlayer;
|
||||
}
|
||||
|
||||
public int getMaxStacks() {
|
||||
return maxStacks;
|
||||
}
|
||||
|
||||
public void setMaxStacks(int maxStacks) {
|
||||
this.maxStacks = maxStacks;
|
||||
}
|
||||
|
||||
public boolean isPersistent() {
|
||||
return isPersistent;
|
||||
}
|
||||
|
||||
public void setPersistent(boolean isPersistent) {
|
||||
this.isPersistent = isPersistent;
|
||||
}
|
||||
|
||||
public boolean isRemoveOnRespec() {
|
||||
return removeOnRespec;
|
||||
}
|
||||
|
||||
public void setRemoveOnRespec(boolean removeOnRespec) {
|
||||
this.removeOnRespec = removeOnRespec;
|
||||
}
|
||||
|
||||
public boolean isAiRemoveOnEndCombat() {
|
||||
return aiRemoveOnEndCombat;
|
||||
}
|
||||
|
||||
public void setAiRemoveOnEndCombat(boolean aiRemoveOnEndCombat) {
|
||||
this.aiRemoveOnEndCombat = aiRemoveOnEndCombat;
|
||||
}
|
||||
|
||||
public boolean isDecayOnPvPDeath() {
|
||||
return decayOnPvPDeath;
|
||||
}
|
||||
|
||||
public void setDecayOnPvPDeath(boolean decayOnPvPDeath) {
|
||||
this.decayOnPvPDeath = decayOnPvPDeath;
|
||||
}
|
||||
|
||||
public void setStartTime() {
|
||||
this.startTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public long getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public int getRemainingDuration() {
|
||||
|
||||
long currentTime = System.currentTimeMillis();
|
||||
long timeDiff = (currentTime - startTime) / 1000;
|
||||
int remaining = (int) (duration - timeDiff);
|
||||
for(int i = 0; i < decayCounter; i++) {
|
||||
remaining /= 2;
|
||||
}
|
||||
return remaining;
|
||||
|
||||
}
|
||||
|
||||
public int getTotalPlayTime() {
|
||||
return totalPlayTime;
|
||||
}
|
||||
|
||||
public void setTotalPlayTime(int totalPlayTime) {
|
||||
this.totalPlayTime = totalPlayTime;
|
||||
}
|
||||
|
||||
public byte getDecayCounter() {
|
||||
return decayCounter;
|
||||
}
|
||||
|
||||
public void incDecayCounter() {
|
||||
this.decayCounter++;
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> getRemovalTask() {
|
||||
return removalTask;
|
||||
}
|
||||
|
||||
public void setRemovalTask(ScheduledFuture<?> removalTask) {
|
||||
this.removalTask = removalTask;
|
||||
}
|
||||
|
||||
public void updateRemovalTask() {
|
||||
|
||||
if(removalTask == null)
|
||||
return;
|
||||
|
||||
removalTask.cancel(true);
|
||||
|
||||
final NGECore core = NGECore.getInstance();
|
||||
final CreatureObject owner = (CreatureObject) core.objectService.getObject(getOwnerId());
|
||||
|
||||
if(owner == null)
|
||||
return;
|
||||
|
||||
ScheduledFuture<?> task = Executors.newScheduledThreadPool(1).schedule(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
core.buffService.removeBuffFromCreature(owner, Buff.this);
|
||||
|
||||
}
|
||||
|
||||
}, (long) getRemainingDuration(), TimeUnit.SECONDS);
|
||||
|
||||
setRemovalTask(task);
|
||||
|
||||
}
|
||||
|
||||
public int getStacks() {
|
||||
return stacks;
|
||||
}
|
||||
|
||||
public void setStacks(int stacks) {
|
||||
this.stacks = stacks;
|
||||
}
|
||||
|
||||
public boolean isGroupBuff() {
|
||||
return effect1Name == null ? false : effect1Name.equals("group");
|
||||
}
|
||||
|
||||
public long getGroupBufferId() {
|
||||
return groupBufferId;
|
||||
}
|
||||
|
||||
public void setGroupBufferId(long groupBufferId) {
|
||||
this.groupBufferId = groupBufferId;
|
||||
}
|
||||
|
||||
public String getGroup2() {
|
||||
return group2;
|
||||
}
|
||||
|
||||
public void setGroup2(String group2) {
|
||||
this.group2 = group2;
|
||||
}
|
||||
|
||||
public int getBuffCRC() {
|
||||
return buffCRC;
|
||||
}
|
||||
|
||||
public void setBuffCRC(int buffCRC) {
|
||||
this.buffCRC = buffCRC;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
@Persistent
|
||||
public class BuffItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int affectAmount;
|
||||
private int entertainerBonus;
|
||||
private int invested;
|
||||
private String skillName;
|
||||
|
||||
public BuffItem() {
|
||||
|
||||
}
|
||||
|
||||
public BuffItem(String skillName, int invested, int entBonus) {
|
||||
this.skillName = skillName;
|
||||
this.invested = invested;
|
||||
this.entertainerBonus = entBonus;
|
||||
}
|
||||
|
||||
public int getAffectAmount() {
|
||||
return affectAmount;
|
||||
}
|
||||
|
||||
public int getEntertainerBonus() {
|
||||
return entertainerBonus;
|
||||
}
|
||||
|
||||
public int getInvested() {
|
||||
return invested;
|
||||
}
|
||||
|
||||
public String getSkillName() {
|
||||
return skillName;
|
||||
}
|
||||
|
||||
public void setAffectAmount(int amount) {
|
||||
this.affectAmount = amount;
|
||||
}
|
||||
|
||||
public void setEntertainerBonus(int entertainerBonus) {
|
||||
this.entertainerBonus = entertainerBonus;
|
||||
}
|
||||
|
||||
public void setInvested(int invested) {
|
||||
this.invested = invested;
|
||||
}
|
||||
|
||||
public void setSkillName(String skillName) {
|
||||
this.skillName = skillName;
|
||||
}
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import com.sleepycat.persist.model.NotPersistent;
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
@Persistent(version=1)
|
||||
public class DamageOverTime implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Buff buff;
|
||||
private String type;
|
||||
private int duration;
|
||||
private int intensity;
|
||||
@NotPersistent
|
||||
private transient ScheduledFuture<?> task;
|
||||
private long startTime;
|
||||
private String commandName;
|
||||
|
||||
public DamageOverTime() { }
|
||||
|
||||
public DamageOverTime(String commandName, Buff buff, String type, int duration, int intensity) {
|
||||
this.buff = buff;
|
||||
this.type = type;
|
||||
this.duration = duration;
|
||||
this.intensity = intensity;
|
||||
this.commandName = commandName;
|
||||
}
|
||||
|
||||
public Buff getBuff() {
|
||||
return buff;
|
||||
}
|
||||
|
||||
public void setBuff(Buff buff) {
|
||||
this.buff = buff;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public int getIntensity() {
|
||||
return intensity;
|
||||
}
|
||||
|
||||
public void setIntensity(int intensity) {
|
||||
this.intensity = intensity;
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> getTask() {
|
||||
return task;
|
||||
}
|
||||
|
||||
public void setTask(ScheduledFuture<?> task) {
|
||||
this.task = task;
|
||||
}
|
||||
|
||||
public long getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(long startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public int getRemainingDuration() {
|
||||
|
||||
long currentTime = System.currentTimeMillis();
|
||||
long timeDiff = (currentTime - startTime) / 1000;
|
||||
return (int) (duration - timeDiff);
|
||||
|
||||
}
|
||||
|
||||
public String getCommandName() {
|
||||
return commandName;
|
||||
}
|
||||
|
||||
public void setCommandName(String commandName) {
|
||||
this.commandName = commandName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
@Persistent(version=0)
|
||||
public class SkillMod extends Delta implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int base;
|
||||
private int modifier;
|
||||
|
||||
public SkillMod(int base, int modifier) {
|
||||
this.base = base;
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public SkillMod() {
|
||||
|
||||
}
|
||||
|
||||
public int getBase() {
|
||||
synchronized(objectMutex) {
|
||||
return base;
|
||||
}
|
||||
}
|
||||
|
||||
public void setBase(int base) {
|
||||
synchronized(objectMutex) {
|
||||
this.base = base;
|
||||
}
|
||||
}
|
||||
|
||||
public void addBase(int base) {
|
||||
synchronized(objectMutex) {
|
||||
this.base += base;
|
||||
}
|
||||
}
|
||||
|
||||
public void deductBase(int base) {
|
||||
synchronized(objectMutex) {
|
||||
this.base -= base;
|
||||
}
|
||||
}
|
||||
|
||||
public int getModifier() {
|
||||
synchronized(objectMutex) {
|
||||
return modifier;
|
||||
}
|
||||
}
|
||||
|
||||
public void setModifier(int modifier) {
|
||||
synchronized(objectMutex) {
|
||||
this.modifier = modifier;
|
||||
}
|
||||
}
|
||||
|
||||
public void addModifier(int modifier) {
|
||||
synchronized(objectMutex) {
|
||||
this.modifier += modifier;
|
||||
}
|
||||
}
|
||||
|
||||
public void deductModifier(int modifier) {
|
||||
synchronized(objectMutex) {
|
||||
this.modifier -= modifier;
|
||||
}
|
||||
}
|
||||
|
||||
public float getValue(int divisor) {
|
||||
synchronized(objectMutex) {
|
||||
return ((divisor < 1) ? ((float) base) : ((float) base / (float) divisor));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getBytes() {
|
||||
synchronized(objectMutex) {
|
||||
IoBuffer buffer = createBuffer(8);
|
||||
buffer.putInt(base);
|
||||
buffer.putInt(modifier);
|
||||
return buffer.array();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -63,15 +63,15 @@ public class BuildingObject extends TangibleObject implements IPersistent, Seria
|
||||
private short maximumStorageCapacity=0;
|
||||
private Vector<Long> entryList = new Vector<Long>(); // Preferably the OIDs should be stored, because of name changes
|
||||
private Vector<Long> banList = new Vector<Long>();
|
||||
|
||||
public BuildingObject() {
|
||||
super();
|
||||
|
||||
public BuildingObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) {
|
||||
super(objectID, planet, Template, position, orientation);
|
||||
messageBuilder = new BuildingMessageBuilder(this);
|
||||
this.setConditionDamage(100);
|
||||
}
|
||||
|
||||
public BuildingObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) {
|
||||
super(objectID, planet, Template, position, orientation);
|
||||
|
||||
public BuildingObject() {
|
||||
super();
|
||||
messageBuilder = new BuildingMessageBuilder(this);
|
||||
this.setConditionDamage(100);
|
||||
}
|
||||
@@ -91,6 +91,18 @@ public class BuildingObject extends TangibleObject implements IPersistent, Seria
|
||||
|
||||
}
|
||||
|
||||
public int getCellNumberByObjectId(long objectId) {
|
||||
Vector<CellObject> cells = getCells();
|
||||
|
||||
for (CellObject cell : cells) {
|
||||
if (cell.getObjectID() == objectId) {
|
||||
return cell.getCellNumber();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getMaintenanceAmount() {
|
||||
return maintenanceAmount;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
package resources.objects.creature;
|
||||
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
@@ -30,13 +29,13 @@ import org.apache.mina.core.buffer.IoBuffer;
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
import engine.resources.common.CRC;
|
||||
import resources.objects.Buff;
|
||||
import resources.buffs.Buff;
|
||||
import resources.objects.ObjectMessageBuilder;
|
||||
import resources.objects.SkillMod;
|
||||
import engine.resources.objects.SWGObject;
|
||||
import resources.objects.player.PlayerObject;
|
||||
import resources.objects.tangible.TangibleObject;
|
||||
import resources.objects.weapon.WeaponObject;
|
||||
import resources.skills.SkillMod;
|
||||
|
||||
@Persistent
|
||||
public class CreatureMessageBuilder extends ObjectMessageBuilder {
|
||||
|
||||
@@ -50,13 +50,12 @@ import com.sleepycat.persist.model.NotPersistent;
|
||||
|
||||
import main.NGECore;
|
||||
import engine.clients.Client;
|
||||
import resources.buffs.Buff;
|
||||
import resources.buffs.DamageOverTime;
|
||||
import resources.common.Cooldown;
|
||||
import resources.common.OutOfBand;
|
||||
import resources.objects.Buff;
|
||||
import resources.objects.DamageOverTime;
|
||||
import resources.objects.SWGList;
|
||||
import resources.objects.SWGMap;
|
||||
import resources.objects.SkillMod;
|
||||
import engine.resources.common.CRC;
|
||||
import engine.resources.objects.IPersistent;
|
||||
import engine.resources.objects.MissionCriticalObject;
|
||||
@@ -66,6 +65,7 @@ import engine.resources.scene.Point3D;
|
||||
import engine.resources.scene.Quaternion;
|
||||
import resources.objects.player.PlayerObject;
|
||||
import resources.objects.tangible.TangibleObject;
|
||||
import resources.skills.SkillMod;
|
||||
import services.command.BaseSWGCommand;
|
||||
|
||||
@Entity(version=9)
|
||||
@@ -189,6 +189,8 @@ public class CreatureObject extends TangibleObject implements Serializable {
|
||||
private transient ConcurrentHashMap<String, Long> cooldowns = new ConcurrentHashMap<String, Long>();
|
||||
@NotPersistent
|
||||
private transient long tefTime = System.currentTimeMillis();
|
||||
@NotPersistent
|
||||
private transient SWGObject useTarget;
|
||||
|
||||
public CreatureObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) {
|
||||
super(objectID, planet, Template, position, orientation);
|
||||
@@ -983,6 +985,18 @@ public class CreatureObject extends TangibleObject implements Serializable {
|
||||
notifyObservers(messageBuilder.buildIntendedTargetDelta(intendedTarget), true);
|
||||
}
|
||||
|
||||
public SWGObject getUseTarget() {
|
||||
synchronized(objectMutex) {
|
||||
return useTarget;
|
||||
}
|
||||
}
|
||||
|
||||
public void setUseTarget(SWGObject useTarget) {
|
||||
synchronized(objectMutex) {
|
||||
this.useTarget = useTarget;
|
||||
}
|
||||
}
|
||||
|
||||
public long getTargetId() {
|
||||
return getIntendedTarget();
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects.loot;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LootDrop {
|
||||
|
||||
private List<String> elements = new ArrayList<String>();
|
||||
private String droppedItemTemplate;
|
||||
|
||||
public LootDrop(){
|
||||
|
||||
}
|
||||
|
||||
public void addElement(String element){
|
||||
elements.add(element);
|
||||
}
|
||||
|
||||
public List<String> getElements(){
|
||||
return elements;
|
||||
}
|
||||
|
||||
public String getDroppedItemTemplate() {
|
||||
return droppedItemTemplate;
|
||||
}
|
||||
|
||||
public void setDroppedItemTemplate(String droppedItemTemplate) {
|
||||
this.droppedItemTemplate = droppedItemTemplate;
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects.loot;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
/**
|
||||
* @author Charon
|
||||
*/
|
||||
|
||||
@Persistent(version=0)
|
||||
public class LootGroup implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String[] lootPoolNames;
|
||||
private double[] lootPoolChances;
|
||||
private double lootGroupChance;
|
||||
|
||||
public LootGroup(){
|
||||
|
||||
}
|
||||
|
||||
public LootGroup(String[] lootPoolNames, double[] lootPoolChances, double lootGroupChance){
|
||||
this.lootPoolNames = lootPoolNames;
|
||||
this.lootPoolChances = lootPoolChances;
|
||||
this.lootGroupChance = lootGroupChance;
|
||||
}
|
||||
|
||||
public void addLootData(String[] lootPoolNames, double[] lootPoolChances, double lootGroupChance){
|
||||
this.lootPoolNames = lootPoolNames;
|
||||
this.lootPoolChances = lootPoolChances;
|
||||
this.lootGroupChance = lootGroupChance;
|
||||
}
|
||||
|
||||
public String[] getLootPoolNames() {
|
||||
return lootPoolNames;
|
||||
}
|
||||
|
||||
public double[] getLootPoolChances() {
|
||||
return lootPoolChances;
|
||||
}
|
||||
|
||||
public double getLootGroupChance() {
|
||||
return lootGroupChance;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects.loot;
|
||||
|
||||
/**
|
||||
* @author Charon
|
||||
*/
|
||||
|
||||
public class LootPool {
|
||||
|
||||
public LootPool(){
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects.loot;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import engine.resources.scene.Planet;
|
||||
import main.NGECore;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
import resources.objects.group.GroupObject;
|
||||
import resources.objects.tangible.TangibleObject;
|
||||
|
||||
/**
|
||||
* @author Charon
|
||||
*/
|
||||
|
||||
public class LootRollSession {
|
||||
|
||||
private String SessionID; // leaderName-SystemTime
|
||||
private boolean sessionValid;
|
||||
private GroupObject playerGroup;
|
||||
private CreatureObject requester;
|
||||
private List<TangibleObject> droppedItems;
|
||||
private Planet sessionPlanet;
|
||||
private List<String> errorMessages;
|
||||
private int sessionLootMode;
|
||||
private boolean allowRareLoot;
|
||||
private boolean increasedRLSChance;
|
||||
|
||||
public LootRollSession(){
|
||||
}
|
||||
|
||||
public LootRollSession(CreatureObject requester, TangibleObject lootedObject){
|
||||
long requesterGroupId = requester.getGroupId();
|
||||
if (requesterGroupId>0){
|
||||
this.playerGroup = (GroupObject) NGECore.getInstance().objectService.getObject(requesterGroupId);
|
||||
this.SessionID = playerGroup.getGroupLeader().getCustomName()+"-"+System.currentTimeMillis();
|
||||
|
||||
} else {
|
||||
this.SessionID = requester.getCustomName()+"-"+System.currentTimeMillis();
|
||||
}
|
||||
|
||||
if (lootedObject instanceof CreatureObject){
|
||||
CreatureObject lootedCreature = (CreatureObject)lootedObject;
|
||||
// Exclude rare loot depending on creature level
|
||||
// For groups maybe average CL?
|
||||
if (requester.getLevel()-lootedCreature.getLevel()<=6){
|
||||
this.setAllowRareLoot(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Group situation
|
||||
if (this.getPlayerGroup()!=null){
|
||||
if (this.getPlayerGroup().getMemberList().size()>=4)
|
||||
this.setIncreasedRLSChance(true);
|
||||
}
|
||||
|
||||
// Possible AFKer check here
|
||||
|
||||
|
||||
droppedItems = new ArrayList<TangibleObject>();
|
||||
errorMessages = new ArrayList<String>();
|
||||
sessionPlanet = requester.getPlanet();
|
||||
this.requester = requester;
|
||||
allowRareLoot = false;
|
||||
}
|
||||
|
||||
public List<TangibleObject> getDroppedItems() {
|
||||
return droppedItems;
|
||||
}
|
||||
|
||||
public void addDroppedItem(TangibleObject droppedItem) {
|
||||
this.droppedItems.add(droppedItem);
|
||||
}
|
||||
|
||||
public String getSessionID() {
|
||||
return SessionID;
|
||||
}
|
||||
|
||||
public void setSessionID(String sessionID) {
|
||||
SessionID = sessionID;
|
||||
}
|
||||
|
||||
public void generateSessionID(String sessionID) {
|
||||
SessionID = sessionID;
|
||||
}
|
||||
|
||||
public Planet getSessionPlanet() {
|
||||
return sessionPlanet;
|
||||
}
|
||||
|
||||
public List<String> getErrorMessages() {
|
||||
return errorMessages;
|
||||
}
|
||||
|
||||
public void addErrorMessage(String errorMessage) {
|
||||
this.errorMessages.add(errorMessage);
|
||||
}
|
||||
|
||||
public int getSessionLootMode() {
|
||||
return sessionLootMode;
|
||||
}
|
||||
|
||||
public void setSessionLootMode(int sessionLootMode) {
|
||||
this.sessionLootMode = sessionLootMode;
|
||||
}
|
||||
|
||||
public boolean isAllowRareLoot() {
|
||||
return allowRareLoot;
|
||||
}
|
||||
|
||||
public void setAllowRareLoot(boolean allowRareLoot) {
|
||||
this.allowRareLoot = allowRareLoot;
|
||||
}
|
||||
|
||||
public GroupObject getPlayerGroup() {
|
||||
return playerGroup;
|
||||
}
|
||||
|
||||
public boolean isIncreasedRLSChance() {
|
||||
return increasedRLSChance;
|
||||
}
|
||||
|
||||
public void setIncreasedRLSChance(boolean increasedRLSChance) {
|
||||
this.increasedRLSChance = increasedRLSChance;
|
||||
}
|
||||
|
||||
public boolean isSessionValid() {
|
||||
return sessionValid;
|
||||
}
|
||||
|
||||
public void setSessionValid(boolean sessionValid) {
|
||||
this.sessionValid = sessionValid;
|
||||
}
|
||||
|
||||
public CreatureObject getRequester() {
|
||||
return requester;
|
||||
}
|
||||
|
||||
public void setRequester(CreatureObject requester) {
|
||||
this.requester = requester;
|
||||
}
|
||||
}
|
||||
@@ -304,13 +304,13 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildMissionDescriptionDelta(String desc, int id) {
|
||||
public IoBuffer buildMissionDescriptionDelta(String desc, int id, String additionalParam) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(12 + desc.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
IoBuffer buffer = IoBuffer.allocate(13 + desc.length() + additionalParam.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.put(getAsciiString(desc));
|
||||
buffer.putInt(0);
|
||||
buffer.put(getAsciiString("m" + id + "d"));
|
||||
buffer.put(getAsciiString("m" + id + "d" + additionalParam));
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
@@ -318,14 +318,14 @@ public class MissionMessageBuilder extends ObjectMessageBuilder {
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public IoBuffer buildMissionTitleDelta(String title, int id) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(12 + title.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
public IoBuffer buildMissionTitleDelta(String title, int id, String additionalParam) {
|
||||
|
||||
IoBuffer buffer = IoBuffer.allocate(12 + title.length() + additionalParam.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
buffer.put(getAsciiString(title));
|
||||
buffer.putInt(0);
|
||||
buffer.put(getAsciiString("m" + id + "t"));
|
||||
buffer.put(getAsciiString("m" + id + "t" + additionalParam));
|
||||
|
||||
int size = buffer.position();
|
||||
buffer.flip();
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.sleepycat.je.Transaction;
|
||||
import com.sleepycat.persist.model.NotPersistent;
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
import resources.common.BountyListItem;
|
||||
import resources.objects.intangible.IntangibleObject;
|
||||
import resources.objects.waypoint.WaypointObject;
|
||||
import services.mission.MissionObjective;
|
||||
@@ -56,8 +57,11 @@ public class MissionObject extends IntangibleObject implements Serializable {
|
||||
private String type = "";
|
||||
private int missionTemplateObject = 0;
|
||||
private WaypointObject attachedWaypoint;
|
||||
|
||||
// Server variables
|
||||
private MissionObjective objective;
|
||||
|
||||
private long bountyObjId;
|
||||
|
||||
@NotPersistent
|
||||
private transient MissionMessageBuilder messageBuilder = new MissionMessageBuilder(this);
|
||||
|
||||
@@ -148,11 +152,15 @@ public class MissionObject extends IntangibleObject implements Serializable {
|
||||
}
|
||||
|
||||
public void setMissionDescription(String missionDescription) {
|
||||
setMissionDescription(missionDescription, "");
|
||||
}
|
||||
|
||||
public void setMissionDescription(String missionDescription, String additionalParam) {
|
||||
synchronized(objectMutex) {
|
||||
this.description = missionDescription;
|
||||
}
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionDescriptionDelta(missionDescription, missionId));
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionDescriptionDelta(missionDescription, missionId, additionalParam));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,11 +171,15 @@ public class MissionObject extends IntangibleObject implements Serializable {
|
||||
}
|
||||
|
||||
public void setMissionTitle(String missionTitle) {
|
||||
setMissionTitle(missionTitle, "");
|
||||
}
|
||||
|
||||
public void setMissionTitle(String missionTitle, String additionalParam) {
|
||||
synchronized(objectMutex) {
|
||||
this.title = missionTitle;
|
||||
}
|
||||
if (getGrandparent() != null && getGrandparent().getClient() != null && getGrandparent().getClient().getSession() != null) {
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionTitleDelta(missionTitle, missionId));
|
||||
getGrandparent().getClient().getSession().write(messageBuilder.buildMissionTitleDelta(missionTitle, missionId, additionalParam));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,6 +298,14 @@ public class MissionObject extends IntangibleObject implements Serializable {
|
||||
this.missionId = missionId;
|
||||
}
|
||||
|
||||
public long getBountyObjId() {
|
||||
return bountyObjId;
|
||||
}
|
||||
|
||||
public void setBountyObjId(long bountyObjId) {
|
||||
this.bountyObjId = bountyObjId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendBaselines(Client destination) {
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects.tangible;
|
||||
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
import engine.resources.scene.Planet;
|
||||
import engine.resources.scene.Point3D;
|
||||
import engine.resources.scene.Quaternion;
|
||||
|
||||
/**
|
||||
* @author Charon
|
||||
*/
|
||||
@Persistent(version=0)
|
||||
public class Deed extends TangibleObject {
|
||||
|
||||
public Deed(long objectID, Planet planet, String template, Point3D position, Quaternion orientation){
|
||||
super(objectID, planet, template, position, orientation);
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects.tangible;
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
import engine.resources.scene.Planet;
|
||||
import engine.resources.scene.Point3D;
|
||||
import engine.resources.scene.Quaternion;
|
||||
|
||||
/**
|
||||
* @author Charon
|
||||
*/
|
||||
@Persistent(version=0)
|
||||
public class Harvester_Deed extends Deed {
|
||||
|
||||
private String name;
|
||||
private String structureTemplate;
|
||||
private String constructorTemplate;
|
||||
private int outputHopperCapacity=0;
|
||||
private int BER=0;
|
||||
private int BMR=0;
|
||||
private int surplusMaintenance=0;
|
||||
private int surplusPower=0;
|
||||
private int lotRequirement;
|
||||
|
||||
|
||||
public Harvester_Deed(long objectID, Planet planet, String template, Point3D position, Quaternion orientation){
|
||||
super(objectID, planet, template, position, orientation);
|
||||
}
|
||||
|
||||
public int getOutputHopperCapacity() {
|
||||
return outputHopperCapacity;
|
||||
}
|
||||
public void setOutputHopperCapacity(int outputHopperCapacity) {
|
||||
this.outputHopperCapacity = outputHopperCapacity;
|
||||
}
|
||||
public int getBER() {
|
||||
return BER;
|
||||
}
|
||||
public void setBER(int bER) {
|
||||
this.BER = bER;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getStructureTemplate() {
|
||||
return structureTemplate;
|
||||
}
|
||||
public void setStructureTemplate(String structureTemplate) {
|
||||
this.structureTemplate = structureTemplate;
|
||||
}
|
||||
public int getLotRequirement() {
|
||||
return lotRequirement;
|
||||
}
|
||||
public void setLotRequirement(int lotRequirement) {
|
||||
this.lotRequirement = lotRequirement;
|
||||
}
|
||||
public String getConstructorTemplate() {
|
||||
return constructorTemplate;
|
||||
}
|
||||
public void setConstructorTemplate(String constructorTemplate) {
|
||||
this.constructorTemplate = constructorTemplate;
|
||||
}
|
||||
public int getBMR() {
|
||||
return BMR;
|
||||
}
|
||||
public void setBMR(int BMR) {
|
||||
this.BMR = BMR;
|
||||
}
|
||||
public int getSurplusMaintenance() {
|
||||
return surplusMaintenance;
|
||||
}
|
||||
public void setSurplusMaintenance(int surplusMaintenance) {
|
||||
this.surplusMaintenance = surplusMaintenance;
|
||||
}
|
||||
|
||||
public int getSurplusPower() {
|
||||
return surplusPower;
|
||||
}
|
||||
|
||||
public void setSurplusPower(int surplusPower) {
|
||||
this.surplusPower = surplusPower;
|
||||
}
|
||||
|
||||
|
||||
public void setAttributes() {
|
||||
this.getAttributes().put("@obj_attr_n:volume", "1");
|
||||
this.getAttributes().put("@obj_attr_n:examine_maintenance_rate", ""+this.getBMR() + "/hour");
|
||||
if (this.getSurplusMaintenance()>0)
|
||||
this.getAttributes().put("@obj_attr_n:examine_maintenance", ""+this.getSurplusMaintenance());
|
||||
|
||||
//this.getAttributes().put("@obj_attr_n:energy_maintenance", "0");
|
||||
if (this.getSurplusPower()>0)
|
||||
this.getAttributes().put("@obj_attr_n:examine_power", ""+this.getSurplusPower());
|
||||
|
||||
this.getAttributes().put("@obj_attr_n:examine_hoppersize", ""+this.getOutputHopperCapacity());
|
||||
this.getAttributes().put("@obj_attr_n:examine_extractionrate", ""+this.getBER());
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013 <Project SWG>
|
||||
*
|
||||
* This File is part of NGECore2.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
|
||||
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
|
||||
******************************************************************************/
|
||||
package resources.objects.tangible;
|
||||
import com.sleepycat.persist.model.Persistent;
|
||||
|
||||
import engine.resources.scene.Planet;
|
||||
import engine.resources.scene.Point3D;
|
||||
import engine.resources.scene.Quaternion;
|
||||
|
||||
/**
|
||||
* @author Seefo
|
||||
* @author Charon
|
||||
*/
|
||||
|
||||
@Persistent(version=0)
|
||||
public class Player_House_Deed extends Deed {
|
||||
|
||||
private String name;
|
||||
private String structureTemplate;
|
||||
private String constructorTemplate;
|
||||
private int BMR=0;
|
||||
private int surplusMaintenance=0;
|
||||
private int lotRequirement;
|
||||
|
||||
public Player_House_Deed(long objectID, Planet planet, String template, Point3D position, Quaternion orientation){
|
||||
super(objectID, planet, template, position, orientation);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getStructureTemplate() {
|
||||
return structureTemplate;
|
||||
}
|
||||
public void setStructureTemplate(String structureTemplate) {
|
||||
this.structureTemplate = structureTemplate;
|
||||
}
|
||||
public int getLotRequirement() {
|
||||
return lotRequirement;
|
||||
}
|
||||
public void setLotRequirement(int lotRequirement) {
|
||||
this.lotRequirement = lotRequirement;
|
||||
}
|
||||
public String getConstructorTemplate() {
|
||||
return constructorTemplate;
|
||||
}
|
||||
public void setConstructorTemplate(String constructorTemplate) {
|
||||
this.constructorTemplate = constructorTemplate;
|
||||
}
|
||||
public int getBMR() {
|
||||
return BMR;
|
||||
}
|
||||
public void setBMR(int BMR) {
|
||||
this.BMR = BMR;
|
||||
}
|
||||
public int getSurplusMaintenance() {
|
||||
return surplusMaintenance;
|
||||
}
|
||||
public void setSurplusMaintenance(int surplusMaintenance) {
|
||||
this.surplusMaintenance = surplusMaintenance;
|
||||
}
|
||||
|
||||
public void setAttributes() {
|
||||
this.getAttributes().put("@obj_attr_n:volume", "1");
|
||||
this.getAttributes().put("@obj_attr_n:examine_maintenance_rate", ""+this.getBMR() + "/hour");
|
||||
if (this.getSurplusMaintenance()>0)
|
||||
this.getAttributes().put("@obj_attr_n:examine_maintenance", ""+this.getSurplusMaintenance());
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -41,8 +41,8 @@ import protocol.swg.objectControllerObjects.ShowFlyText;
|
||||
import resources.common.OutOfBand;
|
||||
import resources.common.RGB;
|
||||
import resources.datatables.Options;
|
||||
import resources.loot.LootGroup;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
import resources.objects.loot.LootGroup;
|
||||
import resources.visitors.IDManagerVisitor;
|
||||
|
||||
import com.sleepycat.persist.model.NotPersistent;
|
||||
|
||||
Reference in New Issue
Block a user