Jump to content
  • 0

[Request] Daily status, please all good devs come here!


Question

Posted

Hello MXC!

Who can make java code for interlude, then you wrote .getstats to you show

Today [PVP] : 0 [Deaths] : 0 [PK] : 0

and...

Cancel Skill after x time you receive back your loosing buffs.

Big big thanks!!! Big big thanks!!! Big big thanks!!! Big big thanks!!!

Recommended Posts

  • 0
Posted

if u did what i wrote, now find a method in L2PcInstance where pvp points are increased and give send it here.

  • 0
Posted

lets make pvp points first.

replace setDayPvp(getDayPvp() + 1); with addDayPvp();

and now create new method in L2PcInstance at the end:

private void addDayPvp()

{

//inside this method we will increase number in database. Find an example of code that is using INSERT INTO statement and send it here

}

  • 0
Posted

i have this

public void setDayPvp(int dayPvp){

_daypvp = dayPvp;

}

 

public int getDayPvp(){

return _daypvp;

}

so change it :)

  • 0
Posted

lets make pvp points first.

replace setDayPvp(getDayPvp() + 1); with addDayPvp();

and now create new method in L2PcInstance at the end:

private void addDayPvp()

{

//inside this method we will increase number in database. Find an example of code that is using INSERT INTO statement and send it here

}

  • 0
Posted

sorry, i wasnt at the code clear enough, delete this lines:

+        if(isPvpMaster())
+        masterkills++;
+        
+        switch(masterkills){
+        	case 4:
+        		getStatus().setCurrentCp(getMaxCp());
+        		getStatus().setCurrentHp(getMaxHp());
+        		getStatus().setCurrentMp(getMaxMp());
+        		sendMessage("You rewarded with full hp,cp,mp cause of your pvp master's ability");
+        		masterkills = 0;
+        		break;
+        		default:
+        			;
+        }

u dont need them, also delete this from your command:

public void DayPvpandPk(L2PcInstance l2pcinstance)
              {
            	  try
            	  {
            		  Connection connection = L2DatabaseFactory.getInstance().getConnection();
            		  PreparedStatement preparedstatement = connection.prepareStatement("SELECT todaypvps,char_name FROM characters WHERE accesslevel=? ORDER BY todaypvps DESC LIMIT 1");
            		  preparedstatement = connection.setInt(1, 0);
            		  ResultSet resultset = preparedstatement.executeQuery();
  					
  					if (rSet.next())
  					{
  						newPvpLord = rSet.getString("char_name");
  						topTodayPvps = rSet.getInt("todaypvps");
  					}
  					
  					rSet.close();
  					stm.close();
  					

            	  }
            	  catch(SQLException sqlexception)
            	  {
            	          
            	  }
              }

replace DayPvp() with activeChar.getDayPvp() and tell me about the results :)

  • 0
Posted

package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
    
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Calendar;

import com.l2jfrozen.util.database.L2DatabaseFactory;
import com.l2jfrozen.gameserver.model.entity.Announcements;
import com.l2jfrozen.gameserver.templates.StatsSet;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
import com.l2jfrozen.gameserver.network.clientpackets.Say2;

/**
* Allow player to enable or disable Experience and SP Gain.
*/

           public class getstatus implements IVoicedCommandHandler

                {

              private static final String[] VOICED_COMMANDS =

              {
                      "getstatus"
              };

       

              public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)

              {
            	  
                  if (command.equalsIgnoreCase("getstatus"))
                  {
                	  DayPvpandPk(activeChar);
                   }
    return true;
}              
              public void DayPvpandPk(L2PcInstance l2pcinstance)
              {
          		int DayPvp = 0;
          		int DayPk = 0;
        		Connection con = null;
        		PreparedStatement state = null;
        		ResultSet rset = null;
            	  try
            	  {
          			con = L2DatabaseFactory.getInstance().getConnection();
        			state = con.prepareStatement("SELECT daypvp,daypk FROM characters WHERE charId=?");
        			rset = state.executeQuery();
        			if(rset.next())
        			{
        			DayPvp = rset.getInt("daypvp");
        			DayPk = rset.getInt("daypvp");
        			}
        			
        			state.close();
        			rset.close();
        			
        			for(L2PcInstance p : L2World.getInstance().getAllPlayers()){
        				{
        					p.broadcastUserInfo();
        					
        					p.sendMessage("Today PvPs: "+DayPvp);
        					p.sendMessage("Today PKs: "+DayPk);
        				}
        			}
            	  }
        					catch (Exception e)
        					{ }
        					finally
        					{
        					try
        					{
        					con.close();
        					}
        					catch (Exception e)
        					{ }
        					}
        					}
              public String[] getVoicedCommandList()

              {

                      return VOICED_COMMANDS;

              }

      }

i maked this, no errors, but DON'T working... and your example don't working...

  • 0
Posted

u have to replace  DayPvpandPk(activeChar); with activeChar.sendMessage("Daily pvps:"+activeChar.getDayPvp());

Guest
This topic is now closed to further replies.



  • Posts

    • Why not, if you're interested I will post an update
    • UPD: New features and improvements
    • Hi everyone! I'm the admin of Lineage 2 ByPass. Some of you might remember it from 2009, when it first launched. This year I brought it back. The old server ran on a server pack from 2008, so I didn't copy anything. Every item, shop, NPC, teleport, drop and spawn was taken from the original files and rewritten for a modern engine. The sets, farm zones, buffer and TvT are the same ones you remember, but a lot of things that had been quietly broken for years are finally fixed, and the client got a big upgrade. THE SERVER IS NOT LIVE YET. We're finishing the last pieces and plan to open the Open Beta very soon. Join our Discord to hear the date first, and to tell me what you'd change while it's still easy to change things.   ──────────────────── RATES & ENCHANT - EXP / SP x1000 - Safe enchant +6, max +25 - Scrolls: Simple 75%, Blessed 80%, Crystal 95% (from events) - Augment skill chance 6% (chance augments removed, only active/passive left); augment buffs stack and last 2 hours UPGRADED INTERFACE - Auto Farm (2 hours per day) that sweeps what you spoil, with a separate skill setup per subclass - Auto Enchant, built-in Teleport and Skill Enchant windows - Next Target (Player): a target key made for PvP - Auto Soulshots / Spiritshots and Auto Potions at a % you set - Arrows and shots never run out - Optimized game client CUSTOM GEAR — 3 TIERS OVER S GRADE - Tier 1 (+5%): Demonic weapons, Dynasty armor - Tier 2 (+10%): Epic weapons, Epic Dark Knight armor - Tier 3 (+15%): Monster weapons, Vesper Gold armor - Every tier has its own weapon ability and a set bonus by armor type - Wings, Tattoos, Custom Shields, RB Jewels GAMEPLAY - 5 subclasses; no class, subclass or Noblesse quests - No grade penalty, no weight limit - Auto Buff: a full set in one click — buffs last 2 hours, 64 buff slots - GM Shop, Custom Item Shop, Global GK EVENTS & BOSSES - Team vs Team every 2 hours — 10-minute fights, every kill counts as PvP - Olympiad every weekend, Fri–Sun 18:00–24:00 Eastern European Time, new heroes every Monday - Castle Siege (Innadril) - 3 Mini Raid Bosses (respawn every 15 minutes) and Scarlet van Halisha (every 30 minutes) And this is only the start: big features never seen in Interlude are on the way. Server location: Warsaw, Poland Website: https://l2bypass.com Discord: https://l2bypass.com/discord See you in game!
    • 🎧 Ad-Free Streaming & Social Tools: YouTube Premium and Telegram Premium available with instant automated activation.     FINAL CALL: Google is Shutting This Down After October 2026! Google will NEVER bring back this window of opportunity again. Once this month ends, this massive backdoor upgrade is gone permanently!  BUY 2, GET 1 FREE IS STILL LIVE! Stock up now for yourself, your family, your business, and your friends! Think about it: Every single person you know uses a Gmail account, and everyone is running out of storage. Don't let your loved ones get trapped paying $20–$30 every single month when you can set them up with 5TB Cloud Storage + Gemini Advanced (12–18 Months) right now for only $15! Why Buy Bulk Activations Today? Instant Gift Value: Perfect lifetime-style gift for clients, family, or team members. 100% Private & Safe: Activates on personal Gmails—zero passwords or logins required. Global Access: Works worldwide with zero VPN hassles. Instant Automated Delivery: Receive your activation links in seconds 24/7! ‍ Time is running out fast—secure your extra free licenses before the October deadline hits! Order Your Bundle Now on the Website
  • 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..