Browse Source

Serialization update.

combat-2
MagicBot 7 months ago
parent
commit
28c6953c3d
  1. 44
      src/engine/net/client/msg/ManageNPCMsg.java

44
src/engine/net/client/msg/ManageNPCMsg.java

@ -10,7 +10,6 @@ @@ -10,7 +10,6 @@
package engine.net.client.msg;
import engine.gameManager.NPCManager;
import engine.gameManager.PowersManager;
import engine.mbEnums.GameObjectType;
import engine.mbEnums.MinionType;
import engine.mbEnums.ProtectionState;
@ -18,7 +17,6 @@ import engine.net.ByteBufferReader; @@ -18,7 +17,6 @@ import engine.net.ByteBufferReader;
import engine.net.ByteBufferWriter;
import engine.net.Protocol;
import engine.objects.*;
import engine.powers.EffectsBase;
import org.joda.time.DateTime;
import org.joda.time.Period;
import org.joda.time.Seconds;
@ -458,48 +456,18 @@ public class ManageNPCMsg extends ClientNetMsg { @@ -458,48 +456,18 @@ public class ManageNPCMsg extends ClientNetMsg {
else
writer.put((byte) 0);
ArrayList<String> effectsList = item.getEffectNames();
EffectsBase prefix = null;
EffectsBase suffix = null;
for (String effectName : effectsList) {
if (effectName.contains("PRE"))
prefix = PowersManager.getEffectByIDString(effectName);
if (effectName.contains("SUF"))
suffix = PowersManager.getEffectByIDString(effectName);
}
if ((prefix == null && suffix == null))
if ((item.prefixToken == 0 && item.suffixToken == 0))
writer.putInt(0);
else
writer.putInt(-1497023830);
if (item.prefixToken == 0) {
if (!item.isComplete())
writer.putInt(0);
else
writer.putInt(prefix.getToken());
} else {
if (prefix != null)
writer.putInt(prefix.getToken());
else
writer.putInt(0);
}
if (item.suffixToken == 0) {
if (!item.isComplete())
writer.putInt(0);
else
writer.putInt(suffix.getToken());
if (!item.isComplete()) {
writer.putInt(0);
writer.putInt(0);
} else {
if (suffix != null)
writer.putInt(suffix.getToken());
else
writer.putInt(0);
writer.putInt(item.prefixToken);
writer.putInt(item.suffixToken);
}
writer.putString(item.name);
}

Loading…
Cancel
Save