mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
refactor(Core/Logging): switch to fmt style for LOG_ (#10366)
* feat(Core/Common): add support fmt style for ASSERT and ABORT * correct CheckCompactArrayMaskOverflow * 1 * Update src/server/game/Spells/Spell.cpp * rework logging * add fmt replace logs * logging * FMT_LOG_ * settings * fix startup * 1 * 2 * 3 * 4 * 5 * fmt::print * to fmt
This commit is contained in:
@@ -909,7 +909,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||
LOG_DEBUG("entities.unit", "DealDamageStart");
|
||||
|
||||
uint32 health = victim->GetHealth();
|
||||
LOG_DEBUG("entities.unit", "deal dmg:%d to health:%d ", damage, health);
|
||||
LOG_DEBUG("entities.unit", "deal dmg:{} to health:{} ", damage, health);
|
||||
|
||||
// duel ends when player has 1 or less hp
|
||||
bool duel_hasEnded = false;
|
||||
@@ -1082,7 +1082,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG("entities.unit", "DealDamageEnd returned %d damage", damage);
|
||||
LOG_DEBUG("entities.unit", "DealDamageEnd returned {} damage", damage);
|
||||
|
||||
return damage;
|
||||
}
|
||||
@@ -1098,7 +1098,7 @@ SpellCastResult Unit::CastSpell(SpellCastTargets const& targets, SpellInfo const
|
||||
{
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell by caster %s", GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell by caster {}", GetGUID().ToString());
|
||||
return SPELL_FAILED_SPELL_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@@ -1132,7 +1132,7 @@ SpellCastResult Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags t
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell %u by caster %s", spellId, GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell {} by caster {}", spellId, GetGUID().ToString());
|
||||
return SPELL_FAILED_SPELL_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@@ -1182,7 +1182,7 @@ SpellCastResult Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& v
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell %u by caster %s", spellId, GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell {} by caster {}", spellId, GetGUID().ToString());
|
||||
return SPELL_FAILED_SPELL_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@@ -1197,7 +1197,7 @@ SpellCastResult Unit::CastSpell(float x, float y, float z, uint32 spellId, bool
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell %u by caster %s", spellId, GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell {} by caster {}", spellId, GetGUID().ToString());
|
||||
return SPELL_FAILED_SPELL_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@@ -1212,7 +1212,7 @@ SpellCastResult Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered,
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell %u by caster %s", spellId, GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "CastSpell: unknown spell {} by caster {}", spellId, GetGUID().ToString());
|
||||
return SPELL_FAILED_SPELL_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@@ -2352,11 +2352,11 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
|
||||
damageInfo.attackType, nullptr, nullptr, -1, nullptr, &dmgInfo);
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
LOG_DEBUG("entities.unit", "AttackerStateUpdate: (Player) %s attacked %s for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||
GetGUID().ToString().c_str(), victim->GetGUID().ToString().c_str(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
|
||||
LOG_DEBUG("entities.unit", "AttackerStateUpdate: (Player) {} attacked {} for {} dmg, absorbed {}, blocked {}, resisted {}.",
|
||||
GetGUID().ToString(), victim->GetGUID().ToString(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
|
||||
else
|
||||
LOG_DEBUG("entities.unit", "AttackerStateUpdate: (NPC) %s attacked %s for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||
GetGUID().ToString().c_str(), victim->GetGUID().ToString().c_str(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
|
||||
LOG_DEBUG("entities.unit", "AttackerStateUpdate: (NPC) {} attacked {} for {} dmg, absorbed {}, blocked {}, resisted {}.",
|
||||
GetGUID().ToString(), victim->GetGUID().ToString(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
|
||||
|
||||
// Let the pet know we've started attacking someting. Handles melee attacks only
|
||||
// Spells such as auto-shot and others handled in WorldSession::HandleCastSpellOpcode
|
||||
@@ -2484,7 +2484,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
float parry_chance = victim->GetUnitParryChance();
|
||||
|
||||
// Useful if want to specify crit & miss chances for melee, else it could be removed
|
||||
//LOG_DEBUG("entities.unit", "MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance, crit_chance, dodge_chance, parry_chance, block_chance);
|
||||
//LOG_DEBUG("entities.unit", "MELEE OUTCOME: miss {} crit {} dodge {} parry {} block {}", miss_chance, crit_chance, dodge_chance, parry_chance, block_chance);
|
||||
|
||||
return RollMeleeOutcomeAgainst(victim, attType, int32(crit_chance * 100), int32(miss_chance * 100), int32(dodge_chance * 100), int32(parry_chance * 100), int32(block_chance * 100));
|
||||
}
|
||||
@@ -2509,8 +2509,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
int32 sum = 0, tmp = 0;
|
||||
int32 roll = urand (0, 10000);
|
||||
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
|
||||
//LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d",
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: skill bonus of {} for attacker", skillBonus);
|
||||
//LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: rolled {}, miss {}, dodge {}, parry {}, block {}, crit {}",
|
||||
// roll, miss_chance, dodge_chance, parry_chance, block_chance, crit_chance);
|
||||
|
||||
tmp = miss_chance;
|
||||
@@ -2551,7 +2551,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
&& ((tmp -= skillBonus) > 0)
|
||||
&& roll < (sum += tmp))
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum - tmp, sum);
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: DODGE <{}, {})", sum - tmp, sum);
|
||||
return MELEE_HIT_DODGE;
|
||||
}
|
||||
}
|
||||
@@ -2583,7 +2583,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
&& (tmp -= skillBonus) > 0
|
||||
&& roll < (sum += tmp))
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum - tmp, sum);
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: PARRY <{}, {})", sum - tmp, sum);
|
||||
return MELEE_HIT_PARRY;
|
||||
}
|
||||
}
|
||||
@@ -2600,7 +2600,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
&& (tmp -= skillBonus) > 0
|
||||
&& roll < (sum += tmp))
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum - tmp, sum);
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: BLOCK <{}, {})", sum - tmp, sum);
|
||||
return MELEE_HIT_BLOCK;
|
||||
}
|
||||
}
|
||||
@@ -2621,7 +2621,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
tmp = tmp > 4000 ? 4000 : tmp;
|
||||
if (roll < (sum += tmp))
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum - 4000, sum);
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: GLANCING <{}, {})", sum - 4000, sum);
|
||||
return MELEE_HIT_GLANCING;
|
||||
}
|
||||
}
|
||||
@@ -2645,7 +2645,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
tmp = tmp * 200 - 1500;
|
||||
if (roll < (sum += tmp))
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum - tmp, sum);
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: CRUSHING <{}, {})", sum - tmp, sum);
|
||||
return MELEE_HIT_CRUSHING;
|
||||
}
|
||||
}
|
||||
@@ -2656,7 +2656,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
|
||||
if (tmp > 0 && roll < (sum += tmp))
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum - tmp, sum);
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: CRIT <{}, {})", sum - tmp, sum);
|
||||
if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: CRIT DISABLED)");
|
||||
@@ -2754,9 +2754,9 @@ void Unit::SendMeleeAttackStop(Unit* victim)
|
||||
LOG_DEBUG("entities.unit", "WORLD: Sent SMSG_ATTACKSTOP");
|
||||
|
||||
if (victim)
|
||||
LOG_DEBUG("entities.unit", "%s %s stopped attacking %s %s", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUID().ToString().c_str(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("entities.unit", "{} {} stopped attacking {} {}", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUID().ToString(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUID().ToString());
|
||||
else
|
||||
LOG_DEBUG("entities.unit", "%s %s stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("entities.unit", "{} {} stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUID().ToString());
|
||||
}
|
||||
|
||||
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType)
|
||||
@@ -2921,7 +2921,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
|
||||
canParry = false;
|
||||
break;
|
||||
default:
|
||||
LOG_DEBUG("entities.unit", "Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
|
||||
LOG_DEBUG("entities.unit", "Spell {} SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state {}", (*i)->GetId(), (*i)->GetMiscValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3594,7 +3594,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
|
||||
|
||||
void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool withInstant, bool bySelf)
|
||||
{
|
||||
//LOG_DEBUG("entities.unit", "Interrupt spell for unit %u.", GetEntry());
|
||||
//LOG_DEBUG("entities.unit", "Interrupt spell for unit {}.", GetEntry());
|
||||
Spell* spell = m_currentSpells[spellType];
|
||||
if (spell
|
||||
&& (withDelayed || spell->getState() != SPELL_STATE_DELAYED)
|
||||
@@ -3850,8 +3850,8 @@ void SafeUnitPointer::UnitDeleted()
|
||||
{
|
||||
if (Player* p = defaultValue->ToPlayer())
|
||||
{
|
||||
LOG_INFO("misc", "SafeUnitPointer::UnitDeleted (A1) - %s, %u, %u, %u, %u, %u, %u, %u",
|
||||
p->GetGUID().ToString().c_str(), p->GetMapId(), p->GetInstanceId(), p->FindMap()->GetId(), p->IsInWorld() ? 1 : 0, p->IsDuringRemoveFromWorld() ? 1 : 0, p->IsBeingTeleported() ? 1 : 0, p->isBeingLoaded() ? 1 : 0);
|
||||
LOG_INFO("misc", "SafeUnitPointer::UnitDeleted (A1) - {}, {}, {}, {}, {}, {}, {}, {}",
|
||||
p->GetGUID().ToString(), p->GetMapId(), p->GetInstanceId(), p->FindMap()->GetId(), p->IsInWorld() ? 1 : 0, p->IsDuringRemoveFromWorld() ? 1 : 0, p->IsBeingTeleported() ? 1 : 0, p->isBeingLoaded() ? 1 : 0);
|
||||
if (ptr)
|
||||
LOG_INFO("misc", "SafeUnitPointer::UnitDeleted (A2)");
|
||||
|
||||
@@ -4099,7 +4099,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator& i, AuraRemoveMode removeMo
|
||||
|
||||
aurApp->SetRemoveMode(removeMode);
|
||||
Aura* aura = aurApp->GetBase();
|
||||
LOG_DEBUG("spells.aura", "Aura %u now is remove mode %d", aura->GetId(), removeMode);
|
||||
LOG_DEBUG("spells.aura", "Aura {} now is remove mode {}", aura->GetId(), removeMode);
|
||||
|
||||
// dead loop is killing the server probably
|
||||
ASSERT(m_removedAurasCount < 0xFFFFFFFF);
|
||||
@@ -4985,7 +4985,7 @@ void Unit::DelayOwnedAuras(uint32 spellId, ObjectGuid caster, int32 delaytime)
|
||||
|
||||
// update for out of range group members (on 1 slot use)
|
||||
aura->SetNeedClientUpdateForTargets();
|
||||
LOG_DEBUG("spells.aura", "Aura %u partially interrupted on unit %s, new duration: %u ms", aura->GetId(), GetGUID().ToString().c_str(), aura->GetDuration());
|
||||
LOG_DEBUG("spells.aura", "Aura {} partially interrupted on unit {}, new duration: {} ms", aura->GetId(), GetGUID().ToString(), aura->GetDuration());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5909,7 +5909,7 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo)
|
||||
data << float(pInfo->multiplier); // gain multiplier
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::SendPeriodicAuraLog: unknown aura %u", uint32(aura->GetAuraType()));
|
||||
LOG_ERROR("entities.unit", "Unit::SendPeriodicAuraLog: unknown aura {}", uint32(aura->GetAuraType()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6624,7 +6624,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
triggered_spell_id = 42771;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non handled spell id: %u (SW)", dummySpell->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non handled spell id: {} (SW)", dummySpell->Id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7614,7 +7614,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
break; // 8 Rank
|
||||
default:
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non handled item enchantment (rank?) {} for spell id: {} (Windfury)",
|
||||
castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)), dummySpell->Id);
|
||||
return false;
|
||||
}
|
||||
@@ -7623,7 +7623,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
SpellInfo const* windfurySpellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!windfurySpellInfo)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non-existing spell id: {} (Windfury)", spellId);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8201,7 +8201,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id);
|
||||
if (!triggerEntry)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: Spell {} has non-existing triggered spell {}", dummySpell->Id, triggered_spell_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8517,7 +8517,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
trigger_spell_id = 31643;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell {} miss posibly Blazing Speed", auraSpellInfo->Id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -8574,7 +8574,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
trigger_spell_id = 27818;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell {} not handled in BR", auraSpellInfo->Id);
|
||||
return false;
|
||||
}
|
||||
basepoints0 = CalculatePct(int32(damage), triggerAmount) / 3;
|
||||
@@ -8652,7 +8652,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
trigger_spell_id = 63468;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell {} miss posibly Piercing Shots", auraSpellInfo->Id);
|
||||
return false;
|
||||
}
|
||||
SpellInfo const* TriggerPS = sSpellMgr->GetSpellInfo(trigger_spell_id);
|
||||
@@ -8783,14 +8783,14 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
originalSpellId = 48825;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell {} not handled in HShock", procSpell->Id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
SpellInfo const* originalSpell = sSpellMgr->GetSpellInfo(originalSpellId);
|
||||
if (!originalSpell)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell {} unknown but selected as original in Illu", originalSpellId);
|
||||
return false;
|
||||
}
|
||||
// percent stored in effect 1 (class scripts) base points
|
||||
@@ -8878,7 +8878,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
if (triggerEntry == nullptr)
|
||||
{
|
||||
// Don't cast unknown spell
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u (effIndex: %u) has unknown TriggerSpell %u. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex(), trigger_spell_id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell {} (effIndex: {}) has unknown TriggerSpell {}. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex(), trigger_spell_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9436,7 +9436,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au
|
||||
|
||||
if (!triggerEntry)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleOverrideClassScriptAuraProc: Spell {} triggering for class script id {}", triggered_spell_id, scriptId);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9518,11 +9518,11 @@ FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const
|
||||
if (GetGUID() != guid)
|
||||
{
|
||||
if (Player const* player = ToPlayer())
|
||||
LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), GetFaction());
|
||||
LOG_ERROR("entities.unit", "Player {} has invalid faction (faction template id) #{}", player->GetName(), GetFaction());
|
||||
else if (Creature const* creature = ToCreature())
|
||||
LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, GetFaction());
|
||||
LOG_ERROR("entities.unit", "Creature (template id: {}) has invalid faction (faction template id) #{}", creature->GetCreatureTemplate()->Entry, GetFaction());
|
||||
else
|
||||
LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), GetFaction());
|
||||
LOG_ERROR("entities.unit", "Unit (name={}, type={}) has invalid faction (faction template id) #{}", GetName(), uint32(GetTypeId()), GetFaction());
|
||||
|
||||
guid = GetGUID();
|
||||
}
|
||||
@@ -10104,7 +10104,7 @@ Minion* Unit::GetFirstMinion() const
|
||||
if (pet->HasUnitTypeMask(UNIT_MASK_MINION))
|
||||
return (Minion*)pet;
|
||||
|
||||
LOG_ERROR("entities.unit", "Unit::GetFirstMinion: Minion %s not exist.", pet_guid.ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "Unit::GetFirstMinion: Minion {} not exist.", pet_guid.ToString());
|
||||
const_cast<Unit*>(this)->SetMinionGUID(ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
@@ -10119,7 +10119,7 @@ Guardian* Unit::GetGuardianPet() const
|
||||
if (pet->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
|
||||
return (Guardian*)pet;
|
||||
|
||||
LOG_FATAL("entities.unit", "Unit::GetGuardianPet: Guardian %s not exist.", pet_guid.ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit::GetGuardianPet: Guardian {} not exist.", pet_guid.ToString());
|
||||
const_cast<Unit*>(this)->SetPetGUID(ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
@@ -10133,7 +10133,7 @@ Unit* Unit::GetCharm() const
|
||||
if (Unit* pet = ObjectAccessor::GetUnit(*this, charm_guid))
|
||||
return pet;
|
||||
|
||||
LOG_ERROR("entities.unit", "Unit::GetCharm: Charmed creature %s not exist.", charm_guid.ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "Unit::GetCharm: Charmed creature {} not exist.", charm_guid.ToString());
|
||||
const_cast<Unit*>(this)->SetGuidValue(UNIT_FIELD_CHARM, ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
@@ -10142,13 +10142,13 @@ Unit* Unit::GetCharm() const
|
||||
|
||||
void Unit::SetMinion(Minion* minion, bool apply)
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply);
|
||||
LOG_DEBUG("entities.unit", "SetMinion {} for {}, apply {}", minion->GetEntry(), GetEntry(), apply);
|
||||
|
||||
if (apply)
|
||||
{
|
||||
if (minion->GetOwnerGUID())
|
||||
{
|
||||
LOG_FATAL("entities.unit", "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
|
||||
LOG_FATAL("entities.unit", "SetMinion: Minion {} is not the minion of owner {}", minion->GetEntry(), GetEntry());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10225,7 +10225,7 @@ void Unit::SetMinion(Minion* minion, bool apply)
|
||||
{
|
||||
if (minion->GetOwnerGUID() != GetGUID())
|
||||
{
|
||||
LOG_FATAL("entities.unit", "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
|
||||
LOG_FATAL("entities.unit", "SetMinion: Minion {} is not the minion of owner {}", minion->GetEntry(), GetEntry());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10343,7 +10343,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (!AddGuidValue(UNIT_FIELD_CHARM, charm->GetGUID()))
|
||||
LOG_FATAL("entities.unit", "Player %s is trying to charm unit %u, but it already has a charmed unit %s", GetName().c_str(), charm->GetEntry(), GetCharmGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Player {} is trying to charm unit {}, but it already has a charmed unit {}", GetName(), charm->GetEntry(), GetCharmGUID().ToString());
|
||||
|
||||
charm->m_ControlledByPlayer = true;
|
||||
// TODO: maybe we can use this flag to check if controlled by player
|
||||
@@ -10356,7 +10356,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
|
||||
|
||||
if (!charm->AddGuidValue(UNIT_FIELD_CHARMEDBY, GetGUID()))
|
||||
LOG_FATAL("entities.unit", "Unit %u is being charmed, but it already has a charmer %s", charm->GetEntry(), charm->GetCharmerGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit {} is being charmed, but it already has a charmer {}", charm->GetEntry(), charm->GetCharmerGUID().ToString());
|
||||
|
||||
if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
|
||||
charm->SetWalk(false);
|
||||
@@ -10368,11 +10368,11 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (!RemoveGuidValue(UNIT_FIELD_CHARM, charm->GetGUID()))
|
||||
LOG_FATAL("entities.unit", "Player %s is trying to uncharm unit %u, but it has another charmed unit %s", GetName().c_str(), charm->GetEntry(), GetCharmGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Player {} is trying to uncharm unit {}, but it has another charmed unit {}", GetName(), charm->GetEntry(), GetCharmGUID().ToString());
|
||||
}
|
||||
|
||||
if (!charm->RemoveGuidValue(UNIT_FIELD_CHARMEDBY, GetGUID()))
|
||||
LOG_FATAL("entities.unit", "Unit %u is being uncharmed, but it has another charmer %s", charm->GetEntry(), charm->GetCharmerGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit {} is being uncharmed, but it has another charmer {}", charm->GetEntry(), charm->GetCharmerGUID().ToString());
|
||||
|
||||
if (charm->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -10559,7 +10559,7 @@ void Unit::RemoveAllControlled(bool onDeath /*= false*/)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
|
||||
LOG_ERROR("entities.unit", "Unit {} is trying to release unit {} which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13584,7 +13584,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::UpdateSpeed: Unsupported move type (%d)", mtype);
|
||||
LOG_ERROR("entities.unit", "Unit::UpdateSpeed: Unsupported move type ({})", mtype);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13711,7 +13711,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
|
||||
data.Initialize(MSG_MOVE_SET_PITCH_RATE, 8 + 4 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
|
||||
LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type ({}), data not sent to client.", mtype);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13776,7 +13776,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
|
||||
data.Initialize(SMSG_FORCE_PITCH_RATE_CHANGE, 16);
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
|
||||
LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type ({}), data not sent to client.", mtype);
|
||||
return;
|
||||
}
|
||||
data << GetPackGUID();
|
||||
@@ -14913,7 +14913,7 @@ void Unit::RemoveFromWorld()
|
||||
|
||||
if (GetCharmerGUID())
|
||||
{
|
||||
LOG_FATAL("entities.unit", "Unit %u has charmer guid when removed from world", GetEntry());
|
||||
LOG_FATAL("entities.unit", "Unit {} has charmer guid when removed from world", GetEntry());
|
||||
ABORT();
|
||||
}
|
||||
|
||||
@@ -14923,7 +14923,7 @@ void Unit::RemoveFromWorld()
|
||||
{
|
||||
if (HasUnitTypeMask(UNIT_MASK_MINION | UNIT_MASK_GUARDIAN))
|
||||
owner->SetMinion((Minion*)this, false);
|
||||
LOG_INFO("entities.unit", "Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
|
||||
LOG_INFO("entities.unit", "Unit {} is in controlled list of {} when removed from world", GetEntry(), owner->GetEntry());
|
||||
//ABORT();
|
||||
}
|
||||
}
|
||||
@@ -15765,7 +15765,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
if (!handled && HandleAuraProc(target, damage, i->aura, procSpellInfo, procFlag, procExtra, cooldown, &handled))
|
||||
{
|
||||
uint32 Id = i->aura->GetId();
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), Id);
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell {} (triggered with value by {} aura of spell {})", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), Id);
|
||||
takeCharges = true;
|
||||
}
|
||||
|
||||
@@ -15789,7 +15789,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
{
|
||||
case SPELL_AURA_PROC_TRIGGER_SPELL:
|
||||
{
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell {} (triggered by {} aura of spell {})", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
// Don`t drop charge or add cooldown for not started trigger
|
||||
if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpellInfo, procFlag, procExtra, cooldown, procPhase))
|
||||
takeCharges = true;
|
||||
@@ -15808,7 +15808,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
case SPELL_AURA_MANA_SHIELD:
|
||||
case SPELL_AURA_DUMMY:
|
||||
{
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell id {} (triggered by {} dummy aura of spell {})", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpellInfo, procFlag, procExtra, cooldown))
|
||||
takeCharges = true;
|
||||
break;
|
||||
@@ -15817,19 +15817,19 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
|
||||
case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN:
|
||||
case SPELL_AURA_MOD_MELEE_HASTE:
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, isVictim ? "a victim's" : "an attacker's", triggeredByAura->GetId());
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell id {} (triggered by {} aura of spell {})", spellInfo->Id, isVictim ? "a victim's" : "an attacker's", triggeredByAura->GetId());
|
||||
takeCharges = true;
|
||||
break;
|
||||
case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
|
||||
{
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell id {} (triggered by {} aura of spell {})", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpellInfo, cooldown))
|
||||
takeCharges = true;
|
||||
break;
|
||||
}
|
||||
case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE:
|
||||
{
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting mending (triggered by {} dummy aura of spell {})",
|
||||
(isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
if (damage > 0)
|
||||
{
|
||||
@@ -15840,7 +15840,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
}
|
||||
case SPELL_AURA_RAID_PROC_FROM_CHARGE:
|
||||
{
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting mending (triggered by {} dummy aura of spell {})",
|
||||
(isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
HandleAuraRaidProcFromCharge(triggeredByAura);
|
||||
takeCharges = true;
|
||||
@@ -15848,7 +15848,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
}
|
||||
case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE:
|
||||
{
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell {} (triggered with value by {} aura of spell {})", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
|
||||
if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpellInfo, procFlag, procExtra, cooldown, procPhase))
|
||||
takeCharges = true;
|
||||
@@ -16793,7 +16793,7 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
|
||||
|
||||
if (!pet->InitStatsForLevel(level))
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->GetEntry());
|
||||
LOG_ERROR("entities.unit", "Pet::InitStatsForLevel() failed for creature (Entry: {})!", pet->GetEntry());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16942,7 +16942,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura)
|
||||
// Currently only Prayer of Mending
|
||||
if (!(spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20))
|
||||
{
|
||||
LOG_DEBUG("spells.aura", "Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id);
|
||||
LOG_DEBUG("spells.aura", "Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: {}", spellProto->Id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17040,7 +17040,7 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura)
|
||||
damageSpellId = 43594;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.unit", "Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleAuraRaidProcFromCharge, received unhandled spell: {}", spellProto->Id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17215,12 +17215,12 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
// Xinef: aura_spirit_of_redemption is triggered by 27827 shapeshift
|
||||
if (victim->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION) || victim->HasAura(27827))
|
||||
{
|
||||
/*LOG_INFO("misc", "Player (%s) died with spirit of redemption. Killer (Entry: %u, Name: %s), Map: %u, x: %f, y: %f, z: %f",
|
||||
victim->GetGUID().ToString().c_str(), killer ? killer->GetEntry() : 1, killer ? killer->GetName().c_str() : "", victim->GetMapId(), victim->GetPositionX(),
|
||||
/*LOG_INFO("misc", "Player ({}) died with spirit of redemption. Killer (Entry: {}, Name: {}), Map: {}, x: {}, y: {}, z: {}",
|
||||
victim->GetGUID().ToString(), killer ? killer->GetEntry() : 1, killer ? killer->GetName() : "", victim->GetMapId(), victim->GetPositionX(),
|
||||
victim->GetPositionY(), victim->GetPositionZ());
|
||||
|
||||
ACE_Stack_Trace trace(0, 50);
|
||||
LOG_INFO("misc", "TRACE: %s\n\n", trace.c_str());*/
|
||||
LOG_INFO("misc", "TRACE: {}\n\n", trace);*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -17273,7 +17273,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
// only if not player and not controlled by player pet. And not at BG
|
||||
if ((durabilityLoss && !player && !plrVictim->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
LOG_DEBUG("entities.unit", "We are dead, losing {} percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false);
|
||||
// durability lost message
|
||||
WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
|
||||
@@ -17718,12 +17718,12 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
throw 1;
|
||||
ASSERT((type == CHARM_TYPE_VEHICLE) == IsVehicle());
|
||||
|
||||
LOG_DEBUG("entities.unit", "SetCharmedBy: charmer %u (%s), charmed %u (%s), type %u.",
|
||||
charmer->GetEntry(), charmer->GetGUID().ToString().c_str(), GetEntry(), GetGUID().ToString().c_str(), uint32(type));
|
||||
LOG_DEBUG("entities.unit", "SetCharmedBy: charmer {} ({}), charmed {} ({}), type {}.",
|
||||
charmer->GetEntry(), charmer->GetGUID().ToString(), GetEntry(), GetGUID().ToString(), uint32(type));
|
||||
|
||||
if (this == charmer)
|
||||
{
|
||||
LOG_FATAL("entities.unit", "Unit::SetCharmedBy: Unit %u (%s) is trying to charm itself!", GetEntry(), GetGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit::SetCharmedBy: Unit {} ({}) is trying to charm itself!", GetEntry(), GetGUID().ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17732,15 +17732,15 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetTransport())
|
||||
{
|
||||
LOG_FATAL("entities.unit", "Unit::SetCharmedBy: Player on transport is trying to charm %u (%s)", GetEntry(), GetGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit::SetCharmedBy: Player on transport is trying to charm {} ({})", GetEntry(), GetGUID().ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Already charmed
|
||||
if (GetCharmerGUID())
|
||||
{
|
||||
LOG_FATAL("entities.unit", "Unit::SetCharmedBy: %u (%s) has already been charmed but %u (%s) is trying to charm it!",
|
||||
GetEntry(), GetGUID().ToString().c_str(), charmer->GetEntry(), charmer->GetGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit::SetCharmedBy: {} ({}) has already been charmed but {} ({}) is trying to charm it!",
|
||||
GetEntry(), GetGUID().ToString(), charmer->GetEntry(), charmer->GetGUID().ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17770,8 +17770,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
// StopCastingCharm may remove a possessed pet?
|
||||
if (!IsInWorld())
|
||||
{
|
||||
LOG_FATAL("entities.unit", "Unit::SetCharmedBy: %u (%s) is not in world but %u (%s) is trying to charm it!",
|
||||
GetEntry(), GetGUID().ToString().c_str(), charmer->GetEntry(), charmer->GetGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit::SetCharmedBy: {} ({}) is not in world but {} ({}) is trying to charm it!",
|
||||
GetEntry(), GetGUID().ToString(), charmer->GetEntry(), charmer->GetGUID().ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17897,8 +17897,8 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
charmer = GetCharmer();
|
||||
if (charmer != GetCharmer()) // one aura overrides another?
|
||||
{
|
||||
// LOG_FATAL("entities.unit", "Unit::RemoveCharmedBy: this: %s true charmer: %s false charmer: %s",
|
||||
// GetGUID().ToString().c_str(), GetCharmerGUID().ToString().c_str(), charmer->GetGUID().ToString().c_str());
|
||||
// LOG_FATAL("entities.unit", "Unit::RemoveCharmedBy: this: {} true charmer: {} false charmer: {}",
|
||||
// GetGUID().ToString(), GetCharmerGUID().ToString(), charmer->GetGUID().ToString());
|
||||
// ABORT();
|
||||
return;
|
||||
}
|
||||
@@ -17979,7 +17979,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
if (GetCharmInfo())
|
||||
GetCharmInfo()->SetPetNumber(0, true);
|
||||
else
|
||||
LOG_ERROR("entities.unit", "Aura::HandleModCharm: target=%s has a charm aura but no charm info!", GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "Aura::HandleModCharm: target={} has a charm aura but no charm info!", GetGUID().ToString());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -18892,7 +18892,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
|
||||
if (!valid)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
|
||||
LOG_ERROR("sql.sql", "Spell {} specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -18954,7 +18954,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
|
||||
{
|
||||
if (seatId >= 0 && seatId != GetTransSeat())
|
||||
{
|
||||
LOG_DEBUG("vehicles", "EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId);
|
||||
LOG_DEBUG("vehicles", "EnterVehicle: {} leave vehicle {} seat {} and enter {}.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId);
|
||||
ChangeSeat(seatId);
|
||||
}
|
||||
|
||||
@@ -18962,7 +18962,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("vehicles", "EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry());
|
||||
LOG_DEBUG("vehicles", "EnterVehicle: {} exit {} and enter {}.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry());
|
||||
ExitVehicle();
|
||||
}
|
||||
}
|
||||
@@ -19476,26 +19476,26 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
||||
void Unit::OutDebugInfo() const
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit::OutDebugInfo");
|
||||
LOG_INFO("entities.unit", "GUID %s, name %s", GetGUID().ToString().c_str(), GetName().c_str());
|
||||
LOG_INFO("entities.unit", "OwnerGUID %s, MinionGUID %s, CharmerGUID %s, CharmedGUID %s",
|
||||
GetOwnerGUID().ToString().c_str(), GetMinionGUID().ToString().c_str(), GetCharmerGUID().ToString().c_str(), GetCharmGUID().ToString().c_str());
|
||||
LOG_INFO("entities.unit", "In world %u, unit type mask %u", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask);
|
||||
LOG_INFO("entities.unit", "GUID {}, name {}", GetGUID().ToString(), GetName());
|
||||
LOG_INFO("entities.unit", "OwnerGUID {}, MinionGUID {}, CharmerGUID {}, CharmedGUID {}",
|
||||
GetOwnerGUID().ToString(), GetMinionGUID().ToString(), GetCharmerGUID().ToString(), GetCharmGUID().ToString());
|
||||
LOG_INFO("entities.unit", "In world {}, unit type mask {}", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask);
|
||||
if (IsInWorld())
|
||||
LOG_INFO("entities.unit", "Mapid %u", GetMapId());
|
||||
LOG_INFO("entities.unit", "Mapid {}", GetMapId());
|
||||
|
||||
LOG_INFO("entities.unit", "Summon Slot: ");
|
||||
for (uint32 i = 0; i < MAX_SUMMON_SLOT; ++i)
|
||||
LOG_INFO("entities.unit", "%s, ", m_SummonSlot[i].ToString().c_str());
|
||||
LOG_INFO("entities.unit", "{}, ", m_SummonSlot[i].ToString());
|
||||
LOG_INFO("server.loading", " ");
|
||||
|
||||
LOG_INFO("entities.unit", "Controlled List: ");
|
||||
for (ControlSet::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
|
||||
LOG_INFO("entities.unit", "%s, ", (*itr)->GetGUID().ToString().c_str());
|
||||
LOG_INFO("entities.unit", "{}, ", (*itr)->GetGUID().ToString());
|
||||
LOG_INFO("server.loading", " ");
|
||||
|
||||
LOG_INFO("entities.unit", "Aura List: ");
|
||||
for (AuraApplicationMap::const_iterator itr = m_appliedAuras.begin(); itr != m_appliedAuras.end(); ++itr)
|
||||
LOG_INFO("entities.unit", "%u, ", itr->first);
|
||||
LOG_INFO("entities.unit", "{}, ", itr->first);
|
||||
LOG_INFO("server.loading", " ");
|
||||
|
||||
if (IsVehicle())
|
||||
@@ -19503,12 +19503,12 @@ void Unit::OutDebugInfo() const
|
||||
LOG_INFO("entities.unit", "Passenger List: ");
|
||||
for (SeatMap::iterator itr = GetVehicleKit()->Seats.begin(); itr != GetVehicleKit()->Seats.end(); ++itr)
|
||||
if (Unit* passenger = ObjectAccessor::GetUnit(*GetVehicleBase(), itr->second.Passenger.Guid))
|
||||
LOG_INFO("entities.unit", "%s, ", passenger->GetGUID().ToString().c_str());
|
||||
LOG_INFO("entities.unit", "{}, ", passenger->GetGUID().ToString());
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
if (GetVehicle())
|
||||
LOG_INFO("entities.unit", "On vehicle %u.", GetVehicleBase()->GetEntry());
|
||||
LOG_INFO("entities.unit", "On vehicle {}.", GetVehicleBase()->GetEntry());
|
||||
}
|
||||
|
||||
class AuraMunchingQueue : public BasicEvent
|
||||
@@ -20405,7 +20405,7 @@ void Unit::Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject con
|
||||
{
|
||||
if (!sObjectMgr->GetBroadcastText(textId))
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit::Talk: `broadcast_text` (ID: %u) was not found", textId);
|
||||
LOG_ERROR("entities.unit", "Unit::Talk: `broadcast_text` (ID: {}) was not found", textId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -20440,7 +20440,7 @@ void Unit::Whisper(uint32 textId, Player* target, bool isBossWhisper /*= false*/
|
||||
BroadcastText const* bct = sObjectMgr->GetBroadcastText(textId);
|
||||
if (!bct)
|
||||
{
|
||||
LOG_ERROR("entities.unit", "Unit::Whisper: `broadcast_text` was not %u found", textId);
|
||||
LOG_ERROR("entities.unit", "Unit::Whisper: `broadcast_text` was not {} found", textId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user