コード例 #1
0
    void SummonedCreatureJustDied(Creature* pSummoned) override
    {
        if (pSummoned->GetEntry() == NPC_GLOB_OF_VISCIDUS)
        {
            // shrink - modify scale
            m_creature->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X, float(-4), true);
            m_creature->UpdateModelData();
            m_creature->SetHealth(m_creature->GetHealth() - (m_creature->GetMaxHealth() * 0.05f));
            m_lGlobesGuidList.remove(pSummoned->GetObjectGuid());

            // suicide if required
            if (m_creature->GetHealthPercent() < 5.0f)
            {
                m_creature->SetVisibility(VISIBILITY_ON);

                if (DoCastSpellIfCan(m_creature, SPELL_VISCIDUS_SUICIDE, CAST_TRIGGERED) == CAST_OK)
                    m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
            }
            else if (m_lGlobesGuidList.empty())
            {
                m_creature->SetVisibility(VISIBILITY_ON);
                m_creature->SetStandState(UNIT_STAND_STATE_STAND);
                m_uiPhase = PHASE_NORMAL;

                SetCombatMovement(true);
                DoStartMovement(m_creature->getVictim());
            }
        }
    }
コード例 #2
0
    // Activate a random Constellation
    void ActivateRandomConstellation()
    {
        // spawn a new set of constellations if empty
        if (m_lConstellationsGuids.empty())
        {
            DoSpawnConstellations();
            m_uiConstellationTimer = 5000;
            return;
        }

        GuidList::iterator iter = m_lConstellationsGuids.begin();
        advance(iter, urand(0, m_lConstellationsGuids.size() - 1));

        if (Creature* pConstellation = m_creature->GetMap()->GetCreature(*iter))
        {
            // follow second top aggro player
            if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1, uint32(0), SELECT_FLAG_PLAYER))
            {
                pConstellation->GetMotionMaster()->MoveFollow(pTarget, CONTACT_DISTANCE, 0);
                SendAIEvent(AI_EVENT_CUSTOM_A, m_creature, pConstellation);
                ++m_uiActiveConstelations;
            }
        }

        m_lConstellationsGuids.remove(*iter);
    }
コード例 #3
0
ファイル: felwood.cpp プロジェクト: Maduse/server
 void SummonedCreatureJustDied(Creature* pSummoned) override
 {
     if (pSummoned->GetEntry() == NPC_IRONTREE_STOMPER || pSummoned->GetEntry() == NPC_IRONTREE_WANDERER)
     {
         m_lSummonsGuids.remove(pSummoned->GetObjectGuid());
         if (m_lSummonsGuids.empty())
             dialogueStep = 1;
     }
 }
コード例 #4
0
 void SummonedCreatureJustDied(Creature* pSummoned) override
 {
     if (pSummoned->GetEntry() == NPC_GRUBBIS)
     {
         if (m_pInstance)
             m_pInstance->SetData(TYPE_GRUBBIS, DONE);
         m_uiPhaseTimer = 1000;
     }
     m_luiSummonedMobGUIDs.remove(pSummoned->GetObjectGuid());
 }
コード例 #5
0
ファイル: felwood.cpp プロジェクト: 520lly/mangos-classic
    void SummonedCreatureJustDied(Creature* pSummoned) override
    {
        if (pSummoned->GetEntry() == NPC_IRONTREE_STOMPER || pSummoned->GetEntry() == NPC_IRONTREE_WANDERER)
        {
            m_lSummonsGuids.remove(pSummoned->GetObjectGuid());

            if (m_lSummonsGuids.empty())
                StartNextDialogueText(SAY_CLEAR_PATH);
        }
    }
コード例 #6
0
ファイル: boss_jedoga.cpp プロジェクト: Chuck5ta/ScriptDev3
        void SummonedCreatureJustDied(Creature* pSummoned) override
        {
            if (pSummoned->GetEntry() == NPC_TWILIGHT_VOLUNTEER)
            {
                m_lVolunteerGuidList.remove(pSummoned->GetObjectGuid());

                if (m_pInstance)
                {
                    m_pInstance->SetData(TYPE_DO_JEDOGA, 1);
                }

                m_creature->GetMotionMaster()->MovePoint(POINT_ID_COMBAT, aJedogaLandingLoc[0], aJedogaLandingLoc[1], aJedogaLandingLoc[2]);
            }
        }
コード例 #7
0
ファイル: boss_jedoga.cpp プロジェクト: jviljoen82/ScriptDev3
    void SummonedCreatureJustDied(Creature* pSummoned) override
    {
        if (pSummoned->GetEntry() == NPC_TWILIGHT_VOLUNTEER)
        {
            m_lVolunteerGuidList.remove(pSummoned->GetObjectGuid());

            if (m_pInstance)
            {
                if (Creature* pTemp = m_creature->GetMap()->GetCreature(m_pInstance->SelectJedogaSacrificeControllerGuid()))
                    pTemp->RemoveAurasDueToSpell(SPELL_SACRIFICE_VISUAL);
            }

            m_creature->GetMotionMaster()->MovePoint(POINT_ID_COMBAT, aJedogaLandingLoc[0], aJedogaLandingLoc[1], aJedogaLandingLoc[2]);
        }
    }
コード例 #8
0
    void SummonedCreatureJustDied(Creature* pSummoned) override
    {
        switch (pSummoned->GetEntry())
        {
            case NPC_INFINITE_ADVERSARY:
            case NPC_INFINITE_AGENT:
            case NPC_INFINITE_HUNTER:
                m_lSummonedGuidsList.remove(pSummoned->GetObjectGuid());

                if (m_lSummonedGuidsList.empty())
                    SetEscortPaused(false);
                break;
            case NPC_LORD_EPOCH:
                m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                break;
        }
    }
コード例 #9
0
    void SummonedMovementInform(Creature* pSummoned, uint32 uiType, uint32 uiPointId) override
    {
        if (pSummoned->GetEntry() != NPC_GLOB_OF_VISCIDUS || uiType != POINT_MOTION_TYPE || !uiPointId)
            return;

        m_lGlobesGuidList.remove(pSummoned->GetObjectGuid());
        pSummoned->CastSpell(m_creature, SPELL_REJOIN_VISCIDUS, TRIGGERED_OLD_TRIGGERED);
        pSummoned->ForcedDespawn(1000);

        if (m_lGlobesGuidList.empty())
        {
            m_creature->SetVisibility(VISIBILITY_ON);
            m_creature->SetStandState(UNIT_STAND_STATE_STAND);
            m_uiPhase = PHASE_NORMAL;

            SetCombatMovement(true);
            DoStartMovement(m_creature->getVictim());
        }
    }
コード例 #10
0
    void SummonedCreatureJustDied(Creature* pSummoned) override
    {
        m_lSummonedAddGuids.remove(pSummoned->GetObjectGuid());

        if (!m_pInstance)
            return;

        if (Creature* pAnchor = m_pInstance->GetClosestAnchorForGoth(pSummoned, true))
        {
            switch (pSummoned->GetEntry())
            {
                // Wrong caster, it expected to be pSummoned.
                // Mangos deletes the spell event at caster death, so for delayed spell like this
                // it's just a workaround. Does not affect other than the visual though (+ spell takes longer to "travel")
                case NPC_UNREL_TRAINEE:         m_creature->CastSpell(pAnchor, SPELL_A_TO_ANCHOR_1, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, pSummoned->GetObjectGuid()); break;
                case NPC_UNREL_DEATH_KNIGHT:    m_creature->CastSpell(pAnchor, SPELL_B_TO_ANCHOR_1, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, pSummoned->GetObjectGuid()); break;
                case NPC_UNREL_RIDER:           m_creature->CastSpell(pAnchor, SPELL_C_TO_ANCHOR_1, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, pSummoned->GetObjectGuid()); break;
            }
        }
    }
コード例 #11
0
ファイル: boss_gothik.cpp プロジェクト: Chuck5ta/ScriptDev3
        void SummonedCreatureJustDied(Creature* pSummoned) override
        {
            m_lSummonedAddGuids.remove(pSummoned->GetObjectGuid());

            if (!m_pInstance)
                return;

            m_pInstance->SetData64(DATA64_GOTH_RIGHT_ANCHOR, pSummoned->GetObjectGuid().GetRawValue());
            if (Creature* pAnchor = m_creature->GetMap()->GetCreature(ObjectGuid(m_pInstance->GetData64(DATA64_GOTH_RIGHT_ANCHOR))))
            {
                switch (pSummoned->GetEntry())
                {
                    // Wrong caster, it expected to be pSummoned.
                    // Mangos deletes the spell event at caster death, so for delayed spell like this
                    // it's just a workaround. Does not affect other than the visual though (+ spell takes longer to "travel")
                case NPC_UNREL_TRAINEE:         m_creature->CastSpell(pAnchor, SPELL_A_TO_ANCHOR_1, true, NULL, NULL, pSummoned->GetObjectGuid()); break;
                case NPC_UNREL_DEATH_KNIGHT:    m_creature->CastSpell(pAnchor, SPELL_B_TO_ANCHOR_1, true, NULL, NULL, pSummoned->GetObjectGuid()); break;
                case NPC_UNREL_RIDER:           m_creature->CastSpell(pAnchor, SPELL_C_TO_ANCHOR_1, true, NULL, NULL, pSummoned->GetObjectGuid()); break;
                }
            }
        }
コード例 #12
0
    void UpdateEscortAI(const uint32 uiDiff) override
    {
        if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
            return;

        // special script for snake fight
        if (m_uiActivateMummiesTimer)
        {
            if (m_uiActivateMummiesTimer <= uiDiff)
            {
                if (Creature* pTecahuna = m_creature->GetMap()->GetCreature(m_tecahunaGuid))
                {
                    // activate 2 mummies at each turn
                    for (uint8 i = 0; i < 2; ++i)
                    {
                        if (Creature* pBunny = m_creature->GetMap()->GetCreature(m_lImmolationBunnyGuids.front()))
                        {
                            pTecahuna->CastSpell(pBunny, SPELL_TECAHUNA_SPIRIT_BEAM, TRIGGERED_OLD_TRIGGERED);
                            pBunny->CastSpell(pBunny, SPELL_SUMMON_DRAKKARI_KING, TRIGGERED_OLD_TRIGGERED, NULL, NULL, m_creature->GetObjectGuid());
                            pBunny->RemoveAurasDueToSpell(SPELL_BUNNY_IMMOLATION);
                            m_lImmolationBunnyGuids.remove(m_lImmolationBunnyGuids.front());
                        }
                    }
                }

                // set timer based on the remaining mummies
                if (m_lImmolationBunnyGuids.empty())
                    m_uiActivateMummiesTimer = 0;
                else
                    m_uiActivateMummiesTimer = urand(5000, 10000);
            }
            else
                m_uiActivateMummiesTimer -= uiDiff;
        }

        DoMeleeAttackIfReady();
    }
コード例 #13
0
    void KilledUnit(Unit* pVictim) override
    {
        // Note: this is called from the Shade, Channeler and Sorcerer script
        // If the function is changed in the future, please review this.
        switch (pVictim->GetEntry())
        {
            case NPC_SHADE_OF_AKAMA:
                m_uiPhase = PHASE_EPILOGUE;

                m_creature->GetMotionMaster()->MovePoint(PHASE_EPILOGUE, afAkamaWP[1].m_fX, afAkamaWP[1].m_fY, afAkamaWP[1].m_fZ);
                break;
            case NPC_ASH_SORCERER:
                // Decrease the sorcerer counter
                m_lSorcerersGUIDList.remove(pVictim->GetObjectGuid());
                break;
            case NPC_ASH_CHANNELER:

                ++m_uiChannelersDead;

                // Move the shade to Akama when all channelers are dead
                // Note: the boss should be already slowly moving, but this isn't possible because of the missing stack for the speed debuff
                if (m_uiChannelersDead == MAX_CHANNELERS)
                {
                    if (m_pInstance)
                    {
                        if (Creature* pShade = m_pInstance->GetSingleCreatureFromStorage(NPC_SHADE_OF_AKAMA))
                        {
                            float fX, fY, fZ;
                            m_creature->GetContactPoint(pShade, fX, fY, fZ);
                            pShade->GetMotionMaster()->MovePoint(1, fX, fY, fZ);
                        }
                    }
                }
                break;
        }
    }
コード例 #14
0
 void SummonedCreatureDespawn(Creature* pSummoned) override
 {
     m_lSummonedBombGUIDs.remove(pSummoned->GetObjectGuid());
 }
コード例 #15
0
 // Wrapper to remove a stored player from the stomach
 void DoRemovePlayerFromStomach(Player* pPlayer)
 {
     if (pPlayer)
         m_lPlayersInStomachList.remove(pPlayer->GetObjectGuid());
 }
コード例 #16
0
ファイル: boss_gluth.cpp プロジェクト: Phatcat/mangos-wotlk
 void SummonedCreatureDespawn(Creature* pSummoned) override
 {
     m_lZombieChowGuidList.remove(pSummoned->GetObjectGuid());
 }
コード例 #17
0
ファイル: boss_fankriss.cpp プロジェクト: Maduse/server
 void SummonedCreatureJustDied(Creature* pSummoned) override
 {
     if (pSummoned->GetEntry() == NPC_VEKNISS_HATCHLING)
         m_lHatchlingsGUIDs.remove(pSummoned->GetObjectGuid());
 }