Core/Dungeon Finder: Add support for dungeon cooldown and luck of the draw spells
--HG-- branch : trunk
This commit is contained in:
@@ -586,9 +586,9 @@ void LFGMgr::Join(Player* plr)
|
|||||||
}
|
}
|
||||||
else if (plr->InBattleground() || plr->InArena())
|
else if (plr->InBattleground() || plr->InArena())
|
||||||
result = LFG_JOIN_USING_BG_SYSTEM;
|
result = LFG_JOIN_USING_BG_SYSTEM;
|
||||||
else if (plr->HasAura(LFG_SPELL_DESERTER))
|
else if (plr->HasAura(LFG_SPELL_DUNGEON_DESERTER))
|
||||||
result = LFG_JOIN_DESERTER;
|
result = LFG_JOIN_DESERTER;
|
||||||
else if (plr->HasAura(LFG_SPELL_COOLDOWN))
|
else if (plr->HasAura(LFG_SPELL_DUNGEON_COOLDOWN))
|
||||||
result = LFG_JOIN_RANDOM_COOLDOWN;
|
result = LFG_JOIN_RANDOM_COOLDOWN;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -617,9 +617,9 @@ void LFGMgr::Join(Player* plr)
|
|||||||
plrg = itr->getSource();
|
plrg = itr->getSource();
|
||||||
if (plrg)
|
if (plrg)
|
||||||
{
|
{
|
||||||
if (plrg->HasAura(LFG_SPELL_DESERTER))
|
if (plrg->HasAura(LFG_SPELL_DUNGEON_DESERTER))
|
||||||
result = LFG_JOIN_PARTY_DESERTER;
|
result = LFG_JOIN_PARTY_DESERTER;
|
||||||
else if (plrg->HasAura(LFG_SPELL_COOLDOWN))
|
else if (plrg->HasAura(LFG_SPELL_DUNGEON_COOLDOWN))
|
||||||
result = LFG_JOIN_PARTY_RANDOM_COOLDOWN;
|
result = LFG_JOIN_PARTY_RANDOM_COOLDOWN;
|
||||||
++memberCount;
|
++memberCount;
|
||||||
}
|
}
|
||||||
@@ -763,6 +763,7 @@ void LFGMgr::Leave(Player* plr, Group* grp /* = NULL*/)
|
|||||||
plr->GetLfgDungeons()->clear();
|
plr->GetLfgDungeons()->clear();
|
||||||
plr->SetLfgRoles(ROLE_NONE);
|
plr->SetLfgRoles(ROLE_NONE);
|
||||||
plr->SetLfgState(LFG_STATE_NONE);
|
plr->SetLfgState(LFG_STATE_NONE);
|
||||||
|
plr->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1608,7 +1609,10 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint32 lowGuid, bool accept)
|
|||||||
|
|
||||||
// Teleport Player
|
// Teleport Player
|
||||||
for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it)
|
for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||||
|
{
|
||||||
|
(*it)->CastSpell(*it, LFG_SPELL_DUNGEON_COOLDOWN, false);
|
||||||
TeleportPlayer(*it, false);
|
TeleportPlayer(*it, false);
|
||||||
|
}
|
||||||
|
|
||||||
for (LfgProposalPlayerMap::const_iterator it = pProposal->players.begin(); it != pProposal->players.end(); ++it)
|
for (LfgProposalPlayerMap::const_iterator it = pProposal->players.begin(); it != pProposal->players.end(); ++it)
|
||||||
delete it->second;
|
delete it->second;
|
||||||
@@ -1813,6 +1817,7 @@ void LFGMgr::TeleportPlayer(Player* plr, bool out)
|
|||||||
sLog.outError("DEBUG:LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", plr->GetGUID(), out ? "out" : "in");
|
sLog.outError("DEBUG:LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", plr->GetGUID(), out ? "out" : "in");
|
||||||
if (out)
|
if (out)
|
||||||
{
|
{
|
||||||
|
plr->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
|
||||||
plr->TeleportToBGEntryPoint();
|
plr->TeleportToBGEntryPoint();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1837,8 +1842,11 @@ void LFGMgr::TeleportPlayer(Player* plr, bool out)
|
|||||||
if (!plr->GetMap()->IsDungeon() && !plr->GetMap()->IsRaid())
|
if (!plr->GetMap()->IsDungeon() && !plr->GetMap()->IsRaid())
|
||||||
plr->SetBattlegroundEntryPoint();
|
plr->SetBattlegroundEntryPoint();
|
||||||
plr->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
plr->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
||||||
// TODO: Teleport to group
|
// TODO: Teleport to group
|
||||||
plr->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, at->target_Orientation);
|
if (plr->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, at->target_Orientation))
|
||||||
|
plr->CastSpell(plr, LFG_SPELL_LUCK_OF_THE_DRAW, false);
|
||||||
|
else
|
||||||
|
sLog.outError("LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u: ", plr->GetGUID(), at->target_mapId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,16 +28,17 @@ class Player;
|
|||||||
|
|
||||||
enum LFGenum
|
enum LFGenum
|
||||||
{
|
{
|
||||||
LFG_TIME_ROLECHECK = 2*MINUTE,
|
LFG_TIME_ROLECHECK = 2*MINUTE,
|
||||||
LFG_TIME_BOOT = 2*MINUTE,
|
LFG_TIME_BOOT = 2*MINUTE,
|
||||||
LFG_TIME_PROPOSAL = 2*MINUTE,
|
LFG_TIME_PROPOSAL = 2*MINUTE,
|
||||||
LFG_TIME_JOIN_WARNING = 1*IN_MILLISECONDS,
|
LFG_TIME_JOIN_WARNING = 1*IN_MILLISECONDS,
|
||||||
LFG_TANKS_NEEDED = 1,
|
LFG_TANKS_NEEDED = 1,
|
||||||
LFG_HEALERS_NEEDED = 1,
|
LFG_HEALERS_NEEDED = 1,
|
||||||
LFG_DPS_NEEDED = 3,
|
LFG_DPS_NEEDED = 3,
|
||||||
LFG_QUEUEUPDATE_INTERVAL = 15000,
|
LFG_QUEUEUPDATE_INTERVAL = 15*IN_MILLISECONDS,
|
||||||
LFG_SPELL_COOLDOWN = 71328,
|
LFG_SPELL_DUNGEON_COOLDOWN = 71328,
|
||||||
LFG_SPELL_DESERTER = 71041,
|
LFG_SPELL_DUNGEON_DESERTER = 71041,
|
||||||
|
LFG_SPELL_LUCK_OF_THE_DRAW = 72221,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LfgType
|
enum LfgType
|
||||||
|
|||||||
@@ -321,7 +321,8 @@ bool Group::AddMember(const uint64 &guid, const char* name)
|
|||||||
Player *player = sObjectMgr.GetPlayer(guid);
|
Player *player = sObjectMgr.GetPlayer(guid);
|
||||||
if (player)
|
if (player)
|
||||||
{
|
{
|
||||||
sLFGMgr.Leave(player);
|
if (player->isUsingLfg())
|
||||||
|
sLFGMgr.Leave(player);
|
||||||
if (!IsLeader(player->GetGUID()) && !isBGGroup())
|
if (!IsLeader(player->GetGUID()) && !isBGGroup())
|
||||||
{
|
{
|
||||||
// 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
|
||||||
|
|||||||
Reference in New Issue
Block a user