diff options
-rw-r--r-- | sql/updates/world/2015_01_30_01_world.sql | 11 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/zone_felwood.cpp | 37 |
2 files changed, 48 insertions, 0 deletions
diff --git a/sql/updates/world/2015_01_30_01_world.sql b/sql/updates/world/2015_01_30_01_world.sql new file mode 100644 index 00000000000..56212e2873c --- /dev/null +++ b/sql/updates/world/2015_01_30_01_world.sql @@ -0,0 +1,11 @@ +-- +DELETE FROM `areatrigger_scripts` WHERE `entry`=3587; +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(3587, 'at_ancient_leaf'); +DELETE FROM `creature` WHERE `id` IN (14524, 14525, 14526); + +DELETE FROM `creature_summon_groups` WHERE `summonerId`=1; +INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES +(1, 2, 1, 14524, 6204.051758, -1172.575684, 370.079224, 0.86052, 3, 100000), +(1, 2, 1, 14525, 6246.953613, -1155.985718, 366.182953, 2.90269, 3, 100000), +(1, 2, 1, 14526, 6193.449219, -1137.834106, 366.260529, 5.77332, 3, 100000); 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(); } |