Since mq.TLO.Me.Buff["Whatever"].ID() gives me the buff slot number, not the ID of the actual spell.
Translate for your needs.
[CODE title="Example in Macroscript"]/for i 1 to 40
/if (${Me.Buff[${i}].ID}) {
/echo "Buff ${i} is ${Me.Buff[${i}].Name} with ID: ${Me.Buff[${i}].ID}"
}
/next i[/CODE]
Basically you can iterate through the list. The index here can be either a string or a number, in the event it's a number it will go to that index in the array of buffs. So you don't need to be looking for a specific buff to find out what buffs you have. You can simply iterate through them. Then you can query the relevant information about the buff that you want to check and determine what to do with it based on your findings.
[CODE lang="cpp" title="Buff and Song members" highlight="7, 34"]case CharacterMembers::Buff:
Dest.Type = pBuffType;
Dest.HighPart = SpellDisplayType_BuffWnd;
if (!Index[0])
return false;
if (IsNumber(Index))
{
int nBuff = GetIntFromString(Index, 0) - 1;
if (nBuff < 0 || nBuff > NUM_LONG_BUFFS || pProfile->GetEffect(nBuff).SpellID <= 0)
return false;
Dest.Int = nBuff;
return true;
}
{
int buffID = FindBuffIndex(Index, 0, NUM_LONG_BUFFS);
if (buffID >= 0 && buffID < NUM_LONG_BUFFS)
{
Dest.Int = buffID;
return true;
}
}
return false;
case CharacterMembers::Song:
Dest.Type = pBuffType;
Dest.HighPart = SpellDisplayType_None;
if (!Index[0])
return false;
if (IsNumber(Index))
{
int nBuff = GetIntFromString(Index, 0) - 1;
if (nBuff < 0 || nBuff >= NUM_SHORT_BUFFS || pProfile->GetTempEffect(nBuff).SpellID <= 0)
return false;
Dest.Int = nBuff + NUM_LONG_BUFFS;
return true;
}
{
int buffID = FindBuffIndex(Index, NUM_LONG_BUFFS, MAX_TOTAL_BUFFS);
if (buffID >= NUM_LONG_BUFFS && buffID < MAX_TOTAL_BUFFS)
{
Dest.Int = buffID;
return true;
}
}
return false;[/CODE]
The results are of pBuffType, and that contains members for the following.
[CODE lang="cpp" title="pBuffType members"]enum class BuffMembers
{
ID,
Level,
Spell,
Mod,
Duration,
Dar,
TotalCounters,
HitCount,
CountersDisease,
CountersPoison,
CountersCurse,
CountersCorruption,
Caster,
};[/CODE]
Now while that will get you information specific to the buff you may want more information about the spell itself, in which case you can do a .Spell} and then the members of spell are as follows.
[CODE lang="cpp" title="pSpellType members"]enum class SpellMembers
{
ID = 1,
Name,
Level,
Skill,
Mana,
ResistAdj,
Range,
AERange,
PushBack,
CastTime,
FizzleTime,
MyCastTime,
RecoveryTime,
RecastTime,
Duration,
SpellType,
TargetType,
ResistType,
CastOnYou,
CastOnAnother,
WearOff,
CounterType,
CounterNumber,
Stacks,
WillLand,
StacksPet,
WillLandPet,
WillStack,
MyRange,
EnduranceCost,
MaxLevel,
Category,
Subcategory,
Restrictions,
Base,
Base2,
Max,
Calc,
Attrib,
AutoCast,
Extra,
RecastTimerID,
ReagentID,
ReagentCount,
CastByOther,
TimeOfDay,
DurationWindow,
CanMGB,
Deletable,
BookIcon,
ActorTagId,
Description,
StacksWith,
Rank,
RankName,
SpellGroup,
SubSpellGroup,
Beneficial,
IsActiveAA,
CalcIndex,
NumEffects,
Location,
IsSwarmSpell,
IsSkill,
DurationValue1,
NewStacks,
NewStacksWith,
StacksTarget,
StacksWithDiscs,
IllusionOkWhenMounted,
EQSpellDuration,
CastByMe,
HasSPA,
Trigger,
BaseName,
NoExpendReagentID,
StacksSpawn,
SpellIcon,
GemIcon,
SlowPct,
HastePct,
MyDuration,
BaseEffectsFocusCap,
CategoryID,
SubcategoryID,
Dispellable,
Link,
};[/CODE]