aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRushor <PBienati@web.de>2015-01-30 17:27:58 +0100
committerRushor <PBienati@web.de>2015-02-12 00:05:15 +0100
commit9eea348d8256633a0f333dd7d6eb256b4c25ec06 (patch)
tree659663177975e689350754ce6e23847a7edfff17 /src
parentccdc100d10143285bc058d968f0472ea4d073120 (diff)
Scripts/Areatrigger: Assign Script to 'Ancient Leaves' Trigger
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Kalimdor/zone_felwood.cpp37
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();
}