@Warl0ck45 Slowed is handled by SPA.
C++:
case Slowed:
Dest.Type = pBuffType;
if (PCHARINFO2 pChar2 = GetCharInfo2()) {
int nBuff = -1;
if ((nBuff = GetSelfBuffBySPA(11, 0)) != -1)//Slowed
{
Dest.Ptr = &pChar2->Buff[nBuff];
return true;
}
}
return false;
For the function GetSelfBuffBySPA the proto is as follows
C++:
int GetSelfBuffBySPA(int spa, bool bIncrease, int startslot)
So it's looking for case 11 on SPA, Which is Melee Speed, then it checks bIncrease which in this case is 0.
the GetSelfBuffBySPA iterates though all Buffs in normal buff window (Up to ox2a or 42). If they go to the short duration window it would be checked in
C++:
int GetSelfShortBuffBySPA(int spa, bool bIncrease, int startslot)
It should be noted that at current that the short buffs are not checked by this case.
For case 11
C++:
case 11: //Melee Speed
if (!bIncrease && base < 100) { //below 100 means its a slow above its haste...
return i;
}
else if (bIncrease && base > 100) {
return i;
}
return -1;
So since bincrease = 0, it gets the base from
C++:
if (LONG base = ((EQ_Spell *)pSpell)->SpellAffectBase(spa)) {
to determine if the value is lower than 100 then it's a slow.
Of course, each of these are handled differently. Such as Snare is SPA 3, which is movement rate. the check is spa 3 with !bIncrease. So the value would theoretically be less than 0, thus returning any buff that has a snared movement rate modifier in it.
One would need to check SPA's on those abilities to see what SPA's it contains so that they can be verified to match the existing conditions available in the GetSelfBuffBySPA function to return more accurate information.
As for
MQ2Debuffs.
C++:
case Detrimentals:
Dest.Type=pBoolType;
Dest.DWord=(dSize)?true:false;
The above reflects the information shown for
MQ2Debuffs.
The arrays of PSPELL for dList, bList, and aList are all 30 in size.
dSize doesn't appear to get initialized, as neither does bSize, or aSize, but are all defined as "long" for a type.
I find that there is a function void SetBuffs(PCHAR Index) that appears to be the one that determines the number of buffs/debuffs a player has on them.
In that particular function it checks "MAXBUFF_MYSELF" which is defined as 25, which significantly is limiting the possible opportunity to actually find the debuffs because it's only checking up to 25 slots instead of up to the 42 available in MQ2.
Without actually testing I wouldn't be able to verify this is the issue with certainty, but I believe it should use the same #define that core does to ensure this iterates through all buff slots available as opposed to requiring it be updated to stay current. MQ2BerZerker uses the same globals as MQ2's core code and I've had no issues.
C++:
ZeroMemory(&dList,sizeof(dList)); dSize=0;
ZeroMemory(&bList,sizeof(bList)); bSize=0;
ZeroMemory(&aList,sizeof(aList)); aSize=0;
if(!Index[0] || !_stricmp(Index,"self") || !_stricmp(Index,"myself")) {
for(int b=0; b<MAXBUFF_MYSELF; b++) {
if(PSPELL spell=GetSpellByID(GetCharInfo2()->Buff[b].SpellID))
if(spell->DurationCap>0) {
((spell->SpellType)?bList[bSize++]:dList[dSize++])=spell;
aList[aSize++]=spell;
}
}
return;
}
The above is part of the code I'm referencing.
It should be noted that
MQ2Debuffs hasn't been updated since it's initial import to very vanilla 2 years ago or more, unless you count the gitlab update that includes adding a space to one line in the comments.
My personal function removes the need to check each individually with a TLO and instead checks normal buffs, short buffs, and aura all at once to save me the headache of getting specific with which box to check.
C++:
bool IHaveBuff(PSPELL pSpell) {
if (!InGame()) return false;
for (int i = 0; i < NUM_LONG_BUFFS; i++) {
if (GetCharInfo2() && GetCharInfo2()->Buff) {
if (PSPELL pBuff = GetSpellByID(GetCharInfo2()->Buff[i].SpellID)) {
if (strstr(pBuff->Name, pSpell->Name)) {
return true;
}
}
}
}
for (int i = 0; i < NUM_SHORT_BUFFS; i++) {
if (GetCharInfo2() && GetCharInfo2()->ShortBuff) {
if (PSPELL pBuff = GetSpellByID(GetCharInfo2()->ShortBuff[i].SpellID)) {
if (strstr(pBuff->Name, pSpell->Name)) {
return true;
}
}
}
}
if (pAuraMgr) {
if (PAURAMGR pAura = (PAURAMGR)pAuraMgr)
{
if (pAura->NumAuras)
{
PAURAS pAuras = (PAURAS)(*pAura->pAuraInfo);
for (DWORD n = 0; n < pAura->NumAuras; n++)
{
if (strstr(pAuras->Aura[n].Name, pSpell->Name))
{
return true;
}
}
}
}
}
return false;
}
Those ranges are the same ranges used for core MQ2 with NUM_LONG_BUFFS expanding to 42, and NUM_SHORT_BUFFS expanding to 55. These are defined (for me on test) in EQData(Test).h and thus should require no intervention from me if they ever get updated. I expect given the right situation the same could be tested for
MQ2Debuffs