I made additional changes - created CallOfTheSpirits AI, I think its a better implementation. Feel free to adjust chances, I didnt found exact information about that.
---
.../ai/others/AbstractSpawningOnAttack.java | 41 -----------
.../data/scripts/ai/others/CallOfTheSpirits.java | 86 ++++++++++++++++++++++
dist/game/data/scripts/ai/others/CrokianLad.java | 29 +++++++-
.../scripts/ai/others/HaritLizardmanMatriarch.java | 24 ------
dist/game/data/scripts/ai/others/Palibati.java | 24 ------
dist/game/data/stats/npcs/20000-20099.xml | 2 +-
dist/game/data/stats/npcs/20600-20699.xml | 8 --
dist/game/data/stats/npcs/21600-21699.xml | 38 ++++++++--
8 files changed, 143 insertions(+), 109 deletions(-)
delete mode 100644 dist/game/data/scripts/ai/others/AbstractSpawningOnAttack.java
create mode 100644 dist/game/data/scripts/ai/others/CallOfTheSpirits.java
delete mode 100644 dist/game/data/scripts/ai/others/HaritLizardmanMatriarch.java
delete mode 100644 dist/game/data/scripts/ai/others/Palibati.java
diff --git a/dist/game/data/scripts/ai/others/AbstractSpawningOnAttack.java b/dist/game/data/scripts/ai/others/AbstractSpawningOnAttack.java
deleted file mode 100644
index 2e2f759..0000000
--- a/dist/game/data/scripts/ai/others/AbstractSpawningOnAttack.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package ai.others;
-
-import ai.AbstractNpcAI;
-import org.l2jmobius.gameserver.model.actor.Npc;
-import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
-import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
-import org.l2jmobius.gameserver.model.holders.MinionHolder;
-
-/**
- * Spawn monster randomly by 'SummonPrivateRate' on attack.
- * @author AnsS
- */
-public abstract class AbstractSpawningOnAttack extends AbstractNpcAI
-{
- protected AbstractSpawningOnAttack()
- {
- addAttackId(getMobId());
- }
-
- protected abstract int getMobId();
-
- @Override
- public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
- {
- if (npc.isMonster())
- {
- final MonsterInstance monster = (MonsterInstance) npc;
- if (!monster.isTeleporting() && npc.getStatus().getActiveChar().getMaxHp() == npc.getStatus().getCurrentHp()
- && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
- {
- for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
- {
- for (int i = 0; i < is.getCount(); i++) {
- addMinion((MonsterInstance) npc, is.getId());
- }
- }
- }
- }
- return super.onAttack(npc, attacker, damage, isSummon);
- }
-}
diff --git a/dist/game/data/scripts/ai/others/CallOfTheSpirits.java b/dist/game/data/scripts/ai/others/CallOfTheSpirits.java
new file mode 100644
index 0000000..79d56b6
--- /dev/null
+++ b/dist/game/data/scripts/ai/others/CallOfTheSpirits.java
@@ -0,0 +1,86 @@
+package ai.others;
+
+import ai.AbstractNpcAI;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * CallOfTheSpirits AI.
+ * @author AnsS
+ */
+public class CallOfTheSpirits extends AbstractNpcAI
+{
+ private static final Map<Integer, Integer> MONSTER_IDS = new HashMap<>();
+
+ static
+ {
+ // Wasteland
+ MONSTER_IDS.put(20068, 21656); // Monster Eye Destroyer / Earth Guardian Golem
+ MONSTER_IDS.put(20083, 21656); // Granite Golem / Earth Guardian Golem
+
+ // Execution Grounds
+ MONSTER_IDS.put(20201, 21654); // Ghoul / Earth Guardian Dreco
+ MONSTER_IDS.put(20202, 21654); // Corpse Tracker / Earth Guardian Dreco
+
+ // Plains of the Lizardmen
+ MONSTER_IDS.put(20580, 21655); // Leto Lizardman Warrior / Earth Guardian Raido
+ MONSTER_IDS.put(20581, 21655); // Leto Lizardman Shaman / Earth Guardian Raido
+
+ // Sea of Spores
+ MONSTER_IDS.put(20556, 21657); // Giant Monster Eye / Earth Guardian Wyrm
+ MONSTER_IDS.put(20557, 21657); // Dire Wyrm / Earth Guardian Wyrm
+
+ // Forest of Mirrors
+ MONSTER_IDS.put(20643, 21658); // Harit Lizardman Warrior / Earth Guardian Harit
+ MONSTER_IDS.put(20645, 21658); // Harit Lizardman Matriarch / Earth Guardian Harit
+
+ // Seal of Shilen
+ MONSTER_IDS.put(20670, 21660); // Crimson Drake / Palibati Earth Guardian
+ MONSTER_IDS.put(20673, 21660); // Plaibati / Palibati Earth Guardian
+ }
+
+ public CallOfTheSpirits()
+ {
+ for (Integer monsterId : MONSTER_IDS.keySet())
+ {
+ addKillId(monsterId);
+ }
+ }
+
+ @Override
+ public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
+ {
+ if (npc.isMonster())
+ {
+ Integer spawningMonsterId = MONSTER_IDS.get(npc.getId());
+ if (getRandom(1, 100) <= (20 * (killer.isInParty() ? 2 : 1)))
+ {
+ int count = 1;
+ if (getRandom(1, 100) <= 40)
+ {
+ count = 2;
+ }
+ else if (getRandom(1, 100) <= 10)
+ {
+ count = 3;
+ }
+
+ for(int i = 0; i < count; i++)
+ {
+ addMinion((MonsterInstance) npc, spawningMonsterId);
+ }
+ }
+ }
+
+ return super.onKill(npc, killer, isSummon);
+ }
+
+ public static void main(String[] args)
+ {
+ new CallOfTheSpirits();
+ }
+}
diff --git a/dist/game/data/scripts/ai/others/CrokianLad.java b/dist/game/data/scripts/ai/others/CrokianLad.java
index 62b31f3..f8f823b 100644
--- a/dist/game/data/scripts/ai/others/CrokianLad.java
+++ b/dist/game/data/scripts/ai/others/CrokianLad.java
@@ -1,20 +1,41 @@
package ai.others;
+import ai.AbstractNpcAI;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.holders.MinionHolder;
+
/**
* Crokian Lad AI.
* @author AnsS
*/
-public class CrokianLad extends AbstractSpawningOnAttack
+public class CrokianLad extends AbstractNpcAI
{
private static final int CROKIAN_LAD_ID = 20804;
private CrokianLad() {
- super();
+ addAttackId(CROKIAN_LAD_ID);
}
@Override
- protected int getMobId() {
- return CROKIAN_LAD_ID;
+ public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
+ {
+ if (npc.isMonster())
+ {
+ final MonsterInstance monster = (MonsterInstance) npc;
+ if (!monster.isTeleporting() && npc.getStatus().getActiveChar().getMaxHp() == npc.getStatus().getCurrentHp()
+ && (getRandom(1, 100) <= npc.getParameters().getInt("SummonPrivateRate", 0)))
+ {
+ for (MinionHolder is : npc.getParameters().getMinionList("Privates"))
+ {
+ for (int i = 0; i < is.getCount(); i++) {
+ addMinion((MonsterInstance) npc, is.getId());
+ }
+ }
+ }
+ }
+ return super.onAttack(npc, attacker, damage, isSummon);
}
public static void main(String[] args)
diff --git a/dist/game/data/scripts/ai/others/HaritLizardmanMatriarch.java b/dist/game/data/scripts/ai/others/HaritLizardmanMatriarch.java
deleted file mode 100644
index 7d77111..0000000
--- a/dist/game/data/scripts/ai/others/HaritLizardmanMatriarch.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package ai.others;
-
-/**
- * Harit Lizardman Matriarch AI.
- * @author AnsS
- */
-public class HaritLizardmanMatriarch extends AbstractSpawningOnAttack
-{
- private static final int HARIT_LIZARDMAN_MATRIARCH_ID = 20645;
-
- private HaritLizardmanMatriarch() {
- super();
- }
-
- @Override
- protected int getMobId() {
- return HARIT_LIZARDMAN_MATRIARCH_ID;
- }
-
- public static void main(String[] args)
- {
- new HaritLizardmanMatriarch();
- }
-}
diff --git a/dist/game/data/scripts/ai/others/Palibati.java b/dist/game/data/scripts/ai/others/Palibati.java
deleted file mode 100644
index dbbd58b..0000000
--- a/dist/game/data/scripts/ai/others/Palibati.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package ai.others;
-
-/**
- * Palibati AI.
- * @author AnsS
- */
-public class Palibati extends AbstractSpawningOnAttack
-{
- private static final int PALIBATI_ID = 20673;
-
- private Palibati() {
- super();
- }
-
- @Override
- protected int getMobId() {
- return PALIBATI_ID;
- }
-
- public static void main(String[] args)
- {
- new Palibati();
- }
-}
diff --git a/dist/game/data/stats/npcs/20000-20099.xml b/dist/game/data/stats/npcs/20000-20099.xml
index e7fbd03..993c815 100644
--- a/dist/game/data/stats/npcs/20000-20099.xml
+++ b/dist/game/data/stats/npcs/20000-20099.xml
@@ -4774,7 +4774,7 @@
</parameters>
<race>CONSTRUCT</race>
<sex>MALE</sex>
- <acquire exp="2966" sp="88" />
+ <acquire exp="3461" sp="104" />
<stats str="40" int="21" dex="30" wit="20" con="43" men="10">
<vitals hp="509.61539" hpRegen="4.5" mp="405.33" mpRegen="1.8" />
<speed>
diff --git a/dist/game/data/stats/npcs/20600-20699.xml b/dist/game/data/stats/npcs/20600-20699.xml
index c27bd3a..d76734d 100644
--- a/dist/game/data/stats/npcs/20600-20699.xml
+++ b/dist/game/data/stats/npcs/20600-20699.xml
@@ -2844,10 +2844,6 @@
<param name="SpiritShot" value="100" />
<param name="SpiritShotRate" value="10" />
<param name="LongRangeGuardRate" value="10" />
- <param name="SummonPrivateRate" value="30" />
- <minions name="Privates">
- <npc id="21658" count="3" respawnTime="0" weightPoint="0" /> <!-- Harit -->
- </minions>
<skill name="PhysicalSpecial" id="4067" level="5" />
</parameters>
<race>HUMANOID</race>
@@ -4758,10 +4754,6 @@
<param name="SpiritShot" value="100" />
<param name="SpiritShotRate" value="5" />
<param name="LongRangeGuardRate" value="5" />
- <param name="SummonPrivateRate" value="30" />
- <minions name="Privates">
- <npc id="21660" count="3" respawnTime="0" weightPoint="0" /> <!-- Palibati Earth Guardian -->
- </minions>
<skill name="SleepMagic" id="4046" level="6" />
</parameters>
<race>BEAST</race>
diff --git a/dist/game/data/stats/npcs/21600-21699.xml b/dist/game/data/stats/npcs/21600-21699.xml
index 5418d7e..f20c5d2 100644
--- a/dist/game/data/stats/npcs/21600-21699.xml
+++ b/dist/game/data/stats/npcs/21600-21699.xml
@@ -3457,12 +3457,24 @@
<height normal="57.75" grown="69" />
</collision>
</npc>
- <npc id="21656" level="84" type="Monster" name="Golem" title="Earth Guardian">
- <!-- AUTO GENERATED NPC TODO: FIX IT -->
+ <npc id="21656" level="33" type="Monster" name="Golem" title="Earth Guardian">
+ <!-- https://l2wiki.com/classic/Golem -->
+ <parameters>
+ <param name="MoveAroundSocial" value="116" />
+ <param name="MoveAroundSocial1" value="116" />
+ <param name="MoveAroundSocial2" value="116" />
+ <param name="SoulShot" value="200" />
+ <param name="SoulShotRate" value="5" />
+ <param name="SpiritShot" value="100" />
+ <param name="SpiritShotRate" value="10" />
+ <param name="LongRangeGuardRate" value="10" />
+ <skill name="DDMagicSlow" id="4247" level="3" /> <!-- NPC Windstrike - Slow -->
+ </parameters>
<race>DEMONIC</race>
<sex>MALE</sex>
+ <acquire exp="5627" sp="167" />
<stats str="40" int="21" dex="30" wit="20" con="43" men="10">
- <vitals hp="740" hpRegen="51" mp="372" mpRegen="3" />
+ <vitals hp="740" hpRegen="51" mp="458" mpRegen="3" />
<speed>
<walk ground="23" />
<run ground="23" />
@@ -3472,7 +3484,15 @@
</stats>
<status undying="false" canBeSown="true" />
<skillList>
- <skill id="4045" level="1" /> <!-- Full Magic Attack Resistance -->
+ <skill id="4416" level="2" /> <!-- Magical Creatures -->
+ <skill id="4410" level="12"/> <!-- Extremely Weak P. Atk -->
+ <skill id="4411" level="12"/> <!-- Extremely Weak M. Atk -->
+ <skill id="4412" level="14"/> <!-- Extremely Weak P. Def -->
+ <skill id="4413" level="14"/> <!-- Extremely Weak M. Def -->
+ <skill id="4444" level="2" /> <!-- Greater Bow Resistance -->
+ <skill id="4273" level="3" /> <!-- Dagger Resistance -->
+ <skill id="4274" level="1" /> <!-- Blunt Weapon Vulnerability -->
+ <skill id="4284" level="5" /> <!-- Bleed Resistance -->
</skillList>
<collision>
<radius normal="20" />
@@ -3480,9 +3500,9 @@
</collision>
</npc>
<npc id="21657" level="35" type="Monster" name="Wyrm" title="Earth Guardian">
- <!-- AUTO GENERATED NPC TODO: FIX IT -->
<race>DRAGON</race>
<sex>MALE</sex>
+ <acquire exp="2582" sp="78"/>
<stats str="40" int="21" dex="30" wit="20" con="43" men="10">
<vitals hp="1248" hpRegen="51" mp="610" mpRegen="3" />
<speed>
@@ -3494,7 +3514,12 @@
</stats>
<status undying="false" canBeSown="true" />
<skillList>
- <skill id="4045" level="1" /> <!-- Full Magic Attack Resistance -->
+ <skill id="4416" level="10"/> <!-- Dragons -->
+ <skill id="4410" level="12"/> <!-- Extremely Weak P. Atk -->
+ <skill id="4411" level="12"/> <!-- Extremely Weak M. Atk -->
+ <skill id="4412" level="14"/> <!-- Extremely Weak P. Def -->
+ <skill id="4413" level="14"/> <!-- Extremely Weak M. Def -->
+ <skill id="48045" level="1"/> <!-- Water Monster -->
</skillList>
<collision>
<radius normal="29" />
@@ -3526,7 +3551,6 @@
</dropLists>
</npc>
<npc id="21658" level="55" type="Npc" name="Harit" title="Earth Guardian">
- <!-- TODO: slightly fixed -->
<race>HUMANOID</race>
<sex>MALE</sex>
<equipment rhand="9" />
--