public class AddStatByKill extends Quest
{
private final AbstractEventListener ON_KILL_LISTENER;
public AddStatByKill()
{
super(-1);
ON_KILL_LISTENER = new ConsumerEventListener(Containers.Npcs(), EventType.ON_CREATURE_DEATH, (OnCreatureDeath event) -> onCreatureDeathEvent(event), this);
Containers.Npcs().addListener(ON_KILL_LISTENER);
}
public void onCreatureDeathEvent(OnCreatureDeath event)
{
Player player = event.getKiller() == null ? null : event.getKiller().getPlayer();
if (player == null)
{
return;
}
player.increaseInt("STAT", 0, 1);
}