bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
if (victim->IsDead())
return false;
if (victim->IsObserverMode())
return false;
if (victim->GetShopOwner())
return false;
{
SECTREE* sectree = NULL;
sectree = ch->GetSectree();
if (sectree && sectree->IsAttr(ch->GetX(), ch->GetY(), ATTR_BANPK))
return false;
sectree = victim->GetSectree();
if (sectree && sectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK))
return false;
}
// >>>>>>>>>>>>>>>> PVP ENGEL () <<<<<<<<<<<<<<
if (ch->IsPC() && victim->IsPC())
{
int m = ch->GetMapIndex();
if (m == 1 || m == 3 || m == 21 || m == 23 || m == 41 || m == 43)
return false;
}
// >>>>>>>>>>>>>>>> PVP ENGEL () <<<<<<<<<<<<<<
#ifdef NEW_ICEDAMAGE_SYSTEM
if (!battle_is_icedamage(ch, victim))
return false;
#endif
if (ch->IsStun() || ch->IsDead())
return false;
if (ch->IsPC() && victim->IsPC())
{
CGuild* g1 = ch->GetGuild();
CGuild* g2 = victim->GetGuild();
if (g1 && g2)
{
if (g1->UnderWar(g2->GetID()))
return true;
}
}
if (IS_CASTLE_MAP(ch->GetMapIndex()) && false == castle_can_attack(ch, victim))
return false;
if (CArenaManager::instance().CanAttack(ch, victim) == true)
return true;
return CPVPManager::instance().CanAttack(ch, victim);
}