mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 22:07:52 +00:00
fix(Scripts/ICC): port Valithria Risen Archmage summon groups from TrinityCore (#26682)
Co-authored-by: Keader <keader.android@gmail.com> Co-authored-by: sirikfoll <11219553+sirikfoll@users.noreply.github.com> Co-authored-by: ForesterDev <11771800+ForesterDev@users.noreply.github.com> Co-authored-by: Treeston <treeston.mmoc@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
--
|
||||||
|
-- Valithria Dreamwalker: turn the initial Risen Archmages (37868) from persistent
|
||||||
|
-- creature spawns into summon groups on the Green Dragon Combat Trigger (38752).
|
||||||
|
-- As permanent spawns they carried the world default 7-day respawn, so they failed to
|
||||||
|
-- return on encounter reset. Ported from TrinityCore (Keader, PR #22754).
|
||||||
|
DELETE FROM `creature` WHERE `id` = 37868;
|
||||||
|
DELETE FROM `creature_summon_groups` WHERE `summonerId` = 38752 AND `entry` = 37868;
|
||||||
|
INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`, `Comment`) VALUES
|
||||||
|
(38752, 0, 1, 37868, 4222.86, 2504.58, 364.96, 3.90954, 8, 0, 'Risen Archmage'),
|
||||||
|
(38752, 0, 1, 37868, 4223.4, 2465.11, 364.952, 2.3911, 8, 0, 'Risen Archmage'),
|
||||||
|
(38752, 0, 2, 37868, 4230.44, 2478.56, 364.953, 2.93215, 8, 0, 'Risen Archmage'),
|
||||||
|
(38752, 0, 2, 37868, 4230.53, 2490.22, 364.957, 3.36849, 8, 0, 'Risen Archmage'),
|
||||||
|
(38752, 0, 3, 37868, 4185.29, 2464.01, 364.87, 0.798137, 8, 0, 'Risen Archmage'),
|
||||||
|
(38752, 0, 3, 37868, 4183.7, 2503.93, 364.879, 5.50843, 8, 0, 'Risen Archmage');
|
||||||
@@ -139,24 +139,21 @@ enum Events
|
|||||||
|
|
||||||
enum Actions
|
enum Actions
|
||||||
{
|
{
|
||||||
ACTION_ENTER_COMBAT = 1,
|
ACTION_ENTER_COMBAT = 1,
|
||||||
MISSED_PORTALS = 2,
|
MISSED_PORTALS = 2,
|
||||||
ACTION_DEATH = 3,
|
ACTION_DEATH = 3,
|
||||||
|
ACTION_SETUP_ARCHMAGES = 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum SummonGroups
|
||||||
|
{
|
||||||
|
SUMMON_GROUP_ALL = 1,
|
||||||
|
SUMMON_GROUP_10 = 2,
|
||||||
|
SUMMON_GROUP_25 = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
Position const ValithriaSpawnPos = {4210.813f, 2484.443f, 364.9558f, 0.01745329f};
|
Position const ValithriaSpawnPos = {4210.813f, 2484.443f, 364.9558f, 0.01745329f};
|
||||||
|
|
||||||
class RisenArchmageCheck
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// look for all permanently spawned Risen Archmages that are not yet in combat
|
|
||||||
bool operator()(Creature* creature)
|
|
||||||
{
|
|
||||||
return creature->IsAlive() && creature->GetEntry() == NPC_RISEN_ARCHMAGE &&
|
|
||||||
creature->GetSpawnId() && !creature->IsInCombat();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ManaVoidSelector
|
struct ManaVoidSelector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -249,12 +246,8 @@ public:
|
|||||||
creature->DespawnOrUnsummon();
|
creature->DespawnOrUnsummon();
|
||||||
return;
|
return;
|
||||||
case NPC_RISEN_ARCHMAGE:
|
case NPC_RISEN_ARCHMAGE:
|
||||||
if (!creature->GetSpawnId())
|
creature->DespawnOrUnsummon();
|
||||||
{
|
return;
|
||||||
creature->DespawnOrUnsummon();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -498,6 +491,16 @@ public:
|
|||||||
{
|
{
|
||||||
_Reset();
|
_Reset();
|
||||||
me->SetReactState(REACT_PASSIVE);
|
me->SetReactState(REACT_PASSIVE);
|
||||||
|
summons.DespawnAll();
|
||||||
|
|
||||||
|
me->SummonCreatureGroup(SUMMON_GROUP_ALL);
|
||||||
|
if (Is25ManRaid())
|
||||||
|
me->SummonCreatureGroup(SUMMON_GROUP_25);
|
||||||
|
else
|
||||||
|
me->SummonCreatureGroup(SUMMON_GROUP_10);
|
||||||
|
|
||||||
|
EntryCheckPredicate pred(NPC_RISEN_ARCHMAGE);
|
||||||
|
summons.DoAction(ACTION_SETUP_ARCHMAGES, pred);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustEnteredCombat(Unit* target) override
|
void JustEnteredCombat(Unit* target) override
|
||||||
@@ -522,12 +525,8 @@ public:
|
|||||||
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_VALITHRIA_LICH_KING)))
|
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_VALITHRIA_LICH_KING)))
|
||||||
lichKing->AI()->DoAction(ACTION_ENTER_COMBAT);
|
lichKing->AI()->DoAction(ACTION_ENTER_COMBAT);
|
||||||
|
|
||||||
std::list<Creature*> archmages;
|
EntryCheckPredicate pred(NPC_RISEN_ARCHMAGE);
|
||||||
RisenArchmageCheck check;
|
summons.DoAction(ACTION_ENTER_COMBAT, pred);
|
||||||
Acore::CreatureListSearcher<RisenArchmageCheck> searcher(me, archmages, check);
|
|
||||||
Cell::VisitObjects(me, searcher, 100.0f);
|
|
||||||
for (std::list<Creature*>::iterator itr = archmages.begin(); itr != archmages.end(); ++itr)
|
|
||||||
(*itr)->AI()->DoAction(ACTION_ENTER_COMBAT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveInLineOfSight(Unit* /*who*/) override {}
|
void MoveInLineOfSight(Unit* /*who*/) override {}
|
||||||
@@ -675,7 +674,6 @@ public:
|
|||||||
_events.ScheduleEvent(EVENT_FROSTBOLT_VOLLEY, 5s, 15s);
|
_events.ScheduleEvent(EVENT_FROSTBOLT_VOLLEY, 5s, 15s);
|
||||||
_events.ScheduleEvent(EVENT_MANA_VOID, 20s, 25s);
|
_events.ScheduleEvent(EVENT_MANA_VOID, 20s, 25s);
|
||||||
_events.ScheduleEvent(EVENT_COLUMN_OF_FROST, 10s, 20s);
|
_events.ScheduleEvent(EVENT_COLUMN_OF_FROST, 10s, 20s);
|
||||||
_isInitialArchmage = me->GetSpawnId() != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustEnteredCombat(Unit* who) override
|
void JustEnteredCombat(Unit* who) override
|
||||||
@@ -701,6 +699,8 @@ public:
|
|||||||
{
|
{
|
||||||
if (action == ACTION_ENTER_COMBAT)
|
if (action == ACTION_ENTER_COMBAT)
|
||||||
DoZoneInCombat();
|
DoZoneInCombat();
|
||||||
|
else if (action == ACTION_SETUP_ARCHMAGES)
|
||||||
|
_isInitialArchmage = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustSummoned(Creature* summon) override
|
void JustSummoned(Creature* summon) override
|
||||||
|
|||||||
Reference in New Issue
Block a user