Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 1 of 1
  1. #1
    Dr.Core
    Guest

    BurningBerserk NPC Script ( 85% Finished )


    Register to remove this ad
    PHP Code:
    /*
     * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */

    #include "ObjectMgr.h"
    #include "ScriptMgr.h"
    #include "Object.h"
    #include "Player.h"
    #include "GameObject.h"
    #include "GameObjectAI.h"
    #include "Unit.h"
    #include "UnitAI.h"
    #include "ScriptMgr.h"
    #include "ScriptedCreature.h"
    #include "SpellScript.h"
    #include "SpellAuraEffects.h"
    #include "Spell.h"

    enum Spells
    {
        
    SPELL_FORAGE 149463,
        
    SPELL_FIERY_CHARGE 147704,
        
    SPELL_BLAZING_CLEAVE 147702,
        
    SPELL_BURNING_FURY 66721,
    };

    enum Events
    {
        
    EVENT_FORAGE                         1,
        
    EVENT_FIERY_CHARGE                     2,
        
    EVENT_BLAZING_CLEAVE                 3,
        
    EVENT_BURNING_FURY                     4,
    };

    class 
    npc_burning_berserker : public CreatureScript
    {
    public:
        
    npc_burning_berserker() : CreatureScript("npc_burning_berserker") { }

        
    struct npc_burning_berserkerAI : public ScriptedAI
        
    {
            
    npc_burning_berserkerAI(Creaturecreature) : ScriptedAI(creature) { }

            
    void Reset() override
            
    {
                
    _events.Reset();
                
    _events.ScheduleEvent(EVENT_FORAGE5000);
            }

            
    void EnterCombat(Unit/*who*/override
            
    {
                
    _events.ScheduleEvent(EVENT_FIERY_CHARGE1000);
            }

            
    void UpdateAI(uint32 diffoverride
            
    {
                
    _events.Update(diff);

                if (!
    InCombat)
            
                    
    DoCast(SPELL_FORAGEurand(20008000));
                    return;

                if (
    Unitunit SelectTarget(SELECT_TARGET_NEAREST00.0ftrue))
                {
                    if (
    me->IsWithinMeleeRange(unit) && unit->isInFront(me))
                        
    DoCast(unitSPELL_FIERY_CHARGE);
                    else
                        return;
                }

                while (
    uint32 eventId _events.ExecuteEvent())
                {
                    switch (
    eventId)
                    {
                    case 
    EVENT_FIERY_CHARGE:
                        
    DoCast(SPELL_FIERY_CHARGE);
                        
    _events.ScheduleEvent(EVENT_FIERY_CHARGE30000);
                        break;
                    case 
    EVENT_BLAZING_CLEAVE:
                        
    DoCast(SPELL_BLAZING_CLEAVE);
                        
    _events.ScheduleEvent(EVENT_BLAZING_CLEAVE5000);
                        break;
                    case 
    EVENT_BURNING_FURY:
                        
    DoCast(SPELL_BURNING_FURY);
                        
    _events.ScheduleEvent(EVENT_BURNING_FURY30000);
                        break;
                    default:
                        break;
                    }
                }
                
    DoMeleeAttackIfReady();
            }
            
        private:
            
    bool InCombat;
            
    EventMap _events;
        };

        
    CreatureAIGetAI(Creaturecreature) const override
        
    {
            return new 
    npc_burning_berserkerAI(creature);
        }
    };

    void AddSC_npc_burning_berserker()
    {
        new 
    npc_burning_berserker();

    Todo :

    Cast FORAGE between 2 and 8 seconds out of combat
    Cast Spell Charge if aggro is taken
    Remove BURNING_FURY after 5 seconds and recast it after 10 seconds




    › See More: BurningBerserk NPC Script ( 85% Finished )
    Last edited by Dr.Core; 09-11-15 at 06:38 PM.



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

 

 

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!
SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 07:57 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org