[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.

Author: GriffonHeart

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-17 17:40:03 -06:00
parent 68cfb7c5a4
commit a24928be67
13 changed files with 298 additions and 16 deletions

View File

@@ -181,6 +181,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
@@ -194,6 +195,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);