Hi everyone,
I’m currently working on some C++ code for Metin2 and came across a section I’m having trouble understanding. Here’s the relevant part of the code:
if (FindAffect(affect_type, apply_type))
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ¹Ì È¿°ú°¡ °É·Á ÀÖ½À´Ï´Ù."));
}
else
{
if (FindAffect(AFFECT_EXP_BONUS_EURO_FREE, POINT_RESIST_MAGIC))
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ¹Ì È¿°ú°¡ °É·Á ÀÖ½À´Ï´Ù."));
}
else
{
AddAffect(affect_type, apply_type, apply_value, 0, apply_duration, 0, false);
item->SetCount(item->GetCount() - 1);
}
}
I understand the general structure of checking for existing effects before applying new ones, but I’m specifically puzzled by the second condition:
if (FindAffect(AFFECT_EXP_BONUS_EURO_FREE, POINT_RESIST_MAGIC))
Could someone explain the purpose of this specific "FindAffect" check? Thanks in advance!