From cae6a70a2c0d39345ef156216dbacb9157fba0be Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:01:20 -0600 Subject: [PATCH] port mlog 'Spells' category to new log system --- zone/attack.cpp | 12 +- zone/bot.cpp | 16 +-- zone/client_packet.cpp | 4 +- zone/spell_effects.cpp | 16 +-- zone/spells.cpp | 308 ++++++++++++++++++++--------------------- 5 files changed, 178 insertions(+), 178 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index d284b9184..4e3aa3c2f 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3137,7 +3137,7 @@ int32 Mob::ReduceDamage(int32 damage) int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100; if(damage_to_reduce >= buffs[slot].melee_rune) { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3145,7 +3145,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce); damage -= damage_to_reduce; @@ -3164,7 +3164,7 @@ int32 Mob::ReduceDamage(int32 damage) if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune)) { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3172,7 +3172,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); if (spellbonuses.MitigateMeleeRune[3]) @@ -3290,7 +3290,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi if(spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune)) { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].magic_rune); damage -= buffs[slot].magic_rune; if(!TryFadeEffect(slot)) @@ -3298,7 +3298,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi } else { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].magic_rune); if (spellbonuses.MitigateSpellRune[3]) diff --git a/zone/bot.cpp b/zone/bot.cpp index fa4d937f2..611fb871c 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -9076,7 +9076,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(zone && !zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) { - mlog(SPELLS__CASTING, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -9084,7 +9084,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(GetClass() != BARD) { if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) { - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -9105,7 +9105,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t //cannot cast under deivne aura if(DivineAura()) { - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -9119,7 +9119,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -9127,7 +9127,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t } if (HasActiveSong()) { - mlog(SPELLS__BARDS, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client //_StopSong(); bardsong = 0; @@ -9256,7 +9256,7 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(caster->IsBot()) { if(spells[spell_id].targettype == ST_Undead) { if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) { - mlog(SPELLS__RESISTS, "Bot's target is not an undead."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead."); return true; } } @@ -9266,13 +9266,13 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { && (GetBodyType() != BT_Summoned2) && (GetBodyType() != BT_Summoned3) ) { - mlog(SPELLS__RESISTS, "Bot's target is not a summoned creature."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature."); return true; } } } - mlog(SPELLS__RESISTS, "No bot immunities to spell %d found.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id); } } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 22d63370c..65fcd4cfe 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -2970,7 +2970,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) if (!IsPoison) { - mlog(SPELLS__CASTING_ERR, "Item used to cast spell effect from a poison item was missing from inventory slot %d " + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " "after casting, or is not a poison!", ApplyPoisonData->inventorySlot); Message(0, "Error: item not found for inventory slot #%i or is not a poison", ApplyPoisonData->inventorySlot); @@ -3865,7 +3865,7 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*)app->pBuffer; uint32 spid = sbf->spellid; - mlog(SPELLS__BUFFS, "Client requested that buff with spell id %d be canceled.", spid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Client requested that buff with spell id %d be canceled.", spid); //something about IsDetrimentalSpell() crashes this portion of code.. //tbh we shouldn't use it anyway since this is a simple red vs blue buff check and diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index b8d67ddaa..217172e8b 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -1649,7 +1649,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) { if(caster) - mlog(SPELLS__REZ, " corpse being rezzed using spell %i by %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, " corpse being rezzed using spell %i by %s", spell_id, caster->GetName()); CastToCorpse()->CastRezz(spell_id, caster); @@ -3065,7 +3065,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, int mod = caster->GetInstrumentMod(spell_id); mod = ApplySpellEffectiveness(caster, spell_id, mod, true); effect_value = effect_value * mod / 10; - mlog(SPELLS__BARDS, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); } effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effectid[effect_id], caster); @@ -3127,7 +3127,7 @@ snare has both of them negative, yet their range should work the same: updownsign = 1; } - mlog(SPELLS__EFFECT_VALUES, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", spell_id, formula, base, max, caster_level, updownsign); switch(formula) @@ -3351,7 +3351,7 @@ snare has both of them negative, yet their range should work the same: if (base < 0 && result > 0) result *= -1; - mlog(SPELLS__EFFECT_VALUES, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); return result; } @@ -3383,18 +3383,18 @@ void Mob::BuffProcess() IsMezSpell(buffs[buffs_i].spellid) || IsBlindSpell(buffs[buffs_i].spellid)) { - mlog(SPELLS__BUFFS, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } } else if (buffs[buffs_i].ticsremaining < 0) { - mlog(SPELLS__BUFFS, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } else { - mlog(SPELLS__BUFFS, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); } } else if(IsClient() && !(CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)) @@ -3759,7 +3759,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if (IsClient() && !CastToClient()->IsDead()) CastToClient()->MakeBuffFadePacket(buffs[slot].spellid, slot); - mlog(SPELLS__BUFFS, "Fading buff %d from slot %d", buffs[slot].spellid, slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); if(spells[buffs[slot].spellid].viral_targets > 0) { bool last_virus = true; diff --git a/zone/spells.cpp b/zone/spells.cpp index 0e2b1e49f..d3b2c3e4b 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -147,7 +147,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 timer, uint32 timer_duration, uint32 type, int16 *resist_adjust) { - mlog(SPELLS__CASTING, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -166,7 +166,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, (IsAmnesiad() && IsDiscipline(spell_id)) ) { - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -204,7 +204,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, //cannot cast under divine aura if(DivineAura()) { - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -234,7 +234,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -243,7 +243,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, } if (HasActiveSong() && IsBardSong(spell_id)) { - mlog(SPELLS__BARDS, "Casting a new song while singing a song. Killing old song %d.", bardsong); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client _StopSong(); } @@ -349,7 +349,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, const SPDat_Spell_Struct &spell = spells[spell_id]; - mlog(SPELLS__CASTING, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", spell.name, spell_id, target_id, slot, cast_time, mana_cost, item_slot==0xFFFFFFFF?999:item_slot); casting_spell_id = spell_id; @@ -363,7 +363,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_type = type; SaveSpellLoc(); - mlog(SPELLS__CASTING, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); // if this spell doesn't require a target, or if it's an optional target // and a target wasn't provided, then it's us; unless TGB is on and this @@ -375,7 +375,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, spell.targettype == ST_Beam || spell.targettype == ST_TargetOptional) && target_id == 0) { - mlog(SPELLS__CASTING, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); target_id = GetID(); } @@ -392,7 +392,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, // we checked for spells not requiring targets above if(target_id == 0) { - mlog(SPELLS__CASTING_ERR, "Spell Error: no target. spell=%d\n", GetName(), spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, SPELL_NEED_TAR); @@ -430,7 +430,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, { mana_cost = 0; } else { - mlog(SPELLS__CASTING_ERR, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, INSUFFICIENT_MANA); @@ -451,7 +451,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_resist_adjust = resist_adjust; - mlog(SPELLS__CASTING, "Spell %d: Casting time %d (orig %d), mana cost %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", spell_id, cast_time, orgcasttime, mana_cost); // cast time is 0, just finish it right now and be done with it @@ -517,7 +517,7 @@ bool Mob::DoCastingChecks() if (RuleB(Spells, BuffLevelRestrictions)) { // casting_spell_targetid is guaranteed to be what we went, check for ST_Self for now should work though if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { - mlog(SPELLS__BUFFS, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if (!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); return false; @@ -756,7 +756,7 @@ bool Client::CheckFizzle(uint16 spell_id) float fizzle_roll = zone->random.Real(0, 100); - mlog(SPELLS__CASTING, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); if(fizzle_roll > fizzlechance) return(true); @@ -816,7 +816,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) ZeroCastingVars(); // resets all the state keeping stuff - mlog(SPELLS__CASTING, "Spell %d has been interrupted.", spellid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d has been interrupted.", spellid); if(!spellid) return; @@ -893,7 +893,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) { //should we issue a message or send them a spell gem packet? Message_StringID(13, SPELL_RECAST); - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: spell reuse timer not expired", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -907,7 +907,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) { Message_StringID(13, SPELL_RECAST); - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -916,7 +916,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!IsValidSpell(spell_id)) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: invalid spell id", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: invalid spell id", spell_id); InterruptSpell(); return; } @@ -927,7 +927,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(delaytimer) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: recast too quickly", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: recast too quickly", spell_id); Message(13, "You are unable to focus."); InterruptSpell(); return; @@ -937,7 +937,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // make sure they aren't somehow casting 2 timed spells at once if (casting_spell_id != spell_id) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: already casting", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: already casting", spell_id); Message_StringID(13,ALREADY_CASTING); InterruptSpell(); return; @@ -952,7 +952,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if (IsBardSong(spell_id)) { if(spells[spell_id].buffduration == 0xFFFF || spells[spell_id].recast_time != 0) { - mlog(SPELLS__BARDS, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); } else { bardsong = spell_id; bardsong_slot = slot; @@ -962,7 +962,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, else bardsong_target_id = spell_target->GetID(); bardsong_timer.Start(6000); - mlog(SPELLS__BARDS, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); bard_song_mode = true; } } @@ -1041,10 +1041,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, } } - mlog(SPELLS__CASTING, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); if(!spells[spell_id].uninterruptable && zone->random.Real(0, 100) > channelchance) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: interrupted.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: interrupted.", spell_id); InterruptSpell(); return; } @@ -1060,10 +1060,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(IsClient()) { int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);//Client only if(zone->random.Roll(reg_focus)) { - mlog(SPELLS__CASTING, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); } else { if(reg_focus > 0) - mlog(SPELLS__CASTING, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); Client *c = this->CastToClient(); int component, component_count, inv_slot_id; bool missingreags = false; @@ -1116,11 +1116,11 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, break; default: // some non-instrument component. Let it go, but record it in the log - mlog(SPELLS__CASTING_ERR, "Something odd happened: Song %d required component %s", spell_id, component); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Something odd happened: Song %d required component %s", spell_id, component); } if(!HasInstrument) { // if the instrument is missing, log it and interrupt the song - mlog(SPELLS__CASTING_ERR, "Song %d: Canceled. Missing required instrument %s", spell_id, component); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); if(c->GetGM()) c->Message(0, "Your GM status allows you to finish casting even though you're missing a required instrument."); else { @@ -1143,12 +1143,12 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, const Item_Struct *item = database.GetItem(component); if(item) { c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name); - mlog(SPELLS__CASTING_ERR, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); } else { char TempItemName[64]; strcpy((char*)&TempItemName, "UNKNOWN"); - mlog(SPELLS__CASTING_ERR, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); } } } // end bard/not bard ifs @@ -1169,7 +1169,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if (component == -1) continue; component_count = spells[spell_id].component_counts[t_count]; - mlog(SPELLS__CASTING_ERR, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); // Components found, Deleting // now we go looking for and deleting the items one by one for(int s = 0; s < component_count; s++) @@ -1234,7 +1234,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) { Message_StringID(13, SPELL_RECAST); - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -1253,15 +1253,15 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(fromaug) { charges = -1; } //Don't destroy the parent item if(charges > -1) { // charged item, expend a charge - mlog(SPELLS__CASTING, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); DeleteChargeFromSlot = inventory_slot; } else { - mlog(SPELLS__CASTING, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); } } else { - mlog(SPELLS__CASTING_ERR, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); Message(13, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot); InterruptSpell(); return; @@ -1280,7 +1280,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // we're done casting, now try to apply the spell if( !SpellFinished(spell_id, spell_target, slot, mana_used, inventory_slot, resist_adjust) ) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: SpellFinished returned false.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); InterruptSpell(); return; } @@ -1309,7 +1309,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, this->CastToClient()->CheckSongSkillIncrease(spell_id); this->CastToClient()->MemorizeSpell(slot, spell_id, memSpellSpellbar); } - mlog(SPELLS__CASTING, "Bard song %d should be started", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d should be started", spell_id); } else { @@ -1344,7 +1344,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, delaytimer = true; spellend_timer.Start(400,true); - mlog(SPELLS__CASTING, "Spell casting of %d is finished.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting of %d is finished.", spell_id); } @@ -1474,7 +1474,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce ) { //invalid target - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1487,7 +1487,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3)) { //invalid target - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1501,7 +1501,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (spell_target != GetPet()) || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3 && body_type != BT_Animal)) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target of body type %d (summoned pet)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", spell_id, body_type); Message_StringID(13, SPELL_NEED_TAR); @@ -1526,7 +1526,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || mob_body != target_bt) { //invalid target - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); if(!spell_target) Message_StringID(13,SPELL_NEED_TAR); else @@ -1544,7 +1544,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (ldon object)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1552,14 +1552,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target->IsNPC()) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (normal)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } if(spell_target->GetClass() != LDON_TREASURE) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (normal)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1568,7 +1568,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (normal)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; // can't cast these unless we have a target } @@ -1580,7 +1580,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target || !spell_target->IsPlayerCorpse()) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (corpse)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); uint32 message = ONLY_ON_CORPSES; if(!spell_target) message = SPELL_NEED_TAR; else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES; @@ -1596,7 +1596,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce spell_target = GetPet(); if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (no pet)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); Message_StringID(13,NO_PET); return false; // can't cast these unless we have a target } @@ -1666,7 +1666,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (AOE)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1703,7 +1703,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1800,14 +1800,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(group_id_caster == 0 || group_id_target == 0) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } if(group_id_caster != group_id_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } @@ -1878,7 +1878,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce default: { - mlog(SPELLS__CASTING_ERR, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); Message(0, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); CastAction = CastActUnknown; break; @@ -1957,7 +1957,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) return(false); - mlog(SPELLS__CASTING, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); // if a spell has the AEDuration flag, it becomes an AE on target // spell that's recast every 2500 msec for AEDuration msec. There are @@ -1968,7 +1968,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 Mob *beacon_loc = spell_target ? spell_target : this; Beacon *beacon = new Beacon(beacon_loc, spells[spell_id].AEDuration); entity_list.AddBeacon(beacon); - mlog(SPELLS__CASTING, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); spell_target = nullptr; ae_center = beacon; CastAction = AECaster; @@ -1977,7 +1977,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // check line of sight to target if it's a detrimental spell if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) { - mlog(SPELLS__CASTING, "Spell %d: cannot see target %s", spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); Message_StringID(13,CANT_SEE_TARGET); return false; } @@ -2008,13 +2008,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 float min_range2 = spells[spell_id].min_range * spells[spell_id].min_range; if(dist2 > range2) { //target is out of range. - mlog(SPELLS__CASTING, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. - mlog(SPELLS__CASTING, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); Message_StringID(13, TARGET_TOO_CLOSE); return(false); } @@ -2043,7 +2043,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 #endif //BOTS if(spell_target == nullptr) { - mlog(SPELLS__CASTING, "Spell %d: Targeted spell, but we have no target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); return(false); } if (isproc) { @@ -2235,7 +2235,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // CastSpell already reduced the cost for it if we're a client with focus if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0) { - mlog(SPELLS__CASTING, "Spell %d: consuming %d mana", spell_id, mana_used); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); if (!DoHPToManaCovert(mana_used)) SetMana(GetMana() - mana_used); TryTriggerOnValueAmount(false, true); @@ -2247,7 +2247,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF) { CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration); - mlog(SPELLS__CASTING, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); } else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].IsDisciplineBuff) { int recast = spells[spell_id].recast_time/1000; @@ -2263,7 +2263,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(reduction) recast -= reduction; - mlog(SPELLS__CASTING, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); CastToClient()->GetPTimers().Start(pTimerSpellStart + spell_id, recast); } } @@ -2301,7 +2301,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(slot == USE_ITEM_SPELL_SLOT) { //bard songs should never come from items... - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); return(false); } @@ -2309,12 +2309,12 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { Mob *ae_center = nullptr; CastAction_type CastAction; if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) { - mlog(SPELLS__BARDS, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); return(false); } if(ae_center != nullptr && ae_center->IsBeacon()) { - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); return(false); } @@ -2323,18 +2323,18 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(mana_used > 0) { if(mana_used > GetMana()) { //ran out of mana... this calls StopSong() for us - mlog(SPELLS__BARDS, "Ran out of mana while singing song %d", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Ran out of mana while singing song %d", spell_id); return(false); } - mlog(SPELLS__CASTING, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); SetMana(GetMana() - mana_used); } // check line of sight to target if it's a detrimental spell if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target)) { - mlog(SPELLS__CASTING, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); Message_StringID(13, CANT_SEE_TARGET); return(false); } @@ -2349,7 +2349,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { float range2 = range * range; if(dist2 > range2) { //target is out of range. - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } @@ -2365,10 +2365,10 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case SingleTarget: { if(spell_target == nullptr) { - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); return(false); } - mlog(SPELLS__BARDS, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); spell_target->BardPulse(spell_id, this); break; } @@ -2386,7 +2386,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { { // we can't cast an AE spell without something to center it on if(ae_center == nullptr) { - mlog(SPELLS__BARDS, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); return(false); } @@ -2394,9 +2394,9 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(spell_target) { // this must be an AETarget spell // affect the target too spell_target->BardPulse(spell_id, this); - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); } else { - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, AE with no target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); } bool affect_caster = !IsNPC(); //NPC AE spells do not affect the NPC caster entity_list.AEBardPulse(this, ae_center, spell_id, affect_caster); @@ -2406,13 +2406,13 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case GroupSpell: { if(spell_target->IsGrouped()) { - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); Group *target_group = entity_list.GetGroupByMob(spell_target); if(target_group) target_group->GroupBardPulse(this, spell_id); } else if(spell_target->IsRaidGrouped() && spell_target->IsClient()) { - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); Raid *r = entity_list.GetRaidByClient(spell_target->CastToClient()); if(r){ uint32 gid = r->GetGroup(spell_target->GetName()); @@ -2429,7 +2429,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { } } else { - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); BardPulse(spell_id, this); #ifdef GROUP_BUFF_PETS if (GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) @@ -2455,13 +2455,13 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { if(buffs[buffs_i].spellid != spell_id) continue; if(buffs[buffs_i].casterid != caster->GetID()) { - mlog(SPELLS__BARDS, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); return; } //extend the spell if it will expire before the next pulse if(buffs[buffs_i].ticsremaining <= 3) { buffs[buffs_i].ticsremaining += 3; - mlog(SPELLS__BARDS, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); } //should we send this buff update to the client... seems like it would @@ -2559,7 +2559,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { //we are done... return; } - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); //this spell is not affecting this mob, apply it. caster->SpellOnTarget(spell_id, this); } @@ -2601,7 +2601,7 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste res = mod_buff_duration(res, caster, target, spell_id); - mlog(SPELLS__CASTING, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", spell_id, castlevel, formula, duration, res); return(res); @@ -2695,15 +2695,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int blocked_effect, blocked_below_value, blocked_slot; int overwrite_effect, overwrite_below_value, overwrite_slot; - mlog(SPELLS__STACKING, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); // Same Spells and dot exemption is set to 1 or spell is Manaburn if (spellid1 == spellid2) { if (sp1.dot_stacking_exempt == 1 && caster1 != caster2) { // same caster can refresh - mlog(SPELLS__STACKING, "Blocking spell due to dot stacking exemption."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell due to dot stacking exemption."); return -1; } else if (spellid1 == 2751) { - mlog(SPELLS__STACKING, "Blocking spell because manaburn does not stack with itself."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because manaburn does not stack with itself."); return -1; } } @@ -2735,7 +2735,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { if(!IsDetrimentalSpell(spellid1) && !IsDetrimentalSpell(spellid2)) { - mlog(SPELLS__STACKING, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); return (0); } } @@ -2804,16 +2804,16 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp1_value = CalcSpellEffectValue(spellid1, overwrite_slot, caster_level1); - mlog(SPELLS__STACKING, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value, sp1_value, (sp1_value < overwrite_below_value)?"Overwriting":"Not overwriting"); if(sp1_value < overwrite_below_value) { - mlog(SPELLS__STACKING, "Overwrite spell because sp1_value < overwrite_below_value"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); return 1; // overwrite spell if its value is less } } else { - mlog(SPELLS__STACKING, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value); } @@ -2827,22 +2827,22 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp2_value = CalcSpellEffectValue(spellid2, blocked_slot, caster_level2); - mlog(SPELLS__STACKING, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value, sp2_value, (sp2_value < blocked_below_value)?"Blocked":"Not blocked"); if (sp2_value < blocked_below_value) { - mlog(SPELLS__STACKING, "Blocking spell because sp2_Value < blocked_below_value"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because sp2_Value < blocked_below_value"); return -1; //blocked } } else { - mlog(SPELLS__STACKING, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value); } } } } else { - mlog(SPELLS__STACKING, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", sp1.name, spellid1, sp2.name, spellid2); } @@ -2905,13 +2905,13 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(IsNPC() && caster1 && caster2 && caster1 != caster2) { if(effect1 == SE_CurrentHP && sp1_detrimental && sp2_detrimental) { - mlog(SPELLS__STACKING, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); continue; } } if(effect1 == SE_CompleteHeal){ //SE_CompleteHeal never stacks or overwrites ever, always block. - mlog(SPELLS__STACKING, "Blocking spell because complete heal never stacks or overwries"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because complete heal never stacks or overwries"); return (-1); } @@ -2923,7 +2923,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(sp_det_mismatch) { - mlog(SPELLS__STACKING, "The effects are the same but the spell types are not, passing the effect"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The effects are the same but the spell types are not, passing the effect"); continue; } @@ -2932,7 +2932,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, and the effect is a dot we can go ahead and stack it */ if(effect1 == SE_CurrentHP && spellid1 != spellid2 && sp1_detrimental && sp2_detrimental) { - mlog(SPELLS__STACKING, "The spells are not the same and it is a detrimental dot, passing"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The spells are not the same and it is a detrimental dot, passing"); continue; } @@ -2958,7 +2958,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, sp2_value = 0 - sp2_value; if(sp2_value < sp1_value) { - mlog(SPELLS__STACKING, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", sp2.name, sp2_value, sp1.name, sp1_value, sp2.name); return -1; // can't stack } @@ -2967,7 +2967,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //we dont return here... a better value on this one effect dosent mean they are //all better... - mlog(SPELLS__STACKING, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", sp1.name, sp1_value, sp2.name, sp2_value, sp1.name); will_overwrite = true; } @@ -2976,15 +2976,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //so now we see if this new spell is any better, or if its not related at all if(will_overwrite) { if (values_equal && effect_match && !IsGroupSpell(spellid2) && IsGroupSpell(spellid1)) { - mlog(SPELLS__STACKING, "%s (%d) appears to be the single target version of %s (%d), rejecting", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", sp2.name, spellid2, sp1.name, spellid1); return -1; } - mlog(SPELLS__STACKING, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); return(1); } - mlog(SPELLS__STACKING, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); return 0; } @@ -3043,11 +3043,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } if (duration == 0) { - mlog(SPELLS__BUFFS, "Buff %d failed to add because its duration came back as 0.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); return -2; // no duration? this isn't a buff } - mlog(SPELLS__BUFFS, "Trying to add buff %d cast by %s (cast level %d) with duration %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", spell_id, caster?caster->GetName():"UNKNOWN", caster_level, duration); // first we loop through everything checking that the spell @@ -3077,12 +3077,12 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid ret = CheckStackConflict(curbuf.spellid, curbuf.casterlevel, spell_id, caster_level, entity_list.GetMobID(curbuf.casterid), caster, buffslot); if (ret == -1) { // stop the spell - mlog(SPELLS__BUFFS, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); return -1; } if (ret == 1) { // set a flag to indicate that there will be overwriting - mlog(SPELLS__BUFFS, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); // If this is the first buff it would override, use its slot if (!will_overwrite) @@ -3106,7 +3106,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid for (buffslot = 0; buffslot < buff_count; buffslot++) { const Buffs_Struct &curbuf = buffs[buffslot]; if (IsBeneficialSpell(curbuf.spellid)) { - mlog(SPELLS__BUFFS, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", spell_id, curbuf.spellid, buffslot); BuffFadeBySlot(buffslot, false); emptyslot = buffslot; @@ -3114,11 +3114,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } } if(emptyslot == -1) { - mlog(SPELLS__BUFFS, "Unable to find a buff slot for detrimental buff %d", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); return -1; } } else { - mlog(SPELLS__BUFFS, "Unable to find a buff slot for beneficial buff %d", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); return -1; } } @@ -3169,7 +3169,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid buffs[emptyslot].UpdateClient = true; } - mlog(SPELLS__BUFFS, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); if (IsPet() && GetOwner() && GetOwner()->IsClient()) SendPetBuffsToClient(); @@ -3270,7 +3270,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // well we can't cast a spell on target without a target if(!spelltar) { - mlog(SPELLS__CASTING_ERR, "Unable to apply spell %d without a target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to apply spell %d without a target", spell_id); Message(13, "SOT: You must have a target for this spell."); return false; } @@ -3298,7 +3298,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r uint16 caster_level = GetCasterLevel(spell_id); - mlog(SPELLS__CASTING, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); // Actual cast action - this causes the caster animation and the particles // around the target @@ -3378,7 +3378,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Spells, EnableBlockedBuffs)) { // We return true here since the caster's client should act like normal if (spelltar->IsBlockedBuff(spell_id)) { - mlog(SPELLS__BUFFS, "Spell %i not applied to %s as it is a Blocked Buff.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", spell_id, spelltar->GetName()); safe_delete(action_packet); return true; @@ -3386,7 +3386,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsBlockedPetBuff(spell_id)) { - mlog(SPELLS__BUFFS, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", spell_id, spelltar->GetName(), spelltar->GetOwner()->GetName()); safe_delete(action_packet); return true; @@ -3395,7 +3395,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // invuln mobs can't be affected by any spells, good or bad if(spelltar->GetInvul() || spelltar->DivineAura()) { - mlog(SPELLS__CASTING_ERR, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3406,17 +3406,17 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Pets, UnTargetableSwarmPet)) { if (spelltar->IsNPC()) { if (!spelltar->CastToNPC()->GetSwarmOwner()) { - mlog(SPELLS__CASTING_ERR, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - mlog(SPELLS__CASTING_ERR, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - mlog(SPELLS__CASTING_ERR, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } @@ -3525,9 +3525,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spells[spell_id].targettype == ST_AEBard) { //if it was a beneficial AE bard song don't spam the window that it would not hold - mlog(SPELLS__CASTING_ERR, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); } else { - mlog(SPELLS__CASTING_ERR, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); } safe_delete(action_packet); @@ -3537,7 +3537,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r } else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check { - mlog(SPELLS__CASTING_ERR, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); spelltar->Message_StringID(MT_SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); safe_delete(action_packet); return false; @@ -3551,7 +3551,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if(spelltar->IsImmuneToSpell(spell_id, this)) { //the above call does the message to the client if needed - mlog(SPELLS__RESISTS, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3644,7 +3644,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spell_effectiveness == 0 || !IsPartialCapableSpell(spell_id) ) { - mlog(SPELLS__RESISTS, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); if (spells[spell_id].resisttype == RESIST_PHYSICAL){ Message_StringID(MT_SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); @@ -3692,7 +3692,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsAIControlled() && IsDetrimentalSpell(spell_id) && !IsHarmonySpell(spell_id)) { int32 aggro_amount = CheckAggroAmount(spell_id, isproc); - mlog(SPELLS__CASTING, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); if(aggro_amount > 0) spelltar->AddToHateList(this, aggro_amount); else{ int32 newhate = spelltar->GetHateAmount(this) + aggro_amount; @@ -3709,7 +3709,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // make sure spelltar is high enough level for the buff if(RuleB(Spells, BuffLevelRestrictions) && !spelltar->CheckSpellLevelRestriction(spell_id)) { - mlog(SPELLS__BUFFS, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if(!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); safe_delete(action_packet); @@ -3721,7 +3721,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { // if SpellEffect returned false there's a problem applying the // spell. It's most likely a buff that can't stack. - mlog(SPELLS__CASTING_ERR, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); if(casting_spell_type != 1) // AA is handled differently Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); safe_delete(action_packet); @@ -3825,7 +3825,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r safe_delete(action_packet); safe_delete(message_packet); - mlog(SPELLS__CASTING, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); return true; } @@ -4005,7 +4005,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) //this spell like 10 times, this could easily be consolidated //into one loop through with a switch statement. - mlog(SPELLS__RESISTS, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); if(!IsValidSpell(spell_id)) return true; @@ -4016,7 +4016,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(IsMezSpell(spell_id)) { if(GetSpecialAbility(UNMEZABLE)) { - mlog(SPELLS__RESISTS, "We are immune to Mez spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Mez spells."); caster->Message_StringID(MT_Shout, CANNOT_MEZ); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4034,7 +4034,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if((GetLevel() > spells[spell_id].max[effect_index]) && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) { - mlog(SPELLS__RESISTS, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_MEZ_WITH_SPELL); return true; } @@ -4043,7 +4043,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) // slow and haste spells if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed)) { - mlog(SPELLS__RESISTS, "We are immune to Slow spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Slow spells."); caster->Message_StringID(MT_Shout, IMMUNE_ATKSPEED); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4059,7 +4059,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { effect_index = GetSpellEffectIndex(spell_id, SE_Fear); if(GetSpecialAbility(UNFEARABLE)) { - mlog(SPELLS__RESISTS, "We are immune to Fear spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Fear spells."); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4070,13 +4070,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) return true; } else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) { - mlog(SPELLS__RESISTS, "Clients cannot fear eachother!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients cannot fear eachother!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - mlog(SPELLS__RESISTS, "Level is %d, cannot be feared by this spell.", GetLevel()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); caster->Message_StringID(MT_Shout, FEAR_TOO_HIGH); int32 aggro = caster->CheckAggroAmount(spell_id); if (aggro > 0) { @@ -4090,7 +4090,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) else if (IsClient() && CastToClient()->CheckAAEffect(aaEffectWarcry)) { Message(13, "Your are immune to fear."); - mlog(SPELLS__RESISTS, "Clients has WarCry effect, immune to fear!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients has WarCry effect, immune to fear!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } @@ -4100,7 +4100,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNCHARMABLE)) { - mlog(SPELLS__RESISTS, "We are immune to Charm spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Charm spells."); caster->Message_StringID(MT_Shout, CANNOT_CHARM); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4113,7 +4113,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { - mlog(SPELLS__RESISTS, "You are immune to your own charms."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You are immune to your own charms."); caster->Message(MT_Shout, "You cannot charm yourself."); return true; } @@ -4126,7 +4126,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) assert(effect_index >= 0); if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - mlog(SPELLS__RESISTS, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_CHARM_YET); return true; } @@ -4140,7 +4140,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) ) { if(GetSpecialAbility(UNSNAREABLE)) { - mlog(SPELLS__RESISTS, "We are immune to Snare spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Snare spells."); caster->Message_StringID(MT_Shout, IMMUNE_MOVEMENT); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4156,7 +4156,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - mlog(SPELLS__RESISTS, "You cannot lifetap yourself."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot lifetap yourself."); caster->Message_StringID(MT_Shout, CANT_DRAIN_SELF); return true; } @@ -4166,13 +4166,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - mlog(SPELLS__RESISTS, "You cannot sacrifice yourself."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot sacrifice yourself."); caster->Message_StringID(MT_Shout, CANNOT_SAC_SELF); return true; } } - mlog(SPELLS__RESISTS, "No immunities to spell %d found.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No immunities to spell %d found.", spell_id); return false; } @@ -4209,7 +4209,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use if(GetSpecialAbility(IMMUNE_MAGIC)) { - mlog(SPELLS__RESISTS, "We are immune to magic, so we fully resist the spell %d", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); return(0); } @@ -4230,7 +4230,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int fear_resist_bonuses = CalcFearResistChance(); if(zone->random.Roll(fear_resist_bonuses)) { - mlog(SPELLS__RESISTS, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); return 0; } } @@ -4248,7 +4248,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int resist_bonuses = CalcResistChanceBonus(); if(resist_bonuses && zone->random.Roll(resist_bonuses)) { - mlog(SPELLS__RESISTS, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); return 0; } } @@ -4256,7 +4256,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use //Get the resist chance for the target if(resist_type == RESIST_NONE) { - mlog(SPELLS__RESISTS, "Spell was unresistable"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell was unresistable"); return 100; } @@ -5089,23 +5089,23 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b PermaProcs[i].spellID = spell_id; PermaProcs[i].chance = iChance; PermaProcs[i].base_spellID = base_spell_id; - mlog(SPELLS__PROCS, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - mlog(SPELLS__PROCS, "Too many perma procs for %s", GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many perma procs for %s", GetName()); } else { for (i = 0; i < MAX_PROCS; i++) { if (SpellProcs[i].spellID == SPELL_UNKNOWN) { SpellProcs[i].spellID = spell_id; SpellProcs[i].chance = iChance; SpellProcs[i].base_spellID = base_spell_id;; - mlog(SPELLS__PROCS, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - mlog(SPELLS__PROCS, "Too many procs for %s", GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many procs for %s", GetName()); } return false; } @@ -5116,7 +5116,7 @@ bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) { SpellProcs[i].spellID = SPELL_UNKNOWN; SpellProcs[i].chance = 0; SpellProcs[i].base_spellID = SPELL_UNKNOWN; - mlog(SPELLS__PROCS, "Removed proc %d from slot %d", spell_id, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed proc %d from slot %d", spell_id, i); } } return true; @@ -5133,7 +5133,7 @@ bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id DefensiveProcs[i].spellID = spell_id; DefensiveProcs[i].chance = iChance; DefensiveProcs[i].base_spellID = base_spell_id; - mlog(SPELLS__PROCS, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5148,7 +5148,7 @@ bool Mob::RemoveDefensiveProc(uint16 spell_id, bool bAll) DefensiveProcs[i].spellID = SPELL_UNKNOWN; DefensiveProcs[i].chance = 0; DefensiveProcs[i].base_spellID = SPELL_UNKNOWN; - mlog(SPELLS__PROCS, "Removed defensive proc %d from slot %d", spell_id, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed defensive proc %d from slot %d", spell_id, i); } } return true; @@ -5165,7 +5165,7 @@ bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id) RangedProcs[i].spellID = spell_id; RangedProcs[i].chance = iChance; RangedProcs[i].base_spellID = base_spell_id; - mlog(SPELLS__PROCS, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5180,7 +5180,7 @@ bool Mob::RemoveRangedProc(uint16 spell_id, bool bAll) RangedProcs[i].spellID = SPELL_UNKNOWN; RangedProcs[i].chance = 0; RangedProcs[i].base_spellID = SPELL_UNKNOWN;; - mlog(SPELLS__PROCS, "Removed ranged proc %d from slot %d", spell_id, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed ranged proc %d from slot %d", spell_id, i); } } return true; @@ -5211,7 +5211,7 @@ bool Mob::UseBardSpellLogic(uint16 spell_id, int slot) int Mob::GetCasterLevel(uint16 spell_id) { int level = GetLevel(); level += itembonuses.effective_casting_level + spellbonuses.effective_casting_level + aabonuses.effective_casting_level; - mlog(SPELLS__CASTING, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); return(level); }