More Onyxia 40 fixes

This commit is contained in:
郑佩茹
2022-12-08 10:21:51 -07:00
parent 51bcb6574a
commit a721c71db8
3 changed files with 32 additions and 8 deletions

View File

@@ -423,7 +423,7 @@ public:
class IndividualPlayerProgression_UnitScript : public UnitScript class IndividualPlayerProgression_UnitScript : public UnitScript
{ {
private: private:
float computeTotalGearTuning(Player* player) static float computeTotalGearTuning(Player* player)
{ {
float gearAdjustment = 0.0; float gearAdjustment = 0.0;
for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)

View File

@@ -112,9 +112,8 @@ enum Yells
SAY_KILL = 1, SAY_KILL = 1,
SAY_PHASE_2_TRANS = 2, SAY_PHASE_2_TRANS = 2,
SAY_PHASE_3_TRANS = 3, SAY_PHASE_3_TRANS = 3,
EMOTE_BREATH = 4,
// Emote SAY_EVADE = 5
EMOTE_BREATH = 4
}; };
class boss_onyxia_40 : public CreatureScript class boss_onyxia_40 : public CreatureScript
@@ -293,9 +292,21 @@ public:
} }
} }
bool CheckInRoom() override
{
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 95.0f)
{
Talk(SAY_EVADE);
EnterEvadeMode();
return false;
}
return true;
}
void UpdateAI(uint32 diff) override void UpdateAI(uint32 diff) override
{ {
if (!UpdateVictim()) if (!UpdateVictim() || !CheckInRoom())
{ {
return; return;
} }
@@ -452,7 +463,7 @@ public:
{ {
Talk(EMOTE_BREATH); Talk(EMOTE_BREATH);
me->SetFacingTo(OnyxiaMoveData[CurrentWP].o); me->SetFacingTo(OnyxiaMoveData[CurrentWP].o);
DoCast(OnyxiaMoveData[CurrentWP].spellId); DoCastAOE(OnyxiaMoveData[CurrentWP].spellId);
events.ScheduleEvent(EVENT_SPELL_BREATH, 8250); events.ScheduleEvent(EVENT_SPELL_BREATH, 8250);
break; break;
} }
@@ -500,7 +511,7 @@ public:
{ {
if (Creature* trigger = me->SummonCreature(12758, *me, TEMPSUMMON_TIMED_DESPAWN, 1000)) if (Creature* trigger = me->SummonCreature(12758, *me, TEMPSUMMON_TIMED_DESPAWN, 1000))
{ {
trigger->AI()->DoCast(trigger, 17731); trigger->CastSpell(trigger, 17731, false);
} }
break; break;
} }

View File

@@ -57,7 +57,14 @@ public:
switch (go->GetEntry()) switch (go->GetEntry())
{ {
case GO_WHELP_SPAWNER: case GO_WHELP_SPAWNER:
if (instance->GetDifficulty() == RAID_DIFFICULTY_10MAN_HEROIC)
{
go->CastSpell((Unit*)nullptr, 90003);
}
else
{
go->CastSpell((Unit*)nullptr, 17646); go->CastSpell((Unit*)nullptr, 17646);
}
if (Creature* onyxia = GetCreature(DATA_ONYXIA)) if (Creature* onyxia = GetCreature(DATA_ONYXIA))
{ {
onyxia->AI()->DoAction(-1); onyxia->AI()->DoAction(-1);
@@ -314,6 +321,12 @@ public:
spellInfo->Effects[EFFECT_0].DieSides = 225; spellInfo->Effects[EFFECT_0].DieSides = 225;
spellInfo->Effects[EFFECT_0].BasePoints = 1387; spellInfo->Effects[EFFECT_0].BasePoints = 1387;
break; break;
case 90003:
spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(5);
break;
} }
} }
}; };