diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Kalimdor/zone_felwood.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/server/scripts/Kalimdor/zone_felwood.cpp b/src/server/scripts/Kalimdor/zone_felwood.cpp index cdf04b1d4cc..91b9ce08010 100644 --- a/src/server/scripts/Kalimdor/zone_felwood.cpp +++ b/src/server/scripts/Kalimdor/zone_felwood.cpp @@ -100,7 +100,44 @@ public: } }; +/*###### +## at_ancient_leaf +######*/ + +enum AncientMisc +{ + QUEST_ANCIENT_LEAF = 7632, + NPC_VARTRUS = 14524, + NPC_STOMA = 14525, + NPC_HASTAT = 14526, + CREATURE_GROUP_ANCIENTS = 1 +}; + +class at_ancient_leaf : public AreaTriggerScript +{ + public: + at_ancient_leaf() : AreaTriggerScript("at_ancient_leaf") { } + + bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) override + { + if (player->IsGameMaster() || !player->IsAlive()) + return false; + + // Handle Call Ancients event start - The area trigger summons 3 ancients + if ((player->GetQuestStatus(QUEST_ANCIENT_LEAF) == QUEST_STATUS_COMPLETE) || (player->GetQuestStatus(QUEST_ANCIENT_LEAF) == QUEST_STATUS_REWARDED)) + { + // If ancients are already spawned, skip the rest + if (GetClosestCreatureWithEntry(player, NPC_VARTRUS, 50.0f) || GetClosestCreatureWithEntry(player, NPC_STOMA, 50.0f) || GetClosestCreatureWithEntry(player, NPC_HASTAT, 50.0f)) + return true; + + player->GetMap()->SummonCreatureGroup(CREATURE_GROUP_ANCIENTS); + } + return false; + } +}; + void AddSC_felwood() { new npcs_riverbreeze_and_silversky(); + new at_ancient_leaf(); } |