コード例 #1
0
    void Reset() override
    {
        // get the list of summoned stalkers and move to a randome one
        if (m_pInstance)
            m_pInstance->GetStalkersGUIDVector(m_vStalkersGuids);

        if (m_vStalkersGuids.empty())
            return;

        m_creature->SetWalk(false);
        if (Creature* pStalker = m_creature->GetMap()->GetCreature(m_vStalkersGuids[urand(0, m_vStalkersGuids.size() - 1)]))
            m_creature->GetMotionMaster()->MovePoint(1, pStalker->GetPositionX(), pStalker->GetPositionY(), pStalker->GetPositionZ());
    }
コード例 #2
0
ファイル: boss_xt_002.cpp プロジェクト: AwkwardDev/mangos-d3
    void ReceiveAIEvent(AIEventType eventType, Creature* /*pSender*/, Unit* pInvoker, uint32 /*uiMiscValue*/) override
    {
        // start XT phase switch and start recharging robots
        if (eventType == AI_EVENT_CUSTOM_A && pInvoker->GetEntry() == NPC_XT002)
        {
            // remove flags and previous vehicle aura before applying the new one
            m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
            pInvoker->RemoveSpellsCausingAura(SPELL_AURA_CONTROL_VEHICLE);

            DoCastSpellIfCan(pInvoker, SPELL_RIDE_VEHICLE, CAST_TRIGGERED);
            DoCastSpellIfCan(pInvoker, SPELL_LIGHTNING_TETHER, CAST_TRIGGERED);
            DoCastSpellIfCan(m_creature, SPELL_HEART_OVERLOAD, CAST_TRIGGERED);
            DoCastSpellIfCan(m_creature, SPELL_EXPOSED_HEART, CAST_TRIGGERED);
            m_uiRobotTimer = 1000;

            // load the toy piles guids
            if (m_pInstance && m_vToyPileGuids.empty())
                m_pInstance->GetToyPileGuids(m_vToyPileGuids);
        }
    }
コード例 #3
0
ファイル: boss_eregos.cpp プロジェクト: AwkwardDev/mangos-d3
    void JustSummoned(Creature* pSummoned) override
    {
        if (pSummoned->GetEntry() == NPC_PLANAR_ANOMALY)
        {
            pSummoned->CastSpell(pSummoned, SPELL_PLANAR_ANOMALY_AGGRO, true);

            // If this happens then something is really wrong
            if (m_vAnomalyTargets.empty())
                return;

            if (Unit* pTarget = m_creature->GetMap()->GetUnit(m_vAnomalyTargets[m_uiAnomalyTargetIndex]))
                pSummoned->GetMotionMaster()->MoveFollow(pTarget, 0, 0);

            if (m_uiAnomalyTargetIndex < m_vAnomalyTargets.size() - 1)
                ++m_uiAnomalyTargetIndex;
        }
        else if (pSummoned->GetEntry() == NPC_GREATER_LEY_WHELP)
        {
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
                pSummoned->AI()->AttackStart(pTarget);
        }
    }