Bläddra i källkod

Fix for bug where 2 command channels can enter to Frintezza at once Thx Nik also whitespaces in 32326002.xml multisell

Tan 14 år sedan
förälder
incheckning
aacc3740ac

+ 4 - 4
L2J_DataPack_BETA/data/multisell/32326002.xml

@@ -51,14 +51,14 @@
 		<production count="1" id="9553" />
 	</item>
 	<item id="9">
-	        <!-- Earth Stone -->
+		<!-- Earth Stone -->
 		<ingredient count="5" id="9548" />
 		<ingredient count="3000000" id="57" />
-	        <!-- Earth Crystal -->
+		<!-- Earth Crystal -->
 		<production count="1" id="9554" />
 	</item>
 	<item id="10">
-	        <!-- Wind Stone -->
+		<!-- Wind Stone -->
 		<ingredient count="5" id="9549" />
 		<ingredient count="3000000" id="57" />
 		<!-- Wind Crystal -->
@@ -72,7 +72,7 @@
 		<production count="1" id="9557" />
 	</item>
 	<item id="12">
-		<!-- Dark Stone-->
+		<!-- Dark Stone -->
 		<ingredient count="5" id="9550" />
 		<ingredient count="3000000" id="57" />
 		<!-- Dark Crystal -->

+ 52 - 49
L2J_DataPack_BETA/data/scripts/ai/individual/Frintezza.java

@@ -1243,68 +1243,71 @@ public class Frintezza extends L2AttackableAIScript
 		}
 		
 		String htmltext = "";
-		if (GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == DEAD)
+		synchronized(this) //Synch to prevent 2 command channels entering at once
 		{
-			htmltext = "<html><body>There is nothing beyond the Magic Force Field. Come back later.<br>(You may not enter because Frintezza is not inside the Imperial Tomb.)</body></html>";
-		}
-		else if (GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == DORMANT)
-		{
-			if ((!player.isInParty() || !player.getParty().isLeader(player))
-					|| (player.getParty().getCommandChannel() == null)
-					|| (player.getParty().getCommandChannel().getChannelLeader() != player))
-			{
-				htmltext = "<html><body>No reaction. Contact must be initiated by the Command Channel Leader.</body></html>";
-			}
-			else if (player.getParty().getCommandChannel().getPartys().size() < 4 || player.getParty().getCommandChannel().getPartys().size() > 5)
+			if (GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == DEAD)
 			{
-				htmltext = "<html><body>Your command channel needs to have at least 4 parties and a maximum of 5.</body></html>";
+				htmltext = "<html><body>There is nothing beyond the Magic Force Field. Come back later.<br>(You may not enter because Frintezza is not inside the Imperial Tomb.)</body></html>";
 			}
-			else if (player.getInventory().getItemByItemId(8073) == null)
-			{
-				htmltext = "<html><body>You dont have required item.</body></html>";
-			}
-			else
+			else if (GrandBossManager.getInstance().getBossStatus(FRINTEZZA) == DORMANT)
 			{
-				player.destroyItemByItemId("Quest", 8073, 1, player, true);
-				L2CommandChannel CC = player.getParty().getCommandChannel();
-				GrandBossManager.getInstance().setBossStatus(FRINTEZZA, WAITING);
-				
-				startQuestTimer("close", 0, npc, null);
-				startQuestTimer("room1_spawn", 5000, npc, null);
-				startQuestTimer("room_final", 2100000, npc, null);
-				startQuestTimer("frintezza_despawn", 60000, npc, null, true);
-				
-				_LastAction = System.currentTimeMillis();
-				for (L2Party party : CC.getPartys())
+				if ((!player.isInParty() || !player.getParty().isLeader(player))
+						|| (player.getParty().getCommandChannel() == null)
+						|| (player.getParty().getCommandChannel().getChannelLeader() != player))
+				{
+					htmltext = "<html><body>No reaction. Contact must be initiated by the Command Channel Leader.</body></html>";
+				}
+				else if (player.getParty().getCommandChannel().getPartys().size() < 4 || player.getParty().getCommandChannel().getPartys().size() > 5)
+				{
+					htmltext = "<html><body>Your command channel needs to have at least 4 parties and a maximum of 5.</body></html>";
+				}
+				else if (player.getInventory().getItemByItemId(8073) == null)
 				{
-					if (party == null)
-						continue;
-					for (L2PcInstance member : party.getPartyMembers())
+					htmltext = "<html><body>You dont have required item.</body></html>";
+				}
+				else
+				{
+					player.destroyItemByItemId("Quest", 8073, 1, player, true);
+					L2CommandChannel CC = player.getParty().getCommandChannel();
+					GrandBossManager.getInstance().setBossStatus(FRINTEZZA, WAITING);
+					
+					startQuestTimer("close", 0, npc, null);
+					startQuestTimer("room1_spawn", 5000, npc, null);
+					startQuestTimer("room_final", 2100000, npc, null);
+					startQuestTimer("frintezza_despawn", 60000, npc, null, true);
+					
+					_LastAction = System.currentTimeMillis();
+					for (L2Party party : CC.getPartys())
 					{
-						if (member == null || member.getLevel() < 74)
-							continue;
-						if (!member.isInsideRadius(npc, 700, false, false))
+						if (party == null)
 							continue;
-						if (_PlayersInside.size() > 45)
+						for (L2PcInstance member : party.getPartyMembers())
 						{
-							member.sendMessage("The number of challenges have been full, so can not enter.");
-							break;
+							if (member == null || member.getLevel() < 74)
+								continue;
+							if (!member.isInsideRadius(npc, 700, false, false))
+								continue;
+							if (_PlayersInside.size() > 45)
+							{
+								member.sendMessage("The number of challenges have been full, so can not enter.");
+								break;
+							}
+							_PlayersInside.add(member);
+							_Zone.allowPlayerEntry(member, 300);
+							member.teleToLocation(getXFix(_invadeLoc[_LocCycle][0]) + Rnd.get(50), getYFix(_invadeLoc[_LocCycle][1]) + Rnd.get(50), getZFix(_invadeLoc[_LocCycle][2]));
 						}
-						_PlayersInside.add(member);
-						_Zone.allowPlayerEntry(member, 300);
-						member.teleToLocation(getXFix(_invadeLoc[_LocCycle][0]) + Rnd.get(50), getYFix(_invadeLoc[_LocCycle][1]) + Rnd.get(50), getZFix(_invadeLoc[_LocCycle][2]));
+						if (_PlayersInside.size() > 45)
+							break;
+						
+						_LocCycle++;
+						if (_LocCycle >= 6)
+							_LocCycle = 1;
 					}
-					if (_PlayersInside.size() > 45)
-						break;
-					
-					_LocCycle++;
-					if (_LocCycle >= 6)
-						_LocCycle = 1;
 				}
 			}
+			else
+				htmltext = "<html><body>Someone else is already inside the Magic Force Field. Try again later.</body></html>";
 		}
-		else
-			htmltext = "<html><body>Someone else is already inside the Magic Force Field. Try again later.</body></html>";
 		
 		return htmltext;
 	}