Halls of Stone: Implement achievement Brann's Spankin' New

--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-03-20 13:15:44 +01:00
parent 3c2d7a4bba
commit 617c94c9da
@@ -101,6 +101,11 @@ enum Quests
QUEST_HALLS_OF_STONE = 13207 QUEST_HALLS_OF_STONE = 13207
}; };
enum Achievements
{
ACHIEV_BRANN_SPANKIN = 2154
};
#define GOSSIP_ITEM_START "Brann, it would be our honor!" #define GOSSIP_ITEM_START "Brann, it would be our honor!"
#define GOSSIP_ITEM_PROGRESS "Let's move Brann, enough of the history lessons!" #define GOSSIP_ITEM_PROGRESS "Let's move Brann, enough of the history lessons!"
@@ -243,6 +248,7 @@ struct npc_brann_hosAI : public npc_escortAI
bool bIsBattle; bool bIsBattle;
bool bIsLowHP; bool bIsLowHP;
bool bHasBeenDamaged;
void Reset() void Reset()
{ {
@@ -250,6 +256,7 @@ struct npc_brann_hosAI : public npc_escortAI
{ {
bIsLowHP = false; bIsLowHP = false;
bIsBattle = false; bIsBattle = false;
bHasBeenDamaged = false;
uiStep = 0; uiStep = 0;
uiPhaseTimer = 0; uiPhaseTimer = 0;
uiControllerGUID = 0; uiControllerGUID = 0;
@@ -349,6 +356,12 @@ struct npc_brann_hosAI : public npc_escortAI
Start(); Start();
} }
void DamageTaken(Unit* done_by, uint32 &damage)
{
if (!bHasBeenDamaged)
bHasBeenDamaged = true;
}
void UpdateEscortAI(const uint32 uiDiff) void UpdateEscortAI(const uint32 uiDiff)
{ {
if (uiPhaseTimer <= uiDiff) if (uiPhaseTimer <= uiDiff)
@@ -510,7 +523,11 @@ struct npc_brann_hosAI : public npc_escortAI
case 29: case 29:
DoScriptText(SAY_EVENT_END_02, m_creature); DoScriptText(SAY_EVENT_END_02, m_creature);
if (pInstance) if (pInstance)
{
pInstance->SetData(DATA_BRANN_EVENT, DONE); pInstance->SetData(DATA_BRANN_EVENT, DONE);
if (!bHasBeenDamaged)
pInstance->DoCompleteAchievement(ACHIEV_BRANN_SPANKIN_NEW);
}
JumpToNextStep(5500); JumpToNextStep(5500);
break; break;