Skip to content

Commit f7c70c6

Browse files
miracokillerwife
authored andcommitted
Wetlands: Add script for Flagongut's Fossil
1 parent 7a1513a commit f7c70c6

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

sql/scriptdev2/scriptdev2.sql

+1
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,7 @@ UPDATE creature_template SET ScriptName='npc_foreman_klaven_mortwake' WHERE entr
13781378
/* WETLANDS */
13791379
UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962;
13801380
UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963;
1381+
UPDATE gameobject_template SET ScriptName = 'go_flagongut_fossil' WHERE entry=9630;
13811382

13821383
/* WINTERSPRING */
13831384
UPDATE creature_template SET ScriptName='npc_ranshalla' WHERE entry=10300;

src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/wetlands.cpp

+36
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,37 @@ bool QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest*
220220
return false;
221221
}
222222

223+
enum
224+
{
225+
NPC_PROSPECTOR_WHELGAR = 1077,
226+
SAY_ITEM_LOOTED = 1235
227+
};
228+
229+
// Flagongut's Fossil ID: 9630
230+
231+
struct go_flagongut_fossil : public GameObjectAI
232+
{
233+
go_flagongut_fossil(GameObject* go) : GameObjectAI(go) {}
234+
235+
void OnLootStateChange(Unit* /*user*/)
236+
{
237+
if (m_go->GetLootState() == GO_JUST_DEACTIVATED)
238+
{
239+
if (Creature* whelgar = GetClosestCreatureWithEntry(m_go, NPC_PROSPECTOR_WHELGAR, 10.0f))
240+
{
241+
whelgar->HandleEmote(EMOTE_ONESHOT_TALK);
242+
DoBroadcastText(SAY_ITEM_LOOTED, whelgar);
243+
}
244+
}
245+
}
246+
};
247+
248+
GameObjectAI* GetAI_go_flagongut_fossil(GameObject* go)
249+
{
250+
return new go_flagongut_fossil(go);
251+
}
252+
253+
223254
/*######
224255
## AddSC
225256
######*/
@@ -235,4 +266,9 @@ void AddSC_wetlands()
235266
pNewScript->Name = "npc_mikhail";
236267
pNewScript->pQuestAcceptNPC = &QuestAccept_npc_mikhail;
237268
pNewScript->RegisterSelf();
269+
270+
pNewScript = new Script;
271+
pNewScript->Name = "go_flagongut_fossil";
272+
pNewScript->GetGameObjectAI = &GetAI_go_flagongut_fossil;
273+
pNewScript->RegisterSelf();
238274
}

0 commit comments

Comments
 (0)