소스 검색

BETA: More retail like Dragon Valley:
* Reworking Necromancer of the Valley AI.
* Added herb drop for some monster.

Patch by: St3eT
Reviewed by: Adry_85, malyelfik, Zoey76
Tested by: FinalDestination
Thanks to: FinalDestination

Adry_85 12 년 전
부모
커밋
a5052c5a78

+ 7 - 6
L2J_DataPack_BETA/dist/game/data/scripts.cfg

@@ -76,6 +76,7 @@ ai/group_template/BeastFarm.java
 ai/group_template/Chests.java
 ai/group_template/Chimeras.java
 ai/group_template/DenOfEvil.java
+ai/group_template/DragonValley.java
 ai/group_template/EnergySeeds.java
 ai/group_template/EvasGiftBoxes.java
 ai/group_template/FairyTrees.java
@@ -126,7 +127,6 @@ ai/individual/Keltas.java
 ai/individual/Knoriks.java
 ai/individual/Lindvior.java
 ai/individual/NaiaLock.java
-ai/individual/NecromancerValley.java
 ai/individual/Orfen.java
 ai/individual/OutpostCaptain.java
 ai/individual/QueenAnt.java
@@ -269,21 +269,22 @@ village_master/orc_occupation_change_2/__init__.py
 village_master/FirstClassTransferTalk/FirstClassTransferTalk.java
 
 # Instance Dungeons Section
-instances/DarkCloudMansion/DarkCloudMansion.java
 instances/CrystalCaverns/CrystalCaverns.java
+instances/DarkCloudMansion/DarkCloudMansion.java
 instances/DemonPrinceFloor/DemonPrinceFloor.java
+#instances/DisciplesNecropolisPast/DisciplesNecropolisPast.java
+instances/FinalEmperialTomb/FinalEmperialTomb.java
 instances/HellboundTown/HellboundTown.java
 instances/HideoutOfTheDawn/HideoutOfTheDawn.java
 instances/Kamaloka/Kamaloka.java
-instances/Pailaka/PailakaSongOfIceAndFire.java
+instances/NornilsGarden/NornilsGarden.java
 instances/Pailaka/PailakaDevilsLegacy.java
+instances/Pailaka/PailakaSongOfIceAndFire.java
 instances/RankuFloor/RankuFloor.java
 instances/SanctumOftheLordsOfDawn/SanctumOftheLordsOfDawn.java
 instances/SecretArea/SecretArea.java
-instances/SeedOfInfinity/HallOfSuffering.java
 instances/SeedOfDestruction/Stage1.java
-instances/NornilsGarden/NornilsGarden.java
-instances/FinalEmperialTomb/FinalEmperialTomb.java
+instances/SeedOfInfinity/HallOfSuffering.java
 
 # Hellbound Section
 hellbound/Engine.java

+ 158 - 0
L2J_DataPack_BETA/dist/game/data/scripts/ai/group_template/DragonValley.java

@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2004-2013 L2J DataPack
+ * 
+ * This file is part of L2J DataPack.
+ * 
+ * L2J DataPack is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * L2J DataPack is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package ai.group_template;
+
+import ai.npc.AbstractNpcAI;
+
+import com.l2jserver.gameserver.ai.CtrlIntention;
+import com.l2jserver.gameserver.datatables.SpawnTable;
+import com.l2jserver.gameserver.model.L2Spawn;
+import com.l2jserver.gameserver.model.actor.L2Attackable;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.L2Playable;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.holders.SkillHolder;
+import com.l2jserver.gameserver.util.Util;
+
+/**
+ * Dragon Valley AI.
+ * @author St3eT
+ */
+public class DragonValley extends AbstractNpcAI
+{
+	// NPC
+	private static final int NECROMANCER_OF_THE_VALLEY = 22858;
+	private static final int EXPLODING_ORC_GHOST = 22818;
+	private static final int WRATHFUL_ORC_GHOST = 22819;
+	private static final int[] HERB_DROP =
+	{
+		22822, // Drakos Warrior
+		22823, // Drakos Assassin
+		22824, // Drakos Guardian
+		22825, // Giant Scorpion Bones
+		22826, // Scorpion Bones
+		22827, // Batwing Drake
+		22828, // Parasitic Leech
+		22829, // Emerald Drake
+		22830, // Gem Dragon
+		22831, // Dragon Tracker of the Valley
+		22832, // Dragon Scout of the Valley
+		22833, // Sand Drake Tracker
+		22834, // Dust Dragon Tracker
+		22860, // Hungry Parasitic Leech
+		22861, // Hard Scorpion Bones
+		22862, // Drakos Hunter
+	};
+	
+	// Skill
+	private static SkillHolder SELF_DESTRUCTION = new SkillHolder(6850, 1);
+	
+	private DragonValley(String name, String descr)
+	{
+		super(name, descr);
+		addAttackId(NECROMANCER_OF_THE_VALLEY);
+		addKillId(NECROMANCER_OF_THE_VALLEY);
+		addKillId(HERB_DROP);
+		addSpawnId(EXPLODING_ORC_GHOST);
+		addSpawnId(HERB_DROP);
+		
+		for (int npcId : HERB_DROP)
+		{
+			for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(npcId))
+			{
+				onSpawn(spawn.getLastSpawn());
+			}
+		}
+		
+		for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(NECROMANCER_OF_THE_VALLEY))
+		{
+			onSpawn(spawn.getLastSpawn());
+		}
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		if (event.equalsIgnoreCase("SelfDestruction") && !npc.isDead())
+		{
+			npc.abortAttack();
+			npc.disableCoreAI(true);
+			npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
+			npc.doCast(SELF_DESTRUCTION.getSkill());
+		}
+		return super.onAdvEvent(event, npc, player);
+	}
+	
+	@Override
+	public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
+	{
+		L2Attackable mob = (L2Attackable) npc;
+		if (Util.contains(HERB_DROP, npc.getNpcId()) && mob.isSweepActive())
+		{
+			((L2Attackable) npc).dropItem(killer, getRandom(8604, 8605), 1);
+		}
+		else if (npc.getNpcId() == NECROMANCER_OF_THE_VALLEY)
+		{
+			spawnGhost(npc, killer, isSummon, 20);
+		}
+		return super.onKill(npc, killer, isSummon);
+	}
+	
+	@Override
+	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
+	{
+		spawnGhost(npc, attacker, isSummon, 1);
+		return super.onAttack(npc, attacker, damage, isSummon);
+	}
+	
+	@Override
+	public String onSpawn(L2Npc npc)
+	{
+		((L2Attackable) npc).setOnKillDelay(0);
+		if (npc.getNpcId() == EXPLODING_ORC_GHOST)
+		{
+			startQuestTimer("SelfDestruction", 3000, npc, null);
+		}
+		return super.onSpawn(npc);
+	}
+	
+	private void spawnGhost(L2Npc npc, L2PcInstance player, boolean isSummon, int chance)
+	{
+		if ((npc.getScriptValue() < 2) && (getRandom(100) < chance))
+		{
+			int val = npc.getScriptValue();
+			final L2Playable attacker = isSummon ? player.getSummon() : player;
+			final L2Attackable Ghost1 = (L2Attackable) addSpawn(getRandom(EXPLODING_ORC_GHOST, WRATHFUL_ORC_GHOST), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);
+			attackPlayer(Ghost1, attacker);
+			val++;
+			if ((val < 2) && (getRandom(100) < 10))
+			{
+				final L2Attackable Ghost2 = (L2Attackable) addSpawn(getRandom(EXPLODING_ORC_GHOST, WRATHFUL_ORC_GHOST), npc.getX(), npc.getY(), npc.getZ() + 20, npc.getHeading(), false, 0, false);
+				attackPlayer(Ghost2, attacker);
+				val++;
+			}
+			npc.setScriptValue(val);
+		}
+	}
+	
+	public static void main(String[] args)
+	{
+		new DragonValley(DragonValley.class.getSimpleName(), "ai");
+	}
+}

+ 0 - 90
L2J_DataPack_BETA/dist/game/data/scripts/ai/individual/NecromancerValley.java

@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2004-2013 L2J DataPack
- * 
- * This file is part of L2J DataPack.
- * 
- * L2J DataPack is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * L2J DataPack is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package ai.individual;
-
-import ai.npc.AbstractNpcAI;
-
-import com.l2jserver.gameserver.ai.CtrlIntention;
-import com.l2jserver.gameserver.model.actor.L2Attackable;
-import com.l2jserver.gameserver.model.actor.L2Character;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-
-/**
- * Necromancer of the Valley AI.
- * @author Micr0, improved by Adry_85
- */
-public class NecromancerValley extends AbstractNpcAI
-{
-	private static final int NECROMANCER = 22858;
-	private static final int EXPLODING_ORC_GHOST = 22818;
-	private static final int WRATHFUL_ORC_GHOST = 22819;
-	
-	private NecromancerValley(String name, String descr)
-	{
-		super(name, descr);
-		addAttackId(NECROMANCER);
-		addKillId(NECROMANCER);
-	}
-	
-	@Override
-	public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
-	{
-		if (getRandom(100) < 20)
-		{
-			L2Character attacker = isSummon ? killer.getSummon() : killer;
-			L2Attackable Orc = (L2Attackable) addSpawn(EXPLODING_ORC_GHOST, npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);
-			Orc.setRunning();
-			Orc.addDamageHate(attacker, 0, 600);
-			Orc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
-			L2Attackable Ork2 = (L2Attackable) addSpawn(WRATHFUL_ORC_GHOST, npc.getX(), npc.getY(), npc.getZ() + 20, npc.getHeading(), false, 0, false);
-			Ork2.setRunning();
-			Ork2.addDamageHate(attacker, 0, 600);
-			Ork2.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
-			
-		}
-		
-		return super.onKill(npc, killer, isSummon);
-	}
-	
-	@Override
-	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
-	{
-		if (getRandom(100) < 1)
-		{
-			L2Character player = isSummon ? attacker.getSummon() : attacker;
-			L2Attackable Orc = (L2Attackable) addSpawn(EXPLODING_ORC_GHOST, npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);
-			Orc.setRunning();
-			Orc.addDamageHate(player, 0, 600);
-			Orc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
-			L2Attackable Ork2 = (L2Attackable) addSpawn(WRATHFUL_ORC_GHOST, npc.getX(), npc.getY(), npc.getZ() + 20, npc.getHeading(), false, 0, false);
-			Ork2.setRunning();
-			Ork2.addDamageHate(player, 0, 600);
-			Ork2.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
-			
-		}
-		
-		return super.onAttack(npc, attacker, damage, isSummon);
-	}
-	
-	public static void main(String[] args)
-	{
-		new NecromancerValley(NecromancerValley.class.getSimpleName(), "ai");
-	}
-}

+ 2 - 2
L2J_DataPack_BETA/dist/sql/game/npc.sql

@@ -4915,7 +4915,7 @@ INSERT INTO `npc` VALUES
 (22812, 22812, "Boom Golem", 0, "", 0, "LineageMonster.big_boom_e", 6, 13, 72, "male", "L2Monster", 40, 2540.15331, 1410, 8.5, 3, 40, 43, 30, 21, 20, 20, 17281, 1671, 731.52506, 305.35947, 499.53679, 223.44881, 253, 4, 333, 0, 0, 0, 48, 160, 1, 1),
 (22813, 22813, "Demon's Banquet", 0, "", 0, "LineageMonster.skeleton", 11, 25, 80, "male", "L2Monster", 40, 3289.87341, 1523.77049, 8.5, 3, 40, 43, 30, 21, 20, 20, 0, 0, 962.52465, 341.42011, 482.95329, 227.47114, 253, 4, 333, 946, 945, 0, 110, 180, 0, 1),
 (22814, 22814, "Demon's Banquet", 0, "", 0, "LineageMonster.skeleton", 11, 25, 80, "male", "L2Monster", 40, 3289.87341, 1523.77049, 8.5, 3, 40, 43, 30, 21, 20, 20, 0, 0, 962.52465, 341.42011, 482.95329, 227.47114, 253, 4, 333, 946, 945, 0, 110, 180, 0, 1),
-(22815, 22815, "Drakos", 0, "", 0, "LineageMonster4.Death_slayer_080p", 16, 27.2, 80, "male", "L2Monster", 40, 3289.87341, 1523.77049, 8.5, 3, 40, 43, 30, 21, 20, 20, 41310, 4436, 962.52465, 341.42011, 482.95329, 227.47114, 253, 4, 333, 13985, 13986, 0, 64, 200, 0, 1),
+(22815, 22815, "Drakos", 0, "", 0, "LineageMonster4.Death_slayer_080p", 16, 27.2, 80, "male", "L2Monster", 40, 3289.87341, 1523.77049, 8.5, 3, 40, 43, 30, 21, 20, 20, 41310, 4436, 962.52465, 341.42011, 482.95329, 227.47114, 253, 4, 333, 13985, 13986, 0, 64, 200, 1, 1),
 (22816, 22816, "Maluk Maiden of the Valley", 0, "", 0, "LineageMonster3.Succubus_Raid_a", 12, 30.7, 81, "female", "L2Monster", 40, 3462.02531, 1554.91803, 8.5, 3, 40, 43, 30, 21, 20, 20, 25215, 2792, 1003.92156, 345.88235, 500.49337, 229.99035, 253, 4, 333, 0, 0, 0, 110, 180, 0, 1),
 (22817, 22817, "Maluk Summoner of the Valley", 0, "", 0, "LineageMonster4.death_scout_110p_a", 18, 27.5, 82, "female", "L2Monster", 40, 3643.67088, 1586.06557, 8.5, 3, 40, 43, 30, 21, 20, 20, 26483, 2895, 1046.29629, 349.70760, 519.15504, 232.95944, 253, 4, 333, 0, 0, 0, 110, 180, 0, 1),
 (22818, 22818, "Exploding Orc Ghost", 0, "", 0, "LineageMonster3.zombie_enlisted_man", 17, 22.3, 81, "male", "L2Monster", 40, 3462.02531, 1554.91803, 8.5, 3, 40, 43, 30, 21, 20, 20, 25020, 2771, 1003.92156, 345.88235, 500.49337, 229.99035, 253, 4, 333, 0, 0, 0, 110, 180, 0, 1),
@@ -4958,7 +4958,7 @@ INSERT INTO `npc` VALUES
 (22855, 22855, "Bloody Berserker", 0, "", 0, "LineageMonster5.leader_anakazel_low_a_130p", 30, 43, 86, "male", "L2Monster", 40, 333456.32911, 1712.29508, 8.5, 3, 40, 43, 30, 21, 20, 20, 614011, 62855, 10625.23809, 585.14285, 5160.4876, 584.07494, 253, 4, 333, 0, 0, 0, 110, 180, 0, 1),
 (22856, 22856, "Bloody Karinness", 0, "", 0, "LineageMonster5.leader_anakazel_mid_a_130p", 18, 38, 86, "female", "L2Monster", 40, 333456.32911, 1712.29508, 8.5, 3, 40, 43, 30, 21, 20, 20, 614011, 62855, 10625.23809, 585.14285, 5160.4876, 584.07494, 253, 4, 333, 0, 0, 0, 110, 180, 0, 1),
 (22857, 22857, "Knoriks", 0, "Land Dragon's Patroller", 0, "LineageMonster6.transform_clanicus", 20, 42, 85, "male", "L2Monster", 40, 334639.87341, 1680.32786, 8.5, 3, 40, 43, 30, 21, 20, 20, 3301929, 348153, 10023.46743, 578.73563, 4898.28788, 578.01017, 253, 4, 333, 0, 0, 0, 54, 180, 0, 1),
-(22858, 22858, "Necromancer of the Valley", 0, "", 0, "LineageMonster4.floating_skeleton_50p", 16, 45, 82, "male", "L2Monster", 40, 3643.67088, 1586.06557, 8.5, 3, 40, 43, 30, 21, 20, 20, 26974, 2949, 1046.29629, 349.70760, 519.15504, 232.95944, 253, 4, 333, 0, 0, 0, 45, 300, 0, 1),
+(22858, 22858, "Necromancer of the Valley", 0, "", 0, "LineageMonster4.floating_skeleton_50p", 16, 45, 82, "male", "L2Monster", 40, 3643.67088, 1586.06557, 8.5, 3, 40, 43, 30, 21, 20, 20, 26974, 2949, 1046.29629, 349.70760, 519.15504, 232.95944, 253, 4, 333, 0, 0, 0, 45, 300, 1, 1),
 (22859, 22859, "Howl", 0, "Tracker", 0, "LineageMonster2.eligor", 21, 35, 81, "male", "L2Monster", 40, 3462.02531, 1554.91803, 8.5, 3, 40, 43, 30, 21, 20, 20, 25020, 2771, 1003.92156, 345.88235, 500.49337, 229.99035, 253, 4, 333, 0, 0, 0, 140, 200, 0, 1),
 (22860, 22860, "Hungry Parasitic Leech", 0, "", 0, "LineageMonster.giant_leech_60p", 30, 16, 82, "male", "L2Monster", 40, 18801.26582, 1586.06557, 8.5, 3, 40, 43, 30, 21, 20, 20, 289372, 30117, 10122.31968, 559.64912, 5031.00854, 558.91093, 253, 4, 333, 0, 0, 0, 50, 50, 0, 1),
 (22861, 22861, "Hard Scorpion Bones", 0, "", 0, "LineageMonster2.scorpion", 28, 66, 83, "male", "L2Monster", 40, 56202.53164, 1617.21311, 8.5, 3, 40, 43, 30, 21, 20, 20, 486444, 52534, 10551.35658, 566.27906, 5640.88861, 565.19252, 253, 4, 333, 0, 0, 0, 37, 170, 0, 1),