[Guide] How to make a custom C++ npc! menu

User Tag List

Results 1 to 4 of 4
  1. #1
    berryman13's Avatar Contributor
    Reputation
    251
    Join Date
    Dec 2006
    Posts
    856
    Thanks G/R
    0/2
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Guide] How to make a custom C++ npc!

    Well, the guide is not fully completed, but i'll add to it soon to finish it off when I have time.

    Here is a base to start out with:

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    
    class SCRIPT_DECL Warper : public GossipScript
    {
    public:
        void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
        void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
        void GossipEnd(Object * pObject, Player* Plr);
        void Destroy()
        {
            delete this;
        }
    };
    void Warper::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
        {
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                Menu->AddItem(0, "Alliance Cities", 2);
                Menu->AddItem(1, "Horde Cities", 1);
                Menu->AddItem(4, "Azeroth Instances", 30);
                Menu->AddItem(5, "Outland Locations", 3);
                Menu->AddItem(6, "Outland Instances", 50);
                Menu->AddItem(7, "Shattrath", 20);
                Menu->AddItem(8, "Gurubashi Arena", 21);
    
    
            if(AutoSend)
                Menu->SendTo(Plr);
        }
    
    void Warper::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
        {
        Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
        if(pCreature==NULL)
            return;
    
            GossipMenu * Menu;
            switch(IntId)
            {
            case 0:     // Return to start
                    GossipHello(pObject, Plr, true);
                break;
                        
            case 1:     // Horde
                    {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                    Menu->AddItem(5, "Silvermoon", 4);
                    Menu->AddItem(5, "Orgrimmar", 5);
                    Menu->AddItem(5, "Thunderbluff", 6);
                    Menu->AddItem(5, "UnderCity", 7);
                    Menu->AddItem(0, "[Back]", 99);
                    Menu->SendTo(Plr);
                    }
            break;
    
    
            case 2:     // Alliance
                    {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                    Menu->AddItem(5, "The Exodar", 8);
                    Menu->AddItem(5, "Stormwind", 9);
                    Menu->AddItem(5, "Ironforge", 10);
                    Menu->AddItem(5, "Darnassus", 11);
                    Menu->AddItem(0, "[Back]", 99);
                    Menu->SendTo(Plr);
                    }
                break;
    
            case 3:     // Outland
                    {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                    Menu->AddItem(5, "Hellfire Peninsula", 12);
                    Menu->AddItem(5, "Zangermarsh", 13);
                    Menu->AddItem(5, "Nagrand", 14);
                    Menu->AddItem(5, "Blades Edge Mountains", 15);
                    Menu->AddItem(5, "Netherstorm", 16);
                    Menu->AddItem(5, "Terokkar Forest", 17);
                    Menu->AddItem(5, "Shadowmoon Valley", 18);
                    Menu->AddItem(0, "[Back]", 99);
                    Menu->SendTo(Plr);
                    }
                break;
    
                //
                // Horde
                //
    
            case 4://Silvermoon
                {
                    Plr->EventTeleport(530, 9400.486328, -7278.376953, 14.206780);
    
                }
                break;
    
            case 5://Orgrimmar
                {
                    Plr->EventTeleport(1, 1371.068970, -4370.801758, 26.052483);
                }
                break;
    
            case 6://ThunderBluff
                {
                    Plr->EventTeleport(1, -1304.569946, 205.285004, 68.681396);
                }
                break;
    
            case 7://UnderCity
                {
                    Plr->EventTeleport(0, 2050.203125, 285.650604, 56.994549);
                }
                break;
    
                //
                // Alliance 
                //
    
            case 8: //Exodar
                {
                    Plr->EventTeleport(530, -4072.202393, -12014.337891, -1.277277);
                }
                break;
    
            case 9: //Stormwind
                {
                    Plr->EventTeleport(0, -9100.480469, 406.950745, 92.594185);
                }
                break;
    
            case 10: //Ironforge
                {
                    Plr->EventTeleport(0, -5028.265137, -825.976563, 495.301575);
                }
                break;
    
            case 11: //Darnassus
                {
                    Plr->EventTeleport(1, 9985.907227, 1971.155640, 1326.815674);
                }
                break;
    
                ////////////////
                // Outland Menu
                ////////
    
            case 12: //Hellfire Peninsula
                {
                    Plr->EventTeleport(530, -248.160004, 922.348999, 84.379799);
                }
                break;
    
            case 13: //Zangermarsh
                {
                    Plr->EventTeleport(530, -225.863632, 5405.927246, 22.346397);
                }
                break;
    
            case 14: //Nagrand
                {
                    Plr->EventTeleport(530, -468.232330, 8418.666016, 28.031298);
    
                }
                break;
    
            case 15: //Blades Edge Mountains
                {
                    Plr->EventTeleport(530, 1471.672852, 6828.047852, 107.759239);
    
                }
                break;
    
            case 16: //Netherstorm
                {
                    Plr->EventTeleport(530, 3396.123779, 4182.208008, 137.097992);
    
                }
                break;
    
            case 17: //Terokkar Forest
                {
                    Plr->EventTeleport(530, -1202.426636, 5313.692871, 33.774723);
    
                }
                break;
    
            case 18: //Shadowmoon Valley
                {
                    Plr->EventTeleport(530, -2859.522461, 3182.34773, 10.008426);
    
                }
                break;
    
            case 20: //Shattrath
                 {
                    Plr->EventTeleport(530, -1887.510010, 5359.379883, -12.427300);
    
                 }
                 break;
            case 21: // Gurubsahi Arena
                 {
                    Plr->EventTeleport(0, -13271.959961, 149.105515, 34.464458);
    
                 }
                 break;
               
            case 30: // Azeroth Instances 
                    {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                    Menu->AddItem(5, "Shadowfang Keep", 31);
                            Menu->AddItem(5, "Scarlet Monastery", 32);
                    Menu->AddItem(5, "Zul'Farrak", 33);
                    Menu->AddItem(5, "Stratholme", 41);
                            Menu->AddItem(5, "Scholomance", 40);
                    Menu->AddItem(5, "Blackrock Spire", 42);
                    Menu->AddItem(5, "Onyxia's Lair", 38);
                    Menu->AddItem(5, "Molten Core", 37);
                    Menu->AddItem(5, "Zul'Gurub", 34);
                    Menu->AddItem(5, "Karazhan", 43);
                    Menu->AddItem(5, "Ahn'Qirai 20", 35);
                            Menu->AddItem(5, "Ahn'Qirai 40", 36);
                            Menu->AddItem(5, "Naxxramas", 39);
                    Menu->AddItem(5, "Caverns of Times", 44);
                            Menu->AddItem(0, "[Back]", 99);
                            Menu->SendTo(Plr);
                    }
                    break;
    
            case 31: // Shadowfang Keep
                 {
                                 Plr->EventTeleport(0, -234.495087, 1561.946411, 76.892143);
                 }
                 break;
            case 32: // Scarlet Monastery
                 {
                                 Plr->EventTeleport(0, 2870.442627, -819.985229, 160.331085);
                 }
                 break;
            case 33: // Zul'Farrak
                 {
                                 Plr->EventTeleport(1, -6797.278809, -2903.917969, 9.953360);
                 }
                 break;
            case 34: // Zul'Gurub
                 {
                                 Plr->EventTeleport(0, -11919.073242, -1202.459374, 92.298744);
                 }
                 break;
            case 35: // Ahn'Qirai 20
                 {
                                 Plr->EventTeleport(1, -8394.730469, 1485.658447, 21.038563);
                 }
                 break;
            case 36: // Ahn'Qirai 40
                 {
                                 Plr->EventTeleport(1, -8247.316406, 1970.156860, 129.071472);
                }
                 break;
            case 37: // Molten Core
                 {
                  // Plr->EventTeleport(0, -7515.409668, -1045.369629, 182.301208);
                  Plr->EventTeleport(409, 1089.6, -470.19, -106.41);
                 }
                 break;
            case 38: // Onyxia
                     {
                         // Plr->EventTeleport(1, -4708.491699, -3727.672363, 54.535076);
                         Plr->EventTeleport(249, 30.0, -64.0, -5.0);
                     }
                     break;
            case 39: // Naxxramas
                     {
                         // Plr->EventTeleport(0, 3132.915283, -3731.012939, 138.658371);
                         Plr->EventTeleport(533, 3006.06, -3436.72, 293.891);
                     }
                     break;
            case 40: //Scholomance
                    { 
                        Plr->EventTeleport(0, 1267.468628, -2556.651367, 94.127983);
                    }
                    break;
            case 41: //Stratholme
                    { 
                        Plr->EventTeleport(0, 3359.111572, -3380.8444238, 144.781860);
                    }break;
                            case 42: // Black ROck Spire
                    { 
                        Plr->EventTeleport(0, -7527.129883, -1224.997437, 285.733002);
                    }break;
                case 43: // Kharazan
                    { 
                        // Plr->EventTeleport(0, -11122.913086, -2014.498779, 47.079350);
                        Plr->EventTeleport(532, -11087.3, -1977.47, 49.6135);
    
                    }break;
                case 44: // Caverns of Times
                    { 
                        Plr->EventTeleport(1, -8519.718750, -4297.542480, -208.441376);
                    }break;
    
    
            case 50: // Outland Instances
                {
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                Menu->AddItem(0, "Outland Raids", 64);
                Menu->AddItem(5, "Hellfire Ramparts", 51);
                    Menu->AddItem(5, "The Blood Furnace", 52);
                    Menu->AddItem(5, "The Shattered Halls", 53);
                    Menu->AddItem(5, "The Underbog", 54);
                    Menu->AddItem(5, "The Slave Pens", 55);
                    Menu->AddItem(5, "The Steamvault", 56);
                    Menu->AddItem(5, "Mana-Tombs", 57);
                    Menu->AddItem(5, "Auchenai Crypts", 58);
                    Menu->AddItem(5, "Sethekk Halls", 59);
                    Menu->AddItem(5, "Shadow Labyrinth", 60);
                    Menu->AddItem(5, "The Mechanar", 61);
            Menu->AddItem(5, "The Botanica", 62);
            Menu->AddItem(5, "The Arcatraz", 63);
            Menu->AddItem(0, "[Back]", 99);
                    Menu->SendTo(Plr);
                }
                break;
                    
            case 51: // Hellfire Ramparts
                    { 
                        Plr->EventTeleport(530, -360.670990, 3071.899902, -15.097700);
                    }break;
            case 52: // The Blood Furnace
                    { 
                        Plr->EventTeleport(530, -303.506012, 3164.820068, 31.742500);
                    }break;
            case 53: // The Shattered Halls
                    { 
                        Plr->EventTeleport(530, -311.083527, 3083.291748, -3.745923);
                    }break;
            case 54: // The Underbog
                    { 
                        Plr->EventTeleport(530, 777.088989, 6763.450195, -72.062561);
                    }break;
            case 55: // The Slave Pens
                    { 
                        Plr->EventTeleport(530, 719.507996, 6999.339844, -73.074303);
                    }break;
            case 56: // The Steamvault
                    { 
                        Plr->EventTeleport(530, 816.590027, 6934.669922, -80.544601);
                    }break;
            case 57: // Mana-Tombs
                    { 
                        Plr->EventTeleport(530, -3079.810059, 4943.040039, -101.046997);
                    }break;
            case 58: // Auchenai Crypts
                    { 
                        Plr->EventTeleport(530, -3361.959961, 5225.770020, -101.047997);
                    }break;
            case 59: // Sethekk Halls
                    { 
                        Plr->EventTeleport(530, -3362.219971, 4660.410156, -101.049004 );
                    }break;
            case 60: // Shadow Labyrinth
                    { 
                        Plr->EventTeleport(530, -3645.060059, 4943.620117, -101.047997);
                    }break;
            case 61: // The Mechanar
                    { 
                        Plr->EventTeleport(530, 2862.409912, 1546.089966, 252.158691);
                    }break;
            case 62: // The Botanica
                    { 
                        Plr->EventTeleport(530, 3413.649902, 1483.319946, 182.837997);
                    }break;
            case 63: // The Arcatraz
                    { 
                        Plr->EventTeleport(530, 3311.598145, 1332.745117, 505.557251);
                    }break;
    
    
            case 64: // Outland Raids
                    {
                    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                    Menu->AddItem(5, "Magtheridon's Lair", 65);
                    Menu->AddItem(5, "Serpentshrine Cavern", 66);
                    Menu->AddItem(5, "Gruul's Lair", 67);
                    Menu->AddItem(5, "The Eye", 68);
                    Menu->AddItem(5, "Black Temple", 69);
                    Menu->AddItem(0, "[Back]", 99);
                    Menu->SendTo(Plr);
                    }
                    break;
    
            case 65: // Magtheridon's Lair
                    {
                        Plr->EventTeleport(530, -313.678986, 3088.350098, -116.501999);
                    }break;
            case 66: // Serpentshrine Cavern
                    { 
                        Plr->EventTeleport(530, 830.542908, 6865.445801, -63.785503);
                    }break;
            case 67: // Gruul's Lair
                    { 
                        Plr->EventTeleport(530, 3549.424072, 5179.854004, -4.430779);
                    }break;
            case 68: // The Eye
                    { 
                        Plr->EventTeleport(530, 3087.310059, 1373.790039, 184.643005);
                    }break;
            case 69: // Black Temple
                    {
                        // Plr->EventTeleport(530, -3609.739990, 328.252014, 37.307701 );
                        Plr->EventTeleport(564, 97.0894, 1001.96, -86.8798 );
                    }break;
                    
                    
                    
            case 99: //main menu
                {
                objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
                Menu->AddItem(1, "Horde Cities", 1);
                Menu->AddItem(2, "The Shopping Mall", 82);
                Menu->AddItem(3, "Leveling Areas", 80);
                Menu->AddItem(4, "Azeroth Instances", 30);
                Menu->AddItem(5, "Outland Locations", 3);
                Menu->AddItem(6, "Outland Instances", 50);
                Menu->AddItem(7, "Shattrath", 20);
                Menu->AddItem(8, "Gurubashi Arena", 21);
                Menu->SendTo(Plr);
                }
                break;
                
                
     }
        }
    
    void Warper::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupWarper(ScriptMgr * mgr)
    {
        GossipScript * gs = (GossipScript*) new Warper();
        /* Teleporter List */
        mgr->register_gossip_script(123456, gs);
    }
    Now this may be a lot to take in, but let me break it down for you:

    Code:
                Menu->AddItem(0, "Alliance Cities", 2);
                Menu->AddItem(1, "Horde Cities", 1);
                Menu->AddItem(2, "The Shopping Mall", 82);
                Menu->AddItem(3, "Leveling Areas", 80);
                Menu->AddItem(4, "Azeroth Instances", 30);
                Menu->AddItem(5, "Outland Locations", 3);
                Menu->AddItem(6, "Outland Instances", 50);
                Menu->AddItem(7, "Shattrath", 20);
                Menu->AddItem(8, "Gurubashi Arena", 21);
    
    
            if(AutoSend)
                Menu->SendTo(Plr);
    This is the menu, Menu->AddItem tells it to add an item to a menu. (0, This is the Icon used on the menu, lets just keep it as it is for now. "Alliance Cities", this is what will show up on the menu. 2); this is the case number of the menu, it is what the menu brings you to when you select th item.

    if(AutoSend)
    Menu->SendTo(Plr);

    This is what tells the npc to send the menu to you.

    Remember what i said about case numbers? well, here it is.

    Code:
            case 68: // The Eye
                    { 
                        Plr->EventTeleport(530, 3087.310059, 1373.790039, 184.643005);
                    }break;
    case 68 is the case number you select from the menu, // The Eye is just something you can put there if you want for reference.
    Plr->EventTeleport(530, 3087.310059, 1373.790039, 184.643005);
    Plr->EventTeleport tells the npc where to teleport you
    (530, 3087.310059, 1373.790039, 184.643005); is the location. (Mapid, x, y, z);

    Well, here is the fun part, adding items to the menu.
    Lets say you want to add something to the menu that removes ressurection sickness, well, you would add a new menu item and add a new case. You need to make sure the case is not in use.

    Menu->AddItem(8, "Remove Rez sickness", 9;
    You would need to add this to the top menu and the bottom. Then, you would add a case to it.

    case 98: // Remove res sickness
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    Plr->addSpell(15007); // learn res sickness
    Plr->removeSpell(15007,0,0,0); // un learn res sickness
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "We have removed your Resurrection Sickness." );
    Menu->AddItem(0, "[Back]", 99);
    Menu->SendTo(Plr);
    }
    break;

    To prevent crashes it would add the spell to you then remove it. If you accidentally click on remove rez sickness and you dont have it, it would crash.
    Plr->addSpell(15007); Learn rez sickness
    Plr->removeSpell(15007,0,0,0); unlearn it
    Code:
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "We have removed your Resurrection Sickness." );
    pCreature->SendChatMessage tells the npc to send a chat message
    (CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL is the language, universal says it in all languages.
    "We have removed your Resurrection Sickness." ); What it says to you after it does the item.

    And there you go, you added it to the npc!

    Here are some more C++ items, i'll add to this guide one by one when i have the time.

    Code:
    /////////////////
    //    CHAT    //
    ///////////////
       void SendChatMessage(uint8 type, uint32 lang, const char *msg);
       void SendChatMessageAlternateEntry(uint32 entry, uint8 type, uint32 lang, const char * msg);
       void RegisterPeriodicChatMessage(uint32 delay, uint32 msgid, std::string message, bool sendnotify);
       void DelayedChatMessage(uint32 delay, uint32 msgid, std::string message, bool sendnotify);
       void SendNotifyToNearby(uint32 msgid);
       void SendNotifyToNearbyCreature(uint32 msgid, uint32 entryid);
    /////////////////
    // CAST-SPELL //
    ///////////////
       void CastSpell(Unit* Target, uint32 SpellID, bool triggered);
       void CastSpell(Unit* Target, SpellEntry* Sp, bool triggered);
       void CastSpell(uint64 targetGuid, uint32 SpellID, bool triggered);
       void CastSpell(uint64 targetGuid, SpellEntry* Sp, bool triggered);
       void CastSpellAoF(float x,float y,float z,SpellEntry* Sp, bool triggered);
       void EventCastSpell(Unit * Target, SpellEntry * Sp);
       bool isCasting();
       bool IsInInstance();
           void CalculateResistanceReduction(Unit *pVictim,dealdamage *dmg) ;
       void RegenerateHealth();
       void RegeneratePower(bool isinterrupted);
       inline void setHRegenTimer(uint32 time) {m_H_regenTimer = time; }
       inline void setPRegenTimer(uint32 time) {m_P_regenTimer = time; }
       inline void setPIRegenTimer(uint32 time) {m_P_I_regenTimer = time; }
       void DeMorph();
       uint32 ManaShieldAbsorb(uint32 dmg);
       void smsg_AttackStart(Unit* pVictim);
       void smsg_AttackStop(Unit* pVictim);
       void smsg_AttackStop(uint64 victimGuid);
       bool IsDazed();
       float spellcritperc;
    ////////////////
    //  COMBAT   //
    //////////////
       inline int GetHealthPct() { return (int)(GetUInt32Value(UNIT_FIELD_HEALTH) * 100 / GetUInt32Value(UNIT_FIELD_MAXHEALTH)); };
       inline int GetManaPct() { return (int)(GetUInt32Value(UNIT_FIELD_POWER1) * 100 / GetUInt32Value(UNIT_FIELD_MAXPOWER1)); };
       void AddAttackTarget(const uint64& guid);            // this means we clicked attack, not actually striked yet, so they shouldnt be in combat.
       void ClearPrimaryAttackTarget();               // means we deselected the unit, stopped attacking it.
       void OnDamageDealt(Unit * pTarget);               // this is what puts the other person in combat.
       void WeHealed(Unit * pHealTarget);               // called when a player heals another player, regardless of combat state.
       void RemoveAttacker(Unit * pAttacker, const uint64& guid);      // this means we stopped attacking them totally. could be because of deagro, etc.
       void RemoveAttackTarget(Unit * pTarget);            // means our DoT expired.
       void UpdateFlag();                     // detects if we have changed combat state (in/out), and applies the flag.
       inline bool IsInCombat() { return m_lastStatus; }         // checks if we are in combat or not.
       void OnRemoveFromWorld();                  // called when we are removed from world, kills all references to us.
    ////////////////
    //  STEALTH  //
    //////////////
       inline int32 GetStealthLevel() { return m_stealthLevel; }
       inline int32 GetStealthDetectBonus() { return m_stealthDetectBonus; }
       inline void SetStealth(uint32 id) { m_stealth = id; }
       inline bool IsStealth() { return (m_stealth!=0 ? true : false); }
       float detectRange;
    //////////////////
    //INVISIBILITY //
    ////////////////
       bool m_invisible;
       uint8 m_invisFlag;
       int32 m_invisDetect[INVIS_FLAG_TOTAL];
       bool HasAura(uint32 visualid);//not spell id!!!
       bool HasActiveAura(uint32 spelllid);
       bool HasActiveAura(uint32 spelllid,uint64);
       void GiveGroupXP(Unit *pVictim, Player *PlayerInGroup);
    /////////////////
    // DEATHSTATE //
    ///////////////
       inline bool isAlive() { return m_deathState == ALIVE; };
       inline bool isDead() { return  m_deathState !=ALIVE; };
       virtual void setDeathState(DeathState s) {
          m_deathState = s;
       };
       DeathState getDeathState() { return m_deathState; }
       void OnDamageTaken();
    ////////////////
    //   EVENT   //
    //////////////
       void Emote (EmoteType emote);
       void EventAddEmote(EmoteType emote, uint32 time);
       void EmoteExpire();
       inline void setEmoteState(uint8 emote) { m_emoteState = emote; };
       inline uint32 GetOldEmote() { return m_oldEmote; }
       void EventSummonPetExpire();
       void EventAurastateExpire(uint32 aurastateflag){RemoveFlag(UNIT_FIELD_AURASTATE,aurastateflag);} //hmm this looks like so not necesary :S
       void EventHealthChangeSinceLastUpdate();
       void SetStandState (uint8 standstate);
    //////////////////
    //  MOVEMENT   //
    ////////////////
       int32 m_speedModifier;
       int32 m_slowdown;
       map< uint32, int32 > speedReductionMap;
       bool GetSpeedDecrease();
       int32 m_mountedspeedModifier;
       int32 m_flyspeedModifier;
       void UpdateSpeed(bool delay = false);
       void EnableFlight(bool delay = false);
       void DisableFlight(bool delay = false);
       void MoveToWaypoint(uint32 wp_id);   
       _unit->GetAIInterface()->StopMovement(18000);
    ///////////////
    //   AURA   //
    /////////////
       void AddAura(Aura *aur);
      //! Remove aura from unit
       bool RemoveAura(Aura *aur);
       bool RemoveAura(uint32 spellId);
       bool RemoveAura(uint32 spellId,uint64 guid);
       bool RemoveAuraByNameHash(uint32 namehash);      //required to remove weaker instances of a spell
       bool RemoveAuraPosByNameHash(uint32 namehash);      //required to remove weaker instances of a spell
       bool RemoveAuraNegByNameHash(uint32 namehash);      //required to remove weaker instances of a spell
       bool RemoveAuras(uint32 * SpellIds);
       void EventRemoveAura(uint32 SpellId)
       {
          RemoveAura(SpellId);
       }
    
      //! Remove all auras
       void RemoveAllAuras();
           void RemoveAllAuraType(uint32 auratype);      //ex:to remove morph spells
       bool RemoveAllAuraByNameHash(uint32 namehash);      //required to remove weaker instances of a spell
       bool RemoveAllPosAuraByNameHash(uint32 namehash);   //required to remove weaker instances of a spell
       bool RemoveAllNegAuraByNameHash(uint32 namehash);   //required to remove weaker instances of a spell
       void RemoveNegativeAuras();
       void RemoveAllAreaAuras();
      // Temporary remove all auras
      // Find auras
       Aura* FindAura(uint32 spellId);
       Aura* FindAura(uint32 spellId, uint64 guid);
       bool SetAurDuration(uint32 spellId,Unit* caster,uint32 duration);
       bool SetAurDuration(uint32 spellId,uint32 duration);
       void DropAurasOnDeath();
       void castSpell(Spell * pSpell);
       void InterruptSpell();
      //Others
       void RemoveAurasByBuffIndexType(uint32 buff_index_type, const uint64 &guid);
       void RemoveAurasByBuffType(uint32 buff_type, const uint64 &guid,uint32 skip);
       bool HasAurasOfBuffType(uint32 buff_type, const uint64 &guid,uint32 skip);
       int    HasAurasWithNameHash(uint32 name_hash);
       bool HasNegativeAuraWithNameHash(uint32 name_hash); //just to reduce search range in some cases
       bool HasNegativeAura(uint32 spell_id); //just to reduce search range in some cases
    
    
    _unit->Despawn(2000, 8000);                  //Despawns the NPC (Time Remove, Time to Respawn)
    _unit->GetAIInterface()->setOutOfCombatRange(200000);         //Sets the Range that the npc needs to reset (Range).
    PLEASE REMEMBER! A simple thanks can mean so much
    CHEAP GOLD ON [US] [ALLIANCE] STORMRAGE & KEL'THUZAD! -https://bit.ly/1nf04nF

    - BERRYMAN13

    [Guide] How to make a custom C++ npc!
  2. #2
    EcHoEs's Avatar lol why u mad
    Reputation
    374
    Join Date
    Sep 2006
    Posts
    1,647
    Thanks G/R
    3/1
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could have added "custom teleporter c++ npc" to topic title
    But anyways, good job


  3. #3
    King Shaun's Avatar Member
    Reputation
    419
    Join Date
    Dec 2007
    Posts
    1,305
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I think this would prove useful. But you haven't explained to people what program you use to put these code snippets in.

    * If You Even Use A Program *

    * +Rep for now, but make it more useful please. *

  4. #4
    berryman13's Avatar Contributor
    Reputation
    251
    Join Date
    Dec 2006
    Posts
    856
    Thanks G/R
    0/2
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as i said, ill go deeper in when i can, but im across the country on my psp.
    PLEASE REMEMBER! A simple thanks can mean so much
    CHEAP GOLD ON [US] [ALLIANCE] STORMRAGE & KEL'THUZAD! -https://bit.ly/1nf04nF

    - BERRYMAN13

Similar Threads

  1. [GUIDE] <<How to make a Custom NPC>> [WITH PICS]
    By sasoritail in forum WoW EMU Guides & Tutorials
    Replies: 42
    Last Post: 04-30-2020, 10:53 AM
  2. [Guide]How to make Custom Class Trainers and Npc.
    By Xcynic in forum WoW EMU Guides & Tutorials
    Replies: 56
    Last Post: 07-28-2009, 02:43 PM
  3. [Guide] How to make custom npcs,quests,etc
    By c0ddingt0n in forum WoW EMU Guides & Tutorials
    Replies: 26
    Last Post: 10-01-2008, 07:01 AM
  4. [guide] How to make a custom instance!
    By ***Munchy*** in forum WoW EMU Guides & Tutorials
    Replies: 10
    Last Post: 06-20-2008, 06:31 AM
  5. [Guide] How To Make A Custom NPC With Pics!
    By Xtinction in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 05-18-2008, 01:30 PM
All times are GMT -5. The time now is 11:23 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search