Core/Pets: Implemented pet specializations (#17058)

* Use prepared statements in Pet::SavePetToDB
* Add support for resetting all of a player's pet specializations
* Send one big spell unlearn/learn packet instead of lots of small ones
* Implemented Adaptation talent
This commit is contained in:
myran2
2016-04-29 11:49:07 -04:00
committed by Shauren
parent 6c71c8694f
commit bc1a81747a
16 changed files with 292 additions and 257 deletions

View File

@@ -1077,7 +1077,17 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
// reset for all pets before pet loading
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
Pet::resetTalentsForAllPetsOf(pCurrChar);
{
// Delete all of the player's pet spells
PreparedStatement* stmtSpells = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_PET_SPELLS_BY_OWNER);
stmtSpells->setUInt64(0, pCurrChar->GetGUID().GetCounter());
CharacterDatabase.Execute(stmtSpells);
// Then reset all of the player's pet specualizations
PreparedStatement* stmtSpec = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_PET_SPELLS_BY_OWNER);
stmtSpec->setUInt64(0, pCurrChar->GetGUID().GetCounter());
CharacterDatabase.Execute(stmtSpec);
}
// Load pet if any (if player not alive and in taxi flight or another then pet will remember as temporary unsummoned)
pCurrChar->LoadPet();