Jump to content

Recommended Posts

Posted

Πολυ καλο και για low,mid αλλα και για pvp rate servers.

Μπορει να γινει και με database connections , εγω το εκανα χωρις.

 

Ολοι οι clanleaders θελουν να βοηθησουν τα members τους να ντυθουν, αλλα δεν εχουν παντα τα items να τους δωσουν. Ε λοιπον με αυτο θα μπορουν να βοηθησουν τα members τους κανοντας pvp. Οταν ενας clanleader παρει 6 pvp στη σειρα , ολα τα members της clan παιρνουν reward.Ολα ομως, ειτε ειναι online , ειτε offline.Ετσι θα μπορουν να βοηθανε τα members τους κανοντας pvp. Οσοι ηταν offline , οταν μπενουν ενημερωνωνται για το reward επισης και το παιρνουν φυσικα.

 

Καντε στον φακελο data ενα αρχειο .txt με ονομα members και αφηστε το κενο.


### Eclipse Workspace Patch 1.0
#P Chr.6GMS
Index: java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(working copy)
@@ -46,6 +46,7 @@
import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.LeaderHelp;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.ClanHall;
import net.sf.l2j.gameserver.model.entity.Couple;
@@ -251,6 +252,13 @@

         SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);
         Announcements.getInstance().showAnnouncements(activeChar);
+        
+        if(LeaderHelp.isMember(activeChar))
+        {
+        	activeChar.getInventory().addItem("", 2807, 25, activeChar, null);
+        	activeChar.sendMessage("You rewarded with items for your clan's leader pvps rows");
+        	LeaderHelp.remove(activeChar.getName());
+        }

		Quest.playerEnter(activeChar);
		activeChar.sendPacket(new QuestList());
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -105,6 +105,7 @@
import net.sf.l2j.gameserver.model.L2SkillLearn;
import net.sf.l2j.gameserver.model.L2Summon;
import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.LeaderHelp;
import net.sf.l2j.gameserver.model.MacroList;
import net.sf.l2j.gameserver.model.PcFreight;
import net.sf.l2j.gameserver.model.PcInventory;
@@ -364,6 +365,8 @@

	private boolean _isIn7sDungeon = false;

+	private int _leaderSpree = 0;
+	
     private boolean _inJail = false;
     private long _jailTimer = 0;
     private ScheduledFuture<?> _jailTask;
@@ -1010,6 +1013,7 @@
		_newbie = isNewbie;
	}

+	

	public void setBaseClass(int baseClass)
	{
@@ -4176,6 +4180,9 @@
			{
				pk.kills.add(getName());
			}
+			
+			if(isClanLeader() && _leaderSpree > 0)
+				_leaderSpree = 0;

			// Clear resurrect xp calculation
			setExpBeforeDeath(0);
@@ -4448,6 +4455,37 @@
     {
         // Add karma to attacker and increase its PK counter
         setPvpKills(getPvpKills() + 1);
+        
+        if(isClanLeader()){
+        	_leaderSpree++;
+        	if(_leaderSpree == 6){
+        		sendMessage("You rewarded with 6 pvps in a row");
+        		getInventory().addItem("", 2807, 25, this, null);
+        		L2ClanMember[] m = null;
+				if(getClan().getMembersCount() < 2)
+        			sendMessage("You rewarded successfully but only you.");
+        		else{
+        			m = getClan().getMembers();
+				    for(L2ClanMember s : m){
+				    	if(s.isOnline()){
+				    		L2PcInstance j = s.getPlayerInstance();
+				    		j.sendMessage("Your clan leader rewarded with 6 pvps in a row so you rewarded and you");
+				    		j.getInventory().addItem("", 2807, 25, j, null);
+				    	}
+				    	else{
+				    		LeaderHelp.clanRewards.add(s.getName());
+				    	}
+				    }	
+				    if(LeaderHelp.clanRewards.isEmpty())
+				    {}
+				    else{
+				     LeaderHelp.addMembers();
+				    }
+        		
+        		_leaderSpree = 0;
+        			}
+        	}
+        }

         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
         sendPacket(new UserInfo(this));
Index: java/net/sf/l2j/gameserver/model/LeaderHelp.java
===================================================================
--- java/net/sf/l2j/gameserver/model/LeaderHelp.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/LeaderHelp.java	(revision 0)
@@ -0,0 +1,84 @@
+package net.sf.l2j.gameserver.model;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.LineNumberReader;
+import java.util.StringTokenizer;
+import java.util.logging.Level;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import javolution.util.FastList;
+
+public class LeaderHelp{
+	
+	public static FastList<String> clanRewards = new FastList<String>();
+	static File file = new File(Config.DATAPACK_ROOT, "data/members.txt");
+	
+	public static boolean isMember(L2PcInstance j){
+		if(clanRewards.contains(j.getName()))
+			return true;
+		return false;
+	}
+	
+	public static void addMembers(){
+		FileWriter save = null;
+		try
+		{
+			save = new FileWriter(file);
+			for (int i = 0; i < clanRewards.size(); i++)
+			{
+				save.write(clanRewards.get(i));
+				save.write("\r\n");
+			}
+			save.flush();
+			save.close();
+			save = null;
+		}
+		catch (IOException e)
+		{
+			e.printStackTrace();
+		}
+	}
+	
+	public static void remove(String n){
+		clanRewards.remove(n);
+		addMembers();
+	}
+	
+	public static void onStart(){
+		LineNumberReader l = null;
+		try
+		{
+			String line = null;
+			l = new LineNumberReader(new FileReader(file));
+			while ( (line = l.readLine()) != null)
+			{
+				StringTokenizer st = new StringTokenizer(line,"\n\r");
+				if (st.hasMoreTokens())
+				{
+					String t = st.nextToken();
+					clanRewards.add(t);
+				}
+			}
+
+		}
+		catch (IOException e1)
+		{
+			e1.printStackTrace();
+		}
+		finally
+		{
+			try
+			{
+				l.close();
+			}
+			catch (Exception e2)
+			{
+			}
+		}
+	}
+	
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/GameServer.java	(working copy)
@@ -221,6 +221,7 @@
import net.sf.l2j.gameserver.model.L2Manor;
import net.sf.l2j.gameserver.model.L2PetDataTable;
import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.LeaderHelp;
import net.sf.l2j.gameserver.model.entity.Hero;
import net.sf.l2j.gameserver.model.entity.TvTManager;
import net.sf.l2j.gameserver.network.L2GameClient;
@@ -604,6 +605,7 @@
			CoupleManager.getInstance();

         TaskManager.getInstance();
+        LeaderHelp.onStart();

		GmListTable.getInstance();

Posted

mpravo file polu kalo alla tha gunotan polu kalutero ean to ekanes san Event

Ti enow ? na to ekanes me Start kai End na to ksekunouses esei stis 5 to apogeuma kai na teleiwne stis 8 kwpes etsi i apo configs false true

pantos polu kalo tha to dokimasw

Posted

mpravo file polu kalo alla tha gunotan polu kalutero ean to ekanes san Event

Ti enow ? na to ekanes me Start kai End na to ksekunouses esei stis 5 to apogeuma kai na teleiwne stis 8 kwpes etsi i apo configs false true

pantos polu kalo tha to dokimasw

 

den xriazete na to kani auto kai etsi mia xara einai

Posted

Πρωτοτυπο και καλογραμμενος κωδικας. Καλη δουλεια.

Posted

Είναι κομπλε δεν λέω,αλλα δεν καταλαβαίνω γιατί δυσκολεύεις τη ζωή σου στους τελευταίους σου κώδικες..

Δεν υπάρχει λόγος για .txt όταν γίνεται ΠΟΛΥ πιο εύκολα με db connections,δεν λεω με τον τρόπο που το κάνεις εσύ είναι πιο advanced,αλλά κατα την γνώμη μου δεν υπάρχει λόγος να το κάνεις αυτό..

 

Posted

Είναι κομπλε δεν λέω,αλλα δεν καταλαβαίνω γιατί δυσκολεύεις τη ζωή σου στους τελευταίους σου κώδικες..

Δεν υπάρχει λόγος για .txt όταν γίνεται ΠΟΛΥ πιο εύκολα με db connections,δεν λεω με τον τρόπο που το κάνεις εσύ είναι πιο advanced,αλλά κατα την γνώμη μου δεν υπάρχει λόγος να το κάνεις αυτό..

πιστεψε με , το να δωσεις items σε clan members δεν ειναι τοσο απλο με database connections. πηγα να το κανω στην αρχη και ψηλο μπερδευτηκα αν θες προσπαθησε το και εσυ και θα καταλαβεις τι εννοω στη μεση του κωδικα περιπου..

 

και επισης πρεπει να μαθενω να κοιταω και τι ειναι πιο ελαφρυ για το συστημα , οχι τι ειναι πιο ευκολο.

Posted

Κανένα antibot protection δεν παίζει; μπορεί κάποιος να φτιάξει 150 char για να πάρει 150 φορές το reward.

Posted

Κανένα antibot protection δεν παίζει; μπορεί κάποιος να φτιάξει 150 char για να πάρει 150 φορές το reward.

εχει γινει share αυτο το θεωρουσα δεδομενο.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hi, great work! Are there any bugs? And will it work with a high five?
    • For others that would like to understand in more details:   The login server also uses a protocol (sent by the server to the client in the very first packet). For instance, the C4 client (the one I'm developing my emulator for) expects the protocol number `50721` (or `0xc621`) which works as follow (from what I've gathered): Preamble: L2 packets are divided into two parts: size and payload; As mentioned, every packet starts with two bytes containing the whole packet size (thus including those two bytes, e.g. a packet of size 15 will have the number `15` written onto its first two bytes and a following payload of 13 bytes); For login server, first byte of the payload is the opcode (game server must deal with variable-sized opcodes); Next bytes are the packet content; Before sending the packet, its buffer size (minus the initial two bytes) is padded to 8 bytes (required by upcoming Blowfish encoding); A checksum of the packet is appended at the end, then the payload is again padded to 8 bytes; If the opcode is not `0` (also written as `0x00`), then the payload is encoded by Blowfish; Packet is sent over the network. You can have a look at my implementation (in C++) here (do note I'm assuming little-endian).   In this protocol, the auth packet (`0x00`) sent back by the client is RSA encrypted using the RSA modulus sent in the first server packet, inserted right after the protocol number.  
    • Hello guys I wanna buy some  Lessons for an L2J Developer
    • Let me give you something for inspiration and get you addicted to bot AI     And a siege 😛     What I have notice helps a lot the LLM to act real, is to give it a real-persons background. So for each LLM in the context beggining, besides the L2 facts, give it a real-life back story "You are a 67 years old retired nurse who plays Lineage 2 while her husband reads his newspaper, you are calm, collected but get mad if insulted". But that makes for a creative bot but its repetitive. So what you can also do, is pick random 20 news sites and for each bot every 2-3 days, initialize a context that is affected by the "news" the bot reads in the "real world".  So for example there's Iran - US war ok ? You take the news, put it in an LLM and ask it, extract the "abstract feelings" that this news piece invokes into you without mentioning anything related to the news. Then you take the result and inject it to the bots LLM prompt after its backstory.  This leads to some VERY human-like behavior from bots. 
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..