L2NpcInstance npc = getNpc();
if(player == null || npc == null)
{
return;
}
L2Summon pl_pet = player.getPet();
if(player.getInventory().getItemByItemId(BABY_BUFFALO_PANPIPE) == null)
{
show(Files.read("data/scripts/services/petevolve/no_item.htm", player), player, npc);
return;
}
if(pl_pet == null || pl_pet.isDead())
{
show(Files.read("data/scripts/services/petevolve/evolve_no.htm", player), player, npc);
return;
}
if(pl_pet.getNpcId() != BABY_BUFFALO)
{
show(Files.read("data/scripts/services/petevolve/no_pet.htm", player), player, npc);
return;
}
if(Config.ALT_IMPROVED_PETS_LIMITED_USE && player.isMageClass())
{
show(Files.read("data/scripts/services/petevolve/no_class_w.htm", player), player, npc);
return;
}
if(pl_pet.getLevel() < 55)
{
show(Files.read("data/scripts/services/petevolve/no_level.htm", player), player, npc);
return;
}
pl_pet.deleteMe();
addItem(player, IN_BABY_BUFFALO_NECKLACE, 1);
show(Files.read("data/scripts/services/petevolve/yes_pet.htm", player), player, npc);
}