Skip to content

Commit

Permalink
chore(Core/Instance): add check boss states for Naxxramas (to frostwy…
Browse files Browse the repository at this point in the history
…rm lair)
  • Loading branch information
Winfidonarleyan committed Jul 5, 2020
1 parent e633723 commit 49afbf9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions data/sql/custom/db_world/2020_07_06_00_nax_teleport.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Add areatrigger_scripts for nax tp
DELETE FROM `areatrigger_scripts` WHERE `entry` = 4156;
INSERT INTO `areatrigger_scripts`(`entry`, `ScriptName`) VALUES (4156, 'nax_frostwyrm_lair');
30 changes: 30 additions & 0 deletions src/server/scripts/World/areatrigger_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,34 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
std::map<uint32, time_t> _triggerTimes;
};

class AreaTrigger_nax_frostwyrm_lair : public AreaTriggerScript
{
public: AreaTrigger_nax_frostwyrm_lair() : AreaTriggerScript("nax_frostwyrm_lair") { }

bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/)
{
if (!player)
return true;

auto instanceScript = player->GetInstanceScript();
if (instanceScript->GetBossState(BOSS_LOATHEB) != EncounterState::DONE ||
instanceScript->GetBossState(BOSS_MAEXXNA) != EncounterState::DONE ||
instanceScript->GetBossState(BOSS_THADDIUS) != EncounterState::DONE ||
instanceScript->GetBossState(BOSS_HORSEMAN) != EncounterState::DONE)
return true;

return false;
}
private:
enum NaxBosses
{
BOSS_LOATHEB = 5,
BOSS_MAEXXNA = 8,
BOSS_THADDIUS = 9,
BOSS_HORSEMAN = 12
};
};

void AddSC_areatrigger_scripts()
{
// Ours
Expand All @@ -504,4 +532,6 @@ void AddSC_areatrigger_scripts()
new AreaTrigger_at_sentry_point();
new AreaTrigger_at_brewfest();
new AreaTrigger_at_area_52_entrance();

new AreaTrigger_nax_frostwyrm_lair();
}

0 comments on commit 49afbf9

Please sign in to comment.