Addition of random guard monsters spawns after monster kill.

Contributed by quangnguyen.
This commit is contained in:
MobiusDevelopment 2021-01-30 07:18:29 +00:00
parent 38ebc1acaf
commit 74aa98440f
3 changed files with 196 additions and 0 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}