Scripts/Eye of Eternity: Rewrite Arcane Barrage mechanic

* Note that even after last changes happens I'm not sure exactly how the timers are controlled. The wipe chance should be a lot smaller now.. Any further change I can think of is beyond what I see. The main problem is currently. In theory there is chance, If timers get to be same with delay lesser than 2 seconds and if target randomisations select same target for shit out of luck reason. And if starting different timers were matching you can be hit atleast 2-3 times and on 25 mode maybe more. The timers are not with fixed difference for sure is all I know.
This commit is contained in:
Trista
2013-03-03 03:16:17 +02:00
parent 6be5bc71eb
commit a108a9026a
3 changed files with 52 additions and 6 deletions
@@ -0,0 +1,6 @@
-- Delete wrongly inserted spell linked spell of Scion of Eternity - "Arcane Barrage".
-- It should be handled in the original caster spell with spellscript effect.
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=56397 AND `spell_effect`=63934 AND`type`=1;
-- Update flags in creature for Malygos since differ from these in creature_template
UPDATE `creature` SET `unit_flags`=320,`dynamicflags`=8 WHERE `id`=28859;
+5
View File
@@ -3620,6 +3620,11 @@ void SpellMgr::LoadDbcDataCorrections()
case 57143: // Life Burst (Wyrmrest Skytalon)
spellInfo->AttributesEx2 |= SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS;
break;
// This would never crit on retail and it has attribute for SPELL_ATTR3_NO_DONE_BONUS because is handled from player,
// until someone figures how to make scions not critting without hack and without making them main casters this should stay here.
case 63934: // Arcane Barrage (casted by players and NONMELEEDAMAGELOG with caster Scion of Eternity (original caster)).
spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT;
break;
// ENDOF EYE OF ETERNITY SPELLS
//
// OCULUS SPELLS
@@ -130,6 +130,7 @@ enum Spells
SPELL_ARCANE_SHOCK = 57058, // used by Nexus Lords
SPELL_HASTE = 57060, // used by Nexus Lords
SPELL_ARCANE_BARRAGE = 56397, // used by Scions of Eternity
SPELL_ARCANE_BARRAGE_DAMAGE = 63934, // the actual damage - cast by affected player by script spell
// Transition /II-III/
SPELL_SUMMOM_RED_DRAGON_BUDYY = 56070,
@@ -1478,7 +1479,7 @@ class npc_scion_of_eternity : public CreatureScript
void IsSummonedBy(Unit* /*summoner*/)
{
_events.SetPhase(PHASE_TWO);
_events.ScheduleEvent(EVENT_ARCANE_BARRAGE, urand(14, 17)*IN_MILLISECONDS, 0, PHASE_TWO);
_events.ScheduleEvent(EVENT_ARCANE_BARRAGE, urand(14, 24)*IN_MILLISECONDS, 0, PHASE_TWO);
}
void EnterCombat(Unit* /*who*/)
@@ -1503,7 +1504,7 @@ class npc_scion_of_eternity : public CreatureScript
{
case EVENT_ARCANE_BARRAGE:
DoCast(me, SPELL_ARCANE_BARRAGE);
_events.ScheduleEvent(EVENT_ARCANE_BARRAGE, urand(4, 12)*IN_MILLISECONDS, 0, PHASE_TWO);
_events.ScheduleEvent(EVENT_ARCANE_BARRAGE, urand(3, 12)*IN_MILLISECONDS, 0, PHASE_TWO);
break;
}
}
@@ -2009,10 +2010,10 @@ class spell_nexus_lord_align_disk_aggro : public SpellScriptLoader
}
};
class IsPlayerOnHoverDiskCheck
class IsPlayerOnHoverDisk
{
public:
IsPlayerOnHoverDiskCheck(Unit* source, bool isOnHoverDisk) : _source(source), _isOnHoverDisk(isOnHoverDisk) { }
IsPlayerOnHoverDisk(Unit* source, bool isOnHoverDisk) : _source(source), _isOnHoverDisk(isOnHoverDisk) { }
bool operator()(WorldObject* unit)
{
@@ -2038,6 +2039,24 @@ class IsPlayerOnHoverDiskCheck
bool _isOnHoverDisk;
};
class CheckUnitAura
{
public:
CheckUnitAura(Unit* source) : _source(source) { }
bool operator()(WorldObject* unit)
{
if (Unit* target = ObjectAccessor::GetUnit(*_source, unit->GetGUID()))
if (target->HasAura(SPELL_ARCANE_BARRAGE_DAMAGE))
return true;
return false;
}
private:
Unit* _source;
};
class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader
{
public:
@@ -2061,14 +2080,30 @@ class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader
for (std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
_playersWithoutDisk.push_back((*itr));
_playersWithoutDisk.remove_if(IsPlayerOnHoverDiskCheck(caster, false));
// Remove players not on Hover Disk from second list,
// if it's empty than we can have player on Hover disk as target.
_playersWithoutDisk.remove_if(IsPlayerOnHoverDisk(caster, false));
// Else if there are players on the ground we remove all from vehicles.
if (_playersWithoutDisk.empty())
targets.remove_if(IsPlayerOnHoverDiskCheck(caster, true));
targets.remove_if(IsPlayerOnHoverDisk(caster, true));
// Finally here we remove all targets that have been damaged by Arcane Barrage
// and have 2 seconds long aura still lasting. Used to give healers some time.
if (!targets.empty())
targets.remove_if(CheckUnitAura(caster));
}
void TriggerDamageSpellFromPlayer()
{
Player* hitTarget = GetHitPlayer();
// There is some proc in this spell I have absolutely no idea of use, but just in case...
TriggerCastFlags triggerFlags = TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_DISALLOW_PROC_EVENTS);
hitTarget->CastSpell(hitTarget, SPELL_ARCANE_BARRAGE_DAMAGE, triggerFlags, NULL, NULL, GetCaster()->GetGUID());
}
void Register()
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_scion_of_eternity_arcane_barrage_SpellScript::FilterMeleeHoverDiskPassangers, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnHit += SpellHitFn(spell_scion_of_eternity_arcane_barrage_SpellScript::TriggerDamageSpellFromPlayer);
}
std::list<WorldObject*> _playersWithoutDisk;