void TabManagerWidget::changeGroupType() { QAction* action = qobject_cast<QAction*>(sender()); if (action) { int type = action->data().toInt(); if (m_groupType != GroupType(type)) { m_groupType = GroupType(type); delayedRefreshTree(); emit groupTypeChanged(m_groupType); } } }
void Group::ConvertToRaid() { m_groupType = GroupType(m_groupType | GROUPTYPE_RAID); _initRaidSubGroupsCounter(); if (!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET groupType = %u WHERE groupId='%u'", uint8(m_groupType), m_Id); SendUpdate(); // update quest related GO states (quest activity dependent from raid membership) for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) if (Player* player = sObjectMgr.GetPlayer(citr->guid)) player->UpdateForQuestWorldObjects(); }
bool Group::LoadGroupFromDB(Field* fields) { // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty, leaderGuid, groupId FROM groups"); m_Id = fields[17].GetUInt32(); m_leaderGuid = ObjectGuid(HIGHGUID_PLAYER, fields[16].GetUInt32()); // group leader not exist if (!sObjectMgr.GetPlayerNameByGUID(m_leaderGuid, m_leaderName)) return false; m_groupType = GroupType(fields[13].GetUInt8()); if (m_groupType & GROUPTYPE_RAID) _initRaidSubGroupsCounter(); uint32 diff = fields[14].GetUInt8(); if (diff >= MAX_DUNGEON_DIFFICULTY) diff = DUNGEON_DIFFICULTY_NORMAL; m_dungeonDifficulty = Difficulty(diff); uint32 r_diff = fields[15].GetUInt8(); if (r_diff >= MAX_RAID_DIFFICULTY) r_diff = RAID_DIFFICULTY_10MAN_NORMAL; m_raidDifficulty = Difficulty(r_diff); m_mainTankGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()); m_mainAssistantGuid = ObjectGuid(HIGHGUID_PLAYER, fields[1].GetUInt32()); m_lootMethod = LootMethod(fields[2].GetUInt8()); m_masterLooterGuid = ObjectGuid(HIGHGUID_PLAYER, fields[3].GetUInt32()); m_lootThreshold = ItemQualities(fields[4].GetUInt16()); for (int i = 0; i < TARGET_ICON_COUNT; ++i) m_targetIcons[i] = ObjectGuid(fields[5 + i].GetUInt64()); m_currentLooterGuid = m_masterLooterGuid; return true; }