Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Scripts: Only only cast and talk if quest incomplete.
Browse files Browse the repository at this point in the history
  • Loading branch information
AriDEV3 committed Nov 13, 2023
1 parent d265301 commit 6206de7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/server/scripts/World/areatrigger_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SDCategory: Areatrigger
EndScriptData */

/* ContentData
at_the_dawning_valley q29409
at_coilfang_waterfall 4591
at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm
at_stormwright_shelf q12741
Expand All @@ -30,7 +31,7 @@ EndContentData */
enum the_dawning_valley
{
NPC_TRAINEE_NIM = 60183,

QUEST_DISCIPLE_CHALLENGE = 29409,
AT_SPELL_FORCE_REACTION = 102429,
};

Expand All @@ -41,12 +42,16 @@ class AreaTrigger_at_the_dawning_valley : AreaTriggerScript

bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) OVERRIDE
{
if (!player->HasAura(AT_SPELL_FORCE_REACTION))
if (player->GetQuestStatus(QUEST_DISCIPLE_CHALLENGE) == QUEST_STATUS_INCOMPLETE)
{
if (Creature* creature = player->FindNearestCreature(NPC_TRAINEE_NIM, 25.0f, true))
if (!player->HasAura(AT_SPELL_FORCE_REACTION))
{
player->CastSpell(player, AT_SPELL_FORCE_REACTION, false);
creature->AI()->Talk(0, player);
if (Creature* creature = player->FindNearestCreature(NPC_TRAINEE_NIM, 25.0f, true))
{
player->CastSpell(player, AT_SPELL_FORCE_REACTION, false);
creature->AI()->Talk(0, player);
return true;
}
}
}
return false;
Expand Down

0 comments on commit 6206de7

Please sign in to comment.