Jump to content

Recommended Posts

Posted

This share is hmm how can i say basic website php scripts but ingame!

Its untested so plz give me some feedback:)

 

Insert the code into net.sf.l2j.gameserver.model.actor.instance and name it as L2StatManagerInstance.java

 

Then make a new npc with the type L2StatManager.

 

Ohh i forgot that :D

Credits to me:)

 

Now its show you:

top 10pvp

top 10pk

top 10Level

If its working properly i will add more stuff to it

 

/* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.l2j.gameserver.model.actor.instance;

import java.sql.PreparedStatement;
import java.sql.ResultSet;

import javolution.text.TextBuilder;

import net.sf.l2j.L2DatabaseFactory;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;


/**
* Stat Manager
* 
* @author Intrepid
*/

public class L2StatManagerInstance extends L2FolkInstance
{

public L2StatManagerInstance(int objectId, L2NpcTemplate template)
{
	super(objectId, template);
}

@Override
public void onBypassFeedback(L2PcInstance player, String command)
{
	if (command.startsWith("TopPvp"))
	{
	      java.sql.Connection con = null;
	      try
	      {
	      	con = L2DatabaseFactory.getInstance().getConnection();
	        PreparedStatement statement;
	        statement = con.prepareStatement("SELECT char_name,pvpkills FROM characters where accesslevel = 0 order by pvpkills DESC LIMIT 10;");
	        ResultSet rset = statement.executeQuery();        
	        while(rset.next())
	        {
	        	NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
	        	TextBuilder sb = new TextBuilder();
	        	sb.append ("Character: "+rset.getString("char_name")+" ("+rset.getInt("pvpkills")+" kills");
	        	html.setHtml(sb.toString());
                    player.sendPacket(html);
    	    }
    	    rset.close();
          statement.close();
          con.close();
    	  }
    	  catch (Exception e)
    	  {
    	  	e.printStackTrace();
    	  }
	}
	if (command.startsWith("TopPk"))
	{
	      java.sql.Connection con = null;
	      try
	      {
	      	con = L2DatabaseFactory.getInstance().getConnection();
	        PreparedStatement statement;
	        statement = con.prepareStatement("SELECT char_name,pkkills FROM characters where accesslevel = 0 order by pkkills DESC LIMIT 10;");
	        ResultSet rset = statement.executeQuery();
	        while(rset.next())
	        {
	        	NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
	        	TextBuilder sb = new TextBuilder();
	        	sb.append ("Character: "+rset.getString("char_name")+" ("+rset.getInt("pkkills")+" kills");
	        	html.setHtml(sb.toString());
                    player.sendPacket(html);
    	    }
    	    rset.close();
          statement.close();
          con.close();
    	  }
    	  catch (Exception e)
    	  {
    	  	e.printStackTrace();
    	  }
	}
	if (command.startsWith("TopLvl"))
	{
	      java.sql.Connection con = null;
	      try
	      {
	      	con = L2DatabaseFactory.getInstance().getConnection();
	        PreparedStatement statement;
	        statement = con.prepareStatement("SELECT char_name,level FROM characters where accesslevel = 0 order by level DESC LIMIT 10;");
	        ResultSet rset = statement.executeQuery();
	        while(rset.next())
	        {
	        	NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
	        	TextBuilder sb = new TextBuilder();
	        	sb.append ("Character: "+rset.getString("char_name")+" ("+rset.getInt("level")+" level");
	        	html.setHtml(sb.toString());
                    player.sendPacket(html);
    	    }
    	    rset.close();
          statement.close();
          con.close();
    	  }
    	  catch (Exception e)
    	  {
    	  	e.printStackTrace();
    	  }
	}
}
}

Posted

Nice Intrepid,but i have a question...

How to add this in the server interlude ???

Can i to use only the java decompiler and it's works ???

Thx in advanced.

Posted

Nice Intrepid,but i have a question...

How to add this in the server interlude ???

Can i to use only the java decompiler and it's works ???

Thx in advanced.

never use java decompiler use eclipse than insert the file change the imports if you need and thats all spawn the npc ingame and you see

Posted

never use java decompiler use eclipse than insert the file change the imports if you need and thats all spawn the npc ingame and you see

Thx for reply man,but any ideia for to insert this modification in the interlude pack already compiled ???

In the gameserver have this files in .jar :

7108Image.png

But i don't know how to insert >.< .

Help-me plz =\.

Posted

Thx for reply man,but any ideia for to insert this modification in the interlude pack already compiled ???

In the gameserver have this files in .jar :

7108Image.png

But i don't know how to insert >.< .

Help-me plz =\.

 

You need the source code not the jar files:)

Posted

I am going to test it. If it works you will have +1 from me. Thanks

No problem man,i just want to use this great mod in my server Interlude  =\.

Posted

I made the code compatible with l2j interlude . Compiled the source with no problem but ingame npc says: 'i have nothing to tell you.'

Now checking on l2jct2.2

Posted

I made the code compatible with l2j interlude . Compiled the source with no problem but ingame npc says: 'i have nothing to tell you.'

Now checking on l2jct2.2

 

Thanks for test i make some test too and i find out whats the error.

Posted

working for me working for dimis...also working for my friends...

 

and WTF i NEVER post non working code...that code needs only a html file thats true i forget that...

Guest
This topic is now closed to further replies.



  • Posts

    • Hello guys, There isn't much information to share yet regarding the project. We've been working on it for the past few months with the goal of creating something unique and truly different. Over the years, I've seen countless projects with the same features repeated over and over again. This time, we're aiming to build something solid and unlike anything players have seen before. Since many of you have been asking about Unreal Engine 5, I'd like to clear that up. Building something on UE5 requires a very large team and a lot of resources to accomplish properly. Right now, we can't say anything regarding UE5. Maybe in the future, who knows? Tzelal is a real life friend of mine. I've known him for many years, and he's a great guy. Right now, he's looking for people who genuinely want to be part of this project. The team is working 20+ hours a day, every single day. I'm often on calls with them, watching their progress and seeing everything they're creating. So, if anyone is wondering what's happening behind the scenes, my answer is simple, something amazing. I know many of you have been asking about features and other details, but we don't want to spoil anything just yet. There is still a lot of work to be done, and we'd rather reveal things when they're ready. Once everything is in the state we want, we'll start releasing sneak peeks. If you'd like to join the project, feel free to send Tzelal a private message so you can go through an interview. Please don't waste his time, or yours, if you're not genuinely interested. Now, I'd like to make a few things clear. No, we're not making another generic server with the same old features and the same old engine that you've seen for years. Our goal is to build something completely different, something that players haven't experienced before. And no, we're not going to give up on development. We work every day, and we keep pushing forward even when some challenges seem difficult. We're committed to making this project the best it can be. That's all for now. There will be much more to share once we're ready to show it. Thanks for your time, everyone.
    • 📢 MMORE.DEV — ONE SLOT AVAILABLE FOR A PROJECT   1 slot has opened up for long-term cooperation. We welcome anyone interested — we're looking for projects built for long-term collaboration, not one-off tasks.   🎯 We're ready to take on projects for these chronicles:   Essence Classic   Current protocols: 520, 542, 557+ One example of our developers' work — the Aden.Land team.   📋 We're also accepting preliminary discussions for the Main (GOD) branch — if you're planning a project on this chronicle, reach out in advance so we can go over the details and timeline. _______________________________________________________________________   For any questions — PM us or reach out on Telegram: https://t.me/L2scripts
    • 🔥 L2SCRIPTS BIG SALE 🔥 30-50% OFF ALL LEGACY PRODUCTS! Special offer for MaxCheaters users! Promotion runs from July 25 to August 1 inclusive _____________________________________________________    🎁 Promo details: 30-50% discount on all legacy studio products Source codes, ready-made builds, technical support — everything you've been wanting to grab at a great price. ___________________________________________________________________________   ⚡ Why you should hurry: A discount like this across the whole lineup is a rare event in our 20 years on the market This offer is strictly time-limited — exactly 7 days, no extensions Available only for MaxCheaters users Support slots are limited. ____________________________________________________ ✅ Proven quality — 20 years in the L2 market ✅ Full range of chronicles and ready-made solutions ✅ Personal support from our team ____________________________________________________   🌐 Our websites: L2-scripts.com — https://l2-scripts.com Mmore.dev — https://mmore.dev Telegram for contact: https://t.me/L2scripts ____________________________________________________   Don't miss your chance! In 7 days prices go back to normal — grab what you need at the best price in the studio's history. ➡️ Browse the product catalog: https://l2-scripts.com For any questions — PM us or check the support thread.
    • Is this a client built in unreal engine 5 or what ? I'm confused. Or is it a backend project ? Whatever it is good luck, may it be as "mighty" as its name !  
  • 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..