Fixed callback buffs for buffs

This commit is contained in:
Mads Boddum
2016-10-19 10:50:48 +02:00
parent 47bc9d4e9a
commit 0a3ebe53a5
5 changed files with 11 additions and 14 deletions
-1
View File
@@ -27,7 +27,6 @@
***********************************************************************************/
package network;
import network.packets.swg.zone.StopClientEffectObjectByLabelMessage;
import network.packets.swg.*;
import network.packets.swg.holo.HoloConnectionStarted;
import network.packets.swg.holo.HoloConnectionStopped;
@@ -33,6 +33,7 @@ import java.util.Set;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import network.packets.swg.zone.UpdatePostureMessage;
@@ -62,9 +63,6 @@ import utilities.Encoder.StringType;
public class CreatureObject extends TangibleObject {
private static final long serialVersionUID = 3L;
private transient GroupInviterData inviterData = new GroupInviterData(0, null, "", 0);
private transient long lastReserveOperation = 0;
private final CreatureObjectClientServerNP creo4 = new CreatureObjectClientServerNP();
@@ -602,6 +600,10 @@ public class CreatureObject extends TangibleObject {
creo6.removeBuff(buffCrc, this);
}
public boolean hasBuff(String buffName) {
return getBuffByCrc(new CRC(buffName.toLowerCase(Locale.ENGLISH))) != null;
}
public Buff getBuffByCrc(CRC buffCrc) {
return creo6.getBuffByCrc(buffCrc);
}
@@ -90,10 +90,6 @@ public class PlayerObject extends IntangibleObject {
sendDelta(3, 7, title, StringType.ASCII);
}
/**
* Calling this method will update the playTime field.
* @return the amount of time this PlayerObject has played.
*/
public int getPlayTime() {
return play3.getPlayTime();
}
@@ -103,7 +99,7 @@ public class PlayerObject extends IntangibleObject {
play3.setPlayTime(playTime);
sendDelta(3, 9, playTime);
}
public int getGcwPoints() {
return play3.getGcwPoints();
}
+1 -1
View File
@@ -336,7 +336,7 @@ public class CombatManager extends Manager {
// We need to handle this differently, depending on whether killedCreature is a player or not
if(corpse.isPlayer()) {
if (corpse.getBuffByCrc(new CRC("incapweaken")) != null) {
if (corpse.hasBuff("incapWeaken")) {
// Kill this sucka immediately
killCreature(killer, corpse);
} else {
+4 -4
View File
@@ -52,10 +52,10 @@ import utilities.ThreadUtilities;
public class BuffService extends Service {
// TODO buff slots A, B, C and D
// TODO buff groups and prioritisation
// TODO remove buffs on respec. Listen for respec event and remove buffs with BuffData where REMOVE_ON_RESPEC == 1
// TODO remove group buff(s) from receiver when distance between caster and receiver is 100m. Perform same check upon zoning in
// TODO decay buffs on deathblow buffs with BuffData where DECAY_ON_PVP_DEATH == 1
// TODO on deathblow, decay buffs with BuffData where DECAY_ON_PVP_DEATH == 1
private final ScheduledExecutorService executor;
private final Map<CreatureObject, DelayQueue<BuffDelayed>> buffRemoval;
@@ -236,10 +236,10 @@ public class BuffService extends Service {
String callback = buffData.getCallback();
if(callback.isEmpty())
if(callback.equals("none"))
return;
CRC callbackCrc = new CRC(callback);
CRC callbackCrc = new CRC(callback.toLowerCase(Locale.ENGLISH));
if(dataMap.containsKey(callbackCrc)) {
// Apply the callback buff
addBuff(callbackCrc, creature, creature);