diff --git a/src/game/Group.cpp b/src/game/Group.cpp index c57289482a8..336e2fd6ed4 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -1284,6 +1284,9 @@ static void RewardGroupAtKill_helper(Player* pGroupGuy, Unit* pVictim, uint32 co pGroupGuy->GiveXP(itr_xp, pVictim); if (Pet* pet = pGroupGuy->GetPet()) + // TODO: Pets need to get exp based on their level diff to the target, not the owners. + // the whole RewardGroupAtKill needs a rewrite to match up with this anyways: + // http://wowwiki.wikia.com/wiki/Formulas:Mob_XP?oldid=228414 pet->GivePetXP(itr_xp / 2); } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b6234da5f8e..e3069b6761e 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2509,11 +2509,13 @@ void Player::GiveLevel(uint32 level) if (level == getLevel()) return; + uint32 plClass = getClass(); + PlayerLevelInfo info; - sObjectMgr.GetPlayerLevelInfo(getRace(), getClass(), level, &info); + sObjectMgr.GetPlayerLevelInfo(getRace(), plClass, level, &info); PlayerClassLevelInfo classInfo; - sObjectMgr.GetPlayerClassLevelInfo(getClass(), level, &classInfo); + sObjectMgr.GetPlayerClassLevelInfo(plClass, level, &classInfo); // send levelup info to client WorldPacket data(SMSG_LEVELUP_INFO, (4 + 4 + MAX_POWERS * 4 + MAX_STATS * 4)); @@ -2564,8 +2566,6 @@ void Player::GiveLevel(uint32 level) SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE)); - SetPower(POWER_FOCUS, 0); - SetPower(POWER_HAPPINESS, 0); _ApplyAllLevelScaleItemMods(true); @@ -2625,13 +2625,16 @@ void Player::InitStatsForLevel(bool reapplyMods) _RemoveAllStatBonuses(); PlayerClassLevelInfo classInfo; - sObjectMgr.GetPlayerClassLevelInfo(getClass(), getLevel(), &classInfo); + + uint32 level = getLevel(); + uint32 plClass = getClass(); + sObjectMgr.GetPlayerClassLevelInfo(plClass, level, &classInfo); PlayerLevelInfo info; - sObjectMgr.GetPlayerLevelInfo(getRace(), getClass(), getLevel(), &info); + sObjectMgr.GetPlayerLevelInfo(getRace(), plClass, level, &info); SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)); - SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr.GetXPForLevel(getLevel())); + SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr.GetXPForLevel(level)); // reset before any aura state sources (health set/aura apply) SetUInt32Value(UNIT_FIELD_AURASTATE, 0); @@ -2768,8 +2771,6 @@ void Player::InitStatsForLevel(bool reapplyMods) SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE)); - SetPower(POWER_FOCUS, 0); - SetPower(POWER_HAPPINESS, 0); SetPower(POWER_RUNIC_POWER, 0); // update level to hunter/summon pet @@ -18092,7 +18093,7 @@ void Player::PetSpellInitialize() uint8 addlist = 0; data << uint8(addlist); // placeholder - if (pet->IsPermanentPetFor(this)) + if (pet->isControlled()) { // spells loop for (PetSpellMap::const_iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)