Procházet zdrojové kódy

Fix for door calculators.
Some other small changes.

JIV před 15 roky
rodič
revize
2f119addb6

+ 1 - 1
L2_GameServer/java/com/l2jserver/gameserver/instancemanager/AuctionManager.java

@@ -73,7 +73,7 @@ public class AuctionManager
 		"(61, 0, 'NPC', 'NPC Clan', 'ClanHall', 61, 0, 'Titan Hall', 1, 50000000, 0, 1164841200000)"
 		"(61, 0, 'NPC', 'NPC Clan', 'ClanHall', 61, 0, 'Titan Hall', 1, 50000000, 0, 1164841200000)"
 	};
 	};
 	
 	
-	private static final Integer[] ItemInitDataId =
+	private static final int[] ItemInitDataId =
 	{
 	{
 		22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 41, 42,
 		22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 41, 42,
 		43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61
 		43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61

+ 1 - 7
L2_GameServer/java/com/l2jserver/gameserver/instancemanager/ItemsOnGroundManager.java

@@ -196,13 +196,7 @@ public class ItemsOnGroundManager
 		}
 		}
 		finally
 		finally
 		{
 		{
-			try
-			{
-				conn.close();
-			}
-			catch (Exception e1)
-			{
-			}
+			L2DatabaseFactory.close(conn);
 		}
 		}
 	}
 	}
 	
 	

+ 4 - 4
L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -344,14 +344,14 @@ public abstract class L2Character extends L2Object
 
 
 		// Set its template to the new L2Character
 		// Set its template to the new L2Character
 		_template = template;
 		_template = template;
+		
+		if (this instanceof L2DoorInstance)
+			_calculators = Formulas.getStdDoorCalculators();
 
 
 		if (template != null && this instanceof L2Npc)
 		if (template != null && this instanceof L2Npc)
 		{
 		{
 			// Copy the Standard Calcultors of the L2NPCInstance in _calculators
 			// Copy the Standard Calcultors of the L2NPCInstance in _calculators
-			if (this instanceof L2DoorInstance)
-				_calculators = Formulas.getStdDoorCalculators();
-			else
-				_calculators = NPC_STD_CALCULATOR;
+			_calculators = NPC_STD_CALCULATOR;
 			
 			
 			// Copy the skills of the L2NPCInstance from its template to the L2Character Instance
 			// Copy the skills of the L2NPCInstance from its template to the L2Character Instance
 			// The skills list can be affected by spell effects so it's necessary to make a copy
 			// The skills list can be affected by spell effects so it's necessary to make a copy

+ 4 - 2
L2_GameServer/java/com/l2jserver/gameserver/skills/Formulas.java

@@ -923,13 +923,15 @@ public final class Formulas
 		std[Stats.EVASION_RATE.ordinal()].addFunc(FuncAtkEvasion.getInstance());
 		std[Stats.EVASION_RATE.ordinal()].addFunc(FuncAtkEvasion.getInstance());
 		
 		
 		//SevenSigns PDEF Modifier
 		//SevenSigns PDEF Modifier
+		std[Stats.POWER_DEFENCE.ordinal()] = new Calculator();
 		std[Stats.POWER_DEFENCE.ordinal()].addFunc(FuncGatesPDefMod.getInstance());
 		std[Stats.POWER_DEFENCE.ordinal()].addFunc(FuncGatesPDefMod.getInstance());
 		
 		
 		//SevenSigns MDEF Modifier
 		//SevenSigns MDEF Modifier
-		std[Stats.MAGIC_DEFENCE.ordinal()].addFunc(FuncGatesMDefMod.getInstance());		
+		std[Stats.MAGIC_DEFENCE.ordinal()] = new Calculator();
+		std[Stats.MAGIC_DEFENCE.ordinal()].addFunc(FuncGatesMDefMod.getInstance());
 		
 		
 		return std;
 		return std;
-	}	
+	}
 
 
 	/**
 	/**
 	 * Add basics Func objects to L2PcInstance and L2Summon.<BR><BR>
 	 * Add basics Func objects to L2PcInstance and L2Summon.<BR><BR>

+ 3 - 21
L2_GameServer/java/com/l2jserver/gameserver/taskmanager/AutoAnnounceTaskManager.java

@@ -91,13 +91,7 @@ public class AutoAnnounceTaskManager
 		}
 		}
 		finally
 		finally
 		{
 		{
-			try
-			{
-				conn.close();
-			}
-			catch (Exception e)
-			{
-			}
+			L2DatabaseFactory.close(conn);
 		}
 		}
 		_log.log(Level.INFO, "AutoAnnoucements: Loaded " + count + " Auto Annoucement Data.");
 		_log.log(Level.INFO, "AutoAnnoucements: Loaded " + count + " Auto Annoucement Data.");
 	}
 	}
@@ -128,13 +122,7 @@ public class AutoAnnounceTaskManager
 		}
 		}
 		finally
 		finally
 		{
 		{
-			try
-			{
-				conn.close();
-			}
-			catch (Exception e)
-			{
-			}
+			L2DatabaseFactory.close(conn);
 		}
 		}
 	}
 	}
 	
 	
@@ -162,13 +150,7 @@ public class AutoAnnounceTaskManager
 		}
 		}
 		finally
 		finally
 		{
 		{
-			try
-			{
-				conn.close();
-			}
-			catch (Exception e)
-			{
-			}
+			L2DatabaseFactory.close(conn);
 		}
 		}
 	}
 	}