mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +00:00
fix(Script/Ahnkahet): Jedoga Shadowseeke sacrifice (#15153)
* fix(Script/Instance): Jedoga Shadowseeke sacrifice * build * std::chrono
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
-- Ahn'kahet: The Old Kingdom - Jedoga Shadowseeker
|
||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id`=56150 AND `ScriptName`='spell_jedoga_sacrafice_beam';
|
||||||
@@ -69,6 +69,7 @@ enum Events
|
|||||||
EVENT_JEDOGA_PREPARE_RITUAL,
|
EVENT_JEDOGA_PREPARE_RITUAL,
|
||||||
EVENT_JEDOGA_MOVE_UP,
|
EVENT_JEDOGA_MOVE_UP,
|
||||||
EVENT_JEDOGA_MOVE_DOWN,
|
EVENT_JEDOGA_MOVE_DOWN,
|
||||||
|
EVENT_JEDGA_START_RITUAL,
|
||||||
|
|
||||||
// Initiate
|
// Initiate
|
||||||
EVENT_RITUAL_BEGIN_MOVE,
|
EVENT_RITUAL_BEGIN_MOVE,
|
||||||
@@ -384,11 +385,9 @@ struct boss_jedoga_shadowseeker : public BossAI
|
|||||||
if (!summons.empty())
|
if (!summons.empty())
|
||||||
{
|
{
|
||||||
sacraficeTarget_GUID = Acore::Containers::SelectRandomContainerElement(summons);
|
sacraficeTarget_GUID = Acore::Containers::SelectRandomContainerElement(summons);
|
||||||
if (Creature* volunteer = ObjectAccessor::GetCreature(*me, sacraficeTarget_GUID))
|
if (ObjectAccessor::GetCreature(*me, sacraficeTarget_GUID))
|
||||||
{
|
{
|
||||||
Talk(SAY_SACRIFICE_1);
|
events.ScheduleEvent(EVENT_JEDGA_START_RITUAL, 3s, 0, PHASE_RITUAL);
|
||||||
sacraficeTarget_GUID = volunteer->GetGUID();
|
|
||||||
volunteer->AI()->DoAction(ACTION_RITUAL_BEGIN);
|
|
||||||
}
|
}
|
||||||
// Something failed, let players continue but do not grant achievement
|
// Something failed, let players continue but do not grant achievement
|
||||||
else
|
else
|
||||||
@@ -506,6 +505,17 @@ struct boss_jedoga_shadowseeker : public BossAI
|
|||||||
me->GetMotionMaster()->MovePoint(POINT_DOWN, JedogaPosition[1], false);
|
me->GetMotionMaster()->MovePoint(POINT_DOWN, JedogaPosition[1], false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case EVENT_JEDGA_START_RITUAL:
|
||||||
|
{
|
||||||
|
sacraficeTarget_GUID = Acore::Containers::SelectRandomContainerElement(summons);
|
||||||
|
if (Creature* volunteer = ObjectAccessor::GetCreature(*me, sacraficeTarget_GUID))
|
||||||
|
{
|
||||||
|
Talk(SAY_SACRIFICE_1);
|
||||||
|
sacraficeTarget_GUID = volunteer->GetGUID();
|
||||||
|
volunteer->AI()->DoAction(ACTION_RITUAL_BEGIN);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,12 +642,8 @@ struct npc_twilight_volunteer : public ScriptedAI
|
|||||||
if (Creature* jedoga = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_JEDOGA_SHADOWSEEKER)))
|
if (Creature* jedoga = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_JEDOGA_SHADOWSEEKER)))
|
||||||
{
|
{
|
||||||
jedoga->AI()->Talk(SAY_SACRIFICE_2);
|
jedoga->AI()->Talk(SAY_SACRIFICE_2);
|
||||||
jedoga->CastSpell(nullptr, SPELL_SACRIFICE_BEAM);
|
jedoga->CastSpell(nullptr, SPELL_SACRIFICE_BEAM); /// @todo: Visual is not working. (cosmetic)
|
||||||
|
jedoga->AI()->DoAction(ACTION_SACRAFICE);
|
||||||
if (Creature* ritualTrigger = jedoga->SummonCreature(NPC_JEDOGA_CONTROLLER, JedogaPosition[2], TEMPSUMMON_TIMED_DESPAWN, 5000))
|
|
||||||
{
|
|
||||||
ritualTrigger->CastSpell(ritualTrigger, SPELL_SACRIFICE_VISUAL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Talk(SAY_SACRIFICED);
|
Talk(SAY_SACRIFICED);
|
||||||
@@ -656,6 +662,14 @@ struct npc_twilight_volunteer : public ScriptedAI
|
|||||||
me->SetHomePosition(JedogaPosition[2]);
|
me->SetHomePosition(JedogaPosition[2]);
|
||||||
me->SetWalk(true);
|
me->SetWalk(true);
|
||||||
me->GetMotionMaster()->MovePoint(POINT_RITUAL, JedogaPosition[2], false);
|
me->GetMotionMaster()->MovePoint(POINT_RITUAL, JedogaPosition[2], false);
|
||||||
|
|
||||||
|
if (Creature* jedoga = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_JEDOGA_SHADOWSEEKER)))
|
||||||
|
{
|
||||||
|
if (Creature* ritualTrigger = jedoga->SummonCreature(NPC_JEDOGA_CONTROLLER, JedogaPosition[2], TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||||
|
{
|
||||||
|
ritualTrigger->CastSpell(ritualTrigger, SPELL_SACRIFICE_VISUAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -688,31 +702,6 @@ class spell_random_lightning_visual_effect : public SpellScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 56150 - Sacrifice Beam
|
|
||||||
class spell_jedoga_sacrafice_beam : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_jedoga_sacrafice_beam);
|
|
||||||
|
|
||||||
bool Load() override
|
|
||||||
{
|
|
||||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleRemoval(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
||||||
{
|
|
||||||
AuraRemoveMode const removeMode = GetTargetApplication()->GetRemoveMode();
|
|
||||||
if (removeMode == AURA_REMOVE_BY_DEFAULT || removeMode == AURA_REMOVE_BY_EXPIRE)
|
|
||||||
{
|
|
||||||
GetCaster()->ToCreature()->AI()->DoAction(ACTION_SACRAFICE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
AfterEffectRemove += AuraEffectRemoveFn(spell_jedoga_sacrafice_beam::HandleRemoval, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// CriteriaID 7359, Volunteer Work (2056)
|
// CriteriaID 7359, Volunteer Work (2056)
|
||||||
class achievement_volunteer_work : public AchievementCriteriaScript
|
class achievement_volunteer_work : public AchievementCriteriaScript
|
||||||
{
|
{
|
||||||
@@ -740,7 +729,6 @@ void AddSC_boss_jedoga_shadowseeker()
|
|||||||
|
|
||||||
// Spells
|
// Spells
|
||||||
RegisterSpellScript(spell_random_lightning_visual_effect);
|
RegisterSpellScript(spell_random_lightning_visual_effect);
|
||||||
RegisterSpellScript(spell_jedoga_sacrafice_beam);
|
|
||||||
|
|
||||||
// Achievements
|
// Achievements
|
||||||
new achievement_volunteer_work();
|
new achievement_volunteer_work();
|
||||||
|
|||||||
Reference in New Issue
Block a user