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);
}
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.
Edited by admirolas38 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now