internal static void Add(Mob mb) { MappedMob mm = new MappedMob(mb.Name, mb.Id, mb.Room.Id, mb.Level, mb.Rage); if (!mMobs.Contains(mm) && !mSubmitted.Contains(mm)) { mMobs.Add(mm); } }
private static void AttackMob(Mob mb) { mb.Attack(false); }
internal void EnumMobs(string src) { // TODO this should really just throw an exception if (string.IsNullOrEmpty(src)) { Load(); } Mobs = new List <Mob>(); foreach (string s in Parser.MultiParse(src, "images//", "spacer.gif")) { Parser p = new Parser(s); string url = "mob.php?" + p.Parse("mob.php?", "\""); string name; string attackurl = string.Empty; bool trainer = false; bool quest = false; bool spawn = false; if (s.Contains("Spawned by")) { name = string.Format("*{0}*", p.Parse("\">*", " [")); if (name.Contains("<")) { // TODO this is a bandaid fix re: a bug with the parser. It will pick up html from killed spawn mobs continue; } spawn = true; // log spawn sighting, but don't attack it if we shouldn't if (Globals.AttackOn) { CoreUI.Instance.SpawnsPanel.Log(string.Format("{0} sighted {1} in room {2}", Mover.Account.Name, name, Id)); CoreUI.Instance.SpawnsPanel.Sighted(Id); if (!CoreUI.Instance.Settings.AttackSpawns) { continue; } } } else { name = Parser.Parse(Parser.CutLeading(s, url + "\">"), "\">", " ["); } if (s.Contains("newattack.php")) { attackurl = "newattack.php" + p.Parse("newattack.php", "\""); } else { continue; } if (s.Contains("talk_icon.jpg")) { quest = true; } if (s.Contains("dc_trainer.gif")) { trainer = true; } /* * if (string.IsNullOrEmpty(attackurl) && !quest && !trainer) * { * continue; * }*/ Mob mb = new Mob(name, url, attackurl, quest, trainer, spawn, this); Mobs.Add(mb); } }
internal void EnumMobs(string src) { // TODO this should really just throw an exception if (string.IsNullOrEmpty(src)) { Load(); } Mobs = new List<Mob>(); //foreach (string s in Parser.MultiParse(src, "<table ", "</table>")) foreach(string s in src.Split(new string[] { "<table "}, StringSplitOptions.RemoveEmptyEntries)) { Parser p = new Parser(s); string url = "mob.php?" + p.Parse("mob.php?", "\""); string name; string attackurl = string.Empty; bool trainer = false; bool quest = false; bool spawn = false; if (s.Contains("Spawned by")) { name = string.Format("*{0}*", p.Parse("\">*", " [")); if (name.Contains("<")) { // TODO this is a bandaid fix re: a bug with the parser. It will pick up html from killed spawn mobs continue; } spawn = true; // log spawn sighting, but don't attack it if we shouldn't if (Globals.AttackOn) { CoreUI.Instance.SpawnsPanel.Log(string.Format("{0} sighted {1} in room {2}", Mover.Account.Name, name, Id)); CoreUI.Instance.SpawnsPanel.Sighted(Id); if (!CoreUI.Instance.Settings.AttackSpawns) continue; } } else { //name = Parser.Parse(Parser.CutLeading(s, url + "\">"), "\">", " ["); name = Parser.Parse(s, "><b>", "</b>"); // "'<b>Spawned By:</b>" occurs, use ><b> for starting } if (s.Contains("somethingelse.php")) { attackurl = "somethingelse.php" + p.Parse("somethingelse.php", "\""); } else { continue; } if (s.Contains("talk_icon.jpg")) { quest = true; } if (s.Contains("dc_trainer.gif")) { trainer = true; } /* if (string.IsNullOrEmpty(attackurl) && !quest && !trainer) { continue; }*/ Mob mb = new Mob(name, url, attackurl, quest, trainer, spawn, this); Mobs.Add(mb); } }