Frame 1
_root.musicenabled = true;
_root.effectsenabled = true;
_root.uzicheat = false;
_root.destsite = "newgrounds";
stop();
Frame 2
stop();
but01.delay = false;
but01._alpha = 0;
Instance of Symbol 45 MovieClip in Frame 2
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
pent.knife._rotation = (loaded * 360) / total;
pent.knifeshad._rotation = (loaded * 360) / total;
percent = (loaded * 100) / total;
if (percent >= 100) {
if (can1._currentframe == 1) {
can1.gotoAndPlay(2);
_root.but01.selectabl = true;
}
}
if (percent >= 90) {
if (can10._currentframe == 1) {
can10.gotoAndPlay(2);
}
}
if (percent >= 80) {
if (can9._currentframe == 1) {
can9.gotoAndPlay(2);
}
}
if (percent >= 70) {
if (can8._currentframe == 1) {
can8.gotoAndPlay(2);
}
}
if (percent >= 60) {
if (can7._currentframe == 1) {
can7.gotoAndPlay(2);
}
}
if (percent >= 50) {
if (can6._currentframe == 1) {
can6.gotoAndPlay(2);
}
}
if (percent >= 40) {
if (can5._currentframe == 1) {
can5.gotoAndPlay(2);
}
}
if (percent >= 30) {
if (can4._currentframe == 1) {
can4.gotoAndPlay(2);
}
}
if (percent >= 20) {
if (can3._currentframe == 1) {
can3.gotoAndPlay(2);
}
}
if (percent >= 10) {
if (can2._currentframe == 1) {
can2.gotoAndPlay(2);
}
}
}
Instance of Symbol 53 MovieClip "but01" in Frame 2
onClipEvent (enterFrame) {
if ((delay == false) && (selectabl == true)) {
delay = true;
_alpha = 30;
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
}
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
gotoAndStop (2);
this.useHandCursor = false;
selectabl = false;
_root.fadeobjectnew.gotoAndPlay(51);
}
}
Frame 3
fakesound = new Sound();
fakesound.setVolume(100);
Frame 4
stopAllSounds();
introplayer = new Sound();
introplayer.setVolume(0);
if (_root.musicenabled == true) {
introplayer.attachSound("intromusic");
introplayer.start(0, 9999);
}
buttween.gotoAndPlay(2);
disableall = function () {
buttween.but01.selectabl = false;
buttween.but02.selectabl = false;
buttween.but03.selectabl = false;
buttween.but04.selectabl = false;
};
Instance of Symbol 160 MovieClip in Frame 4
onClipEvent (enterFrame) {
vol = _root.introplayer.getVolume();
if ((_root.fader._currentframe <= 50) && (vol < 100)) {
_root.introplayer.setVolume(vol + 2);
}
if ((_root.fader._currentframe > 50) && (vol > 0)) {
_root.introplayer.setVolume(vol - 2);
}
}
Instance of Symbol 167 MovieClip "buttween" in Frame 4
onClipEvent (enterFrame) {
if (this._currentframe <= 59) {
}
}
Instance of Symbol 172 MovieClip in Frame 4
onClipEvent (load) {
if (_root.destsite == "gondor") {
_visible = false;
}
}
Frame 5
stop();
_root.leveldata_dragonsremember = _root.leveldata_dragonsleft;
spawnlapse = 3;
if (_root.uzicheat == true) {
wizard.arm.gotoAndStop(3);
currentspell = 3;
buildspeed = 25;
wizard.head.hat.gotoAndStop(2);
radar.playerblip.gotoAndStop(8);
} else {
wizard.arm.gotoAndStop(2);
currentspell = 2;
buildspeed = _root.attrib_buildspeed;
}
wizard.starttofade = undefined;
gameframe = _root._currentframe;
towerhealthcounter._visible = true;
cooldowncounter._visible = true;
towerhealthlogo._visible = true;
timeholder._visible = true;
tower._visible = true;
wizard._visible = true;
cooldown = 0;
warner._visible = true;
radar._visible = true;
mil = 0;
mild = "00";
sec = 0;
secd = "00";
min = 0;
numberofcorpses = 0;
mind = "00";
hour = 0;
pdsize = 0;
makedrag = 0;
soundobj = new Sound();
soundobj.setVolume(0);
if (_root.musicenabled == true) {
soundobj.attachSound("music");
soundobj.start(0, 1000);
}
cel = 0;
num = 1;
ycam = 0;
xcam = 0;
enproj = 0;
currentvel = 0;
handfurther = 100;
lookshock = 0;
xcam = (225 - _xmouse) + (random(currentvel * 2) - currentvel);
ycam = (175 - _ymouse) + (random(currentvel * 2) - currentvel);
enemylist = new Array();
this.shake = function (mag) {
if (mag > currentvel) {
currentvel = mag;
}
};
this.squelch = function () {
stopAllSounds();
};
this.playsound = function (effect) {
if (_root.effectsenabled == true) {
soundobj.attachSound(effect);
soundobj.start();
}
};
this.lookshocker = function (forcerotation, force) {
if ((Math.sin((Math.PI/180) * forcerotation) * force) < 0) {
lookshock = lookshock + ((-Math.sin((Math.PI/180) * forcerotation)) * force);
} else {
lookshock = lookshock + (Math.sin((Math.PI/180) * forcerotation) * force);
}
};
createEmptyMovieClip("fakebullet", 68000);
shooting = function () {
playsound("gun");
fakebullet.bulletx = wizard.xpos + (Math.sin((Math.PI/180) * (wizard.arm._rotation + 90)) * 30);
fakebullet.bullety = (wizard.ypos - 60) - (Math.cos((Math.PI/180) * (wizard.arm._rotation + 90)) * 30);
fakebullet.xshift = Math.sin((Math.PI/180) * (wizard.arm._rotation + 90)) * 10;
fakebullet.yshift = (-Math.cos((Math.PI/180) * (wizard.arm._rotation + 90))) * 10;
fakebullet._rotation = wizard.arm._rotation;
bmoves = 100;
trace("shoot");
while (bmoves > 0) {
bmoves--;
fakebullet.bulletx = fakebullet.bulletx + (Math.sin((Math.PI/180) * (wizard.arm._rotation + 90)) * 6.5);
fakebullet.bullety = fakebullet.bullety - (Math.cos((Math.PI/180) * (wizard.arm._rotation + 90)) * 6.5);
d = 0;
if (enemylist.length > 0) {
while (d < enemylist.length) {
fakebullet._x = fakebullet.bulletx + xcam;
fakebullet._y = fakebullet.bullety + ycam;
if (eval ("enemy" + String(enemylist[d])).hitTest(fakebullet._x, fakebullet._y, true)) {
makeeffect("forcehit", fakebullet.bulletx, fakebullet.bullety, this._rotation, 0, 0, 0, 0, 60);
eval ("enemy" + String(enemylist[d])).health = eval ("enemy" + String(enemylist[d])).health - 5;
eval ("enemy" + String(enemylist[d])).hitfromx = fakebullet.xshift;
eval ("enemy" + String(enemylist[d])).hitfromy = fakebullet.yshift;
bmoves = 0;
}
d++;
}
}
}
fakebullet._x = 9999999 /* 0x98967F */;
fakebullet._y = 9999999 /* 0x98967F */;
};
this.force = function (xposy, yposy, force) {
if (enemylist.length > 0) {
el = 0;
while (el < enemylist.length) {
xdist = xposy - eval ("enemy" + el).xpos;
ydist = yposy - eval ("enemy" + el).ypos;
pdist = Math.sqrt((xdist * xdist) + (ydist * ydist));
if (pdist < (force * 10)) {
}
el++;
}
}
};
this.killall = function () {
funcnum = 0;
while (funcnum <= enemylist.length) {
removeMovieClip(eval ("enemy" + enemylist[funcnum]));
funcnum++;
}
trace("function ran");
funcnum = 300;
while (funcnum > -2) {
removeMovieClip(eval ("effect" + funcnum));
funcnum--;
}
removeMovieClip("proj1");
removeMovieClip("proj2");
removeMovieClip("proj3");
removeMovieClip("proj4");
removeMovieClip("proj0");
};
this.makeenemy = function (breed) {
thedragonsize = 100 + _root.leveldata_dragonsize;
trace(thedragonsize);
e = 0;
while (eval ("enemy" + e)._visible != undefined) {
e++;
}
attachMovie(breed, "enemy" + e, e);
enemylist[enemylist.length] = e;
enemylist = enemylist.sort();
eval ("enemy" + e).idnum = e;
if (breed == "dragonpup") {
temprandom = random(2);
if (temprandom == 1) {
eval ("enemy" + e).xpos = 850 + thedragonsize;
eval ("enemy" + e).facedir = 1;
} else {
eval ("enemy" + e).xpos = -395 - thedragonsize;
eval ("enemy" + e).facedir = -1;
}
eval ("enemy" + e).ypos = 200 - random(400);
radar.attachMovie("eblip", "blip" + e, e);
eval ("enemy" + e)._x = eval ("enemy" + e).xpos + xcam;
eval ("enemy" + e)._y = eval ("enemy" + e).ypos + ycam;
eval ("radar.blip" + e)._x = (eval ("enemy" + e).xpos - 225) / 10;
eval ("radar.blip" + e)._y = (eval ("enemy" + e).ypos - 170) / 10;
eval ("enemy" + e)._xscale = eval ("enemy" + e).facedir * thedragonsize;
eval ("enemy" + e)._yscale = thedragonsize;
eval ("enemy" + e).xshift = 0;
eval ("enemy" + e).yshift = 0;
eval ("enemy" + e).health = thedragonsize / 3.1;
eval ("enemy" + e).createEmptyMovieClip("imaginary", 12);
eval ("enemy" + e).movecount = 0;
eval ("enemy" + e).myid = e;
eval ("enemy" + e).firecount = random(99);
eval ("enemy" + e).onEnterFrame = function () {
if (this.health <= 0) {
removeMovieClip(eval ("_root.radar.blip" + this.myid));
_root.attrib_cash = _root.attrib_cash + ((thedragonsize * 0.42) + random(4));
_root.attrib_score = _root.attrib_score + Math.round(thedragonsize * 0.42);
_root.leveldata_dragonsremember--;
makeeffect("splode", this.xpos, this.ypos, this._rotation);
playsound("diedrag");
playsound("boom");
attachMovie("corpse", "corpse" + numberofcorpses, numberofcorpses + 1500);
eval ("corpse" + numberofcorpses)._xscale = this._xscale;
eval ("corpse" + numberofcorpses)._yscale = this._yscale;
eval ("corpse" + numberofcorpses).xpos = this.xpos;
eval ("corpse" + numberofcorpses).ypos = this.ypos;
eval ("corpse" + numberofcorpses)._x = this.xpos + xcam;
eval ("corpse" + numberofcorpses)._y = this.ypos + ycam;
eval ("corpse" + numberofcorpses)._rotation = this._rotation;
eval ("corpse" + numberofcorpses).xshift = this.hitfromx;
eval ("corpse" + numberofcorpses).yshift = this.hitfromy;
eval ("corpse" + numberofcorpses).onEnterFrame = function () {
if (_root._currentframe != gameframe) {
removeMovieClip(this);
}
this.yshift = this.yshift + 1;
this.xshift = this.xshift / 1.1;
this.xpos = this.xpos + this.xshift;
this.ypos = this.ypos + this.yshift;
this._x = this.xpos + xcam;
this._y = this.ypos + ycam;
this._rotation = this._rotation + (3 * (this._xscale / 100));
if (this.ypos > 800) {
playsound("thump");
shake(3);
removeMovieClip(this);
}
};
numberofcorpses++;
removeMovieClip(this);
}
this.xpos = this.xpos + this.xshift;
this.ypos = this.ypos + this.yshift;
this.xshift = this.xshift / 1.1;
this.yshift = this.yshift / 1.1;
this.rdist = this.imaginary._rotation - this._rotation;
this._rotation = this._rotation + (this.rdist / 10);
this.movecount = this.movecount + random(5);
if ((this.movecount > 15) && (this.fireman == true)) {
this.fireman = false;
this.firecount = this.firecount + (random(10) + random((this._yscale - 100) / 2.5));
if (this.firecount > 100) {
eval ("_root.radar.blip" + this.myid).eb.warner.gotoAndPlay(2);
if (this.facedir == 1) {
makeeffect("shockwave", this.xpos + ((Math.sin((Math.PI/180) * (this._rotation - 90)) * 25) * (this._xscale / 100)), this.ypos + ((Math.cos((Math.PI/180) * (this._rotation - 90)) * 25) * (this._xscale / 100)), this._rotation + 180);
} else {
makeeffect("shockwave", this.xpos + ((Math.sin((Math.PI/180) * (this._rotation - 90)) * 25) * (this._xscale / 100)), this.ypos + ((Math.cos((Math.PI/180) * (this._rotation - 90)) * 25) * (this._xscale / 100)), this._rotation);
}
playsound("launchfire");
attachMovie("fireball", "enbullet" + enproj, enproj + 1000);
eval ("enbullet" + enproj).xpos = this.xpos + ((Math.sin((Math.PI/180) * (this._rotation - 90)) * 26) * (this._xscale / 100));
eval ("enbullet" + enproj)._x = eval ("enbullet" + enproj).xpos;
eval ("enbullet" + enproj).ypos = this.ypos + ((Math.cos((Math.PI/180) * (this._rotation - 90)) * 26) * (this._xscale / 100));
eval ("enbullet" + enproj)._y = eval ("enbullet" + enproj).ypos;
eval ("enbullet" + enproj).facedir = this.facedir;
eval ("enbullet" + enproj)._rotation = this._rotation;
eval ("enbullet" + enproj)._xscale = -this._xscale;
eval ("enbullet" + enproj)._yscale = this._yscale;
eval ("enbullet" + enproj).integrity = 100 + (_root.leveldata_dragonsize * 2);
eval ("enbullet" + enproj).popaway = function () {
makeeffect("splode", this.xpos, this.ypos, this._rotation, 0, 0, 0, 0, this._yscale * 0.75);
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
playsound("lilbang");
shake(2);
};
eval ("enbullet" + enproj).explode = function () {
makeeffect("splode", this.xpos, this.ypos, this._rotation, 0, 0, 0, 0, this._yscale * 0.75);
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, (this._yscale * 0.1) + (this._yscale * 0.9));
playsound("lilbang");
shake(10);
};
eval ("enbullet" + enproj).onEnterFrame = function () {
if (_root._currentframe != gameframe) {
removeMovieClip(this);
}
this._x = this.xpos + xcam;
this._y = this.ypos + ycam;
if (this.hitTest(_root._xmouse, _root._ymouse, true) && (spacstat == "now")) {
this.integrity = this.integrity - _root.attrib_deflect;
makeeffect("forcehit", wizard.xpos + (Math.sin((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther), (wizard.ypos - 60) - (Math.cos((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther), wizard.arm._rotation);
makeeffect("forcehit", _root._xmouse - xcam, _root._ymouse - ycam, 0, 0, 0, 0, 0, 100);
playsound("forcepop");
if (this.integrity <= 0) {
this.popaway();
removeMovieClip(this);
}
}
if (this.facedir == -1) {
this.xpos = this.xpos + (Math.sin((Math.PI/180) * (this._rotation + 90)) * 7);
this.ypos = this.ypos - (Math.cos((Math.PI/180) * (this._rotation + 90)) * 7);
} else {
this.xpos = this.xpos + (Math.sin((Math.PI/180) * (this._rotation - 90)) * 7);
this.ypos = this.ypos - (Math.cos((Math.PI/180) * (this._rotation - 90)) * 7);
}
if (this.ypos > 460) {
this.explode();
this.removeMovieClip();
} else if (((this.ypos < -400) || (this.xpos > 1300)) || (this.xpos < -700)) {
this.removeMovieClip();
} else if (_root.tower.hitTest(this._x, this._y, true)) {
this.explode();
if (_root.wizard.gamestatus == undefined) {
_root.attrib_towerhealth = _root.attrib_towerhealth - ((this._yscale - 25) * 0.75);
}
this.removeMovieClip();
}
};
enproj++;
this.firecount = 0;
}
}
if (this.movecount > 30) {
this.fireman = true;
this.movecount = 0;
if (this.facedir == -1) {
this.ydist = this.ypos - wizard.ypos;
this.yshift = (random((-this.ydist) / 30) - ((-this.ydist) / 90)) - random(3);
this.xdist = this.xpos - (wizard.xpos - 50);
this.xshift = ((random((-this.xdist) / 30) - 3) + random(11)) - 5;
this.dist = Math.sqrt((this.xdist * this.xdist) + (this.ydist * this.ydist));
if (this.ydist < 0) {
this.angle = (Math.PI*2) - Math.acos(this.xdist / this.dist);
} else {
this.angle = Math.acos(this.xdist / this.dist);
}
this.imaginary._rotation = ((((this.angle * 180) / Math.PI) + 180) - 10) + random(20);
}
if (this.facedir == 1) {
this.ydist = this.ypos - wizard.ypos;
this.yshift = (random((-this.ydist) / 30) - ((-this.ydist) / 90)) - random(3);
this.xdist = (wizard.xpos + 50) - this.xpos;
this.xshift = (((-random((-this.xdist) / 30)) + 3) + random(11)) - 5;
this.dist = Math.sqrt((this.xdist * this.xdist) + (this.ydist * this.ydist));
if (this.ydist < 0) {
this.angle = (Math.PI*2) - Math.acos(this.xdist / this.dist);
} else {
this.angle = Math.acos(this.xdist / this.dist);
}
this.imaginary._rotation = (((((-this.angle) * 180) / Math.PI) + 180) - 10) + random(20);
}
}
this._x = this.xpos + xcam;
this._y = this.ypos + ycam;
eval ("_root.radar.blip" + this.myid)._x = (this.xpos - 225) / 10;
eval ("_root.radar.blip" + this.myid)._y = (this.ypos - 170) / 10;
if (this.hitTest(proj1._x, proj1._y, true) && (proj1._visible)) {
this.hitfromx = proj1.xshift;
this.hitfromy = proj1.yshift;
proj1.explode();
removeMovieClip(proj1);
this.health = this.health - _root.attrib_magicdamage;
} else if (this.hitTest(proj2._x, proj2._y, true) && (proj2._visible)) {
this.hitfromx = proj2.xshift;
this.hitfromy = proj2.yshift;
proj2.explode();
removeMovieClip(proj2);
this.health = this.health - _root.attrib_magicdamage;
} else if (this.hitTest(proj3._x, proj3._y, true) && (proj3._visible)) {
this.hitfromx = proj3.xshift;
this.hitfromy = proj3.yshift;
proj3.explode();
removeMovieClip(proj3);
this.health = this.health - _root.attrib_magicdamage;
} else if (this.hitTest(proj4._x, proj4._y, true) && (proj4._visible)) {
this.hitfromx = proj4.xshift;
this.hitfromy = proj4.yshift;
proj4.explode();
removeMovieClip(proj4);
this.health = this.health - _root.attrib_magicdamage;
} else if (this.hitTest(proj0._x, proj0._y, true) && (proj0._visible)) {
this.hitfromx = proj0.xshift;
this.hitfromy = proj0.yshift;
proj0.explode();
removeMovieClip(proj0);
this.health = this.health - _root.attrib_magicdamage;
}
};
}
if (breed == "orc") {
temprandom = random(2);
if (temprandom == 1) {
eval ("enemy" + e).xpos = 850;
eval ("enemy" + e).facedir = 1;
} else {
eval ("enemy" + e).xpos = -395;
eval ("enemy" + e).facedir = -1;
}
eval ("enemy" + e).ypos = 440;
eval ("enemy" + e)._xscale = eval ("enemy" + e).facedir * 90;
eval ("enemy" + e)._yscale = 90;
eval ("enemy" + e).onEnterFrame = function () {
if ((this.xpos > 140) && (this.xpos < 310)) {
if (this._currentframe < 43) {
this.gotoAndPlay(43);
}
} else {
this.xpos = this.xpos - (this.facedir * 3);
}
this._x = this.xpos + xcam;
this._y = this.ypos + ycam;
if (this.hitTest(proj1._x, proj1._y, true) && (proj1._visible)) {
proj1.explode();
removeMovieClip(proj1);
removeMovieClip(this);
} else if (this.hitTest(proj2._x, proj2._y, true) && (proj2._visible)) {
proj2.explode();
removeMovieClip(proj2);
removeMovieClip(this);
} else if (this.hitTest(proj3._x, proj3._y, true) && (proj3._visible)) {
proj3.explode();
removeMovieClip(proj3);
removeMovieClip(this);
} else if (this.hitTest(proj4._x, proj4._y, true) && (proj4._visible)) {
proj4.explode();
removeMovieClip(proj4);
removeMovieClip(this);
} else if (this.hitTest(proj0._x, proj0._y, true) && (proj0._visible)) {
proj0.explode();
removeMovieClip(proj0);
removeMovieClip(this);
}
};
}
};
this.makeeffect = function (pic, xps, yps, rot, ashift, xshift, yshift, rshift, scale) {
if (current >= 100) {
current = 0;
}
attachMovie(pic, "effect" + current, current + 80000);
eval ("effect" + current)._xscale = scale;
eval ("effect" + current)._yscale = scale;
eval ("effect" + current).xpos = xps;
eval ("effect" + current).ypos = yps;
if (ashift == undefined) {
ashift = 0;
}
eval ("effect" + current).ashift = ashift;
if (xshift == undefined) {
xshift = 0;
}
eval ("effect" + current).xshift = xshift;
if (yshift == undefined) {
yshift = 0;
}
eval ("effect" + current).yshift = yshift;
if (rshift == undefined) {
rshift = 0;
}
eval ("effect" + current).rshift = rshift;
eval ("effect" + current)._x = xps + xcam;
eval ("effect" + current)._y = yps + ycam;
eval ("effect" + current)._rotation = rot;
eval ("effect" + current).onEnterFrame = function () {
this.xpos = this.xpos + Number(this.xshift);
this.ypos = this.ypos + Number(this.yshift);
this._x = this.xpos + xcam;
this._y = this.ypos + ycam;
this._alpha = this._alpha - Number(this.ashift);
this._rotation = this._rotation - Number(this.rshift);
};
current++;
};
this.onEnterFrame = function () {
currentvel = currentvel / 1.1;
lookshock = lookshock / 1.05;
xcam = (225 - _xmouse) + (random(currentvel * 2) - currentvel);
ycam = ((175 - _ymouse) + (random(currentvel * 2) - currentvel)) + (lookshock * 5);
if (cooldown < 100) {
if ((cooldown + buildspeed) >= 100) {
cooldown = 100;
cooldowncounter.percent._xscale = 100;
} else {
cooldown = cooldown + buildspeed;
cooldowncounter.percent._xscale = cooldown;
}
}
if (enemylist.length > 0) {
cel++;
if (eval ("enemy" + String(enemylist[cel]))._visible == undefined) {
enemylist.splice(cel, 1);
}
if (cel >= (enemylist.length - 1)) {
cel = -1;
}
}
if (Key.isDown(32) && (spacstat == "free")) {
spacstat = "now";
} else if (Key.isDown(32) && (spacstat == "now")) {
spacstat = "down";
} else if (!Key.isDown(32)) {
spacstat = "free";
}
if (_currentframe == gameframe) {
mil = mil + 1;
if (mil >= 15) {
mil = mil - 15;
if (_root.leveldata_dragonsleft > 0) {
spawnlapse--;
}
if (spawnlapse <= 0) {
trace(((("MADE: " + spawnlapse) + "=spawnlapse, ") + _root.leveldata_dragonsleft) + "=dragonsleft");
spawnlapse = _root.leveldata_senddelay;
_root.leveldata_dragonsleft--;
makeenemy("dragonpup");
}
}
}
};
this.onMouseUp = function () {
holdown = false;
};
this.onMouseDown = function () {
holdown = true;
temprand = random(60) + 20;
if ((((cooldown >= 100) && (!((wizard.arm._rotation > 32) && (wizard.arm._rotation < 137)))) && (_root._currentframe == gameframe)) && (currentspell == 2)) {
firecheck = 5;
if (num == 5) {
num = 0;
}
while (firecheck > 0) {
if (eval ("proj" + num)._visible == undefined) {
castspell(currentspell);
cooldown = 0;
firecheck = 0;
num++;
} else {
firecheck--;
}
}
}
};
this.castspell = function (curspell) {
if (curspell == 1) {
attachMovie("fireball", "proj" + num, num + 600);
playsound("fireballsound");
shake(2);
makeeffect("shockwave", wizard.xpos + (Math.sin((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther), (wizard.ypos - 60) - (Math.cos((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther), wizard.arm._rotation);
eval ("proj" + num).xpos = wizard.xpos + (Math.sin((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther);
eval ("proj" + num).ypos = (wizard.ypos - 60) - (Math.cos((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther);
eval ("proj" + num)._rotation = wizard.arm._rotation;
eval ("proj" + num).cycle = random(360) - 180;
eval ("proj" + num).explode = function () {
force(this.xpos, this.ypos, 10);
makeeffect("splode", this.xpos, this.ypos, this._rotation);
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, 10 + random(90));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, 10 + random(90));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, 10 + random(90));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, 10 + random(90));
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, random(10) - 5, random(10) - 5, 0, 10 + random(90));
playsound("boom");
shake(20);
};
eval ("proj" + num).onEnterFrame = function () {
this.flam = this.flam + random(5);
if (this.flam >= 5) {
this.flam = 0;
makeeffect("flamdot", this.xpos, this.ypos, 90, 5, 0, random(3), 0, 30 + random(90));
}
this.xpos = this.xpos + (Math.sin((Math.PI/180) * (this._rotation + 90)) * 8);
this.ypos = this.ypos - (Math.cos((Math.PI/180) * (this._rotation + 90)) * 8);
this._x = this.xpos + this._parent.xcam;
this._y = this.ypos + this._parent.ycam;
if (this.ypos > 460) {
this.explode();
this.removeMovieClip();
} else if (((this.ypos < -500) || (this.xpos > 1250)) || (this.xpos < -800)) {
this.removeMovieClip();
}
this.cycle = this.cycle + (18 + random(3));
if (this.cycle > 360) {
this.cycle = this.cycle - 360;
}
this._rotation = this._rotation + (Math.sin((Math.PI/180) * this.cycle) * 1.5);
};
}
if (((curspell == 2) && (_root._currentframe == gameframe)) && (!((wizard.arm._rotation > 32) && (wizard.arm._rotation < 137)))) {
attachMovie("spark", "proj" + num, num + 200);
playsound("sparkplay");
lookshocker(wizard.arm._rotation + 90, 5);
shake(1);
makeeffect("shockwave2", wizard.xpos + (Math.sin((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther), (wizard.ypos - 60) - (Math.cos((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther), wizard.arm._rotation);
temprand = random(60) + 20;
eval ("proj" + num).xpos = wizard.xpos + (Math.sin((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther);
eval ("proj" + num).ypos = (wizard.ypos - 60) - (Math.cos((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther);
eval ("proj" + num)._x = (wizard.xpos + (Math.sin((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther)) + xcam;
eval ("proj" + num)._y = ((wizard.ypos - 60) - (Math.cos((Math.PI/180) * (wizard.arm._rotation + 90)) * handfurther)) + ycam;
eval ("proj" + num)._xscale = 80 + (_root.attrib_magicdamage * 3);
eval ("proj" + num)._yscale = 80 + (_root.attrib_magicdamage * 3);
eval ("proj" + num)._rotation = wizard.arm._rotation;
eval ("proj" + num).cycle = random(360) - 180;
eval ("proj" + num).explode = function () {
shake(5);
makeeffect("sparksplode", (this.xpos - 10) + random(5), (this.ypos - 10) + random(5), this._rotation);
makeeffect("twinkle", this.xpos, this.ypos, random(360), 10, random(7) - 3, random(7) - 3, -10 + random(20), 10 + random(90));
makeeffect("twinkle", this.xpos, this.ypos, random(360), 10, random(7) - 3, random(7) - 3, -10 + random(20), 10 + random(90));
makeeffect("twinkle", this.xpos, this.ypos, random(360), 10, random(7) - 3, random(7) - 3, -10 + random(20), 10 + random(90));
makeeffect("twinkle", this.xpos, this.ypos, random(360), 10, random(7) - 3, random(7) - 3, -10 + random(20), 10 + random(90));
makeeffect("twinkle", this.xpos, this.ypos, random(360), 10, random(7) - 3, random(7) - 3, -10 + random(20), 10 + random(90));
playsound("sparkpop");
};
eval ("proj" + num).onEnterFrame = function () {
this.twink = this.twink + random(5);
if (this.twink >= 5) {
this.twink = 0;
makeeffect("twinkle", this.xpos, this.ypos, random(360), 10, 0, random(3), -10 + random(20), 10 + random(90));
}
this.xpos = this.xpos + (Math.sin((Math.PI/180) * (this._rotation + 90)) * 16);
this.xshift = Math.sin((Math.PI/180) * (this._rotation + 90)) * 16;
this.ypos = this.ypos - (Math.cos((Math.PI/180) * (this._rotation + 90)) * 16);
this.yshift = (-Math.cos((Math.PI/180) * (this._rotation + 90))) * 16;
this._x = this.xpos + this._parent.xcam;
this._y = this.ypos + this._parent.ycam;
if ((((this.ypos < -400) || (this.xpos > 850)) || (this.xpos < -400)) || (this.ypos > 600)) {
this.removeMovieClip();
}
this.cycle = this.cycle + (18 + random(3));
if (this.cycle > 360) {
this.cycle = this.cycle - 360;
}
this._rotation = this._rotation + (Math.sin((Math.PI/180) * this.cycle) * 1.5);
};
}
};
Instance of Symbol 176 MovieClip in Frame 5
onClipEvent (load) {
xpos = _x;
ypos = _y;
_x = (xpos + (_parent.xcam / 2));
_y = (ypos + (_parent.ycam / 2));
}
onClipEvent (enterFrame) {
_x = (xpos + (_parent.xcam / 2));
_y = (ypos + (_parent.ycam / 2));
}
Instance of Symbol 197 MovieClip "wizard" in Frame 5
onClipEvent (load) {
gamestatus = undefined;
swapDepths(50001);
xpos = _x;
ypos = _y;
trace("wizy " + ypos);
_x = (xpos + _parent.xcam);
_y = (ypos + _parent.ycam);
gracetime = 50;
}
onClipEvent (enterFrame) {
if (((((_root.holdown == true) && (_root.cooldown >= 100)) && (_root.currentspell == 3)) && (_root._currentframe == _root.gameframe)) && (!((arm._rotation > 32) && (arm._rotation < 137)))) {
arm.gotoAndPlay(3);
_root.shake(1);
_root.lookshocker(arm._rotation + 90, 0.5);
_root.cooldown = 0;
_root.shooting();
}
_x = (xpos + _parent.xcam);
_y = (ypos + _parent.ycam);
if (_root.attrib_towerhealth <= 0) {
_parent.shake(10);
if (gamestatus == undefined) {
if (starttofade == undefined) {
gamestatus = "defeat";
_root.towerhealthcounter._visible = false;
_root.cooldowncounter._visible = false;
_root.towerhealthlogo._visible = false;
_root.dragonsleftholder._visible = false;
_root.timeholder._visible = false;
_root.radar._visible = false;
_root.fadeobject.gotoAndPlay(50);
_root.playsound("rumble");
starttofade = true;
_root.winlose = "gameover";
}
}
}
if (((_root.enemylist.length == 0) && (_root.leveldata_dragonsleft <= 0)) && (gamestatus == undefined)) {
if (gracetime == 50) {
_root.welldone.gotoAndPlay(2);
}
gracetime--;
if ((starttofade == undefined) && (gracetime < 0)) {
gamestatus = "victory";
_root.leveldata_wavenumber++;
_root.winlose = "shop";
_root.fadeobject.gotoAndPlay(50);
starttofade = true;
}
}
}
Instance of Symbol 199 MovieClip "tower" in Frame 5
onClipEvent (load) {
swapDepths(50002);
xpos = _x;
ypos = _y;
trace("castlex" + ypos);
_x = (xpos + _parent.xcam);
_y = (ypos + _parent.ycam);
}
onClipEvent (enterFrame) {
_x = (xpos + _parent.xcam);
_y = (ypos + _parent.ycam);
}
Instance of Symbol 203 MovieClip "cooldowncounter" in Frame 5
onClipEvent (load) {
swapDepths(60002);
}
Instance of Symbol 206 MovieClip "towerhealthcounter" in Frame 5
onClipEvent (load) {
swapDepths(60003);
}
Instance of Symbol 12 MovieClip [radarobj] "radar" in Frame 5
onClipEvent (load) {
swapDepths(60027);
}
Instance of Symbol 210 MovieClip "timeholder" in Frame 5
/* no clip actions */
Instance of Symbol 213 MovieClip "dragonsleftholder" in Frame 5
onClipEvent (load) {
swapDepths(60001);
displaytype = "amount";
}
onClipEvent (enterFrame) {
if (_root.leveldata_dragonsremember <= 0) {
displaytype = "victory";
}
if (displaytype == "victory") {
displayer = "Wave clear!";
if (_root.radar._alpha > 0) {
_root.radar._alpha = _root.radar._alpha - 5;
}
}
if (displaytype == "amount") {
displayer = "Dragons remaining: " + _root.leveldata_dragonsremember;
}
}
Instance of Symbol 217 MovieClip "welldone" in Frame 5
onClipEvent (load) {
swapDepths(60029);
}
Instance of Symbol 219 MovieClip "towerhealthlogo" in Frame 5
onClipEvent (load) {
swapDepths(60004);
}
Instance of Symbol 151 MovieClip "fadeobject" in Frame 5
onClipEvent (load) {
swapDepths(200000);
}
onClipEvent (enterFrame) {
swapDepths(200000);
vol = _root.soundobj.getVolume();
if ((_currentframe <= 50) && (vol < 100)) {
_root.soundobj.setVolume(vol + 2);
}
if (((_currentframe > 50) && (_currentframe < 99)) && (vol > 0)) {
_root.soundobj.setVolume(vol - 2);
}
}
Instance of Symbol 250 MovieClip in Frame 6
on (press) {
_root.gotoAndStop(1);
}
Frame 7
holdy.NAME0 = "OOOOOOOO";
holdy.NAME1 = "OOOOOOOO";
holdy.NAME2 = "OOOOOOOO";
holdy.NAME3 = "OOOOOOOO";
holdy.NAME4 = "OOOOOOOO";
holdy.NAME5 = "OOOOOOOO";
holdy.NAME6 = "OOOOOOOO";
holdy.NAME7 = "OOOOOOOO";
holdy.NAME8 = "OOOOOOOO";
holdy.NAME9 = "OOOOOOOO";
holdy.SCORE0 = "OOOOOOOO";
holdy.SCORE1 = "OOOOOOOO";
holdy.SCORE2 = "OOOOOOOO";
holdy.SCORE3 = "OOOOOOOO";
holdy.SCORE4 = "OOOOOOOO";
holdy.SCORE5 = "OOOOOOOO";
holdy.SCORE6 = "OOOOOOOO";
holdy.SCORE7 = "OOOOOOOO";
holdy.SCORE8 = "OOOOOOOO";
holdy.SCORE9 = "OOOOOOOO";
if (destsite == "gondor") {
holdy.loadVariables("../read.php", "GET");
}
but01.delay = false;
but01._alpha = 30;
Instance of Symbol 233 MovieClip "but01" in Frame 7
onClipEvent (enterFrame) {
if ((delay == false) && (selectabl == true)) {
delay = true;
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
}
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
_root.gotoframe = "splash";
gotoAndStop (2);
this.useHandCursor = false;
selectabl = false;
_root.faderer.gotoAndPlay(50);
}
}
Instance of Symbol 290 MovieClip "faderer" in Frame 7
onClipEvent (enterFrame) {
if ((_root.holdy.NAME1 != "OOOOOOOO") && (_currentframe == 1)) {
play();
}
}
Frame 8
but01.delay = false;
but01._alpha = 30;
Instance of Symbol 233 MovieClip "but01" in Frame 8
onClipEvent (enterFrame) {
if ((delay == false) && (selectabl == true)) {
delay = true;
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
}
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
_root.gotoframe = "splash";
gotoAndStop (2);
this.useHandCursor = false;
selectabl = false;
_root.fader.gotoAndPlay(50);
}
}
Instance of Symbol 301 MovieClip in Frame 9
onClipEvent (load) {
if (_root.effectsenabled == true) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
on (release) {
if (_currentframe == 1) {
_root.effectsenabled = false;
gotoAndStop (2);
} else {
_root.effectsenabled = true;
gotoAndStop (1);
}
}
Instance of Symbol 301 MovieClip in Frame 9
onClipEvent (load) {
if (_root.musicenabled == true) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
on (release) {
if (_currentframe == 1) {
_root.musicenabled = false;
gotoAndStop (2);
} else {
_root.musicenabled = true;
gotoAndStop (1);
}
}
Instance of Symbol 301 MovieClip in Frame 9
onClipEvent (load) {
if (_quality == "HIGH") {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
on (release) {
if (_currentframe == 1) {
_quality = "LOW";
gotoAndStop (2);
} else {
_quality = "HIGH";
gotoAndStop (1);
}
}
Instance of Symbol 306 MovieClip in Frame 9
on (release) {
if (_root.uzicheat == false) {
_root.uzicheat = true;
} else {
_root.uzicheat = false;
}
}
Frame 10
_root.attrib_cash = Math.round(_root.attrib_cash);
if (_root.leveldata_wavenumber == 1) {
_root.leveldata_dragonsize = 0;
_root.leveldata_dragonsleft = 5;
_root.leveldata_senddelay = 10;
} else if (_root.leveldata_wavenumber == 2) {
_root.leveldata_dragonsize = 5;
_root.leveldata_dragonsleft = 7;
_root.leveldata_senddelay = 10;
} else if (_root.leveldata_wavenumber == 3) {
_root.leveldata_dragonsize = 10;
_root.leveldata_dragonsleft = 10;
_root.leveldata_senddelay = 9;
} else if (_root.leveldata_wavenumber == 4) {
_root.leveldata_dragonsize = 15;
_root.leveldata_dragonsleft = 13;
_root.leveldata_senddelay = 9;
} else if (_root.leveldata_wavenumber == 5) {
_root.leveldata_dragonsize = 20;
_root.leveldata_dragonsleft = 15;
_root.leveldata_senddelay = 8;
} else if (_root.leveldata_wavenumber == 6) {
_root.leveldata_dragonsize = 23;
_root.leveldata_dragonsleft = 17;
_root.leveldata_senddelay = 8;
} else if (_root.leveldata_wavenumber == 7) {
_root.leveldata_dragonsize = 25;
_root.leveldata_dragonsleft = 20;
_root.leveldata_senddelay = 7;
} else if (_root.leveldata_wavenumber == 8) {
_root.leveldata_dragonsize = 28;
_root.leveldata_dragonsleft = 23;
_root.leveldata_senddelay = 7;
} else if (_root.leveldata_wavenumber == 9) {
_root.leveldata_dragonsize = 30;
_root.leveldata_dragonsleft = 25;
_root.leveldata_senddelay = 6;
} else if (_root.leveldata_wavenumber == 10) {
_root.leveldata_dragonsize = 33;
_root.leveldata_dragonsleft = 35;
_root.leveldata_senddelay = 5;
}
leveldisplay = ("Wave " + _root.leveldata_wavenumber) + " is coming next!";
stopAllSounds();
introplayer = new Sound();
introplayer.setVolume(0);
if (_root.musicenabled == true) {
introplayer.attachSound("shopmusic");
introplayer.start(0, 9999);
}
Instance of Symbol 53 MovieClip "but01" in Frame 10
onClipEvent (enterFrame) {
if ((delay == false) && (selectabl == true)) {
delay = true;
_alpha = 30;
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
}
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
gotoAndStop (2);
this.useHandCursor = false;
selectabl = false;
_root.fadeobjectnew.gotoAndPlay(51);
}
}
Instance of Symbol 322 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (hitTest(_root._xmouse, _root._ymouse, true)) {
textobj._visible = true;
} else {
textobj._visible = false;
}
}
Instance of Symbol 341 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (hitTest(_root._xmouse, _root._ymouse, true)) {
textobj._visible = true;
} else {
textobj._visible = false;
}
}
Instance of Symbol 347 MovieClip "towerhealthcounter" in Frame 10
/* no clip actions */
Instance of Symbol 219 MovieClip "towerhealthlogo" in Frame 10
/* no clip actions */
Instance of Symbol 348 MovieClip "fadeobjectnew" in Frame 10
onClipEvent (enterFrame) {
vol = _root.introplayer.getVolume();
if ((_currentframe <= 50) && (vol < 100)) {
_root.introplayer.setVolume(vol + 2);
}
if ((_currentframe > 50) && (vol > 0)) {
_root.introplayer.setVolume(vol - 2);
}
}
Frame 11
_root.myscore = "SCORE: " + _root.attrib_score;
Instance of Symbol 247 MovieClip in Frame 11
onClipEvent (load) {
if (_root.uzicheat == true) {
gotoAndStop (2);
}
if (_root.destsite == "newgrounds") {
gotoAndStop (3);
}
}
Instance of Symbol 352 MovieClip "fadeobjectnew" in Frame 11
onClipEvent (enterFrame) {
vol = _root.introplayer.getVolume();
if ((_currentframe <= 50) && (vol < 100)) {
_root.introplayer.setVolume(vol + 2);
}
if ((_currentframe > 50) && (vol > 0)) {
_root.introplayer.setVolume(vol - 2);
}
}
Symbol 4 MovieClip Frame 1
stop();
Instance of Symbol 4 MovieClip "warner" in Symbol 6 MovieClip Frame 1
onClipEvent (load) {
swapDepths(60011);
}
Symbol 7 MovieClip [eblip] Frame 44
stop();
Symbol 11 MovieClip Frame 7
gotoAndPlay (1);
Symbol 13 MovieClip Frame 5
if (_root._currentframe == 1) {
loaded = _root.getBytesLoaded();
upto = _root.getBytesTotal();
if (loaded == upto) {
_root.gotoAndStop(3);
} else if (_root._framesloaded >= 1) {
_root.gotoAndStop(2);
} else {
gotoAndPlay (1);
}
}
Symbol 21 MovieClip Frame 1
stop();
Symbol 44 MovieClip Frame 1
stop();
Symbol 44 MovieClip Frame 3
gotoAndPlay(random(10) + 7);
Symbol 44 MovieClip Frame 18
gotoAndPlay (3);
Symbol 53 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 50
stop();
Symbol 56 MovieClip Frame 100
_root.gotoAndStop(_root._currentframe + 1);
Symbol 74 MovieClip Frame 1
stop();
Symbol 84 MovieClip [splode] Frame 11
removeMovieClip(this);
Symbol 87 MovieClip [sparksplode] Frame 10
removeMovieClip(this);
Symbol 92 MovieClip [forcehit] Frame 10
removeMovieClip(this);
Symbol 98 MovieClip [shockwave] Frame 9
removeMovieClip(this);
Symbol 104 MovieClip [shockwave2] Frame 9
removeMovieClip(this);
Symbol 119 MovieClip [flamdot] Frame 24
removeMovieClip(this);
Symbol 128 MovieClip [twinkle] Frame 11
removeMovieClip(this);
Symbol 147 MovieClip Frame 177
stop();
Instance of Symbol 147 MovieClip in Symbol 150 MovieClip Frame 1
on (press) {
getURL ("http://www.gamesofgondor.com", "_blank");
}
Symbol 150 MovieClip Frame 210
_root.gotoAndStop(4);
Symbol 151 MovieClip Frame 50
stop();
Symbol 151 MovieClip Frame 100
removeMovieClip(_root.tower);
removeMovieClip(_root.wizard);
removeMovieClip(_root.towerhealthcounter);
removeMovieClip(_root.towerhealthlogo);
removeMovieClip(_root.timeholder);
removeMovieClip(_root.warner);
removeMovieClip(_root.cooldowncounter);
removeMovieClip(_root.radar);
removeMovieClip(_root.welldone);
removeMovieClip(_root.dragonsleftholder);
_root.endscore = (_root.mil + (_root.sec * 100)) + (_root.min * 6000);
_root.killall();
trace("Exited");
stopAllSounds();
_root.soundobj.setVolume(100);
if (_root.leveldata_wavenumber != 11) {
_root.gotoAndStop(_root.winlose);
} else {
_root.gotoAndStop("victory");
}
removeMovieClip(_root.fadeobject);
Symbol 160 MovieClip Frame 60
_root.buttween.but01.selectabl = true;
_root.buttween.but02.selectabl = true;
_root.buttween.but03.selectabl = true;
_root.buttween.but04.selectabl = true;
Symbol 160 MovieClip Frame 91
stop();
Symbol 162 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 1
stop();
Symbol 166 MovieClip Frame 1
stop();
Symbol 167 MovieClip Frame 60
stop();
Instance of Symbol 53 MovieClip "but01" in Symbol 167 MovieClip Frame 60
onClipEvent (load) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
} else {
_alpha = 30;
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
_root.gotoframe = "shop";
gotoAndStop (2);
this.useHandCursor = false;
_root.disableall();
_root.attrib_buildspeed = 2.5;
_root.attrib_magicdamage = 9;
_root.attrib_towerhealth = 500;
_root.attrib_towerhealthmax = 500;
_root.attrib_repairlevels = 0;
_root.attrib_deflect = 60;
_root.attrib_cash = 100;
_root.attrib_score = 0;
_root.leveldata_wavenumber = 1;
_root.fader.gotoAndPlay(50);
}
}
Instance of Symbol 162 MovieClip "but02" in Symbol 167 MovieClip Frame 60
onClipEvent (load) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
} else {
_alpha = 30;
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
_root.gotoframe = "help";
gotoAndStop (2);
this.useHandCursor = false;
_root.disableall();
_root.fader.gotoAndPlay(50);
}
}
Instance of Symbol 164 MovieClip "but03" in Symbol 167 MovieClip Frame 60
onClipEvent (load) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
} else {
_alpha = 30;
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
_root.gotoframe = "settings";
gotoAndStop (2);
this.useHandCursor = false;
_root.disableall();
_root.fader.gotoAndPlay(50);
}
}
Instance of Symbol 166 MovieClip "but04" in Symbol 167 MovieClip Frame 60
onClipEvent (load) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
} else {
_alpha = 30;
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
_root.gotoframe = "scores";
gotoAndStop (2);
this.useHandCursor = false;
_root.disableall();
_root.fader.gotoAndPlay(50);
}
}
Instance of Symbol 170 MovieClip in Symbol 172 MovieClip Frame 1
onClipEvent (load) {
_alpha = 20;
}
on (rollOver) {
_alpha = 100;
}
on (rollOut) {
_alpha = 20;
}
on (release) {
getURL ("http://www.gamesofgondor.com", "_blank");
}
Symbol 173 MovieClip Frame 50
stop();
Symbol 173 MovieClip Frame 100
_root.introplayer.stop("intromusic");
_root.introplayer.setVolume(100);
_root.gotoAndStop(_root.gotoframe);
Symbol 176 MovieClip Frame 1
stop();
Symbol 186 MovieClip Frame 1
stop();
Instance of Symbol 183 MovieClip "beard1" in Symbol 187 MovieClip Frame 1
onClipEvent (load) {
repair = function () {
if (_parent._yscale == -100) {
_rotation = ((_parent._rotation - 180) - 20);
} else {
_rotation = ((-_parent._rotation) - 20);
}
};
}
onClipEvent (enterFrame) {
if (_parent._yscale == -100) {
_rotation = ((_parent._rotation - 180) - 20);
} else {
_rotation = ((-_parent._rotation) - 20);
}
}
Instance of Symbol 183 MovieClip "beard2" in Symbol 187 MovieClip Frame 1
onClipEvent (load) {
repair = function () {
if (_parent._yscale == -100) {
_rotation = ((_parent._rotation - 180) + 10);
} else {
_rotation = ((-_parent._rotation) + 10);
}
};
}
onClipEvent (enterFrame) {
if (_parent._yscale == -100) {
_rotation = ((_parent._rotation + 180) + 10);
} else {
_rotation = ((-_parent._rotation) + 10);
}
}
Symbol 196 MovieClip Frame 2
stop();
Symbol 196 MovieClip Frame 3
stop();
Symbol 196 MovieClip Frame 5
gotoAndStop (3);
Instance of Symbol 187 MovieClip "head" in Symbol 197 MovieClip Frame 1
onClipEvent (enterFrame) {
dx = _parent._x - _root._xmouse;
dy = (_parent._y - _root._ymouse) - 90;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dy < 0) {
angle = (Math.PI*2) - Math.acos(dx / dist);
} else {
angle = Math.acos(dx / dist);
}
this._rotation = ((angle * 180) / Math.PI) + 180;
if ((_rotation > -135) && (_rotation < -90)) {
_rotation = -134;
beard1.repair();
beard2.repair();
} else if ((_rotation < -45) && (_rotation >= -90)) {
_rotation = -46;
beard1.repair();
beard2.repair();
} else if ((_rotation > 60) && (_rotation <= 90)) {
_rotation = 60;
beard1.repair();
beard2.repair();
} else if ((_rotation < 120) && (_rotation > 90)) {
_rotation = 120;
beard1.repair();
beard2.repair();
}
}
Instance of Symbol 196 MovieClip "arm" in Symbol 197 MovieClip Frame 1
onClipEvent (enterFrame) {
dx = _parent._x - _root._xmouse;
dy = (_parent._y - _root._ymouse) - 63;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dy < 0) {
angle = (Math.PI*2) - Math.acos(dx / dist);
} else {
angle = Math.acos(dx / dist);
}
this._rotation = ((angle * 180) / Math.PI) + 180;
_root.radar.playerblip._rotation = this._rotation;
if ((this._rotation < 90) && (this._rotation > -90)) {
_yscale = 100;
_parent.head._yscale = 100;
_parent.torso._xscale = 100;
} else {
_yscale = -100;
_parent.head._yscale = -100;
_parent.torso._xscale = -100;
}
}
Instance of Symbol 205 MovieClip "percent" in Symbol 206 MovieClip Frame 1
onClipEvent (enterFrame) {
this._xscale = (_root.attrib_towerhealth * 100) / _root.attrib_towerhealthmax;
}
Symbol 217 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 1
stop();
Symbol 233 MovieClip Frame 1
stop();
Symbol 240 MovieClip Frame 1
stop();
Instance of Symbol 231 MovieClip "but01" in Symbol 240 MovieClip Frame 1
onClipEvent (load) {
checkchars = function () {
i = 0;
valid = true;
while (i < _parent.nameinput.length) {
if ((((_parent.nameinput.charCodeAt(i) >= 97) && (_parent.nameinput.charCodeAt(i) <= 122)) || ((_parent.nameinput.charCodeAt(i) >= 65) && (_parent.nameinput.charCodeAt(i) <= 90))) || ((_parent.nameinput.charCodeAt(i) >= 48) && (_parent.nameinput.charCodeAt(i) <= 57))) {
} else {
valid = false;
}
i++;
}
if (valid == false) {
return(false);
}
return(true);
};
}
onClipEvent (enterFrame) {
if ((delay == false) && (selectabl == true)) {
delay = true;
_alpha = 30;
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
}
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
if ((((checkchars() == true) && (_parent.nameinput != "")) && (_parent.nameinput != " ")) && (_parent.nameinput != undefined)) {
trace((">" + _parent.nameinput) + "<");
gotoAndStop (2);
_parent.gotoAndStop(2);
this.useHandCursor = false;
selectabl = false;
_parent.holdy.winscore = _root.attrib_score;
_parent.holdy.winname = _parent.nameinput;
if (_root.uzicheat == false) {
_parent.holdy.loadVariables("../write.php", "GET");
}
}
}
}
Instance of Symbol 233 MovieClip "but02" in Symbol 240 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((delay == false) && (selectabl == true)) {
delay = true;
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
}
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
gotoAndStop (2);
this.useHandCursor = false;
selectabl = false;
_root.destin = "splash";
_root.fadeobjectnew.gotoAndPlay(51);
}
}
Instance of Symbol 235 MovieClip "holdy" in Symbol 240 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 239 MovieClip in Symbol 240 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_parent.holdy.recieved == "okay") {
_root.destin = "scores";
trace("score recieved");
_root.fadeobjectnew.gotoAndPlay(51);
}
}
Symbol 244 MovieClip Frame 1
stop();
Instance of Symbol 231 MovieClip "but01" in Symbol 244 MovieClip Frame 1
onClipEvent (load) {
_alpha = 30;
checkchars = function () {
i = 0;
valid = true;
while (i < _parent.nameinput.length) {
if ((((_parent.nameinput.charCodeAt(i) >= 97) && (_parent.nameinput.charCodeAt(i) <= 122)) || ((_parent.nameinput.charCodeAt(i) >= 65) && (_parent.nameinput.charCodeAt(i) <= 90))) || ((_parent.nameinput.charCodeAt(i) >= 48) && (_parent.nameinput.charCodeAt(i) <= 57))) {
} else {
valid = false;
}
i++;
}
if (valid == false) {
return(false);
}
return(true);
};
}
onClipEvent (enterFrame) {
if ((delay == false) && (selectabl == true)) {
delay = true;
_alpha = 30;
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
}
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
if ((((checkchars() == true) && (_parent.nameinput != "")) && (_parent.nameinput != " ")) && (_parent.nameinput != undefined)) {
trace((">" + _parent.nameinput) + "<");
gotoAndStop (2);
_parent.gotoAndStop(2);
this.useHandCursor = false;
selectabl = false;
_parent.holdy.winscore = _root.attrib_score;
_parent.holdy.winname = _parent.nameinput;
if (_root.uzicheat == false) {
_parent.holdy.loadVariables("../write.php", "GET");
}
}
}
}
Instance of Symbol 233 MovieClip "but02" in Symbol 244 MovieClip Frame 1
onClipEvent (enterFrame) {
if ((delay == false) && (selectabl == true)) {
delay = true;
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_alpha = 100;
this.useHandCursor = true;
}
}
}
on (rollOver) {
if (selectabl == true) {
_alpha = 100;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (rollOut) {
if (selectabl == true) {
_alpha = 30;
this.useHandCursor = true;
} else {
this.useHandCursor = false;
}
}
on (press) {
if (selectabl == true) {
gotoAndStop (2);
this.useHandCursor = false;
selectabl = false;
_root.destin = "splash";
_parent._parent.gotoAndPlay(126);
}
}
Instance of Symbol 235 MovieClip "holdy" in Symbol 244 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 239 MovieClip in Symbol 244 MovieClip Frame 2
onClipEvent (enterFrame) {
if (_parent.holdy.recieved == "okay") {
_root.destin = "scores";
trace("score recieved");
_parent._parent.gotoAndPlay(126);
}
}
Symbol 247 MovieClip Frame 1
stop();
Symbol 248 MovieClip Frame 1
_root.myscore = "SCORE: " + _root.attrib_score;
Symbol 248 MovieClip Frame 99
submitter.but01.selectabl = false;
submitter.but01._alpha = 30;
submitter.but02.selectabl = false;
submitter.but02._alpha = 30;
Symbol 248 MovieClip Frame 125
stop();
if ((_root.uzicheat == false) && (_root.destsite == "gondor")) {
submitter.but01.selectabl = true;
submitter.but01._alpha = 30;
}
submitter.but02.selectabl = true;
submitter.but02._alpha = 30;
Instance of Symbol 247 MovieClip in Symbol 248 MovieClip Frame 125
onClipEvent (load) {
if (_root.uzicheat == true) {
gotoAndStop (2);
}
if (_root.destsite == "newgrounds") {
gotoAndStop (3);
}
}
Symbol 248 MovieClip Frame 143
_root.gotoAndStop(_root.destin);
Symbol 287 MovieClip Frame 5
gotoAndPlay (1);
Symbol 287 MovieClip Frame 6
stop();
Symbol 290 MovieClip Frame 1
stop();
if (_root.destsite == "newgrounds") {
texty.gotoAndStop(6);
}
Instance of Symbol 289 MovieClip in Symbol 290 MovieClip Frame 1
on (release) {
_root.gotoAndStop(4);
}
Symbol 290 MovieClip Frame 50
stop();
_root.but01.selectabl = true;
Symbol 290 MovieClip Frame 100
_root.gotoAndStop("splash");
Symbol 293 MovieClip Frame 50
stop();
_root.but01.selectabl = true;
Symbol 293 MovieClip Frame 100
_root.gotoAndStop("splash");
Symbol 320 MovieClip Frame 1
stop();
Instance of Symbol 321 MovieClip "b1" in Symbol 322 MovieClip Frame 1
onClipEvent (load) {
glyph.gotoAndStop(1);
}
Instance of Symbol 321 MovieClip "b1" in Symbol 322 MovieClip Frame 1
onClipEvent (load) {
glyph.gotoAndStop(3);
}
Instance of Symbol 321 MovieClip "b1" in Symbol 322 MovieClip Frame 1
onClipEvent (load) {
glyph.gotoAndStop(4);
}
Instance of Symbol 321 MovieClip "b1" in Symbol 322 MovieClip Frame 1
onClipEvent (load) {
glyph.gotoAndStop(5);
}
Symbol 333 MovieClip Frame 1
stop();
Symbol 338 MovieClip Frame 1
stop();
Instance of Symbol 330 MovieClip "b2" in Symbol 341 MovieClip Frame 1
onClipEvent (load) {
glyph.gotoAndStop(1);
levels = [new Array(100, 500), new Array(250, 750), new Array(675, 1000), new Array(1250, 1250), new Array(5000, 1500), new Array(10000, 1750)];
i = 0;
while (done == undefined) {
if (_root.attrib_towerhealthmax == levels[i][1]) {
done = true;
lvl = i + 1;
if (lvl == 5) {
_visible = false;
_x = -9999;
}
cost = levels[i][0];
costd = "$" + cost;
current = i;
}
i++;
}
}
on (press) {
if (_root.attrib_cash >= cost) {
_parent.bling2.gotoAndPlay(2);
_root.introplayer.attachSound("cashing");
_root.introplayer.start(0.3, 1);
current++;
_root.attrib_towerhealthmax = levels[current][1];
trace(_root.attrib_towerhealthmax);
_root.attrib_cash = _root.attrib_cash - cost;
lvl++;
trace("upgrade");
if (lvl == 5) {
_visible = false;
_x = -9999;
}
cost = levels[current][0];
costd = "$" + cost;
}
}
on (rollOver) {
_parent.textobj.writing = "Improve tower strength. Improves the amount of damage the tower can absorb before being destroyed";
}
Instance of Symbol 330 MovieClip "b3" in Symbol 341 MovieClip Frame 1
onClipEvent (load) {
glyph.gotoAndStop(3);
levels = [new Array(100, 2.5), new Array(250, 3.5), new Array(675, 4.5), new Array(1250, 5.5), new Array(5000, 6.5), new Array(10000, 7.5)];
i = 0;
while (done == undefined) {
if (_root.attrib_buildspeed == levels[i][1]) {
done = true;
lvl = i + 1;
if (lvl == 5) {
_visible = false;
_x = -9999;
}
cost = levels[i][0];
costd = "$" + cost;
current = i;
}
i++;
}
}
on (press) {
if (_root.attrib_cash >= cost) {
_parent.bling3.gotoAndPlay(2);
_root.introplayer.attachSound("cashing");
_root.introplayer.start(0.3, 1);
current++;
_root.attrib_buildspeed = levels[current][1];
_root.attrib_cash = _root.attrib_cash - cost;
lvl++;
trace("upgrade");
if (lvl == 5) {
_visible = false;
_x = -9999;
}
cost = levels[current][0];
costd = "$" + cost;
}
}
on (rollOver) {
_parent.textobj.writing = "Improve casting speed. Decreases the amount of time required to charge a MagicBolt\u2122";
}
Instance of Symbol 330 MovieClip "b4" in Symbol 341 MovieClip Frame 1
onClipEvent (load) {
glyph.gotoAndStop(4);
levels = [new Array(100, 9), new Array(250, 15), new Array(675, 19), new Array(1250, 23), new Array(5000, 27), new Array(10000, 31)];
i = 0;
while (done == undefined) {
if (_root.attrib_magicdamage == levels[i][1]) {
done = true;
lvl = i + 1;
if (lvl == 5) {
_visible = false;
_x = -9999;
}
cost = levels[i][0];
costd = "$" + cost;
current = i;
}
i++;
}
}
on (press) {
if (_root.attrib_cash >= cost) {
_parent.bling4.gotoAndPlay(2);
_root.introplayer.attachSound("cashing");
_root.introplayer.start(0.3, 1);
current++;
_root.attrib_magicdamage = levels[current][1];
_root.attrib_cash = _root.attrib_cash - cost;
lvl++;
trace("upgrade");
if (lvl == 5) {
_visible = false;
_x = -9999;
}
cost = levels[current][0];
costd = "$" + cost;
}
}
on (rollOver) {
_parent.textobj.writing = "Improve damage. Increases the amount of damage that your MagicBolt\u2122 inflicts.";
}
Instance of Symbol 330 MovieClip "b5" in Symbol 341 MovieClip Frame 1
onClipEvent (load) {
glyph.gotoAndStop(5);
levels = [new Array(100, 60), new Array(250, 90), new Array(675, 120), new Array(1250, 150), new Array(5000, 180), new Array(10000, 210)];
i = 0;
while (done == undefined) {
if (_root.attrib_deflect == levels[i][1]) {
done = true;
lvl = i + 1;
if (lvl == 5) {
_visible = false;
_x = -9999;
}
cost = levels[i][0];
costd = "$" + cost;
current = i;
}
i++;
}
}
on (press) {
if (_root.attrib_cash >= cost) {
_parent.bling5.gotoAndPlay(2);
_root.introplayer.attachSound("cashing");
_root.introplayer.start(0.3, 1);
current++;
_root.attrib_deflect = levels[current][1];
_root.attrib_cash = _root.attrib_cash - cost;
lvl++;
trace("upgrade");
if (lvl == 5) {
_visible = false;
_x = -9999;
}
cost = levels[current][0];
costd = "$" + cost;
}
}
on (rollOver) {
_parent.textobj.writing = "Improve deflection. Increases the power of your deflection spell, making it easier to repel attacks.";
}
Instance of Symbol 335 MovieClip "b1" in Symbol 341 MovieClip Frame 1
onClipEvent (load) {
glyph.gotoAndStop(2);
cost = 100 + (25 * _root.attrib_repairlevels);
costd = "$" + cost;
}
on (press) {
if ((_root.attrib_cash >= cost) && (_root.attrib_towerhealth != _root.attrib_towerhealthmax)) {
_parent.bling1.gotoAndPlay(2);
_root.introplayer.attachSound("cashing");
_root.introplayer.start(0.3, 1);
current++;
if (_root.attrib_towerhealth < (_root.attrib_towerhealthmax - 100)) {
_root.attrib_towerhealth = _root.attrib_towerhealth + 100;
} else {
_root.attrib_towerhealth = _root.attrib_towerhealthmax;
}
_root.attrib_repairlevels++;
_root.attrib_cash = _root.attrib_cash - cost;
cost = 100 + (25 * _root.attrib_repairlevels);
costd = "$" + cost;
}
}
on (rollOver) {
_parent.textobj.writing = "Repair tower. Decreases the amount of damage that has been inflicted on your tower.";
}
Instance of Symbol 343 MovieClip "percent" in Symbol 347 MovieClip Frame 1
onClipEvent (enterFrame) {
this._xscale = (_root.attrib_towerhealth * 100) / _root.attrib_towerhealthmax;
}
Symbol 348 MovieClip Frame 1
_root.but01._alpha = 30;
Symbol 348 MovieClip Frame 50
_root.but01.selectabl = true;
stop();
Symbol 348 MovieClip Frame 100
_root.gotoAndStop("warner");
Symbol 352 MovieClip Frame 1
_root.submitter.but01._alpha = 30;
_root.submitter.but02._alpha = 30;
Symbol 352 MovieClip Frame 50
stop();
_root.submitter.but01._alpha = 30;
_root.submitter.but02._alpha = 30;
_root.submitter.but02.selectabl = true;
_root.submitter.but01.selecatbl = true;
Symbol 352 MovieClip Frame 100
_root.gotoAndStop(_root.destin);