aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/authserver/Main.cpp6
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.cpp242
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp156
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.h16
-rw-r--r--src/server/game/DungeonFinding/LFGQueue.cpp44
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.cpp24
-rw-r--r--src/server/game/Entities/Player/Player.cpp8
-rw-r--r--src/server/game/Entities/Player/Player.h3
-rwxr-xr-xsrc/server/game/Handlers/LFGHandler.cpp2
-rwxr-xr-xsrc/server/game/Miscellaneous/Language.h7
-rwxr-xr-xsrc/server/game/Miscellaneous/SharedDefines.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp5
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp8
-rwxr-xr-xsrc/server/game/Spells/Spell.h2
-rw-r--r--src/server/game/Spells/SpellEffects.cpp28
-rw-r--r--src/server/game/Spells/SpellMgr.cpp4
-rw-r--r--src/server/game/World/World.cpp2
-rw-r--r--src/server/game/World/World.h2
-rw-r--r--src/server/scripts/Commands/CMakeLists.txt1
-rw-r--r--src/server/scripts/Commands/cs_lfg.cpp134
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/blasted_lands.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp2
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp4
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp2
-rw-r--r--src/server/scripts/Kalimdor/silithus.cpp24
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp103
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp21
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h3
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp2
-rw-r--r--src/server/scripts/Northrend/storm_peaks.cpp2
-rw-r--r--src/server/scripts/Outland/netherstorm.cpp10
-rw-r--r--src/server/scripts/Outland/zangarmarsh.cpp2
-rw-r--r--src/server/scripts/World/go_scripts.cpp18
-rw-r--r--src/server/scripts/World/npc_taxi.cpp4
-rw-r--r--src/server/scripts/World/npcs_special.cpp2
-rw-r--r--src/server/shared/Logging/Appender.h96
-rw-r--r--src/server/shared/Logging/Log.cpp6
-rwxr-xr-xsrc/server/worldserver/Main.cpp8
-rw-r--r--src/server/worldserver/worldserver.conf.dist11
41 files changed, 648 insertions, 374 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index 011210dd95b..90d112a1433 100755
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -86,7 +86,7 @@ extern int main(int argc, char **argv)
{
if (++c >= argc)
{
- printf("Runtime-Error: -c option requires an input argument");
+ printf("Runtime-Error: -c option requires an input argument\n");
usage(argv[0]);
return 1;
}
@@ -98,8 +98,8 @@ extern int main(int argc, char **argv)
if (!ConfigMgr::Load(cfg_file))
{
- printf("Invalid or missing configuration file : %s", cfg_file);
- printf("Verify that the file exists and has \'[authserver]\' written in the top of the file!");
+ printf("Invalid or missing configuration file : %s\n", cfg_file);
+ printf("Verify that the file exists and has \'[authserver]\' written in the top of the file!\n");
return 1;
}
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index d090db1268a..070f974e65a 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -163,13 +163,15 @@ void BattlegroundMgr::Update(uint32 diff)
}
}
-void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * pPlayer, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 /*uiFrame*/)
+void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * player, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 /*uiFrame*/)
{
- if (!bg)
- StatusID = STATUS_NONE;
+ ObjectGuid playerGuid = player->GetGUID();
+ ObjectGuid bgGuid;
- ObjectGuid guidBytes1 = pPlayer->GetGUID();
- ObjectGuid guidBytes2 = bg->GetGUID();
+ if (bg)
+ bgGuid = bg->GetGUID();
+ else
+ StatusID = STATUS_NONE;
switch (StatusID)
{
@@ -177,82 +179,82 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
{
data->Initialize(SMSG_BATTLEFIELD_STATUS);
- data->WriteBit(guidBytes1[0]);
- data->WriteBit(guidBytes1[4]);
- data->WriteBit(guidBytes1[7]);
- data->WriteBit(guidBytes1[1]);
- data->WriteBit(guidBytes1[6]);
- data->WriteBit(guidBytes1[3]);
- data->WriteBit(guidBytes1[5]);
- data->WriteBit(guidBytes1[2]);
+ data->WriteBit(playerGuid[0]);
+ data->WriteBit(playerGuid[4]);
+ data->WriteBit(playerGuid[7]);
+ data->WriteBit(playerGuid[1]);
+ data->WriteBit(playerGuid[6]);
+ data->WriteBit(playerGuid[3]);
+ data->WriteBit(playerGuid[5]);
+ data->WriteBit(playerGuid[2]);
data->FlushBits();
- data->WriteByteSeq(guidBytes1[5]);
- data->WriteByteSeq(guidBytes1[6]);
- data->WriteByteSeq(guidBytes1[7]);
- data->WriteByteSeq(guidBytes1[2]);
+ data->WriteByteSeq(playerGuid[5]);
+ data->WriteByteSeq(playerGuid[6]);
+ data->WriteByteSeq(playerGuid[7]);
+ data->WriteByteSeq(playerGuid[2]);
*data << uint32(1); // unk, always 1
- data->WriteByteSeq(guidBytes1[3]);
- data->WriteByteSeq(guidBytes1[1]);
+ data->WriteByteSeq(playerGuid[3]);
+ data->WriteByteSeq(playerGuid[1]);
*data << uint32(QueueSlot); // Queue slot
*data << uint32(Time1); // Join Time
- data->WriteByteSeq(guidBytes1[0]);
- data->WriteByteSeq(guidBytes1[4]);
+ data->WriteByteSeq(playerGuid[0]);
+ data->WriteByteSeq(playerGuid[4]);
break;
}
case STATUS_WAIT_QUEUE:
{
data->Initialize(SMSG_BATTLEFIELD_STATUS_QUEUED);
- data->WriteBit(guidBytes1[3]);
- data->WriteBit(guidBytes1[0]);
- data->WriteBit(guidBytes2[3]);
- data->WriteBit(guidBytes1[2]);
+ data->WriteBit(playerGuid[3]);
+ data->WriteBit(playerGuid[0]);
+ data->WriteBit(bgGuid[3]);
+ data->WriteBit(playerGuid[2]);
data->WriteBit(1); // Eligible In Queue
data->WriteBit(0); // Join Failed
- data->WriteBit(guidBytes2[2]);
- data->WriteBit(guidBytes1[1]);
- data->WriteBit(guidBytes2[0]);
- data->WriteBit(guidBytes2[6]);
- data->WriteBit(guidBytes2[4]);
- data->WriteBit(guidBytes1[6]);
- data->WriteBit(guidBytes1[7]);
- data->WriteBit(guidBytes2[7]);
- data->WriteBit(guidBytes2[5]);
- data->WriteBit(guidBytes1[4]);
- data->WriteBit(guidBytes1[5]);
+ data->WriteBit(bgGuid[2]);
+ data->WriteBit(playerGuid[1]);
+ data->WriteBit(bgGuid[0]);
+ data->WriteBit(bgGuid[6]);
+ data->WriteBit(bgGuid[4]);
+ data->WriteBit(playerGuid[6]);
+ data->WriteBit(playerGuid[7]);
+ data->WriteBit(bgGuid[7]);
+ data->WriteBit(bgGuid[5]);
+ data->WriteBit(playerGuid[4]);
+ data->WriteBit(playerGuid[5]);
data->WriteBit(bg->isRated()); // Is Rated
data->WriteBit(0); // Waiting On Other Activity
- data->WriteBit(guidBytes2[1]);
+ data->WriteBit(bgGuid[1]);
data->FlushBits();
- data->WriteByteSeq(guidBytes1[0]);
+ data->WriteByteSeq(playerGuid[0]);
*data << uint32(1); // unk, always 1
- data->WriteByteSeq(guidBytes2[5]);
- data->WriteByteSeq(guidBytes1[3]);
+ data->WriteByteSeq(bgGuid[5]);
+ data->WriteByteSeq(playerGuid[3]);
*data << uint32(Time1); // Estimated Wait Time
- data->WriteByteSeq(guidBytes2[7]);
- data->WriteByteSeq(guidBytes2[1]);
- data->WriteByteSeq(guidBytes2[2]);
+ data->WriteByteSeq(bgGuid[7]);
+ data->WriteByteSeq(bgGuid[1]);
+ data->WriteByteSeq(bgGuid[2]);
*data << uint8(0); // unk
- data->WriteByteSeq(guidBytes2[4]);
- data->WriteByteSeq(guidBytes1[2]);
+ data->WriteByteSeq(bgGuid[4]);
+ data->WriteByteSeq(playerGuid[2]);
*data << uint8(0); // Player count in rated mode
- data->WriteByteSeq(guidBytes2[6]);
- data->WriteByteSeq(guidBytes1[7]);
- data->WriteByteSeq(guidBytes2[3]);
- data->WriteByteSeq(guidBytes1[6]);
- data->WriteByteSeq(guidBytes2[0]);
+ data->WriteByteSeq(bgGuid[6]);
+ data->WriteByteSeq(playerGuid[7]);
+ data->WriteByteSeq(bgGuid[3]);
+ data->WriteByteSeq(playerGuid[6]);
+ data->WriteByteSeq(bgGuid[0]);
*data << uint32(Time2); // Join Time
*data << uint32(QueueSlot); // Queue slot
*data << uint8(bg->GetMinLevel()); // Min Level
*data << uint32(GetMSTimeDiffToNow(Time2)); // Time since joined
- data->WriteByteSeq(guidBytes1[1]);
- data->WriteByteSeq(guidBytes1[5]);
+ data->WriteByteSeq(playerGuid[1]);
+ data->WriteByteSeq(playerGuid[5]);
*data << uint32(bg->GetClientInstanceID()); // Client Instance ID
- data->WriteByteSeq(guidBytes1[4]);
+ data->WriteByteSeq(playerGuid[4]);
break;
}
case STATUS_WAIT_JOIN:
@@ -269,83 +271,83 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
*data << uint32(bg->GetMapId()); // Map Id
*data << uint8(0); // Player count in rated mode
- data->WriteBit(guidBytes1[5]);
- data->WriteBit(guidBytes1[2]);
- data->WriteBit(guidBytes1[1]);
- data->WriteBit(guidBytes2[2]);
- data->WriteBit(guidBytes1[4]);
- data->WriteBit(guidBytes2[6]);
- data->WriteBit(guidBytes2[3]);
+ data->WriteBit(playerGuid[5]);
+ data->WriteBit(playerGuid[2]);
+ data->WriteBit(playerGuid[1]);
+ data->WriteBit(bgGuid[2]);
+ data->WriteBit(playerGuid[4]);
+ data->WriteBit(bgGuid[6]);
+ data->WriteBit(bgGuid[3]);
data->WriteBit(bg->isRated()); // Is Rated
- data->WriteBit(guidBytes1[7]);
- data->WriteBit(guidBytes1[3]);
- data->WriteBit(guidBytes2[7]);
- data->WriteBit(guidBytes2[0]);
- data->WriteBit(guidBytes2[4]);
- data->WriteBit(guidBytes1[6]);
- data->WriteBit(guidBytes2[1]);
- data->WriteBit(guidBytes2[5]);
- data->WriteBit(guidBytes1[0]);
+ data->WriteBit(playerGuid[7]);
+ data->WriteBit(playerGuid[3]);
+ data->WriteBit(bgGuid[7]);
+ data->WriteBit(bgGuid[0]);
+ data->WriteBit(bgGuid[4]);
+ data->WriteBit(playerGuid[6]);
+ data->WriteBit(bgGuid[1]);
+ data->WriteBit(bgGuid[5]);
+ data->WriteBit(playerGuid[0]);
data->FlushBits();
- data->WriteByteSeq(guidBytes2[6]);
- data->WriteByteSeq(guidBytes2[5]);
- data->WriteByteSeq(guidBytes2[7]);
- data->WriteByteSeq(guidBytes2[2]);
- data->WriteByteSeq(guidBytes1[0]);
- data->WriteByteSeq(guidBytes1[7]);
- data->WriteByteSeq(guidBytes2[4]);
- data->WriteByteSeq(guidBytes1[1]);
- data->WriteByteSeq(guidBytes2[0]);
- data->WriteByteSeq(guidBytes1[4]);
- data->WriteByteSeq(guidBytes2[1]);
- data->WriteByteSeq(guidBytes1[5]);
- data->WriteByteSeq(guidBytes2[3]);
- data->WriteByteSeq(guidBytes1[6]);
- data->WriteByteSeq(guidBytes1[2]);
- data->WriteByteSeq(guidBytes1[3]);
+ data->WriteByteSeq(bgGuid[6]);
+ data->WriteByteSeq(bgGuid[5]);
+ data->WriteByteSeq(bgGuid[7]);
+ data->WriteByteSeq(bgGuid[2]);
+ data->WriteByteSeq(playerGuid[0]);
+ data->WriteByteSeq(playerGuid[7]);
+ data->WriteByteSeq(bgGuid[4]);
+ data->WriteByteSeq(playerGuid[1]);
+ data->WriteByteSeq(bgGuid[0]);
+ data->WriteByteSeq(playerGuid[4]);
+ data->WriteByteSeq(bgGuid[1]);
+ data->WriteByteSeq(playerGuid[5]);
+ data->WriteByteSeq(bgGuid[3]);
+ data->WriteByteSeq(playerGuid[6]);
+ data->WriteByteSeq(playerGuid[2]);
+ data->WriteByteSeq(playerGuid[3]);
break;
}
case STATUS_IN_PROGRESS:
{
data->Initialize(SMSG_BATTLEFIELD_STATUS_ACTIVE);
- data->WriteBit(guidBytes1[2]);
- data->WriteBit(guidBytes1[7]);
- data->WriteBit(guidBytes2[7]);
- data->WriteBit(guidBytes2[1]);
- data->WriteBit(guidBytes1[5]);
- data->WriteBit(bg->GetPlayerTeam(guidBytes1) == ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance )
- data->WriteBit(guidBytes2[0]);
- data->WriteBit(guidBytes1[1]);
- data->WriteBit(guidBytes2[3]);
- data->WriteBit(guidBytes1[6]);
- data->WriteBit(guidBytes2[5]);
+ data->WriteBit(playerGuid[2]);
+ data->WriteBit(playerGuid[7]);
+ data->WriteBit(bgGuid[7]);
+ data->WriteBit(bgGuid[1]);
+ data->WriteBit(playerGuid[5]);
+ data->WriteBit(player->GetBGTeam() == ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance )
+ data->WriteBit(bgGuid[0]);
+ data->WriteBit(playerGuid[1]);
+ data->WriteBit(bgGuid[3]);
+ data->WriteBit(playerGuid[6]);
+ data->WriteBit(bgGuid[5]);
data->WriteBit(0); // unk, Bit 64
- data->WriteBit(guidBytes1[4]);
- data->WriteBit(guidBytes2[6]);
- data->WriteBit(guidBytes2[4]);
- data->WriteBit(guidBytes2[2]);
- data->WriteBit(guidBytes1[3]);
- data->WriteBit(guidBytes1[0]);
+ data->WriteBit(playerGuid[4]);
+ data->WriteBit(bgGuid[6]);
+ data->WriteBit(bgGuid[4]);
+ data->WriteBit(bgGuid[2]);
+ data->WriteBit(playerGuid[3]);
+ data->WriteBit(playerGuid[0]);
data->FlushBits();
- data->WriteByteSeq(guidBytes2[4]);
- data->WriteByteSeq(guidBytes2[5]);
- data->WriteByteSeq(guidBytes1[5]);
- data->WriteByteSeq(guidBytes2[1]);
- data->WriteByteSeq(guidBytes2[6]);
- data->WriteByteSeq(guidBytes2[3]);
- data->WriteByteSeq(guidBytes2[7]);
- data->WriteByteSeq(guidBytes1[6]);
+ data->WriteByteSeq(bgGuid[4]);
+ data->WriteByteSeq(bgGuid[5]);
+ data->WriteByteSeq(playerGuid[5]);
+ data->WriteByteSeq(bgGuid[1]);
+ data->WriteByteSeq(bgGuid[6]);
+ data->WriteByteSeq(bgGuid[3]);
+ data->WriteByteSeq(bgGuid[7]);
+ data->WriteByteSeq(playerGuid[6]);
*data << uint32(Time1); // Join Time
*data << uint8(arenatype); // Teamsize (0 if not arena)
- data->WriteByteSeq(guidBytes1[4]);
- data->WriteByteSeq(guidBytes1[1]);
+ data->WriteByteSeq(playerGuid[4]);
+ data->WriteByteSeq(playerGuid[1]);
*data << uint32(QueueSlot); // Queue slot
*data << uint8(0); // Player count in rated mode
@@ -354,17 +356,17 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
*data << uint8(bg->GetMinLevel()); // Min Level
*data << uint32(Time2); // Elapsed Time
- data->WriteByteSeq(guidBytes1[2]);
+ data->WriteByteSeq(playerGuid[2]);
*data << uint32(getMSTimeDiff(bg->GetRemainingTime(), Time2)); // Remaining Time
- data->WriteByteSeq(guidBytes1[0]);
- data->WriteByteSeq(guidBytes1[3]);
- data->WriteByteSeq(guidBytes1[2]);
+ data->WriteByteSeq(playerGuid[0]);
+ data->WriteByteSeq(playerGuid[3]);
+ data->WriteByteSeq(playerGuid[2]);
*data << uint32(bg->GetClientInstanceID()); // Client Instance ID
- data->WriteByteSeq(guidBytes2[0]);
- data->WriteByteSeq(guidBytes1[7]);
+ data->WriteByteSeq(bgGuid[0]);
+ data->WriteByteSeq(playerGuid[7]);
break;
}
case STATUS_WAIT_LEAVE:
@@ -422,7 +424,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
data->WriteBit(guid[5]);
data->WriteBit(guid[1]);
data->WriteBit(guid[6]);
- data->WriteBit(player->GetTeam() == ALLIANCE);
+ data->WriteBit(player->GetBGTeam() == ALLIANCE);
data->WriteBit(guid[7]);
buff << uint32(itr2->second->HealingDone); // healing done
@@ -1215,8 +1217,6 @@ void BattlegroundMgr::SendToBattleground(Player* player, uint32 instanceId, Batt
float x, y, z, O;
uint32 mapid = bg->GetMapId();
uint32 team = player->GetBGTeam();
- if (team == 0)
- team = player->GetTeam();
bg->GetTeamStartLoc(team, x, y, z, O);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundMgr::SendToBattleground: Sending %s to map %u, X %f, Y %f, Z %f, O %f (bgType %u)", player->GetName(), mapid, x, y, z, O, bgTypeId);
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 357b7f1ecee..a1084e8807e 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -31,14 +31,11 @@
#include "GroupMgr.h"
#include "GameEventMgr.h"
-LFGMgr::LFGMgr(): m_QueueTimer(0), m_lfgProposalId(1)
+LFGMgr::LFGMgr(): m_QueueTimer(0), m_lfgProposalId(1),
+ m_options(sWorld->getIntConfig(CONFIG_LFG_OPTIONSMASK))
{
- m_options = sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE);
- if (m_options)
- {
- new LFGPlayerScript();
- new LFGGroupScript();
- }
+ new LFGPlayerScript();
+ new LFGGroupScript();
}
LFGMgr::~LFGMgr()
@@ -318,11 +315,9 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
for (LFGDungeonMap::iterator itr = m_LfgDungeonMap.begin(); itr != m_LfgDungeonMap.end(); ++itr)
{
LFGDungeonData& dungeon = itr->second;
- if (dungeon.type == LFG_TYPE_RANDOM)
- continue;
// No teleport coords in database, load from areatriggers
- if (dungeon.x == 0.0f && dungeon.y == 0.0f && dungeon.z == 0.0f)
+ if (dungeon.type != LFG_TYPE_RANDOM && dungeon.x == 0.0f && dungeon.y == 0.0f && dungeon.z == 0.0f)
{
AreaTrigger const* at = sObjectMgr->GetMapEntranceTrigger(dungeon.map);
if (!at)
@@ -355,7 +350,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
void LFGMgr::Update(uint32 diff)
{
- if (!m_options)
+ if (!isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
return;
time_t currTime = time(NULL);
@@ -401,7 +396,9 @@ void LFGMgr::Update(uint32 diff)
uint64 pguid = itVotes->first;
if (pguid != boot.victim)
SendLfgBootProposalUpdate(pguid, boot);
+ SetState(pguid, LFG_STATE_DUNGEON);
}
+ SetState(itBoot->first, LFG_STATE_DUNGEON);
m_Boots.erase(itBoot);
}
}
@@ -496,10 +493,10 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */)
else
if (ar->item)
{
- if (!player->HasItemCount(ar->item, 1) && (!ar->item2 || !player->HasItemCount(ar->item2, 1)))
+ if (!player->HasItemCount(ar->item) && (!ar->item2 || !player->HasItemCount(ar->item2)))
lockData = LFG_LOCKSTATUS_MISSING_ITEM;
}
- else if (ar->item2 && !player->HasItemCount(ar->item2, 1))
+ else if (ar->item2 && !player->HasItemCount(ar->item2))
lockData = LFG_LOCKSTATUS_MISSING_ITEM;
}
@@ -889,11 +886,13 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /*
SetState(gguid, LFG_STATE_QUEUED);
LfgQueue& queue = GetQueue(gguid);
queue.AddQueueData(gguid, time_t(time(NULL)), roleCheck.dungeons, roleCheck.roles);
+ m_RoleChecks.erase(itRoleCheck);
}
else if (roleCheck.state != LFG_ROLECHECK_INITIALITING)
+ {
RestoreState(gguid, "Rolecheck Failed");
-
- m_RoleChecks.erase(itRoleCheck);
+ m_RoleChecks.erase(itRoleCheck);
+ }
}
/**
@@ -1386,18 +1385,22 @@ void LFGMgr::UpdateBoot(uint64 guid, bool accept)
*/
void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*/)
{
- sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", player->GetGUID(), out ? "out" : "in");
-
Group* grp = player->GetGroup();
uint64 gguid = grp->GetGUID();
LFGDungeonData const* dungeon = GetLFGDungeon(GetDungeon(gguid));
- if (!dungeon || (out && player->GetMapId() != uint32(dungeon->map)))
+ if (!dungeon)
return;
if (out)
{
- player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
- player->TeleportToBGEntryPoint();
+ sLog->outDebug(LOG_FILTER_LFG, "TeleportPlayer: Player %s is being teleported out. Current Map %u - Expected Map %u",
+ player->GetName(), player->GetMapId(), uint32(dungeon->map));
+ if (player->GetMapId() == uint32(dungeon->map))
+ {
+ player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
+ player->TeleportToBGEntryPoint();
+ }
+
return;
}
@@ -1415,57 +1418,55 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
error = LFG_TELEPORTERROR_IN_VEHICLE;
else if (player->GetCharmGUID())
error = LFG_TELEPORTERROR_CHARMING;
- else
+ else if (player->GetMapId() != uint32(dungeon->map)) // Do not teleport players in dungeon to the entrance
{
- if (!dungeon)
- error = LFG_TELEPORTERROR_INVALID_LOCATION;
- else if (player->GetMapId() != uint32(dungeon->map)) // Do not teleport players in dungeon to the entrance
- {
- uint32 mapid = dungeon->map;
- float x = dungeon->x;
- float y = dungeon->y;
- float z = dungeon->z;
- float orientation = dungeon->o;
+ uint32 mapid = dungeon->map;
+ float x = dungeon->x;
+ float y = dungeon->y;
+ float z = dungeon->z;
+ float orientation = dungeon->o;
- if (!fromOpcode)
+ if (!fromOpcode)
+ {
+ // Select a player inside to be teleported to
+ for (GroupReference* itr = grp->GetFirstMember(); itr != NULL && !mapid; itr = itr->next())
{
- // Select a player inside to be teleported to
- for (GroupReference* itr = grp->GetFirstMember(); itr != NULL && !mapid; itr = itr->next())
+ Player* plrg = itr->getSource();
+ if (plrg && plrg != player && plrg->GetMapId() == uint32(dungeon->map))
{
- Player* plrg = itr->getSource();
- if (plrg && plrg != player && plrg->GetMapId() == uint32(dungeon->map))
- {
- mapid = plrg->GetMapId();
- x = plrg->GetPositionX();
- y = plrg->GetPositionY();
- z = plrg->GetPositionZ();
- orientation = plrg->GetOrientation();
- }
+ mapid = plrg->GetMapId();
+ x = plrg->GetPositionX();
+ y = plrg->GetPositionY();
+ z = plrg->GetPositionZ();
+ orientation = plrg->GetOrientation();
}
}
+ }
- if (error == LFG_TELEPORTERROR_OK)
- {
- if (!player->GetMap()->IsDungeon())
- player->SetBattlegroundEntryPoint();
+ if (error == LFG_TELEPORTERROR_OK)
+ {
+ if (!player->GetMap()->IsDungeon())
+ player->SetBattlegroundEntryPoint();
- if (player->isInFlight())
- {
- player->GetMotionMaster()->MovementExpired();
- player->CleanupAfterTaxiFlight();
- }
+ if (player->isInFlight())
+ {
+ player->GetMotionMaster()->MovementExpired();
+ player->CleanupAfterTaxiFlight();
+ }
- if (!player->TeleportTo(mapid, x, y, z, orientation))
- {
- error = LFG_TELEPORTERROR_INVALID_LOCATION;
- sLog->outError(LOG_FILTER_LFG, "LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u: ", player->GetGUID(), mapid);
- }
+ if (!player->TeleportTo(mapid, x, y, z, orientation))
+ {
+ error = LFG_TELEPORTERROR_INVALID_LOCATION;
+ sLog->outError(LOG_FILTER_LFG, "TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u (x: %f, y: %f, z: %f)", player->GetGUID(), mapid, x, y, z);
}
}
}
if (error != LFG_TELEPORTERROR_OK)
player->GetSession()->SendLfgTeleportError(uint8(error));
+
+ sLog->outDebug(LOG_FILTER_LFG, "TeleportPlayer: Player %s is being teleported in. Result: %u",
+ player->GetName(), error);
}
/**
@@ -1888,6 +1889,27 @@ bool LFGMgr::AllQueued(const LfgGuidList& check)
return true;
}
+// Only for debugging purposes
+void LFGMgr::Clean()
+{
+ m_Queues.clear();
+}
+
+bool LFGMgr::isOptionEnabled(uint32 option)
+{
+ return m_options & option;
+}
+
+uint32 LFGMgr::GetOptions()
+{
+ return m_options;
+}
+
+void LFGMgr::SetOptions(uint32 options)
+{
+ m_options = options;
+}
+
bool LFGMgr::IsSeasonActive(uint32 dungeonId)
{
switch (dungeonId)
@@ -1903,3 +1925,25 @@ bool LFGMgr::IsSeasonActive(uint32 dungeonId)
}
return false;
}
+
+std::string LFGMgr::DumpQueueInfo(bool /*full*/)
+{
+ uint32 size = uint32(m_Queues.size());
+ std::ostringstream o;
+
+ o << "Number of Queues: " << size << "\n";
+ for (LfgQueueMap::const_iterator itr = m_Queues.begin(); itr != m_Queues.end(); ++itr)
+ {
+ std::string const& queued = itr->second.DumpQueueInfo();
+ std::string const& compatibles = itr->second.DumpCompatibleInfo();
+ o << queued << compatibles;
+ /*
+ if (full)
+ {
+ LfgCompatibleMap const& compatibles = itr->second.GetCompatibleMap();
+ }
+ */
+ }
+
+ return o.str();
+}
diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h
index e60f144a94f..457412a976f 100644
--- a/src/server/game/DungeonFinding/LFGMgr.h
+++ b/src/server/game/DungeonFinding/LFGMgr.h
@@ -28,6 +28,12 @@
class Group;
class Player;
+enum LfgOptions
+{
+ LFG_OPTION_ENABLE_DUNGEON_FINDER = 0x01,
+ LFG_OPTION_ENABLE_RAID_BROWSER = 0x02,
+};
+
enum LFGMgrEnum
{
LFG_TIME_ROLECHECK = 40 * IN_MILLISECONDS,
@@ -346,11 +352,17 @@ class LFGMgr
bool IsTeleported(uint64 guid);
bool AllQueued(LfgGuidList const& check);
+ void Clean();
+
static bool HasIgnore(uint64 guid1, uint64 guid2);
static void SendLfgQueueStatus(uint64 guid, LfgQueueStatusData const& data);
+ bool isOptionEnabled(uint32 option);
+ uint32 GetOptions();
+ void SetOptions(uint32 options);
bool IsSeasonActive(uint32 dungeonId);
+ std::string DumpQueueInfo(bool full = false);
static std::string ConcatenateDungeons(LfgDungeonSet const& dungeons);
static std::string GetRolesString(uint8 roles);
static char const * GetStateString(LfgState state);
@@ -358,14 +370,12 @@ class LFGMgr
void LoadLFGDungeons(bool reload = false);
LFGDungeonData const* GetLFGDungeon(uint32 id);
LFGDungeonMap& GetLFGDungeonMap();
-
- void ClearState(uint64 guid, char const *debugMsg);
private:
uint8 GetTeam(uint64 guid);
uint64 GetGroup(uint64 guid);
void RestoreState(uint64 guid, char const *debugMsg);
-
+ void ClearState(uint64 guid, char const *debugMsg);
void SetDungeon(uint64 guid, uint32 dungeon);
void SetLockedDungeons(uint64 guid, LfgLockMap const& lock);
void DecreaseKicksLeft(uint64 guid);
diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp
index c1d89a16300..131a3e7a992 100644
--- a/src/server/game/DungeonFinding/LFGQueue.cpp
+++ b/src/server/game/DungeonFinding/LFGQueue.cpp
@@ -25,6 +25,7 @@
#include "Log.h"
#include "ObjectMgr.h"
#include "World.h"
+#include "GroupMgr.h"
/**
Given a list of guids returns the concatenation using | as delimiter
@@ -536,4 +537,45 @@ void LfgQueue::UpdateQueueTimers(time_t currTime)
time_t LfgQueue::GetJoinTime(uint64 guid)
{
return m_QueueDataMap[guid].joinTime;
-} \ No newline at end of file
+}
+
+LfgCompatibleMap const& LfgQueue::GetCompatibleMap()
+{
+ return m_CompatibleMap;
+}
+
+std::string LfgQueue::DumpQueueInfo() const
+{
+ uint32 players = 0;
+ uint32 groups = 0;
+ uint32 playersInGroup = 0;
+
+ for (uint8 i = 0; i < 2; ++i)
+ {
+ LfgGuidList const& queue = i ? m_newToQueue : m_currentQueue;
+ for (LfgGuidList::const_iterator it = queue.begin(); it != queue.end(); ++it)
+ {
+ uint64 guid = *it;
+ if (IS_GROUP(guid))
+ {
+ groups++;
+ if (Group const* group = sGroupMgr->GetGroupByGUID(GUID_LOPART(guid)))
+ playersInGroup += group->GetMembersCount();
+ else
+ playersInGroup += 2; // Shouldn't happen but just in case
+ }
+ else
+ players++;
+ }
+ }
+ std::ostringstream o;
+ o << "Queued Players: " << players << "(in group: " << playersInGroup << ") Groups: " << groups << "\n";
+ return o.str();
+}
+
+std::string LfgQueue::DumpCompatibleInfo() const
+{
+ std::ostringstream o;
+ o << "Compatible Map size: " << m_CompatibleMap.size() << "\n";
+ return o.str();
+}
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
index 10ce42da610..522ded70550 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -34,11 +34,17 @@ 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))
+ return;
+
uint64 guid = player->GetGUID();
sLFGMgr->LeaveLfg(guid);
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE);
@@ -51,6 +57,9 @@ void LFGPlayerScript::OnLogout(Player* player)
void LFGPlayerScript::OnLogin(Player* player)
{
+ if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
+ return;
+
sLFGMgr->InitializeLockedDungeons(player);
sLFGMgr->SetTeam(player->GetGUID(), player->GetTeam());
// TODO - Restore LfgPlayerData and send proper status to player if it was in a group
@@ -69,6 +78,9 @@ LFGGroupScript::LFGGroupScript() : GroupScript("LFGGroupScript")
void LFGGroupScript::OnAddMember(Group* group, uint64 guid)
{
+ if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
+ return;
+
uint64 gguid = group->GetGUID();
uint64 leader = group->GetLeaderGUID();
@@ -106,6 +118,9 @@ void LFGGroupScript::OnAddMember(Group* group, uint64 guid)
void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason)
{
+ if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
+ return;
+
uint64 gguid = group->GetGUID();
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : ""));
@@ -157,6 +172,9 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth
void LFGGroupScript::OnDisband(Group* group)
{
+ if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
+ return;
+
uint64 gguid = group->GetGUID();
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnDisband [" UI64FMTD "]", gguid);
@@ -165,6 +183,9 @@ void LFGGroupScript::OnDisband(Group* group)
void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid)
{
+ if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
+ return;
+
uint64 gguid = group->GetGUID();
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid);
@@ -173,6 +194,9 @@ void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 o
void LFGGroupScript::OnInviteMember(Group* group, uint64 guid)
{
+ if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
+ return;
+
uint64 gguid = group->GetGUID();
uint64 leader = group->GetLeaderGUID();
sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, leader);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 9ea1a7b1be3..6b202513103 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -18498,11 +18498,11 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
uint32 missingItem = 0;
if (ar->item)
{
- if (!HasItemCount(ar->item, 1) &&
- (!ar->item2 || !HasItemCount(ar->item2, 1)))
+ if (!HasItemCount(ar->item) &&
+ (!ar->item2 || !HasItemCount(ar->item2)))
missingItem = ar->item;
}
- else if (ar->item2 && !HasItemCount(ar->item2, 1))
+ else if (ar->item2 && !HasItemCount(ar->item2))
missingItem = ar->item2;
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, target_map, this))
@@ -23190,7 +23190,7 @@ uint32 Player::GetResurrectionSpellId()
}
// Reincarnation (passive spell) // prio: 1 // Glyph of Renewed Life
- if (prio < 1 && HasSpell(20608) && !HasSpellCooldown(21169) && (HasAura(58059) || HasItemCount(17030, 1)))
+ if (prio < 1 && HasSpell(20608) && !HasSpellCooldown(21169) && (HasAura(58059) || HasItemCount(17030)))
spell_id = 21169;
return spell_id;
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 9b2b508dbe7..f19e2f197b3 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1425,7 +1425,7 @@ class Player : public Unit, public GridObject<Player>
bool IsValidPos(uint8 bag, uint8 slot, bool explicit_pos);
uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_2, 2); }
void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, 2, count); }
- bool HasItemCount(uint32 item, uint32 count, bool inBankAlso = false) const;
+ bool HasItemCount(uint32 item, uint32 count = 1, bool inBankAlso = false) const;
bool HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem = NULL);
bool CanNoReagentCast(SpellInfo const* spellInfo) const;
bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const;
@@ -1442,7 +1442,6 @@ class Player : public Unit, public GridObject<Player>
return EQUIP_ERR_ITEM_NOT_FOUND;
uint32 count = pItem->GetCount();
return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL);
-
}
InventoryResult CanStoreItems(Item** pItem, int count) const;
InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const;
diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp
index 9f25f0e9c86..f95e7489870 100755
--- a/src/server/game/Handlers/LFGHandler.cpp
+++ b/src/server/game/Handlers/LFGHandler.cpp
@@ -48,7 +48,7 @@ void BuildPartyLockDungeonBlock(WorldPacket& data, const LfgLockPartyMap& lockMa
void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData)
{
- if (!sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE) ||
+ if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER) ||
(GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID() &&
(GetPlayer()->GetGroup()->GetMembersCount() == MAXGROUPSIZE || !GetPlayer()->GetGroup()->isLFGGroup())))
{
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index ac56a814c9c..0aaee6ecd48 100755
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -998,6 +998,12 @@ enum TrinityStrings
LANG_WORLD_CLOSED = 7523,
LANG_WORLD_OPENED = 7524,
+ LANG_LFG_PLAYER_INFO = 9980,
+ LANG_LFG_GROUP_INFO = 9981,
+ LANG_LFG_NOT_IN_GROUP = 9982,
+ LANG_LFG_CLEAN = 9983,
+ LANG_LFG_OPTIONS = 9984,
+ LANG_LFG_OPTIONS_CHANGED = 9985,
LANG_LFG_STATE_NONE = 9986,
LANG_LFG_STATE_ROLECHECK = 9987,
LANG_LFG_STATE_QUEUED = 9988,
@@ -1106,4 +1112,3 @@ enum TrinityStrings
// For other tables maybe 2000010000-2147483647 (max index)
};
#endif
-
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index ed7ed2ea05a..93a911459c9 100755
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -825,7 +825,7 @@ enum SpellEffects
SPELL_EFFECT_JUMP_DEST = 42,
SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER = 43,
SPELL_EFFECT_SKILL_STEP = 44,
- SPELL_EFFECT_ADD_HONOR = 45,
+ SPELL_EFFECT_PLAY_MOVIE = 45,
SPELL_EFFECT_SPAWN = 46,
SPELL_EFFECT_TRADE_SKILL = 47,
SPELL_EFFECT_STEALTH = 48,
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 29c27bc871f..6a282d15241 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -717,7 +717,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
break;
case SPELL_AURA_MOUNTED:
if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(uint32(GetMiscValueB())))
+ {
amount = mountCapability->Id;
+ m_canBeRecalculated = false;
+ }
break;
case SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE:
{
@@ -2809,7 +2812,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
target->RemoveAurasByType(SPELL_AURA_MOUNTED);
// remove speed aura
- if (MountCapabilityEntry const* mountCapability = target->GetMountCapability(uint32(GetMiscValueB())))
+ if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount()))
target->RemoveAurasDueToSpell(mountCapability->SpeedModSpell, target->GetGUID());
}
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index d3e24394974..8ed95ae9530 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5911,7 +5911,7 @@ SpellCastResult Spell::CheckItems()
else
{
uint32 itemid = m_CastItem->GetEntry();
- if (!p_caster->HasItemCount(itemid, 1))
+ if (!p_caster->HasItemCount(itemid))
return SPELL_FAILED_ITEM_NOT_READY;
ItemTemplate const* proto = m_CastItem->GetTemplate();
@@ -6063,7 +6063,7 @@ SpellCastResult Spell::CheckItems()
{
if (m_spellInfo->Totem[i] != 0)
{
- if (p_caster->HasItemCount(m_spellInfo->Totem[i], 1))
+ if (p_caster->HasItemCount(m_spellInfo->Totem[i]))
{
totems -= 1;
continue;
@@ -6100,7 +6100,7 @@ SpellCastResult Spell::CheckItems()
{
if (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (m_spellInfo->SpellFamilyFlags[0] & 0x40000000)))
return SPELL_FAILED_TOO_MANY_OF_ITEM;
- else if (!(p_caster->HasItemCount(m_spellInfo->Effects[i].ItemType, 1)))
+ else if (!(p_caster->HasItemCount(m_spellInfo->Effects[i].ItemType)))
return SPELL_FAILED_TOO_MANY_OF_ITEM;
else
p_caster->CastSpell(m_caster, m_spellInfo->Effects[EFFECT_1].CalcValue(), false); // move this to anywhere
@@ -6279,7 +6279,7 @@ SpellCastResult Spell::CheckItems()
case ITEM_SUBCLASS_WEAPON_THROWN:
{
uint32 ammo = pItem->GetEntry();
- if (!m_caster->ToPlayer()->HasItemCount(ammo, 1))
+ if (!m_caster->ToPlayer()->HasItemCount(ammo))
return SPELL_FAILED_NO_AMMO;
};
break;
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index a69795bf5e1..603cfbf1309 100755
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -252,7 +252,7 @@ class Spell
void EffectQuestClear(SpellEffIndex effIndex);
void EffectTeleUnitsFaceCaster(SpellEffIndex effIndex);
void EffectLearnSkill(SpellEffIndex effIndex);
- void EffectAddHonor(SpellEffIndex effIndex);
+ void EffectPlayMovie(SpellEffIndex effIndex);
void EffectTradeSkill(SpellEffIndex effIndex);
void EffectEnchantItemPerm(SpellEffIndex effIndex);
void EffectEnchantItemTmp(SpellEffIndex effIndex);
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 2b2bd53232d..16cf6549c41 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -113,7 +113,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectJumpDest, // 42 SPELL_EFFECT_JUMP_DEST
&Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
&Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP
- &Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related
+ &Spell::EffectPlayMovie, // 45 SPELL_EFFECT_PLAY_MOVIE
&Spell::EffectUnused, // 46 SPELL_EFFECT_SPAWN clientside, unit appears as if it was just spawned
&Spell::EffectTradeSkill, // 47 SPELL_EFFECT_TRADE_SKILL
&Spell::EffectUnused, // 48 SPELL_EFFECT_STEALTH one spell: Base Stealth
@@ -1639,7 +1639,7 @@ void Spell::EffectCreateItem2(SpellEffIndex effIndex)
{
if (item_id)
{
- if (!player->HasItemCount(item_id, 1))
+ if (!player->HasItemCount(item_id))
return;
// remove reagent
@@ -2564,7 +2564,7 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex)
unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), skillval?skillval:1, damage*75);
}
-void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
+void Spell::EffectPlayMovie(SpellEffIndex effIndex)
{
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
return;
@@ -2572,27 +2572,11 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/)
if (unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- // not scale value for item based reward (/10 value expected)
- if (m_CastItem)
- {
- unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10);
- sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUIDLow());
+ uint32 movieId = GetSpellInfo()->Effects[effIndex].MiscValue;
+ if (!sMovieStore.LookupEntry(movieId))
return;
- }
- // do not allow to add too many honor for player (50 * 21) = 1040 at level 70, or (50 * 31) = 1550 at level 80
- if (damage <= 50)
- {
- uint32 honor_reward = Trinity::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage));
- unitTarget->ToPlayer()->RewardHonor(NULL, 1, honor_reward);
- sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow());
- }
- else
- {
- //maybe we have correct honor_gain in damage already
- unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage);
- sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow());
- }
+ unitTarget->ToPlayer()->SendMovieStart(movieId);
}
void Spell::EffectTradeSkill(SpellEffIndex /*effIndex*/)
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 7fb518271cf..337f7293cec 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3621,6 +3621,10 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->AttributesEx6 |= SPELL_ATTR6_CAN_TARGET_INVISIBLE;
spellInfo->AttributesEx2 |= SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS;
break;
+ case 75888: // Awaken Flames
+ case 75889: // Awaken Flames
+ spellInfo->AttributesEx |= SPELL_ATTR1_CANT_TARGET_SELF;
+ break;
// ENDOF RUBY SANCTUM SPELLS
//
case 40055: // Introspection
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 04f39a568a8..796a7eccb59 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1178,7 +1178,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_WARDEN_CLIENT_RESPONSE_DELAY] = ConfigMgr::GetIntDefault("Warden.ClientResponseDelay", 600);
// Dungeon finder
- m_bool_configs[CONFIG_DUNGEON_FINDER_ENABLE] = ConfigMgr::GetBoolDefault("DungeonFinder.Enable", false);
+ m_int_configs[CONFIG_LFG_OPTIONSMASK] = ConfigMgr::GetIntDefault("DungeonFinder.OptionsMask", 1);
// DBC_ItemAttributes
m_bool_configs[CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES] = ConfigMgr::GetBoolDefault("DBC.EnforceItemAttributes", true);
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index e1465f4897d..a6d3a6f8dc6 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -163,7 +163,6 @@ enum WorldBoolConfigs
CONFIG_CHATLOG_PUBLIC,
CONFIG_CHATLOG_ADDON,
CONFIG_CHATLOG_BGROUND,
- CONFIG_DUNGEON_FINDER_ENABLE,
CONFIG_AUTOBROADCAST,
CONFIG_ALLOW_TICKETS,
CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES,
@@ -322,6 +321,7 @@ enum WorldIntConfigs
CONFIG_DB_PING_INTERVAL,
CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION,
CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS,
+ CONFIG_LFG_OPTIONSMASK,
CONFIG_MAX_INSTANCES_PER_HOUR,
CONFIG_WARDEN_CLIENT_RESPONSE_DELAY,
CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF,
diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt
index 177b3a479f5..a65324a9f42 100644
--- a/src/server/scripts/Commands/CMakeLists.txt
+++ b/src/server/scripts/Commands/CMakeLists.txt
@@ -27,6 +27,7 @@ set(scripts_STAT_SRCS
Commands/cs_honor.cpp
Commands/cs_instance.cpp
Commands/cs_learn.cpp
+ Commands/cs_lfg.cpp
Commands/cs_list.cpp
Commands/cs_lookup.cpp
Commands/cs_message.cpp
diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp
new file mode 100644
index 00000000000..45ecc4e4721
--- /dev/null
+++ b/src/server/scripts/Commands/cs_lfg.cpp
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "LFGMgr.h"
+#include "Group.h"
+
+void GetPlayerInfo(ChatHandler* handler, Player* player)
+{
+ if (!player)
+ return;
+
+ uint64 guid = player->GetGUID();
+ LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(guid);
+
+ char const * const state = sLFGMgr->GetStateString(sLFGMgr->GetState(guid));
+ handler->PSendSysMessage(LANG_LFG_PLAYER_INFO, player->GetName(),
+ state, uint8(dungeons.size()), sLFGMgr->ConcatenateDungeons(dungeons).c_str(),
+ sLFGMgr->GetRolesString(sLFGMgr->GetRoles(guid)).c_str(), sLFGMgr->GetComment(guid).c_str());
+}
+
+class lfg_commandscript : public CommandScript
+{
+public:
+ lfg_commandscript() : CommandScript("lfg_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand lfgCommandTable[] =
+ {
+ { "player", SEC_GAMEMASTER, false, &HandleLfgPlayerInfoCommand, "", NULL },
+ { "group", SEC_GAMEMASTER, false, &HandleLfgGroupInfoCommand, "", NULL },
+ { "queue", SEC_GAMEMASTER, false, &HandleLfgQueueInfoCommand, "", NULL },
+ { "clean", SEC_ADMINISTRATOR, false, &HandleLfgCleanCommand, "", NULL },
+ { "options", SEC_ADMINISTRATOR, false, &HandleLfgOptionsCommand, "", NULL },
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
+ };
+
+ static ChatCommand commandTable[] =
+ {
+ { "lfg", SEC_GAMEMASTER, false, NULL, "", lfgCommandTable },
+ { NULL, SEC_PLAYER, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleLfgPlayerInfoCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target = NULL;
+ std::string playerName;
+ if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName))
+ return false;
+
+ GetPlayerInfo(handler, target);
+ return true;
+ }
+
+ static bool HandleLfgGroupInfoCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target = NULL;
+ std::string playerName;
+ if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName))
+ return false;
+
+ Group* grp = target->GetGroup();
+ if (!grp)
+ {
+ handler->PSendSysMessage(LANG_LFG_NOT_IN_GROUP, playerName.c_str());
+ return true;
+ }
+
+ uint64 guid = grp->GetGUID();
+ char const * const state = sLFGMgr->GetStateString(sLFGMgr->GetState(guid));
+ handler->PSendSysMessage(LANG_LFG_GROUP_INFO, grp->isLFGGroup(),
+ state, sLFGMgr->GetDungeon(guid));
+
+ for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
+ GetPlayerInfo(handler, itr->getSource());
+
+ return true;
+ }
+
+ static bool HandleLfgOptionsCommand(ChatHandler* handler, char const* args)
+ {
+ int32 options = -1;
+ if (char* str = strtok((char*)args, " "))
+ {
+ int32 tmp = atoi(str);
+ if (tmp > -1)
+ options = tmp;
+ }
+
+ if (options != -1)
+ {
+ sLFGMgr->SetOptions(options);
+ handler->PSendSysMessage(LANG_LFG_OPTIONS_CHANGED);
+ }
+ handler->PSendSysMessage(LANG_LFG_OPTIONS, sLFGMgr->GetOptions());
+ return true;
+ }
+
+ static bool HandleLfgQueueInfoCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ handler->SendSysMessage(sLFGMgr->DumpQueueInfo().c_str());
+ return true;
+ }
+
+ static bool HandleLfgCleanCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ handler->PSendSysMessage(LANG_LFG_CLEAN);
+ sLFGMgr->Clean();
+ return true;
+ }
+};
+
+void AddSC_lfg_commandscript()
+{
+ new lfg_commandscript();
+}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp
index 7286466d335..263897edfad 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp
@@ -546,7 +546,7 @@ public:
if (player->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 &&
!player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
- player->HasItemCount(ITEM_SULFURON_INGOT, 1))
+ player->HasItemCount(ITEM_SULFURON_INGOT))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GET_CONTRACT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
}
diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp
index 3d8e68dfbf8..75109f3a2f6 100644
--- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp
+++ b/src/server/scripts/EasternKingdoms/blasted_lands.cpp
@@ -60,7 +60,7 @@ public:
bool OnGossipHello(Player* player, Creature* creature)
{
- if (player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757, 1))
+ if (player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
index ee7ef383603..48dd847b190 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp
@@ -236,7 +236,7 @@ public:
uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
// Only let them get item if Azgalor is dead.
- if (AzgalorEvent == DONE && !player->HasItemCount(ITEM_TEAR_OF_GODDESS, 1))
+ if (AzgalorEvent == DONE && !player->HasItemCount(ITEM_TEAR_OF_GODDESS))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(907, creature->GetGUID());
return true;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp
index ee8c4d1bae1..bed3cde6fa4 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp
@@ -388,13 +388,13 @@ public:
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
- if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON, 1))
+ if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_OBTAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(10000, creature->GetGUID());
return true;
}
- else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON, 1))
+ else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_OBTAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(10001, creature->GetGUID());
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
index 3690e87354d..0158d470ef9 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp
@@ -79,7 +79,7 @@ public:
player->PrepareQuestMenu(creature->GetGUID());
InstanceScript* instance = creature->GetInstanceScript();
- if (instance && instance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS, 1))
+ if (instance && instance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
if (player->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE)
diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp
index 1fe945b06d4..570c95a0737 100644
--- a/src/server/scripts/Kalimdor/silithus.cpp
+++ b/src/server/scripts/Kalimdor/silithus.cpp
@@ -366,37 +366,37 @@ class go_wind_stone : public GameObjectScript
{
case TEMPLAR:
{
- if (player->HasItemCount(ITEM_TEMPLAR_FIRE, 1))
+ if (player->HasItemCount(ITEM_TEMPLAR_FIRE))
result |= FIRE;
- if (player->HasItemCount(ITEM_TEMPLAR_WATER, 1))
+ if (player->HasItemCount(ITEM_TEMPLAR_WATER))
result |= WATER;
- if (player->HasItemCount(ITEM_TEMPLAR_EARTH, 1))
+ if (player->HasItemCount(ITEM_TEMPLAR_EARTH))
result |= EARTH;
- if (player->HasItemCount(ITEM_TEMPLAR_AIR, 1))
+ if (player->HasItemCount(ITEM_TEMPLAR_AIR))
result |= AIR;
break;
}
case DUKE:
{
- if (player->HasItemCount(ITEM_DUKE_FIRE, 1))
+ if (player->HasItemCount(ITEM_DUKE_FIRE))
result |= FIRE;
- if (player->HasItemCount(ITEM_DUKE_WATER, 1))
+ if (player->HasItemCount(ITEM_DUKE_WATER))
result |= WATER;
- if (player->HasItemCount(ITEM_DUKE_EARTH, 1))
+ if (player->HasItemCount(ITEM_DUKE_EARTH))
result |= EARTH;
- if (player->HasItemCount(ITEM_DUKE_AIR, 1))
+ if (player->HasItemCount(ITEM_DUKE_AIR))
result |= AIR;
break;
}
case ROYAL:
{
- if (player->HasItemCount(ITEM_ROYAL_FIRE, 1))
+ if (player->HasItemCount(ITEM_ROYAL_FIRE))
result |= FIRE;
- if (player->HasItemCount(ITEM_ROYAL_WATER, 1))
+ if (player->HasItemCount(ITEM_ROYAL_WATER))
result |= WATER;
- if (player->HasItemCount(ITEM_ROYAL_EARTH, 1))
+ if (player->HasItemCount(ITEM_ROYAL_EARTH))
result |= EARTH;
- if (player->HasItemCount(ITEM_ROYAL_AIR, 1))
+ if (player->HasItemCount(ITEM_ROYAL_AIR))
result |= AIR;
break;
}
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
index 2fe97f3fb50..9aa2ccbee9d 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -112,6 +112,8 @@ enum Spells
SPELL_SUMMON_EXIT_PORTALS = 74805, // Custom spell created in spell_dbc.
SPELL_TWILIGHT_MENDING = 75509,
SPELL_TWILIGHT_REALM = 74807,
+ SPELL_DUSK_SHROUD = 75476,
+ SPELL_TWILIGHT_PRECISION = 78243,
SPELL_COPY_DAMAGE = 74810 // Aura not found in DBCs.
};
@@ -225,19 +227,24 @@ struct generic_halionAI : public BossAI
{
generic_halionAI(Creature* creature, uint32 bossId) : BossAI(creature, bossId), _canEvade(false) { }
- void EnterCombat(Unit* /*who*/)
+ void EnterCombat(Unit* who)
{
- Talk(SAY_AGGRO);
- _EnterCombat();
+ BossAI::EnterCombat(who);
_canEvade = false;
- events.Reset();
events.ScheduleEvent(EVENT_CLEAVE, urand(8000, 10000));
+ events.ScheduleEvent(EVENT_TAIL_LASH, 10000);
+ }
+
+ void Reset()
+ {
+ _canEvade = false;
+ BossAI::Reset();
}
void EnterEvadeMode()
{
+ BossAI::EnterEvadeMode();
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
- _EnterEvadeMode();
}
void ExecuteEvent(uint32 const eventId)
@@ -248,6 +255,10 @@ struct generic_halionAI : public BossAI
DoCastVictim(SPELL_CLEAVE);
events.ScheduleEvent(EVENT_CLEAVE, urand(8000, 10000));
break;
+ case EVENT_TAIL_LASH:
+ DoCastAOE(SPELL_TAIL_LASH);
+ events.ScheduleEvent(EVENT_TAIL_LASH, 10000);
+ break;
}
}
@@ -296,52 +307,54 @@ class boss_halion : public CreatureScript
struct boss_halionAI : public generic_halionAI
{
- boss_halionAI(Creature* creature) : generic_halionAI(creature, DATA_HALION) { }
+ boss_halionAI(Creature* creature) : generic_halionAI(creature, DATA_HALION)
+ {
+ me->SetHomePosition(HalionSpawnPos);
+ }
void Reset()
{
generic_halionAI::Reset();
me->SetReactState(REACT_DEFENSIVE);
-
- instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
-
me->RemoveAurasDueToSpell(SPELL_TWILIGHT_PHASING);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->AddAura(SPELL_TWILIGHT_PRECISION, me);
}
void EnterEvadeMode()
{
// Phase 1: We always can evade. Phase 2 & 3: We can evade if and only if the controller tells us to.
- // Controller has absolute priority over the phasemask.
if ((events.GetPhaseMask() & PHASE_ONE_MASK) || _canEvade)
generic_halionAI::EnterEvadeMode();
}
void EnterCombat(Unit* who)
{
+ Talk(SAY_AGGRO);
+
+ events.Reset();
+ events.SetPhase(PHASE_ONE);
+
generic_halionAI::EnterCombat(who);
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1);
instance->SetBossState(DATA_HALION, IN_PROGRESS);
- events.SetPhase(PHASE_ONE);
- events.ScheduleEvent(EVENT_ACTIVATE_FIREWALL, 10000);
+ events.ScheduleEvent(EVENT_ACTIVATE_FIREWALL, 5000);
events.ScheduleEvent(EVENT_FLAME_BREATH, urand(10000, 12000));
events.ScheduleEvent(EVENT_METEOR_STRIKE, urand(20000, 25000));
events.ScheduleEvent(EVENT_FIERY_COMBUSTION, urand(15000, 18000));
- events.ScheduleEvent(EVENT_TAIL_LASH, 10000);
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER)))
controller->AI()->SetData(DATA_FIGHT_PHASE, PHASE_ONE);
}
- void JustDied(Unit* /*killer*/)
+ void JustDied(Unit* killer)
{
- _JustDied();
+ BossAI::JustDied(killer);
Talk(SAY_DEATH);
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER)))
me->Kill(controller);
@@ -389,21 +402,15 @@ class boss_halion : public CreatureScript
switch (eventId)
{
case EVENT_ACTIVATE_FIREWALL:
- {
- // Flame ring is activated 10 seconds after starting encounter, DOOR_TYPE_ROOM is only instant.
+ // Flame ring is activated 5 seconds after starting encounter, DOOR_TYPE_ROOM is only instant.
for (uint8 i = DATA_FLAME_RING; i <= DATA_TWILIGHT_FLAME_RING; ++i)
if (GameObject* flameRing = ObjectAccessor::GetGameObject(*me, instance->GetData64(i)))
instance->HandleGameObject(instance->GetData64(DATA_FLAME_RING), false, flameRing);
break;
- }
case EVENT_FLAME_BREATH:
DoCast(me, SPELL_FLAME_BREATH);
events.ScheduleEvent(EVENT_FLAME_BREATH, 25000);
break;
- case EVENT_TAIL_LASH:
- DoCastAOE(SPELL_TAIL_LASH);
- events.ScheduleEvent(EVENT_TAIL_LASH, 10000);
- break;
case EVENT_METEOR_STRIKE:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_TWILIGHT_REALM))
@@ -465,29 +472,32 @@ class boss_twilight_halion : public CreatureScript
if (!halion)
return;
- // We use explicit targeting here to avoid conditions + SPELL_ATTR6_CANT_TARGET_SELF.
// Using AddAura because no spell cast packet in sniffs.
- halion->AddAura(SPELL_COPY_DAMAGE, me);
+ halion->AddAura(SPELL_COPY_DAMAGE, me); // We use explicit targeting here to avoid conditions + SPELL_ATTR6_CANT_TARGET_SELF.
me->AddAura(SPELL_COPY_DAMAGE, halion);
+ me->AddAura(SPELL_DUSK_SHROUD, me);
me->SetHealth(halion->GetHealth());
me->SetPhaseMask(0x20, true);
me->SetReactState(REACT_AGGRESSIVE);
+ }
- instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 2);
-
+ void EnterCombat(Unit* who)
+ {
events.Reset();
events.SetPhase(PHASE_TWO);
+
+ generic_halionAI::EnterCombat(who);
+
events.ScheduleEvent(EVENT_DARK_BREATH, urand(10000, 15000));
events.ScheduleEvent(EVENT_SOUL_CONSUMPTION, 20000);
- events.ScheduleEvent(EVENT_TAIL_LASH, 10000);
- }
- void EnterEvadeMode()
- {
- // We don't care about evading, we will be despawned.
+ instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 2);
}
+ // Never evade
+ void EnterEvadeMode() { }
+
void KilledUnit(Unit* victim)
{
if (victim->GetTypeId() == TYPEID_PLAYER)
@@ -564,10 +574,6 @@ class boss_twilight_halion : public CreatureScript
DoCast(target, SPELL_SOUL_CONSUMPTION);
events.ScheduleEvent(EVENT_SOUL_CONSUMPTION, 20000);
break;
- case EVENT_TAIL_LASH:
- DoCastAOE(SPELL_TAIL_LASH);
- events.ScheduleEvent(EVENT_TAIL_LASH, 10000);
- break;
default:
generic_halionAI::ExecuteEvent(eventId);
break;
@@ -1185,10 +1191,19 @@ class npc_living_inferno : public CreatureScript
{
npc_living_infernoAI(Creature* creature) : ScriptedAI(creature) { }
- void JustSummoned(Creature* /*summoner*/)
+ void IsSummonedBy(Unit* /*summoner*/)
{
me->SetInCombatWithZone();
- DoCast(me, SPELL_BLAZING_AURA);
+ me->CastSpell(me, SPELL_BLAZING_AURA, true);
+
+ if (InstanceScript* instance = me->GetInstanceScript())
+ if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER)))
+ controller->AI()->JustSummoned(me);
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ me->DespawnOrUnsummon(1);
}
};
@@ -1219,6 +1234,18 @@ class npc_living_ember : public CreatureScript
_hasEnraged = false;
}
+ void IsSummonedBy(Unit* /*summoner*/)
+ {
+ if (InstanceScript* instance = me->GetInstanceScript())
+ if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER)))
+ controller->AI()->JustSummoned(me);
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ me->DespawnOrUnsummon(1);
+ }
+
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
index a6b50467538..bf48132b2b2 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
@@ -45,7 +45,6 @@ class instance_ruby_sanctum : public InstanceMapScript
OrbCarrierGUID = 0;
OrbRotationFocusGUID = 0;
HalionControllerGUID = 0;
- CombatStalkerGUID = 0;
CrystalChannelTargetGUID = 0;
XerestraszaGUID = 0;
BaltharusSharedHealth = 0;
@@ -56,6 +55,13 @@ class instance_ruby_sanctum : public InstanceMapScript
memset(BurningTreeGUID, 0, 4 * sizeof(uint64));
}
+ void OnPlayerEnter(Player* /*player*/)
+ {
+ if (!GetData64(DATA_HALION_CONTROLLER) && GetBossState(DATA_HALION) != DONE && GetBossState(DATA_GENERAL_ZARITHRIAN) == DONE)
+ if (Creature* halionController = instance->SummonCreature(NPC_HALION_CONTROLLER, HalionControllerSpawnPos))
+ halionController->AI()->DoAction(ACTION_INTRO_HALION);
+ }
+
void OnCreatureCreate(Creature* creature)
{
switch (creature->GetEntry())
@@ -84,9 +90,6 @@ class instance_ruby_sanctum : public InstanceMapScript
case NPC_ORB_ROTATION_FOCUS:
OrbRotationFocusGUID = creature->GetGUID();
break;
- case NPC_COMBAT_STALKER:
- CombatStalkerGUID = creature->GetGUID();
- break;
case NPC_BALTHARUS_TARGET:
CrystalChannelTargetGUID = creature->GetGUID();
break;
@@ -195,8 +198,6 @@ class instance_ruby_sanctum : public InstanceMapScript
return FlameRingGUID;
case DATA_TWILIGHT_FLAME_RING:
return TwilightFlameRingGUID;
- case DATA_COMBAT_STALKER:
- return CombatStalkerGUID;
default:
break;
}
@@ -207,14 +208,7 @@ class instance_ruby_sanctum : public InstanceMapScript
bool SetBossState(uint32 type, EncounterState state)
{
if (!InstanceScript::SetBossState(type, state))
- {
- // Summon Halion on instance loading if conditions are met. Without those lines,
- // InstanceScript::SetBossState returns false, thus preventing the switch from being called.
- if (type == DATA_HALION && state != DONE && GetBossState(DATA_GENERAL_ZARITHRIAN) == DONE && !GetData64(DATA_HALION_CONTROLLER))
- if (Creature* halionController = instance->SummonCreature(NPC_HALION_CONTROLLER, HalionControllerSpawnPos))
- halionController->AI()->DoAction(ACTION_INTRO_HALION);
return false;
- }
switch (type)
{
@@ -353,7 +347,6 @@ class instance_ruby_sanctum : public InstanceMapScript
uint64 BurningTreeGUID[4];
uint64 FlameRingGUID;
uint64 TwilightFlameRingGUID;
- uint64 CombatStalkerGUID;
uint32 BaltharusSharedHealth;
};
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
index 7eb1b73721c..47a55f9035f 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
@@ -52,7 +52,6 @@ enum DataTypes
DATA_BURNING_TREE_4 = 16,
DATA_FLAME_RING = 17,
DATA_TWILIGHT_FLAME_RING = 18,
- DATA_COMBAT_STALKER = 19,
};
enum SharedActions
@@ -97,7 +96,7 @@ enum CreaturesIds
NPC_METEOR_STRIKE_FLAME = 40055,
NPC_COMBUSTION = 40001,
NPC_CONSUMPTION = 40135,
- NPC_COMBAT_STALKER = 40151,
+ NPC_COMBAT_STALKER = 40151, // Seen in sniffs but not used, so no wonder.
// Xerestrasza
NPC_XERESTRASZA = 40429,
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
index 28595571a2f..f00369fd9e2 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
@@ -32,7 +32,7 @@
#define GOSSIP_ITEM_ETERNOS1 "I want to fly on the wings of the Bronze Flight"
#define GOSSIP_ITEM_ETERNOS2 "What abilities do Amber Drakes have?"
-#define HAS_ESSENCE(a) ((a)->HasItemCount(ITEM_EMERALD_ESSENCE, 1) || (a)->HasItemCount(ITEM_AMBER_ESSENCE, 1) || (a)->HasItemCount(ITEM_RUBY_ESSENCE, 1))
+#define HAS_ESSENCE(a) ((a)->HasItemCount(ITEM_EMERALD_ESSENCE) || (a)->HasItemCount(ITEM_AMBER_ESSENCE) || (a)->HasItemCount(ITEM_RUBY_ESSENCE))
enum GossipNPCs
{
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
index a075b480d04..89d2f752721 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
@@ -978,7 +978,7 @@ class go_celestial_planetarium_access : public GameObjectScript
if (!lock->Index[i])
continue;
- if (player->HasItemCount(lock->Index[i], 1))
+ if (player->HasItemCount(lock->Index[i]))
{
hasKey = true;
break;
diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp
index fc4f2785990..1733af17580 100644
--- a/src/server/scripts/Northrend/storm_peaks.cpp
+++ b/src/server/scripts/Northrend/storm_peaks.cpp
@@ -19,6 +19,8 @@
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "Vehicle.h"
#include "CombatAI.h"
diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp
index 480275c42bd..8533491c15f 100644
--- a/src/server/scripts/Outland/netherstorm.cpp
+++ b/src/server/scripts/Outland/netherstorm.cpp
@@ -323,22 +323,22 @@ public:
{
case 3726: //b'naar
if ((player->GetQuestStatus(10299) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10329) == QUEST_STATUS_INCOMPLETE) &&
- player->HasItemCount(29366, 1))
+ player->HasItemCount(29366))
manaforge = player->SummonCreature(ENTRY_BNAAR_C_CONSOLE, 2918.95f, 4189.98f, 161.88f, 0.34f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000);
break;
case 3730: //coruu
if ((player->GetQuestStatus(10321) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10330) == QUEST_STATUS_INCOMPLETE) &&
- player->HasItemCount(29396, 1))
+ player->HasItemCount(29396))
manaforge = player->SummonCreature(ENTRY_CORUU_C_CONSOLE, 2426.77f, 2750.38f, 133.24f, 2.14f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000);
break;
case 3734: //duro
if ((player->GetQuestStatus(10322) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10338) == QUEST_STATUS_INCOMPLETE) &&
- player->HasItemCount(29397, 1))
+ player->HasItemCount(29397))
manaforge = player->SummonCreature(ENTRY_DURO_C_CONSOLE, 2976.48f, 2183.29f, 163.20f, 1.85f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000);
break;
case 3722: //ara
if ((player->GetQuestStatus(10323) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10365) == QUEST_STATUS_INCOMPLETE) &&
- player->HasItemCount(29411, 1))
+ player->HasItemCount(29411))
manaforge = player->SummonCreature(ENTRY_ARA_C_CONSOLE, 4013.71f, 4028.76f, 192.10f, 1.25f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000);
break;
}
@@ -704,7 +704,7 @@ public:
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
- if (player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778, 1))
+ if (player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp
index aa51b532c27..a48866a2f83 100644
--- a/src/server/scripts/Outland/zangarmarsh.cpp
+++ b/src/server/scripts/Outland/zangarmarsh.cpp
@@ -249,7 +249,7 @@ public:
break;
case GOSSIP_ACTION_INFO_DEF + 2:
{
- if (!player->HasItemCount(24573, 1))
+ if (!player->HasItemCount(24573))
{
ItemPosCountVec dest;
uint32 itemId = 24573;
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index 2a5d58122ed..ddb0044a888 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -677,28 +677,28 @@ public:
switch (go->GetEntry())
{
case MATRIX_PUNCHOGRAPH_3005_A:
- if (player->HasItemCount(ITEM_WHITE_PUNCH_CARD, 1))
+ if (player->HasItemCount(ITEM_WHITE_PUNCH_CARD))
{
player->DestroyItemCount(ITEM_WHITE_PUNCH_CARD, 1, true);
player->CastSpell(player, SPELL_YELLOW_PUNCH_CARD, true);
}
break;
case MATRIX_PUNCHOGRAPH_3005_B:
- if (player->HasItemCount(ITEM_YELLOW_PUNCH_CARD, 1))
+ if (player->HasItemCount(ITEM_YELLOW_PUNCH_CARD))
{
player->DestroyItemCount(ITEM_YELLOW_PUNCH_CARD, 1, true);
player->CastSpell(player, SPELL_BLUE_PUNCH_CARD, true);
}
break;
case MATRIX_PUNCHOGRAPH_3005_C:
- if (player->HasItemCount(ITEM_BLUE_PUNCH_CARD, 1))
+ if (player->HasItemCount(ITEM_BLUE_PUNCH_CARD))
{
player->DestroyItemCount(ITEM_BLUE_PUNCH_CARD, 1, true);
player->CastSpell(player, SPELL_RED_PUNCH_CARD, true);
}
break;
case MATRIX_PUNCHOGRAPH_3005_D:
- if (player->HasItemCount(ITEM_RED_PUNCH_CARD, 1))
+ if (player->HasItemCount(ITEM_RED_PUNCH_CARD))
{
player->DestroyItemCount(ITEM_RED_PUNCH_CARD, 1, true);
player->CastSpell(player, SPELL_PRISMATIC_PUNCH_CARD, true);
@@ -884,7 +884,7 @@ public:
bool OnGossipHello(Player* player, GameObject* /*go*/)
{
- if (player->HasItemCount(ITEM_CUERGOS_KEY, 1))
+ if (player->HasItemCount(ITEM_CUERGOS_KEY))
return false;
player->CastSpell(player, SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB, true);
@@ -910,7 +910,7 @@ public:
bool OnGossipHello(Player* player, GameObject* go)
{
- if (!player->HasItemCount(ITEM_TELEPORTER_POWER_PACK, 1))
+ if (!player->HasItemCount(ITEM_TELEPORTER_POWER_PACK))
return false;
go->SummonCreature(NPC_IMAGE_WIND_TRADER, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
@@ -998,7 +998,7 @@ class go_soulwell : public GameObjectScript
return true;
// Don't try to add a stone if we already have one.
- if (player->HasItemCount(_stoneId, 1))
+ if (player->HasItemCount(_stoneId))
{
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(_stoneSpell))
Spell::SendCastResult(player, spell, 0, SPELL_FAILED_TOO_MANY_OF_ITEM);
@@ -1007,7 +1007,7 @@ class go_soulwell : public GameObjectScript
owner->CastSpell(player, _stoneSpell, true);
// Item has to actually be created to remove a charge on the well.
- if (player->HasItemCount(_stoneId, 1))
+ if (player->HasItemCount(_stoneId))
go->AddUse();
return false;
@@ -1158,7 +1158,7 @@ public:
go->CastSpell(target, SPELL_INDISPOSED_III);
}
go->CastSpell(player, SPELL_INDISPOSED);
- if (player->HasItemCount(ITEM_ANDERHOLS_SLIDER_CIDER, 1))
+ if (player->HasItemCount(ITEM_ANDERHOLS_SLIDER_CIDER))
go->CastSpell(player, SPELL_CREATE_AMBERSEEDS);
return true;
}
diff --git a/src/server/scripts/World/npc_taxi.cpp b/src/server/scripts/World/npc_taxi.cpp
index 6241978fbd2..efdd4da73d6 100644
--- a/src/server/scripts/World/npc_taxi.cpp
+++ b/src/server/scripts/World/npc_taxi.cpp
@@ -77,7 +77,7 @@ public:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SUSURRUS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
break;
case 20903: // Netherstorm - Protectorate Nether Drake
- if (player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778, 1))
+ if (player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NETHER_DRAKE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
break;
case 18725: // Old Hillsbrad Foothills - Brazen
@@ -203,7 +203,7 @@ public:
player->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155))
break;
case GOSSIP_ACTION_INFO_DEF + 2:
- if (!player->HasItemCount(25853, 1))
+ if (!player->HasItemCount(25853))
player->SEND_GOSSIP_MENU(9780, creature->GetGUID());
else
{
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index f7363f2fb0a..fc8b718655c 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1268,7 +1268,7 @@ public:
if (player->GetSpecsCount() == 1 && creature->isCanTrainingAndResetTalentsOf(player) && player->getLevel() >= sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_HELLO_ROGUE3, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_LEARNDUALSPEC);
- if (player->getClass() == CLASS_ROGUE && player->getLevel() >= 24 && !player->HasItemCount(17126, 1) && !player->GetQuestRewardStatus(6681))
+ if (player->getClass() == CLASS_ROGUE && player->getLevel() >= 24 && !player->HasItemCount(17126) && !player->GetQuestRewardStatus(6681))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_ROGUE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(5996, creature->GetGUID());
diff --git a/src/server/shared/Logging/Appender.h b/src/server/shared/Logging/Appender.h
index a4f980b30fe..2d6145b14af 100644
--- a/src/server/shared/Logging/Appender.h
+++ b/src/server/shared/Logging/Appender.h
@@ -25,48 +25,48 @@
enum LogFilterType
{
- LOG_FILTER_GENERAL, // This one should only be used inside Log.cpp
- LOG_FILTER_UNITS, // Anything related to units that doesn't fit in other categories. ie. creature formations
- LOG_FILTER_PETS,
- LOG_FILTER_VEHICLES,
- LOG_FILTER_TSCR, // C++ AI, instance scripts, etc.
- LOG_FILTER_DATABASE_AI, // SmartAI, Creature* * AI
- LOG_FILTER_MAPSCRIPTS,
- LOG_FILTER_NETWORKIO,
- LOG_FILTER_SPELLS_AURAS,
- LOG_FILTER_ACHIEVEMENTSYS,
- LOG_FILTER_CONDITIONSYS,
- LOG_FILTER_POOLSYS,
- LOG_FILTER_AUCTIONHOUSE,
- LOG_FILTER_BATTLEGROUND,
- LOG_FILTER_OUTDOORPVP,
- LOG_FILTER_CHATSYS,
- LOG_FILTER_LFG,
- LOG_FILTER_MAPS,
- LOG_FILTER_PLAYER, // Any player log that does not fit in other player filters
- LOG_FILTER_PLAYER_LOADING, // Debug output from Player::_Load functions
- LOG_FILTER_PLAYER_ITEMS,
- LOG_FILTER_PLAYER_SKILLS,
- LOG_FILTER_PLAYER_CHATLOG,
- LOG_FILTER_LOOT,
- LOG_FILTER_GUILD,
- LOG_FILTER_TRANSPORTS,
- LOG_FILTER_SQL,
- LOG_FILTER_GMCOMMAND,
- LOG_FILTER_REMOTECOMMAND,
- LOG_FILTER_WARDEN,
- LOG_FILTER_AUTHSERVER,
- LOG_FILTER_WORLDSERVER,
- LOG_FILTER_GAMEEVENTS,
- LOG_FILTER_CALENDAR,
- LOG_FILTER_CHARACTER,
- LOG_FILTER_ARENAS,
- LOG_FILTER_SQL_DRIVER,
- LOG_FILTER_SQL_DEV,
- LOG_FILTER_PLAYER_DUMP,
- LOG_FILTER_BATTLEFIELD,
- LOG_FILTER_SERVER_LOADING,
- LOG_FILTER_OPCODES
+ LOG_FILTER_GENERAL = 0, // This one should only be used inside Log.cpp
+ LOG_FILTER_UNITS = 1, // Anything related to units that doesn't fit in other categories. ie. creature formations
+ LOG_FILTER_PETS = 2,
+ LOG_FILTER_VEHICLES = 3,
+ LOG_FILTER_TSCR = 4, // C++ AI, instance scripts, etc.
+ LOG_FILTER_DATABASE_AI = 5, // SmartAI, EventAI, Creature* * AI
+ LOG_FILTER_MAPSCRIPTS = 6,
+ LOG_FILTER_NETWORKIO = 7,
+ LOG_FILTER_SPELLS_AURAS = 8,
+ LOG_FILTER_ACHIEVEMENTSYS = 9,
+ LOG_FILTER_CONDITIONSYS = 10,
+ LOG_FILTER_POOLSYS = 11,
+ LOG_FILTER_AUCTIONHOUSE = 12,
+ LOG_FILTER_BATTLEGROUND = 13,
+ LOG_FILTER_OUTDOORPVP = 14,
+ LOG_FILTER_CHATSYS = 15,
+ LOG_FILTER_LFG = 16,
+ LOG_FILTER_MAPS = 17,
+ LOG_FILTER_PLAYER = 18, // Any player log that does not fit in other player filters
+ LOG_FILTER_PLAYER_LOADING = 19, // Debug output from Player::_Load functions
+ LOG_FILTER_PLAYER_ITEMS = 20,
+ LOG_FILTER_PLAYER_SKILLS = 21,
+ LOG_FILTER_PLAYER_CHATLOG = 22,
+ LOG_FILTER_LOOT = 23,
+ LOG_FILTER_GUILD = 24,
+ LOG_FILTER_TRANSPORTS = 25,
+ LOG_FILTER_SQL = 26,
+ LOG_FILTER_GMCOMMAND = 27,
+ LOG_FILTER_REMOTECOMMAND = 28,
+ LOG_FILTER_WARDEN = 29,
+ LOG_FILTER_AUTHSERVER = 30,
+ LOG_FILTER_WORLDSERVER = 31,
+ LOG_FILTER_GAMEEVENTS = 32,
+ LOG_FILTER_CALENDAR = 33,
+ LOG_FILTER_CHARACTER = 34,
+ LOG_FILTER_ARENAS = 35,
+ LOG_FILTER_SQL_DRIVER = 36,
+ LOG_FILTER_SQL_DEV = 37,
+ LOG_FILTER_PLAYER_DUMP = 38,
+ LOG_FILTER_BATTLEFIELD = 39,
+ LOG_FILTER_SERVER_LOADING = 40,
+ LOG_FILTER_OPCODES = 41
};
const uint8 MaxLogFilter = uint8(LOG_FILTER_OPCODES) + 1;
@@ -95,12 +95,12 @@ enum AppenderType
enum AppenderFlags
{
- APPENDER_FLAGS_NONE = 0x00,
- APPENDER_FLAGS_PREFIX_TIMESTAMP = 0x01,
- APPENDER_FLAGS_PREFIX_LOGLEVEL = 0x02,
- APPENDER_FLAGS_PREFIX_LOGFILTERTYPE = 0x04,
- APPENDER_FLAGS_USE_TIMESTAMP = 0x08, // only used by FileAppender
- APPENDER_FLAGS_MAKE_FILE_BACKUP = 0x10 // only used by FileAppender
+ APPENDER_FLAGS_NONE = 0x00,
+ APPENDER_FLAGS_PREFIX_TIMESTAMP = 0x01,
+ APPENDER_FLAGS_PREFIX_LOGLEVEL = 0x02,
+ APPENDER_FLAGS_PREFIX_LOGFILTERTYPE = 0x04,
+ APPENDER_FLAGS_USE_TIMESTAMP = 0x08, // only used by FileAppender
+ APPENDER_FLAGS_MAKE_FILE_BACKUP = 0x10 // only used by FileAppender
};
struct LogMessage
diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp
index 4538fc75c1e..d8914ac8ee0 100644
--- a/src/server/shared/Logging/Log.cpp
+++ b/src/server/shared/Logging/Log.cpp
@@ -435,10 +435,10 @@ void Log::outCharDump(char const* str, uint32 accountId, uint32 guid, char const
<< ")\n" << str << "\n== END DUMP ==\n";
LogMessage* msg = new LogMessage(LOG_LEVEL_INFO, LOG_FILTER_PLAYER_DUMP, ss.str());
- ss.clear();
- ss << guid << '_' << name;
+ std::ostringstream param;
+ param << guid << '_' << name;
- msg->param1 = ss.str();
+ msg->param1 = param.str();
write(msg);
}
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index 7e43cf87dfc..16fbca2597d 100755
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -104,13 +104,13 @@ extern int main(int argc, char **argv)
if (strcmp(argv[c], "install") == 0)
{
if (WinServiceInstall())
- printf("Installing service");
+ printf("Installing service\n");
return 1;
}
else if (strcmp(argv[c], "uninstall") == 0)
{
if (WinServiceUninstall())
- printf("Uninstalling service");
+ printf("Uninstalling service\n");
return 1;
}
else
@@ -131,8 +131,8 @@ extern int main(int argc, char **argv)
if (!ConfigMgr::Load(cfg_file))
{
- printf("Invalid or missing configuration file : %s", cfg_file);
- printf("Verify that the file exists and has \'[worldserver]' written in the top of the file!");
+ printf("Invalid or missing configuration file : %s\n", cfg_file);
+ printf("Verify that the file exists and has \'[worldserver]' written in the top of the file!\n");
return 1;
}
sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using configuration file %s.", cfg_file);
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 6e9d40b6fe8..f8cb61d659d 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -1097,12 +1097,15 @@ Command.LookupMaxResults = 0
AllowTickets = 1
#
-# DungeonFinder.Enable
+# DungeonFinder.OptionsMask
# Description: Dungeon and raid finder system.
-# Default: 1 - (Enabled)
-# 0 - (Disabled)
+# Value is a bitmask consisting of:
+# LFG_OPTION_ENABLE_DUNGEON_FINDER = 1, Enable the dungeon finder browser
+# LFG_OPTION_ENABLE_RAID_BROWSER = 2, Enable the raid browser
+# Default: 1
+
+DungeonFinder.OptionsMask = 1
-DungeonFinder.Enable = 1
#
# DBC.EnforceItemAttributes