Merge commit 'origin/master' into 330

This commit is contained in:
tomrus88 2009-10-17 02:53:46 +04:00
commit dd9fd414bb
42 changed files with 1073 additions and 728 deletions

View file

@ -6106,6 +6106,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor)
if (uVictim != NULL)
{
honor *= sWorld.getRate(RATE_HONOR);
honor *= (GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN) + 100.0f)/100.0f;
if(groupsize > 1)
honor /= groupsize;
@ -13897,6 +13898,33 @@ void Player::SendCanTakeQuestResponse( uint32 msg )
sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID");
}
void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver)
{
if (pReceiver)
{
std::string strTitle = pQuest->GetTitle();
int loc_idx = pReceiver->GetSession()->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
{
if (const QuestLocale* pLocale = objmgr.GetQuestLocale(pQuest->GetQuestId()))
{
if (pLocale->Title.size() > loc_idx && !pLocale->Title[loc_idx].empty())
strTitle = pLocale->Title[loc_idx];
}
}
WorldPacket data(SMSG_QUEST_CONFIRM_ACCEPT, (4 + strTitle.size() + 8));
data << uint32(pQuest->GetQuestId());
data << strTitle;
data << uint64(GetGUID());
pReceiver->GetSession()->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT");
}
}
void Player::SendPushToPartyResponse( Player *pPlayer, uint32 msg )
{
if( pPlayer )
@ -16536,9 +16564,13 @@ void Player::Whisper(const std::string& text, uint32 language,uint64 receiver)
BuildPlayerChat(&data, CHAT_MSG_WHISPER, text, language);
rPlayer->GetSession()->SendPacket(&data);
data.Initialize(SMSG_MESSAGECHAT, 200);
rPlayer->BuildPlayerChat(&data, CHAT_MSG_REPLY, text, language);
GetSession()->SendPacket(&data);
// not send confirmation for addon messages
if (language != LANG_ADDON)
{
data.Initialize(SMSG_MESSAGECHAT, 200);
rPlayer->BuildPlayerChat(&data, CHAT_MSG_REPLY, text, language);
GetSession()->SendPacket(&data);
}
}
else
{
@ -18789,7 +18821,7 @@ void Player::UpdateForQuestWorldObjects()
{
if(IS_GAMEOBJECT_GUID(*itr))
{
GameObject *obj = HashMapHolder<GameObject>::Find(*itr);
GameObject *obj = GetMap()->GetGameObject(*itr);
if(obj)
obj->BuildValuesUpdateBlockForPlayer(&udata,this);
}