Skip to content

Commit 0c412f6

Browse files
author
Reve
committed
[1841] Added support for completing quest 12934.
Added support for completing quest 12934. git-svn-id: https://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2@1841 5f9c896b-1e26-0410-94da-f77f675e2462
1 parent cfada57 commit 0c412f6

1 file changed

Lines changed: 42 additions & 2 deletions

File tree

scripts/northrend/zuldrak.cpp

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
/* ScriptData
1818
SDName: Zuldrak
19-
SD%Complete:
20-
SDComment:
19+
SD%Complete: 100
20+
SDComment: Quest support: 12934.
2121
SDCategory: Zuldrak
2222
EndScriptData */
2323

@@ -39,20 +39,60 @@ enum
3939
static float m_afSpawnLocation[] = {5768.71f, -2969.29f, 273.816f};
4040
static uint32 m_auiBosses[] = {NPC_AZBARIN, NPC_DUKE_SINGEN, NPC_ERATHIUS, NPC_GARGORAL};
4141

42+
struct MANGOS_DLL_DECL npc_gurgthockAI : public ScriptedAI
43+
{
44+
npc_gurgthockAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
45+
46+
uint64 m_uiPlayerGUID;
47+
48+
void SetPlayerGUID(uint64 uiPlayerGUID) { m_uiPlayerGUID = uiPlayerGUID; }
49+
50+
void Reset()
51+
{
52+
m_uiPlayerGUID = 0;
53+
}
54+
55+
void SummonedCreatureJustDied(Creature* pSummoned)
56+
{
57+
uint32 uiEntry = pSummoned->GetEntry();
58+
for(uint8 i = 0; i < 4; ++i)
59+
{
60+
if (uiEntry == m_auiBosses[i])
61+
{
62+
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID))
63+
pPlayer->GroupEventHappens(QUEST_FROM_BEYOND, m_creature);
64+
65+
m_uiPlayerGUID = 0;
66+
return;
67+
}
68+
}
69+
}
70+
};
71+
4272
bool QuestAccept_npc_gurgthock(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
4373
{
4474
if (pQuest->GetQuestId() == QUEST_FROM_BEYOND)
75+
{
4576
pCreature->SummonCreature(m_auiBosses[urand(0, 3)], m_afSpawnLocation[0], m_afSpawnLocation[1], m_afSpawnLocation[2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000);
4677

78+
if (npc_gurgthockAI* pGurthockAI = dynamic_cast<npc_gurgthockAI*>(pCreature->AI()))
79+
pGurthockAI->SetPlayerGUID(pPlayer->GetGUID());
80+
}
4781
return true;
4882
}
4983

84+
CreatureAI* GetAI_npc_gurgthock(Creature* pCreature)
85+
{
86+
return new npc_gurgthockAI(pCreature);
87+
}
88+
5089
void AddSC_zuldrak()
5190
{
5291
Script* pNewScript;
5392

5493
pNewScript = new Script;
5594
pNewScript->Name = "npc_gurgthock";
95+
pNewScript->GetAI = &GetAI_npc_gurgthock;
5696
pNewScript->pQuestAccept = &QuestAccept_npc_gurgthock;
5797
pNewScript->RegisterSelf();
5898
}

0 commit comments

Comments
 (0)