mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix (Scripts/ICC): Make Valithria starting health dynamic, fix broken channeling spell (#17586)
* Make Valithria starting health dynamic based on actual max health * Fix Risen Archmage broken spell channel and combat log spam
This commit is contained in:
@@ -293,16 +293,12 @@ public:
|
||||
_instance(creature->GetInstanceScript()), _portalCount(RAID_MODE<uint32>(3, 8, 3, 8))
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
_spawnHealth = 1; // just in case if not set below
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(me->GetSpawnId()))
|
||||
if (data->curhealth)
|
||||
_spawnHealth = data->curhealth;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_events.Reset();
|
||||
me->SetHealth(_spawnHealth);
|
||||
me->SetHealth(me->GetMaxHealth() * 0.5f); // starts at 50% health
|
||||
me->LoadCreaturesAddon(true);
|
||||
// immune to percent heals
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_OBS_MOD_HEALTH, true);
|
||||
@@ -440,8 +436,9 @@ public:
|
||||
// does not enter combat
|
||||
if (_instance->GetBossState(DATA_VALITHRIA_DREAMWALKER) == NOT_STARTED)
|
||||
{
|
||||
if (me->GetHealth() != _spawnHealth) // healing when boss cannot be engaged (lower spire not finished, cheating) doesn't start the fight, prevent winning this way
|
||||
me->SetHealth(_spawnHealth);
|
||||
uint32 startingHealth = me->GetMaxHealth() * 0.5f;
|
||||
if (me->GetHealth() != startingHealth) // healing when boss cannot be engaged (lower spire not finished, cheating) doesn't start the fight, prevent winning this way
|
||||
me->SetHealth(startingHealth);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -484,7 +481,6 @@ public:
|
||||
private:
|
||||
EventMap _events;
|
||||
InstanceScript* _instance;
|
||||
uint32 _spawnHealth;
|
||||
uint32 const _portalCount;
|
||||
uint32 _missedPortals;
|
||||
bool _under25PercentTalkDone;
|
||||
@@ -756,7 +752,7 @@ public:
|
||||
if (!me->IsInCombat())
|
||||
if (me->GetSpawnId())
|
||||
if (!me->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||
me->CastSpell(me, SPELL_CORRUPTION, false);
|
||||
me->CastSpell(me, SPELL_CORRUPTION, true);
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user