mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 01:01:30 +00:00
port mlog 'Spells' category to new log system
This commit is contained in:
parent
aec39d2650
commit
cae6a70a2c
@ -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])
|
||||
|
||||
16
zone/bot.cpp
16
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
308
zone/spells.cpp
308
zone/spells.cpp
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user