mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
This commit is contained in:
19668
sql/updates/world/2014_04_24_01_world_locales_gameobject.sql
Normal file
19668
sql/updates/world/2014_04_24_01_world_locales_gameobject.sql
Normal file
File diff suppressed because it is too large
Load Diff
8
sql/updates/world/2014_04_24_02_world_gossip.sql
Normal file
8
sql/updates/world/2014_04_24_02_world_gossip.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
--
|
||||
DELETE FROM `gossip_menu` WHERE `entry`=8725 AND `text_id`=11030;
|
||||
INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
|
||||
(8725, 11030); -- 23093
|
||||
|
||||
DELETE FROM `gossip_menu_option` WHERE `menu_id`=8725 AND `id`=0;
|
||||
INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `box_coded`, `box_money`, `box_text`) VALUES
|
||||
(8725, 0, 0, 'I am an envoy of Balthas. He has sent me to collect a flawless arcane essence.', 0, 0, ''); -- 23093
|
||||
8
sql/updates/world/2014_04_24_03_world_gossip.sql
Normal file
8
sql/updates/world/2014_04_24_03_world_gossip.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
--
|
||||
DELETE FROM `gossip_menu` WHERE `entry`=10318 AND `text_id`=14324;
|
||||
INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
|
||||
(10318, 14324); -- 33238
|
||||
|
||||
DELETE FROM `gossip_menu_option` WHERE `menu_id`=10318 AND `id`=7;
|
||||
INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `box_coded`, `box_money`, `box_text`) VALUES
|
||||
(10318, 7, 0, 'Stormwind Champion''s Pennant', 0, 0, ''); -- 33238
|
||||
@@ -256,10 +256,6 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
|
||||
if (reload)
|
||||
{
|
||||
CachedDungeonMapStore.clear();
|
||||
// Recalculate locked dungeons
|
||||
for (LfgPlayerDataContainer::const_iterator it = PlayersStore.begin(); it != PlayersStore.end(); ++it)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(it->first))
|
||||
InitializeLockedDungeons(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,74 +362,6 @@ void LFGMgr::Update(uint32 diff)
|
||||
m_QueueTimer += diff;
|
||||
}
|
||||
|
||||
/**
|
||||
Generate the dungeon lock map for a given player
|
||||
|
||||
@param[in] player Player we need to initialize the lock status map
|
||||
*/
|
||||
void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
if (!level)
|
||||
level = player->getLevel();
|
||||
uint8 expansion = player->GetSession()->Expansion();
|
||||
LfgDungeonSet const& dungeons = GetDungeonsByRandom(0);
|
||||
LfgLockMap lock;
|
||||
bool denyJoin = !player->GetSession()->HasPermission(rbac::RBAC_PERM_JOIN_DUNGEON_FINDER);
|
||||
|
||||
for (LfgDungeonSet::const_iterator it = dungeons.begin(); it != dungeons.end(); ++it)
|
||||
{
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(*it);
|
||||
if (!dungeon) // should never happen - We provide a list from sLFGDungeonStore
|
||||
continue;
|
||||
|
||||
uint32 lockData = 0;
|
||||
if (denyJoin)
|
||||
lockData = LFG_LOCKSTATUS_RAID_LOCKED;
|
||||
else if (dungeon->expansion > expansion)
|
||||
lockData = LFG_LOCKSTATUS_INSUFFICIENT_EXPANSION;
|
||||
else if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, dungeon->map, player))
|
||||
lockData = LFG_LOCKSTATUS_RAID_LOCKED;
|
||||
else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty)))
|
||||
lockData = LFG_LOCKSTATUS_RAID_LOCKED;
|
||||
else if (dungeon->minlevel > level)
|
||||
lockData = LFG_LOCKSTATUS_TOO_LOW_LEVEL;
|
||||
else if (dungeon->maxlevel < level)
|
||||
lockData = LFG_LOCKSTATUS_TOO_HIGH_LEVEL;
|
||||
else if (dungeon->seasonal && !IsSeasonActive(dungeon->id))
|
||||
lockData = LFG_LOCKSTATUS_NOT_IN_SEASON;
|
||||
else if (AccessRequirement const* ar = sObjectMgr->GetAccessRequirement(dungeon->map, Difficulty(dungeon->difficulty)))
|
||||
{
|
||||
if (ar->item_level && player->GetAverageItemLevel() < ar->item_level)
|
||||
lockData = LFG_LOCKSTATUS_TOO_LOW_GEAR_SCORE;
|
||||
else if (ar->achievement && !player->HasAchieved(ar->achievement))
|
||||
lockData = LFG_LOCKSTATUS_MISSING_ACHIEVEMENT;
|
||||
else if (player->GetTeam() == ALLIANCE && ar->quest_A && !player->GetQuestRewardStatus(ar->quest_A))
|
||||
lockData = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED;
|
||||
else if (player->GetTeam() == HORDE && ar->quest_H && !player->GetQuestRewardStatus(ar->quest_H))
|
||||
lockData = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED;
|
||||
else
|
||||
if (ar->item)
|
||||
{
|
||||
if (!player->HasItemCount(ar->item) && (!ar->item2 || !player->HasItemCount(ar->item2)))
|
||||
lockData = LFG_LOCKSTATUS_MISSING_ITEM;
|
||||
}
|
||||
else if (ar->item2 && !player->HasItemCount(ar->item2))
|
||||
lockData = LFG_LOCKSTATUS_MISSING_ITEM;
|
||||
}
|
||||
|
||||
/* @todo VoA closed if WG is not under team control (LFG_LOCKSTATUS_RAID_LOCKED)
|
||||
lockData = LFG_LOCKSTATUS_TOO_HIGH_GEAR_SCORE;
|
||||
lockData = LFG_LOCKSTATUS_ATTUNEMENT_TOO_LOW_LEVEL;
|
||||
lockData = LFG_LOCKSTATUS_ATTUNEMENT_TOO_HIGH_LEVEL;
|
||||
*/
|
||||
|
||||
if (lockData)
|
||||
lock[dungeon->Entry()] = lockData;
|
||||
}
|
||||
SetLockedDungeons(guid, lock);
|
||||
}
|
||||
|
||||
/**
|
||||
Adds the player/group to lfg queue. If player is in a group then it is the leader
|
||||
of the group tying to join the group. Join conditions are checked before adding
|
||||
@@ -1613,10 +1541,69 @@ LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid)
|
||||
return PlayersStore[guid].GetSelectedDungeons();
|
||||
}
|
||||
|
||||
LfgLockMap const& LFGMgr::GetLockedDungeons(uint64 guid)
|
||||
LfgLockMap const LFGMgr::GetLockedDungeons(uint64 guid)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.player.dungeons.locked.get", "Player: %u, LockedDungeons.", GUID_LOPART(guid));
|
||||
return PlayersStore[guid].GetLockedDungeons();
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
|
||||
uint8 level = player->getLevel();
|
||||
uint8 expansion = player->GetSession()->Expansion();
|
||||
LfgDungeonSet const& dungeons = GetDungeonsByRandom(0);
|
||||
LfgLockMap lock;
|
||||
bool denyJoin = !player->GetSession()->HasPermission(rbac::RBAC_PERM_JOIN_DUNGEON_FINDER);
|
||||
|
||||
for (LfgDungeonSet::const_iterator it = dungeons.begin(); it != dungeons.end(); ++it)
|
||||
{
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(*it);
|
||||
if (!dungeon) // should never happen - We provide a list from sLFGDungeonStore
|
||||
continue;
|
||||
|
||||
uint32 lockData = 0;
|
||||
if (denyJoin)
|
||||
lockData = LFG_LOCKSTATUS_RAID_LOCKED;
|
||||
else if (dungeon->expansion > expansion)
|
||||
lockData = LFG_LOCKSTATUS_INSUFFICIENT_EXPANSION;
|
||||
else if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, dungeon->map, player))
|
||||
lockData = LFG_LOCKSTATUS_RAID_LOCKED;
|
||||
else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty)))
|
||||
lockData = LFG_LOCKSTATUS_RAID_LOCKED;
|
||||
else if (dungeon->minlevel > level)
|
||||
lockData = LFG_LOCKSTATUS_TOO_LOW_LEVEL;
|
||||
else if (dungeon->maxlevel < level)
|
||||
lockData = LFG_LOCKSTATUS_TOO_HIGH_LEVEL;
|
||||
else if (dungeon->seasonal && !IsSeasonActive(dungeon->id))
|
||||
lockData = LFG_LOCKSTATUS_NOT_IN_SEASON;
|
||||
else if (AccessRequirement const* ar = sObjectMgr->GetAccessRequirement(dungeon->map, Difficulty(dungeon->difficulty)))
|
||||
{
|
||||
if (ar->item_level && player->GetAverageItemLevel() < ar->item_level)
|
||||
lockData = LFG_LOCKSTATUS_TOO_LOW_GEAR_SCORE;
|
||||
else if (ar->achievement && !player->HasAchieved(ar->achievement))
|
||||
lockData = LFG_LOCKSTATUS_MISSING_ACHIEVEMENT;
|
||||
else if (player->GetTeam() == ALLIANCE && ar->quest_A && !player->GetQuestRewardStatus(ar->quest_A))
|
||||
lockData = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED;
|
||||
else if (player->GetTeam() == HORDE && ar->quest_H && !player->GetQuestRewardStatus(ar->quest_H))
|
||||
lockData = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED;
|
||||
else
|
||||
if (ar->item)
|
||||
{
|
||||
if (!player->HasItemCount(ar->item) && (!ar->item2 || !player->HasItemCount(ar->item2)))
|
||||
lockData = LFG_LOCKSTATUS_MISSING_ITEM;
|
||||
}
|
||||
else if (ar->item2 && !player->HasItemCount(ar->item2))
|
||||
lockData = LFG_LOCKSTATUS_MISSING_ITEM;
|
||||
}
|
||||
|
||||
/* @todo VoA closed if WG is not under team control (LFG_LOCKSTATUS_RAID_LOCKED)
|
||||
lockData = LFG_LOCKSTATUS_TOO_HIGH_GEAR_SCORE;
|
||||
lockData = LFG_LOCKSTATUS_ATTUNEMENT_TOO_LOW_LEVEL;
|
||||
lockData = LFG_LOCKSTATUS_ATTUNEMENT_TOO_HIGH_LEVEL;
|
||||
*/
|
||||
|
||||
if (lockData)
|
||||
lock[dungeon->Entry()] = lockData;
|
||||
}
|
||||
|
||||
return lock;
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetKicksLeft(uint64 guid)
|
||||
@@ -1694,12 +1681,6 @@ void LFGMgr::SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons)
|
||||
PlayersStore[guid].SetSelectedDungeons(dungeons);
|
||||
}
|
||||
|
||||
void LFGMgr::SetLockedDungeons(uint64 guid, LfgLockMap const& lock)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.player.dungeon.locked.set", "Player: %u, LockedDungeons", GUID_LOPART(guid));
|
||||
PlayersStore[guid].SetLockedDungeons(lock);
|
||||
}
|
||||
|
||||
void LFGMgr::DecreaseKicksLeft(uint64 guid)
|
||||
{
|
||||
GroupsStore[guid].DecreaseKicksLeft();
|
||||
|
||||
@@ -354,8 +354,6 @@ class LFGMgr
|
||||
// LFGScripts
|
||||
/// Get leader of the group (using internal data)
|
||||
uint64 GetLeader(uint64 guid);
|
||||
/// Initializes locked dungeons for given player (called at login or level change)
|
||||
void InitializeLockedDungeons(Player* player, uint8 level = 0);
|
||||
/// Sets player team
|
||||
void SetTeam(uint64 guid, uint8 team);
|
||||
/// Sets player group
|
||||
@@ -373,7 +371,7 @@ class LFGMgr
|
||||
|
||||
// LFGHandler
|
||||
/// Get locked dungeons
|
||||
LfgLockMap const& GetLockedDungeons(uint64 guid);
|
||||
LfgLockMap const GetLockedDungeons(uint64 guid);
|
||||
/// Returns current lfg status
|
||||
LfgUpdateData GetLfgStatus(uint64 guid);
|
||||
/// Checks if Seasonal dungeon is active
|
||||
@@ -429,7 +427,6 @@ class LFGMgr
|
||||
void ClearState(uint64 guid, char const* debugMsg);
|
||||
void SetDungeon(uint64 guid, uint32 dungeon);
|
||||
void SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons);
|
||||
void SetLockedDungeons(uint64 guid, LfgLockMap const& lock);
|
||||
void DecreaseKicksLeft(uint64 guid);
|
||||
void SetState(uint64 guid, LfgState state);
|
||||
void RemovePlayerData(uint64 guid);
|
||||
|
||||
@@ -54,11 +54,6 @@ void LfgPlayerData::RestoreState()
|
||||
m_State = m_OldState;
|
||||
}
|
||||
|
||||
void LfgPlayerData::SetLockedDungeons(LfgLockMap const& lockStatus)
|
||||
{
|
||||
m_LockedDungeons = lockStatus;
|
||||
}
|
||||
|
||||
void LfgPlayerData::SetTeam(uint8 team)
|
||||
{
|
||||
m_Team = team;
|
||||
@@ -94,11 +89,6 @@ LfgState LfgPlayerData::GetOldState() const
|
||||
return m_OldState;
|
||||
}
|
||||
|
||||
const LfgLockMap& LfgPlayerData::GetLockedDungeons() const
|
||||
{
|
||||
return m_LockedDungeons;
|
||||
}
|
||||
|
||||
uint8 LfgPlayerData::GetTeam() const
|
||||
{
|
||||
return m_Team;
|
||||
|
||||
@@ -35,7 +35,6 @@ class LfgPlayerData
|
||||
// General
|
||||
void SetState(LfgState state);
|
||||
void RestoreState();
|
||||
void SetLockedDungeons(LfgLockMap const& lock);
|
||||
void SetTeam(uint8 team);
|
||||
void SetGroup(uint64 group);
|
||||
|
||||
@@ -47,7 +46,6 @@ class LfgPlayerData
|
||||
// General
|
||||
LfgState GetState() const;
|
||||
LfgState GetOldState() const;
|
||||
LfgLockMap const& GetLockedDungeons() const;
|
||||
uint8 GetTeam() const;
|
||||
uint64 GetGroup() const;
|
||||
|
||||
@@ -61,7 +59,6 @@ class LfgPlayerData
|
||||
LfgState m_State; ///< State if group in LFG
|
||||
LfgState m_OldState; ///< Old State - Used to restore state after failed Rolecheck/Proposal
|
||||
// Player
|
||||
LfgLockMap m_LockedDungeons; ///< Dungeons player can't do and reason
|
||||
uint8 m_Team; ///< Player team - determines the queue to join
|
||||
uint64 m_Group; ///< Original group of player when joined LFG
|
||||
|
||||
|
||||
@@ -34,14 +34,6 @@ namespace lfg
|
||||
|
||||
LFGPlayerScript::LFGPlayerScript() : PlayerScript("LFGPlayerScript") { }
|
||||
|
||||
void LFGPlayerScript::OnLevelChanged(Player* player, uint8 /*oldLevel*/)
|
||||
{
|
||||
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
|
||||
return;
|
||||
|
||||
sLFGMgr->InitializeLockedDungeons(player);
|
||||
}
|
||||
|
||||
void LFGPlayerScript::OnLogout(Player* player)
|
||||
{
|
||||
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
|
||||
@@ -74,18 +66,10 @@ void LFGPlayerScript::OnLogin(Player* player)
|
||||
}
|
||||
}
|
||||
|
||||
sLFGMgr->InitializeLockedDungeons(player);
|
||||
sLFGMgr->SetTeam(player->GetGUID(), player->GetTeam());
|
||||
/// @todo - Restore LfgPlayerData and send proper status to player if it was in a group
|
||||
}
|
||||
|
||||
void LFGPlayerScript::OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/)
|
||||
{
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
|
||||
if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL)
|
||||
sLFGMgr->InitializeLockedDungeons(player);
|
||||
}
|
||||
|
||||
void LFGPlayerScript::OnMapChanged(Player* player)
|
||||
{
|
||||
Map const* map = player->GetMap();
|
||||
|
||||
@@ -35,10 +35,8 @@ class LFGPlayerScript : public PlayerScript
|
||||
LFGPlayerScript();
|
||||
|
||||
// Player Hooks
|
||||
void OnLevelChanged(Player* player, uint8 oldLevel);
|
||||
void OnLogout(Player* player);
|
||||
void OnLogin(Player* player);
|
||||
void OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent);
|
||||
void OnMapChanged(Player* player);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user