aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp3
-rw-r--r--src/server/game/Miscellaneous/Language.h3
-rw-r--r--src/server/scripts/Commands/cs_cheat.cpp41
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_erekem.cpp5
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp15
5 files changed, 30 insertions, 37 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index 8e5766407f1..5bdaf0e661d 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -821,7 +821,8 @@ void BattlegroundMgr::ToggleArenaTesting()
void BattlegroundMgr::SetHolidayWeekends(uint32 mask)
{
- for (uint32 bgtype = 1; bgtype < MAX_BATTLEGROUND_TYPE_ID; ++bgtype)
+ // The current code supports battlegrounds up to BattlegroundTypeId(31)
+ for (uint32 bgtype = 1; bgtype < MAX_BATTLEGROUND_TYPE_ID && bgtype < 32; ++bgtype)
if (Battleground* bg = GetBattlegroundTemplate(BattlegroundTypeId(bgtype)))
bg->SetHoliday((mask & (1 << bgtype)) != 0);
}
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 63390ad61da..a4ba9866064 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -379,7 +379,8 @@ enum TrinityStrings
LANG_COMMAND_CHEAT_POWER = 361,
LANG_COMMAND_CHEAT_WW = 362,
LANG_COMMAND_WHISPEROFFPLAYER = 363,
- // Room for more level 2 364-399 not used
+ LANG_COMMAND_CHEAT_TAXINODES = 364,
+ // Room for more level 2 365-399 not used
// level 3 chat
LANG_SCRIPTS_RELOADED = 400,
diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp
index 54ae72c3d8a..78ba5a4dc74 100644
--- a/src/server/scripts/Commands/cs_cheat.cpp
+++ b/src/server/scripts/Commands/cs_cheat.cpp
@@ -24,7 +24,6 @@ EndScriptData */
#include "Chat.h"
#include "Language.h"
-#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
@@ -166,8 +165,8 @@ public:
{
Player* player = handler->GetSession()->GetPlayer();
- const char* enabled = "enabled";
- const char* disabled = "disabled";
+ const char* enabled = "ON";
+ const char* disabled = "OFF";
handler->SendSysMessage(LANG_COMMAND_CHEAT_STATUS);
handler->PSendSysMessage(LANG_COMMAND_CHEAT_GOD, player->GetCommandStatus(CHEAT_GOD) ? enabled : disabled);
@@ -175,6 +174,8 @@ public:
handler->PSendSysMessage(LANG_COMMAND_CHEAT_CT, player->GetCommandStatus(CHEAT_CASTTIME) ? enabled : disabled);
handler->PSendSysMessage(LANG_COMMAND_CHEAT_POWER, player->GetCommandStatus(CHEAT_POWER) ? enabled : disabled);
handler->PSendSysMessage(LANG_COMMAND_CHEAT_WW, player->GetCommandStatus(CHEAT_WATERWALK) ? enabled : disabled);
+ handler->PSendSysMessage(LANG_COMMAND_CHEAT_TAXINODES, player->isTaxiCheater() ? enabled : disabled);
+
return true;
}
@@ -186,13 +187,7 @@ public:
std::string argstr = (char*)args;
if (!*args)
- {
argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_WATERWALK)) ? "off" : "on";
- if (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_WATERWALK))
- argstr = "off";
- else
- argstr = "on";
- }
if (argstr == "off")
{
@@ -214,15 +209,7 @@ public:
static bool HandleTaxiCheatCommand(ChatHandler* handler, const char* args)
{
- if (!*args)
- {
- handler->SendSysMessage(LANG_USE_BOL);
- handler->SetSentErrorMessage(true);
- return false;
- }
-
std::string argstr = (char*)args;
-
Player* chr = handler->getSelectedPlayer();
if (!chr)
@@ -230,13 +217,9 @@ public:
else if (handler->HasLowerSecurity(chr, ObjectGuid::Empty)) // check online security
return false;
- if (argstr == "on")
+ if (!*args)
{
- chr->SetTaxiCheater(true);
- handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str());
- if (handler->needReportToTarget(chr))
- ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str());
- return true;
+ argstr = (chr->isTaxiCheater()) ? "off" : "on";
}
if (argstr == "off")
@@ -245,7 +228,14 @@ public:
handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str());
-
+ return true;
+ }
+ else if (argstr == "on")
+ {
+ chr->SetTaxiCheater(true);
+ handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str());
+ if (handler->needReportToTarget(chr))
+ ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str());
return true;
}
@@ -259,10 +249,11 @@ public:
if (!*args)
return false;
+ // std::int flag = (char*)args;
int flag = atoi((char*)args);
Player* chr = handler->getSelectedPlayer();
- if (chr == NULL)
+ if (!chr)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
index a7de2cab9d5..cc27bf52118 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp
@@ -208,7 +208,10 @@ class boss_erekem : public CreatureScript
if (Unit* ally = DoSelectLowestHpFriendly(40.0f))
DoCast(ally, SPELL_CHAIN_HEAL);
- task.Repeat(!CheckGuardAlive() ? Seconds(3) : (Seconds(8), Seconds(11)));
+ if (!CheckGuardAlive())
+ task.Repeat(Seconds(3));
+ else
+ task.Repeat(Seconds(8), Seconds(11));
});
scheduler.Schedule(Seconds(2), Seconds(8), [this](TaskContext task)
diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
index 5e3c7014239..93e74aaca71 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp
@@ -155,19 +155,16 @@ class boss_xevozz : public CreatureScript
std::list<uint8> summonSpells = { 0, 1, 2 };
- auto it = summonSpells.begin();
- std::advance(it, urand(0, summonSpells.size() - 1));
- DoCast(me, EtherealSphereSummonSpells[*it]);
- it = summonSpells.erase(it);
+ uint8 spell = Trinity::Containers::SelectRandomContainerElement(summonSpells);
+ DoCast(me, EtherealSphereSummonSpells[spell]);
+ summonSpells.remove(spell);
if (IsHeroic())
{
- task.Schedule(Milliseconds(2500), [this, &it, &summonSpells](TaskContext /*task*/)
+ spell = Trinity::Containers::SelectRandomContainerElement(summonSpells);
+ task.Schedule(Milliseconds(2500), [this, spell](TaskContext /*task*/)
{
- it = summonSpells.begin();
- std::advance(it, urand(0, summonSpells.size() - 1));
- DoCast(me, EtherealSphereHeroicSummonSpells[*it]);
- it = summonSpells.erase(it);
+ DoCast(me, EtherealSphereHeroicSummonSpells[spell]);
});
}