public static bool ReloadPetModifiers(Player plr, ref List <string> values) { lock (Player._Players) { foreach (Player player in Player._Players) { player.SendClientMessage("[System] Recaching pet tables...", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE); } } CharMgr.ReloadPetModifiers(); lock (Player._Players) { foreach (Player player in Player._Players) { player.SendClientMessage("[System] Pet tables successfully recached.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE); if (player != null && player.CrrInterface != null) { if (player.CrrInterface.GetTargetOfInterest() != null && player.CrrInterface.GetTargetOfInterest() is Pet) { Pet myPet = (Pet)player.CrrInterface.GetTargetOfInterest(); if (myPet != null) { myPet.Dismiss(null, null); player.SendClientMessage("[System] Pet tables were recached. Your pet has been dismissed.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE); } } } } } return(true); }
public static void DisablePetModifiers(Player plr, string targetString = null) { int Disabled; if (targetString != null && Int32.TryParse(targetString, out Disabled)) { WorldMgr.WorldSettingsMgr.SetGenericSetting(19, Disabled); plr.SendClientMessage("Set Pet Modifier System flag Successfully: " + Disabled, ChatLogFilters.CHATLOGFILTERS_TELL_RECEIVE); lock (Player._Players) { foreach (Player player in Player._Players) { player.SendClientMessage("[System] Recaching pet tables...", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE); } } CharMgr.ReloadPetModifiers(); lock (Player._Players) { foreach (Player player in Player._Players) { player.SendClientMessage("[System] Pet tables successfully recached.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE); if (player != null && player.CrrInterface != null) { if (player.CrrInterface.GetTargetOfInterest() != null && player.CrrInterface.GetTargetOfInterest() is Pet) { Pet myPet = (Pet)player.CrrInterface.GetTargetOfInterest(); if (myPet != null) { myPet.Dismiss(null, null); player.SendClientMessage("[System] Pet tables were recached. Your pet has been dismissed.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE); } } } } } } else { plr.SendClientMessage("Disable Pet Mastery System flag is set to: " + WorldMgr.WorldSettingsMgr.GetGenericSetting(19), ChatLogFilters.CHATLOGFILTERS_TELL_RECEIVE); } }