diff options
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-x | src/server/game/Spells/Spell.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 48e6f071a40..8d1f603c5a4 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -420,10 +420,10 @@ void SpellCastTargets::write (ByteBuffer & data) } Spell::Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID, bool skipCheck): -m_spellInfo(sSpellMgr.GetSpellForDifficultyFromSpell(info, Caster)), +m_spellInfo(sSpellMgr->GetSpellForDifficultyFromSpell(info, Caster)), m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo)) { - m_customAttr = sSpellMgr.GetSpellCustomAttr(m_spellInfo->Id); + m_customAttr = sSpellMgr->GetSpellCustomAttr(m_spellInfo->Id); m_skipCheck = skipCheck; m_selfContainer = NULL; m_referencedFromCurrentSpell = false; @@ -704,7 +704,7 @@ void Spell::SelectSpellTargets() case SPELL_EFFECT_SUMMON_PLAYER: if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->GetSelection()) { - Player* target = sObjectMgr.GetPlayer(m_caster->ToPlayer()->GetSelection()); + Player* target = sObjectMgr->GetPlayer(m_caster->ToPlayer()->GetSelection()); if (target) AddUnitTarget(target, i); } @@ -949,7 +949,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex) ihit->scaleAura = false; if (m_auraScaleMask && ihit->effectMask == m_auraScaleMask && m_caster != pVictim) { - SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr.GetFirstSpellInChain(m_spellInfo->Id)); + SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr->GetFirstSpellInChain(m_spellInfo->Id)); if (uint32(pVictim->getLevel() + 10) >= auraSpell->spellLevel) ihit->scaleAura = true; } @@ -970,7 +970,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex) target.scaleAura = false; if (m_auraScaleMask && target.effectMask == m_auraScaleMask && m_caster != pVictim) { - SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr.GetFirstSpellInChain(m_spellInfo->Id)); + SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr->GetFirstSpellInChain(m_spellInfo->Id)); if (uint32(pVictim->getLevel() + 10) >= auraSpell->spellLevel) target.scaleAura = true; } @@ -1462,7 +1462,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool int32 basePoints[3]; if (scaleAura) { - aurSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel()); + aurSpellInfo = sSpellMgr->SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel()); ASSERT(aurSpellInfo); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { @@ -1584,7 +1584,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit) if (m_customAttr & SPELL_ATTR0_CU_LINK_HIT) { - if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT)) + if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT)) for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) if (*i < 0) unit->RemoveAurasDueToSpell(-(*i)); @@ -1884,7 +1884,7 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType, Spe { case SPELL_TARGETS_ENTRY: { - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); if (conditions.empty()) { sLog.outDebug("Spell (ID: %u) (caster Entry: %u) does not have record in `conditions` for spell script target (ConditionSourceType 13)", m_spellInfo->Id, m_caster->GetEntry()); @@ -2281,7 +2281,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) switch(cur) { case TARGET_DST_DB: - if (SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id)) + if (SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id)) { //TODO: fix this check if (m_spellInfo->Effect[0] == SPELL_EFFECT_TELEPORT_UNITS @@ -2476,7 +2476,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) { case SPELL_TARGETS_ENTRY: { - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); if (!conditions.empty()) { for (ConditionList::const_iterator i_spellST = conditions.begin(); i_spellST != conditions.end(); ++i_spellST) @@ -2573,7 +2573,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) } case SPELL_TARGETS_GO: { - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); if (!conditions.empty()) { for (ConditionList::const_iterator i_spellST = conditions.begin(); i_spellST != conditions.end(); ++i_spellST) @@ -2922,10 +2922,10 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere if (Player* plrCaster = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself()) { //check for special spell conditions - ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id); if (!conditions.empty()) { - if (!sConditionMgr.IsPlayerMeetToConditions(plrCaster, conditions)) + if (!sConditionMgr->IsPlayerMeetToConditions(plrCaster, conditions)) { //SendCastResult(SPELL_FAILED_DONT_REPORT); SendCastResult(plrCaster, m_spellInfo, m_cast_count, SPELL_FAILED_DONT_REPORT); @@ -2996,7 +2996,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere return; } - if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, m_caster)) + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, m_caster)) { SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE); finish(false); @@ -3175,7 +3175,7 @@ void Spell::cast(bool skipCheck) // now that we've done the basic check, now run the scripts // should be done before the spell is actually executed if (Player *playerCaster = m_caster->ToPlayer()) - sScriptMgr.OnPlayerSpellCast(playerCaster, this, skipCheck); + sScriptMgr->OnPlayerSpellCast(playerCaster, this, skipCheck); SetExecutedCurrently(true); @@ -3377,7 +3377,7 @@ void Spell::cast(bool skipCheck) if (m_customAttr & SPELL_ATTR0_CU_LINK_CAST) { - if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id)) + if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(m_spellInfo->Id)) { for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) if (*i < 0) @@ -4705,14 +4705,14 @@ void Spell::HandleThreatSpells(uint32 spellId) if (!m_targets.getUnitTarget()->CanHaveThreatList()) return; - uint16 threat = sSpellMgr.GetSpellThreat(spellId); + uint16 threat = sSpellMgr->GetSpellThreat(spellId); if (!threat) return; m_targets.getUnitTarget()->AddThreat(m_caster, float(threat)); - sLog.outStaticDebug("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr.GetSpellRank(spellId), threat); + sLog.outStaticDebug("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr->GetSpellRank(spellId), threat); } void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i) @@ -4871,7 +4871,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (!m_IsTriggeredSpell && target == m_caster && m_spellInfo->AttributesEx & SPELL_ATTR1_CANT_TARGET_SELF) return SPELL_FAILED_BAD_TARGETS; - bool non_caster_target = target != m_caster && !sSpellMgr.IsSpellWithCasterSourceTargetsOnly(m_spellInfo); + bool non_caster_target = target != m_caster && !sSpellMgr->IsSpellWithCasterSourceTargetsOnly(m_spellInfo); if (non_caster_target) { @@ -5045,7 +5045,7 @@ SpellCastResult Spell::CheckCast(bool strict) uint32 zone, area; m_caster->GetZoneAndAreaId(zone,area); - SpellCastResult locRes= sSpellMgr.GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area, + SpellCastResult locRes= sSpellMgr->GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area, m_caster->GetTypeId() == TYPEID_PLAYER ? m_caster->ToPlayer() : NULL); if (locRes != SPELL_CAST_OK) return locRes; @@ -5396,7 +5396,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (!m_caster->ToPlayer()->GetSelection()) return SPELL_FAILED_BAD_TARGETS; - Player* target = sObjectMgr.GetPlayer(m_caster->ToPlayer()->GetSelection()); + Player* target = sObjectMgr->GetPlayer(m_caster->ToPlayer()->GetSelection()); if (!target || m_caster->ToPlayer() == target || !target->IsInSameRaidWith(m_caster->ToPlayer())) return SPELL_FAILED_BAD_TARGETS; @@ -5407,7 +5407,7 @@ SpellCastResult Spell::CheckCast(bool strict) InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(pMap->GetId()); if (!instance) return SPELL_FAILED_TARGET_NOT_IN_INSTANCE; - if (!target->Satisfy(sObjectMgr.GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId())) + if (!target->Satisfy(sObjectMgr->GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId())) return SPELL_FAILED_BAD_TARGETS; } break; @@ -7268,7 +7268,7 @@ void Spell::CheckEffectExecuteData() void Spell::LoadScripts() { sLog.outDebug("Spell::LoadScripts"); - sScriptMgr.CreateSpellScripts(m_spellInfo->Id, m_loadedScripts); + sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts); for(std::list<SpellScript *>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) { if (!(*itr)->_Load(this)) |