* 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:
@@ -155,7 +155,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||
PetType pet_type = PetType(fields[18].GetUInt8());
|
||||
if (pet_type == HUNTER_PET)
|
||||
{
|
||||
CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(petentry);
|
||||
CreatureInfo const* creatureInfo = sObjectMgr.GetCreatureTemplate(petentry);
|
||||
if (!creatureInfo || !creatureInfo->isTameable(owner->CanTameExoticPets()))
|
||||
return false;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||
}
|
||||
|
||||
Map *map = owner->GetMap();
|
||||
uint32 guid = objmgr.GenerateLowGuid(HIGHGUID_PET);
|
||||
uint32 guid = sObjectMgr.GenerateLowGuid(HIGHGUID_PET);
|
||||
if (!Create(guid, map, owner->GetPhaseMask(), petentry, pet_number))
|
||||
return false;
|
||||
|
||||
@@ -654,7 +654,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
|
||||
if (IsPassiveSpell(spellid))
|
||||
return true;
|
||||
|
||||
chainstartstore[0] = spellmgr.GetFirstSpellInChain(spellid);
|
||||
chainstartstore[0] = sSpellMgr.GetFirstSpellInChain(spellid);
|
||||
|
||||
for (PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||
{
|
||||
@@ -664,7 +664,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid)
|
||||
if (IsPassiveSpell(itr->first))
|
||||
continue;
|
||||
|
||||
uint32 chainstart = spellmgr.GetFirstSpellInChain(itr->first);
|
||||
uint32 chainstart = sSpellMgr.GetFirstSpellInChain(itr->first);
|
||||
|
||||
uint8 x;
|
||||
|
||||
@@ -717,7 +717,7 @@ void Pet::GivePetXP(uint32 xp)
|
||||
// Subtract newXP from amount needed for nextlevel
|
||||
newXP -= nextLvlXP;
|
||||
GivePetLevel(level+1);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(level+1)*PET_XP_FACTOR);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(level+1)*PET_XP_FACTOR);
|
||||
|
||||
// Make sure we're working with the upgraded levels for the pet XP-levels
|
||||
level = getLevel();
|
||||
@@ -772,7 +772,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
|
||||
if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
|
||||
SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);
|
||||
else
|
||||
SetName(creature->GetNameForLocaleIdx(objmgr.GetDBCLocaleIndex()));
|
||||
SetName(creature->GetNameForLocaleIdx(sObjectMgr.GetDBCLocaleIndex()));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -793,8 +793,8 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureInfo const* cinfo, Unit * owner)
|
||||
bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseMask)
|
||||
{
|
||||
sLog.outDebug("Pet::CreateBaseForTamed");
|
||||
uint32 guid=objmgr.GenerateLowGuid(HIGHGUID_PET);
|
||||
uint32 pet_number = objmgr.GeneratePetNumber();
|
||||
uint32 guid=sObjectMgr.GenerateLowGuid(HIGHGUID_PET);
|
||||
uint32 pet_number = sObjectMgr.GeneratePetNumber();
|
||||
if (!Create(guid, map, phaseMask, cinfo->Entry, pet_number))
|
||||
return false;
|
||||
|
||||
@@ -803,7 +803,7 @@ bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseM
|
||||
setPowerType(POWER_FOCUS);
|
||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(getLevel()+1)*PET_XP_FACTOR);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(getLevel()+1)*PET_XP_FACTOR);
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
|
||||
if (cinfo->type == CREATURE_TYPE_BEAST)
|
||||
@@ -883,7 +883,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
SetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(createResistance[i]));
|
||||
|
||||
//health, mana, armor and resistance
|
||||
PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel);
|
||||
PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel);
|
||||
if (pInfo) // exist in DB
|
||||
{
|
||||
SetCreateHealth(pInfo->health);
|
||||
@@ -929,7 +929,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
}
|
||||
case HUNTER_PET:
|
||||
{
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(petlevel)*PET_XP_FACTOR);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(petlevel)*PET_XP_FACTOR);
|
||||
//these formula may not be correct; however, it is designed to be close to what it should be
|
||||
//this makes dps 0.5 of pets level
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
|
||||
@@ -1395,16 +1395,16 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (spellmgr.GetSpellRank(spell_id) != 0)
|
||||
else if (sSpellMgr.GetSpellRank(spell_id) != 0)
|
||||
{
|
||||
for (PetSpellMap::const_iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2)
|
||||
{
|
||||
if (itr2->second.state == PETSPELL_REMOVED) continue;
|
||||
|
||||
if (spellmgr.IsRankSpellDueToSpell(spellInfo,itr2->first))
|
||||
if (sSpellMgr.IsRankSpellDueToSpell(spellInfo,itr2->first))
|
||||
{
|
||||
// replace by new high rank
|
||||
if (spellmgr.IsHighRankOfSpell(spell_id,itr2->first))
|
||||
if (sSpellMgr.IsHighRankOfSpell(spell_id,itr2->first))
|
||||
{
|
||||
newspell.active = itr2->second.active;
|
||||
|
||||
@@ -1416,7 +1416,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
|
||||
break;
|
||||
}
|
||||
// ignore new lesser rank
|
||||
else if (spellmgr.IsHighRankOfSpell(itr2->first,spell_id))
|
||||
else if (sSpellMgr.IsHighRankOfSpell(itr2->first,spell_id))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1464,7 +1464,7 @@ void Pet::InitLevelupSpellsForLevel()
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
|
||||
if (PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? spellmgr.GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
|
||||
if (PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? sSpellMgr.GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
|
||||
{
|
||||
// PetLevelupSpellSet ordered by levels, process in reversed order
|
||||
for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
|
||||
@@ -1481,7 +1481,7 @@ void Pet::InitLevelupSpellsForLevel()
|
||||
int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry();
|
||||
|
||||
// default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game)
|
||||
if (PetDefaultSpellsEntry const *defSpells = spellmgr.GetPetDefaultSpellsEntry(petSpellsId))
|
||||
if (PetDefaultSpellsEntry const *defSpells = sSpellMgr.GetPetDefaultSpellsEntry(petSpellsId))
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CREATURE_SPELL_DATA_SLOT; ++i)
|
||||
{
|
||||
@@ -1544,7 +1544,7 @@ bool Pet::removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
|
||||
|
||||
if (learn_prev)
|
||||
{
|
||||
if (uint32 prev_id = spellmgr.GetPrevSpellInChain (spell_id))
|
||||
if (uint32 prev_id = sSpellMgr.GetPrevSpellInChain (spell_id))
|
||||
learnSpell(prev_id);
|
||||
else
|
||||
learn_prev = false;
|
||||
@@ -1657,10 +1657,10 @@ bool Pet::resetTalents(bool no_cost)
|
||||
continue;
|
||||
}
|
||||
// remove learned spells (all ranks)
|
||||
uint32 itrFirstId = spellmgr.GetFirstSpellInChain(itr->first);
|
||||
uint32 itrFirstId = sSpellMgr.GetFirstSpellInChain(itr->first);
|
||||
|
||||
// unlearn if first rank is talent or learned by talent
|
||||
if (itrFirstId == talentInfo->RankID[j] || spellmgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
|
||||
if (itrFirstId == talentInfo->RankID[j] || sSpellMgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
|
||||
{
|
||||
unlearnSpell(itr->first,false);
|
||||
itr = m_spells.begin();
|
||||
@@ -1979,7 +1979,7 @@ void Pet::learnSpellHighRank(uint32 spellid)
|
||||
{
|
||||
learnSpell(spellid);
|
||||
|
||||
if (uint32 next = spellmgr.GetNextSpellInChain(spellid))
|
||||
if (uint32 next = sSpellMgr.GetNextSpellInChain(spellid))
|
||||
learnSpellHighRank(next);
|
||||
}
|
||||
|
||||
@@ -2000,13 +2000,13 @@ void Pet::SynchronizeLevelWithOwner()
|
||||
if (getLevel() > owner->getLevel())
|
||||
{
|
||||
GivePetLevel(owner->getLevel());
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel())/5);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(owner->getLevel())/5);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
}
|
||||
if (getLevel() < owner->getLevel()-5)
|
||||
{
|
||||
GivePetLevel(owner->getLevel()-5);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(owner->getLevel()-5)/5);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(owner->getLevel()-5)/5);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user