diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/include/sc_creature.cpp | 10 | ||||
-rw-r--r-- | src/bindings/scripts/include/sc_creature.h | 1 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp | 11 |
3 files changed, 15 insertions, 7 deletions
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 44148d4d795..03b162268d9 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -203,13 +203,21 @@ void ScriptedAI::DoStopAttack() void ScriptedAI::DoCast(Unit* victim, uint32 spellId, bool triggered) { - if (!victim || m_creature->hasUnitState(UNIT_STAT_CASTING)) + if (!victim || m_creature->hasUnitState(UNIT_STAT_CASTING) && !triggered) return; //m_creature->StopMoving(); m_creature->CastSpell(victim, spellId, triggered); } +void ScriptedAI::DoCastAOE(uint32 spellId, bool triggered) +{ + if(!triggered && m_creature->hasUnitState(UNIT_STAT_CASTING)) + return; + + m_creature->CastSpell((Unit*)NULL, spellId, triggered); +} + void ScriptedAI::DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool triggered) { if (!who || m_creature->IsNonMeleeSpellCasted(false)) diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index aadfdd3d19f..82283138d33 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -121,6 +121,7 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI //Cast spell by Id void DoCast(Unit* victim, uint32 spellId, bool triggered = false); + void DoCastAOE(uint32 spellId, bool triggered = false); //Cast spell by spell info void DoCastSpell(Unit* who,SpellEntry const *spellInfo, bool triggered = false); diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp index f5c1368812b..a08b71751b0 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp @@ -586,32 +586,31 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff) if(ArcaneBuffetTimer < diff) { - DoCast(m_creature->getVictim(), SPELL_ARCANE_BUFFET); + DoCastAOE(SPELL_ARCANE_BUFFET); ArcaneBuffetTimer = 8000; }else ArcaneBuffetTimer -= diff; if(FrostBreathTimer < diff) { - DoCast(m_creature->getVictim(), SPELL_FROST_BREATH); + DoCastAOE(SPELL_FROST_BREATH); FrostBreathTimer = 15000; }else FrostBreathTimer -= diff; if(TailLashTimer < diff) { - DoCast(m_creature->getVictim(), SPELL_TAIL_LASH); + DoCastAOE(SPELL_TAIL_LASH); TailLashTimer = 15000; }else TailLashTimer -= diff; if(WildMagicTimer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if(target && target->isAlive()) - DoCast(target, WildMagic[rand()%6]); + DoCastAOE(WildMagic[rand()%6]); WildMagicTimer = 20000; }else WildMagicTimer -= diff; if(SpectralBlastTimer < diff) { + //this is a hack. we need to find a victim without aura in core Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); if( ( target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION, 0)) ) { |