diff options
author | Trista <aconstantgoal@abv.bg> | 2012-12-18 02:01:49 +0200 |
---|---|---|
committer | Trista <aconstantgoal@abv.bg> | 2012-12-18 02:03:30 +0200 |
commit | 8c286f2b61ffd5237d9f60fa9c0d8c493e4279bd (patch) | |
tree | 20f73f04d4e856bb4f3d63ae019ebf898c567480 /src | |
parent | 323989cc473ecda001ef2de528f69dca3da9bdf2 (diff) |
Server/Quest: Convert quest_end_script and drop of some c++
* drop off c++ script of Clintan Dreamwalker ID: 22834
* convert quest_end_script of 10964 to SAI
* rewrite and add bigger event support
* add a checker to his summon so the spirit script can trigger event alone (I didn't try to rewrite next quest...)
Closes: #8689
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Kalimdor/moonglade.cpp | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 9485048da8c..1296163178e 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -319,6 +319,28 @@ public: } } + void IsSummonedBy(Unit* /*summoner*/) + { + std::list<Player*> playerOnQuestList; + Trinity::AnyPlayerInObjectRangeCheck checker(me, 5.0f); + Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, playerOnQuestList, checker); + me->VisitNearbyWorldObject(5.0f, searcher); + for (std::list<Player*>::const_iterator itr = playerOnQuestList.begin(); itr != playerOnQuestList.end(); ++itr) + { + // Check if found player target has active quest + if (Player* player = (*itr)) + { + if (player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + { + StartEvent(player); + break; + } + } + else + break; + } + } + void JustDied(Unit* /*killer*/) { if (!PlayerGUID) @@ -358,7 +380,7 @@ public: return; } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { npc_escortAI::UpdateAI(diff); @@ -533,30 +555,6 @@ public: }; /*#### -# npc_clintar_dreamwalker -####*/ - -enum Clintar -{ - CLINTAR_SPIRIT = 22916 -}; - -class npc_clintar_dreamwalker : public CreatureScript -{ -public: - npc_clintar_dreamwalker() : CreatureScript("npc_clintar_dreamwalker") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == 10965) - if (Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, ClintarSpiritSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000)) - CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player); - return true; - } - -}; - -/*#### # npc_omen ####*/ @@ -707,7 +705,6 @@ void AddSC_moonglade() new npc_bunthen_plainswind(); new npc_great_bear_spirit(); new npc_silva_filnaveth(); - new npc_clintar_dreamwalker(); new npc_clintar_spirit(); new npc_omen(); new npc_giant_spotlight(); |