Update Group for 322a
--HG-- branch : trunk
This commit is contained in:
+8
-12
@@ -547,13 +547,13 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
|||||||
|
|
||||||
WorldPacket data( SMSG_QUEST_QUERY_RESPONSE, 100 ); // guess size
|
WorldPacket data( SMSG_QUEST_QUERY_RESPONSE, 100 ); // guess size
|
||||||
|
|
||||||
data << uint32(pQuest->GetQuestId());
|
data << uint32(pQuest->GetQuestId()); // quest id
|
||||||
data << uint32(pQuest->GetQuestMethod()); // Accepted values: 0, 1 or 2. 0==IsAutoComplete() (skip objectives/details)
|
data << uint32(pQuest->GetQuestMethod()); // Accepted values: 0, 1 or 2. 0==IsAutoComplete() (skip objectives/details)
|
||||||
data << uint32(pQuest->GetQuestLevel()); // may be -1, static data, in other cases must be used dynamic level: Player::GetQuestLevel (0 is not known, but assuming this is no longer valid for quest intended for client)
|
data << uint32(pQuest->GetQuestLevel()); // may be -1, static data, in other cases must be used dynamic level: Player::GetQuestLevel (0 is not known, but assuming this is no longer valid for quest intended for client)
|
||||||
data << uint32(pQuest->GetZoneOrSort()); // zone or sort to display in quest log
|
data << uint32(pQuest->GetZoneOrSort()); // zone or sort to display in quest log
|
||||||
|
|
||||||
data << uint32(pQuest->GetType());
|
data << uint32(pQuest->GetType()); // quest type
|
||||||
data << uint32(pQuest->GetSuggestedPlayers());
|
data << uint32(pQuest->GetSuggestedPlayers()); // suggested players count
|
||||||
|
|
||||||
data << uint32(pQuest->GetRepObjectiveFaction()); // shown in quest log as part of quest objective
|
data << uint32(pQuest->GetRepObjectiveFaction()); // shown in quest log as part of quest objective
|
||||||
data << uint32(pQuest->GetRepObjectiveValue()); // shown in quest log as part of quest objective
|
data << uint32(pQuest->GetRepObjectiveValue()); // shown in quest log as part of quest objective
|
||||||
@@ -566,7 +566,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
|||||||
if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
|
if (pQuest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS))
|
||||||
data << uint32(0); // Hide money rewarded
|
data << uint32(0); // Hide money rewarded
|
||||||
else
|
else
|
||||||
data << uint32(pQuest->GetRewOrReqMoney());
|
data << uint32(pQuest->GetRewOrReqMoney()); // reward money (below max lvl)
|
||||||
|
|
||||||
data << uint32(pQuest->GetRewMoneyMaxLevel()); // used in XP calculation at client
|
data << uint32(pQuest->GetRewMoneyMaxLevel()); // used in XP calculation at client
|
||||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
|
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
|
||||||
@@ -574,8 +574,8 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
|||||||
|
|
||||||
// rewarded honor points
|
// rewarded honor points
|
||||||
data << uint32(Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
data << uint32(Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
||||||
data << uint32(pQuest->GetSrcItemId());
|
data << uint32(pQuest->GetSrcItemId()); // source item id
|
||||||
data << uint32(pQuest->GetFlags() & 0xFFFF);
|
data << uint32(pQuest->GetFlags() & 0xFFFF); // quest flags
|
||||||
data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
|
data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
|
||||||
data << uint32(pQuest->GetPlayersSlain()); // players slain
|
data << uint32(pQuest->GetPlayersSlain()); // players slain
|
||||||
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
||||||
@@ -628,15 +628,12 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
|||||||
data << uint32(pQuest->ReqSourceId[iI]);
|
data << uint32(pQuest->ReqSourceId[iI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI)
|
for (iI = 0; iI < QUEST_ITEM_OBJECTIVES_COUNT; ++iI)
|
||||||
{
|
{
|
||||||
data << uint32(pQuest->ReqItemId[iI]);
|
data << uint32(pQuest->ReqItemId[iI]);
|
||||||
data << uint32(pQuest->ReqItemCount[iI]);
|
data << uint32(pQuest->ReqItemCount[iI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
data << uint32(0); // TODO: 5 item objective
|
|
||||||
data << uint32(0);
|
|
||||||
|
|
||||||
for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI)
|
for (iI = 0; iI < QUEST_OBJECTIVES_COUNT; ++iI)
|
||||||
data << ObjectiveText[iI];
|
data << ObjectiveText[iI];
|
||||||
|
|
||||||
@@ -782,7 +779,7 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
|
|||||||
|
|
||||||
data << uint32( pQuest->GetReqItemsCount() );
|
data << uint32( pQuest->GetReqItemsCount() );
|
||||||
ItemPrototype const *pItem;
|
ItemPrototype const *pItem;
|
||||||
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||||
{
|
{
|
||||||
if ( !pQuest->ReqItemId[i] ) continue;
|
if ( !pQuest->ReqItemId[i] ) continue;
|
||||||
pItem = objmgr.GetItemPrototype(pQuest->ReqItemId[i]);
|
pItem = objmgr.GetItemPrototype(pQuest->ReqItemId[i]);
|
||||||
@@ -807,4 +804,3 @@ void PlayerMenu::SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID
|
|||||||
pSession->SendPacket( &data );
|
pSession->SendPacket( &data );
|
||||||
sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId() );
|
sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -207,4 +207,3 @@ class TRINITY_DLL_SPEC PlayerMenu
|
|||||||
void SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel );
|
void SendQuestGiverRequestItems( Quest const *pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel );
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -191,4 +191,3 @@ namespace Trinity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1244,4 +1244,3 @@ namespace Trinity
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+115
-45
@@ -71,7 +71,7 @@ Group::~Group()
|
|||||||
// it is undefined whether objectmgr (which stores the groups) or instancesavemgr
|
// it is undefined whether objectmgr (which stores the groups) or instancesavemgr
|
||||||
// will be unloaded first so we must be prepared for both cases
|
// will be unloaded first so we must be prepared for both cases
|
||||||
// this may unload some instance saves
|
// this may unload some instance saves
|
||||||
for (uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
||||||
for (BoundInstancesMap::iterator itr2 = m_boundInstances[i].begin(); itr2 != m_boundInstances[i].end(); ++itr2)
|
for (BoundInstancesMap::iterator itr2 = m_boundInstances[i].begin(); itr2 != m_boundInstances[i].end(); ++itr2)
|
||||||
itr2->second.save->RemoveGroup(this);
|
itr2->second.save->RemoveGroup(this);
|
||||||
|
|
||||||
@@ -94,11 +94,16 @@ bool Group::Create(const uint64 &guid, const char * name)
|
|||||||
m_lootThreshold = ITEM_QUALITY_UNCOMMON;
|
m_lootThreshold = ITEM_QUALITY_UNCOMMON;
|
||||||
m_looterGuid = guid;
|
m_looterGuid = guid;
|
||||||
|
|
||||||
m_difficulty = DIFFICULTY_NORMAL;
|
m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL;
|
||||||
|
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
|
||||||
if(!isBGGroup())
|
if(!isBGGroup())
|
||||||
{
|
{
|
||||||
Player *leader = objmgr.GetPlayer(guid);
|
Player *leader = objmgr.GetPlayer(guid);
|
||||||
if(leader) m_difficulty = leader->GetDifficulty();
|
if(leader)
|
||||||
|
{
|
||||||
|
m_dungeonDifficulty = leader->GetDungeonDifficulty();
|
||||||
|
m_raidDifficulty = leader->GetRaidDifficulty();
|
||||||
|
}
|
||||||
|
|
||||||
Player::ConvertInstancesToGroup(leader, this, guid);
|
Player::ConvertInstancesToGroup(leader, this, guid);
|
||||||
|
|
||||||
@@ -106,10 +111,10 @@ bool Group::Create(const uint64 &guid, const char * name)
|
|||||||
CharacterDatabase.BeginTransaction();
|
CharacterDatabase.BeginTransaction();
|
||||||
CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
|
CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
|
||||||
CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
|
CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
|
||||||
CharacterDatabase.PExecute("INSERT INTO groups(leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid,difficulty) "
|
CharacterDatabase.PExecute("INSERT INTO groups (leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid,difficulty,raiddifficulty) "
|
||||||
"VALUES('%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u')",
|
"VALUES ('%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','%u')",
|
||||||
GUID_LOPART(m_leaderGuid), GUID_LOPART(m_mainTank), GUID_LOPART(m_mainAssistant), uint32(m_lootMethod),
|
GUID_LOPART(m_leaderGuid), GUID_LOPART(m_mainTank), GUID_LOPART(m_mainAssistant), uint32(m_lootMethod),
|
||||||
GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], isRaidGroup(), m_difficulty);
|
GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], isRaidGroup(), uint32(m_dungeonDifficulty), m_raidDifficulty);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!AddMember(guid, name))
|
if(!AddMember(guid, name))
|
||||||
@@ -129,8 +134,8 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool
|
|||||||
if(!result)
|
if(!result)
|
||||||
{
|
{
|
||||||
external = false;
|
external = false;
|
||||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||||
result = CharacterDatabase.PQuery("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(leaderGuid));
|
result = CharacterDatabase.PQuery("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, raiddifficulty FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(leaderGuid));
|
||||||
if(!result)
|
if(!result)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -149,7 +154,16 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool
|
|||||||
if (m_groupType == GROUPTYPE_RAID)
|
if (m_groupType == GROUPTYPE_RAID)
|
||||||
_initRaidSubGroupsCounter();
|
_initRaidSubGroupsCounter();
|
||||||
|
|
||||||
m_difficulty = (*result)[14].GetUInt8();
|
uint32 diff = (*result)[14].GetUInt8();
|
||||||
|
if (diff >= MAX_DUNGEON_DIFFICULTY)
|
||||||
|
diff = DUNGEON_DIFFICULTY_NORMAL;
|
||||||
|
m_dungeonDifficulty = Difficulty(diff);
|
||||||
|
|
||||||
|
uint32 r_diff = (*result)[15].GetUInt8();
|
||||||
|
if (r_diff >= MAX_RAID_DIFFICULTY)
|
||||||
|
r_diff = RAID_DIFFICULTY_10MAN_NORMAL;
|
||||||
|
m_raidDifficulty = Difficulty(r_diff);
|
||||||
|
|
||||||
m_mainTank = (*result)[0].GetUInt64();
|
m_mainTank = (*result)[0].GetUInt64();
|
||||||
m_mainAssistant = (*result)[1].GetUInt64();
|
m_mainAssistant = (*result)[1].GetUInt64();
|
||||||
m_lootMethod = (LootMethod)(*result)[2].GetUInt8();
|
m_lootMethod = (LootMethod)(*result)[2].GetUInt8();
|
||||||
@@ -291,13 +305,22 @@ bool Group::AddMember(const uint64 &guid, const char* name)
|
|||||||
{
|
{
|
||||||
// reset the new member's instances, unless he is currently in one of them
|
// reset the new member's instances, unless he is currently in one of them
|
||||||
// including raid/heroic instances that they are not permanently bound to!
|
// including raid/heroic instances that they are not permanently bound to!
|
||||||
player->ResetInstances(INSTANCE_RESET_GROUP_JOIN);
|
player->ResetInstances(INSTANCE_RESET_GROUP_JOIN,false);
|
||||||
|
player->ResetInstances(INSTANCE_RESET_GROUP_JOIN,true);
|
||||||
|
|
||||||
if(player->getLevel() >= LEVELREQUIREMENT_HEROIC && player->GetDifficulty() != GetDifficulty() )
|
if (player->getLevel() >= LEVELREQUIREMENT_HEROIC)
|
||||||
{
|
{
|
||||||
player->SetDifficulty(m_difficulty);
|
if (player->GetDungeonDifficulty() != GetDungeonDifficulty())
|
||||||
|
{
|
||||||
|
player->SetDungeonDifficulty(GetDungeonDifficulty());
|
||||||
player->SendDungeonDifficulty(true);
|
player->SendDungeonDifficulty(true);
|
||||||
}
|
}
|
||||||
|
if (player->GetRaidDifficulty() != GetRaidDifficulty())
|
||||||
|
{
|
||||||
|
player->SetRaidDifficulty(GetRaidDifficulty());
|
||||||
|
player->SendRaidDifficulty(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
player->SetGroupUpdateFlag(GROUP_UPDATE_FULL);
|
player->SetGroupUpdateFlag(GROUP_UPDATE_FULL);
|
||||||
UpdatePlayerOutOfRange(player);
|
UpdatePlayerOutOfRange(player);
|
||||||
@@ -441,7 +464,8 @@ void Group::Disband(bool hideDestroy)
|
|||||||
CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid='%u'", GUID_LOPART(m_leaderGuid));
|
CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid='%u'", GUID_LOPART(m_leaderGuid));
|
||||||
CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid='%u'", GUID_LOPART(m_leaderGuid));
|
CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid='%u'", GUID_LOPART(m_leaderGuid));
|
||||||
CharacterDatabase.CommitTransaction();
|
CharacterDatabase.CommitTransaction();
|
||||||
ResetInstances(INSTANCE_RESET_GROUP_DISBAND, NULL);
|
ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, NULL);
|
||||||
|
ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_leaderGuid = 0;
|
m_leaderGuid = 0;
|
||||||
@@ -454,12 +478,13 @@ void Group::Disband(bool hideDestroy)
|
|||||||
|
|
||||||
void Group::SendLootStartRoll(uint32 CountDown, const Roll &r)
|
void Group::SendLootStartRoll(uint32 CountDown, const Roll &r)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4));
|
WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4));
|
||||||
data << uint64(r.itemGUID); // guid of rolled item
|
data << uint64(r.itemGUID); // guid of rolled item
|
||||||
data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it???
|
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
|
data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for
|
||||||
data << uint32(r.itemRandomSuffix); // randomSuffix
|
data << uint32(r.itemRandomSuffix); // randomSuffix
|
||||||
data << uint32(r.itemRandomPropId); // item random property ID
|
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 << uint32(CountDown); // the countdown time to choose "need" or "greed"
|
||||||
|
|
||||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
||||||
@@ -475,7 +500,7 @@ void Group::SendLootStartRoll(uint32 CountDown, const Roll &r)
|
|||||||
|
|
||||||
void Group::SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r)
|
void Group::SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1));
|
WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1+1));
|
||||||
data << uint64(SourceGuid); // guid of the item rolled
|
data << uint64(SourceGuid); // guid of the item rolled
|
||||||
data << uint32(0); // unknown, maybe amount of players
|
data << uint32(0); // unknown, maybe amount of players
|
||||||
data << uint64(TargetGuid);
|
data << uint64(TargetGuid);
|
||||||
@@ -704,23 +729,23 @@ void Group::CountRollVote(const uint64& playerGUID, const uint64& Guid, uint32 N
|
|||||||
|
|
||||||
switch (Choise)
|
switch (Choise)
|
||||||
{
|
{
|
||||||
case 0: //Player choose pass
|
case ROLL_PASS: // Player choose pass
|
||||||
{
|
{
|
||||||
SendLootRoll(0, playerGUID, 128, 128, *roll);
|
SendLootRoll(0, playerGUID, 0, ROLL_PASS, *roll);
|
||||||
++roll->totalPass;
|
++roll->totalPass;
|
||||||
itr->second = PASS;
|
itr->second = PASS;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: //player choose Need
|
case ROLL_NEED: // player choose Need
|
||||||
{
|
{
|
||||||
SendLootRoll(0, playerGUID, 0, 0, *roll);
|
SendLootRoll(0, playerGUID, 0, ROLL_NEED, *roll);
|
||||||
++roll->totalNeed;
|
++roll->totalNeed;
|
||||||
itr->second = NEED;
|
itr->second = NEED;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2: //player choose Greed
|
case ROLL_GREED: // player choose Greed
|
||||||
{
|
{
|
||||||
SendLootRoll(0, playerGUID, 128, 2, *roll);
|
SendLootRoll(0, playerGUID, 128, ROLL_GREED, *roll);
|
||||||
++roll->totalGreed;
|
++roll->totalGreed;
|
||||||
itr->second = GREED;
|
itr->second = GREED;
|
||||||
}
|
}
|
||||||
@@ -768,14 +793,14 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint8 randomN = urand(1, 99);
|
uint8 randomN = urand(1, 99);
|
||||||
SendLootRoll(0, itr->first, randomN, 1, *roll);
|
SendLootRoll(0, itr->first, randomN, ROLL_NEED, *roll);
|
||||||
if (maxresul < randomN)
|
if (maxresul < randomN)
|
||||||
{
|
{
|
||||||
maxguid = itr->first;
|
maxguid = itr->first;
|
||||||
maxresul = randomN;
|
maxresul = randomN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SendLootRollWon(0, maxguid, maxresul, 1, *roll);
|
SendLootRollWon(0, maxguid, maxresul, ROLL_NEED, *roll);
|
||||||
player = objmgr.GetPlayer(maxguid);
|
player = objmgr.GetPlayer(maxguid);
|
||||||
|
|
||||||
if(player && player->GetSession())
|
if(player && player->GetSession())
|
||||||
@@ -815,14 +840,14 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint8 randomN = urand(1, 99);
|
uint8 randomN = urand(1, 99);
|
||||||
SendLootRoll(0, itr->first, randomN, 2, *roll);
|
SendLootRoll(0, itr->first, randomN, ROLL_GREED, *roll);
|
||||||
if (maxresul < randomN)
|
if (maxresul < randomN)
|
||||||
{
|
{
|
||||||
maxguid = itr->first;
|
maxguid = itr->first;
|
||||||
maxresul = randomN;
|
maxresul = randomN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SendLootRollWon(0, maxguid, maxresul, 2, *roll);
|
SendLootRollWon(0, maxguid, maxresul, ROLL_GREED, *roll);
|
||||||
player = objmgr.GetPlayer(maxguid);
|
player = objmgr.GetPlayer(maxguid);
|
||||||
|
|
||||||
if(player && player->GetSession())
|
if(player && player->GetSession())
|
||||||
@@ -959,7 +984,8 @@ void Group::SendUpdate()
|
|||||||
data << (uint8)m_lootMethod; // loot method
|
data << (uint8)m_lootMethod; // loot method
|
||||||
data << (uint64)m_looterGuid; // looter guid
|
data << (uint64)m_looterGuid; // looter guid
|
||||||
data << (uint8)m_lootThreshold; // loot threshold
|
data << (uint8)m_lootThreshold; // loot threshold
|
||||||
data << (uint8)m_difficulty; // Heroic Mod Group
|
data << (uint8)m_dungeonDifficulty; // Dungeon Difficulty
|
||||||
|
data << (uint8)m_raidDifficulty; // Raid Difficulty
|
||||||
}
|
}
|
||||||
player->GetSession()->SendPacket( &data );
|
player->GetSession()->SendPacket( &data );
|
||||||
}
|
}
|
||||||
@@ -1076,7 +1102,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
|
|||||||
else
|
else
|
||||||
player->SetGroup(this, group);
|
player->SetGroup(this, group);
|
||||||
// if the same group invites the player back, cancel the homebind timer
|
// if the same group invites the player back, cancel the homebind timer
|
||||||
InstanceGroupBind *bind = GetBoundInstance(player->GetMapId(), player->GetDifficulty());
|
InstanceGroupBind *bind = GetBoundInstance(player);
|
||||||
if(bind && bind->save->GetInstanceId() == player->GetInstanceId())
|
if(bind && bind->save->GetInstanceId() == player->GetInstanceId())
|
||||||
player->m_InstanceValid = true;
|
player->m_InstanceValid = true;
|
||||||
}
|
}
|
||||||
@@ -1162,7 +1188,7 @@ void Group::_setLeader(const uint64 &guid)
|
|||||||
Player *player = objmgr.GetPlayer(slot->guid);
|
Player *player = objmgr.GetPlayer(slot->guid);
|
||||||
if(player)
|
if(player)
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
||||||
{
|
{
|
||||||
for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end();)
|
for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end();)
|
||||||
{
|
{
|
||||||
@@ -1211,7 +1237,7 @@ void Group::_removeRolls(const uint64 &guid)
|
|||||||
|
|
||||||
roll->playerVote.erase(itr2);
|
roll->playerVote.erase(itr2);
|
||||||
|
|
||||||
CountRollVote(guid, roll->itemGUID, GetMembersCount()-1, 3);
|
CountRollVote(guid, roll->itemGUID, GetMembersCount()-1, MAX_ROLL_TYPE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1449,19 +1475,38 @@ void Roll::targetObjectBuildLink()
|
|||||||
getTarget()->addLootValidatorRef(this);
|
getTarget()->addLootValidatorRef(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::SetDifficulty(uint8 difficulty)
|
void Group::SetDungeonDifficulty(Difficulty difficulty)
|
||||||
{
|
{
|
||||||
m_difficulty = difficulty;
|
m_dungeonDifficulty = difficulty;
|
||||||
if(!isBGGroup())
|
if(!isBGGroup())
|
||||||
CharacterDatabase.PExecute("UPDATE groups SET difficulty = %u WHERE leaderGuid ='%u'", m_difficulty, GUID_LOPART(m_leaderGuid));
|
CharacterDatabase.PExecute("UPDATE groups SET difficulty = %u WHERE leaderGuid ='%u'", m_dungeonDifficulty, GUID_LOPART(m_leaderGuid));
|
||||||
|
|
||||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||||
{
|
{
|
||||||
Player *player = itr->getSource();
|
Player *player = itr->getSource();
|
||||||
if(!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC)
|
if(!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC)
|
||||||
continue;
|
continue;
|
||||||
player->SetDifficulty(difficulty);
|
player->SetDungeonDifficulty(difficulty);
|
||||||
player->SendDungeonDifficulty(true);
|
player->SendDungeonDifficulty(true);
|
||||||
|
//send player to recall positio nis a dungeon (to avoid an exploit)
|
||||||
|
if (sMapStore.LookupEntry(player->GetMap()->IsDungeon()))
|
||||||
|
player->TeleportTo(player->m_recallMap, player->m_recallX, player->m_recallY, player->m_recallZ, player->m_recallO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Group::SetRaidDifficulty(Difficulty difficulty)
|
||||||
|
{
|
||||||
|
m_raidDifficulty = difficulty;
|
||||||
|
if(!isBGGroup())
|
||||||
|
CharacterDatabase.PExecute("UPDATE groups SET raiddifficulty = %u WHERE leaderGuid ='%u'", m_raidDifficulty, GUID_LOPART(m_leaderGuid));
|
||||||
|
|
||||||
|
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||||
|
{
|
||||||
|
Player *player = itr->getSource();
|
||||||
|
if(!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC)
|
||||||
|
continue;
|
||||||
|
player->SetRaidDifficulty(difficulty);
|
||||||
|
player->SendRaidDifficulty(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1470,7 +1515,7 @@ bool Group::InCombatToInstance(uint32 instanceId)
|
|||||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||||
{
|
{
|
||||||
Player *pPlayer = itr->getSource();
|
Player *pPlayer = itr->getSource();
|
||||||
if(pPlayer && pPlayer->getAttackers().size() && pPlayer->GetInstanceId() == instanceId && (pPlayer->GetMap()->IsRaid() || pPlayer->GetMap()->IsHeroic()))
|
if(pPlayer && pPlayer->getAttackers().size() && pPlayer->GetInstanceId() == instanceId && (pPlayer->GetMap()->IsRaidOrHeroicDungeon()))
|
||||||
for (std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i!=pPlayer->getAttackers().end(); ++i)
|
for (std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i!=pPlayer->getAttackers().end(); ++i)
|
||||||
if((*i) && (*i)->GetTypeId() == TYPEID_UNIT && ((Creature*)(*i))->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
|
if((*i) && (*i)->GetTypeId() == TYPEID_UNIT && ((Creature*)(*i))->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
|
||||||
return true;
|
return true;
|
||||||
@@ -1478,7 +1523,7 @@ bool Group::InCombatToInstance(uint32 instanceId)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::ResetInstances(uint8 method, Player* SendMsgTo)
|
void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
|
||||||
{
|
{
|
||||||
if(isBGGroup())
|
if(isBGGroup())
|
||||||
return;
|
return;
|
||||||
@@ -1486,13 +1531,13 @@ void Group::ResetInstances(uint8 method, Player* SendMsgTo)
|
|||||||
// method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_DISBAND
|
// method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_DISBAND
|
||||||
|
|
||||||
// we assume that when the difficulty changes, all instances that can be reset will be
|
// we assume that when the difficulty changes, all instances that can be reset will be
|
||||||
uint8 dif = GetDifficulty();
|
Difficulty diff = GetDifficulty(isRaid);
|
||||||
|
|
||||||
for (BoundInstancesMap::iterator itr = m_boundInstances[dif].begin(); itr != m_boundInstances[dif].end();)
|
for (BoundInstancesMap::iterator itr = m_boundInstances[diff].begin(); itr != m_boundInstances[diff].end(); )
|
||||||
{
|
{
|
||||||
InstanceSave *p = itr->second.save;
|
InstanceSave *p = itr->second.save;
|
||||||
const MapEntry *entry = sMapStore.LookupEntry(itr->first);
|
const MapEntry *entry = sMapStore.LookupEntry(itr->first);
|
||||||
if(!entry || (!p->CanReset() && method != INSTANCE_RESET_GROUP_DISBAND))
|
if(!entry || entry->IsRaid() != isRaid || !p->CanReset() && method != INSTANCE_RESET_GROUP_DISBAND)
|
||||||
{
|
{
|
||||||
++itr;
|
++itr;
|
||||||
continue;
|
continue;
|
||||||
@@ -1501,7 +1546,7 @@ void Group::ResetInstances(uint8 method, Player* SendMsgTo)
|
|||||||
if(method == INSTANCE_RESET_ALL)
|
if(method == INSTANCE_RESET_ALL)
|
||||||
{
|
{
|
||||||
// the "reset all instances" method can only reset normal maps
|
// the "reset all instances" method can only reset normal maps
|
||||||
if(dif == DIFFICULTY_HEROIC || entry->map_type == MAP_RAID)
|
if (entry->map_type == MAP_RAID || diff == DUNGEON_DIFFICULTY_HEROIC)
|
||||||
{
|
{
|
||||||
++itr;
|
++itr;
|
||||||
continue;
|
continue;
|
||||||
@@ -1531,8 +1576,8 @@ void Group::ResetInstances(uint8 method, Player* SendMsgTo)
|
|||||||
if(p->CanReset()) p->DeleteFromDB();
|
if(p->CanReset()) p->DeleteFromDB();
|
||||||
else CharacterDatabase.PExecute("DELETE FROM group_instance WHERE instance = '%u'", p->GetInstanceId());
|
else CharacterDatabase.PExecute("DELETE FROM group_instance WHERE instance = '%u'", p->GetInstanceId());
|
||||||
// i don't know for sure if hash_map iterators
|
// i don't know for sure if hash_map iterators
|
||||||
m_boundInstances[dif].erase(itr);
|
m_boundInstances[diff].erase(itr);
|
||||||
itr = m_boundInstances[dif].begin();
|
itr = m_boundInstances[diff].begin();
|
||||||
// this unloads the instance save unless online players are bound to it
|
// this unloads the instance save unless online players are bound to it
|
||||||
// (eg. permanent binds or GM solo binds)
|
// (eg. permanent binds or GM solo binds)
|
||||||
p->RemoveGroup(this);
|
p->RemoveGroup(this);
|
||||||
@@ -1542,11 +1587,19 @@ void Group::ResetInstances(uint8 method, Player* SendMsgTo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InstanceGroupBind* Group::GetBoundInstance(uint32 mapid, uint8 difficulty)
|
InstanceGroupBind* Group::GetBoundInstance(Player* player)
|
||||||
{
|
{
|
||||||
|
uint32 mapid = player->GetMapId();
|
||||||
|
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
||||||
|
if(!mapEntry)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
Difficulty difficulty = player->GetDifficulty(mapEntry->IsRaid());
|
||||||
|
|
||||||
// some instances only have one difficulty
|
// some instances only have one difficulty
|
||||||
const MapEntry* entry = sMapStore.LookupEntry(mapid);
|
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid,difficulty);
|
||||||
if(!entry || !entry->SupportsHeroicMode()) difficulty = DIFFICULTY_NORMAL;
|
if(!mapDiff)
|
||||||
|
difficulty = DUNGEON_DIFFICULTY_NORMAL;
|
||||||
|
|
||||||
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid);
|
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid);
|
||||||
if(itr != m_boundInstances[difficulty].end())
|
if(itr != m_boundInstances[difficulty].end())
|
||||||
@@ -1555,6 +1608,24 @@ InstanceGroupBind* Group::GetBoundInstance(uint32 mapid, uint8 difficulty)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
|
||||||
|
{
|
||||||
|
// Currently spawn numbering not different from map difficulty
|
||||||
|
Difficulty difficulty = GetDifficulty(aMap->IsRaid());
|
||||||
|
|
||||||
|
// some instances only have one difficulty
|
||||||
|
MapDifficulty const* mapDiff = GetMapDifficultyData(aMap->GetId(),difficulty);
|
||||||
|
if(!mapDiff)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(aMap->GetId());
|
||||||
|
if(itr != m_boundInstances[difficulty].end())
|
||||||
|
return &itr->second;
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, bool load)
|
InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, bool load)
|
||||||
{
|
{
|
||||||
if(save && !isBGGroup())
|
if(save && !isBGGroup())
|
||||||
@@ -1624,4 +1695,3 @@ void Group::BroadcastGroupUpdate(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+16
-9
@@ -25,6 +25,7 @@
|
|||||||
#include "GroupRefManager.h"
|
#include "GroupRefManager.h"
|
||||||
#include "BattleGround.h"
|
#include "BattleGround.h"
|
||||||
#include "LootMgr.h"
|
#include "LootMgr.h"
|
||||||
|
#include "DBCEnums.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -100,7 +101,7 @@ class Roll : public LootValidatorRef
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Roll(uint64 _guid, LootItem const& li)
|
Roll(uint64 _guid, LootItem const& li)
|
||||||
: itemGUID(_guid), itemid(li.itemid), itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix),
|
: itemGUID(_guid), itemid(li.itemid), itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count),
|
||||||
totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0) {}
|
totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0) {}
|
||||||
~Roll() { }
|
~Roll() { }
|
||||||
void setLoot(Loot *pLoot) { link(pLoot, this); }
|
void setLoot(Loot *pLoot) { link(pLoot, this); }
|
||||||
@@ -111,6 +112,7 @@ class Roll : public LootValidatorRef
|
|||||||
uint32 itemid;
|
uint32 itemid;
|
||||||
int32 itemRandomPropId;
|
int32 itemRandomPropId;
|
||||||
uint32 itemRandomSuffix;
|
uint32 itemRandomSuffix;
|
||||||
|
uint8 itemCount;
|
||||||
typedef std::map<uint64, RollVote> PlayerVote;
|
typedef std::map<uint64, RollVote> PlayerVote;
|
||||||
PlayerVote playerVote; //vote position correspond with player position (in group)
|
PlayerVote playerVote; //vote position correspond with player position (in group)
|
||||||
uint8 totalPlayersRolling;
|
uint8 totalPlayersRolling;
|
||||||
@@ -281,11 +283,15 @@ class TRINITY_DLL_SPEC Group
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetTargetIcon(uint8 id, uint64 guid);
|
void SetTargetIcon(uint8 id, uint64 guid);
|
||||||
void SetDifficulty(uint8 difficulty);
|
|
||||||
uint8 GetDifficulty() { return m_difficulty; }
|
Difficulty GetDifficulty(bool isRaid) const { return isRaid ? m_raidDifficulty : m_dungeonDifficulty; }
|
||||||
|
Difficulty GetDungeonDifficulty() const { return m_dungeonDifficulty; }
|
||||||
|
Difficulty GetRaidDifficulty() const { return m_raidDifficulty; }
|
||||||
|
void SetDungeonDifficulty(Difficulty difficulty);
|
||||||
|
void SetRaidDifficulty(Difficulty difficulty);
|
||||||
uint16 InInstance();
|
uint16 InInstance();
|
||||||
bool InCombatToInstance(uint32 instanceId);
|
bool InCombatToInstance(uint32 instanceId);
|
||||||
void ResetInstances(uint8 method, Player* SendMsgTo);
|
void ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo);
|
||||||
|
|
||||||
// -no description-
|
// -no description-
|
||||||
//void SendInit(WorldSession *session);
|
//void SendInit(WorldSession *session);
|
||||||
@@ -329,8 +335,9 @@ class TRINITY_DLL_SPEC Group
|
|||||||
|
|
||||||
InstanceGroupBind* BindToInstance(InstanceSave *save, bool permanent, bool load = false);
|
InstanceGroupBind* BindToInstance(InstanceSave *save, bool permanent, bool load = false);
|
||||||
void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false);
|
void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false);
|
||||||
InstanceGroupBind* GetBoundInstance(uint32 mapid, uint8 difficulty);
|
InstanceGroupBind* GetBoundInstance(Player* player);
|
||||||
BoundInstancesMap& GetBoundInstances(uint8 difficulty) { return m_boundInstances[difficulty]; }
|
InstanceGroupBind* GetBoundInstance(Map* aMap);
|
||||||
|
BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }
|
||||||
|
|
||||||
// FG: evil hacks
|
// FG: evil hacks
|
||||||
void BroadcastGroupUpdate(void);
|
void BroadcastGroupUpdate(void);
|
||||||
@@ -402,15 +409,15 @@ class TRINITY_DLL_SPEC Group
|
|||||||
uint64 m_mainTank;
|
uint64 m_mainTank;
|
||||||
uint64 m_mainAssistant;
|
uint64 m_mainAssistant;
|
||||||
GroupType m_groupType;
|
GroupType m_groupType;
|
||||||
uint8 m_difficulty;
|
Difficulty m_dungeonDifficulty;
|
||||||
|
Difficulty m_raidDifficulty;
|
||||||
BattleGround* m_bgGroup;
|
BattleGround* m_bgGroup;
|
||||||
uint64 m_targetIcons[TARGETICONCOUNT];
|
uint64 m_targetIcons[TARGETICONCOUNT];
|
||||||
LootMethod m_lootMethod;
|
LootMethod m_lootMethod;
|
||||||
ItemQualities m_lootThreshold;
|
ItemQualities m_lootThreshold;
|
||||||
uint64 m_looterGuid;
|
uint64 m_looterGuid;
|
||||||
Rolls RollId;
|
Rolls RollId;
|
||||||
BoundInstancesMap m_boundInstances[TOTAL_DIFFICULTIES];
|
BoundInstancesMap m_boundInstances[MAX_DIFFICULTY];
|
||||||
uint8* m_subGroupsCounts;
|
uint8* m_subGroupsCounts;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// just ignore us
|
// just ignore us
|
||||||
if(player->GetInstanceId() != 0 && player->GetDifficulty() != GetPlayer()->GetDifficulty())
|
if(player->GetInstanceId() != 0 && player->GetDungeonDifficulty() != GetPlayer()->GetDungeonDifficulty())
|
||||||
{
|
{
|
||||||
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_TARGET_IGNORE_YOU);
|
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_TARGET_IGNORE_YOU);
|
||||||
return;
|
return;
|
||||||
@@ -386,10 +386,10 @@ void WorldSession::HandleLootRoll( WorldPacket &recv_data )
|
|||||||
|
|
||||||
uint64 Guid;
|
uint64 Guid;
|
||||||
uint32 NumberOfPlayers;
|
uint32 NumberOfPlayers;
|
||||||
uint8 Choise;
|
uint8 rollType;
|
||||||
recv_data >> Guid; //guid of the item rolled
|
recv_data >> Guid; //guid of the item rolled
|
||||||
recv_data >> NumberOfPlayers;
|
recv_data >> NumberOfPlayers;
|
||||||
recv_data >> Choise; //0: pass, 1: need, 2: greed
|
recv_data >> rollType; //0: pass, 1: need, 2: greed
|
||||||
|
|
||||||
//sLog.outDebug("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, Choise:%u", (uint32)Guid, NumberOfPlayers, Choise);
|
//sLog.outDebug("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, Choise:%u", (uint32)Guid, NumberOfPlayers, Choise);
|
||||||
|
|
||||||
@@ -398,14 +398,14 @@ void WorldSession::HandleLootRoll( WorldPacket &recv_data )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// everything's fine, do it
|
// everything's fine, do it
|
||||||
group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, Choise);
|
group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, rollType);
|
||||||
|
|
||||||
switch (Choise)
|
switch (rollType)
|
||||||
{
|
{
|
||||||
case 1:
|
case ROLL_NEED:
|
||||||
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
|
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case ROLL_GREED:
|
||||||
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
|
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -919,4 +919,3 @@ void WorldSession::HandleOptOutOfLootOpcode( WorldPacket & recv_data )
|
|||||||
if(unkn!=0)
|
if(unkn!=0)
|
||||||
sLog.outError("CMSG_GROUP_PASS_ON_LOOT: activation not implemented!");
|
sLog.outError("CMSG_GROUP_PASS_ON_LOOT: activation not implemented!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user