C++ Gossip Scripting menu

User Tag List

Results 1 to 1 of 1
  1. #1
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C++ Gossip Scripting

    Any reason why this is not working? It's register and the mob is casting the spell, but the gossip menu isn't being sent.

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    class SCRIPT_DECL PortNPC : public GossipScript
    {
    public:
        void Destroy()
        {
            delete(this);
        }
    
        void GossipHello(ObjectPointer pObj, PlayerPointer pPlayer, bool autosend)
        {
            uint32 TextID = 820;
            GossipMenu* gm;
    
            pObj->CastSpell((ObjectPointer)pPlayer, 20217, true);
    
            objmgr.CreateGossipMenuForPlayer(&gm, pObj->GetGUID(), TextID, pPlayer);
    
            gm->AddItem(5, "Hi!", 1);
    
            if(autosend)
                gm->SendTo(pPlayer);
        }
    
        void GossipSelectOption(ObjectPointer  pObject, PlayerPointer Plr, uint32 Id, uint32 IntId, const char * Code)
        {
            switch(IntId)
            {
            case 1:
                {
                    Plr->CastSpell(Plr, 20217, true);
                    break;
                }
            default:
                {
                    break;
                }
            }
        }
    };
    
    void SetupPortNPC(ScriptMgr* mgr)
    {
        GossipScript* npc = (GossipScript*)new PortNPC();
        mgr->register_gossip_script(250008, npc);
    }

    C++ Gossip Scripting

Similar Threads

  1. [Lua] Gossip Script
    By LJN in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 07-20-2008, 04:38 AM
  2. Gossip Script is Crashing the Server, what's wrong?
    By guitargod218 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 06-08-2008, 02:24 PM
  3. [share] mini-tut on gossip scripts lua
    By b!atch in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 05-29-2008, 05:11 AM
  4. Intergrating my SkillNPC and WarpNPC to gossip scripts?
    By chronic7 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 04-25-2008, 12:11 AM
  5. Gossip scripting guide!
    By Le Froid in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 12-13-2007, 05:06 PM
All times are GMT -5. The time now is 07:46 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