package ro0tt;
/*
* @author Ro0TT
* @date 25.04.2014
*/
import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.catssoftware.gameserver.listener.actor.OnDeathListener;
import ru.catssoftware.gameserver.model.L2Character;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
import ru.catssoftware.gameserver.model.listeners.CharListenerList;
public class DropItemNooblRb
{
private static int CUSTOM_RB[] = { 25325};
private static int[] ITEM = { 7679, 1};
private static Logger _log = LoggerFactory.getLogger(DropItemNooblRb.class);
public static void main(String... arg)
{
CharListenerList.addGlobal(new OnDeathListenerImpl());
_log.info("Mass drop from custom RB loaded.");
}
private static class OnDeathListenerImpl implements OnDeathListener
{
@Override
public void onDeath(L2Character actor, L2Character killer)
{
if (!actor.isNpc() || !ArrayUtils.contains(CUSTOM_RB, actor.getNpc().getNpcId()))
return;
if (killer == null || killer.getPlayer() == null)
return;
L2PcInstance player = killer.getPlayer();
if (player.isInParty() && player.isSubClassActive() && player.getLevel() >= 75)
{
for (L2PcInstance member : player.getParty().getPartyMembers())
member.addItem("DropItemNooblRb", ITEM[0], ITEM[1], actor, true);
} else if(!player.isInParty() && player.isSubClassActive() && player.getLevel() >= 75)
{
player.addItem("DropItemNooblRb", ITEM[0], ITEM[1], actor, true);
} else {
player.sendMessage("Only for sub-class 75+ lvl!");
}
}
}
}
Вот так будет работать.