diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 3101ac6..c7526f4 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -30,7 +30,9 @@ enum Spells { SHACKLES = 38505, LFG_SPELL_DUNGEON_DESERTER = 71041, - BG_SPELL_DESERTER = 26013 + BG_SPELL_DESERTER = 26013, + SILENCED = 23207, + RESURRECTION_SICKNESS = 15007 }; AnticheatMgr::AnticheatMgr() @@ -88,7 +90,7 @@ void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo moveme // Prevents the False Positive for water walking when you ressurrect. // Aura 15007 (Resurrection sickness) is given while dead before returning back to life. - if (player->HasAuraType(SPELL_AURA_GHOST) && player->HasAura(15007)) + if (player->HasAuraType(SPELL_AURA_GHOST) && player->HasAura(RESURRECTION_SICKNESS)) return; if (m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && movementInfo.HasMovementFlag(MOVEMENTFLAG_WATERWALKING)) @@ -191,8 +193,7 @@ void AnticheatMgr::IgnoreControlHackDetection(Player* player, MovementInfo movem if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption("Anticheat.ReportsForIngameWarnings", 70)) { // display warning at the center of the screen, hacky way? - std::string str = ""; - str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Ignore Control Hack Detected!"; + std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Ignore Control Hack Detected!"; WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); data << str; sWorld->SendGlobalGMMessage(&data); @@ -259,8 +260,7 @@ void AnticheatMgr::ZAxisHackDetection(Player* player, MovementInfo movementInfo) if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption("Anticheat.ReportsForIngameWarnings", 70)) { // display warning at the center of the screen, hacky way? - std::string str = ""; - str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Ignore Zaxis Hack Detected!"; + std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Ignore Zaxis Hack Detected!"; WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); data << str; sWorld->SendGlobalGMMessage(&data); @@ -304,8 +304,7 @@ void AnticheatMgr::TeleportHackDetection(Player* player, MovementInfo movementIn if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption("Anticheat.ReportsForIngameWarnings", 70)) { // display warning at the center of the screen, hacky way? - std::string str = ""; - str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Teleport Hack Detected!"; + std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible Teleport Hack Detected!"; WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); data << str; sWorld->SendGlobalGMMessage(&data); @@ -437,8 +436,6 @@ void AnticheatMgr::SpeedHackDetection(Player* player, MovementInfo movementInfo) case 718: //Transport: The Mighty Wind (Icecrown Citadel Raid) return; break; - default: - break;// Should never happen } uint32 distance2D = (uint32)movementInfo.pos.GetExactDist2d(&m_Players[key].GetLastMovementInfo().pos); @@ -622,8 +619,7 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType) if (m_Players[key].GetTotalReports() > sConfigMgr->GetOption("Anticheat.ReportsForIngameWarnings", 70)) { // display warning at the center of the screen, hacky way? - std::string str = ""; - str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible cheater!"; + std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Possible cheater!"; WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); data << str; sWorld->SendGlobalGMMessage(&data); @@ -641,8 +637,7 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType) LOG_INFO("module", "AnticheatMgr:: Reports reached assigned threshhold and counteracted by kicking player {} ({})", player->GetName(), player->GetGUID().ToString()); } // display warning at the center of the screen, hacky way? - std::string str = ""; - str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Auto Kicked for Reaching Cheat Threshhold!"; + std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Auto Kicked for Reaching Cheat Threshhold!"; WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); data << str; sWorld->SendGlobalGMMessage(&data); @@ -668,8 +663,7 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType) LOG_INFO("module", "AnticheatMgr:: Reports reached assigned threshhold and counteracted by banning player {} ({})", player->GetName(), player->GetGUID().ToString()); } // display warning at the center of the screen, hacky way? - std::string str = ""; - str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Auto Banned Account for Reaching Cheat Threshhold!"; + std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Auto Banned Account for Reaching Cheat Threshhold!"; WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); data << str; sWorld->SendGlobalGMMessage(&data); @@ -698,8 +692,7 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType) LOG_INFO("module", "AnticheatMgr:: Reports reached assigned threshhold and counteracted by jailing player {} ({})", player->GetName(), player->GetGUID().ToString()); } // display warning at the center of the screen, hacky way? - std::string str = ""; - str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Auto Jailed Account for Reaching Cheat Threshhold!"; + std::string str = "|cFFFFFC00[Playername:|cFF00FFFF[|cFF60FF00" + std::string(player->GetName().c_str()) + "|cFF00FFFF] Auto Jailed Account for Reaching Cheat Threshhold!"; WorldPacket data(SMSG_NOTIFICATION, (str.size() + 1)); data << str; sWorld->SendGlobalGMMessage(&data); @@ -711,8 +704,10 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType) player->CastSpell(player, SHACKLES); // Shackle him in place to ensure no exploit happens for jail break attempt Aura* dungdesert = player->AddAura(LFG_SPELL_DUNGEON_DESERTER, player);// LFG_SPELL_DUNGEON_DESERTER Aura* bgdesert = player->AddAura(BG_SPELL_DESERTER, player);// BG_SPELL_DESERTER + Aura* silent = player->AddAura(SILENCED, player);// SILENCED dungdesert->SetDuration(-1); bgdesert->SetDuration(-1); + silent->SetDuration(-1); if (sConfigMgr->GetOption("Anticheat.AnnounceJail", true)) { diff --git a/src/cs_anticheat.cpp b/src/cs_anticheat.cpp index 3bdf02a..31e79ca 100644 --- a/src/cs_anticheat.cpp +++ b/src/cs_anticheat.cpp @@ -31,7 +31,8 @@ enum Spells { SHACKLES = 38505, LFG_SPELL_DUNGEON_DESERTER = 71041, - BG_SPELL_DESERTER = 26013 + BG_SPELL_DESERTER = 26013, + SILENCED = 23207 }; class anticheat_commandscript : public CommandScript @@ -139,8 +140,10 @@ public: pTarget->CastSpell(pTarget, SHACKLES); // Shackle him in place to ensure no exploit happens for jail break attempt Aura* dungdesert = pTarget->AddAura(LFG_SPELL_DUNGEON_DESERTER, pTarget);// LFG_SPELL_DUNGEON_DESERTER Aura* bgdesert = pTarget->AddAura(BG_SPELL_DESERTER, pTarget);// BG_SPELL_DESERTER + Aura* silent = pTarget->AddAura(SILENCED, pTarget);// SILENCED dungdesert->SetDuration(-1); bgdesert->SetDuration(-1); + silent->SetDuration(-1); return true; } @@ -176,10 +179,8 @@ public: if (pTarget == handler->GetSession()->GetPlayer()) return false; - WorldLocation Aloc; - WorldLocation Hloc; - Aloc = WorldLocation(0, -8833.37f, 628.62f, 94.00f, 1.06f);// Stormwind - Hloc = WorldLocation(1, 1569.59f, -4397.63f, 16.06f, 0.54f);// Orgrimmar + WorldLocation Aloc = WorldLocation(0, -8833.37f, 628.62f, 94.00f, 1.06f);// Stormwind + WorldLocation Hloc = WorldLocation(1, 1569.59f, -4397.63f, 16.06f, 0.54f);// Orgrimmar if (pTarget->GetTeamId() == TEAM_ALLIANCE) { @@ -194,6 +195,7 @@ public: pTarget->RemoveAura(SHACKLES);// remove shackles pTarget->RemoveAura(LFG_SPELL_DUNGEON_DESERTER);// LFG_SPELL_DUNGEON_DESERTER pTarget->RemoveAura(BG_SPELL_DESERTER);// BG_SPELL_DESERTER + pTarget->RemoveAura(SILENCED);// SILENCED sAnticheatMgr->AnticheatDeleteCommand(pTarget->GetGUID());// deletes auto reports on player return true;