Jump to content

Recommended Posts

  • 3 months later...
Posted

I do not know whether the error is in the java or html, because when I click on the npc it appears the code of html example% pvplist%, but if you click on the PK it will be normal nicknames of the players, but you clicking again in PVP, appears normal, the only problem yourself and when you first click on the npc.

 

 

- obs: sorry for my english because I am using translator.

Posted (edited)

i am using same code on my server (nothing less, nothing more) and it works within latest revision of acis.

 

- have you changed anything (.htm, java source)?

- which pack are you using (+rev)?

 

... seriously, i need more details.

Edited by Caparso
Posted

I do not know whether the error is in the java or html, because when I click on the npc it appears the code of html example% pvplist%, but if you click on the PK it will be normal nicknames of the players, but you clicking again in PVP, appears normal, the only problem yourself and when you first click on the npc.

 

 

- obs: sorry for my english because I am using translator.

Try to re-add this code.

It's working and for me for aCis last rev..

Posted (edited)
Did not edit any html, the boy ai forum adapted to correct frozen? I picked up the code and added correctly.

 

Follow the links of the images below:

When I click on the npc:


 

When click the pk:


 

When click the online:


 

 

-> When I click the back pk and click the pvp it shows:


 

 

Good bug it is only when you click the NPC which is the first picture I sent. Good've tried to think about it but got no success, then saw topic ask the owner if you have any solution? If you have please let me know

Edited by mxteu
Posted

so, its frozen?

probably missing: onFirstTalk, but i can't tell you more since no longer working on frozen source. just research other instances, then copy analogously missing part of code :)

Posted

my project is not stopped, and as a basis of greatly improved frozen in terms of mods, bugs, and balancing himself, so I'm saying, is missing something in the mod, but not from me but yours.But it did work properly, it is not everyone who uses one acis of life, but there are people who have the intelligence to do a much better design  O0

Posted (edited)

maybe l2jfrozen have lot of customs/mods already implemented, but mechanical part of server is a crap (problems with targeting or changing target, stucking characters and overall problems with movement etc.). if you want good balance probably best option is to run with l2jserver, but <if you ask me> there's no other interlude server emulator worthy to work within - except l2jacis.

 

ps. hiding inappropriate behaviors of mechanical part of the game under visually impressive customs become very popular nowadays, unfortunatelly ...

Edited by Caparso
  • 4 months later...
Posted (edited)

There's a single JOIN over the whole L2J source, so...

I thought there was none

 

For the record and if someone wants to use this with a proper sql part,

this should be your statement.

select toppvp.char_name as toppvp_charname, toppvp.pvpkills as toppvp_kills, toppvp.online as toppvp_online, 
toppk.char_name as toppk_charname, toppk.pkkills as toppk_kills, toppk.online as toppk_online, 
toponline.char_name as toponline_charname, toponline.onlinetime as toponline_onlinetime, toponline.pvpkills as toppvp_online from characters chars
inner join characters toppvp on chars.obj_id=toppvp.obj_id
inner join characters toppk on chars.obj_id=toppk.obj_id
inner join characters toponline on chars.obj_id=toponline.obj_id
ORDER BY toppvp.pvpkills DESC, toppk.pkkills DESC, toponline.onlinetimde DESC, toppvp.char_name ASC LIMIT 10, toppk.char_name ASC LIMIT 10, toponline.char_name ASC LIMIT 10

Edited by .Elfocrash
Posted
 
this where it goes
 
create new npc with our dedicated type or use the one below:
    <npc id="50012" idTemplate="31549" name="STATISTICS WALL" title="L2EUPHORIA.COM">
        <set name="level" val="70"/>
        <set name="radius" val="32"/>
        <set name="height" val="46.5"/>
        <set name="rHand" val="0"/>
        <set name="lHand" val="0"/>
        <set name="type" val="L2Status"/>
        <set name="exp" val="0"/>
        <set name="sp" val="0"/>
        <set name="hp" val="2444.46819"/>
        <set name="mp" val="1345.8"/>
        <set name="hpRegen" val="7.5"/>
        <set name="mpRegen" val="2.7"/>
        <set name="pAtk" val="688.86373"/>
        <set name="pDef" val="295.91597"/>
        <set name="mAtk" val="470.40463"/>
        <set name="mDef" val="216.53847"/>
        <set name="crit" val="4"/>
        <set name="atkSpd" val="253"/>
        <set name="str" val="40"/>
        <set name="int" val="21"/>
        <set name="dex" val="30"/>
        <set name="wit" val="20"/>
        <set name="con" val="43"/>
        <set name="men" val="20"/>
        <set name="corpseTime" val="7"/>
        <set name="walkSpd" val="50"/>
        <set name="runSpd" val="120"/>
        <set name="dropHerbGroup" val="0"/>
        <set name="attackRange" val="40"/>
        <ai type="default" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" canMove="true" seedable="false"/>
    </npc>
  • 3 weeks later...
Posted

proudly presents probably first custom npc, that has been designed and developed together with my good friend. custom npc shows ranking of top players with the best score in three basic categories (TOP PVP, TOP PK, TOP ONLINE). lists refreshes automaticaly every x minutes and generates y players in the ranking table. variables are fully customizable and configurable, but never tested with none-default values. to successfully implement npc just follow three simple steps.

 

preview: http://s29.postimg.org/bxq590bj9/ranking_npc.gif

 

first you have to create new file in proper package (gameserver/model/actor/instance/),

name: L2StatusInstance.java

/*
 * 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 2, 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package net.sf.l2j.gameserver.model.actor.instance;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.StringTokenizer;
import java.util.logging.Level;

import net.sf.l2j.L2DatabaseFactory;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class L2StatusInstance extends L2NpcInstance
    {
    
    private class PlayerInfo
        {
        public PlayerInfo(int pos,String n, int pvps, int pks ,int ontime, Boolean iso)
            {
            position = pos;
            Nick = n;
            pvpCount = pvps;
            pkCount = pks;
            onlineTime = ontime;
            isOnline = iso;
            }
        
        public int position;
        public String Nick;
        public int pvpCount;
        public int pkCount;
        public int onlineTime;
        public Boolean isOnline;
        }
    
    //delay interval (in minutes):
    private final int delayForCheck = 5;
    
    //number of players to be listed
    private int pvpListCount = 10;
    private int pkListCount = 10;
    private int onlineListCount = 10;

    
    private PlayerInfo [] topPvPList = new PlayerInfo [pvpListCount];
    private PlayerInfo [] topPkList = new PlayerInfo [pkListCount];
    private PlayerInfo [] topOnlineList = new PlayerInfo [onlineListCount];
    
    
    public L2StatusInstance(int objectId, NpcTemplate template)
        {
        super(objectId, template);
        ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new RefreshAllLists(), 10000, delayForCheck * 60000);
        }
        
    private class RefreshAllLists implements Runnable
        {
        public void run()
            {
            ReloadData();
            }
        }
    
    private void ReloadData()
        {
        try (Connection con = L2DatabaseFactory.getInstance().getConnection())
            {
            PreparedStatement statement = con.prepareStatement("SELECT char_name, pvpkills, online FROM characters ORDER BY pvpkills DESC, char_name ASC LIMIT 10");
            ResultSet result = statement.executeQuery();
            
            //refreshing top pvp list
            int i = 0; //index of array
            
            while (result.next())
                {
                topPvPList[i] = new PlayerInfo(i+1,result.getString("char_name"),result.getInt("pvpkills"),0,0,result.getBoolean("online"));
                i++;
                }
                    
            //refreshing top pk list
            statement = con.prepareStatement("SELECT char_name, pkkills, online FROM characters ORDER BY pkkills DESC, char_name ASC LIMIT 10");
            result = statement.executeQuery();
            
            i = 0; //index of array
            while (result.next())
                {
                topPkList[i] = new PlayerInfo(i+1,result.getString("char_name"),0,result.getInt("pkkills"),0,result.getBoolean("online"));
                i++;
                }
            
            //refreshing top online list
            statement = con.prepareStatement("SELECT char_name, onlinetime, online FROM characters ORDER BY onlinetime DESC, char_name ASC LIMIT 10");
            result = statement.executeQuery();
            
            i = 0; //index of array
            while (result.next())
                {
                topOnlineList[i] = new PlayerInfo(i+1,result.getString("char_name"),0,0,result.getInt("onlinetime"),result.getBoolean("online"));
                i++;
                }
            
            result.close();
            statement.close();
           
            }
        catch (SQLException e)
            {
            _log.log(Level.WARNING, "ranking (status): could not load statistics informations" + e.getMessage(), e);
            }
        }

    @Override
    public void onSpawn()
        {
        ReloadData();
        }

    @Override
     public void showChatWindow(L2PcInstance player)
         {
        GeneratePvPList(player);
         }
    
    @Override
    public void onBypassFeedback(L2PcInstance player, String command)
        {
        StringTokenizer st = new StringTokenizer(command, " ");
        String currentCommand = st.nextToken();
    
        if (currentCommand.startsWith("pvplist"))
            {
            GeneratePvPList(player);
            }

        else if (currentCommand.startsWith("pklist"))
            {
            GeneratePKList(player);
            }
        else if (currentCommand.startsWith("onlinelist"))
            {
            GenerateOnlineList(player);
            }
                
        super.onBypassFeedback(player, command);
        }
    
    private void GeneratePvPList(L2PcInstance p)
        {
        StringBuilder _PVPranking = new StringBuilder();
        for (PlayerInfo player : topPvPList)
            {
            if (player == null) break;

            _PVPranking.append("<table width=\"290\"><tr>");
               _PVPranking.append("<td FIXWIDTH=\"2\" align=\"center\"></td>");        
               _PVPranking.append("<td FIXWIDTH=\"17\" align=\"center\">"+player.position+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"158\" align=\"center\">"+player.Nick+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"90\" align=\"center\">"+player.pvpCount+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"50\" align=\"center\">"+((player.isOnline) ? "<font color=\"00FF00\">ON</font>" : "<font color=\"CC0000\">OFF</font>")+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"2\" align=\"center\"></td>");
               _PVPranking.append("</tr></table>");
               _PVPranking.append("<img src=\"L2UI.Squaregray\" width=\"300\" height=\"1\">");
            }
        
           NpcHtmlMessage html = new NpcHtmlMessage(1);
        html.setFile(getHtmlPath(getNpcId(), 0));
        html.replace("%objectId%", getObjectId());
        html.replace("%pvplist%", _PVPranking.toString());
        p.sendPacket(html);
        }
    
    private void GeneratePKList(L2PcInstance p)
        {
        StringBuilder _PVPranking = new StringBuilder();
        for (PlayerInfo player : topPkList)
            {
            if (player == null) break;
    
               _PVPranking.append("<table width=\"290\"><tr>");
               _PVPranking.append("<td FIXWIDTH=\"2\" align=\"center\"></td>");        
               _PVPranking.append("<td FIXWIDTH=\"17\" align=\"center\">"+player.position+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"158\" align=\"center\">"+player.Nick+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"90\" align=\"center\">"+player.pkCount+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"50\" align=\"center\">"+((player.isOnline) ? "<font color=\"00FF00\">ON</font>" : "<font color=\"CC0000\">OFF</font>")+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"2\" align=\"center\"></td>");
               _PVPranking.append("</tr></table>");
               _PVPranking.append("<img src=\"L2UI.Squaregray\" width=\"300\" height=\"1\">");
            }
        
           NpcHtmlMessage html = new NpcHtmlMessage(1);
        html.setFile(getHtmlPath(getNpcId(), 2));
        html.replace("%objectId%", getObjectId());
        html.replace("%pklist%", _PVPranking.toString());
        p.sendPacket(html);
        }
    
    private void GenerateOnlineList(L2PcInstance p)
        {
        StringBuilder _PVPranking = new StringBuilder();
        for (PlayerInfo player : topOnlineList)
            {
            if (player == null) break;
        
               _PVPranking.append("<table width=\"290\"><tr>");
               _PVPranking.append("<td FIXWIDTH=\"2\" align=\"center\"></td>");        
               _PVPranking.append("<td FIXWIDTH=\"17\" align=\"center\">"+player.position+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"158\" align=\"center\">"+player.Nick+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"90\" align=\"center\">"+ConverTime(player.onlineTime)+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"50\" align=\"center\">"+((player.isOnline) ? "<font color=\"00FF00\">ON</font>" : "<font color=\"CC0000\">OFF</font>")+"</td>");
               _PVPranking.append("<td FIXWIDTH=\"2\" align=\"center\"></td>");
               _PVPranking.append("</tr></table>");
               _PVPranking.append("<img src=\"L2UI.Squaregray\" width=\"300\" height=\"1\">");
            }
        
           NpcHtmlMessage html = new NpcHtmlMessage(1);
        html.setFile(getHtmlPath(getNpcId(), 3));
        html.replace("%objectId%", getObjectId());
        html.replace("%onlinelist%", _PVPranking.toString());
        p.sendPacket(html);
        }
    
    private String ConverTime(long seconds)
        {
        long remainder = seconds;
        int days = (int) remainder / (24*3600);
        remainder = remainder -(days * 3600 * 24);
    
        int hours = (int) (remainder / 3600);
        remainder = remainder -(hours * 3600);
       
        int minutes = (int) (remainder / 60);
        remainder = remainder -(hours * 60);
 
        seconds = remainder;
    
        String timeInText = "";
    
        if (days > 0)
            timeInText = days+"<font color=\"LEVEL\">D</font> ";
        if (hours > 0)
            timeInText = timeInText+ hours+"<font color=\"LEVEL\">H</font> ";
        if (minutes >0)
            timeInText = timeInText+ minutes+"<font color=\"LEVEL\">M</font>";
          
        if (timeInText=="")
            {
            if(seconds>0)
                {
                timeInText = seconds+"<font color=\"LEVEL\">S</font>";
                }
            else
                {
                timeInText = "N/A";
                }
            }
        return timeInText;
        }
    
    @Override
    public String getHtmlPath(int npcId, int val)
        {
        String filename;
        
        if (val == 0)
            filename = "data/html/Status/" + npcId + ".htm";
        else
            filename = "data/html/Status/" + npcId + "-" + val + ".htm";
        
        if (HtmCache.getInstance().isLoadable(filename))
            return filename;
        
        return "data/html/Status/" + npcId + ".htm";
        }
    }
create new npc with our dedicated type or use the one below:

    <npc id="50012" idTemplate="31549" name="STATISTICS WALL" title="L2EUPHORIA.COM">
        <set name="level" val="70"/>
        <set name="radius" val="32"/>
        <set name="height" val="46.5"/>
        <set name="rHand" val="0"/>
        <set name="lHand" val="0"/>
        <set name="type" val="L2Status"/>
        <set name="exp" val="0"/>
        <set name="sp" val="0"/>
        <set name="hp" val="2444.46819"/>
        <set name="mp" val="1345.8"/>
        <set name="hpRegen" val="7.5"/>
        <set name="mpRegen" val="2.7"/>
        <set name="pAtk" val="688.86373"/>
        <set name="pDef" val="295.91597"/>
        <set name="mAtk" val="470.40463"/>
        <set name="mDef" val="216.53847"/>
        <set name="crit" val="4"/>
        <set name="atkSpd" val="253"/>
        <set name="str" val="40"/>
        <set name="int" val="21"/>
        <set name="dex" val="30"/>
        <set name="wit" val="20"/>
        <set name="con" val="43"/>
        <set name="men" val="20"/>
        <set name="corpseTime" val="7"/>
        <set name="walkSpd" val="50"/>
        <set name="runSpd" val="120"/>
        <set name="dropHerbGroup" val="0"/>
        <set name="attackRange" val="40"/>
        <ai type="default" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" canMove="true" seedable="false"/>
    </npc>
dowload this archive(contains necessary .htmls) and extract to: gameserver/data/html/.

remember to keep these files in proper folder (Status) and use correct npc type (L2Status).

 

1)Work For me Acis 350.:)  

2:) i have one porblem (see and GMchar in list Top pvp/Top Pk/Top online... How to off GMchar in list?

Guest
This topic is now closed to further replies.



  • Posts

    • cheap discord account full access (that's mean you have access to email and discord to change everything) those account are good for everything best prices on the market price start at : 0.55$ bulk= discount link store :  afgstore.mysellauth.com   telegram to contact me or buy : t.me/AFGDiscord discord : revo_gg
    • ⭐⭐⭐⭐⭐L2Lusty 50x [Essence - High Five] Start 08 February⭐⭐⭐⭐⭐  L2Lusty Essence - High Five 50x Website: https://l2lusty.online/ Starts on 08/02/2025 16:00 London Time Rates: XP 50X, Adena 20X, Spoil 20X, Drop 20X, Max enchant +16 with 50% normal and 60% blessed, Chaos Event whit 3x Lcoins Drop 24h Website:  https://l2lusty.online/
    • Hi, I inviting you to join L2Einhovant server, lets give them chanse. It's x1 Classic with some bonus futures, no duals box, no wipes, buffs stores and etc. Grow up by litle steps together with the server population.   🔥 Why L2Einhovant? ✅ Authentic Classic Gameplay – No dual box, all classes inportant, no auto farm. ✅ Hardcore x1 Rates – A true test of your gameplay skill, level up stages. ✅ Active Community & Fair Administration – A server built for passionate players. ✅ Long-Term Stability – Grow your character in a world that lasts.   Gather your allies, sharpen your weapons, and prepare for an unforgettable journey. Join to our comunity now and prepare for start.   Open beta: 1th February. Grand opening: 7th February, 20:00 UTC+2.   🔗 Discord: https://discord.gg/zfKd4tU9N2
    • ElmoreLab Harbor - Eternal C1 x1: ✅ https://harbor.elmorelab.com ElmoreLab Harbor - Eternal C1 x1 - is an exclusive server of the Eternal C1 chronicles from the top project ElmoreLab Harbor.   A unique server of its kind, on which everyone will have maximum pleasure, such as oldschool players who dream of nostalgia and to feel the warmest and classic C1 chronicles, as well as experienced players who are tired of thousands unbalanced servers of late chronicles. Due to the professional corrections of the balance system and the HONEST gameplay system - on this server, EVERY player will feel like in their own, warm and cozy Harbor C1. Let's return to the origins of L2 - back to 2004 in C1! ❤️   ⭐ Server characteristics:   STRICTLY 1 window, NO BOXES Bans for RMT and bots/cheats No donations with benefits Unique and high-quality PTS-build from Master Toma Professional corrections and full class-balance Reworked economy and closed all abuses Improved animations and all aspects of the game Exclusive HD-client with high-quality textures Experienced administration and management Fixed all bugs, geodata, exploits and holes Maximum sociality due to the 1-box system Discovering, exploring and researching Big online International server Nostalgia and oldschool-feelings   Rates: x1 Server start: 14.02.2025   The server is at the final stages of development and preparation for release. Information on the server will be updated, soon the patchnotes and changes/edits will be posted. Don't miss the legendary and epic experience on the best server in the last 20 years! ❤️ Join our C1-forum with a lot of information about server and active discussions.   ⭐ Website: https://harbor.elmorelab.com   ✅ Forum: https://forum-harbor.elmorelab.com   💥 Telegram: https://t.me/l2harbor https://t.me/l2harbor_chat   ⚡ Discord: https://discord.gg/harborelmorelab
  • Topics

×
×
  • Create New...