Custom Shift+Click Drop View Window
To enable this option set AltGameViewNpc = True in AltSettings.propertiesIn gameserver\model\actor\instance\L2NpcInstance.java find and replace:
- Code:
else if (Config.ALT_GAME_VIEWNPC)
{
NpcHtmlMessage html = new NpcHtmlMessage(0);
StringBuilder html1 = new StringBuilder("<html><body><center>");
html1.append("<table border=1 width=\"100%\">");
html1.append("<tr><td>Max.HP</td><td>" + getMaxHp() + "</td><td>P.Atk.</td><td>" + getPAtk(null) + "</td><td>P.Def</td><td>" + getPDef(null) + "</td></tr>");
html1.append("<tr><td>Max.MP</td><td>" + getMaxMp() + "</td><td>M.Atk.</td><td>" + getMAtk(null, null) + "</td><td>M.Def.</td><td>" + getMDef(null, null) + "</td></tr>");
html1.append("</table><br>");
html1.append("<table border=1 width=\"100%\">");
html1.append("<tr><td><center>Item Name</center></td><td><center>Chance</center></td></tr>");
if (getTemplate().getDropData() != null)
{
for (L2DropCategory cat : getTemplate().getDropData())
for (L2DropData drop : cat.getAllDrops())
if (cat.getCategoryType() >= 0)
{
String name = ItemTable.getInstance().getTemplate(drop.getItemId()).getName();
html1.append("<tr><td><font color=\"FFCF48\">" + name + "</font></td>" + "<td><center>" + (drop.getChance() >= 10 ? (double)drop.getChance() / 10000 : "0.001") + "%</center></td></tr>");
}
for (L2DropCategory cat : getTemplate().getDropData())
for (L2DropData drop : cat.getAllDrops())
if (cat.getCategoryType() < 0)
{
String name = ItemTable.getInstance().getTemplate(drop.getItemId()).getName();
html1.append("<tr><td><font color=\"42AAFF\">" + name + "</font></td>" + "<td><center>" + (double)drop.getChance() / 10000 + "%</center></td></tr>");
}
}
html1.append("</table>");
html1.append("</center></body></html>");
html.setHtml(html1.toString());
player.sendPacket(html);
}
To prevent issues with too long item names and symbols in dyes names.
- Code:
UPDATE etcitem SET name = REPLACE (name, '<', '(');
UPDATE etcitem SET name = REPLACE (name, '>', ')');
UPDATE etcitem SET name = REPLACE (name, 'Compressed Package(100%)', '(Packed)');
UPDATE etcitem SET name = REPLACE (name, 'Compressed Package (100%)', '(Packed)');
UPDATE etcitem SET name = REPLACE (name, 'Greater Blessed', 'Gr.Blessed');
UPDATE etcitem SET name = REPLACE (name, 'Greater Spiritshot', 'Gr.Spiritshot');
UPDATE etcitem SET name = REPLACE (name, 'Greater Soulshot', 'Gr.Soulshot');
Optionally you can round values (for mid/high rate servers)
- Code:
UPDATE droplist SET chance = ROUND(chance,-3) WHERE chance > 100000;
UPDATE droplist SET chance = ROUND(chance,-2) WHERE chance BETWEEN 1000 AND 100000;
UPDATE droplist SET chance = ROUND(chance,-1) WHERE chance BETWEEN 100 AND 1000;
Tested with build 713.
Last edited by improvise on 14th February 2020, 07:43; edited 10 times in total