Browse Source

Update to item effect serialization

combat-2
MagicBot 8 months ago
parent
commit
c03c1f4057
  1. 18
      src/engine/net/client/msg/ManageNPCMsg.java
  2. 9
      src/engine/objects/Item.java

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

@ -476,15 +476,29 @@ public class ManageNPCMsg extends ClientNetMsg { @@ -476,15 +476,29 @@ public class ManageNPCMsg extends ClientNetMsg {
else
writer.putInt(-1497023830);
if ((prefix != null && !item.isRandom()) || (prefix != null && item.isComplete()))
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 ((suffix != null && !item.isRandom()) || (suffix != null && item.isComplete()))
if (item.suffixToken == 0) {
if (!item.isComplete())
writer.putInt(0);
else
writer.putInt(suffix.getToken());
} else {
if (suffix != null)
writer.putInt(suffix.getToken());
else
writer.putInt(0);
}
writer.putString(item.name);
}

9
src/engine/objects/Item.java

@ -51,7 +51,6 @@ public class Item extends AbstractWorldObject { @@ -51,7 +51,6 @@ public class Item extends AbstractWorldObject {
public int chargesRemaining;
public mbEnums.EquipSlotType equipSlot;
private boolean canDestroy;
private boolean isRandom = false;
public int value;
public OwnerType ownerType;
public int templateID;
@ -1129,14 +1128,6 @@ public class Item extends AbstractWorldObject { @@ -1129,14 +1128,6 @@ public class Item extends AbstractWorldObject {
this.value = value;
}
public boolean isRandom() {
return isRandom;
}
public void setRandom(boolean isRandom) {
this.isRandom = isRandom;
}
public boolean isCustomValue() {
if (this.value == 0)
return false;

Loading…
Cancel
Save