2010-10-07 15:35:36 +02:00
/*
2011-01-01 15:01:13 +01:00
* Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
2010-10-07 15:35:36 +02:00
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
2008-10-11 14:16:25 -05:00
*/
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
#include "QuestDef.h"
#include "GossipDef.h"
#include "ObjectMgr.h"
2010-06-08 15:50:23 -06:00
#include "Opcodes.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Formulas.h"
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
GossipMenu :: GossipMenu ()
{
2011-05-26 23:57:17 +02:00
_menuId = 0 ;
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
GossipMenu ::~ GossipMenu ()
{
ClearMenu ();
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
void GossipMenu :: AddMenuItem ( int32 menuItemId , uint8 icon , std :: string const & message , uint32 sender , uint32 action , std :: string const & boxMessage , uint32 boxMoney , bool coded /*= false*/ )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
ASSERT ( _menuItems . size () <= GOSSIP_MAX_MENU_ITEMS );
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
// Find a free new id - script case
if ( menuItemId == - 1 )
{
menuItemId = 0 ;
if ( ! _menuItems . empty ())
{
for ( GossipMenuItemContainer :: const_iterator itr = _menuItems . begin (); itr != _menuItems . end (); ++ itr )
{
if ( int32 ( itr -> first ) > menuItemId )
{
menuItemId = menuItemId ;
break ;
}
menuItemId = itr -> first + 1 ;
}
}
}
2009-12-20 13:35:08 +02:00
2011-05-26 23:57:17 +02:00
GossipMenuItem & menuItem = _menuItems [ menuItemId ];
2009-12-20 13:35:08 +02:00
2011-05-26 23:57:17 +02:00
menuItem . MenuItemIcon = icon ;
menuItem . Message = message ;
menuItem . IsCoded = coded ;
menuItem . Sender = sender ;
menuItem . OptionType = action ;
menuItem . BoxMessage = boxMessage ;
menuItem . BoxMoney = boxMoney ;
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-06-18 23:40:14 +01:00
void GossipMenu :: AddGossipMenuItemData ( uint32 menuItemId , uint32 gossipActionMenuId , uint32 gossipActionPoi )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
GossipMenuItemData & itemData = _menuItemData [ menuItemId ];
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
itemData . GossipActionMenuId = gossipActionMenuId ;
itemData . GossipActionPoi = gossipActionPoi ;
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
uint32 GossipMenu :: GetMenuItemSender ( uint32 menuItemId ) const
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
GossipMenuItemContainer :: const_iterator itr = _menuItems . find ( menuItemId );
if ( itr == _menuItems . end ())
return 0 ;
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
return itr -> second . Sender ;
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
uint32 GossipMenu :: GetMenuItemAction ( uint32 menuItemId ) const
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
GossipMenuItemContainer :: const_iterator itr = _menuItems . find ( menuItemId );
if ( itr == _menuItems . end ())
return 0 ;
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
return itr -> second . OptionType ;
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
bool GossipMenu :: IsMenuItemCoded ( uint32 menuItemId ) const
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
GossipMenuItemContainer :: const_iterator itr = _menuItems . find ( menuItemId );
if ( itr == _menuItems . end ())
return false ;
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
return itr -> second . IsCoded ;
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
void GossipMenu :: ClearMenu ()
{
2011-05-26 23:57:17 +02:00
_menuItems . clear ();
_menuItemData . clear ();
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
PlayerMenu :: PlayerMenu ( WorldSession * session ) : _session ( session )
2008-10-11 14:16:25 -05:00
{
}
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
PlayerMenu ::~ PlayerMenu ()
{
ClearMenus ();
}
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
void PlayerMenu :: ClearMenus ()
{
2011-05-26 23:57:17 +02:00
_gossipMenu . ClearMenu ();
_questMenu . ClearMenu ();
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
void PlayerMenu :: SendGossipMenu ( uint32 titleTextId , uint64 objectGUID ) const
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
WorldPacket data ( SMSG_GOSSIP_MESSAGE , 100 ); // guess size
2009-12-20 13:35:08 +02:00
data << uint64 ( objectGUID );
2011-05-26 23:57:17 +02:00
data << uint32 ( _gossipMenu . GetMenuId ()); // new 2.4.0
data << uint32 ( titleTextId );
data << uint32 ( _gossipMenu . GetMenuItemCount ()); // max count 0x10
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
for ( GossipMenuItemContainer :: const_iterator itr = _gossipMenu . GetMenuItems (). begin (); itr != _gossipMenu . GetMenuItems (). end (); ++ itr )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
GossipMenuItem const & item = itr -> second ;
data << uint32 ( itr -> first );
data << uint8 ( item . MenuItemIcon );
data << uint8 ( item . IsCoded ); // makes pop up box password
data << uint32 ( item . BoxMoney ); // money required to open menu, 2.0.3
data << item . Message ; // text for gossip item
data << item . BoxMessage ; // accept text (related to money) pop up box, 2.0.3
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( _questMenu . GetMenuItemCount ()); // max count 0x20
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 iI = 0 ; iI < _questMenu . GetMenuItemCount (); ++ iI )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
QuestMenuItem const & item = _questMenu . GetItem ( iI );
uint32 questID = item . QuestId ;
Quest const * quest = sObjectMgr -> GetQuestTemplate ( questID );
2009-10-17 15:51:44 -07:00
2008-12-12 11:21:28 -06:00
data << uint32 ( questID );
2011-05-26 23:57:17 +02:00
data << uint32 ( item . QuestIcon );
data << int32 ( quest -> GetQuestLevel ());
data << uint32 ( quest -> GetFlags ()); // 3.3.3 quest flags
data << uint8 ( 0 ); // 3.3.3 changes icon: blue question or yellow exclamation
std :: string title = quest -> GetTitle ();
int locale = _session -> GetSessionDbLocaleIndex ();
if ( locale >= 0 )
if ( QuestLocale const * localeData = sObjectMgr -> GetQuestLocale ( questID ))
2011-08-04 15:14:15 +02:00
ObjectMgr :: GetLocaleString ( localeData -> Title , locale , title );
2011-05-26 23:57:17 +02:00
data << title ; // max 0x200
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
_session -> SendPacket ( & data );
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
void PlayerMenu :: SendCloseGossip () const
2008-10-11 14:16:25 -05:00
{
2010-04-07 22:59:46 +02:00
WorldPacket data ( SMSG_GOSSIP_COMPLETE , 0 );
2011-05-26 23:57:17 +02:00
_session -> SendPacket ( & data );
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
void PlayerMenu :: SendPointOfInterest ( uint32 poiId ) const
2009-02-17 17:40:03 -06:00
{
2011-05-26 23:57:17 +02:00
PointOfInterest const * poi = sObjectMgr -> GetPointOfInterest ( poiId );
2010-04-07 19:14:10 +02:00
if ( ! poi )
2009-02-17 17:40:03 -06:00
{
2011-05-26 23:57:17 +02:00
sLog -> outErrorDb ( "Request to send non-existing POI (Id: %u), ignored." , poiId );
2009-02-17 17:40:03 -06:00
return ;
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
std :: string iconText = poi -> icon_name ;
int32 locale = _session -> GetSessionDbLocaleIndex ();
if ( locale >= 0 )
if ( PointOfInterestLocale const * localeData = sObjectMgr -> GetPointOfInterestLocale ( poiId ))
2011-08-04 15:14:15 +02:00
ObjectMgr :: GetLocaleString ( localeData -> IconName , locale , iconText );
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
WorldPacket data ( SMSG_GOSSIP_POI , 4 + 4 + 4 + 4 + 4 + 10 ); // guess size
2009-02-17 17:40:03 -06:00
data << uint32 ( poi -> flags );
data << float ( poi -> x );
data << float ( poi -> y );
data << uint32 ( poi -> icon );
data << uint32 ( poi -> data );
2011-05-26 23:57:17 +02:00
data << iconText ;
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
_session -> SendPacket ( & data );
2009-02-17 17:40:03 -06:00
}
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
/*********************************************************/
/*** QUEST SYSTEM ***/
/*********************************************************/
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
QuestMenu :: QuestMenu ()
{
2011-05-26 23:57:17 +02:00
_questMenuItems . reserve ( 16 ); // can be set for max from most often sizes to speedup push_back and less memory use
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
QuestMenu ::~ QuestMenu ()
{
ClearMenu ();
}
2009-10-17 15:51:44 -07:00
2010-04-07 22:59:46 +02:00
void QuestMenu :: AddMenuItem ( uint32 QuestId , uint8 Icon )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( ! sObjectMgr -> GetQuestTemplate ( QuestId ))
return ;
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
ASSERT ( _questMenuItems . size () <= GOSSIP_MAX_MENU_ITEMS );
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
QuestMenuItem questMenuItem ;
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
questMenuItem . QuestId = QuestId ;
questMenuItem . QuestIcon = Icon ;
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
_questMenuItems . push_back ( questMenuItem );
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
bool QuestMenu :: HasItem ( uint32 questId ) const
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
for ( QuestMenuItemList :: const_iterator i = _questMenuItems . begin (); i != _questMenuItems . end (); ++ i )
if ( i -> QuestId == questId )
2008-10-11 14:16:25 -05:00
return true ;
2011-05-26 23:57:17 +02:00
2008-10-11 14:16:25 -05:00
return false ;
}
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
void QuestMenu :: ClearMenu ()
{
2011-05-26 23:57:17 +02:00
_questMenuItems . clear ();
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2010-04-07 22:59:46 +02:00
void PlayerMenu :: SendQuestGiverQuestList ( QEmote eEmote , const std :: string & Title , uint64 npcGUID )
2008-10-11 14:16:25 -05:00
{
2010-04-07 22:59:46 +02:00
WorldPacket data ( SMSG_QUESTGIVER_QUEST_LIST , 100 ); // guess size
2008-10-11 14:16:25 -05:00
data << uint64 ( npcGUID );
data << Title ;
2010-04-07 22:59:46 +02:00
data << uint32 ( eEmote . _Delay ); // player emote
data << uint32 ( eEmote . _Emote ); // NPC emote
2009-10-17 15:51:44 -07:00
2010-04-15 08:26:30 +04:00
size_t count_pos = data . wpos ();
2011-06-12 02:30:32 +02:00
data << uint8 ( _questMenu . GetMenuItemCount ());
2010-04-15 08:26:30 +04:00
uint32 count = 0 ;
2011-05-26 23:57:17 +02:00
for (; count < _questMenu . GetMenuItemCount (); ++ count )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
QuestMenuItem const & qmi = _questMenu . GetItem ( count );
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
uint32 questID = qmi . QuestId ;
2009-10-17 15:51:44 -07:00
2010-12-22 21:25:23 +01:00
if ( Quest const * pQuest = sObjectMgr -> GetQuestTemplate ( questID ))
2008-10-11 14:16:25 -05:00
{
2010-04-15 08:26:30 +04:00
std :: string title = pQuest -> GetTitle ();
2011-05-26 23:57:17 +02:00
int loc_idx = _session -> GetSessionDbLocaleIndex ();
2010-04-15 08:26:30 +04:00
if ( loc_idx >= 0 )
2010-12-22 21:25:23 +01:00
if ( QuestLocale const * ql = sObjectMgr -> GetQuestLocale ( questID ))
2011-08-04 15:14:15 +02:00
ObjectMgr :: GetLocaleString ( ql -> Title , loc_idx , title );
2009-10-17 15:51:44 -07:00
2010-04-15 08:26:30 +04:00
data << uint32 ( questID );
2011-05-26 23:57:17 +02:00
data << uint32 ( qmi . QuestIcon );
2010-04-15 08:26:30 +04:00
data << int32 ( pQuest -> GetQuestLevel ());
data << uint32 ( pQuest -> GetFlags ()); // 3.3.3 quest flags
data << uint8 ( 0 ); // 3.3.3 changes icon: blue question or yellow exclamation
data << title ;
}
2008-10-11 14:16:25 -05:00
}
2010-04-15 08:26:30 +04:00
data . put < uint8 > ( count_pos , count );
2011-05-26 23:57:17 +02:00
_session -> SendPacket ( & data );
2011-02-20 20:16:34 +01:00
sLog -> outDebug ( LOG_FILTER_NETWORKIO , "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u" , GUID_LOPART ( npcGUID ));
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
void PlayerMenu :: SendQuestGiverStatus ( uint8 questStatus , uint64 npcGUID ) const
2008-10-11 14:16:25 -05:00
{
2010-04-07 22:59:46 +02:00
WorldPacket data ( SMSG_QUESTGIVER_STATUS , 9 );
2008-10-11 14:16:25 -05:00
data << uint64 ( npcGUID );
data << uint8 ( questStatus );
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
_session -> SendPacket ( & data );
2011-02-20 20:16:34 +01:00
sLog -> outDebug ( LOG_FILTER_NETWORKIO , "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u" , GUID_LOPART ( npcGUID ), questStatus );
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
void PlayerMenu :: SendQuestGiverQuestDetails ( Quest const * quest , uint64 npcGUID , bool activateAccept ) const
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
std :: string questTitle = quest -> GetTitle ();
std :: string questDetails = quest -> GetDetails ();
std :: string questObjectives = quest -> GetObjectives ();
std :: string questEndText = quest -> GetEndText ();
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
int32 locale = _session -> GetSessionDbLocaleIndex ();
if ( locale >= 0 )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( QuestLocale const * localeData = sObjectMgr -> GetQuestLocale ( quest -> GetQuestId ()))
2008-10-11 14:16:25 -05:00
{
2011-08-04 15:14:15 +02:00
ObjectMgr :: GetLocaleString ( localeData -> Title , locale , questTitle );
ObjectMgr :: GetLocaleString ( localeData -> Details , locale , questDetails );
ObjectMgr :: GetLocaleString ( localeData -> Objectives , locale , questObjectives );
ObjectMgr :: GetLocaleString ( localeData -> EndText , locale , questEndText );
2008-10-11 14:16:25 -05:00
}
}
2009-10-17 15:51:44 -07:00
2010-02-14 19:13:14 -07:00
WorldPacket data ( SMSG_QUESTGIVER_QUEST_DETAILS , 100 ); // guess size
2008-10-11 14:16:25 -05:00
data << uint64 ( npcGUID );
2008-12-24 09:58:26 -06:00
data << uint64 ( 0 ); // wotlk, something todo with quest sharing?
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetQuestId ());
data << questTitle ;
data << questDetails ;
data << questObjectives ;
data << uint8 ( activateAccept ? 1 : 0 ); // auto finish
data << uint32 ( quest -> GetFlags ()); // 3.3.3 questFlags
data << uint32 ( quest -> GetSuggestedPlayers ());
2010-04-15 08:26:30 +04:00
data << uint8 ( 0 ); // IsFinished? value is sent back to server in quest accept packet
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
if ( quest -> HasFlag ( QUEST_FLAGS_HIDDEN_REWARDS ))
2008-10-11 14:16:25 -05:00
{
data << uint32 ( 0 ); // Rewarded chosen items hidden
data << uint32 ( 0 ); // Rewarded items hidden
data << uint32 ( 0 ); // Rewarded money hidden
2010-04-15 08:26:30 +04:00
data << uint32 ( 0 ); // Rewarded XP hidden
2008-10-11 14:16:25 -05:00
}
else
{
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewChoiceItemsCount ());
2009-04-29 00:26:07 -05:00
for ( uint32 i = 0 ; i < QUEST_REWARD_CHOICES_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( ! quest -> RewChoiceItemId [ i ])
2010-04-15 08:26:30 +04:00
continue ;
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> RewChoiceItemId [ i ]);
data << uint32 ( quest -> RewChoiceItemCount [ i ]);
2010-04-15 08:26:30 +04:00
2011-05-26 23:57:17 +02:00
if ( ItemTemplate const * itemTemplate = sObjectMgr -> GetItemTemplate ( quest -> RewChoiceItemId [ i ]))
data << uint32 ( itemTemplate -> DisplayInfoID );
2008-10-11 14:16:25 -05:00
else
2010-04-07 22:59:46 +02:00
data << uint32 ( 0x00 );
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewItemsCount ());
2010-04-15 08:26:30 +04:00
2009-04-29 00:26:07 -05:00
for ( uint32 i = 0 ; i < QUEST_REWARDS_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( ! quest -> RewItemId [ i ])
2010-04-15 08:26:30 +04:00
continue ;
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> RewItemId [ i ]);
data << uint32 ( quest -> RewItemCount [ i ]);
2010-04-15 08:26:30 +04:00
2011-05-26 23:57:17 +02:00
if ( ItemTemplate const * itemTemplate = sObjectMgr -> GetItemTemplate ( quest -> RewItemId [ i ]))
data << uint32 ( itemTemplate -> DisplayInfoID );
2008-10-11 14:16:25 -05:00
else
data << uint32 ( 0 );
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewOrReqMoney ());
data << uint32 ( quest -> XPValue ( _session -> GetPlayer ()) * sWorld -> getRate ( RATE_XP_QUEST ));
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2008-10-22 08:43:09 -05:00
// rewarded honor points. Multiply with 10 to satisfy client
2011-05-26 23:57:17 +02:00
data << 10 * Trinity :: Honor :: hk_honor_at_level ( _session -> GetPlayer () -> getLevel (), quest -> GetRewHonorMultiplier ());
2010-03-27 15:10:26 +01:00
data << float ( 0 ); // new 3.3.0, honor multiplier?
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewSpell ()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
data << int32 ( quest -> GetRewSpellCast ()); // casted spell
data << uint32 ( quest -> GetCharTitleId ()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
data << uint32 ( quest -> GetBonusTalents ()); // bonus talents
data << uint32 ( quest -> GetRewArenaPoints ()); // reward arena points
2010-03-27 15:10:26 +01:00
data << uint32 ( 0 ); // unk
2010-02-14 19:13:14 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REPUTATIONS_COUNT ; ++ i )
data << uint32 ( quest -> RewRepFaction [ i ]);
2010-02-14 19:13:14 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REPUTATIONS_COUNT ; ++ i )
data << int32 ( quest -> RewRepValueId [ i ]);
2010-02-14 19:13:14 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REPUTATIONS_COUNT ; ++ i )
data << int32 ( quest -> RewRepValue [ i ]);
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
data << uint32 ( QUEST_EMOTE_COUNT );
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_EMOTE_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> DetailsEmote [ i ]);
data << uint32 ( quest -> DetailsEmoteDelay [ i ]); // DetailsEmoteDelay (in ms)
2008-10-11 14:16:25 -05:00
}
2011-05-26 23:57:17 +02:00
_session -> SendPacket ( & data );
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
sLog -> outDebug ( LOG_FILTER_NETWORKIO , "WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u" , GUID_LOPART ( npcGUID ), quest -> GetQuestId ());
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
void PlayerMenu :: SendQuestQueryResponse ( Quest const * quest ) const
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
std :: string questTitle = quest -> GetTitle ();
std :: string questDetails = quest -> GetDetails ();
std :: string questObjectives = quest -> GetObjectives ();
std :: string questEndText = quest -> GetEndText ();
std :: string questCompletedText = quest -> GetCompletedText ();
std :: string questObjectiveText [ QUEST_OBJECTIVES_COUNT ];
for ( uint32 i = 0 ; i < QUEST_OBJECTIVES_COUNT ; ++ i )
questObjectiveText [ i ] = quest -> ObjectiveText [ i ];
int32 locale = _session -> GetSessionDbLocaleIndex ();
if ( locale >= 0 )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( QuestLocale const * localeData = sObjectMgr -> GetQuestLocale ( quest -> GetQuestId ()))
2008-10-11 14:16:25 -05:00
{
2011-08-04 15:14:15 +02:00
ObjectMgr :: GetLocaleString ( localeData -> Title , locale , questTitle );
ObjectMgr :: GetLocaleString ( localeData -> Details , locale , questDetails );
ObjectMgr :: GetLocaleString ( localeData -> Objectives , locale , questObjectives );
ObjectMgr :: GetLocaleString ( localeData -> EndText , locale , questEndText );
ObjectMgr :: GetLocaleString ( localeData -> CompletedText , locale , questCompletedText );
2010-08-27 00:57:49 +06:00
for ( int i = 0 ; i < QUEST_OBJECTIVES_COUNT ; ++ i )
2011-08-04 15:14:15 +02:00
ObjectMgr :: GetLocaleString ( localeData -> ObjectiveText [ i ], locale , questObjectiveText [ i ]);
2008-10-11 14:16:25 -05:00
}
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
WorldPacket data ( SMSG_QUEST_QUERY_RESPONSE , 100 ); // guess size
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetQuestId ()); // quest id
data << uint32 ( quest -> GetQuestMethod ()); // Accepted values: 0, 1 or 2. 0 == IsAutoComplete() (skip objectives/details)
data << uint32 ( quest -> GetQuestLevel ()); // may be -1, static data, in other cases must be used dynamic level: Player::GetQuestLevel (0 is not known, but assuming this is no longer valid for quest intended for client)
data << uint32 ( quest -> GetMinLevel ()); // min level
data << uint32 ( quest -> GetZoneOrSort ()); // zone or sort to display in quest log
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetType ()); // quest type
data << uint32 ( quest -> GetSuggestedPlayers ()); // suggested players count
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRepObjectiveFaction ()); // shown in quest log as part of quest objective
data << uint32 ( quest -> GetRepObjectiveValue ()); // shown in quest log as part of quest objective
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRepObjectiveFaction2 ()); // shown in quest log as part of quest objective OPOSITE faction
data << uint32 ( quest -> GetRepObjectiveValue2 ()); // shown in quest log as part of quest objective OPPOSITE faction
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetNextQuestInChain ()); // client will request this quest from NPC, if not 0
data << uint32 ( quest -> GetXPId ()); // used for calculating rewarded experience
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
if ( quest -> HasFlag ( QUEST_FLAGS_HIDDEN_REWARDS ))
2008-10-11 14:16:25 -05:00
data << uint32 ( 0 ); // Hide money rewarded
else
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewOrReqMoney ()); // reward money (below max lvl)
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewMoneyMaxLevel ()); // used in XP calculation at client
data << uint32 ( quest -> GetRewSpell ()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
data << int32 ( quest -> GetRewSpellCast ()); // casted spell
2009-10-17 15:51:44 -07:00
2008-10-22 07:02:05 -05:00
// rewarded honor points
2011-05-26 23:57:17 +02:00
data << Trinity :: Honor :: hk_honor_at_level ( _session -> GetPlayer () -> getLevel (), quest -> GetRewHonorMultiplier ());
2010-02-14 19:13:14 -07:00
data << float ( 0 ); // new reward honor (multipled by ~62 at client side)
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetSrcItemId ()); // source item id
data << uint32 ( quest -> GetFlags () & 0xFFFF ); // quest flags
data << uint32 ( quest -> GetCharTitleId ()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
data << uint32 ( quest -> GetPlayersSlain ()); // players slain
data << uint32 ( quest -> GetBonusTalents ()); // bonus talents
data << uint32 ( quest -> GetRewArenaPoints ()); // bonus arena points
2010-04-15 08:26:30 +04:00
data << uint32 ( 0 ); // review rep show mask
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
if ( quest -> HasFlag ( QUEST_FLAGS_HIDDEN_REWARDS ))
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARDS_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
data << uint32 ( 0 ) << uint32 ( 0 );
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARD_CHOICES_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
data << uint32 ( 0 ) << uint32 ( 0 );
}
else
{
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARDS_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> RewItemId [ i ]);
data << uint32 ( quest -> RewItemCount [ i ]);
2008-10-11 14:16:25 -05:00
}
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REWARD_CHOICES_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> RewChoiceItemId [ i ]);
data << uint32 ( quest -> RewChoiceItemCount [ i ]);
2008-10-11 14:16:25 -05:00
}
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REPUTATIONS_COUNT ; ++ i ) // reward factions ids
data << uint32 ( quest -> RewRepFaction [ i ]);
2010-02-14 19:13:14 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REPUTATIONS_COUNT ; ++ i ) // columnid+1 QuestFactionReward.dbc?
data << int32 ( quest -> RewRepValueId [ i ]);
2010-02-14 19:13:14 -07:00
2011-05-26 23:57:17 +02:00
for ( int i = 0 ; i < QUEST_REPUTATIONS_COUNT ; ++ i ) // unk (0)
data << int32 ( quest -> RewRepValue [ i ]);
2010-02-14 19:13:14 -07:00
2011-05-26 23:57:17 +02:00
data << quest -> GetPointMapId ();
data << quest -> GetPointX ();
data << quest -> GetPointY ();
data << quest -> GetPointOpt ();
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << questTitle ;
data << questObjectives ;
data << questDetails ;
data << questEndText ;
data << questCompletedText ; // display in quest objectives window once all objectives are completed
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_OBJECTIVES_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( quest -> ReqCreatureOrGOId [ i ] < 0 )
data << uint32 (( quest -> ReqCreatureOrGOId [ i ] * ( - 1 )) | 0x80000000 ); // client expects gameobject template id in form (id|0x80000000)
2008-10-11 14:16:25 -05:00
else
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> ReqCreatureOrGOId [ i ]);
data << uint32 ( quest -> ReqCreatureOrGOCount [ i ]);
data << uint32 ( quest -> ReqSourceId [ i ]);
2010-02-14 19:13:14 -07:00
data << uint32 ( 0 ); // req source count?
2009-01-30 19:22:49 -06:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_ITEM_OBJECTIVES_COUNT ; ++ i )
2009-01-30 19:22:49 -06:00
{
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> ReqItemId [ i ]);
data << uint32 ( quest -> ReqItemCount [ i ]);
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_OBJECTIVES_COUNT ; ++ i )
data << questObjectiveText [ i ];
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
_session -> SendPacket ( & data );
sLog -> outDebug ( LOG_FILTER_NETWORKIO , "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u" , quest -> GetQuestId ());
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
void PlayerMenu :: SendQuestGiverOfferReward ( Quest const * quest , uint64 npcGUID , bool enableNext ) const
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
std :: string questTitle = quest -> GetTitle ();
std :: string questOfferRewardText = quest -> GetOfferRewardText ();
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
int locale = _session -> GetSessionDbLocaleIndex ();
if ( locale >= 0 )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( QuestLocale const * localeData = sObjectMgr -> GetQuestLocale ( quest -> GetQuestId ()))
2008-10-11 14:16:25 -05:00
{
2011-08-04 15:14:15 +02:00
ObjectMgr :: GetLocaleString ( localeData -> Title , locale , questTitle );
ObjectMgr :: GetLocaleString ( localeData -> OfferRewardText , locale , questOfferRewardText );
2008-10-11 14:16:25 -05:00
}
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
WorldPacket data ( SMSG_QUESTGIVER_OFFER_REWARD , 50 ); // guess size
2010-02-14 19:13:14 -07:00
data << uint64 ( npcGUID );
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetQuestId ());
data << questTitle ;
data << questOfferRewardText ;
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint8 ( enableNext ? 1 : 0 ); // Auto Finish
data << uint32 ( quest -> GetFlags ()); // 3.3.3 questFlags
data << uint32 ( quest -> GetSuggestedPlayers ()); // SuggestedGroupNum
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
uint32 emoteCount = 0 ;
2009-04-29 00:26:07 -05:00
for ( uint32 i = 0 ; i < QUEST_EMOTE_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( quest -> OfferRewardEmote [ i ] <= 0 )
2008-10-11 14:16:25 -05:00
break ;
2011-05-26 23:57:17 +02:00
++ emoteCount ;
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << emoteCount ; // Emote Count
for ( uint32 i = 0 ; i < emoteCount ; ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> OfferRewardEmoteDelay [ i ]); // Delay Emote
data << uint32 ( quest -> OfferRewardEmote [ i ]);
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewChoiceItemsCount ());
for ( uint32 i = 0 ; i < quest -> GetRewChoiceItemsCount (); ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> RewChoiceItemId [ i ]);
data << uint32 ( quest -> RewChoiceItemCount [ i ]);
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
if ( ItemTemplate const * itemTemplate = sObjectMgr -> GetItemTemplate ( quest -> RewChoiceItemId [ i ]))
data << uint32 ( itemTemplate -> DisplayInfoID );
2008-10-11 14:16:25 -05:00
else
data << uint32 ( 0 );
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewItemsCount ());
for ( uint32 i = 0 ; i < quest -> GetRewItemsCount (); ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> RewItemId [ i ]);
data << uint32 ( quest -> RewItemCount [ i ]);
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
if ( ItemTemplate const * itemTemplate = sObjectMgr -> GetItemTemplate ( quest -> RewItemId [ i ]))
data << uint32 ( itemTemplate -> DisplayInfoID );
2008-10-11 14:16:25 -05:00
else
data << uint32 ( 0 );
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewOrReqMoney ());
data << uint32 ( quest -> XPValue ( _session -> GetPlayer ()) * sWorld -> getRate ( RATE_XP_QUEST ));
2009-10-17 15:51:44 -07:00
2008-10-22 07:02:05 -05:00
// rewarded honor points. Multiply with 10 to satisfy client
2011-05-26 23:57:17 +02:00
data << 10 * Trinity :: Honor :: hk_honor_at_level ( _session -> GetPlayer () -> getLevel (), quest -> GetRewHonorMultiplier ());
2010-03-27 15:10:26 +01:00
data << float ( 0 ); // unk, honor multiplier?
2008-10-11 14:16:25 -05:00
data << uint32 ( 0x08 ); // unused by client?
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewSpell ()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
data << int32 ( quest -> GetRewSpellCast ()); // casted spell
2008-12-24 09:58:26 -06:00
data << uint32 ( 0 ); // unknown
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetBonusTalents ()); // bonus talents
data << uint32 ( quest -> GetRewArenaPoints ()); // arena points
2010-02-14 19:13:14 -07:00
data << uint32 ( 0 );
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REPUTATIONS_COUNT ; ++ i ) // reward factions ids
data << uint32 ( quest -> RewRepFaction [ i ]);
2010-02-14 19:13:14 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REPUTATIONS_COUNT ; ++ i ) // columnid in QuestFactionReward.dbc (zero based)?
data << int32 ( quest -> RewRepValueId [ i ]);
2010-02-14 19:13:14 -07:00
2011-05-26 23:57:17 +02:00
for ( uint32 i = 0 ; i < QUEST_REPUTATIONS_COUNT ; ++ i ) // reward reputation override?
data << uint32 ( quest -> RewRepValue [ i ]);
2010-02-14 19:13:14 -07:00
2011-05-26 23:57:17 +02:00
_session -> SendPacket ( & data );
sLog -> outDebug ( LOG_FILTER_NETWORKIO , "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u" , GUID_LOPART ( npcGUID ), quest -> GetQuestId ());
2008-10-11 14:16:25 -05:00
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
void PlayerMenu :: SendQuestGiverRequestItems ( Quest const * quest , uint64 npcGUID , bool canComplete , bool closeOnCancel ) const
2008-10-11 14:16:25 -05:00
{
// We can always call to RequestItems, but this packet only goes out if there are actually
// items. Otherwise, we'll skip straight to the OfferReward
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
std :: string questTitle = quest -> GetTitle ();
std :: string requestItemsText = quest -> GetRequestItemsText ();
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
int32 locale = _session -> GetSessionDbLocaleIndex ();
if ( locale >= 0 )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( QuestLocale const * localeData = sObjectMgr -> GetQuestLocale ( quest -> GetQuestId ()))
2008-10-11 14:16:25 -05:00
{
2011-08-04 15:14:15 +02:00
ObjectMgr :: GetLocaleString ( localeData -> Title , locale , questTitle );
ObjectMgr :: GetLocaleString ( localeData -> RequestItemsText , locale , requestItemsText );
2008-10-11 14:16:25 -05:00
}
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
if ( ! quest -> GetReqItemsCount () && canComplete )
2009-02-17 14:46:12 -06:00
{
2011-05-26 23:57:17 +02:00
SendQuestGiverOfferReward ( quest , npcGUID , true );
2009-02-17 14:46:12 -06:00
return ;
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
WorldPacket data ( SMSG_QUESTGIVER_REQUEST_ITEMS , 50 ); // guess size
2010-04-11 11:13:08 +04:00
data << uint64 ( npcGUID );
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetQuestId ());
data << questTitle ;
data << requestItemsText ;
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
data << uint32 ( 0x00 ); // unknown
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
if ( canComplete )
data << quest -> GetCompleteEmote ();
2008-10-11 14:16:25 -05:00
else
2011-05-26 23:57:17 +02:00
data << quest -> GetIncompleteEmote ();
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
// Close Window after cancel
2011-05-26 23:57:17 +02:00
if ( closeOnCancel )
2008-10-11 14:16:25 -05:00
data << uint32 ( 0x01 );
else
data << uint32 ( 0x00 );
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetFlags ()); // 3.3.3 questFlags
data << uint32 ( quest -> GetSuggestedPlayers ()); // SuggestedGroupNum
2009-10-17 15:51:44 -07:00
2008-10-11 14:16:25 -05:00
// Required Money
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetRewOrReqMoney () < 0 ? - quest -> GetRewOrReqMoney () : 0 );
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> GetReqItemsCount ());
2009-12-17 11:11:54 +01:00
for ( int i = 0 ; i < QUEST_ITEM_OBJECTIVES_COUNT ; ++ i )
2008-10-11 14:16:25 -05:00
{
2011-05-26 23:57:17 +02:00
if ( ! quest -> ReqItemId [ i ])
2010-04-15 08:26:30 +04:00
continue ;
2011-05-26 23:57:17 +02:00
data << uint32 ( quest -> ReqItemId [ i ]);
data << uint32 ( quest -> ReqItemCount [ i ]);
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
if ( ItemTemplate const * itemTemplate = sObjectMgr -> GetItemTemplate ( quest -> ReqItemId [ i ]))
data << uint32 ( itemTemplate -> DisplayInfoID );
2008-10-11 14:16:25 -05:00
else
data << uint32 ( 0 );
}
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
if ( ! canComplete )
2008-10-11 14:16:25 -05:00
data << uint32 ( 0x00 );
else
data << uint32 ( 0x03 );
2009-10-17 15:51:44 -07:00
2008-12-12 11:21:28 -06:00
data << uint32 ( 0x04 );
data << uint32 ( 0x08 );
data << uint32 ( 0x10 );
2009-10-17 15:51:44 -07:00
2011-05-26 23:57:17 +02:00
_session -> SendPacket ( & data );
sLog -> outDebug ( LOG_FILTER_NETWORKIO , "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u" , GUID_LOPART ( npcGUID ), quest -> GetQuestId ());
2008-10-11 14:16:25 -05:00
}