*Do not allow to enter frostwyrm wing before killing all previous bosses. If you do not like it, simply do not apply the sql.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-12 08:01:06 -05:00
parent 1bdc65e5ee
commit cd78172c7d
4 changed files with 25 additions and 0 deletions

View File

@@ -1187,3 +1187,6 @@ INSERT INTO `creature_ai_scripts` VALUES
/* EOF */
UPDATE `creature_template` SET `ScriptName` = 'npc_skywing' WHERE entry=22424;
DELETE FROM areatrigger_scripts WHERE entry = 4156;
INSERT INTO areatrigger_scripts VALUES (4156, 'at_naxxramas_frostwyrm_wing');

View File

@@ -0,0 +1,2 @@
DELETE FROM areatrigger_scripts WHERE entry = 4156;
INSERT INTO areatrigger_scripts VALUES (4156, 'at_naxxramas_frostwyrm_wing');

View File

@@ -183,6 +183,20 @@ struct TRINITY_DLL_DECL instance_naxxramas : public InstanceData
}
};
bool AreaTrigger_at_naxxramas_frostwyrm_wing(Player *player, AreaTriggerEntry *at)
{
if(player->isGameMaster())
return false;
InstanceData *data = player->GetInstanceData();
if(data)
for(uint32 i = BOSS_ANUBREKHAN; i < BOSS_SAPPHIRON; ++i)
if(data->GetBossState(i) != DONE)
return true;
return false;
}
InstanceData* GetInstanceData_instance_naxxramas(Map* map)
{
return new instance_naxxramas(map);
@@ -195,4 +209,9 @@ void AddSC_instance_naxxramas()
newscript->Name = "instance_naxxramas";
newscript->GetInstanceData = &GetInstanceData_instance_naxxramas;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "at_naxxramas_frostwyrm_wing";
newscript->pAreaTrigger = &AreaTrigger_at_naxxramas_frostwyrm_wing;
newscript->RegisterSelf();
}

View File

@@ -150,6 +150,7 @@ class TRINITY_DLL_SPEC InstanceData : public ZoneScript
void DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn = MINUTE);
virtual bool SetBossState(uint32 id, EncounterState state);
EncounterState GetBossState(uint32 id) const { return id < bosses.size() ? bosses[id].state : TO_BE_DECIDED; }
const BossBoundaryMap * GetBossBoundary(uint32 id) const { return id < bosses.size() ? &bosses[id].boundary : NULL; }
protected:
void SetBossNumber(uint32 number) { bosses.resize(number); }