MonsterBuff Limit

06/17/2022 15:09 Blazing.Flyff#1
Hey,
when i want to do a buff limit (3), so if you got 3 Monsterbuffs you cant get more even the chance do get an other one is 100%. how i can write it in short version. that there is a check :

if ((CMover*) g_pPlayer->HasBuff(ALL BUFFS HE GOT) == ListofIdMonsterbuffs && CurrentMonsterBuffs < __MonsterBuffLimit)
{
((CUser*)m_pAttacker)->DoApplySkill(m_pAttacker, pItemProp, NULL);
CurrentMonsterBuffs++;
}

i got 84 Monsterbuffs at the moment. so i can do it in 84 if(....){....}.. but what i have to do for short version?



if someone can help me with it would be great...

add me in discord: Luckiee#7002
or answer here. I will do it public if its ok, so the rest of flyff devs can have it too.
06/19/2022 05:05 SandIsWater#2
When attempting to give monster buffs -> check to see if user has the buff its trying to give to reset timer -> otherwise give buff if they dont have a list of buffs or 3 of them

Look at the actual function of HasBuff and HasBuffByIk3 and the IBuff / IBuffMng classes or whatever they are called and how they interact in the source.

Then just find the most optimal way to do it rather the quickest.