Core/Loot: fixed loot roll packet structures

This commit is contained in:
Ovahlord
2019-08-22 19:06:03 +02:00
parent fc1956dc4d
commit c6f6861dbf
2 changed files with 12 additions and 12 deletions

View File

@@ -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;

View File

@@ -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);