feat(Core/Visibility): Visibility improvements part 1 (#22624)

This commit is contained in:
Takenbacon
2025-08-07 07:17:45 -07:00
committed by GitHub
parent bde4e076ed
commit 1499aa51de
25 changed files with 456 additions and 296 deletions

View File

@@ -104,7 +104,7 @@ public:
c->UpdatePosition(630.88f, 131.39f, 140.8f, 3.02f, true);
c->StopMovingOnCurrentPos();
c->DestroyForNearbyPlayers();
c->DestroyForVisiblePlayers();
}
}
}
@@ -792,7 +792,7 @@ public:
{
icehowl->UpdatePosition(513.19f, 139.48f, 395.22f, 3 * M_PI / 2, true);
icehowl->StopMovingOnCurrentPos();
icehowl->DestroyForNearbyPlayers();
icehowl->DestroyForVisiblePlayers();
}
}
break;
@@ -959,7 +959,7 @@ public:
{
jaraxxus->UpdatePosition(613.83f, 139.5f, 395.22f, 3 * M_PI / 2, true);
jaraxxus->StopMovingOnCurrentPos();
jaraxxus->DestroyForNearbyPlayers();
jaraxxus->DestroyForVisiblePlayers();
}
if (Creature* c = instance->GetCreature(NPC_TirionGUID))

View File

@@ -252,7 +252,7 @@ public:
me->SummonCreature(summons[0][i], cords[0][0] + ((i % 2) ? 4.0f : -4.0f), cords[0][1] + (i < 2 ? 4.0f : -4.0f), cords[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
uint8 phase = GetPhaseByCurrentPosition();
me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
me->DestroyForNearbyPlayers();
me->DestroyForVisiblePlayers();
LeaveCombat();
me->CastSpell(me, SPELL_EVOCATION, true);
releaseLockTimer = 1;
@@ -264,7 +264,7 @@ public:
me->SummonCreature(summons[1][i], cords[1][0] + ((i % 2) ? 4.0f : -4.0f), cords[1][1] + (i < 2 ? 4.0f : -4.0f), cords[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
uint8 phase = GetPhaseByCurrentPosition();
me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
me->DestroyForNearbyPlayers();
me->DestroyForVisiblePlayers();
LeaveCombat();
me->CastSpell(me, SPELL_EVOCATION, true);
releaseLockTimer = 1;
@@ -276,7 +276,7 @@ public:
me->SummonCreature(summons[2][i], cords[2][0] + ((i % 2) ? 4.0f : -4.0f), cords[2][1] + (i < 2 ? 4.0f : -4.0f), cords[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
uint8 phase = GetPhaseByCurrentPosition();
me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
me->DestroyForNearbyPlayers();
me->DestroyForVisiblePlayers();
LeaveCombat();
me->CastSpell(me, SPELL_EVOCATION, true);
releaseLockTimer = 1;

View File

@@ -366,7 +366,7 @@ struct boss_ingvar_the_plunderer : public ScriptedAI
case EVENT_AXE_PICKUP:
if (Creature* c = ObjectAccessor::GetCreature(*me, ThrowGUID))
{
c->DestroyForNearbyPlayers();
c->DestroyForVisiblePlayers();
c->DespawnOrUnsummon();
summons.DespawnAll();
}

View File

@@ -229,7 +229,7 @@ public:
c->loot.FillLoot(lootid, LootTemplates_Creature, c->GetLootRecipient(), false, false, c->GetLootMode(), c);
if (c->GetLootMode())
c->loot.generateMoneyLoot(c->GetCreatureTemplate()->mingold, c->GetCreatureTemplate()->maxgold);
c->DestroyForNearbyPlayers();
c->DestroyForVisiblePlayers();
c->SetVisible(true);
}
break;
@@ -244,7 +244,7 @@ public:
c->loot.FillLoot(lootid, LootTemplates_Creature, c->GetLootRecipient(), false, false, c->GetLootMode(), c);
if (c->GetLootMode())
c->loot.generateMoneyLoot(c->GetCreatureTemplate()->mingold, c->GetCreatureTemplate()->maxgold);
c->DestroyForNearbyPlayers();
c->DestroyForVisiblePlayers();
c->SetVisible(true);
}
break;

View File

@@ -159,7 +159,7 @@ public:
{
me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), h, me->GetOrientation(), true); // move to ground
me->StopMovingOnCurrentPos();
me->DestroyForNearbyPlayers();
me->DestroyForVisiblePlayers();
}
}

View File

@@ -110,10 +110,11 @@ public:
{
if (Player* target = ObjectAccessor::GetPlayer(_owner, _targetGUID))
{
target->m_clientGUIDs.insert(_owner.GetGUID());
// @todo: wtf? this is wrong but I cba looking into it.
target->GetObjectVisibilityContainer().LinkWorldObjectVisibility(&_owner);
_owner.CastSpell(target, SPELL_ENVENOM, true);
target->RemoveAurasDueToSpell(SPELL_DEADLY_POISON);
target->m_clientGUIDs.erase(_owner.GetGUID());
target->GetObjectVisibilityContainer().UnlinkWorldObjectVisibility(&_owner);
}
return true;
}

View File

@@ -80,7 +80,7 @@ public:
if (_timer > 5000)
{
me->CastSpell(nullptr, 9056);
me->DestroyForNearbyPlayers();
me->DestroyForVisiblePlayers();
_timer = 0;
}
}