WIP on auras

Lots to do still

Normal buffing auras currently work for the most part
This commit is contained in:
Michael Cook (mackal)
2017-07-14 02:05:35 -04:00
parent be0374d197
commit 94038ebb75
22 changed files with 692 additions and 4 deletions
+25
View File
@@ -4189,6 +4189,21 @@ void Mob::BuffFadeBySpellID(uint16 spell_id)
CalcBonuses();
}
void Mob::BuffFadeBySpellIDAndCaster(uint16 spell_id, uint16 caster_id)
{
bool recalc_bonus = false;
auto buff_count = GetMaxTotalSlots();
for (int i = 0; i < buff_count; ++i) {
if (buffs[i].spellid == spell_id && buffs[i].casterid == caster_id) {
BuffFadeBySlot(i, false);
recalc_bonus = true;
}
}
if (recalc_bonus)
CalcBonuses();
}
// removes buffs containing effectid, skipping skipslot
void Mob::BuffFadeByEffect(int effectid, int skipslot)
{
@@ -4207,6 +4222,16 @@ void Mob::BuffFadeByEffect(int effectid, int skipslot)
CalcBonuses();
}
bool Mob::IsAffectedByBuff(uint16 spell_id)
{
int buff_count = GetMaxTotalSlots();
for (int i = 0; i < buff_count; ++i)
if (buffs[i].spellid == spell_id)
return true;
return false;
}
// checks if 'this' can be affected by spell_id from caster
// returns true if the spell should fail, false otherwise
bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)