Ver Fonte

Core-Part for [DP7821] by Zoey76.

MELERIX há 14 anos atrás
pai
commit
193a038958

+ 8 - 5
L2J_Server/java/com/l2jserver/gameserver/datatables/SkillTreeTable.java

@@ -152,7 +152,7 @@ public class SkillTreeTable
 				int parentClassId;
 				L2SkillLearn skillLearn;
 				
-				PreparedStatement statement2 = con.prepareStatement("SELECT class_id, skill_id, level, name, sp, min_level, learned_by_npc, learned_by_fs FROM skill_trees where class_id=? ORDER BY skill_id, level");
+				PreparedStatement statement2 = con.prepareStatement("SELECT class_id, skill_id, level, name, sp, min_level, learned_by_npc, learned_by_fs, is_transfer, is_autoget FROM skill_trees where class_id=? ORDER BY skill_id, level");
 				while (classlist.next())
 				{
 					map = new FastMap<Integer, L2SkillLearn>();
@@ -180,11 +180,13 @@ public class SkillTreeTable
 						int cost = skilltree.getInt("sp");
 						boolean npc = skilltree.getBoolean("learned_by_npc");
 						boolean fs = skilltree.getBoolean("learned_by_fs");
+						boolean trans = skilltree.getBoolean("is_transfer");
+						boolean autoget = skilltree.getBoolean("is_autoget");
 						
 						if (prevSkillId != id)
 							prevSkillId = id;
 						
-						skillLearn = new L2SkillLearn(id, lvl, minLvl, name, cost, 0, 0, npc, fs);
+						skillLearn = new L2SkillLearn(id, lvl, minLvl, name, cost, 0, 0, npc, fs, trans, autoget);
 						map.put(SkillTable.getSkillHashCode(id, lvl), skillLearn);
 					}
 					
@@ -233,7 +235,7 @@ public class SkillTreeTable
 					if (prevSkillId != id)
 						prevSkillId = id;
 					
-					L2SkillLearn skill = new L2SkillLearn(id, lvl, minLvl, name, cost, costId, costCount, npc, fs);
+					L2SkillLearn skill = new L2SkillLearn(id, lvl, minLvl, name, cost, costId, costCount, npc, fs, false, false);
 					
 					if (isDwarven)
 						_expandDwarfCraftSkillTrees.add(skill);
@@ -339,7 +341,7 @@ public class SkillTreeTable
 					if (prevSkillId != id)
 						prevSkillId = id;
 					
-					L2SkillLearn skill = new L2SkillLearn(id, lvl, 0, name, 0, costId, costCount, npc, fs);
+					L2SkillLearn skill = new L2SkillLearn(id, lvl, 0, name, 0, costId, costCount, npc, fs, false, false);
 					
 					_specialSkillTrees.add(skill);
 				}
@@ -461,7 +463,8 @@ public class SkillTreeTable
 		
 		for (L2SkillLearn temp : skills)
 		{
-			if (!temp.isLearnedByFS() && temp.getMinLevel() <= cha.getLevel())
+			//Let's get all auto-get skills and all skill learn from npc, but transfer skills.
+			if ((temp.isAutoGetSkill() || (temp.isLearnedByNPC() && !temp.isTransferSkill())) && (temp.getMinLevel() <= cha.getLevel()))
 			{
 				boolean knownSkill = false;
 				

+ 4 - 12
L2J_Server/java/com/l2jserver/gameserver/model/L2ExtractableSkill.java

@@ -22,15 +22,12 @@ import javolution.util.FastList;
 public class L2ExtractableSkill
 {
 	private final int _hash;
-	private final L2ExtractableProductItem[] _product;
-	private final boolean _msg;
+	private final FastList<L2ExtractableProductItem> _product;
 	
-	public L2ExtractableSkill(int hash, FastList<L2ExtractableProductItem> products, boolean msg)
+	public L2ExtractableSkill(int hash, FastList<L2ExtractableProductItem> products)
 	{
 		_hash = hash;
-		_product = new L2ExtractableProductItem[products.size()];
-		products.toArray(_product);
-		_msg = msg;
+		_product = products;
 	}
 	
 	public int getSkillHash()
@@ -38,13 +35,8 @@ public class L2ExtractableSkill
 		return _hash;
 	}
 	
-	public L2ExtractableProductItem[] getProductItemsArray()
+	public FastList<L2ExtractableProductItem> getProductItemsArray()
 	{
 		return _product;
 	}
-	
-	public boolean useMessage()
-	{
-		return _msg;
-	}
 }

+ 4 - 4
L2J_Server/java/com/l2jserver/gameserver/model/L2Skill.java

@@ -291,7 +291,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	private final boolean _excludedFromCheck;
 	private final boolean _simultaneousCast;
 	
-	private L2ExtractableSkill _extractableItems;
+	private L2ExtractableSkill _extractableItems = null;;
 	
 	protected L2Skill(StatsSet set)
 	{
@@ -530,7 +530,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 			if (capsuled_items.isEmpty())
 				_log.warning("Empty Extractable Item Skill data in Skill Id: " + _id);
 			
-			_extractableItems = parseExtractableSkill(_id, _level, capsuled_items, set.getBool("extractableSkillUseMsg", true));
+			_extractableItems = parseExtractableSkill(_id, _level, capsuled_items);
 		}
 	}
 	
@@ -2869,7 +2869,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 	 * @return L2ExtractableSkill
 	 * @author Zoey76
 	 */
-	private L2ExtractableSkill parseExtractableSkill(int skillId, int skillLvl, String values, boolean useMsg)
+	private L2ExtractableSkill parseExtractableSkill(int skillId, int skillLvl, String values)
 	{
 		String[] lineSplit = values.split(";");
 		
@@ -2915,7 +2915,7 @@ public abstract class L2Skill implements IChanceSkillTrigger
 		if (product_temp.size()== 0)
 			_log.warning("Extractable skills data: Error in Skill Id: " + skillId + " Level: " + skillLvl + " -> There are no production items!");
 		
-		return new L2ExtractableSkill(SkillTable.getSkillHashCode(this), product_temp, useMsg);
+		return new L2ExtractableSkill(SkillTable.getSkillHashCode(this), product_temp);
 	}
 	
 	public L2ExtractableSkill getExtractableSkill()

+ 15 - 1
L2J_Server/java/com/l2jserver/gameserver/model/L2SkillLearn.java

@@ -35,8 +35,10 @@ public final class L2SkillLearn
 	
 	private final boolean _learnedByNpc;
 	private final boolean _learnedByFs;
+	private final boolean _isTransfer;
+	private final boolean _isAutoGet;
 	
-	public L2SkillLearn(int id, int lvl, int minLvl, String name, int cost, int costid, int costcount, boolean npc, boolean fs)
+	public L2SkillLearn(int id, int lvl, int minLvl, String name, int cost, int costid, int costcount, boolean npc, boolean fs, boolean transfer, boolean autoget)
 	{
 		_id = id;
 		_level = lvl;
@@ -47,6 +49,8 @@ public final class L2SkillLearn
 		_costcount = costcount;
 		_learnedByNpc = npc;
 		_learnedByFs = fs;
+		_isTransfer = transfer;
+		_isAutoGet = autoget;
 	}
 	
 	/**
@@ -114,4 +118,14 @@ public final class L2SkillLearn
 	{
 		return _learnedByFs;
 	}
+	
+	public boolean isTransferSkill()
+	{
+		return _isTransfer;
+	}
+	
+	public boolean isAutoGetSkill()
+	{
+		return _isAutoGet;
+	}
 }

+ 1 - 1
L2J_Server/launcher/L2 GameServer.launch

@@ -19,7 +19,7 @@
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/bsh-2.0b5.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/bsh-engine.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/c3p0-0.9.2-pre1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/ecj-3.6.1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/ecj-3.6.2.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/java-engine.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/javolution-5.5.1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/jython.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+ 1 - 1
L2J_Server/launcher/L2 LoginServer.launch

@@ -22,7 +22,7 @@
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/bsh-2.0b5.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/bsh-engine.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/c3p0-0.9.2-pre1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/ecj-3.6.1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/ecj-3.6.2.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/java-engine.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/javolution-5.5.1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
 <listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/L2J_Server/lib/jython-engine.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

BIN
L2J_Server/lib/ecj-3.6.1.jar → L2J_Server/lib/ecj-3.6.2.jar