diff options
| author | megamage <none@none> | 2009-02-17 17:40:03 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-02-17 17:40:03 -0600 |
| commit | a24928be67da1cffd433c6bd40564ebfd55b1d9d (patch) | |
| tree | f50ac4f59d40a59d2195848ab9a7a54de700880f /src/game/GossipDef.cpp | |
| parent | 68cfb7c5a492ca1cc691cce831421af98bd6fe45 (diff) | |
[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
Diffstat (limited to 'src/game/GossipDef.cpp')
| -rw-r--r-- | src/game/GossipDef.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 300d02cca4e..65e0f54d925 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -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); |
