how to add a C++ warpnpc? menu

User Tag List

Results 1 to 3 of 3
  1. #1
    ipnetz006's Avatar Active Member
    Reputation
    18
    Join Date
    Jan 2007
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to add a C++ warpnpc?

    Hi I used this WarpNPC generator to create a teleporter and I got three files.

    these are the files:


    setup.ccp

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    extern "C" SCRIPT_DECL uint32 _exp_get_version()
    {
        return MAKE_SCRIPT_VERSION(SCRIPTLIB_VERSION_MAJOR, SCRIPTLIB_VERSION_MINOR);
    }
    
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
        SetupWarpnpc(mgr);
    
    }
    
    #ifdef WIN32
    
    BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
    {
        return TRUE;
    }
    
    #endif
    setup.h

    Code:
    #ifndef INSTANCE_SCRIPTS_SETUP_H
    #define INSTANCE_SCRIPTS_SETUP_H
    
    void SetupWarpNPC(ScriptMgr * mgr);
    
    #endif
    WarpNPC.cpp

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    
    class SCRIPT_DECL WarpNPC : public GossipScript
    {
        public:
        void Destroy()
        {
                delete this;
        }
    
        void GossipHello(Object* pObject, Player * Plr, bool AutoSend)
        {
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
            Menu->AddItem(5,"Teleport random location", 1);
            if(AutoSend)
                Menu->SendTo(Plr);
            }
        void 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 1: //Teleport random location
                {
    
                    //Teleport the player.
                    Plr->EventTeleport( 530, -1960.995361, 5378.362793, -12.428423);
                    Plr->Gossip_Complete();
                }break;
            }
        }
    };
    
    void SetupWarpnpc(ScriptMgr * mgr)
    {
        GossipScript *warp = (Warpnpc*) new WarpNPC();
    
        mgr->register_gossip_script(100000, warp);
    }
    any idea how I can add this? +Rep to whoever gives an working answer
    Last edited by ipnetz006; 06-20-2008 at 11:21 AM.

    how to add a C++ warpnpc?
  2. #2
    Nilrac's Avatar Banned
    Reputation
    360
    Join Date
    Nov 2007
    Posts
    762
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Compile it and place the compiled file into your Scripts_bin.

    Here is a guide

    http://www.mmowned.com/forums/emulat...dll-video.html

  3. #3
    ipnetz006's Avatar Active Member
    Reputation
    18
    Join Date
    Jan 2007
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot. + 2rep

Similar Threads

  1. How to add flying mounts in azeroth!
    By Le Froid in forum WoW EMU Guides & Tutorials
    Replies: 80
    Last Post: 05-18-2008, 05:06 PM
  2. How to Add Premade Leveling Items [Included]
    By Herzeleid in forum WoW EMU Guides & Tutorials
    Replies: 8
    Last Post: 10-30-2007, 03:53 AM
  3. How To: Add Game Objects anywhere, everywhere!
    By CSOM in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 10-03-2007, 06:35 PM
  4. how to add sig or avatar to mmowned
    By Sacrifice in forum Art & Graphic Design
    Replies: 6
    Last Post: 07-21-2007, 04:27 PM
  5. How to add Images?
    By Fault in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 08-17-2006, 05:54 PM
All times are GMT -5. The time now is 09:51 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