mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 13:22:48 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user