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

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock