Jump to content
  • 0

Problem with a bug.


Joκκєrino

Question

Hello community . As you know , there is a bug on L2jFrozen . If admin set to color clan leader title , you can make all players of this clan to have the same title by changing the clan leader .

 

Exemple : I am Leader . I have green color and then i change clan leader . After changing i'm not leader but i have green title color . My friend gonna give my clan back and then he will have green title color too as me , but he's not clan leader .

 

I tryied fix it and i successed.

 

 

                                L2jFrozen Code 

// Apply color settings to clan leader when entering  
	if (activeChar.getClan() != null && activeChar.isClanLeader() && Config.CLAN_LEADER_COLOR_ENABLED && activeChar.getClan().getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
	{
		if (Config.CLAN_LEADER_COLORED == 1)
			activeChar.getAppearance().setNameColor(Config.CLAN_LEADER_COLOR);
		else
			activeChar.getAppearance().setTitleColor(Config.CLAN_LEADER_COLOR);
	}

                   MY EDIT ADDED .
	if(activeChar.getClan() != null )
		if(!activeChar.isClanLeader())
			activeChar.getAppearance().setTitleColor(Config.CLAN_NOLEADER_COLOR);

 

But that's not really good , cuz player must restart to change his title color from "green"(Config.CLAN_LEADER_COLOR) to "white"Config.CLAN_NOLEADER_COLOR). Can you tell me how i can kill connection ? In moment when clan leader is changed , last clan leader to be kicked , not actually .

 

Sorry for my english ... :D But i hope you understand what i'm writing

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Hello community . As you know , there is a bug on L2jFrozen . If admin set to color clan leader title , you can make all players of this clan to have the same title by changing the clan leader .

 

Exemple : I am Leader . I have green color and then i change clan leader . After changing i'm not leader but i have green title color . My friend gonna give my clan back and then he will have green title color too as me , but he's not clan leader .

 

I tryied fix it and i successed.

 

 

                                L2jFrozen Code 

// Apply color settings to clan leader when entering  
	if (activeChar.getClan() != null && activeChar.isClanLeader() && Config.CLAN_LEADER_COLOR_ENABLED && activeChar.getClan().getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
	{
		if (Config.CLAN_LEADER_COLORED == 1)
			activeChar.getAppearance().setNameColor(Config.CLAN_LEADER_COLOR);
		else
			activeChar.getAppearance().setTitleColor(Config.CLAN_LEADER_COLOR);
	}

                   MY EDIT ADDED .
	if(activeChar.getClan() != null )
		if(!activeChar.isClanLeader())
			activeChar.getAppearance().setTitleColor(Config.CLAN_NOLEADER_COLOR);

 

But that's not really good , cuz player must restart to change his title color from "green"(Config.CLAN_LEADER_COLOR) to "white"Config.CLAN_NOLEADER_COLOR). Can you tell me how i can kill connection ? In moment when clan leader is changed , last clan leader to be kicked , not actually .

 

Sorry for my english ... :D But i hope you understand what i'm writing

 

 

 

    MY EDIT ADDED .

if(activeChar.getClan() != null )

if(!activeChar.isClanLeader())

-activeChar.getAppearance().setTitleColor(Config.CLAN_NOLEADER_COLOR);

                    +activeChar.getAppearance().setTitleColor(0xFFFFFF);

 

Link to comment
Share on other sites

  • 0

 

    MY EDIT ADDED .

if(activeChar.getClan() != null )

if(!activeChar.isClanLeader())

-activeChar.getAppearance().setTitleColor(Config.CLAN_NOLEADER_COLOR);

 

 

                    +activeChar.getAppearance().setTitleColor(0xFFFFFF);

 

 

 

Buddy , i already finished problem with bug , now i just want to kick last leader after changing leader

Link to comment
Share on other sites

  • 0

I don't know how l2jfrozen does clans but from the default interlude in L2Clan.java you could use this function after doing that crap.

 

public void removeClanMember(String name, long clanJoinExpiryTime)

 

 

Link to comment
Share on other sites

  • 0

I don't know how l2jfrozen does clans but from the default interlude in L2Clan.java you could use this function after doing that crap.

 

public void removeClanMember(String name, long clanJoinExpiryTime)

 

 

 

it's not about kicking him , just close his connection ( lineage 2 screen ).

Link to comment
Share on other sites

  • 0

it's not about kicking him , just close his connection ( lineage 2 screen ).

 

why do you want to close his connection? I don't really see the logic in that but, alright. What you can do is turn on the debugger, freeze your L2PcInstance and see what happens when you trigger a disconnect, perhaps there is a player disconnect function somewhere.

Link to comment
Share on other sites

  • 0

Hi, but about this, I can say, what I have been searching for leader color name changing, and I saw what, leaders name color is changing only when leader is crossing packet Enterworld (or in other words, he is starting playing) and then clan is destroying. But I didn't saw what clan leader color is changing, for example, when he creates the clan, or changes leader. So we can think like this:

Add these:

		if (Config.CLAN_LEADER_COLOR_ENABLED && getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
		{
			exLeader.getAppearance().setNameColor(0x000000);
			exLeader.getAppearance().setTitleColor(0x9900CC);
			exLeader.updateNameTitleColor();
		}

Below these:

public boolean setLeader(L2ClanMember member)
{
	if(member==null){
		return false;
	}

	L2ClanMember old_leader = _leader;
	_leader = member;
	_members.put(member.getName(), member);

	//refresh oldleader and new leader info
	if(old_leader!=null){

		L2PcInstance exLeader = old_leader.getPlayerInstance();
		exLeader.setClan(this);
		exLeader.setPledgeClass(exLeader.getClan().getClanMember(exLeader.getObjectId()).calculatePledgeClass(exLeader));
		exLeader.setClanPrivileges(L2Clan.CP_NOTHING);

And then, these:

		if (Config.CLAN_LEADER_COLOR_ENABLED && getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
		{
			if (Config.CLAN_LEADER_COLORED == 1)
				newLeader.getAppearance().setNameColor(Config.CLAN_LEADER_COLOR);
			else
				newLeader.getAppearance().setTitleColor(Config.CLAN_LEADER_COLOR);
			newLeader.updateNameTitleColor();
		}

Below these:

	updateClanInDB();


	if(member.getPlayerInstance()!=null){

		L2PcInstance newLeader = member.getPlayerInstance();
		newLeader.setClan(this);
		newLeader.setPledgeClass(member.calculatePledgeClass(newLeader));
		newLeader.setClanPrivileges(L2Clan.CP_ALL);

 

P.s. Sorry, I haven't finded good project with svn, so I couldn't put patch.

P.s.s. All this change is in L2Clan.java / setLeader method.

P.s.s.s. Sorry for bad English. :)

Link to comment
Share on other sites

  • 0

main thing:

exLeader.updateNameTitleColor();

But without these:

				exLeader.getAppearance().setNameColor(0x000000);
			exLeader.getAppearance().setTitleColor(0x9900CC);

You have nothing to update...  :-X

Link to comment
Share on other sites

  • 0

you set the colors, but you will not see them if you dont send some update packet to the client, that why the client still see the old colors, usualy its:

 

sendPacket(new ShortBuffStatusUpdate(0, 0, 0));

type

for example

 

but that function looks like it does send the packet inside it, check it, and if its ot doing it, the find what packet you need to send and send it

Link to comment
Share on other sites

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 SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt  
    • Server Rates: » Xp 500x. » Sp 500x. » Aden 500x. » Drop 1x. » PartyXp 2x. » PartySp 2x. » Starting character level -61. Enchant rates: » Safe enchant +4. » Blessed and simple scrolls max enchant (+16). » Crystal scrolls max enchant (+20). » Simple enchant scrolls chance – 65%. » Blessed enchant scrolls chance – 100%. » Crystal enchant scrolls chance – 50% Augmentations: » Mid life stone skill chance – 5%. » High life stone skill chance – 10%. » Top life stone skill chance – 20%. » Augments 1+1 Unique features: » Main town – Giran » Automatic-Manual Potions. » Working 2 castle sieges. (Giran-Aden) » SPS cancel lasts 10 seconds and than buffs come back. » Stackable scrolls, lifestones, book of giants. » Unique pvp zone » More then 11 active raid bosses. » Wedding system. » Unique farming areas. » Npc skill enchanter. » Full npc buffer with auto buff. » Max count of buffs – 55. » Max subclasses – 4. » Free and no quest class change. » Free and no quest sub class. » Raid boss drop nobless item. » No weight limit. » Unique protection anti-hwy armor for archers/daggers etc. » Ingame password change. » Top pvp/pk/online ranks NPC. » Unique monsters & NPC. » Interlude retail skills. » Server up-time [24/7] [99]%. » Perfect class balance (all class can kill all class depending on players skill and setup knowledge,gear,augmentations). » Announcements on double kills triple kills etc. » Announcements on Grand Boss death , with the name of the killer as well as clan name of the player. » Information Npc in game with all servers infromations. Custom server gear : 1). Titanium Armor Lv.1 2). Epic Armor Lv.2 3). Epic Weapons-Kamikaze-Black S grade (Same Stats) 4). Demonic-Angelic Wings-Baium Hair-Custom Accessories (SameStats) 5). Custom Fighter/Mage tattoo Lv1-Lv2-Lv3 6). Shirt (STR,CON,INT +1) 7). Custom Shields Server Commands: .tvtjoin .tvtleave – Join or leave tvt event. .ctfjoin .ctfleave – Join or leave ctf event. .dmjoin .dmleave – Join of leave dm event. .online – current online players count. .repair – repairs stuck character in world. .menu – opens online menu panel. .exit – PVP zone exit in case you are bullied. .changepassword - Opens online menu then u can change ur password in game. .farm - Enable/disable autofarm Event system: » TVT event » CTF event » DM event » Tournament Event » Party Zone » Unique event shop. Olympiad game: » Retail olympiad game. » Competition period [1] week. » Olympiad start time [18:00] end [00:00] GMT+2. » New Heroes every Sunday.
    • Tomorrow grand opening lests go 🙂 
    • New season of Warfire X150 has been postponed to September 28th.
  • Topics

×
×
  • Create New...