Changed back to previous drop system.
This commit is contained in:
@@ -77,7 +77,7 @@ public class NpcViewMod implements IBypassHandler
|
||||
{
|
||||
target = L2World.getInstance().findObject(Integer.parseInt(st.nextToken()));
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
catch (final NumberFormatException e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -116,11 +116,11 @@ public class NpcViewMod implements IBypassHandler
|
||||
}
|
||||
sendNpcDropList(activeChar, npc, dropListScope, st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
catch (final NumberFormatException e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
catch (final IllegalArgumentException e)
|
||||
{
|
||||
_log.warning("Bypass[NpcViewMod] unknown drop list scope: " + dropListScopeString);
|
||||
return false;
|
||||
@@ -155,7 +155,7 @@ public class NpcViewMod implements IBypassHandler
|
||||
{
|
||||
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
|
||||
long min = Long.MAX_VALUE;
|
||||
for (TimeUnit tu : TimeUnit.values())
|
||||
for (final TimeUnit tu : TimeUnit.values())
|
||||
{
|
||||
final long minTimeFromMillis = tu.convert(npcSpawn.getRespawnMinDelay(), TimeUnit.MILLISECONDS);
|
||||
final long maxTimeFromMillis = tu.convert(npcSpawn.getRespawnMaxDelay(), TimeUnit.MILLISECONDS);
|
||||
@@ -287,7 +287,34 @@ public class NpcViewMod implements IBypassHandler
|
||||
final IDropItem dropItem = dropList.get(i);
|
||||
if (dropItem instanceof GeneralDropItem)
|
||||
{
|
||||
addGeneralDropItem(activeChar, npc, amountFormat, chanceFormat, sb, (GeneralDropItem) dropItem);
|
||||
final GeneralDropItem generalDropItem = (GeneralDropItem) dropItem;
|
||||
final L2Item item = ItemTable.getInstance().getTemplate(generalDropItem.getItemId());
|
||||
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");
|
||||
sb.append("<tr><td width=32 valign=top>");
|
||||
sb.append("<img src=\"" + item.getIcon() + "\" width=32 height=32>");
|
||||
sb.append("</td><td fixwidth=300 align=center><font name=\"hs9\" color=\"CD9000\">");
|
||||
sb.append(item.getName());
|
||||
sb.append("</font></td></tr><tr><td width=32></td><td width=300><table width=295 cellpadding=0 cellspacing=0>");
|
||||
sb.append("<tr><td width=48 align=right valign=top><font color=\"LEVEL\">Amount:</font></td>");
|
||||
sb.append("<td width=247 align=center>");
|
||||
|
||||
final long min = generalDropItem.getMin(npc, activeChar);
|
||||
final long max = generalDropItem.getMax(npc, activeChar);
|
||||
if (min == max)
|
||||
{
|
||||
sb.append(amountFormat.format(min));
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append(amountFormat.format(min));
|
||||
sb.append(" - ");
|
||||
sb.append(amountFormat.format(max));
|
||||
}
|
||||
|
||||
sb.append("</td></tr><tr><td width=48 align=right valign=top><font color=\"LEVEL\">Chance:</font></td>");
|
||||
sb.append("<td width=247 align=center>");
|
||||
sb.append(chanceFormat.format(Math.min(generalDropItem.getChance(npc, activeChar), 100)));
|
||||
sb.append("%</td></tr></table></td></tr><tr><td width=32></td><td width=300> </td></tr></table>");
|
||||
}
|
||||
else if (dropItem instanceof GroupedGeneralDropItem)
|
||||
{
|
||||
@@ -295,21 +322,46 @@ public class NpcViewMod implements IBypassHandler
|
||||
if (generalGroupedDropItem.getItems().size() == 1)
|
||||
{
|
||||
final GeneralDropItem generalDropItem = generalGroupedDropItem.getItems().get(0);
|
||||
addGeneralDropItem(activeChar, npc, amountFormat, chanceFormat, sb, new GeneralDropItem(generalDropItem.getItemId(), generalDropItem.getMin(), generalDropItem.getMax(), (generalDropItem.getChance(npc, activeChar) * generalGroupedDropItem.getChance()) / 100, generalDropItem.getAmountStrategy(), generalDropItem.getChanceStrategy(), generalGroupedDropItem.getPreciseStrategy(), generalGroupedDropItem.getKillerChanceModifierStrategy(), generalDropItem.getDropCalculationStrategy()));
|
||||
final L2Item item = ItemTable.getInstance().getTemplate(generalDropItem.getItemId());
|
||||
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");
|
||||
sb.append("<tr><td width=32 valign=top>");
|
||||
sb.append("<img src=\"" + item.getIcon() + "\" width=32 height=32>");
|
||||
sb.append("</td><td fixwidth=300 align=center><font name=\"hs9\" color=\"CD9000\">");
|
||||
sb.append(item.getName());
|
||||
sb.append("</font></td></tr><tr><td width=32></td><td width=300><table width=295 cellpadding=0 cellspacing=0>");
|
||||
sb.append("<tr><td width=48 align=right valign=top><font color=\"LEVEL\">Amount:</font></td>");
|
||||
sb.append("<td width=247 align=center>");
|
||||
|
||||
final long min = generalDropItem.getMin(npc, activeChar);
|
||||
final long max = generalDropItem.getMax(npc, activeChar);
|
||||
if (min == max)
|
||||
{
|
||||
sb.append(amountFormat.format(min));
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append(amountFormat.format(min));
|
||||
sb.append(" - ");
|
||||
sb.append(amountFormat.format(max));
|
||||
}
|
||||
|
||||
sb.append("</td></tr><tr><td width=48 align=right valign=top><font color=\"LEVEL\">Chance:</font></td>");
|
||||
sb.append("<td width=247 align=center>");
|
||||
sb.append(chanceFormat.format(Math.min(generalGroupedDropItem.getChance(npc, activeChar), 100)));
|
||||
sb.append("%</td></tr></table></td></tr><tr><td width=32></td><td width=300> </td></tr></table>");
|
||||
}
|
||||
else
|
||||
{
|
||||
final GroupedGeneralDropItem normalized = generalGroupedDropItem.normalizeMe(npc, activeChar);
|
||||
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");
|
||||
sb.append("<tr><td width=32 valign=top><img src=\"L2UI_CT1.ICON_DF_premiumItem\" width=32 height=32></td>");
|
||||
sb.append("<td fixwidth=300 align=center><font name=\"ScreenMessageSmall\" color=\"CD9000\">One from group</font>");
|
||||
sb.append("</td></tr><tr><td width=32></td><td width=300><table width=295 cellpadding=0 cellspacing=0><tr>");
|
||||
sb.append("<td width=48 align=right valign=top><font color=\"LEVEL\">Chance:</font></td>");
|
||||
sb.append("<td width=247 align=center>");
|
||||
sb.append(chanceFormat.format(Math.min(normalized.getChance(), 100)));
|
||||
sb.append(chanceFormat.format(Math.min(generalGroupedDropItem.getChance(npc, activeChar), 100)));
|
||||
sb.append("%</td></tr></table><br>");
|
||||
|
||||
for (GeneralDropItem generalDropItem : normalized.getItems())
|
||||
for (final GeneralDropItem generalDropItem : generalGroupedDropItem.getItems())
|
||||
{
|
||||
final L2Item item = ItemTable.getInstance().getTemplate(generalDropItem.getItemId());
|
||||
sb.append("<table width=291 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");
|
||||
@@ -324,9 +376,9 @@ public class NpcViewMod implements IBypassHandler
|
||||
sb.append(item.getName());
|
||||
sb.append("</font></td></tr><tr><td width=32></td><td width=259><table width=253 cellpadding=0 cellspacing=0>");
|
||||
sb.append("<tr><td width=48 align=right valign=top><font color=\"LEVEL\">Amount:</font></td><td width=205 align=center>");
|
||||
final MinMax minMax = getPreciseMinMax(normalized.getChance(), generalDropItem.getMin(npc, activeChar), generalDropItem.getMax(npc, activeChar), generalDropItem.isPreciseCalculated());
|
||||
final long min = minMax.min;
|
||||
final long max = minMax.max;
|
||||
|
||||
final long min = generalDropItem.getMin(npc, activeChar);
|
||||
final long max = generalDropItem.getMax(npc, activeChar);
|
||||
sb.append(amountFormat.format(min));
|
||||
if (min != max)
|
||||
{
|
||||
@@ -379,62 +431,4 @@ public class NpcViewMod implements IBypassHandler
|
||||
html = html.replaceAll("%items%", bodySb.toString());
|
||||
Util.sendCBHtml(activeChar, html);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param activeChar
|
||||
* @param npc
|
||||
* @param amountFormat
|
||||
* @param chanceFormat
|
||||
* @param sb
|
||||
* @param dropItem
|
||||
*/
|
||||
private static void addGeneralDropItem(L2PcInstance activeChar, L2Npc npc, DecimalFormat amountFormat, DecimalFormat chanceFormat, StringBuilder sb, GeneralDropItem dropItem)
|
||||
{
|
||||
final L2Item item = ItemTable.getInstance().getTemplate(dropItem.getItemId());
|
||||
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");
|
||||
sb.append("<tr><td width=32 valign=top>");
|
||||
sb.append("<img src=\"" + item.getIcon() + "\" width=32 height=32>");
|
||||
sb.append("</td><td fixwidth=300 align=center><font name=\"hs9\" color=\"CD9000\">");
|
||||
sb.append(item.getName());
|
||||
sb.append("</font></td></tr><tr><td width=32></td><td width=300><table width=295 cellpadding=0 cellspacing=0>");
|
||||
sb.append("<tr><td width=48 align=right valign=top><font color=\"LEVEL\">Amount:</font></td>");
|
||||
sb.append("<td width=247 align=center>");
|
||||
final MinMax minMax = getPreciseMinMax(dropItem.getChance(npc, activeChar), dropItem.getMin(npc, activeChar), dropItem.getMax(npc, activeChar), dropItem.isPreciseCalculated());
|
||||
|
||||
final long min = minMax.min;
|
||||
final long max = minMax.max;
|
||||
sb.append(amountFormat.format(min));
|
||||
if (min != max)
|
||||
{
|
||||
sb.append(" - ");
|
||||
sb.append(amountFormat.format(max));
|
||||
}
|
||||
|
||||
sb.append("</td></tr><tr><td width=48 align=right valign=top><font color=\"LEVEL\">Chance:</font></td>");
|
||||
sb.append("<td width=247 align=center>");
|
||||
sb.append(chanceFormat.format(Math.min(dropItem.getChance(npc, activeChar), 100)));
|
||||
sb.append("%</td></tr></table></td></tr><tr><td width=32></td><td width=300> </td></tr></table>");
|
||||
}
|
||||
|
||||
private static class MinMax
|
||||
{
|
||||
public final long min, max;
|
||||
|
||||
public MinMax(long min, long max)
|
||||
{
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
}
|
||||
|
||||
private static MinMax getPreciseMinMax(double chance, long min, long max, boolean isPrecise)
|
||||
{
|
||||
if (!isPrecise || (chance <= 100))
|
||||
{
|
||||
return new MinMax(min, max);
|
||||
}
|
||||
|
||||
final int mult = (int) chance / 100;
|
||||
return new MinMax(mult * min, (chance % 100) > 0 ? (mult + 1) * max : mult * max);
|
||||
}
|
||||
}
|
||||
|
@@ -49,11 +49,15 @@ public class Premium implements IVoicedCommandHandler
|
||||
html.append("<tr><td>Rate SP: <font color=\"LEVEL\"> x" + Config.RATE_SP + "<br1></font></td></tr>");
|
||||
html.append("<tr><td>Drop Chance: <font color=\"LEVEL\"> x" + Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER + "<br1></font></td></tr><br>");
|
||||
html.append("<tr><td>Drop Amount: <font color=\"LEVEL\"> x" + Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER + "<br1></font></td></tr><br>");
|
||||
html.append("<tr><td>Spoil Chance: <font color=\"LEVEL\"> x" + Config.RATE_CORPSE_DROP_CHANCE_MULTIPLIER + "<br1></font></td></tr><br>");
|
||||
html.append("<tr><td>Spoil Amount: <font color=\"LEVEL\"> x" + Config.RATE_CORPSE_DROP_AMOUNT_MULTIPLIER + "<br><br></font></td></tr><br>");
|
||||
html.append("<tr><td><center>Premium Info & Rules<br></td></tr>");
|
||||
html.append("<tr><td>Rate XP: <font color=\"LEVEL\"> x" + (Config.RATE_XP * Config.PREMIUM_RATE_XP) + "<br1></font></td></tr>");
|
||||
html.append("<tr><td>Rate SP: <font color=\"LEVEL\"> x" + (Config.RATE_SP * Config.PREMIUM_RATE_SP) + "<br1></font></td></tr>");
|
||||
html.append("<tr><td>Drop Chance: <font color=\"LEVEL\"> x" + (Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER * Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_DROP_CHANCE) + "<br1></font></td></tr>");
|
||||
html.append("<tr><td>Drop Amount: <font color=\"LEVEL\"> x" + (Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_DROP_AMOUNT) + "<br1></font></td></tr>");
|
||||
html.append("<tr><td>Spoil Chance: <font color=\"LEVEL\"> x" + (Config.RATE_CORPSE_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + "<br1></font></td></tr>");
|
||||
html.append("<tr><td>Spoil Amount: <font color=\"LEVEL\"> x" + (Config.RATE_CORPSE_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + "<br1></font></td></tr>");
|
||||
html.append("<tr><td> <font color=\"70FFCA\">1. Premium benefits CAN NOT BE TRANSFERED.<br1></font></td></tr>");
|
||||
html.append("<tr><td> <font color=\"70FFCA\">2. Premium does not effect party members.<br1></font></td></tr>");
|
||||
html.append("<tr><td> <font color=\"70FFCA\">3. Premium benefits effect ALL characters in same account.</font></td></tr>");
|
||||
@@ -67,6 +71,8 @@ public class Premium implements IVoicedCommandHandler
|
||||
html.append("<tr><td>Rate SP: <font color=\"LEVEL\">x" + (Config.RATE_SP * Config.PREMIUM_RATE_SP) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Drop Chance: <font color=\"LEVEL\">x" + (Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_DROP_CHANCE) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Drop Amount: <font color=\"LEVEL\">x" + (Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_DROP_AMOUNT) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Spoil Chance: <font color=\"LEVEL\">x" + (Config.RATE_CORPSE_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Spoil Amount: <font color=\"LEVEL\">x" + (Config.RATE_CORPSE_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Expires: <font color=\"00A5FF\">" + String.valueOf(format.format(endDate)) + "</font></td></tr>");
|
||||
html.append("<tr><td>Current Date: <font color=\"70FFCA\">" + String.valueOf(format.format(System.currentTimeMillis())) + "<br><br></font></td></tr>");
|
||||
html.append("<tr><td><center>Premium Info & Rules<br></center></td></tr>");
|
||||
|
Reference in New Issue
Block a user