mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01: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.
Author: GriffonHeart
--HG--
branch : trunk
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user