|
|
|
@ -27,8 +27,6 @@ import org.pmw.tinylog.Logger;
@@ -27,8 +27,6 @@ import org.pmw.tinylog.Logger;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashSet; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Order NPC |
|
|
|
@ -436,12 +434,13 @@ public class ManageNPCMsg extends ClientNetMsg {
@@ -436,12 +434,13 @@ public class ManageNPCMsg extends ClientNetMsg {
|
|
|
|
|
writer.put((byte) template.modTable);//EffectItemType
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Item> itemList = ForgeManager.vendorItemLookup.get(npc); |
|
|
|
|
itemList = itemList.stream().limit(npc.getRank()).collect(Collectors.toList()); |
|
|
|
|
// Sanity check.
|
|
|
|
|
|
|
|
|
|
writer.putInt(itemList.size()); |
|
|
|
|
ForgeManager.vendorItemLookup.computeIfAbsent(npc, k -> new ArrayList<>()); // Forge lookup
|
|
|
|
|
|
|
|
|
|
for (Item item : itemList) { |
|
|
|
|
writer.putInt(ForgeManager.vendorItemLookup.get(npc).size()); |
|
|
|
|
|
|
|
|
|
for (Item item : ForgeManager.vendorItemLookup.get(npc)) { |
|
|
|
|
|
|
|
|
|
writer.put((byte) 0); // ? Unknown45
|
|
|
|
|
writer.putInt(item.getObjectType().ordinal()); |
|
|
|
|