| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -3,6 +3,7 @@ package engine.gameManager; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import engine.Enum; | 
					 | 
					 | 
					 | 
					import engine.Enum; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import engine.InterestManagement.WorldGrid; | 
					 | 
					 | 
					 | 
					import engine.InterestManagement.WorldGrid; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import engine.exception.MsgSendException; | 
					 | 
					 | 
					 | 
					import engine.exception.MsgSendException; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import engine.math.Vector3f; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import engine.math.Vector3fImmutable; | 
					 | 
					 | 
					 | 
					import engine.math.Vector3fImmutable; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import engine.objects.*; | 
					 | 
					 | 
					 | 
					import engine.objects.*; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import engine.server.MBServerStatics; | 
					 | 
					 | 
					 | 
					import engine.server.MBServerStatics; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -56,14 +57,23 @@ public class ArenaManager { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private static void createArena() { | 
					 | 
					 | 
					 | 
					    private static void createArena() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (playerQueue.size() > 1) { | 
					 | 
					 | 
					 | 
					        if (playerQueue.size() > 1) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Collections.shuffle(playerQueue); | 
					 | 
					 | 
					 | 
					            Collections.shuffle(playerQueue); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Arena newArena = new Arena(); | 
					 | 
					 | 
					 | 
					            Arena newArena = new Arena(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            //set starting time
 | 
					 | 
					 | 
					 | 
					            //set starting time
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            newArena.startTime = System.currentTimeMillis(); | 
					 | 
					 | 
					 | 
					            newArena.startTime = System.currentTimeMillis(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            //decide an arena location
 | 
					 | 
					 | 
					 | 
					            //decide an arena location
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            newArena.loc = selectRandomArenaLocation(); | 
					 | 
					 | 
					 | 
					            newArena.loc = selectRandomArenaLocation(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //create building for arena
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //arena mesh uuid = 423600
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            Vector3f rot = new Vector3f(0.0f, 0.0f, 0.0f); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            float w = 1f; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            Building building = DbManager.BuildingQueries.CREATE_BUILDING(992, 0, "Duelling Arena", 423600, newArena.loc, 3.0f, 0, Enum.ProtectionState.PROTECTED, 0, 1, null, 423600, w, rot.y); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            newArena.arenaCircle = building; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            // Assign players to the arena
 | 
					 | 
					 | 
					 | 
					            // Assign players to the arena
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            newArena.player1 = playerQueue.remove(0); | 
					 | 
					 | 
					 | 
					            newArena.player1 = playerQueue.remove(0); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            newArena.player2 = playerQueue.remove(0); | 
					 | 
					 | 
					 | 
					            newArena.player2 = playerQueue.remove(0); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -90,6 +100,14 @@ public class ArenaManager { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        Zone sdr = ZoneManager.getZoneByUUID(656); | 
					 | 
					 | 
					 | 
					        Zone sdr = ZoneManager.getZoneByUUID(656); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        MovementManager.translocate(arena.player1, Vector3fImmutable.getRandomPointOnCircle(sdr.getLoc(),50f), null); | 
					 | 
					 | 
					 | 
					        MovementManager.translocate(arena.player1, Vector3fImmutable.getRandomPointOnCircle(sdr.getLoc(),50f), null); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        MovementManager.translocate(arena.player2, Vector3fImmutable.getRandomPointOnCircle(sdr.getLoc(),50f), null); | 
					 | 
					 | 
					 | 
					        MovementManager.translocate(arena.player2, Vector3fImmutable.getRandomPointOnCircle(sdr.getLoc(),50f), null); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        Building building = arena.arenaCircle; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        Zone zone = building.getParentZone(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        DbManager.BuildingQueries.DELETE_FROM_DATABASE(building); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        DbManager.removeFromCache(building); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        zone.zoneBuildingSet.remove(building); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        WorldGrid.RemoveWorldObject(building); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        activeArenas.remove(arena); | 
					 | 
					 | 
					 | 
					        activeArenas.remove(arena); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if(winner != null){ | 
					 | 
					 | 
					 | 
					        if(winner != null){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |