2
0
Эх сурвалжийг харах

core support for reading etcitem skills, thx kerb

janiii 16 жил өмнө
parent
commit
1962d41c75

+ 3 - 2
L2_GameServer/java/net/sf/l2j/gameserver/datatables/ItemTable.java

@@ -175,7 +175,7 @@ public class ItemTable
 	/** Table of SQL request in order to obtain items from tables [etcitem], [armor], [weapon] */
 	private static final String[] SQL_ITEM_SELECTS =
 	{
-		"SELECT item_id, name, crystallizable, item_type, weight, consume_type, material," + " crystal_type, duration, time, price, crystal_count, sellable, dropable, destroyable, tradeable FROM etcitem",
+		"SELECT item_id, name, crystallizable, item_type, weight, consume_type, material," + " crystal_type, duration, time, price, crystal_count, sellable, dropable, destroyable, tradeable, skill FROM etcitem",
 		
 		"SELECT item_id, name, bodypart, crystallizable, armor_type, weight," + " material, crystal_type, avoid_modify, duration, time, p_def, m_def, mp_bonus,"
 				+ " price, crystal_count, sellable, dropable, destroyable, tradeable, skill FROM armor",
@@ -187,7 +187,7 @@ public class ItemTable
 	
 	private static final String[] SQL_CUSTOM_ITEM_SELECTS =
 	{
-		"SELECT item_id, name, crystallizable, item_type, weight, consume_type, material," + " crystal_type, duration, time, price, crystal_count, sellable, dropable, destroyable, tradeable FROM custom_etcitem",
+		"SELECT item_id, name, crystallizable, item_type, weight, consume_type, material," + " crystal_type, duration, time, price, crystal_count, sellable, dropable, destroyable, tradeable, skill FROM custom_etcitem",
 		
 		"SELECT item_id, name, bodypart, crystallizable, armor_type, weight," + " material, crystal_type, avoid_modify, duration, time, p_def, m_def, mp_bonus,"
 				+ " price, crystal_count, sellable, dropable, destroyable, tradeable, skill FROM custom_armor",
@@ -563,6 +563,7 @@ public class ItemTable
 		item.set.set("dropable", Boolean.valueOf(rset.getString("dropable")));
 		item.set.set("destroyable", Boolean.valueOf(rset.getString("destroyable")));
 		item.set.set("tradeable", Boolean.valueOf(rset.getString("tradeable")));
+		item.set.set("skill", rset.getString("skill"));
 		String itemType = rset.getString("item_type");
 		if (itemType.equals("none"))
 			item.type = L2EtcItemType.OTHER; // only for default

+ 10 - 0
L2_GameServer/java/net/sf/l2j/gameserver/templates/item/L2EtcItem.java

@@ -23,6 +23,7 @@ import net.sf.l2j.gameserver.templates.StatsSet;
  */
 public final class L2EtcItem  extends L2Item
 {
+	private final String[] _skill;
 	/**
 	 * Constructor for EtcItem.
 	 * @see L2Item constructor
@@ -32,6 +33,7 @@ public final class L2EtcItem  extends L2Item
 	public L2EtcItem(L2EtcItemType type, StatsSet set)
 	{
 		super(type, set);
+		_skill = set.getString("skill").split(";");
 	}
 
 	/**
@@ -64,4 +66,12 @@ public final class L2EtcItem  extends L2Item
 		return getItemType().mask();
 	}
 
+	/**
+	 * Returns skills linked to that EtcItem
+	 * @return
+	 */
+	public String[] getSkills()
+	{
+		return _skill;
+	}
 }