Jump to content
  • 0

[How To]Clan Popping out message


iHeadshoT

Question

hey guys i was wondering how is it possible for a clan leader to write a message so it pops up when clan members log in!! this is mainly for freya-hi5 i think.. i would appreciate some help !!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

it's clan notice from community board.you have to compile communityserver(assuming you want this for l2jserver you can find it at their site,there is a guide there).obviously this feature will be under clan tab.

Link to comment
Share on other sites

  • 0

so you want something like...:(example)

a clan leader press .addclanmessage ALL SIEGE AT SATUDRDAY!!!!!!

and when clan members login, this message pops up?

And the clan leader will have the right to add new / clear the messages??

 

If yes, i will work on it in some hours.

Link to comment
Share on other sites

  • 0

hey guys i was wondering how is it possible for a clan leader to write a message so it pops up when clan members log in!! this is mainly for freya-hi5 i think.. i would appreciate some help !!

with client you use with project you use ?

 

also if you got epilogue + it works it is on your community board if you use interlude i advice you to search on l2jserver forums theres a patch there

Link to comment
Share on other sites

  • 0

for last revision l2jserver trunk

Clan message w/o community board

core

Index: java/com/l2jserver/gameserver/model/L2Clan.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Clan.java	(revision 4874)
+++ java/com/l2jserver/gameserver/model/L2Clan.java	(working copy)
@@ -51,6 +51,7 @@
import com.l2jserver.gameserver.network.serverpackets.ExSubPledgeSkillAdd;
import com.l2jserver.gameserver.network.serverpackets.ItemList;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.network.serverpackets.PledgeReceiveSubPledgeCreated;
import com.l2jserver.gameserver.network.serverpackets.PledgeShowInfoUpdate;
import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListAll;
@@ -174,6 +175,8 @@
	private boolean _noticeEnabled = false;
	private static final int MAX_NOTICE_LENGTH = 8192;

+	private String _clanMessage; // Non community board message
+	
	/**
	 * Called if a clan is referenced only by id.
	 * In this case all other data needs to be fetched from db
@@ -772,7 +775,7 @@
		try
		{
			con = L2DatabaseFactory.getInstance().getConnection();
-			statement = con.prepareStatement("UPDATE clan_data SET leader_id=?,ally_id=?,ally_name=?,reputation_score=?,ally_penalty_expiry_time=?,ally_penalty_type=?,char_penalty_expiry_time=?,dissolving_expiry_time=? WHERE clan_id=?");
+			statement = con.prepareStatement("UPDATE clan_data SET leader_id=?,ally_id=?,ally_name=?,reputation_score=?,ally_penalty_expiry_time=?,ally_penalty_type=?,char_penalty_expiry_time=?,dissolving_expiry_time=?, clan_message=? WHERE clan_id=?");
			statement.setInt(1, getLeaderId());
			statement.setInt(2, getAllyId());
			statement.setString(3, getAllyName());
@@ -781,7 +784,8 @@
			statement.setInt(6, getAllyPenaltyType());
			statement.setLong(7, getCharPenaltyExpiryTime());
			statement.setLong(8, getDissolvingExpiryTime());
-			statement.setInt(9, getClanId());
+			statement.setString(9, getClanMessage());
+			statement.setInt(10, getClanId());
			statement.execute();
			if (Config.DEBUG)
				_log.fine("New clan leader saved in db: " + getClanId());
@@ -900,7 +904,7 @@
			L2ClanMember member;

			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT clan_name,clan_level,hasCastle,ally_id,ally_name,leader_id,crest_id,crest_large_id,ally_crest_id,reputation_score,auction_bid_at,ally_penalty_expiry_time,ally_penalty_type,char_penalty_expiry_time,dissolving_expiry_time FROM clan_data where clan_id=?");
+			PreparedStatement statement = con.prepareStatement("SELECT clan_name,clan_level,hasCastle,ally_id,ally_name,leader_id,crest_id,crest_large_id,ally_crest_id,reputation_score,auction_bid_at,ally_penalty_expiry_time,ally_penalty_type,char_penalty_expiry_time,dissolving_expiry_time,clan_message FROM clan_data where clan_id=?");
			statement.setInt(1, getClanId());
			ResultSet clanData = statement.executeQuery();

@@ -930,6 +934,8 @@
				setReputationScore(clanData.getInt("reputation_score"), false);
				setAuctionBiddedAt(clanData.getInt("auction_bid_at"), false);

+				setMessage(clanData.getString("clan_message"));
+				
				int leaderId = (clanData.getInt("leader_id"));

				PreparedStatement statement2 = con.prepareStatement("SELECT char_name,level,classid,charId,title,power_grade,subpledge,apprentice,sponsor,sex,race FROM characters WHERE clanid=?");
@@ -2835,4 +2841,45 @@
			}
		}
	}
+	
+	public String getClanMessage()
+	{
+		return _clanMessage;
+	}
+	
+	public void setMessage(final String message)
+	{
+		_clanMessage = message;
+	}
+	
+	public void sendEditWindow(final L2PcInstance leader)
+	{
+		try
+		{
+			NpcHtmlMessage msg = new NpcHtmlMessage(5);
+			msg.setFile(null, "data/html/changeclanmsg.htm");
+			msg.replace("%defaultText%", getClanMessage() != null && !getClanMessage().isEmpty()?
+					getClanMessage() : "");
+			leader.sendPacket(msg);
+		} 
+		catch(NullPointerException npe)
+		{
+			_log.warning("L2Clan: Could not find the edit clan message html! : data/html/changeclanmsg.htm");
+		}
+	}
+	
+	public void sendClanMessage(final L2PcInstance member)
+	{
+		try
+		{
+			NpcHtmlMessage msg = new NpcHtmlMessage(5);
+			msg.setFile(null, "data/html/clanmessage.htm");
+			msg.replace("%message%", getClanMessage());
+			member.sendPacket(msg);
+		}
+		catch(NullPointerException npe)
+		{
+			_log.warning("L2Clan: Could not find the clan message html!: data/html/clanmessage.htm");
+		}
+	}
}
Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java	(revision 4874)
+++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -195,6 +195,10 @@
		{
			activeChar.sendPacket(new PledgeSkillList(activeChar.getClan()));

+			final String clanMessage = activeChar.getClan().getClanMessage();
+			if(clanMessage != null && !clanMessage.isEmpty())
+				activeChar.getClan().sendClanMessage(activeChar);
+			
			notifyClanMembers(activeChar);

			notifySponsorOrApprentice(activeChar);
Index: java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java
===================================================================
--- java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java	(revision 4874)
+++ java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java	(working copy)
@@ -27,6 +27,7 @@
import com.l2jserver.gameserver.handler.IAdminCommandHandler;
import com.l2jserver.gameserver.handler.IBypassHandler;
import com.l2jserver.gameserver.model.L2CharPosition;
+import com.l2jserver.gameserver.model.L2Clan;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.L2Npc;
@@ -241,6 +242,33 @@
					Hero.getInstance().showHeroDiary(player, heroclass, heroid, heropage);
				}
			}
+			else if(_command.startsWith("editClanNotice"))
+			{
+				if(!activeChar.isClanLeader())
+				{
+					activeChar.sendMessage("You must be a clan leader to change such text!");
+					return;
+				}
+				String msg = _command.substring(15);
+				if(msg.length() > 100)
+				{
+					activeChar.sendMessage("The text cannot be over 100 characters lenght");
+					activeChar.getClan().sendEditWindow(activeChar);
+					return;
+				}
+				final L2Clan clan = activeChar.getClan();
+				clan.setMessage(msg);
+				if(msg != null && !msg.isEmpty()) // Update notice for online members
+				{
+					for(L2PcInstance mem : clan.getOnlineMembers(0))
+					{
+						if(mem != null)
+							clan.sendClanMessage(mem);
+					}
+				}
+			}
			else
			{
				final IBypassHandler handler = BypassHandler.getInstance().getBypassHandler(_command);

DP

Index: data/html/changeclanmsg.htm
===================================================================
--- data/html/changeclanmsg.htm	(revision 0)
+++ data/html/changeclanmsg.htm	(revision 0)
@@ -0,0 +1,23 @@
+<html>
+<title>Clan Message Editor</title>
+<body>
+Here you will be able to edit your clan's MOTD. Enter the text in the <font color=LEVEL>above box</font> and press <font color=LEVEL>"Set Text"</font>
+<br>
+<center>
+Current Message
+<br>
+<font color="2E9AFE">
+%defaultText%
+</font>
+<br><br>
+<center>
+<font color="FF0000">NOTE: If you enter an empty text, no page will pop up for clan members.</font>
+<br>
+MAX: 100 characters
+<br>
+<MultiEdit var="textbox" width=240 height=100>
+<br>
+<a action="bypass -h editClanNotice $textbox">Set Text</a>
+</center>
+</body>
+</html>
\ No newline at end of file
Index: data/html/clanmessage.htm
===================================================================
--- data/html/clanmessage.htm	(revision 0)
+++ data/html/clanmessage.htm	(revision 0)
@@ -0,0 +1,8 @@
+<html>
+<title>Clan Message</title>
+<center>
+Here is the message of your clan:
+<br>
+%message%
+</body>
+</html>
\ No newline at end of file
Index: data/scripts/handlers/voicedcommandhandlers/ClanMessage.java
===================================================================
--- data/scripts/handlers/voicedcommandhandlers/ClanMessage.java	(revision 0)
+++ data/scripts/handlers/voicedcommandhandlers/ClanMessage.java	(revision 0)
@@ -0,0 +1,31 @@
+/**
+ * 
+ */
+package handlers.voicedcommandhandlers;
+
+import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ * @author BiggBoss
+ */
+public final class ClanMessage implements IVoicedCommandHandler
+{
+	private final String[] CMD = {"editClanMessage"};
+	
+	@Override
+	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
+	{
+		if(!activeChar.isClanLeader())
+			return false;
+		
+		activeChar.getClan().sendEditWindow(activeChar);
+		return true;
+	}
+
+	@Override
+	public String[] getVoicedCommandList()
+	{
+		return CMD;
+	}	
+}
Index: data/scripts/handlers/MasterHandler.java
===================================================================
--- data/scripts/handlers/MasterHandler.java	(revision 8319)
+++ data/scripts/handlers/MasterHandler.java	(working copy)
@@ -243,6 +243,7 @@
import handlers.usercommandhandlers.Time;
import handlers.voicedcommandhandlers.Banking;
import handlers.voicedcommandhandlers.ChatAdmin;
+import handlers.voicedcommandhandlers.ClanMessage;
import handlers.voicedcommandhandlers.Debug;
import handlers.voicedcommandhandlers.Lang;
import handlers.voicedcommandhandlers.TvTVoicedInfo;
@@ -552,6 +553,7 @@
			VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Lang());
		if (Config.L2JMOD_DEBUG_VOICE_COMMAND)
			VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Debug());
+		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new ClanMessage());
		_log.config("Loaded " + VoicedCommandHandler.getInstance().size() + " VoicedHandlers");
	}

Index: dist/sql/server/clan_data.sql
===================================================================
--- dist/sql/server/clan_data.sql	(revision 8319)
+++ dist/sql/server/clan_data.sql	(working copy)
@@ -15,6 +15,7 @@
   `ally_penalty_type` DECIMAL( 1 ) NOT NULL DEFAULT 0,
   `char_penalty_expiry_time` bigint(13) unsigned NOT NULL DEFAULT '0',
   `dissolving_expiry_time` bigint(13) unsigned NOT NULL DEFAULT '0',
+  `clan_message` varchar(100), -- 100 = text lenght
   PRIMARY KEY (`clan_id`),
   KEY `leader_id` (`leader_id`),
   KEY `ally_id` (`ally_id`)

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

    • It's funny how you're judging me for decrypting work. The real problem isn't in decrypting, but in people selling my work without permission, which undermines everything I've done.   You call my methods "ugly," but you don't seem to care about the harm caused by those who misuse my work. It's pretty hypocritical to criticize my actions while ignoring the unethical behavior that forced me to protect my work this way.   If you think decrypting ruins it, maybe you should think about the real issue. people who don't respect the creator's rights. Until you understand that, your judgments don't mean much.   Also, I want to make it clear that I don't decrypt work from respected developers like Corason, NevesOma, Darkdelux, and the Emudevs team because I respect their efforts. However, some people who act like rats deserve it.   And honestly, considering how everyone seems to dislike you on all the forums, it looks like you have a habit of provoking people. That says a lot about your approach. 🫠🫠🫠
    • OUR OFFICIAL WEBSITE / FORUM - MILLENNIUM-HOOK.NET CHEAT DESCRIPTION: Our cheat for Valorant is the best and safest solution for this game. The cheat supports all the most necessary functions such as aimbot. We also support esp, since our esp (visual) is not displayed in screenshots or videos, for example when streaming. Therefore, we cannot be detected by the Riot Vanguard anti-cheat. We offer you the best value for money cheats on the market for this game. SUPPORTED ANTI-CHEATS: (read more on official website) - Riot Vanguard AC: Undetected & Safe Our Valorant cheat has a limited number of slots to ensure greater product security! (Available slots check on official website) FEATURES: AIMBOT: - Bone (Head, Neck, Body, Arms, Stomach) - Customizable Smooth - Customizable Fov Size / Fov Circle - Anti Shake Aim - Aimkey - Auto Shot - RCS ESP: - ESP Players - Player Corpse - Player Box - Filled Box - Line ESP - Player Skeleton - Player Health - Distance ESP MISC: - Online config - No Recoil - Radar (A Separate Radar that shows locations of the enemies) REQUIREMENTS: - Included HWID Spoofer: Yes - Stream Bypass: Yes - Supported game modes: Windowed, Borderless - Supported CPU: Intel & AMD - Supported OS: Windows 10 (1903,1909,2004,20H2,21H1, 22H2), Windows 11 (All version). Supported OS change and are added periodically. More check on official website. SCREENSHOTS: - Check on official website.
    • Welcome to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 60.99 $ 2016 Discord Account : 10.50 $ 2017 Discord Account :4.99 $ 2018 Discord Account : 3.99 $ 2019 Discord Account : 2.99 $ 2020 Discord Account :1.99$ 2021 Discord Account :1.50$ 2022 Discord Account :0.99$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 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/ultrastore11
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hoodservices https://campsite.bio/utchihaamkt
    • WTS valakas-antharas-zaken-baium-qa on x1 l2 reborn. A better price will be made if u choose to purchace all of it. Middleman @PUFA   NOTE: dont even bother to pm me if u only want 1 epic.the minimum trade will be anth+valakas+baium or anth+valakas.or 1 dragon+baium.      
  • Topics

×
×
  • Create New...