Last active
December 10, 2015 21:09
-
-
Save vertrigo/4493276 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp | |
old mode 100644 | |
new mode 100755 | |
index 78088a2..b36665e | |
--- a/src/game/BattleGround.cpp | |
+++ b/src/game/BattleGround.cpp | |
@@ -1360,10 +1360,13 @@ void BattleGround::AddPlayer(Player *plr) | |
WorldPacket data; | |
sBattleGroundMgr.BuildPlayerJoinedBattleGroundPacket(&data, plr); | |
SendPacketToTeam(team, &data, plr, false); | |
- | |
+ | |
// add arena specific auras | |
if (isArena()) | |
{ | |
+ // remove forbidden auras | |
+ plr->RemoveForbiddenAuras(); | |
plr->RemoveArenaSpellCooldowns(); | |
plr->RemoveArenaAuras(); | |
if (team == ALLIANCE) // gold | |
diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp | |
old mode 100644 | |
new mode 100755 | |
index a5f3fce..86ef805 | |
--- a/src/game/BattleGroundAB.cpp | |
+++ b/src/game/BattleGroundAB.cpp | |
@@ -25,6 +25,7 @@ | |
#include "BattleGroundMgr.h" | |
#include "Language.h" | |
#include "Util.h" | |
+#include "World.h" | |
#include "WorldPacket.h" | |
#include "MapManager.h" | |
@@ -182,6 +183,9 @@ void BattleGroundAB::StartingEventOpenDoors() | |
void BattleGroundAB::AddPlayer(Player *plr) | |
{ | |
BattleGround::AddPlayer(plr); | |
+ // remove forbidden auras | |
+ if (sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_RFA_ARATI)) | |
+ plr->RemoveForbiddenAuras(); | |
//create score and add it to map, default values are set in the constructor | |
BattleGroundABScore* sc = new BattleGroundABScore; | |
diff --git a/src/game/BattleGroundAV.cpp b/src/game/BattleGroundAV.cpp | |
old mode 100644 | |
new mode 100755 | |
index 2bf0f83..8a2426c | |
--- a/src/game/BattleGroundAV.cpp | |
+++ b/src/game/BattleGroundAV.cpp | |
@@ -23,6 +23,7 @@ | |
#include "Creature.h" | |
#include "GameObject.h" | |
#include "Language.h" | |
+#include "World.h" | |
#include "WorldPacket.h" | |
BattleGroundAV::BattleGroundAV() | |
@@ -290,6 +291,9 @@ void BattleGroundAV::StartingEventOpenDoors() | |
void BattleGroundAV::AddPlayer(Player *plr) | |
{ | |
BattleGround::AddPlayer(plr); | |
+ // remove forbidden auras | |
+ if (sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_RFA_ALTERAC)) | |
+ plr->RemoveForbiddenAuras(); | |
// create score and add it to map, default values are set in constructor | |
BattleGroundAVScore* sc = new BattleGroundAVScore; | |
m_PlayerScores[plr->GetObjectGuid()] = sc; | |
diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp | |
old mode 100644 | |
new mode 100755 | |
index dbbe920..e52e59e | |
--- a/src/game/BattleGroundWS.cpp | |
+++ b/src/game/BattleGroundWS.cpp | |
@@ -24,6 +24,7 @@ | |
#include "GameObject.h" | |
#include "ObjectMgr.h" | |
#include "BattleGroundMgr.h" | |
+#include "World.h" | |
#include "WorldPacket.h" | |
#include "Language.h" | |
#include "MapManager.h" | |
@@ -160,6 +161,9 @@ void BattleGroundWS::StartingEventOpenDoors() | |
void BattleGroundWS::AddPlayer(Player *plr) | |
{ | |
BattleGround::AddPlayer(plr); | |
+ // remove forbidden auras | |
+ if (sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_RFA_WARSONG)) | |
+ plr->RemoveForbiddenAuras(); | |
//create score and add it to map, default values are set in constructor | |
BattleGroundWGScore* sc = new BattleGroundWGScore; | |
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp | |
index 926b178..5d6848b 100755 | |
--- a/src/game/Chat.cpp | |
+++ b/src/game/Chat.cpp | |
@@ -606,9 +606,11 @@ ChatCommand * ChatHandler::getCommandTable() | |
{ "spell_target_position", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellTargetPositionCommand, "", NULL }, | |
{ "spell_threats", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellThreatsCommand, "", NULL }, | |
{ "spell_disabled", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellDisabledCommand, "", NULL }, | |
+ { "spell_bg_disabled", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellBGDisabledCommand, "", NULL }, | |
+ { "spell_zone_disabled", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellZoneDisabledCommand, "", NULL }, | |
{ "spell_linked", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellLinkedCommand, "", NULL }, | |
{ "anticheat", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAntiCheatCommand, "", NULL }, | |
- { "item_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemTemplateCommand, "", NULL }, | |
+ { "item_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemTemplateCommand, "", NULL }, | |
{ NULL, 0, false, NULL, "", NULL } | |
}; | |
diff --git a/src/game/Chat.h b/src/game/Chat.h | |
index 707784a..a3d9011 100755 | |
--- a/src/game/Chat.h | |
+++ b/src/game/Chat.h | |
@@ -488,8 +488,10 @@ class MANGOS_DLL_SPEC ChatHandler | |
bool HandleReloadSpellLinkedCommand(char* args); | |
bool HandleReloadSpellDisabledCommand(char* args); | |
+ bool HandleReloadSpellBGDisabledCommand(char* args); | |
+ bool HandleReloadSpellZoneDisabledCommand(char* args); | |
bool HandleReloadAntiCheatCommand(char* args); | |
+ bool HandleReloadItemTemplateCommand(char* args); | |
bool HandleResetAchievementsCommand(char* args); | |
bool HandleResetAllCommand(char* args); | |
diff --git a/src/game/Language.h b/src/game/Language.h | |
index 8e0cd9f..e857604 100755 | |
--- a/src/game/Language.h | |
+++ b/src/game/Language.h | |
@@ -974,6 +974,9 @@ enum MangosStrings | |
// Broadcaster | |
LANG_AUTO_BROADCAST = 1300, | |
+ LANG_SERVER_INFO_CORE = 1301, | |
+ LANG_SERVER_INFO_OS = 1302, | |
+ LANG_SERVER_LAST_UPDATE = 1303, | |
// Use for not-in-offcial-sources patches | |
// 10000-10999 | |
diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp | |
index 3d2c177..f66b08e 100755 | |
--- a/src/game/Level0.cpp | |
+++ b/src/game/Level0.cpp | |
@@ -108,9 +108,12 @@ bool ChatHandler::HandleServerInfoCommand(char* /*args*/) | |
full = _FULLVERSION(REVISION_NR); | |
fullR2 = _R2FULLVERSION(REVISION_DATE,REVISION_TIME,REVISION_R2,REVISION_ID); | |
} | |
- SendSysMessage(full); | |
- SendSysMessage(fullR2); | |
- | |
+ //SendSysMessage(full); | |
+ //SendSysMessage(fullR2); | |
+ SendSysMessage(LANG_SERVER_INFO_CORE); | |
+ PSendSysMessage(LANG_SERVER_INFO_OS, _ENDIAN_PLATFORM); | |
+ PSendSysMessage(LANG_SERVER_LAST_UPDATE, __DATE__, __TIME__); | |
+ | |
if (sScriptMgr.IsScriptLibraryLoaded()) | |
{ | |
char const* ver = sScriptMgr.GetScriptLibraryVersion(); | |
@@ -122,8 +125,8 @@ bool ChatHandler::HandleServerInfoCommand(char* /*args*/) | |
else | |
SendSysMessage(LANG_USING_SCRIPT_LIB_NONE); | |
- PSendSysMessage(LANG_USING_WORLD_DB,sWorld.GetDBVersion()); | |
- PSendSysMessage(LANG_USING_EVENT_AI,sWorld.GetCreatureEventAIVersion()); | |
+ //PSendSysMessage(LANG_USING_WORLD_DB,sWorld.GetDBVersion()); | |
+ //PSendSysMessage(LANG_USING_EVENT_AI,sWorld.GetCreatureEventAIVersion()); | |
PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum); | |
PSendSysMessage(LANG_UPTIME, str.c_str()); | |
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp | |
index 4b37ccc..2d411a5 100755 | |
--- a/src/game/Level3.cpp | |
+++ b/src/game/Level3.cpp | |
@@ -1094,6 +1094,28 @@ bool ChatHandler::HandleReloadSpellDisabledCommand(char* /*arg*/) | |
return true; | |
} | |
+bool ChatHandler::HandleReloadSpellBGDisabledCommand(char* /*arg*/) | |
+{ | |
+ sLog.outString( "Re-Loading spell disabled table for bg..."); | |
+ | |
+ sObjectMgr.LoadSpellBGDisabledEntrys(); | |
+ | |
+ SendGlobalSysMessage("DB table `spell_bg_disabled` reloaded."); | |
+ | |
+ return true; | |
+} | |
+ | |
+bool ChatHandler::HandleReloadSpellZoneDisabledCommand(char* /*arg*/) | |
+{ | |
+ sLog.outString( "Re-Loading spell disabled table for zones..."); | |
+ | |
+ sObjectMgr.LoadSpellZoneDisabledEntrys(); | |
+ | |
+ SendGlobalSysMessage("DB table `spell_zone_disabled` reloaded."); | |
+ | |
+ return true; | |
+} | |
+ | |
bool ChatHandler::HandleReloadSpellLinkedCommand(char* /*arg*/) | |
{ | |
sLog.outString( "Re-Loading spell linked table..."); | |
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp | |
old mode 100644 | |
new mode 100755 | |
index e581bbe..8ee5b4a | |
--- a/src/game/MovementHandler.cpp | |
+++ b/src/game/MovementHandler.cpp | |
@@ -603,7 +603,8 @@ void WorldSession::HandleMoverRelocation(MovementInfo& movementInfo) | |
} | |
// cancel the death timer here if started | |
- plMover->RepopAtGraveyard(); | |
+ plMover->TeleportToHomebind(); | |
+ plMover->ResurrectPlayer(1.0f); | |
} | |
} | |
} | |
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp | |
old mode 100644 | |
new mode 100755 | |
index cf32d92..f185f01 | |
--- a/src/game/ObjectMgr.cpp | |
+++ b/src/game/ObjectMgr.cpp | |
@@ -7796,6 +7796,83 @@ void ObjectMgr::LoadSpellDisabledEntrys() | |
sLog.outString( ">> Loaded %u disabled spells ( %u - is cheaters spells)", total_count, cheat_spell_count); | |
} | |
+void ObjectMgr::LoadSpellBGDisabledEntrys() | |
+{ | |
+ m_spell_bg_disabled.clear(); // need for reload case | |
+ QueryResult *result = WorldDatabase.Query("SELECT entry, ischeat_spell FROM spell_bg_disabled where active=1"); | |
+ | |
+ uint32 total_count = 0; | |
+ uint32 cheat_spell_count=0; | |
+ | |
+ if( !result ) | |
+ { | |
+ BarGoLink bar( 1 ); | |
+ bar.step(); | |
+ | |
+ sLog.outString(); | |
+ sLog.outString( ">> Loaded %u disabled spells for bg", total_count ); | |
+ return; | |
+ } | |
+ | |
+ BarGoLink bar( result->GetRowCount() ); | |
+ | |
+ Field* fields; | |
+ do | |
+ { | |
+ bar.step(); | |
+ fields = result->Fetch(); | |
+ uint32 spellid = fields[0].GetUInt32(); | |
+ bool ischeater = fields[1].GetBool(); | |
+ m_spell_bg_disabled[spellid] = ischeater; | |
+ ++total_count; | |
+ if(ischeater) | |
+ ++cheat_spell_count; | |
+ | |
+ } while ( result->NextRow() ); | |
+ | |
+ delete result; | |
+ | |
+ sLog.outString(); | |
+ sLog.outString( ">> Loaded %u disabled spells ( %u - is cheaters spells)", total_count, cheat_spell_count); | |
+} | |
+ | |
+void ObjectMgr::LoadSpellZoneDisabledEntrys() | |
+{ | |
+ m_spell_zone_disabled.clear(); // need for reload case | |
+ QueryResult *result = WorldDatabase.Query("SELECT entry, zone FROM spell_zone_disabled where active=1"); | |
+ | |
+ uint32 total_count = 0; | |
+ | |
+ if( !result ) | |
+ { | |
+ BarGoLink bar( 1 ); | |
+ bar.step(); | |
+ | |
+ sLog.outString(); | |
+ sLog.outString( ">> Loaded %u disabled zone spells", total_count ); | |
+ return; | |
+ } | |
+ | |
+ BarGoLink bar( result->GetRowCount() ); | |
+ | |
+ Field* fields; | |
+ do | |
+ { | |
+ bar.step(); | |
+ fields = result->Fetch(); | |
+ uint32 spellid = fields[0].GetUInt32(); | |
+ uint32 zone = fields[1].GetUInt32(); | |
+ m_spell_zone_disabled[spellid] = zone; | |
+ ++total_count; | |
+ | |
+ } while ( result->NextRow() ); | |
+ | |
+ delete result; | |
+ | |
+ sLog.outString(); | |
+ sLog.outString( ">> Loaded %u disabled zone spells", total_count); | |
+} | |
+ | |
void ObjectMgr::LoadFishingBaseSkillLevel() | |
{ | |
mFishingBaseForArea.clear(); // for reload case | |
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h | |
old mode 100644 | |
new mode 100755 | |
index 98b2d75..7f55cdc | |
--- a/src/game/ObjectMgr.h | |
+++ b/src/game/ObjectMgr.h | |
@@ -1037,7 +1038,33 @@ class ObjectMgr | |
} | |
return result; | |
} | |
- | |
+ | |
+ void LoadSpellBGDisabledEntrys(); | |
+ uint8 IsSpellBGDisabled(uint32 spellid) | |
+ { | |
+ uint8 result=0; | |
+ SpellDisabledBGMap::const_iterator itr = m_spell_bg_disabled.find(spellid); | |
+ if(itr != m_spell_bg_disabled.end()) | |
+ { | |
+ result=1; | |
+ if(itr->second != 0) | |
+ result=2; | |
+ } | |
+ return result; | |
+ } | |
+ | |
+ void LoadSpellZoneDisabledEntrys(); | |
+ bool IsSpellZoneDisabled(uint32 spellid, uint32 zone) | |
+ { | |
+ SpellDisabledBGMap::const_iterator itr = m_spell_zone_disabled.find(spellid); | |
+ if (itr != m_spell_zone_disabled.end()) | |
+ { | |
+ if (itr->second == zone) | |
+ return true; | |
+ } | |
+ return false; | |
+ } | |
+ | |
int GetIndexForLocale(LocaleConstant loc); | |
LocaleConstant GetLocaleForIndex(int i); | |
@@ -1249,6 +1276,12 @@ class ObjectMgr | |
typedef UNORDERED_MAP<uint32, uint32> SpellDisabledMap; | |
SpellDisabledMap m_spell_disabled; | |
+ | |
+ typedef UNORDERED_MAP<uint32, uint32> SpellDisabledBGMap; | |
+ SpellDisabledBGMap m_spell_bg_disabled; | |
+ | |
+ typedef UNORDERED_MAP<uint32, uint32> SpellDisabledZoneMap; | |
+ SpellDisabledBGMap m_spell_zone_disabled; | |
GraveYardMap mGraveYardMap; | |
diff --git a/src/game/Player.cpp b/src/game/Player.cpp | |
index 9f11e3b..f7bf48d 100755 | |
--- a/src/game/Player.cpp | |
+++ b/src/game/Player.cpp | |
@@ -7222,6 +7223,15 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) | |
{ | |
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); | |
} | |
+ | |
+ if(GetZoneId() == 440 && GetMaxHealth() < 1000000) | |
+ { | |
+ SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); | |
+ if (sWorld.IsFFAPvPRealm()) | |
+ SetFFAPvP(false); | |
+ UpdatePvP(false); | |
+ //RemoveFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE ); | |
+ } | |
if (zone->flags & AREA_FLAG_CAPITAL) // in capital city | |
SetRestType(REST_TYPE_IN_CITY); | |
@@ -7246,6 +7256,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) | |
UpdateZoneDependentAuras(); | |
UpdateZoneDependentPets(); | |
+ RemoveForbiddenForZoneAuras(m_zoneUpdateId); | |
+ | |
} | |
//If players are too far way of duel flag... then player loose the duel | |
@@ -19495,13 +19507,17 @@ void Player::Whisper(const std::string& text, uint32 language, ObjectGuid receiv | |
Player *rPlayer = sObjectMgr.GetPlayer(receiver); | |
- WorldPacket data(SMSG_MESSAGECHAT, 200); | |
- BuildPlayerChat(&data, CHAT_MSG_WHISPER, text, language); | |
- rPlayer->GetSession()->SendPacket(&data); | |
- | |
+ if(!rPlayer->isDND() || isGameMaster()) | |
+ { | |
+ WorldPacket data(SMSG_MESSAGECHAT, 200); | |
+ BuildPlayerChat(&data, CHAT_MSG_WHISPER, text, language); | |
+ rPlayer->GetSession()->SendPacket(&data); | |
+ } | |
+ | |
// not send confirmation for addon messages | |
if (language != LANG_ADDON) | |
{ | |
+ WorldPacket data(SMSG_MESSAGECHAT, 200); | |
data.Initialize(SMSG_MESSAGECHAT, 200); | |
rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, text, language); | |
GetSession()->SendPacket(&data); | |
diff --git a/src/game/Player.h b/src/game/Player.h | |
old mode 100644 | |
new mode 100755 | |
index e052f43..016f64a | |
--- a/src/game/Player.h | |
+++ b/src/game/Player.h | |
@@ -2597,9 +2597,9 @@ class MANGOS_DLL_SPEC Player : public Unit | |
Glyph m_glyphs[MAX_TALENT_SPEC_COUNT][MAX_GLYPH_SLOT_INDEX]; | |
float m_auraBaseMod[BASEMOD_END][MOD_END]; | |
- int16 m_baseRatingValue[MAX_COMBAT_RATING]; | |
- uint16 m_baseSpellPower; | |
- uint16 m_baseFeralAP; | |
+ int32 m_baseRatingValue[MAX_COMBAT_RATING]; | |
+ uint32 m_baseSpellPower; | |
+ uint32 m_baseFeralAP; | |
uint16 m_baseManaRegen; | |
uint16 m_baseHealthRegen; | |
float m_armorPenetrationPct; | |
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp | |
old mode 100644 | |
new mode 100755 | |
index 03e6459..577645c | |
--- a/src/game/Spell.cpp | |
+++ b/src/game/Spell.cpp | |
@@ -3374,6 +3374,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura) | |
m_castPositionY = m_caster->GetPositionY(); | |
m_castPositionZ = m_caster->GetPositionZ(); | |
m_castOrientation = m_caster->GetOrientation(); | |
+ uint32 zone = m_caster->GetZoneId(); | |
if (triggeredByAura) | |
m_triggeredByAuraSpell = triggeredByAura->GetSpellProto(); | |
@@ -3402,6 +3403,27 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura) | |
finish(false); | |
return; | |
} | |
+ | |
+ if (m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->InBattleGround()) | |
+ { | |
+ if (uint8 result = sObjectMgr.IsSpellBGDisabled(m_spellInfo->Id)) | |
+ { | |
+ SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE); | |
+ finish(false); | |
+ return; | |
+ } | |
+ } | |
+ | |
+ if (sObjectMgr.IsSpellZoneDisabled(m_spellInfo->Id, zone)) | |
+ { | |
+ if (m_caster->GetTypeId() == TYPEID_PLAYER) | |
+ { | |
+ sLog.outDebug("Player %s cast a spell %u which was disabled by server administrator", m_caster->GetName(), m_spellInfo->Id); | |
+ } | |
+ SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE); | |
+ finish(false); | |
+ return; | |
+ } | |
// Fill cost data | |
m_powerCost = CalculatePowerCost(m_spellInfo, m_caster, this, m_CastItem); | |
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp | |
index 6e26fe1..4bce236 100644 | |
--- a/src/game/SpellAuras.cpp | |
+++ b/src/game/SpellAuras.cpp | |
@@ -5133,6 +5133,13 @@ void Aura::HandleAuraModStun(bool apply, bool Real) | |
if (apply) | |
{ | |
+ // remove stealth for set target | |
+ if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_ROGUE && GetSpellProto()->SpellFamilyFlags.test<CF_ROGUE_SAP>()) | |
+ { | |
+ if (target->HasStealthAura()) | |
+ target->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); | |
+ } | |
+ | |
// Frost stun aura -> freeze/unfreeze target | |
if (GetSpellSchoolMask(GetSpellProto()) & SPELL_SCHOOL_MASK_FROST) | |
target->ModifyAuraState(AURA_STATE_FROZEN, apply); | |
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp | |
old mode 100644 | |
new mode 100755 | |
index 6e59ef9..064e5a4 | |
--- a/src/game/Unit.cpp | |
+++ b/src/game/Unit.cpp | |
@@ -1424,6 +1424,16 @@ void Unit::CastCustomSpell(Unit* Victim, SpellEntry const *spellInfo, int32 cons | |
if (sObjectMgr.IsSpellDisabled(spellInfo->Id)) | |
return; | |
+ | |
+ if (sObjectMgr.IsSpellZoneDisabled(spellInfo->Id, GetZoneId())) | |
+ return; | |
+ | |
+ // prevent to cast forbidden spell in battleground | |
+ if (((Player*)this)->InBattleGround()) | |
+ if (sObjectMgr.IsSpellBGDisabled(spellInfo->Id)) | |
+ return; | |
if (castItem) | |
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "WORLD: cast Item spellId - %i", spellInfo->Id); | |
@@ -1493,6 +1503,10 @@ void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, boo | |
if (sObjectMgr.IsSpellDisabled(spellInfo->Id)) | |
return; | |
+ | |
+ if (((Player*)this)->InBattleGround()) | |
+ if (sObjectMgr.IsSpellBGDisabled(spellInfo->Id)) | |
+ return; | |
if (castItem) | |
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "WORLD: cast Item spellId - %i", spellInfo->Id); | |
@@ -5494,6 +5508,34 @@ void Unit::RemoveAllAuras(AuraRemoveMode mode /*= AURA_REMOVE_BY_DEFAULT*/) | |
} | |
} | |
+void Unit::RemoveForbiddenAuras() | |
+{ | |
+ for(SpellAuraHolderMap::iterator iter = m_spellAuraHolders.begin(); iter != m_spellAuraHolders.end();) | |
+ { | |
+ if (!iter->second->IsDeleted() && sObjectMgr.IsSpellBGDisabled(iter->second->GetId())) | |
+ { | |
+ RemoveAurasDueToSpell(iter->second->GetId()); | |
+ iter = m_spellAuraHolders.begin(); | |
+ } | |
+ else | |
+ ++iter; | |
+ } | |
+} | |
+ | |
+void Unit::RemoveForbiddenForZoneAuras(uint32 zoneid) | |
+{ | |
+ for(SpellAuraHolderMap::iterator iter = m_spellAuraHolders.begin(); iter != m_spellAuraHolders.end();) | |
+ { | |
+ if (!iter->second->IsDeleted() && sObjectMgr.IsSpellZoneDisabled(iter->second->GetId(),zoneid)) | |
+ { | |
+ RemoveAurasDueToSpell(iter->second->GetId()); | |
+ iter = m_spellAuraHolders.begin(); | |
+ } | |
+ else | |
+ ++iter; | |
+ } | |
+} | |
+ | |
void Unit::RemoveArenaAuras(bool onleave) | |
{ | |
// in join, remove positive buffs, on end, remove negative | |
diff --git a/src/game/Unit.h b/src/game/Unit.h | |
old mode 100644 | |
new mode 100755 | |
index 470ec1b..c70d02a | |
--- a/src/game/Unit.h | |
+++ b/src/game/Unit.h | |
@@ -1700,6 +1700,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject | |
void RemoveAurasWithAttribute(uint32 flags); | |
void RemoveAurasWithDispelType(DispelType type, ObjectGuid casterGuid = ObjectGuid()); | |
void RemoveAllAuras(AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); | |
+ void RemoveForbiddenAuras(); | |
+ void RemoveForbiddenForZoneAuras(uint32 zoneid); | |
void RemoveArenaAuras(bool onleave = false); | |
void RemoveAllAurasOnDeath(); | |
diff --git a/src/game/World.cpp b/src/game/World.cpp | |
old mode 100644 | |
new mode 100755 | |
index db7c8d5..2f17167 | |
--- a/src/game/World.cpp | |
+++ b/src/game/World.cpp | |
@@ -805,7 +805,10 @@ void World::LoadConfigSettings(bool reload) | |
setConfig(CONFIG_BOOL_DECLINED_NAMES_USED, true); | |
else | |
setConfig(CONFIG_BOOL_DECLINED_NAMES_USED, "DeclinedNames", false); | |
- | |
+ | |
+ setConfig(CONFIG_BOOL_BATTLEGROUND_RFA_WARSONG, "Battleground.Warsong.RemoveForbiddenAuras", true); | |
+ setConfig(CONFIG_BOOL_BATTLEGROUND_RFA_ARATI, "Battleground.Arati.RemoveForbiddenAuras", true); | |
+ setConfig(CONFIG_BOOL_BATTLEGROUND_RFA_ALTERAC, "Battleground.Alterac.RemoveForbiddenAuras", true); | |
setConfig(CONFIG_BOOL_BATTLEGROUND_CAST_DESERTER, "Battleground.CastDeserter", true); | |
setConfigMinMax(CONFIG_UINT32_BATTLEGROUND_QUEUE_ANNOUNCER_JOIN, "Battleground.QueueAnnouncer.Join", 0, 0, 2); | |
setConfig(CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_START, "Battleground.QueueAnnouncer.Start", false); | |
@@ -1337,6 +1340,9 @@ void World::SetInitialWorldSettings() | |
sLog.outString( "Loading Spell disabled..." ); | |
sObjectMgr.LoadSpellDisabledEntrys(); | |
+ | |
+ sLog.outString( "Loading Spell disabled for bg... " ); | |
+ sObjectMgr.LoadSpellBGDisabledEntrys(); | |
sLog.outString( "Loading Loot Tables..." ); | |
sLog.outString(); | |
diff --git a/src/game/World.h b/src/game/World.h | |
old mode 100644 | |
new mode 100755 | |
index eb61139..4924923 | |
--- a/src/game/World.h | |
+++ b/src/game/World.h | |
@@ -354,6 +354,9 @@ enum eConfigBoolValues | |
CONFIG_BOOL_SKILL_FAIL_LOOT_FISHING, | |
CONFIG_BOOL_SKILL_FAIL_GAIN_FISHING, | |
CONFIG_BOOL_SKILL_FAIL_POSSIBLE_FISHINGPOOL, | |
+ CONFIG_BOOL_BATTLEGROUND_RFA_WARSONG, | |
+ CONFIG_BOOL_BATTLEGROUND_RFA_ARATI, | |
+ CONFIG_BOOL_BATTLEGROUND_RFA_ALTERAC, | |
CONFIG_BOOL_BATTLEGROUND_CAST_DESERTER, | |
CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_START, | |
CONFIG_BOOL_ARENA_AUTO_DISTRIBUTE_POINTS, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment