Jump to content

Question

Recommended Posts

  • 1
Posted (edited)
58 minutes ago, SweeTs said:

No. It's basically one code line. Create the command on you own. 

Fact: I'm not a chef.

Example: Basically, all you can do is cook a dish. Create the recipe on your own.

 

I don't think he got any help rather than frustration.

 

Edited by protoftw
  • 1
Posted
25 minutes ago, protoftw said:

Fact: I'm not a chef.

Example: Basically, all you can do is cook a dish. Create the recipe on your own.

Fact: you have the recipe. 

Example: as you have the recipe you can cook, at least try. 

 

Title change color npc is shared, reuse the code. Admin command set name/title color exists, reuse the code.

Voiced, command handlers exists, reuse the code.

 

At least try, take a look, think, experiment. If you don't try, you never learn to cook.

 

Saying "i can't, I won't do it" won't change anything. 

  • 1
Posted

It's easy, you just have to think and reuse existing code.

 

Okay, then.. 

 

- open any command, can be Escape

- copy the code, create new file paste it

- remove the destroy, teleport, checks and/or whatever part you think is useless

- search for "settitle" command

- copy the code, mainly the line player.setTitleColor obviously, no need further explanations what's that and other broadcast lines, hello, if those lines are there, you need them as well

- I see errors on parse something, well, replace it with static code

- but how? Search for gm color config, see how is builded the line and do the same

- register the handler, usercommandhandler

- enjoy

 

Got errors? Post em here, show that you are trying and you are willing to learn. Otherwise don't bother opening a server, even a local one. Sad but true. 

 

----

 

You said you tried, show me the code. 

  • Like 1
  • 1
Posted (edited)
24 minutes ago, l2bartdev said:

so i just have to create for ex custom_colors table? and then what inside? :P

 

I made you a quick code, is up to you how to use it e.t.c

 

package com.l2evie.gameserver;

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

import com.l2evie.L2DatabaseFactory;
import com.l2evie.gameserver.model.actor.instance.L2PcInstance;

/**
 * @author Evie Frye
 */
public class Color
{
	private static Color _instance = null;
	
	public static Color getInstance()
	{
		if (_instance == null)
		{
			_instance = new Color();
		}
		return _instance;
	}
	
	/**
	 * @param objectId
	 * @return
	 */
	public void setColor(final L2PcInstance activeChar)
	{
		Integer[] holder = null;
		
		try(Connection con = L2DatabaseFactory.getInstance().getConnection())
		{
			ResultSet result = con.prepareStatement("SELECT hexName, hexTitle FROM character_color_table WHERE objectId = " + activeChar.getObjectId()).executeQuery();
			
			if (result.next())
			{
				holder = new Integer[]{(Integer.parseInt(result.getString("hexName"))), Integer.parseInt(result.getString("hexTitle"))};
			}
		}
		catch(SQLException e)
		{
			return;
		}
		
		if (holder !=null)
		{
			activeChar.getAppearance().setNameColor(holder[0]);
			activeChar.getAppearance().setTitleColor(holder[1]);
			activeChar.broadcastUserInfo();
		}
	}
	
	/**
	 * 
	 * @param objectId
	 */
	public void storeColor(final L2PcInstance activeChar)
	{
		try(Connection con = L2DatabaseFactory.getInstance().getConnection())
		{
			PreparedStatement statement = con.prepareStatement("INSERT INTO character_color(objectId, hexName, hexTitle) values(?,?,?) ON DUPLICATE KEY UPDATE hexColor=?");
			statement.setInt(1, activeChar.getObjectId());
			statement.setInt(2, activeChar.getAppearance().getNameColor());
			statement.setInt(3, activeChar.getAppearance().getNameColor());
			statement.execute();
		}
		catch(SQLException e)
		{
			
		}
	}
}

 

And the SQL:

 

/*
MySQL Data Transfer
Source Host: localhost
Source Database: l2jgs
Target Host: localhost
Target Database: l2jgs
Date: 4/3/2018 9:18:52 PM
*/

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for character_color
-- ----------------------------
DROP TABLE IF EXISTS `character_color`;
CREATE TABLE `character_color` (
  `objectId` int(10) NOT NULL,
  `hexName` text NOT NULL,
  `hexTitle` text NOT NULL,
  PRIMARY KEY (`objectId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

 

Consider those should load once upon server start and server shutdown to avoid connection everytime a player login and logout but nowadays with so fast queries and store procedures nobody cares.

 

To use the code just go on EnterWorld and write

 

Color.getInstance().setColor(activeChar);

and to store go in L2PcInstance, find cleanMe method and somewhere inside write:

 

Color.getInstance().storeColor(this);

 

Edited by Evie Frye
  • 1
Posted
5 minutes ago, l2bartdev said:

very kind of you brother thanks a bunch i already did the code i can do the command //titlecolor but when i rr it gets in the normal colors so i can just put the sql and it should work?thanks again. :D

 

Yeap and if it works come back and give me 1.000 euro, took me 2 minutes.

  • 1
Posted
59 minutes ago, Evie Frye said:

 

I made you a quick code, is up to you how to use it e.t.c

 


package com.l2evie.gameserver;

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

import com.l2evie.L2DatabaseFactory;
import com.l2evie.gameserver.model.actor.instance.L2PcInstance;

/**
 * @author Evie Frye
 */
public class Color
{
	private static Color _instance = null;
	
	public static Color getInstance()
	{
		if (_instance == null)
		{
			_instance = new Color();
		}
		return _instance;
	}
	
	/**
	 * @param objectId
	 * @return
	 */
	public void setColor(final L2PcInstance activeChar)
	{
		Integer[] holder = null;
		
		try(Connection con = L2DatabaseFactory.getInstance().getConnection())
		{
			ResultSet result = con.prepareStatement("SELECT hexName, hexTitle FROM character_color_table WHERE objectId = " + activeChar.getObjectId()).executeQuery();
			
			if (result.next())
			{
				holder = new Integer[]{(Integer.parseInt(result.getString("hexName"))), Integer.parseInt(result.getString("hexTitle"))};
			}
		}
		catch(SQLException e)
		{
			return;
		}
		
		if (holder !=null)
		{
			activeChar.getAppearance().setNameColor(holder[0]);
			activeChar.getAppearance().setTitleColor(holder[1]);
			activeChar.broadcastUserInfo();
		}
	}
	
	/**
	 * 
	 * @param objectId
	 */
	public void storeColor(final L2PcInstance activeChar)
	{
		try(Connection con = L2DatabaseFactory.getInstance().getConnection())
		{
			PreparedStatement statement = con.prepareStatement("INSERT INTO character_color(objectId, hexName, hexTitle) values(?,?,?) ON DUPLICATE KEY UPDATE hexColor=?");
			statement.setInt(1, activeChar.getObjectId());
			statement.setInt(2, activeChar.getAppearance().getNameColor());
			statement.setInt(3, activeChar.getAppearance().getNameColor());
			statement.execute();
		}
		catch(SQLException e)
		{
			
		}
	}
}

 

And the SQL:

 


/*
MySQL Data Transfer
Source Host: localhost
Source Database: l2jgs
Target Host: localhost
Target Database: l2jgs
Date: 4/3/2018 9:18:52 PM
*/

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for character_color
-- ----------------------------
DROP TABLE IF EXISTS `character_color`;
CREATE TABLE `character_color` (
  `objectId` int(10) NOT NULL,
  `hexName` text NOT NULL,
  `hexTitle` text NOT NULL,
  PRIMARY KEY (`objectId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

 

Consider those should load once upon server start and server shutdown to avoid connection everytime a player login and logout but nowadays with so fast queries and store procedures nobody cares.

 

To use the code just go on EnterWorld and write

 


Color.getInstance().setColor(activeChar);

and to store go in L2PcInstance, find cleanMe method and somewhere inside write:

 


Color.getInstance().storeColor(this);

 

 

best!

  • 1
Posted
5 minutes ago, Evie Frye said:

 

And to be honest i'm done with this forum anyway so that was my last post.

 

We will really miss you!

My heart is already beating more and more every time I read your reply..

 

RIP my net friend.. :D

  • 1
Posted
2 hours ago, Evie Frye said:

judge someone's code who wrote it in 1-2 minute while playing DotA.

Excuses as always, poor code as always :(

Code properly, or don't code at all. Kisses my dear not :D

  • 0
Posted

how to do this? ;D i am not this experienced with these i know how to add a code but that is a childs game for others now creating a code line gets a bit hard ;D but thanks in advance brother 

  • 0
Posted

I'm not saying that he can't try . You are stating facts that are known to you. Without further due there is no reason to argue. It's pointless and non helpful for him.

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
Answer this question...

×   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

    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market
    • as you said expose connections in the server and create a communication with your AI, ironically an AI can help you do excactly that, all you need is your time i dont think you can get any help on discovering something that dont exist out of the box, thats the history with emulating l2->j in general thats what people, here you can find only positive and sometimes toxic responses, just go ahead and do stuff
    • 高质量 LinkedIn 账号新品到货,助力自信推广与影响力提升 新增商品: LinkedIn 自注册账号,带真实好友 (50/100/250/500/1000 可选) | 地区:美国/欧洲 (可选) | 完善资料 | 实机注册 | 价格起步 $10 LinkedIn 自注册账号,带真实好友 + 高级订阅 (Career/Business/Sales Navigator/Recruiter 任意选择) | 地区:美国 | 完善资料 | 实机注册 | 价格起步 $15 我们的在线商店全品类: 账号:Telegram、Facebook、Reddit、Twitter (X)、Instagram、YouTube、TikTok、Discord、VK、LinkedIn、GitHub、Snapchat、Gmail、邮箱账号 (Outlook、Firstmail、Rambler、Onet、Gazeta、GMX、Yahoo、Proton、Web.de)、Google Voice、Google Ads 高级订阅:Telegram Premium、Twitter Premium X、YouTube Premium、Spotify Premium、Netflix Premium、Discord Nitro、ChatGPT Plus/PRO、XBOX Game Pass 附加服务:Telegram Stars、代理 (IPv4、IPv6、ISP、移动)、VPN (Outline、WireGuard、其他)、VDS/RDP 服务器 优惠码:AUGUST2025 (立减 10%) 支付方式:银行卡 · 加密货币 · 其他常用方式 如何购买: 在线商店: Click Telegram 机器人: Click 其他服务: SMM 面板: Click – 推广您的社交媒体账号 使用我们的 SMM 面板可提升:Facebook、Instagram、Telegram、Spotify、Soundcloud、YouTube、Reddit、Threads、Kick、Discord、LinkedIn、Likee、VK、Twitch、Kwai、Reddit、网站流量、TikTok、Trust Pilot、Apple Music、Tripadvisor、Snapchat 等数字产品。 首次试用 SMM 面板可获得 $1 奖励:只需在我们的网站 (Support) 提交工单,主题填写 “Get Trial Bonus”。 LinkedIn 账号种类: LINKEDIN.COM 账号 | 自带邮箱 @OUTLOOK.COM / HOTMAIL.COM / @FIRSTMAIL,男女皆有,部分资料已填,注册自美国 IP | 起价 $2.5 LINKEDIN.COM 账号 | 自带邮箱 @OUTLOOK.COM / HOTMAIL.COM / @FIRSTMAIL,男女皆有,部分资料已填,注册自欧洲 IP | 起价 $2.5 LINKEDIN.COM 账号 | 自带邮箱 @OUTLOOK.COM / HOTMAIL.COM / @FIRSTMAIL.COM,男女皆有,部分资料已填,注册自混合 IP | 起价 $2.5 LinkedIn 老号 (Brute) 带真实好友 (0 好友) | 混合地区 | 完善资料 | 实机注册 | 起价 $10 LinkedIn 自注册账号,带真实好友 (50/100/250/500/1000 可选) | 地区:美国/欧洲 (可选) | 完善资料 | 实机注册 | 起价 $10 LinkedIn 自注册账号,带真实好友 + 高级订阅 (Career/Business/Sales Navigator/Recruiter 任意选择) | 地区:美国 | 完善资料 | 实机注册 | 起价 $15 LinkedIn 高级老号 (Brute) (Premium) 带 1 个月有效高级订阅 | 地区:混合 | 实机注册 | 完整访问 | 起价 $20 LinkedIn 老号 (Brute) 带真实好友 (50 好友) | 混合地区 | 完善资料 | 实机注册 | 起价 $20 LinkedIn 老号 (Brute) 带真实好友 (100+ 好友) | 混合地区 | 完善资料 | 实机注册 | 起价 $39 LinkedIn 老号 (Brute) 带真实好友 (500+ 好友) | 混合地区 | 完善资料 | 实机注册 | 起价 $69 LinkedIn 已验证老号 (Brute) 带实名验证文件 | 混合地区 | 实机注册 | 完整访问 | 起价 $89 老客户专享 — 额外折扣与优惠码! 享受 10% – 20% 折扣 或 注册即送 $1 奖励 如果您想领取注册奖励 $1 或首次购买立减 10% – 20%,您可以留言: “SEND ME BONUS, MY USERNAME IS...” 您也可以在首次购买时使用优惠码:SOCNET (15% 折扣!) 联系方式与支持: Telegram: https://t.me/socnet_support Telegram 频道: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp 频道: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord 服务器: https://discord.gg/y9AStFFsrh 邮箱: solomonbog@socnet.store 您还可以通过以上联系方式: — 咨询批发采购 — 建立合作伙伴关系 (现有合作伙伴: https://socnet.bgng.io/partners ) — 成为我们的供应商 SocNet – 数字商品与高级订阅商店 
    • Thanks a lot for the very interesting responses! To clarify, this is only for personal learning and use, I don't plan on earning any money!
    • 高质量 LinkedIn 账号新品到货,助力自信推广与影响力提升 新增商品: LinkedIn 自注册账号,带真实好友 (50/100/250/500/1000 可选) | 地区:美国/欧洲 (可选) | 完善资料 | 实机注册 | 价格起步 $10 LinkedIn 自注册账号,带真实好友 + 高级订阅 (Career/Business/Sales Navigator/Recruiter 任意选择) | 地区:美国 | 完善资料 | 实机注册 | 价格起步 $15 我们的在线商店全品类: 账号:Telegram、Facebook、Reddit、Twitter (X)、Instagram、YouTube、TikTok、Discord、VK、LinkedIn、GitHub、Snapchat、Gmail、邮箱账号 (Outlook、Firstmail、Rambler、Onet、Gazeta、GMX、Yahoo、Proton、Web.de)、Google Voice、Google Ads 高级订阅:Telegram Premium、Twitter Premium X、YouTube Premium、Spotify Premium、Netflix Premium、Discord Nitro、ChatGPT Plus/PRO、XBOX Game Pass 附加服务:Telegram Stars、代理 (IPv4、IPv6、ISP、移动)、VPN (Outline、WireGuard、其他)、VDS/RDP 服务器 优惠码:AUGUST2025 (立减 10%) 支付方式:银行卡 · 加密货币 · 其他常用方式 如何购买: 在线商店: Click Telegram 机器人: Click 其他服务: SMM 面板: Click – 推广您的社交媒体账号 使用我们的 SMM 面板可提升:Facebook、Instagram、Telegram、Spotify、Soundcloud、YouTube、Reddit、Threads、Kick、Discord、LinkedIn、Likee、VK、Twitch、Kwai、Reddit、网站流量、TikTok、Trust Pilot、Apple Music、Tripadvisor、Snapchat 等数字产品。 首次试用 SMM 面板可获得 $1 奖励:只需在我们的网站 (Support) 提交工单,主题填写 “Get Trial Bonus”。 LinkedIn 账号种类: LINKEDIN.COM 账号 | 自带邮箱 @OUTLOOK.COM / HOTMAIL.COM / @FIRSTMAIL,男女皆有,部分资料已填,注册自美国 IP | 起价 $2.5 LINKEDIN.COM 账号 | 自带邮箱 @OUTLOOK.COM / HOTMAIL.COM / @FIRSTMAIL,男女皆有,部分资料已填,注册自欧洲 IP | 起价 $2.5 LINKEDIN.COM 账号 | 自带邮箱 @OUTLOOK.COM / HOTMAIL.COM / @FIRSTMAIL.COM,男女皆有,部分资料已填,注册自混合 IP | 起价 $2.5 LinkedIn 老号 (Brute) 带真实好友 (0 好友) | 混合地区 | 完善资料 | 实机注册 | 起价 $10 LinkedIn 自注册账号,带真实好友 (50/100/250/500/1000 可选) | 地区:美国/欧洲 (可选) | 完善资料 | 实机注册 | 起价 $10 LinkedIn 自注册账号,带真实好友 + 高级订阅 (Career/Business/Sales Navigator/Recruiter 任意选择) | 地区:美国 | 完善资料 | 实机注册 | 起价 $15 LinkedIn 高级老号 (Brute) (Premium) 带 1 个月有效高级订阅 | 地区:混合 | 实机注册 | 完整访问 | 起价 $20 LinkedIn 老号 (Brute) 带真实好友 (50 好友) | 混合地区 | 完善资料 | 实机注册 | 起价 $20 LinkedIn 老号 (Brute) 带真实好友 (100+ 好友) | 混合地区 | 完善资料 | 实机注册 | 起价 $39 LinkedIn 老号 (Brute) 带真实好友 (500+ 好友) | 混合地区 | 完善资料 | 实机注册 | 起价 $69 LinkedIn 已验证老号 (Brute) 带实名验证文件 | 混合地区 | 实机注册 | 完整访问 | 起价 $89 老客户专享 — 额外折扣与优惠码! 享受 10% – 20% 折扣 或 注册即送 $1 奖励 如果您想领取注册奖励 $1 或首次购买立减 10% – 20%,您可以留言: “SEND ME BONUS, MY USERNAME IS...” 您也可以在首次购买时使用优惠码:SOCNET (15% 折扣!) 联系方式与支持: Telegram: https://t.me/socnet_support Telegram 频道: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp 频道: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord 服务器: https://discord.gg/y9AStFFsrh 邮箱: solomonbog@socnet.store 您还可以通过以上联系方式: — 咨询批发采购 — 建立合作伙伴关系 (现有合作伙伴: https://socnet.bgng.io/partners ) — 成为我们的供应商 SocNet – 数字商品与高级订阅商店   
  • 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