Jump to content

Recommended Posts

Posted

Hi there i'd like to share a Drop Preview Panel for Mobs.

 

So what this system does?

When you Shift + Click a mob you can view its Drops.

 

Drop Preview Panel Supports: (for each item)

Item Icon

Item Name

Item Min+Max Drop

Item Drop Quantity

Item Percentage Drop % (enhanced for low drops)

 

 

Here is a preview pic of the system

droppreview.png

 

This is the patch file for the latest action shift for l2jhi5.

 

Index: L2NpcActionShift.java
===================================================================
--- L2NpcActionShift.java	(revision 8584)
+++ L2NpcActionShift.java	(working copy)
@@ -183,77 +183,13 @@
				activeChar.sendPacket(su);
			}

-			NpcHtmlMessage html = new NpcHtmlMessage(0);
-			int hpMul = Math.round((float)(((L2Character)target).getStat().calcStat(Stats.MAX_HP, 1, (L2Character)target, null) / BaseStats.CON.calcBonus((L2Character)target)));
-			if (hpMul == 0)
-				hpMul = 1;
-			final StringBuilder html1 = StringUtil.startAppend(
+			NpcHtmlMessage html = new NpcHtmlMessage(0);final StringBuilder html1 = StringUtil.startAppend(
					1000,
-					"<html><body>" +
-					"<br><center><font color=\"LEVEL\">[Combat Stats]</font></center>" +
-					"<table border=0 width=\"100%\">" +
-					"<tr><td>Max.HP</td><td>",
-					String.valueOf(((L2Character)target).getMaxHp() / hpMul),
-					"*",
-					String.valueOf(hpMul),
-					"</td><td>Max.MP</td><td>",
-					String.valueOf(((L2Character)target).getMaxMp()),
-					"</td></tr>" +
-					"<tr><td>P.Atk.</td><td>",
-					String.valueOf(((L2Character)target).getPAtk(null)),
-					"</td><td>M.Atk.</td><td>",
-					String.valueOf(((L2Character)target).getMAtk(null, null)),
-					"</td></tr>" +
-					"<tr><td>P.Def.</td><td>",
-					String.valueOf(((L2Character)target).getPDef(null)),
-					"</td><td>M.Def.</td><td>",
-					String.valueOf(((L2Character)target).getMDef(null, null)),
-					"</td></tr>" +
-					"<tr><td>Accuracy</td><td>",
-					String.valueOf(((L2Character)target).getAccuracy()),
-					"</td><td>Evasion</td><td>",
-					String.valueOf(((L2Character)target).getEvasionRate(null)),
-					"</td></tr>" +
-					"<tr><td>Critical</td><td>",
-					String.valueOf(((L2Character)target).getCriticalHit(null, null)),
-					"</td><td>Speed</td><td>",
-					String.valueOf(((L2Character)target).getRunSpeed()),
-					"</td></tr>" +
-					"<tr><td>Atk.Speed</td><td>",
-					String.valueOf(((L2Character)target).getPAtkSpd()),
-					"</td><td>Cast.Speed</td><td>",
-					String.valueOf(((L2Character)target).getMAtkSpd()),
-					"</td></tr>" +
-					"<tr><td>Race</td><td>",
-					((L2Npc)target).getTemplate().getRace().toString(),
-					"</td><td></td><td></td></tr>" +
-					"</table>" +
-					"<br><center><font color=\"LEVEL\">[basic Stats]</font></center>" +
-					"<table border=0 width=\"100%\">" +
-					"<tr><td>STR</td><td>",
-					String.valueOf(((L2Character)target).getSTR()),
-					"</td><td>DEX</td><td>",
-					String.valueOf(((L2Character)target).getDEX()),
-					"</td><td>CON</td><td>",
-					String.valueOf(((L2Character)target).getCON()),
-					"</td></tr>" +
-					"<tr><td>INT</td><td>",
-					String.valueOf(((L2Character)target).getINT()),
-					"</td><td>WIT</td><td>",
-					String.valueOf(((L2Character)target).getWIT()),
-					"</td><td>MEN</td><td>",
-					String.valueOf(((L2Character)target).getMEN()),
-					"</td></tr>" +
-					"</table>"
+					"<html><head><title>"+((L2Npc) target).getName()+"</title><body><table bgcolor=444444 border=1 cellspacing=2 cellpadding=0 width=293><tr><td align=center>Drop Panel</td></tr></table><br><table  bgcolor=333333 cellpadding=0 cellspacing=0 width=274><tr><td align=center><font color=fff600>Legend</font></td></tr></table><table bgcolor=333333 width=276><tr><td align=center>[D]= Drop   [s]= Spoil   [Q]= Quest</td></tr><tr><td align=center>(CI)= Common Item</td></tr></table><br><table bgcolor=444444 cellspacing=2 cellpadding=1 border=1 width=280>"
			);

			if (!((L2Npc) target).getTemplate().getDropData().isEmpty())
			{
-				StringUtil.append(html1,
-						"<br><center><font color=\"LEVEL\">[Drop Info]</font></center>" +
-						"<br>Rates legend: <font color=\"ff9999\">50%+</font> <font color=\"00ff00\">30%+</font> <font color=\"0066ff\">less than 30%</font>" +
-						"<table border=0 width=\"100%\">"
-				);
				for (L2DropCategory cat : ((L2Npc)target).getTemplate().getDropData())
				{
					for (L2DropData drop : cat.getAllDrops())
@@ -261,31 +197,76 @@
						final L2Item item = ItemTable.getInstance().getTemplate(drop.getItemId());
						if (item == null)
							continue;
+						int mind = 0,maxd = 0;
+						String smind = null,smaxd = null,drops = null;
+						String name = item.getName();
+						double chance = 100/(1000000/(drop.getChance()));

-						final String color;
-						
-						if (drop.getChance() >= 500000)
-							color = "ff9999";
-						else if (drop.getChance() >= 300000)
-							color = "00ff00";
+						if (cat.isSweep())
+						{
+							mind = (int) (Config.RATE_DROP_SPOIL * drop.getMinDrop());
+							maxd = (int) (Config.RATE_DROP_SPOIL * drop.getMaxDrop());
+						}
+						else if (drop.getItemId()==57)
+						{
+							mind = 300 * drop.getMinDrop();
+							maxd = 300 * drop.getMaxDrop();
+						}
						else
-							color = "0066ff";
+						{
+							mind = (int) (Config.RATE_DROP_ITEMS * drop.getMinDrop());
+							maxd = (int) (Config.RATE_DROP_ITEMS * drop.getMaxDrop());
+						}
+						if (mind > 999999)
+						{
+							DecimalFormat df = new DecimalFormat("###.#");
+							smind = df.format(((double)(mind))/1000000)+" KK";
+							smaxd = df.format(((double)(maxd))/1000000)+" KK";
+						}
+						else if (mind > 999)
+						{
+							smind = ((int)(mind/1000))+" K";
+							smaxd = ((int)(maxd/1000))+" K";
+						}

+						else
+						{ 
+							smind = Integer.toString(mind);
+							smaxd = Integer.toString(maxd);
+						}
+						if (chance <= 0.001)
+						{
+							DecimalFormat df = new DecimalFormat("#.####");
+							drops = df.format(chance);
+						}
+						else if (chance <= 0.01)
+						{
+							DecimalFormat df = new DecimalFormat("#.###");
+							drops = df.format(chance);
+						}
+						else
+						{
+							DecimalFormat df = new DecimalFormat("##.##");
+							drops = df.format(chance);
+						}
+						if (name.startsWith("Common Item - "))
+						{
+							name = "(CI)" + name.substring(14);
+						}
+						if (name.length() >= 36)
+						{
+							name = name.substring(0, 33) + "...";
+						}
						StringUtil.append(html1,
-								"<tr>",
-								"<td><img src=\"" + item.getIcon() + "\" height=32 width=32></td>" + 
-								"<td><font color=\"", color, "\">", item.getName(), "</font></td>",
-								"<td>", (drop.isQuestDrop() ? "Quest" : (cat.isSweep() ? "Sweep" : "Drop")),"</td>",
-								"</tr>"
-						);
+						"<tr><td valign=top align=center height=38 width=40><img src=\""+item.getIcon()+"\" height=32 width=32></td><td><table cellpadding=0 cellspacing=1 width=237><tr><td>"+drops+"%</td></tr><tr><td>"+(drop.isQuestDrop() ? "[Q]" : (cat.isSweep() ? "[s]" : "[D]"))+"<font color=fff600>"+name+"</font>"+(maxd==1 ? "[1]" : "["+smind+" - "+smaxd+"]") + "</td></tr></table></td>"
+                        );
					}
				}
-				html1.append("</table>");
			}
-			html1.append("</body></html>");
-			
+			html1.append("</tr></table></body></html>");
			html.setHtml(html1.toString());
			activeChar.sendPacket(html);
+		
		}
		return true;
	}

 

This code can be done better, if you have any suggestion tell me here. We can do this with a config file too for more options.

Posted

Try deleting the border to the table (table border=0), deleting the quest drop items who are shown on the droplist (i supouse).

The [D]Drop and [s Spoil delete the [s and [D] and put the indications with colors.

That would be a nice code :)

I'll try to do it by myself and if you want i can post it :)

Very good share, and keep sharing :D

Posted

I havent test it on Interlude, maybe you need some adaptions for it.

Is there a file for shift clicking mobs on il like the L2NpcActionShift.java if yes then you can try it.

Posted

Thanks for the share... But onlu handy for those who like to use the shift+click feature in theirs production server,... a questios, did the properties have already something like shift+click drop list?

 

Stop using the google translator man...

Posted

Thanks for the share... But onlu handy for those who like to use the shift+click feature in theirs production server,... a questios, did the properties have already something like shift+click drop list?

 

Yes the feature is only for servers that want to use such a feature, btw as you said there is in the configs  a shift+click feature already but its not like this system.

  • 4 weeks later...
Posted

Erro L2Brick server

 

 

 

----------

1. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcAc

tionShift.java (at line 38)

        public class L2NpcActionShift implements IActionHandler

                    ^^^^^^^^^^^^^^^^

The type L2NpcActionShift must implement the inherited abstract method IActionHa

ndler.getInstanceType()

----------

2. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcAc

tionShift.java (at line 228)

        DecimalFormat df = new DecimalFormat("000.0");

        ^^^^^^^^^^^^^

DecimalFormat cannot be resolved to a type

----------

3. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcAc

tionShift.java (at line 228)

        DecimalFormat df = new DecimalFormat("000.0");

                              ^^^^^^^^^^^^^

DecimalFormat cannot be resolved to a type

----------

4. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcAc

tionShift.java (at line 245)

        DecimalFormat df = new DecimalFormat("0.0000");

        ^^^^^^^^^^^^^

DecimalFormat cannot be resolved to a type

----------

5. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcAc

tionShift.java (at line 245)

        DecimalFormat df = new DecimalFormat("0.0000");

                              ^^^^^^^^^^^^^

DecimalFormat cannot be resolved to a type

----------

6. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcAc

tionShift.java (at line 250)

        DecimalFormat df = new DecimalFormat("0.000");

        ^^^^^^^^^^^^^

DecimalFormat cannot be resolved to a type

----------

7. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcAc

tionShift.java (at line 250)

        DecimalFormat df = new DecimalFormat("0.000");

                              ^^^^^^^^^^^^^

DecimalFormat cannot be resolved to a type

----------

8. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcAc

tionShift.java (at line 255)

        DecimalFormat df = new DecimalFormat("00.00");

        ^^^^^^^^^^^^^

DecimalFormat cannot be resolved to a type

----------

9. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcAc

tionShift.java (at line 255)

        DecimalFormat df = new DecimalFormat("00.00");

                              ^^^^^^^^^^^^^

DecimalFormat cannot be resolved to a type

----------

10. ERROR in D:\L2Brick-Rev1608\game\data\scripts\handlers\actionhandlers\L2NpcA

ctionShift.java (at line 279)

        }

        ^

Syntax error, insert "}" to complete ClassBody

----------

 

Posted

working for interlude, but IL don't have getIcon() so there is two way:

1) remove getIcon, but then you dont see icon

2) add getIcon(), its easy, but you need to add all icons to etc, armor and weapons.sql

 

btw, interlude dont have L2NpcActionShift.java, so we add to L2NpcInstance this code.

  • 3 weeks later...
Posted

wow amazing share where all servers need (low rate)

 

thx for share keep ur work

 

Thanks a lot, although i think that even high rate servers can use it too, its good for the player to know the drops cause they are sometimes distrustfull xD

  • 9 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • ## [1.5.5] - 2026-02-02   ### ✨ New Features - **Discord Login**: You can now sign in with your Discord account. Admins enable and configure Discord login in **cpadmin → Users** (Discord auth settings: Client ID, Client Secret, Redirect URI). If you already have an account with the same email (e.g. forum, Google, or legacy), signing in with Discord links to that account so you keep one profile. Discord login is available on Add Server, My Servers, Vote page, and Premium Ads booking. - **Setup Links**: In **cpadmin → Users**, both Google and Discord login settings now include direct links to their official developer portals (Google Cloud Console and Discord Developer Portal) for easier OAuth app setup.   ### 🔒 Security - **Email Required for Registration**: New user registration via OAuth (Forum, Google, Discord) now requires a valid email address. If the OAuth provider doesn't provide an email (e.g. unverified Discord email), registration is rejected with a clear message. This prevents anonymous accounts and ensures all users can receive important notifications.   ### 🔄 Improvements - **User Auth Badges**: In **cpadmin → Users**, the Registered Members table now shows auth method badges: **Forum**, **Google**, **Discord**, or **Legacy**. Users can have multiple badges if they've linked multiple login methods. - **Server Info Labels**: Translated server info labels (Owner Name, Language, Server Location) are now properly localized in all 5 languages (English, Spanish, Portuguese, Greek, Russian).   ---   ## [1.5.4] - 2026-02-01   ### ✨ New Features - **Google Login**: You can now sign in with your Google account. Admins enable and configure Google login in **cpadmin → Users** (Google auth settings: Client ID, Client Secret, Redirect URI). If you already have an account with the same email (e.g. forum or legacy), signing in with Google links to that account so you keep one profile. The login menu (navbar and login prompts) offers **Login with Forum Account**, **Login with Google** (when enabled), and **Create Forum Account**. Google login is available on Add Server, My Servers, Profile Settings, Vote page, and Premium Ads booking. - **Ban/Unban Members**: In **cpadmin → Users**, admins can ban or unban registered members. Banned users see a full-page message: "Sorry, you are banned from using this site." When a user is banned, all their servers are set to inactive. - **Moderator Activity Log**: **cpadmin → Moderators** now records when a moderator or admin enters the CPAdmin panel (e.g. "Moderator X entered CPAdmin panel at &lt;time&gt;") and when they change any cpadmin settings (only write actions are logged; read-only use is not). - **Clear Moderator Logs**: Admins can clear all moderator activity log entries via a **Clear logs** button with confirmation. Logs are shown at 100 per page with pagination. - **Filter by Moderator**: In the Moderator Activity Log, a **Filter by moderator** dropdown lets you view activity for a specific moderator or "All moderators." - **cpadmin → Users Tab**: New **Users** tab in the admin panel with Registered Members list (paginated), Google auth settings card, and per-user Ban/Unban and server links.   ### 🔄 Improvements - **cpadmin → Servers**: Each server name in the servers table is now clickable and opens that server’s info page. - **cpadmin → Users – Servers column**: The servers count/list is clickable and opens a small modal listing that user’s servers; each server name in the modal links to the server info page. - **cpadmin → Users – Search**: A search bar above the Registered Members table lets you search by **username**, **email**, or **server name**. Results are filtered on the server (paginated); clearing the search resets the list. - **Moderator Activity Log**: Pagination shows "Showing X–Y of Z" and "Page N of M" with Previous/Next when there are more than 100 entries. - **Login UI**: Login options (Forum, Google, Create account) are shown in a consistent dropdown and in modals (Add Server, My Servers, Vote, Premium Ads) for a clearer sign-in experience. - **Vote Page – Unauthenticated**: When you must log in to vote, the page now shows "Vote for [Server Name]" as the main heading and presents login options in a compact section.   ---   ## [1.5.3] - 2026-01-30   ### ✨ New Features - **File Logs in Admin Panel**: Admins can now view CodeIgniter PHP logs (api/writable/logs) directly in **cpadmin → Logs**. Select a date to view the log file, refresh to reload, or delete all log files to free up space.   ### 🔄 Improvements - **Cache System**: Full cache audit and improvements — when you clear cache in cpadmin, both backend and frontend caches are cleared. Server listings, My Servers, pricing, ad config, and chronicles all refresh with fresh data. New paid servers now appear in listings and My Servers immediately. - **Admin Panel – Server Rates**: Server rates in the admin servers table now display in compact format (e.g. x10000 → x10k, x100000 → x100k, x1000000 → x1m) for easier scanning. Hover to see the full value.
    • WTB High Five source running on Salvation/Fafurion client
    • MoMoProxy has updated more static residential proxies for USA location, anyone interested in can view: https://momoproxy.com/static-residential-proxies
    • Hello, i am selling a project that was going to open but at the end i have not the time to do it Its a c4 server ( scripts) with all the c5 changes played from Interlude Client    the server is 1:1 copy of the legendary 2007 L2Revenge server with some bits like events and some more sync stuff There is a lot of retail fixes included  , extender is vanganth and has a lot of mods but mostly fixes on the retail stuff.   Test server is available through discord , i offer client/patch/server/sources The price is 300 Euro and for testing the server you have to pm me at discord banshee1019 , dont really wanna let anybody log because some people are "bad"   Once you buy you also have free support for 1 year , that doesnt mean i will code all your ideas but support you if something comes up , and guide you to do simple edits
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..