using System.Collections.Generic;
using System.Text.RegularExpressions;
public List<Actor> Actors;
public List<string> Lines;
public double[] GetPointInBand(double x, double y, int minRadius, int maxRadius)
var coords = new double[2];
var angle = new Random().Next() * Math.PI * 2;
var radius = Math.Sqrt(new Random().Next()) * (maxRadius - minRadius) + minRadius;
var x2 = radius * Math.Cos(angle);
var y2 = radius * Math.Sin(angle);
public void GetMonsters()
Actors = new List<Actor>();
Lines = new List<string>();
Lines.Add("coords = new OpenLayers.LonLat(1925, -1525);");
Lines.Add("popupContentHTML = '<div class=\"popups\"><table class=\"popups\"><tr><th colspan=2>Chigoe</th></tr><tr><td class=\"img\"><img src=\"../images/maps/chigoe.png\"></td><td><p class=\"aggro\"><img src=\"../images/maps/1.png\"></p><p>Level: 4-5</p><p>Amount: 10-12</p><p>Coords: 38,30<br>(Lower elevation)");
foreach (var line in Lines)
if (line.StartsWith("popupContentHTML"))
var idx = Lines.IndexOf(line);
var coords = Regex.Matches(Lines[idx - 1], @".+\((\-?\d+).\s(\-?\d+)\)");
var x = Math.Abs(int.Parse(coords[0].Groups[1].Value)) << 1;
var y = Math.Abs(int.Parse(coords[0].Groups[2].Value)) << 1;
var info = Regex.Matches(Lines[idx], @".+<th colspan=\d+>(.+)<\/th>.+Level:\s+(\d*).?(\d*).+Amount:\s+(\d*).?(\d*).+");
var X2 = ((x / mapScale) - mapOffsetX);
var Y2 = ((y / mapScale) - mapOffsetY);
Console.WriteLine(info[0].Groups[1].Value);
Console.WriteLine(info[0].Groups[2].Value);
Console.WriteLine(info[0].Groups[3].Value);
Console.WriteLine(info[0].Groups[4].Value);
Console.WriteLine(info[0].Groups[5].Value);
for (var i = 0; i < int.Parse(info[0].Groups[5].Value); i++)
var ret = GetPointInBand(actor.X, actor.Y, 10, 20);
Console.WriteLine("X: " + ret[0] + " Y: " + ret[1]);
Console.WriteLine("2D X: " + x);
Console.WriteLine("2D Y: " + y);
Console.WriteLine("3D X: " + actor.X);
Console.WriteLine("3D Y: " + actor.Y);
public string Name { get; set; }
public int X { get; set; }
public int Y { get; set; }
public byte MinimumLevel { get; set; }
public byte MaximumLevel { get; set; }
public byte MinimumCount { get; set; }
public byte MaximumCount { get; set; }