Skip to content

Commit

Permalink
Wetlands: Add script for Flagongut's Fossil
Browse files Browse the repository at this point in the history
  • Loading branch information
miraco authored and killerwife committed Feb 4, 2025
1 parent 7a1513a commit f7c70c6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions sql/scriptdev2/scriptdev2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ UPDATE creature_template SET ScriptName='npc_foreman_klaven_mortwake' WHERE entr
/* WETLANDS */
UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962;
UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963;
UPDATE gameobject_template SET ScriptName = 'go_flagongut_fossil' WHERE entry=9630;

/* WINTERSPRING */
UPDATE creature_template SET ScriptName='npc_ranshalla' WHERE entry=10300;
Expand Down
36 changes: 36 additions & 0 deletions src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/wetlands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,37 @@ bool QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest*
return false;
}

enum
{
NPC_PROSPECTOR_WHELGAR = 1077,
SAY_ITEM_LOOTED = 1235
};

// Flagongut's Fossil ID: 9630

struct go_flagongut_fossil : public GameObjectAI
{
go_flagongut_fossil(GameObject* go) : GameObjectAI(go) {}

void OnLootStateChange(Unit* /*user*/)
{
if (m_go->GetLootState() == GO_JUST_DEACTIVATED)
{
if (Creature* whelgar = GetClosestCreatureWithEntry(m_go, NPC_PROSPECTOR_WHELGAR, 10.0f))
{
whelgar->HandleEmote(EMOTE_ONESHOT_TALK);
DoBroadcastText(SAY_ITEM_LOOTED, whelgar);
}
}
}
};

GameObjectAI* GetAI_go_flagongut_fossil(GameObject* go)
{
return new go_flagongut_fossil(go);
}


/*######
## AddSC
######*/
Expand All @@ -235,4 +266,9 @@ void AddSC_wetlands()
pNewScript->Name = "npc_mikhail";
pNewScript->pQuestAcceptNPC = &QuestAccept_npc_mikhail;
pNewScript->RegisterSelf();

pNewScript = new Script;
pNewScript->Name = "go_flagongut_fossil";
pNewScript->GetGameObjectAI = &GetAI_go_flagongut_fossil;
pNewScript->RegisterSelf();
}

0 comments on commit f7c70c6

Please sign in to comment.