Hey, i am working on custom npc, that will show private store list of players, by selected category. Example if i select category dagger weapons, npc will show list of available shops with dagger type weapons. I have a little problem, when there is no shops in world, the "No items to show" msg is not shown in npc htm. Maybe someone would know what is bad? For me it's pretty hard.
else if (currentCommand.startsWith("category"))
{
String categoryName = st.nextToken();
final StringBuilder sb = new StringBuilder(200);
for (Player storeChar : World.getInstance().getPlayers())
{
if (storeChar.isInStoreMode() && storeChar.getStoreType() == StoreType.SELL)
{
for (TradeItem i : storeChar.getSellList().getItems())
{
if (categoryName.startsWith("dagger"))
{
if(i.getItem().getItemType() == WeaponType.DAGGER){
sb.append("<tablewidth=240height=42><tr>");
sb.append("<tdwidth=32height=32align=center><imgsrc=Icon.item"+i.getItem().getItemId()+"width=32height=32></td>");
sb.append("<td>" + i.getItem().getName() + "</td>");
sb.append("</tr><tr><tdheight=7></td></tr></table>");
}
else{
sb.append("No items to show");
}
}
}
}
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
html.setFile("data/html/auctioneerManager/categoryView.htm");
html.replace("%objectId%", getObjectId());
html.replace("%items%", sb.toString());
player.sendPacket(html);
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Product Information :
+ Clean accounts.
+ Unique names.
+ Very fast seller.
+ Verified email and phone.
Account Prices :
Prices can be found inside the server.
Contacts
Discord : skyserners
Telegram : skyserners
Server Discord : https://discord.gg/Z7hYfUaT
Question
admirolas3
Hey, i am working on custom npc, that will show private store list of players, by selected category. Example if i select category dagger weapons, npc will show list of available shops with dagger type weapons. I have a little problem, when there is no shops in world, the "No items to show" msg is not shown in npc htm. Maybe someone would know what is bad? For me it's pretty hard.
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.