From 74aa98440f94e1008e71e788e6d0e65766f83e53 Mon Sep 17 00:00:00 2001
From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Sat, 30 Jan 2021 07:18:29 +0000
Subject: [PATCH] Addition of random guard monsters spawns after monster kill.
Contributed by quangnguyen.
---
.../FieldofMassacre/FieldOfMassacre.java | 68 +++++++++++++++++++
.../ai/areas/PlainsOfGlory/PlainsOfGlory.java | 64 +++++++++++++++++
.../ai/areas/WarTornPlains/WarTornPlains.java | 64 +++++++++++++++++
3 files changed, 196 insertions(+)
create mode 100644 L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/FieldofMassacre/FieldOfMassacre.java
create mode 100644 L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/PlainsOfGlory/PlainsOfGlory.java
create mode 100644 L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/WarTornPlains/WarTornPlains.java
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/FieldofMassacre/FieldOfMassacre.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/FieldofMassacre/FieldOfMassacre.java
new file mode 100644
index 0000000000..6d5f59b4f6
--- /dev/null
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/FieldofMassacre/FieldOfMassacre.java
@@ -0,0 +1,68 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program 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.
+ *
+ * This program 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 .
+ */
+package ai.areas.FieldofMassacre;
+
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.Playable;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Field of Massacre AI.
+ * @author quangnguyen
+ */
+public class FieldOfMassacre extends AbstractNpcAI
+{
+ // Monsters
+ private static final int ACHER_OF_DESTRUCTION = 21001;
+ private static final int GRAVEYARD_LICH = 21003;
+ private static final int DISMAL_POLE = 21004;
+ private static final int GRAVEYARD_PREDATOR = 21005;
+ private static final int DOOM_KNIGHT = 20674;
+ private static final int DOOM_SCOUT = 21002;
+ private static final int DOOM_SERVANT = 21006;
+ private static final int DOOM_GUARD = 21007;
+ private static final int DOOM_ARCHER = 21008;
+ private static final int DOOM_TROOPER = 21009;
+ private static final int DOOM_WARRIOR = 21010;
+ // Guard
+ private static final int GUARD_BUTCHER = 22101;
+
+ private FieldOfMassacre()
+ {
+ addKillId(ACHER_OF_DESTRUCTION, GRAVEYARD_LICH, DISMAL_POLE, GRAVEYARD_PREDATOR, DOOM_KNIGHT, DOOM_SCOUT, DOOM_SERVANT, DOOM_GUARD, DOOM_ARCHER, DOOM_TROOPER, DOOM_WARRIOR);
+ }
+
+ @Override
+ public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
+ {
+ if (getRandom(100) < 50)
+ {
+ final Npc spawnBanshee = addSpawn(GUARD_BUTCHER, npc, false, 300000);
+ final Playable attacker = isSummon ? killer.getServitors().values().stream().findFirst().orElse(killer.getPet()) : killer;
+ addAttackPlayerDesire(spawnBanshee, attacker);
+ npc.deleteMe();
+ }
+ return super.onKill(npc, killer, isSummon);
+ }
+
+ public static void main(String[] args)
+ {
+ new FieldOfMassacre();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/PlainsOfGlory/PlainsOfGlory.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/PlainsOfGlory/PlainsOfGlory.java
new file mode 100644
index 0000000000..35266a7fce
--- /dev/null
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/PlainsOfGlory/PlainsOfGlory.java
@@ -0,0 +1,64 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program 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.
+ *
+ * This program 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 .
+ */
+package ai.areas.PlainsOfGlory;
+
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.Playable;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Plains of Glory AI.
+ * @author quangnguyen
+ */
+public class PlainsOfGlory extends AbstractNpcAI
+{
+ // Monsters
+ private static final int VANOR_SILENOS = 20681;
+ private static final int VANOR_SILENOS_SOLDIER = 20682;
+ private static final int VANOR_SILENOS_SCOUT = 20683;
+ private static final int VANOR_SILENOS_WARRIOR = 20684;
+ private static final int VANOR_SILENOS_SHAMAN = 20685;
+ private static final int VANOR_SILENOS_CHIEFTAIN = 20686;
+ private static final int VANOR_MERCENARY_OF_GLORY = 24014;
+ // Guard
+ private static final int GUARD_OF_HONOR = 22102;
+
+ private PlainsOfGlory()
+ {
+ addKillId(VANOR_SILENOS, VANOR_SILENOS_SOLDIER, VANOR_SILENOS_SCOUT, VANOR_SILENOS_WARRIOR, VANOR_SILENOS_SHAMAN, VANOR_SILENOS_CHIEFTAIN, VANOR_MERCENARY_OF_GLORY);
+ }
+
+ @Override
+ public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
+ {
+ if (getRandom(100) < 50)
+ {
+ final Npc spawnBanshee = addSpawn(GUARD_OF_HONOR, npc, false, 300000);
+ final Playable attacker = isSummon ? killer.getServitors().values().stream().findFirst().orElse(killer.getPet()) : killer;
+ addAttackPlayerDesire(spawnBanshee, attacker);
+ npc.deleteMe();
+ }
+ return super.onKill(npc, killer, isSummon);
+ }
+
+ public static void main(String[] args)
+ {
+ new PlainsOfGlory();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/WarTornPlains/WarTornPlains.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/WarTornPlains/WarTornPlains.java
new file mode 100644
index 0000000000..74286d2faa
--- /dev/null
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/ai/areas/WarTornPlains/WarTornPlains.java
@@ -0,0 +1,64 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program 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.
+ *
+ * This program 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 .
+ */
+package ai.areas.WarTornPlains;
+
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.Playable;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Cave Maiden, Keeper AI.
+ * @author proGenitor
+ */
+public class WarTornPlains extends AbstractNpcAI
+{
+ // Monsters
+ private static final int GRAVEYARD_WANDERER = 20659;
+ private static final int ARCHER_OF_GREED = 20660;
+ private static final int HATAR_RATMAN_THIEF = 20661;
+ private static final int HATAR_RATMAN_BOSS = 20662;
+ private static final int HATAR_HANISHEE = 20663;
+ private static final int DEPRIVE = 20664;
+ private static final int TAIK_ORC_SUPPLY = 20665;
+ // Guard
+ private static final int FIERCE_GUARD = 22103;
+
+ private WarTornPlains()
+ {
+ addKillId(GRAVEYARD_WANDERER, ARCHER_OF_GREED, HATAR_RATMAN_THIEF, HATAR_RATMAN_BOSS, HATAR_HANISHEE, DEPRIVE, TAIK_ORC_SUPPLY);
+ }
+
+ @Override
+ public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
+ {
+ if (getRandom(100) < 50)
+ {
+ final Npc spawnBanshee = addSpawn(FIERCE_GUARD, npc, false, 300000);
+ final Playable attacker = isSummon ? killer.getServitors().values().stream().findFirst().orElse(killer.getPet()) : killer;
+ addAttackPlayerDesire(spawnBanshee, attacker);
+ npc.deleteMe();
+ }
+ return super.onKill(npc, killer, isSummon);
+ }
+
+ public static void main(String[] args)
+ {
+ new WarTornPlains();
+ }
+}
\ No newline at end of file