All pastes #402268 Raw Edit

Anonymous

public java v1 · immutable
·published 2007-03-19 20:29 UTC
rendered paste body
Index: C:/Documents and Settings/AresXP/workspace/L2Z_GSC5/src/main/java/net/sf/l2j/gameserver/model/entity/Siege.java===================================================================--- C:/Documents and Settings/AresXP/workspace/L2Z_GSC5/src/main/java/net/sf/l2j/gameserver/model/entity/Siege.java	(revision 32)+++ C:/Documents and Settings/AresXP/workspace/L2Z_GSC5/src/main/java/net/sf/l2j/gameserver/model/entity/Siege.java	(working copy)@@ -716,6 +716,7 @@         {             if(player.getClan().getAllyId() == allyId && !force)             {+                //TODO: change message. (cannot reg)                 player.sendMessage("You cannot register as an attacker because your alliance owns the castle");                 return;              }@@ -735,6 +736,7 @@      public void registerDefender(L2PcInstance player, boolean force)     {+        //TODO: check message (cannot reg)         if (getCastle().getOwnerId() <= 0) player.sendMessage("You cannot register as a defender because "             + getCastle().getName() + " is owned by NPC.");         else if (force || this.checkIfCanRegister(player)) saveSiegeClan(player.getClan(), 2, false); // Save to database@@ -895,20 +897,51 @@      */     private boolean checkIfCanRegister(L2PcInstance player)     {-        if (getIsRegistrationOver()) player.sendMessage("The deadline to register for the siege of "-            + getCastle().getName() + " has passed.");-        else if (getIsInProgress()) player.sendMessage("This is not the time for siege registration and so registration and cancellation cannot be done.");+        if (getIsRegistrationOver()) +        {+            //The deadline to register for the siege of $s1 has passed.+            SystemMessage sm = new SystemMessage(845);+            sm.addString(getCastle().getName());+            player.sendPacket(sm);+            sm = null;+        	return false;+        }+        else if (getIsInProgress()) +        {+            //This is not the time for siege registration and so registration and cancellation cannot be done.+        	player.sendPacket(new SystemMessage(660));+        	return false;+        }         else if (player.getClan() == null-            || player.getClan().getLevel() < SiegeManager.getInstance().getSiegeClanMinLevel()) player.sendMessage("Only clans with Level "-            + SiegeManager.getInstance().getSiegeClanMinLevel()-            + " and higher may register for a castle siege.");-        else if (player.getClan().getHasCastle() > 0) player.sendMessage("You cannot register because your clan already own a castle.");+            || player.getClan().getLevel() < SiegeManager.getInstance().getSiegeClanMinLevel()) +        {+            //Only clans of level 4 or higher may register for a castle siege.+            player.sendPacket(new SystemMessage(645));+        	return false;+        }+        else if (player.getClan().getHasCastle() > 0) +        {+            //A clan that owns a castle cannot participate in another siege.+        	player.sendPacket(new SystemMessage(689));+        	return false;+        }         else if (player.getClan().getClanId() == getCastle().getOwnerId())+        {             player.sendPacket(new SystemMessage(SystemMessage.CLAN_THAT_OWNS_CASTLE_IS_AUTOMATICALLY_REGISTERED_DEFENDING));-        else if (SiegeManager.getInstance().checkIsRegistered(player.getClan(), getCastle().getCastleId())) player.sendMessage("You are already registered in a Siege.");-        else return true;--        return false;+            return false;+        }+        else +        {+        	for(int i=0; i<10; i++)+        	{+                //Your application has been denied because you have already submitted a request for another Siege Battle.+        		if (SiegeManager.getInstance().checkIsRegistered(player.getClan(), i)) {+        			player.sendPacket(new SystemMessage(639));+        			return false;+        		}+        	}+        }+        return true;     }      /**