internal Fight GetFight(string name, double currentTime) { Fight result = null; if (!string.IsNullOrEmpty(name)) { if (char.IsUpper(name[0])) { if (!ActiveFights.TryGetValue(name, out result)) { ActiveFights.TryGetValue(Helpers.ToLower(name), out result); } } else { if (!ActiveFights.TryGetValue(name, out result)) { ActiveFights.TryGetValue(Helpers.ToUpper(name), out result); } } } // assume npc has been killed and create new entry if (result != null && (currentTime - result.LastTime) > FIGHT_TIMEOUT) { RemoveActiveFight(result.CorrectMapKey); result = null; } return(result); }
internal bool IsLifetimeNpc(string name) { bool result = false; if (!string.IsNullOrEmpty(name)) { if (char.IsUpper(name[0])) { result = LifetimeFights.ContainsKey(name) || LifetimeFights.ContainsKey(Helpers.ToLower(name)); } else { result = LifetimeFights.ContainsKey(name) || LifetimeFights.ContainsKey(Helpers.ToUpper(name)); } } return(result); }