Frame 102
stop();
Frame 9684
gotoAndPlay (2);
Frame 9685
stop();
Frame 9699
stop();
Frame 9700
items = new Array();
MovieClip.prototype.setCookie = function (c, n, v) {
var so = SharedObject.getLocal(c);
so.data[n] = v;
so.flush();
};
MovieClip.prototype.getCookie = function (c, n) {
var so = SharedObject.getLocal(c);
return(so.data[n]);
};
MovieClip.prototype.liftItem = function (item) {
_root.items.push(item);
this.drawItems();
};
MovieClip.prototype.dropItem = function (item) {
var i;
var l;
l = _root.items.length;
i = 0;
while (i < l) {
if (_root.items[i] == item) {
_root.items[i] = _root.items[l - 1];
_root.items[l - 1] = item;
_root.items.pop();
i = l;
}
i++;
}
this.drawItems();
};
MovieClip.prototype.hasItem = function (item) {
l = _root.items.length;
i = 0;
while (i < l) {
if (_root.items[i] == item) {
return(true);
}
i++;
}
return(false);
};
spacing = 10;
MovieClip.prototype.drawItems = function () {
var i;
for (i in _root.item_bar) {
_root.item_bar[i].removeMovieClip();
}
i = 0;
while (i < _root.items.length) {
_root.item_bar.attachMovie("icons", "icon" + i, i);
_root.item_bar["icon" + i]._x = (i * (10 + _root.spacing)) + _root.spacing;
_root.item_bar["icon" + i].gotoAndStop(_root.items[i]);
i++;
}
};
Instance of Symbol 554 MovieClip "walkable" in Frame 9700
onClipEvent (enterFrame) {
c = _root.roomNum;
this.gotoAndStop(c);
}
Instance of Symbol 569 MovieClip in Frame 9700
onClipEvent (enterFrame) {
_root.enemyarrowtime = _root.enemyarrowtime - 1;
if (_root.enemyarrowtime <= 0) {
_root.enemyarrowtime = "0";
}
}
Instance of Symbol 572 MovieClip "arrow" in Frame 9700
onClipEvent (load) {
fire = 1;
step = 9;
}
onClipEvent (enterFrame) {
if (this.hasItem("bow")) {
if (fire == 0) {
this._x = _root.hero._x;
this._y = _root.hero._y;
this._rotation = _root.hero._rotation;
if (Key.isDown(16) and (_root.arrowcount > 0)) {
_root.arrowcount = _root.arrowcount - 1;
_root.hero.bowmove.gotoAndPlay(2);
this.gotoAndStop(2);
if (_root.hero._currentframe == 4) {
this._rotation = this._rotation - 180;
xx = -step;
yy = 0;
}
if (_root.hero._currentframe == 3) {
xx = step;
yy = 0;
}
if (_root.hero._currentframe == 2) {
this._rotation = this._rotation + 270;
xx = 0;
yy = -step;
}
if (_root.hero._currentframe == 1) {
this._rotation = this._rotation + 90;
xx = 0;
yy = step;
}
fire = 1;
this._x = this._x + xx;
this._y = this._y + yy;
}
} else {
this._x = this._x + xx;
this._y = this._y + yy;
if ((((_root.floor.hitTest(this._x, this._y, true) or (_x < 20)) or (_x > 300)) or (_y < 20)) or (_y > 300)) {
fire = 0;
this.gotoAndStop(1);
}
if ((((_root.enemies.hitTest(this._x, this._y, true) or (_x < 20)) or (_x > 300)) or (_y < 20)) or (_y > 300)) {
fire = 0;
this.gotoAndStop(1);
}
}
}
if (!this.hasItem("bow")) {
_root.f = c;
if (Key.isDown(16)) {
_root.talk._visible = 1;
_root.talk.message = "Please find the bow and arrow";
c = 0;
timer = true;
}
if (timer == true) {
c++;
}
if (c >= 30) {
_root.talk._visible = 0;
c = 0;
timer = false;
}
}
}
Instance of Symbol 605 MovieClip "floor" in Frame 9700
onClipEvent (enterFrame) {
_root.roomNum = this._currentframe;
}
Instance of Symbol 647 MovieClip "hero" in Frame 9700
onClipEvent (load) {
r = 1;
c = 1;
frame = substring(_root["row" + r], c, 1);
with (_root.floor) {
gotoAndStop(frame);
}
nearnpc = "";
talking = false;
pause = false;
speed = 4;
key_down = 0;
s = 25;
lock = true;
count = 0;
inventory = new Array();
}
onClipEvent (keyDown) {
this.zelda.play();
}
onClipEvent (keyUp) {
key_down = 0;
this.zelda.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (!_root.pause) {
room = _currentframe;
if (!_root.floor.hitTest(this._x + Xstep, this._y + Ystep, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
Ystep = 0;
Xstep = 0;
}
if (this._y >= 295) {
this._y = 45;
c = c + 1;
change_room("down");
}
if (this._y <= 5) {
this._y = 295;
c = c - 1;
change_room("up");
}
if (this._x >= 295) {
this._x = 45;
r = r + 1;
change_room("right");
}
if (this._x <= 5) {
this._x = 295;
r = r - 1;
change_room("left");
}
if (lock == true) {
if (Key.isDown(32)) {
_root.hero.sword.play(2);
this.zelda.gotoAndStop(1);
}
if (_root.item_bar._visible == false) {
if (Key.isDown(73)) {
setProperty(_root.item_bar, _visible , true);
_root.item_bar.message = "INVENTORY";
}
if (Key.isDown(DELETEKEY)) {
setProperty(_root.container, _visible , true);
}
if (count >= 5) {
count = 6;
}
}
old_x = this._x;
old_y = this._y;
if ((Key.isDown(38) and (!Key.isDown(37))) and (!Key.isDown(39))) {
Ystep = -4;
Xstep = 0;
if (moving == false) {
moving = true;
this.gotoAndPlay(2);
}
this.gotoAndStop("back");
} else if ((Key.isDown(40) and (!Key.isDown(37))) and (!Key.isDown(39))) {
Ystep = 4;
Xstep = 0;
if (moving == false) {
moving = true;
this.gotoAndPlay(2);
}
this.gotoAndStop("front");
} else if ((Key.isDown(37) and (!Key.isDown(38))) and (!Key.isDown(40))) {
Xstep = -4;
Ystep = 0;
if (moving == false) {
moving = true;
this.gotoAndPlay(2);
}
this.gotoAndStop("left");
} else if ((Key.isDown(39) and (!Key.isDown(38))) and (!Key.isDown(40))) {
Xstep = 4;
Ystep = 0;
if (moving == false) {
moving = true;
this.gotoAndPlay(2);
}
this.gotoAndStop("right");
} else if (Key.isDown(39) and Key.isDown(38)) {
Xstep = 3;
Ystep = -3;
if (moving == false) {
moving = true;
this.gotoAndPlay(2);
}
this.gotoAndStop("back");
} else if (Key.isDown(39) and Key.isDown(40)) {
Xstep = 3;
Ystep = 3;
if (moving == false) {
moving = true;
this.gotoAndPlay(2);
}
this.gotoAndStop("front");
} else if (Key.isDown(37) and Key.isDown(38)) {
Xstep = -3;
Ystep = -3;
if (moving == false) {
moving = true;
this.gotoAndPlay(2);
}
this.gotoAndStop("back");
} else if (Key.isDown(37) and Key.isDown(40)) {
Xstep = -3;
Ystep = 3;
if (moving == false) {
moving = true;
this.gotoAndPlay(2);
}
this.gotoAndStop("front");
}
if (_root.floor.hitTest(this._x + 40, this._y, true)) {
this._y = old_y;
this._x = old_x;
}
if (_root.floor.hitTest(this._x - 40, this._y, true)) {
this._y = old_y;
this._x = old_x;
}
if (_root.floor.hitTest(this._x, this._y + 40, true)) {
this._x = old_x;
this._y = old_y;
}
if (_root.floor.hitTest(this._x, this._y - 40, true)) {
this._x = old_x;
this._y = old_y;
}
if (_root.floor.hitTest(this._x + 40, this._y + 40, true)) {
this._y = old_y;
this._x = old_x;
}
if (_root.floor.hitTest(this._x - 40, this._y + 40, true)) {
this._y = old_y;
this._x = old_x;
}
if (_root.floor.hitTest(this._x + 40, this._y - 40, true)) {
this._x = old_x;
this._y = old_y;
}
if (_root.floor.hitTest(this._x - 40, this._y - 40, true)) {
this._x = old_x;
this._y = old_y;
}
}
}
}
Instance of Symbol 778 MovieClip "enemies" in Frame 9700
onClipEvent (enterFrame) {
c = _root.roomNum;
this.gotoAndStop(c);
}
Instance of Symbol 780 MovieClip "arrow3" in Frame 9700
onClipEvent (load) {
fire = 1;
step = 9;
shootarrow = false;
}
onClipEvent (enterFrame) {
if (!fire) {
if (_root.enemyarrowtime <= 0) {
this._x = _root.enemies.enemy2.point.x;
this._y = _root.enemies.enemy2.point.y;
this._rotation = _root.hero._rotation;
if (shootarrow) {
_root.enemyarrowtime = 20;
this.gotoAndStop(2);
if (_root.enemies.enemy2._currentframe == 3) {
this._rotation = this._rotation - 180;
xx = -step;
yy = 0;
}
if (_root.enemies.enemy2._currentframe == 4) {
xx = step;
yy = 0;
}
if (_root.enemies.enemy2._currentframe == 1) {
this._rotation = this._rotation + 270;
xx = 0;
yy = -step;
}
if (_root.enemies.enemy2._currentframe == 2) {
this._rotation = this._rotation + 90;
xx = 0;
yy = step;
}
fire = 1;
this._x = this._x + xx;
this._y = this._y + yy;
}
} else {
this._x = this._x + xx;
this._y = this._y + yy;
if ((((_root.floor.hitTest(this._x, this._y, true) or (_x < 20)) or (_x > 300)) or (_y < 20)) or (_y > 300)) {
fire = 0;
shootarrow = false;
this.gotoAndStop(1);
}
if ((((_root.hero.hitTest(this._x, this._y, true) or (_x < 20)) or (_x > 300)) or (_y < 20)) or (_y > 300)) {
fire = 0;
_root.health = _root.health - 15;
_root.hero.hit.play();
this.gotoAndStop(1);
}
}
}
}
Instance of Symbol 782 MovieClip "arrow2" in Frame 9700
onClipEvent (load) {
fire = 1;
step = 9;
shootarrow = false;
}
onClipEvent (enterFrame) {
if (_root.enemyarrowtime <= 0) {
if (!fire) {
this._x = _root.enemies.enemy2.point.x;
this._y = _root.enemies.enemy2.point.y;
this._rotation = _root.hero._rotation;
if (shootarrow) {
_root.enemyarrowtime = 20;
this.gotoAndStop(2);
if (_root.enemies.enemy2._currentframe == 3) {
this._rotation = this._rotation - 180;
xx = -step;
yy = 0;
}
if (_root.enemies.enemy2._currentframe == 4) {
xx = step;
yy = 0;
}
if (_root.enemies.enemy2._currentframe == 1) {
this._rotation = this._rotation + 270;
xx = 0;
yy = -step;
}
if (_root.enemies.enemy2._currentframe == 2) {
this._rotation = this._rotation + 90;
xx = 0;
yy = step;
}
fire = 1;
this._x = this._x + xx;
this._y = this._y + yy;
}
} else {
this._x = this._x + xx;
this._y = this._y + yy;
if ((((_root.floor.hitTest(this._x, this._y, true) or (_x < 20)) or (_x > 300)) or (_y < 20)) or (_y > 300)) {
fire = 0;
shootarrow = false;
this.gotoAndStop(1);
}
if ((((_root.hero.hitTest(this._x, this._y, true) or (_x < 20)) or (_x > 300)) or (_y < 20)) or (_y > 300)) {
fire = 0;
_root.health = _root.health - 15;
_root.hero.hit.play();
this.gotoAndStop(1);
}
}
}
}
Instance of Symbol 791 MovieClip "talk" in Frame 9700
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 806 MovieClip "healthbar" in Frame 9700
onClipEvent (enterFrame) {
if (_root.health == 0) {
_root.gotoAndPlay(5);
} else {
this.gotoAndStop(11 - Math.ceil(_root.health / 15));
}
}
Instance of Symbol 841 MovieClip "item_bar" in Frame 9700
onClipEvent (load) {
_visible = false;
}
Frame 9787
gotoAndPlay (9893);
Frame 9890
gotoAndPlay (9700);
Frame 10013
gotoAndPlay (98);
Symbol 14 MovieClip Frame 1
stop();
Symbol 14 MovieClip Frame 8
gotoAndPlay (2);
Symbol 37 MovieClip [guard] Frame 66
gotoAndPlay (1);
Symbol 37 MovieClip [guard] Frame 98
stop();
Instance of Symbol 42 MovieClip in Symbol 43 MovieClip [heartpickup] Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
this._x = 350;
this._y = 360;
this._visible = 1;
_root.health = _root.health + 15;
if (_root.health < 150) {
this.removeMovieClip();
} else {
_root.health = "150";
this._visible = 0;
}
}
}
Symbol 46 MovieClip [swordleft] Frame 1
stop();
Symbol 59 MovieClip [swordback] Frame 1
stop();
Symbol 70 MovieClip [swordfront] Frame 1
stop();
Symbol 80 Button
on (release) {
_root.play();
}
Symbol 81 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop (3);
}
Symbol 81 MovieClip Frame 2
gotoAndPlay (1);
Symbol 98 MovieClip Frame 1399
gotoAndPlay (1);
Symbol 134 Button
on (release) {
gotoAndPlay (1);
}
Symbol 141 Button
on (release) {
gotoAndPlay (1);
}
Symbol 146 Button
on (release) {
gotoAndStop (1);
}
Symbol 149 Button
on (release) {
gotoAndPlay (109);
}
Symbol 150 Button
on (release) {
gotoAndPlay (9686);
}
Symbol 151 Button
on (release) {
gotoAndStop (103);
}
Symbol 157 Button
on (release) {
gotoAndPlay (108);
}
Symbol 161 Button
on (release) {
gotoAndPlay (699);
}
Symbol 166 Button
on (release) {
gotoAndPlay (2850);
}
Symbol 170 Button
on (release) {
gotoAndPlay (4921);
}
Symbol 174 Button
on (release) {
gotoAndPlay (98);
}
Symbol 551 Button
on (release) {
gotoAndPlay (9700);
}
Symbol 554 MovieClip Frame 1
stop();
Symbol 569 MovieClip Frame 1
stop();
Symbol 572 MovieClip Frame 1
stop();
Symbol 594 MovieClip Frame 47
stop();
Symbol 605 MovieClip Frame 1
stop();
Instance of Symbol 604 MovieClip in Symbol 605 MovieClip Frame 1
onClipEvent (enterFrame) {
if (hitTest(_root.hero)) {
gotoAndPlay (1);
}
}
Symbol 615 MovieClip Frame 1
stop();
Symbol 615 MovieClip Frame 2
_root.sword = true;
Symbol 617 MovieClip Frame 1
stop();
Symbol 617 MovieClip Frame 10
gotoAndStop (1);
Symbol 620 MovieClip Frame 1
stop();
Symbol 620 MovieClip Frame 2
stop();
Symbol 634 MovieClip Frame 1
stop();
Symbol 646 MovieClip Frame 1
stop();
Symbol 647 MovieClip Frame 1
stop();
stop();
stop();
Symbol 647 MovieClip Frame 2
stop();
stop();
stop();
Symbol 647 MovieClip Frame 3
stop();
stop();
stop();
Symbol 647 MovieClip Frame 4
stop();
stop();
stop();
Symbol 649 MovieClip Frame 1
stop();
Symbol 672 MovieClip Frame 1
a = random(2);
stop();
Symbol 672 MovieClip Frame 2
stop();
Symbol 672 MovieClip Frame 3
stop();
Symbol 672 MovieClip Frame 4
stop();
Symbol 672 MovieClip Frame 19
if (a == 1) {
gotoAndStop (30);
} else if (a == 2) {
gotoAndStop (31);
}
stop();
Symbol 672 MovieClip Frame 30
stop();
Symbol 672 MovieClip Frame 31
stop();
Symbol 690 MovieClip Frame 1
a = random(2);
stop();
Symbol 690 MovieClip Frame 2
stop();
Symbol 690 MovieClip Frame 3
stop();
Symbol 690 MovieClip Frame 4
stop();
Symbol 690 MovieClip Frame 14
stop();
Instance of Symbol 43 MovieClip [heartpickup] in Symbol 690 MovieClip Frame 14
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
this._x = 350;
this._y = 360;
this._visible = 1;
_root.health = _root.health + 15;
if (_root.health < 150) {
this.removeMovieClip();
} else {
_root.health = "150";
this._visible = 0;
}
}
}
Symbol 708 MovieClip Frame 1
a = random(2);
stop();
Symbol 708 MovieClip Frame 2
stop();
Symbol 708 MovieClip Frame 3
stop();
Symbol 708 MovieClip Frame 4
stop();
Symbol 708 MovieClip Frame 17
if (a == 1) {
gotoAndStop (28);
} else if (a == 2) {
gotoAndStop (29);
}
stop();
Symbol 708 MovieClip Frame 28
stop();
Symbol 708 MovieClip Frame 29
stop();
Symbol 725 MovieClip Frame 1
a = random(2);
stop();
Symbol 725 MovieClip Frame 2
stop();
Symbol 725 MovieClip Frame 3
stop();
Symbol 725 MovieClip Frame 4
stop();
Symbol 725 MovieClip Frame 18
if (a == 1) {
gotoAndStop (29);
} else if (a == 2) {
gotoAndStop (30);
}
stop();
Symbol 725 MovieClip Frame 29
stop();
Symbol 725 MovieClip Frame 30
stop();
Symbol 759 MovieClip Frame 1
a = random(3);
Symbol 759 MovieClip Frame 35
if (a == 1) {
gotoAndPlay (36);
} else if (a == 2) {
gotoAndPlay (209);
} else if (a == 3) {
gotoAndPlay (1);
} else if (a == 4) {
gotoAndPlay (399);
}
Symbol 759 MovieClip Frame 202
gotoAndPlay (1);
Symbol 759 MovieClip Frame 398
gotoAndPlay (1);
Symbol 759 MovieClip Frame 539
gotoAndPlay (1);
Symbol 759 MovieClip Frame 541
stop();
Symbol 777 MovieClip Frame 1
a = random(2);
stop();
Symbol 777 MovieClip Frame 2
stop();
Symbol 777 MovieClip Frame 3
stop();
Symbol 777 MovieClip Frame 4
stop();
Symbol 777 MovieClip Frame 25
stop();
Instance of Symbol 40 MovieClip [moneydrop] in Symbol 777 MovieClip Frame 25
onClipEvent (load) {
timer = false;
c = 0;
}
onClipEvent (enterFrame) {
if ((!_root.gotitem4) != 1) {
this._y = 1000;
}
n = 0;
while (n < _root.items.length) {
if (_root.items[n] eq "bag") {
if (this.hitTest(_root.hero)) {
this._x = 1000;
_root.gotitem4 = 1;
setProperty(_root.item_bar, _visible , true);
_root.item_bar.message = "You got money to put in your bag";
}
}
n++;
}
if (!this.hasItem("bag")) {
if (this.hitTest(_root.hero)) {
_root.f = c;
_root.talk._visible = 1;
_root.talk.message = "You require a bag to put this money in!";
c = 0;
timer = true;
}
if (timer == true) {
c++;
}
if (c >= 5) {
_root.talk._visible = 0;
c = 0;
timer = false;
}
}
}
Symbol 778 MovieClip Frame 1
stop();
stop();
Instance of Symbol 672 MovieClip "enemy" in Symbol 778 MovieClip Frame 2
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 672 MovieClip "enemy" in Symbol 778 MovieClip Frame 2
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 672 MovieClip "enemy" in Symbol 778 MovieClip Frame 2
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 672 MovieClip "enemy" in Symbol 778 MovieClip Frame 2
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 690 MovieClip "enemy2" in Symbol 778 MovieClip Frame 4
onClipEvent (load) {
function checkproximity() {
point = new Object();
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
dist_hero = 80;
dx = point.x - _root.hero._x;
dy = point.y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function faceHero() {
point = new Object();
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
_parent.mcx = point.x;
_parent.mcy = point.y;
xDistance = Math.abs(point.x - _root.hero._x);
yDistance = Math.abs(point.y - _root.hero._y);
if (xDistance < yDistance) {
if (_root.hero._y < point.y) {
this.gotoAndStop("back");
} else {
this.gotoAndStop("front");
}
} else if (_root.hero._x < point.x) {
this.gotoAndStop("left");
} else {
this.gotoAndStop("right");
}
}
function attack() {
dir = halt;
_root.arrow2.shootarrow = true;
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 1;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
face();
point = new Object();
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
if (!_root.floor.hitTest(point.x + Xstep, ((point.y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
faceHero();
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
} else if (dir == halt) {
Xstep = 0;
Ystep = 0;
stop();
}
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (_root.dam > 3) {
gotoAndPlay (6);
}
}
}
}
Instance of Symbol 708 MovieClip "enemy" in Symbol 778 MovieClip Frame 5
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 708 MovieClip "enemy2" in Symbol 778 MovieClip Frame 5
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 725 MovieClip "enemy" in Symbol 778 MovieClip Frame 6
onClipEvent (load) {
function checkproximity() {
dist_hero = 0;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 1;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero.zelda)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 1;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 725 MovieClip "enemy4" in Symbol 778 MovieClip Frame 6
onClipEvent (load) {
function checkproximity() {
dist_hero = 0;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 1;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero.zelda)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 1;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 725 MovieClip "enemy3" in Symbol 778 MovieClip Frame 6
onClipEvent (load) {
function checkproximity() {
dist_hero = 0;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 1;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero.zelda)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 1;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 725 MovieClip "enemy5" in Symbol 778 MovieClip Frame 6
onClipEvent (load) {
function checkproximity() {
dist_hero = 0;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 1;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero.zelda)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 1;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 725 MovieClip "enemy2" in Symbol 778 MovieClip Frame 6
onClipEvent (load) {
function checkproximity() {
dist_hero = 0;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 1;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero.zelda)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 1;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
all = false;
gotoAndPlay (6);
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 672 MovieClip "enemy" in Symbol 778 MovieClip Frame 7
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 708 MovieClip "enemy2" in Symbol 778 MovieClip Frame 7
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 672 MovieClip "enemy" in Symbol 778 MovieClip Frame 9
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 708 MovieClip "enemy" in Symbol 778 MovieClip Frame 10
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 708 MovieClip "enemy2" in Symbol 778 MovieClip Frame 10
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 672 MovieClip "enemy" in Symbol 778 MovieClip Frame 11
onClipEvent (load) {
function checkproximity() {
dist_hero = 50;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
_root.hero.hit._visible = 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 690 MovieClip "enemy2" in Symbol 778 MovieClip Frame 11
onClipEvent (load) {
function checkproximity() {
point = new Object();
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
if (_root.enemyarrowtime <= 0) {
dist_hero = 80;
dx = point.x - _root.hero._x;
dy = point.y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
}
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function faceHero() {
point = new Object();
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
_parent.mcx = point.x;
_parent.mcy = point.y;
xDistance = Math.abs(point.x - _root.hero._x);
yDistance = Math.abs(point.y - _root.hero._y);
if (xDistance < yDistance) {
if (_root.hero._y < point.y) {
this.gotoAndStop("back");
} else {
this.gotoAndStop("front");
}
} else if (_root.hero._x < point.x) {
this.gotoAndStop("left");
} else {
this.gotoAndStop("right");
}
}
function attack() {
dir = halt;
if (_root.enemyarrowtime <= 0) {
_root.arrow2.shootarrow = true;
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 1;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
face();
point = new Object();
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
if (!_root.floor.hitTest(point.x + Xstep, ((point.y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
faceHero();
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
} else if (dir == halt) {
Xstep = 0;
Ystep = 0;
stop();
}
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
}
}
Instance of Symbol 759 MovieClip in Symbol 778 MovieClip Frame 12
onClipEvent (load) {
function attack() {
_root.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if ((damage = 100)) {
all = false;
gotoAndPlay (541);
}
}
}
onClipEvent (enterFrame) {
if (!_root.pause) {
this.play();
} else {
this.stop();
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
}
}
Instance of Symbol 725 MovieClip "enemy2" in Symbol 778 MovieClip Frame 16
onClipEvent (load) {
function checkproximity() {
dist_hero = 1;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 725 MovieClip "enemy" in Symbol 778 MovieClip Frame 16
onClipEvent (load) {
function checkproximity() {
dist_hero = 1;
dx = _x - _root.hero._x;
dy = _y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
speed = 2;
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 2;
}
}
function follow() {
if (in_range) {
if (this.hitTest(_root.hero)) {
xstep = _root.hero.xstep + 1;
ystep = _root.hero.ystep + 1;
}
lock = false;
my = _root.hero._y;
mx = _root.hero._x;
if (mx < _x) {
dx = _x - mx;
this.gotoAndStop("left");
} else {
dx = mx - _x;
this.gotoAndStop("right");
}
moveSpeedx = dx / 10;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (my < _y) {
dy = _y - my;
} else {
dy = my - _y;
}
moveSpeedy = dy / 10;
if (my < _y) {
_y = (_y - moveSpeedy);
} else {
_y = (_y + moveSpeedy);
}
}
}
function attack() {
_parent.dam = damage;
if (this.hitTest(_root.hero.sword)) {
damage = damage + 1;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 2;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
follow();
if (!_root.floor.hitTest(this._x + Xstep, ((this._y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
}
}
if (this.hitTest(_root.hero.zelda)) {
_root.health = _root.health - 1;
_root.hero.hit.play();
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
}
}
}
Instance of Symbol 777 MovieClip "enemy" in Symbol 778 MovieClip Frame 19
onClipEvent (load) {
function checkproximity() {
point = new Object();
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
dist_hero = 80;
dx = point.x - _root.hero._x;
dy = point.y - _root.hero._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
if (dist < dist_hero) {
in_range = true;
} else {
in_range = false;
lock = true;
speed = 3;
}
}
function faceHero() {
point = new Object();
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
_parent.mcx = point.x;
_parent.mcy = point.y;
xDistance = Math.abs(point.x - _root.hero._x);
yDistance = Math.abs(point.y - _root.hero._y);
if (xDistance < yDistance) {
if (_root.hero._y < point.y) {
this.gotoAndStop("back");
} else {
this.gotoAndStop("front");
}
} else if (_root.hero._x < point.x) {
this.gotoAndStop("left");
} else {
this.gotoAndStop("right");
}
}
function attack() {
dir = halt;
if (_root.enemyarrowtime <= 0) {
_root.arrow3.shootarrow = true;
}
}
lock = true;
up = 1;
down = 2;
right = 3;
left = 4;
speed = 3;
none = 0;
dir = random(4) + 1;
off = true;
damage = 0;
all = true;
}
onClipEvent (enterFrame) {
if (!_root.pause) {
if (all) {
checkproximity();
face();
point = new Object();
point.x = _x;
point.y = _y;
_parent.localToGlobal(point);
if (!_root.floor.hitTest(point.x + Xstep, ((point.y + Ystep) + Ystep) + 15, true)) {
this._x = this._x + Xstep;
this._y = this._y + Ystep;
hit = false;
} else {
hit = true;
}
if (in_range and (!hit)) {
faceHero();
attack();
}
if (off) {
if (hit or (random(100) > 98)) {
dir = random(4) + 1;
}
}
if (lock) {
if (dir == UP) {
Ystep = -speed;
Xstep = 0;
this.gotoAndStop("back");
} else if (dir == down) {
Ystep = speed;
Xstep = 0;
this.gotoAndStop("front");
} else if (dir == left) {
Xstep = -speed;
Ystep = 0;
this.gotoAndStop("left");
} else if (dir == right) {
Xstep = speed;
Ystep = 0;
this.gotoAndStop("right");
} else if (dir == halt) {
Xstep = 0;
Ystep = 0;
stop();
}
}
if (this.hitTest(_root.arrow)) {
_root.dam = _root.dam + 2;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root["bomb" + count])) {
_root.dam = _root.dam + 3;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (this.hitTest(_root.hero.sword)) {
_root.dam = _root.dam + 5;
_x = (_x + xstep);
_y = (_y + ystep);
}
if (damage > 3) {
all = false;
gotoAndPlay (6);
}
}
}
}
Symbol 780 MovieClip Frame 1
stop();
Symbol 782 MovieClip Frame 1
stop();
Symbol 787 Button
on (release) {
message.scroll = message.scroll - 1;
message.scroll = message.scroll - 1;
}
Symbol 788 Button
on (release, keyPress "<Space>") {
message.scroll = message.scroll + 1;
message.scroll = message.scroll + 1;
}
Symbol 806 MovieClip Frame 1
stop();
Symbol 819 Button
on (release) {
_root.items = _root.getCookie("zelda", "items");
this.drawItems();
_root.gotitem = _root.getCookie("zelda", "gotitem");
_root.key1 = _root.getCookie("zelda", "key1");
_root.health = _root.getCookie("zelda", "health");
_root.bombcount = _root.getCookie("zelda", "bombcount");
_root.arrowcount = _root.getCookie("zelda", "arrowcount");
_root.keys = _root.getCookie("zelda", "keys");
_root.hero._x = _root.getCookie("zelda", "posx");
_root.hero._y = _root.getCookie("zelda", "posy");
_root.floor.gotoAndStop(this.getCookie("zelda", "room"));
_root.gotitem2 = _root.getCookie("zelda", "gotitem2");
_root.gotitem3 = _root.getCookie("zelda", "gotitem3");
_root.gotitem4 = _root.getCookie("zelda", "gotitem4");
_root.gotitem5 = _root.getCookie("zelda", "gotitem5");
_root.pause = _root.getCookie("zelda", "pause");
_root.gotoAndStop(4);
}
Symbol 836 Button
on (release, keyPress "i") {
i = 0;
_root.pause = false;
_visible = false;
}
on (release, keyPress "I") {
i = 0;
_root.pause = false;
_visible = false;
}
Symbol 840 Button
on (release) {
_root.setCookie("zelda", "items", _root.items);
_root.setCookie("zelda", "gotitem", _root.gotitem);
_root.setCookie("zelda", "gotitem2", _root.gotitem2);
_root.setCookie("zelda", "gotitem3", _root.gotitem3);
_root.setCookie("zelda", "gotitem4", _root.gotitem4);
_root.setCookie("zelda", "gotitem5", _root.gotitem5);
_root.setCookie("zelda", "pause", _root.pause);
_root.setCookie("zelda", "key1", _root.key1);
_root.setCookie("zelda", "health", _root.health);
_root.setCookie("zelda", "bombcount", _root.bombcount);
_root.setCookie("zelda", "arrowcount", _root.arrowcount);
_root.setCookie("zelda", "keys", _root.keys);
_root.setCookie("zelda", "posx", _root.hero._x);
_root.setCookie("zelda", "posy", _root.hero._y);
this.setCookie("zelda", "room", _root.floor._currentframe);
}