void AfterRemove(AuraEffect const* eff, AuraEffectHandleModes /*mode*/)
            {
                if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
                    return;

                GetTarget()->CastSpell(nullptr, SPELL_DEATHBLOOM_FINAL_DAMAGE, CastSpellExtraArgs(eff).SetOriginalCaster(GetCasterGUID()));
            }
    void OnProcSpell(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
    {
        PreventDefaultAction();
        DamageInfo* damageInfo = eventInfo.GetDamageInfo();
        if (!damageInfo || !damageInfo->GetDamage())
            return;

        Unit* caster = eventInfo.GetActor();
        caster->CastSpell(caster, SPELL_AURA_OF_DESIRE_DAMAGE, CastSpellExtraArgs(aurEff).AddSpellBP0(damageInfo->GetDamage() / 2));
    }
Ejemplo n.º 3
0
            void JustSummoned(Creature* summoned) override
            {
                summoned->SetFaction(FACTION_MONSTER_2);
                summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);

                //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid?
                summoned->CastSpell(summoned, SPELL_TEMPORARY_VISUAL, true);
                summoned->CastSpell(summoned, SPELL_CONSUMPTION, CastSpellExtraArgs().SetOriginalCaster(me->GetGUID()));
            }
    void HandleDummy(AuraEffect const* /*aurEff*/)
    {
        if (AuraEffect* slowEff = GetEffect(EFFECT_0))
        {
            int32 newAmount = slowEff->GetAmount() - 10;
            if (newAmount < -100)
                newAmount = -100;
            slowEff->ChangeAmount(newAmount);

            if (newAmount == -100 && !GetTarget()->HasAura(SPELL_PARALYSIS))
                GetTarget()->CastSpell(GetTarget(), SPELL_PARALYSIS, CastSpellExtraArgs(slowEff).SetOriginalCaster(GetCasterGUID()));
        }
    }
Ejemplo n.º 5
0
        void JustSummoned(Creature* summoned) override
        {
            if (summoned->GetEntry() == NPC_MOLTEN_GOLEM)
            {
                m_lGolemGUIDList.push_back(summoned->GetGUID());

                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                    summoned->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f);

                // Why healing when just summoned?
                summoned->CastSpell(summoned, SPELL_HEAT, CastSpellExtraArgs().SetOriginalCaster(me->GetGUID()));
            }
        }
Ejemplo n.º 6
0
    void UpdateAI(uint32 diff) override
    {
        if (!UpdateVictim())
            return;

        events.Update(diff);

        if (me->HasUnitState(UNIT_STATE_CASTING))
            return;

        while (uint32 eventId = events.ExecuteEvent())
        {
            switch (eventId)
            {
                case EVENT_FROZEN_ORB:
                {
                    me->CastSpell(me, SPELL_FROZEN_ORB, CastSpellExtraArgs().AddSpellMod(SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 3)));
                    events.Repeat(Seconds(32));
                    break;
                }
                case EVENT_WHITEOUT:
                    DoCastSelf(SPELL_WHITEOUT);
                    events.Repeat(Seconds(38));
                    break;
                case EVENT_FREEZING_GROUND:
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
                        DoCast(target, SPELL_FREEZING_GROUND);
                    events.Repeat(Seconds(38));
                    break;
                default:
                    break;
            }

            if (me->HasUnitState(UNIT_STATE_CASTING))
                return;
        }

        DoMeleeAttackIfReady();
    }
        void DoAction(int32 actionId) override
        {
            switch (actionId)
            {
                case ACTION_NEXT_PHASE:
                {
                    Creature* orb = ObjectAccessor::GetCreature(*me, _orb);
                    if (!orb)
                        return;

                    _encountersCount++;
                    if (_encountersCount == _dungeonMode)
                        orb->CastSpell(orb, SPELL_AWAKEN_GORTOK, true);
                    else
                        orb->CastSpell(orb, SPELL_AWAKEN_SUBBOSS, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_MAX_TARGETS, 1));
                    break;
                }
                case ACTION_START_FIGHT:
                    me->RemoveAurasDueToSpell(SPELL_FREEZE);
                    me->SetImmuneToPC(false);
                    DoZoneInCombat();
                    if (Creature* orb = ObjectAccessor::GetCreature(*me, _orb))
                        orb->DespawnOrUnsummon(1000);
                    break;
                case ACTION_START_ENCOUNTER:
                    if (Creature* orb = ObjectAccessor::GetCreature(*me, _orb))
                    {
                        orb->CastSpell(orb, SPELL_ORB_VISUAL, true);
                        orb->m_Events.AddEvent(new OrbAirPositionEvent(orb), orb->m_Events.CalculateTime(3000));
                        orb->m_Events.AddEvent(new OrbFlyEvent(orb), orb->m_Events.CalculateTime(6000));
                    }
                    break;
                default:
                    break;
            }
        }