Ejemplo n.º 1
0
 void SummonedCreatureDespawn(Creature* summoned)
 {
     Summons.Despawn(summoned);
     ++KillCount;
 }
 void JustDied(Unit* /*Killer*/)
 {
     DoScriptText(SAY_DEAD, me);
     summons.DespawnAll();
 }
Ejemplo n.º 3
0
		void JustSummoned(Creature* pSummoned) {
			Summons.Summon(pSummoned);
		}
Ejemplo n.º 4
0
 void SummonedCreatureDespawn(Creature* creature)
 {
     summons.Despawn(creature);
 }
 void EnterEvadeMode()
 {
     summons.DespawnAll();
     ScriptedAI::EnterEvadeMode();
 }
Ejemplo n.º 6
0
 void JustSummoned(Creature* summon)
 {
     lSummons.push_back(summon->GetGUID());
     if (summon->AI())
         summon->AI()->AttackStart(me);
 }
 void JustSummoned(Creature* summon)
 {
     summons.Summon(summon);
 }
Ejemplo n.º 8
0
 void Reset()
 {
     summons.DespawnAll();
 }
Ejemplo n.º 9
0
 void JustSummoned(Creature* summoned) override
 {
     Summons.Summon(summoned);
     ++KillCount;
 }
Ejemplo n.º 10
0
        void UpdateAI(const uint32 uiDiff)
        {
            if (!UpdateVictim())
                return;

            switch (m_uiStage)
            {
                case 0:
                    if (m_uiFreezeSlashTimer <= uiDiff)
                    {
                        DoCastVictim(SPELL_FREEZE_SLASH);
                        m_uiFreezeSlashTimer = 15*IN_MILLISECONDS;
                    } else m_uiFreezeSlashTimer -= uiDiff;

                    if (m_uiPenetratingColdTimer <= uiDiff)
                    {
                        me->CastCustomSpell(SPELL_PENETRATING_COLD, SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5));
                        m_uiPenetratingColdTimer = 20*IN_MILLISECONDS;
                    } else m_uiPenetratingColdTimer -= uiDiff;

                    if (m_uiSummonNerubianTimer <= uiDiff && (IsHeroic() || !m_bReachedPhase3))
                    {
                        me->CastCustomSpell(SPELL_SUMMON_BURROWER, SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 2, 2, 4));
                        m_uiSummonNerubianTimer = 45*IN_MILLISECONDS;
                    } else m_uiSummonNerubianTimer -= uiDiff;

                    if (IsHeroic() && m_uiNerubianShadowStrikeTimer <= uiDiff)
                    {
                        Summons.DoAction(NPC_BURROWER, ACTION_SHADOW_STRIKE);
                        m_uiNerubianShadowStrikeTimer = 30*IN_MILLISECONDS;
                    } else m_uiNerubianShadowStrikeTimer -= uiDiff;

                    if (m_uiSubmergeTimer <= uiDiff && !m_bReachedPhase3 && !me->HasAura(SPELL_BERSERK))
                    {
                        m_uiStage = 1;
                        m_uiSubmergeTimer = 60*IN_MILLISECONDS;
                    } else m_uiSubmergeTimer -= uiDiff;
                    break;
                case 1:
                    DoCast(me, SPELL_SUBMERGE_ANUBARAK);
                    DoCast(me, SPELL_CLEAR_ALL_DEBUFFS);
                    me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                    DoScriptText(SAY_BURROWER, me);
                    m_uiScarabSummoned = 0;
                    m_uiSummonScarabTimer = 4*IN_MILLISECONDS;
                    m_uiStage = 2;
                    break;
                case 2:
                    if (m_uiPursuingSpikeTimer <= uiDiff)
                    {
                        DoCast(SPELL_SPIKE_CALL);
                        // Just to make sure it won't happen again in this phase
                        m_uiPursuingSpikeTimer = 90*IN_MILLISECONDS;
                    } else m_uiPursuingSpikeTimer -= uiDiff;

                    if (m_uiSummonScarabTimer <= uiDiff)
                    {
                        /* WORKAROUND
                         * - The correct implementation is more likely the comment below but it needs spell knowledge
                         */
                        std::list<uint64>::iterator i = m_vBurrowGUID.begin();
                        uint32 at = urand(0, m_vBurrowGUID.size()-1);
                        for (uint32 k = 0; k < at; k++)
                            ++i;
                        if (Creature *pBurrow = Unit::GetCreature(*me, *i))
                            pBurrow->CastSpell(pBurrow, 66340, false);
                        m_uiScarabSummoned++;
                        m_uiSummonScarabTimer = 4*IN_MILLISECONDS;
                        if (m_uiScarabSummoned == 4) m_uiSummonScarabTimer = RAID_MODE(4, 20)*IN_MILLISECONDS;

                        /*It seems that this spell have something more that needs to be taken into account
                        //Need more sniff info
                        DoCast(SPELL_SUMMON_BEATLES);
                        // Just to make sure it won't happen again in this phase
                        m_uiSummonScarabTimer = 90*IN_MILLISECONDS;*/
                    } else m_uiSummonScarabTimer -= uiDiff;

                    if (m_uiSubmergeTimer <= uiDiff)
                    {
                        m_uiStage = 3;
                        m_uiSubmergeTimer = 80*IN_MILLISECONDS;
                    } else m_uiSubmergeTimer -= uiDiff;
                    break;
                case 3:
                    m_uiStage = 0;
                    DoCast(SPELL_SPIKE_TELE);
                    Summons.DespawnEntry(NPC_SPIKE);
                    me->RemoveAurasDueToSpell(SPELL_SUBMERGE_ANUBARAK);
                    me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
                    DoCast(me, SPELL_EMERGE_ANUBARAK);
                    me->GetMotionMaster()->MoveChase(me->getVictim());
                    m_uiSummonNerubianTimer = 10*IN_MILLISECONDS;
                    m_uiNerubianShadowStrikeTimer = 30*IN_MILLISECONDS;
                    m_uiSummonScarabTimer = 2*IN_MILLISECONDS;
                    break;
            }

            if (!IsHeroic())
            {
                if (m_uiSummonFrostSphereTimer <= uiDiff)
                {
                    uint8 startAt = urand(0, 5);
                    uint8 i = startAt;
                    do
                    {
                        if (Unit *pSphere = Unit::GetCreature(*me, m_aSphereGUID[i]))
                        {
                            if (!pSphere->HasAura(SPELL_FROST_SPHERE))
                            {
                                if (Creature *pSummon = me->SummonCreature(NPC_FROST_SPHERE, SphereSpawn[i]))
                                    m_aSphereGUID[i] = pSummon->GetGUID();
                                break;
                            }
                        }
                        i = (i+1)%6;
                    } while (i != startAt);
                    m_uiSummonFrostSphereTimer = urand(20, 30)*IN_MILLISECONDS;
                } else m_uiSummonFrostSphereTimer -= uiDiff;
            }

            if (HealthBelowPct(30) && m_uiStage == 0 && !m_bReachedPhase3)
            {
                m_bReachedPhase3 = true;
                DoCastAOE(SPELL_LEECHING_SWARM);
                DoScriptText(EMOTE_LEECHING_SWARM, me);
                DoScriptText(SAY_LEECHING_SWARM, me);
            }

            if (m_uiBerserkTimer <= uiDiff && !me->HasAura(SPELL_BERSERK))
            {
                DoCast(me, SPELL_BERSERK);
            } else m_uiBerserkTimer -= uiDiff;

            DoMeleeAttackIfReady();
        }
 void JustDied(Unit* killer)
 {
     summons.DespawnAll();
 }
Ejemplo n.º 12
0
        void UpdateAI(const uint32 uiDiff)
        {
            if (!UpdateVictim())
                return;

            if (!bIsFrenzy && HealthBelowPct(25) && !bIsExploded)
            {
                Talk(SAY_ENRAGE);
                DoCast(me, SPELL_FRENZY, true);
                bIsFrenzy = true;
            }

            if (!bIsFrenzy)
            {
                if (uiBubbleCheckerTimer <= uiDiff)
                {
                    if (!bIsExploded)
                    {
                        if (!me->HasAura(SPELL_PROTECTIVE_BUBBLE, 0))
                        {
                            Talk(SAY_SHATTER);
                            DoCast(me, SPELL_WATER_BLAST);
                            DoCast(me, SPELL_DRAINED);
                            bIsExploded = true;
                            me->AttackStop();
                            me->SetVisible(false);
                            for (uint8 i = 0; i < 10; i++)
                            {
                                int tmp = urand(0, MAX_SPAWN_LOC-1);
                                me->SummonCreature(NPC_ICHOR_GLOBULE, SpawnLoc[tmp], TEMPSUMMON_CORPSE_DESPAWN);
                            }
                        }
                    }
                    else
                    {
                        bool bIsWaterElementsAlive = false;
                        if (!m_waterElements.empty())
                        {
                            for (std::list<uint64>::const_iterator itr = m_waterElements.begin(); itr != m_waterElements.end(); ++itr)
                                if (Creature* temp = Unit::GetCreature(*me, *itr))
                                    if (temp->isAlive())
                                    {
                                        bIsWaterElementsAlive = true;
                                        break;
                                    }
                        }

                        if (!bIsWaterElementsAlive)
                            DoExplodeCompleted();
                    }
                    uiBubbleCheckerTimer = 1000;
                }
                else uiBubbleCheckerTimer -= uiDiff;
            }

            if (!bIsExploded)
            {
                if (uiWaterBoltVolleyTimer <= uiDiff)
                {
                    DoCast(me, SPELL_WATER_BOLT_VOLLEY);
                    uiWaterBoltVolleyTimer = urand(10000, 15000);
                }
                else uiWaterBoltVolleyTimer -= uiDiff;

                DoMeleeAttackIfReady();
            }
        }
Ejemplo n.º 13
0
 void DespawnWaterElements()
 {
     m_waterElements.DespawnAll();
 }
Ejemplo n.º 14
0
 void JustSummoned(Creature* summon) override
 {
     summons.Summon(summon);
     summon->AI()->AttackStart(me->GetVictim());
 }
Ejemplo n.º 15
0
 void Reset()
 {
     events.Reset();
     summons.DespawnAll();
 }
Ejemplo n.º 16
0
 void SummonedCreatureDespawn(Creature* summoned) override
 {
     Summons.Despawn(summoned);
     --KillCount;
 }
Ejemplo n.º 17
0
 void Reset()
 {
     summons.DespawnAll();
     events.Reset();
     stage = 0;
 }
Ejemplo n.º 18
0
 void Reset()
 {
     events.Reset();
     summons.DespawnAll();
     lTarget = 0;
 }
Ejemplo n.º 19
0
 void JustSummoned(Creature* summoned)
 {
     summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
     lSummons.Summon(summoned);
 }
Ejemplo n.º 20
0
 void SummonedCreatureDies(Creature* summon, Unit*)
 {
     summons.Despawn(summon);
     for (uint8 i = 0; i < 3; ++i)
         me->CastSpell(me, SPELL_SUMMON_SPORE_STRIDER, false);
 }
Ejemplo n.º 21
0
 void JustSummoned(Creature* creature)
 {
     summons.Summon(creature);
 }
 void SummonedCreatureDespawn(Creature* summon) override
 {
     Summons.Despawn(summon);
 }
Ejemplo n.º 23
0
    void OozesMeetCheck()
    {
        if (summons.empty() || summons.size()==1)
            return;

        for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
        {
            Creature* ooze = ObjectAccessor::GetCreatureOrPetOrVehicle((*me), (*itr));
            if (!ooze || !ooze->isAlive())
                continue;
            if (ooze->GetEntry() != CREATURE_LITTLE_OOZE && ooze->GetEntry() != CREATURE_OOZE_BIG)
                continue;

            bool little = (ooze->GetEntry() == CREATURE_LITTLE_OOZE);

            for(SummonList::const_iterator itr2 = summons.begin(); itr2 != summons.end(); ++itr2)
            {
                Creature* ooze2 = ObjectAccessor::GetCreatureOrPetOrVehicle((*me), (*itr2));
                if (!ooze2 || !ooze2->isAlive())
                    continue;
                if (ooze2->GetEntry() != CREATURE_LITTLE_OOZE && ooze2->GetEntry() != CREATURE_OOZE_BIG)
                    continue;
                if (ooze2 == ooze)
                    continue;

                if (ooze->GetDistance2d(ooze2) > 5.0f)
                    continue;

                bool little2 = (ooze2->GetEntry() == CREATURE_LITTLE_OOZE);

                //if first ooze is big ooze
                if (!little)
                {
                    //and if second ooze is little
                    if (little2)
                    {
                        ooze->CastSpell(ooze, SPELL_UNSTABLE_OOZE, false);

                        if (ooze->GetAura(SPELL_UNSTABLE_OOZE) && ooze->GetAura(SPELL_UNSTABLE_OOZE)->GetStackAmount() >= 5)
                            ooze->CastSpell(ooze2->getVictim(), SPELL_UNSTABLE_EXPLOSION, true);

                        continue;
                    }
                    else //big ooze meet another big ooze, check wich one have more buff stack and despawn second one
                    {
                        uint8 stack1, stack2 = 0;
                        if (Aura* aura = ooze->GetAura(SPELL_UNSTABLE_OOZE))
                            stack1 = aura->GetStackAmount();
                        if (Aura* aura = ooze2->GetAura(SPELL_UNSTABLE_OOZE))
                            stack2 = aura->GetStackAmount();

                        if (stack1 < stack2)
                        {
                            ooze2->CastSpell(ooze, SPELL_UNSTABLE_OOZE, false);

                            if (ooze2->GetAura(SPELL_UNSTABLE_OOZE) && ooze2->GetAura(SPELL_UNSTABLE_OOZE)->GetStackAmount() >= 5)
                                ooze2->CastSpell(ooze2->getVictim(), SPELL_UNSTABLE_EXPLOSION, true);

                            break;
                        }
                        else
                        {
                            ooze->CastSpell(ooze, SPELL_UNSTABLE_OOZE, false);

                            if (ooze->GetAura(SPELL_UNSTABLE_OOZE) && ooze->GetAura(SPELL_UNSTABLE_OOZE)->GetStackAmount() >= 5)
                                ooze->CastSpell(ooze2->getVictim(), SPELL_UNSTABLE_EXPLOSION, true);
                            continue;
                        }
                    }
                }
                else  //if first ooze is little
                {
                    if (little2) //and second ooze is little, despawn both and summon big ooze
                    {
                        DoSummon(CREATURE_OOZE_BIG, (*ooze));
                        break;
                    }
                    else
                    {
                        ooze2->CastSpell(ooze, SPELL_UNSTABLE_OOZE, false);

                        if (ooze2->GetAura(SPELL_UNSTABLE_OOZE) && ooze2->GetAura(SPELL_UNSTABLE_OOZE)->GetStackAmount() >= 5)
                            ooze2->CastSpell(ooze2->getVictim(), SPELL_UNSTABLE_EXPLOSION, true);
                        break;
                    }
                }
            }
        }
    }
Ejemplo n.º 24
0
 void JustSummoned(Creature* summon)
 {
     summons.Summon(summon);
     DoZoneInCombat(summon);
 }
 void SummonedCreatureDespawn(Creature *summon)
 {
     summons.Despawn(summon);
 }
Ejemplo n.º 26
0
 void DespawnAllImp()
 {
     summons.DespawnAll();
 }
Ejemplo n.º 27
0
		void JustDied(Unit* /*pKiller*/) {
			Summons.DespawnAll();
			DoScriptText(SAY_DEATH, me);
			if (m_pInstance)
				m_pInstance->SetData(TYPE_JARAXXUS, DONE);
		}
Ejemplo n.º 28
0
 void JustDied(Unit* who)
 {
     summons.DespawnAll();
 }
Ejemplo n.º 29
0
		void JustSummoned(Creature* pSummoned) {
			Summons.Summon(pSummoned);
			pSummoned->SetCorpseDelay(0);
		}
Ejemplo n.º 30
0
 void JustSummoned(Creature* summoned)
 {
     summoned->AI()->AttackStart(me);
     Summons.Summon(summoned);
 }