mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
chore(Core/Logging): replace most server loggers (#5726)
* chore(Core/Logging): replace most server loggers Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -63,8 +63,8 @@ bool Corpse::Create(ObjectGuid::LowType guidlow, Player* owner)
|
||||
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
|
||||
guidlow, owner->GetName().c_str(), owner->GetPositionX(), owner->GetPositionY());
|
||||
LOG_ERROR("entities.player", "Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
|
||||
guidlow, owner->GetName().c_str(), owner->GetPositionX(), owner->GetPositionY());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -156,8 +156,8 @@ bool Corpse::LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields)
|
||||
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "Corpse ( %s, owner: %s) is not created, given coordinates are not valid (X: %f, Y: %f, Z: %f)",
|
||||
GetGUID().ToString().c_str(), GetOwnerGUID().ToString().c_str(), posX, posY, posZ);
|
||||
LOG_ERROR("entities.player", "Corpse ( %s, owner: %s) is not created, given coordinates are not valid (X: %f, Y: %f, Z: %f)",
|
||||
GetGUID().ToString().c_str(), GetOwnerGUID().ToString().c_str(), posX, posY, posZ);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -200,9 +200,6 @@ Creature::~Creature()
|
||||
|
||||
delete i_AI;
|
||||
i_AI = nullptr;
|
||||
|
||||
//if (m_uint32Values)
|
||||
// LOG_ERROR("server", "Deconstruct Creature Entry = %u", GetEntry());
|
||||
}
|
||||
|
||||
void Creature::AddToWorld()
|
||||
@@ -542,11 +539,11 @@ void Creature::Update(uint32 diff)
|
||||
{
|
||||
case JUST_RESPAWNED:
|
||||
// Must not be called, see Creature::setDeathState JUST_RESPAWNED -> ALIVE promoting.
|
||||
LOG_ERROR("server", "Creature (%s) in wrong state: JUST_RESPAWNED (4)", GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "Creature (%s) in wrong state: JUST_RESPAWNED (4)", GetGUID().ToString().c_str());
|
||||
break;
|
||||
case JUST_DIED:
|
||||
// Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting.
|
||||
LOG_ERROR("server", "Creature (%s) in wrong state: JUST_DEAD (1)", GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "Creature (%s) in wrong state: JUST_DEAD (1)", GetGUID().ToString().c_str());
|
||||
break;
|
||||
case DEAD:
|
||||
{
|
||||
@@ -595,9 +592,7 @@ void Creature::Update(uint32 diff)
|
||||
else if (m_corpseRemoveTime <= time(nullptr))
|
||||
{
|
||||
RemoveCorpse(false);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -910,9 +905,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
|
||||
// make sure nothing can change the AI during AI update
|
||||
if (m_AI_locked)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("scripts.ai", "AIM_Initialize: failed to init, locked.");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -970,7 +963,7 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, u
|
||||
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang);
|
||||
LOG_ERROR("entities.unit", "Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1187,7 +1180,7 @@ void Creature::SaveToDB()
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(m_spawnId);
|
||||
if (!data)
|
||||
{
|
||||
LOG_ERROR("server", "Creature::SaveToDB failed, cannot get creature data!");
|
||||
LOG_ERROR("entities.unit", "Creature::SaveToDB failed, cannot get creature data!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1635,7 +1628,7 @@ void Creature::DeleteFromDB()
|
||||
{
|
||||
if (!m_spawnId)
|
||||
{
|
||||
LOG_ERROR("server", "Trying to delete not saved creature: %s", GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "Trying to delete not saved creature: %s", GetGUID().ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1825,9 +1818,7 @@ void Creature::Respawn(bool force)
|
||||
if (m_spawnId)
|
||||
GetMap()->RemoveCreatureRespawnTime(m_spawnId);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Respawning creature %s (SpawnId: %u, %s)", GetName().c_str(), GetSpawnId(), GetGUID().ToString().c_str());
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "Respawning creature %s (SpawnId: %u, %s)", GetName().c_str(), GetSpawnId(), GetGUID().ToString().c_str());
|
||||
m_respawnTime = 0;
|
||||
ResetPickPocketLootTime();
|
||||
|
||||
@@ -1991,7 +1982,7 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* victim)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("server", "WORLD: unknown spell id %i", m_spells[i]);
|
||||
LOG_ERROR("entities.unit", "WORLD: unknown spell id %i", m_spells[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2039,7 +2030,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("server", "WORLD: unknown spell id %i", m_spells[i]);
|
||||
LOG_ERROR("entities.unit", "WORLD: unknown spell id %i", m_spells[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2115,9 +2106,7 @@ void Creature::SendAIReaction(AiReaction reactionType)
|
||||
|
||||
((WorldObject*)this)->SendMessageToSet(&data, true);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("network", "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Creature::CallAssistance()
|
||||
@@ -2445,9 +2434,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
|
||||
}
|
||||
|
||||
AddAura(*itr, this);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Spell: %u added to creature (%s)", *itr, GetGUID().ToString().c_str());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2466,7 +2453,7 @@ void Creature::SetInCombatWithZone()
|
||||
{
|
||||
if (!CanHaveThreatList())
|
||||
{
|
||||
LOG_ERROR("server", "Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
|
||||
LOG_ERROR("entities.unit", "Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2474,7 +2461,7 @@ void Creature::SetInCombatWithZone()
|
||||
|
||||
if (!map->IsDungeon())
|
||||
{
|
||||
LOG_ERROR("server", "Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), map->GetId());
|
||||
LOG_ERROR("entities.unit", "Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), map->GetId());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,17 +33,13 @@ void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member)
|
||||
//Add member to an existing group
|
||||
if (itr != map->CreatureGroupHolder.end())
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Group found: %u, inserting creature %s, Group InstanceID %u", groupId, member->GetGUID().ToString().c_str(), member->GetInstanceId());
|
||||
#endif
|
||||
itr->second->AddMember(member);
|
||||
}
|
||||
//Create new group
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Group not found: %u. Creating new group.", groupId);
|
||||
#endif
|
||||
CreatureGroup* group = new CreatureGroup(groupId);
|
||||
map->CreatureGroupHolder[groupId] = group;
|
||||
group->AddMember(member);
|
||||
@@ -52,9 +48,7 @@ void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member)
|
||||
|
||||
void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* member)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Deleting member pointer to spawnId: %u from group %u", member->GetSpawnId(), group->GetId());
|
||||
#endif
|
||||
group->RemoveMember(member);
|
||||
|
||||
if (group->isEmpty())
|
||||
@@ -63,9 +57,7 @@ void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* membe
|
||||
if (!map)
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Deleting group with InstanceID %u", member->GetInstanceId());
|
||||
#endif
|
||||
map->CreatureGroupHolder.erase(group->GetId());
|
||||
delete group;
|
||||
}
|
||||
@@ -85,7 +77,7 @@ void FormationMgr::LoadCreatureFormations()
|
||||
if (!result)
|
||||
{
|
||||
LOG_ERROR("sql.sql", ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!");
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", " ");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -137,22 +129,18 @@ void FormationMgr::LoadCreatureFormations()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server", ">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", ">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
void CreatureGroup::AddMember(Creature* member)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "CreatureGroup::AddMember: Adding unit %s.", member->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
|
||||
//Check if it is a leader
|
||||
if (member->GetSpawnId() == m_groupID)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Unit %s is formation leader. Adding group.", member->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
m_leader = member;
|
||||
}
|
||||
|
||||
@@ -180,10 +168,8 @@ void CreatureGroup::MemberAttackStart(Creature* member, Unit* target)
|
||||
|
||||
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
if (m_leader) // avoid crash if leader was killed and reset.
|
||||
LOG_DEBUG("entities.unit", "GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId());
|
||||
#endif
|
||||
|
||||
//Skip one check
|
||||
if (itr->first == member)
|
||||
@@ -213,9 +199,7 @@ void CreatureGroup::FormationReset(bool dismiss)
|
||||
itr->first->GetMotionMaster()->Initialize();
|
||||
else
|
||||
itr->first->GetMotionMaster()->MoveIdle();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Set %s movement for member %s", dismiss ? "default" : "idle", itr->first->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
m_Formed = !dismiss;
|
||||
|
||||
@@ -332,9 +332,7 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string
|
||||
|
||||
data.put<uint8>(count_pos, count);
|
||||
_session->SendPacket(&data);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC %s", npcGUID.ToString().c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, ObjectGuid npcGUID) const
|
||||
@@ -344,9 +342,7 @@ void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, ObjectGuid npcGUID) con
|
||||
data << uint8(questStatus);
|
||||
|
||||
_session->SendPacket(&data);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC %s, status=%u", npcGUID.ToString().c_str(), questStatus);
|
||||
#endif
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGUID, bool activateAccept) const
|
||||
@@ -448,9 +444,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
|
||||
}
|
||||
_session->SendPacket(&data);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS %s, questid=%u", npcGUID.ToString().c_str(), quest->GetQuestId());
|
||||
#endif
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
@@ -581,9 +575,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
data << questObjectiveText[i];
|
||||
|
||||
_session->SendPacket(&data);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", quest->GetQuestId());
|
||||
#endif
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUID, bool enableNext) const
|
||||
@@ -671,9 +663,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
|
||||
data << uint32(quest->RewardFactionValueIdOverride[i]);
|
||||
|
||||
_session->SendPacket(&data);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD %s, questid=%u", npcGUID.ToString().c_str(), quest->GetQuestId());
|
||||
#endif
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, ObjectGuid npcGUID, bool canComplete, bool closeOnCancel) const
|
||||
@@ -764,7 +754,5 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, ObjectGuid npcGU
|
||||
data << uint32(0x10);
|
||||
|
||||
_session->SendPacket(&data);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS %s, questid=%u", npcGUID.ToString().c_str(), quest->GetQuestId());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ void TempSummon::Update(uint32 diff)
|
||||
}
|
||||
default:
|
||||
UnSummon();
|
||||
LOG_ERROR("server", "Temporary summoned creature (entry: %u) have unknown type %u of ", GetEntry(), m_type);
|
||||
LOG_ERROR("entities.unit", "Temporary summoned creature (entry: %u) have unknown type %u of ", GetEntry(), m_type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -262,7 +262,7 @@ void TempSummon::RemoveFromWorld()
|
||||
owner->m_SummonSlot[slot].Clear();
|
||||
|
||||
//if (GetOwnerGUID())
|
||||
// LOG_ERROR("server", "Unit %u has owner guid when removed from world", GetEntry());
|
||||
// LOG_ERROR("entities.unit", "Unit %u has owner guid when removed from world", GetEntry());
|
||||
|
||||
Creature::RemoveFromWorld();
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caste
|
||||
Relocate(pos);
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY());
|
||||
LOG_ERROR("dyobject", "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ void GameObject::RemoveFromOwner()
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_FATAL("server", "Delete GameObject (%s Entry: %u SpellId %u LinkedGO %u) that lost references to owner %s GO list. Crash possible later.",
|
||||
LOG_FATAL("entities.gameobject", "Delete GameObject (%s Entry: %u SpellId %u LinkedGO %u) that lost references to owner %s GO list. Crash possible later.",
|
||||
GetGUID().ToString().c_str(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), ownerGUID.ToString().c_str());
|
||||
|
||||
SetOwnerGUID(ObjectGuid::Empty);
|
||||
@@ -235,7 +235,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
|
||||
m_stationaryPosition.Relocate(x, y, z, ang);
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
|
||||
LOG_ERROR("entities.gameobject", "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ void GameObject::Update(uint32 diff)
|
||||
if (AI())
|
||||
AI()->UpdateAI(diff);
|
||||
else if (!AIM_Initialize())
|
||||
LOG_ERROR("server", "Could not initialize GameObjectAI");
|
||||
LOG_ERROR("entities.gameobject", "Could not initialize GameObjectAI");
|
||||
|
||||
switch (m_lootState)
|
||||
{
|
||||
@@ -850,7 +850,7 @@ void GameObject::SaveToDB(bool saveAddon /*= false*/)
|
||||
GameObjectData const* data = sObjectMgr->GetGOData(m_spawnId);
|
||||
if (!data)
|
||||
{
|
||||
LOG_ERROR("server", "GameObject::SaveToDB failed, cannot get gameobject data!");
|
||||
LOG_ERROR("entities.gameobject", "GameObject::SaveToDB failed, cannot get gameobject data!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1456,9 +1456,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
if (info->goober.eventId)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("maps.script", "Goober ScriptStart id %u for GO entry %u (spawnId %u).", info->goober.eventId, GetEntry(), m_spawnId);
|
||||
#endif
|
||||
GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this);
|
||||
EventInform(info->goober.eventId);
|
||||
}
|
||||
@@ -1559,9 +1557,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
int32 roll = irand(1, 100);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
|
||||
#endif
|
||||
LOG_DEBUG("entities.gameobject", "Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
|
||||
|
||||
// but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
|
||||
if (chance >= roll)
|
||||
@@ -1841,7 +1837,7 @@ void GameObject::Use(Unit* user)
|
||||
}
|
||||
default:
|
||||
if (GetGoType() >= MAX_GAMEOBJECT_TYPE)
|
||||
LOG_ERROR("server", "GameObject::Use(): unit (%s, name: %s) tries to use object (%s, name: %s) of unknown type (%u)",
|
||||
LOG_ERROR("entities.gameobject", "GameObject::Use(): unit (%s, name: %s) tries to use object (%s, name: %s) of unknown type (%u)",
|
||||
user->GetGUID().ToString().c_str(), user->GetName().c_str(), GetGUID().ToString().c_str(), GetGOInfo()->name.c_str(), GetGoType());
|
||||
break;
|
||||
}
|
||||
@@ -1853,11 +1849,9 @@ void GameObject::Use(Unit* user)
|
||||
if (!spellInfo)
|
||||
{
|
||||
if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this))
|
||||
LOG_ERROR("server", "WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
|
||||
LOG_ERROR("entities.gameobject", "WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
|
||||
else
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("outdoorpvp", "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Bag::~Bag()
|
||||
{
|
||||
if (item->IsInWorld())
|
||||
{
|
||||
LOG_FATAL("server", "Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
|
||||
LOG_FATAL("entities.item", "Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
|
||||
item->GetEntry(), (uint32)item->GetSlot(), (uint32)item->GetBagSlot(),
|
||||
GetEntry(), (uint32)GetSlot(), (uint32)GetBagSlot(), (uint32)i);
|
||||
item->RemoveFromWorld();
|
||||
|
||||
@@ -85,7 +85,7 @@ void AddItemsSetItem(Player* player, Item* item)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->spells[x]);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("server", "WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
|
||||
LOG_ERROR("entities.item", "WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -287,9 +287,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
|
||||
if (!GetUInt32Value(ITEM_FIELD_DURATION))
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.player.items", "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff);
|
||||
#endif
|
||||
|
||||
if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff)
|
||||
{
|
||||
@@ -704,9 +702,7 @@ void Item::AddToUpdateQueueOf(Player* player)
|
||||
|
||||
if (player->GetGUID() != GetOwnerGUID())
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.player.items", "Item::AddToUpdateQueueOf - Owner's guid (%s) and player's guid (%s) don't match!", GetOwnerGUID().ToString().c_str(), player->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -726,9 +722,7 @@ void Item::RemoveFromUpdateQueueOf(Player* player)
|
||||
|
||||
if (player->GetGUID() != GetOwnerGUID())
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.player.items", "Item::RemoveFromUpdateQueueOf - Owner's guid (%s) and player's guid (%s) don't match!", GetOwnerGUID().ToString().c_str(), player->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,13 +58,13 @@ void LoadRandomEnchantmentsTable()
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server", ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("sql.sql", ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ WorldObject::~WorldObject()
|
||||
{
|
||||
if (GetTypeId() == TYPEID_CORPSE)
|
||||
{
|
||||
LOG_FATAL("server", "Object::~Object Corpse %s, type=%d deleted but still in map!!", GetGUID().ToString().c_str(), ((Corpse*)this)->GetType());
|
||||
LOG_FATAL("entities.object", "Object::~Object Corpse %s, type=%d deleted but still in map!!", GetGUID().ToString().c_str(), ((Corpse*)this)->GetType());
|
||||
ABORT();
|
||||
}
|
||||
ResetMap();
|
||||
@@ -88,15 +88,15 @@ Object::~Object()
|
||||
|
||||
if (IsInWorld())
|
||||
{
|
||||
LOG_FATAL("server", "Object::~Object - %s deleted but still in world!!", GetGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.object", "Object::~Object - %s deleted but still in world!!", GetGUID().ToString().c_str());
|
||||
if (isType(TYPEMASK_ITEM))
|
||||
LOG_FATAL("server", "Item slot %u", ((Item*)this)->GetSlot());
|
||||
LOG_FATAL("entities.object", "Item slot %u", ((Item*)this)->GetSlot());
|
||||
ABORT();
|
||||
}
|
||||
|
||||
if (m_objectUpdated)
|
||||
{
|
||||
LOG_FATAL("server", "Object::~Object - %s deleted but still in update list!!", GetGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.object", "Object::~Object - %s deleted but still in update list!!", GetGUID().ToString().c_str());
|
||||
ABORT();
|
||||
}
|
||||
|
||||
@@ -686,7 +686,7 @@ void Object::SetByteValue(uint16 index, uint8 offset, uint8 value)
|
||||
|
||||
if (offset > 3)
|
||||
{
|
||||
LOG_ERROR("server", "Object::SetByteValue: wrong offset %u", offset);
|
||||
LOG_ERROR("entities.object", "Object::SetByteValue: wrong offset %u", offset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value)
|
||||
|
||||
if (offset > 1)
|
||||
{
|
||||
LOG_ERROR("server", "Object::SetUInt16Value: wrong offset %u", offset);
|
||||
LOG_ERROR("entities.object", "Object::SetUInt16Value: wrong offset %u", offset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ void Object::SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
|
||||
|
||||
if (offset > 3)
|
||||
{
|
||||
LOG_ERROR("server", "Object::SetByteFlag: wrong offset %u", offset);
|
||||
LOG_ERROR("entities.object", "Object::SetByteFlag: wrong offset %u", offset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -825,7 +825,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
|
||||
|
||||
if (offset > 3)
|
||||
{
|
||||
LOG_ERROR("server", "Object::RemoveByteFlag: wrong offset %u", offset);
|
||||
LOG_ERROR("entities.object", "Object::RemoveByteFlag: wrong offset %u", offset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -840,7 +840,8 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
|
||||
|
||||
bool Object::PrintIndexError(uint32 index, bool set) const
|
||||
{
|
||||
LOG_INFO("server", "Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u", (set ? "set value to" : "get value from"), index, m_valuesCount, GetTypeId(), m_objectType);
|
||||
LOG_INFO("misc", "Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u",
|
||||
(set ? "set value to" : "get value from"), index, m_valuesCount, GetTypeId(), m_objectType);
|
||||
|
||||
// ASSERT must fail after function call
|
||||
return false;
|
||||
@@ -912,32 +913,36 @@ ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& st
|
||||
|
||||
void MovementInfo::OutDebug()
|
||||
{
|
||||
LOG_INFO("server", "MOVEMENT INFO");
|
||||
LOG_INFO("server", "guid %s", guid.ToString().c_str());
|
||||
LOG_INFO("server", "flags %u", flags);
|
||||
LOG_INFO("server", "flags2 %u", flags2);
|
||||
LOG_INFO("server", "time %u current time " UI64FMTD "", flags2, uint64(::time(nullptr)));
|
||||
LOG_INFO("server", "position: `%s`", pos.ToString().c_str());
|
||||
LOG_INFO("movement", "MOVEMENT INFO");
|
||||
LOG_INFO("movement", "guid %s", guid.ToString().c_str());
|
||||
LOG_INFO("movement", "flags %u", flags);
|
||||
LOG_INFO("movement", "flags2 %u", flags2);
|
||||
LOG_INFO("movement", "time %u current time " UI64FMTD "", flags2, uint64(::time(nullptr)));
|
||||
LOG_INFO("movement", "position: `%s`", pos.ToString().c_str());
|
||||
|
||||
if (flags & MOVEMENTFLAG_ONTRANSPORT)
|
||||
{
|
||||
LOG_INFO("server", "TRANSPORT:");
|
||||
LOG_INFO("server", "guid: %s", transport.guid.ToString().c_str());
|
||||
LOG_INFO("server", "position: `%s`", transport.pos.ToString().c_str());
|
||||
LOG_INFO("server", "seat: %i", transport.seat);
|
||||
LOG_INFO("server", "time: %u", transport.time);
|
||||
LOG_INFO("movement", "TRANSPORT:");
|
||||
LOG_INFO("movement", "guid: %s", transport.guid.ToString().c_str());
|
||||
LOG_INFO("movement", "position: `%s`", transport.pos.ToString().c_str());
|
||||
LOG_INFO("movement", "seat: %i", transport.seat);
|
||||
LOG_INFO("movement", "time: %u", transport.time);
|
||||
|
||||
if (flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT)
|
||||
LOG_INFO("server", "time2: %u", transport.time2);
|
||||
{
|
||||
LOG_INFO("movement", "time2: %u", transport.time2);
|
||||
}
|
||||
}
|
||||
|
||||
if ((flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING))
|
||||
LOG_INFO("server", "pitch: %f", pitch);
|
||||
LOG_INFO("movement", "pitch: %f", pitch);
|
||||
|
||||
LOG_INFO("server", "fallTime: %u", fallTime);
|
||||
LOG_INFO("movement", "fallTime: %u", fallTime);
|
||||
if (flags & MOVEMENTFLAG_FALLING)
|
||||
LOG_INFO("server", "j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", jump.zspeed, jump.sinAngle, jump.cosAngle, jump.xyspeed);
|
||||
LOG_INFO("movement", "j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", jump.zspeed, jump.sinAngle, jump.cosAngle, jump.xyspeed);
|
||||
|
||||
if (flags & MOVEMENTFLAG_SPLINE_ELEVATION)
|
||||
LOG_INFO("server", "splineElevation: %f", splineElevation);
|
||||
LOG_INFO("movement", "splineElevation: %f", splineElevation);
|
||||
}
|
||||
|
||||
WorldObject::WorldObject(bool isWorldObject) : WorldLocation(),
|
||||
@@ -1920,7 +1925,7 @@ namespace Acore
|
||||
ChatHandler::BuildChatPacket(data, i_msgtype, i_language, i_object, i_target, text, 0, "", loc_idx);
|
||||
}
|
||||
else
|
||||
LOG_ERROR("server", "MonsterChatBuilder: `broadcast_text` id %i missing", i_textId);
|
||||
LOG_ERROR("entities.object", "MonsterChatBuilder: `broadcast_text` id %i missing", i_textId);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -2092,7 +2097,7 @@ void WorldObject::SetMap(Map* map)
|
||||
return;
|
||||
if (m_currMap)
|
||||
{
|
||||
LOG_FATAL("server", "WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
|
||||
LOG_FATAL("entities.object", "WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
|
||||
ABORT();
|
||||
}
|
||||
m_currMap = map;
|
||||
@@ -2140,7 +2145,7 @@ void WorldObject::AddObjectToRemoveList()
|
||||
Map* map = FindMap();
|
||||
if (!map)
|
||||
{
|
||||
LOG_ERROR("server", "Object %s at attempt add to move list not have valid map (Id: %u).", GetGUID().ToString().c_str(), GetMapId());
|
||||
LOG_ERROR("entities.object", "Object %s at attempt add to move list not have valid map (Id: %u).", GetGUID().ToString().c_str(), GetMapId());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2693,7 +2698,7 @@ void WorldObject::MovePosition(Position& pos, float dist, float angle)
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!Acore::IsValidMapCoord(destx, desty))
|
||||
{
|
||||
LOG_FATAL("server", "WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
LOG_FATAL("entities.object", "WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ ByteBuffer& operator>>(ByteBuffer& buf, PackedGuidReader const& guid)
|
||||
|
||||
void ObjectGuidGeneratorBase::HandleCounterOverflow(HighGuid high)
|
||||
{
|
||||
LOG_ERROR("server", "%s guid overflow!! Can't continue, shutting down server. ", ObjectGuid::GetTypeName(high));
|
||||
LOG_ERROR("entities.object", "%s guid overflow!! Can't continue, shutting down server. ", ObjectGuid::GetTypeName(high));
|
||||
World::StopNow(ERROR_EXIT_CODE);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ void UpdateData::Compress(void* dst, uint32* dst_size, void* src, int src_size)
|
||||
int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION));
|
||||
if (z_res != Z_OK)
|
||||
{
|
||||
LOG_ERROR("server", "Can't compress update packet (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res));
|
||||
LOG_ERROR("entities.object", "Can't compress update packet (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res));
|
||||
*dst_size = 0;
|
||||
return;
|
||||
}
|
||||
@@ -60,14 +60,14 @@ void UpdateData::Compress(void* dst, uint32* dst_size, void* src, int src_size)
|
||||
z_res = deflate(&c_stream, Z_NO_FLUSH);
|
||||
if (z_res != Z_OK)
|
||||
{
|
||||
LOG_ERROR("server", "Can't compress update packet (zlib: deflate) Error code: %i (%s)", z_res, zError(z_res));
|
||||
LOG_ERROR("entities.object", "Can't compress update packet (zlib: deflate) Error code: %i (%s)", z_res, zError(z_res));
|
||||
*dst_size = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (c_stream.avail_in != 0)
|
||||
{
|
||||
LOG_ERROR("server", "Can't compress update packet (zlib: deflate not greedy)");
|
||||
LOG_ERROR("entities.object", "Can't compress update packet (zlib: deflate not greedy)");
|
||||
*dst_size = 0;
|
||||
return;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ void UpdateData::Compress(void* dst, uint32* dst_size, void* src, int src_size)
|
||||
z_res = deflate(&c_stream, Z_FINISH);
|
||||
if (z_res != Z_STREAM_END)
|
||||
{
|
||||
LOG_ERROR("server", "Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)", z_res, zError(z_res));
|
||||
LOG_ERROR("entities.object", "Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)", z_res, zError(z_res));
|
||||
*dst_size = 0;
|
||||
return;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ void UpdateData::Compress(void* dst, uint32* dst_size, void* src, int src_size)
|
||||
z_res = deflateEnd(&c_stream);
|
||||
if (z_res != Z_OK)
|
||||
{
|
||||
LOG_ERROR("server", "Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res));
|
||||
LOG_ERROR("entities.object", "Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res));
|
||||
*dst_size = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ SpellCastResult Pet::TryLoadFromDB(Player* owner, bool current /*= false*/, PetT
|
||||
CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(petentry);
|
||||
if (!creatureInfo)
|
||||
{
|
||||
LOG_ERROR("server", "Pet entry %u does not exist but used at pet load (owner: %s).", petentry, owner->GetName().c_str());
|
||||
LOG_ERROR("entities.pet", "Pet entry %u does not exist but used at pet load (owner: %s).", petentry, owner->GetName().c_str());
|
||||
return SPELL_FAILED_NO_PET;
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ void Pet::Update(uint32 diff)
|
||||
{
|
||||
if (owner->GetPetGUID() != GetGUID())
|
||||
{
|
||||
LOG_ERROR("server", "Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName().c_str());
|
||||
LOG_ERROR("entities.pet", "Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName().c_str());
|
||||
Remove(getPetType() == HUNTER_PET ? PET_SAVE_AS_DELETED : PET_SAVE_NOT_IN_SLOT);
|
||||
return;
|
||||
}
|
||||
@@ -646,7 +646,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
|
||||
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "Pet %s not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
|
||||
LOG_ERROR("entities.pet", "Pet %s not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
|
||||
GetGUID().ToString().c_str(), GetPositionX(), GetPositionY());
|
||||
return false;
|
||||
}
|
||||
@@ -654,7 +654,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
|
||||
CreatureTemplate const* cinfo = GetCreatureTemplate();
|
||||
if (!cinfo)
|
||||
{
|
||||
LOG_ERROR("server", "CreateBaseAtCreature() failed, creatureInfo is missing!");
|
||||
LOG_ERROR("entities.pet", "CreateBaseAtCreature() failed, creatureInfo is missing!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -683,9 +683,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner)
|
||||
|
||||
bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.pet", "Pet::CreateBaseForTamed");
|
||||
#endif
|
||||
ObjectGuid::LowType guid = map->GenerateLowGuid<HighGuid::Pet>();
|
||||
uint32 pet_number = sObjectMgr->GeneratePetNumber();
|
||||
if (!Create(guid, map, phaseMask, cinfo->Entry, pet_number))
|
||||
@@ -750,7 +748,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
if (petType == HUNTER_PET)
|
||||
m_unitTypeMask |= UNIT_MASK_HUNTER_PET;
|
||||
else if (petType != SUMMON_PET)
|
||||
LOG_ERROR("server", "Unknown type pet %u is summoned by player class %u", GetEntry(), owner->getClass());
|
||||
LOG_ERROR("entities.pet", "Unknown type pet %u is summoned by player class %u", GetEntry(), owner->getClass());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1143,7 +1141,7 @@ void Pet::_LoadSpellCooldowns(PreparedQueryResult result)
|
||||
|
||||
if (!sSpellMgr->GetSpellInfo(spell_id))
|
||||
{
|
||||
LOG_ERROR("server", "Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.", m_charmInfo->GetPetNumber(), spell_id);
|
||||
LOG_ERROR("entities.pet", "Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.", m_charmInfo->GetPetNumber(), spell_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1155,9 +1153,7 @@ void Pet::_LoadSpellCooldowns(PreparedQueryResult result)
|
||||
cooldowns[spell_id] = cooldown;
|
||||
_AddCreatureSpellCooldown(spell_id, cooldown);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.pet", "Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time - curTime));
|
||||
#endif
|
||||
} while (result->NextRow());
|
||||
|
||||
if (!cooldowns.empty() && GetOwner())
|
||||
@@ -1261,9 +1257,7 @@ void Pet::_SaveSpells(SQLTransaction& trans)
|
||||
|
||||
void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.pet", "Loading auras for pet %s", GetGUID().ToString().c_str());
|
||||
#endif
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -1293,7 +1287,7 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
|
||||
if (!spellInfo)
|
||||
{
|
||||
LOG_ERROR("server", "Unknown aura (spellid %u), ignore.", spellid);
|
||||
LOG_ERROR("entities.pet", "Unknown aura (spellid %u), ignore.", spellid);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1333,9 +1327,7 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
}
|
||||
aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]);
|
||||
aura->ApplyForTargets();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
|
||||
#endif
|
||||
LOG_DEBUG("entities.pet", "Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
|
||||
}
|
||||
} while (result->NextRow());
|
||||
}
|
||||
@@ -1432,7 +1424,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
|
||||
// do pet spell book cleanup
|
||||
if (state == PETSPELL_UNCHANGED) // spell load case
|
||||
{
|
||||
LOG_ERROR("server", "Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.", spellId);
|
||||
LOG_ERROR("entities.pet", "Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.", spellId);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_PET_SPELL);
|
||||
|
||||
@@ -1441,7 +1433,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
else
|
||||
LOG_ERROR("server", "Pet::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
|
||||
LOG_ERROR("entities.pet", "Pet::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2189,7 +2181,7 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as
|
||||
uint32 pet_number = sObjectMgr->GeneratePetNumber();
|
||||
if (!pet->Create(map->GenerateLowGuid<HighGuid::Pet>(), map, player->GetPhaseMask(), info->m_entry, pet_number))
|
||||
{
|
||||
LOG_ERROR("server", "no such creature entry %u", info->m_entry);
|
||||
LOG_ERROR("entities.pet", "no such creature entry %u", info->m_entry);
|
||||
delete pet;
|
||||
return;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@ bool MotionTransport::CreateMoTrans(ObjectGuid::LowType guidlow, uint32 entry, u
|
||||
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
|
||||
LOG_ERROR("entities.transport", "Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
|
||||
guidlow, x, y);
|
||||
return false;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ bool MotionTransport::CreateMoTrans(ObjectGuid::LowType guidlow, uint32 entry, u
|
||||
|
||||
if (!goinfo)
|
||||
{
|
||||
LOG_ERROR("server", "Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang);
|
||||
LOG_ERROR("entities.transport", "Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ bool MotionTransport::CreateMoTrans(ObjectGuid::LowType guidlow, uint32 entry, u
|
||||
TransportTemplate const* tInfo = sTransportMgr->GetTransportTemplate(entry);
|
||||
if (!tInfo)
|
||||
{
|
||||
LOG_ERROR("server", "Transport %u (name: %s) will not be created, missing `transport_template` entry.", entry, goinfo->name.c_str());
|
||||
LOG_ERROR("entities.transport", "Transport %u (name: %s) will not be created, missing `transport_template` entry.", entry, goinfo->name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ void MotionTransport::Update(uint32 diff)
|
||||
if (AI())
|
||||
AI()->UpdateAI(diff);
|
||||
else if (!AIM_Initialize())
|
||||
LOG_ERROR("server", "Could not initialize GameObjectAI for Transport");
|
||||
LOG_ERROR("entities.transport", "Could not initialize GameObjectAI for Transport");
|
||||
|
||||
if (GetKeyFrames().size() <= 1)
|
||||
return;
|
||||
@@ -332,7 +332,7 @@ Creature* MotionTransport::CreateNPCPassenger(ObjectGuid::LowType guid, Creature
|
||||
|
||||
if (!creature->IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "Creature (%s) not created. Suggested coordinates aren't valid (X: %f Y: %f)",
|
||||
LOG_ERROR("entities.transport", "Creature (%s) not created. Suggested coordinates aren't valid (X: %f Y: %f)",
|
||||
creature->GetGUID().ToString().c_str(), creature->GetPositionX(), creature->GetPositionY());
|
||||
delete creature;
|
||||
return nullptr;
|
||||
@@ -374,7 +374,7 @@ GameObject* MotionTransport::CreateGOPassenger(ObjectGuid::LowType guid, GameObj
|
||||
|
||||
if (!go->IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "GameObject (%s) not created. Suggested coordinates aren't valid (X: %f Y: %f)",
|
||||
LOG_ERROR("entities.transport", "GameObject (%s) not created. Suggested coordinates aren't valid (X: %f Y: %f)",
|
||||
go->GetGUID().ToString().c_str(), go->GetPositionX(), go->GetPositionY());
|
||||
delete go;
|
||||
return nullptr;
|
||||
@@ -670,7 +670,7 @@ bool StaticTransport::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* m
|
||||
m_stationaryPosition.Relocate(x, y, z, ang);
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
LOG_ERROR("server", "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
|
||||
LOG_ERROR("entities.transport", "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -844,14 +844,10 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "DealDamageStart");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "DealDamageStart");
|
||||
|
||||
uint32 health = victim->GetHealth();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "deal dmg:%d to health:%d ", damage, health);
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "deal dmg:%d to health:%d ", damage, health);
|
||||
|
||||
// duel ends when player has 1 or less hp
|
||||
bool duel_hasEnded = false;
|
||||
@@ -915,9 +911,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||
|
||||
if (health <= damage)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "DealDamage: victim just died");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "DealDamage: victim just died");
|
||||
|
||||
//if (attacker && victim->GetTypeId() == TYPEID_PLAYER && victim != attacker)
|
||||
//victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, health); // pussywizard: optimization
|
||||
@@ -926,9 +920,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "DealDamageAlive");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "DealDamageAlive");
|
||||
|
||||
//if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
// victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, damage); // pussywizard: optimization
|
||||
@@ -1019,9 +1011,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "DealDamageEnd returned %d damage", damage);
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "DealDamageEnd returned %d damage", damage);
|
||||
|
||||
return damage;
|
||||
}
|
||||
@@ -1290,9 +1280,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss)
|
||||
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(damageInfo->SpellID);
|
||||
if (spellProto == nullptr)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "Unit::DealSpellDamage has wrong damageInfo->SpellID: %u", damageInfo->SpellID);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2236,14 +2224,12 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
|
||||
DealMeleeDamage(&damageInfo, true);
|
||||
ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
LOG_DEBUG("server", "AttackerStateUpdate: (Player) %s attacked %s for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||
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);
|
||||
else
|
||||
LOG_DEBUG("server", "AttackerStateUpdate: (NPC) %s attacked %s for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||
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);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2363,7 +2349,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("server", "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 %f crit %f dodge %f parry %f block %f", 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));
|
||||
}
|
||||
@@ -2388,19 +2374,15 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
int32 sum = 0, tmp = 0;
|
||||
int32 roll = urand (0, 10000);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
|
||||
#endif
|
||||
//LOG_DEBUG("server", "RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d",
|
||||
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",
|
||||
// roll, miss_chance, dodge_chance, parry_chance, block_chance, crit_chance);
|
||||
|
||||
tmp = miss_chance;
|
||||
|
||||
if (tmp > 0 && roll < (sum += tmp))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: MISS");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: MISS");
|
||||
return MELEE_HIT_MISS;
|
||||
}
|
||||
|
||||
@@ -2409,7 +2391,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
// only players can't dodge if attacker is behind
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && !victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
//LOG_DEBUG("server", "RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
|
||||
//LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
|
||||
}
|
||||
// Xinef: do not allow to dodge with CREATURE_FLAG_EXTRA_NO_DODGE flag
|
||||
else if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_DODGE))
|
||||
@@ -2434,9 +2416,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
&& ((tmp -= skillBonus) > 0)
|
||||
&& roll < (sum += tmp))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum - tmp, sum);
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum - tmp, sum);
|
||||
return MELEE_HIT_DODGE;
|
||||
}
|
||||
}
|
||||
@@ -2446,9 +2426,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
// check if attack comes from behind, nobody can parry or block if attacker is behind
|
||||
if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: attack came from behind.");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: attack came from behind.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2470,9 +2448,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
&& (tmp -= skillBonus) > 0
|
||||
&& roll < (sum += tmp))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum - tmp, sum);
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum - tmp, sum);
|
||||
return MELEE_HIT_PARRY;
|
||||
}
|
||||
}
|
||||
@@ -2489,9 +2465,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
&& (tmp -= skillBonus) > 0
|
||||
&& roll < (sum += tmp))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum - tmp, sum);
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum - tmp, sum);
|
||||
return MELEE_HIT_BLOCK;
|
||||
}
|
||||
}
|
||||
@@ -2512,9 +2486,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
tmp = tmp > 4000 ? 4000 : tmp;
|
||||
if (roll < (sum += tmp))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum - 4000, sum);
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum - 4000, sum);
|
||||
return MELEE_HIT_GLANCING;
|
||||
}
|
||||
}
|
||||
@@ -2538,9 +2510,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
tmp = tmp * 200 - 1500;
|
||||
if (roll < (sum += tmp))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum - tmp, sum);
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum - tmp, sum);
|
||||
return MELEE_HIT_CRUSHING;
|
||||
}
|
||||
}
|
||||
@@ -2551,22 +2521,16 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
|
||||
if (tmp > 0 && roll < (sum += tmp))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum - tmp, sum);
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum - tmp, sum);
|
||||
if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: CRIT DISABLED)");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: CRIT DISABLED)");
|
||||
}
|
||||
else
|
||||
return MELEE_HIT_CRIT;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "RollMeleeOutcomeAgainst: NORMAL");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: NORMAL");
|
||||
return MELEE_HIT_NORMAL;
|
||||
}
|
||||
|
||||
@@ -2638,9 +2602,7 @@ void Unit::SendMeleeAttackStart(Unit* victim, Player* sendTo)
|
||||
sendTo->SendDirectMessage(&data);
|
||||
else
|
||||
SendMessageToSet(&data, true);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "WORLD: Sent SMSG_ATTACKSTART");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "WORLD: Sent SMSG_ATTACKSTART");
|
||||
}
|
||||
|
||||
void Unit::SendMeleeAttackStop(Unit* victim)
|
||||
@@ -2654,14 +2616,12 @@ void Unit::SendMeleeAttackStop(Unit* victim)
|
||||
data << (victim ? victim->GetPackGUID() : PackedGuid());
|
||||
data << uint32(0); //! Can also take the value 0x01, which seems related to updating rotation
|
||||
SendMessageToSet(&data, true);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "WORLD: Sent SMSG_ATTACKSTOP");
|
||||
LOG_DEBUG("entities.unit", "WORLD: Sent SMSG_ATTACKSTOP");
|
||||
|
||||
if (victim)
|
||||
LOG_DEBUG("server", "%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", "%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());
|
||||
else
|
||||
LOG_DEBUG("server", "%s %s stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUID().ToString().c_str());
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "%s %s stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUID().ToString().c_str());
|
||||
}
|
||||
|
||||
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType)
|
||||
@@ -2826,9 +2786,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
|
||||
canParry = false;
|
||||
break;
|
||||
default:
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -4162,9 +4120,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator& i, AuraRemoveMode removeMo
|
||||
|
||||
aurApp->SetRemoveMode(removeMode);
|
||||
Aura* aura = aurApp->GetBase();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Aura %u now is remove mode %d", aura->GetId(), removeMode);
|
||||
#endif
|
||||
|
||||
// dead loop is killing the server probably
|
||||
ASSERT(m_removedAurasCount < 0xFFFFFFFF);
|
||||
@@ -5044,9 +5000,7 @@ void Unit::DelayOwnedAuras(uint32 spellId, ObjectGuid caster, int32 delaytime)
|
||||
|
||||
// update for out of range group members (on 1 slot use)
|
||||
aura->SetNeedClientUpdateForTargets();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Aura %u partially interrupted on unit %s, new duration: %u ms", aura->GetId(), GetGUID().ToString().c_str(), aura->GetDuration());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5937,7 +5891,7 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo)
|
||||
data << float(pInfo->multiplier); // gain multiplier
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Unit::SendPeriodicAuraLog: unknown aura %u", uint32(aura->GetAuraType()));
|
||||
LOG_ERROR("entities.unit", "Unit::SendPeriodicAuraLog: unknown aura %u", uint32(aura->GetAuraType()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5980,9 +5934,7 @@ void Unit::SendSpellDamageImmune(Unit* target, uint32 spellId)
|
||||
|
||||
void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "WORLD: Sending SMSG_ATTACKERSTATEUPDATE");
|
||||
#endif
|
||||
|
||||
//IF we are in cheat mode we swap absorb with damage and set damage to 0, this way we can still debug damage but our hp bar will not drop
|
||||
uint32 damage = damageInfo->damage;
|
||||
@@ -6654,7 +6606,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
triggered_spell_id = 42771;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Unit::HandleDummyAuraProc: non handled spell id: %u (SW)", dummySpell->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non handled spell id: %u (SW)", dummySpell->Id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7659,7 +7611,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
break; // 8 Rank
|
||||
default:
|
||||
{
|
||||
LOG_ERROR("server", "Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
|
||||
castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)), dummySpell->Id);
|
||||
return false;
|
||||
}
|
||||
@@ -7668,7 +7620,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
SpellInfo const* windfurySpellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!windfurySpellInfo)
|
||||
{
|
||||
LOG_ERROR("server", "Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8246,7 +8198,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id);
|
||||
if (!triggerEntry)
|
||||
{
|
||||
LOG_ERROR("server", "Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8562,7 +8514,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
trigger_spell_id = 31643;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -8639,7 +8591,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
trigger_spell_id = 27818;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
|
||||
return false;
|
||||
}
|
||||
basepoints0 = CalculatePct(int32(damage), triggerAmount) / 3;
|
||||
@@ -8717,7 +8669,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
trigger_spell_id = 63468;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id);
|
||||
return false;
|
||||
}
|
||||
SpellInfo const* TriggerPS = sSpellMgr->GetSpellInfo(trigger_spell_id);
|
||||
@@ -8848,14 +8800,14 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
originalSpellId = 48825;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
SpellInfo const* originalSpell = sSpellMgr->GetSpellInfo(originalSpellId);
|
||||
if (!originalSpell)
|
||||
{
|
||||
LOG_ERROR("server", "Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId);
|
||||
return false;
|
||||
}
|
||||
// percent stored in effect 1 (class scripts) base points
|
||||
@@ -8943,7 +8895,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
if (triggerEntry == nullptr)
|
||||
{
|
||||
// Don't cast unknown spell
|
||||
// LOG_ERROR("server", "Unit::HandleProcTriggerSpell: Spell %u has 0 in EffectTriggered[%d]. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
|
||||
// LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u has 0 in EffectTriggered[%d]. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9520,7 +9472,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au
|
||||
|
||||
if (!triggerEntry)
|
||||
{
|
||||
LOG_ERROR("server", "Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9602,11 +9554,11 @@ FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const
|
||||
if (GetGUID() != guid)
|
||||
{
|
||||
if (Player const* player = ToPlayer())
|
||||
LOG_ERROR("server", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), getFaction());
|
||||
LOG_ERROR("entities.unit", "Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(), getFaction());
|
||||
else if (Creature const* creature = ToCreature())
|
||||
LOG_ERROR("server", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
|
||||
LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
|
||||
else
|
||||
LOG_ERROR("server", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), getFaction());
|
||||
LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), getFaction());
|
||||
|
||||
guid = GetGUID();
|
||||
}
|
||||
@@ -10012,7 +9964,7 @@ void Unit::RemoveAllAttackers()
|
||||
AttackerSet::iterator iter = m_attackers.begin();
|
||||
if (!(*iter)->AttackStop())
|
||||
{
|
||||
LOG_ERROR("server", "WORLD: Unit has an attacker that isn't attacking it!");
|
||||
LOG_ERROR("entities.unit", "WORLD: Unit has an attacker that isn't attacking it!");
|
||||
m_attackers.erase(iter);
|
||||
}
|
||||
}
|
||||
@@ -10165,7 +10117,7 @@ Minion* Unit::GetFirstMinion() const
|
||||
if (pet->HasUnitTypeMask(UNIT_MASK_MINION))
|
||||
return (Minion*)pet;
|
||||
|
||||
LOG_ERROR("server", "Unit::GetFirstMinion: Minion %s not exist.", pet_guid.ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "Unit::GetFirstMinion: Minion %s not exist.", pet_guid.ToString().c_str());
|
||||
const_cast<Unit*>(this)->SetMinionGUID(ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
@@ -10180,7 +10132,7 @@ Guardian* Unit::GetGuardianPet() const
|
||||
if (pet->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
|
||||
return (Guardian*)pet;
|
||||
|
||||
LOG_FATAL("server", "Unit::GetGuardianPet: Guardian %s not exist.", pet_guid.ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit::GetGuardianPet: Guardian %s not exist.", pet_guid.ToString().c_str());
|
||||
const_cast<Unit*>(this)->SetPetGUID(ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
@@ -10194,7 +10146,7 @@ Unit* Unit::GetCharm() const
|
||||
if (Unit* pet = ObjectAccessor::GetUnit(*this, charm_guid))
|
||||
return pet;
|
||||
|
||||
LOG_ERROR("server", "Unit::GetCharm: Charmed creature %s not exist.", charm_guid.ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "Unit::GetCharm: Charmed creature %s not exist.", charm_guid.ToString().c_str());
|
||||
const_cast<Unit*>(this)->SetGuidValue(UNIT_FIELD_CHARM, ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
@@ -10203,15 +10155,13 @@ Unit* Unit::GetCharm() const
|
||||
|
||||
void Unit::SetMinion(Minion* minion, bool apply)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply);
|
||||
#endif
|
||||
|
||||
if (apply)
|
||||
{
|
||||
if (minion->GetOwnerGUID())
|
||||
{
|
||||
LOG_FATAL("server", "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
|
||||
LOG_FATAL("entities.unit", "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10283,7 +10233,7 @@ void Unit::SetMinion(Minion* minion, bool apply)
|
||||
{
|
||||
if (minion->GetOwnerGUID() != GetGUID())
|
||||
{
|
||||
LOG_FATAL("server", "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
|
||||
LOG_FATAL("entities.unit", "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10399,7 +10349,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (!AddGuidValue(UNIT_FIELD_CHARM, charm->GetGUID()))
|
||||
LOG_FATAL("server", "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 %s is trying to charm unit %u, but it already has a charmed unit %s", GetName().c_str(), charm->GetEntry(), GetCharmGUID().ToString().c_str());
|
||||
|
||||
charm->m_ControlledByPlayer = true;
|
||||
// TODO: maybe we can use this flag to check if controlled by player
|
||||
@@ -10412,7 +10362,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("server", "Unit %u is being charmed, but it already has a charmer %s", charm->GetEntry(), charm->GetCharmerGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit %u is being charmed, but it already has a charmer %s", charm->GetEntry(), charm->GetCharmerGUID().ToString().c_str());
|
||||
|
||||
if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
|
||||
charm->SetWalk(false);
|
||||
@@ -10424,11 +10374,11 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (!RemoveGuidValue(UNIT_FIELD_CHARM, charm->GetGUID()))
|
||||
LOG_FATAL("server", "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 %s is trying to uncharm unit %u, but it has another charmed unit %s", GetName().c_str(), charm->GetEntry(), GetCharmGUID().ToString().c_str());
|
||||
}
|
||||
|
||||
if (!charm->RemoveGuidValue(UNIT_FIELD_CHARMEDBY, GetGUID()))
|
||||
LOG_FATAL("server", "Unit %u is being uncharmed, but it has another charmer %s", charm->GetEntry(), charm->GetCharmerGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit %u is being uncharmed, but it has another charmer %s", charm->GetEntry(), charm->GetCharmerGUID().ToString().c_str());
|
||||
|
||||
if (charm->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
@@ -10607,14 +10557,14 @@ void Unit::RemoveAllControlled()
|
||||
else if (target->GetOwnerGUID() == GetGUID() && target->IsSummon())
|
||||
target->ToTempSummon()->UnSummon();
|
||||
else
|
||||
LOG_ERROR("server", "Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
|
||||
LOG_ERROR("entities.unit", "Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
|
||||
}
|
||||
if (GetPetGUID())
|
||||
LOG_FATAL("server", "Unit %u is not able to release its pet %s", GetEntry(), GetPetGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit %u is not able to release its pet %s", GetEntry(), GetPetGUID().ToString().c_str());
|
||||
if (GetMinionGUID())
|
||||
LOG_FATAL("server", "Unit %u is not able to release its minion %s", GetEntry(), GetMinionGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit %u is not able to release its minion %s", GetEntry(), GetMinionGUID().ToString().c_str());
|
||||
if (GetCharmGUID())
|
||||
LOG_FATAL("server", "Unit %u is not able to release its charm %s", GetEntry(), GetCharmGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit %u is not able to release its charm %s", GetEntry(), GetCharmGUID().ToString().c_str());
|
||||
}
|
||||
|
||||
Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
|
||||
@@ -13568,7 +13518,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("server", "Unit::UpdateSpeed: Unsupported move type (%d)", mtype);
|
||||
LOG_ERROR("entities.unit", "Unit::UpdateSpeed: Unsupported move type (%d)", mtype);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13726,7 +13676,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("server", "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
|
||||
LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13791,7 +13741,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
|
||||
data.Initialize(SMSG_FORCE_PITCH_RATE_CHANGE, 16);
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
|
||||
LOG_ERROR("entities.unit", "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
|
||||
return;
|
||||
}
|
||||
data << GetPackGUID();
|
||||
@@ -14447,7 +14397,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f
|
||||
{
|
||||
if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
|
||||
{
|
||||
LOG_ERROR("server", "ERROR in HandleStatModifier(): non-existing UnitMods or wrong UnitModifierType!");
|
||||
LOG_ERROR("entities.unit", "ERROR in HandleStatModifier(): non-existing UnitMods or wrong UnitModifierType!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -14532,7 +14482,7 @@ float Unit::GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) co
|
||||
{
|
||||
if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
|
||||
{
|
||||
LOG_ERROR("server", "attempt to access non-existing modifier value from UnitMods!");
|
||||
LOG_ERROR("entities.unit", "attempt to access non-existing modifier value from UnitMods!");
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -14562,7 +14512,7 @@ float Unit::GetTotalAuraModValue(UnitMods unitMod) const
|
||||
{
|
||||
if (unitMod >= UNIT_MOD_END)
|
||||
{
|
||||
LOG_ERROR("server", "attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
|
||||
LOG_ERROR("entities.unit", "attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -14930,7 +14880,7 @@ void Unit::RemoveFromWorld()
|
||||
|
||||
if (GetCharmerGUID())
|
||||
{
|
||||
LOG_FATAL("server", "Unit %u has charmer guid when removed from world", GetEntry());
|
||||
LOG_FATAL("entities.unit", "Unit %u has charmer guid when removed from world", GetEntry());
|
||||
ABORT();
|
||||
}
|
||||
|
||||
@@ -14940,7 +14890,7 @@ void Unit::RemoveFromWorld()
|
||||
{
|
||||
if (HasUnitTypeMask(UNIT_MASK_MINION | UNIT_MASK_GUARDIAN))
|
||||
owner->SetMinion((Minion*)this, false);
|
||||
LOG_INFO("server", "Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
|
||||
LOG_INFO("entities.unit", "Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
|
||||
//ABORT();
|
||||
}
|
||||
}
|
||||
@@ -15776,10 +15726,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
// "handled" is needed as long as proc can be handled in multiple places
|
||||
if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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);
|
||||
#endif
|
||||
takeCharges = true;
|
||||
}
|
||||
|
||||
@@ -15803,9 +15751,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
{
|
||||
case SPELL_AURA_PROC_TRIGGER_SPELL:
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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());
|
||||
#endif
|
||||
// Don`t drop charge or add cooldown for not started trigger
|
||||
if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
|
||||
takeCharges = true;
|
||||
@@ -15824,9 +15770,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
case SPELL_AURA_MANA_SHIELD:
|
||||
case SPELL_AURA_DUMMY:
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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());
|
||||
#endif
|
||||
if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
|
||||
takeCharges = true;
|
||||
break;
|
||||
@@ -15840,19 +15784,15 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
break;
|
||||
case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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());
|
||||
#endif
|
||||
if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpell, cooldown))
|
||||
takeCharges = true;
|
||||
break;
|
||||
}
|
||||
case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE:
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
|
||||
(isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
#endif
|
||||
if (damage > 0)
|
||||
{
|
||||
HandleAuraRaidProcFromChargeWithValue(triggeredByAura);
|
||||
@@ -15862,19 +15802,15 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
|
||||
}
|
||||
case SPELL_AURA_RAID_PROC_FROM_CHARGE:
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)",
|
||||
(isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId());
|
||||
#endif
|
||||
HandleAuraRaidProcFromCharge(triggeredByAura);
|
||||
takeCharges = true;
|
||||
break;
|
||||
}
|
||||
case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE:
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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());
|
||||
#endif
|
||||
|
||||
if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
|
||||
takeCharges = true;
|
||||
@@ -16691,7 +16627,7 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
|
||||
|
||||
if (!pet->InitStatsForLevel(level))
|
||||
{
|
||||
LOG_ERROR("server", "Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->GetEntry());
|
||||
LOG_ERROR("entities.unit", "Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->GetEntry());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16836,9 +16772,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura)
|
||||
// Currently only Prayer of Mending
|
||||
if (!(spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("spells.aura", "Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16936,7 +16870,7 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura)
|
||||
damageSpellId = 43594;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->Id);
|
||||
LOG_ERROR("entities.unit", "Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->Id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17144,9 +17078,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
|
||||
if (!spiritOfRedemption)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "SET JUST_DIED");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "SET JUST_DIED");
|
||||
victim->setDeathState(JUST_DIED);
|
||||
}
|
||||
|
||||
@@ -17171,9 +17103,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)))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "We are dead, losing %f 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);
|
||||
@@ -17193,9 +17123,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
}
|
||||
else // creature died
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "DealDamageNotPlayer");
|
||||
#endif
|
||||
LOG_DEBUG("entities.unit", "DealDamageNotPlayer");
|
||||
|
||||
if (!creature->IsPet() && creature->GetLootMode() > 0)
|
||||
{
|
||||
@@ -17635,14 +17563,12 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
throw 1;
|
||||
ASSERT((type == CHARM_TYPE_VEHICLE) == IsVehicle());
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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));
|
||||
#endif
|
||||
|
||||
if (this == charmer)
|
||||
{
|
||||
LOG_FATAL("server", "Unit::SetCharmedBy: Unit %u (%s) is trying to charm itself!", GetEntry(), GetGUID().ToString().c_str());
|
||||
LOG_FATAL("entities.unit", "Unit::SetCharmedBy: Unit %u (%s) is trying to charm itself!", GetEntry(), GetGUID().ToString().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17651,14 +17577,14 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetTransport())
|
||||
{
|
||||
LOG_FATAL("server", "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 %u (%s)", GetEntry(), GetGUID().ToString().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Already charmed
|
||||
if (GetCharmerGUID())
|
||||
{
|
||||
LOG_FATAL("server", "Unit::SetCharmedBy: %u (%s) has already been charmed but %u (%s) is trying to charm it!",
|
||||
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());
|
||||
return false;
|
||||
}
|
||||
@@ -17689,7 +17615,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
// StopCastingCharm may remove a possessed pet?
|
||||
if (!IsInWorld())
|
||||
{
|
||||
LOG_FATAL("server", "Unit::SetCharmedBy: %u (%s) is not in world but %u (%s) is trying to charm it!",
|
||||
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());
|
||||
return false;
|
||||
}
|
||||
@@ -17819,7 +17745,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
charmer = GetCharmer();
|
||||
if (charmer != GetCharmer()) // one aura overrides another?
|
||||
{
|
||||
// LOG_FATAL("server", "Unit::RemoveCharmedBy: this: %s true charmer: %s false charmer: %s",
|
||||
// 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());
|
||||
// ABORT();
|
||||
return;
|
||||
@@ -17904,7 +17830,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
if (GetCharmInfo())
|
||||
GetCharmInfo()->SetPetNumber(0, true);
|
||||
else
|
||||
LOG_ERROR("server", "Aura::HandleModCharm: target=%s has a charm aura but no charm info!", GetGUID().ToString().c_str());
|
||||
LOG_ERROR("entities.unit", "Aura::HandleModCharm: target=%s has a charm aura but no charm info!", GetGUID().ToString().c_str());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -18878,9 +18804,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
|
||||
{
|
||||
if (seatId >= 0 && seatId != GetTransSeat())
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId);
|
||||
#endif
|
||||
ChangeSeat(seatId);
|
||||
}
|
||||
|
||||
@@ -18888,9 +18812,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry());
|
||||
#endif
|
||||
ExitVehicle();
|
||||
}
|
||||
}
|
||||
@@ -19299,9 +19221,7 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference)
|
||||
{
|
||||
uint32 count = getThreatManager().getThreatList().size();
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message");
|
||||
#endif
|
||||
WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8);
|
||||
data << GetPackGUID();
|
||||
data << pHostileReference->getUnitGuid().WriteAsPacked();
|
||||
@@ -19318,9 +19238,7 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference)
|
||||
|
||||
void Unit::SendClearThreatListOpcode()
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "WORLD: Send SMSG_THREAT_CLEAR Message");
|
||||
#endif
|
||||
WorldPacket data(SMSG_THREAT_CLEAR, 8);
|
||||
data << GetPackGUID();
|
||||
SendMessageToSet(&data, false);
|
||||
@@ -19328,9 +19246,7 @@ void Unit::SendClearThreatListOpcode()
|
||||
|
||||
void Unit::SendRemoveFromThreatListOpcode(HostileReference* pHostileReference)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("entities.unit", "WORLD: Send SMSG_THREAT_REMOVE Message");
|
||||
#endif
|
||||
WorldPacket data(SMSG_THREAT_REMOVE, 8 + 8);
|
||||
data << GetPackGUID();
|
||||
data << pHostileReference->getUnitGuid().WriteAsPacked();
|
||||
@@ -19404,40 +19320,40 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
||||
|
||||
void Unit::OutDebugInfo() const
|
||||
{
|
||||
LOG_ERROR("server", "Unit::OutDebugInfo");
|
||||
LOG_INFO("server", "GUID %s, name %s", GetGUID().ToString().c_str(), GetName().c_str());
|
||||
LOG_INFO("server", "OwnerGUID %s, MinionGUID %s, CharmerGUID %s, CharmedGUID %s",
|
||||
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("server", "In world %u, unit type mask %u", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask);
|
||||
LOG_INFO("entities.unit", "In world %u, unit type mask %u", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask);
|
||||
if (IsInWorld())
|
||||
LOG_INFO("server", "Mapid %u", GetMapId());
|
||||
LOG_INFO("entities.unit", "Mapid %u", GetMapId());
|
||||
|
||||
LOG_INFO("server", "Summon Slot: ");
|
||||
LOG_INFO("entities.unit", "Summon Slot: ");
|
||||
for (uint32 i = 0; i < MAX_SUMMON_SLOT; ++i)
|
||||
LOG_INFO("server", "%s, ", m_SummonSlot[i].ToString().c_str());
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("entities.unit", "%s, ", m_SummonSlot[i].ToString().c_str());
|
||||
LOG_INFO("server.loading", " ");
|
||||
|
||||
LOG_INFO("server", "Controlled List: ");
|
||||
LOG_INFO("entities.unit", "Controlled List: ");
|
||||
for (ControlSet::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
|
||||
LOG_INFO("server", "%s, ", (*itr)->GetGUID().ToString().c_str());
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("entities.unit", "%s, ", (*itr)->GetGUID().ToString().c_str());
|
||||
LOG_INFO("server.loading", " ");
|
||||
|
||||
LOG_INFO("server", "Aura List: ");
|
||||
LOG_INFO("entities.unit", "Aura List: ");
|
||||
for (AuraApplicationMap::const_iterator itr = m_appliedAuras.begin(); itr != m_appliedAuras.end(); ++itr)
|
||||
LOG_INFO("server", "%u, ", itr->first);
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("entities.unit", "%u, ", itr->first);
|
||||
LOG_INFO("server.loading", " ");
|
||||
|
||||
if (IsVehicle())
|
||||
{
|
||||
LOG_INFO("server", "Passenger List: ");
|
||||
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("server", "%s, ", passenger->GetGUID().ToString().c_str());
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("entities.unit", "%s, ", passenger->GetGUID().ToString().c_str());
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
if (GetVehicle())
|
||||
LOG_INFO("server", "On vehicle %u.", GetVehicleBase()->GetEntry());
|
||||
LOG_INFO("entities.unit", "On vehicle %u.", GetVehicleBase()->GetEntry());
|
||||
}
|
||||
|
||||
class AuraMunchingQueue : public BasicEvent
|
||||
|
||||
@@ -50,13 +50,12 @@ Vehicle::~Vehicle()
|
||||
{
|
||||
if (Unit* unit = ObjectAccessor::GetUnit(*_me, itr->second.Passenger.Guid))
|
||||
{
|
||||
LOG_INFO("server", "ZOMG! ~Vehicle(), unit: %s, entry: %u, typeid: %u, this_entry: %u, this_typeid: %u!", unit->GetName().c_str(), unit->GetEntry(), unit->GetTypeId(), _me ? _me->GetEntry() : 0, _me ? _me->GetTypeId() : 0);
|
||||
LOG_FATAL("vehicles", "ZOMG! ~Vehicle(), unit: %s, entry: %u, typeid: %u, this_entry: %u, this_typeid: %u!", unit->GetName().c_str(), unit->GetEntry(), unit->GetTypeId(), _me ? _me->GetEntry() : 0, _me ? _me->GetTypeId() : 0);
|
||||
unit->_ExitVehicle();
|
||||
}
|
||||
else
|
||||
LOG_INFO("server", "ZOMG! ~Vehicle(), unknown guid!");
|
||||
LOG_FATAL("vehicles", "ZOMG! ~Vehicle(), unknown guid!");
|
||||
}
|
||||
//ASSERT(!itr->second.IsEmpty());
|
||||
}
|
||||
|
||||
void Vehicle::Install()
|
||||
@@ -93,14 +92,12 @@ void Vehicle::Uninstall()
|
||||
/// @Prevent recursive uninstall call. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.)
|
||||
if (_status == STATUS_UNINSTALLING && !GetBase()->HasUnitTypeMask(UNIT_MASK_MINION))
|
||||
{
|
||||
LOG_ERROR("server", "Vehicle %s attempts to uninstall, but already has STATUS_UNINSTALLING! "
|
||||
LOG_ERROR("vehicles", "Vehicle %s attempts to uninstall, but already has STATUS_UNINSTALLING! "
|
||||
"Check Uninstall/PassengerBoarded script hooks for errors.", _me->GetGUID().ToString().c_str());
|
||||
return;
|
||||
}
|
||||
_status = STATUS_UNINSTALLING;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "Vehicle::Uninstall %s", _me->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
RemoveAllPassengers();
|
||||
|
||||
if (GetBase()->GetTypeId() == TYPEID_UNIT)
|
||||
@@ -109,9 +106,7 @@ void Vehicle::Uninstall()
|
||||
|
||||
void Vehicle::Reset(bool evading /*= false*/)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "Vehicle::Reset: %s", _me->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
if (_me->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (_usableSeatNum)
|
||||
@@ -195,9 +190,7 @@ void Vehicle::ApplyAllImmunities()
|
||||
|
||||
void Vehicle::RemoveAllPassengers()
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "Vehicle::RemoveAllPassengers. %s", _me->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
|
||||
// Passengers always cast an aura with SPELL_AURA_CONTROL_VEHICLE on the vehicle
|
||||
// We just remove the aura and the unapply handler will make the target leave the vehicle.
|
||||
@@ -261,14 +254,12 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ
|
||||
/// @Prevent adding accessories when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.)
|
||||
if (_status == STATUS_UNINSTALLING)
|
||||
{
|
||||
LOG_ERROR("server", "Vehicle %s attempts to install accessory Entry: %u on seat %d with STATUS_UNINSTALLING! "
|
||||
LOG_ERROR("vehicles", "Vehicle %s attempts to install accessory Entry: %u on seat %d with STATUS_UNINSTALLING! "
|
||||
"Check Uninstall/PassengerBoarded script hooks for errors.", _me->GetGUID().ToString().c_str(), entry, (int32)seatId);
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "Vehicle: Installing accessory entry %u on vehicle entry %u (seat:%i)", entry, GetCreatureEntry(), seatId);
|
||||
#endif
|
||||
if (Unit* passenger = GetPassenger(seatId))
|
||||
{
|
||||
// already installed
|
||||
@@ -307,10 +298,8 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
|
||||
/// @Prevent adding passengers when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.)
|
||||
if (_status == STATUS_UNINSTALLING)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "Passenger %s, attempting to board vehicle %s during uninstall! SeatId: %i",
|
||||
unit->GetGUID().ToString().c_str(), _me->GetGUID().ToString().c_str(), (int32)seatId);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -344,10 +333,8 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
|
||||
ASSERT(seat->second.IsEmpty());
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "Unit %s enter vehicle entry %u id %u (%s) seat %d",
|
||||
unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUID().ToString().c_str(), (int32)seat->first);
|
||||
#endif
|
||||
|
||||
seat->second.Passenger.Guid = unit->GetGUID();
|
||||
seat->second.Passenger.IsUnselectable = unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -394,15 +381,15 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
LOG_INFO("server", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy()!");
|
||||
LOG_INFO("server", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). not null: %u", _me ? 1 : 0);
|
||||
LOG_INFO("vehicles", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy()!");
|
||||
LOG_INFO("vehicles", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). not null: %u", _me ? 1 : 0);
|
||||
if (!_me)
|
||||
return false;
|
||||
LOG_INFO("server", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). Is: %u!", _me->IsInWorld());
|
||||
LOG_INFO("server", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). Is2: %u!", _me->IsDuringRemoveFromWorld());
|
||||
LOG_INFO("server", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). Unit %s!", _me->GetName().c_str());
|
||||
LOG_INFO("server", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). typeid: %u!", _me->GetTypeId());
|
||||
LOG_INFO("server", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). Unit %s, typeid: %u, in world: %u, duringremove: %u has wrong CharmType! Charmer %s, typeid: %u, in world: %u, duringremove: %u.", _me->GetName().c_str(), _me->GetTypeId(), _me->IsInWorld(), _me->IsDuringRemoveFromWorld(), unit->GetName().c_str(), unit->GetTypeId(), unit->IsInWorld(), unit->IsDuringRemoveFromWorld());
|
||||
LOG_INFO("vehicles", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). Is: %u!", _me->IsInWorld());
|
||||
LOG_INFO("vehicles", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). Is2: %u!", _me->IsDuringRemoveFromWorld());
|
||||
LOG_INFO("vehicles", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). Unit %s!", _me->GetName().c_str());
|
||||
LOG_INFO("vehicles", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). typeid: %u!", _me->GetTypeId());
|
||||
LOG_INFO("vehicles", "ZOMG! CRASH! Try-catch in Unit::SetCharmedBy(). Unit %s, typeid: %u, in world: %u, duringremove: %u has wrong CharmType! Charmer %s, typeid: %u, in world: %u, duringremove: %u.", _me->GetName().c_str(), _me->GetTypeId(), _me->IsInWorld(), _me->IsDuringRemoveFromWorld(), unit->GetName().c_str(), unit->GetTypeId(), unit->IsInWorld(), unit->IsDuringRemoveFromWorld());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -456,10 +443,8 @@ void Vehicle::RemovePassenger(Unit* unit)
|
||||
if (seat == Seats.end())
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "Unit %s exit vehicle entry %u id %u (%s) seat %d",
|
||||
unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUID().ToString().c_str(), (int32)seat->first);
|
||||
#endif
|
||||
|
||||
if (seat->second.SeatInfo->CanEnterOrExit() && ++_usableSeatNum)
|
||||
_me->SetFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));
|
||||
@@ -525,9 +510,7 @@ void Vehicle::Dismiss()
|
||||
if (GetBase()->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("vehicles", "Vehicle::Dismiss %s", _me->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Uninstall();
|
||||
GetBase()->ToCreature()->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user