Показать контент
package ai;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.quest.jython.QuestJython;
public class PolymorphingAngel extends QuestJython {
private static final int[][] keypairs = {
{20830, 20859},
{21067, 21068},
{21062, 21063},
{20831, 20860},
{100109, 18265},
{10095, 10078},
{21070, 21071}
};
public PolymorphingAngel(int questId, String name, String descr, int ex) {
super(questId, name, descr, ex);
for(int[] i : keypairs)
addKillId(i[0]);
}
@Override
public String onKill(final L2NpcInstance npc, final L2PcInstance killer, boolean isPet)
{
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() {
@Override
public void run() {
L2NpcInstance sp = addSpawn(getSpawnId(npc.getNpcId()), npc);
sp.setRunning();
sp.addDamageHate(killer, 0, 999);
sp.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, killer);
}
}, 1000); // задержка в МС
return null;
}
private static int getSpawnId(int from)
{
for(int[] i : keypairs)
if(i[0] == from)
return i[1];
return 0;
}
public static void main(String[] args) {
new PolymorphingAngel(-1, "PolymorphingAngel", "by CalypsoToolz", 0);
}
}
Hide