HouseNPC on Arcemu (LInux Compile) error menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    nOeX's Avatar Member
    Reputation
    4
    Join Date
    Oct 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HouseNPC on Arcemu (LInux Compile) error

    Hello,
    i´ve got a problem i found a script witch is very intresting for me the one problem ive got is the only compiling tutorial is for windows ... and visual Studio. Iam using UNIX Debian Etch and did Following settings to compile.

    ==========================================================
    Folder where the script is:
    ==========================================================
    arcemu/trunk/src/scripts/src/WOL


    ==========================================================
    The folder contains: (insides below)
    ==========================================================
    HouseNPC.cpp
    Makefile
    Makefile.am
    Setup.cpp
    Setup.h

    ==========================================================
    HouseNPC.cpp
    ==========================================================
    Code:
     #include "StdAfx.h"
    #include "Setup.h"
     
    #include "mysql/mysql.h"
    #include <stdio.h>
     
    #ifdef WIN32
    #pragma warning(disable:4305)
    #pragma warning(disable:4244)
    #endif
     
    MYSQL *conn;
    MYSQL_RES *res;
    MYSQL_ROW row;
     
    #define server		  "xxx.xxx.xxx.xxx"
    #define user			 "xxxxx"
    #define password	 "xxxxx"
    #define database	 "xxxxx"
     
     
    class SCRIPT_DECL HouseNPC : public GossipScript
    {
    public:
    	#pragma region Hello
    	void GossipHello(Object * pObject, Player* plr, bool AutoSend)
    	{
    		GossipMenu *menu;
    		objmgr.CreateGossipMenuForPlayer(&menu, pObject->GetGUID(), 1, plr);
     
     
    		if(!plr->CombatStatus.IsInCombat())
    		{
    			menu->AddItem(1, "Get a house", 1);
    			menu->AddItem(2, "Teleport to your house", 2);
    		}
    		else
    			plr->BroadcastMessage("You are in combat.");
     
    		if(AutoSend)
    		   menu->SendTo(plr);
    	};
    	#pragma endregion
     
    	#pragma region Selection
    	void GossipSelectOption(Object * pObject, Player* plr, uint32 id, uint32 intId, const char * code)
    	{
    	   switch(intId)
    	   {
    	   case 1: //Get a house
    			{
    				bool haveHouse = false;
     
    				//Init the mysql client
    				conn = mysql_init(NULL);
     
    				//Connect to the database
    				if(!mysql_real_connect(conn, server, user, password, database, 3306, NULL, 0))
    				{
    					sLog.outString("HouseNPC: %s.", mysql_error(conn));
    					return;
    				}
     
    				//Send a query that loads the houses table
    				mysql_query(conn, "SELECT * FROM houses");
     
    				res = mysql_use_result(conn);
    				if(res)
    				{
    					while((row = mysql_fetch_row(res)) != NULL)
    					{
    						//Get guids
    						uint32 plr_guid = plr->GetGUID();
    						uint32 r_guid = atol(row[0]);
     
    						if(r_guid == plr_guid)
    							haveHouse = true; break;
    					}
    				}
    				else
    				{
    					sLog.outString("HouseNPC: %s.", mysql_error(conn));
    					return;
    				}
     
    				if(!haveHouse)
    				{
    					char sql[512];
    					snprintf(sql, 512, "INSERT INTO houses(ownerguid, posX, posY, posZ, mapId) VALUES(%u, 242.284, 0.74529, 1.75938, 598);", plr->GetGUID());
    					mysql_query(conn, sql);
    					plr->BroadcastMessage("You just got a house.");
    				}
    				else
    				{
    					plr->BroadcastMessage("You do alredy have a house.");
    				}
     
    				mysql_free_result(res);
    				mysql_close(conn);
    			}break;
     
    	   case 2: //Teleport to your house
    		   {
    			   bool haveHouse = false;
     
    				//Init the mysql client
    				conn = mysql_init(NULL);
     
    				//Connect to the database
    				if(!mysql_real_connect(conn, server, user, password, database, 3306, NULL, 0))
    				{
    					sLog.outString("HouseNPC: %s.", mysql_error(conn));
    					return;
    				}
     
    				//Send a query that loads the houses table
    				mysql_query(conn, "SELECT * FROM houses");
     
    				res = mysql_use_result(conn);
    				if(res)
    				{
    					while((row = mysql_fetch_row(res)) != NULL)
    					{
    						//Get guids
    						uint32 plr_guid = plr->GetGUID();
    						uint32 r_guid = atol(row[0]);
     
    						if(r_guid == plr_guid)
    						{
    							plr->EventTeleport(atol(row[4]), atol(row[1]), atol(row[2]), atol(row[3]));
    							haveHouse = true;
    							break;
    						}
    					}
    				}
     
    				if(!haveHouse)
    				{
    					plr->BroadcastMessage("You don't have a house.");
    				}
     
    				mysql_free_result(res);
    				mysql_close(conn);
    		   }break;
    	   }
    	};
    	#pragma endregion
     
    	#pragma region Dispose
    	void HouseNPC::GossipEnd(Object * pObject, Player* Plr)
    	{
    		GossipScript::GossipEnd(pObject, Plr);
    	};
     
    	void Destroy()
    	{
    		delete this;
    	};
    	#pragma endregion
    };
     
    void SetupHouseNPC(ScriptMgr * mgr)
    {
    	GossipScript * gs = (GossipScript*) new HouseNPC();
    	mgr->register_gossip_script(160000, gs);
    };
    ==========================================================
    Makefile.am
    ==========================================================
    Code:
    INCLUDES = -I$(top_srcdir)/src/arcemu-logonserver \
       -I$(top_srcdir)/src/arcemu-realmserver -I$(top_srcdir)/src/arcemu-shared -I$(top_srcdir)/src/arcemu-voicechat \
       -I$(top_srcdir)/src/arcemu-world -I$(srcdir) -I$(srcdir)/../../../../dep/include \
       -I$(srcdir)/../../../../dep/src -I$(srcdir)/../../../../src
    
    AM_CXXFLAGS = -DSCRIPTLIB
    
    lib_LTLIBRARIES = libSunGossipScripts.la
    
    libSunGossipScripts_la_SOURCES = \
    HouseNPC.cpp \
    Setup.cpp
    ==========================================================
    Setup.cpp
    ==========================================================
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    #define SKIP_ALLOCATOR_SHARING 1
    #include <scriptSetup.h>
    
    extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
    {
    	return SCRIPT_TYPE_MISC;
    }
    
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
    	SetupHouseNPC(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 SetupHouseNPC(ScriptMgr * mgr);
    
    #endif
    ==========================================================
    Including Dir in Makefile.am:
    ==========================================================
    /arcemu/trunk/src/scripts/src/Makefile.am
    Code:
    SUBDIRS = InstanceScripts WOL GossipScripts ExtraScripts ServerStatusPlugin SpellHandlers LUAScripting QuestScripts EventScripts MiscScripts
    ==========================================================
    Including Script on configure.ac:
    ==========================================================
    /arcemu/trunk/configure.ac
    Code:
    AC_CONFIG_FILES([
       Makefile
       src/Makefile
       src/arcemu-shared/Makefile
       src/arcemu-world/Makefile
       src/arcemu-logonserver/Makefile
       src/arcemu-crashreport/Makefile
       src/scripts/Makefile
       src/scripts/src/Makefile
       src/scripts/src/GossipScripts/Makefile
       src/scripts/src/ExtraScripts/Makefile
       src/scripts/src/MiscScripts/Makefile
       src/scripts/src/InstanceScripts/Makefile
       src/scripts/src/ServerStatusPlugin/Makefile
       src/scripts/src/WOL/Makefile
       src/scripts/src/SpellHandlers/Makefile
       src/scripts/src/LUAScripting/Makefile
       src/scripts/src/QuestScripts/Makefile
       src/scripts/src/EventScripts/Makefile
       src/collision/Makefile
    ])
    ==========================================================
    ==========================================================

    After all of This config includes and after doing following commands on SSH:

    # svn update
    # make clear
    # autoreconf -i -f
    # ./configure prefix=/home/arcemu/trunk --enable-lua-scripting --enable-collision --enable-debug && make -j 4 && make install
    i`ve got this error:

    HouseNPC.cpp:25: warning: ignoring #pragma region Hello
    HouseNPC.cpp:43: warning: ignoring #pragma endregion
    HouseNPC.cpp:45: warning: ignoring #pragma region Selection
    HouseNPC.cpp:147: warning: ignoring #pragma endregion
    HouseNPC.cpp:149: warning: ignoring #pragma region Dispose
    HouseNPC.cpp:159: warning: ignoring #pragma endregion
    HouseNPC.cpp:150: error: extra qualification 'HouseNPC::' on member 'GossipEnd'
    HouseNPC.cpp: In member function 'virtual void HouseNPC::GossipSelectOption(Object*, Player*, uint32, uint32, const char*)':
    HouseNPC.cpp:89: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'long long unsigned int'
    HouseNPC.cpp:89: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'long long unsigned int'
    make[5]: *** [HouseNPC.lo] Error 1
    make[5]: Leaving directory `/home/arcemu/trunk/src/scripts/src/WOL'
    make[4]: *** [all-recursive] Error 1
    make[4]: Leaving directory `/home/arcemu/trunk/src/scripts/src'
    make[3]: *** [all-recursive] Error 1
    make[3]: Leaving directory `/home/arcemu/trunk/src/scripts'
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/home/arcemu/trunk/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/arcemu/trunk
    make: *** [all] Error 2
    So now i hope i was detailed enough that some one can help me thru my problem ;D

    best regards nOeX

    HouseNPC on Arcemu (LInux Compile) error
  2. #2
    Aznex's Avatar Contributor
    Reputation
    128
    Join Date
    Feb 2008
    Posts
    770
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try
    Code:
    void GossipEnd(Object * pObject, Player* Plr)
    instead of
    Code:
    void HouseNPC::GossipEnd(Object * pObject, Player* Plr)
    at line 150

  3. #3
    nOeX's Avatar Member
    Reputation
    4
    Join Date
    Oct 2008
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok seams to work ^^ thanks +rep


    Edit: Soo Compile is complete but the npc have no Funktion at all.... dont know yet why..
    Last edited by nOeX; 02-02-2009 at 01:30 AM.

  4. #4
    Trollin's Avatar Contributor
    Reputation
    204
    Join Date
    Nov 2008
    Posts
    1,093
    Thanks G/R
    0/1
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yay! it worked for me too, ty Aznarx.
    ____________________________________________

    ____________________________________________

  5. #5
    xnerdx's Avatar Member
    Reputation
    2
    Join Date
    Nov 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would say ensure you have the SQL executed into your DB's and also check the flags

Similar Threads

  1. ArcEmu fresh compile error-HELP please-
    By jwhitten87 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 03-19-2013, 01:14 PM
  2. [Linux] Compiling Guide - ArcEmu 3.3 / 3.2
    By f1racer328 in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 01-05-2010, 01:25 PM
  3. How to compile ArcEmu (Linux)
    By f1racer328 in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 01-12-2009, 12:31 PM
  4. [Help] Compiling errors with ArcEmu
    By hackers_best_cs in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 07-26-2008, 08:01 AM
  5. How to get Arcemu to compile with no script errors
    By Sorayazlawl in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 07-17-2008, 08:27 PM
All times are GMT -5. The time now is 10:49 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