Frame 1
stop();
Instance of Symbol 28 MovieClip [preloaderShape_mc] in Frame 1
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int((loaded / total) * 100);
percen101 = ("" + percent) + "%";
gotoAndStop(percent);
if (loaded == total) {
_root.play();
}
}
Frame 2
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("35fdeb42", this, 10301, true);
mochi.MochiServices.connect("9b733987de1e8726");
Frame 3
gotoAndPlay (5);
Frame 5
stop();
Frame 10
MochiAd.showPreGameAd({id:"9b733987de1e8726", res:"640x480"});
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
var maxfire = 40;
var firecount = 0;
_global.LEVELS = 1;
_global.GOLD = 0;
_global.SCORE = 0;
_global.hp = 500;
_global.damage = 20;
_global.leveltime = 0;
Frame 15
this.attachMovie("maxgamesintro24fps", "maxgamesintro24fps", 1001);
maxgamesintro24fps._x = 45;
maxgamesintro24fps._y = 45;
gotoAndStop (20);
Instance of Symbol 128 MovieClip in Frame 15
on (release) {
mochi.MochiScores.showLeaderboard({boardID:"3d9c6d260393c235", onClose:function () {
_root.gotoAndStop(20);
}});
}
Frame 16
gotoAndStop (20);
Frame 20
if (Number(firecount) <= Number(maxfire)) {
duplicateMovieClip ("fire", "fire" + firecount, firecount + 10);
this["fire" + firecount]._x = 100 + (Math.random() * 20);
this["fire" + firecount]._y = 375;
firecount = Number(firecount) + 1;
}
if (Number(firecount) <= Number(maxfire)) {
duplicateMovieClip ("fire2", "fire2" + firecount, firecount + 10);
this["fire2" + firecount]._x = 100 + (Math.random() * 20);
this["fire2" + firecount]._y = 375;
firecount = Number(firecount) + 1;
}
Frame 25
gotoAndStop (20);
Frame 30
function buildMap(map) {
_root.attachMovie("empty", "tiles", 1);
game.halfvisx = int(game.visx / 2);
game.halfvisy = int(game.visy / 2);
game.clip = _root.tiles;
game.mapwidth = map[0].length;
game.mapheight = map.length;
if (game.halfvisx > char[0].xtile) {
var fixx = (char[0].xtile - game.halfvisx);
} else if (char[0].xtile > (game.mapwidth - game.halfvisx)) {
var fixx = (game.mapwidth - char[0].xtile);
}
if (game.halfvisy > char[0].ytile) {
var fixy = (char[0].ytile - game.halfvisy);
} else if (char[0].ytile > ((game.mapheight - game.halfvisy) - 1)) {
var fixy = ((game.mapheight - char[0].ytile) - 1);
}
game.clip._x = (game.centerx - ((char[0].xtile - fixx) * game.tileW)) - (game.tileW / 2);
game.clip._y = (game.centery - ((char[0].ytile - fixy) * game.tileH)) - (game.tileH / 2);
var y = 0;
while (y <= myMap1[0].length) {
var x = 0;
while (x <= myMap1.length) {
var name = ((("t_" + y) + "_") + x);
if ((((y >= 0) and (x >= 0)) and (y <= (map.length - 1))) and (x <= (map[0].length - 1))) {
game[name] = new game["Tile" + map[y][x]]();
} else {
game[name] = new game.Tile4();
}
x++;
}
y++;
}
var y = ((char[0].ytile - game.halfvisy) - fixy);
while (y <= (((char[0].ytile + game.halfvisy) + 1) - fixy)) {
var x = ((char[0].xtile - game.halfvisx) - fixx);
while (x <= (((char[0].xtile + game.halfvisx) + 1) - fixx)) {
var name = ((("t_" + y) + "_") + x);
if ((((y >= 0) and (x >= 0)) and (y <= (map.length - 1))) and (x <= (map[0].length - 1))) {
game[name] = new game["Tile" + map[y][x]]();
} else {
game[name] = new game.Tile4();
}
game.clip.attachMovie("tile", name, (100001 + (y * 100)) + (x * 2));
game.clip[name]._x = x * game.tileW;
game.clip[name]._y = y * game.tileH;
game.clip[name].gotoAndStop(game[name].frame);
x++;
}
y++;
}
var i = 0;
game.clip.attachMovie("herotop", "char" + i, 10000 + i);
game.clip.attachMovie("herobottom", "charlegs" + i, (10000 + i) - 1);
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "hero";
char[i].team = 1;
char[i].ranged = true;
char[i].mattack = _global.damage;
char[i].hpMax = _global.hp;
char[i].hpCurrent = _global.hp;
char[i].clip = game.clip["char" + i];
char[i].x = (char[i].xtile * game.tileW) + (game.tileW / 2);
char[i].y = (char[i].ytile * game.tileW) + (game.tileW / 2);
char[i].width = char[i].clip._width / 2;
char[i].height = char[i].clip._height / 2;
char[i].clip._x = char[i].x;
char[i].clip._y = char[i].y;
game.clip["charlegs" + i]._x = char[i].x;
game.clip["charlegs" + i]._y = char[i].y;
char[i].clip.gotoAndStop(char[i].frame);
game.clip["charlegs" + i].gotoAndStop(char[i].frame);
char[i].xstep = char[i].x;
char[i].ystep = char[i].y;
checkActivity();
game.clip.createEmptyMovieClip("square_mc", 0);
with (game.clip.square_mc) {
moveTo(-2000, -1000);
var earth = flash.display.BitmapData.loadBitmap(level[clevel].tile);
beginBitmapFill(earth);
lineTo(-2000, 5000);
lineTo(15000, 5000);
lineTo(15000, -1000);
lineTo(-2000, -1000);
endFill();
}
}
function changeTile(xold, yold, xnew, ynew, map) {
var _local4 = (("t_" + yold) + "_") + xold;
var _local1 = (("t_" + ynew) + "_") + xnew;
if ((((ynew >= 0) and (xnew >= 0)) and (ynew <= (map.length - 1))) and (xnew <= (map[0].length - 1))) {
game[_local1] = new game["Tile" + map[ynew][xnew]]();
game.clip[_local4]._name = _local1;
game.clip[_local1].gotoAndStop(game[_local1].frame);
game.clip[_local1]._x = xnew * game.tileW;
game.clip[_local1]._y = ynew * game.tileH;
} else {
game[_local1] = new game.Tile4();
game.clip[_local4]._name = _local1;
game.clip[_local1].gotoAndStop(game[_local1].frame);
}
}
function changeMap(ob) {
var _local3 = (("t_" + ob.ytile) + "_") + ob.xtile;
game.currentMap = game[_local3].newMap;
ob.ytile = game[_local3].newchary;
ob.xtile = game[_local3].newcharx;
ob.frame = ob.clip._currentframe;
buildMap(_root["myMap" + game.currentMap]);
}
function getMyCorners(x, y, ob) {
ob.downY = Math.floor(((y + ob.height) - 1) / game.tileH);
ob.upY = Math.floor((y - ob.height) / game.tileH);
ob.leftX = Math.floor((x - ob.width) / game.tileW);
ob.rightX = Math.floor(((x + ob.width) - 1) / game.tileW);
ob.ytile = Math.floor(y / game.tileH);
ob.xtile = Math.floor(x / game.tileW);
ob.upleft = game[(("t_" + ob.upY) + "_") + ob.leftX].walkable;
ob.downleft = game[(("t_" + ob.downY) + "_") + ob.leftX].walkable;
ob.upright = game[(("t_" + ob.upY) + "_") + ob.rightX].walkable;
ob.downright = game[(("t_" + ob.downY) + "_") + ob.rightX].walkable;
ob.down = game[(("t_" + ob.downY) + "_") + ob.xtile].walkable;
ob.up = game[(("t_" + ob.upY) + "_") + ob.xtile].walkable;
ob.right = game[(("t_" + ob.ytile) + "_") + ob.rightX].walkable;
ob.left = game[(("t_" + ob.ytile) + "_") + ob.leftX].walkable;
if (x > maxx) {
ob.right = false;
}
}
function moveChar(ob, dirx, diry) {
getMyCorners(ob.x, ob.y + (ob.speed * diry), ob);
if (diry == -1) {
if (ob.up) {
ob.y = ob.y + (ob.speed * diry);
}
} else if (diry == 1) {
if (ob.down) {
ob.y = ob.y + (ob.speed * diry);
}
}
if (dirx == -1) {
if (ob.left) {
ob.x = ob.x + (ob.speed * dirx);
}
} else if (dirx == 1) {
if (ob.right) {
ob.x = ob.x + (ob.speed * dirx);
}
}
if (ob.x < -10) {
ob.x = -10;
}
if (ob.y < 0) {
ob.y = 0;
}
if (ob.y > 480) {
ob.y = 480;
}
if (ob.x > maxx) {
ob.x = maxx;
}
ob.clip._x = ob.x;
ob.clip._y = ob.y;
game.clip.char0._x = ob.x;
game.clip.char0._y = ob.y;
game.clip.charlegs0._x = ob.x;
game.clip.charlegs0._y = ob.y;
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileH);
if (char[0].xtile > (myMap1[0].length - 2)) {
checkvictory();
}
if (game[(("t_" + ob.ytile) + "_") + ob.xtile].door and (ob == _root.char[0])) {
changeMap(ob);
}
if (ob.x < (maxx - (game.halfvisx * game.tileW))) {
if (ob.x > ((game.halfvisx * game.tileW) + (game.tileW / 2))) {
if (ob.x < (((game.mapwidth - game.halfvisx) * game.tileW) - (game.tileW / 2))) {
game.clip._x = game.centerx - ob.x;
if (ob.xstep < (ob.x - game.tileW)) {
var _local11 = Math.floor(ob.xstep / game.tileW) + 1;
var _local8 = (_local11 + game.halfvisx) + 1;
var _local6 = (_local11 - game.halfvisx) - 1;
var _local4 = Math.round(((game.centery - ob.y) - game.clip._y) / game.tileH);
var _local3 = ((ob.ytile - game.halfvisy) - 1) + _local4;
while (_local3 <= (((ob.ytile + game.halfvisy) + 1) + _local4)) {
changeTile(_local6, _local3, _local8, _local3, _root["myMap" + game.currentMap]);
_local3++;
}
ob.xstep = ob.xstep + game.tileW;
} else if (ob.xstep > ob.x) {
var _local11 = Math.floor(ob.xstep / game.tileW);
var _local6 = (_local11 + game.halfvisx) + 1;
var _local8 = (_local11 - game.halfvisx) - 1;
var _local4 = Math.round(((game.centery - ob.y) - game.clip._y) / game.tileH);
var _local3 = ((ob.ytile - game.halfvisy) - 1) + _local4;
while (_local3 <= (((ob.ytile + game.halfvisy) + 1) + _local4)) {
changeTile(_local6, _local3, _local8, _local3, _root["myMap" + game.currentMap]);
_local3++;
}
ob.xstep = ob.xstep - game.tileW;
}
}
}
} else {
updateMaxx();
}
if (ob.y > ((game.halfvisy * game.tileH) + (game.tileH / 2))) {
if (ob.y < (((game.mapheight - game.halfvisy) * game.tileH) - (game.tileH / 2))) {
game.clip._y = game.centery - ob.y;
if (ob.ystep < (ob.y - game.tileH)) {
var _local12 = Math.floor(ob.ystep / game.tileH) + 1;
var _local9 = (_local12 + game.halfvisy) + 1;
var _local7 = (_local12 - game.halfvisy) - 1;
var _local5 = Math.round(((game.centerx - ob.x) - game.clip._x) / game.tileW);
var _local3 = ((ob.xtile - game.halfvisx) - 1) + _local5;
while (_local3 <= (((ob.xtile + game.halfvisx) + 1) + _local5)) {
changeTile(_local3, _local7, _local3, _local9, _root["myMap" + game.currentMap]);
_local3++;
}
ob.ystep = ob.ystep + game.tileH;
} else if (ob.ystep > ob.y) {
var _local12 = Math.floor(ob.ystep / game.tileH);
var _local7 = (_local12 + game.halfvisy) + 1;
var _local9 = (_local12 - game.halfvisy) - 1;
var _local5 = Math.round(((game.centerx - ob.x) - game.clip._x) / game.tileW);
var _local3 = ((ob.xtile - game.halfvisx) - 1) + _local5;
while (_local3 <= (((ob.xtile + game.halfvisx) + 1) + _local5)) {
changeTile(_local3, _local7, _local3, _local9, _root["myMap" + game.currentMap]);
_local3++;
}
ob.ystep = ob.ystep - game.tileH;
}
}
}
collectitems();
return(true);
}
function moveAI(ob, cp) {
if ((char[cp].shooting <= 0) or (char[cp].die > 0)) {
if (!char[cp].ranged) {
var _local2 = 0;
while (_local2 < (level[clevel].count + 1)) {
if (char[_local2].team != char[cp].team) {
if ((char[_local2].die == 0) and (char[_local2].active == true)) {
if (getDist(game.clip["char" + _local2]._x, game.clip["char" + _local2]._y, game.clip["char" + cp]._x, game.clip["char" + cp]._y) < 50) {
char[cp].melee = true;
}
}
}
_local2++;
}
}
var _local5 = cp;
if ((((ob.x - (game.tileW / 2)) % game.tileW) == 0) and (((ob.y - (game.tileW / 2)) % game.tileW) == 0)) {
if ((Math.random() * 100) > 25) {
if (((((char[cp].race == "rogue") or (char[cp].race == "fwizard")) or (char[cp].race == "goblinarcher")) or (char[cp].race == "troll")) or (char[cp].race == "wizard")) {
char[cp].cweapon = "rweapon";
var _local2 = 0;
while (_local2 < (level[clevel].count + 1)) {
if ((char[_local2].die == 0) and (char[_local2].active == true)) {
if (char[_local2].team != char[cp].team) {
if (getDist(game.clip["char" + _local2]._x, game.clip["char" + _local2]._y, game.clip["char" + cp]._x, game.clip["char" + cp]._y) < 350) {
char[cp].shooting = 15;
char[cp].starget = _local2;
fire(cp, game.clip["char" + _local2]._x, game.clip["char" + _local2]._y);
char[cp].path.length = 0;
char[cp].moving = false;
return(undefined);
}
}
}
_local2++;
}
}
}
ob.xtile = Math.floor(ob.x / game.tileW);
ob.ytile = Math.floor(ob.y / game.tileH);
char[cp].xtile = ob.xtile;
char[cp].ytile = ob.ytile;
ob.moveCount = ob.moveCount + 1;
if (char[cp].path.length > 0) {
game.targety = char[cp].path.pop();
game.targetx = char[cp].path.pop();
if ((game[(("t_" + (ob.ytile + 1)) + "_") + (ob.xtile + 1)].walkable and (game.targety > ob.ytile)) and (game.targetx > ob.xtile)) {
ob.dirx = 1;
ob.diry = 1;
game.clip["char" + cp]._rotation = 135;
} else if ((game[(("t_" + (ob.ytile + 1)) + "_") + (ob.xtile - 1)].walkable and (game.targety > ob.ytile)) and (game.targetx < ob.xtile)) {
ob.dirx = -1;
ob.diry = 1;
game.clip["char" + cp]._rotation = 225;
} else if ((game[(("t_" + (ob.ytile - 1)) + "_") + (ob.xtile + 1)].walkable and (game.targety < ob.ytile)) and (game.targetx > ob.xtile)) {
ob.dirx = 1;
ob.diry = -1;
game.clip["char" + cp]._rotation = 45;
} else if ((game[(("t_" + (ob.ytile - 1)) + "_") + (ob.xtile - 1)].walkable and (game.targety < ob.ytile)) and (game.targetx < ob.xtile)) {
ob.dirx = -1;
ob.diry = -1;
game.clip["char" + cp]._rotation = 315;
} else if (game[(("t_" + ob.ytile) + "_") + (ob.xtile + 1)].walkable and (game.targetx > ob.xtile)) {
ob.dirx = 1;
ob.diry = 0;
game.clip["char" + cp]._rotation = 90;
} else if (game[(("t_" + ob.ytile) + "_") + (ob.xtile - 1)].walkable and (game.targetx < ob.xtile)) {
ob.dirx = -1;
ob.diry = 0;
game.clip["char" + cp]._rotation = 270;
} else if (game[(("t_" + (ob.ytile + 1)) + "_") + ob.xtile].walkable and (game.targety > ob.ytile)) {
ob.dirx = 0;
ob.diry = 1;
game.clip["char" + cp]._rotation = 180;
} else if (game[(("t_" + (ob.ytile - 1)) + "_") + ob.xtile].walkable and (game.targety < ob.ytile)) {
ob.dirx = 0;
ob.diry = -1;
game.clip["char" + cp]._rotation = 0;
} else {
char[cp].moving = false;
return(undefined);
}
if (char[cp].moving == true) {
var _local4 = game.clip["char" + cp].frame;
}
} else {
char[cp].moving = false;
}
if ((game.targety == ob.targety) and (game.targetx == ob.targetx)) {
char[cp].moving = false;
} else if (game[(("t_" + game.targety) + "_") + game.targety].walkable == false) {
char[cp].moving = false;
}
}
ob.y = ob.y + (ob.speed * ob.diry);
ob.x = ob.x + (ob.speed * ob.dirx);
game.clip["char" + cp]._x = ob.x;
game.clip["char" + cp]._y = ob.y;
}
}
function meleeAI(cp) {
if (char[cp].mcount == 0) {
var _local2 = 0;
while (_local2 < (level[clevel].count + 1)) {
if (char[_local2].team != char[cp].team) {
if ((char[_local2].die == 0) and (char[_local2].active == true)) {
if (getDist(game.clip["char" + _local2]._x, game.clip["char" + _local2]._y, game.clip["char" + cp]._x, game.clip["char" + cp]._y) < 50) {
char[cp].mcount = 10;
char[cp].mtarget = _local2;
var _local3 = Math.round(Math.random() * 100);
if (char[cp].race == "hero") {
} else if (_local3 < char[cp].a1) {
game.clip["char" + cp].gotoAndPlay(31);
} else if (_local3 < char[cp].a2) {
game.clip["char" + cp].gotoAndPlay(61);
} else if (_local3 < char[cp].a3) {
game.clip["char" + cp].gotoAndPlay(91);
} else if (_local3 < char[cp].a4) {
game.clip["char" + cp].gotoAndPlay(121);
}
game.clip["char" + cp]._rotation = 90 + getAngle(game.clip["char" + cp]._x, game.clip["char" + cp]._y, game.clip["char" + _local2]._x, game.clip["char" + _local2]._y);
}
}
}
_local2++;
}
if (char[cp].mcount == 0) {
char[cp].melee = false;
}
} else {
char[cp].mcount--;
if (char[cp].mcount == 5) {
char[char[cp].mtarget].hpCurrent = char[char[cp].mtarget].hpCurrent - Math.round(Math.random() * char[cp].mattack);
Whoosh.start();
testDeath(char[cp].mtarget);
}
}
}
function getTarget(targetx, targety, cp) {
if (game[(("t_" + targety) + "_") + targetx].walkable) {
if (!char[cp].moving) {
findPath(char[cp].xtile, char[cp].ytile, targetx, targety, cp);
}
}
}
function addNode(ob, x, y, targetx, targety) {
path.name = (("node_" + y) + "_") + x;
if (game[(("t_" + y) + "_") + x].walkable) {
var _local2 = Math.abs(x - targetx) + Math.abs(y - targety);
if ((path[path.name].cost > _local2) or (path[path.name].cost == undefined)) {
path[path.name] = {x:x, y:y, visited:false, parentx:ob.x, parenty:ob.y, cost:_local2};
var _local1 = 0;
while (_local1 < path.Unchecked_Neighbours.length) {
if (_local2 < path.Unchecked_Neighbours[_local1].cost) {
path.Unchecked_Neighbours.splice(_local1, 0, path[path.name]);
break;
}
_local1++;
}
if (_local1 >= path.Unchecked_Neighbours.length) {
path.Unchecked_Neighbours[path.Unchecked_Neighbours.length] = path[path.name];
}
}
}
}
function make_path(ob, cp) {
char[cp].path = [];
while (ob.parentx != null) {
char[cp].path[char[cp].path.length] = ob.x;
char[cp].path[char[cp].path.length] = ob.y;
game.clip[(("t_" + ob.y) + "_") + ob.x].mark.gotoAndStop(2);
ob = path[(("node_" + ob.parenty) + "_") + ob.parentx];
}
char[cp].moving = true;
sound.gotoAndPlay(2);
_root.pathtime = (getTimer() - game.pathTime) + " ms";
}
function findPath(startx, starty, targetx, targety, cp) {
path = {};
path.Unchecked_Neighbours = [];
path.done = false;
path.name = (("node_" + starty) + "_") + startx;
var _local7 = Math.abs(startx - targetx) + Math.abs(starty - targety);
path[path.name] = {x:startx, y:starty, visited:true, parentx:null, parenty:null, cost:_local7};
path.Unchecked_Neighbours[path.Unchecked_Neighbours.length] = path[path.name];
while (path.Unchecked_Neighbours.length > 0) {
var _local1 = path.Unchecked_Neighbours.shift();
if ((_local1.x == targetx) and (_local1.y == targety)) {
make_path(_local1, cp);
path.done = true;
break;
}
_local1.visited = true;
addNode(_local1, _local1.x + 1, _local1.y + 1, targetx, targety);
addNode(_local1, _local1.x - 1, _local1.y + 1, targetx, targety);
addNode(_local1, _local1.x + 1, _local1.y - 1, targetx, targety);
addNode(_local1, _local1.x - 1, _local1.y - 1, targetx, targety);
addNode(_local1, _local1.x + 1, _local1.y, targetx, targety);
addNode(_local1, _local1.x - 1, _local1.y, targetx, targety);
addNode(_local1, _local1.x, _local1.y + 1, targetx, targety);
addNode(_local1, _local1.x, _local1.y - 1, targetx, targety);
}
if (path.done) {
return(true);
}
delete path;
}
function getDist(px1, py1, px2, py2) {
x = px2 - px1;
y = py2 - py1;
hyp = Math.sqrt((x * x) + (y * y));
return(hyp);
}
function getAngle(px1, py1, px2, py2) {
x = px2 - px1;
y = py2 - py1;
hyp = Math.sqrt((x * x) + (y * y));
cos = x / hyp;
rad = Math.acos(cos);
deg = 180 / (Math.PI / rad);
if (y < 0) {
deg = -deg;
} else if ((y == 0) && (x < 0)) {
deg = 180;
}
return(deg);
}
function detectKeys() {
var _local5 = _root.char[0];
var _local6 = false;
pressingKey = false;
game.clip.char0.play();
game.clip.charlegs0.play();
if (Key.isDown(39) or Key.isDown(67)) {
if (Key.isDown(38) or Key.isDown(83)) {
_local6 = _root.moveChar(_local5, 1, -1);
game.clip.char0._rotation = 45;
game.clip.charlegs0._rotation = 45;
} else if (Key.isDown(40) or Key.isDown(88)) {
_local6 = _root.moveChar(_local5, 1, 1);
game.clip.char0._rotation = 135;
game.clip.charlegs0._rotation = 135;
} else {
_local6 = _root.moveChar(_local5, 1, 0);
game.clip.char0._rotation = 90;
game.clip.charlegs0._rotation = 90;
}
game.clip.char0._rotation = game.clip.char0._rotation + 5;
game.clip.charlegs0._rotation = game.clip.char0._rotation + 5;
pressingKey = true;
} else if (Key.isDown(37) or Key.isDown(90)) {
if (Key.isDown(38) or Key.isDown(83)) {
_local6 = _root.moveChar(_local5, -1, -1);
game.clip.char0._rotation = 315;
game.clip.charlegs0._rotation = 315;
} else if (Key.isDown(40) or Key.isDown(88)) {
_local6 = _root.moveChar(_local5, -1, 1);
game.clip.char0._rotation = 225;
game.clip.charlegs0._rotation = 225;
} else {
_local6 = _root.moveChar(_local5, -1, 0);
game.clip.char0._rotation = 270;
game.clip.charlegs0._rotation = 270;
}
pressingKey = true;
} else if (Key.isDown(38) or Key.isDown(83)) {
_local6 = _root.moveChar(_local5, 0, -1);
game.clip.char0._rotation = 0;
game.clip.charlegs0._rotation = 0;
pressingKey = true;
} else if (Key.isDown(40) or Key.isDown(88)) {
_local6 = _root.moveChar(_local5, 0, 1);
game.clip.char0._rotation = 180;
game.clip.charlegs0._rotation = 180;
pressingKey = true;
} else {
_local6 = _root.moveChar(_local5, 0, 0);
if (char[0].shooting == 0) {
game.clip.char0.stop();
}
game.clip.charlegs0.stop();
}
if (char[0].shooting == 0) {
} else {
fire(0, char[0].targetx, char[0].targety);
}
var _local2 = 1;
while (_local2 < (level[clevel].count + 1)) {
if ((char[_local2].die == 0) and (char[_local2].active == true)) {
if (!char[_local2].flyer) {
if (!_root.char[_local2].moving) {
game.clip["char" + _local2].stop(1);
var _local4 = false;
var _local3 = 0;
while (_local3 < (level[clevel].count + 1)) {
if (char[_local3].team != char[_local2].team) {
if (char[_local3].die == 0) {
if (getDist(game.clip["char" + _local3]._x, game.clip["char" + _local3]._y, game.clip["char" + _local2]._x, game.clip["char" + _local2]._y) < 500) {
char[_local2].targetx = Math.floor(game.clip["char" + _local3]._x / game.tileW);
char[_local2].targety = Math.floor(game.clip["char" + _local3]._y / game.tileH);
_local4 = true;
break;
}
}
}
_local3++;
}
if (!_local4) {
char[_local2].targety = Math.round(Math.random() * (myMap1.length - 2));
char[_local2].targetx = (char[0].xtile - 4) + Math.round(Math.random() * 8);
}
if (game[(("t_" + char[_local2].targety) + "_") + char[_local2].targetx].walkable) {
getTarget(char[_local2].targetx, char[_local2].targety, _local2);
}
} else if (char[_local2].melee) {
meleeAI(_local2);
} else {
moveAI(_root.char[_local2], _local2);
game.clip["char" + _local2].play();
if (char[_local2].shooting > 0) {
fire(_local2, game.clip["char" + char[_local2].starget]._x, game.clip["char" + char[_local2].starget]._y);
}
}
} else {
moveflyer(_local2);
}
}
_local2++;
}
checkActivity();
movemissiles();
if (char[0].die == 0) {
testDeath(0);
}
hitpoints.text = (("LIFE: " + Math.round(char[0].hpCurrent)) + " / ") + char[0].hpMax;
hitpoints.setTextFormat(my_fmt);
shieldlevel.text = "GOLD: " + gold;
shieldlevel.setTextFormat(my_fmt3);
score.text = "SCORE: " + gamescore;
score.setTextFormat(my_fmt2);
}
function collectitems() {
var _local1 = 1;
while (_local1 < (level[clevel].count + 1)) {
if ((char[_local1].gold > 0) and (char[_local1].hpCurrent < 1)) {
if (game.clip["coins" + _local1].hitTest(game.clip.char0)) {
game.clip["coins" + _local1].removeMovieClip();
gold = gold + char[_local1].gold;
char[_local1].gold = 0;
}
}
_local1++;
}
}
function mouseisdown() {
var _local2 = 5;
if ((char[0].shooting < _local2) or (char[0].shooting == 0)) {
char[0].shooting = 10;
char[0].targetx = this._xmouse - game.clip._x;
char[0].targety = this._ymouse - game.clip._y;
fire(0, char[0].targetx, char[0].targety);
}
}
function fire(owner, tx, ty) {
if (char[owner].shooting == 5) {
if (owner == 0) {
if (splits == 1) {
generatemissile(owner, tx, ty);
} else if (splits == 2) {
generatemissile(owner, tx, ty);
generatemissile(owner, tx - 10, ty - 10);
generatemissile(owner, tx + 10, ty + 10);
} else if (splits == 3) {
generatemissile(owner, tx, ty);
generatemissile(owner, tx - 10, ty - 10);
generatemissile(owner, tx + 10, ty + 10);
generatemissile(owner, tx - 20, ty - 20);
generatemissile(owner, tx + 20, ty + 20);
}
} else {
generatemissile(owner, tx, ty);
}
} else if ((char[owner].shooting == 14) or (char[0].shooting == 9)) {
if ((((((char[owner].race == "rogue") or (char[owner].race == "fwizard")) or (char[owner].race == "goblinarcher")) or (char[owner].race == "hero")) or (char[owner].race == "troll")) or (char[owner].race == "wizard")) {
game.clip["char" + owner].gotoAndPlay(25);
game.clip["char" + owner]._rotation = 90 + getAngle(game.clip["char" + owner]._x, game.clip["char" + owner]._y, tx, ty);
if ((owner == 0) and (pressingKey == false)) {
game.clip["charlegs" + owner].gotoAndPlay(25);
game.clip["charlegs" + owner]._rotation = game.clip["char" + owner]._rotation;
}
}
}
if (char[owner].shooting > 0) {
if ((((((char[owner].race == "rogue") or (char[owner].race == "fwizard")) or (char[owner].race == "goblinarcher")) or (char[owner].race == "hero")) or (char[cp].race == "troll")) or (char[cp].race == "wizard")) {
game.clip["char" + owner]._rotation = 90 + getAngle(game.clip["char" + owner]._x, game.clip["char" + owner]._y, tx, ty);
}
char[owner].shooting--;
}
}
function generatemissile(owner, tx, ty) {
if (misslecount < misslemax) {
misslecount++;
} else {
misslecount = 0;
}
if (char[owner].cweapon == "rweapon") {
game.clip.attachMovie(char[owner].rweapon, "missle" + misslecount, 9990001 + misslecount);
} else {
game.clip.attachMovie(char[owner].lweapon, "missle" + misslecount, 9990001 + misslecount);
}
missle[misslecount] = {mowner:owner, targetx:tx, targety:ty, active:true, speed:20, startx:game.clip["char" + owner]._x, starty:game.clip["char" + owner]._y};
game.clip["missle" + misslecount]._x = game.clip["char" + owner]._x;
game.clip["missle" + misslecount]._y = game.clip["char" + owner]._y;
game.clip["missle" + misslecount]._rotation = 90 + getAngle(game.clip["missle" + misslecount]._x, game.clip["missle" + misslecount]._y, tx, ty);
game.clip["missle" + misslecount]._x = game.clip["char" + owner]._x;
game.clip["missle" + misslecount]._y = game.clip["char" + owner]._y;
if ((char[owner].race == "drake") or (char[owner].race == "dragon")) {
missle[misslecount].speed = 15;
dragonbreath.start();
} else if (((char[owner].race == "rogue") or (char[owner].race == "goblinarcher")) or (char[owner].race == "hero")) {
arrow_shot.start();
} else if ((char[cp].race == "troll") or (char[cp].race == "wizard")) {
fireball.start();
}
}
function movemissiles() {
var _local1 = 0;
while (_local1 < (misslemax + 1)) {
if (missle[_local1].active) {
game.clip["missle" + _local1]._y = game.clip["missle" + _local1]._y + (missle[_local1].speed * (-Math.cos((Math.PI * game.clip["missle" + _local1]._rotation) / 180)));
game.clip["missle" + _local1]._x = game.clip["missle" + _local1]._x + (missle[_local1].speed * Math.sin((Math.PI * game.clip["missle" + _local1]._rotation) / 180));
if (getDist(game.clip["missle" + _local1]._x, game.clip["missle" + _local1]._y, missle[_local1].startx, missle[_local1].starty) > 500) {
game.clip["missle" + _local1].swapDepths(1);
game.clip["missle" + _local1]._x = 90000 /* 0x015F90 */;
game.clip["missle" + _local1].removeMovieClip();
missle[_local1].active = false;
} else {
var _local2 = 0;
while (_local2 < (level[clevel].count + 1)) {
if (_local2 == missle[_local1].mowner) {
} else if ((char[_local2].die == 0) and (char[_local2].active == true)) {
if (char[missle[_local1].mowner].team == char[_local2].team) {
} else if (game.clip["missle" + _local1].hitTest(game.clip["char" + _local2])) {
if (char[missle[_local1].mowner].rweapon == "fire5") {
testDeath(_local2);
} else if ((char[missle[_local1].mowner].rweapon == "arrow") or (char[missle[_local1].mowner].rweapon == "boulder")) {
arrowhit.start();
game.clip.attachMovie("bloodspatter", "explosion" + _local1, 900300 + _local1);
game.clip["explosion" + _local1]._x = game.clip["missle" + _local1]._x;
game.clip["explosion" + _local1]._y = game.clip["missle" + _local1]._y;
game.clip["explosion" + _local1]._rotation = game.clip["missle" + _local1]._rotation + 180;
char[_local2].hpCurrent = char[_local2].hpCurrent - Math.round((Math.random() * char[missle[_local1].mowner].mattack) + 3);
game.clip["missle" + _local1].swapDepths(1);
game.clip["missle" + _local1]._x = 90000 /* 0x015F90 */;
game.clip["missle" + _local1].removeMovieClip();
missle[_local1].active = false;
testDeath(_local2);
} else if (char[missle[_local1].mowner].rweapon == "beamfull") {
game.clip.attachMovie("explosion1", "explosion" + _local1, 900300 + _local1);
char[_local2].hpCurrent = char[_local2].hpCurrent - Math.round((Math.random() * char[missle[_local1].mowner].mattack) + 30);
game.clip["explosion" + _local1]._x = game.clip["missle" + _local1]._x;
game.clip["explosion" + _local1]._y = game.clip["missle" + _local1]._y;
game.clip["missle" + _local1].swapDepths(1);
game.clip["missle" + _local1]._x = 90000 /* 0x015F90 */;
game.clip["missle" + _local1].removeMovieClip();
missle[_local1].active = false;
testDeath(_local2);
} else {
game.clip.attachMovie("explosion1", "explosion" + _local1, 900300 + _local1);
game.clip["explosion" + _local1]._x = game.clip["missle" + _local1]._x;
game.clip["explosion" + _local1]._y = game.clip["missle" + _local1]._y;
game.clip["missle" + _local1].swapDepths(1);
game.clip["missle" + _local1]._x = 90000 /* 0x015F90 */;
game.clip["missle" + _local1].removeMovieClip();
missle[_local1].active = false;
}
}
}
_local2++;
}
}
}
_local1++;
}
}
function testDeath(cp) {
if (char[cp].hpCurrent < 1) {
if (cp == 0) {
game.clip.attachMovie("explosion2", "explosion" + cp, 900300 + cp);
game.clip["explosion" + cp]._x = game.clip["char" + cp]._x;
game.clip["explosion" + cp]._y = game.clip["char" + cp]._y;
game.clip["explosion" + cp].gotoAndPlay(4);
game.clip["char" + cp].swapDepths(501);
game.clip["char" + cp].removeMovieClip();
char[cp].die = 1;
attachMovie("defeat", "defeat", 109994);
defeat._x = 310;
defeat._y = 230;
_global.SCORE = gamescore - 1000;
_global.GOLD = 0;
x7._x = 3000;
x4._x = 3000;
x5._x = 3000;
x6._x = 3000;
x1.removeMovieClip();
x2.removeMovieClip();
x3.removeMovieClip();
y1.stopDrag();
y1._x = 3000;
Mouse.show();
} else if (char[cp].flyer) {
if ((char[cp].race == "drake") or (char[cp].race == "dragon")) {
game.clip.attachMovie("explosion2", "explosion" + cp, 900300 + cp);
game.clip["explosion" + cp]._x = game.clip["char" + cp]._x;
game.clip["explosion" + cp]._y = game.clip["char" + cp]._y;
game.clip["explosion" + cp].gotoAndPlay(4);
}
if (char[cp].gold > 0) {
game.clip.attachMovie("coins", "coins" + cp, 9500 + cp);
game.clip["coins" + cp]._x = game.clip["char" + cp]._x;
game.clip["coins" + cp]._y = game.clip["char" + cp]._y;
}
game.clip["char" + cp].swapDepths(501);
game.clip["char" + cp].removeMovieClip();
char[cp].die = 1;
gamescore = gamescore + char[cp].hpMax;
checkvictory();
} else {
game.clip["char" + cp].gotoAndPlay(151);
game.clip["char" + cp].swapDepths(9100 + cp);
char[cp].die = 1;
if (char[cp].gold > 0) {
game.clip.attachMovie("coins", "coins" + cp, 9500 + cp);
game.clip["coins" + cp]._x = game.clip["char" + cp]._x;
game.clip["coins" + cp]._y = game.clip["char" + cp]._y;
}
gamescore = gamescore + char[cp].hpMax;
checkvictory();
if ((((char[cp].race == "goblin") or (char[cp].race == "goblinarcher")) or (char[cp].race == "troll")) or (char[cp].race == "battleogre")) {
moan.start();
}
}
}
}
function checkvictory() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < (level[clevel].count + 1)) {
if ((char[_local2].team == 2) and (char[_local2].die == 0)) {
_local3++;
}
_local2++;
}
if ((_local3 < 10) and (char[0].xtile > (myMap1[0].length - 2))) {
game.clip.swapDepths(1);
game.clip.removeMovieClip();
game.removeMovieClip();
_global.LEVELS++;
_global.SCORE = gamescore;
_global.GOLD = gold;
_global.leveltime = Math.round(ltime / 24);
leveltimer._x = -100;
if (_global.LEVELS > 15) {
gotoAndStop (50);
} else {
gotoAndStop (35);
}
}
}
function changeColor(item, ra, rb, ga, gb, ba, bb, aa, ab) {
var _local2 = new Color(item);
var _local1 = new Object();
if (ra != 0) {
_local1.ra = ra;
}
if (ga != 0) {
_local1.ga = ga;
}
if (ba != 0) {
_local1.ba = ba;
}
if (aa != 0) {
_local1.aa = aa;
}
if (rb != 0) {
_local1.rb = rb;
}
if (gb != 0) {
_local1.gb = gb;
}
if (bb != 0) {
_local1.bb = bb;
}
if (ab != 0) {
_local1.ab = ab;
}
_local2.setTransform(_local1);
}
function checkActivity() {
ltime++;
leveltimer.text = "Timer: " + Math.round(ltime / 24);
leveltimer.setTextFormat(my_fmt3);
var _local1 = 1;
while (_local1 < (level[clevel].count + 1)) {
if ((((((char[_local1].xtile - char[0].xtile) < 6) and (char[_local1].behind == false)) or (((char[_local1].xtile - char[0].xtile) < -4) and (char[_local1].behind == true))) and (char[_local1].active == false)) and (char[_local1].hpCurrent > 0)) {
char[_local1].active = true;
if (char[_local1].race == "goblin") {
game.clip.attachMovie("goblin", "char" + _local1, 10000 + _local1);
} else if (char[_local1].race == "rat") {
game.clip.attachMovie("rat", "char" + _local1, 10000 + _local1);
game.clip["char" + _local1]._xscale = 70;
game.clip["char" + _local1]._yscale = 70;
} else if (char[_local1].race == "goblinarcher") {
game.clip.attachMovie("goblinarcher", "char" + _local1, 10000 + _local1);
} else if (char[_local1].race == "wizard") {
game.clip.attachMovie("wizard", "char" + _local1, 10000 + _local1);
} else if (char[_local1].race == "footman") {
game.clip.attachMovie("footman", "char" + _local1, 10000 + _local1);
game.clip["char" + _local1]._xscale = 80;
game.clip["char" + _local1]._yscale = 80;
} else if (char[_local1].race == "lionman") {
game.clip.attachMovie("lionman", "char" + _local1, 10000 + _local1);
} else if (char[_local1].race == "troll") {
game.clip.attachMovie("troll", "char" + _local1, 10000 + _local1);
} else if (char[_local1].race == "lizardman") {
game.clip.attachMovie("lizardman", "char" + _local1, 10000 + _local1);
} else if (char[_local1].race == "demon") {
game.clip.attachMovie("demon", "char" + _local1, 10000 + _local1);
var _local2 = 50 + Math.round(Math.random() * 50);
game.clip["char" + _local1]._xscale = _local2;
game.clip["char" + _local1]._yscale = _local2;
} else if (char[_local1].race == "battleogre") {
game.clip.attachMovie("battleogre", "char" + _local1, 10000 + _local1);
game.clip["char" + _local1]._xscale = 120;
game.clip["char" + _local1]._yscale = 120;
} else if (char[_local1].race == "rogue") {
game.clip.attachMovie("rogue", "char" + _local1, 10000 + _local1);
} else if (char[_local1].race == "hero") {
game.clip.attachMovie("hero", "char" + _local1, 10000 + _local1);
} else if (char[_local1].race == "drake") {
game.clip.attachMovie("dragon", "char" + _local1, 1000000 + _local1);
game.clip["char" + _local1]._xscale = 50;
game.clip["char" + _local1]._yscale = 50;
changeColor("game.clip.char" + _local1, Math.round(Math.random() * 70), 0, Math.round(Math.random() * 70), 0, Math.round(Math.random() * 70), 0, 99, 0);
} else if (char[_local1].race == "dragon") {
game.clip.attachMovie("dragon", "char" + _local1, 1000000 + _local1);
changeColor("game.clip.char" + _local1, Math.round(Math.random() * 70), 0, Math.round(Math.random() * 70), 0, Math.round(Math.random() * 70), 0, 99, 0);
} else if (char[_local1].race == "bat") {
game.clip.attachMovie("bat", "char" + _local1, 1000000 + _local1);
}
char[_local1].clip = game.clip["char" + _local1];
char[_local1].x = (char[_local1].xtile * game.tileW) + (game.tileW / 2);
char[_local1].y = (char[_local1].ytile * game.tileW) + (game.tileW / 2);
char[_local1].width = char[_local1].clip._width / 2;
char[_local1].height = char[_local1].clip._height / 2;
char[_local1].clip._x = char[_local1].x;
char[_local1].clip._y = char[_local1].y;
char[_local1].clip.gotoAndStop(char[_local1].frame);
char[_local1].xstep = char[_local1].x;
char[_local1].ystep = char[_local1].y;
}
if (((char[_local1].active == true) and (char[_local1].hpCurrent < 1)) and (char[_local1].xtile < (char[0].xtile - 6))) {
char[_local1].active = false;
game.clip["char" + _local1].removeMovieClip();
}
_local1++;
}
}
function moveflyer(i) {
var _local4 = game.clip["char" + i]._rotation;
var _local3 = 90 + getAngle(game.clip["char" + i]._x, game.clip["char" + i]._y, game.clip.char0._x, game.clip.char0._y);
if (game.clip["char" + i]._rotation < 0) {
if (_local3 < 0) {
if ((game.clip["char" + i]._rotation + 363) < (_local3 + 360)) {
game.clip["char" + i]._rotation = game.clip["char" + i]._rotation + 3;
char[i].swing = 1;
} else if (((game.clip["char" + i]._rotation - 3) + 360) > (_local3 + 360)) {
game.clip["char" + i]._rotation = game.clip["char" + i]._rotation - 3;
char[i].swing = -1;
} else if ((char[i].race == "drake") or (char[i].race == "dragon")) {
if (char[i].shooting > 5) {
char[i].shooting = 0;
generatemissile(i, game.clip.char0._x, game.clip.char0._y);
} else {
char[i].shooting++;
}
}
} else if ((game.clip["char" + i]._rotation + 363) < _local3) {
game.clip["char" + i]._rotation = game.clip["char" + i]._rotation + 3;
char[i].swing = 1;
} else if (((game.clip["char" + i]._rotation - 3) + 360) > _local3) {
game.clip["char" + i]._rotation = game.clip["char" + i]._rotation - 3;
char[i].swing - 1;
} else if ((char[i].race == "drake") or (char[i].race == "dragon")) {
if (char[i].shooting > 5) {
char[i].shooting = 0;
generatemissile(i, game.clip.char0._x, game.clip.char0._y);
} else {
char[i].shooting++;
}
}
} else if (_local3 < 0) {
if ((game.clip["char" + i]._rotation + 3) < (_local3 + 360)) {
game.clip["char" + i]._rotation = game.clip["char" + i]._rotation + (3 * char[i].swing);
} else if ((game.clip["char" + i]._rotation - 3) > (_local3 + 360)) {
game.clip["char" + i]._rotation = game.clip["char" + i]._rotation + 3;
char[i].swing = 1;
} else if ((char[i].race == "drake") or (char[i].race == "dragon")) {
if (char[i].shooting > 5) {
char[i].shooting = 0;
generatemissile(i, game.clip.char0._x, game.clip.char0._y);
} else {
char[i].shooting++;
}
}
} else if ((game.clip["char" + i]._rotation + 3) < _local3) {
game.clip["char" + i]._rotation = game.clip["char" + i]._rotation + 3;
char[i].swing = 1;
} else if ((game.clip["char" + i]._rotation - 3) > _local3) {
game.clip["char" + i]._rotation = game.clip["char" + i]._rotation - 3;
char[i].swing = -1;
} else if ((char[i].race == "drake") or (char[i].race == "dragon")) {
if (char[i].shooting > 5) {
char[i].shooting = 0;
generatemissile(i, game.clip.char0._x, game.clip.char0._y);
} else {
char[i].shooting++;
}
}
game.clip["char" + i]._y = game.clip["char" + i]._y + (9 * (-Math.cos((Math.PI * game.clip["char" + i]._rotation) / 180)));
game.clip["char" + i]._x = game.clip["char" + i]._x + (9 * Math.sin((Math.PI * game.clip["char" + i]._rotation) / 180));
var _local2 = 0;
while (_local2 < (level[clevel].count + 1)) {
if (((char[_local2].team == 1) and (char[_local2].die == 0)) && (char[_local2].active == true)) {
if (game.clip["char" + i].hitTest(game.clip["char" + _local2])) {
char[_local2].hpCurrent = char[_local2].hpCurrent - Math.round(Math.random() * char[i].mattack);
Whoosh.start();
testDeath(_local2);
}
}
_local2++;
}
}
function updateMaxx() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < (level[clevel].count + 1)) {
if (((char[_local2].team == 2) and (char[_local2].active == true)) and (char[_local2].die == 0)) {
if (game.clip["char" + _local2]._x < (maxx - 500)) {
_local3++;
}
}
_local2++;
}
trace(_local3);
if (_local3 == 0) {
this.attachMovie("go", "go", 110009);
maxx = maxx + 1500;
} else if (stopcount == 0) {
this.attachMovie("stop", "go", 110009);
stopcount++;
} else if (stopcount > 250) {
this.attachMovie("go", "go", 110009);
_local2 = 0;
while (_local2 < (level[clevel].count + 1)) {
if (((char[_local2].team == 2) and (char[_local2].active == true)) and (char[_local2].die == 0)) {
if (game.clip["char" + _local2]._x < (maxx - 500)) {
char[_local2].active = false;
game.clip["char" + _local2].removeMovieClip();
}
}
_local2++;
}
maxx = maxx + 1500;
stopcount = 0;
} else {
trace(stopcount);
stopcount++;
}
}
fscommand ("allowscale", false);
fscommand ("allowscale", false);
var y1 = this.attachMovie("bullseye", "bullseye", 9999999);
Mouse.hide();
startDrag ("bullseye");
tellTarget ("bullseye") {
_x = this._xmouse;
_y = this._ymouse;
};
var my_fmt = new TextFormat();
my_fmt.color = 65280;
my_fmt.size = 16;
my_fmt.bold = true;
var my_fmt2 = new TextFormat();
my_fmt2.color = 16711680 /* 0xFF0000 */;
my_fmt2.size = 16;
my_fmt2.bold = true;
var my_fmt3 = new TextFormat();
my_fmt3.color = 16776960 /* 0xFFFF00 */;
my_fmt3.size = 16;
my_fmt3.bold = true;
var x4 = this.createTextField("hitpoints", 110000, 30, 458, 180, 40);
var x5 = this.createTextField("shieldlevel", 110001, 250, 458, 180, 40);
var x6 = this.createTextField("score", 110002, 480, 458, 180, 40);
var x7 = this.createTextField("leveltimer", 110003, 480, 10, 280, 40);
var x1 = this.attachMovie("woodsign", "w1", 109991);
w1._x = 10;
w1._y = 458;
var x2 = this.attachMovie("woodsign", "w2", 109992);
w2._x = 230;
w2._y = 458;
var x3 = this.attachMovie("woodsign", "w3", 109993);
w3._x = 460;
w3._y = 458;
var clearpath = 4;
myMap1 = [];
var i = 0;
while (i < 8) {
myMap1[i] = [];
var j = 0;
while (j < 80) {
if (((Math.random() * 20) > 5) or (j < 5)) {
myMap1[i][j] = 0;
} else {
var ttype = Math.round((Math.random() * 10) + 5);
myMap1[i][j] = ttype;
}
j++;
}
i++;
}
var j = 0;
while (j < 80) {
myMap1[clearpath][j] = 0;
var updown = Math.round(Math.random() * 7);
if (updown > clearpath) {
clearpath = clearpath + 1;
myMap1[clearpath][j] = 0;
} else if (updown < clearpath) {
clearpath = clearpath - 1;
myMap1[clearpath][j] = 0;
}
j++;
}
var saved = 0;
var cc = 0;
var ix = 0;
var iy = 0;
var ixx = 0;
var iyy = 0;
var mapstr;
var splits = 1;
var splitscount = 0;
var maxx = 2500;
var maxxtrigger = false;
var gold = _global.GOLD;
var pressingKey = false;
var ltime = 0;
var swing = 1;
astars = [];
astars[0] = [];
astars[0][0] = [];
astars[0][0][0] = [];
game = {tileW:80, tileH:80, currentMap:1, visx:8, visy:8, centerx:320, centery:120};
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Doors = function (newmap, newcharx, newchary) {
this.newmap = newmap;
this.newcharx = newcharx;
this.newchary = newchary;
};
game.Doors.prototype.walkable = true;
game.Doors.prototype.frame = 3;
game.Doors.prototype.door = true;
game.Tile2 = function () {
};
game.Tile2.prototype = new game.Doors(2, 1, 4);
game.Tile3 = function () {
};
game.Tile3.prototype = new game.Doors(1, 12, 10);
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 20;
game.Tile5 = function () {
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 4;
game.Tile5.prototype.building = true;
game.Tile5.prototype.hp = 100;
};
game.Tile6 = function () {
game.Tile6.prototype.walkable = false;
game.Tile6.prototype.frame = 5;
};
game.Tile7 = function () {
game.Tile7.prototype.walkable = false;
game.Tile7.prototype.frame = 6;
game.Tile7.prototype.building = true;
game.Tile7.prototype.hp = 100;
};
game.Tile8 = function () {
game.Tile8.prototype.walkable = false;
game.Tile8.prototype.frame = 7;
game.Tile8.prototype.building = true;
game.Tile8.prototype.hp = 100;
};
game.Tile9 = function () {
game.Tile9.prototype.walkable = false;
game.Tile9.prototype.frame = 8;
};
game.Tile10 = function () {
game.Tile10.prototype.walkable = false;
game.Tile10.prototype.frame = 9;
};
game.Tile11 = function () {
game.Tile11.prototype.walkable = false;
game.Tile11.prototype.frame = 10;
};
game.Tile12 = function () {
game.Tile12.prototype.walkable = false;
game.Tile12.prototype.frame = 11;
};
game.Tile13 = function () {
game.Tile13.prototype.walkable = false;
game.Tile13.prototype.frame = 12;
};
game.Tile14 = function () {
game.Tile14.prototype.walkable = false;
game.Tile14.prototype.frame = 13;
};
game.Tile15 = function () {
game.Tile15.prototype.walkable = false;
game.Tile15.prototype.frame = 14;
};
game.Tile16 = function () {
game.Tile16.prototype.walkable = false;
game.Tile16.prototype.frame = 15;
};
game.Tile17 = function () {
game.Tile17.prototype.walkable = false;
game.Tile17.prototype.frame = 16;
};
var missle = [];
var misslecount = 0;
var misslemax = 20;
var gamescore = _global.SCORE;
var clevel = _global.LEVELS;
var mouseattackcounter = 1;
var stopcount = 0;
var level = [];
level[1] = {tile:"grass", count:60, goblin:5, goblinarcher:0, footman:0, rogue:0, wizard:0, lizardman:0, battleogre:0, lionman:0, troll:0, demon:0, rat:45, drake:0, bat:10};
level[2] = {tile:"grass", count:90, goblin:20, goblinarcher:5, footman:0, rogue:0, wizard:0, lizardman:0, battleogre:0, lionman:0, troll:0, demon:0, rat:45, drake:0, bat:20};
level[3] = {tile:"grass", count:100, goblin:35, goblinarcher:10, footman:0, rogue:0, wizard:0, lizardman:0, battleogre:0, lionman:0, troll:0, demon:0, rat:25, drake:0, bat:30};
level[4] = {tile:"tiles", count:100, goblin:65, goblinarcher:29, footman:0, rogue:0, wizard:0, lizardman:0, battleogre:1, lionman:0, troll:0, demon:0, rat:0, drake:0, bat:0};
level[5] = {tile:"tiles", count:100, goblin:40, goblinarcher:35, footman:0, rogue:0, wizard:0, lizardman:0, battleogre:25, lionman:0, troll:0, demon:0, rat:0, drake:0, bat:0};
level[6] = {tile:"tiles", count:100, goblin:5, goblinarcher:15, footman:0, rogue:0, wizard:0, lizardman:0, battleogre:80, lionman:0, troll:0, demon:0, rat:0, drake:0, bat:0};
level[7] = {tile:"beachsand3", count:100, goblin:10, goblinarcher:15, footman:0, rogue:0, wizard:0, lizardman:0, battleogre:50, lionman:0, troll:0, demon:0, rat:0, drake:0, bat:25};
level[8] = {tile:"beachsand3", count:100, goblin:10, goblinarcher:10, footman:0, rogue:0, wizard:0, lizardman:0, battleogre:40, lionman:0, troll:20, demon:0, rat:0, drake:0, bat:20};
level[9] = {tile:"winter", count:100, goblin:10, goblinarcher:10, footman:0, rogue:0, wizard:0, lizardman:0, battleogre:30, lionman:0, troll:30, demon:0, rat:0, drake:0, bat:20};
level[10] = {tile:"sand_1", count:100, goblin:0, goblinarcher:0, footman:0, rogue:0, wizard:0, lizardman:10, battleogre:2, lionman:50, troll:20, demon:0, rat:0, drake:0, bat:18};
level[11] = {tile:"sand_1", count:100, goblin:0, goblinarcher:0, footman:0, rogue:0, wizard:0, lizardman:30, battleogre:0, lionman:50, troll:0, demon:0, rat:0, drake:15, bat:5};
level[12] = {tile:"Grass2", count:100, goblin:0, goblinarcher:0, footman:0, rogue:0, wizard:0, lizardman:40, battleogre:0, lionman:10, troll:0, demon:0, rat:0, drake:50, bat:0};
level[13] = {tile:"grass1thumbsmall", count:120, goblin:0, goblinarcher:0, footman:20, rogue:0, wizard:20, lizardman:40, battleogre:0, lionman:0, troll:0, demon:0, rat:0, drake:40, bat:0};
level[14] = {tile:"redmud", count:120, goblin:5, goblinarcher:10, footman:25, rogue:0, wizard:20, lizardman:20, battleogre:5, lionman:5, troll:10, demon:0, rat:0, drake:20, bat:0};
level[15] = {tile:"winter", count:135, goblin:10, goblinarcher:10, footman:20, rogue:0, wizard:20, lizardman:10, battleogre:10, lionman:10, troll:10, demon:10, rat:0, drake:20, bat:0, dragon:5};
var char = [];
char[0] = {xtile:2, ytile:4, speed:5, width:20, height:20, dirx:0, diry:0, targetx:0, targety:0, moving:false, frame:0, moveCount:0, team:1, weapon:"sword", lweapon:"bow", hpMax:500, hpCurrent:500, isHit:false, die:0, rangex:0, rangey:0, rAngle:0, shieldm:100, shieldc:100, dleft:0, dright:0, dup:0, ddown:0, race:"dragon", shooting:0, wlife:0, melee:false, mcount:0, a1:50, a2:80, a3:100, a4:100, ranged:false, starget:0, mtarget:0, mattack:10, active:true, behind:false, flyer:false, swing:1};
var i = 1;
while (i < (level[clevel].count + 1)) {
char[i] = {xtile:3, ytile:3, speed:5, width:31, height:31, dirx:0, diry:0, targetx:0, targety:0, moving:false, frame:0, moveCount:0, team:1, weapon:"sword", lweapon:"bow", hpMax:100, hpCurrent:100, isHit:false, die:0, rangex:0, rangey:0, rAngle:0, shieldm:100, shieldc:0, dleft:0, dright:0, dup:0, ddown:0, race:"", shooting:0, wlife:0, melee:false, mcount:0, a1:50, a2:80, a3:100, a4:100, ranged:false, starget:0, mtarget:0, mattack:10, active:false, behind:false, flyer:false, swing:1, gold:0};
char[i].ytile = Math.round(Math.random() * (myMap1.length - 2)) + 1;
char[i].xtile = Math.round(Math.random() * (myMap1[0].length - 8)) + 7;
if (myMap1[char[i].ytile][char[i].xtile] > 0) {
i--;
} else {
if (Math.round(Math.random() * 10) > 6) {
char[i].behind = true;
}
if (level[clevel].goblin > 0) {
level[clevel].goblin--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "goblin";
char[i].team = 2;
char[i].a1 = 25;
char[i].a2 = 50;
char[i].a3 = 75;
char[i].a4 = 100;
char[i].gold = Math.round(Math.random() * 10) + 1;
} else if (level[clevel].rat > 0) {
level[clevel].rat--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "rat";
char[i].team = 2;
char[i].mattack = 5;
char[i].hpMax = 20;
char[i].hpCurrent = 20;
} else if (level[clevel].goblinarcher > 0) {
level[clevel].goblinarcher--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "goblinarcher";
char[i].team = 2;
char[i].ranged = true;
char[i].gold = Math.round(Math.random() * 10) + 1;
} else if (level[clevel].footman > 0) {
level[clevel].footman--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "footman";
char[i].team = 2;
char[i].speed = 8;
char[i].mattack = 75;
char[i].hpMax = 550;
char[i].hpCurrent = 550;
char[i].gold = Math.round(Math.random() * 150) + 1;
} else if (level[clevel].lionman > 0) {
level[clevel].lionman--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "lionman";
char[i].team = 2;
char[i].mattack = 65;
char[i].hpMax = 450;
char[i].hpCurrent = 450;
char[i].gold = Math.round(Math.random() * 150) + 1;
} else if (level[clevel].troll > 0) {
level[clevel].troll--;
char[i].rweapon = "boulder";
char[i].lweapon = "boulder";
char[i].race = "troll";
char[i].team = 2;
char[i].ranged = true;
char[i].mattack = 45;
char[i].hpMax = 450;
char[i].hpCurrent = 450;
char[i].gold = Math.round(Math.random() * 150) + 1;
} else if (level[clevel].wizard > 0) {
level[clevel].wizard--;
char[i].rweapon = "beamfull";
char[i].lweapon = "beamfull";
char[i].race = "wizard";
char[i].team = 2;
char[i].ranged = true;
char[i].mattack = 95;
char[i].hpMax = 850;
char[i].hpCurrent = 850;
char[i].gold = Math.round(Math.random() * 150) + 1;
} else if (level[clevel].lizardman > 0) {
level[clevel].lizardman--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "lizardman";
char[i].team = 2;
char[i].mattack = 55;
char[i].hpMax = 550;
char[i].hpCurrent = 550;
char[i].gold = Math.round(Math.random() * 90) + 1;
} else if (level[clevel].demon > 0) {
level[clevel].demon--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "demon";
char[i].team = 2;
char[i].speed = 8;
char[i].mattack = 155;
char[i].hpMax = 1400;
char[i].hpCurrent = 1400;
char[i].gold = Math.round(Math.random() * 1000) + 1;
} else if (level[clevel].battleogre > 0) {
level[clevel].battleogre--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "battleogre";
char[i].team = 2;
char[i].mattack = 55;
char[i].hpMax = 450;
char[i].hpCurrent = 450;
char[i].gold = Math.round(Math.random() * 70) + 1;
} else if (level[clevel].rogue > 0) {
level[clevel].rogue--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "rogue";
char[i].team = 1;
char[i].ranged = true;
char[i].mattack = 35;
char[i].hpMax = 150;
char[i].hpCurrent = 150;
char[i].xtile = 2;
char[i].ytile = 4;
} else if (level[clevel].hero > 0) {
game.clip.attachMovie("herotop", "char" + i, (10000 + i) - 1);
game.clip.attachMovie("herobottom", "charlegs" + i, 10000 + i);
level[clevel].hero--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "footman";
char[i].team = 1;
char[i].mattack = 15;
char[i].hpMax = 650;
char[i].hpCurrent = 650;
char[i].a1 = 25;
char[i].a2 = 50;
char[i].a3 = 75;
char[i].a4 = 100;
} else if (level[clevel].drake > 0) {
level[clevel].drake--;
char[i].rweapon = "fire3";
char[i].lweapon = "fire3";
char[i].race = "drake";
char[i].team = 2;
char[i].mattack = 25;
char[i].hpMax = 550;
char[i].hpCurrent = 550;
char[i].a1 = 25;
char[i].a2 = 50;
char[i].a3 = 75;
char[i].a4 = 100;
char[i].flyer = true;
} else if (level[clevel].dragon > 0) {
level[clevel].dragon--;
char[i].rweapon = "fire2";
char[i].lweapon = "fire2";
char[i].race = "dragon";
char[i].team = 2;
char[i].mattack = 125;
char[i].hpMax = 2550;
char[i].hpCurrent = 2550;
char[i].a1 = 25;
char[i].a2 = 50;
char[i].a3 = 75;
char[i].a4 = 100;
char[i].flyer = true;
} else if (level[clevel].bat > 0) {
level[clevel].bat--;
char[i].rweapon = "arrow";
char[i].lweapon = "arrow";
char[i].race = "bat";
char[i].team = 2;
char[i].mattack = 1;
char[i].hpMax = 10;
char[i].hpCurrent = 10;
char[i].a1 = 25;
char[i].a2 = 50;
char[i].a3 = 75;
char[i].a4 = 100;
char[i].flyer = true;
}
}
i++;
}
flapwings = new Sound();
flapwings.attachSound("flapwings");
dragonbreath = new Sound();
dragonbreath.attachSound("dragonbreath");
dragonbreath = new Sound();
dragonbreath.attachSound("dragonbreath");
arrow_shot = new Sound();
arrow_shot.attachSound("Arrow_Swoosh");
arrowhit = new Sound();
arrowhit.attachSound("arrowhit");
Whoosh = new Sound();
Whoosh.attachSound("Whoosh");
Fireball = new Sound();
Fireball.attachSound("Fireball");
Fireball3 = new Sound();
Fireball3.attachSound("Fireball3");
ohh = new Sound();
ohh.attachSound("ohh");
moan = new Sound();
moan.attachSound("moan");
var recursiveFunction = function () {
mouseisdown();
};
this.onMouseDown = function () {
this.onEnterFrame = recursiveFunction;
};
this.onMouseUp = function () {
delete this.onEnterFrame;
};
buildMap(_root["myMap" + game.currentMap]);
stop();
Instance of Symbol 19 MovieClip [empty] "controller" in Frame 30
onClipEvent (enterFrame) {
_root.detectKeys();
}
Frame 35
if (_global.LEVELS > 1) {
stop();
trace("interAdd");
MochiAd.showInterLevelAd({id:"9b733987de1e8726", res:"640x480"});
} else {
this.play();
}
Frame 40
timetaken = _global.leveltime;
var tg = (((_global.LEVELS * 100) + 200) - _global.leveltime);
if (tg > 0) {
timegold = tg;
} else {
tg = 0;
timegold = 0;
}
compgold = _global.LEVELS * 25;
_global.GOLD = (_global.GOLD + tg) + (_global.LEVELS * 25);
var my_fmt = new TextFormat();
my_fmt.color = 65280;
my_fmt.size = 16;
my_fmt.bold = true;
var my_fmt2 = new TextFormat();
my_fmt2.color = 16711680 /* 0xFF0000 */;
my_fmt2.size = 16;
my_fmt2.bold = true;
var my_fmt3 = new TextFormat();
my_fmt3.color = 16776960 /* 0xFFFF00 */;
my_fmt3.size = 16;
my_fmt3.bold = true;
shieldlevel.text = "GOLD: " + _global.GOLD;
shieldlevel.setTextFormat(my_fmt3);
stop();
Frame 45
stop();
Instance of Symbol 1776 MovieClip in Frame 45
on (press) {
if (_global.GOLD > 99) {
_global.GOLD = _global.GOLD - 100;
_global.hp = _global.hp + 25;
_parent.hitpoints.text = (("LIFE: " + _global.hp) + " / ") + _global.hp;
_parent.shieldlevel.text = "GOLD: " + _global.GOLD;
var my_fmt = new TextFormat();
my_fmt.color = 65280;
my_fmt.size = 16;
my_fmt.bold = true;
var my_fmt2 = new TextFormat();
my_fmt2.color = 16711680 /* 0xFF0000 */;
my_fmt2.size = 16;
my_fmt2.bold = true;
var my_fmt3 = new TextFormat();
my_fmt3.color = 16776960 /* 0xFFFF00 */;
my_fmt3.size = 16;
my_fmt3.bold = true;
_parent.hitpoints.setTextFormat(my_fmt);
_parent.shieldlevel.setTextFormat(my_fmt3);
}
}
Instance of Symbol 1776 MovieClip in Frame 45
on (press) {
if (_global.GOLD > 99) {
_global.GOLD = _global.GOLD - 100;
_global.damage = _global.damage + 2;
_parent.shieldlevel.text = "GOLD: " + _global.GOLD;
var my_fmt = new TextFormat();
my_fmt.color = 65280;
my_fmt.size = 16;
my_fmt.bold = true;
var my_fmt2 = new TextFormat();
my_fmt2.color = 16711680 /* 0xFF0000 */;
my_fmt2.size = 16;
my_fmt2.bold = true;
var my_fmt3 = new TextFormat();
my_fmt3.color = 16776960 /* 0xFFFF00 */;
my_fmt3.size = 16;
my_fmt3.bold = true;
_parent.hitpoints.setTextFormat(my_fmt);
_parent.shieldlevel.setTextFormat(my_fmt3);
}
}
Frame 50
var i = 0;
while (i < (maxfire + 1)) {
this["fire" + i].removeMovieClip();
this["fire2" + i].removeMovieClip();
i++;
}
story.removeMovieClip();
box.removeMovieClip();
about.removeMovieClip();
howto.removeMovieClip();
credits.removeMovieClip();
scores.removeMovieClip();
leave.removeMovieClip();
var i = 1;
while (i < 16) {
this["names" + i].removeTextField();
this["scores" + i].removeTextField();
i++;
}
hweapon.removeTextField();
dweapon.removeTextField();
if (_global.LEVELS == 1) {
quest = "Recently there has become an overwhelming plague of rats near the village. Eradicate the pests before they spread further";
} else if (_global.LEVELS == 2) {
quest = "Due to your efforts the pests are slowly being reduced, please proceed in hunting the remainder down.";
} else if (_global.LEVELS == 3) {
quest = "The town watch has had an alert of a band of goblins near the village. Please investigate and if necssary remove them by force.";
} else if (_global.LEVELS == 4) {
quest = "Turns out that there is a small army of goblins massing together in the badlands. Please investigate further and if possible create havoc before the get too organised.";
} else if (_global.LEVELS == 5) {
quest = "Our worst fears are true, the goblins have a massive army marching our way, please see what you can do in slowing them down.";
} else if (_global.LEVELS == 6) {
quest = "You have managed to stop their approach, they seem to be waiting for something, please see if you can chase of the remainder.";
} else if (_global.LEVELS == 7) {
quest = "The goblins it appears where waiting for battleogres. Generally they don't work together, search the battleogre badlands to see what is happening.";
} else if (_global.LEVELS == 8) {
quest = "Looks like the battleogres where part of a bigger plan. There have been reports of trolls marching with the ogres. See what you can do.";
} else if (_global.LEVELS == 9) {
quest = "The trolls and ogres are fleeing into the snowy mountains, chase them down and kill them so we won't have a threat in the future.";
} else if (_global.LEVELS == 10) {
quest = "Near the mountains have been spotted the fabled lion men. Please see if you can negotiate a treaty with them as they are intelligent creatures.";
} else if (_global.LEVELS == 11) {
quest = "Looks like the lion man has been corrupted by some evil, there are reports of lizard men mingling with them. Investigate and report.";
} else if (_global.LEVELS == 12) {
quest = "The lizard men seem to be some half breed of drake or dragon, they have many pet drakes flying to support their evil cause. See if you can stop them.";
} else if (_global.LEVELS == 13) {
quest = "The drakes are amassing with even more lizard men, but the truth has been revealed, the reason behind all these creatures are wicked humans. Kill them all.";
} else if (_global.LEVELS == 14) {
quest = "The bandits outpost has been located, destroy as many of them nearby the outpost as possbile so the army won't have to many inconveniences when it comes to clear these scum out.";
} else if (_global.LEVELS == 15) {
quest = "Our worst fears are true, dragons are allied with the evil humans and are lead by a horde of demons!, please help fight this evil horde as we fear the army will not survive.";
} else {
gotoAndStop (9);
}
Frame 65
gotoAndPlay (30);
Symbol 20 MovieClip [coins] Frame 1
var coincount = 0;
var i = 0;
while (i < 10) {
attachMovie("coin", "coin" + i, 100 + i);
this["coin" + i]._x = (Math.random() * 20) - 10;
this["coin" + i]._y = (Math.random() * 20) - 10;
i++;
}
play();
Symbol 20 MovieClip [coins] Frame 3
coincount++;
if (countcount > 100) {
this._alpha--;
}
if (this._alpha < 10) {
this.removeMovieClip();
}
gotoAndPlay (2);
Symbol 1792 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.31");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 1793 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 1794 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 97 MovieClip Frame 1
Symbol 97 MovieClip Frame 140
stop();
_root.gotoAndPlay(10);
Symbol 106 MovieClip [goblinportrait] Frame 1
stop();
Symbol 109 MovieClip [flame] Frame 1
Symbol 110 MovieClip [flame2] Frame 1
Symbol 112 MovieClip Frame 1
Symbol 114 MovieClip [enter] Frame 1
this.onPress = function () {
_parent.gotoAndStop(50);
_root.firestaffbutton.removeMovieClip();
};
this.onRollOver = function () {
ClickSound = new Sound();
ClickSound.attachSound("arrowhit");
ClickSound.start();
change_color = new Color(this);
change_color.setRGB(65280);
};
this.onRollOut = function () {
change_color = new Color(this);
change_color.setRGB(255);
};
Symbol 116 MovieClip Frame 1
this.onRollOver = function () {
ClickSound = new Sound();
ClickSound.attachSound("arrowhit");
ClickSound.start();
change_color = new Color(this);
change_color.setRGB(65280);
};
this.onRollOut = function () {
change_color = new Color(this);
change_color.setRGB(255);
};
this.onPress = function () {
ClickmSound = new Sound();
ClickmSound.attachSound("click");
ClickmSound.start();
var _local4 = new TextFormat();
_local4.color = 65280;
_local4.size = 20;
my_txt.setTextFormat(_local4);
_root.createTextField("hweapon", 1001, 80, 50, 300, 100);
_root.createTextField("dweapon", 1002, 80, 100, 300, 500);
_parent.dweapon.multiline = true;
_parent.dweapon.wordWrap = true;
_root.hweapon.multiline = true;
_root.hweapon.wordWrap = true;
_root.hweapon.text = "WHAT TO DO WITH ALL THE MONSTERS?";
_root.hweapon.setTextFormat(_local4);
_root.dweapon.text = "In the small village of Krondria there has been a build up of beasts of all description, some ranging from rats to ogres. In an attempt to remove the pests the village has requested heroes thoughout the land to help. Hearing the proclaimation you journey to the village to undertake the quest ahead of you.";
_root.dweapon.setTextFormat(_local4);
_root.attachMovie("box", "box", 1000);
_root.box._x = 220;
_root.box._y = 232;
_root.box._xscale = 400;
_root.box._yscale = 435;
_root.swordbutton.removeMovieClip();
_root.staffbutton.removeMovieClip();
_root.axebutton.removeMovieClip();
_root.bowswordbutton.removeMovieClip();
_root.firestaffbutton.removeMovieClip();
_root.poisonswordbutton.removeMovieClip();
var _local3 = 1;
while (_local3 < 16) {
_root["names" + _local3].removeTextField();
_root["scores" + _local3].removeTextField();
_local3++;
}
};
Symbol 118 MovieClip [howto] Frame 1
this.onRollOver = function () {
ClickSound = new Sound();
ClickSound.attachSound("arrowhit");
ClickSound.start();
change_color = new Color(this);
change_color.setRGB(65280);
};
this.onRollOut = function () {
change_color = new Color(this);
change_color.setRGB(255);
};
this.onPress = function () {
ClickmSound = new Sound();
ClickmSound.attachSound("click");
ClickmSound.start();
var _local4 = new TextFormat();
_local4.color = 65280;
_local4.size = 20;
my_txt.setTextFormat(_local4);
_root.createTextField("hweapon", 1001, 80, 50, 300, 100);
_root.createTextField("dweapon", 1002, 80, 100, 300, 500);
_parent.dweapon.multiline = true;
_parent.dweapon.wordWrap = true;
_root.hweapon.multiline = true;
_root.hweapon.wordWrap = true;
_root.hweapon.text = "USE THE FOLLOWING KEYS TO CONTROL HUNTER";
_root.hweapon.setTextFormat(_local4);
_root.dweapon.text = "'S' is up, 'X' is down, 'C' is right and 'Z' is left. Or you can use the arrow keys.\r\rUse the mouse to aim a shoot. Hold down for rapid fire.\r\rYou can upgrade your hitpoints and arrow damage at the end of each mission with the gold you collect and are rewarded with. Aim of the game is to hunt down and kill as many monsters moving eastward (to the right) until the end of the map.";
_root.dweapon.setTextFormat(_local4);
_root.attachMovie("box", "box", 1000);
_root.box._x = 220;
_root.box._y = 232;
_root.box._xscale = 400;
_root.box._yscale = 435;
_root.swordbutton.removeMovieClip();
_root.staffbutton.removeMovieClip();
_root.axebutton.removeMovieClip();
_root.bowswordbutton.removeMovieClip();
_root.firestaffbutton.removeMovieClip();
_root.poisonswordbutton.removeMovieClip();
var _local3 = 1;
while (_local3 < 16) {
_root["names" + _local3].removeTextField();
_root["scores" + _local3].removeTextField();
_local3++;
}
};
Symbol 128 MovieClip Frame 1
this.onRollOver = function () {
ClickSound = new Sound();
ClickSound.attachSound("arrowhit");
ClickSound.start();
change_color = new Color(this);
change_color.setRGB(65280);
};
this.onRollOut = function () {
change_color = new Color(this);
change_color.setRGB(255);
};
this.onPress = function () {
ClickmSound = new Sound();
ClickmSound.attachSound("click");
ClickmSound.start();
};
Symbol 131 MovieClip [bloodspatter] Frame 2
var xstr = [];
var ystr = [];
var galpha = 100;
var limit = [];
var i = 0;
while (i < 15) {
this.attachMovie("blooddrop", "bp" + i, 10000 + i);
xstr[i] = (Math.random() * 4) - 2;
ystr[i] = Math.random() * 6;
limit[i] = (Math.random() * 20) + 20;
this["bp" + i]._x = (Math.random() * 8) - 4;
this["bp" + i]._y = (Math.random() * 8) + 10;
this["bp" + i]._xscale = (Math.random() * 10) + 60;
this["bp" + i]._yscale = (Math.random() * 10) + 60;
i++;
}
Symbol 131 MovieClip [bloodspatter] Frame 4
if (galpha > 1) {
galpha = galpha - 5;
var i = 0;
while (i < 15) {
if ((this["bp" + i]._y + Math.abs(this["bp" + i]._x)) < limit[i]) {
this["bp" + i]._x = this["bp" + i]._x + xstr[i];
this["bp" + i]._y = this["bp" + i]._y - ystr[i];
ystr[i] = ystr[i] - 0.2;
}
this["bp" + i]._alpha = galpha;
i++;
}
gotoAndPlay (3);
} else {
this.swapDepths(1);
var i = 0;
while (i < 15) {
this["bp" + i].swapDepths(1);
this["bp" + i].removeMovieClip();
this["bp" + i].removeMovieClip();
i++;
}
this.removeMovieClip();
gotoAndStop (1);
}
Symbol 190 MovieClip [explosion1] Frame 34
stop();
this.removeMovieClip();
Symbol 257 MovieClip [explosion2] Frame 38
stop();
this.removeMovieClip();
Symbol 258 MovieClip [explosion3] Frame 36
stop();
this.removeMovieClip();
Symbol 259 MovieClip [explosion4] Frame 34
stop();
this.removeMovieClip();
Symbol 288 MovieClip [fire2] Frame 34
stop();
this.removeMovieClip();
Symbol 317 MovieClip [fire3] Frame 34
stop();
this.removeMovieClip();
Symbol 318 MovieClip [fire5] Frame 25
this.swapDepths(500);
this.removeMovieClip();
Symbol 322 MovieClip [go] Frame 1
var seconds = 0;
Symbol 322 MovieClip [go] Frame 2
seconds++;
if (seconds > 10) {
this.removeMovieClip();
}
Symbol 322 MovieClip [go] Frame 21
gotoAndPlay (2);
Symbol 445 MovieClip [footman] Frame 11
gotoAndPlay (1);
Symbol 445 MovieClip [footman] Frame 39
gotoAndStop (1);
Symbol 445 MovieClip [footman] Frame 69
gotoAndStop (1);
Symbol 445 MovieClip [footman] Frame 98
gotoAndStop (1);
Symbol 445 MovieClip [footman] Frame 135
gotoAndStop (1);
Symbol 445 MovieClip [footman] Frame 159
stop();
Symbol 582 MovieClip [battleogre] Frame 14
gotoAndPlay (1);
Symbol 582 MovieClip [battleogre] Frame 41
gotoAndStop (1);
Symbol 582 MovieClip [battleogre] Frame 70
gotoAndStop (1);
Symbol 582 MovieClip [battleogre] Frame 101
gotoAndStop (1);
Symbol 582 MovieClip [battleogre] Frame 132
gotoAndStop (1);
Symbol 582 MovieClip [battleogre] Frame 157
stop();
Symbol 721 MovieClip [demon] Frame 14
gotoAndPlay (1);
Symbol 721 MovieClip [demon] Frame 40
gotoAndStop (1);
Symbol 721 MovieClip [demon] Frame 70
gotoAndStop (1);
Symbol 721 MovieClip [demon] Frame 101
gotoAndStop (1);
Symbol 721 MovieClip [demon] Frame 134
gotoAndStop (1);
Symbol 721 MovieClip [demon] Frame 160
stop();
Symbol 754 MovieClip [dragon] Frame 16
gotoAndPlay (1);
Symbol 947 MovieClip [goblin] Frame 20
gotoAndPlay (1);
Symbol 947 MovieClip [goblin] Frame 46
gotoAndStop (1);
Symbol 947 MovieClip [goblin] Frame 76
gotoAndStop (1);
Symbol 947 MovieClip [goblin] Frame 106
gotoAndStop (1);
Symbol 947 MovieClip [goblin] Frame 135
gotoAndStop (1);
Symbol 947 MovieClip [goblin] Frame 163
stop();
Symbol 1014 MovieClip [goblinarcher] Frame 11
gotoAndPlay (1);
Symbol 1014 MovieClip [goblinarcher] Frame 39
gotoAndStop (1);
Symbol 1014 MovieClip [goblinarcher] Frame 157
stop();
Symbol 1050 MovieClip Frame 11
gotoAndPlay (1);
Symbol 1050 MovieClip Frame 12
gotoAndPlay (1);
Symbol 1050 MovieClip Frame 40
gotoAndStop (1);
Symbol 1050 MovieClip Frame 157
stop();
Symbol 1213 MovieClip [lionman] Frame 20
gotoAndPlay (1);
Symbol 1213 MovieClip [lionman] Frame 45
gotoAndStop (1);
Symbol 1213 MovieClip [lionman] Frame 75
gotoAndStop (1);
Symbol 1213 MovieClip [lionman] Frame 105
gotoAndStop (1);
Symbol 1213 MovieClip [lionman] Frame 135
gotoAndStop (1);
Symbol 1213 MovieClip [lionman] Frame 166
stop();
Symbol 1326 MovieClip [lizardman] Frame 19
gotoAndPlay (1);
Symbol 1326 MovieClip [lizardman] Frame 40
gotoAndStop (1);
Symbol 1326 MovieClip [lizardman] Frame 70
gotoAndStop (1);
Symbol 1326 MovieClip [lizardman] Frame 99
gotoAndStop (1);
Symbol 1326 MovieClip [lizardman] Frame 129
gotoAndStop (1);
Symbol 1326 MovieClip [lizardman] Frame 158
stop();
Symbol 1387 MovieClip [rat] Frame 8
gotoAndPlay (1);
Symbol 1387 MovieClip [rat] Frame 38
gotoAndStop (1);
Symbol 1387 MovieClip [rat] Frame 68
gotoAndStop (1);
Symbol 1387 MovieClip [rat] Frame 98
gotoAndStop (1);
Symbol 1387 MovieClip [rat] Frame 128
gotoAndStop (1);
Symbol 1387 MovieClip [rat] Frame 164
stop();
Symbol 1458 MovieClip [herobottom] Frame 21
gotoAndPlay (1);
Symbol 1458 MovieClip [herobottom] Frame 40
gotoAndStop (1);
Symbol 1458 MovieClip [herobottom] Frame 158
stop();
Symbol 1529 MovieClip [herotop] Frame 21
gotoAndPlay (1);
Symbol 1529 MovieClip [herotop] Frame 40
gotoAndStop (1);
Symbol 1529 MovieClip [herotop] Frame 158
stop();
Symbol 1620 MovieClip [troll] Frame 15
gotoAndPlay (1);
Symbol 1620 MovieClip [troll] Frame 39
gotoAndStop (1);
Symbol 1620 MovieClip [troll] Frame 165
stop();
Symbol 1704 MovieClip [wizard] Frame 21
gotoAndPlay (1);
Symbol 1704 MovieClip [wizard] Frame 44
gotoAndStop (1);
Symbol 1704 MovieClip [wizard] Frame 160
stop();
Symbol 1725 MovieClip [beamfull] Frame 6
stop();
Symbol 1731 MovieClip [death] Frame 32
this.removeMovieClip();
Symbol 1739 Button
on (release, keyPress "<Enter>") {
_parent.game.clip.swapDepths(1);
_parent.game.clip.removeMovieClip();
_parent.game.removeMovieClip();
mochi.MochiScores.showLeaderboard({boardID:"3d9c6d260393c235", score:_global.SCORE + 1000, name:pname, onClose:function () {
_global.LEVELS = 1;
_global.GOLD = 0;
_global.SCORE = 0;
_global.hp = 500;
_global.damage = 20;
_global.leveltime = 0;
_root.gotoAndPlay(20);
}});
this.removeMovieClip();
}
Instance of Symbol 1737 MovieClip in Symbol 1744 MovieClip [defeat] Frame 1
on (release) {
getURL ("http://www.freeflashgameplayer.com", "_blank");
}
Symbol 1748 Button
on (release) {
getURL ("http://www.gamevia.com", "_blank");
}
Symbol 1750 MovieClip Frame 1
onRelease = function () {
getURL ("http://www.freeflashgameplayer.com", "_blank");
};
Instance of Symbol 1750 MovieClip in Symbol 1751 MovieClip [maxgamesintro24fps] Frame 1
on (press) {
getURL ("http://www.gamevia.com", "_blank");
}
Symbol 1751 MovieClip [maxgamesintro24fps] Frame 200
this.removeMovieClip();
Symbol 1755 Button
on (release, keyPress "<Enter>") {
gotoAndStop (45);
}
Symbol 1767 Button
on (release, keyPress "<Enter>") {
gotoAndStop (50);
}
Symbol 1779 Button
on (release, keyPress "<Enter>") {
gotoAndStop (30);
}
Symbol 1786 Button
on (release) {
getURL ("http://www.freeflashgameplayer.com", "_blank");
}
Symbol 1788 Button
on (release) {
mochi.MochiScores.showLeaderboard({boardID:"3d9c6d260393c235", score:_global.SCORE, name:pname, onClose:function () {
_root.gotoAndPlay(20);
}});
}