diff --git a/zone/attack.cpp b/zone/attack.cpp index 4e3aa3c2f..1bf858cf9 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -370,7 +370,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) { damage = -3; - mlog(COMBAT__DAMAGE, "I am enraged, riposting frontal attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -517,7 +517,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - mlog(COMBAT__DAMAGE, "Final damage after all avoidances: %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -690,9 +690,9 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac damage -= (myac * zone->random.Int(0, acrandom) / 10000); } if (damage<1) damage=1; - mlog(COMBAT__DAMAGE, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); } else { - mlog(COMBAT__DAMAGE, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); } } @@ -1135,7 +1135,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(!GetTarget()) SetTarget(other); - mlog(COMBAT__ATTACKS, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); //SetAttackTimer(); if ( @@ -1145,12 +1145,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b || (GetHP() < 0) || (!IsAttackAllowed(other)) ) { - mlog(COMBAT__ATTACKS, "Attack canceled, invalid circumstances."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances."); return false; // Only bards can attack while casting } if(DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm - mlog(COMBAT__ATTACKS, "Attack canceled, Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! return false; } @@ -1170,19 +1170,19 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - mlog(COMBAT__ATTACKS, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - mlog(COMBAT__ATTACKS, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - mlog(COMBAT__ATTACKS, "Attacking without a weapon."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - mlog(COMBAT__ATTACKS, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -1200,7 +1200,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(IsBerserk() && GetClass() == BERSERKER){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - mlog(COMBAT__DAMAGE, "Berserker damage bonus increases DMG to %d", weapon_damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -1268,7 +1268,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b damage = mod_client_damage(damage, skillinuse, Hand, weapon, other); - mlog(COMBAT__DAMAGE, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, mylevel); int hit_chance_bonus = 0; @@ -1283,7 +1283,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) { - mlog(COMBAT__ATTACKS, "Attack missed. Damage set to 0."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; } else { //we hit, try to avoid it other->AvoidDamage(this, damage); @@ -1291,7 +1291,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(damage > 0) CommonOutgoingHitSuccess(other, damage, skillinuse); - mlog(COMBAT__DAMAGE, "Final damage after all reductions: %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -1430,7 +1430,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att } int exploss = 0; - mlog(COMBAT__HITS, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); /* #1: Send death packet to everyone @@ -1710,7 +1710,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (other->IsClient()) other->CastToClient()->RemoveXTarget(this, false); RemoveFromHateList(other); - mlog(COMBAT__ATTACKS, "I am not allowed to attack %s", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName()); } return false; } @@ -1737,10 +1737,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //We dont factor much from the weapon into the attack. //Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons if(weapon) { - mlog(COMBAT__ATTACKS, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); if(Hand == MainSecondary && weapon->ItemType == ItemTypeShield){ - mlog(COMBAT__ATTACKS, "Attack with shield canceled."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled."); return false; } @@ -1829,11 +1829,11 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //check if we're hitting above our max or below it. if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) { - mlog(COMBAT__DAMAGE, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); damage = (min_dmg+eleBane); } if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) { - mlog(COMBAT__DAMAGE, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); damage = (max_dmg+eleBane); } @@ -1846,7 +1846,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } if(other->IsClient() && other->CastToClient()->IsSitting()) { - mlog(COMBAT__DAMAGE, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); damage = (max_dmg+eleBane); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); @@ -1857,7 +1857,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool hate += opts->hate_flat; } - mlog(COMBAT__HITS, "Generating hate %d towards %s", hate, GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list other->AddToHateList(this, hate); @@ -1881,7 +1881,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if(damage > 0) { CommonOutgoingHitSuccess(other, damage, skillinuse); } - mlog(COMBAT__HITS, "Generating hate %d towards %s", hate, GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list if(damage > 0) other->AddToHateList(this, hate); @@ -1890,7 +1890,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } } - mlog(COMBAT__DAMAGE, "Final damage against %s: %d", other->GetName(), damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage); if(other->IsClient() && IsPet() && GetOwner()->IsClient()) { //pets do half damage to clients in pvp @@ -1902,7 +1902,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //cant riposte a riposte if (bRiposte && damage == -3) { - mlog(COMBAT__DAMAGE, "Riposte of riposte canceled."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled."); return false; } @@ -1954,7 +1954,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - mlog(COMBAT__HITS, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); parse->EventNPC(EVENT_ATTACK, this, other, "", 0); } attacked_timer.Start(CombatEventTimer_expire); @@ -1991,7 +1991,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack } bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill) { - mlog(COMBAT__HITS, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); Mob *oos = nullptr; if(killerMob) { @@ -2580,7 +2580,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { if(DS == 0 && rev_ds == 0) return; - mlog(COMBAT__HITS, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); //invert DS... spells yield negative values for a true damage shield if(DS < 0) { @@ -2625,7 +2625,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID; if(rev_ds < 0) { - mlog(COMBAT__HITS, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this //do we need to send a damage packet here also? } @@ -3437,11 +3437,11 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons // This method is called with skill_used=ABJURE for Damage Shield damage. bool FromDamageShield = (skill_used == SkillAbjuration); - mlog(COMBAT__HITS, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot); if (GetInvul() || DivineAura()) { - mlog(COMBAT__DAMAGE, "Avoiding %d damage due to invulnerability.", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage); damage = -5; } @@ -3493,7 +3493,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int healed = damage; healed = attacker->GetActSpellHealing(spell_id, healed); - mlog(COMBAT__DAMAGE, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); attacker->HealDamage(healed); //we used to do a message to the client, but its gone now. @@ -3516,7 +3516,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //see if any runes want to reduce this damage if(spell_id == SPELL_UNKNOWN) { damage = ReduceDamage(damage); - mlog(COMBAT__HITS, "Melee Damage reduced to %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage); damage = ReduceAllDamage(damage); TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker); } else { @@ -3573,7 +3573,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //fade mez if we are mezzed if (IsMezzed() && attacker) { - mlog(COMBAT__HITS, "Breaking mez due to attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack."); entity_list.MessageClose_StringID(this, true, 100, MT_WornOff, HAS_BEEN_AWAKENED, GetCleanName(), attacker->GetCleanName()); BuffFadeByEffect(SE_Mez); @@ -3616,7 +3616,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int stun_resist = itembonuses.StunResist + spellbonuses.StunResist; int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist; - mlog(COMBAT__HITS, "Stun passed, checking resists. Was %d chance.", stun_chance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); if (IsClient()) { stun_resist += aabonuses.StunResist; frontal_stun_resist += aabonuses.FrontalStunResist; @@ -3626,20 +3626,20 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (((GetBaseRace() == OGRE && IsClient()) || (frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) && !attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) { - mlog(COMBAT__HITS, "Frontal stun resisted. %d chance.", frontal_stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); } else { // Normal stun resist check. if (stun_resist && zone->random.Roll(stun_resist)) { if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - mlog(COMBAT__HITS, "Stun Resisted. %d chance.", stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist); } else { - mlog(COMBAT__HITS, "Stunned. %d resist chance.", stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist); Stun(zone->random.Int(0, 2) * 1000); // 0-2 seconds } } } else { - mlog(COMBAT__HITS, "Stun failed. %d chance.", stun_chance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance); } } @@ -3653,7 +3653,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //increment chances of interrupting if(IsCasting()) { //shouldnt interrupt on regular spell damage attacked_count++; - mlog(COMBAT__HITS, "Melee attack while casting. Attack count %d", attacked_count); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count); } } @@ -3859,7 +3859,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand) ProcChance += ProcChance * ProcBonus / 100.0f; } - mlog(COMBAT__PROCS, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3878,7 +3878,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 h ProcBonus += static_cast(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f; ProcChance = ProcChance + (ProcChance * ProcBonus); - mlog(COMBAT__PROCS, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3923,12 +3923,12 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { } if (!IsAttackAllowed(on)) { - mlog(COMBAT__PROCS, "Preventing procing off of unattackable things."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things."); return; } if (DivineAura()) { - mlog(COMBAT__PROCS, "Procs canceled, Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect."); return; } @@ -3975,7 +3975,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on static_cast(weapon->ProcRate)) / 100.0f; if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really. if (weapon->Proc.Level > ourlevel) { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Tried to proc (%s), but our level (%d) is lower than required (%d)", weapon->Name, ourlevel, weapon->Proc.Level); if (IsPet()) { @@ -3986,7 +3986,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on Message_StringID(13, PROC_TOOLOW); } } else { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)", weapon->Name, weapon->Proc.Effect, WPC * 100); ExecWeaponProc(inst, weapon->Proc.Effect, on); @@ -4065,12 +4065,12 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, // Perma procs (AAs) if (PermaProcs[i].spellID != SPELL_UNKNOWN) { if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus? - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d procing spell %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); ExecWeaponProc(nullptr, PermaProcs[i].spellID, on); } else { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d failed to proc %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); } @@ -4080,13 +4080,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (SpellProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(SpellProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d procing spell %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); ExecWeaponProc(nullptr, SpellProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, SpellProcs[i].base_spellID); } else { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d failed to proc %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); } @@ -4096,13 +4096,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (RangedProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(RangedProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d procing spell %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); ExecWeaponProc(nullptr, RangedProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, RangedProcs[i].base_spellID); } else { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d failed to proc %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); } @@ -4352,7 +4352,7 @@ bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Mob::DoRiposte(Mob* defender) { - mlog(COMBAT__ATTACKS, "Preforming a riposte"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -4370,7 +4370,7 @@ void Mob::DoRiposte(Mob* defender) { //Live AA - Double Riposte if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - mlog(COMBAT__ATTACKS, "Preforming a double riposed (%d percent chance)", DoubleRipChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); if (HasDied()) return; } @@ -4381,7 +4381,7 @@ void Mob::DoRiposte(Mob* defender) { DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1]; if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - mlog(COMBAT__ATTACKS, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); if (defender->GetClass() == MONK) defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]); @@ -4398,7 +4398,7 @@ void Mob::ApplyMeleeDamageBonus(uint16 skill, int32 &damage){ int dmgbonusmod = 0; dmgbonusmod += (100*(itembonuses.STR + spellbonuses.STR))/3; dmgbonusmod += (100*(spellbonuses.ATK + itembonuses.ATK))/5; - mlog(COMBAT__DAMAGE, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); damage += (damage*dmgbonusmod/10000); } } @@ -4692,13 +4692,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) { if (!TryFadeEffect(spellbonuses.Root[1])) { BuffFadeBySlot(spellbonuses.Root[1]); - mlog(COMBAT__HITS, "Spell broke root! BreakChance percent chance"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance"); return true; } } } - mlog(COMBAT__HITS, "Spell did not break root. BreakChance percent chance"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance"); return false; } @@ -4770,19 +4770,19 @@ void Mob::CommonBreakInvisible() { //break invis when you attack if(invisible) { - mlog(COMBAT__ATTACKS, "Removing invisibility due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - mlog(COMBAT__ATTACKS, "Removing invisibility vs. undead due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - mlog(COMBAT__ATTACKS, "Removing invisibility vs. animals due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } diff --git a/zone/bot.cpp b/zone/bot.cpp index 3552ec6c5..fb3f86c90 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -2979,7 +2979,7 @@ void Bot::BotRangedAttack(Mob* other) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) { - mlog(COMBAT__RANGED, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -2997,7 +2997,7 @@ void Bot::BotRangedAttack(Mob* other) { if(!RangeWeapon || !Ammo) return; - mlog(COMBAT__RANGED, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); if(!IsAttackAllowed(other) || IsCasting() || @@ -3015,19 +3015,19 @@ void Bot::BotRangedAttack(Mob* other) { //break invis when you attack if(invisible) { - mlog(COMBAT__ATTACKS, "Removing invisibility due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - mlog(COMBAT__ATTACKS, "Removing invisibility vs. undead due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - mlog(COMBAT__ATTACKS, "Removing invisibility vs. animals due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -5959,7 +5959,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - mlog(COMBAT__HITS, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); parse->EventNPC(EVENT_ATTACK, this, from, "", 0); } @@ -5972,7 +5972,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ // if spell is lifetap add hp to the caster if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) { int healed = GetActSpellHealing(spell_id, damage); - mlog(COMBAT__DAMAGE, "Applying lifetap heal of %d to %s", healed, GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); HealDamage(healed); entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() ); } @@ -6024,7 +6024,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(!GetTarget() || GetTarget() != other) SetTarget(other); - mlog(COMBAT__ATTACKS, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || other == nullptr || @@ -6036,13 +6036,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName()); if(other) { RemoveFromHateList(other); - mlog(COMBAT__ATTACKS, "I am not allowed to attack %s", other->GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName()); } return false; } if(DivineAura()) {//cant attack while invulnerable - mlog(COMBAT__ATTACKS, "Attack canceled, Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); return false; } @@ -6068,19 +6068,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - mlog(COMBAT__ATTACKS, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - mlog(COMBAT__ATTACKS, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - mlog(COMBAT__ATTACKS, "Attacking without a weapon."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - mlog(COMBAT__ATTACKS, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -6098,7 +6098,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(berserk && (GetClass() == BERSERKER)){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - mlog(COMBAT__DAMAGE, "Berserker damage bonus increases DMG to %d", weapon_damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -6163,7 +6163,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b else damage = zone->random.Int(min_hit, max_hit); - mlog(COMBAT__DAMAGE, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel()); if(opts) { @@ -6175,7 +6175,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(other, skillinuse, Hand)) { - mlog(COMBAT__ATTACKS, "Attack missed. Damage set to 0."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; other->AddToHateList(this, 0); } else { //we hit, try to avoid it @@ -6185,13 +6185,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b ApplyMeleeDamageBonus(skillinuse, damage); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); TryCriticalHit(other, skillinuse, damage, opts); - mlog(COMBAT__HITS, "Generating hate %d towards %s", hate, GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName()); // now add done damage to the hate list //other->AddToHateList(this, hate); } else other->AddToHateList(this, 0); - mlog(COMBAT__DAMAGE, "Final damage after all reductions: %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -6253,19 +6253,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //break invis when you attack if(invisible) { - mlog(COMBAT__ATTACKS, "Removing invisibility due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - mlog(COMBAT__ATTACKS, "Removing invisibility vs. undead due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - mlog(COMBAT__ATTACKS, "Removing invisibility vs. animals due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -7378,7 +7378,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) { ProcChance += ProcChance*ProcBonus / 100.0f; } - mlog(COMBAT__PROCS, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -7414,7 +7414,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && !other->BehindMob(this, other->GetX(), other->GetY())) { damage = -3; - mlog(COMBAT__DAMAGE, "I am enraged, riposting frontal attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -7556,7 +7556,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - mlog(COMBAT__DAMAGE, "Final damage after all avoidances: %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -7609,14 +7609,14 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) uint16 levelreq = aabonuses.FinishingBlowLvl[0]; if(defender->GetLevel() <= levelreq && (chance >= zone->random.Int(0, 1000))){ - mlog(COMBAT__ATTACKS, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse); return true; } else { - mlog(COMBAT__ATTACKS, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); return false; } } @@ -7624,7 +7624,7 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Bot::DoRiposte(Mob* defender) { - mlog(COMBAT__ATTACKS, "Preforming a riposte"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -7637,7 +7637,7 @@ void Bot::DoRiposte(Mob* defender) { defender->GetItemBonuses().GiveDoubleRiposte[0]; if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) { - mlog(COMBAT__ATTACKS, "Preforming a double riposte (%d percent chance)", DoubleRipChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); } @@ -8207,7 +8207,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f); float DefenderChance = (float)zone->random.Real(0.00f, 1.00f); if(AttackerChance > DefenderChance) { - mlog(COMBAT__ATTACKS, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); // WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW //entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s has scored a leathal HEADSHOT!", GetName()); @@ -8215,7 +8215,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { Result = true; } else { - mlog(COMBAT__ATTACKS, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); } } } diff --git a/zone/mob.cpp b/zone/mob.cpp index 3ea572eb6..d63cdf0f7 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -4536,7 +4536,7 @@ void Mob::MeleeLifeTap(int32 damage) { if(lifetap_amt && damage > 0){ lifetap_amt = damage * lifetap_amt / 100; - mlog(COMBAT__DAMAGE, "Melee lifetap healing for %d damage.", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage); if (lifetap_amt > 0) HealDamage(lifetap_amt); //Heal self for modified damage amount. diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 5255ff1f6..bf8d875b8 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -683,7 +683,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if(!CanDoubleAttack && ((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - mlog(COMBAT__RANGED, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -695,12 +695,12 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const ItemInst* Ammo = m_inv[MainAmmo]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(MainRange)); return; } if (!Ammo || !Ammo->IsType(ItemClassCommon)) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(MainAmmo)); return; } @@ -709,17 +709,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const Item_Struct* AmmoItem = Ammo->GetItem(); if(RangeItem->ItemType != ItemTypeBow) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); Message(0, "Error: Rangeweapon: Item %d is not a bow.", RangeWeapon->GetID()); return; } if(AmmoItem->ItemType != ItemTypeArrow) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); Message(0, "Error: Ammo: type %d != %d, you have the wrong type of ammo!", AmmoItem->ItemType, ItemTypeArrow); return; } - mlog(COMBAT__RANGED, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); //look for ammo in inventory if we only have 1 left... if(Ammo->GetCharges() == 1) { @@ -746,7 +746,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { Ammo = baginst; ammo_slot = m_inv.CalcSlotId(r, i); found = true; - mlog(COMBAT__RANGED, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); break; } } @@ -761,17 +761,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (aslot != INVALID_INDEX) { ammo_slot = aslot; Ammo = m_inv[aslot]; - mlog(COMBAT__RANGED, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); } } } float range = RangeItem->Range + AmmoItem->Range + GetRangeDistTargetSizeMod(GetTarget()); - mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - mlog(COMBAT__RANGED, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -799,9 +799,9 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (!ChanceAvoidConsume || (ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)){ DeleteItemInInventory(ammo_slot, 1, true); - mlog(COMBAT__RANGED, "Consumed one arrow from slot %d", ammo_slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Consumed one arrow from slot %d", ammo_slot); } else { - mlog(COMBAT__RANGED, "Endless Quiver prevented ammo consumption."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Endless Quiver prevented ammo consumption."); } CheckIncreaseSkill(SkillArchery, GetTarget(), -15); @@ -873,7 +873,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillArchery); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) { - mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillArchery, 0, RangeWeapon, Ammo, AmmoSlot, speed); @@ -882,7 +882,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillArchery); } else { - mlog(COMBAT__RANGED, "Ranged attack hit %s.", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack hit %s.", other->GetName()); bool HeadShot = false; uint32 HeadShot_Dmg = TryHeadShot(other, SkillArchery); @@ -923,7 +923,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite MaxDmg += MaxDmg*bonusArcheryDamageModifier / 100; - mlog(COMBAT__RANGED, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); bool dobonus = false; if(GetClass() == RANGER && GetLevel() > 50){ @@ -944,7 +944,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite hate *= 2; MaxDmg = mod_archery_bonus_damage(MaxDmg, RangeWeapon); - mlog(COMBAT__RANGED, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); Message_StringID(MT_CritMelee, BOW_DOUBLE_DAMAGE); } } @@ -1192,7 +1192,7 @@ void NPC::RangedAttack(Mob* other) //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())){ - mlog(COMBAT__RANGED, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -1361,7 +1361,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((!CanDoubleAttack && (attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - mlog(COMBAT__RANGED, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -1371,19 +1371,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 const ItemInst* RangeWeapon = m_inv[MainRange]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(MainRange)); return; } const Item_Struct* item = RangeWeapon->GetItem(); if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(MainRange)); return; } - mlog(COMBAT__RANGED, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); if(RangeWeapon->GetCharges() == 1) { //first check ammo @@ -1392,7 +1392,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //more in the ammo slot, use it RangeWeapon = AmmoItem; ammo_slot = MainAmmo; - mlog(COMBAT__RANGED, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } else { //look through our inventory for more int32 aslot = m_inv.HasItem(item->ID, 1, invWherePersonal); @@ -1400,17 +1400,17 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //the item wont change, but the instance does, not that it matters ammo_slot = aslot; RangeWeapon = m_inv[aslot]; - mlog(COMBAT__RANGED, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } } } float range = item->Range + GetRangeDistTargetSizeMod(other); - mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - mlog(COMBAT__RANGED, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1489,7 +1489,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillThrowing); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){ - mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed); return; @@ -1497,7 +1497,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillThrowing); } else { - mlog(COMBAT__RANGED, "Throwing attack hit %s.", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack hit %s.", other->GetName()); int16 WDmg = 0; @@ -1533,7 +1533,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, GetName()); } - mlog(COMBAT__RANGED, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); if (!Assassinate_Dmg) other->AvoidDamage(this, TotalDmg, false); //CanRiposte=false - Can not riposte throw attacks. diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 217172e8b..f666c62ce 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -711,7 +711,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) stun_resist += aabonuses.StunResist; if (stun_resist <= 0 || zone->random.Int(0,99) >= stun_resist) { - mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.", stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. We had %d percent resist chance.", stun_resist); if (caster->IsClient()) effect_value += effect_value*caster->GetFocusEffect(focusFcStunTimeMod, spell_id)/100; @@ -721,7 +721,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - mlog(COMBAT__HITS, "Stun Resisted. We had %d percent resist chance.", stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); } } break;