Core: Use new SpellInfo class in core. Sadly, this commit is not compatibile with some of the custom code. To make your code work again you may need to change:
*SpellEntry is now SpellInfo *GetSpellProto is now GetSpellInfo *SpellEntry::Effect*[effIndex] is now avalible under SpellInfo.Effects[effIndex].* *sSpellStore.LookupEntry is no longer valid, use sSpellMgr->GetSpellInfo() *SpellFunctions from SpellMgr.h like DoSpellStuff(spellId) are now: spellInfo->DoStuff() *SpellMgr::CalculateEffectValue and similar functions are now avalible in SpellEffectInfo class. *GET_SPELL macro is removed, code which used it is moved to SpellMgr::LoadDbcDataCorrections *code which affected dbc data in SpellMgr::LoadSpellCustomAttr is now moved to LoadDbcDataCorrections
This commit is contained in:
@@ -3298,7 +3298,7 @@ void Player::SendInitialSpells()
|
||||
data << uint16(spellCooldowns);
|
||||
for (SpellCooldowns::const_iterator itr=m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr)
|
||||
{
|
||||
SpellEntry const *sEntry = sSpellStore.LookupEntry(itr->first);
|
||||
SpellInfo const *sEntry = sSpellMgr->GetSpellInfo(itr->first);
|
||||
if (!sEntry)
|
||||
continue;
|
||||
|
||||
@@ -3406,7 +3406,7 @@ void Player::AddNewMailDeliverTime(time_t deliver_time)
|
||||
|
||||
bool Player::AddTalent(uint32 spell_id, uint8 spec, bool learning)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
if (!spellInfo)
|
||||
{
|
||||
// do character spell book cleanup (all characters)
|
||||
@@ -3469,7 +3469,7 @@ bool Player::AddTalent(uint32 spell_id, uint8 spec, bool learning)
|
||||
|
||||
bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependent, bool disabled, bool loading /*=false*/)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
if (!spellInfo)
|
||||
{
|
||||
// do character spell book cleanup (all characters)
|
||||
@@ -3513,7 +3513,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||
{
|
||||
uint32 next_active_spell_id = 0;
|
||||
// fix activate state for non-stackable low rank (and find next spell for !active case)
|
||||
if (!SpellMgr::canStackSpellRanks(spellInfo) && sSpellMgr->GetSpellRank(spellInfo->Id) != 0)
|
||||
if (!spellInfo->IsStackableWithRanks() && spellInfo->IsRanked())
|
||||
{
|
||||
if (uint32 next = sSpellMgr->GetNextSpellInChain(spell_id))
|
||||
{
|
||||
@@ -3557,7 +3557,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||
|
||||
if (active)
|
||||
{
|
||||
if (IsPassiveSpell(spell_id) && IsNeedCastPassiveSpellAtLearn(spellInfo))
|
||||
if (spellInfo->IsPassive() && IsNeedCastPassiveSpellAtLearn(spellInfo))
|
||||
CastSpell (this, spell_id, true);
|
||||
}
|
||||
else if (IsInWorld())
|
||||
@@ -3648,19 +3648,19 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||
newspell->disabled = disabled;
|
||||
|
||||
// replace spells in action bars and spellbook to bigger rank if only one spell rank must be accessible
|
||||
if (newspell->active && !newspell->disabled && !SpellMgr::canStackSpellRanks(spellInfo) && sSpellMgr->GetSpellRank(spellInfo->Id) != 0)
|
||||
if (newspell->active && !newspell->disabled && !spellInfo->IsStackableWithRanks() && spellInfo->IsRanked() != 0)
|
||||
{
|
||||
for (PlayerSpellMap::iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2)
|
||||
{
|
||||
if (itr2->second->state == PLAYERSPELL_REMOVED) continue;
|
||||
SpellEntry const *i_spellInfo = sSpellStore.LookupEntry(itr2->first);
|
||||
SpellInfo const *i_spellInfo = sSpellMgr->GetSpellInfo(itr2->first);
|
||||
if (!i_spellInfo) continue;
|
||||
|
||||
if (sSpellMgr->IsRankSpellDueToSpell(spellInfo, itr2->first))
|
||||
if (spellInfo->IsDifferentRankOf(i_spellInfo))
|
||||
{
|
||||
if (itr2->second->active)
|
||||
{
|
||||
if (sSpellMgr->IsHighRankOfSpell(spell_id, itr2->first))
|
||||
if (spellInfo->IsHighRankOf(i_spellInfo))
|
||||
{
|
||||
if (IsInWorld()) // not send spell (re-/over-)learn packets at loading
|
||||
{
|
||||
@@ -3676,7 +3676,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||
itr2->second->state = PLAYERSPELL_CHANGED;
|
||||
superceded_old = true; // new spell replace old in action bars and spell book.
|
||||
}
|
||||
else if (sSpellMgr->IsHighRankOfSpell(itr2->first, spell_id))
|
||||
else
|
||||
{
|
||||
if (IsInWorld()) // not send spell (re-/over-)learn packets at loading
|
||||
{
|
||||
@@ -3707,18 +3707,18 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||
|
||||
// cast talents with SPELL_EFFECT_LEARN_SPELL (other dependent spells will learned later as not auto-learned)
|
||||
// note: all spells with SPELL_EFFECT_LEARN_SPELL isn't passive
|
||||
if (!loading && talentCost > 0 && IsSpellHaveEffect(spellInfo, SPELL_EFFECT_LEARN_SPELL))
|
||||
if (!loading && talentCost > 0 && spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL))
|
||||
{
|
||||
// ignore stance requirement for talent learn spell (stance set for spell only for client spell description show)
|
||||
CastSpell(this, spell_id, true);
|
||||
}
|
||||
// also cast passive spells (including all talents without SPELL_EFFECT_LEARN_SPELL) with additional checks
|
||||
else if (IsPassiveSpell(spell_id))
|
||||
else if (spellInfo->IsPassive())
|
||||
{
|
||||
if (IsNeedCastPassiveSpellAtLearn(spellInfo))
|
||||
CastSpell(this, spell_id, true);
|
||||
}
|
||||
else if (IsSpellHaveEffect(spellInfo, SPELL_EFFECT_SKILL_STEP))
|
||||
else if (spellInfo->HasEffect(SPELL_EFFECT_SKILL_STEP))
|
||||
{
|
||||
CastSpell(this, spell_id, true);
|
||||
return false;
|
||||
@@ -3730,7 +3730,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||
// update free primary prof.points (if any, can be none in case GM .learn prof. learning)
|
||||
if (uint32 freeProfs = GetFreePrimaryProfessionPoints())
|
||||
{
|
||||
if (sSpellMgr->IsPrimaryProfessionFirstRankSpell(spell_id))
|
||||
if (spellInfo->IsPrimaryProfessionFirstRank())
|
||||
SetFreePrimaryProfessions(freeProfs-1);
|
||||
}
|
||||
|
||||
@@ -3767,8 +3767,8 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||
|
||||
if (!Has310Flyer(false) && pSkill->id == SKILL_MOUNTS)
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
SpellMgr::CalculateSpellEffectAmount(spellInfo, i) == 310)
|
||||
if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
spellInfo->Effects[i].CalcValue() == 310)
|
||||
SetHas310Flyer(true);
|
||||
|
||||
if (HasSkill(pSkill->id))
|
||||
@@ -3854,7 +3854,7 @@ void Player::RemoveTemporarySpell(uint32 spellId)
|
||||
m_spells.erase(itr);
|
||||
}
|
||||
|
||||
bool Player::IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const
|
||||
bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const
|
||||
{
|
||||
// note: form passives activated with shapeshift spells be implemented by HandleShapeshiftBoosts instead of spell_learn_spell
|
||||
// talent dependent passives activated at form apply have proper stance data
|
||||
@@ -3863,7 +3863,7 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const
|
||||
(!form && (spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_NEED_SHAPESHIFT)));
|
||||
|
||||
//Check CasterAuraStates
|
||||
return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState)));
|
||||
return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraStateType(spellInfo->CasterAuraState)));
|
||||
}
|
||||
|
||||
void Player::learnSpell(uint32 spell_id, bool dependent)
|
||||
@@ -3887,12 +3887,11 @@ void Player::learnSpell(uint32 spell_id, bool dependent)
|
||||
// learn all disabled higher ranks and required spells (recursive)
|
||||
if (disabled)
|
||||
{
|
||||
SpellChainNode const* node = sSpellMgr->GetSpellChainNode(spell_id);
|
||||
if (node)
|
||||
if (uint32 nextSpell = sSpellMgr->GetNextSpellInChain(spell_id))
|
||||
{
|
||||
PlayerSpellMap::iterator iter = m_spells.find(node->next);
|
||||
PlayerSpellMap::iterator iter = m_spells.find(nextSpell);
|
||||
if (iter != m_spells.end() && iter->second->disabled)
|
||||
learnSpell(node->next, false);
|
||||
learnSpell(nextSpell, false);
|
||||
}
|
||||
|
||||
SpellsRequiringSpellMapBounds spellsRequiringSpell = sSpellMgr->GetSpellsRequiringSpellBounds(spell_id);
|
||||
@@ -3915,10 +3914,10 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
return;
|
||||
|
||||
// unlearn non talent higher ranks (recursive)
|
||||
if (SpellChainNode const* node = sSpellMgr->GetSpellChainNode(spell_id))
|
||||
if (uint32 nextSpell = sSpellMgr->GetNextSpellInChain(spell_id))
|
||||
{
|
||||
if (HasSpell(node->next) && !GetTalentSpellPos(node->next))
|
||||
removeSpell(node->next, disabled, false);
|
||||
if (HasSpell(nextSpell) && !GetTalentSpellPos(nextSpell))
|
||||
removeSpell(nextSpell, disabled, false);
|
||||
}
|
||||
//unlearn spells dependent from recently removed spells
|
||||
SpellsRequiringSpellMapBounds spellsRequiringSpell = sSpellMgr->GetSpellsRequiringSpellBounds(spell_id);
|
||||
@@ -3970,7 +3969,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
}
|
||||
|
||||
// update free primary prof.points (if not overflow setting, can be in case GM use before .learn prof. learning)
|
||||
if (sSpellMgr->IsPrimaryProfessionFirstRankSpell(spell_id))
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
if (spellInfo && spellInfo->IsPrimaryProfessionFirstRank())
|
||||
{
|
||||
uint32 freeProfs = GetFreePrimaryProfessionPoints()+1;
|
||||
if (freeProfs <= sWorld->getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL))
|
||||
@@ -4041,10 +4041,10 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
// most likely will never be used, haven't heard of cases where players unlearn a mount
|
||||
if (Has310Flyer(false) && _spell_idx->second->skillId == SKILL_MOUNTS)
|
||||
{
|
||||
SpellEntry const *pSpellInfo = sSpellStore.LookupEntry(spell_id);
|
||||
SpellInfo const *pSpellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (pSpellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
SpellMgr::CalculateSpellEffectAmount(pSpellInfo, i) == 310)
|
||||
if (pSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
pSpellInfo->Effects[i].CalcValue() == 310)
|
||||
Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag
|
||||
}
|
||||
}
|
||||
@@ -4059,9 +4059,9 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
// activate lesser rank in spellbook/action bar, and cast it if need
|
||||
bool prev_activate = false;
|
||||
|
||||
if (uint32 prev_id = sSpellMgr->GetPrevSpellInChain (spell_id))
|
||||
if (uint32 prev_id = sSpellMgr->GetPrevSpellInChain(spell_id))
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
|
||||
// if talent then lesser rank also talent and need learn
|
||||
if (talentCosts)
|
||||
@@ -4071,7 +4071,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
// learnSpell(prev_id, false);
|
||||
}
|
||||
// if ranked non-stackable spell: need activate lesser rank and update dendence state
|
||||
else if (cur_active && !SpellMgr::canStackSpellRanks(spellInfo) && sSpellMgr->GetSpellRank(spellInfo->Id) != 0)
|
||||
else if (cur_active && !spellInfo->IsStackableWithRanks() && spellInfo->IsRanked())
|
||||
{
|
||||
// need manually update dependence state (learn spell ignore like attempts)
|
||||
PlayerSpellMap::iterator prev_itr = m_spells.find(prev_id);
|
||||
@@ -4125,7 +4125,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId)
|
||||
else
|
||||
{
|
||||
SetHas310Flyer(false);
|
||||
SpellEntry const *pSpellInfo;
|
||||
SpellInfo const *pSpellInfo;
|
||||
for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||
{
|
||||
if (itr->first == excludeSpellId)
|
||||
@@ -4137,10 +4137,10 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId)
|
||||
if (_spell_idx->second->skillId != SKILL_MOUNTS)
|
||||
break; // We can break because mount spells belong only to one skillline (at least 310 flyers do)
|
||||
|
||||
pSpellInfo = sSpellStore.LookupEntry(itr->first);
|
||||
pSpellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (pSpellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
SpellMgr::CalculateSpellEffectAmount(pSpellInfo, i) == 310)
|
||||
if (pSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
|
||||
pSpellInfo->Effects[i].CalcValue() == 310)
|
||||
{
|
||||
SetHas310Flyer(true);
|
||||
return true;
|
||||
@@ -4194,7 +4194,7 @@ void Player::RemoveArenaSpellCooldowns(bool removeActivePetCooldowns)
|
||||
{
|
||||
next = itr;
|
||||
++next;
|
||||
SpellEntry const* entry = sSpellStore.LookupEntry(itr->first);
|
||||
SpellInfo const* entry = sSpellMgr->GetSpellInfo(itr->first);
|
||||
// check if spellentry is present and if the cooldown is less or equal to 10 min
|
||||
if (entry &&
|
||||
entry->RecoveryTime <= 10 * MINUTE * IN_MILLISECONDS &&
|
||||
@@ -4246,7 +4246,7 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result)
|
||||
uint32 item_id = fields[1].GetUInt32();
|
||||
time_t db_time = time_t(fields[2].GetUInt32());
|
||||
|
||||
if (!sSpellStore.LookupEntry(spell_id))
|
||||
if (!sSpellMgr->GetSpellInfo(spell_id))
|
||||
{
|
||||
sLog->outError("Player %u has unknown spell %u in `character_spell_cooldown`, skipping.", GetGUIDLow(), spell_id);
|
||||
continue;
|
||||
@@ -4389,10 +4389,10 @@ bool Player::resetTalents(bool no_cost)
|
||||
if (talentInfo->RankID[rank] == 0)
|
||||
continue;
|
||||
removeSpell(talentInfo->RankID[rank], true);
|
||||
if (const SpellEntry *_spellEntry = sSpellStore.LookupEntry(talentInfo->RankID[rank]))
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellEntry for valid trigger spells
|
||||
if (_spellEntry->EffectTriggerSpell[i] > 0 && _spellEntry->Effect[i] == SPELL_EFFECT_LEARN_SPELL)
|
||||
removeSpell(_spellEntry->EffectTriggerSpell[i], true); // and remove any spells that the talent teaches
|
||||
if (const SpellInfo *_spellEntry = sSpellMgr->GetSpellInfo(talentInfo->RankID[rank]))
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellInfo for valid trigger spells
|
||||
if (_spellEntry->Effects[i].TriggerSpell > 0 && _spellEntry->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL)
|
||||
removeSpell(_spellEntry->Effects[i].TriggerSpell, true); // and remove any spells that the talent teaches
|
||||
// if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted
|
||||
PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]);
|
||||
if (plrTalent != m_talents[m_activeSpec]->end())
|
||||
@@ -4676,10 +4676,10 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
|
||||
if (!IsSpellFitByClassAndRace(trainer_spell->learnedSpell[i]))
|
||||
return TRAINER_SPELL_RED;
|
||||
|
||||
if (SpellChainNode const* spell_chain = sSpellMgr->GetSpellChainNode(trainer_spell->learnedSpell[i]))
|
||||
if (uint32 prevSpell = sSpellMgr->GetPrevSpellInChain(trainer_spell->learnedSpell[i]))
|
||||
{
|
||||
// check prev.rank requirement
|
||||
if (spell_chain->prev && !HasSpell(spell_chain->prev))
|
||||
if (prevSpell && !HasSpell(prevSpell))
|
||||
return TRAINER_SPELL_RED;
|
||||
}
|
||||
|
||||
@@ -4698,7 +4698,8 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
|
||||
{
|
||||
if (!trainer_spell->learnedSpell[i])
|
||||
continue;
|
||||
if ((sSpellMgr->IsPrimaryProfessionFirstRankSpell(trainer_spell->learnedSpell[i])) && (GetFreePrimaryProfessionPoints() == 0))
|
||||
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(trainer_spell->learnedSpell[i]);
|
||||
if (learnedSpellInfo && learnedSpellInfo->IsPrimaryProfessionFirstRank() && (GetFreePrimaryProfessionPoints() == 0))
|
||||
return TRAINER_SPELL_GREEN_DISABLED;
|
||||
}
|
||||
|
||||
@@ -6074,7 +6075,7 @@ bool Player::UpdateCraftSkill(uint32 spellid)
|
||||
uint32 SkillValue = GetPureSkillValue(_spell_idx->second->skillId);
|
||||
|
||||
// Alchemy Discoveries here
|
||||
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellid);
|
||||
SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spellid);
|
||||
if (spellEntry && spellEntry->Mechanic == MECHANIC_DISCOVERY)
|
||||
{
|
||||
if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->skillId, spellid, this))
|
||||
@@ -6628,7 +6629,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
|
||||
switch (type)
|
||||
{
|
||||
case ACTION_BUTTON_SPELL:
|
||||
if (!sSpellStore.LookupEntry(action))
|
||||
if (!sSpellMgr->GetSpellInfo(action))
|
||||
{
|
||||
sLog->outError("Spell action %u not added into button %u for player %s: spell not exist", action, button, GetName());
|
||||
return false;
|
||||
@@ -8011,7 +8012,7 @@ void Player::_ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackTy
|
||||
float mod = 100.0f;
|
||||
AuraEffectList const& auraDamagePctList = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
||||
for (AuraEffectList::const_iterator itr = auraDamagePctList.begin(); itr != auraDamagePctList.end(); ++itr)
|
||||
if ((apply && item->IsFitToSpellRequirements((*itr)->GetSpellProto())) || HasItemFitToSpellRequirements((*itr)->GetSpellProto(), item))
|
||||
if ((apply && item->IsFitToSpellRequirements((*itr)->GetSpellInfo())) || HasItemFitToSpellRequirements((*itr)->GetSpellInfo(), item))
|
||||
mod += (*itr)->GetAmount();
|
||||
|
||||
SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, mod/100.0f);
|
||||
@@ -8020,7 +8021,7 @@ void Player::_ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackTy
|
||||
void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect const* aura, bool apply)
|
||||
{
|
||||
// generic not weapon specific case processes in aura code
|
||||
if (aura->GetSpellProto()->EquippedItemClass == -1)
|
||||
if (aura->GetSpellInfo()->EquippedItemClass == -1)
|
||||
return;
|
||||
|
||||
BaseModGroup mod = BASEMOD_END;
|
||||
@@ -8032,7 +8033,7 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attac
|
||||
default: return;
|
||||
}
|
||||
|
||||
if (!item->IsBroken()&&item->IsFitToSpellRequirements(aura->GetSpellProto()))
|
||||
if (!item->IsBroken()&&item->IsFitToSpellRequirements(aura->GetSpellInfo()))
|
||||
HandleBaseModValue(mod, FLAT_MOD, float (aura->GetAmount()), apply);
|
||||
}
|
||||
|
||||
@@ -8047,7 +8048,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att
|
||||
return;
|
||||
|
||||
// generic not weapon specific case processes in aura code
|
||||
if (aura->GetSpellProto()->EquippedItemClass == -1)
|
||||
if (aura->GetSpellInfo()->EquippedItemClass == -1)
|
||||
return;
|
||||
|
||||
UnitMods unitMod = UNIT_MOD_END;
|
||||
@@ -8066,7 +8067,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att
|
||||
default: return;
|
||||
}
|
||||
|
||||
if (item->IsFitToSpellRequirements(aura->GetSpellProto()))
|
||||
if (item->IsFitToSpellRequirements(aura->GetSpellInfo()))
|
||||
{
|
||||
HandleStatModifier(unitMod, unitModType, float(aura->GetAmount()), apply);
|
||||
ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS, aura->GetAmount(), apply);
|
||||
@@ -8095,7 +8096,7 @@ void Player::ApplyItemEquipSpell(Item *item, bool apply, bool form_change)
|
||||
continue;
|
||||
|
||||
// check if it is valid spell
|
||||
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellData.SpellId);
|
||||
SpellInfo const* spellproto = sSpellMgr->GetSpellInfo(spellData.SpellId);
|
||||
if (!spellproto)
|
||||
continue;
|
||||
|
||||
@@ -8103,12 +8104,12 @@ void Player::ApplyItemEquipSpell(Item *item, bool apply, bool form_change)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply, bool form_change)
|
||||
void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply, bool form_change)
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
// Cannot be used in this stance/form
|
||||
if (GetErrorAtShapeshiftedCast(spellInfo, GetShapeshiftForm()) != SPELL_CAST_OK)
|
||||
if (spellInfo->CheckShapeshift(GetShapeshiftForm()) != SPELL_CAST_OK)
|
||||
return;
|
||||
|
||||
if (form_change) // check aura active state from other form
|
||||
@@ -8128,7 +8129,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply
|
||||
if (form_change) // check aura compatibility
|
||||
{
|
||||
// Cannot be used in this stance/form
|
||||
if (GetErrorAtShapeshiftedCast(spellInfo, GetShapeshiftForm()) == SPELL_CAST_OK)
|
||||
if (spellInfo->CheckShapeshift(GetShapeshiftForm()) == SPELL_CAST_OK)
|
||||
return; // and remove only not compatible at form change
|
||||
}
|
||||
|
||||
@@ -8159,7 +8160,7 @@ void Player::UpdateEquipSpellsAtFormChange()
|
||||
|
||||
for (uint32 y = 0; y < MAX_ITEM_SET_SPELLS; ++y)
|
||||
{
|
||||
SpellEntry const* spellInfo = eff->spells[y];
|
||||
SpellInfo const* spellInfo = eff->spells[y];
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
|
||||
@@ -8222,7 +8223,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
|
||||
if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT)
|
||||
continue;
|
||||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outError("WORLD: unknown Item spellid %i", spellData.SpellId);
|
||||
@@ -8230,10 +8231,10 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
|
||||
}
|
||||
|
||||
// not allow proc extra attack spell at extra attack
|
||||
if (m_extraAttacks && IsSpellHaveEffect(spellInfo, SPELL_EFFECT_ADD_EXTRA_ATTACKS))
|
||||
if (m_extraAttacks && spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
|
||||
return;
|
||||
|
||||
float chance = (float)spellInfo->procChance;
|
||||
float chance = (float)spellInfo->ProcChance;
|
||||
|
||||
if (spellData.SpellPPMRate)
|
||||
{
|
||||
@@ -8289,7 +8290,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
|
||||
continue;
|
||||
}
|
||||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outError("Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is casted, ignoring...",
|
||||
@@ -8316,10 +8317,10 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
|
||||
|
||||
if (roll_chance_f(chance))
|
||||
{
|
||||
if (IsPositiveSpell(pEnchant->spellid[s]))
|
||||
CastSpell(this, pEnchant->spellid[s], true, item);
|
||||
if (spellInfo->IsPositive())
|
||||
CastSpell(this, spellInfo, true, item);
|
||||
else
|
||||
CastSpell(target, pEnchant->spellid[s], true, item);
|
||||
CastSpell(target, spellInfo, true, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8334,7 +8335,7 @@ void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8
|
||||
uint32 learn_spell_id = proto->Spells[0].SpellId;
|
||||
uint32 learning_spell_id = proto->Spells[1].SpellId;
|
||||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(learn_spell_id);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(learn_spell_id);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ", proto->ItemId, learn_spell_id);
|
||||
@@ -8366,7 +8367,7 @@ void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8
|
||||
if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE)
|
||||
continue;
|
||||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring", proto->ItemId, spellData.SpellId);
|
||||
@@ -8394,7 +8395,7 @@ void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8
|
||||
if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL)
|
||||
continue;
|
||||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outError("Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
|
||||
@@ -12073,7 +12074,7 @@ Item* Player::EquipItem(uint16 pos, Item *pItem, bool update)
|
||||
if (getClass() == CLASS_ROGUE)
|
||||
cooldownSpell = 6123;
|
||||
|
||||
SpellEntry const* spellProto = sSpellStore.LookupEntry(cooldownSpell);
|
||||
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cooldownSpell);
|
||||
|
||||
if (!spellProto)
|
||||
sLog->outError("Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell);
|
||||
@@ -17112,15 +17113,15 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
int32 remaintime = fields[12].GetInt32();
|
||||
uint8 remaincharges = fields[13].GetUInt8();
|
||||
|
||||
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid);
|
||||
if (!spellproto)
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outError("Unknown aura (spellid %u), ignore.", spellid);
|
||||
continue;
|
||||
}
|
||||
|
||||
// negative effects should continue counting down after logout
|
||||
if (remaintime != -1 && !IsPositiveSpell(spellid))
|
||||
if (remaintime != -1 && !spellInfo->IsPositive())
|
||||
{
|
||||
if (remaintime/IN_MILLISECONDS <= int32(timediff))
|
||||
continue;
|
||||
@@ -17129,17 +17130,17 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
}
|
||||
|
||||
// prevent wrong values of remaincharges
|
||||
if (spellproto->procCharges)
|
||||
if (spellInfo->ProcCharges)
|
||||
{
|
||||
// we have no control over the order of applying auras and modifiers allow auras
|
||||
// to have more charges than value in SpellEntry
|
||||
// to have more charges than value in SpellInfo
|
||||
if (remaincharges <= 0/* || remaincharges > spellproto->procCharges*/)
|
||||
remaincharges = spellproto->procCharges;
|
||||
remaincharges = spellInfo->ProcCharges;
|
||||
}
|
||||
else
|
||||
remaincharges = 0;
|
||||
|
||||
if (Aura* aura = Aura::TryCreate(spellproto, effmask, this, NULL, &baseDamage[0], NULL, caster_guid))
|
||||
if (Aura* aura = Aura::TryCreate(spellInfo, effmask, this, NULL, &baseDamage[0], NULL, caster_guid))
|
||||
{
|
||||
if (!aura->CanBeSaved())
|
||||
{
|
||||
@@ -17149,7 +17150,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
|
||||
aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]);
|
||||
aura->ApplyForTargets();
|
||||
sLog->outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
|
||||
sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
|
||||
}
|
||||
}
|
||||
while (result->NextRow());
|
||||
@@ -19133,7 +19134,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
|
||||
{
|
||||
//returning of reagents only for players, so best done here
|
||||
uint32 spellId = pet ? pet->GetUInt32Value(UNIT_CREATED_BY_SPELL) : m_oldpetspell;
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
|
||||
if (spellInfo)
|
||||
{
|
||||
@@ -19434,7 +19435,8 @@ void Player::VehicleSpellInitialize()
|
||||
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
{
|
||||
uint32 spellId = veh->m_spells[i];
|
||||
if (!sSpellStore.LookupEntry(spellId))
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
data << uint16(0) << uint8(0) << uint8(i+8);
|
||||
continue;
|
||||
@@ -19448,7 +19450,7 @@ void Player::VehicleSpellInitialize()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IsPassiveSpell(spellId))
|
||||
if (spellInfo->IsPassive())
|
||||
{
|
||||
veh->CastSpell(veh, spellId, true);
|
||||
data << uint16(0) << uint8(0) << uint8(i+8);
|
||||
@@ -19536,7 +19538,7 @@ void Player::CharmSpellInitialize()
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_SPELL_CHARM; ++i)
|
||||
{
|
||||
CharmSpellEntry *cspell = charmInfo->GetCharmSpell(i);
|
||||
CharmSpellInfo *cspell = charmInfo->GetCharmSpell(i);
|
||||
if (cspell->GetAction())
|
||||
data << uint32(cspell->packedData);
|
||||
}
|
||||
@@ -19554,7 +19556,7 @@ void Player::SendRemoveControlBar()
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mod, Spell* spell)
|
||||
bool Player::IsAffectedBySpellmod(SpellInfo const *spellInfo, SpellModifier *mod, Spell* spell)
|
||||
{
|
||||
if (!mod || !spellInfo)
|
||||
return false;
|
||||
@@ -19564,10 +19566,10 @@ bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mo
|
||||
return false;
|
||||
|
||||
// +duration to infinite duration spells making them limited
|
||||
if (mod->op == SPELLMOD_DURATION && GetSpellDuration(spellInfo) == -1)
|
||||
if (mod->op == SPELLMOD_DURATION && spellInfo->GetDuration() == -1)
|
||||
return false;
|
||||
|
||||
return sSpellMgr->IsAffectedByMod(spellInfo, mod);
|
||||
return spellInfo->IsAffectedBySpellMod(mod);
|
||||
}
|
||||
|
||||
void Player::AddSpellMod(SpellModifier* mod, bool apply)
|
||||
@@ -19628,7 +19630,7 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura)
|
||||
continue;
|
||||
|
||||
// Restore only specific owner aura mods
|
||||
if (ownerAuraId && (ownerAuraId != mod->ownerAura->GetSpellProto()->Id))
|
||||
if (ownerAuraId && (ownerAuraId != mod->ownerAura->GetSpellInfo()->Id))
|
||||
continue;
|
||||
|
||||
if (aura && mod->ownerAura != aura)
|
||||
@@ -20121,7 +20123,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
|
||||
if (itr->second->state == PLAYERSPELL_REMOVED)
|
||||
continue;
|
||||
uint32 unSpellId = itr->first;
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(unSpellId);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(unSpellId);
|
||||
if (!spellInfo)
|
||||
{
|
||||
ASSERT(spellInfo);
|
||||
@@ -20135,7 +20137,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
|
||||
if (spellInfo->PreventionType != SPELL_PREVENTION_TYPE_SILENCE)
|
||||
continue;
|
||||
|
||||
if ((idSchoolMask & GetSpellSchoolMask(spellInfo)) && GetSpellCooldownDelay(unSpellId) < unTimeMs)
|
||||
if ((idSchoolMask & spellInfo->GetSchoolMask()) && GetSpellCooldownDelay(unSpellId) < unTimeMs)
|
||||
{
|
||||
data << uint32(unSpellId);
|
||||
data << uint32(unTimeMs); // in m.secs
|
||||
@@ -20531,7 +20533,7 @@ void Player::UpdatePvP(bool state, bool override)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell, bool infinityCooldown)
|
||||
void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 itemId, Spell* spell, bool infinityCooldown)
|
||||
{
|
||||
// init cooldown values
|
||||
uint32 cat = 0;
|
||||
@@ -20584,7 +20586,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
|
||||
{
|
||||
// shoot spells used equipped item cooldown values already assigned in GetAttackTime(RANGED_ATTACK)
|
||||
// prevent 0 cooldowns set by another way
|
||||
if (rec <= 0 && catrec <= 0 && (cat == 76 || (IsAutoRepeatRangedSpell(spellInfo) && spellInfo->Id != 75)))
|
||||
if (rec <= 0 && catrec <= 0 && (cat == 76 || (spellInfo->IsAutoRepeatRangedSpell() && spellInfo->Id != 75)))
|
||||
rec = GetAttackTime(RANGED_ATTACK);
|
||||
|
||||
// Now we have cooldown data (if found any), time to apply mods
|
||||
@@ -20635,7 +20637,7 @@ void Player::AddSpellCooldown(uint32 spellid, uint32 itemid, time_t end_time)
|
||||
m_spellCooldowns[spellid] = sc;
|
||||
}
|
||||
|
||||
void Player::SendCooldownEvent(SpellEntry const* spellInfo, uint32 itemId /*= 0*/, Spell* spell /*= NULL*/, bool setCooldown /*= true*/)
|
||||
void Player::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId /*= 0*/, Spell* spell /*= NULL*/, bool setCooldown /*= true*/)
|
||||
{
|
||||
// start cooldowns at server side, if any
|
||||
if (setCooldown)
|
||||
@@ -20661,7 +20663,7 @@ void Player::UpdatePotionCooldown(Spell* spell)
|
||||
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(m_lastPotionId))
|
||||
for (uint8 idx = 0; idx < MAX_ITEM_SPELLS; ++idx)
|
||||
if (proto->Spells[idx].SpellId && proto->Spells[idx].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE)
|
||||
if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[idx].SpellId))
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(proto->Spells[idx].SpellId))
|
||||
SendCooldownEvent(spellInfo, m_lastPotionId);
|
||||
}
|
||||
// from spell cases (m_lastPotionId set in Spell::SendSpellCooldown)
|
||||
@@ -21549,12 +21551,12 @@ void Player::resetSpells(bool myClassOnly)
|
||||
|
||||
for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(iter->first);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(iter->first);
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
|
||||
// skip server-side/triggered spells
|
||||
if (spellInfo->spellLevel == 0)
|
||||
if (spellInfo->SpellLevel == 0)
|
||||
continue;
|
||||
|
||||
// skip wrong class/race skills
|
||||
@@ -21614,7 +21616,7 @@ void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||
return;
|
||||
}
|
||||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
|
||||
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spell_id);
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
@@ -21622,7 +21624,7 @@ void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||
bool found = false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (spellInfo->Effect[i] == SPELL_EFFECT_LEARN_SPELL && !HasSpell(spellInfo->EffectTriggerSpell[i]))
|
||||
if (spellInfo->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL && !HasSpell(spellInfo->Effects[i].TriggerSpell))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@@ -21634,7 +21636,7 @@ void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||
return;
|
||||
|
||||
// prevent learn non first rank unknown profession and second specialization for same profession)
|
||||
uint32 learned_0 = spellInfo->EffectTriggerSpell[0];
|
||||
uint32 learned_0 = spellInfo->Effects[0].TriggerSpell;
|
||||
if (sSpellMgr->GetSpellRank(learned_0) > 1 && !HasSpell(learned_0))
|
||||
{
|
||||
// not have first rank learned (unlearned prof?)
|
||||
@@ -21642,7 +21644,7 @@ void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||
if (!HasSpell(first_spell))
|
||||
return;
|
||||
|
||||
SpellEntry const *learnedInfo = sSpellStore.LookupEntry(learned_0);
|
||||
SpellInfo const *learnedInfo = sSpellMgr->GetSpellInfo(learned_0);
|
||||
if (!learnedInfo)
|
||||
return;
|
||||
|
||||
@@ -21652,7 +21654,7 @@ void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||
uint32 profSpell = itr2->second;
|
||||
|
||||
// specialization
|
||||
if (learnedInfo->Effect[0] == SPELL_EFFECT_TRADE_SKILL && learnedInfo->Effect[1] == 0 && profSpell)
|
||||
if (learnedInfo->Effects[0].Effect == SPELL_EFFECT_TRADE_SKILL && learnedInfo->Effects[1].Effect == 0 && profSpell)
|
||||
{
|
||||
// search other specialization for same prof
|
||||
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||
@@ -21660,12 +21662,12 @@ void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||
if (itr->second->state == PLAYERSPELL_REMOVED || itr->first == learned_0)
|
||||
continue;
|
||||
|
||||
SpellEntry const *itrInfo = sSpellStore.LookupEntry(itr->first);
|
||||
SpellInfo const *itrInfo = sSpellMgr->GetSpellInfo(itr->first);
|
||||
if (!itrInfo)
|
||||
return;
|
||||
|
||||
// compare only specializations
|
||||
if (itrInfo->Effect[0] != SPELL_EFFECT_TRADE_SKILL || itrInfo->Effect[1] != 0)
|
||||
if (itrInfo->Effects[0].Effect != SPELL_EFFECT_TRADE_SKILL || itrInfo->Effects[1].Effect != 0)
|
||||
continue;
|
||||
|
||||
// compare same chain spells
|
||||
@@ -21708,7 +21710,7 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value)
|
||||
if (pAbility->classmask && !(pAbility->classmask & classMask))
|
||||
continue;
|
||||
|
||||
if (sSpellStore.LookupEntry(pAbility->spellId))
|
||||
if (sSpellMgr->GetSpellInfo(pAbility->spellId))
|
||||
{
|
||||
// need unlearn spell
|
||||
if (skill_value < pAbility->req_skill_value)
|
||||
@@ -22032,7 +22034,7 @@ OutdoorPvP * Player::GetOutdoorPvP() const
|
||||
return sOutdoorPvPMgr->GetOutdoorPvPToZoneId(GetZoneId());
|
||||
}
|
||||
|
||||
bool Player::HasItemFitToSpellRequirements(SpellEntry const* spellInfo, Item const* ignoreItem)
|
||||
bool Player::HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem)
|
||||
{
|
||||
if (spellInfo->EquippedItemClass < 0)
|
||||
return true;
|
||||
@@ -22077,7 +22079,7 @@ bool Player::HasItemFitToSpellRequirements(SpellEntry const* spellInfo, Item con
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Player::CanNoReagentCast(SpellEntry const* spellInfo) const
|
||||
bool Player::CanNoReagentCast(SpellInfo const* spellInfo) const
|
||||
{
|
||||
// don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP
|
||||
if (spellInfo->AttributesEx5 & SPELL_ATTR5_NO_REAGENT_WHILE_PREP &&
|
||||
@@ -22102,7 +22104,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item* pItem)
|
||||
Aura * aura = itr->second;
|
||||
|
||||
// skip passive (passive item dependent spells work in another way) and not self applied auras
|
||||
SpellEntry const* spellInfo = aura->GetSpellProto();
|
||||
SpellInfo const* spellInfo = aura->GetSpellInfo();
|
||||
if (aura->IsPassive() || aura->GetCasterGUID() != GetGUID())
|
||||
{
|
||||
++itr;
|
||||
@@ -22136,7 +22138,7 @@ uint32 Player::GetResurrectionSpellId()
|
||||
for (AuraEffectList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
|
||||
{
|
||||
// Soulstone Resurrection // prio: 3 (max, non death persistent)
|
||||
if (prio < 2 && (*itr)->GetSpellProto()->SpellVisual[0] == 99 && (*itr)->GetSpellProto()->SpellIconID == 92)
|
||||
if (prio < 2 && (*itr)->GetSpellInfo()->SpellVisual[0] == 99 && (*itr)->GetSpellInfo()->SpellIconID == 92)
|
||||
{
|
||||
switch ((*itr)->GetId())
|
||||
{
|
||||
@@ -22362,7 +22364,7 @@ void Player::UpdateAreaDependentAuras(uint32 newArea)
|
||||
for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
|
||||
{
|
||||
// use m_zoneUpdateId for speed: UpdateArea called from UpdateZone or instead UpdateZone in both cases m_zoneUpdateId up-to-date
|
||||
if (sSpellMgr->GetSpellAllowedInLocationError(iter->second->GetSpellProto(), GetMapId(), m_zoneUpdateId, newArea, this) != SPELL_CAST_OK)
|
||||
if (iter->second->GetSpellInfo()->CheckLocation(GetMapId(), m_zoneUpdateId, newArea, this) != SPELL_CAST_OK)
|
||||
RemoveOwnedAura(iter);
|
||||
else
|
||||
++iter;
|
||||
@@ -23142,7 +23144,7 @@ uint32 Player::CalculateTalentsPoints() const
|
||||
|
||||
bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const
|
||||
{
|
||||
// continent checked in SpellMgr::GetSpellAllowedInLocationError at cast and area update
|
||||
// continent checked in SpellInfo::CheckLocation at cast and area update
|
||||
uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
|
||||
return v_map != 571 || HasSpell(54197); // Cold Weather Flying
|
||||
}
|
||||
@@ -24252,10 +24254,10 @@ void Player::ActivateSpec(uint8 spec)
|
||||
if (talentInfo->RankID[rank] == 0)
|
||||
continue;
|
||||
removeSpell(talentInfo->RankID[rank], true); // removes the talent, and all dependant, learned, and chained spells..
|
||||
if (const SpellEntry *_spellEntry = sSpellStore.LookupEntry(talentInfo->RankID[rank]))
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellEntry for valid trigger spells
|
||||
if (_spellEntry->EffectTriggerSpell[i] > 0 && _spellEntry->Effect[i] == SPELL_EFFECT_LEARN_SPELL)
|
||||
removeSpell(_spellEntry->EffectTriggerSpell[i], true); // and remove any spells that the talent teaches
|
||||
if (const SpellInfo *_spellEntry = sSpellMgr->GetSpellInfo(talentInfo->RankID[rank]))
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellInfo for valid trigger spells
|
||||
if (_spellEntry->Effects[i].TriggerSpell > 0 && _spellEntry->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL)
|
||||
removeSpell(_spellEntry->Effects[i].TriggerSpell, true); // and remove any spells that the talent teaches
|
||||
// if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted
|
||||
//PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]);
|
||||
//if (plrTalent != m_talents[m_activeSpec]->end())
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#include "Util.h" // for Tokens typedef
|
||||
#include "WorldSession.h"
|
||||
|
||||
// for template
|
||||
#include "SpellMgr.h"
|
||||
|
||||
#include<string>
|
||||
#include<vector>
|
||||
|
||||
@@ -1202,8 +1205,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_2, 2); }
|
||||
void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, 2, count); }
|
||||
bool HasItemCount(uint32 item, uint32 count, bool inBankAlso = false) const;
|
||||
bool HasItemFitToSpellRequirements(SpellEntry const* spellInfo, Item const* ignoreItem = NULL);
|
||||
bool CanNoReagentCast(SpellEntry const* spellInfo) const;
|
||||
bool HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem = NULL);
|
||||
bool CanNoReagentCast(SpellInfo const* spellInfo) const;
|
||||
bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const;
|
||||
bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const;
|
||||
InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return _CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); }
|
||||
@@ -1600,7 +1603,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool HasActiveSpell(uint32 spell) const; // show in spellbook
|
||||
TrainerSpellState GetTrainerSpellState(TrainerSpell const* trainer_spell) const;
|
||||
bool IsSpellFitByClassAndRace(uint32 spell_id) const;
|
||||
bool IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const;
|
||||
bool IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const;
|
||||
|
||||
void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask);
|
||||
void SendInitialSpells();
|
||||
@@ -1661,7 +1664,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
SpellCooldowns const& GetSpellCooldownMap() const { return m_spellCooldowns; }
|
||||
|
||||
void AddSpellMod(SpellModifier* mod, bool apply);
|
||||
bool IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mod, Spell* spell = NULL);
|
||||
bool IsAffectedBySpellmod(SpellInfo const *spellInfo, SpellModifier *mod, Spell* spell = NULL);
|
||||
template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell = NULL);
|
||||
void RemoveSpellMods(Spell* spell);
|
||||
void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = NULL);
|
||||
@@ -1682,9 +1685,9 @@ class Player : public Unit, public GridObject<Player>
|
||||
time_t t = time(NULL);
|
||||
return uint32(itr != m_spellCooldowns.end() && itr->second.end > t ? itr->second.end - t : 0);
|
||||
}
|
||||
void AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell = NULL, bool infinityCooldown = false);
|
||||
void AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 itemId, Spell* spell = NULL, bool infinityCooldown = false);
|
||||
void AddSpellCooldown(uint32 spell_id, uint32 itemid, time_t end_time);
|
||||
void SendCooldownEvent(SpellEntry const* spellInfo, uint32 itemId = 0, Spell* spell = NULL, bool setCooldown = true);
|
||||
void SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId = 0, Spell* spell = NULL, bool setCooldown = true);
|
||||
void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs);
|
||||
void RemoveSpellCooldown(uint32 spell_id, bool update = false);
|
||||
void RemoveSpellCategoryCooldown(uint32 cat, bool update = false);
|
||||
@@ -2061,7 +2064,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void InitDataForForm(bool reapplyMods = false);
|
||||
|
||||
void ApplyItemEquipSpell(Item *item, bool apply, bool form_change = false);
|
||||
void ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply, bool form_change = false);
|
||||
void ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply, bool form_change = false);
|
||||
void UpdateEquipSpellsAtFormChange();
|
||||
void CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx);
|
||||
void CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex);
|
||||
@@ -2768,7 +2771,7 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const *proto);
|
||||
// "the bodies of template functions must be made available in a header file"
|
||||
template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
return 0;
|
||||
float totalmul = 1.0f;
|
||||
|
||||
Reference in New Issue
Block a user