refactor(Scripts/Commands): Update cs_quest to the new model (#9267)

This commit is contained in:
Skjalf
2021-11-24 01:21:16 -03:00
committed by GitHub
parent 91552e240e
commit 2187470df7
12 changed files with 716 additions and 204 deletions

View File

@@ -204,9 +204,10 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*
if (quest)
{
uint8 playerLevel = GetPlayer() ? GetPlayer()->getLevel() : 0;
data << uint8(done);
data << uint32(quest->GetRewOrReqMoney(GetPlayer()));
data << uint32(quest->XPValue(GetPlayer()));
data << uint32(quest->GetRewOrReqMoney(playerLevel));
data << uint32(quest->XPValue(playerLevel));
data << uint32(0);
data << uint32(0);
data << uint8(quest->GetRewItemsCount());
@@ -491,13 +492,15 @@ void WorldSession::SendLfgPlayerReward(lfg::LfgPlayerRewardData const& rewardDat
uint8 itemNum = rewardData.quest->GetRewItemsCount();
uint8 playerLevel = GetPlayer() ? GetPlayer()->getLevel() : 0;
WorldPacket data(SMSG_LFG_PLAYER_REWARD, 4 + 4 + 1 + 4 + 4 + 4 + 4 + 4 + 1 + itemNum * (4 + 4 + 4));
data << uint32(rewardData.rdungeonEntry); // Random Dungeon Finished
data << uint32(rewardData.sdungeonEntry); // Dungeon Finished
data << uint8(rewardData.done);
data << uint32(1);
data << uint32(rewardData.quest->GetRewOrReqMoney(GetPlayer()));
data << uint32(rewardData.quest->XPValue(GetPlayer()));
data << uint32(rewardData.quest->GetRewOrReqMoney(playerLevel));
data << uint32(rewardData.quest->XPValue(playerLevel));
data << uint32(0);
data << uint32(0);
data << uint8(itemNum);