Frame 1
MochiAd.showPreGameAd({id:"3d0ebc3176bc258f", res:"640x480"});
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__("c1af3af4", this, 10301, true);
Frame 2
_global.LEVEL = 1;
_global.SCORE = 1;
_global.FREQUENCY = 10;
_global.POWER = 30;
stop();
Instance of Symbol 332 MovieClip in Frame 2
on (release) {
getURL ("http://www.freeflashgameplayer.com", "_blank");
}
Frame 3
stop();
var counter = 0;
lvl = "Generating Level " + _global.LEVEL;
this.onEnterFrame = function () {
counter++;
if (counter > 10) {
gotoAndStop (4);
}
};
Frame 4
function drawMap() {
var _local3 = 0;
while (_local3 < maxx) {
var _local2 = 0;
while (_local2 < maxy) {
var _local1 = 0;
while (_local1 < 4) {
myMap[_local3][_local2][_local1] = Math.round(Math.random() * 100);
_local1++;
}
_local2++;
}
_local3++;
}
}
function loadScreen() {
var _local4 = 1;
while (_local4 < 14) {
var _local17 = 2 + (_local4 * 2);
var _local8 = (Math.ceil(((_local17 / 2) - 2) / 4) * 2) + 1;
var _local6 = 650 / _local17;
var _local7 = (_local8 * 4) - _local17;
var _local5 = _local6 / 134;
var _local18 = _local4 * 2;
var _local10 = (Math.ceil(((_local18 / 2) - 2) / 4) * 2) + 1;
var _local11 = 650 / _local18;
var _local12 = (_local10 * 4) - _local18;
var _local9 = _local11 / 134;
graph = createEmptyMovieClip("graphpoint" + _local4, 50000 - (_local4 * 1000));
graph.beginFill(lvlcolor1, 100);
graph.lineStyle(0, lvlcolor2);
graph.moveTo((-(_local7 / 2)) * _local6, 340 + myMap[locx - 1][locy - 1][2].hlevel);
var _local3 = 0;
while (_local3 < ((_local8 * 4) + 1)) {
var _local13 = Math.floor((_local3 / 4) - ((_local8 - 1) / 2));
var _local16 = Math.floor((_local3 / 4) - ((_local10 - 1) / 2));
graph.lineTo((_local3 - (_local7 / 2)) * _local6, (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].hlevel));
if (myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].object) {
var _local15 = myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].object;
attachMovie(_local15, (("buildingr" + _local4) + "c") + _local3, (49500 - (_local4 * 1000)) + _local3);
this[(("buildingr" + _local4) + "c") + _local3]._x = (_local3 - (_local7 / 2)) * _local6;
this[(("buildingr" + _local4) + "c") + _local3]._y = (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].hlevel);
this[(("buildingr" + _local4) + "c") + _local3]._xscale = _local5 * 100;
this[(("buildingr" + _local4) + "c") + _local3]._yscale = _local5 * 100;
} else {
this[(("buildingr" + _local4) + "c") + _local3].swapDepths(1);
removeMovieClip((("buildingr" + _local4) + "c") + _local3);
}
_local3++;
}
graph.lineTo(650, 500);
graph.lineTo(0, 500);
graph.endFill();
var _local20 = false;
if ((_local20 == true) and (_local4 > 1)) {
_local3 = 0;
while (_local3 < ((_local8 * 4) + 1)) {
if (_local8 == _local10) {
if (_local3 < (_local8 * 2)) {
var _local13 = Math.floor((_local3 / 4) - ((_local8 - 1) / 2));
var _local16 = Math.floor((_local3 / 4) - ((_local10 - 1) / 2));
graph.beginFill(10079232, 100);
graph.lineStyle(0, 0);
graph.moveTo((_local3 - (_local7 / 2)) * _local6, (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].hlevel));
graph.lineTo(((_local3 + 1) - (_local12 / 2)) * _local11, (340 - (((_local4 - 1) * 3) + (_local9 * 40))) + (_local9 * myMap[locx + _local16][locy - (_local4 - 1)][(_local3 + 1) - (Math.floor((_local3 + 1) / 4) * 4)].hlevel));
graph.lineTo(((_local3 + 1) - (_local7 / 2)) * _local6, (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][(_local3 + 1) - (Math.floor((_local3 + 1) / 4) * 4)].hlevel));
graph.lineTo((_local3 - (_local7 / 2)) * _local6, (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].hlevel));
graph.endFill();
graph.beginFill(10092339, 100);
graph.lineStyle(0, 0);
graph.moveTo((_local3 - (_local7 / 2)) * _local6, (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].hlevel));
graph.lineTo((_local3 - (_local12 / 2)) * _local11, (340 - (((_local4 - 1) * 3) + (_local9 * 40))) + (_local9 * myMap[locx + _local16][locy - (_local4 - 1)][_local3 - (Math.floor(_local3 / 4) * 4)].hlevel));
graph.lineTo(((_local3 + 1) - (_local12 / 2)) * _local11, (340 - (((_local4 - 1) * 3) + (_local9 * 40))) + (_local9 * myMap[locx + _local16][locy - (_local4 - 1)][(_local3 + 1) - (Math.floor((_local3 + 1) / 4) * 4)].hlevel));
graph.lineTo((_local3 - (_local7 / 2)) * _local6, (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].hlevel));
graph.endFill();
}
} else if (_local3 < (_local8 * 2)) {
var _local13 = Math.floor((_local3 / 4) - ((_local8 - 1) / 2));
var _local16 = Math.floor((_local3 / 4) - ((_local10 - 1) / 2));
var _local14 = Math.round(_local3 * (_local10 / _local8));
graph.beginFill(10092492, 100);
graph.lineStyle(0, 0);
graph.moveTo((_local3 - (_local7 / 2)) * _local6, (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].hlevel));
graph.lineTo((_local14 - (_local12 / 2)) * _local11, (340 - (((_local4 - 1) * 3) + (_local9 * 40))) + (_local9 * myMap[locx + _local16][locy - (_local4 - 1)][_local14 - (Math.floor(_local14 / 4) * 4)].hlevel));
graph.lineTo(((_local3 + 1) - (_local7 / 2)) * _local6, (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][(_local3 + 1) - (Math.floor((_local3 + 1) / 4) * 4)].hlevel));
graph.lineTo((_local3 - (_local7 / 2)) * _local6, (340 - ((_local4 * 3) + (_local5 * 40))) + (_local5 * myMap[locx + _local13][locy - _local4][_local3 - (Math.floor(_local3 / 4) * 4)].hlevel));
graph.endFill();
}
_local3++;
}
}
_local4++;
}
var _local3 = 1;
while (_local3 < (unitcount + 1)) {
this["powerup" + _local3]._xscale++;
this["powerup" + _local3]._yscale++;
this["powerup" + _local3].swapDepths((490000 + _local3) + (this["powerup" + _local3]._xscale * 100));
if (this["powerup" + _local3]._xscale > 80) {
if (this["powerup" + _local3].hitbox.hitTest(this.herodragon.hitbox)) {
this["powerup" + _local3].swapDepths(1);
this["powerup" + _local3].removeMovieClip();
attachMovie("powerupvision", "powerupvision", 78999999);
powerupvision._x = 320;
powerupvision._y = 240;
if (dragon[_local3].bonus == "health") {
dragon[0].hp = dragon[0].hp + 50;
if (dragon[0].hp > dragon[0].hpmax) {
dragon[0].hp = dragon[0].hpmax;
}
} else if (dragon[_local3].bonus == "power") {
_global.POWER = _global.POWER + 5;
if (_global.POWER > 200) {
_global.POWER = 200;
}
dragon[0].damage = _global.POWER;
} else {
_global.FREQUENCY = _global.FREQUENCY - 0.4;
if (_global.FREQUENCY < 1) {
_global.FREQUENCY = 1;
}
}
}
}
if (this["powerup" + _local3]._xscale > 110) {
this["powerup" + _local3].swapDepths(1);
this["powerup" + _local3].removeMovieClip();
}
if (dragon[_local3].startframe == locy) {
if (dragon[_local3].dtype == "bat") {
this.attachMovie("bat", "baddragon" + _local3, (490000 + _local3) + (dragon[_local3].distance * 100));
this["baddragon" + _local3]._x = dragon[_local3].startx;
this["baddragon" + _local3]._y = dragon[_local3].starty;
this["baddragon" + _local3]._xscale = 100 - dragon[_local3].distance;
this["baddragon" + _local3]._yscale = 100 - dragon[_local3].distance;
} else {
this.attachMovie("baddragon", "baddragon" + _local3, (490000 + _local3) + (dragon[_local3].distance * 100));
this["baddragon" + _local3]._x = dragon[_local3].startx;
this["baddragon" + _local3]._y = dragon[_local3].starty;
this["baddragon" + _local3]._xscale = 100 - dragon[_local3].distance;
this["baddragon" + _local3]._yscale = 100 - dragon[_local3].distance;
if (dragon[_local3].dtype == "green") {
changeColor("baddragon" + _local3, 40, 50, 120, 90, 30, 50, 0, 200);
} else if (dragon[_local3].dtype == "red") {
changeColor("baddragon" + _local3, 120, 90, 20, 10, 30, 10, 0, 200);
} else if (dragon[_local3].dtype == "blue") {
changeColor("baddragon" + _local3, 10, 10, 10, 10, 120, 80, 0, 200);
} else if (dragon[_local3].dtype == "white") {
changeColor("baddragon" + _local3, 255, 90, 255, 90, 255, 90, 0, 200);
} else {
changeColor("baddragon" + _local3, 1, 1, 1, 1, 1, 1, 0, 200);
}
}
}
if (dragon[_local3].startframe > locy) {
if (dragon[_local3].distance < -10) {
dragon[_local3].distance = dragon[_local3].distance - 15;
this["baddragon" + _local3]._alpha = 100 + dragon[_local3].distance;
} else if (dragon[_local3].distance < 30) {
dragon[_local3].distance = dragon[_local3].distance - 8;
} else if (dragon[_local3].distance < 50) {
dragon[_local3].distance = dragon[_local3].distance - 3;
} else if (dragon[_local3].distance < 80) {
dragon[_local3].distance = dragon[_local3].distance - 0.5;
} else {
dragon[_local3].distance = dragon[_local3].distance - 0.1;
}
this["baddragon" + _local3]._xscale = 100 - dragon[_local3].distance;
this["baddragon" + _local3]._yscale = 100 - dragon[_local3].distance;
this["baddragon" + _local3]._rotation = 0;
if ((((this["baddragon" + _local3]._x > (dragon[_local3].targetx - 5)) and (this["baddragon" + _local3]._x < (dragon[_local3].targetx + 5))) and (this["baddragon" + _local3]._y > (dragon[_local3].targety - 5))) and (this["baddragon" + _local3]._y < (dragon[_local3].targety + 5))) {
dragon[_local3].targetx = Math.round(Math.random() * 650) - 15;
dragon[_local3].targety = Math.round(Math.random() * 350);
}
}
if (dragon[_local3].targetx > this["baddragon" + _local3]._x) {
this["baddragon" + _local3]._x = this["baddragon" + _local3]._x + (1 + int(_global.LEVEL / 2));
this["baddragon" + _local3]._rotation = 20;
}
if (dragon[_local3].targetx < this["baddragon" + _local3]._x) {
this["baddragon" + _local3]._x = this["baddragon" + _local3]._x - (1 + int(_global.LEVEL / 2));
this["baddragon" + _local3]._rotation = -20;
}
if (dragon[_local3].targety > this["baddragon" + _local3]._y) {
this["baddragon" + _local3]._y = this["baddragon" + _local3]._y + (1 + int(_global.LEVEL / 2));
}
if (dragon[_local3].targety < this["baddragon" + _local3]._y) {
this["baddragon" + _local3]._y = this["baddragon" + _local3]._y - (1 + int(_global.LEVEL / 2));
}
this["baddragon" + _local3].swapDepths((490000 + _local3) + ((100 - dragon[_local3].distance) * 100));
if (dragon[_local3].distance < -80) {
this["baddragon" + _local3].swapDepths(1);
this["baddragon" + _local3].removeMovieClip();
}
if (((Math.random() * 400) < (10 + (10 * _global.LEVEL))) && (this["baddragon" + _local3])) {
if (dragon[_local3].dtype == "green") {
attachMovie("poisonbolt", "fireball" + misslecount, 580000 + misslecount);
} else if (dragon[_local3].dtype == "white") {
attachMovie("iceball", "fireball" + misslecount, 580000 + misslecount);
} else if (dragon[_local3].dtype == "black") {
attachMovie("toxic", "fireball" + misslecount, 580000 + misslecount);
} else if (dragon[_local3].dtype == "red") {
attachMovie("fire4", "fireball" + misslecount, 580000 + misslecount);
} else if (dragon[_local3].dtype == "blue") {
attachMovie("lightning", "fireball" + misslecount, 580000 + misslecount);
} else {
attachMovie("fire", "fireball" + misslecount, 580000 + misslecount);
}
this["fireball" + misslecount]._x = this["baddragon" + _local3]._x;
this["fireball" + misslecount]._y = this["baddragon" + _local3]._y - 10;
var _local19 = int(Math.random() * 100);
if (_local19 > 75) {
bdattack1.start();
} else if (_local19 > 50) {
bdattack2.start();
} else if (_local19 > 25) {
bdattack3.start();
} else {
bdattack3.start();
}
var _local22 = int(Math.random() * 100) - 50;
var _local21 = int(Math.random() * 100) - 50;
missle[misslecount] = {mowner:"bad", targetx:herodragon._x + _local22, targety:herodragon._y + _local21, active:true, speed:getDist(this["fireball" + misslecount]._x, this["fireball" + misslecount]._y, herodragon._x + _local22, herodragon._y + _local21) / 5, fangle:90 + getAngle(this["fireball" + misslecount]._x, this["fireball" + misslecount]._y, herodragon._x + _local22, herodragon._y + _local21), fdistance:dragon[_local3].distance, damage:dragon[_local3].damage};
misslecount++;
if (misslecount > misslemax) {
misslecount = 0;
}
}
_local3++;
}
healthbar.hbgreen._xscale = (dragon[0].hp / dragon[0].hpmax) * 100;
powerbar.hbgreen._xscale = (_global.POWER / 200) * 100;
speedbar.hbgreen._xscale = 200 / _global.FREQUENCY;
if (locy == 400) {
attachMovie("citadel", "citadel", 480500);
citadel._x = 350;
citadel._y = 250;
citadel._xscale = 100 - int(locy / 4);
citadel._yscale = 100 - int(locy / 4);
}
if (locy < 400) {
citadel._xscale = 50 - (locy / 8);
citadel._yscale = 50 - (locy / 8);
}
if (locy == 20) {
if ((Math.random() * 100) < (20 + (5 * _global.LEVEL))) {
attachMovie("stone", "fireball" + misslecount, 580000 + misslecount);
this["fireball" + misslecount]._x = (citadel._x + (Math.random() * 30)) - 15;
this["fireball" + misslecount]._y = citadel._y - 100;
var _local22 = int(Math.random() * 640);
var _local21 = int(Math.random() * 440);
missle[misslecount] = {mowner:"bad", targetx:_local22, targety:_local21, active:true, speed:getDist(this["fireball" + misslecount]._x, this["fireball" + misslecount]._y, _local22, _local21) / 5, fangle:90 + getAngle(this["fireball" + misslecount]._x, this["fireball" + misslecount]._y, _local22, _local21), fdistance:100, damage:10 + (3 * _global.LEVEL)};
misslecount++;
if (misslecount > misslemax) {
misslecount = 0;
}
}
if ((Math.random() * 100) < (10 + (5 * _global.LEVEL))) {
attachMovie("fire4", "fireball" + misslecount, 580000 + misslecount);
this["fireball" + misslecount]._x = citadel._x - 70;
this["fireball" + misslecount]._y = citadel._y - 140;
var _local22 = herodragon._x;
var _local21 = herodragon._y;
missle[misslecount] = {mowner:"bad", targetx:_local22, targety:_local21, active:true, speed:getDist(this["fireball" + misslecount]._x, this["fireball" + misslecount]._y, _local22, _local21) / 5, fangle:90 + getAngle(this["fireball" + misslecount]._x, this["fireball" + misslecount]._y, _local22, _local21), fdistance:100, damage:10 + (3 * _global.LEVEL)};
misslecount++;
if (misslecount > misslemax) {
misslecount = 0;
}
}
}
scorebox.fscore = _global.SCORE;
}
function loadConsole() {
console = createEmptyMovieClip("consolepoint", 100000);
console.beginBitmapFill(con);
console.lineStyle(6, 6697728);
console.moveTo(0, 600);
console.lineTo(0, 500);
console.lineTo(600, 500);
console.lineTo(600, 0);
console.lineTo(800, 0);
console.lineTo(800, 600);
console.lineTo(0, 600);
console.endFill();
this.createTextField("mapLocation", 110000, 50, 500, 50, 20);
mapLocation.text = (locx + ", ") + locy;
}
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 mouseisdown() {
if (shcount < 0) {
attachMovie("fire4", "fireball" + misslecount, 580000 + misslecount);
this["fireball" + misslecount]._x = herodragon._x;
this["fireball" + misslecount]._y = herodragon._y - 10;
fire.start();
missle[misslecount] = {mowner:"owner", targetx:this._xmouse, targety:this._ymouse, active:true, speed:getDist(this["fireball" + misslecount]._x, this["fireball" + misslecount]._y, this._xmouse, this._ymouse) / 5, fangle:90 + getAngle(this["fireball" + misslecount]._x, this["fireball" + misslecount]._y, this._xmouse, this._ymouse), fdistance:0};
misslecount++;
if (misslecount > misslemax) {
misslecount = 0;
}
shcount = _global.FREQUENCY;
} else {
shcount--;
}
}
function moveMissles() {
i = 0;
while (i < (misslemax + 1)) {
if (missle[i].active && (missle[i].mowner == "owner")) {
this["fireball" + i]._x = this["fireball" + i]._x + ((missle[i].speed / ((missle[i].fdistance / 10) + 1)) * Math.sin((Math.PI * missle[i].fangle) / 180));
this["fireball" + i]._y = this["fireball" + i]._y + ((missle[i].speed / ((missle[i].fdistance / 10) + 1)) * (-Math.cos((Math.PI * missle[i].fangle) / 180)));
missle[i].fdistance = missle[i].fdistance + 5;
if (missle[i].fdistance > 95) {
this["fireball" + i].removeMovieClip();
missle[i].active = false;
} else {
this["fireball" + i]._xscale = 100 - missle[i].fdistance;
this["fireball" + i]._yscale = 100 - missle[i].fdistance;
}
if (locy < 25) {
if ((missle[i].fdistance > 70) and (missle[i].fdistance < 90)) {
if (this["fireball" + i].hitbox.hitTest(citadel)) {
attachMovie("explosion1", "explosion" + i, 900300 + i);
this["explosion" + i]._x = this["fireball" + i]._x;
this["explosion" + i]._y = this["fireball" + i]._y;
this["explosion" + i]._xscale = this["fireball" + i]._xscale;
this["explosion" + i]._yscale = this["fireball" + i]._yscale;
this["fireball" + i].removeMovieClip();
missle[i].active = false;
citadelhp = citadelhp - dragon[0].damage;
hit1.start();
if (citadelhp < 1) {
attachMovie("explosion2", "explosion" + i, 900300 + i);
this["explosion" + i]._x = citadel._x;
this["explosion" + i]._y = citadel._y;
this["explosion" + i]._xscale = citadel._xscale * 5;
this["explosion" + i]._yscale = citadel._yscale * 5;
citadel.swapDepths(this["explosion" + i]);
citadel.swapDepths(1);
citadel.removeMovieClip();
_global.SCORE = _global.SCORE + (1000 * _global.LEVEL);
buildingdie.start();
victory();
}
}
}
}
var _local3 = 0;
while (_local3 < (unitcount + 1)) {
if (missle[i].fdistance > (dragon[_local3].distance - 20)) {
if (missle[i].fdistance < (dragon[_local3].distance + 20)) {
if (this["fireball" + i].hitbox.hitTest(this["baddragon" + _local3].hitbox)) {
attachMovie("explosion1", "explosion" + i, 900300 + i);
this["explosion" + i]._x = this["fireball" + i]._x;
this["explosion" + i]._y = this["fireball" + i]._y;
this["explosion" + i]._xscale = this["fireball" + i]._xscale;
this["explosion" + i]._yscale = this["fireball" + i]._yscale;
this["fireball" + i].removeMovieClip();
missle[i].active = false;
dragon[_local3].hp = dragon[_local3].hp - dragon[0].damage;
var _local5 = int(Math.random() * 100);
if (_local5 > 75) {
hit1.start();
} else if (_local5 > 50) {
hit2.start();
} else if (_local5 > 25) {
hit3.start();
} else {
hit4.start();
}
if (dragon[_local3].hp < 1) {
_local5 = int(Math.random() * 100);
if (_local5 > 50) {
bddie1.start();
} else {
bddie2.start();
}
attachMovie("explosion2", "explosion" + i, 900300 + i);
this["explosion" + i]._x = this["baddragon" + _local3]._x;
this["explosion" + i]._y = this["baddragon" + _local3]._y;
this["explosion" + i]._xscale = this["baddragon" + _local3]._xscale * 2;
this["explosion" + i]._yscale = this["baddragon" + _local3]._yscale * 2;
this["baddragon" + _local3].swapDepths(this["explosion" + i]);
if ((Math.random() * 100) > 50) {
var _local4 = int(Math.random() * 100);
if (_local4 > 65) {
attachMovie("health", "powerup" + _local3, this["explosion" + i] - 1);
dragon[_local3].bonus = "health";
} else if (_local4 > 35) {
attachMovie("speed", "powerup" + _local3, this["explosion" + i] - 1);
dragon[_local3].bonus = "speed";
} else {
attachMovie("power", "powerup" + _local3, this["explosion" + i] - 1);
dragon[_local3].bonus = "power";
}
this["powerup" + _local3]._x = this["baddragon" + _local3]._x;
this["powerup" + _local3]._y = this["baddragon" + _local3]._y;
this["powerup" + _local3]._xscale = this["baddragon" + _local3]._xscale * 2;
this["powerup" + _local3]._yscale = this["baddragon" + _local3]._yscale * 2;
}
this["baddragon" + _local3].swapDepths(1);
this["baddragon" + _local3].removeMovieClip();
_global.SCORE = _global.SCORE + dragon[_local3].hpmax;
dragon[_local3].distance = -40;
}
}
}
}
_local3++;
}
}
i++;
}
i = 0;
while (i < (misslemax + 1)) {
if (missle[i].active && (missle[i].mowner == "bad")) {
this["fireball" + i]._x = this["fireball" + i]._x + ((missle[i].speed / (((missle[i].fdistance + 50) / 20) + 1)) * Math.sin((Math.PI * missle[i].fangle) / 180));
this["fireball" + i]._y = this["fireball" + i]._y + ((missle[i].speed / (((missle[i].fdistance + 50) / 20) + 1)) * (-Math.cos((Math.PI * missle[i].fangle) / 180)));
if (missle[i].fdistance > 80) {
missle[i].fdistance = missle[i].fdistance - 2;
} else if (missle[i].fdistance > 50) {
missle[i].fdistance = missle[i].fdistance - 4;
} else if (missle[i].fdistance > 25) {
missle[i].fdistance = missle[i].fdistance - 6;
} else {
missle[i].fdistance = missle[i].fdistance - 8;
}
if (missle[i].fdistance < -50) {
this["fireball" + i].removeMovieClip();
missle[i].active = false;
} else {
if (missle[i].fdistance < 0) {
this["fireball" + i]._alpha = this["fireball" + i]._alpha - 2;
}
this["fireball" + i]._xscale = 100 - missle[i].fdistance;
this["fireball" + i]._yscale = 100 - missle[i].fdistance;
}
if (missle[i].fdistance > -40) {
if (missle[i].fdistance < 8) {
if (this["fireball" + i].hitbox.hitTest(this.herodragon.hitbox)) {
attachMovie("explosion1", "explosion" + i, 900300 + i);
this["explosion" + i]._x = this["fireball" + i]._x;
this["explosion" + i]._y = this["fireball" + i]._y;
this["explosion" + i]._xscale = this["fireball" + i]._xscale;
this["explosion" + i]._yscale = this["fireball" + i]._yscale;
this["fireball" + i].removeMovieClip();
missle[i].active = false;
dragon[0].hp = dragon[0].hp - missle[i].damage;
attachMovie("bloodvision", "bloodvision", 78999999);
bloodvision._x = 320;
bloodvision._y = 240;
if (dragon[0].hp < 1) {
attachMovie("explosion2", "explosion" + i, herodragon.getDepth());
this["explosion" + i]._x = this.herodragon._x;
this["explosion" + i]._y = this.herodragon._y;
this["explosion" + i]._xscale = this.herodragon._xscale * 2;
this["explosion" + i]._yscale = this.herodragon._yscale * 2;
this.herodragon.swapDepths(1);
this.herodragon.removeMovieClip();
dragon[0].distance = -40;
victory();
}
}
}
}
}
i++;
}
}
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 getDist(px1, py1, px2, py2) {
x = px2 - px1;
y = py2 - py1;
hyp = Math.sqrt((x * x) + (y * y));
return(hyp);
}
function lightning(startx, starty, stopx, stopy) {
trace((((((startx + ",") + starty) + ",") + stopx) + ",") + stopy);
var _local9 = Math.round(Math.abs((startx - stopx) / 40) + Math.abs((starty - stopy) / 40));
var _local2 = 5;
var _local11 = (stopx - startx) / _local9;
var _local10 = (stopy - starty) / _local9;
var _local1 = "1";
var _local6;
var _local4;
var _local5;
var _local3;
while (Number(_local1) <= Number(_local9)) {
if (Number(_local1) == 1) {
_local6 = startx;
_local5 = starty;
_local4 = Number(Number(startx) + Number(_local11 * _local1)) + Number(_local2 - random((Number(_local2) + 1) * 2));
_local3 = Number(Number(starty) + Number(_local10 * _local1)) + Number(_local2 - random((Number(_local2) + 1) * 2));
} else if (Number(_local1) == Number(_local9)) {
_local6 = _local4;
_local5 = _local3;
_local4 = stopx;
_local3 = stopy;
} else {
_local6 = _local4;
_local5 = _local3;
_local4 = Number(Number(startx) + Number(_local11 * _local1)) + Number(_local2 - random((Number(_local2) + 1) * 2));
_local3 = Number(Number(starty) + Number(_local10 * _local1)) + Number(_local2 - random((Number(_local2) + 1) * 2));
}
game.clip.attachMovie("line", "line" + Number(_local1), 600000 + Number(_local1));
setProperty(game.clip["line" + Number(_local1)], _x , _local6);
setProperty(game.clip["line" + Number(_local1)], _y , _local5);
setProperty(game.clip["line" + Number(_local1)], _xscale , _local4 - _local6);
setProperty(game.clip["line" + Number(_local1)], _yscale , _local3 - _local5);
_local1 = Number(_local1) + 1;
trace(_local1);
}
trace("complete");
}
function victory() {
this.herodragon.swapDepths(1);
this.herodragon.removeMovieClip();
var _local4 = 1;
while (_local4 < (unitcount + 1)) {
this["baddragon" + _local4].swapDepths(1);
this["baddragon" + _local4].removeMovieClip();
_local4++;
}
var _local3 = 1;
while (_local3 < 14) {
this["graphpoint" + _local3].swapDepths;
removeMovieClip("graphpoint" + _local3);
var _local6 = 2 + (_local3 * 2);
var _local5 = (Math.ceil(((_local6 / 2) - 2) / 4) * 2) + 1;
_local4 = 0;
while (_local4 < ((_local5 * 4) + 1)) {
this[(("buildingr" + _local3) + "c") + _local4].swapDepths(1);
removeMovieClip((("buildingr" + _local3) + "c") + _local4);
_local4++;
}
_local3++;
}
_local4 = 0;
while (_local4 < (misslemax + 1)) {
this["fireball" + _local4].swapDepths(1);
this["fireball" + _local4].removeMovieClip();
_local4++;
}
citadel.swapDepths(1);
citadel.removeMovieClip();
healthbar.swapDepths(1);
healthbar.removeMovieClip();
dragonhead.swapDepths(1);
dragonhead.removeMovieClip();
speedbar.swapDepths(1);
speedbar.removeMovieClip();
powerbar.swapDepths(1);
powerbar.removeMovieClip();
base.swapDepths(1);
base.removeMovieClip();
powericon.swapDepths(1);
powericon.removeMovieClip();
speedicon.swapDepths(1);
speedicon.removeMovieClip();
delete this.onEnterFrame;
if (dragon[0].hp < 1) {
gotoAndStop (7);
} else if (_global.LEVEL == 7) {
gotoAndStop (6);
} else {
gotoAndStop (5);
}
}
fscommand ("allowscale", false);
fscommand ("allowscale", false);
var lvlcolor1 = 10066278;
var lvlcolor2 = 10053120;
if (_global.LEVEL == 1) {
lvlcolor1 = 10066278 /* 0x999966 */;
lvlcolor2 = 10053120 /* 0x996600 */;
changeColor("sky", 10, 10, 10, 10, 120, 80, 0, 200);
} else if (_global.LEVEL == 2) {
lvlcolor1 = 16777215 /* 0xFFFFFF */;
lvlcolor2 = 13421772 /* 0xCCCCCC */;
changeColor("sky", 10, 10, 40, 40, 120, 80, 0, 200);
} else if (_global.LEVEL == 3) {
lvlcolor1 = 52224;
lvlcolor2 = 39168;
changeColor("sky", 100, 90, 100, 90, 40, 10, 0, 200);
} else if (_global.LEVEL == 4) {
lvlcolor1 = 10053120 /* 0x996600 */;
lvlcolor2 = 6697728 /* 0x663300 */;
changeColor("sky", 100, 90, 50, 40, 30, 10, 0, 200);
} else if (_global.LEVEL == 5) {
lvlcolor1 = 10066329 /* 0x999999 */;
lvlcolor2 = 3355443 /* 0x333333 */;
changeColor("sky", 1, 1, 1, 1, 1, 1, 0, 200);
} else if (_global.LEVEL == 6) {
lvlcolor1 = 6710886 /* 0x666666 */;
lvlcolor2 = 0;
changeColor("sky", 20, 20, 10, 10, 1, 1, 0, 200);
} else if (_global.LEVEL == 7) {
lvlcolor1 = 16711680 /* 0xFF0000 */;
lvlcolor2 = 0;
changeColor("sky", 70, 0, 0, 70, 0, 70, 0, 200);
} else {
gotoAndStop (2);
}
this.attachMovie("bullseye", "bullseye", 599999);
Mouse.hide();
startDrag ("bullseye");
tellTarget ("bullseye") {
_x = this._xmouse;
_y = this._ymouse;
};
var shoot = false;
var shcount = 0;
var shspeed = _global.FREQUENCY;
var spellmax = 20;
var spellcount = 0;
var lightsx = 0;
var lightsy = 0;
var lightex = 0;
var lightey = 0;
var citadelhp = (2000 + (_global.LEVEL * 1000));
var endcounter = 0;
var every = 0;
var trend = new Array(4);
var trendi = new Array(4);
i = 0;
while (i < 5) {
trendi[i] = 0;
i++;
}
var missle = [];
var misslecount = 0;
var misslemax = 40;
var unitcount = (15 + (2 * _global.LEVEL));
this.attachMovie("herodragon", "herodragon", 600001);
changeColor("herodragon", 100, 90, 100, 90, 40, 10, 0, 200);
herodragon._x = 275;
herodragon._y = 240;
herodragon._xscale = 75;
herodragon._yscale = 75;
herodragon.hitbox._alpha = 0;
var dragon = [];
dragon[0] = {dleft:0, dright:0, dup:0, ddown:0, hpmax:2000, hp:2000, dtype:gold, damage:_global.POWER};
var i = 1;
while (i < (unitcount + 1)) {
dragon[i] = {distance:98, startframe:100, startx:0, starty:0, targetx:0, targety:0, hpmax:500, hp:500, dtype:"red", damage:20, speed:5, bonus:""};
dragon[i].startframe = Math.round(Math.random() * 960);
dragon[i].startx = Math.round(Math.random() * 650);
dragon[i].starty = Math.round(Math.random() * 200);
dragon[i].targetx = Math.round(Math.random() * 650);
dragon[i].targety = Math.round(Math.random() * 300);
var rancolor = ((Math.random() * (10 * _global.LEVEL)) + (10 * _global.LEVEL));
if (rancolor < 20) {
dragon[i].dtype = "bat";
dragon[i].damage = 20;
dragon[i].hp = 50;
dragon[i].hpmax = 50;
} else if (rancolor < 40) {
dragon[i].dtype = "red";
dragon[i].damage = 60;
dragon[i].hp = 250;
dragon[i].hpmax = 250;
} else if (rancolor < 60) {
dragon[i].dtype = "green";
dragon[i].damage = 80;
dragon[i].hp = 350;
dragon[i].hpmax = 350;
} else if (rancolor < 80) {
dragon[i].dtype = "white";
dragon[i].damage = 40;
dragon[i].hp = 450;
dragon[i].hpmax = 450;
} else if (rancolor < 100) {
dragon[i].dtype = "blue";
dragon[i].damage = 100;
dragon[i].hp = 550;
dragon[i].hpmax = 550;
} else {
dragon[i].dtype = "black";
dragon[i].damage = 120;
dragon[i].hp = 750;
dragon[i].hpmax = 750;
}
i++;
}
fire = new Sound();
fire.attachSound("Fireball");
explode = new Sound();
explode.attachSound("Fireball2");
flapwings = new Sound();
flapwings.attachSound("flapwings");
dragonbreath = new Sound();
dragonbreath.attachSound("dragonbreath");
bdattack1 = new Sound();
bdattack1.attachSound("dragon_attack1");
bdattack2 = new Sound();
bdattack2.attachSound("dragon_attack2");
bdattack3 = new Sound();
bdattack3.attachSound("dragon_attack3");
bdattack4 = new Sound();
bdattack4.attachSound("dragon_attack4");
bddie1 = new Sound();
bddie1.attachSound("dragon_die1");
bddie2 = new Sound();
bddie2.attachSound("dragon_die2");
hit1 = new Sound();
hit1.attachSound("dragon_hit1");
hit2 = new Sound();
hit2.attachSound("dragon_hit2");
hit3 = new Sound();
hit3.attachSound("dragon_hit3");
hit4 = new Sound();
hit4.attachSound("dragon_hit4");
buildingdie = new Sound();
buildingdie.attachSound("magic_builing_falls");
myMap = new Array(20);
r = 0;
while (r < 20) {
myMap[r] = new Array(1000);
c = 0;
while (c < 1000) {
myMap[r][c] = new Array(4);
i = 0;
while (i < 5) {
if (trendi[i] < 1) {
trend[i] = Math.round(Math.random() * 100);
} else {
trendi[i]--;
}
myMap[r][c][i] = {hlevel:Math.round(Math.random() * 50) + trend[i], object:""};
var ranobject = (Math.random() * 1000);
if (ranobject < 8) {
myMap[r][c][i].object = "tree1";
} else if (ranobject < 16) {
myMap[r][c][i].object = "tree2";
} else if (ranobject < 24) {
myMap[r][c][i].object = "tree3";
} else if (ranobject < 12) {
myMap[r][c][i].object = "humancastle1";
} else if (ranobject < 13) {
myMap[r][c][i].object = "inn";
} else if (ranobject < 14) {
myMap[r][c][i].object = "tower";
} else if (ranobject < 15) {
myMap[r][c][i].object = "stable";
} else if (ranobject < 16) {
myMap[r][c][i].object = "windmill";
}
i++;
}
c++;
}
r++;
}
var locx = 10;
var locy = 1000;
var maxx = 20;
var maxy = 100;
cloudspeed = new Array(10);
var i = 0;
while (i < 10) {
this.attachMovie("cloud", "cloud" + i, 50 + i);
this["cloud" + i]._x = Math.random() * 800;
this["cloud" + i]._y = Math.random() * 200;
cloudspeed[i] = Math.random() * 3;
this["cloud" + i]._xscale = (Math.random() * 200) + 100;
this["cloud" + i]._yscale = Math.random() * 120;
i++;
}
var con = flash.display.BitmapData.loadBitmap("tiles");
var grass = flash.display.BitmapData.loadBitmap("grass");
loadScreen();
attachMovie("healthbar", "healthbar", 597999);
healthbar._x = 120;
healthbar._y = 465;
attachMovie("dragonhead", "dragonhead", 597998);
dragonhead._x = 20;
dragonhead._y = 465;
attachMovie("scorebox", "scorebox", 597997);
scorebox._x = 500;
scorebox._y = 5;
attachMovie("speedbar", "speedbar", 597996);
speedbar._x = 330;
speedbar._y = 465;
attachMovie("powerbar", "powerbar", 597995);
powerbar._x = 540;
powerbar._y = 465;
attachMovie("powericon", "powericon", 597994);
powericon._x = 435;
powericon._y = 450;
powericon._xscale = 80;
powericon._yscale = 80;
attachMovie("speedicon", "speedicon", 597993);
speedicon._x = 215;
speedicon._y = 460;
speedicon._xscale = 60;
speedicon._yscale = 60;
attachMovie("base", "base", 597990);
base._x = -20;
base._y = 445;
this.onEnterFrame = function () {
if (Key.isDown(38) or Key.isDown(87)) {
if (dragon[0].ddown < 15) {
dragon[0].ddown = dragon[0].ddown + 2;
}
herodragon._y = herodragon._y - dragon[0].ddown;
} else {
dragon[0].ddown = 0;
}
if (Key.isDown(40) or Key.isDown(83)) {
if (dragon[0].dup < 15) {
dragon[0].dup = dragon[0].dup + 2;
}
herodragon._y = herodragon._y + dragon[0].dup;
} else {
dragon[0].dup = 0;
}
if (Key.isDown(37) or Key.isDown(65)) {
if (dragon[0].dleft < 15) {
dragon[0].dleft = dragon[0].dleft + 2;
}
herodragon._x = herodragon._x - dragon[0].dleft;
} else {
dragon[0].dleft = 0;
}
if (Key.isDown(39) or Key.isDown(68)) {
if (dragon[0].dright < 15) {
dragon[0].dright = dragon[0].dright + 2;
}
herodragon._x = herodragon._x + dragon[0].dright;
} else {
dragon[0].dright = 0;
}
if (herodragon._x < 0) {
herodragon._x = 0;
}
if (herodragon._x > 650) {
herodragon._x = 650;
}
if (herodragon._y < 0) {
herodragon._y = 0;
}
if (herodragon._y > 370) {
herodragon._y = 370;
}
herodragon._rotation = (dragon[0].dright * 3) - (dragon[0].dleft * 3);
if (dragon[0].ddown > 0) {
if (herodragon._currentframe < 20) {
herodragon.gotoAndPlay(herodragon._currentframe + 20);
} else if (herodragon._currentframe > 40) {
herodragon.gotoAndPlay(herodragon._currentframe - 20);
}
} else if (dragon[0].dup > 0) {
if (herodragon._currentframe < 20) {
herodragon.gotoAndPlay(herodragon._currentframe + 40);
} else if (herodragon._currentframe < 40) {
herodragon.gotoAndPlay(herodragon._currentframe + 20);
}
} else if (herodragon._currentframe > 40) {
herodragon.gotoAndPlay(herodragon._currentframe - 40);
} else if (herodragon._currentframe > 20) {
herodragon.gotoAndPlay(herodragon._currentframe - 20);
}
if (every < 1) {
every++;
} else {
if (locy > 20) {
locy--;
}
loadScreen();
mapLocation.text = (locx + ", ") + locy;
every = 0;
}
var _local2 = 0;
while (_local2 < 10) {
this["cloud" + _local2]._x = this["cloud" + _local2]._x - cloudspeed[_local2];
if (this["cloud" + _local2]._x < -200) {
this["cloud" + _local2]._x = (Math.random() * 200) + 700;
this["cloud" + _local2]._y = Math.random() * 200;
this["cloud" + _local2]._xscale = (Math.random() * 200) + 100;
this["cloud" + _local2]._yscale = Math.random() * 120;
}
_local2++;
}
moveMissles();
if (shoot) {
mouseisdown();
}
};
this.onMouseUp = function () {
shoot = false;
shcount = 0;
};
this.onMouseDown = function () {
shoot = true;
};
Frame 5
stop();
if (_global.LEVEL == 1) {
lvl = "You have been successful in the destruction of the giant Bat citadel!\rThe WitchLord has sent his Fire-Citadel into the ice mountains to destroy the eskimos hiding in the caverns, it is protected by a fleet of Red dragons. Beware of their firey breath!";
} else if (_global.LEVEL == 2) {
lvl = "With the destruction of the Fire-Citadel, the eskimos rejoice and give you offerings of food and gifts. You rest peacefully that night knowing that you have done some good in the lives of the people.\rEarly in the morning you hear of the WitchLord sending another citadel towards one of the only remaining cities of Kryndoria. You flight to intercept";
} else if (_global.LEVEL == 3) {
lvl = "Victory has arrived again and the people of the city rejoice. Once again you are given more gifts.\rHowever the festivities last for only a few hours as knews that another citadel will be arriving by sunset.";
} else if (_global.LEVEL == 4) {
lvl = "Exhausted by the battle you fly quickly back to the city for rest.\rSoon after the alarm bells sound in the middle of the night. Another citadel is almost at the city. You fly to stop their approach.";
} else if (_global.LEVEL == 5) {
lvl = "The fight had lasted to the early morning, but unfortunately it you can't stop for rest as another citadel approaches.";
} else if (_global.LEVEL == 6) {
lvl = "Numb from the last battle, your anger increases to an overwhelming feeling. It is time to finish this. You fly into the WitchLords territory to destroy his domain.";
} else {
lvl = "Game Complete!";
}
var j = 1;
while (j < 14) {
this["graphpoint" + j].swapDepths;
removeMovieClip("graphpoint" + j);
var i = 0;
while (i < ((sections * 4) + 1)) {
this[(("buildingr" + j) + "c") + i].swapDepths(1);
removeMovieClip((("buildingr" + j) + "c") + i);
i++;
}
j++;
}
this.herodragon.swapDepths(1);
this.herodragon.removeMovieClip();
var i = 1;
while (i < (unitcount + 1)) {
this["baddragon" + i].swapDepths(1);
this["baddragon" + i].removeMovieClip();
i++;
}
var j = 1;
while (j < 14) {
this["graphpoint" + j].swapDepths;
removeMovieClip("graphpoint" + j);
var rowcount = (2 + (j * 2));
var sections = ((Math.ceil(((rowcount / 2) - 2) / 4) * 2) + 1);
var i = 0;
while (i < ((sections * 4) + 1)) {
this[(("buildingr" + j) + "c") + i].swapDepths(1);
removeMovieClip((("buildingr" + j) + "c") + i);
i++;
}
j++;
}
Frame 6
stop();
Frame 7
stop();
Symbol 70 MovieClip [poisonbolt] Frame 1
this._rotation = this._rotation + 5;
Symbol 71 MovieClip [iceball] Frame 1
var i = 0;
while (i < 10) {
attachMovie("ice", "ice" + i, i);
this["ice" + i]._x = int(Math.random() * 60) - 30;
this["ice" + i]._y = int(Math.random() * 60) - 30;
this["ice" + i]._rotation = int(Math.random() * 350);
this["ice" + i]._alpha = 35;
this["ice" + i]._xscale = int(Math.random() * 90) + 10;
this["ice" + i]._yscale = int(Math.random() * 90) + 10;
i++;
}
Symbol 71 MovieClip [iceball] Frame 3
gotoAndPlay (2);
Symbol 78 MovieClip [powerupvision] Frame 9
stop();
Symbol 82 MovieClip [lightning] Frame 1
Symbol 94 MovieClip [toxic] Frame 1
var i = 0;
while (i < 20) {
attachMovie("toxicparticle", "tp" + i, i);
this["tp" + i]._x = int(Math.random() * 140) - 70;
this["tp" + i]._y = int(Math.random() * 140) - 70;
var rand = (int(Math.random() * 50) + 50);
this["tp" + i]._xscale = rand;
this["tp" + i]._yscale = rand;
i++;
}
Symbol 94 MovieClip [toxic] Frame 2
stop();
Symbol 127 MovieClip [submitter] Frame 1
var subcount = 0;
Symbol 127 MovieClip [submitter] Frame 10
if (subcount < 6) {
subcount++;
this.attachMovie("subp", "subp" + subcount, subcount);
this["subp" + subcount]._x = (subcount * 20) - 80;
this["subp" + subcount]._y = -12;
trace(subcount);
gotoAndPlay (2);
} else {
_parent.scorebox.swapDepths(1);
_parent.scorebox.removeMovieClip();
getURL ("http://www.freeflashgameplayer.com/highscores.php?game=dragonflight", "_blank");
_parent.gotoAndStop(2);
this.swapDepths(1);
this.removeMovieClip();
}
Symbol 134 MovieClip [nextquest] Frame 1
this.onPress = function () {
_global.LEVEL++;
_parent.gotoAndStop(3);
};
this.onRollOver = function () {
ClickSound = new Sound();
ClickSound.attachSound("arrowhit");
ClickSound.start();
change_color = new Color(this.begin);
change_color.setRGB(16711680);
};
this.onRollOut = function () {
change_color = new Color(this.begin);
change_color.setRGB(0);
};
Symbol 197 MovieClip [explosion1] Frame 34
stop();
this.removeMovieClip();
Symbol 199 MovieClip [more] Frame 1
this.onPress = function () {
getURL ("http://www.freeflashgameplayer.com", "_blank");
};
this.onRollOver = function () {
ClickSound = new Sound();
ClickSound.attachSound("arrowhit");
ClickSound.start();
change_color = new Color(this.begin);
change_color.setRGB(16711680);
};
this.onRollOut = function () {
change_color = new Color(this.begin);
change_color.setRGB(0);
};
Symbol 201 MovieClip [settings] Frame 1
this.onPress = function () {
_parent.box.removeMovieClip();
_parent.attachMovie("box", "box", 1);
_parent.box._x = 70;
_parent.box._y = 10;
_parent.box.attachMovie("story", "story", 1);
};
this.onRollOver = function () {
ClickSound = new Sound();
ClickSound.attachSound("arrowhit");
ClickSound.start();
change_color = new Color(this.begin);
change_color.setRGB(16711680);
};
this.onRollOut = function () {
change_color = new Color(this.begin);
change_color.setRGB(0);
};
Symbol 203 MovieClip [how] Frame 1
this.onPress = function () {
_parent.box.removeMovieClip();
_parent.attachMovie("box", "box", 1);
_parent.box._x = 70;
_parent.box._y = 10;
_parent.box.attachMovie("keys", "keys", 1);
};
this.onRollOver = function () {
ClickSound = new Sound();
ClickSound.attachSound("arrowhit");
ClickSound.start();
change_color = new Color(this.begin);
change_color.setRGB(16711680);
};
this.onRollOut = function () {
change_color = new Color(this.begin);
change_color.setRGB(0);
};
Symbol 205 MovieClip [play] Frame 1
this.onPress = function () {
_parent.box.removeMovieClip();
_parent.gotoAndStop(3);
};
this.onRollOver = function () {
ClickSound = new Sound();
ClickSound.attachSound("arrowhit");
ClickSound.start();
change_color = new Color(this.begin);
change_color.setRGB(16711680);
};
this.onRollOut = function () {
change_color = new Color(this.begin);
change_color.setRGB(0);
};
Symbol 514 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 350 MovieClip [bloodvision] Frame 9
stop();
Symbol 427 MovieClip [explosion2] Frame 38
stop();
this.removeMovieClip();
Symbol 438 MovieClip [firesmoke] Frame 1
this._alpha--;
Symbol 487 MovieClip [herodragon] Frame 9
_parent.flapwings.setVolume(75);
_parent.flapwings.start();
Symbol 487 MovieClip [herodragon] Frame 16
gotoAndPlay (1);
Symbol 487 MovieClip [herodragon] Frame 29
_parent.flapwings.setVolume(75);
_parent.flapwings.start();
Symbol 487 MovieClip [herodragon] Frame 36
gotoAndPlay (21);
Symbol 487 MovieClip [herodragon] Frame 49
_parent.flapwings.setVolume(75);
_parent.flapwings.start();
Symbol 487 MovieClip [herodragon] Frame 56
gotoAndPlay (41);
Symbol 500 Button
on (release, keyPress "<Enter>") {
sendAction = new LoadVars();
System.security.allowInsecureDomain("www.freeflashgameplayer.com");
System.security.allowDomain("www.freeflashgameplayer.com");
sendAction.sendAndLoad((("http://www.freeflashgameplayer.com/postscores.php?game=dragonflight&name=" + pname) + "&score=") + _global.SCORE, sendAction, "POST");
getURL ("http://www.freeflashgameplayer.com/highscores.php?game=dragonflight", "_blank");
_parent.attachMovie("submitter", "submitter", 99999560);
_parent.submitter._x = 320;
_parent.submitter._y = 200;
_parent.submitter._xscale = 200;
_parent.submitter._yscale = 200;
}
Symbol 508 Button
on (release, keyPress "<Enter>") {
sendAction = new LoadVars();
trace(pname);
System.security.allowInsecureDomain("www.freeflashgameplayer.com");
System.security.allowDomain("www.freeflashgameplayer.com");
sendAction.sendAndLoad((("http://www.freeflashgameplayer.com/postscores.php?game=dragonflight&name=" + pname) + "&score=") + _global.SCORE, sendAction, "POST");
getURL ("http://www.freeflashgameplayer.com/highscores.php?game=dragonflight", "_blank");
attachMovie("submitter", "submitter", 99999560);
submitter._x = 320;
submitter._y = 200;
submitter._xscale = 200;
submitter._yscale = 200;
}