Browse Source

Serialization update.

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

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

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

Loading…
Cancel
Save