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
This commit is contained in:
1 parent
323989cc47
commit
8c286f2b61
2 files changed
+70
-26
No files matched your search
@@ -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);
|
||||
|
||||
@@ -532,30 +554,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();
|
||||
|
||||
Reference in new issue
Block a user