xt gravity bomb pair
This commit is contained in:
@@ -880,73 +880,67 @@ class spell_xt002_tympanic_tantrum : public SpellScript
|
||||
};
|
||||
|
||||
// 64234, 63024 - Gravity Bomb
|
||||
class spell_xt002_gravity_bomb_aura : public SpellScriptLoader
|
||||
enum GravityBomb
|
||||
{
|
||||
public:
|
||||
spell_xt002_gravity_bomb_aura() : SpellScriptLoader("spell_xt002_gravity_bomb_aura") { }
|
||||
SPELL_GRAVTY_BOMB_10 = 63025
|
||||
};
|
||||
|
||||
class spell_xt002_gravity_bomb_aura_AuraScript : public AuraScript
|
||||
class spell_xt002_gravity_bomb : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_gravity_bomb);
|
||||
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareAuraScript(spell_xt002_gravity_bomb_aura_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* player = GetOwner()->ToPlayer())
|
||||
if (Unit* xt002 = GetCaster())
|
||||
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
|
||||
if (Creature* cr = xt002->SummonCreature(NPC_VOID_ZONE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
|
||||
{
|
||||
int32 damage = GetSpellInfo()->Id == 63025 ? 5000 : 7500;
|
||||
cr->CastCustomSpell(cr, SPELL_VOID_ZONE_DAMAGE, &damage, 0, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* xt002 = GetCaster();
|
||||
if (!xt002)
|
||||
return;
|
||||
|
||||
Unit* owner = GetOwner()->ToUnit();
|
||||
if (!owner)
|
||||
return;
|
||||
|
||||
if (aurEff->GetAmount() >= int32(owner->GetHealth()))
|
||||
if (xt002->GetAI())
|
||||
xt002->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_xt002_gravity_bomb_aura_AuraScript::OnPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_xt002_gravity_bomb_aura_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_xt002_gravity_bomb_aura_AuraScript();
|
||||
if (Unit* victim = GetCaster()->GetVictim())
|
||||
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
|
||||
}
|
||||
|
||||
class spell_xt002_gravity_bomb_aura_SpellScript : public SpellScript
|
||||
void Register() override
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_gravity_bomb_aura_SpellScript);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_gravity_bomb::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* victim = GetCaster()->GetVictim())
|
||||
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
|
||||
}
|
||||
class spell_xt002_gravity_bomb_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_xt002_gravity_bomb_aura);
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_gravity_bomb_aura_SpellScript::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return new spell_xt002_gravity_bomb_aura_SpellScript();
|
||||
return ValidateSpellInfo({ SPELL_VOID_ZONE_DAMAGE });
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* player = GetOwner()->ToPlayer())
|
||||
if (Unit* xt002 = GetCaster())
|
||||
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
|
||||
if (Creature* creature = xt002->SummonCreature(NPC_VOID_ZONE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
|
||||
{
|
||||
int32 damage = GetSpellInfo()->Id == SPELL_GRAVTY_BOMB_10 ? 5000 : 7500;
|
||||
creature->CastCustomSpell(creature, SPELL_VOID_ZONE_DAMAGE, &damage, 0, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* xt002 = GetCaster();
|
||||
if (!xt002)
|
||||
return;
|
||||
|
||||
Unit* owner = GetOwner()->ToUnit();
|
||||
if (!owner)
|
||||
return;
|
||||
|
||||
if (aurEff->GetAmount() >= int32(owner->GetHealth()))
|
||||
if (xt002->GetAI())
|
||||
xt002->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_xt002_gravity_bomb_aura::OnPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_xt002_gravity_bomb_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1067,7 +1061,7 @@ void AddSC_boss_xt002()
|
||||
|
||||
// Spells
|
||||
RegisterSpellScript(spell_xt002_tympanic_tantrum);
|
||||
new spell_xt002_gravity_bomb_aura();
|
||||
RegisterSpellAndAuraScriptPair(spell_xt002_gravity_bomb, spell_xt002_gravity_bomb_aura);
|
||||
RegisterSpellScript(spell_xt002_gravity_bomb_damage);
|
||||
new spell_xt002_searing_light_spawn_life_spark();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user