Hello,
I'm currently working with the following system:
#define ENABLE_BOOST_BONUS_RACE
#ifdef ENABLE_BOOST_BONUS_RACE
if (GetJob() == JOB_WARRIOR && GetSkillGroup() == 2) // Mental Warrior
{
SetPoint(POINT_ATTBONUS_MONSTER, GetPoint(POINT_ATTBONUS_MONSTER) + 10); //Strong against monsters +10%
}
if (GetJob() == JOB_SURA && GetSkillGroup() == 2) // Black Sura
{
SetPoint(POINT_ATTBONUS_MONSTER, GetPoint(POINT_ATTBONUS_MONSTER) + 10); //Strong against monsters +10%
}
if (GetJob() == JOB_SHAMAN) // Shaman
{
SetPoint(POINT_ATTBONUS_MONSTER, GetPoint(POINT_ATTBONUS_MONSTER) + 10); //Strong against monsters +10%
}
if (GetJob() == JOB_ASSASSIN) // Ninja
{
SetPoint(POINT_ATTBONUS_MONSTER, GetPoint(POINT_ATTBONUS_MONSTER) + 10); //Strong against monsters +10%
}
#endif
Right now, the bonus is applied only once when the character is first created. However, I'm trying to find a way to reapply or update the bonus every time the character logs in, based on their current job and skill group.
The goal is to ensure that:
If the character changes race or skill group, the bonus is updated accordingly.
If a character was created before the system was implemented, they also receive the bonus on their next login.
Bonuses must not stack or duplicate over multiple logins.
I may want to add multiple types of bonuses, such as +10% Strong against Metin Stones, but again, these must not overlap or stack with previous bonuses.
I’m considering moving the bonus logic into the Login function, or any reliable hook that is triggered on every login, and managing bonus state updates carefully to avoid duplication.
Do you have any advice or suggestions on the best way to implement this?