mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 22:26:22 +00:00
refactor(Core/Misc): acore to Acore (#6043)
This commit is contained in:
@@ -74,7 +74,7 @@ bool Corpse::Create(ObjectGuid::LowType guidlow, Player* owner)
|
||||
SetObjectScale(1);
|
||||
SetGuidValue(CORPSE_FIELD_OWNER, owner->GetGUID());
|
||||
|
||||
_cellCoord = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
_cellCoord = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ bool Corpse::LoadCorpseFromDB(ObjectGuid::LowType guid, Field* fields)
|
||||
return false;
|
||||
}
|
||||
|
||||
_cellCoord = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
_cellCoord = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ void Creature::RemoveFromWorld()
|
||||
Unit::RemoveFromWorld();
|
||||
|
||||
if (m_spawnId)
|
||||
acore::Containers::MultimapErasePair(GetMap()->GetCreatureBySpawnIdStore(), m_spawnId, this);
|
||||
Acore::Containers::MultimapErasePair(GetMap()->GetCreatureBySpawnIdStore(), m_spawnId, this);
|
||||
|
||||
GetMap()->GetObjectsStore().Remove<Creature>(GetGUID());
|
||||
}
|
||||
@@ -888,13 +888,13 @@ void Creature::DoFleeToGetAssistance()
|
||||
{
|
||||
Creature* creature = nullptr;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
Acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
Acore::CreatureLastSearcher<Acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureLastSearcher<acore::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::CreatureLastSearcher<Acore::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
|
||||
@@ -1545,7 +1545,7 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad
|
||||
if (CanFly())
|
||||
{
|
||||
float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, true, MAX_FALL_DISTANCE);
|
||||
if (data->posZ - tz > 0.1f && acore::IsValidMapCoord(tz))
|
||||
if (data->posZ - tz > 0.1f && Acore::IsValidMapCoord(tz))
|
||||
{
|
||||
Relocate(data->posX, data->posY, tz);
|
||||
}
|
||||
@@ -2077,7 +2077,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
|
||||
// select nearest hostile unit within the given distance (regardless of threat list).
|
||||
Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) const
|
||||
{
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
@@ -2087,11 +2087,11 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
||||
if (dist == 0.0f)
|
||||
dist = MAX_SEARCHER_DISTANCE;
|
||||
|
||||
acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
|
||||
acore::UnitLastSearcher<acore::NearestHostileUnitCheck> searcher(this, target, u_check);
|
||||
Acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
|
||||
Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck> searcher(this, target, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
|
||||
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
|
||||
@@ -2103,7 +2103,7 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
||||
// select nearest hostile unit within the given attack distance (i.e. distance is ignored if > than ATTACK_DISTANCE), regardless of threat list.
|
||||
Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
||||
{
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
@@ -2115,11 +2115,11 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
||||
dist = MAX_SEARCHER_DISTANCE;
|
||||
|
||||
{
|
||||
acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
|
||||
acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
|
||||
Acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
|
||||
Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<acore::UnitLastSearcher<acore::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
cell.Visit(p, world_unit_searcher, *GetMap(), *this, dist);
|
||||
cell.Visit(p, grid_unit_searcher, *GetMap(), *this, dist);
|
||||
@@ -2155,14 +2155,14 @@ void Creature::CallAssistance()
|
||||
std::list<Creature*> assistList;
|
||||
|
||||
{
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
||||
acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
Acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
||||
Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
}
|
||||
@@ -2187,14 +2187,14 @@ void Creature::CallForHelp(float radius)
|
||||
if (radius <= 0.0f || !GetVictim() || IsPet() || IsCharmed())
|
||||
return;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
Acore::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
Acore::CreatureWorker<Acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureWorker<acore::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
TypeContainerVisitor<Acore::CreatureWorker<Acore::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
|
||||
cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
|
||||
}
|
||||
@@ -2828,7 +2828,7 @@ std::string const& Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const
|
||||
|
||||
void Creature::SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
if (!acore::IsValidMapCoord(x, y, z, o))
|
||||
if (!Acore::IsValidMapCoord(x, y, z, o))
|
||||
return;
|
||||
|
||||
GetMap()->CreatureRelocation(this, x, y, z, o);
|
||||
|
||||
@@ -262,8 +262,8 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z, bool run)
|
||||
float dy = y + sin(followAngle + pathAngle) * followDist;
|
||||
float dz = z;
|
||||
|
||||
acore::NormalizeMapCoord(dx);
|
||||
acore::NormalizeMapCoord(dy);
|
||||
Acore::NormalizeMapCoord(dx);
|
||||
Acore::NormalizeMapCoord(dy);
|
||||
|
||||
member->UpdateGroundPositionZ(dx, dy, dz);
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ void GameObject::RemoveFromWorld()
|
||||
WorldObject::RemoveFromWorld();
|
||||
|
||||
if (m_spawnId)
|
||||
acore::Containers::MultimapErasePair(GetMap()->GetGameObjectBySpawnIdStore(), m_spawnId, this);
|
||||
Acore::Containers::MultimapErasePair(GetMap()->GetGameObjectBySpawnIdStore(), m_spawnId, this);
|
||||
GetMap()->GetObjectsStore().Remove<GameObject>(GetGUID());
|
||||
}
|
||||
}
|
||||
@@ -459,7 +459,7 @@ void GameObject::Update(uint32 diff)
|
||||
if (info->summoningRitual.casterTargetSpell && info->summoningRitual.casterTargetSpell != 1) // No idea why this field is a bool in some cases
|
||||
for (uint32 i = 0; i < info->summoningRitual.casterTargetSpellTargets; i++)
|
||||
// m_unique_users can contain only player GUIDs
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*this, acore::Containers::SelectRandomContainerElement(m_unique_users)))
|
||||
if (Player* target = ObjectAccessor::GetPlayer(*this, Acore::Containers::SelectRandomContainerElement(m_unique_users)))
|
||||
spellCaster->CastSpell(target, info->summoningRitual.casterTargetSpell, true);
|
||||
|
||||
// finish owners spell
|
||||
@@ -608,8 +608,8 @@ void GameObject::Update(uint32 diff)
|
||||
// search unfriendly creature
|
||||
if (owner) // hunter trap
|
||||
{
|
||||
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
acore::UnitSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
Acore::UnitSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyGridObject(radius, searcher);
|
||||
if (!target)
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
@@ -619,8 +619,8 @@ void GameObject::Update(uint32 diff)
|
||||
// environmental damage spells already have around enemies targeting but this not help in case not existed GO casting support
|
||||
// affect only players
|
||||
Player* player = nullptr;
|
||||
acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
target = player;
|
||||
}
|
||||
@@ -1189,13 +1189,13 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
||||
GameObject* trapGO = nullptr;
|
||||
{
|
||||
// using original GO distance
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
acore::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
|
||||
Acore::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
|
||||
|
||||
TypeContainerVisitor<acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
TypeContainerVisitor<Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
cell.Visit(p, object_checker, *GetMap(), *target, range);
|
||||
}
|
||||
|
||||
@@ -1209,12 +1209,12 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
||||
{
|
||||
GameObject* ok = nullptr;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
CellCoord p(Acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
acore::NearestGameObjectFishingHole u_check(*this, range);
|
||||
acore::GameObjectSearcher<acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
Acore::NearestGameObjectFishingHole u_check(*this, range);
|
||||
Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
|
||||
TypeContainerVisitor<acore::GameObjectSearcher<acore::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
TypeContainerVisitor<Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell.Visit(p, grid_object_checker, *GetMap(), *this, range);
|
||||
|
||||
return ok;
|
||||
@@ -1977,7 +1977,7 @@ void GameObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*s
|
||||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION * 2.0f; // pussywizard: to ensure everyone receives all important packets
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
@@ -2481,7 +2481,7 @@ void GameObject::SetPosition(float x, float y, float z, float o)
|
||||
{
|
||||
// pussywizard: do not call for MotionTransport and other gobjects not in grid
|
||||
|
||||
if (!acore::IsValidMapCoord(x, y, z, o))
|
||||
if (!Acore::IsValidMapCoord(x, y, z, o))
|
||||
return;
|
||||
|
||||
GetMap()->GameObjectRelocation(this, x, y, z, o);
|
||||
|
||||
@@ -1410,8 +1410,8 @@ void WorldObject::GetRandomPoint(const Position& pos, float distance, float& ran
|
||||
rand_y = pos.m_positionY + new_dist * sin(angle);
|
||||
rand_z = pos.m_positionZ;
|
||||
|
||||
acore::NormalizeMapCoord(rand_x);
|
||||
acore::NormalizeMapCoord(rand_y);
|
||||
Acore::NormalizeMapCoord(rand_x);
|
||||
Acore::NormalizeMapCoord(rand_y);
|
||||
UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
|
||||
}
|
||||
|
||||
@@ -1510,7 +1510,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, float* grou
|
||||
|
||||
bool Position::IsPositionValid() const
|
||||
{
|
||||
return acore::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
return Acore::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation);
|
||||
}
|
||||
|
||||
float WorldObject::GetGridActivationRange() const
|
||||
@@ -1900,7 +1900,7 @@ void Object::ForceValuesUpdateAtIndex(uint32 i)
|
||||
AddToObjectUpdateIfNeeded();
|
||||
}
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
class MonsterChatBuilder
|
||||
{
|
||||
@@ -1948,61 +1948,61 @@ namespace acore
|
||||
Language i_language;
|
||||
WorldObject const* i_target;
|
||||
};
|
||||
} // namespace acore
|
||||
} // namespace Acore
|
||||
|
||||
void WorldObject::MonsterSay(const char* text, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, text, language, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterSay(int32 textId, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_SAY, textId, language, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(const char* text, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterCustomChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, text, language, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterCustomChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
void WorldObject::MonsterYell(int32 textId, uint32 language, WorldObject const* target)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterChatBuilder say_build(this, CHAT_MSG_MONSTER_YELL, textId, language, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
@@ -2016,15 +2016,15 @@ void WorldObject::MonsterTextEmote(const char* text, WorldObject const* target,
|
||||
|
||||
void WorldObject::MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
|
||||
acore::LocalizedPacketDo<acore::MonsterChatBuilder> say_do(say_build);
|
||||
acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
|
||||
TypeContainerVisitor<acore::PlayerDistWorker<acore::LocalizedPacketDo<acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
Acore::MonsterChatBuilder say_build(this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, target);
|
||||
Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> say_do(say_build);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> > say_worker(this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)), say_do);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker);
|
||||
cell.Visit(p, message, *GetMap(), *this, (IsBossEmote ? 200.0f : sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)));
|
||||
}
|
||||
|
||||
@@ -2072,7 +2072,7 @@ void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*
|
||||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
@@ -2404,8 +2404,8 @@ void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list
|
||||
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
|
||||
{
|
||||
Creature* creature = nullptr;
|
||||
acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
acore::CreatureLastSearcher<acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
Acore::CreatureLastSearcher<Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
VisitNearbyObject(range, searcher);
|
||||
return creature;
|
||||
}
|
||||
@@ -2413,8 +2413,8 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
|
||||
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
||||
{
|
||||
GameObject* go = nullptr;
|
||||
acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
Acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
return go;
|
||||
}
|
||||
@@ -2422,8 +2422,8 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
||||
GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float range) const
|
||||
{
|
||||
GameObject* go = nullptr;
|
||||
acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
Acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
return go;
|
||||
}
|
||||
@@ -2432,8 +2432,8 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
||||
{
|
||||
Player* target = nullptr;
|
||||
|
||||
acore::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
acore::PlayerLastSearcher<acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
Acore::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
Acore::PlayerLastSearcher<Acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyObject(distance, searcher);
|
||||
|
||||
return target;
|
||||
@@ -2441,32 +2441,32 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
||||
|
||||
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
|
||||
TypeContainerVisitor<acore::GameObjectListSearcher<acore::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
Acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
Acore::GameObjectListSearcher<Acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
|
||||
TypeContainerVisitor<Acore::GameObjectListSearcher<Acore::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
|
||||
}
|
||||
|
||||
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
|
||||
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
Acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
|
||||
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
|
||||
|
||||
cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange);
|
||||
}
|
||||
|
||||
/*
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
class NearUsedPosDo
|
||||
{
|
||||
@@ -2535,7 +2535,7 @@ namespace acore
|
||||
float i_angle;
|
||||
ObjectPosSelector& i_selector;
|
||||
};
|
||||
} // namespace acore
|
||||
} // namespace Acore
|
||||
*/
|
||||
|
||||
//===================================================================================================
|
||||
@@ -2565,8 +2565,8 @@ void WorldObject::GetNearPoint2D(WorldObject const* searcher, float& x, float& y
|
||||
x = GetPositionX() + (effectiveReach + distance2d) * std::cos(absAngle);
|
||||
y = GetPositionY() + (effectiveReach + distance2d) * std::sin(absAngle);
|
||||
|
||||
acore::NormalizeMapCoord(x);
|
||||
acore::NormalizeMapCoord(y);
|
||||
Acore::NormalizeMapCoord(x);
|
||||
Acore::NormalizeMapCoord(y);
|
||||
}
|
||||
|
||||
void WorldObject::GetNearPoint2D(float& x, float& y, float distance2d, float absAngle) const
|
||||
@@ -2702,7 +2702,7 @@ void WorldObject::MovePosition(Position& pos, float dist, float angle)
|
||||
desty = pos.m_positionY + dist * sin(angle);
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!acore::IsValidMapCoord(destx, desty))
|
||||
if (!Acore::IsValidMapCoord(destx, desty))
|
||||
{
|
||||
LOG_FATAL("server", "WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
|
||||
return;
|
||||
@@ -2733,8 +2733,8 @@ void WorldObject::MovePosition(Position& pos, float dist, float angle)
|
||||
}
|
||||
}
|
||||
|
||||
acore::NormalizeMapCoord(pos.m_positionX);
|
||||
acore::NormalizeMapCoord(pos.m_positionY);
|
||||
Acore::NormalizeMapCoord(pos.m_positionX);
|
||||
Acore::NormalizeMapCoord(pos.m_positionY);
|
||||
UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
pos.m_orientation = m_orientation;
|
||||
}
|
||||
@@ -2841,8 +2841,8 @@ void WorldObject::DestroyForNearbyPlayers()
|
||||
return;
|
||||
|
||||
std::list<Player*> targets;
|
||||
acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange() + VISIBILITY_COMPENSATION, false);
|
||||
acore::PlayerListSearcherWithSharedVision<acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
Acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange() + VISIBILITY_COMPENSATION, false);
|
||||
Acore::PlayerListSearcherWithSharedVision<Acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
VisitNearbyWorldObject(GetVisibilityRange() + VISIBILITY_COMPENSATION, searcher);
|
||||
for (std::list<Player*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
@@ -2865,7 +2865,7 @@ void WorldObject::DestroyForNearbyPlayers()
|
||||
void WorldObject::UpdateObjectVisibility(bool /*forced*/, bool /*fromUpdate*/)
|
||||
{
|
||||
//updates object's visibility for nearby players
|
||||
acore::VisibleChangesNotifier notifier(*this);
|
||||
Acore::VisibleChangesNotifier notifier(*this);
|
||||
VisitNearbyWorldObject(GetVisibilityRange() + VISIBILITY_COMPENSATION, notifier);
|
||||
}
|
||||
|
||||
@@ -2970,7 +2970,7 @@ struct WorldObjectChangeAccumulator
|
||||
|
||||
void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set)
|
||||
{
|
||||
CellCoord p = acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
CellCoord p = Acore::ComputeCellCoord(GetPositionX(), GetPositionY());
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
WorldObjectChangeAccumulator notifier(*this, data_map, player_set);
|
||||
@@ -2984,17 +2984,17 @@ void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& play
|
||||
|
||||
void WorldObject::GetCreaturesWithEntryInRange(std::list<Creature*>& creatureList, float radius, uint32 entry)
|
||||
{
|
||||
CellCoord pair(acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
CellCoord pair(Acore::ComputeCellCoord(this->GetPositionX(), this->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
cell.SetNoCreate();
|
||||
|
||||
acore::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
Acore::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, WorldTypeMapContainer> world_visitor(searcher);
|
||||
cell.Visit(pair, world_visitor, *(this->GetMap()), *this, radius);
|
||||
|
||||
TypeContainerVisitor<acore::CreatureListSearcher<acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
|
||||
TypeContainerVisitor<Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange>, GridTypeMapContainer> grid_visitor(searcher);
|
||||
cell.Visit(pair, grid_visitor, *(this->GetMap()), *this, radius);
|
||||
}
|
||||
|
||||
|
||||
@@ -1095,7 +1095,7 @@ private:
|
||||
bool CanDetectStealthOf(WorldObject const* obj, bool checkAlert = false) const;
|
||||
};
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
// Binary predicate to sort WorldObjects based on the distance to a reference WorldObject
|
||||
class ObjectDistanceOrderPred
|
||||
|
||||
@@ -517,7 +517,7 @@ inline void KillRewarder::_InitGroupData()
|
||||
}
|
||||
// 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance,
|
||||
// for whom victim is not gray;
|
||||
uint32 grayLevel = acore::XP::GetGrayLevel(lvl);
|
||||
uint32 grayLevel = Acore::XP::GetGrayLevel(lvl);
|
||||
if (_victim->getLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->getLevel() < lvl))
|
||||
{
|
||||
_maxNotGrayMember = member;
|
||||
@@ -542,7 +542,7 @@ inline void KillRewarder::_InitXP(Player* player)
|
||||
// * otherwise, not in PvP;
|
||||
// * not if killer is on vehicle.
|
||||
if (_victim && (_isBattleGround || (!_isPvP && !_killer->GetVehicle())))
|
||||
_xp = acore::XP::Gain(player, _victim, _isBattleGround);
|
||||
_xp = Acore::XP::Gain(player, _victim, _isBattleGround);
|
||||
|
||||
if (_xp && !_isBattleGround && _victim) // pussywizard: npcs with relatively low hp give lower exp
|
||||
if (_victim->GetTypeId() == TYPEID_UNIT)
|
||||
@@ -658,7 +658,7 @@ void KillRewarder::_RewardGroup()
|
||||
{
|
||||
// 3.1.2. Alter group rate if group is in raid (not for battlegrounds).
|
||||
const bool isRaid = !_isPvP && sMapStore.LookupEntry(_killer->GetMapId())->IsRaid() && _group->isRaidGroup();
|
||||
_groupRate = acore::XP::xp_in_group_rate(_count, isRaid);
|
||||
_groupRate = Acore::XP::xp_in_group_rate(_count, isRaid);
|
||||
}
|
||||
|
||||
// 3.1.3. Reward each group member (even dead or corpse) within reward distance.
|
||||
@@ -6564,7 +6564,7 @@ void Player::UpdateWeaponSkill(Unit* victim, WeaponAttackType attType)
|
||||
void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence)
|
||||
{
|
||||
uint8 plevel = getLevel(); // if defense than victim == attacker
|
||||
uint8 greylevel = acore::XP::GetGrayLevel(plevel);
|
||||
uint8 greylevel = Acore::XP::GetGrayLevel(plevel);
|
||||
uint8 moblevel = victim->getLevelForTarget(this);
|
||||
/*if (moblevel < greylevel)
|
||||
return;*/ // Patch 3.0.8 (2009-01-20): You can no longer skill up weapons on mobs that are immune to damage.
|
||||
@@ -7065,7 +7065,7 @@ void Player::SendMessageToSetInRange(WorldPacket* data, float dist, bool self, b
|
||||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist, false, skipped_rcvr);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
@@ -7075,7 +7075,7 @@ void Player::SendMessageToSetInRange_OwnTeam(WorldPacket* data, float dist, bool
|
||||
if (self)
|
||||
GetSession()->SendPacket(data);
|
||||
|
||||
acore::MessageDistDeliverer notifier(this, data, dist, true);
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist, true);
|
||||
VisitNearbyWorldObject(dist, notifier);
|
||||
}
|
||||
|
||||
@@ -7258,7 +7258,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, uint32 creatureOr
|
||||
break;
|
||||
}
|
||||
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= acore::XP::GetGrayLevel(getLevel()))
|
||||
if (rate != 1.0f && creatureOrQuestLevel <= Acore::XP::GetGrayLevel(getLevel()))
|
||||
percent *= rate;
|
||||
|
||||
if (percent <= 0.0f)
|
||||
@@ -7498,7 +7498,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
return false;
|
||||
|
||||
uint8 k_level = getLevel();
|
||||
uint8 k_grey = acore::XP::GetGrayLevel(k_level);
|
||||
uint8 k_grey = Acore::XP::GetGrayLevel(k_level);
|
||||
uint8 v_level = victim->getLevel();
|
||||
|
||||
if (v_level <= k_grey)
|
||||
@@ -7527,7 +7527,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
else
|
||||
victim_guid.Clear(); // Don't show HK: <rank> message, only log.
|
||||
|
||||
honor_f = ceil(acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
honor_f = ceil(Acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
|
||||
// count the number of playerkills in one day
|
||||
ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true);
|
||||
@@ -18335,7 +18335,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, SQLQueryHolder* holder)
|
||||
m_movementInfo.transport.pos.Relocate(x, y, z, o);
|
||||
m_transport->CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
if (!acore::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
|
||||
if (!Acore::IsValidMapCoord(x, y, z, o) || std::fabs(m_movementInfo.transport.pos.GetPositionX()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionY()) > 75.0f || std::fabs(m_movementInfo.transport.pos.GetPositionZ()) > 75.0f)
|
||||
{
|
||||
m_transport = nullptr;
|
||||
m_movementInfo.transport.Reset();
|
||||
@@ -21526,8 +21526,8 @@ void Player::TextEmote(const std::string& text)
|
||||
|
||||
WorldPacket data;
|
||||
std::list<Player*> players;
|
||||
acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
acore::PlayerListSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, players, checker);
|
||||
this->VisitNearbyWorldObject(sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), searcher);
|
||||
|
||||
for (auto const& itr : players)
|
||||
@@ -23680,10 +23680,10 @@ void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
|
||||
|
||||
void Player::UpdateVisibilityForPlayer(bool mapChange)
|
||||
{
|
||||
acore::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
|
||||
Acore::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
|
||||
m_seer->VisitNearbyObject(GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS, notifierNoLarge);
|
||||
notifierNoLarge.SendToSelf();
|
||||
acore::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
|
||||
Acore::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
|
||||
m_seer->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, notifierLarge);
|
||||
notifierLarge.SendToSelf();
|
||||
|
||||
@@ -24753,7 +24753,7 @@ uint32 Player::GetResurrectionSpellId()
|
||||
bool Player::isHonorOrXPTarget(Unit* victim) const
|
||||
{
|
||||
uint8 v_level = victim->getLevel();
|
||||
uint8 k_grey = acore::XP::GetGrayLevel(getLevel());
|
||||
uint8 k_grey = Acore::XP::GetGrayLevel(getLevel());
|
||||
|
||||
// Victim level less gray level
|
||||
if (v_level <= k_grey)
|
||||
|
||||
@@ -609,7 +609,7 @@ void MotionTransport::UpdatePassengerPositions(PassengerSet& passengers)
|
||||
CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
// check if position is valid
|
||||
if (!acore::IsValidMapCoord(x, y, z))
|
||||
if (!Acore::IsValidMapCoord(x, y, z))
|
||||
continue;
|
||||
|
||||
switch (passenger->GetTypeId())
|
||||
@@ -875,7 +875,7 @@ void StaticTransport::RelocateToProgress(uint32 progress)
|
||||
float oriRotAngle = oriRotAngleCurr + percRot * (oriRotAngleNext - oriRotAngleCurr);
|
||||
|
||||
// check if position is valid
|
||||
if (!acore::IsValidMapCoord(pos.x, pos.y, pos.z))
|
||||
if (!Acore::IsValidMapCoord(pos.x, pos.y, pos.z))
|
||||
return;
|
||||
|
||||
// update position to new one
|
||||
@@ -910,7 +910,7 @@ void StaticTransport::UpdatePassengerPositions()
|
||||
CalculatePassengerPosition(x, y, z, &o);
|
||||
|
||||
// check if position is valid
|
||||
if (!acore::IsValidMapCoord(x, y, z))
|
||||
if (!Acore::IsValidMapCoord(x, y, z))
|
||||
continue;
|
||||
|
||||
switch (passenger->GetTypeId())
|
||||
|
||||
@@ -1893,7 +1893,7 @@ void Unit::CalcAbsorbResist(Unit* attacker, Unit* victim, SpellSchoolMask school
|
||||
// We're going to call functions which can modify content of the list during iteration over it's elements
|
||||
// Let's copy the list so we can prevent iterator invalidation
|
||||
AuraEffectList vSchoolAbsorbCopy(victim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB));
|
||||
vSchoolAbsorbCopy.sort(acore::AbsorbAuraOrderPred());
|
||||
vSchoolAbsorbCopy.sort(Acore::AbsorbAuraOrderPred());
|
||||
|
||||
// absorb without mana cost
|
||||
for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
|
||||
@@ -16294,8 +16294,8 @@ void Unit::UpdateReactives(uint32 p_time)
|
||||
Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
acore::UnitListSearcher<acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
VisitNearbyObject(dist, searcher);
|
||||
|
||||
// remove current target
|
||||
@@ -16323,14 +16323,14 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
|
||||
return nullptr;
|
||||
|
||||
// select random
|
||||
return acore::Containers::SelectRandomContainerElement(targets);
|
||||
return Acore::Containers::SelectRandomContainerElement(targets);
|
||||
}
|
||||
|
||||
Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
acore::UnitListSearcher<acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
VisitNearbyObject(dist, searcher);
|
||||
|
||||
// remove current target
|
||||
@@ -16358,7 +16358,7 @@ Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
|
||||
return nullptr;
|
||||
|
||||
// select random
|
||||
return acore::Containers::SelectRandomContainerElement(targets);
|
||||
return Acore::Containers::SelectRandomContainerElement(targets);
|
||||
}
|
||||
|
||||
void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
|
||||
@@ -16893,7 +16893,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura)
|
||||
|
||||
if (!nearMembers.empty())
|
||||
{
|
||||
nearMembers.sort(acore::HealthPctOrderPred());
|
||||
nearMembers.sort(Acore::HealthPctOrderPred());
|
||||
if (Unit* target = nearMembers.front())
|
||||
{
|
||||
CastSpell(target, 41637 /*Dummy visual effect triggered by main spell cast*/, true);
|
||||
@@ -18369,7 +18369,7 @@ void Unit::UpdateObjectVisibility(bool forced, bool /*fromUpdate*/)
|
||||
// pussywizard: generally this is not needed here, delayed notifier will handle this, call only for pets
|
||||
if ((IsGuardian() || IsPet()) && GetOwnerGUID().IsPlayer())
|
||||
{
|
||||
acore::AIRelocationNotifier notifier(*this);
|
||||
Acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
VisitNearbyObject(radius, notifier);
|
||||
}
|
||||
@@ -19220,7 +19220,7 @@ void Unit::SendTeleportPacket(Position& pos)
|
||||
|
||||
bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport)
|
||||
{
|
||||
if (!acore::IsValidMapCoord(x, y, z, orientation))
|
||||
if (!Acore::IsValidMapCoord(x, y, z, orientation))
|
||||
return false;
|
||||
|
||||
float old_orientation = GetOrientation();
|
||||
@@ -19743,10 +19743,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
//active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
}
|
||||
@@ -19777,10 +19777,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
|
||||
@@ -19801,7 +19801,7 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
|
||||
unit->m_last_notify_position.Relocate(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
|
||||
|
||||
acore::CreatureRelocationNotifier relocate(*unit);
|
||||
Acore::CreatureRelocationNotifier relocate(*unit);
|
||||
unit->VisitNearbyObject(unit->GetVisibilityRange() + VISIBILITY_COMPENSATION, relocate);
|
||||
|
||||
this->AddToNotify(NOTIFY_AI_RELOCATION);
|
||||
@@ -19814,7 +19814,7 @@ void Unit::ExecuteDelayedUnitAINotifyEvent()
|
||||
if (!this->IsInWorld() || this->IsDuringRemoveFromWorld())
|
||||
return;
|
||||
|
||||
acore::AIRelocationNotifier notifier(*this);
|
||||
Acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
this->VisitNearbyObject(radius, notifier);
|
||||
}
|
||||
|
||||
@@ -2627,7 +2627,7 @@ private:
|
||||
float processDummyAuras(float TakenTotalMod) const;
|
||||
};
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
// Binary predicate for sorting Units based on percent value of a power
|
||||
class PowerPctOrderPred
|
||||
|
||||
Reference in New Issue
Block a user