Addition of item icons and drop mod view with icons.
This commit is contained in:
@@ -878,26 +878,9 @@ public class NpcInstance extends Creature
|
||||
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(0);
|
||||
final StringBuilder html1 = new StringBuilder("<html><body>");
|
||||
html1.append("<br><center><font color=\"LEVEL\">[Combat Stats]</font></center>");
|
||||
html1.append("<br><center><font color=\"LEVEL\">[Drop Info]</font>");
|
||||
html1.append("<table border=0 width=\"100%\">");
|
||||
html1.append("<tr><td>Max.HP</td><td>" + (int) (getMaxHp() / getStat().calcStat(Stat.MAX_HP, 1, this, null)) + "*" + (int) getStat().calcStat(Stat.MAX_HP, 1, this, null) + "</td><td>Max.MP</td><td>" + getMaxMp() + "</td></tr>");
|
||||
html1.append("<tr><td>P.Atk.</td><td>" + getPAtk(null) + "</td><td>M.Atk.</td><td>" + getMAtk(null, null) + "</td></tr>");
|
||||
html1.append("<tr><td>P.Def.</td><td>" + getPDef(null) + "</td><td>M.Def.</td><td>" + getMDef(null, null) + "</td></tr>");
|
||||
html1.append("<tr><td>Accuracy</td><td>" + getAccuracy() + "</td><td>Evasion</td><td>" + getEvasionRate(null) + "</td></tr>");
|
||||
html1.append("<tr><td>Critical</td><td>" + getCriticalHit(null, null) + "</td><td>Speed</td><td>" + getRunSpeed() + "</td></tr>");
|
||||
html1.append("<tr><td>Atk.Speed</td><td>" + getPAtkSpd() + "</td><td>Cast.Speed</td><td>" + getMAtkSpd() + "</td></tr>");
|
||||
html1.append("<tr><td>Race</td><td>" + getTemplate().getRace() + "</td><td></td><td></td></tr>");
|
||||
html1.append("</table>");
|
||||
|
||||
html1.append("<br><center><font color=\"LEVEL\">[Basic Stats]</font></center>");
|
||||
html1.append("<table border=0 width=\"100%\">");
|
||||
html1.append("<tr><td>STR</td><td>" + getSTR() + "</td><td>DEX</td><td>" + getDEX() + "</td><td>CON</td><td>" + getCON() + "</td></tr>");
|
||||
html1.append("<tr><td>INT</td><td>" + getINT() + "</td><td>WIT</td><td>" + getWIT() + "</td><td>MEN</td><td>" + getMEN() + "</td></tr>");
|
||||
html1.append("</table>");
|
||||
|
||||
html1.append("<br><center><font color=\"LEVEL\">[Drop Info]</font><br>");
|
||||
html1.append("Rates legend: <font color=\"ff0000\">50%+</font> <font color=\"00ff00\">30%+</font> <font color=\"0000ff\">less than 30%</font>");
|
||||
html1.append("<table border=0 width=\"100%\">");
|
||||
for (DropCategory cat : getTemplate().getDropData())
|
||||
{
|
||||
final List<DropData> drops = cat.getAllDrops();
|
||||
@@ -910,26 +893,14 @@ public class NpcInstance extends Creature
|
||||
continue;
|
||||
}
|
||||
|
||||
final String name = ItemTable.getInstance().getTemplate(drop.getItemId()).getName();
|
||||
if (drop.getChance() >= 600000)
|
||||
{
|
||||
html1.append("<tr><td><font color=\"ff0000\">" + name + "</font></td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
|
||||
}
|
||||
else if (drop.getChance() >= 300000)
|
||||
{
|
||||
html1.append("<tr><td><font color=\"00ff00\">" + name + "</font></td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
|
||||
}
|
||||
else
|
||||
{
|
||||
html1.append("<tr><td><font color=\"0000ff\">" + name + "</font></td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
|
||||
}
|
||||
final Item item = ItemTable.getInstance().getTemplate(drop.getItemId());
|
||||
html1.append("<tr><td><br><img src=\"" + item.getIcon() + "\" width=32 height=32>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "<font color=\"0040FF\">" : "<font color=\"FFFFFF\">") + item.getName() + "</font> </td><td>" + (drop.getChance() / 10000.0) + "%</td><td>" + (drop.isQuestDrop() ? "Quest" : cat.isSweep() ? "Sweep" : "Drop") + "</td></tr>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
html1.append("</table>");
|
||||
html1.append("</body></html>");
|
||||
|
||||
html.setHtml(html1.toString());
|
||||
player.sendPacket(html);
|
||||
}
|
||||
|
@@ -118,6 +118,7 @@ public abstract class Item
|
||||
|
||||
private final int _itemId;
|
||||
private final String _name;
|
||||
private final String _icon;
|
||||
private final int _type1; // needed for item list (inventory)
|
||||
private final int _type2; // different lists for armor, weapon, etc
|
||||
private final int _weight;
|
||||
@@ -148,6 +149,7 @@ public abstract class Item
|
||||
* <li>type</li>
|
||||
* <li>_itemId</li>
|
||||
* <li>_name</li>
|
||||
* <li>_icon</li>
|
||||
* <li>_type1 & _type2</li>
|
||||
* <li>_weight</li>
|
||||
* <li>_crystallizable</li>
|
||||
@@ -165,6 +167,7 @@ public abstract class Item
|
||||
_type = type;
|
||||
_itemId = set.getInt("item_id");
|
||||
_name = set.getString("name");
|
||||
_icon = set.getString("icon", "");
|
||||
_type1 = set.getInt("type1"); // needed for item list (inventory)
|
||||
_type2 = set.getInt("type2"); // different lists for armor, weapon, etc
|
||||
_weight = set.getInt("weight", 0);
|
||||
@@ -369,6 +372,15 @@ public abstract class Item
|
||||
return _name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the icon of the item
|
||||
* @return String
|
||||
*/
|
||||
public String getIcon()
|
||||
{
|
||||
return _icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the part of the body used with the item.
|
||||
* @return int
|
||||
|
Reference in New Issue
Block a user