Browse Source

Cleaner rank filter on display

master
MagicBot 1 year ago
parent
commit
e3f468681a
  1. 12
      src/engine/net/client/msg/ManageNPCMsg.java

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

@ -26,7 +26,9 @@ import org.pmw.tinylog.Logger; @@ -26,7 +26,9 @@ import org.pmw.tinylog.Logger;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/**
* Order NPC
@ -362,6 +364,7 @@ public class ManageNPCMsg extends ClientNetMsg { @@ -362,6 +364,7 @@ public class ManageNPCMsg extends ClientNetMsg {
long curTime = System.currentTimeMillis() / 1000;
long upgradeTime = (mob.deathTime + (mob.spawnTime * 1000)) / 1000;
long timeLife = upgradeTime - curTime;
if (upgradeTime * 1000 > System.currentTimeMillis()) {
if (mob.npcOwner.isAlive()) {
writer.put((byte) 0);//shows respawning timer
@ -402,13 +405,14 @@ public class ManageNPCMsg extends ClientNetMsg { @@ -402,13 +405,14 @@ public class ManageNPCMsg extends ClientNetMsg {
writer.putInt(0);
else
writer.putInt(npc.getRank()); //vendor slots
writer.putInt(0); //artilerist slots
writer.putInt(0); //runemaster slots
writer.putInt(1); //is this static?
for (int i = 0; i < 4; i++) {
for (int i = 0; i < 4; i++)
writer.putInt(0); //statics
}
HashSet<Integer> rollableSet = npc.getCanRoll();
@ -428,7 +432,9 @@ public class ManageNPCMsg extends ClientNetMsg { @@ -428,7 +432,9 @@ public class ManageNPCMsg extends ClientNetMsg {
writer.put((byte) item.getModTable());
writer.put((byte) item.getModTable());//EffectItemType
}
ArrayList<MobLoot> itemList = npc.getRolling();
List<MobLoot> itemList = npc.getRolling();
itemList = itemList.stream().limit(npc.getRank()).collect(Collectors.toList());
writer.putInt(itemList.size());

Loading…
Cancel
Save