瀏覽代碼

Core support for [DP6843]. Support for summon shots consume count.

JIV 15 年之前
父節點
當前提交
9f9a9ac164

+ 6 - 6
L2_GameServer/java/com/l2jserver/gameserver/datatables/NpcTable.java

@@ -80,7 +80,7 @@ public class NpcTable
 								"title", "serverSideTitle", "class", "collision_radius", "collision_height", "level", "sex", "type",
 								"attackrange", "hp", "mp", "hpreg", "mpreg", "str", "con", "dex", "int", "wit", "men", "exp", "sp", "patk",
 								"pdef", "matk", "mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "armor", "enchant", "walkspd", "runspd",
-								"faction_id", "faction_range", "isUndead", "absorb_level", "absorb_type", "ss", "bss", "ss_rate", "AI",
+								"faction_id", "faction_range", "isUndead", "absorb_level", "absorb_type", "soulshot_count", "spiritshot_count", "ss_rate", "AI",
 								"drop_herbs" }) + " FROM npc");
 				ResultSet npcdata = statement.executeQuery();
 				
@@ -103,7 +103,7 @@ public class NpcTable
 									"title", "serverSideTitle", "class", "collision_radius", "collision_height", "level", "sex", "type",
 									"attackrange", "hp", "mp", "hpreg", "mpreg", "str", "con", "dex", "int", "wit", "men", "exp", "sp",
 									"patk", "pdef", "matk", "mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "armor", "enchant", "walkspd",
-									"runspd", "faction_id", "faction_range", "isUndead", "absorb_level", "absorb_type", "ss", "bss",
+									"runspd", "faction_id", "faction_range", "isUndead", "absorb_level", "absorb_type", "soulshot_count", "spiritshot_count",
 									"ss_rate", "AI", "drop_herbs" }) + " FROM custom_npc");
 					ResultSet npcdata = statement.executeQuery();
 					
@@ -443,8 +443,8 @@ public class NpcTable
 			npcDat.set("absorb_level", NpcData.getString("absorb_level"));
 			npcDat.set("absorb_type", NpcData.getString("absorb_type"));
 			
-			npcDat.set("ss", NpcData.getInt("ss"));
-			npcDat.set("bss", NpcData.getInt("bss"));
+			npcDat.set("soulshot_count", NpcData.getInt("soulshot_count"));
+			npcDat.set("spiritshot_count", NpcData.getInt("spiritshot_count"));
 			npcDat.set("ssRate", NpcData.getInt("ss_rate"));
 			
 			npcDat.set("AI", NpcData.getString("AI"));
@@ -502,7 +502,7 @@ public class NpcTable
 							"serverSideTitle", "class", "collision_radius", "collision_height", "level", "sex", "type", "attackrange",
 							"hp", "mp", "hpreg", "mpreg", "str", "con", "dex", "int", "wit", "men", "exp", "sp", "patk", "pdef", "matk",
 							"mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "armor", "enchant", "walkspd", "runspd", "faction_id",
-							"faction_range", "isUndead", "absorb_level", "absorb_type", "ss", "bss", "ss_rate", "AI", "drop_herbs" })
+							"faction_range", "isUndead", "absorb_level", "absorb_type", "soulshot_count", "spiritshot_count", "ss_rate", "AI", "drop_herbs" })
 					+ " FROM npc WHERE id=?");
 			st.setInt(1, id);
 			ResultSet rs = st.executeQuery();
@@ -514,7 +514,7 @@ public class NpcTable
 								"title", "serverSideTitle", "class", "collision_radius", "collision_height", "level", "sex", "type",
 								"attackrange", "hp", "mp", "hpreg", "mpreg", "str", "con", "dex", "int", "wit", "men", "exp", "sp", "patk",
 								"pdef", "matk", "mdef", "atkspd", "aggro", "matkspd", "rhand", "lhand", "armor", "enchant", "walkspd", "runspd",
-								"faction_id", "faction_range", "isUndead", "absorb_level", "absorb_type", "ss", "bss", "ss_rate", "AI",
+								"faction_id", "faction_range", "isUndead", "absorb_level", "absorb_type", "soulshot_count", "spiritshot_count", "ss_rate", "AI",
 								"drop_herbs" }) + " FROM custom_npc WHERE id=?");
 				st.setInt(1, id);
 				rs = st.executeQuery();

+ 8 - 9
L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Summon.java

@@ -73,11 +73,6 @@ public abstract class L2Summon extends L2Playable
     private int _chargedSoulShot;
     private int _chargedSpiritShot;
 
-    // TODO: currently, all servitors use 1 shot.  However, this value
-    // should vary depending on the servitor template (id and level)!
-    private int _soulShotsPerHit = 1;
-    private int _spiritShotsPerHit = 1;
-
 	public class AIAccessor extends L2Character.AIAccessor
 	{
 		protected AIAccessor() {}
@@ -358,14 +353,18 @@ public abstract class L2Summon extends L2Playable
         return 0;
     }
 
-    public final int getSoulShotsPerHit()
+    public final short getSoulShotsPerHit()
     {
-        return _soulShotsPerHit;
+    	if (getTemplate().soulShotCount > 0)
+    		return getTemplate().soulShotCount;
+    	else return 1;
     }
 
-    public final int getSpiritShotsPerHit()
+    public final short getSpiritShotsPerHit()
     {
-        return _spiritShotsPerHit;
+    	if (getTemplate().spiritShotCount > 0)
+    		return getTemplate().spiritShotCount;
+    	else return 1;
     }
 
     public void setChargedSoulShot(int shotType)

+ 2 - 0
L2_GameServer/java/com/l2jserver/gameserver/network/serverpackets/ExGetOnAirShip.java

@@ -31,6 +31,8 @@ public class ExGetOnAirShip extends L2GameServerPacket
 		_y = ship.getY();
 		_z = ship.getZ();
 		player.setXYZ(_x, _y, _z);
+		if (player.getPet() != null)
+			player.getPet().teleToLocation(_x, _y, _z);
 	}
 
 	@Override

+ 4 - 4
L2_GameServer/java/com/l2jserver/gameserver/templates/chars/L2NpcTemplate.java

@@ -73,8 +73,8 @@ public final class L2NpcTemplate extends L2CharTemplate
 	public final int factionRange;
 	public final int absorbLevel;
 	public final AbsorbCrystalType absorbType;
-	public final short ss;
-	public final short bss;
+	public final short soulShotCount;
+	public final short spiritShotCount;
 	public final short ssRate;
 	public Race race;
 	public final String jClass;
@@ -227,8 +227,8 @@ public final class L2NpcTemplate extends L2CharTemplate
 		factionRange = set.getInteger("factionRange");
 		absorbLevel = set.getInteger("absorb_level", 0);
 		absorbType = AbsorbCrystalType.valueOf(set.getString("absorb_type"));
-		ss = (short) set.getInteger("ss", 0);
-		bss = (short) set.getInteger("bss", 0);
+		soulShotCount = (short) set.getInteger("soulshot_count", 0);
+		spiritShotCount = (short) set.getInteger("spiritshot_count", 0);
 		ssRate = (short) set.getInteger("ssRate", 0);
 		race = null;
 		dropherb = set.getBool("drop_herbs", false);