Bläddra i källkod

BETA: Continuation of [6488].
* Fixed enchant HP bonus it was not working after [6488].
* `EnchantItemHPBonusData` '''(data/stats/enchantHPBonus.xml)''' is using now `CrystalType` enum.

Reported by: d!g0
Tested by: d!g0
Reviewed by: d!g0

Nos 11 år sedan
förälder
incheckning
941c921685

+ 6 - 6
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/EnchantItemHPBonusData.java

@@ -20,7 +20,7 @@ package com.l2jserver.gameserver.datatables;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
+import java.util.EnumMap;
 import java.util.List;
 import java.util.Map;
 
@@ -40,7 +40,7 @@ import com.l2jserver.gameserver.model.stats.Stats;
  */
 public class EnchantItemHPBonusData extends DocumentParser
 {
-	private final Map<Integer, List<Integer>> _armorHPBonuses = new HashMap<>();
+	private final Map<CrystalType, List<Integer>> _armorHPBonuses = new EnumMap<>(CrystalType.class);
 	
 	private static final float fullArmorModifier = 1.5f; // TODO: Move it to config!
 	
@@ -57,21 +57,21 @@ public class EnchantItemHPBonusData extends DocumentParser
 	{
 		for (Node n = getCurrentDocument().getFirstChild(); n != null; n = n.getNextSibling())
 		{
-			if ("list".equals(n.getNodeName()))
+			if ("list".equalsIgnoreCase(n.getNodeName()))
 			{
 				for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
 				{
-					if ("enchantHP".equals(d.getNodeName()))
+					if ("enchantHP".equalsIgnoreCase(d.getNodeName()))
 					{
 						List<Integer> bonuses = new ArrayList<>();
 						for (Node e = d.getFirstChild(); e != null; e = e.getNextSibling())
 						{
-							if ("bonus".equals(e.getNodeName()))
+							if ("bonus".equalsIgnoreCase(e.getNodeName()))
 							{
 								bonuses.add(Integer.valueOf(e.getTextContent()));
 							}
 						}
-						_armorHPBonuses.put(parseInteger(d.getAttributes(), "grade"), bonuses);
+						_armorHPBonuses.put(parseEnum(d.getAttributes(), CrystalType.class, "grade"), bonuses);
 					}
 				}
 			}