Jump to content
  • 0

Drop list panel


Question

Posted

OK, i add Runes for boost drop rates, Now, Who can explain me where i can find this drop setting, when I run Rune drop to be modified here. For exemple. I add rune for boost Drop Rate with 200%, and when i have rune in inventory, this window isn't modified. How i can do this? With Rune Drop i have 6,684-13,646 and without Rune drop 6,684-13,646. SO it's same. How i can do?

http://aXgicWP.jpg 

Recommended Posts

  • 0
Posted

You can't create method like that, you have to put a variable declaration there. Look on the previous method.

 

public static float getBonus(BonusType type)

 

What you want to do, is to create one more the same method, which is pointless.

 

---

 

amountFormat.format(min) this line is responsible for the amount display of min drop. So, all you have to do, is to mul it with getBonus check, the same with max obviously.

amountFormat.format(min * activeChar.getBonus(BonusType.DROP) something like that. I just hope that the default switch from the getBonus method is returning 1.

  • 0
Posted

OK SweeTs, u are greate, but, i get error in GameServer.

This is Code 

public static float getBonus(BonusType type, L2PcInstance activeChar, NumberFormat amountFormat, float min)
	{
		amountFormat.format(min * activeChar.getBonus(BonusType.DROP));
		
		return 1.0f;
	}

And in game doesn't happend something, no changes. Maybe i must put line 

amountFormat.format(min * activeChar.getBonus(BonusType.DROP));

and

amountFormat.format(max * activeChar.getBonus(BonusType.DROP));

?

  • 0
Posted

God, did I told you to paste that line into getBonus method?? Open NpcViewMod, find the line I mentioned (min and max) and add the mul..

  • 0
Posted

Well, This is method which u give me,

 

public static float getBonus(BonusType type)
    {
        return 1;
    }

 

 

and about amountFormat, i find just sb.append

sb.append(amountFormat.format(min * activeChar.getBonus(BonusType.DROP)));

 

and was 

sb.append(amountFormat.format(min));

 

i don;t find 

amountFormat.format(min) like u say. Just with sb.append.

  • 0
Posted

And this is sendNpcDropList method

public static void sendNpcDropList(L2PcInstance activeChar, L2Npc npc, DropListScope dropListScope, int page)
	{
		final List<IDropItem> dropList = npc.getTemplate().getDropList(dropListScope);
		if ((dropList == null) || dropList.isEmpty())
		{
			return;
		}
		
		int pages = dropList.size() / DROP_LIST_ITEMS_PER_PAGE;
		if ((DROP_LIST_ITEMS_PER_PAGE * pages) < dropList.size())
		{
			pages++;
		}
		
		final StringBuilder pagesSb = new StringBuilder();
		if (pages > 1)
		{
			pagesSb.append("<table><tr>");
			for (int i = 0; i < pages; i++)
			{
				pagesSb.append("<td align=center><button value=\"" + (i + 1) + "\" width=20 height=20 action=\"bypass NpcViewMod dropList " + dropListScope + " " + npc.getObjectId() + " " + i + "\" back=\"L2UI_CT1.Button_DF_Calculator_Down\" fore=\"L2UI_CT1.Button_DF_Calculator\"></td>");
			}
			pagesSb.append("</tr></table>");
		}
		
		if (page >= pages)
		{
			page = pages - 1;
		}
		
		final int start = page > 0 ? page * DROP_LIST_ITEMS_PER_PAGE : 0;
		
		int end = (page * DROP_LIST_ITEMS_PER_PAGE) + DROP_LIST_ITEMS_PER_PAGE;
		if (end > dropList.size())
		{
			end = dropList.size();
		}
		
		final DecimalFormat amountFormat = new DecimalFormat("#,###");
		final DecimalFormat chanceFormat = new DecimalFormat("0.00##");
		
		int leftHeight = 0;
		int rightHeight = 0;
		final StringBuilder leftSb = new StringBuilder();
		final StringBuilder rightSb = new StringBuilder();
		for (int i = start; i < end; i++)
		{
			final StringBuilder sb = new StringBuilder();
			
			int height = 64;
			final IDropItem dropItem = dropList.get(i);
			if (dropItem instanceof GeneralDropItem)
			{
				addGeneralDropItem(activeChar, npc, amountFormat, chanceFormat, sb, (GeneralDropItem) dropItem);
			}
			else if (dropItem instanceof GroupedGeneralDropItem)
			{
				final GroupedGeneralDropItem generalGroupedDropItem = (GroupedGeneralDropItem) dropItem;
				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() * generalGroupedDropItem.getChance()) / 100, generalDropItem.getAmountStrategy(), generalDropItem.getChanceStrategy(), generalGroupedDropItem.getPreciseStrategy(), generalGroupedDropItem.getKillerChanceModifierStrategy(), generalDropItem.getDropCalculationStrategy()));
				}
				else
				{
					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("%</td></tr></table><br>");
					
					for (GeneralDropItem generalDropItem : normalized.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\">");
						sb.append("<tr><td width=32 valign=top>");
						sb.append("<img src=\"" + item.getIcon() + "\" width=32 height=32>");
						sb.append("</td><td fixwidth=259 align=center><font name=\"hs9\" color=\"CD9000\">");
						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>");
						MinMax minMax = getPreciseMinMax(normalized.getChance(), generalDropItem.getMin(npc), generalDropItem.getMax(npc), generalDropItem.isPreciseCalculated());
						final long min = minMax.min;
						final long max = minMax.max;
						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=205 align=center>");
						sb.append(chanceFormat.format(Math.min(generalDropItem.getChance(), 100)));
						sb.append("%</td></tr></table></td></tr><tr><td width=32></td><td width=259>&nbsp;</td></tr></table>");
						
						height += 64;
					}
					
					sb.append("</td></tr><tr><td width=32></td><td width=300>&nbsp;</td></tr></table>");
				}
			}
			
			if (leftHeight >= (rightHeight + height))
			{
				rightSb.append(sb);
				rightHeight += height;
			}
			else
			{
				leftSb.append(sb);
				leftHeight += height;
			}
		}
		
		final StringBuilder bodySb = new StringBuilder();
		bodySb.append("<table><tr>");
		bodySb.append("<td>");
		bodySb.append(leftSb.toString());
		bodySb.append("</td><td>");
		bodySb.append(rightSb.toString());
		bodySb.append("</td>");
		bodySb.append("</tr></table>");
		
		String html = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/mods/NpcView/DropList.htm");
		if (html == null)
		{
			_log.warning(NpcViewMod.class.getSimpleName() + ": The html file data/html/mods/NpcView/DropList.htm could not be found.");
			return;
		}
		html = html.replaceAll("%name%", npc.getName());
		html = html.replaceAll("%dropListButtons%", getDropListButtons(npc));
		html = html.replaceAll("%pages%", pagesSb.toString());
		html = html.replaceAll("%items%", bodySb.toString());
		Util.sendCBHtml(activeChar, html);
	}

In this method, where i must put 

activeChar.getBonus(BonusType.DROP)

?

  • 0
Posted

Oh my goodness.. I simply fixed, showed you how the method should looks like. Don't act like 5y old kid. I told you which line you must find and what to add. Don't expect me to copy even sb.append lol, get real dude. Get you shit together or don't mod the core.

Find all occuriences or that amount calculation, formation and simply add that godamn getBonus check.

  • 0
Posted

Well, i make this

if (min == max)
                        {
                            sb.append(amountFormat.format(min));
                        }
                        else
                        {
                            sb.append(amountFormat.format(min * activeChar.getBonus(BonusType.DROP)));
                            sb.append(" - ");
                            sb.append(amountFormat.format(max * activeChar.getBonus(BonusType.DROP)));
                        }
       and nothing happend in game, simply, i can;t open more view mode :)

Guest
This topic is now closed to further replies.


  • Posts

    • 🎉 ¡Llega EuroLatinL2! 🎉 🌍 Un servidor Interlude x20 con esencia retail y ajustes justos para una experiencia única. 🧠 Desarrollado por profesionales rusos, EuroLatinL2 está basado en el cliente original de Lineage II Interlude. Buscamos revivir lo mejor de la vieja escuela con un balance perfecto entre nostalgia y jugabilidad moderna. 🛡️ ¿Qué hace diferente a EuroLatinL2? ✨ Rates Mid x20 – Equilibrados para un progreso fluido, sin perder el desafío. 🧪 Experiencia 100% retail con leves ajustes para mantener el interés. ⚔️ Raid Bosses épicos ajustados al nivel 80. 💡 Nada de GM Shop, sin buffs OP, sin teleport personalizados. ⛩️ Solo tiendas y contenido original de Lineage II. 🧙 Buffer básico (solo Prophet), duración de 60 minutos. 🔄 Sistema de héroes cada 15 días y Olimpiadas 2h por día. 🛒 Sistema de donaciones solo para servicios estéticos y premium (sin pay-to-win). 🧬 Sistema de skins para armas y armaduras (solo apariencia). 💤 AutoFarm disponible solo con adena/premium, opcional. 🔥 ¿Quieres volver a disfrutar Lineage II como en sus mejores tiempos? 💬 Completa quests, forma grupos reales, derrota jefes con estrategia, y recolecta recetas (¡incluso para Soulshots!). ⏳ ¡La apertura está muy cerca! 🚪 No te quedes fuera de esta aventura. Vive Lineage II como debe ser. 🌐 Sitio oficial: https://eurolatin.eu 📣 ¡Comparte con tu clan y prepárate para la nostalgia! #Lineage2 #Interlude #EuroLatinL2 #L2Classic #PvE #PvP #NostalgiaL2
    • Still looking to adapt packets to allow modern client to connect on my GF Extender.
    • Καλησπέρα,  Αναζητώ Lineage II C3 Rise of Darkness client (καθαρή έκδοση) και το απαραίτητο αρχείο System για Windows 10/11 Προσφέρω αμοιβή για τη βοήθεια  Ευχαριστώ.   Good evening,  I am looking for a Lineage II C3 Rise of Darkness client and the necessary System file for Windows 10/11 compatibility I am willing to pay for assistance  Thank you    Add me Discord: devibtv  or dm here                                                        @AlisaCodeDragon
    • Sorry, I didn't get to read everything you actually wrote, I don't think it has value. Regards.
    • "Why do you have problems with all forum users?" I dont. I respond based on how people act toward me or my clients! You are defending someone who has been trash-talking me and attacking me directly. And somehow you think I’m the one creating the problem? Did you even bother to check what actually happened, or did you just jump on his side?    While there is another guy that knows and calls him out, he is a known scammer. on this very same topic   If you believe I have issues with all forum users, name them, vilmis is not all forum users.   Besides, this looks like you are just another Vilmis alt accounts blindly backing him without facts.   Tinker123aa I have an alergy on scammers you see, ill wait for your list of all forum users tho.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock