fix (Script/Scarlet Enclave) Named Npcs can no longer be attacked after the end of the The Light of Dawn battle. (#22463)

This commit is contained in:
Rocco Silipo
2025-07-13 08:50:50 +02:00
committed by GitHub
parent bfd3f0aa95
commit 88342576e0

View File

@@ -700,6 +700,7 @@ public:
{
summon->CombatStop(true);
summon->GetThreatMgr().ClearAllThreat();
summon->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
summon->SetImmuneToAll(true);
summon->SetReactState(REACT_PASSIVE);
summon->GetMotionMaster()->Clear(false);
@@ -950,6 +951,7 @@ public:
if (summon->GetEntry() <= NPC_RIMBLAT_EARTHSHATTER && summon->GetEntry() != NPC_HIGHLORD_TIRION_FORDRING)
{
float o = lk->GetAngle(summon);
summon->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
summon->GetMotionMaster()->MovePoint(3, lk->GetPositionX() + 2.0f * cos(o), lk->GetPositionY() + 2.0f * std::sin(o), lk->GetPositionZ());
summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
}