[주의!] 문서의 이전 버전(에 수정)을 보고 있습니다. 최신 버전으로 이동
분류
var _mochiads_game_id = "8ba53e5d63bd23f5";
bcount = 0;
dcount = 0;
enemyCount = 0;
_root.charname = "Billy";
_root.jewelslot.gotoAndStop(1);
_root.jewstr = 0;
_root.jewagi = 0;
_root.jewend = 0;
_root.jewwil = 0;
_root.jewarm = 0;
_root.bdy = 1;
_root.arm = 0;
_root.rep = 50;
_root.armstr = 0;
_root.armagi = 0;
_root.armend = 0;
_root.armwil = 0;
_root.armarm = 1;
_root.blockrating = 0;
_root.armorslot.gotoAndStop(5);
_root.headslot.gotoAndStop(1);
_root.head = 1;
_root.headstr = 0;
_root.headagi = 0;
_root.headend = 0;
_root.headwil = 0;
_root.headarm = 0;
_root.wpnslot.gotoAndStop(4);
_root.dmgmin = 1;
_root.dmgmax = 3;
_root.dmgtype = 2;
_root.critical = 0;
_root.criticalhitting = false;
_root.dmgrangemin = 0;
_root.dmgrangemax = 0;
_root.dmgrangetype = 0;
_root.strdmg = 0;
_root.attspeed = 15;
_root.magattspeed = 5;
_root.wpn = 1;
_root.wpnstr = 0;
_root.wpnagi = 0;
_root.wpnend = 0;
_root.wpnwil = 0;
_root.wpnarm = 0;
_root.wpnrange = 1;
_root.wpnrangestr = 0;
_root.wpnrangeagi = 0;
_root.wpnrangeend = 0;
_root.wpnrangewil = 0;
_root.wpnrangearm = 0;
_root.rangeammo = " ";
_root.shislot.gotoAndStop(13);
_root.shi = 1;
_root.shistr = 0;
_root.shiagi = 0;
_root.shiend = 0;
_root.shiwil = 0;
_root.shiarm = 5;
_root.shiblock = 1;
_root.movespd = 6;
_root.moving = false;
_root.attacking = false;
_root.defending = false;
_root.dir = "L";
_root.str = 5;
_root.agi = 5;
_root.bg.gotoAndStop(1);
_root.end = 5;
_root.wil = 5;
_root.gold = 10;
_root.hpmax = (_root.end + _root.armend + _root.headend + _root.wpnend + _root.jewend) * 2;
_root.hp = _root.hpmax;
_root.lvl = 1;
_root.spnt = 3;
_root.xpneed = 200;
_root.xp = 0;
var timer = 0;
var sectimer = 0;
var tiptimer = 0;
_root.maintip._visible = false;
_root.hudeverything.journa = " ";
_root.chatperson = 0;
_root.shop = false;
_root.shoptab._visible = false;
_root.shoptab.stop();
_root.help._visible = false;
_root.chat._visible = false;
_root.main.tip._visible = false;
_root.quest1 = 13;
_root.quest2 = 1;
_root.quest3 = 1;
_root.quest4 = 1;
_root.quest5 = 1;
_root.quest6 = 1;
_root.quest7 = 1;
_root.quest8 = 1;
_root.quest9 = 1;
_root.quest10 = 1;
_root.quest11 = 1;
_root.quest12 = 1;
_root.crate0 = false;
_root.keg0 = false;
_root.chest0 = false;
_root.chest1 = false;
_root.chest2 = false;
_root.chest3 = false;
_root.chest4 = false;
_root.chest5 = false;
_root.chest6 = false;
_root.chest7 = false;
_root.foodheal = 0;
_root.foodtimer = 0;
_root.buffstr = 0;
_root.buffagi = 0;
_root.buffend = 0;
_root.buffwil = 0;
_root.buffarm = 0;
_root.buffatrtimer = 0;
_root.savechat = false;
_root.savename1 = "No Data";
_root.savetab.name1 = "No Data";
_root.savename2 = "No Data";
_root.savetab.name2 = "No Data";
_root.savetab._visible = false;
_root.loadtab._visible = false;
_root.menuon = true;
_root.soundplay = "none";
_root.area = "menu";
_root.areaswitch = "menu";
_root.tracknum = 1;
_root.trackswitch = 0;
_quality = "HIGH";
_root.soundoff = false;
_root.hudeverything.s1.gotoAndStop(1);
_root.hudeverything.s2.gotoAndStop(1);
_root.hudeverything.s3.gotoAndStop(1);
_root.hudeverything.s4.gotoAndStop(1);
_root.hudeverything.s5.gotoAndStop(1);
_root.hudeverything.s6.gotoAndStop(1);
_root.hudeverything.s7.gotoAndStop(1);
_root.hudeverything.s8.gotoAndStop(1);
_root.hudeverything.s9.gotoAndStop(1);
_root.hudeverything.s10.gotoAndStop(1);
_root.hudeverything.s11.gotoAndStop(1);
_root.hudeverything.s12.gotoAndStop(1);
_root.hudeverything.s13.gotoAndStop(1);
_root.hudeverything.s14.gotoAndStop(1);
_root.hudeverything.s15.gotoAndStop(1);
_root.hudeverything.s16.gotoAndStop(1);
_root.hudeverything.s17.gotoAndStop(1);
_root.hudeverything.s18.gotoAndStop(1);
_root.hudeverything.s19.gotoAndStop(1);
_root.hudeverything.s20.gotoAndStop(1);
rearrangeinventory = function()
{
var _loc3_ = 1;
while(_loc3_ < 19)
{
while(_loc3_ < 19)
{
var _loc4_ = "s" + _loc3_;
var _loc2_ = "s" + (_loc3_ + 1);
if(_root.hudeverything[_loc4_]._currentframe == 1 && _root.hudeverything[_loc2_]._currentframe != 1)
{
var _loc2_ = "s" + (_loc3_ + 1);
if(_root.hudeverything[_loc4_]._currentframe == 1 && _root.hudeverything[_loc2_]._currentframe != 1)
{
_root.hudeverything[_loc4_].stacknum = _root.hudeverything[_loc2_].stacknum;
_root.hudeverything[_loc4_].gotoAndStop(_root.hudeverything[_loc2_]._currentframe);
_root.hudeverything[_loc2_].gotoAndStop(1);
_root.hudeverything[_loc4_].gotoAndStop(_root.hudeverything[_loc2_]._currentframe);
_root.hudeverything[_loc2_].gotoAndStop(1);
}
_loc3_ = _loc3_ + 1;
_loc3_ = _loc3_ + 1;
}
};
musiccontroller.onEnterFrame = function()
{
musiccontroller.onEnterFrame = function()
{
if(_root.soundoff == false)
{
{
_root.soundplay = "track" + _root.area + _root.tracknum;
if(_root.area != _root.areaswitch)
{
if(_root.area != _root.areaswitch)
{
_root.trackswitch -= 2;
if(_root.trackswitch >= 60)
{
if(_root.trackswitch >= 60)
{
global_sound.setVolume(_root.trackswitch - 60);
}
else if(_root.trackswitch <= 0)
{
else if(_root.trackswitch <= 0)
{
stopBGSongs();
_root.tracknum = 1;
_root.area = _root.areaswitch;
global_sound.setVolume(40);
_root.tracknum = 1;
_root.area = _root.areaswitch;
global_sound.setVolume(40);
}
}
if(_root.area == "menu")
{
if(_root.area == "menu")
{
tracktravel2.start(0,999999);
}
else if(_root.area == "travel")
{
else if(_root.area == "travel")
{
if(_root.tracknum == 3)
{
{
tracktravel2.start(0,999999);
tracktravel2.onSoundComplete = function()
{
tracktravel2.onSoundComplete = function()
{
stopBGSongs();
_root.tracknum = 1;
_root.tracknum = 1;
};
}
else if(_root.tracknum == 2)
{
else if(_root.tracknum == 2)
{
tracktown5.start(0,999999);
tracktown5.onSoundComplete = function()
{
tracktown5.onSoundComplete = function()
{
stopBGSongs();
_root.tracknum = 3;
_root.tracknum = 3;
};
}
else if(_root.tracknum == 1)
{
else if(_root.tracknum == 1)
{
tracktown1.start(0,999999);
tracktown1.onSoundComplete = function()
{
tracktown1.onSoundComplete = function()
{
stopBGSongs();
_root.tracknum = 2;
_root.tracknum = 2;
};
}
}
else if(_root.area == "enemy")
{
else if(_root.area == "enemy")
{
if(_root.tracknum == 2)
{
{
trackenemy2.start(0,999999);
trackenemy2.onSoundComplete = function()
{
trackenemy2.onSoundComplete = function()
{
stopBGSongs();
_root.tracknum = 1;
_root.tracknum = 1;
};
}
else if(_root.tracknum == 1)
{
else if(_root.tracknum == 1)
{
trackenemy3.start(0,999999);
trackenemy3.onSoundComplete = function()
{
trackenemy3.onSoundComplete = function()
{
stopBGSongs();
_root.tracknum = 2;
_root.tracknum = 2;
};
}
}
}
};
stopBGSongs = function()
{
stopBGSongs = function()
{
tracktravel2.stop();
tracktown5.stop();
tracktown1.stop();
trackenemy2.stop();
trackenemy3.stop();
tracktown5.stop();
tracktown1.stop();
trackenemy2.stop();
trackenemy3.stop();
};
shootbow = function()
{
shootbow = function()
{
var _loc5_ = "bullet" + bcount;
_root.bg.projlayer.attachMovie("range1",_loc5_,bcount);
_root.bg.projlayer[_loc5_]._x = _root.hero._x;
_root.bg.projlayer[_loc5_]._y = _root.hero._y - 40;
_root.bg.projlayer[_loc5_].ymax = _root.hero._y;
if(_root.dir == "R")
{
_root.bg.projlayer.attachMovie("range1",_loc5_,bcount);
_root.bg.projlayer[_loc5_]._x = _root.hero._x;
_root.bg.projlayer[_loc5_]._y = _root.hero._y - 40;
_root.bg.projlayer[_loc5_].ymax = _root.hero._y;
if(_root.dir == "R")
{
_root.bg.projlayer[_loc5_]._rotation = 90;
_root.bg.projlayer[_loc5_].dx = 20;
_root.bg.projlayer[_loc5_].dx = 20;
}
else
{
else
{
_root.bg.projlayer[_loc5_]._rotation = -90;
_root.bg.projlayer[_loc5_].dx = -20;
_root.bg.projlayer[_loc5_].dx = -20;
}
_root.bg.projlayer[_loc5_].dy = -3;
_root.bg.projlayer[_loc5_].onEnterFrame = function()
{
_root.bg.projlayer[_loc5_].dy = -3;
_root.bg.projlayer[_loc5_].onEnterFrame = function()
{
this.dy += 0.75;
this._x += this.dx;
this._y += this.dy;
if(this._x < -50 || this._x > 600 || this._y < -50 || this._y > this.ymax)
{
this._x += this.dx;
this._y += this.dy;
if(this._x < -50 || this._x > 600 || this._y < -50 || this._y > this.ymax)
{
this.removeMovieClip();
}
var _loc4_ = 0;
while(_loc4_ < 10)
{
var _loc4_ = 0;
while(_loc4_ < 10)
{
var _loc3_ = "enemy" + _loc4_;
if(this.hitTest(_root.bg.enemylayer[_loc3_]) && _root.bg.enemylayer[_loc3_].hits > 0)
{
if(this.hitTest(_root.bg.enemylayer[_loc3_]) && _root.bg.enemylayer[_loc3_].hits > 0)
{
effect("impact0",this._x,this._y);
_root.bg.enemylayer[_loc3_].attacked = true;
_root.bg.enemylayer[_loc3_].hits -= _root.dmggen3;
damagethingy("dmgtxtshow",this._x,this._y,_root.dmggen3);
this.removeMovieClip();
_root.bg.enemylayer[_loc3_].attacked = true;
_root.bg.enemylayer[_loc3_].hits -= _root.dmggen3;
damagethingy("dmgtxtshow",this._x,this._y,_root.dmggen3);
this.removeMovieClip();
}
_loc4_ = _loc4_ + 1;
_loc4_ = _loc4_ + 1;
}
};
bcount++;
bcount %= 10;
bcount++;
bcount %= 10;
};
shootmagic = function()
{
shootmagic = function()
{
var _loc5_ = "bullet" + bcount;
_root.bg.projlayer.attachMovie("range2",_loc5_,bcount);
_root.bg.projlayer[_loc5_]._x = _root.hero._x;
_root.bg.projlayer[_loc5_]._y = _root.hero._y - 30;
_root.bg.projlayer[_loc5_].ymax = _root.hero._y;
_root.bg.projlayer[_loc5_].gotoAndStop(_root.wpnrange);
if(_root.dir == "R")
{
_root.bg.projlayer.attachMovie("range2",_loc5_,bcount);
_root.bg.projlayer[_loc5_]._x = _root.hero._x;
_root.bg.projlayer[_loc5_]._y = _root.hero._y - 30;
_root.bg.projlayer[_loc5_].ymax = _root.hero._y;
_root.bg.projlayer[_loc5_].gotoAndStop(_root.wpnrange);
if(_root.dir == "R")
{
_root.bg.projlayer[_loc5_]._rotation = 90;
_root.bg.projlayer[_loc5_].dx = 12;
_root.bg.projlayer[_loc5_]._x += 20;
_root.bg.projlayer[_loc5_].dx = 12;
_root.bg.projlayer[_loc5_]._x += 20;
}
else
{
else
{
_root.bg.projlayer[_loc5_]._rotation = -90;
_root.bg.projlayer[_loc5_].dx = -12;
_root.bg.projlayer[_loc5_]._x -= 20;
_root.bg.projlayer[_loc5_].dx = -12;
_root.bg.projlayer[_loc5_]._x -= 20;
}
_root.bg.projlayer[_loc5_].dy = (random(10) - 10) * -0.1;
_root.bg.projlayer[_loc5_].onEnterFrame = function()
{
_root.bg.projlayer[_loc5_].dy = (random(10) - 10) * -0.1;
_root.bg.projlayer[_loc5_].onEnterFrame = function()
{
this._x += this.dx;
this._y += this.dy;
if(this._x < -50 || this._x > 600 || this._y < -50 || this._y > this.ymax)
{
this._y += this.dy;
if(this._x < -50 || this._x > 600 || this._y < -50 || this._y > this.ymax)
{
this.removeMovieClip();
}
var _loc4_ = 0;
while(_loc4_ < 10)
{
var _loc4_ = 0;
while(_loc4_ < 10)
{
var _loc3_ = "enemy" + _loc4_;
if(this.hitTest(_root.bg.enemylayer[_loc3_]) && _root.bg.enemylayer[_loc3_].hits > 0)
{
if(this.hitTest(_root.bg.enemylayer[_loc3_]) && _root.bg.enemylayer[_loc3_].hits > 0)
{
effect("impact" + _root.wpnrange,this._x,this._y);
_root.bg.enemylayer[_loc3_].attacked = true;
_root.bg.enemylayer[_loc3_].hits -= _root.dmggen3;
damagethingy("dmgtxtshow",this._x,this._y,_root.dmggen3);
this.removeMovieClip();
_root.bg.enemylayer[_loc3_].attacked = true;
_root.bg.enemylayer[_loc3_].hits -= _root.dmggen3;
damagethingy("dmgtxtshow",this._x,this._y,_root.dmggen3);
this.removeMovieClip();
}
_loc4_ = _loc4_ + 1;
_loc4_ = _loc4_ + 1;
}
};
bcount++;
bcount %= 10;
bcount++;
bcount %= 10;
};
damagethingy = function(type, x, y, dmg)
{
damagethingy = function(type, x, y, dmg)
{
var _loc3_ = "dmgtxt" + dcount;
_root.dmgtxtlayer.attachMovie(type,_loc3_,dcount);
_root.dmgtxtlayer[_loc3_]._x = x;
_root.dmgtxtlayer[_loc3_]._y = y;
_root.dmgtxtlayer[_loc3_].dmgtxt = dmg;
_root.dmgtxtlayer[_loc3_].dmgtxt2 = dmg;
_root.dmgtxtlayer[_loc3_].dy = random(8) + 8;
_root.dmgtxtlayer[_loc3_].dy2 = _root.dmgtxtlayer[_loc3_].dy;
_root.dmgtxtlayer[_loc3_].onEnterFrame = function()
{
_root.dmgtxtlayer.attachMovie(type,_loc3_,dcount);
_root.dmgtxtlayer[_loc3_]._x = x;
_root.dmgtxtlayer[_loc3_]._y = y;
_root.dmgtxtlayer[_loc3_].dmgtxt = dmg;
_root.dmgtxtlayer[_loc3_].dmgtxt2 = dmg;
_root.dmgtxtlayer[_loc3_].dy = random(8) + 8;
_root.dmgtxtlayer[_loc3_].dy2 = _root.dmgtxtlayer[_loc3_].dy;
_root.dmgtxtlayer[_loc3_].onEnterFrame = function()
{
this._y -= this.dy;
this.dy *= 0.8;
this._alpha = this.dy / this.dy2 * 100;
if(this.dy <= 0.5)
{
this.dy *= 0.8;
this._alpha = this.dy / this.dy2 * 100;
if(this.dy <= 0.5)
{
this.removeMovieClip();
}
};
dcount++;
dcount %= 30;
dcount++;
dcount %= 30;
};
effect = function(type, x, y)
{
effect = function(type, x, y)
{
var _loc3_ = "bullet" + bcount;
_root.bg.projlayer.attachMovie(type,_loc3_,bcount);
_root.bg.projlayer[_loc3_]._x = x;
_root.bg.projlayer[_loc3_]._y = y;
_root.bg.projlayer[_loc3_].onEnterFrame = function()
{
_root.bg.projlayer.attachMovie(type,_loc3_,bcount);
_root.bg.projlayer[_loc3_]._x = x;
_root.bg.projlayer[_loc3_]._y = y;
_root.bg.projlayer[_loc3_].onEnterFrame = function()
{
if(this._x < -50 || this._x > 600 || this._y < -50 || this._y > this.ymax)
{
{
this.removeMovieClip();
}
};
bcount++;
bcount %= 10;
bcount++;
bcount %= 10;
};
var onepress = true;
var cursorhide = 100;
onMouseMove = function()
{
var onepress = true;
var cursorhide = 100;
onMouseMove = function()
{
cursorhide = 100;
};
onMouseDown = function()
{
onMouseDown = function()
{
cursorhide = 100;
};
hero.onEnterFrame = function()
{
hero.onEnterFrame = function()
{
if(cursorhide > 0)
{
{
cursorhide--;
_root.cursor._visible = true;
_root.cursor._visible = true;
}
else
{
else
{
_root.cursor._visible = false;
}
if(Key.isDown(16) == false)
{
if(Key.isDown(16) == false)
{
onepress = true;
}
if(Key.isDown(16) && onepress == true)
{
if(Key.isDown(16) && onepress == true)
{
if(_root.hudeverything._visible == false)
{
{
_root.hudeverything._visible = true;
onepress = false;
onepress = false;
}
else
{
else
{
if(_root.help._visible == true)
{
{
_root.help._visible = false;
_root.menuon = false;
_root.menuon = false;
}
_root.hudeverything._visible = false;
onepress = false;
_root.hudeverything._visible = false;
onepress = false;
}
}
_root.cursor._x = _xmouse;
_root.cursor._y = _ymouse;
Mouse.hide();
if(_root.menuon == false)
{
_root.cursor._x = _xmouse;
_root.cursor._y = _ymouse;
Mouse.hide();
if(_root.menuon == false)
{
_root.hudeverything.q1.gotoAndStop(_root.quest1);
_root.hudeverything.q2.gotoAndStop(_root.quest2);
_root.hudeverything.q3.gotoAndStop(_root.quest3);
_root.hudeverything.q4.gotoAndStop(_root.quest4);
_root.hudeverything.q5.gotoAndStop(_root.quest5);
_root.hudeverything.q6.gotoAndStop(_root.quest6);
_root.hudeverything.q7.gotoAndStop(_root.quest7);
_root.hudeverything.q8.gotoAndStop(_root.quest8);
_root.hudeverything.q9.gotoAndStop(_root.quest9);
_root.hudeverything.q10.gotoAndStop(_root.quest10);
_root.hudeverything.q11.gotoAndStop(_root.quest11);
_root.hudeverything.q12.gotoAndStop(_root.quest12);
if(Key.isDown(37) && _root.attacking == false && _root.defending == false)
{
_root.hudeverything.q2.gotoAndStop(_root.quest2);
_root.hudeverything.q3.gotoAndStop(_root.quest3);
_root.hudeverything.q4.gotoAndStop(_root.quest4);
_root.hudeverything.q5.gotoAndStop(_root.quest5);
_root.hudeverything.q6.gotoAndStop(_root.quest6);
_root.hudeverything.q7.gotoAndStop(_root.quest7);
_root.hudeverything.q8.gotoAndStop(_root.quest8);
_root.hudeverything.q9.gotoAndStop(_root.quest9);
_root.hudeverything.q10.gotoAndStop(_root.quest10);
_root.hudeverything.q11.gotoAndStop(_root.quest11);
_root.hudeverything.q12.gotoAndStop(_root.quest12);
if(Key.isDown(37) && _root.attacking == false && _root.defending == false)
{
_root.moving = true;
_root.dir = "L";
this.gotoAndStop(3);
this._x -= _root.movespd + (_root.addagi + _root.agi) / 5 * 0.1;
_root.dir = "L";
this.gotoAndStop(3);
this._x -= _root.movespd + (_root.addagi + _root.agi) / 5 * 0.1;
}
else if(Key.isDown(39) && _root.attacking == false && _root.defending == false)
{
else if(Key.isDown(39) && _root.attacking == false && _root.defending == false)
{
_root.moving = true;
_root.dir = "R";
this.gotoAndStop(4);
this._x += _root.movespd + (_root.addagi + _root.agi) / 5 * 0.1;
_root.dir = "R";
this.gotoAndStop(4);
this._x += _root.movespd + (_root.addagi + _root.agi) / 5 * 0.1;
}
if(Key.isDown(38) && _root.attacking == false && _root.defending == false)
{
if(Key.isDown(38) && _root.attacking == false && _root.defending == false)
{
_root.moving = true;
this._y -= _root.movespd + (_root.addagi + _root.agi) / 5 * 0.1;
if(_root.dir == "L")
{
this._y -= _root.movespd + (_root.addagi + _root.agi) / 5 * 0.1;
if(_root.dir == "L")
{
this.gotoAndStop(3);
}
else
{
else
{
this.gotoAndStop(4);
}
}
else if(Key.isDown(40) && _root.attacking == false && _root.defending == false)
{
else if(Key.isDown(40) && _root.attacking == false && _root.defending == false)
{
_root.moving = true;
this._y += _root.movespd + (_root.addagi + _root.agi) / 5 * 0.1;
if(_root.dir == "L")
{
this._y += _root.movespd + (_root.addagi + _root.agi) / 5 * 0.1;
if(_root.dir == "L")
{
this.gotoAndStop(3);
}
else
{
else
{
this.gotoAndStop(4);
}
}
if(_root.hitrange == true)
{
if(_root.hitrange == true)
{
if(_root.dmgrangetype == 1)
{
{
shootbow();
}
else if(_root.dmgrangetype == 2)
{
else if(_root.dmgrangetype == 2)
{
shootmagic();
}
else if(_root.dmgrangetype == 3)
{
else if(_root.dmgrangetype == 3)
{
if(_root.rangeammo >= 1)
{
{
shootmagic();
_root.rangeammo = _root.rangeammo - 1;
_root.rangeammo = _root.rangeammo - 1;
}
else if(_root.rangeammo == 0)
{
else if(_root.rangeammo == 0)
{
_root.rangeammo = _root.rangeammo - 1;
_root.wpnrange = 0;
_root.dmgrangemin = 0;
_root.dmgrangemax = 0;
_root.dmgrangetype = 0;
_root.wpnrangestr = 0;
_root.wpnrangeagi = 0;
_root.wpnrangeend = 0;
_root.wpnrangewil = 0;
_root.wpnrangearm = 0;
_root.magattspeed = 0;
_root.bowslot.gotoAndStop(1);
_root.rangeammo = 0;
_root.wpnrange = 0;
_root.dmgrangemin = 0;
_root.dmgrangemax = 0;
_root.dmgrangetype = 0;
_root.wpnrangestr = 0;
_root.wpnrangeagi = 0;
_root.wpnrangeend = 0;
_root.wpnrangewil = 0;
_root.wpnrangearm = 0;
_root.magattspeed = 0;
_root.bowslot.gotoAndStop(1);
_root.rangeammo = 0;
}
}
}
if(_root.spdagi >= _root.attspeed)
{
if(_root.spdagi >= _root.attspeed)
{
var _loc3_ = 0;
}
else
{
else
{
_loc3_ = _root.attspeed - _root.spdagi;
}
if(_root.hero.ani._currentframe >= 20 + Math.round(_loc3_) && (_root.hero._currentframe == 5 || _root.hero._currentframe == 6) && _root.criticalhitting == false)
{
if(_root.hero.ani._currentframe >= 20 + Math.round(_loc3_) && (_root.hero._currentframe == 5 || _root.hero._currentframe == 6) && _root.criticalhitting == false)
{
_root.attacking = false;
_root.hero.ani.gotoAndPlay(1);
_root.hero.ani.gotoAndPlay(1);
}
if(_root.hero.ani._currentframe >= 30 + Math.round(_root.magattspeed) && (_root.hero._currentframe == 13 || _root.hero._currentframe == 14))
{
if(_root.hero.ani._currentframe >= 30 + Math.round(_root.magattspeed) && (_root.hero._currentframe == 13 || _root.hero._currentframe == 14))
{
_root.attacking = false;
_root.hero.ani.gotoAndPlay(1);
_root.hero.ani.gotoAndPlay(1);
}
if(Key.isDown(37) == false && Key.isDown(39) == false && Key.isDown(38) == false && Key.isDown(40) == false)
{
if(Key.isDown(37) == false && Key.isDown(39) == false && Key.isDown(38) == false && Key.isDown(40) == false)
{
_root.moving = false;
if(Key.isDown(65) && _root.attacking == false && _root.defending == false)
{
if(Key.isDown(65) && _root.attacking == false && _root.defending == false)
{
_root.attacking = true;
_root.defending = false;
if(_root.dir == "L")
{
_root.defending = false;
if(_root.dir == "L")
{
this.gotoAndStop(5);
}
else
{
else
{
this.gotoAndStop(6);
}
}
else if(Key.isDown(83) && _root.attacking == false && _root.defending == false)
{
else if(Key.isDown(83) && _root.attacking == false && _root.defending == false)
{
_root.attacking = true;
_root.defending = false;
if(_root.dir == "L")
{
_root.defending = false;
if(_root.dir == "L")
{
this.gotoAndStop(7);
}
else
{
else
{
this.gotoAndStop(8);
}
}
else if(Key.isDown(70) && _root.attacking == false && _root.defending == false)
{
else if(Key.isDown(70) && _root.attacking == false && _root.defending == false)
{
if(_root.dmgrangetype == 3)
{
{
_root.attacking = true;
_root.defending = false;
if(_root.dir == "L")
{
_root.defending = false;
if(_root.dir == "L")
{
this.gotoAndStop(13);
}
else
{
else
{
this.gotoAndStop(14);
}
}
else if(_root.dmgrangetype == 2)
{
else if(_root.dmgrangetype == 2)
{
_root.attacking = true;
_root.defending = false;
if(_root.dir == "L")
{
_root.defending = false;
if(_root.dir == "L")
{
this.gotoAndStop(13);
}
else
{
else
{
this.gotoAndStop(14);
}
}
else if(_root.dmgrangetype == 1)
{
else if(_root.dmgrangetype == 1)
{
_root.attacking = true;
_root.defending = false;
if(_root.dir == "L")
{
_root.defending = false;
if(_root.dir == "L")
{
this.gotoAndStop(11);
}
else
{
else
{
this.gotoAndStop(12);
}
}
else
{
else
{
tiptimer = 15;
_root.maintip.tipvar = "No Ranged Weapon";
_root.maintip._visible = true;
_root.attacking = true;
_root.defending = false;
if(_root.dir == "L")
{
_root.maintip.tipvar = "No Ranged Weapon";
_root.maintip._visible = true;
_root.attacking = true;
_root.defending = false;
if(_root.dir == "L")
{
this.gotoAndStop(7);
}
else
{
else
{
this.gotoAndStop(8);
}
}
}
else if(Key.isDown(68) && _root.attacking == false)
{
else if(Key.isDown(68) && _root.attacking == false)
{
_root.defending = true;
_root.attacking = false;
if(_root.dir == "L")
{
_root.attacking = false;
if(_root.dir == "L")
{
this.gotoAndStop(9);
}
else
{
else
{
this.gotoAndStop(10);
}
}
else if(Key.isDown(68) == false && _root.attacking == false)
{
else if(Key.isDown(68) == false && _root.attacking == false)
{
_root.defending = false;
_root.attacking = false;
if(_root.dir == "L")
{
_root.attacking = false;
if(_root.dir == "L")
{
this.gotoAndStop(1);
}
else
{
else
{
this.gotoAndStop(2);
}
}
}
if(_root.showtip == "food")
{
if(_root.showtip == "food")
{
_root.main.tip.tipvar = "Food is restoring " + _root.foodheal / 2 + " health every second for " + _root.foodtimer * 2 + " more seconds.";
_root.main.tip._visible = true;
_root.main.tip._visible = true;
}
else if(_root.showtip == "strp")
{
else if(_root.showtip == "strp")
{
_root.main.tip.tipvar = "Your Strength is increased by " + _root.buffstr + " for " + _root.buffatrtimer * 2 + " more seconds.";
_root.main.tip._visible = true;
_root.main.tip._visible = true;
}
else if(_root.showtip == "agip")
{
else if(_root.showtip == "agip")
{
_root.main.tip.tipvar = "Your Agility is increased by " + _root.buffagi + " for " + _root.buffatrtimer * 2 + " more seconds.";
_root.main.tip._visible = true;
_root.main.tip._visible = true;
}
else if(_root.showtip == "endp")
{
else if(_root.showtip == "endp")
{
_root.main.tip.tipvar = "Your Endurance is increased by " + _root.buffend + " for " + _root.buffatrtimer * 2 + " more seconds.";
_root.main.tip._visible = true;
_root.main.tip._visible = true;
}
else if(_root.showtip == "wilp")
{
else if(_root.showtip == "wilp")
{
_root.main.tip.tipvar = "Your Willpower is increased by " + _root.buffwil + " for " + _root.buffatrtimer * 2 + " more seconds.";
_root.main.tip._visible = true;
_root.main.tip._visible = true;
}
else if(_root.showtip == "armp")
{
else if(_root.showtip == "armp")
{
_root.main.tip.tipvar = "Your Armour is increased by " + _root.buffarm + " for " + _root.buffatrtimer * 2 + " more seconds.";
_root.main.tip._visible = true;
_root.main.tip._visible = true;
}
else
{
else
{
_root.main.tip._visible = false;
}
timer++;
timer %= 100;
sectimer++;
sectimer %= 40;
if(tiptimer < 0)
{
timer++;
timer %= 100;
sectimer++;
sectimer %= 40;
if(tiptimer < 0)
{
_root.maintip._visible = false;
}
else
{
else
{
tiptimer -= 0.25;
}
if(_root.foodtimer > 0)
{
if(_root.foodtimer > 0)
{
if(sectimer == 0)
{
{
_root.hero.foodheal.gotoAndPlay(2);
_root.foodtimer = _root.foodtimer - 1;
_root.main.bufffood._visible = true;
if(_root.hp <= _root.hpmax - Math.round(_root.foodheal))
{
_root.foodtimer = _root.foodtimer - 1;
_root.main.bufffood._visible = true;
if(_root.hp <= _root.hpmax - Math.round(_root.foodheal))
{
_root.hp += Math.round(_root.foodheal);
}
else
{
else
{
_root.hp = _root.hpmax;
}
}
}
else
{
else
{
_root.foodheal = 0;
_root.main.bufffood._visible = false;
_root.main.bufffood._visible = false;
}
if(_root.buffatrtimer > 0)
{
if(_root.buffatrtimer > 0)
{
if(sectimer == 0)
{
{
_root.buffatrtimer = _root.buffatrtimer - 1;
_root.hero.ability.gotoAndPlay(2);
if(_root.buffstr > 0)
{
_root.hero.ability.gotoAndPlay(2);
if(_root.buffstr > 0)
{
_root.main.buffstr._visible = true;
}
else
{
else
{
_root.main.buffstr._visible = false;
}
if(_root.buffagi > 0)
{
if(_root.buffagi > 0)
{
_root.main.buffagi._visible = true;
}
else
{
else
{
_root.main.buffagi._visible = false;
}
if(_root.buffend > 0)
{
if(_root.buffend > 0)
{
_root.main.buffend._visible = true;
}
else
{
else
{
_root.main.buffend._visible = false;
}
if(_root.buffwil > 0)
{
if(_root.buffwil > 0)
{
_root.main.buffwil._visible = true;
}
else
{
else
{
_root.main.buffwil._visible = false;
}
if(_root.buffarm > 0)
{
if(_root.buffarm > 0)
{
_root.main.buffarm._visible = true;
}
else
{
else
{
_root.main.buffarm._visible = false;
}
}
}
else
{
else
{
_root.buffarm = 0;
_root.buffstr = 0;
_root.buffagi = 0;
_root.buffend = 0;
_root.buffwil = 0;
_root.main.buffstr._visible = false;
_root.main.buffagi._visible = false;
_root.main.buffend._visible = false;
_root.main.buffwil._visible = false;
_root.main.buffarm._visible = false;
_root.buffstr = 0;
_root.buffagi = 0;
_root.buffend = 0;
_root.buffwil = 0;
_root.main.buffstr._visible = false;
_root.main.buffagi._visible = false;
_root.main.buffend._visible = false;
_root.main.buffwil._visible = false;
_root.main.buffarm._visible = false;
}
if(timer == 0 && _root.attacking == false && _root.defending == false)
{
if(timer == 0 && _root.attacking == false && _root.defending == false)
{
if(_root.hp <= _root.hpmax - Math.round(Math.round((_root.wil + _root.addwil - 5) / 6) + 1))
{
{
_root.hp += Math.round((_root.wil + _root.addwil - 5) / 6) + 1;
}
else
{
else
{
_root.hp = _root.hpmax;
}
}
_root.main.lvl = _root.lvl;
this.ani.weapon.gotoAndStop(_root.wpn);
this.ani.bow.gotoAndStop(_root.wpnrange);
this.ani.projectile.gotoAndStop(_root.wpnrange);
this.ani.shield.gotoAndStop(_root.shi);
this.ani.body.gotoAndStop(_root.bdy);
this.ani.shoulder.gotoAndStop(_root.bdy);
this.ani.head.gotoAndStop(_root.head);
_root.hudeverything.dmg = _root.dmgmin + _root.strdmg + " - " + (_root.dmgmax + _root.strdmg);
if(_root.dmgrangetype >= 2)
{
_root.main.lvl = _root.lvl;
this.ani.weapon.gotoAndStop(_root.wpn);
this.ani.bow.gotoAndStop(_root.wpnrange);
this.ani.projectile.gotoAndStop(_root.wpnrange);
this.ani.shield.gotoAndStop(_root.shi);
this.ani.body.gotoAndStop(_root.bdy);
this.ani.shoulder.gotoAndStop(_root.bdy);
this.ani.head.gotoAndStop(_root.head);
_root.hudeverything.dmg = _root.dmgmin + _root.strdmg + " - " + (_root.dmgmax + _root.strdmg);
if(_root.dmgrangetype >= 2)
{
_root.hudeverything.dmgrange = _root.dmgrangemin + _root.wildmg + " - " + (_root.dmgrangemax + _root.wildmg);
}
else if(_root.dmgrangetype == 1)
{
else if(_root.dmgrangetype == 1)
{
_root.hudeverything.dmgrange = _root.dmgrangemin + _root.agidmg + " - " + (_root.dmgrangemax + _root.agidmg);
}
else
{
else
{
_root.hudeverything.dmgrange = "Not Equiped";
}
_root.hudeverything.arm = _root.arm;
_root.blockrating = Math.round((_root.end + _root.addend - 5) * 0.33) + 14 + _root.shiblock * 2;
_root.hpmax = Math.round((_root.end + _root.addend) * 2);
_root.hudeverything.hp = _root.hp + "/" + _root.hpmax;
_root.hudeverything.blok = _root.blockrating - 14;
_root.hudeverything.weapon.gotoAndStop(_root.wpnslot._currentframe);
_root.hudeverything.shield.gotoAndStop(_root.shislot._currentframe);
_root.hudeverything.bow.gotoAndStop(_root.bowslot._currentframe);
_root.hudeverything.armor.gotoAndStop(_root.armorslot._currentframe);
_root.hudeverything.head.gotoAndStop(_root.headslot._currentframe);
_root.hudeverything.jewel.gotoAndStop(_root.jewelslot._currentframe);
_root.hudeverything.weapontop.gotoAndStop(_root.wpnslot._currentframe);
_root.hudeverything.shieldtop.gotoAndStop(_root.shislot._currentframe);
_root.hudeverything.bowtop.gotoAndStop(_root.bowslot._currentframe);
_root.hudeverything.armortop.gotoAndStop(_root.armorslot._currentframe);
_root.hudeverything.headtop.gotoAndStop(_root.headslot._currentframe);
_root.hudeverything.jeweltop.gotoAndStop(_root.jewelslot._currentframe);
_root.hudeverything.spnt = _root.spnt;
_root.hudeverything.str = _root.str;
_root.hudeverything.agi = _root.agi;
_root.hudeverything.end = _root.end;
_root.hudeverything.wil = _root.wil;
_root.hudeverything.rep = _root.rep;
_root.main.charname = _root.charname;
if(_root.shop == true)
{
_root.hudeverything.arm = _root.arm;
_root.blockrating = Math.round((_root.end + _root.addend - 5) * 0.33) + 14 + _root.shiblock * 2;
_root.hpmax = Math.round((_root.end + _root.addend) * 2);
_root.hudeverything.hp = _root.hp + "/" + _root.hpmax;
_root.hudeverything.blok = _root.blockrating - 14;
_root.hudeverything.weapon.gotoAndStop(_root.wpnslot._currentframe);
_root.hudeverything.shield.gotoAndStop(_root.shislot._currentframe);
_root.hudeverything.bow.gotoAndStop(_root.bowslot._currentframe);
_root.hudeverything.armor.gotoAndStop(_root.armorslot._currentframe);
_root.hudeverything.head.gotoAndStop(_root.headslot._currentframe);
_root.hudeverything.jewel.gotoAndStop(_root.jewelslot._currentframe);
_root.hudeverything.weapontop.gotoAndStop(_root.wpnslot._currentframe);
_root.hudeverything.shieldtop.gotoAndStop(_root.shislot._currentframe);
_root.hudeverything.bowtop.gotoAndStop(_root.bowslot._currentframe);
_root.hudeverything.armortop.gotoAndStop(_root.armorslot._currentframe);
_root.hudeverything.headtop.gotoAndStop(_root.headslot._currentframe);
_root.hudeverything.jeweltop.gotoAndStop(_root.jewelslot._currentframe);
_root.hudeverything.spnt = _root.spnt;
_root.hudeverything.str = _root.str;
_root.hudeverything.agi = _root.agi;
_root.hudeverything.end = _root.end;
_root.hudeverything.wil = _root.wil;
_root.hudeverything.rep = _root.rep;
_root.main.charname = _root.charname;
if(_root.shop == true)
{
_root.chat.shopbtn._visible = true;
}
else
{
else
{
_root.chat.shopbtn._visible = false;
_root.shoptab._visible = false;
_root.shoptab._visible = false;
}
if(_root.savechat == true)
{
if(_root.savechat == true)
{
_root.chat.savebtn._visible = true;
playerSO = SharedObject.getLocal("playerInfo");
player = new Object();
_root.savename1 = playerSO.data.playerDat.charname;
_root.savetab.name1 = playerSO.data.playerDat.charname;
playerSO2 = SharedObject.getLocal("playerInfo");
player2 = new Object();
_root.savename2 = playerSO2.data.playerDat2.charname;
_root.savetab.name2 = playerSO2.data.playerDat2.charname;
playerSO = SharedObject.getLocal("playerInfo");
player = new Object();
_root.savename1 = playerSO.data.playerDat.charname;
_root.savetab.name1 = playerSO.data.playerDat.charname;
playerSO2 = SharedObject.getLocal("playerInfo");
player2 = new Object();
_root.savename2 = playerSO2.data.playerDat2.charname;
_root.savetab.name2 = playerSO2.data.playerDat2.charname;
}
else
{
else
{
_root.chat.savebtn._visible = false;
_root.savechat._visible = false;
_root.savechat._visible = false;
}
if(_root.spnt > 0)
{
if(_root.spnt > 0)
{
_root.hudeverything.btnaddstr._visible = true;
_root.hudeverything.btnaddagi._visible = true;
_root.hudeverything.btnaddend._visible = true;
_root.hudeverything.btnaddwil._visible = true;
_root.skills2spend._visible = true;
_root.hudeverything.btnaddagi._visible = true;
_root.hudeverything.btnaddend._visible = true;
_root.hudeverything.btnaddwil._visible = true;
_root.skills2spend._visible = true;
}
else
{
else
{
_root.hudeverything.btnaddstr._visible = false;
_root.hudeverything.btnaddagi._visible = false;
_root.hudeverything.btnaddend._visible = false;
_root.hudeverything.btnaddwil._visible = false;
_root.skills2spend._visible = false;
_root.hudeverything.btnaddagi._visible = false;
_root.hudeverything.btnaddend._visible = false;
_root.hudeverything.btnaddwil._visible = false;
_root.skills2spend._visible = false;
}
_root.strdmg = Math.round((_root.str + _root.addstr - 5) / 2);
_root.dmgminhit = _root.dmgmin + _root.strdmg;
_root.dmgdiffhit = _root.dmgmax + _root.strdmg - _root.dmgminhit;
_root.dmgmaxhit = _root.dmgminhit + _root.dmgdiffhit;
_root.agidmg = Math.round((_root.agi + _root.addagi - 5) / 6);
_root.wildmg = Math.round((_root.wil + _root.addwil - 5) / 6);
_root.hudeverything.bow.stacknum = _root.rangeammo;
if(_root.dmgrangetype >= 2)
{
_root.strdmg = Math.round((_root.str + _root.addstr - 5) / 2);
_root.dmgminhit = _root.dmgmin + _root.strdmg;
_root.dmgdiffhit = _root.dmgmax + _root.strdmg - _root.dmgminhit;
_root.dmgmaxhit = _root.dmgminhit + _root.dmgdiffhit;
_root.agidmg = Math.round((_root.agi + _root.addagi - 5) / 6);
_root.wildmg = Math.round((_root.wil + _root.addwil - 5) / 6);
_root.hudeverything.bow.stacknum = _root.rangeammo;
if(_root.dmgrangetype >= 2)
{
_root.dmgrangeminhit = _root.dmgrangemin + _root.wildmg;
_root.dmgrangediffhit = _root.dmgrangemax + _root.wildmg - _root.dmgrangeminhit;
_root.dmgrangemaxhit = _root.dmgrangeminhit + _root.dmgrangediffhit;
_root.dmggen3 = _root.dmgrangeminhit + random(_root.dmgrangediffhit + 1);
_root.dmgrangediffhit = _root.dmgrangemax + _root.wildmg - _root.dmgrangeminhit;
_root.dmgrangemaxhit = _root.dmgrangeminhit + _root.dmgrangediffhit;
_root.dmggen3 = _root.dmgrangeminhit + random(_root.dmgrangediffhit + 1);
}
else if(_root.dmgrangetype == 1)
{
else if(_root.dmgrangetype == 1)
{
_root.dmgrangeminhit = _root.dmgrangemin + _root.agidmg;
_root.dmgrangediffhit = _root.dmgrangemax + _root.agidmg - _root.dmgrangeminhit;
_root.dmgrangemaxhit = _root.dmgrangeminhit + _root.dmgrangediffhit;
_root.dmggen3 = _root.dmgrangeminhit + random(_root.dmgrangediffhit + 1);
_root.dmgrangediffhit = _root.dmgrangemax + _root.agidmg - _root.dmgrangeminhit;
_root.dmgrangemaxhit = _root.dmgrangeminhit + _root.dmgrangediffhit;
_root.dmggen3 = _root.dmgrangeminhit + random(_root.dmgrangediffhit + 1);
}
else
{
else
{
_root.dmgrangeminhit = 0;
_root.dmgrangediffhit = 0;
_root.dmgrangemaxhit = 0;
_root.dmggen3 = _root.dmgrangeminhit + random(_root.dmgrangediffhit + 1);
_root.dmgrangediffhit = 0;
_root.dmgrangemaxhit = 0;
_root.dmggen3 = _root.dmgrangeminhit + random(_root.dmgrangediffhit + 1);
}
if(_root.dmgtype == 1)
{
if(_root.dmgtype == 1)
{
_root.dmggen = Math.round(0.666 * (_root.dmgminhit + random(_root.dmgdiffhit)));
_root.dmggen2 = _root.dmgminhit + random(_root.dmgdiffhit + 1);
_root.dmggen2 = _root.dmgminhit + random(_root.dmgdiffhit + 1);
}
else if(_root.dmgtype == 2)
{
else if(_root.dmgtype == 2)
{
_root.dmggen = _root.dmgminhit + random(_root.dmgdiffhit + 1);
_root.dmggen2 = Math.round(0.666 * (_root.dmgminhit + random(_root.dmgdiffhit)));
_root.dmggen2 = Math.round(0.666 * (_root.dmgminhit + random(_root.dmgdiffhit)));
}
else
{
else
{
_root.dmggen = _root.dmgminhit + random(_root.dmgdiffhit + 1);
_root.dmggen2 = Math.round(0.333 * (_root.dmgminhit + random(_root.dmgdiffhit)));
_root.dmggen2 = Math.round(0.333 * (_root.dmgminhit + random(_root.dmgdiffhit)));
}
_root.endarm = Math.round((_root.addend + _root.end - 5) / 2);
_root.arm = _root.wpnarm + _root.armarm + _root.headarm + _root.jewarm + _root.shiarm + _root.endarm + _root.buffarm;
_root.armeff = Math.round(_root.arm / 8);
_root.addstr = _root.wpnstr + _root.armstr + _root.headstr + _root.jewstr + _root.shistr + _root.buffstr;
_root.addagi = _root.wpnagi + _root.armagi + _root.headagi + _root.jewagi + _root.shiagi + _root.buffagi;
_root.addend = _root.wpnend + _root.armend + _root.headend + _root.jewend + _root.shiend + _root.buffend;
_root.addwil = _root.wpnwil + _root.armwil + _root.headwil + _root.jewwil + _root.shiwil + _root.buffwil;
_root.addarm = _root.wpnarm + _root.armarm + _root.headarm + _root.jewarm + _root.shiarm + _root.buffarm;
_root.spdagi = Math.round((_root.agi + _root.addagi - 5) / 9);
_root.hudeverything.addstr = "+ " + _root.addstr;
_root.hudeverything.addagi = "+ " + _root.addagi;
_root.hudeverything.addend = "+ " + _root.addend;
_root.hudeverything.addwil = "+ " + _root.addwil;
_root.hudeverything.gold = "You have " + _root.gold + " coins";
_root.shoptab.goldshop = "You have " + _root.gold + " coins";
if(_root.hudeverything._visible == false || _root.hudeverything._currentframe != 1)
{
_root.endarm = Math.round((_root.addend + _root.end - 5) / 2);
_root.arm = _root.wpnarm + _root.armarm + _root.headarm + _root.jewarm + _root.shiarm + _root.endarm + _root.buffarm;
_root.armeff = Math.round(_root.arm / 8);
_root.addstr = _root.wpnstr + _root.armstr + _root.headstr + _root.jewstr + _root.shistr + _root.buffstr;
_root.addagi = _root.wpnagi + _root.armagi + _root.headagi + _root.jewagi + _root.shiagi + _root.buffagi;
_root.addend = _root.wpnend + _root.armend + _root.headend + _root.jewend + _root.shiend + _root.buffend;
_root.addwil = _root.wpnwil + _root.armwil + _root.headwil + _root.jewwil + _root.shiwil + _root.buffwil;
_root.addarm = _root.wpnarm + _root.armarm + _root.headarm + _root.jewarm + _root.shiarm + _root.buffarm;
_root.spdagi = Math.round((_root.agi + _root.addagi - 5) / 9);
_root.hudeverything.addstr = "+ " + _root.addstr;
_root.hudeverything.addagi = "+ " + _root.addagi;
_root.hudeverything.addend = "+ " + _root.addend;
_root.hudeverything.addwil = "+ " + _root.addwil;
_root.hudeverything.gold = "You have " + _root.gold + " coins";
_root.shoptab.goldshop = "You have " + _root.gold + " coins";
if(_root.hudeverything._visible == false || _root.hudeverything._currentframe != 1)
{
rearrangeinventory();
}
if(_root.xp >= _root.xpneed)
{
if(_root.xp >= _root.xpneed)
{
_root.xp -= _root.xpneed;
_root.lvl = _root.lvl + 1;
_root.spnt += 3;
_root.xpneed = Math.round(_root.xpneed * 1.5);
_root.hero.lvlup.gotoAndPlay(2);
_root.hp = _root.hpmax;
tiptimer = 15;
_root.maintip.tipvar = "Level Up!! Your now level " + _root.lvl + " you have " + _root.spnt + " points to spend";
_root.maintip._visible = true;
_root.lvl = _root.lvl + 1;
_root.spnt += 3;
_root.xpneed = Math.round(_root.xpneed * 1.5);
_root.hero.lvlup.gotoAndPlay(2);
_root.hp = _root.hpmax;
tiptimer = 15;
_root.maintip.tipvar = "Level Up!! Your now level " + _root.lvl + " you have " + _root.spnt + " points to spend";
_root.maintip._visible = true;
}
if(_root.hp < 0)
{
if(_root.hp < 0)
{
stopAllSounds();
_root.area = "enemy";
_root.areaswitch = "enemy";
tracknum == 1;
_root.menuon = true;
_root.mainmenu.gotoAndStop(7);
_root.area = "enemy";
_root.areaswitch = "enemy";
tracknum == 1;
_root.menuon = true;
_root.mainmenu.gotoAndStop(7);
}
}
};
createEnemy = function(type, x, y, hp, dmg)
{
createEnemy = function(type, x, y, hp, dmg)
{
var _loc3_ = "enemy" + enemyCount;
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 3;
_root.bg.enemylayer[_loc3_].hitmax = hp + 3;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].attacked = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 3;
_root.bg.enemylayer[_loc3_].hitmax = hp + 3;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].attacked = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
if(_root.menuon == false)
{
{
this.hud.lvl = Math.round((this.hitmax - 10) / 6 + this.dmg / 5);
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc7_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc7_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
if(this._x > _root.hero._x)
{
{
var _loc8_ = "L";
}
else if(this._x < _root.hero._x)
{
else if(this._x < _root.hero._x)
{
_loc8_ = "R";
}
if(_loc7_ < 60)
{
if(_loc7_ < 60)
{
this.moving = false;
if(_loc8_ == "L")
{
if(_loc8_ == "L")
{
this.gotoAndStop(4);
}
else
{
else
{
this.gotoAndStop(5);
}
this.attacked = true;
this.attacking = true;
this.attacked = true;
this.attacking = true;
}
else if(_loc7_ < 150 || this.attacked == true)
{
else if(_loc7_ < 150 || this.attacked == true)
{
this.moving = true;
}
}
if(this.moving == true)
{
if(this.moving == true)
{
if(_loc8_ == "L")
{
{
this.gotoAndStop(2);
this._x -= 4;
this._x -= 4;
}
else
{
else
{
this.gotoAndStop(3);
this._x += 4;
this._x += 4;
}
if(this._y > _root.hero._y + 10)
{
if(this._y > _root.hero._y + 10)
{
this._y -= 5;
}
else if(this._y < _root.hero._y - 10)
{
else if(this._y < _root.hero._y - 10)
{
this._y += 5;
}
}
if(this.hit == true)
{
if(this.hit == true)
{
if(_root.defending == false)
{
{
if(this.dmg > Math.round(_root.arm / 20))
{
{
var _loc3_ = Math.abs(this.dmg - Math.round(_root.arm / 20));
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
else if(_root.defending == true)
{
else if(_root.defending == true)
{
if(this._x >= _root.hero._x && _root.dir == "R" || this._x <= _root.hero._x && _root.dir == "L")
{
{
var _loc6_ = random(2 * this.dmg + 30);
}
else
{
else
{
_loc6_ = random(6 * this.dmg + 50);
}
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.hero.ani.gotoAndPlay("block");
}
else
{
else
{
_root.hero.ani.gotoAndPlay(1);
if(this.dmg > _root.armeff)
{
if(this.dmg > _root.armeff)
{
_loc3_ = Math.abs(this.dmg - _root.armeff);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
}
}
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
this.attacked = true;
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
this.hits -= _root.dmggen;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
}
else
{
else
{
this.hits -= _root.dmggen2;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
}
}
if(this.hits <= 0)
{
if(this.hits <= 0)
{
this.attacking = false;
this.moving = false;
this.alive = false;
this.gotoAndStop(6);
this.moving = false;
this.alive = false;
this.gotoAndStop(6);
}
}
};
enemyCount++;
enemyCount %= 10;
enemyCount++;
enemyCount %= 10;
};
createDryad = function(type, x, y, hp, dmg)
{
createDryad = function(type, x, y, hp, dmg)
{
var _loc3_ = "enemy" + enemyCount;
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 3;
_root.bg.enemylayer[_loc3_].hitmax = hp + 3;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].attacked = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 3;
_root.bg.enemylayer[_loc3_].hitmax = hp + 3;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].attacked = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
if(_root.menuon == false)
{
{
this.hud.lvl = Math.round((this.hitmax - 10) / 6 + this.dmg / 5);
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc7_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc7_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
if(this._x > _root.hero._x)
{
{
var _loc8_ = "L";
}
else if(this._x < _root.hero._x)
{
else if(this._x < _root.hero._x)
{
_loc8_ = "R";
}
if(_loc7_ < 60)
{
if(_loc7_ < 60)
{
this.moving = false;
if(_loc8_ == "L")
{
if(_loc8_ == "L")
{
this.gotoAndStop(5);
}
else
{
else
{
this.gotoAndStop(6);
}
this.attacked = true;
this.attacking = true;
this.attacked = true;
this.attacking = true;
}
else if(_loc7_ < 150 || this.attacked == true)
{
else if(_loc7_ < 150 || this.attacked == true)
{
if(this._currentframe <= 2 && this.moving == false)
{
{
this.gotoAndStop(2);
}
else
{
else
{
this.moving = true;
}
}
}
if(this.moving == true)
{
if(this.moving == true)
{
if(_loc8_ == "L")
{
{
this.gotoAndStop(3);
this._x -= 4;
this._x -= 4;
}
else
{
else
{
this.gotoAndStop(4);
this._x += 4;
this._x += 4;
}
if(this._y > _root.hero._y + 10)
{
if(this._y > _root.hero._y + 10)
{
this._y -= 5;
}
else if(this._y < _root.hero._y - 10)
{
else if(this._y < _root.hero._y - 10)
{
this._y += 5;
}
}
if(this.hit == true)
{
if(this.hit == true)
{
if(_root.defending == false)
{
{
if(this.dmg > Math.round(_root.arm / 20))
{
{
var _loc3_ = Math.abs(this.dmg - Math.round(_root.arm / 20));
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
else if(_root.defending == true)
{
else if(_root.defending == true)
{
if(this._x >= _root.hero._x && _root.dir == "R" || this._x <= _root.hero._x && _root.dir == "L")
{
{
var _loc6_ = random(2 * this.dmg + 30);
}
else
{
else
{
_loc6_ = random(6 * this.dmg + 50);
}
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.hero.ani.gotoAndPlay("block");
}
else
{
else
{
_root.hero.ani.gotoAndPlay(1);
if(this.dmg > _root.armeff)
{
if(this.dmg > _root.armeff)
{
_loc3_ = Math.abs(this.dmg - _root.armeff);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
}
}
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
this.attacked = true;
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
this.hits -= _root.dmggen;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
}
else
{
else
{
this.hits -= _root.dmggen2;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
}
}
if(this.hits <= 0)
{
if(this.hits <= 0)
{
this.attacking = false;
this.moving = false;
this.alive = false;
this.gotoAndStop(7);
this.moving = false;
this.alive = false;
this.gotoAndStop(7);
}
}
};
enemyCount++;
enemyCount %= 10;
enemyCount++;
enemyCount %= 10;
};
createRangedEnemy = function(type, x, y, hp, dmg, ran)
{
createRangedEnemy = function(type, x, y, hp, dmg, ran)
{
var _loc3_ = "enemy" + enemyCount;
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 4;
_root.bg.enemylayer[_loc3_].hitmax = hp + 4;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].ran = ran;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].attacked = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 4;
_root.bg.enemylayer[_loc3_].hitmax = hp + 4;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].ran = ran;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].attacked = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
if(_root.menuon == false)
{
{
this.hud.lvl = Math.round((this.hitmax - 10) / 6 + this.dmg / 5);
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc7_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc7_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
if(this._x > _root.hero._x)
{
{
var _loc8_ = "L";
}
else if(this._x < _root.hero._x)
{
else if(this._x < _root.hero._x)
{
_loc8_ = "R";
}
if(_loc7_ < this.ran)
{
if(_loc7_ < this.ran)
{
this.moving = false;
if(_loc8_ == "L")
{
if(_loc8_ == "L")
{
this.gotoAndStop(4);
}
else
{
else
{
this.gotoAndStop(5);
}
this.attacked = true;
this.attacking = true;
this.attacked = true;
this.attacking = true;
}
else if(_loc7_ < 150 || this.attacked == true)
{
else if(_loc7_ < 150 || this.attacked == true)
{
this.moving = true;
}
}
if(this.moving == true)
{
if(this.moving == true)
{
if(_loc8_ == "L")
{
{
this.gotoAndStop(2);
this._x -= 4;
this._x -= 4;
}
else
{
else
{
this.gotoAndStop(3);
this._x += 4;
this._x += 4;
}
if(this._y > _root.hero._y + 10)
{
if(this._y > _root.hero._y + 10)
{
this._y -= 5;
}
else if(this._y < _root.hero._y - 10)
{
else if(this._y < _root.hero._y - 10)
{
this._y += 5;
}
}
if(this.hit == true)
{
if(this.hit == true)
{
if(_root.defending == false)
{
{
if(this.dmg > Math.round(_root.arm / 20))
{
{
var _loc3_ = Math.abs(this.dmg - Math.round(_root.arm / 20));
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
else if(_root.defending == true)
{
else if(_root.defending == true)
{
if(this._x >= _root.hero._x && _root.dir == "R" || this._x <= _root.hero._x && _root.dir == "L")
{
{
var _loc6_ = random(2 * this.dmg + 30);
}
else
{
else
{
_loc6_ = random(6 * this.dmg + 50);
}
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.hero.ani.gotoAndPlay("block");
}
else
{
else
{
_root.hero.ani.gotoAndPlay(1);
if(this.dmg > _root.armeff)
{
if(this.dmg > _root.armeff)
{
_loc3_ = Math.abs(this.dmg - _root.armeff);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
}
}
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
this.attacked = true;
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
this.hits -= _root.dmggen;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
}
else
{
else
{
this.hits -= _root.dmggen2;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
}
}
if(this.hits <= 0)
{
if(this.hits <= 0)
{
this.attacking = false;
this.moving = false;
this.alive = false;
this.gotoAndStop(6);
this.moving = false;
this.alive = false;
this.gotoAndStop(6);
}
}
};
enemyCount++;
enemyCount %= 10;
enemyCount++;
enemyCount %= 10;
};
createPassiveEnemy = function(type, x, y, hp, dmg)
{
createPassiveEnemy = function(type, x, y, hp, dmg)
{
var _loc3_ = "enemy" + enemyCount;
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 3;
_root.bg.enemylayer[_loc3_].hitmax = hp + 3;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 3;
_root.bg.enemylayer[_loc3_].hitmax = hp + 3;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
if(_root.menuon == false)
{
{
this.hud.lvl = 0;
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc8_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc8_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
if(this._x > _root.hero._x)
{
{
var _loc7_ = "L";
}
else if(this._x < _root.hero._x)
{
else if(this._x < _root.hero._x)
{
_loc7_ = "R";
}
if(this.attacked == true)
{
if(this.attacked == true)
{
if(_loc8_ < 60)
{
{
this.moving = false;
if(_loc7_ == "L")
{
if(_loc7_ == "L")
{
this.gotoAndStop(4);
}
else
{
else
{
this.gotoAndStop(5);
}
this.attacked = true;
this.attacking = true;
this.attacked = true;
this.attacking = true;
}
else if(this.attacked == true)
{
else if(this.attacked == true)
{
this.moving = true;
}
}
else
{
else
{
this.moving = false;
this.gotoAndStop(1);
this.gotoAndStop(1);
}
}
if(this.moving == true)
{
if(this.moving == true)
{
if(_loc7_ == "L")
{
{
this.gotoAndStop(2);
this._x -= 4;
this._x -= 4;
}
else
{
else
{
this.gotoAndStop(3);
this._x += 4;
this._x += 4;
}
if(this._y > _root.hero._y + 10)
{
if(this._y > _root.hero._y + 10)
{
this._y -= 5;
}
else if(this._y < _root.hero._y - 10)
{
else if(this._y < _root.hero._y - 10)
{
this._y += 5;
}
}
if(this.hit == true)
{
if(this.hit == true)
{
if(_root.defending == false)
{
{
if(this.dmg > Math.round(_root.arm / 20))
{
{
var _loc3_ = Math.abs(this.dmg - Math.round(_root.arm / 20));
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
else if(_root.defending == true)
{
else if(_root.defending == true)
{
if(this._x >= _root.hero._x && _root.dir == "R" || this._x <= _root.hero._x && _root.dir == "L")
{
{
var _loc6_ = random(2 * this.dmg + 30);
}
else
{
else
{
_loc6_ = random(6 * this.dmg + 50);
}
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.hero.ani.gotoAndPlay("block");
}
else
{
else
{
_root.hero.ani.gotoAndPlay(1);
if(this.dmg > _root.armeff)
{
if(this.dmg > _root.armeff)
{
_loc3_ = Math.abs(this.dmg - _root.armeff);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
}
}
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
this.attacked = true;
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
this.hits -= _root.dmggen;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
}
else
{
else
{
this.hits -= _root.dmggen2;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
}
}
if(this.hits <= 0)
{
if(this.hits <= 0)
{
this.attacking = false;
this.moving = false;
this.alive = false;
this.gotoAndStop(6);
this.moving = false;
this.alive = false;
this.gotoAndStop(6);
}
}
};
enemyCount++;
enemyCount %= 10;
enemyCount++;
enemyCount %= 10;
};
createGuard = function(type, x, y, hp, dmg)
{
createGuard = function(type, x, y, hp, dmg)
{
var _loc3_ = "enemy" + enemyCount;
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 3;
_root.bg.enemylayer[_loc3_].hitmax = hp + 3;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
_root.bg.enemylayer.attachMovie(type,_loc3_,enemyCount);
_root.bg.enemylayer[_loc3_]._x = x;
_root.bg.enemylayer[_loc3_]._y = y;
_root.bg.enemylayer[_loc3_].hits = hp + 3;
_root.bg.enemylayer[_loc3_].hitmax = hp + 3;
_root.bg.enemylayer[_loc3_].dmg = dmg;
_root.bg.enemylayer[_loc3_].hit = false;
_root.bg.enemylayer[_loc3_].attacking = false;
_root.bg.enemylayer[_loc3_].moving = false;
_root.bg.enemylayer[_loc3_].alive = true;
_root.bg.enemylayer[_loc3_].gotoAndStop(1);
_root.bg.enemylayer[_loc3_].onEnterFrame = function()
{
if(_root.menuon == false)
{
{
this.hud.lvl = Math.round((this.hitmax - 10) / 6 + this.dmg / 5);
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc7_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
var _loc5_ = this._x - _root.hero._x - _root.bg._x;
var _loc4_ = this._y - _root.hero._y - _root.bg._y;
var _loc7_ = Math.sqrt(_loc5_ * _loc5_ + _loc4_ * _loc4_);
if(this.attacking == false && this.alive == true)
{
if(this._x > _root.hero._x)
{
{
var _loc8_ = "L";
}
else if(this._x < _root.hero._x)
{
else if(this._x < _root.hero._x)
{
_loc8_ = "R";
}
if(_root.rep < -50 || this.attacked == true)
{
if(_root.rep < -50 || this.attacked == true)
{
if(_loc7_ < 60)
{
{
this.moving = false;
if(_loc8_ == "L")
{
if(_loc8_ == "L")
{
this.gotoAndStop(4);
}
else
{
else
{
this.gotoAndStop(5);
}
this.attacked = true;
this.attacking = true;
this.attacked = true;
this.attacking = true;
}
else if(_loc7_ < 200 || this.attacked == true)
{
else if(_loc7_ < 200 || this.attacked == true)
{
this.moving = true;
}
}
else
{
else
{
this.moving = false;
this.gotoAndStop(1);
this.gotoAndStop(1);
}
}
if(this.moving == true)
{
if(this.moving == true)
{
if(_loc8_ == "L")
{
{
this.gotoAndStop(2);
this._x -= 4;
this._x -= 4;
}
else
{
else
{
this.gotoAndStop(3);
this._x += 4;
this._x += 4;
}
if(this._y > _root.hero._y + 10)
{
if(this._y > _root.hero._y + 10)
{
this._y -= 5;
}
else if(this._y < _root.hero._y - 10)
{
else if(this._y < _root.hero._y - 10)
{
this._y += 5;
}
}
if(this.hit == true)
{
if(this.hit == true)
{
if(_root.defending == false)
{
{
if(this.dmg > Math.round(_root.arm / 20))
{
{
var _loc3_ = Math.abs(this.dmg - Math.round(_root.arm / 20));
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
else if(_root.defending == true)
{
else if(_root.defending == true)
{
if(this._x >= _root.hero._x && _root.dir == "R" || this._x <= _root.hero._x && _root.dir == "L")
{
{
var _loc6_ = random(2 * this.dmg + 30);
}
else
{
else
{
_loc6_ = random(6 * this.dmg + 50);
}
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.blockchance2 = _loc6_;
if(_loc6_ < _root.blockrating)
{
_root.hero.ani.gotoAndPlay("block");
}
else
{
else
{
_root.hero.ani.gotoAndPlay(1);
if(this.dmg > _root.armeff)
{
if(this.dmg > _root.armeff)
{
_loc3_ = Math.abs(this.dmg - _root.armeff);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
_root.hp -= _loc3_;
damagethingy("dmgtxtshow2",_root.hero._x,_root.hero._y - 50,_loc3_);
}
}
}
}
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
if(_root.hit == true && this.hitTest(_root.hero) && this.hits > 0)
{
this.attacked = true;
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
if(_root.hero._currentframe == 5 || _root.hero._currentframe == 6)
{
this.hits -= _root.dmggen;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen);
}
else
{
else
{
this.hits -= _root.dmggen2;
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
damagethingy("dmgtxtshow",this._x,this._y - 50,_root.dmggen2);
}
}
if(this.hits <= 0)
{
if(this.hits <= 0)
{
this.attacking = false;
this.moving = false;
this.alive = false;
this.gotoAndStop(6);
this.moving = false;
this.alive = false;
this.gotoAndStop(6);
}
}
};
enemyCount++;
enemyCount %= 10;
enemyCount++;
enemyCount %= 10;
};
spawner.onRelease = function()
{
spawner.onRelease = function()
{
_root.createRangedEnemy("enm_queenspider",200,200,47,14,200);
};
saver1.onRelease = function()
{
saver1.onRelease = function()
{
_root.setPlayerInfo1();
_root.savePlayer1();
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " saved to Slot 1";
_root.maintip._visible = true;
_root.savePlayer1();
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " saved to Slot 1";
_root.maintip._visible = true;
};
loader1.onRelease = function()
{
loader1.onRelease = function()
{
_root.loadPlayer1();
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " loaded from Slot 1";
_root.maintip._visible = true;
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " loaded from Slot 1";
_root.maintip._visible = true;
};
loadtab.loadbtn1.onRelease = function()
{
loadtab.loadbtn1.onRelease = function()
{
_root.tutorial.gotoAndStop(60);
if(_root.loadtab.name1 != undefined)
{
if(_root.loadtab.name1 != undefined)
{
_root.loadPlayer1();
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " loaded from Slot 1";
_root.maintip._visible = true;
_root.areaswitch = "travel";
_root.trackswitch = 100;
_root.loadtab._visible = false;
_root.menuon = false;
mainmenu.gotoAndStop(4);
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " loaded from Slot 1";
_root.maintip._visible = true;
_root.areaswitch = "travel";
_root.trackswitch = 100;
_root.loadtab._visible = false;
_root.menuon = false;
mainmenu.gotoAndStop(4);
}
};
saver2.onRelease = function()
{
saver2.onRelease = function()
{
_root.setPlayerInfo2();
_root.savePlayer2();
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " saved to Slot 2";
_root.maintip._visible = true;
_root.savePlayer2();
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " saved to Slot 2";
_root.maintip._visible = true;
};
loader2.onRelease = function()
{
loader2.onRelease = function()
{
_root.loadPlayer2();
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " loaded from Slot 2";
_root.maintip._visible = true;
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " loaded from Slot 2";
_root.maintip._visible = true;
};
loadtab.loadbtn2.onRelease = function()
{
loadtab.loadbtn2.onRelease = function()
{
_root.tutorial.gotoAndStop(60);
if(_root.loadtab.name2 != undefined)
{
if(_root.loadtab.name2 != undefined)
{
_root.hero._x = 275;
_root.hero._y = 150;
_root.loadPlayer2();
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " loaded from Slot 2";
_root.maintip._visible = true;
_root.areaswitch = "travel";
_root.trackswitch = 100;
_root.loadtab._visible = false;
_root.menuon = false;
mainmenu.gotoAndStop(4);
_root.hero._y = 150;
_root.loadPlayer2();
_root.tiptimer = 15;
_root.maintip.tipvar = _root.charname + " loaded from Slot 2";
_root.maintip._visible = true;
_root.areaswitch = "travel";
_root.trackswitch = 100;
_root.loadtab._visible = false;
_root.menuon = false;
mainmenu.gotoAndStop(4);
}
};
trackenemy2 = new Sound(hero);
trackenemy2.attachSound("Enemy2_Kill The Thief.mp3");
trackenemy3 = new Sound(hero);
trackenemy3.attachSound("Enemy3_Open The Gates.mp3");
tracktown1 = new Sound(hero);
tracktown1.attachSound("Town1_Bakery.mp3");
tracktown5 = new Sound(hero);
tracktown5.attachSound("Town5_Traders.mp3");
tracktravel2 = new Sound(hero);
tracktravel2.attachSound("Travel2_Medieval.mp3");
arrowshoot = new Sound(hero);
arrowshoot.attachSound("ArrowShoot.wav");
global_sound = new Sound();
global_sound.setVolume(60);
stop();
trackenemy2 = new Sound(hero);
trackenemy2.attachSound("Enemy2_Kill The Thief.mp3");
trackenemy3 = new Sound(hero);
trackenemy3.attachSound("Enemy3_Open The Gates.mp3");
tracktown1 = new Sound(hero);
tracktown1.attachSound("Town1_Bakery.mp3");
tracktown5 = new Sound(hero);
tracktown5.attachSound("Town5_Traders.mp3");
tracktravel2 = new Sound(hero);
tracktravel2.attachSound("Travel2_Medieval.mp3");
arrowshoot = new Sound(hero);
arrowshoot.attachSound("ArrowShoot.wav");
global_sound = new Sound();
global_sound.setVolume(60);
stop();