Training dummy menu

User Tag List

Results 1 to 3 of 3
  1. #1
    LilleCarl's Avatar Active Member
    Reputation
    65
    Join Date
    Feb 2008
    Posts
    132
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Training dummy

    Code:
    struct pAttackMap{
        pAttackMap() : guid(0), timer(0) { }
        uint64 guid;
        uint32 timer;
    };
    
    
    struct MANGOS_DLL_DECL npc_training_dummyAI : public Scripted_NoMovementAI
    {
        npc_training_dummyAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature){}
    
    
        std::map<uint64, pAttackMap*> AttackMap;
    
    
        uint32 second;
    
    
        void Reset(){}
    
    
        void DamageTaken(Unit* pDealer, uint32& uiDamage)
        {
            uint64 guid = pDealer->GetObjectGuid();
            pAttackMap *data = AttackMap[guid];
    
    
            if(!data)
            {
                data = new pAttackMap();
                AttackMap[guid] = data;
                data->guid = guid;
            }
            data->timer = 6000;
        }
    
    
        void UpdateAI(const uint32 diff)
        {
            second += diff;
            if (second > 1000)
            {
                for (std::map<uint64, pAttackMap*>::iterator itr = AttackMap.begin(); itr != AttackMap.end(); ++itr)
                {
                    ObjectGuid oGuid;
                    oGuid.Set(itr->second->guid);
                    Player* pPlayer = m_creature->GetMap()->GetPlayer(oGuid);
                    itr->second->timer -= 1000;
                    if (itr->second->timer < 1)
                    {
                        pPlayer->CombatStop(true);
                        pPlayer->AttackStop(false);
                        pPlayer->CombatStopWithPets(true);
                        pPlayer->ClearInCombat();
                        AttackMap.erase(itr->second->guid);
                        delete itr->second;
                    }
                    if (AttackMap.empty())
                    {
                        EnterEvadeMode();
                        m_creature->SetHealth(m_creature->GetMaxHealth());
                    }
                    
                }
                second = 0;
            }
    
    
            m_creature->SetStunned(true);
            if ((m_creature->GetHealthPercent() < 10.0f || m_creature->GetHealthPercent() > 20.0f) && m_creature->isInCombat()) // allow players using finishers
                m_creature->SetHealth(m_creature->GetMaxHealth()/5);
     
            m_creature->SetTargetGuid(ObjectGuid()); // prevent from rotating
        }
    };
     
    CreatureAI* GetAI_npc_training_dummy(Creature* pCreature)
    {
        return new npc_training_dummyAI(pCreature);
    }
    Enough said, its working properly and i wrote it.
    Last edited by LilleCarl; 06-13-2012 at 09:53 AM.
    Violence doesn't solve shit, but everything else.

    Training dummy
  2. #2
    Harambeqt's Avatar Elite User CoreCoins Purchaser
    Reputation
    333
    Join Date
    Mar 2010
    Posts
    1,206
    Thanks G/R
    9/29
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Damn, finally not a repack release!
    You know how to script n"36er
    Support the #1 WoW Emulator:
    http://arcemu.org/
    https://github.com/arcemu/arcemu
    - - -

  3. #3
    LilleCarl's Avatar Active Member
    Reputation
    65
    Join Date
    Feb 2008
    Posts
    132
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah ik, i felt that something like this was needed, people must learn not to use repacks. Repacks are holding back development, because people never get introduced to the C++ language (That is why so many people use lua xD)
    Violence doesn't solve shit, but everything else.

Similar Threads

  1. vanilla training dummy
    By frammis4242 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 03-25-2015, 08:03 AM
  2. Training dummy Testing DPS
    By Yexs in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 01-31-2014, 10:16 AM
  3. Training Dummy
    By InvaderGir in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 04-10-2009, 07:41 PM
  4. DK Weapon skill off level 60 training dummy
    By mrfreeze in forum World of Warcraft Exploits
    Replies: 6
    Last Post: 03-17-2009, 09:27 AM
  5. Get weaponskill as a hunter on a training dummy!
    By kitash in forum World of Warcraft Exploits
    Replies: 18
    Last Post: 02-20-2009, 12:13 PM
All times are GMT -5. The time now is 09:59 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search