Jump to content

[GR]-[EN][Share][IL]Top PvP Player Announce+Color+Chat


Recommended Posts

Posted

Hi All i create with some help of my friend Top PvP Player Status And i want to Help all users of mxc :'D

 

PS: If you feel there to perform the same post deletion!

 

Lets start! :D

 

=============================================

index/net/sf/l2j/gameserver/gameserver.java =

=============================================

 @657,9 657,7@

       _adminCommandHandler.registerAdminCommandHandler(new AdminHero());
        _adminCommandHandler.registerAdminCommandHandler(new AdminNoble());
+        _adminCommandHandler.registerAdminCommandHandler(new AdminTopPvpPlayer());

 

===================================================================================

Index/net/sf/l2j/handlers/admincommandHandlers Create File AdminTopPvpPlayer.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.
*
*/
package net.sf.l2j.gameserver.handler.admincommandhandlers;

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

import net.sf.l2j.L2Config;
import net.sf.l2j.L2DatabaseFactory;
import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.GmListTable;
import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
import net.sf.l2j.gameserver.model.L2Object;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
*
* Author Tsikos*
*
*/
public class AdminTopPvpPlayer implements IAdminCommandHandler
{
private static String[] _adminCommands =
{
	"admin_setTopPvpPlayer",};
private final static Log _log = LogFactory.getLog(AdminTopPvpPlayer.class.getName());
private static final int REQUIRED_LEVEL = L2Config.GM_MENU;

public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
	if (!L2Config.ALT_PRIVILEGES_ADMIN)
	{
		if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM()))
		{
			return false;
		}
	}
	if (command.startsWith("admin_setTopPvpPlayer"))
	{
		L2Object target = activeChar.getTarget();
		L2PcInstance player = null;
		SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
		if (target instanceof L2PcInstance)
		{
			player = (L2PcInstance)target;
		} else
		{
			player = activeChar;
		}

		if (player.isTopPvpPlayer())
		{
			player.setTopPvpPlayer(false);
			sm.addString("You are no longer a server TopPvpPlayer.");
			GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" removed TopPvpPlayer stat of player"+ target.getName());
			Connection connection = null;
			try
			{
				connection = L2DatabaseFactory.getInstance().getConnection();

				PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?");
				statement.setString(1,target.getName());
				ResultSet rset = statement.executeQuery();
				int objId = 0;
				if (rset.next())
				{
					objId = rset.getInt(1);
				}
				rset.close();
				statement.close();

				if (objId == 0) {connection.close(); return false;}

				statement = connection.prepareStatement("UPDATE characters SET TopPvpPlayer=0 WHERE obj_id=?");
				statement.setInt(1, objId);
				statement.execute();
				statement.close();
				connection.close();
			}
			catch (Exception e)
			{
				_log.warn("could not set TopPvpPlayer stats of char:", e);
			}
			finally
			{
				try { connection.close(); } catch (Exception e) {}
			}
		}
		else
		{
			player.setTopPvpPlayer(true);
			sm.addString("You are now a server TopPvpPlayer, congratulations!");
			GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" has given TopPvpPlayer stat for player "+target.getName()+".");
			Connection connection = null;
			try
			{
				connection = L2DatabaseFactory.getInstance().getConnection();

				PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?");
				statement.setString(1,target.getName());
				ResultSet rset = statement.executeQuery();
				int objId = 0;
				if (rset.next())
				{
					objId = rset.getInt(1);
				}
				rset.close();
				statement.close();

				if (objId == 0) {connection.close(); return false;}

				statement = connection.prepareStatement("UPDATE characters SET TopPvpPlayer=1 WHERE obj_id=?");
				statement.setInt(1, objId);
				statement.execute();
				statement.close();
				connection.close();
			}
			catch (Exception e)
			{
				_log.warn("could not set TopPvpPlayer stats of char:", e);
			}
			finally
			{
				try { connection.close(); } catch (Exception e) {}
			}

		}
		player.sendPacket(sm);
		player.broadcastUserInfo();
		if(player.isTopPvpPlayer() == true)
		{
			Announcements.getInstance().announceToAll(player.getName() + " Has Become a Server TopPvpPlayer!");
		}
	}
	return false;
}
  public String[] getAdminCommandList() {
	return _adminCommands;
}
private boolean checkLevel(int level)
{
	return (level >= REQUIRED_LEVEL);
}
}

 

=========================================================

index/net/sf/l2j/model/actor/instance/l2pcinstance.java =

=========================================================

@225,4 225,4@

-    private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_id=?";


-    private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_id=?";

+    private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,TopPvpPlayer WHERE obj_id=?";

+    private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,TopPvpPlayer FROM characters WHERE obj_id=?";


@498,1 498,1@

       /** True if the L2PcInstance is newbie */
private boolean _newbie;

private boolean _noble = false;
private boolean _hero = false;
private boolean _Customhero = false;
+	private boolean _TopPvpPlayer = false;

@5912,30 5912,30@ 


			player.setNewbie(rset.getInt("newbie")==1);
			player.setNoble(rset.getInt("nobless")==1);
+				player.setTopPvpPlayer(rset.getInt("TopPvpPlayer")==1);

@6387,39 6387,39@

           statement.setLong(41, totalOnlineTime);
           statement.setInt(42, isInJail() ? 1 : 0);
           statement.setLong(43, getJailTimer());
           statement.setInt(44, isNewbie() ? 1 : 0);
           statement.setInt(45, isNoble() ? 1 : 0);
           statement.setLong(46, getPowerGrade());
           statement.setInt(47, getPledgeType());
           statement.setLong(48,getLastRecomUpdate());
           statement.setInt(49,getLvlJoinedAcademy());
           statement.setLong(50,getApprentice());
           statement.setLong(51,getSponsor());
           statement.setInt(52, getAllianceWithVarkaKetra());
           statement.setLong(53, getClanJoinExpiryTime());
           statement.setLong(54, getClanCreateExpiryTime());
           statement.setString(55, getName());
    statement.setLong(56, getDeathPenaltyBuffLevel());
+	    statement.setInt(57, isTopPvpPlayer() ? 1 : 0); 

@6523,25 6523,25@

+ 	public boolean isTopPvpPlayer()
+ 	{
+ 	return _TopPvpPlayer;
+ 	}
+
+ 	public void setTopPvpPlayer(boolean TopPvpPlayer)
+ 	{
+ 	_TopPvpPlayer = TopPvpPlayer;
+    }

 

===================================================================

index:net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java =

===================================================================

 

@181,38 181,38@

 
+                    if (activeChar.isTopPvpPlayer())
+         	 	{
+          	 	activeChar.getAppearance().setNameColor(L2Config.TopPvpPlayer_NAME_COLOR);
+          	 	activeChar.sendMessage("Welcome TopPvpPlayer "+activeChar.getName()+" !");
+          	 	activeChar.sendMessage("Enjoy your Stay Mate!");
+         	 	Announcements.getInstance().announceToAll("Top PvP Player" +activeChar.getName()+ " is Now Online!"); 
+          	 	}

@236,29 236,29@


	if (activeChar.isTopPvpPlayer() || activeChar.getPvpKills() == 5000)
	{
		activeChar.sendMessage("[Message]:You rewarded TopPvpPlayer status for your pvp kill's");
	}

 

 

=============================================================

Index:net/sf/l2j/gameserver/network/clientpackets/say2.java =

=============================================================

@181,55 181,55@

+		 if (_text.startsWith("*") && activeChar.isTopPvpPlayer())
+		 {
+			 for (L2PcInstance player : L2World.getInstance().getAllPlayers())
+			 player.sendPacket(new CreatureSay(0, 15, activeChar.getName(), _text));
+			 return;
+		 }

 

================================

Index:net/sf/l2j/L2Config.java =

================================

 

@1147,23 1147,23@

  public static boolean KEEP_SUBCLASS_SKILLS;


+	public static boolean   TopPvpPlayer_NAME_COLOR_ENABLED;
+ 	public static int       TopPvpPlayer_NAME_COLOR;


@2659,20 2659,20@


             KEEP_SUBCLASS_SKILLS = Boolean.parseBoolean(customSettings.getProperty("EnableStuckSubsMode", "False"));
+              TopPvpPlayer_NAME_COLOR_ENABLED  = Boolean.parseBoolean(customSettings.getProperty("TopPvpPlayerNameColorEnabled",
"False")); 
+              TopPvpPlayer_NAME_COLOR          = Integer.decode("0x" + customSettings.getProperty("TopPvpPlayerColorName", "0099ff"));

 

=====================================

Gameserver/config/custom.properties =

=====================================

+#------------------------------------------------# 
+# Top PvP Player System By Tsikos                      #      
+#------------------------------------------------# 
+
+# TopPvpPlayer Color Name 
+# TopPvpPlayer Name Color Enabled?.
+TopPvpPlayerNameColorEnabled = False
+# TopPvpPlayer Color Name Selection
+TopPvpPlayerColorName = 0099ff

=========
=Code Finish=
=========

 

##################

#All Credits Go to Tsikos*#

##################

 

::DownLoad Link::

 

 

[move]http://www.4shared.com/file/igL-m8m8/Top_PvP_Player.html[/move]

 

Posted

Not so well-coded. Why do you query the DB for the char objectid ? Its already in the l2pcinstance.getObjectId();

 

Look Man

+    private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,TopPvpPlayer WHERE obj_id=?";

 

Finish

death_penalty_level=?,TopPvpPlayer Where obj_id=?"

 

;)

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • 🔥 Apresentação I present to you a new fully customized DressMe system, developed for DreamV2, inspired by the best servers and enhanced with unique features that guarantee performance, customization and stunning visuals. ✨ Funcionalidades ✅ Aplicação de visual de armas e armaduras sem alterar o item real equipado. ✅ Compatível com qualquer tipo de arma/armadura (ex: skins de bow visíveis apenas com bows equipados). ✅ Remoção automática do visual quando parte do set real é desequipada. ✅ Efeitos visuais (skills) aplicados com suporte a: Aplicação única ou recorrente Intervalo configurável via XML Remoção automática ao desativar o visual ✅ Interface limpa e lógica modular, fácil de expandir com novos visuais ou efeitos.     <?xml version="1.0" encoding="UTF-8"?> <dressMeList> <dress skillId="9100" name="Draconic Armor" type="ARMOR" isVip="false" > <visualSet chest="6379" legs="0" gloves="6380" feet="6381" helmet="6841" /> <visualEffect skillId="445" level="1" recurring="true" interval="35" /> </dress> <dress skillId="9102" name="Cloak Style Armor" type="CLOAK" isVip="false"> <visualSet chest="7000" legs="0" gloves="0" feet="0" helmet="0" /> <visualEffect skillId="10005" level="1" recurring="false" /> </dress> <dress skillId="9103" name="Valakas Style Weapon" type="WEAPON" isVip="false"> <visualWep type="bow" rhand="7575" lhand="0" lrhand="0" /> <visualEffect skillId="10005" level="1" recurring="false" /> </dress> </dressMeList> 📸 Imagens & Vídeo 🛠️ Detalhes Técnicos Desenvolvido com base no L2J DreamV2 Integração direta com L2PcInstance, Inventory, ThreadPoolManager e SkillTable Sistema de gerenciamento central via DressMeEffectManager Agendamento e cancelamento seguro de efeitos recorrentes Totalmente thread-safe e compatível com jogadores offline 📂 Instalação A instalação é feita via patch e inclui: Classes: DressMeHolder, DressMeEffectManager, modificações em L2PcInstance XML de exemplo Suporte completo à expansão por armas, cloaks e visuais parciais 📎 Download https://pastebin.com/raw/7i843yKh 💬 Feedback & Sugestões Sinta-se à vontade para comentar abaixo com sugestões, dúvidas ou feedbacks. Toda contribuição é bem-vinda para futuras versões!
    • @Tinker123aa Guytis, I have nothing against you, but it's very clear to me who is behind this files. I'm talking about the one that came with the captcha anti-bot system. I personally bought it from the real owner, who was one of the administrators of L2Gold.cc. This can be confirmed by him if he wishes. 😊 Maybe you worked on the files, but they didn’t start from you.   To the people trying to buy the files I’m just advising you not to waste your money. This is 100% verified information.   I honestly don't know how people believe you. 🙂 I'll share the link to the guy's topic below.   ps  
    • Hello,  Anyone knows how I can communicate to purchase this emulator.  Nobody answered in the forum of eternity neither Kate neither lord winter.    Thanks in advance.
  • 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