diff options
| author | Shauren <none@none> | 2010-12-22 21:25:23 +0100 |
|---|---|---|
| committer | Shauren <none@none> | 2010-12-22 21:25:23 +0100 |
| commit | 0f3b9019a88777bef8383e699d27a7e8615f93f2 (patch) | |
| tree | b88e120ad46050aa073ee451676801aabbd3eaa1 /src/server/game/Entities/Unit | |
| parent | 0948fc5bbed08ae6edee4fa1ff86df5cfbffa996 (diff) | |
Core: Get rid of dirty operator workaround for ACE_Singleton class implementation
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 88799c8f2dd..8da94c2d403 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1438,7 +1438,7 @@ bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellEntry const * if (spellInfo) { // there are spells with no specific attribute but they have "ignores armor" in tooltip - if (sSpellMgr.GetSpellCustomAttr(spellInfo->Id) & SPELL_ATTR0_CU_IGNORE_ARMOR) + if (sSpellMgr->GetSpellCustomAttr(spellInfo->Id) & SPELL_ATTR0_CU_IGNORE_ARMOR) return false; // bleeding effects are not reduced by armor @@ -1887,8 +1887,8 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff int32 remainingHp = int32(pVictim->GetHealth() - RemainingDamage); // min pct of hp is stored in effect 0 of talent spell - uint32 rank = sSpellMgr.GetSpellRank(spellProto->Id); - SpellEntry const * talentProto = sSpellStore.LookupEntry(sSpellMgr.GetSpellWithRank(49189, rank)); + uint32 rank = sSpellMgr->GetSpellRank(spellProto->Id); + SpellEntry const * talentProto = sSpellStore.LookupEntry(sSpellMgr->GetSpellWithRank(49189, rank)); int32 minHp = int32(pVictim->CountPctFromMaxHealth(SpellMgr::CalculateSpellEffectAmount(talentProto, EFFECT_0, (*itr)->GetCaster()))); // Damage that would take you below [effect0] health or taken while you are at [effect0] @@ -3743,7 +3743,7 @@ bool Unit::_IsNoStackAuraDueToAura(Aura * appliedAura, Aura * existingAura) cons return false; // passive non-stackable spells not stackable only with another rank of same spell - if (!sSpellMgr.IsRankSpellDueToSpell(spellProto, i_spellId)) + if (!sSpellMgr->IsRankSpellDueToSpell(spellProto, i_spellId)) return false; } @@ -3763,7 +3763,7 @@ bool Unit::_IsNoStackAuraDueToAura(Aura * appliedAura, Aura * existingAura) cons if (is_triggered_by_spell) return false; - if (sSpellMgr.CanAurasStack(appliedAura, existingAura, sameCaster)) + if (sSpellMgr->CanAurasStack(appliedAura, existingAura, sameCaster)) return false; return true; } @@ -4362,12 +4362,12 @@ AuraEffect * Unit::GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster) AuraEffect * Unit::GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, uint64 caster) const { - uint32 rankSpell = sSpellMgr.GetFirstSpellInChain(spellId); + uint32 rankSpell = sSpellMgr->GetFirstSpellInChain(spellId); while (true) { if (AuraEffect * aurEff = GetAuraEffect(rankSpell, effIndex, caster)) return aurEff; - SpellChainNode const * chainNode = sSpellMgr.GetSpellChainNode(rankSpell); + SpellChainNode const * chainNode = sSpellMgr->GetSpellChainNode(rankSpell); if (!chainNode) break; else @@ -4425,12 +4425,12 @@ Aura * Unit::GetAura(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, u AuraApplication * Unit::GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, uint8 reqEffMask, AuraApplication* except) const { - uint32 rankSpell = sSpellMgr.GetFirstSpellInChain(spellId); + uint32 rankSpell = sSpellMgr->GetFirstSpellInChain(spellId); while (true) { if (AuraApplication * aurApp = GetAuraApplication(rankSpell, casterGUID, itemCasterGUID, reqEffMask, except)) return aurApp; - SpellChainNode const * chainNode = sSpellMgr.GetSpellChainNode(rankSpell); + SpellChainNode const * chainNode = sSpellMgr->GetSpellChainNode(rankSpell); if (!chainNode) break; else @@ -5207,7 +5207,7 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger } // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -7574,7 +7574,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Lightning Shield if (AuraEffect const * aurEff = GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0)) { - uint32 spell = sSpellMgr.GetSpellWithRank(26364, sSpellMgr.GetSpellRank(aurEff->GetId())); + uint32 spell = sSpellMgr->GetSpellWithRank(26364, sSpellMgr->GetSpellRank(aurEff->GetId())); // custom cooldown processing case if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(spell)) @@ -7779,7 +7779,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (spellProto->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && spellProto->SpellFamilyFlags[0] & 0x2000) { - SpellChainNode const* newChain = sSpellMgr.GetSpellChainNode(itr->first); + SpellChainNode const* newChain = sSpellMgr->GetSpellChainNode(itr->first); // No chain entry or entry lower than found entry if (!chain || !newChain || (chain->rank < newChain->rank)) @@ -7877,7 +7877,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger } // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown_spell_id == 0) @@ -7939,7 +7939,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 /*damage*/, AuraEffe } // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -7996,7 +7996,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 /*damage*/, Aur } // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) @@ -8578,7 +8578,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig // Lightning Shield (overwrite non existing triggered spell call in spell.dbc if (auraSpellInfo->SpellFamilyFlags[0] & 0x400) { - trigger_spell_id = sSpellMgr.GetSpellWithRank(26364, sSpellMgr.GetSpellRank(auraSpellInfo->Id)); + trigger_spell_id = sSpellMgr->GetSpellWithRank(26364, sSpellMgr->GetSpellRank(auraSpellInfo->Id)); } // Nature's Guardian else if (auraSpellInfo->SpellIconID == 2013) @@ -8891,7 +8891,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig { // have rank dependent proc chance, ignore too often cases // PPM = 2.5 * (rank of talent), - uint32 rank = sSpellMgr.GetSpellRank(auraSpellInfo->Id); + uint32 rank = sSpellMgr->GetSpellRank(auraSpellInfo->Id); // 5 rank -> 100% 4 rank -> 80% and etc from full rate if (!roll_chance_i(20*rank)) return false; @@ -9014,7 +9014,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig target = !(procFlags & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && IsPositiveSpell(trigger_spell_id) ? this : pVictim; // default case - if ((!target && !sSpellMgr.IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) + if ((!target && !sSpellMgr->IsSrcTargetSpell(triggerEntry)) || (target && target != this && !target->isAlive())) return false; if (basepoints0) @@ -10439,7 +10439,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 { if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0)) { - if (SpellChainNode const *chain = sSpellMgr.GetSpellChainNode((*i)->GetId())) + if (SpellChainNode const *chain = sSpellMgr->GetSpellChainNode((*i)->GetId())) AddPctF(DoneTotalMod, chain->rank * 2.0f); } break; @@ -10657,7 +10657,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 // Check for table values float coeff = 0; - SpellBonusEntry const *bonus = sSpellMgr.GetSpellBonusData(spellProto->Id); + SpellBonusEntry const *bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); if (bonus) { if (damagetype == DOT) @@ -11169,7 +11169,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint } // Check for table values - SpellBonusEntry const* bonus = !scripted ? sSpellMgr.GetSpellBonusData(spellProto->Id) : NULL; + SpellBonusEntry const* bonus = !scripted ? sSpellMgr->GetSpellBonusData(spellProto->Id) : NULL; float coeff = 0; float factorMod = 1.0f; if (bonus) @@ -11669,7 +11669,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att case 7293: { if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0)) - if (SpellChainNode const *chain = sSpellMgr.GetSpellChainNode((*i)->GetId())) + if (SpellChainNode const *chain = sSpellMgr->GetSpellChainNode((*i)->GetId())) AddPctF(DoneTotalMod, chain->rank * 2.0f); break; } @@ -12946,8 +12946,8 @@ int32 Unit::ModSpellDuration(SpellEntry const* spellProto, Unit const* target, i if (target->GetTypeId() == TYPEID_PLAYER) { if (spellProto->SpellFamilyName == SPELLFAMILY_POTION && ( - sSpellMgr.IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_BATTLE) || - sSpellMgr.IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_GUARDIAN))) + sSpellMgr->IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_BATTLE) || + sSpellMgr->IsSpellMemberOfSpellGroup(spellProto->Id, SPELL_GROUP_ELIXIR_GUARDIAN))) { if (target->HasAura(53042) && target->HasSpell(spellProto->EffectTriggerSpell[0])) duration *= 2; @@ -13835,14 +13835,14 @@ void CharmInfo::InitCharmCreateSpells() bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate) { - uint32 first_id = sSpellMgr.GetFirstSpellInChain(spell_id); + uint32 first_id = sSpellMgr->GetFirstSpellInChain(spell_id); // new spell rank can be already listed for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i) { if (uint32 action = PetActionBar[i].GetAction()) { - if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr.GetFirstSpellInChain(action) == first_id) + if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr->GetFirstSpellInChain(action) == first_id) { PetActionBar[i].SetAction(spell_id); return true; @@ -13864,13 +13864,13 @@ bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate) bool CharmInfo::RemoveSpellFromActionBar(uint32 spell_id) { - uint32 first_id = sSpellMgr.GetFirstSpellInChain(spell_id); + uint32 first_id = sSpellMgr->GetFirstSpellInChain(spell_id); for (uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i) { if (uint32 action = PetActionBar[i].GetAction()) { - if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr.GetFirstSpellInChain(action) == first_id) + if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr->GetFirstSpellInChain(action) == first_id) { SetActionBar(i,0,ACT_PASSIVE); return true; @@ -14477,7 +14477,7 @@ void Unit::StopMoving() // send explicit stop packet // rely on vmaps here because for example stormwind is in air - //float z = sMapMgr.GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true); + //float z = sMapMgr->GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true); //if (fabs(GetPositionZ() - z) < 2.0f) // Relocate(GetPositionX(), GetPositionY(), z); //Relocate(GetPositionX(), GetPositionY(),GetPositionZ()); @@ -14556,7 +14556,7 @@ void Unit::ClearComboPointHolders() { uint32 lowguid = *m_ComboPointHolders.begin(); - Player* plr = sObjectMgr.GetPlayer(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER)); + Player* plr = sObjectMgr->GetPlayer(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER)); if (plr && plr->GetComboTarget() == GetGUID()) // recheck for safe plr->ClearComboPoints(); // remove also guid from m_ComboPointHolders; else @@ -14922,7 +14922,7 @@ bool Unit::InitTamedPet(Pet * pet, uint8 level, uint32 spell_id) return false; } - pet->GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true); + pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); // this enables pet details window (Shift+P) pet->InitPetCreateSpells(); //pet->InitLevelupSpellsForLevel(); @@ -14935,7 +14935,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co SpellEntry const *spellProto = aura->GetSpellProto(); // Get proc Event Entry - spellProcEvent = sSpellMgr.GetSpellProcEvent(spellProto->Id); + spellProcEvent = sSpellMgr->GetSpellProcEvent(spellProto->Id); // Get EventProcFlag uint32 EventProcFlag; @@ -14955,7 +14955,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co } // Check spellProcEvent data requirements - if (!sSpellMgr.IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active)) + if (!sSpellMgr->IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active)) return false; // In most cases req get honor or XP from kill if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER) @@ -15188,7 +15188,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) group->UpdateLooterGuid(creature, true); if (group->GetLooterGuid()) { - pLooter = sObjectMgr.GetPlayer(group->GetLooterGuid()); + pLooter = sObjectMgr->GetPlayer(group->GetLooterGuid()); if (pLooter) { creature->SetLootRecipient(pLooter); // update creature loot recipient to the allowed looter. @@ -15353,7 +15353,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) // the reset time is set but not added to the scheduler // until the players leave the instance time_t resettime = creature->GetRespawnTimeEx() + 2 * HOUR; - if (InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(creature->GetInstanceId())) + if (InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(creature->GetInstanceId())) if (save->GetResetTime() < resettime) save->SetResetTime(resettime); } } @@ -15398,13 +15398,13 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) { Player *killer = this->ToPlayer(); Player *killed = pVictim->ToPlayer(); - sScriptMgr.OnPVPKill(killer, killed); + sScriptMgr->OnPVPKill(killer, killed); } else if (pVictim->GetTypeId() == TYPEID_UNIT) { Player *killer = this->ToPlayer(); Creature *killed = pVictim->ToCreature(); - sScriptMgr.OnCreatureKill(killer, killed); + sScriptMgr->OnCreatureKill(killer, killed); } } else if (this->GetTypeId() == TYPEID_UNIT) @@ -15413,7 +15413,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) { Creature *killer = this->ToCreature(); Player *killed = pVictim->ToPlayer(); - sScriptMgr.OnPlayerKilledByCreature(killer, killed); + sScriptMgr->OnPlayerKilledByCreature(killer, killed); } } } @@ -15731,7 +15731,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type) //just to enable stat window if (GetCharmInfo()) - GetCharmInfo()->SetPetNumber(sObjectMgr.GeneratePetNumber(), true); + GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); //if charmed two demons the same session, the 2nd gets the 1st one's name SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped |
