mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7292] Implement storage for points of interest data in DB.
It can be in current state used for simplify scripting code that set POI and more advansed way later.. Call void PlayerMenu::SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, char const * locName ) will removed after some time delay, and only void PlayerMenu::SendPointOfInterest( uint32 poi_id ) will exist. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
946e4fb036
commit
9b2a772413
14 changed files with 302 additions and 16 deletions
|
|
@ -22,7 +22,7 @@
|
||||||
DROP TABLE IF EXISTS `db_version`;
|
DROP TABLE IF EXISTS `db_version`;
|
||||||
CREATE TABLE `db_version` (
|
CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`required_7290_01_mangos_command` bit(1) default NULL
|
`required_7292_02_mangos_locales_points_of_interest` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -2152,6 +2152,33 @@ LOCK TABLES `locales_page_text` WRITE;
|
||||||
/*!40000 ALTER TABLE `locales_page_text` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `locales_page_text` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `locales_points_of_interest`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `locales_points_of_interest`;
|
||||||
|
CREATE TABLE `locales_points_of_interest` (
|
||||||
|
`entry` mediumint(8) unsigned NOT NULL default '0',
|
||||||
|
`icon_name_loc1` text,
|
||||||
|
`icon_name_loc2` text,
|
||||||
|
`icon_name_loc3` text,
|
||||||
|
`icon_name_loc4` text,
|
||||||
|
`icon_name_loc5` text,
|
||||||
|
`icon_name_loc6` text,
|
||||||
|
`icon_name_loc7` text,
|
||||||
|
`icon_name_loc8` text,
|
||||||
|
PRIMARY KEY (`entry`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `locales_points_of_interest`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `locales_points_of_interest` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `locales_points_of_interest` DISABLE KEYS */;
|
||||||
|
/*!40000 ALTER TABLE `locales_points_of_interest` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `locales_quest`
|
-- Table structure for table `locales_quest`
|
||||||
--
|
--
|
||||||
|
|
@ -12720,6 +12747,31 @@ INSERT INTO `playercreateinfo_spell` VALUES
|
||||||
/*!40000 ALTER TABLE `playercreateinfo_spell` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `playercreateinfo_spell` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `points_of_interest`
|
||||||
|
--
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `points_of_interest`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `points_of_interest` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `points_of_interest` DISABLE KEYS */;
|
||||||
|
/*!40000 ALTER TABLE `points_of_interest` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `prospecting_loot_template`
|
-- Table structure for table `prospecting_loot_template`
|
||||||
--
|
--
|
||||||
|
|
|
||||||
13
sql/updates/7292_01_mangos_points_of_interest.sql
Normal file
13
sql/updates/7292_01_mangos_points_of_interest.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_7290_01_mangos_command required_7292_01_mangos_points_of_interest bit;
|
||||||
|
|
||||||
|
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;
|
||||||
15
sql/updates/7292_02_mangos_locales_points_of_interest.sql
Normal file
15
sql/updates/7292_02_mangos_locales_points_of_interest.sql
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_7292_01_mangos_points_of_interest required_7292_02_mangos_locales_points_of_interest bit;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `locales_points_of_interest`;
|
||||||
|
CREATE TABLE `locales_points_of_interest` (
|
||||||
|
`entry` mediumint(8) unsigned NOT NULL default '0',
|
||||||
|
`icon_name_loc1` text,
|
||||||
|
`icon_name_loc2` text,
|
||||||
|
`icon_name_loc3` text,
|
||||||
|
`icon_name_loc4` text,
|
||||||
|
`icon_name_loc5` text,
|
||||||
|
`icon_name_loc6` text,
|
||||||
|
`icon_name_loc7` text,
|
||||||
|
`icon_name_loc8` text,
|
||||||
|
PRIMARY KEY (`entry`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
@ -177,6 +177,8 @@ pkgdata_DATA = \
|
||||||
7255_01_characters_characters.sql \
|
7255_01_characters_characters.sql \
|
||||||
7267_01_characters_auctionhouse.sql \
|
7267_01_characters_auctionhouse.sql \
|
||||||
7290_01_mangos_command.sql \
|
7290_01_mangos_command.sql \
|
||||||
|
7292_01_mangos_points_of_interest.sql \
|
||||||
|
7292_02_mangos_locales_points_of_interest.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -334,4 +336,6 @@ EXTRA_DIST = \
|
||||||
7255_01_characters_characters.sql \
|
7255_01_characters_characters.sql \
|
||||||
7267_01_characters_auctionhouse.sql \
|
7267_01_characters_auctionhouse.sql \
|
||||||
7290_01_mangos_command.sql \
|
7290_01_mangos_command.sql \
|
||||||
|
7292_01_mangos_points_of_interest.sql \
|
||||||
|
7292_02_mangos_locales_points_of_interest.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,13 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
{ "gameobject_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameObjectScriptsCommand, "", NULL },
|
{ "gameobject_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameObjectScriptsCommand, "", NULL },
|
||||||
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemEnchantementsCommand, "", NULL },
|
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemEnchantementsCommand, "", NULL },
|
||||||
{ "item_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesItemCommand, "", NULL },
|
{ "item_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesItemCommand, "", NULL },
|
||||||
|
{ "locales_creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesCreatureCommand, "", NULL },
|
||||||
|
{ "locales_gameobject", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesGameobjectCommand, "", NULL },
|
||||||
|
{ "locales_item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesItemCommand, "", NULL },
|
||||||
|
{ "locales_npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesNpcTextCommand, "", NULL },
|
||||||
|
{ "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL },
|
||||||
|
{ "locales_points_of_interest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPointsOfInterestCommand, "", NULL },
|
||||||
|
{ "locales_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesQuestCommand, "", NULL },
|
||||||
{ "mangos_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadMangosStringCommand, "", NULL },
|
{ "mangos_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadMangosStringCommand, "", NULL },
|
||||||
{ "milling_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesMillingCommand, "", NULL },
|
{ "milling_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesMillingCommand, "", NULL },
|
||||||
{ "npc_gossip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcGossipCommand, "", NULL },
|
{ "npc_gossip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcGossipCommand, "", NULL },
|
||||||
|
|
@ -289,6 +296,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
{ "npc_vendor", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcVendorCommand, "", NULL },
|
{ "npc_vendor", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcVendorCommand, "", NULL },
|
||||||
{ "page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPageTextsCommand, "", NULL },
|
{ "page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPageTextsCommand, "", NULL },
|
||||||
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesPickpocketingCommand,"",NULL},
|
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesPickpocketingCommand,"",NULL},
|
||||||
|
{ "points_of_interest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPointsOfInterestCommand, "",NULL},
|
||||||
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesProspectingCommand,"", NULL },
|
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesProspectingCommand,"", NULL },
|
||||||
{ "quest_mail_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesQuestMailCommand, "", NULL },
|
{ "quest_mail_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesQuestMailCommand, "", NULL },
|
||||||
{ "quest_end_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestEndScriptsCommand, "", NULL },
|
{ "quest_end_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestEndScriptsCommand, "", NULL },
|
||||||
|
|
@ -312,12 +320,6 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
{ "spell_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellScriptsCommand, "", NULL },
|
{ "spell_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellScriptsCommand, "", NULL },
|
||||||
{ "spell_target_position", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellTargetPositionCommand, "", NULL },
|
{ "spell_target_position", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellTargetPositionCommand, "", NULL },
|
||||||
{ "spell_threats", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellThreatsCommand, "", NULL },
|
{ "spell_threats", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellThreatsCommand, "", NULL },
|
||||||
{ "locales_creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesCreatureCommand, "", NULL },
|
|
||||||
{ "locales_gameobject", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesGameobjectCommand, "", NULL },
|
|
||||||
{ "locales_item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesItemCommand, "", NULL },
|
|
||||||
{ "locales_npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesNpcTextCommand, "", NULL },
|
|
||||||
{ "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL },
|
|
||||||
{ "locales_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesQuestCommand, "", NULL },
|
|
||||||
|
|
||||||
{ NULL, 0, false, NULL, "", NULL }
|
{ NULL, 0, false, NULL, "", NULL }
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,14 @@ class ChatHandler
|
||||||
bool HandleReloadGameTeleCommand(const char* args);
|
bool HandleReloadGameTeleCommand(const char* args);
|
||||||
bool HandleReloadGOQuestRelationsCommand(const char* args);
|
bool HandleReloadGOQuestRelationsCommand(const char* args);
|
||||||
bool HandleReloadGOQuestInvRelationsCommand(const char* args);
|
bool HandleReloadGOQuestInvRelationsCommand(const char* args);
|
||||||
|
bool HandleReloadItemEnchantementsCommand(const char* args);
|
||||||
|
bool HandleReloadLocalesCreatureCommand(const char* args);
|
||||||
|
bool HandleReloadLocalesGameobjectCommand(const char* args);
|
||||||
|
bool HandleReloadLocalesItemCommand(const char* args);
|
||||||
|
bool HandleReloadLocalesNpcTextCommand(const char* args);
|
||||||
|
bool HandleReloadLocalesPageTextCommand(const char* args);
|
||||||
|
bool HandleReloadLocalesPointsOfInterestCommand(const char* args);
|
||||||
|
bool HandleReloadLocalesQuestCommand(const char* args);
|
||||||
bool HandleReloadLootTemplatesCreatureCommand(const char* args);
|
bool HandleReloadLootTemplatesCreatureCommand(const char* args);
|
||||||
bool HandleReloadLootTemplatesDisenchantCommand(const char* args);
|
bool HandleReloadLootTemplatesDisenchantCommand(const char* args);
|
||||||
bool HandleReloadLootTemplatesFishingCommand(const char* args);
|
bool HandleReloadLootTemplatesFishingCommand(const char* args);
|
||||||
|
|
@ -240,6 +248,8 @@ class ChatHandler
|
||||||
bool HandleReloadNpcOptionCommand(const char* args);
|
bool HandleReloadNpcOptionCommand(const char* args);
|
||||||
bool HandleReloadNpcTrainerCommand(const char* args);
|
bool HandleReloadNpcTrainerCommand(const char* args);
|
||||||
bool HandleReloadNpcVendorCommand(const char* args);
|
bool HandleReloadNpcVendorCommand(const char* args);
|
||||||
|
bool HandleReloadPageTextsCommand(const char* args);
|
||||||
|
bool HandleReloadPointsOfInterestCommand(const char* args);
|
||||||
bool HandleReloadQuestAreaTriggersCommand(const char* args);
|
bool HandleReloadQuestAreaTriggersCommand(const char* args);
|
||||||
bool HandleReloadQuestEndScriptsCommand(const char* args);
|
bool HandleReloadQuestEndScriptsCommand(const char* args);
|
||||||
bool HandleReloadQuestStartScriptsCommand(const char* args);
|
bool HandleReloadQuestStartScriptsCommand(const char* args);
|
||||||
|
|
@ -259,14 +269,6 @@ class ChatHandler
|
||||||
bool HandleReloadSpellTargetPositionCommand(const char* args);
|
bool HandleReloadSpellTargetPositionCommand(const char* args);
|
||||||
bool HandleReloadSpellThreatsCommand(const char* args);
|
bool HandleReloadSpellThreatsCommand(const char* args);
|
||||||
bool HandleReloadSpellPetAurasCommand(const char* args);
|
bool HandleReloadSpellPetAurasCommand(const char* args);
|
||||||
bool HandleReloadPageTextsCommand(const char* args);
|
|
||||||
bool HandleReloadItemEnchantementsCommand(const char* args);
|
|
||||||
bool HandleReloadLocalesCreatureCommand(const char* args);
|
|
||||||
bool HandleReloadLocalesGameobjectCommand(const char* args);
|
|
||||||
bool HandleReloadLocalesItemCommand(const char* args);
|
|
||||||
bool HandleReloadLocalesNpcTextCommand(const char* args);
|
|
||||||
bool HandleReloadLocalesPageTextCommand(const char* args);
|
|
||||||
bool HandleReloadLocalesQuestCommand(const char* args);
|
|
||||||
|
|
||||||
bool HandleInstanceListBindsCommand(const char* args);
|
bool HandleInstanceListBindsCommand(const char* args);
|
||||||
bool HandleInstanceUnbindCommand(const char* args);
|
bool HandleInstanceUnbindCommand(const char* args);
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,11 @@ struct NpcOptionLocale
|
||||||
std::vector<std::string> BoxText;
|
std::vector<std::string> BoxText;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct PointOfInterestLocale
|
||||||
|
{
|
||||||
|
std::vector<std::string> IconName;
|
||||||
|
};
|
||||||
|
|
||||||
struct EquipmentInfo
|
struct EquipmentInfo
|
||||||
{
|
{
|
||||||
uint32 entry;
|
uint32 entry;
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,7 @@ void PlayerMenu::CloseGossip()
|
||||||
//sLog.outDebug( "WORLD: Sent SMSG_GOSSIP_COMPLETE" );
|
//sLog.outDebug( "WORLD: Sent SMSG_GOSSIP_COMPLETE" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Outdated
|
||||||
void PlayerMenu::SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, char const * locName )
|
void PlayerMenu::SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, char const * locName )
|
||||||
{
|
{
|
||||||
WorldPacket data( SMSG_GOSSIP_POI, (4+4+4+4+4+10) ); // guess size
|
WorldPacket data( SMSG_GOSSIP_POI, (4+4+4+4+4+10) ); // guess size
|
||||||
|
|
@ -192,6 +193,40 @@ void PlayerMenu::SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flag
|
||||||
//sLog.outDebug("WORLD: Sent SMSG_GOSSIP_POI");
|
//sLog.outDebug("WORLD: Sent SMSG_GOSSIP_POI");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PlayerMenu::SendPointOfInterest( uint32 poi_id )
|
||||||
|
{
|
||||||
|
PointOfInterest const* poi = objmgr.GetPointOfInterest(poi_id);
|
||||||
|
if(!poi)
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Requested send not existed POI (Id: %u), ignore.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string icon_name = poi->icon_name;
|
||||||
|
|
||||||
|
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||||
|
if (loc_idx >= 0)
|
||||||
|
{
|
||||||
|
PointOfInterestLocale const *pl = objmgr.GetPointOfInterestLocale(poi_id);
|
||||||
|
if (pl)
|
||||||
|
{
|
||||||
|
if (pl->IconName.size() > size_t(loc_idx) && !pl->IconName[loc_idx].empty())
|
||||||
|
icon_name = pl->IconName[loc_idx];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldPacket data( SMSG_GOSSIP_POI, (4+4+4+4+4+10) ); // guess size
|
||||||
|
data << uint32(poi->flags);
|
||||||
|
data << float(poi->x);
|
||||||
|
data << float(poi->y);
|
||||||
|
data << uint32(poi->icon);
|
||||||
|
data << uint32(poi->data);
|
||||||
|
data << icon_name;
|
||||||
|
|
||||||
|
pSession->SendPacket( &data );
|
||||||
|
//sLog.outDebug("WORLD: Sent SMSG_GOSSIP_POI");
|
||||||
|
}
|
||||||
|
|
||||||
void PlayerMenu::SendTalking( uint32 textID )
|
void PlayerMenu::SendTalking( uint32 textID )
|
||||||
{
|
{
|
||||||
GossipText const* pGossip = objmgr.GetGossipText(textID);
|
GossipText const* pGossip = objmgr.GetGossipText(textID);
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,7 @@ class MANGOS_DLL_SPEC PlayerMenu
|
||||||
void SendGossipMenu( uint32 TitleTextId, uint64 npcGUID );
|
void SendGossipMenu( uint32 TitleTextId, uint64 npcGUID );
|
||||||
void CloseGossip();
|
void CloseGossip();
|
||||||
void SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName );
|
void SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, const char * locName );
|
||||||
|
void SendPointOfInterest( uint32 poi_id );
|
||||||
void SendTalking( uint32 textID );
|
void SendTalking( uint32 textID );
|
||||||
void SendTalking( char const * title, char const * text );
|
void SendTalking( char const * title, char const * text );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ bool ChatHandler::HandleReloadAllNpcCommand(const char* /*args*/)
|
||||||
HandleReloadNpcOptionCommand("a");
|
HandleReloadNpcOptionCommand("a");
|
||||||
HandleReloadNpcTrainerCommand("a");
|
HandleReloadNpcTrainerCommand("a");
|
||||||
HandleReloadNpcVendorCommand("a");
|
HandleReloadNpcVendorCommand("a");
|
||||||
|
HandleReloadPointsOfInterestCommand("a");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -159,6 +160,7 @@ bool ChatHandler::HandleReloadAllLocalesCommand(const char* /*args*/)
|
||||||
HandleReloadLocalesItemCommand("a");
|
HandleReloadLocalesItemCommand("a");
|
||||||
HandleReloadLocalesNpcTextCommand("a");
|
HandleReloadLocalesNpcTextCommand("a");
|
||||||
HandleReloadLocalesPageTextCommand("a");
|
HandleReloadLocalesPageTextCommand("a");
|
||||||
|
HandleReloadLocalesPointsOfInterestCommand("a");
|
||||||
HandleReloadLocalesQuestCommand("a");
|
HandleReloadLocalesQuestCommand("a");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -394,6 +396,14 @@ bool ChatHandler::HandleReloadNpcVendorCommand(const char*)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatHandler::HandleReloadPointsOfInterestCommand(const char*)
|
||||||
|
{
|
||||||
|
sLog.outString( "Re-Loading `points_of_interest` Table!" );
|
||||||
|
objmgr.LoadPointsOfInterest();
|
||||||
|
SendGlobalSysMessage("DB table `points_of_interest` reloaded.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ChatHandler::HandleReloadReservedNameCommand(const char*)
|
bool ChatHandler::HandleReloadReservedNameCommand(const char*)
|
||||||
{
|
{
|
||||||
sLog.outString( "Loading ReservedNames... (`reserved_name`)" );
|
sLog.outString( "Loading ReservedNames... (`reserved_name`)" );
|
||||||
|
|
@ -692,6 +702,14 @@ bool ChatHandler::HandleReloadLocalesPageTextCommand(const char* /*arg*/)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatHandler::HandleReloadLocalesPointsOfInterestCommand(const char* /*arg*/)
|
||||||
|
{
|
||||||
|
sLog.outString( "Re-Loading Locales Points Of Interest ... ");
|
||||||
|
objmgr.LoadPointOfInterestLocales();
|
||||||
|
SendGlobalSysMessage("DB table `locales_points_of_interest` reloaded.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
|
bool ChatHandler::HandleReloadLocalesQuestCommand(const char* /*arg*/)
|
||||||
{
|
{
|
||||||
sLog.outString( "Re-Loading Locales Quest ... ");
|
sLog.outString( "Re-Loading Locales Quest ... ");
|
||||||
|
|
|
||||||
|
|
@ -395,6 +395,57 @@ void ObjectMgr::LoadNpcOptionLocales()
|
||||||
sLog.outString( ">> Loaded %u npc_option locale strings", mNpcOptionLocaleMap.size() );
|
sLog.outString( ">> Loaded %u npc_option locale strings", mNpcOptionLocaleMap.size() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectMgr::LoadPointOfInterestLocales()
|
||||||
|
{
|
||||||
|
mPointOfInterestLocaleMap.clear(); // need for reload case
|
||||||
|
|
||||||
|
QueryResult *result = WorldDatabase.Query("SELECT entry,icon_name_loc1,icon_name_loc2,icon_name_loc3,icon_name_loc4,icon_name_loc5,icon_name_loc6,icon_name_loc7,icon_name_loc8 FROM locales_points_of_interest");
|
||||||
|
|
||||||
|
if(!result)
|
||||||
|
{
|
||||||
|
barGoLink bar(1);
|
||||||
|
|
||||||
|
bar.step();
|
||||||
|
|
||||||
|
sLog.outString("");
|
||||||
|
sLog.outString(">> Loaded 0 points_of_interest locale strings. DB table `locales_points_of_interest` is empty.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
barGoLink bar(result->GetRowCount());
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Field *fields = result->Fetch();
|
||||||
|
bar.step();
|
||||||
|
|
||||||
|
uint32 entry = fields[0].GetUInt32();
|
||||||
|
|
||||||
|
PointOfInterestLocale& data = mPointOfInterestLocaleMap[entry];
|
||||||
|
|
||||||
|
for(int i = 1; i < MAX_LOCALE; ++i)
|
||||||
|
{
|
||||||
|
std::string str = fields[i].GetCppString();
|
||||||
|
if(str.empty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
int idx = GetOrNewIndexForLocale(LocaleConstant(i));
|
||||||
|
if(idx >= 0)
|
||||||
|
{
|
||||||
|
if(data.IconName.size() <= idx)
|
||||||
|
data.IconName.resize(idx+1);
|
||||||
|
|
||||||
|
data.IconName[idx] = str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (result->NextRow());
|
||||||
|
|
||||||
|
delete result;
|
||||||
|
|
||||||
|
sLog.outString();
|
||||||
|
sLog.outString( ">> Loaded %u points_of_interest locale strings", mPointOfInterestLocaleMap.size() );
|
||||||
|
}
|
||||||
|
|
||||||
struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
|
struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
|
||||||
{
|
{
|
||||||
template<class D>
|
template<class D>
|
||||||
|
|
@ -5715,6 +5766,58 @@ void ObjectMgr::LoadReputationOnKill()
|
||||||
sLog.outString(">> Loaded %u creature award reputation definitions", count);
|
sLog.outString(">> Loaded %u creature award reputation definitions", count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectMgr::LoadPointsOfInterest()
|
||||||
|
{
|
||||||
|
uint32 count = 0;
|
||||||
|
|
||||||
|
// 0 1 2 3 4 5
|
||||||
|
QueryResult *result = WorldDatabase.Query("SELECT entry, x, y, icon, flags, data, icon_name FROM points_of_interest");
|
||||||
|
|
||||||
|
if(!result)
|
||||||
|
{
|
||||||
|
barGoLink bar(1);
|
||||||
|
|
||||||
|
bar.step();
|
||||||
|
|
||||||
|
sLog.outString();
|
||||||
|
sLog.outErrorDb(">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
barGoLink bar(result->GetRowCount());
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Field *fields = result->Fetch();
|
||||||
|
bar.step();
|
||||||
|
|
||||||
|
uint32 point_id = fields[0].GetUInt32();
|
||||||
|
|
||||||
|
PointOfInterest POI;
|
||||||
|
POI.x = fields[1].GetFloat();
|
||||||
|
POI.y = fields[2].GetFloat();
|
||||||
|
POI.icon = fields[3].GetUInt32();
|
||||||
|
POI.flags = fields[4].GetUInt32();
|
||||||
|
POI.data = fields[5].GetUInt32();
|
||||||
|
POI.icon_name = fields[6].GetCppString();
|
||||||
|
|
||||||
|
if(!MaNGOS::IsValidMapCoord(POI.x,POI.y))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.",point_id,POI.x,POI.y);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
mPointsOfInterest[point_id] = POI;
|
||||||
|
|
||||||
|
++count;
|
||||||
|
} while (result->NextRow());
|
||||||
|
|
||||||
|
delete result;
|
||||||
|
|
||||||
|
sLog.outString();
|
||||||
|
sLog.outString(">> Loaded %u Points of Interest definitions", count);
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectMgr::LoadWeatherZoneChances()
|
void ObjectMgr::LoadWeatherZoneChances()
|
||||||
{
|
{
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,7 @@ typedef UNORDERED_MAP<uint32,NpcTextLocale> NpcTextLocaleMap;
|
||||||
typedef UNORDERED_MAP<uint32,PageTextLocale> PageTextLocaleMap;
|
typedef UNORDERED_MAP<uint32,PageTextLocale> PageTextLocaleMap;
|
||||||
typedef UNORDERED_MAP<uint32,MangosStringLocale> MangosStringLocaleMap;
|
typedef UNORDERED_MAP<uint32,MangosStringLocale> MangosStringLocaleMap;
|
||||||
typedef UNORDERED_MAP<uint32,NpcOptionLocale> NpcOptionLocaleMap;
|
typedef UNORDERED_MAP<uint32,NpcOptionLocale> NpcOptionLocaleMap;
|
||||||
|
typedef UNORDERED_MAP<uint32,PointOfInterestLocale> PointOfInterestLocaleMap;
|
||||||
|
|
||||||
typedef std::multimap<uint32,uint32> QuestRelations;
|
typedef std::multimap<uint32,uint32> QuestRelations;
|
||||||
|
|
||||||
|
|
@ -172,6 +173,17 @@ struct ReputationOnKillEntry
|
||||||
bool team_dependent;
|
bool team_dependent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct PointOfInterest
|
||||||
|
{
|
||||||
|
uint32 entry;
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
uint32 icon;
|
||||||
|
uint32 flags;
|
||||||
|
uint32 data;
|
||||||
|
std::string icon_name;
|
||||||
|
};
|
||||||
|
|
||||||
struct PetCreateSpellEntry
|
struct PetCreateSpellEntry
|
||||||
{
|
{
|
||||||
uint32 spellid[4];
|
uint32 spellid[4];
|
||||||
|
|
@ -292,6 +304,7 @@ class ObjectMgr
|
||||||
typedef UNORDERED_MAP<uint32, uint32> AreaTriggerScriptMap;
|
typedef UNORDERED_MAP<uint32, uint32> AreaTriggerScriptMap;
|
||||||
|
|
||||||
typedef UNORDERED_MAP<uint32, ReputationOnKillEntry> RepOnKillMap;
|
typedef UNORDERED_MAP<uint32, ReputationOnKillEntry> RepOnKillMap;
|
||||||
|
typedef UNORDERED_MAP<uint32, PointOfInterest> PointOfInterestMap;
|
||||||
|
|
||||||
typedef UNORDERED_MAP<uint32, WeatherZoneChances> WeatherZoneMap;
|
typedef UNORDERED_MAP<uint32, WeatherZoneChances> WeatherZoneMap;
|
||||||
|
|
||||||
|
|
@ -431,6 +444,14 @@ class ObjectMgr
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PointOfInterest const* GetPointOfInterest(uint32 id) const
|
||||||
|
{
|
||||||
|
PointOfInterestMap::const_iterator itr = mPointsOfInterest.find(id);
|
||||||
|
if(itr != mPointsOfInterest.end())
|
||||||
|
return &itr->second;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
PetCreateSpellEntry const* GetPetCreateSpellEntry(uint32 id) const
|
PetCreateSpellEntry const* GetPetCreateSpellEntry(uint32 id) const
|
||||||
{
|
{
|
||||||
PetCreateSpellMap::const_iterator itr = mPetCreateSpell.find(id);
|
PetCreateSpellMap::const_iterator itr = mPetCreateSpell.find(id);
|
||||||
|
|
@ -486,6 +507,7 @@ class ObjectMgr
|
||||||
void LoadNpcTextLocales();
|
void LoadNpcTextLocales();
|
||||||
void LoadPageTextLocales();
|
void LoadPageTextLocales();
|
||||||
void LoadNpcOptionLocales();
|
void LoadNpcOptionLocales();
|
||||||
|
void LoadPointOfInterestLocales();
|
||||||
void LoadInstanceTemplate();
|
void LoadInstanceTemplate();
|
||||||
|
|
||||||
void LoadGossipText();
|
void LoadGossipText();
|
||||||
|
|
@ -508,6 +530,7 @@ class ObjectMgr
|
||||||
void LoadFishingBaseSkillLevel();
|
void LoadFishingBaseSkillLevel();
|
||||||
|
|
||||||
void LoadReputationOnKill();
|
void LoadReputationOnKill();
|
||||||
|
void LoadPointsOfInterest();
|
||||||
|
|
||||||
void LoadWeatherZoneChances();
|
void LoadWeatherZoneChances();
|
||||||
void LoadGameTele();
|
void LoadGameTele();
|
||||||
|
|
@ -615,6 +638,12 @@ class ObjectMgr
|
||||||
if(itr==mNpcOptionLocaleMap.end()) return NULL;
|
if(itr==mNpcOptionLocaleMap.end()) return NULL;
|
||||||
return &itr->second;
|
return &itr->second;
|
||||||
}
|
}
|
||||||
|
PointOfInterestLocale const* GetPointOfInterestLocale(uint32 poi_id) const
|
||||||
|
{
|
||||||
|
PointOfInterestLocaleMap::const_iterator itr = mPointOfInterestLocaleMap.find(poi_id);
|
||||||
|
if(itr==mPointOfInterestLocaleMap.end()) return NULL;
|
||||||
|
return &itr->second;
|
||||||
|
}
|
||||||
|
|
||||||
GameObjectData const* GetGOData(uint32 guid) const
|
GameObjectData const* GetGOData(uint32 guid) const
|
||||||
{
|
{
|
||||||
|
|
@ -768,6 +797,8 @@ class ObjectMgr
|
||||||
|
|
||||||
RepOnKillMap mRepOnKill;
|
RepOnKillMap mRepOnKill;
|
||||||
|
|
||||||
|
PointOfInterestMap mPointsOfInterest;
|
||||||
|
|
||||||
WeatherZoneMap mWeatherZoneMap;
|
WeatherZoneMap mWeatherZoneMap;
|
||||||
|
|
||||||
PetCreateSpellMap mPetCreateSpell;
|
PetCreateSpellMap mPetCreateSpell;
|
||||||
|
|
@ -826,6 +857,7 @@ class ObjectMgr
|
||||||
PageTextLocaleMap mPageTextLocaleMap;
|
PageTextLocaleMap mPageTextLocaleMap;
|
||||||
MangosStringLocaleMap mMangosStringLocaleMap;
|
MangosStringLocaleMap mMangosStringLocaleMap;
|
||||||
NpcOptionLocaleMap mNpcOptionLocaleMap;
|
NpcOptionLocaleMap mNpcOptionLocaleMap;
|
||||||
|
PointOfInterestLocaleMap mPointOfInterestLocaleMap;
|
||||||
RespawnTimes mCreatureRespawnTimes;
|
RespawnTimes mCreatureRespawnTimes;
|
||||||
RespawnTimes mGORespawnTimes;
|
RespawnTimes mGORespawnTimes;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1094,6 +1094,7 @@ void World::SetInitialWorldSettings()
|
||||||
objmgr.LoadNpcTextLocales();
|
objmgr.LoadNpcTextLocales();
|
||||||
objmgr.LoadPageTextLocales();
|
objmgr.LoadPageTextLocales();
|
||||||
objmgr.LoadNpcOptionLocales();
|
objmgr.LoadNpcOptionLocales();
|
||||||
|
objmgr.LoadPointOfInterestLocales();
|
||||||
objmgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
|
objmgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
|
||||||
sLog.outString( ">>> Localization strings loaded" );
|
sLog.outString( ">>> Localization strings loaded" );
|
||||||
sLog.outString();
|
sLog.outString();
|
||||||
|
|
@ -1152,6 +1153,9 @@ void World::SetInitialWorldSettings()
|
||||||
sLog.outString( "Loading Creature Reputation OnKill Data..." );
|
sLog.outString( "Loading Creature Reputation OnKill Data..." );
|
||||||
objmgr.LoadReputationOnKill();
|
objmgr.LoadReputationOnKill();
|
||||||
|
|
||||||
|
sLog.outString( "Loading Points Of Interest Data..." );
|
||||||
|
objmgr.LoadPointsOfInterest();
|
||||||
|
|
||||||
sLog.outString( "Loading Pet Create Spells..." );
|
sLog.outString( "Loading Pet Create Spells..." );
|
||||||
objmgr.LoadPetCreateSpells();
|
objmgr.LoadPetCreateSpells();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7291"
|
#define REVISION_NR "7292"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue