Jump to content

BenjaminLSR

Members
  • Posts

    13
  • Joined

  • Last visited

  • Donations

    10.00 GBP 

Bug Comments posted by BenjaminLSR

  1. /*
     * Explosive Sheep
     */
    
    enum
    {
        SPELL_EXPLOSIVE_SHEEP_PASSIVE   = 4051,
        SPELL_EXPLOSIVE_SHEEP           = 4050
    };
    
    struct npc_explosive_sheepAI : ScriptedPetAI
    {
        explicit npc_explosive_sheepAI(Creature* pCreature) : ScriptedPetAI(pCreature)
        {
            m_creature->SetCanModifyStats(true);
    
            if (m_creature->GetCharmInfo())
                m_creature->GetCharmInfo()->SetReactState(REACT_AGGRESSIVE);
    
            npc_explosive_sheepAI::Reset();
            npc_explosive_sheepAI::ResetCreature();
        }
    
        bool m_bExploded;
        uint32 m_uiAliveTimer;
    
        void Reset() override
        {
    
        }
    
        void ResetCreature() override
        {
            m_bExploded = false;
            m_uiAliveTimer = 3 * MINUTE * IN_MILLISECONDS;
    
            m_creature->CastSpell(m_creature, SPELL_EXPLOSIVE_SHEEP_PASSIVE, true);
        }
    
        void JustDied(Unit* /*pKiller*/) override
        {
            if (auto pPet = m_creature->ToPet())
                pPet->DelayedUnsummon(5000, PET_SAVE_AS_DELETED);
        }
    
        void UpdateAI(const uint32 uiDiff) override
        {
            if (!m_bExploded)
            {
                if (m_uiAliveTimer <= uiDiff)
                {
                    m_creature->CastSpell(m_creature, SPELL_EXPLOSIVE_SHEEP, true);
                    m_bExploded = true;
                }
                else
                    m_uiAliveTimer -= uiDiff;
    
                ScriptedPetAI::UpdateAI(uiDiff);
            }
        }
    };
    
    CreatureAI* GetAI_npc_explosive_sheep(Creature* pCreature)
    {
        return new npc_explosive_sheepAI(pCreature);
    }
    
    newscript = new Script;
    newscript->Name = "npc_explosive_sheep";
    newscript->GetAI = &GetAI_npc_explosive_sheep;
    newscript->RegisterSelf();

    This is what can be found within elysium core.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use