void TeleportToMyBrother()
    {
        if (!pInstance)
            return;

        Teleport_Timer = TELEPORTTIME;

        if (IAmVeklor())
            return;                                         // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates

        Creature *pOtherBoss = GetOtherBoss();
        if (pOtherBoss)
        {
            //me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
            float other_x = pOtherBoss->GetPositionX();
            float other_y = pOtherBoss->GetPositionY();
            float other_z = pOtherBoss->GetPositionZ();
            float other_o = pOtherBoss->GetOrientation();

            Map *thismap = me->GetMap();
            thismap->CreatureRelocation(pOtherBoss, me->GetPositionX(),
                me->GetPositionY(),    me->GetPositionZ(), me->GetOrientation());
            thismap->CreatureRelocation(me, other_x, other_y, other_z, other_o);

            SetAfterTeleport();
            CAST_AI(boss_twinemperorsAI,  pOtherBoss->AI())->SetAfterTeleport();
        }
    }
Exemple #2
0
    void JustDied(Unit* pKiller)
    {
        Map* pMap = m_creature->GetMap();
        Map::PlayerList const &players = pMap->GetPlayers();
        for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
            itr->getSource()->KilledMonsterCredit(NPC_EREGOS);

        pMap->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()-100.0f, 0);
        m_creature->MonsterMoveWithSpeed(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()-100.0f, 26);
        DoScriptText(SAY_DEATH, m_creature);
        if (m_pInstance)
            m_pInstance->SetData(TYPE_EREGOS, DONE);
    }
Exemple #3
0
        void UpdateAI(const uint32 diff)
        {
            if (Must_Die)
            {
                if (Must_Die_Timer <= diff)
                {
                    me->DespawnOrUnsummon();
                    return;
                } else Must_Die_Timer -= diff;
            }

            if (!Escape)
            {
                if (!PlayerGUID)
                    return;

                if (spellEscape_Timer <= diff)
                {
                    DoCast(me, SPELL_RIZZLE_ESCAPE, false);
                    spellEscape_Timer = 10000;
                } else spellEscape_Timer -= diff;

                if (Teleport_Timer <= diff)
                {
                    //temp solution - unit can't be teleported by core using spelleffect 5, only players
                    Map* map = me->GetMap();
                    if (map)
                    {
                        map->CreatureRelocation(me, 3706.39f, -3969.15f, 35.9118f, 0);
                        me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0);
                    }
                    //begin swimming and summon depth charges
                    Player* player = Unit::GetPlayer(*me, PlayerGUID);
                    SendText(MSG_ESCAPE_NOTICE, player);
                    DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE);
                    me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
                    me->SetSpeed(MOVE_RUN, 0.85f, true);
                    me->GetMotionMaster()->MovementExpired();
                    me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
                    Escape = true;
                } else Teleport_Timer -= diff;

                return;
            }

            if (ContinueWP)
            {
                me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
                ContinueWP = false;
            }

            if (Grenade_Timer <= diff)
            {
                Player* player = Unit::GetPlayer(*me, PlayerGUID);
                if (player)
                {
                   DoScriptText(SAY_RIZZLE_GRENADE, me, player);
                   DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true);
                }
                Grenade_Timer = 30000;
            } else Grenade_Timer -= diff;

            if (Check_Timer <= diff)
            {
                Player* player = Unit::GetPlayer(*me, PlayerGUID);
                if (!player)
                {
                    me->DespawnOrUnsummon();
                    return;
                }

                if (me->IsWithinDist(player, 10) && me->GetPositionX() > player->GetPositionX() && !Reached)
                {
                    DoScriptText(SAY_RIZZLE_FINAL, me);
                    me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
                    me->setFaction(35);
                    me->GetMotionMaster()->MoveIdle();
                    me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE);
                    Reached = true;
                }

                Check_Timer = 1000;
            } else Check_Timer -= diff;

        }