fix(Scripts/BlackrockSpire): Urok Doomhowl - improvements: (#9067)

The mobs should attack the pike if there is no players around
The boss should not despawning after summon
Urok's Tribute Pile with Pike and Head should disapear after Urok appear
Fixes #9023
This commit is contained in:
UltraNix
2021-11-12 13:46:07 +01:00
committed by GitHub
parent 4a69d1fc07
commit 7201d8840f
10 changed files with 68 additions and 22 deletions

View File

@@ -2533,10 +2533,10 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
return creature;
}
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range, bool onlySpawned /*= false*/) const
{
GameObject* go = nullptr;
Acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
Acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range, onlySpawned);
Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
Cell::VisitGridObjects(this, searcher, range);
return go;
@@ -2816,7 +2816,8 @@ void WorldObject::GetContactPoint(const WorldObject* obj, float& x, float& y, fl
// angle to face `obj` to `this` using distance includes size of `obj`
GetNearPoint(obj, x, y, z, obj->GetObjectSize(), distance2d, GetAngle(obj));
if (fabs(this->GetPositionZ() - z) > 3.0f || !IsWithinLOS(x, y, z))
// Exclude gameobjects from LoS calculations
if (fabs(this->GetPositionZ() - z) > 3.0f || (GetTypeId() != TYPEID_GAMEOBJECT && !IsWithinLOS(x, y, z)))
{
x = this->GetPositionX();
y = this->GetPositionY();