From c6f6861dbf53d63c26486d61afe19361bbbb2f5c Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Thu, 22 Aug 2019 19:06:03 +0200 Subject: [PATCH] Core/Loot: fixed loot roll packet structures --- src/server/game/Groups/Group.cpp | 20 ++++++++++---------- src/server/game/Groups/Group.h | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 0870e05b098..d57fdfdd250 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -940,7 +940,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, p->SendDirectMessage(&data); } -void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, int8 rollNumber, uint8 rollType, Roll const& roll) +void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, int32 rollNumber, uint8 rollType, Roll const& roll) { WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1+1)); data << uint64(sourceGuid); // guid of the item rolled @@ -949,7 +949,7 @@ void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, int8 roll data << uint32(roll.itemid); // the itemEntryId for the item that shall be rolled for data << uint32(roll.itemRandomSuffix); // randomSuffix data << uint32(roll.itemRandomPropId); // Item random property ID - data << uint32(rollNumber); // 0: "Need for: [item name]" - 1: "you passed on: [item name]" Roll number + data << int32(rollNumber); // 0: "Need for: [item name]" - 1: "you passed on: [item name]" Roll number data << uint8(rollType); // 0: "Need for: [item name]" 0: "You have selected need for [item name] 1: need roll 2: greed roll data << uint8(0); // 1: "You automatically passed on: %s because you cannot loot that item." - Possibly used in need befor greed @@ -964,7 +964,7 @@ void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, int8 roll } } -void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, int8 rollNumber, uint8 rollType, Roll const& roll) +void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, int32 rollNumber, uint8 rollType, Roll const& roll) { WorldPacket data(SMSG_LOOT_ROLL_WON, (8+4+4+4+4+8+1+1)); data << uint64(sourceGuid); // guid of the item rolled @@ -973,7 +973,7 @@ void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, int8 r data << uint32(roll.itemRandomSuffix); // randomSuffix data << uint32(roll.itemRandomPropId); // Item random property data << uint64(targetGuid); // guid of the player who won. - data << uint32(rollNumber); // rollnumber realted to SMSG_LOOT_ROLL + data << int32(rollNumber); // rollnumber realted to SMSG_LOOT_ROLL data << uint8(rollType); // rollType related to SMSG_LOOT_ROLL for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr) @@ -1093,7 +1093,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject) continue; if (itr->second == PASS) - SendLootRoll(newitemGUID, p->GetGUID(), int32(-1), ROLL_PASS, *r); + SendLootRoll(newitemGUID, p->GetGUID(), -1, ROLL_PASS, *r); } } @@ -1234,7 +1234,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) continue; if (itr->second == PASS) - SendLootRoll(newitemGUID, p->GetGUID(), int32(-1), ROLL_PASS, *r); + SendLootRoll(newitemGUID, p->GetGUID(), -1, ROLL_PASS, *r); else SendLootStartRollToPlayer(60000, lootedObject->GetMapId(), p, p->CanRollForItemInLFG(item, lootedObject) == EQUIP_ERR_OK, *r); } @@ -1297,7 +1297,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) continue; if (itr->second == PASS) - SendLootRoll(newitemGUID, p->GetGUID(), int32(-1), ROLL_PASS, *r); + SendLootRoll(newitemGUID, p->GetGUID(), -1, ROLL_PASS, *r); else SendLootStartRollToPlayer(60000, lootedObject->GetMapId(), p, p->CanRollForItemInLFG(item, lootedObject) == EQUIP_ERR_OK, *r); } @@ -1387,7 +1387,7 @@ void Group::CountRollVote(ObjectGuid playerGUID, ObjectGuid Guid, uint8 Choice) switch (Choice) { case ROLL_PASS: // Player choose pass - SendLootRoll(ObjectGuid::Empty, playerGUID, int32(-1), ROLL_PASS, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, -1, ROLL_PASS, *roll); ++roll->totalPass; itr->second = PASS; break; @@ -1397,12 +1397,12 @@ void Group::CountRollVote(ObjectGuid playerGUID, ObjectGuid Guid, uint8 Choice) itr->second = NEED; break; case ROLL_GREED: // player choose Greed - SendLootRoll(ObjectGuid::Empty, playerGUID, int32(-1), ROLL_GREED, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, -7, ROLL_GREED, *roll); ++roll->totalGreed; itr->second = GREED; break; case ROLL_DISENCHANT: // player choose Disenchant - SendLootRoll(ObjectGuid::Empty, playerGUID, int32(-1), ROLL_DISENCHANT, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, -8, ROLL_DISENCHANT, *roll); ++roll->totalGreed; itr->second = DISENCHANT; break; diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 459b4a79ee1..fc086159b02 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -335,8 +335,8 @@ class TC_GAME_API Group bool isRollLootActive() const; void SendLootStartRoll(uint32 CountDown, uint32 mapid, Roll const& r); void SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r); - void SendLootRoll(ObjectGuid SourceGuid, ObjectGuid TargetGuid, int8 RollNumber, uint8 RollType, Roll const& r); - void SendLootRollWon(ObjectGuid SourceGuid, ObjectGuid TargetGuid, int8 RollNumber, uint8 RollType, Roll const& r); + void SendLootRoll(ObjectGuid SourceGuid, ObjectGuid TargetGuid, int32 RollNumber, uint8 RollType, Roll const& r); + void SendLootRollWon(ObjectGuid SourceGuid, ObjectGuid TargetGuid, int32 RollNumber, uint8 RollType, Roll const& r); void SendLootAllPassed(Roll const& roll); void SendLooter(Creature* creature, Player* pLooter); void GroupLoot(Loot* loot, WorldObject* pLootedObject);