Пример #1
0
    void UpdateAI(const uint32 uiDiff)
    {
        UpdateIntro(uiDiff);

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

        if (m_creature->getVictim()->GetEntry() == NPC_RITUAL_TARGET)
        {
            EnterEvadeMode();
            return;
        }

        Events.Update(uiDiff);
        while (uint32 uiEventId = Events.ExecuteEvent())
            switch (uiEventId)
            {
                case EVENT_RITUAL: // handle teleports
                    if (Unit* pSacrifice = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM_PLAYER, 0))
                    {
                        switch(urand(0, 4))
                        {
                            case 0: DoScriptText(SAY_SACRIFICE_1, m_creature); break;
                            case 1: DoScriptText(SAY_SACRIFICE_2, m_creature); break;
                            case 2: DoScriptText(SAY_SACRIFICE_3, m_creature); break;
                            case 3: DoScriptText(SAY_SACRIFICE_4, m_creature); break;
                            case 4: DoScriptText(SAY_SACRIFICE_5, m_creature); break;
                        }
                        p_Sacrifice = pSacrifice->GetObjectGuid();
                        m_creature->CastSpell(pSacrifice, SPELL_RITUAL_PREPARATION, true);
                        m_creature->CastSpell(m_creature, SPELL_RITUAL_OF_SWORD, false);
                        Events.DelayEventsWithId(EVENT_SINISTER_STRIKE, 27*IN_MILLISECONDS);
                        Events.DelayEventsWithId(EVENT_CALL_FLAMES, 27*IN_MILLISECONDS);
                        Events.ScheduleEvent(EVENT_SUMMON_CHANNELERS, 1500); // enough time to get teleported before casting
                    }
                    break;
                case EVENT_SUMMON_CHANNELERS:
                    {
                        if (!p_Sacrifice.IsEmpty())
                            if (Unit* pSacrificed = m_creature->GetMap()->GetUnit(p_Sacrifice))
                                m_creature->CastSpell(pSacrificed, SPELL_RITUAL_STRIKE, true);
                        m_creature->CastSpell(m_creature, SPELL_SUMMON_CHANNELER_1, true);
                        m_creature->CastSpell(m_creature, SPELL_SUMMON_CHANNELER_2, true);
                        m_creature->CastSpell(m_creature, SPELL_SUMMON_CHANNELER_3, true);
                    }
                    break;
                case EVENT_SINISTER_STRIKE:
                    if (m_creature->getVictim())
                        m_creature->CastSpell(m_creature->getVictim(), m_bIsRegularMode? SPELL_SINISTER_STRIKE : SPELL_SINISTER_STRIKE_H, false);
                    break;
                case EVENT_CALL_FLAMES: // haven't seen this spell used enough
                    m_creature->CastSpell(m_creature, SPELL_CALL_FLAMES, true);
                    break;
                default:
                    break;
            }

        DoMeleeAttackIfReady();
    }
Пример #2
0
void BattleScene::Update()
{
	switch (stage)
	{
	case BattleStages::SCROLL: //0
		UpdateScroll();
		break;
	case BattleStages::INTRO: //1
		UpdateIntro();
		break;
	}
}