mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Fixed quests.
This commit is contained in:
parent
26070c571f
commit
c2a3062f4e
3 changed files with 62 additions and 75 deletions
|
|
@ -142,7 +142,7 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID)
|
|||
data << uint64(objectGUID);
|
||||
data << uint32(mGossipMenu.GetMenuId()); // new 2.4.0
|
||||
data << uint32(TitleTextId);
|
||||
data << uint32(mGossipMenu.MenuItemCount()); // max count 0x10
|
||||
data << uint32(mGossipMenu.MenuItemCount()); // max count 0x20
|
||||
|
||||
for (uint32 iI = 0; iI < mGossipMenu.MenuItemCount(); ++iI )
|
||||
{
|
||||
|
|
@ -151,8 +151,8 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID)
|
|||
data << uint8( gItem.m_gIcon );
|
||||
data << uint8( gItem.m_gCoded ); // makes pop up box password
|
||||
data << uint32(gItem.m_gBoxMoney); // money required to open menu, 2.0.3
|
||||
data << gItem.m_gMessage; // text for gossip item
|
||||
data << gItem.m_gBoxMessage; // accept text (related to money) pop up box, 2.0.3
|
||||
data << gItem.m_gMessage; // text for gossip item, max 0x800
|
||||
data << gItem.m_gBoxMessage; // accept text (related to money) pop up box, 2.0.3, max 0x800
|
||||
}
|
||||
|
||||
data << uint32( mQuestMenu.MenuItemCount() ); // max count 0x20
|
||||
|
|
@ -166,19 +166,16 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID)
|
|||
data << uint32(questID);
|
||||
data << uint32(qItem.m_qIcon);
|
||||
data << int32(pQuest->GetQuestLevel());
|
||||
data << uint32(0); // 3.3.3
|
||||
data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation
|
||||
std::string Title = pQuest->GetTitle();
|
||||
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID);
|
||||
if (ql)
|
||||
{
|
||||
if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(questID))
|
||||
if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty())
|
||||
Title = ql->Title[loc_idx];
|
||||
}
|
||||
}
|
||||
data << Title;
|
||||
data << Title; // max 0x200
|
||||
}
|
||||
|
||||
pSession->SendPacket( &data );
|
||||
|
|
@ -220,14 +217,9 @@ void PlayerMenu::SendPointOfInterest( uint32 poi_id )
|
|||
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
PointOfInterestLocale const *pl = sObjectMgr.GetPointOfInterestLocale(poi_id);
|
||||
if (pl)
|
||||
{
|
||||
if (PointOfInterestLocale const *pl = sObjectMgr.GetPointOfInterestLocale(poi_id))
|
||||
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);
|
||||
|
|
@ -275,8 +267,7 @@ void PlayerMenu::SendTalking( uint32 textID )
|
|||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID);
|
||||
if (nl)
|
||||
if (NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID))
|
||||
{
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
|
|
@ -370,12 +361,8 @@ void QuestMenu::AddMenuItem( uint32 QuestId, uint8 Icon)
|
|||
bool QuestMenu::HasItem( uint32 questid )
|
||||
{
|
||||
for (QuestMenuItemList::const_iterator i = m_qItems.begin(); i != m_qItems.end(); ++i)
|
||||
{
|
||||
if(i->m_qId == questid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -418,6 +405,8 @@ void PlayerMenu::SendQuestGiverQuestList( QEmote eEmote, const std::string& Titl
|
|||
data << uint32(questID);
|
||||
data << uint32(qmi.m_qIcon);
|
||||
data << int32(pQuest->GetQuestLevel());
|
||||
data << uint32(0);
|
||||
data << uint8(0);
|
||||
data << title;
|
||||
}
|
||||
}
|
||||
|
|
@ -466,9 +455,9 @@ void PlayerMenu::SendQuestGiverQuestDetails( Quest const *pQuest, uint64 npcGUID
|
|||
data << Objectives;
|
||||
data << uint8(ActivateAccept ? 1 : 0); // auto finish?
|
||||
data << uint32(pQuest->GetSuggestedPlayers());
|
||||
data << uint8(0); // flags PvP
|
||||
data << uint32(0); // flags PvP
|
||||
data << uint8(0); // value is sent back to server in quest accept packet
|
||||
data << uint8(0); // auto accept?
|
||||
//data << uint32(0); // auto accept?
|
||||
|
||||
if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
|
||||
{
|
||||
|
|
@ -577,8 +566,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
|||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
if (ql)
|
||||
if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId()))
|
||||
{
|
||||
if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty())
|
||||
Title = ql->Title[loc_idx];
|
||||
|
|
@ -719,8 +707,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
|
|||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
if (ql)
|
||||
if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId()))
|
||||
{
|
||||
if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty())
|
||||
Title = ql->Title[loc_idx];
|
||||
|
|
@ -737,6 +724,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
|
|||
data << OfferRewardText;
|
||||
|
||||
data << uint8(EnableNext ? 1 : 0); // Auto Finish?
|
||||
data << uint32(0); // 3.3.3
|
||||
data << uint32(0); // SuggestedGroupNum
|
||||
|
||||
uint32 EmoteCount = 0;
|
||||
|
|
@ -771,7 +759,7 @@ void PlayerMenu::SendQuestGiverOfferReward( Quest const* pQuest, uint64 npcGUID,
|
|||
}
|
||||
|
||||
data << uint32(pQuest->GetRewItemsCount());
|
||||
for (uint16 i=0; i < pQuest->GetRewItemsCount(); ++i)
|
||||
for (uint32 i = 0; i < pQuest->GetRewItemsCount(); ++i)
|
||||
{
|
||||
pItem = ObjectMgr::GetItemPrototype(pQuest->RewItemId[i]);
|
||||
data << uint32(pQuest->RewItemId[i]);
|
||||
|
|
@ -828,8 +816,7 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
|
|||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId());
|
||||
if (ql)
|
||||
if (QuestLocale const *ql = sObjectMgr.GetQuestLocale(pQuest->GetQuestId()))
|
||||
{
|
||||
if (ql->Title.size() > (size_t)loc_idx && !ql->Title[loc_idx].empty())
|
||||
Title = ql->Title[loc_idx];
|
||||
|
|
@ -845,8 +832,8 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
|
|||
}
|
||||
|
||||
WorldPacket data( SMSG_QUESTGIVER_REQUEST_ITEMS, 50 ); // guess size
|
||||
data << npcGUID;
|
||||
data << pQuest->GetQuestId();
|
||||
data << uint64(npcGUID);
|
||||
data << uint32(pQuest->GetQuestId());
|
||||
data << Title;
|
||||
data << RequestItemsText;
|
||||
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
|||
AccountTypes gmLevelInWhoList = (AccountTypes)sWorld.getConfig(CONFIG_UINT32_GM_LEVEL_IN_WHO_LIST);
|
||||
|
||||
WorldPacket data( SMSG_WHO, 50 ); // guess size
|
||||
data << clientcount; // clientcount place holder
|
||||
data << clientcount; // clientcount place holder
|
||||
data << uint32(clientcount); // clientcount place holder, listed count
|
||||
data << uint32(clientcount); // clientcount place holder, online count
|
||||
|
||||
// TODO: Guard Player map
|
||||
HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
|
||||
|
|
@ -244,13 +244,14 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
|||
data << uint8(0); // new 2.4.0
|
||||
data << uint32( pzoneid ); // player zone id
|
||||
|
||||
// 49 is maximum player count sent to client
|
||||
if ((++clientcount) == 49)
|
||||
// 50 is maximum player count sent to client
|
||||
if ((++clientcount) == 50)
|
||||
break;
|
||||
}
|
||||
|
||||
data.put( 0, clientcount ); // insert right count
|
||||
data.put( sizeof(uint32), clientcount ); // insert right count
|
||||
uint32 count = m.size();
|
||||
data.put( 0, clientcount ); // insert right count, listed count
|
||||
data.put( 4, count > 50 ? count : clientcount ); // insert right count, online count
|
||||
|
||||
SendPacket(&data);
|
||||
sLog.outDebug( "WORLD: Send SMSG_WHO Message" );
|
||||
|
|
|
|||
|
|
@ -13535,13 +13535,12 @@ bool Player::SatisfyQuestLog( bool msg )
|
|||
if( FindQuestSlot(0) < MAX_QUEST_LOG_SIZE )
|
||||
return true;
|
||||
|
||||
if( msg )
|
||||
{
|
||||
if( !msg )
|
||||
return false;
|
||||
|
||||
WorldPacket data( SMSG_QUESTLOG_FULL, 0 );
|
||||
GetSession()->SendPacket( &data );
|
||||
sLog.outDebug( "WORLD: Sent QUEST_LOG_FULL_MESSAGE" );
|
||||
}
|
||||
return false;
|
||||
sLog.outDebug( "WORLD: Sent SMSG_QUESTLOG_FULL" );
|
||||
}
|
||||
|
||||
bool Player::SatisfyQuestPreviousQuest( Quest const* qInfo, bool msg )
|
||||
|
|
@ -14431,7 +14430,7 @@ void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGive
|
|||
|
||||
data << uint32(10*MaNGOS::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorAddition()));
|
||||
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
||||
data << uint32(0);
|
||||
data << uint32(0); // arena points
|
||||
GetSession()->SendPacket( &data );
|
||||
|
||||
if (pQuest->GetQuestCompleteScript() != 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue