mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 13:57:52 +00:00
refactor(Scripts/Ulduar): seat Kologarn arms as vehicle accessories (#26747)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `vehicle_template_accessory` WHERE `entry` = 32930;
|
||||||
|
INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES
|
||||||
|
(32930, 32933, 0, 1, 'Kologarn', 8, 0),
|
||||||
|
(32930, 32934, 1, 1, 'Kologarn', 8, 0);
|
||||||
@@ -156,6 +156,10 @@ struct boss_kologarn : public BossAI
|
|||||||
instance->SaveToDB();
|
instance->SaveToDB();
|
||||||
}
|
}
|
||||||
Reset();
|
Reset();
|
||||||
|
// Arms are vehicle accessories; the initial pair is seated by Map::AddToMap,
|
||||||
|
// so only wipe recovery needs to heal survivors or reinstall missing arms.
|
||||||
|
AttachLeftArm();
|
||||||
|
AttachRightArm();
|
||||||
me->setActive(false);
|
me->setActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,18 +171,8 @@ struct boss_kologarn : public BossAI
|
|||||||
// Clear the arm's combat-start state so it can re-pull the boss on a subsequent attempt.
|
// Clear the arm's combat-start state so it can re-pull the boss on a subsequent attempt.
|
||||||
arm->AI()->Reset();
|
arm->AI()->Reset();
|
||||||
}
|
}
|
||||||
else if (Creature* accessory = me->SummonCreature(NPC_LEFT_ARM, *me, TEMPSUMMON_MANUAL_DESPAWN))
|
else
|
||||||
{
|
vehicle->InstallAccessory(NPC_LEFT_ARM, 0, true, TEMPSUMMON_MANUAL_DESPAWN, 0);
|
||||||
accessory->AddUnitTypeMask(UNIT_MASK_ACCESSORY);
|
|
||||||
if (!me->HandleSpellClick(accessory, 0))
|
|
||||||
accessory->DespawnOrUnsummon();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_left = accessory->GetGUID();
|
|
||||||
accessory->SetOrientation(M_PI);
|
|
||||||
accessory->CastSpell(accessory, SPELL_ARM_RESPAWN_VISUAL, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttachRightArm()
|
void AttachRightArm()
|
||||||
@@ -189,18 +183,8 @@ struct boss_kologarn : public BossAI
|
|||||||
// Clear the arm's combat-start state so it can re-pull the boss on a subsequent attempt.
|
// Clear the arm's combat-start state so it can re-pull the boss on a subsequent attempt.
|
||||||
arm->AI()->Reset();
|
arm->AI()->Reset();
|
||||||
}
|
}
|
||||||
else if (Creature* accessory = me->SummonCreature(NPC_RIGHT_ARM, *me, TEMPSUMMON_MANUAL_DESPAWN))
|
else
|
||||||
{
|
vehicle->InstallAccessory(NPC_RIGHT_ARM, 1, true, TEMPSUMMON_MANUAL_DESPAWN, 0);
|
||||||
accessory->AddUnitTypeMask(UNIT_MASK_ACCESSORY);
|
|
||||||
if (!me->HandleSpellClick(accessory, 1))
|
|
||||||
accessory->DespawnOrUnsummon();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_right = accessory->GetGUID();
|
|
||||||
accessory->SetOrientation(M_PI);
|
|
||||||
accessory->CastSpell(accessory, SPELL_ARM_RESPAWN_VISUAL, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
@@ -221,9 +205,6 @@ struct boss_kologarn : public BossAI
|
|||||||
door->SetGoState(GO_STATE_ACTIVE);
|
door->SetGoState(GO_STATE_ACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
AttachLeftArm();
|
|
||||||
AttachRightArm();
|
|
||||||
|
|
||||||
// Reset breath on pull
|
// Reset breath on pull
|
||||||
breathReady = false;
|
breathReady = false;
|
||||||
}
|
}
|
||||||
@@ -326,35 +307,46 @@ struct boss_kologarn : public BossAI
|
|||||||
|
|
||||||
void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override
|
void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override
|
||||||
{
|
{
|
||||||
|
if (apply)
|
||||||
|
{
|
||||||
|
if (who->GetEntry() == NPC_LEFT_ARM)
|
||||||
|
_left = who->GetGUID();
|
||||||
|
else if (who->GetEntry() == NPC_RIGHT_ARM)
|
||||||
|
_right = who->GetGUID();
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
who->SetOrientation(M_PI);
|
||||||
|
who->CastSpell(who, SPELL_ARM_RESPAWN_VISUAL, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!me->IsAlive() || instance->GetBossState(BOSS_KOLOGARN) != IN_PROGRESS)
|
if (!me->IsAlive() || instance->GetBossState(BOSS_KOLOGARN) != IN_PROGRESS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!apply)
|
// left arm
|
||||||
|
if (who->GetGUID() == _left)
|
||||||
{
|
{
|
||||||
// left arm
|
_left.Clear();
|
||||||
if (who->GetGUID() == _left)
|
if (me->IsInCombat())
|
||||||
{
|
{
|
||||||
_left.Clear();
|
Talk(SAY_LEFT_ARM_GONE);
|
||||||
if (me->IsInCombat())
|
events.ScheduleEvent(EVENT_RESTORE_ARM_LEFT, 50s);
|
||||||
{
|
|
||||||
Talk(SAY_LEFT_ARM_GONE);
|
|
||||||
events.ScheduleEvent(EVENT_RESTORE_ARM_LEFT, 50s);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
_right.Clear();
|
|
||||||
if (me->IsInCombat())
|
|
||||||
{
|
|
||||||
Talk(SAY_RIGHT_ARM_GONE);
|
|
||||||
events.ScheduleEvent(EVENT_RESTORE_ARM_RIGHT, 50s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
me->CastSpell(me, SPELL_ARM_DEAD, true);
|
|
||||||
if (!_right && !_left)
|
|
||||||
events.ScheduleEvent(EVENT_STONE_SHOUT, 5s);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_right.Clear();
|
||||||
|
if (me->IsInCombat())
|
||||||
|
{
|
||||||
|
Talk(SAY_RIGHT_ARM_GONE);
|
||||||
|
events.ScheduleEvent(EVENT_RESTORE_ARM_RIGHT, 50s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
me->CastSpell(me, SPELL_ARM_DEAD, true);
|
||||||
|
if (!_right && !_left)
|
||||||
|
events.ScheduleEvent(EVENT_STONE_SHOUT, 5s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DamageTaken(Unit* who, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
void DamageTaken(Unit* who, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||||
|
|||||||
Reference in New Issue
Block a user