aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-04-25 22:03:34 +0200
committerShauren <shauren.trinity@gmail.com>2016-05-20 23:49:53 +0200
commit70102f32fe38ae7d49acbd5ddee0239602d3cb94 (patch)
tree22dcecc33942c7f60e2edb5402f6f7feaf559ece /src/server/game/Spells
parent885d9b53c38662e00e3b4977b82e9cf36d197f94 (diff)
Core/DataStores: Updated opcodes and db2 to 7.0.3.21414
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp2
-rw-r--r--src/server/game/Spells/SpellInfo.cpp26
-rw-r--r--src/server/game/Spells/SpellInfo.h3
-rw-r--r--src/server/game/Spells/SpellMgr.cpp1
-rw-r--r--src/server/game/Spells/SpellMgr.h1
5 files changed, 18 insertions, 15 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 31e0b126be6..d22b6df71e4 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -5291,7 +5291,7 @@ void Spell::EffectGameObjectDamage(SpellEffIndex /*effIndex*/)
FactionTemplateEntry const* casterFaction = caster->GetFactionTemplateEntry();
FactionTemplateEntry const* targetFaction = sFactionTemplateStore.LookupEntry(gameObjTarget->GetUInt32Value(GAMEOBJECT_FACTION));
// Do not allow to damage GO's of friendly factions (ie: Wintergrasp Walls/Ulduar Storm Beacons)
- if (!targetFaction || (casterFaction && targetFaction && !casterFaction->IsFriendlyTo(*targetFaction)))
+ if (!targetFaction || (casterFaction && targetFaction && !casterFaction->IsFriendlyTo(targetFaction)))
gameObjTarget->ModifyHealth(-damage, caster, GetSpellInfo()->Id);
}
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 031ab5bdbdf..ec1c63076aa 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -20,8 +20,8 @@
#include "SpellAuraEffects.h"
#include "SpellMgr.h"
#include "Spell.h"
-#include "DBCStores.h"
#include "ConditionMgr.h"
+#include "GameTables.h"
#include "Player.h"
#include "Battleground.h"
#include "Vehicle.h"
@@ -468,6 +468,9 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const*
if (!_spellInfo->HasAttribute(SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL) && _spellInfo->HasAttribute(SPELL_ATTR10_USE_SPELL_BASE_LEVEL_FOR_SCALING))
level = _spellInfo->BaseLevel;
+ if (_spellInfo->Scaling.MinScalingLevel && _spellInfo->Scaling.MinScalingLevel > level)
+ level = _spellInfo->Scaling.MinScalingLevel;
+
if (_spellInfo->Scaling.MaxScalingLevel && _spellInfo->Scaling.MaxScalingLevel < level)
level = _spellInfo->Scaling.MaxScalingLevel;
@@ -481,8 +484,11 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const*
{
if (!_spellInfo->HasAttribute(SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL))
{
- if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.EvaluateTable(level - 1, (_spellInfo->Scaling.Class > 0 ? _spellInfo->Scaling.Class : ((MAX_CLASSES - 1 /*last class*/) - _spellInfo->Scaling.Class)) - 1))
- value = gtScaling->value;
+ GtSpellScalingEntry const* gtScaling = sSpellScalingGameTable.GetRow(level);
+ if (_spellInfo->Scaling.Class > 0)
+ value = GetGameTableColumnForClass(gtScaling, _spellInfo->Scaling.Class);
+ else
+ value = gtScaling->Item;
}
else
value = GetRandomPropertyPoints(itemLevel != -1 ? uint32(itemLevel) : 1u, ITEM_QUALITY_RARE, INVTYPE_CHEST, 0);
@@ -600,10 +606,10 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const*
if (canEffectScale)
{
- GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.EvaluateTable(_spellInfo->SpellLevel - 1, 0);
- GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.EvaluateTable(caster->getLevel() - 1, 0);
+ GtNpcManaCostScalerEntry const* spellScaler = sNpcManaCostScalerGameTable.GetRow(_spellInfo->SpellLevel);
+ GtNpcManaCostScalerEntry const* casterScaler = sNpcManaCostScalerGameTable.GetRow(caster->getLevel());
if (spellScaler && casterScaler)
- value *= casterScaler->ratio / spellScaler->ratio;
+ value *= casterScaler->Scaler / spellScaler->Scaler;
}
}
}
@@ -1729,7 +1735,7 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
// continent limitation (virtual continent)
if (AttributesEx4 & SPELL_ATTR4_CAST_ONLY_IN_OUTLAND)
{
- uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id);
+ uint32 v_map = sDB2Manager.GetVirtualMapForMapAndZone(map_id, zone_id);
MapEntry const* mapEntry = sMapStore.LookupEntry(v_map);
if (!mapEntry || mapEntry->ExpansionID < 1 || !mapEntry->IsContinent())
return SPELL_FAILED_INCORRECT_AREA;
@@ -2676,10 +2682,10 @@ std::vector<SpellInfo::CostData> SpellInfo::CalcPowerCost(Unit const* caster, Sp
{
if (Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION)
{
- GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.EvaluateTable(SpellLevel - 1, 0);
- GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.EvaluateTable(caster->getLevel() - 1, 0);
+ GtNpcManaCostScalerEntry const* spellScaler = sNpcManaCostScalerGameTable.GetRow(SpellLevel);
+ GtNpcManaCostScalerEntry const* casterScaler = sNpcManaCostScalerGameTable.GetRow(caster->getLevel());
if (spellScaler && casterScaler)
- powerCost *= casterScaler->ratio / spellScaler->ratio;
+ powerCost *= casterScaler->Scaler / spellScaler->Scaler;
}
}
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 764760ddffa..a5d620571a3 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -20,8 +20,6 @@
#include "SharedDefines.h"
#include "Util.h"
-#include "DBCStructure.h"
-#include "DB2Structure.h"
#include "Object.h"
#include "SpellAuraDefines.h"
@@ -409,6 +407,7 @@ public:
struct ScalingInfo
{
int32 Class;
+ uint32 MinScalingLevel;
uint32 MaxScalingLevel;
uint32 ScalesFromItemLevel;
} Scaling;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index ebf82122e00..a7ad0e55d5b 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -21,7 +21,6 @@
#include "ObjectMgr.h"
#include "SpellAuraDefines.h"
#include "SharedDefines.h"
-#include "DBCStores.h"
#include "Chat.h"
#include "BattlegroundMgr.h"
#include "BattlefieldWG.h"
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index e9488d8ecbb..4d15043a220 100644
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -22,7 +22,6 @@
// For static or at-server-startup loaded spell data
#include "Define.h"
-#include "DBCStructure.h"
#include "SharedDefines.h"
#include "Util.h"