mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 10:55:43 +00:00
fix(Core/CullingOfStratholme): Chromie start (#9898)
This commit is contained in:
@@ -1412,66 +1412,56 @@ class npc_cos_chromie_start : public CreatureScript
|
||||
public:
|
||||
npc_cos_chromie_start() : CreatureScript("npc_cos_chromie_start") { }
|
||||
|
||||
struct npc_cos_chromie_startAI : public ScriptedAI
|
||||
bool OnQuestAccept(Player*, Creature* creature, const Quest* pQuest)
|
||||
{
|
||||
npc_cos_chromie_startAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
bool OnQuestAccept(Player*, Creature* creature, const Quest* pQuest)
|
||||
if (pQuest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
|
||||
{
|
||||
if (pQuest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/)
|
||||
{
|
||||
// final menu id, show crates if hidden and add item if missing
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9595)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
{
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
{
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
||||
{
|
||||
creature->CastSpell(player, SPELL_SUMMON_ARCANE_DISRUPTOR);
|
||||
}
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/)
|
||||
// Skip Event
|
||||
else if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11277)
|
||||
{
|
||||
// final menu id, show crates if hidden and add item if missing
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9595)
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
{
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_FINISHED_INTRO);
|
||||
if (Creature* arthas = ObjectAccessor::GetCreature(*creature, pInstance->GetGuidData(DATA_ARTHAS)))
|
||||
{
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
arthas->AI()->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
||||
{
|
||||
me->CastSpell(player, SPELL_SUMMON_ARCANE_DISRUPTOR);
|
||||
}
|
||||
player->NearTeleportTo(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY(), LeaderIntroPos2.GetPositionZ(), LeaderIntroPos2.GetOrientation());
|
||||
}
|
||||
// Skip Event
|
||||
else if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11277)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
{
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
{
|
||||
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_FINISHED_INTRO);
|
||||
if (Creature* arthas = ObjectAccessor::GetCreature(*creature, pInstance->GetGuidData(DATA_ARTHAS)))
|
||||
{
|
||||
arthas->AI()->Reset();
|
||||
}
|
||||
}
|
||||
player->NearTeleportTo(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY(), LeaderIntroPos2.GetPositionZ(), LeaderIntroPos2.GetOrientation());
|
||||
}
|
||||
}
|
||||
|
||||
// return false to display last windows
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetCullingOfStratholmeAI<npc_cos_chromie_startAI>(creature);
|
||||
// return false to display last windows
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user