fix(Core/CullingOfStratholme): Chromie start (#9898)
This commit is contained in:
+32
-42
@@ -1412,66 +1412,56 @@ class npc_cos_chromie_start : public CreatureScript
|
|||||||
public:
|
public:
|
||||||
npc_cos_chromie_start() : CreatureScript("npc_cos_chromie_start") { }
|
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) {}
|
if (pQuest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
|
||||||
|
|
||||||
bool OnQuestAccept(Player*, Creature* creature, const Quest* pQuest)
|
|
||||||
{
|
{
|
||||||
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);
|
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
||||||
|
{
|
||||||
|
creature->CastSpell(player, SPELL_SUMMON_ARCANE_DISRUPTOR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// Skip Event
|
||||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/)
|
else if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11277)
|
||||||
{
|
{
|
||||||
// final menu id, show crates if hidden and add item if missing
|
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9595)
|
|
||||||
{
|
{
|
||||||
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
player->NearTeleportTo(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY(), LeaderIntroPos2.GetPositionZ(), LeaderIntroPos2.GetOrientation());
|
||||||
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
|
||||||
{
|
|
||||||
me->CastSpell(player, SPELL_SUMMON_ARCANE_DISRUPTOR);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 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 false to display last windows
|
||||||
{
|
return false;
|
||||||
return GetCullingOfStratholmeAI<npc_cos_chromie_startAI>(creature);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user