Jump to content
  • 0

This Code For L2Jfrozen


SQL Developer

Question

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2ClanManagerInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2ClanManagerInstance.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2ClanManagerInstance.java	(working copy)
@@ -0,0 +1,116 @@
/*
 * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.model.actor.instance;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.network.serverpackets.MyTargetSelected;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
import net.sf.l2j.gameserver.network.serverpackets.ValidateLocation;
import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
import net.sf.l2j.util.Rnd;

/**
 * @author Debian
 *
 */
public class L2ClanManagerInstance extends L2NpcInstance
{
	public L2ClanManagerInstance(int objectId, L2NpcTemplate template)
	{
		super(objectId, template);
	}
	
	@Override
	public void onBypassFeedback(L2PcInstance player, String command)
	{
		if (command.startsWith("levelup"))
		{
			if(player.getClan() != null)
			{
				if (!player.isClanLeader())
				{
					player.sendMessage("Only clan leaders, can use this service.");
				}
				if (player.isClanLeader() && player.getClan().getReputationScore() > 50000)
				{
					player.getClan().takeReputationScore(50000);
					player.getClan().changeLevel(8);
					player.sendMessage("Your clan successfully changed to level 8.");
				}
				else
				{
					player.sendMessage("Your clan must have 50000 clan reputation points in order to buy level 8.");
				}
			}
			else
			{
				player.sendMessage("You don't have a clan.");
			}
		}
	}
	
    @Override
    public void onAction(L2PcInstance player)
    {
		if (this != player.getTarget()) {
			player.setTarget(this);
			player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()));
			player.sendPacket(new ValidateLocation(this));
		}
		else if (isInsideRadius(player, INTERACTION_DISTANCE, false, false)) {
			SocialAction sa = new SocialAction(this, Rnd.get(8));
			broadcastPacket(sa);
			player.setCurrentFolkNPC(this);
			showMessageWindow(player);
			player.sendPacket(ActionFailed.STATIC_PACKET);
		}
		else {
			player.getAI().setIntention(CtrlIntention.INTERACT, this);
			player.sendPacket(ActionFailed.STATIC_PACKET);
		}
    }
    
    private void showMessageWindow(L2PcInstance player)
    {
        NpcHtmlMessage debian = new NpcHtmlMessage(5);
        StringBuilder tb = new StringBuilder("");
            
        tb.append("<html><head><title>Clan Manager</title></head><body>");
        tb.append("<center>");
        tb.append("<img src=\"L2Font-e.replay_logo-e\" width=256 height=80>");
        tb.append("<br>");
        tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>"); 
        tb.append("<br>");
        tb.append("<font color=\"FFAA00\">Clan Manager</font>");
        tb.append("<br>");
        tb.append("</center>");
        tb.append("<center>");
        tb.append("<a action=\"bypass -h npc_" + getObjectId() + "_levelup\">Get your clan at level 8.</a><br>");
        tb.append("<font color=\"FFAA00\">It costs 50.000 clan reputation points.</font>");
        tb.append("<br>");
        tb.append("</center>");
        tb.append("<center>");
        tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");
        tb.append("<br>");
        tb.append("<font color=\"FFAA00\">" + Config.SERVER_NAME + "</font>");  
        tb.append("</center>");
        tb.append("</body></html>");
            
        debian.setHtml(tb.toString());
        player.sendPacket(debian);
    }	
}

As titlle say anyone have this code for frozen?

Link to comment
Share on other sites

Recommended Posts

  • 0

player.getClan().setReputationScore(50000, true); remove that line xD

 

player.getClan().takeReputationScore(50000); it was my mistake replace the line with lololol 

 

 

 

Haters, i made a mistake rofl

To be honest, with "setReputationScore(50000, true);"  is working...

With the second, need some changes from another part...

Anyway...

 

I gave on LostWard a idea... To create a "Donate" item for all this in donate list.. Without to make the "day" more difficult..

I create for him, an code. I hope to is what is searching.

 

For the "haters"... If you talking about me... Sorry if i gave you something like this to eat your mind... In my replay, I don't talking about if you have mistake or not...

Just for the "buy" logic...  I don't care what SweeTs said... My position is not with attack or something like this...

I like to help if i know, but have to be with the "correct" way...

Link to comment
Share on other sites

  • 0

To be honest, with "setReputationScore(50000, true);"  is working...

Ofc it is working, lol..

 

It was checking if you have MORE than 5k clan rep, if you do, then your clan rep was CHANGED to 5k. So, if you had like 10/20/30k clan rep, it was changed to 5..

Edited by SweeTs
Link to comment
Share on other sites

  • 0

Ofc it is working, lol..

 

It was checking if you have MORE than 5k clan rep, if you do, then your clan rep was CHANGED to 5k. So, if you had like 10/20/30k clan rep, it was changed to 5..

yes... that is. Because of this, i said for the "buy" logic..

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Thank you for your reply. I have removed it from the L2Server.exe file, but the L2Server still crashes. It doesn't crash if I don't start l2npc, otherwise it will crash within a few days at the latest.
    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore1 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11
    • L2 ArenaWar: Low Rate PvP Server with Free Buffs & Autofarm [PVP]⚔️ [Free]🆓 Classic Interlude with  3x XP rates! Free starter pack(no grade) to kickstart your adventure! Autofarm for convenient grinding! Free buffs to keep you fighting fit! (2 job buffs) No experience loss on death! (Except with Karma) Clear Karma system to keep things fair! ⚖️ Active community of 800-1k players! Join our Discord to learn more! >> Discord <<     Server website: https://l2arenawar.com/en/    
    • This is dedication! 2 years working on a problem. Congratulations!
    • You indeed have to save player position over Enterworld to properly clean it up later (if you don't, even trying to delete packet content would eventually keep it up), that's what we do with debug packet (which is a reusable Map of ExServerPrimitive packets) on aCis.   It doesn't solve the FPS stuttering - more you draw/delete lines, more your client becomes laggy. It's like if client wasn't deleting drawn points/lines properly, but instead simply hide them and redrawn content above.   If you got a solution, I would happy to integrate it.   You should check aCis#Player _debug packet integration, it allows very big amount of lines/points to be drawn, it is also reusable.   https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java?ref_type=heads https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java?ref_type=heads  
  • Topics

×
×
  • Create New...