private void decreaseAlly(L2NpcInstance npc, L2PcInstance player)
{
if(player.getAllianceWithVarkaKetra() != 0)
{
L2ItemInstance mark = null;
if(player.isAlliedWithKetra() && npc.getFactionId() == "ketra")
{
L2ItemInstance varkasBadgeSoldier = player.getInventory().getItemByItemId(7216);
L2ItemInstance varkasBadgeOfficer = player.getInventory().getItemByItemId(7217);
L2ItemInstance varkasBadgeCaptain = player.getInventory().getItemByItemId(7218);
L2ItemInstance valorTotem = player.getInventory().getItemByItemId(7219);
L2ItemInstance wisdomTotem = player.getInventory().getItemByItemId(7220);
int varkasBadgeSoldierCount = varkasBadgeSoldier == null ? 0 : varkasBadgeSoldier.getCount();
int varkasBadgeOfficerCount = varkasBadgeOfficer == null ? 0 : varkasBadgeOfficer.getCount();
int varkasBadgeCaptainCount = varkasBadgeCaptain == null ? 0 : varkasBadgeCaptain.getCount();
int valorTotemCount = valorTotem == null ? 0 : valorTotem.getCount();
int wisdomTotemCount = wisdomTotem == null ? 0 : wisdomTotem.getCount();
if(varkasBadgeSoldierCount > 0)
{
player.getInventory().destroyItemByItemId("ketrasBadgeSoldier", 7216, varkasBadgeSoldierCount, player, player.getTarget());
}
if(varkasBadgeOfficerCount > 0)
{
player.getInventory().destroyItemByItemId("ketrasBadgeOfficer", 7217, varkasBadgeOfficerCount, player, player.getTarget());
}
if(varkasBadgeCaptainCount > 0)
{
player.getInventory().destroyItemByItemId("ketrasBadgeCaptain", 7218, varkasBadgeCaptainCount, player, player.getTarget());
}
if(valorTotemCount > 0)
{
player.getInventory().destroyItemByItemId("valorTotem", 7219, valorTotemCount, player, player.getTarget());
}
if(wisdomTotemCount > 0)
{
player.getInventory().destroyItemByItemId("wisdomTotem", 7220, wisdomTotemCount, player, player.getTarget());
}
player.getInventory().destroyItemByItemId("Mark", ketraAllyMark[player.getAllianceWithVarkaKetra() - 1], 1, player, player.getTarget());
player.setAllianceWithVarkaKetra(player.getAllianceWithVarkaKetra() - 1);
if(player.getAllianceWithVarkaKetra() != 0)
{
mark = player.getInventory().addItem("Mark", ketraAllyMark[player.getAllianceWithVarkaKetra() - 1], 1, player, player);
}
}
if(player.isAlliedWithVarka() && npc.getFactionId() == "varka")
{
L2ItemInstance ketrasBadgeSoldier = player.getInventory().getItemByItemId(7226);
L2ItemInstance ketrasBadgeOfficer = player.getInventory().getItemByItemId(7227);
L2ItemInstance ketrasBadgeCaptain = player.getInventory().getItemByItemId(7228);
L2ItemInstance featherValor = player.getInventory().getItemByItemId(7229);
L2ItemInstance featherWisdom = player.getInventory().getItemByItemId(7230);
int ketrasBadgeSoldierCount = ketrasBadgeSoldier == null ? 0 : ketrasBadgeSoldier.getCount();
int ketrasBadgeOfficerCount = ketrasBadgeOfficer == null ? 0 : ketrasBadgeOfficer.getCount();
int ketrasBadgeCaptainCount = ketrasBadgeCaptain == null ? 0 : ketrasBadgeCaptain.getCount();
int featherValorCount = featherValor == null ? 0 : featherValor.getCount();
int featherWisdomCount = featherWisdom == null ? 0 : featherWisdom.getCount();
if(ketrasBadgeSoldierCount > 0)
{
player.getInventory().destroyItemByItemId("ketrasBadgeSoldier", 7226, ketrasBadgeSoldierCount, player, player.getTarget());
}