@@ -16674,14 +16674,17 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP) const
1667416674{
1667516675 uint32 questId = quest->GetQuestId();
1667616676 sGameEventMgr->HandleQuestComplete(questId);
16677- WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
16678- data << uint32(questId) ;
16677+
16678+ uint32 xp ;
1667916679
1668016680 if (!IsMaxLevel())
16681- data << uint32(XP) ;
16681+ xp = XP ;
1668216682 else
16683- data << uint32(0) ;
16683+ xp = 0 ;
1668416684
16685+ WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
16686+ data << uint32(questId);
16687+ data << uint32(xp);
1668516688 data << uint32(quest->GetRewOrReqMoney(this));
1668616689 data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest)));
1668716690 data << uint32(quest->GetBonusTalents()); // bonus talents
@@ -20365,7 +20368,7 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) const
2036520368 // 1: There are players offline in your party.
2036620369 // 2>: There are players in your party attempting to zone into an instance.
2036720370 */
20368- WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4 );
20371+ WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 8 );
2036920372 data << uint32(reason);
2037020373 data << uint32(MapId);
2037120374 SendDirectMessage(&data);
@@ -26215,6 +26218,26 @@ PetStable& Player::GetOrInitPetStable()
2621526218 return *m_petStable;
2621626219}
2621726220
26221+ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) const
26222+ {
26223+ WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8 + 4 + 4 + 4 + 4 + 4 * 4 + 4 * 4);
26224+ data << uint64(item->GetGUID()); // item guid
26225+ data << uint32(error); // 0, or error code
26226+ if (!error)
26227+ {
26228+ data << uint32(item->GetPaidMoney()); // money cost
26229+ data << uint32(iece->HonorPoints); // honor point cost
26230+ data << uint32(iece->ArenaPoints); // arena point cost
26231+ for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
26232+ {
26233+ data << uint32(iece->ItemID[i]);
26234+ data << uint32(iece->ItemCount[i]);
26235+ }
26236+ }
26237+
26238+ SendDirectMessage(&data);
26239+ }
26240+
2621826241void Player::RefundItem(Item* item)
2621926242{
2622026243 if (!item->IsRefundable())
@@ -26226,10 +26249,7 @@ void Player::RefundItem(Item* item)
2622626249 if (item->IsRefundExpired()) // item refund has expired
2622726250 {
2622826251 item->SetNotRefundable(this);
26229- WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4);
26230- data << uint64(item->GetGUID()); // Guid
26231- data << uint32(10); // Error!
26232- SendDirectMessage(&data);
26252+ SendItemRefundResult(item, nullptr, 10);
2623326253 return;
2623426254 }
2623526255
@@ -26267,25 +26287,11 @@ void Player::RefundItem(Item* item)
2626726287
2626826288 if (store_error)
2626926289 {
26270- WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4);
26271- data << uint64(item->GetGUID()); // Guid
26272- data << uint32(10); // Error!
26273- SendDirectMessage(&data);
26290+ SendItemRefundResult(item, iece, 10);
2627426291 return;
2627526292 }
2627626293
26277- WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4+4+4+4+4*4+4*4);
26278- data << uint64(item->GetGUID()); // item guid
26279- data << uint32(0); // 0, or error code
26280- data << uint32(item->GetPaidMoney()); // money cost
26281- data << uint32(iece->HonorPoints); // honor point cost
26282- data << uint32(iece->ArenaPoints); // arena point cost
26283- for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
26284- {
26285- data << uint32(iece->ItemID[i]);
26286- data << uint32(iece->ItemCount[i]);
26287- }
26288- SendDirectMessage(&data);
26294+ SendItemRefundResult(item, iece, 0);
2628926295
2629026296 uint32 moneyRefund = item->GetPaidMoney(); // item-> will be invalidated in DestroyItem
2629126297
0 commit comments