* 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
This commit is contained in:
@@ -616,7 +616,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster)
|
||||
amount+=caster->ApplyEffectModifiers(m_spellProto,m_effIndex,int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.2f));
|
||||
// "If used while your target is above 75% health, Rend does 35% more damage."
|
||||
// as for 3.1.3 only ranks above 9 (wrong tooltip?)
|
||||
if (spellmgr.GetSpellRank(m_spellProto->Id) >= 9)
|
||||
if (sSpellMgr.GetSpellRank(m_spellProto->Id) >= 9)
|
||||
{
|
||||
if (GetBase()->GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, m_spellProto, caster))
|
||||
amount += int32(amount * SpellMgr::CalculateSpellEffectAmount(m_spellProto, 2, caster) / 100.0f);
|
||||
@@ -968,7 +968,7 @@ void AuraEffect::ApplySpellMod(Unit * target, bool apply)
|
||||
Aura * aura = iter->second->GetBase();
|
||||
// only passive auras-active auras should have amount set on spellcast and not be affected
|
||||
// if aura is casted by others, it will not be affected
|
||||
if (aura->IsPassive() && aura->GetCasterGUID() == guid && spellmgr.IsAffectedByMod(aura->GetSpellProto(), m_spellmod))
|
||||
if (aura->IsPassive() && aura->GetCasterGUID() == guid && sSpellMgr.IsAffectedByMod(aura->GetSpellProto(), m_spellmod))
|
||||
{
|
||||
if (GetMiscValue() == SPELLMOD_ALL_EFFECTS)
|
||||
{
|
||||
@@ -3092,7 +3092,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
|
||||
}
|
||||
else
|
||||
{
|
||||
CreatureInfo const * ci = objmgr.GetCreatureTemplate(GetMiscValue());
|
||||
CreatureInfo const * ci = sObjectMgr.GetCreatureTemplate(GetMiscValue());
|
||||
if (!ci)
|
||||
{
|
||||
target->SetDisplayId(16358); // pig pink ^_^
|
||||
@@ -3166,14 +3166,14 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
|
||||
if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty())
|
||||
{
|
||||
uint32 cr_id = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
|
||||
if (CreatureInfo const* ci = objmgr.GetCreatureTemplate(cr_id))
|
||||
if (CreatureInfo const* ci = sObjectMgr.GetCreatureTemplate(cr_id))
|
||||
{
|
||||
uint32 team = 0;
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
team = target->ToPlayer()->GetTeam();
|
||||
|
||||
uint32 display_id = objmgr.ChooseDisplayId(team,ci);
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
|
||||
uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
|
||||
if (minfo)
|
||||
display_id = minfo->modelid;
|
||||
|
||||
@@ -3599,7 +3599,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b
|
||||
|
||||
if (apply)
|
||||
{
|
||||
CreatureInfo const* ci = objmgr.GetCreatureTemplate(GetMiscValue());
|
||||
CreatureInfo const* ci = sObjectMgr.GetCreatureTemplate(GetMiscValue());
|
||||
if (!ci)
|
||||
{
|
||||
sLog.outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need it modelid)",GetMiscValue());
|
||||
@@ -3610,8 +3610,8 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
team = target->ToPlayer()->GetTeam();
|
||||
|
||||
uint32 display_id = objmgr.ChooseDisplayId(team,ci);
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
|
||||
uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
|
||||
if (minfo)
|
||||
display_id = minfo->modelid;
|
||||
|
||||
@@ -6039,7 +6039,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
|
||||
if (mode & AURA_EFFECT_HANDLE_REAL)
|
||||
{
|
||||
// pet auras
|
||||
if (PetAura const* petSpell = spellmgr.GetPetAura(GetId(), m_effIndex))
|
||||
if (PetAura const* petSpell = sSpellMgr.GetPetAura(GetId(), m_effIndex))
|
||||
{
|
||||
if (apply)
|
||||
target->AddPetAura(petSpell);
|
||||
@@ -6171,7 +6171,7 @@ void AuraEffect::HandleAuraEmpathy(AuraApplication const * aurApp, uint8 mode, b
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureInfo const * ci = objmgr.GetCreatureTemplate(target->GetEntry());
|
||||
CreatureInfo const * ci = sObjectMgr.GetCreatureTemplate(target->GetEntry());
|
||||
if (ci && ci->type == CREATURE_TYPE_BEAST)
|
||||
target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply);
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply)
|
||||
for (Unit::AuraApplicationMap::iterator iter = itr->first->GetAppliedAuras().begin(); iter != itr->first->GetAppliedAuras().end(); ++iter)
|
||||
{
|
||||
Aura const * aura = iter->second->GetBase();
|
||||
if (!spellmgr.CanAurasStack(GetSpellProto(), aura->GetSpellProto(), aura->GetCasterGUID() == GetCasterGUID()))
|
||||
if (!sSpellMgr.CanAurasStack(GetSpellProto(), aura->GetSpellProto(), aura->GetCasterGUID() == GetCasterGUID()))
|
||||
{
|
||||
addUnit = false;
|
||||
break;
|
||||
@@ -844,7 +844,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
|
||||
Unit * target = aurApp->GetTarget();
|
||||
AuraRemoveMode removeMode = aurApp->GetRemoveMode();
|
||||
// spell_area table
|
||||
SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAuraMapBounds(GetId());
|
||||
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
|
||||
if (saBounds.first != saBounds.second)
|
||||
{
|
||||
uint32 zone, area;
|
||||
@@ -867,9 +867,9 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
|
||||
if (apply)
|
||||
{
|
||||
// Apply linked auras (On first aura apply)
|
||||
if (spellmgr.GetSpellCustomAttr(GetId()) & SPELL_ATTR_CU_LINK_AURA)
|
||||
if (sSpellMgr.GetSpellCustomAttr(GetId()) & SPELL_ATTR_CU_LINK_AURA)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
|
||||
{
|
||||
if (*itr < 0)
|
||||
@@ -1057,11 +1057,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
|
||||
// Remove Linked Auras
|
||||
if (removeMode != AURA_REMOVE_BY_STACK && removeMode != AURA_REMOVE_BY_DEATH)
|
||||
{
|
||||
if (uint32 customAttr = spellmgr.GetSpellCustomAttr(GetId()))
|
||||
if (uint32 customAttr = sSpellMgr.GetSpellCustomAttr(GetId()))
|
||||
{
|
||||
if (customAttr & SPELL_ATTR_CU_LINK_REMOVE)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)GetId()))
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(-(int32)GetId()))
|
||||
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
|
||||
{
|
||||
if (*itr < 0)
|
||||
@@ -1072,7 +1072,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
|
||||
}
|
||||
if (customAttr & SPELL_ATTR_CU_LINK_AURA)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
|
||||
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
|
||||
{
|
||||
if (*itr < 0)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1890,7 +1890,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
}
|
||||
|
||||
// pet auras
|
||||
if (PetAura const* petSpell = spellmgr.GetPetAura(m_spellInfo->Id,i))
|
||||
if (PetAura const* petSpell = sSpellMgr.GetPetAura(m_spellInfo->Id,i))
|
||||
{
|
||||
m_caster->AddPetAura(petSpell);
|
||||
return;
|
||||
@@ -2782,7 +2782,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
|
||||
Player* player = (Player*)unitTarget;
|
||||
|
||||
uint32 newitemid = itemtype;
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(newitemid);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(newitemid);
|
||||
if (!pProto)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
@@ -2944,7 +2944,7 @@ void Spell::EffectPersistentAA(uint32 i)
|
||||
if (!caster->IsInWorld())
|
||||
return;
|
||||
DynamicObject* dynObj = new DynamicObject;
|
||||
if (!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, m_targets.m_dstPos, radius, false))
|
||||
if (!dynObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, m_targets.m_dstPos, radius, false))
|
||||
{
|
||||
delete dynObj;
|
||||
return;
|
||||
@@ -3028,10 +3028,10 @@ void Spell::EffectEnergize(uint32 i)
|
||||
{
|
||||
uint32 spell_id = itr->second->GetBase()->GetId();
|
||||
if (!guardianFound)
|
||||
if (spellmgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_GUARDIAN))
|
||||
if (sSpellMgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_GUARDIAN))
|
||||
guardianFound = true;
|
||||
if (!battleFound)
|
||||
if (spellmgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_BATTLE))
|
||||
if (sSpellMgr.IsSpellMemberOfSpellGroup(spell_id, SPELL_GROUP_ELIXIR_BATTLE))
|
||||
battleFound = true;
|
||||
if (battleFound && guardianFound)
|
||||
break;
|
||||
@@ -3040,17 +3040,17 @@ void Spell::EffectEnergize(uint32 i)
|
||||
// get all available elixirs by mask and spell level
|
||||
std::set<uint32> avalibleElixirs;
|
||||
if (!guardianFound)
|
||||
spellmgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs);
|
||||
sSpellMgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs);
|
||||
if (!battleFound)
|
||||
spellmgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs);
|
||||
sSpellMgr.GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs);
|
||||
for (std::set<uint32>::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end() ;)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(*itr);
|
||||
if (spellInfo->spellLevel < m_spellInfo->spellLevel || spellInfo->spellLevel > unitTarget->getLevel())
|
||||
avalibleElixirs.erase(itr++);
|
||||
else if (spellmgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_SHATTRATH))
|
||||
else if (sSpellMgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_SHATTRATH))
|
||||
avalibleElixirs.erase(itr++);
|
||||
else if (spellmgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_UNSTABLE))
|
||||
else if (sSpellMgr.IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_UNSTABLE))
|
||||
avalibleElixirs.erase(itr++);
|
||||
else
|
||||
++itr;
|
||||
@@ -3750,7 +3750,7 @@ void Spell::EffectAddFarsight(uint32 i)
|
||||
if (!m_caster->IsInWorld())
|
||||
return;
|
||||
DynamicObject* dynObj = new DynamicObject;
|
||||
if (!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, m_targets.m_dstPos, radius, true))
|
||||
if (!dynObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, m_targets.m_dstPos, radius, true))
|
||||
{
|
||||
delete dynObj;
|
||||
return;
|
||||
@@ -4203,7 +4203,7 @@ void Spell::EffectSummonPet(uint32 i)
|
||||
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
|
||||
|
||||
// generate new name for summon pet
|
||||
std::string new_name=objmgr.GeneratePetName(petentry);
|
||||
std::string new_name=sObjectMgr.GeneratePetName(petentry);
|
||||
if (!new_name.empty())
|
||||
pet->SetName(new_name);
|
||||
}
|
||||
@@ -4639,7 +4639,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
|
||||
Map *map = target->GetMap();
|
||||
|
||||
if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map,
|
||||
if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -4688,7 +4688,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if (linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
|
||||
if (linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
@@ -5727,7 +5727,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
||||
{
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || !unitTarget->ToCreature()->isPet())
|
||||
return;
|
||||
CreatureInfo const * ci = objmgr.GetCreatureTemplate(unitTarget->GetEntry());
|
||||
CreatureInfo const * ci = sObjectMgr.GetCreatureTemplate(unitTarget->GetEntry());
|
||||
switch (ci->family)
|
||||
{
|
||||
case CREATURE_FAMILY_SUCCUBUS:
|
||||
@@ -6105,7 +6105,7 @@ void Spell::EffectDuel(uint32 i)
|
||||
uint32 gameobject_id = m_spellInfo->EffectMiscValue[i];
|
||||
|
||||
Map *map = m_caster->GetMap();
|
||||
if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id,
|
||||
if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id,
|
||||
map, m_caster->GetPhaseMask(),
|
||||
m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2 ,
|
||||
m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2 ,
|
||||
@@ -6416,7 +6416,7 @@ void Spell::EffectSummonObject(uint32 i)
|
||||
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
|
||||
|
||||
Map *map = m_caster->GetMap();
|
||||
if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map,
|
||||
if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -6550,7 +6550,7 @@ void Spell::EffectReputation(uint32 i)
|
||||
if (!factionEntry)
|
||||
return;
|
||||
|
||||
if (RepRewardRate const * repData = objmgr.GetRepRewardRate(faction_id))
|
||||
if (RepRewardRate const * repData = sObjectMgr.GetRepRewardRate(faction_id))
|
||||
{
|
||||
rep_change = (float)rep_change * repData->spell_rate;
|
||||
}
|
||||
@@ -6748,7 +6748,7 @@ void Spell::EffectQuestClear(uint32 i)
|
||||
|
||||
uint32 quest_id = m_spellInfo->EffectMiscValue[i];
|
||||
|
||||
Quest const* pQuest = objmgr.GetQuestTemplate(quest_id);
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(quest_id);
|
||||
|
||||
if (!pQuest)
|
||||
return;
|
||||
@@ -6940,7 +6940,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
{
|
||||
uint32 name_id = m_spellInfo->EffectMiscValue[effIndex];
|
||||
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(name_id);
|
||||
GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(name_id);
|
||||
|
||||
if (!goinfo)
|
||||
{
|
||||
@@ -6991,7 +6991,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
|
||||
GameObject* pGameObj = new GameObject;
|
||||
|
||||
if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap,
|
||||
if (!pGameObj->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap,
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -7055,7 +7055,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if (linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
|
||||
if (linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
@@ -7294,7 +7294,7 @@ void Spell::EffectQuestStart(uint32 i)
|
||||
return;
|
||||
|
||||
Player * player = unitTarget->ToPlayer();
|
||||
if (Quest const* qInfo = objmgr.GetQuestTemplate(m_spellInfo->EffectMiscValue[i]))
|
||||
if (Quest const* qInfo = sObjectMgr.GetQuestTemplate(m_spellInfo->EffectMiscValue[i]))
|
||||
{
|
||||
if (player->CanTakeQuest(qInfo, false) && player->CanAddQuest(qInfo, false))
|
||||
{
|
||||
@@ -7638,7 +7638,7 @@ void Spell::EffectRechargeManaGem(uint32 /*i*/)
|
||||
|
||||
uint32 item_id = m_spellInfo->EffectItemType[0];
|
||||
|
||||
ItemPrototype const *pProto = objmgr.GetItemPrototype(item_id);
|
||||
ItemPrototype const *pProto = sObjectMgr.GetItemPrototype(item_id);
|
||||
if (!pProto)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
|
||||
@@ -7664,7 +7664,7 @@ void Spell::EffectBind(uint32 i)
|
||||
WorldLocation loc;
|
||||
if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_DST_DB || m_spellInfo->EffectImplicitTargetB[i] == TARGET_DST_DB)
|
||||
{
|
||||
SpellTargetPosition const* st = spellmgr.GetSpellTargetPosition(m_spellInfo->Id);
|
||||
SpellTargetPosition const* st = sSpellMgr.GetSpellTargetPosition(m_spellInfo->Id);
|
||||
if (!st)
|
||||
{
|
||||
sLog.outError( "Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id );
|
||||
|
||||
@@ -364,7 +364,7 @@ bool IsAutocastableSpell(uint32 spellId)
|
||||
|
||||
bool IsHigherHankOfSpell(uint32 spellId_1, uint32 spellId_2)
|
||||
{
|
||||
return spellmgr.GetSpellRank(spellId_1)<spellmgr.GetSpellRank(spellId_2);
|
||||
return sSpellMgr.GetSpellRank(spellId_1)<sSpellMgr.GetSpellRank(spellId_2);
|
||||
}
|
||||
|
||||
uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, SpellSchoolMask schoolMask)
|
||||
@@ -540,7 +540,7 @@ SpellSpecific GetSpellSpecific(SpellEntry const * spellInfo)
|
||||
// scrolls effects
|
||||
else
|
||||
{
|
||||
uint32 firstSpell = spellmgr.GetFirstSpellInChain(spellInfo->Id);
|
||||
uint32 firstSpell = sSpellMgr.GetFirstSpellInChain(spellInfo->Id);
|
||||
switch (firstSpell)
|
||||
{
|
||||
case 8118: // Strength
|
||||
@@ -981,7 +981,7 @@ bool IsPositiveSpell(uint32 spellId)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(spellId)) // non-existing spells
|
||||
return false;
|
||||
return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE);
|
||||
return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE);
|
||||
}
|
||||
|
||||
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
||||
@@ -991,9 +991,9 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
||||
switch(effIndex)
|
||||
{
|
||||
default:
|
||||
case 0: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF0);
|
||||
case 1: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF1);
|
||||
case 2: return !(spellmgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF2);
|
||||
case 0: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF0);
|
||||
case 1: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF1);
|
||||
case 2: return !(sSpellMgr.GetSpellCustomAttr(spellId) & SPELL_ATTR_CU_NEGATIVE_EFF2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1225,7 +1225,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
// if (!spellmgr.GetSpellTargetPosition(i))
|
||||
// if (!sSpellMgr.GetSpellTargetPosition(i))
|
||||
// sLog.outDebug("Spell (ID: %u) does not have record in `spell_target_position`", i);
|
||||
}
|
||||
}
|
||||
@@ -1701,7 +1701,7 @@ bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo)
|
||||
if (IsProfessionOrRidingSpell(spellInfo->Id))
|
||||
return false;
|
||||
|
||||
if (spellmgr.IsSkillBonusSpell(spellInfo->Id))
|
||||
if (sSpellMgr.IsSkillBonusSpell(spellInfo->Id))
|
||||
return false;
|
||||
|
||||
// All stance spells. if any better way, change it.
|
||||
@@ -2229,7 +2229,7 @@ bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntr
|
||||
return false;
|
||||
|
||||
// remove duplicates with levelupSpells if any
|
||||
if (PetLevelupSpellSet const *levelupSpells = cInfo->family ? spellmgr.GetPetLevelupSpellList(cInfo->family) : NULL)
|
||||
if (PetLevelupSpellSet const *levelupSpells = cInfo->family ? sSpellMgr.GetPetLevelupSpellList(cInfo->family) : NULL)
|
||||
{
|
||||
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
|
||||
{
|
||||
@@ -2527,7 +2527,7 @@ void SpellMgr::LoadSpellAreas()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spellArea.questStart && !objmgr.GetQuestTemplate(spellArea.questStart))
|
||||
if (spellArea.questStart && !sObjectMgr.GetQuestTemplate(spellArea.questStart))
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart);
|
||||
continue;
|
||||
@@ -2535,7 +2535,7 @@ void SpellMgr::LoadSpellAreas()
|
||||
|
||||
if (spellArea.questEnd)
|
||||
{
|
||||
if (!objmgr.GetQuestTemplate(spellArea.questEnd))
|
||||
if (!sObjectMgr.GetQuestTemplate(spellArea.questEnd))
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd);
|
||||
continue;
|
||||
@@ -2683,7 +2683,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
|
||||
}
|
||||
|
||||
// DB base check (if non empty then must fit at least single for allow)
|
||||
SpellAreaMapBounds saBounds = spellmgr.GetSpellAreaMapBounds(spellInfo->Id);
|
||||
SpellAreaMapBounds saBounds = sSpellMgr.GetSpellAreaMapBounds(spellInfo->Id);
|
||||
if (saBounds.first != saBounds.second)
|
||||
{
|
||||
for (SpellAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
|
||||
|
||||
@@ -1420,5 +1420,5 @@ class SpellMgr
|
||||
SpellDifficultySearcherMap mSpellDifficultySearcherMap;
|
||||
};
|
||||
|
||||
#define spellmgr SpellMgr::Instance()
|
||||
#define sSpellMgr SpellMgr::Instance()
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user