Thread: WOD/Pre-patch
View Single Post
12-08-14, 06:06 AM   #678
atl77
A Chromatic Dragonspawn
Join Date: Oct 2014
Posts: 179
Originally Posted by ircdirk View Post
I got all data from wowhead allready, only need this algoritm...
I'll try to find a better algorythm, until then you can use this one (JS, v8, node.js or io.js), outputs lua array:

Code:
// coords/zoneid are from wowhead
var coords = [[61.8,75.8],[62.2,78],[62.4,77.2],[62.8,76.2],[62.8,76.6],[63,78.6],[63.2,78],[63.6,76.4],[63.6,76.6],[63.6,77.6],[64.2,79.4],[64.4,79.6],[64.6,80.4],[64.8,78],[65,79]],
	zoneid = 5785;

function coords2lua(coords, zoneid) {
	var boxes = []; 
        for (var i = 0; i < coords.length; i++) {
	        boxes.push('"nil|' + zoneid + '|35|' + (coords[i][0] - 0.5).toFixed(1) + '|' + (coords[i][1] - 0.5).toFixed(1) + '|1|1"');
        }
        return '{\n' + boxes.join(',\n') + '\n}'
}

coords2lua(coords, zoneid)
It will currently only copy the dots instead of creating filled areas, but that's all I have at the moment that works as intended. It may be a good starting point.

Last edited by atl77 : 12-08-14 at 06:10 AM.