[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:
GriffonHeart 2009-02-17 23:21:54 +03:00 committed by VladimirMangos
parent 946e4fb036
commit 9b2a772413
14 changed files with 302 additions and 16 deletions

View file

@ -179,6 +179,7 @@ void PlayerMenu::CloseGossip()
//sLog.outDebug( "WORLD: Sent SMSG_GOSSIP_COMPLETE" );
}
// Outdated
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
@ -192,6 +193,40 @@ void PlayerMenu::SendPointOfInterest( float X, float Y, uint32 Icon, uint32 Flag
//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 )
{
GossipText const* pGossip = objmgr.GetGossipText(textID);