Updated to latest PTR client build 10676.

This commit is contained in:
tomrus88 2009-10-24 19:38:37 +04:00
parent 2164bbad86
commit d599aea0ba
16 changed files with 132 additions and 50 deletions

View file

@ -479,7 +479,7 @@ void Group::Disband(bool hideDestroy)
void Group::SendLootStartRoll(uint32 CountDown, const Roll &r)
{
WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4));
WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4+1));
data << uint64(r.itemGUID); // guid of rolled item
data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it???
data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
@ -487,6 +487,7 @@ void Group::SendLootStartRoll(uint32 CountDown, const Roll &r)
data << uint32(r.itemRandomPropId); // item random property ID
data << uint32(r.itemCount); // items in stack
data << uint32(CountDown); // the countdown time to choose "need" or "greed"
data << uint8(ALL_ROLL_TYPE_MASK); // roll type mask
for (Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
{
@ -750,8 +751,15 @@ void Group::CountRollVote(const uint64& playerGUID, const uint64& Guid, uint32 N
itr->second = GREED;
}
break;
case ROLL_DISENCHANT: // player choose Disenchant
{
SendLootRoll(0, playerGUID, 128, ROLL_DISENCHANT, *roll);
++roll->totalDisenchant;
itr->second = DISENCHANT;
}
break;
}
if (roll->totalPass + roll->totalGreed + roll->totalNeed >= roll->totalPlayersRolling)
if (roll->totalPass + roll->totalNeed + roll->totalGreed + roll->totalDisenchant >= roll->totalPlayersRolling)
{
CountTheRoll(rollI, NumberOfPlayers);
}
@ -872,6 +880,39 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
}
}
}
else if(roll->totalDisenchant > 0)
{
uint8 maxresul = 0;
uint64 maxguid = (*roll->playerVote.begin()).first;
Player *player;
for( Roll::PlayerVote::const_iterator itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
{
if (itr->second != DISENCHANT)
continue;
uint8 randomN = urand(1, 99);
SendLootRoll(0, itr->first, randomN, ROLL_DISENCHANT, *roll);
if (maxresul < randomN)
{
maxguid = itr->first;
maxresul = randomN;
}
}
SendLootRollWon(0, maxguid, maxresul, ROLL_DISENCHANT, *roll);
player = objmgr.GetPlayer(maxguid);
if(player && player->GetSession())
{
LootItem *item = &(roll->getLoot()->items[roll->itemSlot]);
item->is_looted = true;
roll->getLoot()->NotifyItemRemoved(roll->itemSlot);
--roll->getLoot()->unlootedCount;
ItemPrototype const *pProto = objmgr.GetItemPrototype(roll->itemid);
player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true);
}
}
else
{
SendLootAllPassed(NumberOfPlayers, *roll);
@ -976,6 +1017,7 @@ void Group::SendUpdate()
data << (uint8)(onlineState);
data << (uint8)(citr2->group); // groupid
data << (uint8)(citr2->assistant?0x01:0); // 0x2 main assist, 0x4 main tank
data << uint8(0); // 3.3
}
data << uint64(m_leaderGuid); // leader guid
@ -986,6 +1028,7 @@ void Group::SendUpdate()
data << (uint8)m_lootThreshold; // loot threshold
data << (uint8)m_dungeonDifficulty; // Dungeon Difficulty
data << (uint8)m_raidDifficulty; // Raid Difficulty
data << uint8(0); // 3.3
}
player->GetSession()->SendPacket( &data );
}
@ -1236,6 +1279,8 @@ void Group::_removeRolls(const uint64 &guid)
--roll->totalNeed;
if (itr2->second == PASS)
--roll->totalPass;
if (itr2->second == DISENCHANT)
--roll->totalDisenchant;
if (itr2->second != NOT_VALID)
--roll->totalPlayersRolling;