aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorXTZGZoReX <none@none>2010-08-08 05:25:45 +0200
committerXTZGZoReX <none@none>2010-08-08 05:25:45 +0200
commit9083271a2f29326ae91a3239b972ca63513169f6 (patch)
tree4b28f5c0c3cb4d447140743bd413402a7c685f8d /src/server/game/Spells/Spell.cpp
parent93fc24ece91443225bbecf9f3cb59658194dcbf3 (diff)
* Some singleton renames for consistency:
accmgr -> AccountMgr objmgr -> ObjectMgr auctionmgr -> sAuctionMgr spellmgr -> sSpellMgr CreatureEAI_Mgr -> sEventAIMgr achievementmgr -> sAchievementMgr gameeventmgr -> sGameEventMgr sInstanceSaveManager -> sInstanceSaveMgr poolhandler -> sPoolMgr --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 5f1d60b1771..05c6c741e39 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -334,10 +334,10 @@ void SpellCastTargets::write (WorldPacket * data)
}
Spell::Spell(Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID, Spell** triggeringContainer, bool skipCheck)
-: m_spellInfo(spellmgr.GetSpellForDifficultyFromSpell(info, Caster)), m_spellValue(new SpellValue(m_spellInfo))
+: m_spellInfo(sSpellMgr.GetSpellForDifficultyFromSpell(info, Caster)), m_spellValue(new SpellValue(m_spellInfo))
, m_caster(Caster)
{
- m_customAttr = spellmgr.GetSpellCustomAttr(m_spellInfo->Id);
+ m_customAttr = sSpellMgr.GetSpellCustomAttr(m_spellInfo->Id);
m_skipCheck = skipCheck;
m_selfContainer = NULL;
m_triggeringContainer = triggeringContainer;
@@ -619,7 +619,7 @@ void Spell::SelectSpellTargets()
case SPELL_EFFECT_SUMMON_PLAYER:
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->GetSelection())
{
- Player* target = objmgr.GetPlayer(m_caster->ToPlayer()->GetSelection());
+ Player* target = sObjectMgr.GetPlayer(m_caster->ToPlayer()->GetSelection());
if (target)
AddUnitTarget(target, i);
}
@@ -899,7 +899,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(spellmgr.GetFirstSpellInChain(m_spellInfo->Id));
+ SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr.GetFirstSpellInChain(m_spellInfo->Id));
if ((pVictim->getLevel() + 10) >= auraSpell->spellLevel)
ihit->scaleAura = true;
}
@@ -920,7 +920,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(spellmgr.GetFirstSpellInChain(m_spellInfo->Id));
+ SpellEntry const * auraSpell = sSpellStore.LookupEntry(sSpellMgr.GetFirstSpellInChain(m_spellInfo->Id));
if ((pVictim->getLevel() + 10) >= auraSpell->spellLevel)
target.scaleAura = true;
}
@@ -1406,7 +1406,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
int32 basePoints[3];
if (scaleAura)
{
- aurSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel());
+ aurSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel());
ASSERT (aurSpellInfo);
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
@@ -1528,7 +1528,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit)
if (m_customAttr & SPELL_ATTR_CU_LINK_HIT)
{
- if (const std::vector<int32> *spell_triggered = spellmgr.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));
@@ -2196,7 +2196,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
switch(cur)
{
case TARGET_DST_DB:
- if (SpellTargetPosition const* st = spellmgr.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
@@ -3198,7 +3198,7 @@ void Spell::cast(bool skipCheck)
if (m_customAttr & SPELL_ATTR_CU_LINK_CAST)
{
- if (const std::vector<int32> *spell_triggered = spellmgr.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)
m_caster->RemoveAurasDueToSpell(-(*i));
@@ -3714,7 +3714,7 @@ void Spell::SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 ca
for (int8 x=0;x < 3;x++)
if (spellInfo->EffectItemType[x])
item = spellInfo->EffectItemType[x];
- ItemPrototype const *pProto = objmgr.GetItemPrototype(item);
+ ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item);
if (pProto && pProto->ItemLimitCategory)
data << uint32(pProto->ItemLimitCategory);
break;
@@ -3894,7 +3894,7 @@ void Spell::WriteAmmoToPacket(WorldPacket * data)
uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID);
if (ammoID)
{
- ItemPrototype const *pProto = objmgr.GetItemPrototype(ammoID);
+ ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(ammoID);
if (pProto)
{
ammoDisplayID = pProto->DisplayInfoID;
@@ -4541,14 +4541,14 @@ void Spell::HandleThreatSpells(uint32 spellId)
if (!m_targets.getUnitTarget()->CanHaveThreatList())
return;
- uint16 threat = spellmgr.GetSpellThreat(spellId);
+ uint16 threat = sSpellMgr.GetSpellThreat(spellId);
if (!threat)
return;
m_targets.getUnitTarget()->AddThreat(m_caster, float(threat));
- DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threat);
+ DEBUG_LOG("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)
@@ -4719,7 +4719,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!m_IsTriggeredSpell && target == m_caster && m_spellInfo->AttributesEx & SPELL_ATTR_EX_CANT_TARGET_SELF)
return SPELL_FAILED_BAD_TARGETS;
- bool non_caster_target = target != m_caster && !spellmgr.IsSpellWithCasterSourceTargetsOnly(m_spellInfo);
+ bool non_caster_target = target != m_caster && !sSpellMgr.IsSpellWithCasterSourceTargetsOnly(m_spellInfo);
if (non_caster_target)
{
@@ -4894,7 +4894,7 @@ SpellCastResult Spell::CheckCast(bool strict)
uint32 zone, area;
m_caster->GetZoneAndAreaId(zone,area);
- SpellCastResult locRes= spellmgr.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;
@@ -4928,8 +4928,8 @@ SpellCastResult Spell::CheckCast(bool strict)
m_spellInfo->EffectImplicitTargetA[j] == TARGET_DST_NEARBY_ENTRY ||
m_spellInfo->EffectImplicitTargetB[j] == TARGET_DST_NEARBY_ENTRY)
{
- SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(m_spellInfo->Id);
- SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(m_spellInfo->Id);
+ SpellScriptTarget::const_iterator lower = sSpellMgr.GetBeginSpellScriptTarget(m_spellInfo->Id);
+ SpellScriptTarget::const_iterator upper = sSpellMgr.GetEndSpellScriptTarget(m_spellInfo->Id);
if (lower == upper)
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = TARGET_UNIT_NEARBY_ENTRY or TARGET_DST_NEARBY_ENTRY, but does not have record in `spell_script_target`",m_spellInfo->Id);
@@ -5377,7 +5377,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!m_caster->ToPlayer()->GetSelection())
return SPELL_FAILED_BAD_TARGETS;
- Player* target = objmgr.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;
@@ -5388,7 +5388,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(objmgr.GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId()))
+ if (!target->Satisfy(sObjectMgr.GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId()))
return SPELL_FAILED_BAD_TARGETS;
}
break;
@@ -5548,7 +5548,7 @@ SpellCastResult Spell::CheckCast(bool strict)
// Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells
bool AllowMount = !m_caster->GetMap()->IsDungeon() || m_caster->GetMap()->IsBattlegroundOrArena();
- InstanceTemplate const *it = objmgr.GetInstanceTemplate(m_caster->GetMapId());
+ InstanceTemplate const *it = sObjectMgr.GetInstanceTemplate(m_caster->GetMapId());
if (it)
AllowMount = it->allowMount;
if (m_caster->GetTypeId() == TYPEID_PLAYER && !AllowMount && !m_IsTriggeredSpell && !m_spellInfo->AreaGroupId)
@@ -6112,7 +6112,7 @@ SpellCastResult Spell::CheckItems()
uint8 msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1);
if (msg != EQUIP_ERR_OK)
{
- ItemPrototype const *pProto = objmgr.GetItemPrototype(m_spellInfo->EffectItemType[i]);
+ ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(m_spellInfo->EffectItemType[i]);
// TODO: Needs review
if (pProto && !(pProto->ItemLimitCategory))
{
@@ -6297,7 +6297,7 @@ SpellCastResult Spell::CheckItems()
return SPELL_FAILED_NO_AMMO;
}
- ItemPrototype const *ammoProto = objmgr.GetItemPrototype(ammo);
+ ItemPrototype const *ammoProto = sObjectMgr.GetItemPrototype(ammo);
if (!ammoProto)
return SPELL_FAILED_NO_AMMO;
@@ -6333,7 +6333,7 @@ SpellCastResult Spell::CheckItems()
case SPELL_EFFECT_CREATE_MANA_GEM:
{
uint32 item_id = m_spellInfo->EffectItemType[i];
- ItemPrototype const *pProto = objmgr.GetItemPrototype(item_id);
+ ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item_id);
if (!pProto)
return SPELL_FAILED_ITEM_AT_MAX_CHARGES;