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 αυτο το θεωρουσα δεδομενο.

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

    • https://prnt.sc/Bkkc0ShGXv9m https://prnt.sc/-JFLvZXsn27A
    • Hello guys want to sell adena in L2 Reborn Signature x1  Stock =14kk good price 
    • Hi guys, I have the following problem, I want to set up two servers on the same dedicated server and I can't.   L2jacis 409 Linux Server. The first gameserver has the following configuration: # ================================================================ # Gameserver setting # ================================================================ # This is transmitted to the clients, so it has to be an IP or resolvable hostname. If this ip is resolvable by Login just leave * Hostname = 190.25.103.103 # Bind ip of the gameserver, use * to bind on all available IPs. GameserverHostname = * GameserverPort = 7777 # The Loginserver host and port. LoginHost = 127.0.0.1 LoginPort = 9014 # This is the server id that the gameserver will request. RequestServerID = 1 # If set to true, the login will give an other id to the server (if the requested id is already reserved). AcceptAlternateID = True UseBlowfishCipher = True # ================================================================ # Database informations # ================================================================ URL = jdbc:mariadb://localhost/server1 Login = server1 Password = server1 I configured the second gameserver like this:   # ================================================================ # Gameserver setting # ================================================================ # This is transmitted to the clients, so it has to be an IP or resolvable hostname. If this ip is resolvable by Login just leave * Hostname = 0.0.0.0 # Bind ip of the gameserver, use * to bind on all available IPs. GameserverHostname = * GameserverPort = 7788 # The Loginserver host and port. LoginHost = 127.0.0.1 LoginPort = 9014 # This is the server id that the gameserver will request. RequestServerID = 2 # If set to true, the login will give an other id to the server (if the requested id is already reserved). AcceptAlternateID = True UseBlowfishCipher = True # ================================================================ # Database informations # ================================================================ URL = jdbc:mariadb://localhost/server2 Login = server2 Password = server2 apart from having tested 0.0.0.0 on the second gameserver I also tried 127.0.0.1 In both cases I see the two servers in the login when I log in, but I try to enter the one with the lowest ping and it kicks me out. The other server always appears with ping 9999 and I try to enter but it doesn't do anything and it freezes the login so I have to log in again. The hexids are in their respective folders. For server 1, it has its hexid inside the gameserver config folder, and I checked that the hexid id is the same id, for example id 1 in the gameserver is also id1 for server 1, and hexid 2 has its hexid 2 for server 2. The server ports are open and listening when I turn on both gameservers. I really don't know what could be wrong. If you could give me some help I would appreciate it. Excuse my English.
    • We have both old channels from 2006-2009 with the 3rd verification function enabled, and new ones.   For availability, please contact us below: Link - Telegram Link - Facebook WhatsApp - Click here to go to WhatsApp chat
    • You can contact me on skype: niedziolek50
  • Topics

×
×
  • Create New...