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

    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
    • small update: dc robe set sold   wts adena 1kk = 1.5$ 
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt
    • Why adena in this sever so expensive 🙂
  • Topics

×
×
  • Create New...