Jump to content

Recommended Posts

Posted

Here's small share for you :O

 

Index: java/net/sf/l2j/gameserver/model/entity/TvTEvent.java
===================================================================
--- java/net/sf/l2j/gameserver/model/entity/TvTEvent.java	(revision 2909)
+++ java/net/sf/l2j/gameserver/model/entity/TvTEvent.java	(working copy)
@@ -177,20 +177,28 @@
			highestLevelPlayerId = highestLevelPcInstanceOf(allParticipants);
			highestLevelPlayer = allParticipants.get(highestLevelPlayerId);
			allParticipants.remove(highestLevelPlayerId);
-			_teams[priority].addPlayer(highestLevelPlayer);
-			balance[priority] += highestLevelPlayer.getLevel();
-			// Exiting if no more players
-			if (allParticipants.isEmpty()) break;
-			// The other team gets one player
-			// XXX: Code not dry
-			priority = 1-priority;
-			highestLevelPlayerId = highestLevelPcInstanceOf(allParticipants);
-			highestLevelPlayer = allParticipants.get(highestLevelPlayerId);
-			allParticipants.remove(highestLevelPlayerId);
-			_teams[priority].addPlayer(highestLevelPlayer);
-			balance[priority] += highestLevelPlayer.getLevel();
-			// Recalculating priority
-			priority = balance[0] > balance[1] ? 1 : 0;
+			// Don't add any cursed weapon owners to either team
+			if (highestLevelPlayer.isCursedWeaponEquipped())
+			{
+				highestLevelPlayer.sendMessage("Your TvT registration has been canceled. Cursed weapon owners are not allowed to participate.");
+			}
+			else
+			{	
+				_teams[priority].addPlayer(highestLevelPlayer);
+				balance[priority] += highestLevelPlayer.getLevel();
+				// Exiting if no more players
+				if (allParticipants.isEmpty()) break;
+				// The other team gets one player
+				// XXX: Code not dry
+				priority = 1-priority;
+				highestLevelPlayerId = highestLevelPcInstanceOf(allParticipants);
+				highestLevelPlayer = allParticipants.get(highestLevelPlayerId);
+				allParticipants.remove(highestLevelPlayerId);
+				_teams[priority].addPlayer(highestLevelPlayer);
+				balance[priority] += highestLevelPlayer.getLevel();
+				// Recalculating priority
+				priority = balance[0] > balance[1] ? 1 : 0;
+			}
		}

		// Check for enought participants

  • 1 year later...

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


×
×
  • 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..