aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorIntel <chemicstry@gmail.com>2014-11-10 02:51:55 +0200
committerIntel <chemicstry@gmail.com>2014-11-10 02:51:55 +0200
commit43d5fb5eaefeafb34bea10ff5c6a2878c6c14df1 (patch)
treeaec71df4cf481459512756b27521113f1aae2198 /src/server/game/Spells
parentf847f55385cd1babc67d701d49f180242c63e83e (diff)
Core/DataStores: Updating spells dbc part 2
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp8
-rw-r--r--src/server/game/Spells/Spell.cpp10
-rw-r--r--src/server/game/Spells/SpellEffects.cpp2
-rw-r--r--src/server/game/Spells/SpellInfo.cpp57
-rw-r--r--src/server/game/Spells/SpellMgr.cpp9
5 files changed, 46 insertions, 40 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 88791cc2e77..4e31af725a9 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -502,7 +502,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
if (pEnchant)
{
for (int t = 0; t < MAX_ITEM_ENCHANTMENT_EFFECTS; t++)
- if (pEnchant->spellid[t] == m_spellInfo->Id)
+ if (pEnchant->EffectSpellID[t] == m_spellInfo->Id)
{
amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000);
break;
@@ -1902,12 +1902,12 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
// Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
{
- if (!shapeInfo->stanceSpell[i])
+ if (!shapeInfo->PresetSpellID[i])
continue;
if (apply)
- target->ToPlayer()->AddTemporarySpell(shapeInfo->stanceSpell[i]);
+ target->ToPlayer()->AddTemporarySpell(shapeInfo->PresetSpellID[i]);
else
- target->ToPlayer()->RemoveTemporarySpell(shapeInfo->stanceSpell[i]);
+ target->ToPlayer()->RemoveTemporarySpell(shapeInfo->PresetSpellID[i]);
}
}
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 75f6c7d86fa..3b9acb90d79 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4546,7 +4546,7 @@ void Spell::TakeRunePower(bool didHit)
// you can gain some runic power when use runes
if (didHit)
- if (int32 rp = int32(runeCostData->runePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME)))
+ if (int32 rp = int32(runeCostData->RunePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME)))
player->ModifyPower(POWER_RUNIC_POWER, int32(rp));
}
@@ -5812,7 +5812,7 @@ SpellCastResult Spell::CheckRange(bool strict)
if (m_spellInfo->RangeEntry->ID == 1)
return SPELL_CAST_OK;
- range_type = m_spellInfo->RangeEntry->type;
+ range_type = m_spellInfo->RangeEntry->Flags;
}
Unit* target = m_targets.GetUnitTarget();
@@ -6132,7 +6132,7 @@ SpellCastResult Spell::CheckItems()
{
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- switch (enchantEntry->type[s])
+ switch (enchantEntry->Effect[s])
{
case ITEM_ENCHANTMENT_TYPE_USE_SPELL:
if (isItemUsable)
@@ -6158,7 +6158,7 @@ SpellCastResult Spell::CheckItems()
{
if (!enchantEntry)
return SPELL_FAILED_ERROR;
- if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
+ if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND)
return SPELL_FAILED_NOT_TRADEABLE;
}
break;
@@ -6175,7 +6175,7 @@ SpellCastResult Spell::CheckItems()
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if (!pEnchant)
return SPELL_FAILED_ERROR;
- if (pEnchant->slot & ENCHANTMENT_CAN_SOULBOUND)
+ if (pEnchant->Flags & ENCHANTMENT_CAN_SOULBOUND)
return SPELL_FAILED_NOT_TRADEABLE;
}
break;
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index c441bd9b3f7..c383ba0d51f 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2571,7 +2571,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
bool add_socket = false;
for (uint8 i = 0; i < MAX_ITEM_ENCHANTMENT_EFFECTS; ++i)
{
- if (enchant->type[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
+ if (enchant->Effect[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
{
add_socket = true;
break;
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index dcd3338e0c2..9fc99e431d3 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -367,9 +367,10 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo con
TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0;
SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag128();
ImplicitTargetConditions = NULL;
- ScalingMultiplier = scaling ? scaling->Multiplier[_effIndex] : 0.0f;
- DeltaScalingMultiplier = scaling ? scaling->RandomMultiplier[_effIndex] : 0.0f;
- ComboScalingMultiplier = scaling ? scaling->OtherMultiplier[_effIndex] : 0.0f;
+ // TODO: 6.x these values are no longer in dbc
+ ScalingMultiplier = /*scaling ? scaling->Multiplier[_effIndex] :*/ 0.0f;
+ DeltaScalingMultiplier = /*scaling ? scaling->RandomMultiplier[_effIndex] :*/ 0.0f;
+ ComboScalingMultiplier = /*scaling ? scaling->OtherMultiplier[_effIndex] :*/ 0.0f;
}
bool SpellEffectInfo::IsEffect() const
@@ -925,8 +926,8 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
CastTimeMax = _scaling ?_scaling->CastTimeMax : 0;
CastTimeMaxLevel = _scaling ? _scaling->CastTimeMaxLevel : 0;
ScalingClass = _scaling ? _scaling->ScalingClass : 0;
- CoefBase = _scaling ? _scaling->CoefBase : 0;
- CoefLevelBase = _scaling ? _scaling->CoefLevelBase : 0;
+ CoefBase = _scaling ? _scaling->NerfFactor : 0;
+ CoefLevelBase = _scaling ? _scaling->NerfMaxLevel : 0;
// SpellAuraOptionsEntry
SpellAuraOptionsEntry const* _options = GetSpellAuraOptions();
@@ -955,16 +956,16 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellCategoriesEntry
SpellCategoriesEntry const* _categorie = GetSpellCategories();
CategoryEntry = _categorie ? sSpellCategoryStore.LookupEntry(_categorie->Category) : NULL;
- Dispel = _categorie ? _categorie->Dispel : 0;
+ Dispel = _categorie ? _categorie->DispelType : 0;
Mechanic = _categorie ? _categorie->Mechanic : 0;
StartRecoveryCategory = _categorie ? _categorie->StartRecoveryCategory : 0;
- DmgClass = _categorie ? _categorie->DmgClass : 0;
+ DmgClass = _categorie ? _categorie->DefenseType : 0;
PreventionType = _categorie ? _categorie->PreventionType : 0;
// SpellClassOptionsEntry
SpellClassOptionsEntry const* _class = GetSpellClassOptions();
- SpellFamilyName = _class ? _class->SpellFamilyName : 0;
- SpellFamilyFlags = _class ? _class->SpellFamilyFlags : flag96(0);
+ SpellFamilyName = _class ? _class->SpellClassSet : 0;
+ SpellFamilyFlags = _class ? _class->SpellClassMask : flag128(0);
// SpellCooldownsEntry
SpellCooldownsEntry const* _cooldowns = GetSpellCooldowns();
@@ -981,21 +982,22 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellInterruptsEntry
SpellInterruptsEntry const* _interrupt = GetSpellInterrupts();
InterruptFlags = _interrupt ? _interrupt->InterruptFlags : 0;
- AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags : 0;
- ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags : 0;
+ // TODO: 6.x these flags have 2 parts
+ AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags[0] : 0;
+ ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags[0] : 0;
// SpellLevelsEntry
SpellLevelsEntry const* _levels = GetSpellLevels();
- MaxLevel = _levels ? _levels->maxLevel : 0;
- BaseLevel = _levels ? _levels->baseLevel : 0;
- SpellLevel = _levels ? _levels->spellLevel : 0;
+ MaxLevel = _levels ? _levels->MaxLevel : 0;
+ BaseLevel = _levels ? _levels->BaseLevel : 0;
+ SpellLevel = _levels ? _levels->SpellLevel : 0;
// SpellPowerEntry
SpellPowerEntry const* _power = GetSpellPower();
- ManaCost = _power ? _power->manaCost : 0;
- ManaCostPerlevel = _power ? _power->manaCostPerlevel : 0;
+ ManaCost = _power ? _power->ManaCost : 0;
+ ManaCostPerlevel = _power ? _power->ManaCostPerLevel : 0;
ManaCostPercentage = _power ? _power->ManaCostPercentage : 0;
- ManaPerSecond = _power ? _power->manaPerSecond : 0;
+ ManaPerSecond = _power ? _power->ManaCostPerSecond : 0;
// SpellReagentsEntry
SpellReagentsEntry const* _reagents = GetSpellReagents();
@@ -1006,8 +1008,9 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellShapeshiftEntry
SpellShapeshiftEntry const* _shapeshift = GetSpellShapeshift();
- Stances = _shapeshift ? _shapeshift->Stances : 0;
- StancesNot = _shapeshift ? _shapeshift->StancesNot : 0;
+ // TODO: 6.x these maks have 2 parts
+ Stances = _shapeshift ? _shapeshift->ShapeshiftMask[0] : 0;
+ StancesNot = _shapeshift ? _shapeshift->ShapeshiftExclude[0] : 0;
// SpellTargetRestrictionsEntry
SpellTargetRestrictionsEntry const* _target = GetSpellTargetRestrictions();
@@ -1033,7 +1036,7 @@ SpellInfo::~SpellInfo()
uint32 SpellInfo::GetCategory() const
{
- return CategoryEntry ? CategoryEntry->Id : 0;
+ return CategoryEntry ? CategoryEntry->ID : 0;
}
bool SpellInfo::HasEffect(SpellEffects effect) const
@@ -1497,7 +1500,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
TC_LOG_ERROR("spells", "GetErrorAtShapeshiftedCast: unknown shapeshift %u", form);
return SPELL_CAST_OK;
}
- actAsShifted = !(shapeInfo->flags1 & 1); // shapeshift acts as normal form for spells
+ actAsShifted = !(shapeInfo->Flags & 1); // shapeshift acts as normal form for spells
}
if (actAsShifted)
@@ -1517,7 +1520,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
// Check if stance disables cast of not-stance spells
// Example: cannot cast any other spells in zombie or ghoul form
/// @todo Find a way to disable use of these spells clientside
- if (shapeInfo && shapeInfo->flags1 & 0x400)
+ if (shapeInfo && shapeInfo->Flags & 0x400)
{
if (!(stanceMask & Stances))
return SPELL_FAILED_ONLY_SHAPESHIFT;
@@ -1872,7 +1875,7 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const
if (Effects[effIndex].ApplyAuraName == SPELL_AURA_MOD_SHAPESHIFT)
{
SpellShapeshiftFormEntry const* shapeShiftFromEntry = sSpellShapeshiftFormStore.LookupEntry(Effects[effIndex].MiscValue);
- if (shapeShiftFromEntry && (shapeShiftFromEntry->flags1 & 1) == 0) // unk flag
+ if (shapeShiftFromEntry && (shapeShiftFromEntry->Flags & 1) == 0) // unk flag
checkMask |= VEHICLE_SEAT_FLAG_UNCONTROLLED;
break;
}
@@ -2245,8 +2248,8 @@ float SpellInfo::GetMinRange(bool positive) const
if (!RangeEntry)
return 0.0f;
if (positive)
- return RangeEntry->minRangeFriend;
- return RangeEntry->minRangeHostile;
+ return RangeEntry->MinRangeFriend;
+ return RangeEntry->MinRangeHostile;
}
float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
@@ -2255,9 +2258,9 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
return 0.0f;
float range;
if (positive)
- range = RangeEntry->maxRangeFriend;
+ range = RangeEntry->MaxRangeFriend;
else
- range = RangeEntry->maxRangeHostile;
+ range = RangeEntry->MaxRangeHostile;
if (caster)
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell);
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 6d2973b1644..cf25599cfaa 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -466,9 +466,10 @@ void SpellMgr::SetSpellDifficultyId(uint32 spellId, uint32 id)
mSpellDifficultySearcherMap[spellId] = id;
}
+// TODO: 6.x adapt to new spell diff system
uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) const
{
- if (!GetSpellInfo(spellId))
+ /*if (!GetSpellInfo(spellId))
return spellId;
if (!caster || !caster->GetMap() || !caster->GetMap()->IsDungeon())
@@ -506,6 +507,8 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->SpellID[mode]);
return uint32(difficultyEntry->SpellID[mode]);
+ */
+ return 0;
}
SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell, Unit const* caster) const
@@ -2951,10 +2954,10 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+ if (enchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
- SpellInfo* procInfo = _GetSpellInfo(enchant->spellid[s]);
+ SpellInfo* procInfo = _GetSpellInfo(enchant->EffectSpellID[s]);
if (!procInfo)
continue;