hondacrx
2023-05-19 16:23:44 -04:00
parent 24b0836710
commit dfceb4c044
40 changed files with 1910 additions and 1549 deletions
+37
View File
@@ -5395,6 +5395,43 @@ namespace Game.Entities
GetSceneMgr().TriggerDelayedScenes();
}
public void AddSpellCategoryCooldownMod(int spellCategoryId, int mod)
{
int categoryIndex = m_activePlayerData.CategoryCooldownMods.FindIndexIf(mod => mod.SpellCategoryID == spellCategoryId);
if (categoryIndex < 0)
{
CategoryCooldownMod newMod = new();
newMod.SpellCategoryID = spellCategoryId;
newMod.ModCooldown = -mod;
AddDynamicUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.CategoryCooldownMods), newMod);
}
else
{
CategoryCooldownMod g = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.CategoryCooldownMods, categoryIndex);
SetUpdateFieldValue(ref g.ModCooldown, m_activePlayerData.CategoryCooldownMods[categoryIndex].ModCooldown - mod);
}
}
public void RemoveSpellCategoryCooldownMod(int spellCategoryId, int mod)
{
int categoryIndex = m_activePlayerData.CategoryCooldownMods.FindIndexIf(mod => mod.SpellCategoryID == spellCategoryId);
if (categoryIndex < 0)
return;
if (m_activePlayerData.CategoryCooldownMods[categoryIndex].ModCooldown + mod == 0)
{
RemoveDynamicUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.CategoryCooldownMods), categoryIndex);
}
else
{
CategoryCooldownMod g = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.CategoryCooldownMods, categoryIndex);
SetUpdateFieldValue(ref g.ModCooldown, m_activePlayerData.CategoryCooldownMods[categoryIndex].ModCooldown + mod);
}
}
public void RemoveSocial()
{
SocialMgr.RemovePlayerSocial(GetGUID());