Beispiel #1
0
            // summoning function for second phase
            void SummonWaveP2()
            {
                if (Is25ManRaid())
                {
                    uint8 addIndex = _waveCounter & 1;
                    Summon(SummonEntries[addIndex], SummonPositions[addIndex * 3]);
                    Summon(SummonEntries[addIndex ^ 1], SummonPositions[addIndex * 3 + 1]);
                    Summon(SummonEntries[addIndex], SummonPositions[addIndex * 3+ 2]);
                }
                else
                    Summon(SummonEntries[urand(0, 1)], SummonPositions[6]);

                ++_waveCounter;
            }
        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim())
                return;

            if (uiSummonTimer <= diff)
            {
                Summon();
                uiSummonTimer = 15*IN_MILLISECONDS;
            } else uiSummonTimer -= diff;

            if (uiMindFlayTimer <= diff)
            {
                    DoCast(me->getVictim(), SPELL_MIND_FLAY);
                    uiMindFlayTimer = 15*IN_MILLISECONDS;
                } else uiMindFlayTimer -= diff;

            if (uiCurseFatigueTimer <= diff)
            {
                //WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically."
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    DoCast(target, SPELL_CURSE_OF_FATIGUE);
                if (Unit* tankTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
                    DoCast(tankTarget, SPELL_CURSE_OF_FATIGUE);

                uiCurseFatigueTimer = 10*IN_MILLISECONDS;
            } else uiCurseFatigueTimer -= diff;

            if (!me->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
                DoCast(me, SPELL_FRENZY, true);

            DoMeleeAttackIfReady();
        }
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (SummonTimer <= diff)
        {
            Summon();
            SummonTimer = 15000;
        } else SummonTimer -= diff;

        if (MindFlayTimer <= diff)
        {
                DoCast(m_creature->getVictim(), HEROIC(SPELL_MIND_FLAY, H_SPELL_MIND_FLAY));
                MindFlayTimer = 15000;
            } else MindFlayTimer -= diff;

        if (CurseFatigueTimer <= diff)
        {
            //WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically. "
            Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
            Unit *pTarget_1 = SelectUnit(SELECT_TARGET_RANDOM, 1);

            DoCast(pTarget, HEROIC(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE));
            DoCast(pTarget_1, HEROIC(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE));

            CurseFatigueTimer = 10000;
        } else CurseFatigueTimer -= diff;

        if (!m_creature->HasAura(SPELL_FRENZY) && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10)
            m_creature->CastSpell(m_creature,SPELL_FRENZY,true);

        DoMeleeAttackIfReady();
    }
        void EnterCombat(Unit* /*who*/)
        {
            DoScriptText(SAY_AGGRO, me);
            Summon();
            uiSummonTimer = 15*IN_MILLISECONDS;

            if (pInstance)
                pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
        }
        void EnterCombat(Unit* /*who*/)
        {
            Talk(SAY_AGGRO);
            Summon();
            uiSummonTimer = 15*IN_MILLISECONDS;

            if (instance)
                instance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
        }
 void UpdateAI(uint32 const diff)
 {
     if (SummonTimer <= diff)
     {
         uint8 summon = urand(0,1);
         Summon(summon);
         SummonTimer = 15000;
     } else SummonTimer -= diff;
 }
    void EnterCombat(Unit* who)
    {
        DoScriptText(SAY_AGGRO, m_creature);
        Summon();
        SummonTimer = 15000;

        if (pInstance)
            pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
    }
            void EnterCombat(Unit* /*who*/) override
            {
                Talk(SAY_AGGRO);
                _EnterCombat();
                Summon();

                events.ScheduleEvent(EVENT_SUMMON, 15000);
                events.ScheduleEvent(EVENT_MIND_FLAY, 15000);
                events.ScheduleEvent(EVENT_CURSE_FATIGUE, 12000);
            }
    void AIUpdate()
    {
		if((GetHealthPercent() <= 76 && summon == 0) 
		|| (GetHealthPercent() <= 51 && summon == 2) 
		|| (GetHealthPercent() <= 25 && summon == 4))
			summon += 1;
		
		if(summon == 1 || summon == 3 || summon == 5) 
			Summon();

		if( mRift == true && ( pChaoticRift == NULL || !pChaoticRift->isAlive() ))
		{
			RemoveAura(47748);
			mRift = false;
		};

		ParentClass::AIUpdate();
    };
Beispiel #10
0
    void UpdateAI(const uint32 uiDiff) override
    {
        if(!m_pInstance) return;

        if (m_pInstance->GetData(TYPE_EVENT) == 6)
        {
            m_pInstance->SetData(TYPE_EVENT, 7);
            Summon();
        }

        if(m_pInstance->GetData(TYPE_MARWYN) == SPECIAL)
        {
            if(m_uiSummonTimer < uiDiff)
            {
                ++SummonCount;
                m_pInstance->SetData(DATA_WAVE_COUNT,SummonCount+5);
                if(SummonCount == 1)
                    DoScriptText(SAY_MARWYN_INTRO, m_creature);

                if(SummonCount > 4)
                {
                    m_pInstance->SetData(TYPE_MARWYN, IN_PROGRESS);
                    m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                    m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                    m_creature->SetInCombatWithZone();
                }
                else CallFallSoldier();
                m_uiSummonTimer = 60000;
            } else m_uiSummonTimer -= uiDiff;
        }

        if(!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        timedCast(SPELL_OBLITERATE, uiDiff);
        timedCast(SPELL_WELL_OF_CORRUPTION, uiDiff);
        timedCast(SPELL_SHARED_SUFFERING, uiDiff);
        timedCast(SPELL_CORRUPTED_FLESH, uiDiff);

        timedCast(SPELL_BERSERK, uiDiff);

        DoMeleeAttackIfReady();
    }
Beispiel #11
0
    void WaypointReached(uint32 uiPoint)
    {
        //just in case
        if (GetPlayerForEscort())
            if (me->GetFaction() != GetPlayerForEscort()->GetFaction())
                me->SetFaction(GetPlayerForEscort()->GetFaction());

        switch (uiPoint)
        {
        case 3:
            SetEscortPaused(true);
            NextStep(2000, false, 3);
            break;
        case 7:
            SetEscortPaused(true);
            NextStep(2000, false, 4);
            break;
        case 9:
            NextStep(1000, false, 8);
            break;
        case 10:
            NextStep(25000, false, 10);
            break;
        case 11:
            SetEscortPaused(true);
            SetInFace(true);
            NextStep(1000, false, 11);
            break;
        case 12:
            NextStep(25000, false, 18);
            break;
        case 13:
            Summon(7);
            NextStep(25000, false, 19);
            break;
        case 14:
            SetInFace(false);
            DoScriptText(SAY_BLASTMASTER_26, me);
            SetEscortPaused(true);
            NextStep(5000, false, 20);
            break;
        }
    }
Beispiel #12
0
        void WaypointReached(uint32 waypointId) override
        {
            //just in case
            if (GetPlayerForEscort())
                if (me->getFaction() != GetPlayerForEscort()->getFaction())
                    me->setFaction(GetPlayerForEscort()->getFaction());

            switch (waypointId)
            {
                case 3:
                    SetEscortPaused(true);
                    NextStep(2000, false, 3);
                    break;
                case 7:
                    SetEscortPaused(true);
                    NextStep(2000, false, 4);
                    break;
                case 9:
                    NextStep(1000, false, 8);
                    break;
                case 10:
                    NextStep(25000, false, 10);
                    break;
                case 11:
                    SetEscortPaused(true);
                    SetInFace(true);
                    NextStep(1000, false, 11);
                    break;
                case 12:
                    NextStep(25000, false, 18);
                    break;
                case 13:
                    Summon(6);
                    NextStep(25000, false, 19);
                    break;
                case 14:
                    SetInFace(false);
                    Talk(SAY_BLASTMASTER_17);
                    SetEscortPaused(true);
                    NextStep(5000, false, 20);
                    break;
            }
        }
            void SummonWaveP1()
            {
                uint8 addIndex = _waveCounter & 1;
                uint8 addIndexOther = uint8(addIndex ^ 1);

                if (_waveCounter || !sPoolMgr->IsSpawnedObject<Quest>(QUEST_DEPROGRAMMING))
                    Summon(SummonEntries[addIndex], SummonPositions[addIndex * 3]);
                else
                    Summon(NPC_DARNAVAN, SummonPositions[addIndex * 3]);

                Summon(SummonEntries[addIndexOther], SummonPositions[addIndex * 3 + 1]);
                Summon(SummonEntries[addIndex], SummonPositions[addIndex * 3 + 2]);
                if (Is25ManRaid())
                {
                    Summon(SummonEntries[addIndexOther], SummonPositions[addIndexOther * 3]);
                    Summon(SummonEntries[addIndex], SummonPositions[addIndexOther * 3 + 1]);
                    Summon(SummonEntries[addIndexOther], SummonPositions[addIndexOther * 3 + 2]);
                    Summon(SummonEntries[urand(0, 1)], SummonPositions[6]);
                }

                ++_waveCounter;
            }
Beispiel #14
0
    void UpdateAI(const uint32 uiDiff) override
    {
        if (!m_pInstance)
            return;

        if (m_pInstance->GetData(TYPE_EVENT) == 5)
        {
            m_pInstance->SetData(TYPE_EVENT, 6);
            Summon();
        }

        if (m_pInstance->GetData(TYPE_FALRIC) == SPECIAL)
        {

            if (m_uiSummonTimer < uiDiff)
            {
                    ++SummonCount;
                    m_pInstance->SetData(DATA_WAVE_COUNT,SummonCount);
                    if(SummonCount > 4)
                    {
                        m_pInstance->SetData(TYPE_FALRIC, IN_PROGRESS);
                        m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                        m_creature->SetInCombatWithZone();
                    }
                    else CallFallSoldier();
                    m_uiSummonTimer = 60000;
            } else m_uiSummonTimer -= uiDiff;
        }

        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        timedCast(SPELL_QUIVERING_STRIKE, uiDiff);
        timedCast(SPELL_IMPENDING_DESPAIR, uiDiff);
        timedCast(SPELL_DEFILING_HORROR, uiDiff);

        timedCast(SPELL_BERSERK, uiDiff);

        DoMeleeAttackIfReady();

    }
Beispiel #15
0
void Cmd_Summon_f(edict_t *ent)
{
	char * name = gi.args();
	edict_t * target;
	int i;

	for (i = 1; i < (int)(maxclients->value)+1; i++)
	{
		target = &g_edicts[i];

		if (!target->inuse || !target->client || IsSpectator(target))
			continue;
		if (target == ent)
			continue;
		// if a specific name requested & doesn't match, skip
		if (name[0] && Q_stricmp(name, target->client->pers.netname))
			continue;

		Summon(ent, target);
		return;
	}
}
            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_SUMMON:
                            Summon();
                            events.ScheduleEvent(EVENT_SUMMON, 15000);
                            break;
                        case EVENT_MIND_FLAY:
                            DoCastVictim(SPELL_MIND_FLAY);
                            events.ScheduleEvent(EVENT_MIND_FLAY, 15000);
                            break;
                        case EVENT_CURSE_FATIGUE:
                            if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                                DoCast(target, SPELL_CURSE_OF_FATIGUE);
                            events.ScheduleEvent(EVENT_CURSE_FATIGUE, 10000);
                            break;
                        default:
                            break;
                    }
                }

                if (!me->HasAura(SPELL_FRENZY) && HealthBelowPct(10))
                    DoCast(me, SPELL_FRENZY, true);

                DoMeleeAttackIfReady();
            }
        void HandlerDummy()
        {
            Summon(GetCaster());

        }
Beispiel #18
0
    void UpdateAI(const uint32 uiDiff)
    {
        if(m_pInstance && m_pInstance->GetData(TYPE_INTRO) == DONE && m_pInstance->GetData(TYPE_FALRIC) == SPECIAL)
        {
            if(m_uiExploitCheckTimer < uiDiff)
            {
                if(!IsPlayerInside())
                    EnterEvadeMode();
                m_uiExploitCheckTimer = 1000;
            }
            else m_uiExploitCheckTimer -= uiDiff;

			if(!m_bIsCall) 
            {
               m_bIsCall = true;
               Summon();
            }

			if(m_uiDeadSoldiers == m_uiCalledSoldiers && !m_bDelaySet && m_uiSummonCount < 5)
			{
				m_uiSummon_Timer = 10000;
				m_bDelaySet = true;
			}

            if (m_uiSummon_Timer < uiDiff) 
            {
                if(!m_bHasIntro)
                {
                    if(m_pInstance)
                        m_pInstance->DoUpdateWorldState(UI_STATE_SPIRIT_WAVES, 1);
                    DoScriptText(SAY_INTRO1, m_creature);
                    m_bHasIntro = true;
                    m_creature->SetInCombatWithZone();
                }

                m_uiSummonCount += 1;
                if (m_uiSummonCount > 4)
                {
                    m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                    m_creature->SetInCombatWithZone();
                    if(m_pInstance) 
					{
                        m_pInstance->SetData(TYPE_FALRIC, IN_PROGRESS);
						m_pInstance->DoUpdateWorldState(UI_STATE_SPIRIT_WAVES_COUNT, m_uiSummonCount);
					}
                }
                else 
                {
                    if(m_pInstance)
                        m_pInstance->DoUpdateWorldState(UI_STATE_SPIRIT_WAVES_COUNT, m_uiSummonCount);
					// change the no. of mobs per wave
					switch(m_uiSummonCount)
					{
					case 1:
						m_uiMaxMobs = 5;	// maybe just 3?
						break;
					case 2:
					case 3:
						m_uiMaxMobs = 4;
						break;
					case 4:
						m_uiMaxMobs = 5;
						break;
					}
					CallFallSoldier();
                }
				m_bDelaySet = false;
                m_uiSummon_Timer = 90000;
            } 
            else 
                m_uiSummon_Timer -= uiDiff;
        }

        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
        {
            if(m_pInstance && m_pInstance->GetData(TYPE_FALRIC) == IN_PROGRESS)
                EnterEvadeMode();
            return;
        }

        if (m_uiDespair_Timer < uiDiff) 
        {
            DoScriptText(SAY_IMPENDING_DESPAIR, m_creature);
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                DoCast(pTarget, SPELL_IMPENDING_DESPAIR);
            m_uiDespair_Timer= m_bIsRegularMode ? 40000 : 30000;
        } 
        else 
            m_uiDespair_Timer -= uiDiff;

        if (m_uiStrike_Timer < uiDiff)
        {
            DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_QUIVERING_STRIKE : SPELL_QUIVERING_STRIKE_H);
            m_uiStrike_Timer=urand(10000,15000);
        } 
        else 
            m_uiStrike_Timer -= uiDiff;

        if (m_uiHorror_Timer < uiDiff) 
        {
            DoScriptText(SAY_DEFILING_HORROR, m_creature);
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                DoCast(pTarget, m_bIsRegularMode ? SPELL_DEFILING_HORROR : SPELL_DEFILING_HORROR_H);
            m_uiHorror_Timer=urand(25000,35000);
        } 
        else 
            m_uiHorror_Timer -= uiDiff;

        if(m_creature->GetHealthPercent() <= 66.0f && !m_bIsPhase1)
        {
            DoCast(m_creature, SPELL_HOPELESSNESS);
            m_bIsPhase1 = true;
        }

        if(m_creature->GetHealthPercent() <= 33.0f && !m_bIsPhase2)
        {
            DoCast(m_creature, SPELL_HOPELESSNESS);
            m_bIsPhase2 = true;
        }

        if(m_creature->GetHealthPercent() <= 10.0f && !m_bIsPhase3)
        {
            DoCast(m_creature, SPELL_HOPELESSNESS);
            m_bIsPhase3 = true;
        }

        if (m_uiBerserk_Timer < uiDiff)
        {
            DoCast(m_creature, SPELL_BERSERK);
            m_uiBerserk_Timer = 180000;
        } 
        else  
            m_uiBerserk_Timer -= uiDiff;

        DoMeleeAttackIfReady();
    }
Beispiel #19
0
        void UpdateAI(const uint32 uiDiff)
        {
            if(!m_pInstance) return;

            if (m_pInstance->GetData(TYPE_FALRIC) == SPECIAL) 
            {
                if(!m_bIsCall) 
                {
                   m_bIsCall = true;
                   Summon();
                }

                if (m_uiSummonTimer < uiDiff) 
                {
                        ++SummonCount;
                        if(SummonCount > 4) 
                        {
                            m_pInstance->SetData(TYPE_FALRIC, IN_PROGRESS);
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                            me->SetInCombatWithZone();
                        }
                        else CallFallSoldier();
                        m_uiSummonTimer = 60000;
                } else m_uiSummonTimer -= uiDiff;
            }

            if (!UpdateVictim())
                return;

            if(m_uiStrikeTimer < uiDiff)
            {
                DoCast(me->getVictim(), Regular ? SPELL_QUIVERING_STRIKE_N : SPELL_QUIVERING_STRIKE_H);
                m_uiStrikeTimer = (urand(7000, 14000));
            }
            else m_uiStrikeTimer -= uiDiff;

            if(m_uiHorrorTimer < uiDiff)
            {
                DoScriptText(SAY_FALRIC_SP01, me);
                if(Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM))
                   DoCast(pTarget, SPELL_IMPENDING_DESPAIR);
                m_uiHorrorTimer = (urand(15000, 25000));
            }
            else m_uiHorrorTimer -= uiDiff;

            if(m_uiGrowlTimer < uiDiff)
            {
                DoScriptText(SAY_FALRIC_SP02, me);
                DoCast(me->getVictim(), Regular ? SPELL_DEFILING_HORROR_N : SPELL_DEFILING_HORROR_H);
                m_uiGrowlTimer = (urand(25000, 30000));
            }
            else m_uiGrowlTimer -= uiDiff;

            if (m_uiBerserkTimer < uiDiff)
            {
                DoCast(me, SPELL_BERSERK);
                m_uiBerserkTimer = 180000;
            } else  m_uiBerserkTimer -= uiDiff;

            if ((uiHopelessnessCount < 1 && HealthBelowPct(66))
                || (uiHopelessnessCount < 2 && HealthBelowPct(33))
                || (uiHopelessnessCount < 3 && HealthBelowPct(10)))
            {
                uiHopelessnessCount++;
                DoCast(DUNGEON_MODE(SPELL_HOPELESSNESS,H_SPELL_HOPELESSNESS));
            }

            DoMeleeAttackIfReady();  

            return;
        }
Beispiel #20
0
       void UpdateAI(const uint32 uiDiff)
        {
            if(!m_pInstance) return;

            if (m_pInstance->GetData(DATA_FALRIC_EVENT) == SPECIAL)
            {
                if(!m_bIsCall)
                {
                   m_bIsCall = true;
                   Summon();
                }
            }

            if(m_pInstance->GetData(DATA_MARWYN_EVENT) == SPECIAL)
            {
               if(m_uiSummonTimer < uiDiff)
               {
                       ++SummonCount;
                       if(SummonCount == 1)
                          DoScriptText(SAY_MARWYN_INTRO, me);

                       if(SummonCount > 4)
                       {
                            m_pInstance->SetData(DATA_MARWYN_EVENT, IN_PROGRESS);
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                            me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                            me->SetInCombatWithZone();
                       }
                       else CallFallSoldier();
                       m_uiSummonTimer = 60000;
               } else m_uiSummonTimer -= uiDiff;
            }

            if(!UpdateVictim())
                return;

            if(m_uiObliterateTimer < uiDiff)
            {
                DoCast(me->getVictim(), Regular ? SPELL_OBLITERATE_N : SPELL_OBLITERATE_H);
                m_uiObliterateTimer = urand(8000, 12000);
            } else m_uiObliterateTimer -= uiDiff;

            if (m_uiWellTimer < uiDiff)
            {
                DoScriptText(SAY_MARWYN_SP02, me);
                if(Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM))
                   DoCast(pTarget, SPELL_WELL_OF_CORRUPTION);
                m_uiWellTimer= urand(25000, 30000);
            } else m_uiWellTimer -= uiDiff;

            if (m_uiSharedSufferingTimer < uiDiff)
            {
                if(Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM))
                   DoCast(pTarget, Regular ? SPELL_SHARED_SUFFERING_N : SPELL_SHARED_SUFFERING_H);
                m_uiSharedSufferingTimer = urand(15000, 20000);
            } else m_uiSharedSufferingTimer -= uiDiff;

            if (m_uiFleshTimer < uiDiff)
            {
                DoScriptText(SAY_MARWYN_SP01, me);
                if(Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM))
                    DoCast(pTarget, Regular ? SPELL_CORRUPTED_FLESH_N : SPELL_CORRUPTED_FLESH_H);
                m_uiFleshTimer = urand(10000, 16000);
            } else m_uiFleshTimer -= uiDiff;

            if(m_uiBerserkTimer < uiDiff)
            {
                DoCast(me, SPELL_BERSERK);
                m_uiBerserkTimer = 180000;
            } else  m_uiBerserkTimer -= uiDiff;

            DoMeleeAttackIfReady();

            return;
        }
Beispiel #21
0
        void UpdateEscortAI(uint32 uiDiff) override
        {
            if (uiPhase)
            {
                if (uiTimer <= uiDiff)
                {
                    switch (uiPhase)
                    {
                        case 1:
                            Talk(SAY_BLASTMASTER_1);
                            NextStep(2000, true);
                            break;
                        case 2:
                            SetEscortPaused(false);
                            NextStep(0, false, 0);
                            break;
                        case 3:
                            Talk(SAY_BLASTMASTER_2);
                            SetEscortPaused(false);
                            NextStep(0, false, 0);
                            break;
                        case 4:
                            Talk(SAY_BLASTMASTER_3);
                            NextStep(3000, true);
                            break;
                        case 5:
                            Talk(SAY_BLASTMASTER_4);
                            NextStep(3000, true);
                            break;
                        case 6:
                            SetInFace(true);
                            Talk(SAY_BLASTMASTER_5);
                            Summon(1);
                            if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_GO_CAVE_IN_RIGHT)))
                                instance->HandleGameObject(ObjectGuid::Empty, true, go);
                            NextStep(3000, true);
                            break;
                        case 7:
                            Talk(SAY_BLASTMASTER_6);
                            SetEscortPaused(false);
                            NextStep(0, false, 0);
                            break;
                        case 8:
                            me->HandleEmoteCommand(EMOTE_STATE_USE_STANDING);
                            NextStep(25000, true);
                            break;
                        case 9:
                            Summon(2);
                            NextStep(0, false);
                            break;
                        case 10:
                            Summon(4);
                            Talk(SAY_BLASTMASTER_8);
                            NextStep(0, false);
                            break;
                        case 11:
                            Talk(SAY_BLASTMASTER_9);
                            NextStep(5000, true);
                            break;
                        case 12:
                            Talk(SAY_BLASTMASTER_10);
                            NextStep(5000, true);
                            break;
                        case 13:
                            Talk(SAY_BLASTMASTER_11);
                            CaveDestruction(true);
                            NextStep(8000, true);
                            break;
                        case 14:
                            Talk(SAY_BLASTMASTER_12);
                            NextStep(8500, true);
                            break;
                        case 15:
                            Talk(SAY_BLASTMASTER_13);
                            NextStep(2000, true);
                            break;
                        case 16:
                            Talk(SAY_BLASTMASTER_14);
                            SetInFace(false);
                            if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_GO_CAVE_IN_LEFT)))
                                instance->HandleGameObject(ObjectGuid::Empty, true, go);
                            NextStep(2000, true);
                            break;
                        case 17:
                            SetEscortPaused(false);
                            Talk(SAY_BLASTMASTER_15);
                            Summon(5);
                            NextStep(0, false);
                            break;
                        case 18:
                            Summon(6);
                            NextStep(0, false);
                            break;
                        case 19:
                            SetInFace(false);
                            Summon(7);
                            Talk(SAY_BLASTMASTER_16);
                            NextStep(0, false);
                            break;
                        case 20:
                            Talk(SAY_BLASTMASTER_18);
                            NextStep(2000, true);
                            break;
                        case 21:
                            Summon(8);
                            NextStep(0, false);
                            break;
                        case 22:
                            CaveDestruction(false);
                            Talk(SAY_BLASTMASTER_11);
                            NextStep(3000, true);
                            break;
                        case 23:
                            Summon(9);
                            Talk(SAY_BLASTMASTER_19);
                            NextStep(0, false);
                            break;
                    }
                } else uiTimer -= uiDiff;
            }

            if (!UpdateVictim())
                return;

            DoMeleeAttackIfReady();
        }
Beispiel #22
0
 void Summon(uint8 uiCase)
 {
     switch (uiCase)
     {
         case 1:
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             break;
         case 2:
             if (GameObject* go = me->SummonGameObject(183410, -533.140f, -105.322f, -156.016f, 0.f, G3D::Quat(), 1))
             {
                 GoSummonList.push_back(go->GetGUID());
                 go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
             }
             Summon(3);
             break;
         case 3:
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             Talk(SAY_BLASTMASTER_7);
             break;
         case 4:
             if (GameObject* go = me->SummonGameObject(183410, -542.199f, -96.854f, -155.790f, 0.f, G3D::Quat(), 1))
             {
                 GoSummonList.push_back(go->GetGUID());
                 go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
             }
             break;
         case 5:
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             break;
         case 6:
             if (GameObject* go = me->SummonGameObject(183410, -507.820f, -103.333f, -151.353f, 0.f, G3D::Quat(), 1))
             {
                 GoSummonList.push_back(go->GetGUID());
                 go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
                 Summon(5);
             }
             break;
         case 7:
             if (GameObject* go = me->SummonGameObject(183410, -511.829f, -86.249f, -151.431f, 0.f, G3D::Quat(), 1))
             {
                 GoSummonList.push_back(go->GetGUID());
                 go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
             }
             break;
         case 8:
             if (Creature* grubbis = me->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000))
                 grubbis->AI()->Talk(SAY_GRUBBIS);
             me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
             break;
         case 9:
             me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[17], G3D::Quat(), 7200);
             me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[18], G3D::Quat(), 7200);
             me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[19], G3D::Quat(), 7200);
             break;
     }
 }
Beispiel #23
0
 void Summon(uint8 uiCase)
 {
     switch (uiCase)
     {
     case 1:
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         break;
     case 2:
         if (GameObject* pGo = me->SummonGameObject(183410, -533.140f, -105.322f, -156.016f, 0, 0, 0, 0, 0, 1000))
         {
             GoSummonList.push_back(pGo->GetGUID());
             pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
         }
         Summon(3);
         break;
     case 3:
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         DoScriptText(SAY_BLASTMASTER_19, me);
         break;
     case 4:
         if (GameObject* pGo = me->SummonGameObject(183410, -542.199f, -96.854f, -155.790f, 0, 0, 0, 0, 0, 1000))
         {
             GoSummonList.push_back(pGo->GetGUID());
             pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
         }
         break;
     case 5:
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         DoScriptText(SAY_BLASTMASTER_15, me);
         break;
     case 6:
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         break;
     case 7:
         if (GameObject* pGo = me->SummonGameObject(183410, -507.820f, -103.333f, -151.353f, 0, 0, 0, 0, 0, 1000))
         {
             GoSummonList.push_back(pGo->GetGUID());
             pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
             Summon(6);
         }
         break;
     case 8:
         if (GameObject* pGo = me->SummonGameObject(183410, -511.829f, -86.249f, -151.431f, 0, 0, 0, 0, 0, 1000))
         {
             GoSummonList.push_back(pGo->GetGUID());
             pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); //We can't use it!
         }
         break;
     case 9:
         if (Creature* pGrubbis = me->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000))
             DoScriptText(SAY_GRUBBIS, pGrubbis);
         me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
         break;
     }
 }
Beispiel #24
0
    void UpdateEscortAI(const uint32 uiDiff)
    {
        if (uiPhase)
        {
            if (uiTimer <= uiDiff)
            {
                switch (uiPhase)
                {
                case 1:
                    DoScriptText(SAY_BLASTMASTER_1, me);
                    NextStep(1500, true);
                    break;
                case 2:
                    SetEscortPaused(false);
                    NextStep(0, false, 0);
                    break;
                case 3:
                    DoScriptText(SAY_BLASTMASTER_2, me);
                    SetEscortPaused(false);
                    NextStep(0, false, 0);
                    break;
                case 4:
                    DoScriptText(SAY_BLASTMASTER_3, me);
                    NextStep(3000, true);
                    break;
                case 5:
                    DoScriptText(SAY_BLASTMASTER_4, me);
                    NextStep(3000, true);
                    break;
                case 6:
                    SetInFace(true);
                    DoScriptText(SAY_BLASTMASTER_5, me);
                    Summon(1);
                    if (pInstance)
                        if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
                            pInstance->HandleGameObject(0, true, pGo);
                    NextStep(3000, true);
                    break;
                case 7:
                    DoScriptText(SAY_BLASTMASTER_6, me);
                    SetEscortPaused(false);
                    NextStep(0, false, 0);
                    break;
                case 8:
                    me->HandleEmoteCommand(EMOTE_STATE_WORK);
                    NextStep(25000, true);
                    break;
                case 9:
                    Summon(2);
                    NextStep(0, false);
                    break;
                case 10:
                    Summon(4);
                    NextStep(0, false);
                    break;
                case 11:
                    DoScriptText(SAY_BLASTMASTER_17, me);
                    NextStep(5000, true);
                    break;
                case 12:
                    DoScriptText(SAY_BLASTMASTER_18, me);
                    NextStep(5000, true);
                    break;
                case 13:
                    DoScriptText(SAY_BLASTMASTER_20, me);
                    CaveDestruction(true);
                    NextStep(8000, true);
                    break;
                case 14:
                    DoScriptText(SAY_BLASTMASTER_21, me);
                    NextStep(8500, true);
                    break;
                case 15:
                    DoScriptText(SAY_BLASTMASTER_22, me);
                    NextStep(2000, true);
                    break;
                case 16:
                    DoScriptText(SAY_BLASTMASTER_23, me);
                    SetInFace(false);
                    if (pInstance)
                        if (GameObject* pGo = GameObject::GetGameObject((*me), pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
                            pInstance->HandleGameObject(0, true, pGo);
                    NextStep(2000, true);
                    break;
                case 17:
                    SetEscortPaused(false);
                    DoScriptText(SAY_BLASTMASTER_24, me);
                    Summon(6);
                    NextStep(0, false);
                    break;
                case 18:
                    Summon(7);
                    NextStep(0, false);
                    break;
                case 19:
                    SetInFace(false);
                    Summon(8);
                    DoScriptText(SAY_BLASTMASTER_25, me);
                    NextStep(0, false);
                    break;
                case 20:
                    DoScriptText(SAY_BLASTMASTER_27, me);
                    NextStep(2000, true);
                    break;
                case 21:
                    Summon(9);
                    NextStep(0, false);
                    break;
                case 22:
                    CaveDestruction(false);
                    DoScriptText(SAY_BLASTMASTER_20, me);
                    NextStep(0, false);
                    break;
                }
            }
            else uiTimer -= uiDiff;
        }

        if (!UpdateVictim())
            return;

        DoMeleeAttackIfReady();
    }
        void SetData(uint32 type, uint32 data)
        {
            switch(type)
            {
				case DATA_WAVE_STATE:
                    uiWaveState = data;
                    
                    if (data == SPECIAL) // Called on first spawn
                    {
                        CloseDoor(uiFrontDoor);
                        if (!m_bIsCall)
                        {
                           m_bIsCall = true;
                           Summon();
                        }
                        events.ScheduleEvent(EVENT_NEXT_WAVE, 15000);
                     }
                     
                     if (data == IN_PROGRESS) // Called on failed wave
                    {
                        CloseDoor(uiFrontDoor);
                        if (!m_bIsCall)
                        {
                           m_bIsCall = true;
                           Summon();
                        }
                        events.ScheduleEvent(EVENT_NEXT_WAVE, 3000);
                    }

                    if (uiWaveCount && data == FAIL)
                        DoWipe();
                    break;
                case DATA_INTRO_EVENT:
                    uiIntroDone = data;
                    break;
                case DATA_FALRIC_EVENT:
                    uiEncounter[0] = data;
                    if (data == DONE)
                        events.ScheduleEvent(EVENT_NEXT_WAVE, 60000);
                    break;
                case DATA_MARWYN_EVENT:
                    uiEncounter[1] = data;
                    if (data == DONE)
                    {
                        OpenDoor(uiFrostwornDoor);
                        OpenDoor(uiFrontDoor);
                    }
                    break;
                case DATA_FROSWORN_EVENT:
                    uiEncounter[2] = data;
                    if (data == DONE)
                    {
                        OpenDoor(uiArthasDoor);
                        SetData(DATA_PHASE, 3);
                        instance->SummonCreature(BOSS_LICH_KING, OutroSpawns[0]);
                        instance->SummonCreature(NPC_JAINA_OUTRO, OutroSpawns[1]);
                    }
                    break;
                case DATA_LICHKING_EVENT:
                    uiEncounter[3] = data;
                    if(data == IN_PROGRESS)
                    {
                        OpenDoor(uiRunDoor);

                        if(instance->IsHeroic())
                            DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEVNOTRETREATINGEVENT);
                    }
                    if(data == FAIL)
                    {
                        for(uint8 i = 0; i<4; i++)
                            OpenDoor(uiWallID[i]);

                        CloseDoor(uiRunDoor);

                        if(Creature* pLichKing = instance->GetCreature(uiLichKing))
                            pLichKing->DespawnOrUnsummon(10000);
                        if(Creature* pLider = instance->GetCreature(uiLider))
                            pLider->DespawnOrUnsummon(10000);

                        DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEVNOTRETREATINGEVENT);
                        DoCastSpellOnPlayers(5); // Kill all players

                        SetData(DATA_PHASE, 3);
                        instance->SummonCreature(BOSS_LICH_KING, OutroSpawns[0]);
                        instance->SummonCreature(NPC_JAINA_OUTRO, OutroSpawns[1]);
                    }
                    if(data == DONE)
                    {
                        if(GameObject *pChest = instance->GetGameObject(uiChest))
                            pChest->SetPhaseMask(1, true);
                        if(GameObject *pPortal = instance->GetGameObject(uiPortal))
                            pPortal->SetPhaseMask(1, true);

						AchievementEntry const* AchievHoRN = sAchievementStore.LookupEntry(ACHIEVHORN);

						Map::PlayerList const &players = instance->GetPlayers();
                        for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
							itr->getSource()->CompletedAchievement(AchievHoRN);

                        if(instance->IsHeroic())
                        {
							AchievementEntry const* AchievHoRH = sAchievementStore.LookupEntry(ACHIEVHORH);
                            for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
								itr->getSource()->CompletedAchievement(AchievHoRH);
                            DoCastSpellOnPlayers(SPELL_ACHIEV_CHECK);
                            DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEVNOTRETREATINGEVENT);
                        }
                    }
                    break;
                case DATA_SUMMONS:
                    if (data == 3) uiSummons = 0;
                    else if (data == 1) ++uiSummons;
                    else if (data == 0) --uiSummons;
                    data = NOT_STARTED;
                    break;
                case DATA_ICE_WALL_1:
                    uiWall[0] = data;
                    break;
                case DATA_ICE_WALL_2:
                    uiWall[1] = data;
                    break;
                case DATA_ICE_WALL_3:
                    uiWall[2] = data;
                    break;
                case DATA_ICE_WALL_4:
                    uiWall[3] = data;
                    break;
                case DATA_PHASE:
                    uiDataPhase = data;
                    break;
            }

            if (data == DONE)
                SaveToDB();
        }