Gossip menu

User Tag List

Thread: Gossip

Results 1 to 6 of 6
  1. #1
    BinaryX's Avatar Corporal
    Reputation
    1
    Join Date
    Sep 2010
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Gossip

    Hi,

    Im trying to access Player::getMPoints(); in my gossip script but it keeps telling me that its not a member of player.

    Declared in player.h:
    Code:
    uint32 getMPoints();
    uint32 mPoints;
    Declared in player.cpp:
    Code:
    uint32 Player::getMPoints() 
    {
       return mPoints;
    }
    Declared in CharacterHandler.cpp:
    Code:
    QueryResult* res;
    	res = CharacterDatabase.Query("SELECT points FROM points WHERE guid='%u'", _player->GetGUID());
    	_player->mPoints = res->Fetch()->GetUInt32();
    	_player->BroadcastMessage("You have a total of %u points.", _player->mPoints);
    Gossip script:
    Code:
        void GossipHello(Object* pObject, Player* plr, bool AutoSend)
        {
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7245, plr);
    		Menu->AddItem( 0, "You have " << plr->getMPoints() << " points.");
    
            if(AutoSend)
                Menu->SendTo(plr);
        }


    ---------- Post added at 10:53 PM ---------- Previous post was at 10:35 PM ----------

    it wont link and create the DLL.
    In visual studio the code shows red, cant include Setup.h, unresolved variable(s) etc (For 1 script only) but i can compile it with no errors.

    Code:
    #include "Setup.h"
    
    class Manager : public GossipScript
    {
    public:
        void GossipHello(Object* pObject, Player* plr, bool AutoSend)
        {
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 7245, plr);
    		Menu->AddItem( 0, "You have points");
    
            if(AutoSend)
                Menu->SendTo(plr);
        }
    
        void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char * Code)
        {
    		GossipMenu * Menu;
    		switch (IntId)
    		{
    			case 0:
    				GossipHello(pObject, plr, true);
    				break;
    		}
    	};
    
    
    void SetupTrainerScript(ScriptMgr * mgr)
    {
    	GossipScript * Managert = new Manager();
        mgr->register_gossip_script(75555, Managert);
    
    
    }
    
    };
    Last edited by BinaryX; 09-18-2010 at 03:46 PM.

    Gossip
  2. #2
    Zymus's Avatar Active Member
    Reputation
    15
    Join Date
    Sep 2009
    Posts
    87
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post the entire output of the error?

  3. #3
    BinaryX's Avatar Corporal
    Reputation
    1
    Join Date
    Sep 2010
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure:
    Code:
    2>  Gossip_XpEliminator.cpp
    2>  Gossip_Manager.cpp
    2>C:\Users\BinaryX\Desktop\Gossip_Manager.cpp(18): warning C4101: 'Menu' : unreferenced local variable
    2>  Generating Code...
    2>     Creating library ..\..\..\bin\release\script_bin\arcGossipScripts.lib and object ..\..\..\bin\release\script_bin\arcGossipScripts.exp
    2>Setup.obj : error LNK2019: unresolved external symbol "void __cdecl SetupManager(class ScriptMgr *)" (?SetupManager@@YAXPAVScriptMgr@@@Z) referenced in function __exp_script_register
    2>../../../bin/release/script_bin/arcGossipScripts.dll : fatal error LNK1120: 1 unresolved externals

  4. #4
    BinaryX's Avatar Corporal
    Reputation
    1
    Join Date
    Sep 2010
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bump ..

  5. #5
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    post your setup.h and setup.cpp
    Lunar Gaming - Reaching For The Stars

  6. #6
    BinaryX's Avatar Corporal
    Reputation
    1
    Join Date
    Sep 2010
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    they are fine, i added all that already so the gossip should work.

    ---------- Post added at 02:59 PM ---------- Previous post was at 01:00 PM ----------



    Why is it underlined? the configuration in the setup.h and setup.cpp are all fine, and if i try to set global scope and click in the document it changes back.
    If i use the code of an existing gossip file and i paste that in the Manager it also shows errors.

    BUT it compiles without errors.

    ---------- Post added at 03:10 PM ---------- Previous post was at 02:59 PM ----------

    Fixed. ...

Similar Threads

  1. LUA: Understanding Gossip Menus
    By SectorSeven in forum WoW EMU Guides & Tutorials
    Replies: 46
    Last Post: 08-16-2008, 09:27 AM
  2. Unit Event Lua Question (Gossip Talk)
    By moongo in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 05-22-2008, 07:49 PM
  3. Guards dont give a gossip?
    By thijsd in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 05-14-2008, 01:27 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 08:42 PM. 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