Core/Loot: Correct some values sent for roll packets
This commit is contained in:
@@ -525,7 +525,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
|
||||
roll->playerVote.erase(itr2);
|
||||
|
||||
CountRollVote(guid, roll->itemGUID, GetMembersCount()-1, MAX_ROLL_TYPE);
|
||||
CountRollVote(guid, roll->itemGUID, MAX_ROLL_TYPE);
|
||||
}
|
||||
|
||||
// Update subgroups
|
||||
@@ -732,7 +732,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r)
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4+1));
|
||||
data << uint64(r.itemGUID); // guid of rolled item
|
||||
data << uint32(mapid); // 3.3.3 mapid
|
||||
data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it???
|
||||
data << uint32(r.itemSlot); // itemslot
|
||||
data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
data << uint32(r.itemRandomSuffix); // randomSuffix
|
||||
data << uint32(r.itemRandomPropId); // item random property ID
|
||||
@@ -759,7 +759,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p,
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1));
|
||||
data << uint64(r.itemGUID); // guid of rolled item
|
||||
data << uint32(mapId); // 3.3.3 mapid
|
||||
data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it???
|
||||
data << uint32(r.itemSlot); // itemslot
|
||||
data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
data << uint32(r.itemRandomSuffix); // randomSuffix
|
||||
data << uint32(r.itemRandomPropId); // item random property ID
|
||||
@@ -773,20 +773,20 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p,
|
||||
p->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Group::SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r)
|
||||
void Group::SendLootRoll(uint64 sourceGuid, uint64 targetGuid, uint8 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
|
||||
data << uint32(0); // unknown, maybe amount of players
|
||||
data << uint64(TargetGuid);
|
||||
data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
data << uint32(r.itemRandomSuffix); // randomSuffix
|
||||
data << uint32(r.itemRandomPropId); // Item random property ID
|
||||
data << uint8(RollNumber); // 0: "Need for: [item name]" > 127: "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); // auto pass on NeedBeforeGreed loot because player cannot use the object
|
||||
data << uint64(sourceGuid); // guid of the item rolled
|
||||
data << uint32(roll.itemSlot); // slot
|
||||
data << uint64(targetGuid);
|
||||
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 << uint8(rollNumber); // 0: "Need for: [item name]" > 127: "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
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr)
|
||||
{
|
||||
Player* p = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!p || !p->GetSession())
|
||||
@@ -797,19 +797,19 @@ void Group::SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber,
|
||||
}
|
||||
}
|
||||
|
||||
void Group::SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r)
|
||||
void Group::SendLootRollWon(uint64 sourceGuid, uint64 targetGuid, uint8 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
|
||||
data << uint32(0); // unknown, maybe amount of players
|
||||
data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
data << uint32(r.itemRandomSuffix); // randomSuffix
|
||||
data << uint32(r.itemRandomPropId); // Item random property
|
||||
data << uint64(TargetGuid); // guid of the player who won.
|
||||
data << uint8(RollNumber); // rollnumber realted to SMSG_LOOT_ROLL
|
||||
data << uint8(RollType); // Rolltype related to SMSG_LOOT_ROLL
|
||||
data << uint64(sourceGuid); // guid of the item rolled
|
||||
data << uint32(roll.itemSlot); // slot
|
||||
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
|
||||
data << uint64(targetGuid); // guid of the player who won.
|
||||
data << uint8(rollNumber); // rollnumber realted to SMSG_LOOT_ROLL
|
||||
data << uint8(rollType); // rollType related to SMSG_LOOT_ROLL
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr)
|
||||
{
|
||||
Player* p = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!p || !p->GetSession())
|
||||
@@ -820,11 +820,11 @@ void Group::SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumb
|
||||
}
|
||||
}
|
||||
|
||||
void Group::SendLootAllPassed(uint32 numberOfPlayers, Roll const& roll)
|
||||
void Group::SendLootAllPassed(Roll const& roll)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ALL_PASSED, (8+4+4+4+4));
|
||||
data << uint64(roll.itemGUID); // Guid of the item rolled
|
||||
data << uint32(numberOfPlayers); // The number of players rolling for it
|
||||
data << uint32(roll.itemSlot); // Item loot slot
|
||||
data << uint32(roll.itemid); // The itemEntryId for the item that shall be rolled for
|
||||
data << uint32(roll.itemRandomPropId); // Item random property ID
|
||||
data << uint32(roll.itemRandomSuffix); // Item random suffix ID
|
||||
@@ -1067,7 +1067,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject)
|
||||
}
|
||||
}
|
||||
|
||||
void Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint32 NumberOfPlayers, uint8 Choice)
|
||||
void Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choice)
|
||||
{
|
||||
Rolls::iterator rollI = GetRoll(Guid);
|
||||
if (rollI == RollId.end())
|
||||
@@ -1108,7 +1108,7 @@ void Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint32 NumberOfPlayers
|
||||
}
|
||||
|
||||
if (roll->totalPass + roll->totalNeed + roll->totalGreed >= roll->totalPlayersRolling)
|
||||
CountTheRoll(rollI, NumberOfPlayers);
|
||||
CountTheRoll(rollI);
|
||||
}
|
||||
|
||||
//called when roll timer expires
|
||||
@@ -1117,7 +1117,7 @@ void Group::EndRoll(Loot* pLoot)
|
||||
for (Rolls::iterator itr = RollId.begin(); itr != RollId.end();)
|
||||
{
|
||||
if ((*itr)->getLoot() == pLoot) {
|
||||
CountTheRoll(itr, GetMembersCount()); //i don't have to edit player votes, who didn't vote ... he will pass
|
||||
CountTheRoll(itr); //i don't have to edit player votes, who didn't vote ... he will pass
|
||||
itr = RollId.begin();
|
||||
}
|
||||
else
|
||||
@@ -1125,7 +1125,7 @@ void Group::EndRoll(Loot* pLoot)
|
||||
}
|
||||
}
|
||||
|
||||
void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
||||
void Group::CountTheRoll(Rolls::iterator rollI)
|
||||
{
|
||||
Roll* roll = *rollI;
|
||||
if (!roll->isValid()) // is loot already deleted ?
|
||||
@@ -1248,7 +1248,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
||||
}
|
||||
else
|
||||
{
|
||||
SendLootAllPassed(NumberOfPlayers, *roll);
|
||||
SendLootAllPassed(*roll);
|
||||
|
||||
// remove is_blocked so that the item is lootable by all players
|
||||
LootItem* item = &(roll->getLoot()->items[roll->itemSlot]);
|
||||
|
||||
@@ -276,14 +276,14 @@ class Group
|
||||
void SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r);
|
||||
void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
|
||||
void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
|
||||
void SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r);
|
||||
void SendLootAllPassed(Roll const& roll);
|
||||
void SendLooter(Creature* creature, Player* pLooter);
|
||||
void GroupLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
void NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject);
|
||||
void MasterLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
Rolls::iterator GetRoll(uint64 Guid);
|
||||
void CountTheRoll(Rolls::iterator roll, uint32 NumberOfPlayers);
|
||||
void CountRollVote(uint64 playerGUID, uint64 Guid, uint32 NumberOfPlayers, uint8 Choise);
|
||||
void CountTheRoll(Rolls::iterator roll);
|
||||
void CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choise);
|
||||
void EndRoll(Loot* loot);
|
||||
|
||||
// related to disenchant rolls
|
||||
|
||||
@@ -429,7 +429,7 @@ void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data)
|
||||
group->SendUpdate();
|
||||
}
|
||||
|
||||
void WorldSession::HandleLootRoll(WorldPacket &recv_data)
|
||||
void WorldSession::HandleLootRoll(WorldPacket& recvData)
|
||||
{
|
||||
Group* group = GetPlayer()->GetGroup();
|
||||
if (!group)
|
||||
@@ -438,15 +438,15 @@ void WorldSession::HandleLootRoll(WorldPacket &recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
uint64 Guid;
|
||||
uint32 NumberOfPlayers;
|
||||
uint64 guid;
|
||||
uint32 itemSlot;
|
||||
uint8 rollType;
|
||||
recv_data >> Guid; //guid of the item rolled
|
||||
recv_data >> NumberOfPlayers;
|
||||
recv_data >> rollType; //0: pass, 1: need, 2: greed
|
||||
recvData >> guid; // guid of the item rolled
|
||||
recvData >> itemSlot;
|
||||
recvData >> rollType; // 0: pass, 1: need, 2: greed
|
||||
|
||||
// everything's fine, do it
|
||||
group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, rollType);
|
||||
group->CountRollVote(GetPlayer()->GetGUID(), guid, rollType);
|
||||
|
||||
switch (rollType)
|
||||
{
|
||||
|
||||
@@ -220,16 +220,18 @@ void WorldSession::HandleLootOpcode(WorldPacket & recv_data)
|
||||
GetPlayer()->InterruptNonMeleeSpells(false);
|
||||
}
|
||||
|
||||
void WorldSession::HandleLootReleaseOpcode(WorldPacket & recv_data)
|
||||
void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE");
|
||||
|
||||
// cheaters can modify lguid to prevent correct apply loot release code and re-loot
|
||||
// use internal stored guid
|
||||
recv_data.read_skip<uint64>(); // guid;
|
||||
uint64 guid;
|
||||
recvData >> guid;
|
||||
|
||||
if (uint64 lguid = GetPlayer()->GetLootGUID())
|
||||
DoLootRelease(lguid);
|
||||
if (lguid == guid)
|
||||
DoLootRelease(lguid);
|
||||
}
|
||||
|
||||
void WorldSession::DoLootRelease(uint64 lguid)
|
||||
|
||||
Reference in New Issue
Block a user