fix(Scripts/Quest): Correct respawn logic for Isla Starmane and Rin'ji (#17874)

* Create rev_1694739263824086500.sql

* init

* 2
This commit is contained in:
Gultask
2023-11-26 20:04:47 -03:00
committed by GitHub
parent daec8345e0
commit abf85fb44f
2 changed files with 7 additions and 5 deletions

View File

@@ -77,7 +77,7 @@ public:
{
_IsByOutrunner = false;
spawnId = 0;
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
me->SetImmuneToAll(true);
}
void Reset() override
@@ -90,6 +90,7 @@ public:
{
_IsByOutrunner = false;
spawnId = 0;
me->SetImmuneToAll(true);
npc_escortAI::JustRespawned();
}
@@ -136,7 +137,7 @@ public:
void sQuestAccept(Player* player, Quest const* quest) override
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
me->SetImmuneToAll(false);
if (quest->GetQuestId() == QUEST_RINJI_TRAPPED)
{
if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))

View File

@@ -472,7 +472,7 @@ public:
{
case 0:
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10))
Cage->SetGoState(GO_STATE_ACTIVE);
Cage->UseDoorOrButton();
break;
case 2:
Talk(SAY_PROGRESS_1, player);
@@ -501,9 +501,10 @@ public:
}
}
void Reset() override
void JustRespawned() override
{
me->RestoreFaction();
me->SetImmuneToAll(true);
npc_escortAI::JustRespawned();
}
void JustDied(Unit* /*killer*/) override