Jump to content

[Freya] Ctf Fully Configurable!


FFs

Recommended Posts

Capture the Flag - Freya - Last Rev

 

Freatures:

 

- Possibility to turn if ON/OFF into l2jmods.properties

- Time interval configurable into l2jmods.properties

- Red and blue glow for teams like during a party duel

- Commands

- Admin Commands

 

This code is based on the one here: http://www.l2jserver.com/forum/viewtopic.php?f=73&t=11576

 

Credits:

 

Nerimah - L2JServer

 

Download:

 

http://www.mediafire.com/?u5i7hswl57ffsla

 

Tested:

 

23/06/11 - Tested and Working!

 

Installation:

 

Read: "how_to_install.txt" into the .rar file.

 

Enjoy it!

 


 

Fix for old revisions - 25/06/11:

That code will fix errors on PcStat.java and L2PcInstance.java and add some lines at SystemMessageId.java

 

 

### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/model/actor/stat/PcStat.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/stat/PcStat.java	(revision 4668)
+++ java/com/l2jserver/gameserver/model/actor/stat/PcStat.java	(working copy)
@@ -21,6 +21,7 @@
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
import com.l2jserver.gameserver.model.base.Experience;
+import com.l2jserver.gameserver.model.entity.CTF;
import com.l2jserver.gameserver.model.entity.RecoBonus;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.SystemMessageId;
@@ -235,6 +236,13 @@
			getActiveChar().sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_INCREASED_YOUR_LEVEL));

			L2ClassMasterInstance.showQuestionMark(getActiveChar());
+			
+			if (getActiveChar().isInFunEvent())
+			{
+				if (getActiveChar()._inEventCTF && CTF._maxlvl == getLevel() && !CTF._started)
+					CTF.removePlayer(getActiveChar());
+				getActiveChar().sendMessage("Your event sign up was canceled.");
+			}
		}

		getActiveChar().rewardSkills(); // Give Expertise skill of this level

### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/network/SystemMessageId.java
===================================================================
--- java/com/l2jserver/gameserver/network/SystemMessageId.java	(revision 4668)
+++ java/com/l2jserver/gameserver/network/SystemMessageId.java	(working copy)
@@ -14693,6 +14693,12 @@
	public static final SystemMessageId THOMAS_D_TURKEY_DISAPPEARED;

	/**
+	 * ID: 6506<br>
+	 * Message: You cannot mount a Steed while holding a flag!
+	 */	
+	public static SystemMessageId YOU_CANNOT_MOUNT_A_STEED_WHILE_HOLDING_A_FLAG = null;
+	
+	/**
	 * Array containing all SystemMessageIds<br>
	 * Important: Always initialize with a length of the highest SystemMessageId + 1!!!
	 */
@@ -17116,6 +17122,7 @@
		THOMAS_D_TURKEY_APPEARED = new SystemMessageId(6503);
		THOMAS_D_TURKEY_DEFETED = new SystemMessageId(6504);
		THOMAS_D_TURKEY_DISAPPEARED = new SystemMessageId(6505);
+		YOU_CANNOT_MOUNT_A_STEED_WHILE_HOLDING_A_FLAG = new SystemMessageId(6506);

		buildFastLookupTable();
	}
### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 4668)
+++ java/config/l2jmods.properties	(working copy)
@@ -221,6 +242,62 @@

# ---------------------------------------------------------------------------
+# Setting for Capture The Flag
+# ---------------------------------------------------------------------------
+#This parameter is to turn on/off the auto CTF at server start .
+#If True, it writes into gameserver console: CTFEventEngine: Started.
+#If Flase, it writes into gameserver console: CTFEventEngine: Engine is disabled.
+
+CTFEventEnabled = True  
+
+#This is where you will chose the time where the CTF Event will take place automatically
+# Times CTF will occur (24h format)
+CTFEventInterval = 7:00,11:00,15:00,19:00,23:00,3:00
+
+# CTFEvenTeams = NO|BALANCE|SHUFFLE
+# NO means: not even teams.
+# BALANCE means: Players can only join team with lowest player count.
+# SHUFFLE means: Players can only participate to the event and not direct to a team. Teams will be shuffled on teams teleport.
+CTFEvenTeams = SHUFFLE
+
+# Allow voiced command on CTF Event?
+CTFAllowVoiceCommand = False
+
+# Players that are not participating in CTF can target ctf participants?
+CTFAllowInterference = False
+
+# CTF participants can use potions?
+CTFAllowPotions = False
+
+# CTF participants can summon by item?
+CTFAllowSummon = False
+
+# Remove all effects of CTF participants on event start?
+CTFOnStartRemoveAllEffects = True
+
+# Unsummon pet of CTF participants on event start?
+CTFOnStartUnsummonPet = True
+
+# On revive participants regain full HP/MP/CP?
+CTFReviveRecovery = False
+
+# Announce all team statistics
+CTFAnnounceTeamStats = False
+
+# Announce reward
+CTFAnnounceReward = False
+
+# Players with cursed weapon are allowed to join?
+CTFJoinWithCursedWeapon = True
+
+# Delay on revive when dead, NOTE: 20000 equals to 20 seconds, minimum 1000 (1 second)
+CTFReviveDelay = 20000
+
+# Would you like to have a base for the players to have first, then teleport into battle?
+# If True, You must set-up in CTF admin panel
+CTFTeleportToBaseFirst = True
+
+# ---------------------------------------------------------------------------
# L2J Banking System
# ---------------------------------------------------------------------------
# Enable/Disable Banking System

 

Fix by:

- FFs

 


 

New Update (28/06/11):

 

- Team color glow fixed

- CTF intervals fixed

 

Download:

 

http://www.mediafire.com/?okvxhauyctanbjd

Link to comment
Share on other sites

i don't think so i added patch in last rev and it giving me error in some lines

u wanna screen, huh ?

 

If to him works, that mean u're newbie and u're not able to add a shit like this.

Link to comment
Share on other sites

@BlackDevilDev - Thanx :)

@ss42ss - Tell me how its works for u :)

@serverl2 - Np, if you are happy, i'm happy

@marwan - I need a screen to belive it

@Legend™ - Tell me in what file gives you an error

Link to comment
Share on other sites

Gonna test and provide feedback if it works and maybe possible errors..... (Im sure that there are no problems about compiling...) ....

 

Thanks FFs for your share!

 

Np pipiou21, test it and tell us :), but what i said.... you will have no problems with the event, i tested 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
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

    • Will it work for GOD H5 Client Protocol 140??
    • 6.2K followers growth from 500K DMs campaign for Onlyfan niche 🚀 ⭐️ Instant Instagram followers growth & gain subscribers ⭐️ GO VIRAL easier with reels on IG ⭐️ Scraping & Sending in less than 24 hours For consulting contact us on telegram @igmassdm ✅
    • ANOTHER LOGO DESIGN FOR ANOTHER EPIC PROJECT 😎 Thank You for using my support 🙏    
    • In this guide we will cover how to understand and implement the packages belonging to the Lineage 2 UI. More specifically the Essence version UI. Required UTPT (Unreal Tournament Package Tool) : https://github.com/l2jsourcecode/ut-package-tool File : InterfaceClassic.U   The packages are embedded into the interface, specifically located in the InterfaceClassic.u file. Some key classes include: UIPacket.uc (defines package structure) UIProtocol.uc (defines package opcode)   The packages are split into two main types: Client to Server (prefix: C) Server to Client (prefix: S) For example, in the UIProtocol class:   const C_EX_COSTUME_LOCK = 573; // packet from client to server const S_EX_COSTUME_LOCK = 785; // packet from server to client   We’ll use this package as a case study to delve deeper. Understanding Client to Server Packets Let's examine a packet from the client with an opcode of 573. On the server side, opcodes are converted into hexadecimal values using a formula: opcode - C_MAX   where C_MAX is an opcode defined in UIProtocol. Recently, C_MAX has been set to 209. For instance: 573 - 209 = 364 364 -> hex = 16C This hexadecimal value (16C) corresponds to the opcode for the Java class. Understanding Server to Client Packets For server packets, we also use hexadecimal conversion but with a different opcode: S_MAX = 255 S_MAX is applied to packages with an opcode above 255. For values below this, simply convert the number to hex. For example: const S_EX_COSTUME_LOCK = 785; 785 - 255 = 530 530 -> hex = 212 = 0xFE:0x212 Here, 0xFE represents S_MAX. Packet Structure Finally, let’s look at the packet structure. Open UIPacket.uc and locate the C_EX_COSTUME_LOCK to examine its structure in detail.   struct _C_EX_COSTUME_LOCK { var int nCostumeId; var int nLockState; };   We observe two integer variables, representing the structure of the package transmitted to the server. By continuing our search within this file, we find the following code:   static function bool Encode_C_EX_COSTUME_LOCK(out array<byte> stream, _C_EX_COSTUME_LOCK packet) { if(!EncodeInt(stream, packet.nCostumeId)) { return false; } if(!EncodeChar(stream, packet.nLockState)) { return false; } return true; }   This function encodes the packet structure for transmission. As discussed earlier, the data types within the packet are crucial. Specifically:   EncodeInt corresponds to an integer. EncodeChar is treated as a short in Java, typically read using readC, while readD is used for EncodeInt. Having examined the client-to-server packet structure, let's now explore the structure expected by the client from the server. The process is similar. We locate _S_EX_COSTUME_LOCK within UIPacket:     struct _S_EX_COSTUME_LOCK { var byte bResult; var int nCostumeId; var int nLockState; };   Data Decryption The corresponding decryption function is:   static function bool Decode_S_EX_COSTUME_LOCK(out _S_EX_COSTUME_LOCK packet) { if(!DecodeBool(packet.bResult)) { return false; } if(!DecodeInt(packet.nCostumeId)) { return false; } if(!DecodeChar(packet.nLockState)) { return false; } return true; }   Here, the variables are decoded as follows:   bResult is decoded as a Bool. nCostumeId is decoded as an Int. nLockState is decoded as a Char.   This consistent approach to encoding and decoding ensures reliable data transmission between the client and server. Example usage :  https://imgur.com/a/zVZHVzq Credits : L2j West Coast Custom ( https://discord.gg/n2c8meMN )
  • Topics

×
×
  • Create New...