#ifdef [B]ENABLE_BATTLE_FIELD[/B]
if (item->GetVnum() == 27125)
{
if (FindAffect(AFFECT_BATTLE_POTION))
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You already used that potion."));
return false;
}
if (CBattleZone::instance().IsBattleZoneMapIndex(GetMapIndex()))
{
int iMultiply = 0;
if(GetLevel() <= 64)
{
iMultiply = 4;
}
else if (GetLevel() > 64 && GetLevel() < 90)
{
iMultiply = 3;
}
else if (GetLevel() >= 90)
{
iMultiply = 2;
}
int iAttackDefenceValue = (gPlayerMaxLevel - (GetLevel() - 50)) * iMultiply;
AddAffect(AFFECT_BATTLE_POTION, POINT_MAX_HP, 50000, 0, INFINITE_AFFECT_DURATION, 0, false);
AddAffect(AFFECT_BATTLE_POTION, POINT_ATT_GRADE_BONUS, iAttackDefenceValue, 0, INFINITE_AFFECT_DURATION, 0, false);
AddAffect(AFFECT_BATTLE_POTION, POINT_DEF_GRADE_BONUS, iAttackDefenceValue, 0, INFINITE_AFFECT_DURATION, 0, false);
EffectPacket(SE_EFFECT_BATTLE_POTION);
}
else
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can use this item just in battle zone map."));
return false;
}
}
#endif