diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html new file mode 100644 index 0000000000..85bfcfb653 --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html @@ -0,0 +1,7 @@ +Undercover Agent Khamin:
+Our scouts have brought information that Jisra can be seen only short periods of time. In 30 minutes before every even hour a secret pathway is opened, it won't be closed for 30 minutes. If you follow the way and kill Escorts, Escort Captain Cooca will come to find out what's going on.
+Keep in mind you have to kill Cooca first. If you can defeat him, you can defeat Jisra.
+Cooca has cast a powerful protection spell on Jisra, so without killing Cooca you most likely fail to deal with Jisra.
+Our mages say that after Cooca's death his spell will be unleashed and sweep away from the camp everybody who wasn't in the combat. So good luck.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html new file mode 100644 index 0000000000..474d255199 --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html @@ -0,0 +1,6 @@ +Undercover Agent Khamin:
+Nobody can go through the secret pathway now.
+It's too dangerous to let the way be opened all the time, our enemies are surely going to see it and block it, or make an ambush.
+Come back later when I can open the pathway safely. + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/34173.html b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/34173.html new file mode 100644 index 0000000000..c52812aa78 --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/34173.html @@ -0,0 +1,8 @@ +Undercover Agent Khamin:
+Sel Mahums have occupied Abandoned Camp.
+The camp is guarded by Escorts, their leaders are an elite warrior called Jisra and Escort Captain Cooca. The bastards are getting very strong and dangerous.
+I have to ask for your help. We need to sound out the situation, so do it using a secret pathway.
+Be careful,the camp is guarded not only by the men but also powerful magic that can teleport you anywhere. Cooca is the one who cast it but even if you kill him spell won't be broken. So you aren't going to come back the same way you travel there,that's why you need to prepare a Scroll of Escape.
+ + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java new file mode 100644 index 0000000000..60a82e6396 --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java @@ -0,0 +1,188 @@ +package ai.bosses.Kuka; + +import org.l2jmobius.commons.threads.ThreadPool; +import org.l2jmobius.commons.time.SchedulingPattern; +import org.l2jmobius.gameserver.data.SpawnTable; +import org.l2jmobius.gameserver.data.xml.NpcData; +import org.l2jmobius.gameserver.data.xml.SkillData; +import org.l2jmobius.gameserver.enums.RaidBossStatus; +import org.l2jmobius.gameserver.instancemanager.DBSpawnManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Spawn; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; +import org.l2jmobius.gameserver.model.skill.BuffInfo; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.NoRestartZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import ai.AbstractNpcAI; + +/** + * @author Symb1OS + */ +public class Kuka extends AbstractNpcAI +{ + // NPCs + private static final int KHAMIN = 34173; + private static final int JISRA = 25925; + private static final int KUKA = 25926; + // Item + private static final int PROOF_OF_COURAGE = 48185; + // Locations + private static final Location KUKA_LOC = new Location(-58974, 135294, -2392); + private static final Location JISRA_LOC = new Location(-60496, 137347, -2392); + private static final Location TELEPORT_START_LOC = new Location(-57406, 136429, -2396); + private static final Location TELEPORT_OUT_LOC = new Location(-48363, 140230, -2947); + // Zone + private static final NoRestartZone ZONE = ZoneManager.getInstance().getZoneByName("kuka_no_restart", NoRestartZone.class); + // Misc + private static final String ENTER_ZONE_PATTERN = "30-50 */2 * * *"; + private static final String KUKA_RESPAWN_PATTERN = "50 */2 * * *"; + private static final String KUKA_DESPAWN_PATTERN = "0 */1 * * *"; + private static final String JISRA_DESPAWN_PATTERN = "30 */1 * * *"; + private final SchedulingPattern _enterZonePattern; + private final SchedulingPattern _respawnKukaPattern; + private final SchedulingPattern _despawnKukaPattern; + private final SchedulingPattern _despawnJisraPattern; + + private Kuka() + { + addFirstTalkId(KHAMIN); + addEnterZoneId(ZONE.getId()); + // addAttackId(JISRA); + addKillId(KUKA, JISRA); + + _enterZonePattern = new SchedulingPattern(ENTER_ZONE_PATTERN); + _respawnKukaPattern = new SchedulingPattern(KUKA_RESPAWN_PATTERN); + _despawnKukaPattern = new SchedulingPattern(KUKA_DESPAWN_PATTERN); + _despawnJisraPattern = new SchedulingPattern(JISRA_DESPAWN_PATTERN); + + ThreadPool.scheduleAtFixedRate(() -> onSpawn(KUKA, KUKA_LOC, _respawnKukaPattern), _respawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(KUKA), _despawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(JISRA), _despawnJisraPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + } + + @Override + public String onEvent(String event, Npc npc, Player player) + { + if ("teleport".equals(event)) + { + if (canMoveToZone(player)) + { + player.teleToLocation(TELEPORT_START_LOC); + return null; + } + + return "34173-2.html"; + } + + return event; + } + + // @Override + // public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon) + // { + // // TODO: Jisra casting self buff. + // return super.onAttack(npc, attacker, damage, isSummon); + // } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final int npcId = npc.getTemplate().getId(); + if (npcId == KUKA) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_ONLY_YOU_NCAN_CHALLENGE_JISRA, 2, 5000, true, killer.getName())); + killer.getEffectList().add(new BuffInfo(npc, killer, SkillData.getInstance().getSkill(PROOF_OF_COURAGE, 1), false, null, null)); + + for (Creature creature : ZONE.getCharactersInside()) + { + if (creature.isPlayer() && !creature.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + } + } + + final Npc jisra = onSpawn(JISRA, JISRA_LOC, null); + addAttackPlayerDesire(jisra, killer); + + } + else if (npcId == JISRA) + { + final Npc jisra = DBSpawnManager.getInstance().getNpc(JISRA); + DBSpawnManager.getInstance().deleteSpawn(jisra.getSpawn(), true); + jisra.deleteMe(); + } + + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + if (creature.isPlayer() && !canMoveToZone((Player) creature)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + creature.sendMessage("Nobody can go through the secret pathway now."); + } + + return super.onEnterZone(creature, zone); + } + + private void onDespawn(int bossId) + { + for (Spawn spawn : SpawnTable.getInstance().getSpawns(bossId)) + { + for (Npc monster : spawn.getSpawnedNpcs()) + { + if (!monster.isDead()) + { + DBSpawnManager.getInstance().deleteSpawn(spawn, true); + monster.deleteMe(); + } + } + } + } + + private Npc onSpawn(int id, Location location, SchedulingPattern respawnPattern) + { + final NpcTemplate template = NpcData.getInstance().getTemplate(id); + try + { + if (template != null) + { + final Spawn spawn = new Spawn(template); + spawn.setXYZ(location); + spawn.setRespawnPattern(respawnPattern); + return DBSpawnManager.getInstance().addNewSpawn(spawn, true); + } + } + catch (Exception e) + { + LOGGER.warning(getClass().getSimpleName() + ": Caused an exception " + e.getMessage()); + } + + return null; + } + + private boolean isAlive(int npc) + { + final RaidBossStatus status = DBSpawnManager.getInstance().getStatus(npc); + return (status == RaidBossStatus.ALIVE) || (status == RaidBossStatus.COMBAT); + } + + private boolean canMoveToZone(Player player) + { + return _enterZonePattern.match(System.currentTimeMillis()) || isAlive(KUKA) || player.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE); + } + + public static void main(String[] args) + { + new Kuka(); + } +} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/48100-48199.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/48100-48199.xml index 4a6a6373f9..1ea0a0c588 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/48100-48199.xml +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/48100-48199.xml @@ -691,6 +691,7 @@ icon.skill30530 + 600 A1 diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/zones/no_restart.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/zones/no_restart.xml index f8a99549c7..7c76e33d55 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/zones/no_restart.xml +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/zones/no_restart.xml @@ -1,6 +1,13 @@ + + + + + + + diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html new file mode 100644 index 0000000000..85bfcfb653 --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html @@ -0,0 +1,7 @@ +Undercover Agent Khamin:
+Our scouts have brought information that Jisra can be seen only short periods of time. In 30 minutes before every even hour a secret pathway is opened, it won't be closed for 30 minutes. If you follow the way and kill Escorts, Escort Captain Cooca will come to find out what's going on.
+Keep in mind you have to kill Cooca first. If you can defeat him, you can defeat Jisra.
+Cooca has cast a powerful protection spell on Jisra, so without killing Cooca you most likely fail to deal with Jisra.
+Our mages say that after Cooca's death his spell will be unleashed and sweep away from the camp everybody who wasn't in the combat. So good luck.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html new file mode 100644 index 0000000000..474d255199 --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html @@ -0,0 +1,6 @@ +Undercover Agent Khamin:
+Nobody can go through the secret pathway now.
+It's too dangerous to let the way be opened all the time, our enemies are surely going to see it and block it, or make an ambush.
+Come back later when I can open the pathway safely. + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/34173.html b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/34173.html new file mode 100644 index 0000000000..c52812aa78 --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/34173.html @@ -0,0 +1,8 @@ +Undercover Agent Khamin:
+Sel Mahums have occupied Abandoned Camp.
+The camp is guarded by Escorts, their leaders are an elite warrior called Jisra and Escort Captain Cooca. The bastards are getting very strong and dangerous.
+I have to ask for your help. We need to sound out the situation, so do it using a secret pathway.
+Be careful,the camp is guarded not only by the men but also powerful magic that can teleport you anywhere. Cooca is the one who cast it but even if you kill him spell won't be broken. So you aren't going to come back the same way you travel there,that's why you need to prepare a Scroll of Escape.
+ + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java new file mode 100644 index 0000000000..60a82e6396 --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java @@ -0,0 +1,188 @@ +package ai.bosses.Kuka; + +import org.l2jmobius.commons.threads.ThreadPool; +import org.l2jmobius.commons.time.SchedulingPattern; +import org.l2jmobius.gameserver.data.SpawnTable; +import org.l2jmobius.gameserver.data.xml.NpcData; +import org.l2jmobius.gameserver.data.xml.SkillData; +import org.l2jmobius.gameserver.enums.RaidBossStatus; +import org.l2jmobius.gameserver.instancemanager.DBSpawnManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Spawn; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; +import org.l2jmobius.gameserver.model.skill.BuffInfo; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.NoRestartZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import ai.AbstractNpcAI; + +/** + * @author Symb1OS + */ +public class Kuka extends AbstractNpcAI +{ + // NPCs + private static final int KHAMIN = 34173; + private static final int JISRA = 25925; + private static final int KUKA = 25926; + // Item + private static final int PROOF_OF_COURAGE = 48185; + // Locations + private static final Location KUKA_LOC = new Location(-58974, 135294, -2392); + private static final Location JISRA_LOC = new Location(-60496, 137347, -2392); + private static final Location TELEPORT_START_LOC = new Location(-57406, 136429, -2396); + private static final Location TELEPORT_OUT_LOC = new Location(-48363, 140230, -2947); + // Zone + private static final NoRestartZone ZONE = ZoneManager.getInstance().getZoneByName("kuka_no_restart", NoRestartZone.class); + // Misc + private static final String ENTER_ZONE_PATTERN = "30-50 */2 * * *"; + private static final String KUKA_RESPAWN_PATTERN = "50 */2 * * *"; + private static final String KUKA_DESPAWN_PATTERN = "0 */1 * * *"; + private static final String JISRA_DESPAWN_PATTERN = "30 */1 * * *"; + private final SchedulingPattern _enterZonePattern; + private final SchedulingPattern _respawnKukaPattern; + private final SchedulingPattern _despawnKukaPattern; + private final SchedulingPattern _despawnJisraPattern; + + private Kuka() + { + addFirstTalkId(KHAMIN); + addEnterZoneId(ZONE.getId()); + // addAttackId(JISRA); + addKillId(KUKA, JISRA); + + _enterZonePattern = new SchedulingPattern(ENTER_ZONE_PATTERN); + _respawnKukaPattern = new SchedulingPattern(KUKA_RESPAWN_PATTERN); + _despawnKukaPattern = new SchedulingPattern(KUKA_DESPAWN_PATTERN); + _despawnJisraPattern = new SchedulingPattern(JISRA_DESPAWN_PATTERN); + + ThreadPool.scheduleAtFixedRate(() -> onSpawn(KUKA, KUKA_LOC, _respawnKukaPattern), _respawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(KUKA), _despawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(JISRA), _despawnJisraPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + } + + @Override + public String onEvent(String event, Npc npc, Player player) + { + if ("teleport".equals(event)) + { + if (canMoveToZone(player)) + { + player.teleToLocation(TELEPORT_START_LOC); + return null; + } + + return "34173-2.html"; + } + + return event; + } + + // @Override + // public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon) + // { + // // TODO: Jisra casting self buff. + // return super.onAttack(npc, attacker, damage, isSummon); + // } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final int npcId = npc.getTemplate().getId(); + if (npcId == KUKA) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_ONLY_YOU_NCAN_CHALLENGE_JISRA, 2, 5000, true, killer.getName())); + killer.getEffectList().add(new BuffInfo(npc, killer, SkillData.getInstance().getSkill(PROOF_OF_COURAGE, 1), false, null, null)); + + for (Creature creature : ZONE.getCharactersInside()) + { + if (creature.isPlayer() && !creature.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + } + } + + final Npc jisra = onSpawn(JISRA, JISRA_LOC, null); + addAttackPlayerDesire(jisra, killer); + + } + else if (npcId == JISRA) + { + final Npc jisra = DBSpawnManager.getInstance().getNpc(JISRA); + DBSpawnManager.getInstance().deleteSpawn(jisra.getSpawn(), true); + jisra.deleteMe(); + } + + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + if (creature.isPlayer() && !canMoveToZone((Player) creature)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + creature.sendMessage("Nobody can go through the secret pathway now."); + } + + return super.onEnterZone(creature, zone); + } + + private void onDespawn(int bossId) + { + for (Spawn spawn : SpawnTable.getInstance().getSpawns(bossId)) + { + for (Npc monster : spawn.getSpawnedNpcs()) + { + if (!monster.isDead()) + { + DBSpawnManager.getInstance().deleteSpawn(spawn, true); + monster.deleteMe(); + } + } + } + } + + private Npc onSpawn(int id, Location location, SchedulingPattern respawnPattern) + { + final NpcTemplate template = NpcData.getInstance().getTemplate(id); + try + { + if (template != null) + { + final Spawn spawn = new Spawn(template); + spawn.setXYZ(location); + spawn.setRespawnPattern(respawnPattern); + return DBSpawnManager.getInstance().addNewSpawn(spawn, true); + } + } + catch (Exception e) + { + LOGGER.warning(getClass().getSimpleName() + ": Caused an exception " + e.getMessage()); + } + + return null; + } + + private boolean isAlive(int npc) + { + final RaidBossStatus status = DBSpawnManager.getInstance().getStatus(npc); + return (status == RaidBossStatus.ALIVE) || (status == RaidBossStatus.COMBAT); + } + + private boolean canMoveToZone(Player player) + { + return _enterZonePattern.match(System.currentTimeMillis()) || isAlive(KUKA) || player.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE); + } + + public static void main(String[] args) + { + new Kuka(); + } +} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/48100-48199.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/48100-48199.xml index fbf89f1c2a..05e6688fcc 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/48100-48199.xml +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/48100-48199.xml @@ -691,6 +691,7 @@ icon.skill30530 + 600 A1 diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/zones/no_restart.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/zones/no_restart.xml index 7a58f55ca9..0db0cdf5d9 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/zones/no_restart.xml +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/zones/no_restart.xml @@ -1,6 +1,13 @@ + + + + + + + diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html new file mode 100644 index 0000000000..85bfcfb653 --- /dev/null +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html @@ -0,0 +1,7 @@ +Undercover Agent Khamin:
+Our scouts have brought information that Jisra can be seen only short periods of time. In 30 minutes before every even hour a secret pathway is opened, it won't be closed for 30 minutes. If you follow the way and kill Escorts, Escort Captain Cooca will come to find out what's going on.
+Keep in mind you have to kill Cooca first. If you can defeat him, you can defeat Jisra.
+Cooca has cast a powerful protection spell on Jisra, so without killing Cooca you most likely fail to deal with Jisra.
+Our mages say that after Cooca's death his spell will be unleashed and sweep away from the camp everybody who wasn't in the combat. So good luck.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html new file mode 100644 index 0000000000..474d255199 --- /dev/null +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html @@ -0,0 +1,6 @@ +Undercover Agent Khamin:
+Nobody can go through the secret pathway now.
+It's too dangerous to let the way be opened all the time, our enemies are surely going to see it and block it, or make an ambush.
+Come back later when I can open the pathway safely. + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/34173.html b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/34173.html new file mode 100644 index 0000000000..c52812aa78 --- /dev/null +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/34173.html @@ -0,0 +1,8 @@ +Undercover Agent Khamin:
+Sel Mahums have occupied Abandoned Camp.
+The camp is guarded by Escorts, their leaders are an elite warrior called Jisra and Escort Captain Cooca. The bastards are getting very strong and dangerous.
+I have to ask for your help. We need to sound out the situation, so do it using a secret pathway.
+Be careful,the camp is guarded not only by the men but also powerful magic that can teleport you anywhere. Cooca is the one who cast it but even if you kill him spell won't be broken. So you aren't going to come back the same way you travel there,that's why you need to prepare a Scroll of Escape.
+ + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java new file mode 100644 index 0000000000..b61e25b0d6 --- /dev/null +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java @@ -0,0 +1,188 @@ +package ai.bosses.Kuka; + +import org.l2jmobius.commons.threads.ThreadPool; +import org.l2jmobius.commons.time.SchedulingPattern; +import org.l2jmobius.gameserver.data.SpawnTable; +import org.l2jmobius.gameserver.data.xml.NpcData; +import org.l2jmobius.gameserver.data.xml.SkillData; +import org.l2jmobius.gameserver.enums.RaidBossStatus; +import org.l2jmobius.gameserver.instancemanager.DBSpawnManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Spawn; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; +import org.l2jmobius.gameserver.model.skill.BuffInfo; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.NoRestartZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import ai.AbstractNpcAI; + +/** + * @author Symb1OS + */ +public class Kuka extends AbstractNpcAI +{ + // NPCs + private static final int KHAMIN = 34173; + private static final int JISRA = 25925; + private static final int KUKA = 25926; + // Item + private static final int PROOF_OF_COURAGE = 48185; + // Locations + private static final Location KUKA_LOC = new Location(-58974, 135294, -2392); + private static final Location JISRA_LOC = new Location(-60496, 137347, -2392); + private static final Location TELEPORT_START_LOC = new Location(-57406, 136429, -2396); + private static final Location TELEPORT_OUT_LOC = new Location(-48363, 140230, -2947); + // Zone + private static final NoRestartZone ZONE = ZoneManager.getInstance().getZoneByName("kuka_no_restart", NoRestartZone.class); + // Misc + private static final String ENTER_ZONE_PATTERN = "30-50 */2 * * *"; + private static final String KUKA_RESPAWN_PATTERN = "50 */2 * * *"; + private static final String KUKA_DESPAWN_PATTERN = "0 */1 * * *"; + private static final String JISRA_DESPAWN_PATTERN = "30 */1 * * *"; + private final SchedulingPattern _enterZonePattern; + private final SchedulingPattern _respawnKukaPattern; + private final SchedulingPattern _despawnKukaPattern; + private final SchedulingPattern _despawnJisraPattern; + + private Kuka() + { + addFirstTalkId(KHAMIN); + addEnterZoneId(ZONE.getId()); + // addAttackId(JISRA); + addKillId(KUKA, JISRA); + + _enterZonePattern = new SchedulingPattern(ENTER_ZONE_PATTERN); + _respawnKukaPattern = new SchedulingPattern(KUKA_RESPAWN_PATTERN); + _despawnKukaPattern = new SchedulingPattern(KUKA_DESPAWN_PATTERN); + _despawnJisraPattern = new SchedulingPattern(JISRA_DESPAWN_PATTERN); + + ThreadPool.scheduleAtFixedRate(() -> onSpawn(KUKA, KUKA_LOC, _respawnKukaPattern), _respawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(KUKA), _despawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(JISRA), _despawnJisraPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + } + + @Override + public String onEvent(String event, Npc npc, Player player) + { + if ("teleport".equals(event)) + { + if (canMoveToZone(player)) + { + player.teleToLocation(TELEPORT_START_LOC); + return null; + } + + return "34173-2.html"; + } + + return event; + } + + // @Override + // public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon) + // { + // // TODO: Jisra casting self buff. + // return super.onAttack(npc, attacker, damage, isSummon); + // } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final int npcId = npc.getTemplate().getId(); + if (npcId == KUKA) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_ONLY_YOU_CAN_CHALLENGE_JISRA, 2, 5000, true, killer.getName())); + killer.getEffectList().add(new BuffInfo(npc, killer, SkillData.getInstance().getSkill(PROOF_OF_COURAGE, 1), false, null, null)); + + for (Creature creature : ZONE.getCharactersInside()) + { + if (creature.isPlayer() && !creature.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + } + } + + final Npc jisra = onSpawn(JISRA, JISRA_LOC, null); + addAttackPlayerDesire(jisra, killer); + + } + else if (npcId == JISRA) + { + final Npc jisra = DBSpawnManager.getInstance().getNpc(JISRA); + DBSpawnManager.getInstance().deleteSpawn(jisra.getSpawn(), true); + jisra.deleteMe(); + } + + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + if (creature.isPlayer() && !canMoveToZone((Player) creature)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + creature.sendMessage("Nobody can go through the secret pathway now."); + } + + return super.onEnterZone(creature, zone); + } + + private void onDespawn(int bossId) + { + for (Spawn spawn : SpawnTable.getInstance().getSpawns(bossId)) + { + for (Npc monster : spawn.getSpawnedNpcs()) + { + if (!monster.isDead()) + { + DBSpawnManager.getInstance().deleteSpawn(spawn, true); + monster.deleteMe(); + } + } + } + } + + private Npc onSpawn(int id, Location location, SchedulingPattern respawnPattern) + { + final NpcTemplate template = NpcData.getInstance().getTemplate(id); + try + { + if (template != null) + { + final Spawn spawn = new Spawn(template); + spawn.setXYZ(location); + spawn.setRespawnPattern(respawnPattern); + return DBSpawnManager.getInstance().addNewSpawn(spawn, true); + } + } + catch (Exception e) + { + LOGGER.warning(getClass().getSimpleName() + ": Caused an exception " + e.getMessage()); + } + + return null; + } + + private boolean isAlive(int npc) + { + final RaidBossStatus status = DBSpawnManager.getInstance().getStatus(npc); + return (status == RaidBossStatus.ALIVE) || (status == RaidBossStatus.COMBAT); + } + + private boolean canMoveToZone(Player player) + { + return _enterZonePattern.match(System.currentTimeMillis()) || isAlive(KUKA) || player.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE); + } + + public static void main(String[] args) + { + new Kuka(); + } +} diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/spawns/RaidbossSpawns.xml index 1cd80d6a5f..dfb7bb2112 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/spawns/RaidbossSpawns.xml @@ -44,7 +44,6 @@ - diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/stats/skills/48100-48199.xml b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/stats/skills/48100-48199.xml index 42a1ebc739..a627d24c4b 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/stats/skills/48100-48199.xml +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/stats/skills/48100-48199.xml @@ -691,6 +691,7 @@ icon.skill30530 + 600 A1 diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/zones/no_restart.xml b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/zones/no_restart.xml index 7a58f55ca9..0db0cdf5d9 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/zones/no_restart.xml +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/data/zones/no_restart.xml @@ -1,6 +1,13 @@ + + + + + + + diff --git a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html new file mode 100644 index 0000000000..85bfcfb653 --- /dev/null +++ b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html @@ -0,0 +1,7 @@ +Undercover Agent Khamin:
+Our scouts have brought information that Jisra can be seen only short periods of time. In 30 minutes before every even hour a secret pathway is opened, it won't be closed for 30 minutes. If you follow the way and kill Escorts, Escort Captain Cooca will come to find out what's going on.
+Keep in mind you have to kill Cooca first. If you can defeat him, you can defeat Jisra.
+Cooca has cast a powerful protection spell on Jisra, so without killing Cooca you most likely fail to deal with Jisra.
+Our mages say that after Cooca's death his spell will be unleashed and sweep away from the camp everybody who wasn't in the combat. So good luck.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html new file mode 100644 index 0000000000..474d255199 --- /dev/null +++ b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html @@ -0,0 +1,6 @@ +Undercover Agent Khamin:
+Nobody can go through the secret pathway now.
+It's too dangerous to let the way be opened all the time, our enemies are surely going to see it and block it, or make an ambush.
+Come back later when I can open the pathway safely. + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/34173.html b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/34173.html new file mode 100644 index 0000000000..c52812aa78 --- /dev/null +++ b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/34173.html @@ -0,0 +1,8 @@ +Undercover Agent Khamin:
+Sel Mahums have occupied Abandoned Camp.
+The camp is guarded by Escorts, their leaders are an elite warrior called Jisra and Escort Captain Cooca. The bastards are getting very strong and dangerous.
+I have to ask for your help. We need to sound out the situation, so do it using a secret pathway.
+Be careful,the camp is guarded not only by the men but also powerful magic that can teleport you anywhere. Cooca is the one who cast it but even if you kill him spell won't be broken. So you aren't going to come back the same way you travel there,that's why you need to prepare a Scroll of Escape.
+ + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java new file mode 100644 index 0000000000..b61e25b0d6 --- /dev/null +++ b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java @@ -0,0 +1,188 @@ +package ai.bosses.Kuka; + +import org.l2jmobius.commons.threads.ThreadPool; +import org.l2jmobius.commons.time.SchedulingPattern; +import org.l2jmobius.gameserver.data.SpawnTable; +import org.l2jmobius.gameserver.data.xml.NpcData; +import org.l2jmobius.gameserver.data.xml.SkillData; +import org.l2jmobius.gameserver.enums.RaidBossStatus; +import org.l2jmobius.gameserver.instancemanager.DBSpawnManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Spawn; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; +import org.l2jmobius.gameserver.model.skill.BuffInfo; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.NoRestartZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import ai.AbstractNpcAI; + +/** + * @author Symb1OS + */ +public class Kuka extends AbstractNpcAI +{ + // NPCs + private static final int KHAMIN = 34173; + private static final int JISRA = 25925; + private static final int KUKA = 25926; + // Item + private static final int PROOF_OF_COURAGE = 48185; + // Locations + private static final Location KUKA_LOC = new Location(-58974, 135294, -2392); + private static final Location JISRA_LOC = new Location(-60496, 137347, -2392); + private static final Location TELEPORT_START_LOC = new Location(-57406, 136429, -2396); + private static final Location TELEPORT_OUT_LOC = new Location(-48363, 140230, -2947); + // Zone + private static final NoRestartZone ZONE = ZoneManager.getInstance().getZoneByName("kuka_no_restart", NoRestartZone.class); + // Misc + private static final String ENTER_ZONE_PATTERN = "30-50 */2 * * *"; + private static final String KUKA_RESPAWN_PATTERN = "50 */2 * * *"; + private static final String KUKA_DESPAWN_PATTERN = "0 */1 * * *"; + private static final String JISRA_DESPAWN_PATTERN = "30 */1 * * *"; + private final SchedulingPattern _enterZonePattern; + private final SchedulingPattern _respawnKukaPattern; + private final SchedulingPattern _despawnKukaPattern; + private final SchedulingPattern _despawnJisraPattern; + + private Kuka() + { + addFirstTalkId(KHAMIN); + addEnterZoneId(ZONE.getId()); + // addAttackId(JISRA); + addKillId(KUKA, JISRA); + + _enterZonePattern = new SchedulingPattern(ENTER_ZONE_PATTERN); + _respawnKukaPattern = new SchedulingPattern(KUKA_RESPAWN_PATTERN); + _despawnKukaPattern = new SchedulingPattern(KUKA_DESPAWN_PATTERN); + _despawnJisraPattern = new SchedulingPattern(JISRA_DESPAWN_PATTERN); + + ThreadPool.scheduleAtFixedRate(() -> onSpawn(KUKA, KUKA_LOC, _respawnKukaPattern), _respawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(KUKA), _despawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(JISRA), _despawnJisraPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + } + + @Override + public String onEvent(String event, Npc npc, Player player) + { + if ("teleport".equals(event)) + { + if (canMoveToZone(player)) + { + player.teleToLocation(TELEPORT_START_LOC); + return null; + } + + return "34173-2.html"; + } + + return event; + } + + // @Override + // public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon) + // { + // // TODO: Jisra casting self buff. + // return super.onAttack(npc, attacker, damage, isSummon); + // } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final int npcId = npc.getTemplate().getId(); + if (npcId == KUKA) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_ONLY_YOU_CAN_CHALLENGE_JISRA, 2, 5000, true, killer.getName())); + killer.getEffectList().add(new BuffInfo(npc, killer, SkillData.getInstance().getSkill(PROOF_OF_COURAGE, 1), false, null, null)); + + for (Creature creature : ZONE.getCharactersInside()) + { + if (creature.isPlayer() && !creature.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + } + } + + final Npc jisra = onSpawn(JISRA, JISRA_LOC, null); + addAttackPlayerDesire(jisra, killer); + + } + else if (npcId == JISRA) + { + final Npc jisra = DBSpawnManager.getInstance().getNpc(JISRA); + DBSpawnManager.getInstance().deleteSpawn(jisra.getSpawn(), true); + jisra.deleteMe(); + } + + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + if (creature.isPlayer() && !canMoveToZone((Player) creature)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + creature.sendMessage("Nobody can go through the secret pathway now."); + } + + return super.onEnterZone(creature, zone); + } + + private void onDespawn(int bossId) + { + for (Spawn spawn : SpawnTable.getInstance().getSpawns(bossId)) + { + for (Npc monster : spawn.getSpawnedNpcs()) + { + if (!monster.isDead()) + { + DBSpawnManager.getInstance().deleteSpawn(spawn, true); + monster.deleteMe(); + } + } + } + } + + private Npc onSpawn(int id, Location location, SchedulingPattern respawnPattern) + { + final NpcTemplate template = NpcData.getInstance().getTemplate(id); + try + { + if (template != null) + { + final Spawn spawn = new Spawn(template); + spawn.setXYZ(location); + spawn.setRespawnPattern(respawnPattern); + return DBSpawnManager.getInstance().addNewSpawn(spawn, true); + } + } + catch (Exception e) + { + LOGGER.warning(getClass().getSimpleName() + ": Caused an exception " + e.getMessage()); + } + + return null; + } + + private boolean isAlive(int npc) + { + final RaidBossStatus status = DBSpawnManager.getInstance().getStatus(npc); + return (status == RaidBossStatus.ALIVE) || (status == RaidBossStatus.COMBAT); + } + + private boolean canMoveToZone(Player player) + { + return _enterZonePattern.match(System.currentTimeMillis()) || isAlive(KUKA) || player.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE); + } + + public static void main(String[] args) + { + new Kuka(); + } +} diff --git a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/spawns/RaidbossSpawns.xml index 7ad77943a3..e413e55907 100644 --- a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/spawns/RaidbossSpawns.xml @@ -44,7 +44,6 @@ - diff --git a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/stats/skills/48100-48199.xml b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/stats/skills/48100-48199.xml index 28d605e748..726a43a1c4 100644 --- a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/stats/skills/48100-48199.xml +++ b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/stats/skills/48100-48199.xml @@ -691,6 +691,7 @@ icon.skill30530 + 600 A1 diff --git a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/zones/no_restart.xml b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/zones/no_restart.xml index b20c987114..83210d8079 100644 --- a/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/zones/no_restart.xml +++ b/L2J_Mobius_Essence_7.1_Assassin/dist/game/data/zones/no_restart.xml @@ -1,6 +1,13 @@ + + + + + + + diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html new file mode 100644 index 0000000000..85bfcfb653 --- /dev/null +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html @@ -0,0 +1,7 @@ +Undercover Agent Khamin:
+Our scouts have brought information that Jisra can be seen only short periods of time. In 30 minutes before every even hour a secret pathway is opened, it won't be closed for 30 minutes. If you follow the way and kill Escorts, Escort Captain Cooca will come to find out what's going on.
+Keep in mind you have to kill Cooca first. If you can defeat him, you can defeat Jisra.
+Cooca has cast a powerful protection spell on Jisra, so without killing Cooca you most likely fail to deal with Jisra.
+Our mages say that after Cooca's death his spell will be unleashed and sweep away from the camp everybody who wasn't in the combat. So good luck.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html new file mode 100644 index 0000000000..474d255199 --- /dev/null +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html @@ -0,0 +1,6 @@ +Undercover Agent Khamin:
+Nobody can go through the secret pathway now.
+It's too dangerous to let the way be opened all the time, our enemies are surely going to see it and block it, or make an ambush.
+Come back later when I can open the pathway safely. + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/34173.html b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/34173.html new file mode 100644 index 0000000000..c52812aa78 --- /dev/null +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/34173.html @@ -0,0 +1,8 @@ +Undercover Agent Khamin:
+Sel Mahums have occupied Abandoned Camp.
+The camp is guarded by Escorts, their leaders are an elite warrior called Jisra and Escort Captain Cooca. The bastards are getting very strong and dangerous.
+I have to ask for your help. We need to sound out the situation, so do it using a secret pathway.
+Be careful,the camp is guarded not only by the men but also powerful magic that can teleport you anywhere. Cooca is the one who cast it but even if you kill him spell won't be broken. So you aren't going to come back the same way you travel there,that's why you need to prepare a Scroll of Escape.
+ + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java new file mode 100644 index 0000000000..b61e25b0d6 --- /dev/null +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java @@ -0,0 +1,188 @@ +package ai.bosses.Kuka; + +import org.l2jmobius.commons.threads.ThreadPool; +import org.l2jmobius.commons.time.SchedulingPattern; +import org.l2jmobius.gameserver.data.SpawnTable; +import org.l2jmobius.gameserver.data.xml.NpcData; +import org.l2jmobius.gameserver.data.xml.SkillData; +import org.l2jmobius.gameserver.enums.RaidBossStatus; +import org.l2jmobius.gameserver.instancemanager.DBSpawnManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Spawn; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; +import org.l2jmobius.gameserver.model.skill.BuffInfo; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.NoRestartZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import ai.AbstractNpcAI; + +/** + * @author Symb1OS + */ +public class Kuka extends AbstractNpcAI +{ + // NPCs + private static final int KHAMIN = 34173; + private static final int JISRA = 25925; + private static final int KUKA = 25926; + // Item + private static final int PROOF_OF_COURAGE = 48185; + // Locations + private static final Location KUKA_LOC = new Location(-58974, 135294, -2392); + private static final Location JISRA_LOC = new Location(-60496, 137347, -2392); + private static final Location TELEPORT_START_LOC = new Location(-57406, 136429, -2396); + private static final Location TELEPORT_OUT_LOC = new Location(-48363, 140230, -2947); + // Zone + private static final NoRestartZone ZONE = ZoneManager.getInstance().getZoneByName("kuka_no_restart", NoRestartZone.class); + // Misc + private static final String ENTER_ZONE_PATTERN = "30-50 */2 * * *"; + private static final String KUKA_RESPAWN_PATTERN = "50 */2 * * *"; + private static final String KUKA_DESPAWN_PATTERN = "0 */1 * * *"; + private static final String JISRA_DESPAWN_PATTERN = "30 */1 * * *"; + private final SchedulingPattern _enterZonePattern; + private final SchedulingPattern _respawnKukaPattern; + private final SchedulingPattern _despawnKukaPattern; + private final SchedulingPattern _despawnJisraPattern; + + private Kuka() + { + addFirstTalkId(KHAMIN); + addEnterZoneId(ZONE.getId()); + // addAttackId(JISRA); + addKillId(KUKA, JISRA); + + _enterZonePattern = new SchedulingPattern(ENTER_ZONE_PATTERN); + _respawnKukaPattern = new SchedulingPattern(KUKA_RESPAWN_PATTERN); + _despawnKukaPattern = new SchedulingPattern(KUKA_DESPAWN_PATTERN); + _despawnJisraPattern = new SchedulingPattern(JISRA_DESPAWN_PATTERN); + + ThreadPool.scheduleAtFixedRate(() -> onSpawn(KUKA, KUKA_LOC, _respawnKukaPattern), _respawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(KUKA), _despawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(JISRA), _despawnJisraPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + } + + @Override + public String onEvent(String event, Npc npc, Player player) + { + if ("teleport".equals(event)) + { + if (canMoveToZone(player)) + { + player.teleToLocation(TELEPORT_START_LOC); + return null; + } + + return "34173-2.html"; + } + + return event; + } + + // @Override + // public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon) + // { + // // TODO: Jisra casting self buff. + // return super.onAttack(npc, attacker, damage, isSummon); + // } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final int npcId = npc.getTemplate().getId(); + if (npcId == KUKA) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_ONLY_YOU_CAN_CHALLENGE_JISRA, 2, 5000, true, killer.getName())); + killer.getEffectList().add(new BuffInfo(npc, killer, SkillData.getInstance().getSkill(PROOF_OF_COURAGE, 1), false, null, null)); + + for (Creature creature : ZONE.getCharactersInside()) + { + if (creature.isPlayer() && !creature.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + } + } + + final Npc jisra = onSpawn(JISRA, JISRA_LOC, null); + addAttackPlayerDesire(jisra, killer); + + } + else if (npcId == JISRA) + { + final Npc jisra = DBSpawnManager.getInstance().getNpc(JISRA); + DBSpawnManager.getInstance().deleteSpawn(jisra.getSpawn(), true); + jisra.deleteMe(); + } + + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + if (creature.isPlayer() && !canMoveToZone((Player) creature)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + creature.sendMessage("Nobody can go through the secret pathway now."); + } + + return super.onEnterZone(creature, zone); + } + + private void onDespawn(int bossId) + { + for (Spawn spawn : SpawnTable.getInstance().getSpawns(bossId)) + { + for (Npc monster : spawn.getSpawnedNpcs()) + { + if (!monster.isDead()) + { + DBSpawnManager.getInstance().deleteSpawn(spawn, true); + monster.deleteMe(); + } + } + } + } + + private Npc onSpawn(int id, Location location, SchedulingPattern respawnPattern) + { + final NpcTemplate template = NpcData.getInstance().getTemplate(id); + try + { + if (template != null) + { + final Spawn spawn = new Spawn(template); + spawn.setXYZ(location); + spawn.setRespawnPattern(respawnPattern); + return DBSpawnManager.getInstance().addNewSpawn(spawn, true); + } + } + catch (Exception e) + { + LOGGER.warning(getClass().getSimpleName() + ": Caused an exception " + e.getMessage()); + } + + return null; + } + + private boolean isAlive(int npc) + { + final RaidBossStatus status = DBSpawnManager.getInstance().getStatus(npc); + return (status == RaidBossStatus.ALIVE) || (status == RaidBossStatus.COMBAT); + } + + private boolean canMoveToZone(Player player) + { + return _enterZonePattern.match(System.currentTimeMillis()) || isAlive(KUKA) || player.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE); + } + + public static void main(String[] args) + { + new Kuka(); + } +} diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/spawns/RaidbossSpawns.xml index 7ad77943a3..e413e55907 100644 --- a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/spawns/RaidbossSpawns.xml @@ -44,7 +44,6 @@ - diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/stats/skills/48100-48199.xml b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/stats/skills/48100-48199.xml index b78d7e7af7..050f9eec05 100644 --- a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/stats/skills/48100-48199.xml +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/stats/skills/48100-48199.xml @@ -691,6 +691,7 @@ icon.skill30530 + 600 A1 diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/zones/no_restart.xml b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/zones/no_restart.xml index 240f474a97..810f96ad22 100644 --- a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/zones/no_restart.xml +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/data/zones/no_restart.xml @@ -1,6 +1,13 @@ + + + + + + + diff --git a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html new file mode 100644 index 0000000000..85bfcfb653 --- /dev/null +++ b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/34173-1.html @@ -0,0 +1,7 @@ +Undercover Agent Khamin:
+Our scouts have brought information that Jisra can be seen only short periods of time. In 30 minutes before every even hour a secret pathway is opened, it won't be closed for 30 minutes. If you follow the way and kill Escorts, Escort Captain Cooca will come to find out what's going on.
+Keep in mind you have to kill Cooca first. If you can defeat him, you can defeat Jisra.
+Cooca has cast a powerful protection spell on Jisra, so without killing Cooca you most likely fail to deal with Jisra.
+Our mages say that after Cooca's death his spell will be unleashed and sweep away from the camp everybody who wasn't in the combat. So good luck.
+ + \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html new file mode 100644 index 0000000000..474d255199 --- /dev/null +++ b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/34173-2.html @@ -0,0 +1,6 @@ +Undercover Agent Khamin:
+Nobody can go through the secret pathway now.
+It's too dangerous to let the way be opened all the time, our enemies are surely going to see it and block it, or make an ambush.
+Come back later when I can open the pathway safely. + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/34173.html b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/34173.html new file mode 100644 index 0000000000..c52812aa78 --- /dev/null +++ b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/34173.html @@ -0,0 +1,8 @@ +Undercover Agent Khamin:
+Sel Mahums have occupied Abandoned Camp.
+The camp is guarded by Escorts, their leaders are an elite warrior called Jisra and Escort Captain Cooca. The bastards are getting very strong and dangerous.
+I have to ask for your help. We need to sound out the situation, so do it using a secret pathway.
+Be careful,the camp is guarded not only by the men but also powerful magic that can teleport you anywhere. Cooca is the one who cast it but even if you kill him spell won't be broken. So you aren't going to come back the same way you travel there,that's why you need to prepare a Scroll of Escape.
+ + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java new file mode 100644 index 0000000000..b61e25b0d6 --- /dev/null +++ b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/scripts/ai/bosses/Kuka/Kuka.java @@ -0,0 +1,188 @@ +package ai.bosses.Kuka; + +import org.l2jmobius.commons.threads.ThreadPool; +import org.l2jmobius.commons.time.SchedulingPattern; +import org.l2jmobius.gameserver.data.SpawnTable; +import org.l2jmobius.gameserver.data.xml.NpcData; +import org.l2jmobius.gameserver.data.xml.SkillData; +import org.l2jmobius.gameserver.enums.RaidBossStatus; +import org.l2jmobius.gameserver.instancemanager.DBSpawnManager; +import org.l2jmobius.gameserver.instancemanager.ZoneManager; +import org.l2jmobius.gameserver.model.Location; +import org.l2jmobius.gameserver.model.Spawn; +import org.l2jmobius.gameserver.model.actor.Creature; +import org.l2jmobius.gameserver.model.actor.Npc; +import org.l2jmobius.gameserver.model.actor.Player; +import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; +import org.l2jmobius.gameserver.model.skill.BuffInfo; +import org.l2jmobius.gameserver.model.zone.ZoneType; +import org.l2jmobius.gameserver.model.zone.type.NoRestartZone; +import org.l2jmobius.gameserver.network.NpcStringId; +import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage; + +import ai.AbstractNpcAI; + +/** + * @author Symb1OS + */ +public class Kuka extends AbstractNpcAI +{ + // NPCs + private static final int KHAMIN = 34173; + private static final int JISRA = 25925; + private static final int KUKA = 25926; + // Item + private static final int PROOF_OF_COURAGE = 48185; + // Locations + private static final Location KUKA_LOC = new Location(-58974, 135294, -2392); + private static final Location JISRA_LOC = new Location(-60496, 137347, -2392); + private static final Location TELEPORT_START_LOC = new Location(-57406, 136429, -2396); + private static final Location TELEPORT_OUT_LOC = new Location(-48363, 140230, -2947); + // Zone + private static final NoRestartZone ZONE = ZoneManager.getInstance().getZoneByName("kuka_no_restart", NoRestartZone.class); + // Misc + private static final String ENTER_ZONE_PATTERN = "30-50 */2 * * *"; + private static final String KUKA_RESPAWN_PATTERN = "50 */2 * * *"; + private static final String KUKA_DESPAWN_PATTERN = "0 */1 * * *"; + private static final String JISRA_DESPAWN_PATTERN = "30 */1 * * *"; + private final SchedulingPattern _enterZonePattern; + private final SchedulingPattern _respawnKukaPattern; + private final SchedulingPattern _despawnKukaPattern; + private final SchedulingPattern _despawnJisraPattern; + + private Kuka() + { + addFirstTalkId(KHAMIN); + addEnterZoneId(ZONE.getId()); + // addAttackId(JISRA); + addKillId(KUKA, JISRA); + + _enterZonePattern = new SchedulingPattern(ENTER_ZONE_PATTERN); + _respawnKukaPattern = new SchedulingPattern(KUKA_RESPAWN_PATTERN); + _despawnKukaPattern = new SchedulingPattern(KUKA_DESPAWN_PATTERN); + _despawnJisraPattern = new SchedulingPattern(JISRA_DESPAWN_PATTERN); + + ThreadPool.scheduleAtFixedRate(() -> onSpawn(KUKA, KUKA_LOC, _respawnKukaPattern), _respawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(KUKA), _despawnKukaPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + ThreadPool.scheduleAtFixedRate(() -> onDespawn(JISRA), _despawnJisraPattern.getDelayToNextFromNow(), 1000 * 60 * 60 * 2); + } + + @Override + public String onEvent(String event, Npc npc, Player player) + { + if ("teleport".equals(event)) + { + if (canMoveToZone(player)) + { + player.teleToLocation(TELEPORT_START_LOC); + return null; + } + + return "34173-2.html"; + } + + return event; + } + + // @Override + // public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon) + // { + // // TODO: Jisra casting self buff. + // return super.onAttack(npc, attacker, damage, isSummon); + // } + + @Override + public String onKill(Npc npc, Player killer, boolean isSummon) + { + final int npcId = npc.getTemplate().getId(); + if (npcId == KUKA) + { + npc.broadcastPacket(new ExShowScreenMessage(NpcStringId.S1_ONLY_YOU_CAN_CHALLENGE_JISRA, 2, 5000, true, killer.getName())); + killer.getEffectList().add(new BuffInfo(npc, killer, SkillData.getInstance().getSkill(PROOF_OF_COURAGE, 1), false, null, null)); + + for (Creature creature : ZONE.getCharactersInside()) + { + if (creature.isPlayer() && !creature.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + } + } + + final Npc jisra = onSpawn(JISRA, JISRA_LOC, null); + addAttackPlayerDesire(jisra, killer); + + } + else if (npcId == JISRA) + { + final Npc jisra = DBSpawnManager.getInstance().getNpc(JISRA); + DBSpawnManager.getInstance().deleteSpawn(jisra.getSpawn(), true); + jisra.deleteMe(); + } + + return super.onKill(npc, killer, isSummon); + } + + @Override + public String onEnterZone(Creature creature, ZoneType zone) + { + if (creature.isPlayer() && !canMoveToZone((Player) creature)) + { + creature.teleToLocation(TELEPORT_OUT_LOC); + creature.sendMessage("Nobody can go through the secret pathway now."); + } + + return super.onEnterZone(creature, zone); + } + + private void onDespawn(int bossId) + { + for (Spawn spawn : SpawnTable.getInstance().getSpawns(bossId)) + { + for (Npc monster : spawn.getSpawnedNpcs()) + { + if (!monster.isDead()) + { + DBSpawnManager.getInstance().deleteSpawn(spawn, true); + monster.deleteMe(); + } + } + } + } + + private Npc onSpawn(int id, Location location, SchedulingPattern respawnPattern) + { + final NpcTemplate template = NpcData.getInstance().getTemplate(id); + try + { + if (template != null) + { + final Spawn spawn = new Spawn(template); + spawn.setXYZ(location); + spawn.setRespawnPattern(respawnPattern); + return DBSpawnManager.getInstance().addNewSpawn(spawn, true); + } + } + catch (Exception e) + { + LOGGER.warning(getClass().getSimpleName() + ": Caused an exception " + e.getMessage()); + } + + return null; + } + + private boolean isAlive(int npc) + { + final RaidBossStatus status = DBSpawnManager.getInstance().getStatus(npc); + return (status == RaidBossStatus.ALIVE) || (status == RaidBossStatus.COMBAT); + } + + private boolean canMoveToZone(Player player) + { + return _enterZonePattern.match(System.currentTimeMillis()) || isAlive(KUKA) || player.getEffectList().isAffectedBySkill(PROOF_OF_COURAGE); + } + + public static void main(String[] args) + { + new Kuka(); + } +} diff --git a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/spawns/RaidbossSpawns.xml b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/spawns/RaidbossSpawns.xml index 7ad77943a3..e413e55907 100644 --- a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/spawns/RaidbossSpawns.xml +++ b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/spawns/RaidbossSpawns.xml @@ -44,7 +44,6 @@ - diff --git a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/stats/skills/48100-48199.xml b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/stats/skills/48100-48199.xml index 31fe0d962e..9796f3a017 100644 --- a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/stats/skills/48100-48199.xml +++ b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/stats/skills/48100-48199.xml @@ -691,6 +691,7 @@ icon.skill30530 + 600 A1 diff --git a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/zones/no_restart.xml b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/zones/no_restart.xml index 240f474a97..810f96ad22 100644 --- a/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/zones/no_restart.xml +++ b/L2J_Mobius_Essence_7.3_SevenSigns/dist/game/data/zones/no_restart.xml @@ -1,6 +1,13 @@ + + + + + + +