mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-28 04:42:10 +01:00
Core/Commands: Added a command that shows what cheat commands you have active
Closes #7721 (Modified)
This commit is contained in:
12
sql/updates/world/2012_09_13_02_world_trinity_string.sql
Normal file
12
sql/updates/world/2012_09_13_02_world_trinity_string.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
DELETE FROM `command` WHERE `name` = 'cheat status';
|
||||
INSERT INTO `command` (`name`, `security`, `help`) VALUES
|
||||
('cheat status', 2, 'Syntax: .cheat status \n\nShows the cheats you currently have enabled.');
|
||||
|
||||
DELETE FROM `trinity_string` WHERE `entry` BETWEEN 357 AND 362;
|
||||
INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
|
||||
(357, 'Cheat Command Status:'),
|
||||
(358, 'Godmode: %s.'),
|
||||
(359, 'Casttime: %s.'),
|
||||
(360, 'Cooldown: %s.'),
|
||||
(361, 'Power: %s.'),
|
||||
(362, 'Waterwalk: %s.');
|
||||
@@ -338,7 +338,13 @@ enum TrinityStrings
|
||||
LANG_TITLE_REMOVE_RES = 354,
|
||||
LANG_TITLE_CURRENT_RES = 355,
|
||||
LANG_CURRENT_TITLE_RESET = 356,
|
||||
// Room for more level 2 357-399 not used
|
||||
LANG_COMMAND_CHEAT_STATUS = 357,
|
||||
LANG_COMMAND_CHEAT_GOD = 358,
|
||||
LANG_COMMAND_CHEAT_CT = 359,
|
||||
LANG_COMMAND_CHEAT_CD = 360,
|
||||
LANG_COMMAND_CHEAT_POWER = 361,
|
||||
LANG_COMMAND_CHEAT_WW = 362,
|
||||
// Room for more level 2 363-399 not used
|
||||
|
||||
// level 3 chat
|
||||
LANG_SCRIPTS_RELOADED = 400,
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
{ "cooldown", SEC_GAMEMASTER, false, &HandleCoolDownCheatCommand, "", NULL },
|
||||
{ "power", SEC_GAMEMASTER, false, &HandlePowerCheatCommand, "", NULL },
|
||||
{ "waterwalk", SEC_GAMEMASTER, false, &HandleWaterWalkCheatCommand, "", NULL },
|
||||
{ "status", SEC_GAMEMASTER, false, &HandleCheatStatusCommand, "", NULL },
|
||||
{ "taxi", SEC_GAMEMASTER, false, &HandleTaxiCheatCommand, "", NULL },
|
||||
{ "explore", SEC_GAMEMASTER, false, &HandleExploreCheatCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
@@ -159,6 +160,22 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleCheatStatusCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
const char* enabled = "enabled";
|
||||
const char* disabled = "disabled";
|
||||
|
||||
handler->SendSysMessage(LANG_COMMAND_CHEAT_STATUS);
|
||||
handler->PSendSysMessage(LANG_COMMAND_CHEAT_GOD, player->GetCommandStatus(CHEAT_GOD) ? enabled : disabled);
|
||||
handler->PSendSysMessage(LANG_COMMAND_CHEAT_CD, player->GetCommandStatus(CHEAT_COOLDOWN) ? enabled : disabled);
|
||||
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);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWaterWalkCheatCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
if (!handler->GetSession() && !handler->GetSession()->GetPlayer())
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "SpellScript.h"
|
||||
#include "Vehicle.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
|
||||
class spell_generic_quest_update_entry_SpellScript : public SpellScript
|
||||
{
|
||||
@@ -1322,7 +1324,7 @@ enum Quest11010_11102_11023Data
|
||||
SPELL_FLAK_CANNON_TRIGGER = 40110,
|
||||
SPELL_CHOOSE_LOC = 40056,
|
||||
SPELL_AGGRO_CHECK = 40112,
|
||||
// NPCs
|
||||
// NPCs
|
||||
NPC_FEL_CANNON2 = 23082
|
||||
};
|
||||
|
||||
@@ -1364,21 +1366,21 @@ class spell_q11010_q11102_q11023_aggro_check : public SpellScriptLoader
|
||||
class spell_q11010_q11102_q11023_aggro_check_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q11010_q11102_q11023_aggro_check_SpellScript);
|
||||
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* playerTarget = GetHitPlayer())
|
||||
// Check if found player target is on fly mount or using flying form
|
||||
// Check if found player target is on fly mount or using flying form
|
||||
if (playerTarget->HasAuraType(SPELL_AURA_FLY) || playerTarget->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
playerTarget->CastSpell(playerTarget, SPELL_FLAK_CANNON_TRIGGER, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||
}
|
||||
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q11010_q11102_q11023_aggro_check_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q11010_q11102_q11023_aggro_check_SpellScript();
|
||||
@@ -1423,28 +1425,28 @@ class spell_q11010_q11102_q11023_choose_loc : public SpellScriptLoader
|
||||
class spell_q11010_q11102_q11023_choose_loc_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q11010_q11102_q11023_choose_loc_SpellScript);
|
||||
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
// Check for player that is in 65 y range
|
||||
// Check for player that is in 65 y range
|
||||
std::list<Player*> playerList;
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(caster, 765.0f);
|
||||
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(caster, playerList, checker);
|
||||
caster->VisitNearbyWorldObject(65.0f, searcher);
|
||||
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(caster, playerList, checker);
|
||||
caster->VisitNearbyWorldObject(65.0f, searcher);
|
||||
for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
|
||||
// Check if found player target is on fly mount or using flying form
|
||||
// Check if found player target is on fly mount or using flying form
|
||||
if ((*itr)->HasAuraType(SPELL_AURA_FLY) || (*itr)->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
// Summom Fel Cannon (bunny version) at found player
|
||||
caster->SummonCreature(NPC_FEL_CANNON2, (*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ());
|
||||
}
|
||||
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_q11010_q11102_q11023_choose_loc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q11010_q11102_q11023_choose_loc_SpellScript();
|
||||
|
||||
Reference in New Issue
Block a user