fix(Scripts/BlackMorass): Fixed amount of Medivh's Integrity shield t… (#14948)
This commit is contained in:
+19
-3
@@ -49,7 +49,7 @@ public:
|
|||||||
uint32 encounters[MAX_ENCOUNTER];
|
uint32 encounters[MAX_ENCOUNTER];
|
||||||
ObjectGuid _medivhGUID;
|
ObjectGuid _medivhGUID;
|
||||||
uint8 _currentRift;
|
uint8 _currentRift;
|
||||||
uint8 _shieldPercent;
|
int8 _shieldPercent;
|
||||||
|
|
||||||
void Initialize() override
|
void Initialize() override
|
||||||
{
|
{
|
||||||
@@ -144,7 +144,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetData(uint32 type, uint32 /*data*/) override
|
void SetData(uint32 type, uint32 data) override
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
@@ -187,10 +187,19 @@ public:
|
|||||||
Events.RescheduleEvent(EVENT_NEXT_PORTAL, 3000);
|
Events.RescheduleEvent(EVENT_NEXT_PORTAL, 3000);
|
||||||
break;
|
break;
|
||||||
case DATA_DAMAGE_SHIELD:
|
case DATA_DAMAGE_SHIELD:
|
||||||
--_shieldPercent;
|
{
|
||||||
|
_shieldPercent -= data;
|
||||||
|
if (_shieldPercent < 0)
|
||||||
|
{
|
||||||
|
_shieldPercent = 0;
|
||||||
|
}
|
||||||
|
|
||||||
DoUpdateWorldState(WORLD_STATE_BM_SHIELD, _shieldPercent);
|
DoUpdateWorldState(WORLD_STATE_BM_SHIELD, _shieldPercent);
|
||||||
|
|
||||||
if (!_shieldPercent)
|
if (!_shieldPercent)
|
||||||
|
{
|
||||||
if (Creature* medivh = instance->GetCreature(_medivhGUID))
|
if (Creature* medivh = instance->GetCreature(_medivhGUID))
|
||||||
|
{
|
||||||
if (medivh->IsAlive())
|
if (medivh->IsAlive())
|
||||||
{
|
{
|
||||||
Unit::Kill(medivh, medivh);
|
Unit::Kill(medivh, medivh);
|
||||||
@@ -198,12 +207,19 @@ public:
|
|||||||
// Xinef: delete all spawns
|
// Xinef: delete all spawns
|
||||||
GuidSet eCopy = encounterNPCs;
|
GuidSet eCopy = encounterNPCs;
|
||||||
for (ObjectGuid const& guid : eCopy)
|
for (ObjectGuid const& guid : eCopy)
|
||||||
|
{
|
||||||
if (Creature* creature = instance->GetCreature(guid))
|
if (Creature* creature = instance->GetCreature(guid))
|
||||||
|
{
|
||||||
creature->DespawnOrUnsummon();
|
creature->DespawnOrUnsummon();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint32 GetData(uint32 type) const override
|
uint32 GetData(uint32 type) const override
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -387,16 +387,32 @@ public:
|
|||||||
{
|
{
|
||||||
PrepareAuraScript(spell_black_morass_corrupt_medivh_AuraScript);
|
PrepareAuraScript(spell_black_morass_corrupt_medivh_AuraScript);
|
||||||
|
|
||||||
|
bool Load() override
|
||||||
|
{
|
||||||
|
_ticks = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void PeriodicTick(AuraEffect const* /*aurEff*/)
|
void PeriodicTick(AuraEffect const* /*aurEff*/)
|
||||||
{
|
{
|
||||||
|
if (++_ticks >= 3)
|
||||||
|
{
|
||||||
|
_ticks = 0;
|
||||||
|
|
||||||
if (InstanceScript* instance = GetUnitOwner()->GetInstanceScript())
|
if (InstanceScript* instance = GetUnitOwner()->GetInstanceScript())
|
||||||
instance->SetData(DATA_DAMAGE_SHIELD, 1);
|
{
|
||||||
|
instance->SetData(DATA_DAMAGE_SHIELD, m_scriptSpellId == SPELL_CORRUPT_AEONUS ? 2 : 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_morass_corrupt_medivh_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_morass_corrupt_medivh_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint8 _ticks = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
AuraScript* GetAuraScript() const override
|
AuraScript* GetAuraScript() const override
|
||||||
|
|||||||
Reference in New Issue
Block a user