From bd92f9898aadf82cdb51d1a9e19b809259fed354 Mon Sep 17 00:00:00 2001 From: Ovalord <1Don7H4v3@m41L.com> Date: Mon, 8 Jan 2018 18:55:11 +0100 Subject: [PATCH] Core/Groups: fixed loot rolling packets --- src/server/game/Groups/Group.cpp | 18 +++++++++--------- src/server/game/Groups/Group.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index d46d4a35d5a..c45cb48056e 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -933,7 +933,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, p->GetSession()->SendPacket(&data); } -void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll) +void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, int8 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 @@ -942,7 +942,7 @@ void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rol 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]" > 127: "you passed on: [item name]" Roll number + data << uint32(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 @@ -957,7 +957,7 @@ void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rol } } -void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll) +void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, int8 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 @@ -1086,7 +1086,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject) continue; if (itr->second == PASS) - SendLootRoll(newitemGUID, p->GetGUID(), 128, ROLL_PASS, *r); + SendLootRoll(newitemGUID, p->GetGUID(), int32(-1), ROLL_PASS, *r); } } @@ -1227,7 +1227,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) continue; if (itr->second == PASS) - SendLootRoll(newitemGUID, p->GetGUID(), 128, ROLL_PASS, *r); + SendLootRoll(newitemGUID, p->GetGUID(), int32(-1), ROLL_PASS, *r); else SendLootStartRollToPlayer(60000, lootedObject->GetMapId(), p, p->CanRollForItemInLFG(item, lootedObject) == EQUIP_ERR_OK, *r); } @@ -1290,7 +1290,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) continue; if (itr->second == PASS) - SendLootRoll(newitemGUID, p->GetGUID(), 128, ROLL_PASS, *r); + SendLootRoll(newitemGUID, p->GetGUID(), int32(-1), ROLL_PASS, *r); else SendLootStartRollToPlayer(60000, lootedObject->GetMapId(), p, p->CanRollForItemInLFG(item, lootedObject) == EQUIP_ERR_OK, *r); } @@ -1380,7 +1380,7 @@ void Group::CountRollVote(ObjectGuid playerGUID, ObjectGuid Guid, uint8 Choice) switch (Choice) { case ROLL_PASS: // Player choose pass - SendLootRoll(ObjectGuid::Empty, playerGUID, 128, ROLL_PASS, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, int32(-1), ROLL_PASS, *roll); ++roll->totalPass; itr->second = PASS; break; @@ -1390,12 +1390,12 @@ void Group::CountRollVote(ObjectGuid playerGUID, ObjectGuid Guid, uint8 Choice) itr->second = NEED; break; case ROLL_GREED: // player choose Greed - SendLootRoll(ObjectGuid::Empty, playerGUID, 128, ROLL_GREED, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, int32(-1), ROLL_GREED, *roll); ++roll->totalGreed; itr->second = GREED; break; case ROLL_DISENCHANT: // player choose Disenchant - SendLootRoll(ObjectGuid::Empty, playerGUID, 128, ROLL_DISENCHANT, *roll); + SendLootRoll(ObjectGuid::Empty, playerGUID, int32(-1), 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 93629bd0b1a..9522e1fa1f9 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -325,8 +325,8 @@ class TC_GAME_API Group bool isRollLootActive() const; void SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r); void SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r); - void SendLootRoll(ObjectGuid SourceGuid, ObjectGuid TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); - void SendLootRollWon(ObjectGuid SourceGuid, ObjectGuid TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); + void SendLootRoll(ObjectGuid SourceGuid, ObjectGuid TargetGuid, int8 RollNumber, uint8 RollType, const Roll &r); + void SendLootRollWon(ObjectGuid SourceGuid, ObjectGuid TargetGuid, int8 RollNumber, uint8 RollType, const Roll &r); void SendLootAllPassed(Roll const& roll); void SendLooter(Creature* creature, Player* pLooter); void GroupLoot(Loot* loot, WorldObject* pLootedObject);