ArcEmu: Enhancement - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Read:

When submitting patches - READ: http://arcemu.org/fo...?showtopic=2355 -
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Enhancement store POIs in DB

#1 User is offline   Artox 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 01-November 08

Posted 30 April 2010 - 02:40 PM

Patch Title:
Store Points of Interest in DB
Detailed Explanation: This patch adds a storage for points of interest as well as a method to easily use POIs in scripts.
pPlayer->Gossip_SendPOI(3)
// this would send the POI with id 3 to the player if it exists in the db


UPDATE:
Removed style changes from patch
I am not sure now where best to put the new struct I created though.

SQL Update:
DROP TABLE IF EXISTS `points_of_interest`;
CREATE TABLE `points_of_interest` (
 `entry` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `x` float NOT NULL DEFAULT '0',
 `y` float NOT NULL DEFAULT '0',
 `icon` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `flags` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `data` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `icon_name` text NOT NULL,
 PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Attached File  poi.sql (444bytes)
Number of downloads: 3

patch:
diff --git a/src/arcemu-world/ObjectMgr.h b/src/arcemu-world/ObjectMgr.h
index f2afb10..cd6cdcc 100644
--- a/src/arcemu-world/ObjectMgr.h
+++ b/src/arcemu-world/ObjectMgr.h
@@ -217,6 +217,17 @@ struct InstanceReputationModifier
 	vector<InstanceReputationMod> mods;
 };
 
+struct PointOfInterest
+{
+	uint32 entry;
+	float x;
+	float y;
+	uint32 icon;
+	uint32 flags;
+	uint32 data;
+	const char * icon_name;
+};
+
 enum AREATABLE_FLAGS
 {
 	AREA_CITY_AREA      	= 0x20,
diff --git a/src/arcemu-world/ObjectStorage.cpp b/src/arcemu-world/ObjectStorage.cpp
index 4bb88b4..7e1ce79 100644
--- a/src/arcemu-world/ObjectStorage.cpp
+++ b/src/arcemu-world/ObjectStorage.cpp
@@ -46,6 +46,7 @@ const char* gWorldBroadCastFormat						= "usu"; // announce message
 const char* gBattleMasterFormat						= "uu";
 const char* gSpellClickSpellsFormat					= "uu";
 const char* gTotemDisplayIDsFormat                 	= "uuuu";
+const char *gPointOfInterestFormat					= "uffuuus";
 
 /** SQLStorage symbols
  */
@@ -71,6 +72,7 @@ SERVER_DECL SQLStorage<WorldBroadCast, HashMapStorageContainer<WorldBroadCast> >
 SERVER_DECL SQLStorage<BGMaster, HashMapStorageContainer<BGMaster> >						BGMasterStorage;
 SERVER_DECL SQLStorage< SpellClickSpell, HashMapStorageContainer< SpellClickSpell > >		SpellClickSpellStorage;
 SERVER_DECL SQLStorage< TotemDisplayIdEntry, HashMapStorageContainer< TotemDisplayIdEntry > > TotemDisplayIdStorage;
+SERVER_DECL SQLStorage<PointOfInterest, HashMapStorageContainer<PointOfInterest> >		PointOfInterestStorage;
 
 
 SERVER_DECL set<string> ExtraMapCreatureTables;
@@ -560,6 +562,7 @@ void Storage_FillTaskList(TaskList & tl)
 	make_task(BGMasterStorage, BGMaster, HashMapStorageContainer, "battlemasters", gBattleMasterFormat);
 	make_task(SpellClickSpellStorage, SpellClickSpell, HashMapStorageContainer, "spellclickspells", gSpellClickSpellsFormat);
 	make_task(TotemDisplayIdStorage, TotemDisplayIdEntry, HashMapStorageContainer, "totemdisplayids", gTotemDisplayIDsFormat);
+	make_task(PointOfInterestStorage, PointOfInterest, HashMapStorageContainer, "points_of_interest", gPointOfInterestFormat);
 }
 
 void Storage_Cleanup()
@@ -605,6 +608,7 @@ void Storage_Cleanup()
 	BGMasterStorage.Cleanup();
 	SpellClickSpellStorage.Cleanup();
 	TotemDisplayIdStorage.Cleanup();
+	PointOfInterestStorage.Cleanup();
 }
 
 vector<pair<string, string> > additionalTables;
@@ -653,6 +657,8 @@ bool LoadAdditionalTable(const char* TableName, const char* SecondName, bool fir
 		ZoneGuardStorage.LoadAdditionalData(SecondName, gZoneGuardsFormat);
 	else if(!stricmp(TableName, "unit_display_sizes"))
 		UnitModelSizeStorage.LoadAdditionalData(SecondName, gUnitModelSizeFormat);
+	else if(!stricmp(TableName, "points_of_interest"))
+		PointOfInterestStorage.LoadAdditionalData(SecondName, gPointOfInterestFormat);
 	else
 		return false;
 
@@ -700,6 +706,8 @@ bool Storage_ReloadTable(const char* TableName)
 		CommandTableStorage::getSingleton().Init();
 		CommandTableStorage::getSingleton().Load();
 	}
+	else if(!stricmp(TableName, "points_of_interest"))
+		PointOfInterestStorage.Reload();
 	else
 		return false;
 
diff --git a/src/arcemu-world/ObjectStorage.h b/src/arcemu-world/ObjectStorage.h
index 700ace7..55dc73c 100644
--- a/src/arcemu-world/ObjectStorage.h
+++ b/src/arcemu-world/ObjectStorage.h
@@ -43,6 +43,7 @@ extern SERVER_DECL SQLStorage<WorldBroadCast, HashMapStorageContainer<WorldBroad
 extern SERVER_DECL SQLStorage<BGMaster, HashMapStorageContainer<BGMaster> >						BGMasterStorage;
 extern SERVER_DECL SQLStorage< SpellClickSpell, HashMapStorageContainer< SpellClickSpell > >		SpellClickSpellStorage;
 extern SERVER_DECL SQLStorage< TotemDisplayIdEntry, HashMapStorageContainer< TotemDisplayIdEntry > > TotemDisplayIdStorage;
+extern SERVER_DECL SQLStorage<PointOfInterest, HashMapStorageContainer<PointOfInterest> >		PointOfInterestStorage;
 
 void Storage_FillTaskList(TaskList & tl);
 void Storage_Cleanup();
diff --git a/src/arcemu-world/Player.cpp b/src/arcemu-world/Player.cpp
index 97618c5..eb3d309 100644
--- a/src/arcemu-world/Player.cpp
+++ b/src/arcemu-world/Player.cpp
@@ -13645,4 +13645,11 @@ void Player::AddVehicleComponent( uint32 creature_entry, uint32 vehicleid ){
 void Player::RemoveVehicleComponent(){
 	delete vehicle;
 	vehicle = NULL;
-}
\ No newline at end of file
+}
+
+void Player::Gossip_SendPOI(uint32 id)
+{
+	PointOfInterest *pPOI = PointOfInterestStorage.LookupEntry(id);
+	if(pPOI != NULL)
+		Gossip_SendPOI(pPOI->x, pPOI->y, pPOI->icon, pPOI->flags, pPOI->data, pPOI->icon_name);
+}
diff --git a/src/arcemu-world/Player.h b/src/arcemu-world/Player.h
index 8efb554..041958d 100644
--- a/src/arcemu-world/Player.h
+++ b/src/arcemu-world/Player.h
@@ -2184,6 +2184,7 @@ class SERVER_DECL Player : public Unit
 		void SendWorldStateUpdate(uint32 WorldState, uint32 Value);
 		void SendCastResult(uint32 SpellId, uint8 ErrorMessage, uint8 MultiCast, uint32 Extra);
 		void Gossip_SendPOI(float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char* Name);
+		void Gossip_SendPOI(uint32 id);
 		void SendSpellCooldownEvent(uint32 SpellId);
 		void SendSpellModifier(uint8 spellgroup, uint8 spelltype, int32 v, bool is_pct);
 		void SendItemPushResult(bool created, bool recieved, bool sendtoset, bool newitem,  uint8 destbagslot, uint32 destslot, uint32 count, uint32 entry, uint32 suffix, uint32 randomprop, uint32 stack);
Attached File  poi.patch (5.27K)
Number of downloads: 3
Posted Image
0

#2 User is offline   Dzjhenghiz 

  • حشّاشين
  • Group: Contributor
  • Posts: 1,936
  • Joined: 07-June 08
  • Gender:Male
  • Location:2nd stone after the 3rd oase western sahara
  • Interests:M.C.S.E :- Minesweeper Consultant & Solitaire Expert
  • Server OS:Other

Posted 01 May 2010 - 09:09 PM

Yeah for sure gonna try this xD

thanks artox
Need Help With Arcemu ? ^^
Posted Image
Concordia res parvae crescunt In varietate concordia
Spoiler

0

#3 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 21 August 2011 - 07:07 PM

When submitting a patch please clean it from every unneeded unrelated annoying codestyle layout change so we can focus our attention on your changes. Please submit an updated patch with the mentioned rules. Thank you for your understanding :D
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#4 User is offline   Artox 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 142
  • Joined: 01-November 08

Posted 26 May 2012 - 04:11 PM

View Postjackpoz, on 21 August 2011 - 07:07 PM, said:

When submitting a patch please clean it from every unneeded unrelated annoying codestyle layout change so we can focus our attention on your changes. Please submit an updated patch with the mentioned rules. Thank you for your understanding :D


Thanks Jackpoz for taking a look. I now updated the patch and remvoed the style changes. Also patch is now based on latest arcemu.
Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users