Jump to content

Recommended Posts

Posted

Γεια σας μέλη του maxcheaters.

Λοιπων εδώ είναι ένας κώδικας για "Vote Reward" ο οποίος δούλευε σε "Interlude". Tου έχω κάνει μερικές αλλαγές και εχω προσθεσει καποια πράγματα ώστε να λειτουργεί σε "Freya"!!

 

Τα αρχικά credits πηγαίνουν στον "extr3me". Ειναι το πρώτο μου topic που έχει σχέση με CODE.!

 

Εδώ είμαστε λοιπών:

Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties
+++ java/config/l2jmods.properties

# will be 1+2=3. Use 0 or negative value for unlimited number of connections.
# Default: 127.0.0.1,0 (no limits from localhost)
DualboxCheckWhitelist = 127.0.0.1,0
+
+#============================================
+#       Vote Reward System by GoldenBoy     =
+#============================================
+#Set it "True" if you want to Enable Vote Reward System.
+EnableVoteReward = False
+#If you enable Vote Reward System you must fill your Html Patch.
+#e.g. VoteHtmlPatch = http://l2.hopzone.net/lineage2/moreinfo/yourserver/65487.htm
+# Html Patch for Your Vote Site
+# Works with HopZone/HopZones/TopZone and other HopZone Like
+ServerNameForVotes = L2ServerName
+VoteHtmlPatch = 
+VoteReward1Count = 1000
+VoteReward2Count = 1000
+VoteReward1Id = 57
+VoteReward2Id = 57
+VotesForReward = 5
+#Max amount of reward items that you want to stop reward 
+#the player that have more than "MaxRewardCountForStack".
+MaxRewardCountForStackItem1 = 2000000000
+MaxRewardCountForStackItem2 = 2000000000
+#DelayForNextReward in seconds
+DelayForNextReward = 600

 

Index: java/com/l2jserver/gameserver/model/AutoVoteRewardHandler.java
===================================================================
--- java/com/l2jserver/gameserver/model/AutoVoteRewardHandler.java
+++ java/com/l2jserver/gameserver/model/AutoVoteRewardHandler.java
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+ 
+package com.l2jserver.gameserver.model;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.Announcements;
+import com.l2jserver.gameserver.GmListTable;
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.model.L2ItemInstance;
+import com.l2jserver.gameserver.model.L2World;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ *
+ * @author GoldenBoy
+ *
+ */
+
+
+public class AutoVoteRewardHandler
+{
+	private int	lastVoteCount = 0;
+	private int	initialCheck = 60 * 1000;														
+	private int	delayForCheck = Config.DELAY_FOR_NEXT_REWARD * 1000;	
+	
+	private AutoVoteRewardHandler()
+
+	{
+		if (Config.VOTE_REWARD_ENABLE)
+		{		
+		System.out.println("========= "+Config.SERVER_NAME_FOR_VOTES+" =========");
+		System.out.println("Vote Reward System activated");
+		System.out.println("========= "+Config.SERVER_NAME_FOR_VOTES+" =========");
+		ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck, delayForCheck);
+		}
+	}
+	
+
+	private class AutoReward implements Runnable
+	{
+		public void run()		
+		{
+			if (Config.VOTE_REWARD_ENABLE)
+			{
+			System.out.println("");
+			System.out.println("==================");
+			System.out.println("Vote Count Check.");
+			if (Config.VOTE_REWARD1_ID == 0 || Config.VOTE_REWARD1_COUNT == 0 || Config.VOTE_REWARD2_ID == 0 || Config.VOTE_REWARD2_COUNT == 0)
+			{
+				GmListTable.broadcastMessageToGMs("The rewards aren't Identified. Please take a look.");
+				return;
+			}
+			int newVoteCount = getVotes(Config.VOTE_HTML_PATCH);
+			System.out.println("getLastVoteCount:"+getLastVoteCount());
+			System.out.println("newVoteCount:"+newVoteCount);
+			System.out.println("==================");
+			System.out.println("");
+			if (newVoteCount != 0 && getLastVoteCount() != 0 && newVoteCount >= getLastVoteCount() + Config.VOTES_FOR_REWARD)
+			{
+				for (L2PcInstance player : L2World.getInstance().getAllPlayers().values())
+				{
+					if (player != null)
+					{
+							L2ItemInstance item1 = player.getInventory().getItemByItemId(Config.VOTE_REWARD1_ID);
+							if (item1 == null || item1.getCount() < Config.MAX_REWARD_COUNT_FOR_STACK_ITEM1)
+							{
+								if (player.getAppearance().getNameColor() != Config.OFFLINE_NAME_COLOR)
+								{
+									player.addItem("reward", Config.VOTE_REWARD1_ID, Config.VOTE_REWARD1_COUNT, player, true);
+								}
+							}
+							else
+							{
+								player.sendMessage("[" + Config.SERVER_NAME_FOR_VOTES+"]" + "You have reached our limit for vote reward items!!");
+							}
+							L2ItemInstance item2 = player.getInventory().getItemByItemId(Config.VOTE_REWARD2_ID);
+							if (item2 == null || item2.getCount() < Config.MAX_REWARD_COUNT_FOR_STACK_ITEM2)
+							{
+								if (player.getAppearance().getNameColor() != Config.OFFLINE_NAME_COLOR)
+								{
+									player.addItem("reward", Config.VOTE_REWARD2_ID, Config.VOTE_REWARD2_COUNT, player, true);
+								}
+							}
+							else
+							{
+								player.sendMessage("[" + Config.SERVER_NAME_FOR_VOTES+"]" + "You have reached our limit for vote reward items!!");
+							}
+					}
+				}	
+				setLastVoteCount(newVoteCount);
+			}
+			Announcements.getInstance().announceToAll("[" + Config.SERVER_NAME_FOR_VOTES+"]" + "Our Current vote count is: " + newVoteCount);
+			Announcements.getInstance().announceToAll("[" + Config.SERVER_NAME_FOR_VOTES+"]" + "The next reward will be given at " + (getLastVoteCount()+ Config.VOTES_FOR_REWARD) + " Votes.");
+			if (getLastVoteCount() == 0)
+			{
+				setLastVoteCount(newVoteCount);
+			}
+			}
+		}
+	}
+
+	private int getVotes(String urlString)
+	{
+		InputStreamReader isr = null;
+		BufferedReader in = null;
+		try
+		{
+			URL url = new URL(urlString);
+                      isr = new InputStreamReader(url.openStream());
+			in = new BufferedReader(isr);
+			String inputLine;
+			int voteCount = 0;
+			while ((inputLine = in.readLine()) != null)
+			{
+				if (inputLine.contains("moreinfo_total_rank_text"))
+				{
+					int Sub = 12;
+					switch (inputLine.length())
+					{
+						case 116:
+							Sub = 13; 
+							break;
+						case 117:
+							Sub = 14; 
+							break;
+						case 118:
+							Sub = 15;
+							break;
+						case 119:
+							Sub = 16; 
+							break;
+					}
+					voteCount = Integer.parseInt(inputLine.substring(inputLine.length() - Sub, inputLine.length() - 11));
+					break;
+				}
+			}
+			return voteCount;
+		}
+		catch (IOException e)
+		{
+			e.printStackTrace();
+			return 0;
+		}
+		finally
+		{
+			try
+			{
+				in.close();
+			}
+			catch (IOException e)
+			{
+				
+			}
+			try
+			{
+				isr.close();
+			}
+			catch (IOException e)
+			{
+				
+			}
+		}
+	}
+	
+	/**
+	 * @return
+	 */
+
+	private void setLastVoteCount(int voteCount)
+	{
+		lastVoteCount = voteCount;
+	}
+	
+	private int getLastVoteCount()
+	{
+		return lastVoteCount;
+	}
+	
+	public static AutoVoteRewardHandler getInstance()
+	{
+		return SingletonHolder._instance;
+	}
+	
+	@SuppressWarnings("synthetic-access")
+	private static class SingletonHolder
+	{
+		protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler();
+	}
+}

 

Index: java/com/l2jserver/gameserver/GameServer.java
===================================================================
--- java/com/l2jserver/gameserver/GameServer.java
+++ java/net/l2jserver/gameserver/GameServer.java

import com.l2jserver.gameserver.handler.SkillHandler;
import com.l2jserver.gameserver.handler.UserCommandHandler;
import com.l2jserver.gameserver.handler.VoicedCommandHandler;
+import com.l2jserver.gameserver.model.AutoVoteRewardHandler;
import com.l2jserver.gameserver.idfactory.IdFactory;
import com.l2jserver.gameserver.instancemanager.AirShipManager;
import com.l2jserver.gameserver.instancemanager.AntiFeedManager;

	SkillHandler.getInstance();
	UserCommandHandler.getInstance();
	VoicedCommandHandler.getInstance();
+	 	AutoVoteRewardHandler.getInstance();

	if (Config.L2JMOD_ALLOW_WEDDING)
		CoupleManager.getInstance();

 

Index: java/com/l2jserver/Config.java
===================================================================
--- java/com/l2jserver/Config.java
+++ java/com/l2jserver/Config.java

public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP;
public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST;
     
+    //Vote Reward
+    public static String 		VOTE_HTML_PATCH;
+    public static int 			VOTE_REWARD1_ID;
+    public static int 			VOTE_REWARD2_ID;
+    public static int 			VOTE_REWARD1_COUNT;
+    public static int 			VOTE_REWARD2_COUNT;
+    public static int 			VOTES_FOR_REWARD;
+    public static boolean 		VOTE_REWARD_ENABLE;
+    public static String 		SERVER_NAME_FOR_VOTES;
+    public static int 			MAX_REWARD_COUNT_FOR_STACK_ITEM1;
+    public static int 			MAX_REWARD_COUNT_FOR_STACK_ITEM2;
+    public static int 			DELAY_FOR_NEXT_REWARD;
+	

//--------------------------------------------------
// NPC Settings
//--------------------------------------------------
=================================================================================================================================================================
							_log.warning(StringUtil.concat("DualboxCheck[Config.load()]: invalid number -> DualboxCheckWhitelist \"", entrySplit[1], "\""));
						}
					}
				}
+					VOTE_HTML_PATCH = L2JModSettings.getProperty("VoteHtmlPatch", "Null");
+					VOTE_REWARD1_COUNT = Integer.parseInt(L2JModSettings.getProperty("VoteReward1Count", "1000"));
+					VOTE_REWARD2_COUNT = Integer.parseInt(L2JModSettings.getProperty("VoteReward2Count", "1000"));
+					VOTE_REWARD1_ID = Integer.parseInt(L2JModSettings.getProperty("VoteReward1Id", "57"));
+					VOTE_REWARD2_ID = Integer.parseInt(L2JModSettings.getProperty("VoteReward2Id", "57"));
+					VOTES_FOR_REWARD = Integer.parseInt(L2JModSettings.getProperty("VotesForReward", "5"));
+					VOTE_REWARD_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("EnableVoteReward", "False"));
+					SERVER_NAME_FOR_VOTES                     = L2JModSettings.getProperty("ServerNameForVotes", "L2ServerName");
+					MAX_REWARD_COUNT_FOR_STACK_ITEM1 = Integer.parseInt(L2JModSettings.getProperty("MaxRewardCountForStackItem1", "2000000000"));
+					MAX_REWARD_COUNT_FOR_STACK_ITEM2 = Integer.parseInt(L2JModSettings.getProperty("MaxRewardCountForStackItem2", "2000000000"));
+					DELAY_FOR_NEXT_REWARD = Integer.parseInt(L2JModSettings.getProperty("DelayForNextReward", "600"));
			}
			catch (Exception e)
			{
				e.printStackTrace();

 

**UPDATE**

Έφτιαξα το error που είχε και το τέσταρα!

Αν θέλετε οι OfflineTrade παίκτες να μην παίρνουν το reward, ενεργοποιήστε το "Offline Name Collor". Έτσι όταν κάποιος παίκτης είναι OfflineTrade και έχει το Χρώμα στον τίτλο του που εσείς ορίσατε δεν θα παίρνει το reward!

 

Rework Credits : GoldenBoy™

Posted

Koitaxe ligo to code sou file merikes lexeis einai la8os grammenes kai merika  + lathos sigoura.:S

Kata ta alla einai kalo , elpizw na doulebei

Αφού είδες πως έχει λάθη δοκίμασε τον να μας πεις αν δουλεύει όντως ή απλά πες του τι είναι λάθος να το διορθώσει.

Posted

Παιδιά συγνώμη αν έχω κάποιο λάθος πάω τώρα αμέσως να το κοιτάξω ξανά!!!

 

EDIT: Το testara και είδα το λαθάκι που είχα! Τώρα δουλεύει πολύ καλά! Ευχαριστώ παίδες!

Posted

Παιδιά συγνώμη αν έχω κάποιο λάθος πάω τώρα αμέσως να το κοιτάξω ξανά!!!

 

EDIT: Το testara και είδα το λαθάκι που είχα! Τώρα δουλεύει πολύ καλά! Ευχαριστώ παίδες!

 

 

Just Tested... :P Doulevei Apsoga... Thanks Pou to ekanes Share... Keep Up ;) ..!

Posted

Fusiko  einai na kolaei kai tha kolaei sinexeia ma fou exei kanei lathos o filos mas o GoldenBoy™

ayto edw kato  prepei na fix.. diladi prepei na to kanete etsi..

 

#DelayForNextReward in seconds
-DelayForNextReward = 120
+DelayForNextReward = 600

 

Gia ton logo oti  kanei  se 120s  next vote kai kolaei..

Gi ayto balteto opws to ekana poio pano kai den tha exei provlima.. :)

Posted

Fusiko  einai na kolaei kai tha kolaei sinexeia ma fou exei kanei lathos o filos mas o GoldenBoy™

ayto edw kato  prepei na fix.. diladi prepei na to kanete etsi..

 

#DelayForNextReward in seconds
-DelayForNextReward = 120
+DelayForNextReward = 600

 

Gia ton logo oti  kanei  se 120s  next vote kai kolaei..

Gi ayto balteto opws to ekana poio pano kai den tha exei provlima.. :)

 

Εμένα δούλευε κανονικά και με 120sec και γιαυτό το είχα έτσι αλλά και για τον λόγο ότι το τέσταρα και ήθελα να δίνει γρήγορα το reward για να δω αν δουλεύει.!

Posted

vasika egw otan ton kanw ston test server pou exw ta kanei mia xara kai ta dinei(ta exw valei ana 1 vote kai ana 20 sec na check)... ston kanoniko omws otan erxete h wra na paroun to reward kai na dosei kainourio ari8mo gia vote kolaei ekei... apo thn mia pistevw ot ginete auto epeidh... mexri na ksanatsekarei exoun perasei ta vote pou 8elei kai kolaei...

pantws kati na to fixarw fast giati mou exei dimiourgi8ei provlima...

Posted

File GoldenBoy™  se test serevr kala to ekanes  kai  na to kaneis test  se  kanoniko server prepei na to kaneis 600 gia ton  logo  na min lagari kai ektos arxisou ta error ston server...

n

Posted

emena mou vgazei auto sto GS:

Exception in thread "GeneralSTPool-4" java.lang.NullPointerException
       at com.l2jserver.gameserver.model.AutoVoteRewardHandler$AutoReward.run(A
utoVoteRewardHandler.java:91)
       at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(Thread
PoolManager.java:86)
       at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

       at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$101(Unknown Source)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
runPeriodic(Unknown Source)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
       at java.lang.Thread.run(Unknown Source)

Posted

File GoldenBoy™  se test serevr kala to ekanes  kai  na to kaneis test  se  kanoniko server prepei na to kaneis 600 gia ton  logo  na min lagari kai ektos arxisou ta error ston server...

n

 

Φίλε Flash™ έχεις δίκιο σε αυτό που λες απλά ξέχασα να το αλλάξω όταν πέρασα τον κώδικα εδώ!

 

==========================================================================

emena mou vgazei auto sto GS:

Exception in thread "GeneralSTPool-4" java.lang.NullPointerException
        at com.l2jserver.gameserver.model.AutoVoteRewardHandler$AutoReward.run(A
utoVoteRewardHandler.java:91)
        at com.l2jserver.gameserver.ThreadPoolManager$RunnableWrapper.run(Thread
PoolManager.java:86)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

        at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$101(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
runPeriodic(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

 

Δες ξανά το topic είχα και εγώ αυτό το error και το fixara και το έκανα και εδώ update, προσθέτοντας την αλλαγή αυτή!

 

Αυτό εδώ άλλαξα:

+						if (item1 == null || item1.getCount() < Config.MAX_REWARD_COUNT_FOR_STACK_ITEM1)
+						{
+							player.addItem("reward", Config.VOTE_REWARD1_ID, Config.VOTE_REWARD1_COUNT, player, true);
+						}
+						else
+						{
+							player.sendMessage("[" + Config.SERVER_NAME_FOR_VOTES+"]" + "You have reached our limit for vote reward items");
+						}

 

 

και αυτό:

+						if (item2 == null || item2.getCount() < Config.MAX_REWARD_COUNT_FOR_STACK_ITEM2)
+						{
+							player.addItem("reward", Config.VOTE_REWARD2_ID, Config.VOTE_REWARD2_COUNT, player, true);
+						}
+						else
+						{
+							player.sendMessage("[" + Config.SERVER_NAME_FOR_VOTES+"]" + "You have reached our limit for vote reward items");
+						}

 

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

    • If you don't want spam, stop badmouthing open source code just to try and sell your compiled crap in a licensed DLL, which is probably full of backdoors like any criminal would do.   I'll create a Git repository just to publish the mods Skylord prepared for this garbage for free.   You're the only scammer here, selling a compilation of the source code Guytis gave you. Regards.   It's not easy when you dedicate yourself to insulting, threatening, and harassing people. Just look at your own reality and you'll realize it.
    • (3241-100)/9 = 349 online xD     WHAT I WILL SEE ON NEW SEASON ? *Free VIP characters for everyone for first 3 days after opening ! Unique augmentation trade/sell system (NEW PATCH V3.2). Improved server stability. No more lagg / dc. Pvp map area HIDE Names/clans unique system. Big changes on augmentation system.  rotfl Lucky fortune monsters on levelling area with 10min spawn. Also we will try to push longer seasons ever !  HAHAHAHAHAHA XD Increased giran trading area for sell. New raid boss events in coliseum. Fixed reflect damage skills. New raid boss banshee. Fixed pvp area flag issues. Fixed castle siege pray issues. New pvp map in sea of spores. Increased all mob drops rate by +20%. And much more...   Augment diammond 100% 3x winter xDD   And now the best part   HAHAHAH 1-10 random level LS Augment Also we will try to push longer seasons ever !  HAHAHAHAHAHA XD   GRAND START FROM - 15/08/2025, FRIDAY, 20:00 +3 GMT ! GRAND OPENING FROM - 10/10/2025, FRIDAY, 20:00 +3 GRAND OPENING FROM - 05 DECEMBER 2025, FRIDAY, 20:00 +2 GMT ! GRAND OPENING FROM - 12/052025, FRIDAY, 20:00 +3 GMT ! GRAND OPENING FROM - 23 JANUARY 2026, FRIDAY, 20:00 +2 GMT ! WIPE ! NEW SEASON GRAND OPENING FROM TODAY ! - 23/01/2026, FRIDAY, 20:00 +3 GMT ! OPENING TODAY !!! FROM - 06/03/2026, FRIDAY, 20:00 +3 GMT !   1. When wipe?  2. When will there be any response to the allegations? 3. When will they stop deceiving players with the actual number of players online? 4. When change server name to L2][Wipe the best waste Time][Money?
    • Don't spam my post again. Do you need attention? That guy doesn't work at L2Devs, he's not a programmer, and I've never spoken to him. You should respond to the people you scammed. Regards!
    • “WRONG EMAIL – AND EVERYTHING FALLS APART.” ▪ Requests are different. Sometimes a task takes three days, sometimes thirty minutes. ▪ Recently a regular client contacted us. The account had one e-mail, but another one was required for a specific service. ▪ The screenshot was sent immediately. Task – carefully replace the e-mail in the document so that everything looks natural and leaves no editing traces. ▪ Small details like this are often underestimated. › What usually happens: – one symbol in the e-mail doesn’t match – the system starts checking metadata – questions appear about the file origin – the document goes to additional verification ▪ We simply did it properly: the e-mail matches, the file structure remained intact, the document looks original. ▪ Sometimes a good result is not “magic”, but precision in details. ▪ If your document were checked right now – are you sure there are no small details that could ruin everything? › TG: https://t.me/mustang_service ( https:// t.me/ mustang_service ) › Channel: https://t.me/+JPpJCETg-xM1NjNl ( https:// t.me/ +JPpJCETg-xM1NjNl ) #documentdesign #verification #documents #case #antifraud
    • Skylord  = L2Gold.eu ;   Skylord is the programmer at L2Devs. Look what he posted in my thread. I reported him, and they automatically deleted his post and closed my thread.   They need to trick people into buying this garbage.   You can safely use this extender:   https://maxcheaters.com/topic/253977-%F0%9F%94%A5-l2ext-custom-interlude-vang-%E2%80%93-2026-release/  
  • 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..