mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-15 21:45:12 +00:00
fix(Scripts/CoS): Chromie dialog options (#25024)
This commit is contained in:
@@ -1402,7 +1402,10 @@ enum chromie
|
||||
ITEM_ARCANE_DISRUPTOR = 37888,
|
||||
QUEST_DISPELLING_ILLUSIONS = 13149,
|
||||
QUEST_A_ROYAL_ESCORT = 13151,
|
||||
SPELL_SUMMON_ARCANE_DISRUPTOR = 49591
|
||||
SPELL_SUMMON_ARCANE_DISRUPTOR = 49591,
|
||||
GOSSIP_MENU_START = 9586,
|
||||
GOSSIP_MENU_ACTION_MENU_SKIP = 11277,
|
||||
GOSSIP_MENU_ACTION_INTERFERE = 9595
|
||||
};
|
||||
|
||||
class npc_cos_chromie_start : public CreatureScript
|
||||
@@ -1410,55 +1413,55 @@ class npc_cos_chromie_start : public CreatureScript
|
||||
public:
|
||||
npc_cos_chromie_start() : CreatureScript("npc_cos_chromie_start") { }
|
||||
|
||||
bool OnQuestAccept(Player*, Creature* creature, const Quest* pQuest)
|
||||
bool OnQuestAccept(Player* /*player*/, Creature* creature, const Quest* quest) override
|
||||
{
|
||||
if (pQuest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
{
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
}
|
||||
}
|
||||
if (quest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
instance->SetData(DATA_SHOW_CRATES, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/)
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
// final menu id, show crates if hidden and add item if missing
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9595)
|
||||
switch (player->PlayerTalkClass->GetGossipMenu().GetMenuId())
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
case GOSSIP_MENU_START:
|
||||
{
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
{
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
}
|
||||
}
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
if (instance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
instance->SetData(DATA_SHOW_CRATES, 1);
|
||||
|
||||
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
||||
{
|
||||
creature->CastSpell(player, SPELL_SUMMON_ARCANE_DISRUPTOR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Skip Event
|
||||
else if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11277)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
case GOSSIP_MENU_ACTION_INTERFERE:
|
||||
{
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
||||
creature->CastSpell(player, SPELL_SUMMON_ARCANE_DISRUPTOR);
|
||||
|
||||
break;
|
||||
}
|
||||
// Since 3.3.3: "Players may now skip the initial introduction dialog to this dungeon once they have completed it at least once."
|
||||
case GOSSIP_MENU_ACTION_MENU_SKIP:
|
||||
{
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_FINISHED_INTRO);
|
||||
if (Creature* arthas = ObjectAccessor::GetCreature(*creature, pInstance->GetGuidData(DATA_ARTHAS)))
|
||||
if (instance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
{
|
||||
arthas->AI()->Reset();
|
||||
instance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_FINISHED_INTRO);
|
||||
|
||||
if (Creature* arthas = ObjectAccessor::GetCreature(*creature, instance->GetGuidData(DATA_ARTHAS)))
|
||||
arthas->AI()->Reset();
|
||||
}
|
||||
|
||||
player->NearTeleportTo(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY(), LeaderIntroPos2.GetPositionZ(), LeaderIntroPos2.GetOrientation());
|
||||
}
|
||||
player->NearTeleportTo(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY(), LeaderIntroPos2.GetPositionZ(), LeaderIntroPos2.GetOrientation());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// return false to display last windows
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -1483,7 +1486,7 @@ public:
|
||||
if (!creature->GetInstanceScript() || creature->GetInstanceScript()->GetData(DATA_ARTHAS_EVENT) != COS_PROGRESS_CRATES_FOUND)
|
||||
return true;
|
||||
|
||||
// We can start event:)
|
||||
// "Well, you're not going to sign recruitment papers or anything, but you are going to fight alongside him. ..."
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9612)
|
||||
creature->GetInstanceScript()->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_START_INTRO);
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ enum Data
|
||||
DATA_START_WAVES,
|
||||
DATA_SHOW_INFINITE_TIMER,
|
||||
DATA_ARTHAS_REPOSITION,
|
||||
|
||||
DATA_INTRO_EVENT_FINISHED,
|
||||
};
|
||||
|
||||
enum Data64
|
||||
|
||||
@@ -188,6 +188,8 @@ public:
|
||||
return _encounterState;
|
||||
case DATA_GUARDIANTIME_EVENT:
|
||||
return _guardianTimer;
|
||||
case DATA_INTRO_EVENT_FINISHED:
|
||||
return _encounterState >= COS_PROGRESS_FINISHED_INTRO ? 1 : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user