mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-15 13:35:08 +00:00
fix(Scripts/CoS): Chromie dialog options (#25024)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
--
|
||||
-- Remove misplaced "Yes, please!" option from menu 9586.
|
||||
DELETE FROM `gossip_menu_option` WHERE `MenuID` = 9586 AND `OptionID` = 1;
|
||||
DELETE FROM `gossip_menu_option_locale` WHERE `MenuID` = 9586 AND `OptionID` = 1;
|
||||
|
||||
-- Show "Welcome, adventurer. You've come just in the nick..." if intro has not been completed yet
|
||||
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 14) AND (`SourceGroup` = 9586) AND (`SourceEntry` IN (12939, 13470, 13471));
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(14, 9586, 13470, 0, 0, 13, 0, 7, 1, 0, 0, 0, 0, '', 'intro event must be completed'),
|
||||
(14, 9586, 13471, 0, 0, 2, 0, 37888, 1, 0, 0, 0, 0, '', 'must have item Arcane Disruptor'),
|
||||
(14, 9586, 13471, 0, 0, 13, 0, 7, 0, 0, 0, 0, 0, '', 'intro event must not be completed');
|
||||
@@ -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