Pagan Temple upgraded to level 97.

Contributed by notorionn.
This commit is contained in:
MobiusDev
2015-07-21 12:42:28 +00:00
parent 72867c7917
commit 5d7ac7425e
9 changed files with 1219 additions and 1532 deletions

View File

@@ -0,0 +1,68 @@
/*
* Copyright (C) 2004-2015 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 java.util.HashMap;
import java.util.Map;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.ItemChanceHolder;
/**
* Pagan Key AI.
* @author Zoey76. Adapted to PaganKey by Notorionn
*/
public final class PaganKey extends AbstractNpcAI
{
// Items
private static final int PAGAN_KEY = 8273;
// Monsters
private static final Map<Integer, ItemChanceHolder> MONSTERS = new HashMap<>();
static
{
MONSTERS.put(22140, new ItemChanceHolder(PAGAN_KEY, 7000)); // Resurrected Worker
MONSTERS.put(22141, new ItemChanceHolder(PAGAN_KEY, 6500)); // Forgotten Victim
MONSTERS.put(22139, new ItemChanceHolder(PAGAN_KEY, 5200)); // Old Aristocrat's Soldier
}
private PaganKey()
{
super(PaganKey.class.getSimpleName(), "ai/group_template");
addKillId(MONSTERS.keySet());
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final ItemChanceHolder holder = MONSTERS.get(npc.getId());
if (getRandom(10000) <= holder.getChance())
{
npc.dropItem(killer, holder);
}
return super.onKill(npc, killer, isSummon);
}
public static void main(String[] args)
{
new PaganKey();
}
}