Core/BattlePets: Move revive battle pet cooldown to spell script and add serverside spell for stable master heal cooldown

Port From (https://github.com/TrinityCore/TrinityCore/commit/05f2f4e8f69133d542f3eadf99410deb932cd30d)
This commit is contained in:
hondacrx
2022-10-14 17:00:30 -04:00
parent 4f89dad639
commit 219833ac17
4 changed files with 40 additions and 22 deletions
@@ -1014,25 +1014,6 @@ namespace Game.Entities
m_lastPotionId = 0;
}
public void UpdateReviveBattlePetCooldown()
{
SpellInfo reviveBattlePetSpellInfo = Global.SpellMgr.GetSpellInfo(SharedConst.SpellReviveBattlePets, Difficulty.None);
if (reviveBattlePetSpellInfo != null && HasSpell(SharedConst.SpellReviveBattlePets))
{
var remainingCooldown = GetSpellHistory().GetRemainingCategoryCooldown(reviveBattlePetSpellInfo);
if (remainingCooldown > TimeSpan.Zero)
{
if (remainingCooldown < SharedConst.ReviveBattlePetsCooldown)
GetSpellHistory().ModifyCooldown(reviveBattlePetSpellInfo, SharedConst.ReviveBattlePetsCooldown - remainingCooldown);
}
else
{
GetSpellHistory().StartCooldown(reviveBattlePetSpellInfo, 0, null, false, SharedConst.ReviveBattlePetsCooldown);
}
}
}
public bool CanUseMastery()
{
ChrSpecializationRecord chrSpec = CliDB.ChrSpecializationStorage.LookupByKey(GetPrimarySpecialization());
-2
View File
@@ -854,8 +854,6 @@ namespace Game
pCurrChar.SendInitialPacketsAfterAddToMap();
pCurrChar.UpdateReviveBattlePetCooldown();
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_ONLINE);
stmt.AddValue(0, pCurrChar.GetGUID().GetCounter());
DB.Characters.Execute(stmt);