Section 1
//ag_intro_mc_6 (hackslashcrawlArmor_fla.ag_intro_mc_6)
package hackslashcrawlArmor_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class ag_intro_mc_6 extends MovieClip {
public var agb:SimpleButton;
public function ag_intro_mc_6(){
addFrameScript(0, frame1, 81, frame82, 217, frame218);
}
function frame82(){
agb.addEventListener(MouseEvent.CLICK, agbc);
}
function frame218(){
MovieClip(parent).nextFrame();
}
function frame1(){
MovieClip(parent).stop();
gotoAndPlay(2);
}
public function agbc(_arg1:Event){
var _local2:String;
var _local3:URLRequest;
_local2 = null;
_local3 = new URLRequest("http://www.armorgames.com");
navigateToURL(_local3, _local2);
}
}
}//package hackslashcrawlArmor_fla
Section 2
//awardpop_93 (hackslashcrawlArmor_fla.awardpop_93)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class awardpop_93 extends MovieClip {
public var awardtext:TextField;
}
}//package hackslashcrawlArmor_fla
Section 3
//cancelbar_110 (hackslashcrawlArmor_fla.cancelbar_110)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class cancelbar_110 extends MovieClip {
public function cancelbar_110(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 4
//credits_25 (hackslashcrawlArmor_fla.credits_25)
package hackslashcrawlArmor_fla {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public dynamic class credits_25 extends MovieClip {
public var hgb:SimpleButton;
public var bb:SimpleButton;
public function credits_25(){
addFrameScript(0, frame1);
}
public function bbc(_arg1:Event){
MovieClip(parent).gotoAndStop("mainmenu");
}
function frame1(){
bb.addEventListener(MouseEvent.CLICK, bbc);
hgb.addEventListener(MouseEvent.CLICK, hgbc);
}
public function hgbc(_arg1:Event){
var _local2:String;
var _local3:URLRequest;
_local2 = null;
_local3 = new URLRequest("http://www.hatchedgames.com");
navigateToURL(_local3, _local2);
}
}
}//package hackslashcrawlArmor_fla
Section 5
//fireclip_12 (hackslashcrawlArmor_fla.fireclip_12)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class fireclip_12 extends MovieClip {
public function fireclip_12(){
addFrameScript(11, frame12);
}
function frame12(){
if ((Math.random() * 100) < 20){
gotoAndPlay(1);
};
}
}
}//package hackslashcrawlArmor_fla
Section 6
//gloweyrect_97 (hackslashcrawlArmor_fla.gloweyrect_97)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class gloweyrect_97 extends MovieClip {
public function gloweyrect_97(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 7
//gloweyrect2_99 (hackslashcrawlArmor_fla.gloweyrect2_99)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class gloweyrect2_99 extends MovieClip {
public function gloweyrect2_99(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 8
//hudtextarea_82 (hackslashcrawlArmor_fla.hudtextarea_82)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class hudtextarea_82 extends MovieClip {
public var htext:TextField;
}
}//package hackslashcrawlArmor_fla
Section 9
//instructions_23 (hackslashcrawlArmor_fla.instructions_23)
package hackslashcrawlArmor_fla {
import flash.events.*;
import flash.display.*;
public dynamic class instructions_23 extends MovieClip {
public var bb:SimpleButton;
public function instructions_23(){
addFrameScript(0, frame1);
}
public function bbc(_arg1:Event){
MovieClip(parent).gotoAndStop("mainmenu");
}
function frame1(){
bb.addEventListener(MouseEvent.CLICK, bbc);
}
}
}//package hackslashcrawlArmor_fla
Section 10
//inventorybuttonanim_86 (hackslashcrawlArmor_fla.inventorybuttonanim_86)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class inventorybuttonanim_86 extends MovieClip {
public var invb:SimpleButton;
public function inventorybuttonanim_86(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 11
//inventorypop_94 (hackslashcrawlArmor_fla.inventorypop_94)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class inventorypop_94 extends MovieClip {
public var ei1:MovieClip;
public var ei2:MovieClip;
public var ei3:MovieClip;
public var ei4:MovieClip;
public var rs3:MovieClip;
public var rs1:MovieClip;
public var rs2:MovieClip;
public var ei6:MovieClip;
public var s6:MovieClip;
public var s1:MovieClip;
public var s3:MovieClip;
public var s9:MovieClip;
public var ei5:MovieClip;
public var s8:MovieClip;
public var pearldrop:MovieClip;
public var s2:MovieClip;
public var s4:MovieClip;
public var iidrag:MovieClip;
public var s7:MovieClip;
public var qc1:MovieClip;
public var qc2:MovieClip;
public var qc3:MovieClip;
public var qc4:MovieClip;
public var qc5:MovieClip;
public var qc7:MovieClip;
public var qc8:MovieClip;
public var s5:MovieClip;
public var qc6:MovieClip;
public var infoblock:MovieClip;
public var statblock:MovieClip;
public var ii2:MovieClip;
public var ii3:MovieClip;
public var ii4:MovieClip;
public var ii5:MovieClip;
public var ii7:MovieClip;
public var ii9:MovieClip;
public var ii1:MovieClip;
public var ii6:MovieClip;
public var ii8:MovieClip;
public var ii10:MovieClip;
public var ii13:MovieClip;
public var ii14:MovieClip;
public var ii15:MovieClip;
public var ii16:MovieClip;
public var ii11:MovieClip;
public var ii12:MovieClip;
public var ii17:MovieClip;
public var ii18:MovieClip;
public var ii19:MovieClip;
public var ii21:MovieClip;
public var ii24:MovieClip;
public var ii25:MovieClip;
public var ii26:MovieClip;
public var ii20:MovieClip;
public var ii28:MovieClip;
public var closeb:MovieClip;
public var ii29:MovieClip;
public var ii22:MovieClip;
public var ii23:MovieClip;
public var infoblock2:MovieClip;
public var ii30:MovieClip;
public var ii32:MovieClip;
public var ii31:MovieClip;
public var ii27:MovieClip;
public var shownewspells:MovieClip;
public var dragprompt:MovieClip;
public var cs1:MovieClip;
public var cs2:MovieClip;
public var cs3:MovieClip;
public var s10:MovieClip;
public var s11:MovieClip;
public var s12:MovieClip;
public function inventorypop_94(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 12
//invinfobox_105 (hackslashcrawlArmor_fla.invinfobox_105)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class invinfobox_105 extends MovieClip {
public var itemicon:MovieClip;
public var itemname:TextField;
public var itemstats:TextField;
}
}//package hackslashcrawlArmor_fla
Section 13
//invinfobox2_104 (hackslashcrawlArmor_fla.invinfobox2_104)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class invinfobox2_104 extends MovieClip {
public var itemicon:MovieClip;
public var itemname:TextField;
public var itemstats:TextField;
}
}//package hackslashcrawlArmor_fla
Section 14
//invinfoboxcreate_83 (hackslashcrawlArmor_fla.invinfoboxcreate_83)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class invinfoboxcreate_83 extends MovieClip {
public var infotitle:TextField;
public var infotext:TextField;
}
}//package hackslashcrawlArmor_fla
Section 15
//invinfoboxcreater_117 (hackslashcrawlArmor_fla.invinfoboxcreater_117)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class invinfoboxcreater_117 extends MovieClip {
public var infotitle:TextField;
public var infotext:TextField;
}
}//package hackslashcrawlArmor_fla
Section 16
//itemslot_95 (hackslashcrawlArmor_fla.itemslot_95)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class itemslot_95 extends MovieClip {
public var iconsquarenew:MovieClip;
public var iconsquareglow:MovieClip;
public var iconsquare:MovieClip;
}
}//package hackslashcrawlArmor_fla
Section 17
//levelachieved_84 (hackslashcrawlArmor_fla.levelachieved_84)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class levelachieved_84 extends MovieClip {
public var st4:TextField;
public var b2:SimpleButton;
public var b4:SimpleButton;
public var b1:SimpleButton;
public var lvl:TextField;
public var b3:SimpleButton;
public var sta:TextField;
public var st2:TextField;
public var st3:TextField;
public var st1:TextField;
public function levelachieved_84(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 18
//mutebutton_108 (hackslashcrawlArmor_fla.mutebutton_108)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class mutebutton_108 extends MovieClip {
public function mutebutton_108(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 19
//newspellsanim_90 (hackslashcrawlArmor_fla.newspellsanim_90)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class newspellsanim_90 extends MovieClip {
public var spoint:MovieClip;
public function newspellsanim_90(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 20
//pearldrop_102 (hackslashcrawlArmor_fla.pearldrop_102)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class pearldrop_102 extends MovieClip {
public var wealth:TextField;
}
}//package hackslashcrawlArmor_fla
Section 21
//quickbarglower_75 (hackslashcrawlArmor_fla.quickbarglower_75)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class quickbarglower_75 extends MovieClip {
public function quickbarglower_75(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 22
//recharge_80 (hackslashcrawlArmor_fla.recharge_80)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class recharge_80 extends MovieClip {
public var rbar:MovieClip;
}
}//package hackslashcrawlArmor_fla
Section 23
//rippop_89 (hackslashcrawlArmor_fla.rippop_89)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class rippop_89 extends MovieClip {
public var clevel:TextField;
public var ctitles:TextField;
public var award:MovieClip;
public var contb:SimpleButton;
public var cname:TextField;
public var shownewspells:MovieClip;
public var wealth:TextField;
public function rippop_89(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 24
//shownewspells_91 (hackslashcrawlArmor_fla.shownewspells_91)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class shownewspells_91 extends MovieClip {
public function shownewspells_91(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 25
//sitelockmessage_1 (hackslashcrawlArmor_fla.sitelockmessage_1)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class sitelockmessage_1 extends MovieClip {
public function sitelockmessage_1(){
addFrameScript(2, frame3);
}
function frame3(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 26
//soundsclip_130 (hackslashcrawlArmor_fla.soundsclip_130)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class soundsclip_130 extends MovieClip {
public function soundsclip_130(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package hackslashcrawlArmor_fla
Section 27
//specialbuttons_79 (hackslashcrawlArmor_fla.specialbuttons_79)
package hackslashcrawlArmor_fla {
import flash.display.*;
public dynamic class specialbuttons_79 extends MovieClip {
public var recharge:MovieClip;
}
}//package hackslashcrawlArmor_fla
Section 28
//statblock_100 (hackslashcrawlArmor_fla.statblock_100)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class statblock_100 extends MovieClip {
public var clevel:TextField;
public var ctitles:TextField;
public var stat1:TextField;
public var stat3:TextField;
public var stat7:TextField;
public var stat6:TextField;
public var stat8:TextField;
public var stat2:TextField;
public var stat5:TextField;
public var cname:TextField;
public var stat11:TextField;
public var stat9:TextField;
public var stat10:TextField;
public var stat4:TextField;
}
}//package hackslashcrawlArmor_fla
Section 29
//statblockcreate_114 (hackslashcrawlArmor_fla.statblockcreate_114)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class statblockcreate_114 extends MovieClip {
public var stat1:TextField;
public var stat3:TextField;
public var stat7:TextField;
public var stat6:TextField;
public var stat8:TextField;
public var stat2:TextField;
public var stat5:TextField;
public var stat11:TextField;
public var stat9:TextField;
public var stat10:TextField;
public var stat4:TextField;
}
}//package hackslashcrawlArmor_fla
Section 30
//titlesbar_123 (hackslashcrawlArmor_fla.titlesbar_123)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class titlesbar_123 extends MovieClip {
public var t2:MovieClip;
public var t3:MovieClip;
public var t7:MovieClip;
public var t1:MovieClip;
public var t9:MovieClip;
public var t5:MovieClip;
public var t4:MovieClip;
public var t8:MovieClip;
public var t12:MovieClip;
public var t14:MovieClip;
public var t15:MovieClip;
public var t16:MovieClip;
public var t17:MovieClip;
public var t13:MovieClip;
public var t21:MovieClip;
public var t23:MovieClip;
public var t27:MovieClip;
public var t28:MovieClip;
public var t22:MovieClip;
public var t24:MovieClip;
public var t25:MovieClip;
public var t29:MovieClip;
public var t19:MovieClip;
public var t20:MovieClip;
public var t10:MovieClip;
public var t11:MovieClip;
public var t26:MovieClip;
public var t30:MovieClip;
public var t31:MovieClip;
public var t32:MovieClip;
public var t18:MovieClip;
public var titletext:TextField;
public var t6:MovieClip;
}
}//package hackslashcrawlArmor_fla
Section 31
//titleselector_124 (hackslashcrawlArmor_fla.titleselector_124)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class titleselector_124 extends MovieClip {
public var titletext:TextField;
}
}//package hackslashcrawlArmor_fla
Section 32
//tooltop_107 (hackslashcrawlArmor_fla.tooltop_107)
package hackslashcrawlArmor_fla {
import flash.display.*;
import flash.text.*;
public dynamic class tooltop_107 extends MovieClip {
public var tooltext:TextField;
}
}//package hackslashcrawlArmor_fla
Section 33
//addfix (addfix)
package {
import flash.display.*;
public dynamic class addfix extends MovieClip {
public function addfix(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
MovieClip(parent).play();
}
}
}//package
Section 34
//AI (AI)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class AI {
public var AItype:String;
public var viewdist:Number;// = 200
public var FSMstate:String;
public var myentity:entity;
public function AI(_arg1:entity, _arg2:String, _arg3:Number){
viewdist = 200;
super();
AItype = _arg2;
myentity = _arg1;
viewdist = _arg3;
FSMstate = "watchful";
}
function pathto(_arg1:entity){
var _local2:Number;
if (_arg1 == null){
} else {
if (myentity.wpx.length > 0){
wpfollow();
} else {
if (!myentity.mygame.los(myentity, _arg1)){
myentity.mygame.dungeonfloor.getentitypath(myentity, _arg1);
prettypath(myentity);
} else {
_local2 = Math.sqrt((((_arg1.worldx - myentity.worldx) * (_arg1.worldx - myentity.worldx)) + ((_arg1.worldy - myentity.worldy) * (_arg1.worldy - myentity.worldy))));
myentity.move((((_arg1.worldx - myentity.worldx) / _local2) * myentity.entitytemplate.speed), (((_arg1.worldy - myentity.worldy) / _local2) * myentity.entitytemplate.speed));
};
};
};
}
public function runstate(){
var _local1:Number;
_local1 = 0;
if (FSMstate == "attack"){
if (myentity.canim.tag != "attack"){
if (myentity.ctarget != null){
myentity.aim((myentity.ctarget.worldx - myentity.worldx), (myentity.ctarget.worldy - myentity.worldy));
myentity.setanim("attack");
};
};
} else {
if (FSMstate == "cast"){
if (myentity.canim.tag != "cast"){
if (myentity.ctarget != null){
myentity.aim((myentity.ctarget.worldx - myentity.worldx), (myentity.ctarget.worldy - myentity.worldy));
myentity.setanim("cast");
};
};
} else {
if (FSMstate == "heal"){
if (myentity.canim.tag != "heal"){
if (myentity.ctarget != null){
myentity.aim((myentity.ctarget.worldx - myentity.worldx), (myentity.ctarget.worldy - myentity.worldy));
myentity.setanim("heal");
};
};
} else {
if (FSMstate == "watchful"){
if (myentity.canim.tag != "idle"){
myentity.setanim("idle");
};
} else {
if (FSMstate == "pursuing"){
if (myentity.ctarget != null){
if (myentity.ctarget == myentity.mygame.player){
myentity.mygame.player.regenaccel = 0;
};
if ((((AItype == "healer")) || ((AItype == "ranged")))){
_local1 = (((myentity.ctarget.worldx - myentity.worldx) * (myentity.ctarget.worldx - myentity.worldx)) + ((myentity.ctarget.worldy - myentity.worldy) * (myentity.ctarget.worldy - myentity.worldy)));
if ((((_local1 > ((viewdist * 0.5) * (viewdist * 0.5)))) || (!(myentity.mygame.los(myentity, myentity.ctarget))))){
pathto(myentity.ctarget);
} else {
if (myentity.canim.tag != "idle"){
myentity.setanim("idle");
};
};
} else {
pathto(myentity.ctarget);
};
};
} else {
if (FSMstate == "follow"){
pathto(myentity.mygame.player);
};
};
};
};
};
};
}
function prettypath(_arg1:entity){
var _local2:Number;
_local2 = 1;
while (_local2 < (_arg1.wpx.length - 1)) {
if (_arg1.mygame.lospointpoint(_arg1.wpx[(_local2 - 1)], _arg1.wpy[(_local2 - 1)], _arg1.wpx[(_local2 + 1)], _arg1.wpy[(_local2 + 1)])){
_arg1.wpx.splice(_local2, 1);
_arg1.wpy.splice(_local2, 1);
} else {
_local2++;
};
};
_arg1.wpx.splice(0, 1);
_arg1.wpy.splice(0, 1);
}
public function seektoheal(){
var _local1:Number;
var _local2:Number;
_local1 = 0;
_local1 = 0;
while (_local1 < myentity.mygame.screenentitylist.length) {
if ((((myentity.mygame.screenentitylist[_local1].etype.substr(0, 3) == "mob")) && (!(myentity.mygame.screenentitylist[_local1].dead)))){
if ((((((myentity.charmed > 0)) && ((((myentity.mygame.screenentitylist[_local1].charmed > 0)) || ((myentity.mygame.screenentitylist[_local1].etype == "mob_pc")))))) || ((((((myentity.charmed == 0)) && ((myentity.mygame.screenentitylist[_local1].charmed == 0)))) && (!((myentity.mygame.screenentitylist[_local1].etype == "mob_pc"))))))){
if (myentity.mygame.screenentitylist[_local1].hp <= (myentity.mygame.screenentitylist[_local1].maxhp * 0.75)){
_local2 = (((myentity.worldx - myentity.mygame.screenentitylist[_local1].worldx) * (myentity.worldx - myentity.mygame.screenentitylist[_local1].worldx)) + ((myentity.worldy - myentity.mygame.screenentitylist[_local1].worldy) * (myentity.worldy - myentity.mygame.screenentitylist[_local1].worldy)));
if (_local2 < (myentity.entitytemplate.castrange * myentity.entitytemplate.castrange)){
if (myentity.mygame.los(myentity, myentity.mygame.screenentitylist[_local1])){
myentity.ctarget = myentity.mygame.screenentitylist[_local1];
FSMstate = "heal";
};
};
};
};
};
_local1++;
};
}
public function think(){
var _local1:Number;
_local1 = 0;
if (((!((myentity.totarget == null))) && (!((myentity.canim.tag == "attack"))))){
myentity.ctarget = myentity.totarget;
myentity.totarget = null;
};
if (myentity.ctarget != null){
if (myentity.ctarget.dead){
myentity.ctarget = null;
} else {
if ((((((((myentity.charmed == 0)) && ((myentity.ctarget.charmed == 0)))) && (!((myentity.ctarget.etype == "mob_pc"))))) || ((((myentity.charmed > 0)) && ((((myentity.ctarget.charmed > 0)) || ((myentity.ctarget.etype == "mob_pc")))))))){
if (FSMstate != "heal"){
myentity.ctarget = null;
};
};
};
};
if (myentity.charmed > 0){
if (myentity.charmed < 1000){
myentity.mygame.player.regenaccel = 0;
myentity.charmed--;
if (myentity.etype == "mob_boss"){
myentity.charmed = (myentity.charmed - 2);
};
};
};
if (myentity.charmed < 0){
myentity.charmed = 0;
};
getstate();
runstate();
}
function wpfollow(){
var _local1:*;
_local1 = 0;
_local1 = Math.sqrt((((myentity.wpx[0] - myentity.worldx) * (myentity.wpx[0] - myentity.worldx)) + ((myentity.wpy[0] - myentity.worldy) * (myentity.wpy[0] - myentity.worldy))));
if (_local1 <= (myentity.entitytemplate.speed * 3)){
myentity.wpx.splice(0, 1);
myentity.wpy.splice(0, 1);
} else {
myentity.move((((myentity.wpx[0] - myentity.worldx) / _local1) * myentity.entitytemplate.speed), (((myentity.wpy[0] - myentity.worldy) / _local1) * myentity.entitytemplate.speed));
};
if (myentity.wpx.length == 1){
if (myentity.mygame.lospoint(myentity, myentity.wpx[1], myentity.wpy[1])){
myentity.wpx.splice(0, 1);
myentity.wpy.splice(0, 1);
};
};
}
public function getstate(){
var _local1:Number;
var _local2:Number;
_local1 = 0;
_local2 = 0;
if (FSMstate == "attack"){
if (myentity.canim.tag != "attack"){
if (myentity.ctarget == null){
FSMstate = "watchful";
} else {
_local2 = Math.sqrt((((myentity.ctarget.worldx - myentity.worldx) * (myentity.ctarget.worldx - myentity.worldx)) + ((myentity.ctarget.worldy - myentity.worldy) * (myentity.ctarget.worldy - myentity.worldy))));
if (_local2 < ((myentity.entitytemplate.size + myentity.ctarget.entitytemplate.size) * 1.5)){
FSMstate = "attack";
} else {
FSMstate = "pursuing";
};
if ((((AItype == "healer")) || ((AItype == "ranged")))){
if (_local2 < (viewdist * 0.8)){
if (myentity.mygame.los(myentity, myentity.ctarget)){
if ((Math.random() * 100) < 10){
FSMstate = "attack";
};
};
};
};
if (AItype == "meleecaster"){
if ((((((_local2 < myentity.entitytemplate.castrange)) && ((_local2 >= myentity.entitytemplate.castminrange)))) && ((myentity.magic > myentity.entitytemplate.castcost)))){
if ((Math.random() * 100) < 30){
FSMstate = "cast";
};
};
};
};
};
} else {
if (FSMstate == "cast"){
if (myentity.canim.tag != "cast"){
if (myentity.ctarget == null){
FSMstate = "watchful";
} else {
FSMstate = "pursuing";
};
};
} else {
if (FSMstate == "heal"){
if (myentity.canim.tag != "heal"){
FSMstate = "watchful";
};
} else {
if (FSMstate == "watchful"){
if ((myentity.thinktimer % 10) == 1){
_local2 = (((myentity.mygame.player.worldx - myentity.worldx) * (myentity.mygame.player.worldx - myentity.worldx)) + ((myentity.mygame.player.worldy - myentity.worldy) * (myentity.mygame.player.worldy - myentity.worldy)));
if (myentity.charmed > 0){
getnewtarget();
if (myentity.ctarget == null){
if (_local2 > (80 * 80)){
FSMstate = "follow";
};
} else {
FSMstate = "pursuing";
};
} else {
if ((((myentity.ctarget == myentity.mygame.player)) || ((myentity.ctarget == null)))){
if (_local2 < (viewdist * viewdist)){
if (myentity.mygame.los(myentity, myentity.mygame.player)){
if ((((((myentity.etype.substr((myentity.etype.length - 8), 8) == "skeleton")) && (myentity.mygame.activetitles[28]))) && (((Math.random() * 100) >= 80)))){
myentity.charmed = 900;
} else {
myentity.ctarget = myentity.mygame.player;
FSMstate = "pursuing";
};
};
};
} else {
_local2 = (((myentity.ctarget.worldx - myentity.worldx) * (myentity.ctarget.worldx - myentity.worldx)) + ((myentity.ctarget.worldy - myentity.worldy) * (myentity.ctarget.worldy - myentity.worldy)));
if (_local2 < (viewdist * viewdist)){
if (myentity.mygame.los(myentity, myentity.ctarget)){
FSMstate = "pursuing";
};
};
};
};
if (AItype == "healer"){
seektoheal();
};
};
} else {
if (FSMstate == "follow"){
_local2 = Math.sqrt((((myentity.mygame.player.worldx - myentity.worldx) * (myentity.mygame.player.worldx - myentity.worldx)) + ((myentity.mygame.player.worldy - myentity.worldy) * (myentity.mygame.player.worldy - myentity.worldy))));
if (_local2 < 50){
FSMstate = "watchful";
};
} else {
if (FSMstate == "pursuing"){
if (myentity.ctarget == null){
FSMstate = "watchful";
} else {
_local2 = Math.sqrt((((myentity.ctarget.worldx - myentity.worldx) * (myentity.ctarget.worldx - myentity.worldx)) + ((myentity.ctarget.worldy - myentity.worldy) * (myentity.ctarget.worldy - myentity.worldy))));
if ((((_local2 > viewdist)) && (!((myentity.etype == "mob_boss"))))){
myentity.fatigue = (myentity.fatigue + 2);
};
if (myentity.fatigue > 160){
FSMstate = "watchful";
};
if ((((AItype == "healer")) || ((AItype == "ranged")))){
if (_local2 < (viewdist * 0.8)){
if (myentity.mygame.los(myentity, myentity.ctarget)){
if ((Math.random() * 100) < 10){
FSMstate = "attack";
};
};
};
};
if (AItype == "meleecaster"){
if ((((((_local2 < myentity.entitytemplate.castrange)) && ((_local2 >= myentity.entitytemplate.castminrange)))) && ((myentity.magic > myentity.entitytemplate.castcost)))){
if ((Math.random() * 100) < 10){
FSMstate = "cast";
};
};
};
if (_local2 < ((myentity.entitytemplate.size + myentity.ctarget.entitytemplate.size) * 1.5)){
FSMstate = "attack";
};
};
if (AItype == "healer"){
seektoheal();
};
} else {
FSMstate = "watchful";
};
};
};
};
};
};
}
public function getnewtarget(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = 0;
_local2 = 1000000;
myentity.ctarget = null;
_local3 = 0;
while (_local3 < myentity.mygame.screenentitylist.length) {
if ((((myentity.mygame.screenentitylist[_local3].etype.substr(0, 3) == "mob")) && (!((myentity.mygame.screenentitylist[_local3] == myentity))))){
if ((((((myentity.charmed > 0)) && ((myentity.mygame.screenentitylist[_local3].charmed <= 0)))) && (!((myentity.mygame.screenentitylist[_local3].etype == "mob_pc"))))){
_local1 = (((myentity.worldx - myentity.mygame.screenentitylist[_local3].worldx) * (myentity.worldx - myentity.mygame.screenentitylist[_local3].worldx)) + ((myentity.worldy - myentity.mygame.screenentitylist[_local3].worldy) * (myentity.worldy - myentity.mygame.screenentitylist[_local3].worldy)));
if ((((_local1 < _local2)) && ((_local1 < (viewdist * viewdist))))){
if (myentity.mygame.los(myentity, myentity.mygame.screenentitylist[_local3])){
_local2 = _local1;
myentity.ctarget = myentity.mygame.screenentitylist[_local3];
};
};
};
};
_local3++;
};
}
}
}//package
Section 35
//animation (animation)
package {
public class animation {
public var procedures:Array;
public var frames:Array;
public var loops:Boolean;
public var tag:String;
public var procindex:Array;
public function animation(_arg1:String, _arg2:Boolean){
procedures = new Array();
procindex = new Array();
tag = _arg1;
loops = _arg2;
}
public function loadanim(_arg1:Array){
frames = _arg1;
}
public function addproc(_arg1:String, _arg2:Number){
procindex.push(_arg2);
procedures.push(_arg1);
}
}
}//package
Section 36
//Anode (Anode)
package {
public class Anode {
public var dir:Number;
public var onopen:Boolean;
public var pnode:Anode;
public var onclosed:Boolean;
public var cost:Number;
public var x:Number;
public var y:Number;
public var esttotal:Number;
public function Anode(_arg1:Anode, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=0){
onopen = true;
onclosed = false;
pnode = _arg1;
x = _arg2;
y = _arg3;
cost = _arg4;
esttotal = (cost + _arg5);
}
}
}//package
Section 37
//blitter (blitter)
package {
import flash.display.*;
import flash.geom.*;
public class blitter {
public var ii:Number;// = 0
public var surfacelist:Array;
public var tilesheetlist:Array;
public var surfaceheight:Number;
public var surfacewidth:Number;
public function blitter(_arg1:Number=300, _arg2:Number=200){
ii = 0;
super();
surfacewidth = _arg1;
surfaceheight = _arg2;
surfacelist = new Array();
tilesheetlist = new Array();
}
public function blittile(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:tilesheet, _arg5:Number, _arg6:Number=0){
var _local7:Number;
var _local8:Number;
if (_arg6 > 0){
_arg6 = 0;
};
if (_arg6 < 0){
_arg6 = (_arg6 - 40);
};
_local7 = ((_arg5 % _arg4.sheetwidth) * _arg4.tilewidth);
_local8 = (Math.floor((_arg5 / _arg4.sheetwidth)) * _arg4.tileheight);
_arg1.copyPixels(_arg4.tiledata, new Rectangle(_local7, _local8, _arg4.tilewidth, (_arg4.tileheight + Math.round(_arg6))), new Point(((_arg2 - Math.floor((_arg4.tilewidth / 2))) + (surfacewidth / 2)), ((_arg3 - Math.floor((_arg4.tileheight / 2))) + (surfaceheight / 2))));
}
public function zerosurface(_arg1:BitmapData){
_arg1.fillRect(new Rectangle(0, 0, surfacewidth, surfaceheight), 0);
}
public function createsurface():BitmapData{
var _local1:*;
_local1 = new BitmapData(surfacewidth, surfaceheight, false, 0);
surfacelist.push(_local1);
return (_local1);
}
public function createtilesheet(_arg1:Number, _arg2:Number, _arg3:Number):tilesheet{
var _local4:*;
_local4 = new tilesheet(_arg1, _arg2, _arg3);
tilesheetlist.push(_local4);
return (_local4);
}
public function drawtext(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:String){
var _local5:textblitter;
var _local6:*;
_local5 = new textblitter();
_local5.textblit.text = _arg4;
_local6 = new Matrix(1, 0, 0, 1, ((surfacewidth / 2) + _arg2), ((surfaceheight / 2) + _arg3));
_arg1.draw(_local5, _local6);
}
public function blithpbar(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
var _local6:Number;
_local6 = ((_arg5 * 40) / 1000);
if (_local6 < 40){
_local6 = 40;
};
ii = 0;
while (ii < _local6) {
if (ii < (_local6 * (_arg4 / _arg5))){
if ((ii % Math.floor((_local6 * (100 / _arg5)))) != 0){
_arg1.setPixel32((((_arg2 + (surfacewidth / 2)) + ii) - Math.floor((_local6 / 2))), (_arg3 + (surfaceheight / 2)), 4278255360);
_arg1.setPixel32((((_arg2 + (surfacewidth / 2)) + ii) - Math.floor((_local6 / 2))), ((_arg3 + (surfaceheight / 2)) + 1), 4278255360);
_arg1.setPixel32((((_arg2 + (surfacewidth / 2)) + ii) - Math.floor((_local6 / 2))), ((_arg3 + (surfaceheight / 2)) + 2), 4278229248);
};
} else {
if ((ii % Math.floor((_local6 * (100 / _arg5)))) != 0){
_arg1.setPixel32((((_arg2 + (surfacewidth / 2)) + ii) - Math.floor((_local6 / 2))), (_arg3 + (surfaceheight / 2)), 4282646528);
_arg1.setPixel32((((_arg2 + (surfacewidth / 2)) + ii) - Math.floor((_local6 / 2))), ((_arg3 + (surfaceheight / 2)) + 1), 4282646528);
_arg1.setPixel32((((_arg2 + (surfacewidth / 2)) + ii) - Math.floor((_local6 / 2))), ((_arg3 + (surfaceheight / 2)) + 2), 4283760640);
};
};
ii++;
};
}
public function drawcone(_arg1:BitmapData, _arg2:Number){
var _local3:cone;
var _local4:*;
_local3 = new cone();
_local3.conedraw.rotation = ((_arg2 * 180) / Math.PI);
_local4 = new Matrix(1, 0, 0, 0.5, (surfacewidth / 2), (surfaceheight / 2));
_arg1.draw(_local3, _local4);
}
}
}//package
Section 38
//charcreate (charcreate)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class charcreate extends MovieClip {
public var animcount:Number;// = 0
public var rs1:MovieClip;
public var rs3:MovieClip;
public var titles:MovieClip;
public var rs2:MovieClip;
public var hovering:Number;// = -1
public var nameinput:TextField;
public var finishb:MovieClip;
public var spinner1:uispinner;
public var spinner2:uispinner;
public var dragging:Number;// = -1
public var randoname:MovieClip;
public var heroidat:BitmapData;
public var titletext:TextField;
public var infoblock:MovieClip;
public var heroimage:Bitmap;
public var mygame:gamestage;
public var titlecount:Number;// = 0
public var statblock:MovieClip;
public var cs1:MovieClip;
public var cs2:MovieClip;
public var cs3:MovieClip;
public var initialized:Boolean;// = false
public static var sqrtof2:Number = Math.sqrt(2);
public function charcreate(_arg1:gamestage){
var _local2:Number;
dragging = -1;
hovering = -1;
animcount = 0;
titlecount = 0;
initialized = false;
super();
visible = false;
mygame = _arg1;
addEventListener(MouseEvent.CLICK, clicked);
addEventListener(MouseEvent.MOUSE_MOVE, mmove);
heroidat = new BitmapData(80, 80, true, 0);
heroimage = new Bitmap(heroidat);
addChild(heroimage);
heroimage.x = -40;
heroimage.y = -176;
infoblock.visible = false;
nameinput.restrict = "a-zA-Z";
_local2 = 0;
while (_local2 < 32) {
if (mygame.myroot.titles[_local2]){
titles[("t" + (_local2 + 1))].gotoAndStop(2);
} else {
titles[("t" + (_local2 + 1))].gotoAndStop(1);
};
mygame.activetitles[_local2] = false;
_local2++;
};
}
public function init(){
var _local1:Number;
visible = true;
randomname();
initialized = true;
spinner1.myui = this;
spinner2.myui = this;
spinner1.addchoice(new uichoice("HUMAN"));
spinner1.addchoice(new uichoice("ATLANTIAN"));
spinner1.addchoice(new uichoice("VAMPIRE"));
spinner1.addchoice(new uichoice("GOLEM"));
spinner1.addchoice(new uichoice("CELESTIAL"));
spinner1.addchoice(new uichoice("DEMON"));
spinner1.addchoice(new uichoice("DRYAD"));
spinner1.addchoice(new uichoice("DRACONIAN"));
spinner1.addchoice(new uichoice("WEREWOLF"));
spinner1.addchoice(new uichoice("KITILID"));
spinner1.addchoice(new uichoice("CELESTIAL"));
spinner1.addchoice(new uichoice("DEMON"));
_local1 = 0;
while (_local1 < spinner1.choices.length) {
spinner1.choices[_local1].unlocked = true;
_local1++;
};
if (mygame.myroot.unlockedminotaur){
spinner1.choices[10].unlocked = true;
};
if (mygame.myroot.unlockedskeleton){
spinner1.choices[11].unlocked = true;
};
spinner2.addchoice(new uichoice("NECROMANCER"));
spinner2.addchoice(new uichoice("MAGUS"));
spinner2.addchoice(new uichoice("FIGHTER"));
spinner2.addchoice(new uichoice("WANDERER"));
spinner2.addchoice(new uichoice("DUELIST"));
spinner2.addchoice(new uichoice("HUNTER"));
spinner2.addchoice(new uichoice("JUGGERNAUT"));
spinner2.addchoice(new uichoice("CHARMER"));
spinner2.addchoice(new uichoice("REAPER"));
spinner2.addchoice(new uichoice("LIGHTWIELDER"));
spinner2.addchoice(new uichoice("EXPLORER"));
spinner2.addchoice(new uichoice("CURSED"));
_local1 = 0;
while (_local1 < spinner2.choices.length) {
spinner2.choices[_local1].unlocked = true;
_local1++;
};
spinner2.hoveroffs = 200;
}
public function clicked(_arg1:MouseEvent){
var _local2:Number;
if ((((((((mouseX < (randoname.x + 10))) && ((mouseX > (randoname.x - 10))))) && ((mouseY < (randoname.y + 10))))) && ((mouseY > (randoname.y - 10))))){
randomname();
};
if ((((((((mouseX < (finishb.x + (finishb.width / 2)))) && ((mouseX > (finishb.x - (finishb.width / 2)))))) && ((mouseY < (finishb.y + (finishb.height / 2)))))) && ((mouseY > (finishb.y - (finishb.height / 2)))))){
if (spinner1.choices[spinner1.choice].unlocked){
mygame.player.initialized = false;
mygame.gamestate = "running";
mygame.removeChild(this);
spinner1.die();
spinner2.die();
if (mygame.activetitles[4]){
mygame.magicfind = 50;
} else {
mygame.magicfind = 40;
};
removeEventListener(MouseEvent.CLICK, clicked);
removeEventListener(MouseEvent.MOUSE_MOVE, mmove);
mygame.myroot.sounds.stopmusic();
mygame.myroot.sounds.musicsequence("002");
mygame.myroot.sounds.playmusic();
};
};
_local2 = 0;
while (_local2 < 32) {
if ((((((((titles[("t" + (_local2 + 1))].mouseX < 40)) && ((titles[("t" + (_local2 + 1))].mouseX > -40)))) && ((titles[("t" + (_local2 + 1))].mouseY < 7)))) && ((titles[("t" + (_local2 + 1))].mouseY > -7)))){
if (mygame.myroot.titles[_local2]){
if ((((mygame.activetitles[_local2] == false)) && ((titlecount < mygame.myroot.availabletitles)))){
mygame.activetitles[_local2] = true;
titles[("t" + (_local2 + 1))].gotoAndStop(3);
} else {
mygame.activetitles[_local2] = false;
titles[("t" + (_local2 + 1))].gotoAndStop(2);
};
};
};
_local2++;
};
}
public function updatestats(){
mygame.player.entitytemplate.speed = 3;
if (spinner1.choices[spinner1.choice].choice == "HUMAN"){
mygame.player.entitytemplate.BASESTR = 11;
mygame.player.entitytemplate.BASECON = 11;
mygame.player.entitytemplate.BASEWILL = 11;
mygame.player.entitytemplate.BASEINT = 11;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 10;
mygame.player.entitytemplate.BASERELECTRIC = 10;
mygame.player.entitytemplate.BASERPOISON = 10;
mygame.player.entitytemplate.BASERICE = 10;
mygame.player.entitytemplate.HEAD = 1;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 100;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "human";
mygame.racespells.splice(0, mygame.racespells.length);
};
if (spinner1.choices[spinner1.choice].choice == "ATLANTIAN"){
mygame.player.entitytemplate.BASESTR = 10;
mygame.player.entitytemplate.BASECON = 10;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 0;
mygame.player.entitytemplate.BASERELECTRIC = 0;
mygame.player.entitytemplate.BASERPOISON = 0;
mygame.player.entitytemplate.BASERICE = 20;
mygame.player.entitytemplate.HEAD = 2;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 2;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "atlantian";
mygame.racespells.splice(0, mygame.racespells.length);
mygame.racespells.push(new spell("blast", 103, 25, "frozenwind", "FROZEN WIND"));
mygame.racespells.push(new spell("blast", 104, 200, "flashfreeze", "FLASH FREEZE"));
};
if (spinner1.choices[spinner1.choice].choice == "VAMPIRE"){
mygame.player.entitytemplate.BASESTR = 10;
mygame.player.entitytemplate.BASECON = 10;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 0;
mygame.player.entitytemplate.BASERELECTRIC = 0;
mygame.player.entitytemplate.BASERPOISON = 0;
mygame.player.entitytemplate.BASERICE = 0;
mygame.player.entitytemplate.HEAD = 3;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 3;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "vampire";
mygame.racespells.splice(0, mygame.racespells.length);
};
if (spinner1.choices[spinner1.choice].choice == "GOLEM"){
mygame.player.entitytemplate.BASESTR = 10;
mygame.player.entitytemplate.BASECON = 10;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 2;
mygame.player.entitytemplate.BASERFIRE = 20;
mygame.player.entitytemplate.BASERELECTRIC = 20;
mygame.player.entitytemplate.BASERPOISON = 20;
mygame.player.entitytemplate.BASERICE = 20;
mygame.player.entitytemplate.HEAD = 4;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 4;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "golem";
mygame.racespells.splice(0, mygame.racespells.length);
};
if (spinner1.choices[spinner1.choice].choice == "CELESTIAL"){
mygame.player.entitytemplate.BASESTR = 10;
mygame.player.entitytemplate.BASECON = 10;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = -20;
mygame.player.entitytemplate.BASERELECTRIC = 20;
mygame.player.entitytemplate.BASERPOISON = 20;
mygame.player.entitytemplate.BASERICE = 20;
mygame.player.entitytemplate.HEAD = 5;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 5;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "celestial";
mygame.racespells.splice(0, mygame.racespells.length);
};
if (spinner1.choices[spinner1.choice].choice == "DEMON"){
mygame.player.entitytemplate.BASESTR = 10;
mygame.player.entitytemplate.BASECON = 10;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 20;
mygame.player.entitytemplate.BASERELECTRIC = 0;
mygame.player.entitytemplate.BASERPOISON = 0;
mygame.player.entitytemplate.BASERICE = 0;
mygame.player.entitytemplate.HEAD = 6;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 6;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "demon";
mygame.racespells.splice(0, mygame.racespells.length);
};
if (spinner1.choices[spinner1.choice].choice == "DRYAD"){
mygame.player.entitytemplate.BASESTR = 10;
mygame.player.entitytemplate.BASECON = 10;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 0;
mygame.player.entitytemplate.BASERELECTRIC = 0;
mygame.player.entitytemplate.BASERPOISON = 0;
mygame.player.entitytemplate.BASERICE = 0;
mygame.player.entitytemplate.HEAD = 7;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 7;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "dryad";
mygame.racespells.splice(0, mygame.racespells.length);
mygame.racespells.push(new spell("select", 113, 40, "entangle", "ENTANGLE"));
mygame.racespells.push(new spell("smallradius", 114, 80, "vinefield", "VINE FIELD"));
};
if (spinner1.choices[spinner1.choice].choice == "DRACONIAN"){
mygame.player.entitytemplate.BASESTR = 10;
mygame.player.entitytemplate.BASECON = 10;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 0;
mygame.player.entitytemplate.BASERELECTRIC = 0;
mygame.player.entitytemplate.BASERPOISON = 0;
mygame.player.entitytemplate.BASERICE = 0;
mygame.player.entitytemplate.HEAD = 10;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 8;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "draconian";
mygame.racespells.splice(0, mygame.racespells.length);
mygame.racespells.push(new spell("blast", 105, 50, "fireblast", "FIRE BREATH"));
mygame.racespells.push(new spell("blast", 106, 200, "fireblast2", "FIRE BLAST"));
};
if (spinner1.choices[spinner1.choice].choice == "WEREWOLF"){
mygame.player.entitytemplate.BASESTR = 10;
mygame.player.entitytemplate.BASECON = 10;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 0;
mygame.player.entitytemplate.BASERELECTRIC = 0;
mygame.player.entitytemplate.BASERPOISON = 0;
mygame.player.entitytemplate.BASERICE = 0;
mygame.player.entitytemplate.HEAD = 11;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 9;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "werewolf";
mygame.racespells.splice(0, mygame.racespells.length);
};
if (spinner1.choices[spinner1.choice].choice == "KITILID"){
mygame.player.entitytemplate.BASESTR = 10;
mygame.player.entitytemplate.BASECON = 10;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 0;
mygame.player.entitytemplate.BASERELECTRIC = 0;
mygame.player.entitytemplate.BASERPOISON = 0;
mygame.player.entitytemplate.BASERICE = 0;
mygame.player.entitytemplate.HEAD = 8;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 10;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "kitilid";
mygame.racespells.splice(0, mygame.racespells.length);
mygame.racespells.push(new spell("select", 109, 70, "swarm", "SWARM"));
mygame.racespells.push(new spell("smallradius", 110, 140, "massswarm", "MASSIVE SWARM"));
};
if (spinner1.choices[spinner1.choice].choice == "MINOTAUR"){
mygame.player.entitytemplate.BASESTR = 12;
mygame.player.entitytemplate.BASECON = 12;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 0;
mygame.player.entitytemplate.BASERELECTRIC = 0;
mygame.player.entitytemplate.BASERPOISON = 0;
mygame.player.entitytemplate.BASERICE = 0;
mygame.player.entitytemplate.HEAD = 12;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 11;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "minotaur";
mygame.racespells.splice(0, mygame.racespells.length);
mygame.racespells.push(new spell("select", 107, 30, "charge", "CHARGE"));
mygame.racespells.push(new spell("select", 108, 40, "charge2", "WILD CHARGE"));
};
if (spinner1.choices[spinner1.choice].choice == "SKELETON"){
mygame.player.entitytemplate.BASESTR = 12;
mygame.player.entitytemplate.BASECON = 8;
mygame.player.entitytemplate.BASEWILL = 10;
mygame.player.entitytemplate.BASEINT = 10;
mygame.player.entitytemplate.BASEARMOR = 0;
mygame.player.entitytemplate.BASERFIRE = 0;
mygame.player.entitytemplate.BASERELECTRIC = 0;
mygame.player.entitytemplate.BASERPOISON = 100;
mygame.player.entitytemplate.BASERICE = 0;
mygame.player.entitytemplate.HEAD = 9;
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.FEET = 1;
mygame.player.entitytemplate.ARMS = 1;
mygame.player.entitytemplate.WEAPON1 = 1;
mygame.player.entitytemplate.WEAPON2 = 1;
mygame.player.entitytemplate.TAIL = 12;
mygame.player.entitytemplate.HELM = 0;
mygame.player.entitytemplate.race = "skeleton";
mygame.racespells.splice(0, mygame.racespells.length);
mygame.racespells.push(new spell("select", 116, 40, "scavenge", "SCAVENGE"));
mygame.racespells.push(new spell("blast", 115, 100, "boneshrapnel", "BONE SHRAPNEL"));
};
if (spinner2.choices[spinner2.choice].choice == "NECROMANCER"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 0);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 0);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 2);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 0);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 0);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 0);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 0);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 0);
mygame.player.entitytemplate.cclass = "necromancer";
mygame.classspells.splice(0, mygame.classspells.length);
mygame.classspells.push(new spell("smallradius", 117, 40, "createskeleton", "CREATE SKELETON"));
mygame.classspells.push(new spell("smallradius", 118, 160, "createskeletons", "CREATE SKELETONS"));
};
if (spinner2.choices[spinner2.choice].choice == "MAGUS"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 0);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 0);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 0);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 2);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 0);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 0);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 0);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 0);
mygame.player.entitytemplate.cclass = "magus";
mygame.classspells.splice(0, mygame.classspells.length);
mygame.classspells.push(new spell("smallradius", 101, 60, "fireburst", "IGNITE"));
mygame.classspells.push(new spell("smallradius", 102, 200, "inferno", "INFERNO"));
};
if (spinner2.choices[spinner2.choice].choice == "FIGHTER"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 2);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 2);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 0);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 0);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 2);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 0);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 0);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 0);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 0);
mygame.player.entitytemplate.cclass = "fighter";
mygame.classspells.splice(0, mygame.classspells.length);
};
if (spinner2.choices[spinner2.choice].choice == "WANDERER"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 0);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 2);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 0);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 0);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 10);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 10);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 10);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 10);
mygame.player.entitytemplate.cclass = "wanderer";
mygame.classspells.splice(0, mygame.classspells.length);
};
if (spinner2.choices[spinner2.choice].choice == "DUELIST"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 0);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 0);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 0);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 0);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 0);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 0);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 0);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 0);
mygame.player.entitytemplate.cclass = "duelist";
mygame.classspells.splice(0, mygame.classspells.length);
};
if (spinner2.choices[spinner2.choice].choice == "HUNTER"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 2);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 0);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 0);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 2);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 0);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 0);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 10);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 10);
mygame.player.entitytemplate.cclass = "hunter";
mygame.classspells.splice(0, mygame.classspells.length);
};
if (spinner2.choices[spinner2.choice].choice == "JUGGERNAUT"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 0);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 0);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 0);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 0);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 3);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 0);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 0);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 0);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 0);
mygame.player.entitytemplate.cclass = "juggernaut";
mygame.classspells.splice(0, mygame.classspells.length);
mygame.classspells.push(new spell("self", 121, 50, "invuln", "SHIELD"));
};
if (spinner2.choices[spinner2.choice].choice == "CHARMER"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 0);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 0);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 0);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 0);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 0);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 0);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 0);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 0);
mygame.player.entitytemplate.cclass = "charmer";
mygame.classspells.splice(0, mygame.classspells.length);
mygame.classspells.push(new spell("select", 122, 100, "charm", "CHARM"));
};
if (spinner2.choices[spinner2.choice].choice == "REAPER"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 3);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 0);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 0);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 0);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 0);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 0);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 0);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 0);
mygame.player.entitytemplate.cclass = "reaper";
mygame.classspells.splice(0, mygame.classspells.length);
mygame.classspells.push(new spell("self", 120, 30, "crit", "CRITICAL STRIKE"));
};
if (spinner2.choices[spinner2.choice].choice == "LIGHTWIELDER"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 0);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 0);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 2);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 0);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 0);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 0);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 0);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 0);
mygame.player.entitytemplate.cclass = "lightwielder";
mygame.classspells.splice(0, mygame.classspells.length);
mygame.classspells.push(new spell("self", 111, 30, "heal", "HEAL"));
mygame.classspells.push(new spell("smallradius", 112, 100, "sanctify", "SANCTIFY"));
};
if (spinner2.choices[spinner2.choice].choice == "EXPLORER"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 0);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 0);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 2);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 0);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 10);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 10);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 10);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 10);
mygame.player.entitytemplate.cclass = "explorer";
mygame.classspells.splice(0, mygame.classspells.length);
};
if (spinner2.choices[spinner2.choice].choice == "CURSED"){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR - 2);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON - 2);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL - 2);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT - 2);
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 0);
mygame.player.entitytemplate.BASERFIRE = (mygame.player.entitytemplate.BASERFIRE + 20);
mygame.player.entitytemplate.BASERELECTRIC = (mygame.player.entitytemplate.BASERELECTRIC + 20);
mygame.player.entitytemplate.BASERPOISON = (mygame.player.entitytemplate.BASERPOISON + 20);
mygame.player.entitytemplate.BASERICE = (mygame.player.entitytemplate.BASERICE + 20);
mygame.player.entitytemplate.cclass = "cursed";
mygame.classspells.splice(0, mygame.classspells.length);
};
if (mygame.activetitles[1] == true){
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 2);
};
if (mygame.activetitles[3] == true){
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 2);
};
if (mygame.activetitles[4] == true){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 1);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 1);
};
if (mygame.activetitles[6] == true){
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 1);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 1);
};
if (mygame.activetitles[7] == true){
mygame.player.entitytemplate.speed = (mygame.player.entitytemplate.speed + 0.15);
};
if (mygame.activetitles[8] == true){
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 1);
};
if (mygame.activetitles[11] == true){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 2);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 2);
};
if (mygame.activetitles[13] == true){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 3);
};
if (mygame.activetitles[14] == true){
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 3);
};
if (mygame.activetitles[15] == true){
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 3);
};
if (mygame.activetitles[16] == true){
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 3);
};
if (mygame.activetitles[17] == true){
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 2);
};
if (mygame.activetitles[18] == true){
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 2);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 2);
};
if (mygame.activetitles[19] == true){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 1);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 1);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 1);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 1);
};
if (mygame.activetitles[20] == true){
mygame.player.entitytemplate.speed = (mygame.player.entitytemplate.speed + 0.3);
};
if (mygame.activetitles[21] == true){
mygame.player.entitytemplate.BASEARMOR = (mygame.player.entitytemplate.BASEARMOR + 3);
};
if (mygame.activetitles[22] == true){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 2);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 2);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 2);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 2);
};
if (mygame.activetitles[23] == true){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 5);
};
if (mygame.activetitles[24] == true){
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 5);
};
if (mygame.activetitles[25] == true){
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 5);
};
if (mygame.activetitles[26] == true){
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 5);
};
if (mygame.activetitles[27] == true){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 3);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 3);
};
if (mygame.activetitles[29] == true){
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 3);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 3);
};
if (mygame.activetitles[30] == true){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 3);
mygame.player.entitytemplate.BASECON = (mygame.player.entitytemplate.BASECON + 3);
mygame.player.entitytemplate.BASEWILL = (mygame.player.entitytemplate.BASEWILL + 3);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 3);
};
if (mygame.activetitles[31] == true){
mygame.player.entitytemplate.BASESTR = (mygame.player.entitytemplate.BASESTR + 5);
mygame.player.entitytemplate.BASEINT = (mygame.player.entitytemplate.BASEINT + 5);
};
statblock.stat4.htmlText = mygame.player.entitytemplate.BASESTR;
statblock.stat5.htmlText = mygame.player.entitytemplate.BASECON;
statblock.stat6.htmlText = mygame.player.entitytemplate.BASEWILL;
statblock.stat7.htmlText = mygame.player.entitytemplate.BASEINT;
statblock.stat3.htmlText = mygame.player.entitytemplate.BASEARMOR;
mygame.player.maxhp = ((mygame.player.entitytemplate.BASECON * 10) + 20);
mygame.player.maxmagic = ((mygame.player.entitytemplate.BASEWILL * 10) + 5);
mygame.player.hp = mygame.player.maxhp;
mygame.player.magic = mygame.player.maxmagic;
statblock.stat1.htmlText = mygame.player.maxhp;
statblock.stat2.htmlText = mygame.player.maxmagic;
statblock.stat8.htmlText = mygame.player.entitytemplate.BASERFIRE;
statblock.stat9.htmlText = mygame.player.entitytemplate.BASERICE;
statblock.stat10.htmlText = mygame.player.entitytemplate.BASERPOISON;
statblock.stat11.htmlText = mygame.player.entitytemplate.BASERELECTRIC;
mygame.player.entitytemplate.entitystamp.anim.gotoAndStop(1);
mygame.player.entitytemplate.addframe(1, 0);
mygame.player.entitytemplate.entitystamp.anim.gotoAndStop(2);
mygame.player.entitytemplate.addframe(2, 1);
mygame.player.entitytemplate.entitystamp.anim.gotoAndStop(3);
mygame.player.entitytemplate.addframe(3, 2);
mygame.player.entitytemplate.entitystamp.anim.gotoAndStop(4);
mygame.player.entitytemplate.addframe(4, 3);
}
public function die(){
removeEventListener(MouseEvent.CLICK, clicked);
}
public function updatehud(){
var _local1:Number;
var _local2:Number;
var _local3:String;
var _local4:String;
if (!initialized){
init();
} else {
_local1 = 0;
mygame.playername = nameinput.text;
updatestats();
_local2 = 0;
_local1 = 0;
while (_local1 < 32) {
if (mygame.myroot.titles[_local1]){
_local2++;
};
_local1++;
};
if (_local2 > 0){
if ((mygame.myroot.availabletitles - titlecount) > 0){
if ((mygame.myroot.availabletitles - titlecount) == 1){
titles.titletext.text = (("CHOOSE UP TO " + (mygame.myroot.availabletitles - titlecount)) + " MORE TITLE");
} else {
titles.titletext.text = (("CHOOSE UP TO " + (mygame.myroot.availabletitles - titlecount)) + " MORE TITLES");
};
} else {
titles.titletext.text = "MAXIMUM TITLES SELECTED";
};
} else {
titles.titletext.text = "UNLOCK TITLES BY PLAYING";
};
_local3 = "";
titlecount = 0;
_local1 = 1;
while (_local1 <= 32) {
if (mygame.activetitles[(_local1 - 1)]){
titlecount++;
if (_local3 == ""){
_local3 = (_local3 + "the ");
} else {
_local3 = (_local3 + " and ");
};
_local3 = (_local3 + mygame.titles[(_local1 - 1)].toLowerCase());
};
if (titles[("t" + _local1)].getChildByName("titletext") != null){
titles[("t" + _local1)].titletext.text = mygame.titles[(_local1 - 1)];
};
_local1++;
};
mygame.titletext = _local3;
titletext.text = _local3;
_local1 = 0;
while (_local1 < 3) {
if (mygame.racespells[_local1] == null){
this[("rs" + (_local1 + 1))].gotoAndStop(0);
this[("rs" + (_local1 + 1))].iconsquare.gotoAndStop(0);
} else {
this[("rs" + (_local1 + 1))].gotoAndStop(mygame.racespells[_local1].sicon);
this[("rs" + (_local1 + 1))].iconsquare.gotoAndStop(0);
};
_local1++;
};
_local1 = 0;
while (_local1 < 3) {
if (mygame.classspells[_local1] == null){
this[("cs" + (_local1 + 1))].gotoAndStop(0);
this[("cs" + (_local1 + 1))].iconsquare.gotoAndStop(0);
} else {
this[("cs" + (_local1 + 1))].gotoAndStop(mygame.classspells[_local1].sicon);
this[("cs" + (_local1 + 1))].iconsquare.gotoAndStop(0);
};
_local1++;
};
finishb.gotoAndStop(2);
spinner1.updatehud();
spinner2.updatehud();
animcount++;
if (animcount >= 16){
animcount = 0;
};
mygame.blit.blittile(heroidat, (-300 + 40), (-225 + 40), mygame.player.entitytemplate.spritesheet, Math.floor((animcount / 4)));
infoblock.visible = true;
if (spinner1.choices[spinner1.choice].unlocked){
infoblock.infotitle.htmlText = ((("<font color='#FFFFFF'>" + mygame.player.entitytemplate.race.toUpperCase()) + " ") + mygame.player.entitytemplate.cclass.toUpperCase());
} else {
infoblock.infotitle.htmlText = ((("<font color='#FF0000'>" + mygame.player.entitytemplate.race.toUpperCase()) + " ") + mygame.player.entitytemplate.cclass.toUpperCase());
};
_local4 = "";
if (mygame.player.entitytemplate.race == "human"){
_local4 = "<font color='#FFFFFF'>Improved resistances<br>Improved stats";
};
if (mygame.player.entitytemplate.race == "atlantian"){
_local4 = "<font color='#FFFFFF'>Resistant to ice<br>Grants the racial ability: <font color='#FFFF00'>FREEZING WIND";
};
if (mygame.player.entitytemplate.race == "vampire"){
_local4 = "<font color='#FFFFFF'>Gains health with each melee attack";
};
if (mygame.player.entitytemplate.race == "golem"){
_local4 = "<font color='#FFFFFF'>Increased resistance to all forms of damage";
};
if (mygame.player.entitytemplate.race == "celestial"){
_local4 = "<font color='#FFFFFF'>Resistant to ice, electricity, and poison<br>Vulnerable to fire<br>Gains additional health from magic healing";
};
if (mygame.player.entitytemplate.race == "demon"){
_local4 = "<font color='#FFFFFF'>Resistant to fire<br>Deals additional fire damage with each melee attack";
};
if (mygame.player.entitytemplate.race == "dryad"){
_local4 = "<font color='#FFFFFF'>Grants the racial ability: <font color='#FFFF00'>ENTANGLE";
};
if (mygame.player.entitytemplate.race == "draconian"){
_local4 = "<font color='#FFFFFF'>Grants the racial ability: <font color='#FFFF00'>FIRE BREATH";
};
if (mygame.player.entitytemplate.race == "werewolf"){
_local4 = "<font color='#FFFFFF'>Improved health regeneration";
};
if (mygame.player.entitytemplate.race == "kitilid"){
_local4 = "<font color='#FFFFFF'>Grants the racial ability: <font color='#FFFF00'>SWARM";
};
if (mygame.player.entitytemplate.race == "minotaur"){
_local4 = "<font color='#FFFFFF'>Improved strength and stamina<br>Grants the racial ability: <font color='#FFFF00'>CHARGE";
};
if (mygame.player.entitytemplate.race == "skeleton"){
_local4 = "<font color='#FFFFFF'>Does not regenerate health<br>Immune to poison<br>Grants the racial ability: <font color='#FFFF00'>SCAVENGE";
};
infoblock.infotext.htmlText = ("" + _local4);
if (mygame.player.entitytemplate.cclass == "necromancer"){
_local4 = "<font color='#FFFFFF'>Improved will<br>Grants the class ability: <font color='#FFFF00'>CREATE SKELETON";
};
if (mygame.player.entitytemplate.cclass == "magus"){
_local4 = "<font color='#FFFFFF'>Improved intellect<br>Grants the class ability: <font color='#FFFF00'>IGNITE";
};
if (mygame.player.entitytemplate.cclass == "fighter"){
_local4 = "<font color='#FFFFFF'>Improved strength, stamina, and armor";
};
if (mygame.player.entitytemplate.cclass == "wanderer"){
_local4 = "<font color='#FFFFFF'>Improved stamina<br>Increased resistance to all forms of damage";
};
if (mygame.player.entitytemplate.cclass == "duelist"){
_local4 = "<font color='#FFFFFF'>Improved strength and intellect when fighting a single opponent";
};
if (mygame.player.entitytemplate.cclass == "hunter"){
_local4 = "<font color='#FFFFFF'>Improved strength and intellect<br>Increased resistance to poison and ice";
};
if (mygame.player.entitytemplate.cclass == "juggernaut"){
_local4 = "<font color='#FFFFFF'>Improved armor<br>Grants the class ability: <font color='#FFFF00'>SHIELD";
};
if (mygame.player.entitytemplate.cclass == "charmer"){
_local4 = "<font color='#FFFFFF'>Grants the class ability: <font color='#FFFF00'>CHARM";
};
if (mygame.player.entitytemplate.cclass == "reaper"){
_local4 = "<font color='#FFFFFF'>Improved strength<br>Grants the class ability: <font color='#FFFF00'>CRITICAL STRIKE";
};
if (mygame.player.entitytemplate.cclass == "lightwielder"){
_local4 = "<font color='#FFFFFF'>Improved willpower<br>Grants the racial ability: <font color='#FFFF00'>HEAL";
};
if (mygame.player.entitytemplate.cclass == "explorer"){
_local4 = "<font color='#FFFFFF'>Improved willpower<br>Increased resistance to all forms of damage";
};
if (mygame.player.entitytemplate.cclass == "cursed"){
_local4 = "<font color='#FFFFFF'>Reduced stats<br>Highly increased resistance to all forms of damage<br>Physical attacks are converted to random magic damage types";
};
infoblock.infotext.htmlText = (infoblock.infotext.htmlText + ("<br>" + _local4));
if (hovering >= 0){
if (hovering < 32){
infoblock.infotitle.htmlText = mygame.titles[hovering];
};
if (hovering == 0){
infoblock.infotext.htmlText = "+8 ARMOR when wearing no armor";
};
if (hovering == 1){
infoblock.infotext.htmlText = "+2 STAMINA";
};
if (hovering == 2){
infoblock.infotext.htmlText = "+1 to all stats when inventory is empty";
};
if (hovering == 3){
infoblock.infotext.htmlText = "+2 WILLPOWER";
};
if (hovering == 4){
infoblock.infotext.htmlText = "+1 STRENGTH<br>+1 INTELLECT";
};
if (hovering == 5){
infoblock.infotext.htmlText = "+2 ARMOR when inventory is full";
};
if (hovering == 6){
infoblock.infotext.htmlText = "+1 STAMINA<br>+1 WILL";
};
if (hovering == 7){
infoblock.infotext.htmlText = "+5% run speed";
};
if (hovering == 8){
infoblock.infotext.htmlText = "+1 ARMOR";
};
if (hovering == 9){
infoblock.infotext.htmlText = "+1 ARMOR for each enemy over 2 when surrounded";
};
if (hovering == 10){
infoblock.infotext.htmlText = "+2 ARMOR for each enemy over 2 when surrounded";
};
if (hovering == 11){
infoblock.infotext.htmlText = "+2 STRENGTH<br>+2 INTELLECT";
};
if (hovering == 12){
infoblock.infotext.htmlText = "+50% damage to skeletons";
};
if (hovering == 13){
infoblock.infotext.htmlText = "+3 STRENGTH";
};
if (hovering == 14){
infoblock.infotext.htmlText = "+3 STAMINA";
};
if (hovering == 15){
infoblock.infotext.htmlText = "+3 WILLPOWER";
};
if (hovering == 16){
infoblock.infotext.htmlText = "+3 INTELLECT";
};
if (hovering == 17){
infoblock.infotext.htmlText = "+2 ARMOR";
};
if (hovering == 18){
infoblock.infotext.htmlText = "+2 STAMINA<br>+2 WILL";
};
if (hovering == 19){
infoblock.infotext.htmlText = "+1 to all stats";
};
if (hovering == 20){
infoblock.infotext.htmlText = "+10% run speed";
};
if (hovering == 21){
infoblock.infotext.htmlText = "+3 ARMOR";
};
if (hovering == 22){
infoblock.infotext.htmlText = "+2 to all stats";
};
if (hovering == 23){
infoblock.infotext.htmlText = "+5 STRENGTH";
};
if (hovering == 24){
infoblock.infotext.htmlText = "+5 STAMINA";
};
if (hovering == 25){
infoblock.infotext.htmlText = "+5 WILLPOWER";
};
if (hovering == 26){
infoblock.infotext.htmlText = "+5 INTELLECT";
};
if (hovering == 27){
infoblock.infotext.htmlText = "+3 STRENGTH<br>+3 INTELLECT";
};
if (hovering == 28){
infoblock.infotext.htmlText = "20% chance any skeleton that sees you will temporarily be charmed";
};
if (hovering == 29){
infoblock.infotext.htmlText = "+3 STAMINA<br>+3 WILL";
};
if (hovering == 30){
infoblock.infotext.htmlText = "+3 to all stats";
};
if (hovering == 31){
infoblock.infotext.htmlText = "+5 STRENGTH<br>+5 INTELLECT";
};
};
};
}
public function mmove(_arg1:MouseEvent){
var _local2:Number;
_local2 = 0;
hovering = -1;
_local2 = 0;
while (_local2 < 32) {
if ((((((((titles[("t" + (_local2 + 1))].mouseX < 40)) && ((titles[("t" + (_local2 + 1))].mouseX > -40)))) && ((titles[("t" + (_local2 + 1))].mouseY < 7)))) && ((titles[("t" + (_local2 + 1))].mouseY > -7)))){
if (mygame.myroot.titles[_local2]){
hovering = _local2;
};
};
_local2++;
};
}
public function randomname(){
var _local1:String;
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:String;
var _local6:String;
_local1 = "";
_local2 = new Array();
_local3 = new Array();
_local4 = new Array();
_local2 = ["Ab", "Ank", "Asr", "B", "Br", "Bod", "Ben", "Corr", "Cail", "Cr", "Dw", "Dor", "Eff", "Gar", "Grod", "Hob", "Is", "Im", "Jor", "Jil", "Jen", "Koch", "Krul", "Low", "Lin", "leg", "Mor", "Mel", "Nic", "Nath", "Os", "Ond", "Pr", "Pin", "Quin", "Rin", "Rhas", "St", "Sin", "Tul", "Tir", "Urv", "Vil", "Var", "Wh", "Wor", "Yan", "Y", "Zor", "Zull"];
_local3 = ["a", "e", "i", "o", "u", "ou", "ae"];
_local4 = ["ren", "star", "wan", "kerf", "sift", "tink", "fur", "las", "gorn", "les", "ten", "ric", "con", "vrel"];
_local1 = _local2[Math.floor((Math.random() * _local2.length))];
_local1 = (_local1 + _local3[Math.floor((Math.random() * _local3.length))]);
_local1 = (_local1 + _local4[Math.floor((Math.random() * _local4.length))]);
if ((Math.random() * 100) < 30){
_local1 = (_local1 + _local3[Math.floor((Math.random() * _local3.length))]);
_local1 = (_local1 + _local4[Math.floor((Math.random() * _local4.length))]);
};
_local5 = _local1.substr(0, 1);
_local5 = _local5.toUpperCase();
_local6 = _local1.substr(1, (_local1.length - 1));
_local1 = (_local5 + _local6);
nameinput.text = _local1;
}
public function newItem(_arg1:Object){
if (_arg1.id == "f78ef78a40c75df4"){
mygame.myroot.unlockedskeleton = true;
spinner1.choices[11].unlocked = true;
};
if (_arg1.id == "bf50e4a8403da1ac"){
mygame.myroot.unlockedminotaur = true;
spinner1.choices[10].unlocked = true;
};
if (_arg1.id == "2fa60c3e35275f96"){
mygame.myroot.availabletitles = 3;
};
}
}
}//package
Section 39
//clickgrab (clickgrab)
package {
import flash.display.*;
public dynamic class clickgrab extends MovieClip {
}
}//package
Section 40
//clink (clink)
package {
import flash.media.*;
public dynamic class clink extends Sound {
}
}//package
Section 41
//cone (cone)
package {
import flash.display.*;
public dynamic class cone extends MovieClip {
public var conedraw:MovieClip;
}
}//package
Section 42
//dungeon (dungeon)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class dungeon {
public var wdth:Number;
public var tilefamily:Array;
public var roomlisth:Array;
public var Aweights:Array;
public var tiledec1:Array;
public var tiledec2:Array;
public var tiledec3:Array;
public var tiledec4:Array;
public var tiledec5:Array;
public var tiledec6:Array;
public var mygame:gamestage;
public var roomlistx:Array;
public var roomlisty:Array;
public var tile:Array;
public var roomlistw:Array;
public var NE:Boolean;// = false
public var E:Boolean;// = false
public var NW:Boolean;// = false
public var N:Boolean;// = false
public var debugbmpd:BitmapData;
public var S:Boolean;// = false
public var floortype:Number;// = 0
public var W:Boolean;// = false
public var debugbmp:Bitmap;
public var SE:Boolean;// = false
public var SW:Boolean;// = false
public static var sqrtof2:Number = Math.sqrt(2);
public function dungeon(_arg1:gamestage){
N = false;
NE = false;
E = false;
SE = false;
S = false;
SW = false;
W = false;
NW = false;
floortype = 0;
super();
mygame = _arg1;
tile = new Array();
tilefamily = new Array();
tiledec1 = new Array();
tiledec2 = new Array();
tiledec3 = new Array();
tiledec4 = new Array();
tiledec5 = new Array();
tiledec6 = new Array();
Aweights = new Array();
wdth = 0;
debugbmpd = new BitmapData(100, 100, true, 0);
debugbmp = new Bitmap(debugbmpd);
}
public function decorate(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:String;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Boolean;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = "fll";
_local5 = "none";
_local1 = 0;
while (_local1 < tile.length) {
_local4 = gettype(_local1);
_local5 = getwalltype(_local1);
tiledec1[_local1] = 0;
if (_local4.substr(0, 3) == "isl"){
tiledec1[_local1] = 428;
} else {
if (_local4.substr(0, 3) == "plr"){
if (floortype == 0){
tiledec1[_local1] = 5;
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((_local1 % wdth) * (40 / sqrtof2)) + (20 / sqrtof2)), ((Math.floor((_local1 / wdth)) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("pillar");
} else {
tiledec1[_local1] = 11;
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((_local1 % wdth) * (40 / sqrtof2)) + (20 / sqrtof2)), ((Math.floor((_local1 / wdth)) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("rock");
};
} else {
if (_local4.substr(0, 3) == "fll"){
tiledec1[_local1] = 1100;
if ((Math.random() * 100) < 50){
tiledec1[_local1] = 1101;
};
if ((Math.random() * 100) <= 2){
tiledec1[_local1] = 1102;
};
} else {
if (_local4.substr(0, 3) == "flr"){
if (tilefamily[_local1] == 1){
tiledec1[_local1] = 200;
if ((Math.random() * 100) < 50){
tiledec1[_local1] = 201;
};
if ((Math.random() * 100) < 5){
tiledec1[_local1] = 202;
};
if ((((((tile[(_local1 - 1)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))) || ((((tile[((_local1 - wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))){
addtiledec(_local1, 1313);
};
if ((((((tile[(_local1 + wdth)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))) || ((((tile[((_local1 + wdth) + 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))){
addtiledec(_local1, 1328);
};
if ((Math.random() * 100) < 2){
mygame.entitylist.push(new entity("fixtureswt", mygame.entitytypes["fixtureswt"], ((((_local1 - 3) % wdth) * (40 / sqrtof2)) + ((5 + (Math.random() * 30)) / sqrtof2)), ((Math.floor(((_local1 - 3) / wdth)) * (40 / sqrtof2)) + ((5 + (Math.random() * 30)) / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("bush");
};
if ((Math.random() * 100) < 2){
mygame.entitylist.push(new entity("fixtureswt", mygame.entitytypes["fixtureswt"], ((((_local1 - 3) % wdth) * (40 / sqrtof2)) + ((5 + (Math.random() * 30)) / sqrtof2)), ((Math.floor(((_local1 - 3) / wdth)) * (40 / sqrtof2)) + ((5 + (Math.random() * 30)) / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("leaves");
};
} else {
N = (tilefamily[((_local1 - wdth) + 1)] == 1);
NE = (tilefamily[(_local1 + 1)] == 1);
E = (tilefamily[((_local1 + wdth) + 1)] == 1);
SE = (tilefamily[(_local1 + wdth)] == 1);
S = (tilefamily[((_local1 + wdth) - 1)] == 1);
SW = (tilefamily[(_local1 - 1)] == 1);
W = (tilefamily[((_local1 - wdth) - 1)] == 1);
NW = (tilefamily[(_local1 - wdth)] == 1);
if (((((((((((((((((((((((NW) && (SE))) || (((NE) && (SW))))) || (((((((N) && (S))) && (E))) && (W))))) || (((((NE) && (SE))) && (W))))) || (((((SE) && (SW))) && (N))))) || (((((SW) && (NW))) && (E))))) || (((((NW) && (NE))) && (S))))) || (((((NW) && (S))) && (E))))) || (((((NE) && (S))) && (W))))) || (((((SE) && (N))) && (W))))) || (((((SW) && (N))) && (E))))){
tiledec1[_local1] = 200;
} else {
if (tile[_local1] == 1){
if (floortype == 0){
tiledec1[_local1] = 1;
if ((Math.random() * 100) < 30){
tiledec1[_local1] = 2;
};
if ((Math.random() * 100) < 10){
tiledec1[_local1] = 3;
};
if (((!((tile[(_local1 - wdth)] == 1))) && (!((tile[(_local1 + 1)] == 1))))){
addtiledec(_local1, 15);
} else {
if (((!((tile[(_local1 + wdth)] == 1))) && (!((tile[(_local1 + 1)] == 1))))){
addtiledec(_local1, 16);
} else {
if (((!((tile[(_local1 + wdth)] == 1))) && (!((tile[(_local1 - 1)] == 1))))){
addtiledec(_local1, 17);
} else {
if (((!((tile[(_local1 - wdth)] == 1))) && (!((tile[(_local1 - 1)] == 1))))){
addtiledec(_local1, 18);
} else {
if (tile[(_local1 + 1)] != 1){
addtiledec(_local1, 19);
} else {
if (tile[(_local1 + wdth)] != 1){
addtiledec(_local1, 20);
} else {
if (tile[(_local1 - 1)] != 1){
addtiledec(_local1, 21);
} else {
if (tile[(_local1 - wdth)] != 1){
addtiledec(_local1, 22);
};
};
};
};
};
};
};
};
} else {
if (floortype == 1){
tiledec1[_local1] = 11;
if ((Math.random() * 100) < 30){
tiledec1[_local1] = 12;
};
if ((Math.random() * 100) < 10){
tiledec1[_local1] = 13;
};
if ((((((tile[(_local1 - 1)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))) || ((((tile[((_local1 - wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))){
addtiledec(_local1, 1314);
};
if ((((((tile[(_local1 + wdth)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))) || ((((tile[((_local1 + wdth) + 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))){
addtiledec(_local1, 1329);
};
};
};
} else {
if (floortype == 0){
tiledec1[_local1] = 14;
if ((Math.random() * 100) < 30){
tiledec1[_local1] = 7;
};
if ((Math.random() * 100) < 20){
tiledec1[_local1] = 8;
};
if ((Math.random() * 100) < 10){
tiledec1[_local1] = 9;
};
} else {
if (floortype == 1){
tiledec1[_local1] = 11;
if ((((((tile[(_local1 - 1)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))) || ((((tile[((_local1 - wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))){
addtiledec(_local1, 1312);
};
if ((((((tile[(_local1 + wdth)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))) || ((((tile[((_local1 + wdth) + 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))){
addtiledec(_local1, 1327);
};
};
};
};
if (((((((NE) && (NW))) || (((NE) && (W))))) || (((E) && (NW))))){
addtiledec(_local1, 215);
} else {
if (((((((NE) && (SE))) || (((NE) && (S))))) || (((N) && (SE))))){
addtiledec(_local1, 216);
} else {
if (((((((SE) && (SW))) || (((SE) && (W))))) || (((E) && (SW))))){
addtiledec(_local1, 217);
} else {
if (((((((SW) && (NW))) || (((SW) && (N))))) || (((S) && (NW))))){
addtiledec(_local1, 218);
} else {
if (((NE) || (((N) && (E))))){
addtiledec(_local1, 219);
} else {
if (((SE) || (((S) && (E))))){
addtiledec(_local1, 220);
} else {
if (((SW) || (((S) && (W))))){
addtiledec(_local1, 221);
} else {
if (((NW) || (((N) && (W))))){
addtiledec(_local1, 222);
} else {
if (((N) && (S))){
addtiledec(_local1, 227);
} else {
if (((E) && (W))){
addtiledec(_local1, 228);
} else {
if (N){
addtiledec(_local1, 223);
};
if (E){
addtiledec(_local1, 224);
};
if (S){
addtiledec(_local1, 225);
};
if (W){
addtiledec(_local1, 226);
};
};
};
};
};
};
};
};
};
};
};
};
if (floortype == 0){
if ((((((tile[(_local1 - 1)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))) || ((((tile[((_local1 - wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))){
addtiledec(_local1, 1312);
};
if ((((((tile[(_local1 + wdth)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))) || ((((tile[((_local1 + wdth) + 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))){
addtiledec(_local1, 1327);
};
} else {
if ((((((tile[(_local1 - 1)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))) || ((((tile[((_local1 - wdth) - 1)] < 0)) && ((tile[(_local1 - 1)] == 0)))))){
addtiledec(_local1, 1314);
};
if ((((((tile[(_local1 + wdth)] < 0)) || ((((tile[((_local1 + wdth) - 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))) || ((((tile[((_local1 + wdth) + 1)] < 0)) && ((tile[(_local1 + wdth)] == 0)))))){
addtiledec(_local1, 1329);
};
};
};
} else {
if (_local4.substr(0, 3) == "hle"){
tiledec1[_local1] = 0;
} else {
if ((((((_local4.substr(0, 3) == "SWw")) || ((_local4.substr(0, 3) == "SEw")))) || ((_local4.substr(0, 3) == "Sws")))){
tiledec1[_local1] = 1100;
if ((((_local4.substr(0, 3) == "SWw")) || ((_local4.substr(0, 3) == "Sws")))){
if ((((tile[(_local1 - wdth)] == -2)) || ((tile[((_local1 - wdth) - 1)] == -2)))){
if ((((floortype == 0)) && ((((tile[(_local1 + wdth)] == 1)) || ((tile[((_local1 + wdth) - 1)] == 1)))))){
addtiledec(_local1, 1302);
} else {
addtiledec(_local1, 1305);
};
} else {
if ((((tile[(_local1 + wdth)] == -2)) || ((tile[((_local1 + wdth) - 1)] == -2)))){
if ((((floortype == 0)) && ((((tile[(_local1 - wdth)] == 1)) || ((tile[((_local1 - wdth) - 1)] == 1)))))){
addtiledec(_local1, 1301);
} else {
addtiledec(_local1, 1304);
};
} else {
if ((((floortype == 0)) && ((tile[(_local1 - 1)] == 1)))){
addtiledec(_local1, 1300);
} else {
addtiledec(_local1, 1303);
if (floortype == 0){
if (tile[((_local1 - wdth) - 1)] == 1){
addtiledec(_local1, 1301);
};
if (tile[((_local1 + wdth) - 1)] == 1){
addtiledec(_local1, 1302);
};
};
};
};
};
};
if ((((_local4.substr(0, 3) == "SEw")) || ((_local4.substr(0, 3) == "Sws")))){
if ((((tile[(_local1 + 1)] == -2)) || ((tile[((_local1 + wdth) + 1)] == -2)))){
if ((((floortype == 0)) && ((((tile[(_local1 - 1)] == 1)) || ((tile[((_local1 + wdth) - 1)] == 1)))))){
addtiledec(_local1, 1317);
} else {
addtiledec(_local1, 1320);
};
} else {
if ((((tile[(_local1 - 1)] == -2)) || ((tile[((_local1 + wdth) - 1)] == -2)))){
if ((((floortype == 0)) && ((((tile[((_local1 + wdth) + 1)] == 1)) || ((tile[(_local1 + wdth)] == 1)))))){
addtiledec(_local1, 1316);
} else {
addtiledec(_local1, 1319);
};
} else {
if ((((floortype == 0)) && ((tile[(_local1 + wdth)] == 1)))){
addtiledec(_local1, 1315);
} else {
addtiledec(_local1, 1318);
if (floortype == 0){
if (tile[((_local1 + wdth) + 1)] == 1){
addtiledec(_local1, 1316);
};
if (tile[((_local1 + wdth) - 1)] == 1){
addtiledec(_local1, 1317);
};
};
};
};
};
};
};
};
};
};
if (_local4.substr(3, (_local4.length - 3)) == "S"){
if (_local5 == "N"){
tiledec1[_local1] = 1500;
addtiledec(_local1, (500 + 14));
} else {
tiledec1[_local1] = 1400;
addtiledec(_local1, (400 + 14));
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "W"){
if (_local5 == "E"){
tiledec1[_local1] = 1501;
addtiledec(_local1, (501 + 14));
} else {
tiledec1[_local1] = 1401;
addtiledec(_local1, (401 + 14));
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "N"){
if (_local5 == "S"){
tiledec1[_local1] = 1502;
addtiledec(_local1, (502 + 14));
} else {
tiledec1[_local1] = 1402;
addtiledec(_local1, (402 + 14));
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "E"){
if (_local5 == "W"){
tiledec1[_local1] = 1403;
addtiledec(_local1, (403 + 14));
} else {
tiledec1[_local1] = 1403;
addtiledec(_local1, (403 + 14));
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "SW"){
if ((((_local5 == "NE")) || ((((_local5 == "N")) && ((_local5 == "E")))))){
tiledec1[_local1] = 1504;
addtiledec(_local1, (504 + 14));
} else {
if (_local5 == "S"){
tiledec1[_local1] = 1508;
addtiledec(_local1, (508 + 14));
addtiledec(_local1, 1409);
addtiledec(_local1, (409 + 14));
} else {
if (_local5 == "W"){
tiledec1[_local1] = 1408;
addtiledec(_local1, (408 + 14));
addtiledec(_local1, 1509);
addtiledec(_local1, (509 + 14));
} else {
tiledec1[_local1] = 1404;
addtiledec(_local1, (404 + 14));
};
};
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "NW"){
if ((((_local5 == "SE")) || ((((_local5 == "S")) && ((_local5 == "E")))))){
tiledec1[_local1] = 1505;
addtiledec(_local1, (505 + 14));
} else {
if (_local5 == "E"){
tiledec1[_local1] = 1509;
addtiledec(_local1, (509 + 14));
addtiledec(_local1, 1410);
addtiledec(_local1, (410 + 14));
} else {
if (_local5 == "S"){
tiledec1[_local1] = 1409;
addtiledec(_local1, (409 + 14));
addtiledec(_local1, 1510);
addtiledec(_local1, (510 + 14));
} else {
tiledec1[_local1] = 1405;
addtiledec(_local1, (405 + 14));
};
};
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "NE"){
if ((((_local5 == "SW")) || ((((_local5 == "S")) && ((_local5 == "W")))))){
tiledec1[_local1] = 1506;
addtiledec(_local1, (506 + 14));
} else {
if (_local5 == "W"){
tiledec1[_local1] = 1511;
addtiledec(_local1, (511 + 14));
addtiledec(_local1, 1410);
addtiledec(_local1, (410 + 14));
} else {
if (_local5 == "S"){
tiledec1[_local1] = 1411;
addtiledec(_local1, (411 + 14));
addtiledec(_local1, 1510);
addtiledec(_local1, (510 + 14));
} else {
tiledec1[_local1] = 1406;
addtiledec(_local1, (406 + 14));
};
};
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "SE"){
if ((((_local5 == "NW")) || ((((_local5 == "N")) && ((_local5 == "W")))))){
tiledec1[_local1] = 1507;
addtiledec(_local1, (507 + 14));
} else {
if (_local5 == "N"){
tiledec1[_local1] = 1508;
addtiledec(_local1, (508 + 14));
addtiledec(_local1, 1411);
addtiledec(_local1, (411 + 14));
} else {
if (_local5 == "W"){
tiledec1[_local1] = 1408;
addtiledec(_local1, (408 + 14));
addtiledec(_local1, 1511);
addtiledec(_local1, (511 + 14));
} else {
tiledec1[_local1] = 1407;
addtiledec(_local1, (407 + 14));
};
};
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "ESW"){
if (_local5 == "N"){
tiledec1[_local1] = 1508;
addtiledec(_local1, (508 + 14));
} else {
tiledec1[_local1] = 1408;
addtiledec(_local1, (408 + 14));
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "SWN"){
if (_local5 == "E"){
tiledec1[_local1] = 1509;
addtiledec(_local1, (509 + 14));
} else {
tiledec1[_local1] = 1409;
addtiledec(_local1, (409 + 14));
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "WNE"){
if (_local5 == "S"){
tiledec1[_local1] = 1510;
addtiledec(_local1, (510 + 14));
} else {
tiledec1[_local1] = 1410;
addtiledec(_local1, (410 + 14));
};
} else {
if (_local4.substr(3, (_local4.length - 3)) == "NES"){
if (_local5 == "W"){
tiledec1[_local1] = 1511;
addtiledec(_local1, (511 + 14));
} else {
tiledec1[_local1] = 1411;
addtiledec(_local1, (411 + 14));
};
};
};
};
};
};
};
};
};
};
};
};
};
if ((((((((_local4.substr(0, 3) == "SWw")) || ((_local4.substr(0, 3) == "SEw")))) || ((_local4.substr(0, 3) == "Sws")))) || ((_local4.substr(0, 3) == "fll")))){
if (_local5 == "isl"){
addtiledec(_local1, 1114);
};
if (_local5 == "WNE"){
addtiledec(_local1, 1115);
};
if (_local5 == "NES"){
addtiledec(_local1, 1116);
};
if (_local5 == "ESW"){
addtiledec(_local1, 1117);
};
if (_local5 == "SWN"){
addtiledec(_local1, 1118);
};
if (_local5 == "NE"){
addtiledec(_local1, 1119);
};
if (_local5 == "SE"){
addtiledec(_local1, 1120);
};
if (_local5 == "SW"){
addtiledec(_local1, 1121);
};
if (_local5 == "NW"){
addtiledec(_local1, 1122);
};
if (_local5 == "N"){
addtiledec(_local1, 1123);
};
if (_local5 == "E"){
addtiledec(_local1, 1124);
};
if (_local5 == "S"){
addtiledec(_local1, 1125);
};
if (_local5 == "W"){
addtiledec(_local1, 1126);
};
if (_local5 == "NS"){
addtiledec(_local1, 1127);
};
if (_local5 == "EW"){
addtiledec(_local1, 1128);
};
};
};
};
if (_local1 > 4){
if ((((((((((((Math.floor((tiledec1[_local1] / 100)) == 15)) && ((Math.floor((tiledec1[(_local1 - 3)] / 100)) == 15)))) && (((tiledec1[_local1] % 100) == 7)))) && ((tile[(_local1 - 1)] == 2)))) && ((tile[(_local1 - 2)] == 2)))) && (((tiledec1[(_local1 - 3)] % 100) == 7)))){
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], ((((_local1 - 3) % wdth) * (40 / sqrtof2)) + (30 / sqrtof2)), ((Math.floor(((_local1 - 3) / wdth)) * (40 / sqrtof2)) + (10 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].elev = 40;
mygame.entitylist[(mygame.entitylist.length - 1)].voffs = 31;
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("leftarch");
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((_local1 % wdth) * (40 / sqrtof2)) + (10 / sqrtof2)), ((Math.floor((_local1 / wdth)) * (40 / sqrtof2)) + (10 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].elev = 40;
mygame.entitylist[(mygame.entitylist.length - 1)].voffs = 31;
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("rightarch");
};
};
if (_local1 > ((3 * wdth) + 1)){
if ((((((((((((Math.floor((tiledec1[_local1] / 100)) == 15)) && ((Math.floor((tiledec1[(_local1 - (3 * wdth))] / 100)) == 15)))) && (((tiledec1[_local1] % 100) == 4)))) && ((tile[(_local1 - wdth)] == 2)))) && ((tile[(_local1 - (2 * wdth))] == 2)))) && (((tiledec1[(_local1 - (3 * wdth))] % 100) == 4)))){
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((_local1 % wdth) * (40 / sqrtof2)) + (30 / sqrtof2)), (((Math.floor((_local1 / wdth)) - 3) * (40 / sqrtof2)) + (30 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].elev = 40;
mygame.entitylist[(mygame.entitylist.length - 1)].voffs = 31;
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("leftarch2");
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((_local1 % wdth) * (40 / sqrtof2)) + (30 / sqrtof2)), ((Math.floor((_local1 / wdth)) * (40 / sqrtof2)) + (10 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].elev = 40;
mygame.entitylist[(mygame.entitylist.length - 1)].voffs = 31;
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("rightarch2");
};
};
_local1++;
};
_local6 = false;
_local7 = false;
_local8 = false;
_local9 = true;
_local1 = 1;
while (_local1 < (roomlisty.length - 1)) {
if (!_local7){
if ((((roomlistw[_local1] > 5)) && ((roomlisth[_local1] > 5)))){
_local9 = true;
_local2 = (roomlisty[_local1] - 3);
while (_local2 <= (roomlisty[_local1] + 3)) {
_local3 = (roomlistx[_local1] - 3);
while (_local3 <= (roomlistx[_local1] + 3)) {
if ((((tile[((_local2 * wdth) + _local3)] <= 0)) || ((tilefamily[((_local2 * wdth) + _local3)] > 0)))){
_local9 = false;
};
_local3++;
};
_local2++;
};
if (((_local9) && ((floortype == 0)))){
_local2 = (roomlisty[_local1] - 2);
while (_local2 <= (roomlisty[_local1] + 2)) {
_local3 = (roomlistx[_local1] - 2);
while (_local3 <= (roomlistx[_local1] + 2)) {
tile[((_local2 * wdth) + _local3)] = 0;
if ((((_local2 == (roomlisty[_local1] - 2))) && ((_local3 == (roomlistx[_local1] + 2))))){
tiledec1[((_local2 * wdth) + _local3)] = 103;
} else {
if (_local2 == (roomlisty[_local1] - 2)){
tiledec1[((_local2 * wdth) + _local3)] = 104;
} else {
if (_local3 == (roomlistx[_local1] + 2)){
tiledec1[((_local2 * wdth) + _local3)] = 105;
} else {
tiledec1[((_local2 * wdth) + _local3)] = 106;
};
};
};
_local3++;
};
_local2++;
};
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] - 1) * (40 / sqrtof2)) + ((Math.random() * 120) / sqrtof2)), (((roomlisty[_local1] - 1) * (40 / sqrtof2)) + ((Math.random() * 120) / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("lilly");
if (mygame.floor > 3){
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], ((roomlistx[_local1] * (40 / sqrtof2)) + (20 / sqrtof2)), ((roomlisty[_local1] * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("pondstand");
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] * (40 / sqrtof2)) + (20 / sqrtof2)) - 1), (((roomlisty[_local1] * (40 / sqrtof2)) + (20 / sqrtof2)) + 1), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].elev = 30;
mygame.entitylist[(mygame.entitylist.length - 1)].voffs = 20;
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("statue1");
};
_local7 = true;
};
};
};
if (!_local8){
if ((((roomlistw[_local1] > 4)) && ((roomlisth[_local1] > 4)))){
_local9 = true;
_local2 = (roomlisty[_local1] - 2);
while (_local2 <= (roomlisty[_local1] + 2)) {
_local3 = (roomlistx[_local1] - 2);
while (_local3 <= (roomlistx[_local1] + 2)) {
if ((((tile[((_local2 * wdth) + _local3)] <= 0)) || ((tilefamily[((_local2 * wdth) + _local3)] > 0)))){
_local9 = false;
};
_local3++;
};
_local2++;
};
if (_local9){
if (floortype == 0){
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] - 2) * (40 / sqrtof2)) + (20 / sqrtof2)), (((roomlisty[_local1] - 2) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("pillar3");
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] + 2) * (40 / sqrtof2)) + (20 / sqrtof2)), (((roomlisty[_local1] - 2) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("pillar3");
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] + 2) * (40 / sqrtof2)) + (20 / sqrtof2)), (((roomlisty[_local1] + 2) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("pillar3");
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] - 2) * (40 / sqrtof2)) + (20 / sqrtof2)), (((roomlisty[_local1] + 2) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("pillar3");
} else {
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] - 1) * (40 / sqrtof2)) + (20 / sqrtof2)), (((roomlisty[_local1] - 2) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("stalagmite");
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] + 2) * (40 / sqrtof2)) + (20 / sqrtof2)), (((roomlisty[_local1] - 1) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("stalagmite");
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] + 2) * (40 / sqrtof2)) + (20 / sqrtof2)), (((roomlisty[_local1] + 2) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("stalagmite");
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (((roomlistx[_local1] - 2) * (40 / sqrtof2)) + (20 / sqrtof2)), (((roomlisty[_local1] + 3) * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("stalagmite");
};
_local8 = true;
};
};
};
if (!_local6){
if ((((roomlistw[_local1] <= 4)) && ((roomlisth[_local1] <= 4)))){
_local9 = true;
_local2 = (roomlisty[_local1] - 2);
while (_local2 <= (roomlisty[_local1] + 2)) {
_local3 = (roomlistx[_local1] - 2);
while (_local3 <= (roomlistx[_local1] + 2)) {
if (tile[((_local2 * wdth) + _local3)] <= 0){
_local9 = false;
};
_local3++;
};
_local2++;
};
if (_local9){
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], ((roomlistx[_local1] * (40 / sqrtof2)) + (20 / sqrtof2)), ((roomlisty[_local1] * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
if (floortype == 0){
tile[((roomlisty[_local1] * wdth) + roomlistx[_local1])] = -1;
if (tilefamily[((roomlisty[_local1] * wdth) + roomlistx[_local1])] == 1){
tiledec1[((roomlisty[_local1] * wdth) + roomlistx[_local1])] = 205;
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("pillar2");
} else {
tiledec1[((roomlisty[_local1] * wdth) + roomlistx[_local1])] = 5;
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("pillar");
};
} else {
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("rock");
};
_local6 = true;
};
};
};
_local1++;
};
}
public function gettype(_arg1:Number):String{
var _local2:String;
_local2 = "";
N = (tile[((_arg1 - wdth) + 1)] > 0);
NE = (tile[(_arg1 + 1)] > 0);
E = (tile[((_arg1 + wdth) + 1)] > 0);
SE = (tile[(_arg1 + wdth)] > 0);
S = (tile[((_arg1 + wdth) - 1)] > 0);
SW = (tile[(_arg1 - 1)] > 0);
W = (tile[((_arg1 - wdth) - 1)] > 0);
NW = (tile[(_arg1 - wdth)] > 0);
if (tile[_arg1] > 0){
_local2 = "flr";
} else {
if (tile[_arg1] == -2){
_local2 = "hle";
} else {
if (((((((SE) && (SW))) && (NE))) && (NW))){
_local2 = "plr";
} else {
if (((!(SE)) && (!(SW)))){
_local2 = "fll";
} else {
if (!SE){
_local2 = "SWw";
} else {
if (!SW){
_local2 = "SEw";
} else {
_local2 = "Sws";
};
};
};
};
N = (tile[((_arg1 - wdth) + 1)] == -2);
NE = (tile[(_arg1 + 1)] == -2);
E = (tile[((_arg1 + wdth) + 1)] == -2);
SE = (tile[(_arg1 + wdth)] == -2);
S = (tile[((_arg1 + wdth) - 1)] == -2);
SW = (tile[(_arg1 - 1)] == -2);
W = (tile[((_arg1 - wdth) - 1)] == -2);
NW = (tile[(_arg1 - wdth)] == -2);
if (((((((((((((((((((((((NW) && (SE))) || (((NE) && (SW))))) || (((((((N) && (S))) && (E))) && (W))))) || (((((NE) && (SE))) && (W))))) || (((((SE) && (SW))) && (N))))) || (((((SW) && (NW))) && (E))))) || (((((NW) && (NE))) && (S))))) || (((((NW) && (S))) && (E))))) || (((((NE) && (S))) && (W))))) || (((((SE) && (N))) && (W))))) || (((((SW) && (N))) && (E))))){
_local2 = "isl";
} else {
if (((((((NE) && (NW))) || (((NE) && (W))))) || (((E) && (NW))))){
_local2 = (_local2 + "WNE");
} else {
if (((((((NE) && (SE))) || (((NE) && (S))))) || (((N) && (SE))))){
_local2 = (_local2 + "NES");
} else {
if (((((((SE) && (SW))) || (((SE) && (W))))) || (((E) && (SW))))){
_local2 = (_local2 + "ESW");
} else {
if (((((((SW) && (NW))) || (((SW) && (N))))) || (((S) && (NW))))){
_local2 = (_local2 + "SWN");
} else {
if (((NE) || (((N) && (E))))){
_local2 = (_local2 + "NE");
} else {
if (((SE) || (((S) && (E))))){
_local2 = (_local2 + "SE");
} else {
if (((SW) || (((S) && (W))))){
_local2 = (_local2 + "SW");
} else {
if (((NW) || (((N) && (W))))){
_local2 = (_local2 + "NW");
} else {
if (((N) && (S))){
_local2 = (_local2 + "NS");
} else {
if (((E) && (W))){
_local2 = (_local2 + "EW");
} else {
if (N){
_local2 = (_local2 + "N");
};
if (E){
_local2 = (_local2 + "E");
};
if (S){
_local2 = (_local2 + "S");
};
if (W){
_local2 = (_local2 + "W");
};
};
};
};
};
};
};
};
};
};
};
};
};
};
return (_local2);
}
public function loadmap(_arg1:String){
var _local2:Number;
var _local3:Number;
_local2 = 0;
_local3 = _arg1.charCodeAt(0);
if (_local3 == 126){
_local3 = 92;
};
_local3 = (_local3 - 40);
wdth = _local3;
_local2 = 1;
while (_local2 < _arg1.length) {
_local3 = _arg1.charCodeAt(_local2);
if (_local3 == 126){
_local3 = 92;
};
_local3 = (_local3 - 40);
tile.push(_local3);
_local2++;
};
}
public function carvehalls(_arg1:Number):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Boolean;
var _local6:Array;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = true;
setweights();
_local3 = 1;
while (_local3 < _arg1) {
_local6 = getpath(roomlistx[(_local3 - 1)], roomlisty[(_local3 - 1)], roomlistx[_local3], roomlisty[_local3]);
if (_local6.length == 0){
_local5 = false;
_local3 = 100;
} else {
_local2 = 0;
while (_local2 < _local6.length) {
if (tile[((_local6[_local2].y * wdth) + _local6[_local2].x)] <= 0){
tile[((_local6[_local2].y * wdth) + _local6[_local2].x)] = 2;
};
if (tile[(((_local6[_local2].y + 1) * wdth) + _local6[_local2].x)] <= 0){
tile[(((_local6[_local2].y + 1) * wdth) + _local6[_local2].x)] = 2;
};
if (tile[(((_local6[_local2].y * wdth) + _local6[_local2].x) + 1)] <= 0){
tile[(((_local6[_local2].y * wdth) + _local6[_local2].x) + 1)] = 2;
};
if (tile[((((_local6[_local2].y + 1) * wdth) + _local6[_local2].x) + 1)] <= 0){
tile[((((_local6[_local2].y + 1) * wdth) + _local6[_local2].x) + 1)] = 2;
};
_local2++;
};
setweights();
};
_local3++;
};
if (_local5){
_local3 = 0;
while (_local3 < (tile.length / wdth)) {
_local4 = 0;
while (_local4 < wdth) {
if (tile[((_local4 * wdth) + _local3)] > 0){
debugbmpd.setPixel32(_local3, _local4, 2013265919);
};
_local4++;
};
_local3++;
};
debugbmpd.setPixel32(roomlistx[(_arg1 - 1)], roomlisty[(_arg1 - 1)], 4294967295);
return (true);
//unresolved jump
};
return (false);
}
public function finishlevel(_arg1:Number){
paintfamily(1);
decorate();
populate();
zerotiledec(((roomlisty[(roomlisty.length - 1)] * wdth) + roomlistx[(roomlistx.length - 1)]));
tiledec1[((roomlisty[(roomlisty.length - 1)] * wdth) + roomlistx[(roomlistx.length - 1)])] = 6;
tile[((roomlisty[(roomlisty.length - 1)] * wdth) + roomlistx[(roomlistx.length - 1)])] = 6;
mygame.entitylist.push(new entity("vfx_zones", mygame.entitytypes["vfx_zones"], ((roomlistx[(roomlistx.length - 1)] * (40 / sqrtof2)) + (20 / sqrtof2)), ((roomlisty[(roomlisty.length - 1)] * (40 / sqrtof2)) + (20 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("exit");
mygame.entitylist[(mygame.entitylist.length - 1)].duration = -1;
mygame.player.worldx = ((roomlistx[0] * (40 / sqrtof2)) + ((40 / sqrtof2) / 2));
mygame.player.worldy = ((roomlisty[0] * (40 / sqrtof2)) + ((40 / sqrtof2) / 2));
mygame.player.tworldx = 0;
mygame.player.tworldy = 0;
mygame.player.moving = false;
}
public function getwalltype(_arg1:Number):String{
var _local2:String;
_local2 = "";
N = (tile[((_arg1 - wdth) + 1)] == 1);
NE = (tile[(_arg1 + 1)] == 1);
E = (tile[((_arg1 + wdth) + 1)] == 1);
SE = (tile[(_arg1 + wdth)] == 1);
S = (tile[((_arg1 + wdth) - 1)] == 1);
SW = (tile[(_arg1 - 1)] == 1);
W = (tile[((_arg1 - wdth) - 1)] == 1);
NW = (tile[(_arg1 - wdth)] == 1);
if (((((((((((((((((((((((NW) && (SE))) || (((NE) && (SW))))) || (((((((N) && (S))) && (E))) && (W))))) || (((((NE) && (SE))) && (W))))) || (((((SE) && (SW))) && (N))))) || (((((SW) && (NW))) && (E))))) || (((((NW) && (NE))) && (S))))) || (((((NW) && (S))) && (E))))) || (((((NE) && (S))) && (W))))) || (((((SE) && (N))) && (W))))) || (((((SW) && (N))) && (E))))){
_local2 = "isl";
} else {
if (((((((NE) && (NW))) || (((NE) && (W))))) || (((E) && (NW))))){
_local2 = "WNE";
} else {
if (((((((NE) && (SE))) || (((NE) && (S))))) || (((N) && (SE))))){
_local2 = "NES";
} else {
if (((((((SE) && (SW))) || (((SE) && (W))))) || (((E) && (SW))))){
_local2 = "ESW";
} else {
if (((((((SW) && (NW))) || (((SW) && (N))))) || (((S) && (NW))))){
_local2 = "SWN";
} else {
if (((NE) || (((N) && (E))))){
_local2 = "NE";
} else {
if (((SE) || (((S) && (E))))){
_local2 = "SE";
} else {
if (((SW) || (((S) && (W))))){
_local2 = "SW";
} else {
if (((NW) || (((N) && (W))))){
_local2 = "NW";
} else {
if (((N) && (S))){
_local2 = "NS";
} else {
if (((E) && (W))){
_local2 = "EW";
} else {
if (N){
_local2 = "N";
};
if (E){
_local2 = "E";
};
if (S){
_local2 = "S";
};
if (W){
_local2 = "W";
};
};
};
};
};
};
};
};
};
};
};
};
return (_local2);
}
public function newmap(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
_local3 = 0;
_local4 = 0;
wdth = _arg1;
_local3 = 0;
while (_local3 < (_arg1 * _arg2)) {
if (tile.length <= _local3){
tile.push(0);
} else {
tile[_local3] = 0;
};
_local3++;
};
_local3 = 0;
while (_local3 < (_arg1 * _arg2)) {
if (tilefamily.length <= _local3){
tilefamily.push(0);
} else {
tilefamily[_local3] = 0;
};
_local3++;
};
_local3 = 0;
while (_local3 < (_arg1 * _arg2)) {
if (tiledec1.length <= _local3){
tiledec1.push(-1);
tiledec2.push(-1);
tiledec3.push(-1);
tiledec4.push(-1);
tiledec5.push(-1);
tiledec6.push(-1);
} else {
tiledec1[_local3] = -1;
tiledec2[_local3] = -1;
tiledec3[_local3] = -1;
tiledec4[_local3] = -1;
tiledec5[_local3] = -1;
tiledec6[_local3] = -1;
};
_local3++;
};
_local4 = 0;
while (_local4 < (tile.length / wdth)) {
_local3 = 0;
while (_local3 < wdth) {
debugbmpd.setPixel32(_local4, _local3, 0);
_local3++;
};
_local4++;
};
}
public function addtiledec(_arg1:Number, _arg2:Number){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
if (tiledec1[_arg1] == -1){
tiledec1[_arg1] = _arg2;
} else {
if (tiledec2[_arg1] == -1){
tiledec2[_arg1] = _arg2;
} else {
if (tiledec3[_arg1] == -1){
tiledec3[_arg1] = _arg2;
} else {
if (tiledec4[_arg1] == -1){
tiledec4[_arg1] = _arg2;
} else {
if (tiledec5[_arg1] == -1){
tiledec5[_arg1] = _arg2;
} else {
if (tiledec6[_arg1] == -1){
tiledec6[_arg1] = _arg2;
};
};
};
};
};
};
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local4 = 1;
while (_local4 <= 4) {
if (((((this[("tiledec" + _local4)][_arg1] % 100) < 15)) && ((((((((((((Math.floor((this[("tiledec" + _local4)][_arg1] / 100)) == 0)) || ((Math.floor((this[("tiledec" + _local4)][_arg1] / 100)) == 1)))) || ((Math.floor((this[("tiledec" + _local4)][_arg1] / 100)) == 2)))) || ((Math.floor((this[("tiledec" + _local4)][_arg1] / 100)) == 10)))) || ((Math.floor((this[("tiledec" + _local4)][_arg1] / 100)) == 11)))) || ((Math.floor((this[("tiledec" + _local4)][_arg1] / 100)) == 12)))))){
_local3 = (_local4 + 1);
while (_local3 <= 5) {
if (((((this[("tiledec" + _local3)][_arg1] % 100) < 15)) && ((((((((((((Math.floor((this[("tiledec" + _local3)][_arg1] / 100)) == 0)) || ((Math.floor((this[("tiledec" + _local3)][_arg1] / 100)) == 1)))) || ((Math.floor((this[("tiledec" + _local3)][_arg1] / 100)) == 2)))) || ((Math.floor((this[("tiledec" + _local3)][_arg1] / 100)) == 10)))) || ((Math.floor((this[("tiledec" + _local3)][_arg1] / 100)) == 11)))) || ((Math.floor((this[("tiledec" + _local3)][_arg1] / 100)) == 12)))))){
this[("tiledec" + _local4)][_arg1] = this[("tiledec" + _local3)][_arg1];
_local5 = _local4;
while (_local5 <= 4) {
this[("tiledec" + _local5)][_arg1] = this[("tiledec" + (_local5 + 1))][_arg1];
_local5++;
};
tiledec5[_arg1] = -1;
};
_local3++;
};
};
_local4++;
};
_local6 = false;
_local4 = 5;
while (_local4 >= 1) {
if (((((((((((((((((((this[("tiledec" + _local4)][_arg1] % 100) == 1)) || (((this[("tiledec" + _local4)][_arg1] % 100) == 2)))) || (((this[("tiledec" + _local4)][_arg1] % 100) == 4)))) || (((this[("tiledec" + _local4)][_arg1] % 100) == 5)))) || (((this[("tiledec" + _local4)][_arg1] % 100) == 16)))) || (((this[("tiledec" + _local4)][_arg1] % 100) == 17)))) || (((this[("tiledec" + _local4)][_arg1] % 100) == 19)))) || (((this[("tiledec" + _local4)][_arg1] % 100) == 20)))) && ((Math.floor((this[("tiledec" + _local4)][_arg1] / 100)) == 13)))){
_local3 = (_local4 - 1);
while (_local3 >= 1) {
if (_local6){
if (((((((((((this[("tiledec" + _local3)][_arg1] % 100) == 3)) || (((this[("tiledec" + _local3)][_arg1] % 100) == 6)))) || (((this[("tiledec" + _local3)][_arg1] % 100) == 18)))) || (((this[("tiledec" + _local3)][_arg1] % 100) == 21)))) && ((Math.floor((this[("tiledec" + _local3)][_arg1] / 100)) == 13)))){
_local5 = _local3;
while (_local5 <= 4) {
this[("tiledec" + _local5)][_arg1] = this[("tiledec" + (_local5 + 1))][_arg1];
_local5++;
};
tiledec5[_arg1] = -1;
};
} else {
if (((((((((((((((((((this[("tiledec" + _local3)][_arg1] % 100) == 1)) || (((this[("tiledec" + _local3)][_arg1] % 100) == 2)))) || (((this[("tiledec" + _local3)][_arg1] % 100) == 4)))) || (((this[("tiledec" + _local3)][_arg1] % 100) == 5)))) || (((this[("tiledec" + _local3)][_arg1] % 100) == 16)))) || (((this[("tiledec" + _local3)][_arg1] % 100) == 17)))) || (((this[("tiledec" + _local3)][_arg1] % 100) == 19)))) || (((this[("tiledec" + _local3)][_arg1] % 100) == 20)))) && ((Math.floor((this[("tiledec" + _local3)][_arg1] / 100)) == 13)))){
_local6 = true;
};
};
_local3--;
};
};
_local4--;
};
}
public function addtiledecunder(_arg1:Number, _arg2:Number){
if (tiledec1[_arg1] == -1){
tiledec1[_arg1] = _arg2;
} else {
if (tiledec2[_arg1] == -1){
tiledec2[_arg1] = tiledec1[_arg1];
tiledec1[_arg1] = _arg2;
} else {
if (tiledec3[_arg1] == -1){
tiledec3[_arg1] = tiledec2[_arg1];
tiledec2[_arg1] = tiledec1[_arg1];
tiledec1[_arg1] = _arg2;
} else {
if (tiledec4[_arg1] == -1){
tiledec4[_arg1] = tiledec3[_arg1];
tiledec3[_arg1] = tiledec2[_arg1];
tiledec2[_arg1] = tiledec1[_arg1];
tiledec1[_arg1] = _arg2;
} else {
if (tiledec5[_arg1] == -1){
tiledec5[_arg1] = tiledec4[_arg1];
tiledec4[_arg1] = tiledec3[_arg1];
tiledec3[_arg1] = tiledec2[_arg1];
tiledec2[_arg1] = tiledec1[_arg1];
tiledec1[_arg1] = _arg2;
};
};
};
};
};
}
public function findtile(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = 0;
if ((((((((Math.floor((_arg2 / 100)) > 0)) && ((Math.floor((_arg2 / 100)) < (tile.length / wdth))))) && ((Math.floor((_arg1 / 100)) > 0)))) && ((Math.floor((_arg1 / 100)) < wdth)))){
_local3 = tile[((wdth * Math.floor((_arg2 / 100))) + Math.floor((_arg1 / 100)))];
} else {
_local3 = 0;
};
return (_local3);
}
public function setweights(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
Aweights.splice(0, Aweights.length);
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local1 = 0;
while (_local1 < tile.length) {
if (tile[_local1] == 1){
if ((((((((_local1 < (wdth + 1))) || (((_local1 % wdth) < 1)))) || ((_local1 > (tile.length - wdth))))) || (((_local1 % wdth) > (wdth - 2))))){
Aweights.push(100);
} else {
Aweights.push(5);
_local2 = -2;
while (_local2 < 4) {
_local3 = -2;
while (_local3 < 4) {
if (tile[((_local1 + (_local3 * wdth)) + _local2)] == 0){
Aweights[(Aweights.length - 1)] = (Aweights[(Aweights.length - 1)] + 5);
};
_local3++;
};
_local2++;
};
};
} else {
if ((((((((_local1 < (wdth + 1))) || (((_local1 % wdth) < 1)))) || ((_local1 > (tile.length - wdth))))) || (((_local1 % wdth) > (wdth - 2))))){
Aweights.push(200);
} else {
Aweights.push(10);
_local2 = -2;
while (_local2 < 4) {
_local3 = -2;
while (_local3 < 4) {
if (tile[((_local1 + (_local3 * wdth)) + _local2)] == 1){
Aweights[(Aweights.length - 1)] = (Aweights[(Aweights.length - 1)] + 5);
};
_local3++;
};
_local2++;
};
};
};
_local1++;
};
}
public function populate(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Boolean;
var _local8:Number;
var _local9:Array;
var _local10:Number;
var _local11:Number;
var _local12:*;
var _local13:String;
var _local14:Array;
var _local15:Array;
var _local16:Number;
var _local17:Number;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 20;
_local7 = false;
_local8 = 0;
_local9 = null;
_local10 = (Math.floor((Math.random() * (roomlistx.length - 2))) + 1);
if (((((Math.random() * 100) > 50)) || ((mygame.floor == 1)))){
_local7 = false;
_local6 = 20;
while ((((_local6 > 0)) && (!(_local7)))) {
_local6--;
_local3 = ((roomlistx[_local10] - (roomlistw[_local10] - 1)) + Math.floor((Math.random() * ((roomlistw[_local10] * 2) - 1))));
_local4 = ((roomlisty[_local10] - (roomlisth[_local10] - 1)) + Math.floor((Math.random() * ((roomlisth[_local10] * 2) - 1))));
if ((((tile[((_local4 * wdth) + _local3)] > 0)) && (!((tile[((_local4 * wdth) + _local3)] == 100))))){
_local7 = true;
tile[((_local4 * wdth) + _local3)] = 100;
};
};
if (_local7){
mygame.entitylist.push(new entity("fixtures", mygame.entitytypes["fixtures"], (_local3 * (40 / sqrtof2)), (_local4 * (40 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("chest");
} else {
trace("Failed to find spawn location for chest");
_local10 = -100;
};
} else {
_local10 = -100;
};
_local11 = 0;
_local2 = 1;
while (_local2 < roomlistx.length) {
_local8 = 0;
do {
_local5 = (mygame.floor - 1);
if (_local2 == (roomlistx.length - 1)){
_local5++;
};
if ((Math.random() * 100) > 50){
_local5++;
};
if (((((Math.random() * 100) > 50)) && ((mygame.floor > 1)))){
_local5++;
};
if ((((_local5 > 0)) && (((Math.random() * 100) > 50)))){
_local5--;
};
if ((((_local5 > 0)) && (((Math.random() * 100) > 50)))){
_local5--;
};
_local11 = 0;
if (_local5 > 11){
_local11 = (_local5 - 11);
_local5 = 11;
};
_local9 = mygame.entitylevellist[_local5][Math.floor((Math.random() * mygame.entitylevellist[_local5].length))].split("+");
_local1 = 0;
while (_local1 < _local9.length) {
_local7 = false;
_local6 = 20;
while ((((_local6 > 0)) && (!(_local7)))) {
_local6--;
_local3 = ((roomlistx[_local2] - (roomlistw[_local2] - 1)) + Math.floor((Math.random() * (roomlistw[_local2] * 2))));
_local4 = ((roomlisty[_local2] - (roomlisth[_local2] - 1)) + Math.floor((Math.random() * (roomlisth[_local2] * 2))));
if ((((tile[((_local4 * wdth) + _local3)] > 0)) && (!((tile[((_local4 * wdth) + _local3)] == 100))))){
_local7 = true;
tile[((_local4 * wdth) + _local3)] = 100;
};
};
if (_local7){
mygame.entitylist.push(new entity(_local9[_local1], mygame.entitytypes[_local9[_local1]], (_local3 * (40 / sqrtof2)), (_local4 * (40 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].aim(((Math.random() * 10) - 5), ((Math.random() * 10) - 5));
mygame.entitylist[(mygame.entitylist.length - 1)].LVL = (mygame.entitylist[(mygame.entitylist.length - 1)].entitytemplate.LVL + (_local11 * 8));
} else {
trace("Failed to find spawn location");
};
_local1++;
};
_local12 = (_local5 - mygame.floor);
if (_local12 < 0){
_local12 = 0;
};
if ((((_local2 == _local10)) && ((mygame.floor > 1)))){
_local8 = (_local8 + ((30 + (_local12 * 5)) / 2));
} else {
_local8 = (_local8 + (30 + (_local12 * 5)));
};
} while (_local8 < 100);
if (_local2 == (roomlistx.length - 1)){
_local7 = false;
_local6 = 100;
while ((((_local6 > 0)) && (!(_local7)))) {
_local6--;
_local3 = ((roomlistx[_local2] - (roomlistw[_local2] - 1)) + Math.floor((Math.random() * (roomlistw[_local2] * 2))));
_local4 = ((roomlisty[_local2] - (roomlisth[_local2] - 1)) + Math.floor((Math.random() * (roomlisth[_local2] * 2))));
if ((((tile[((_local4 * wdth) + _local3)] > 0)) && (!((tile[((_local4 * wdth) + _local3)] == 100))))){
_local7 = true;
tile[((_local4 * wdth) + _local3)] = 100;
};
};
if (_local7){
_local5 = mygame.floor;
if (_local5 > 11){
_local5 = 11;
};
do {
_local9 = mygame.entitylevellist[_local5][Math.floor((Math.random() * mygame.entitylevellist[_local5].length))].split("+");
} while (_local9.length > 1);
mygame.entitytypes["mob_boss"].bossify(mygame.entitytypes[_local9[0]]);
mygame.entitytypes["mob_boss"].reinitialize();
mygame.entitylist.push(new entity("mob_boss", mygame.entitytypes["mob_boss"], (_local3 * (40 / sqrtof2)), (_local4 * (40 / sqrtof2)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].aim(((Math.random() * 10) - 5), ((Math.random() * 10) - 5));
mygame.entitylist[(mygame.entitylist.length - 1)].LVL = (mygame.floor + 1);
_local13 = "";
_local14 = ["b", "br", "bl", "c", "cr", "cl", "d", "f", "g", "gh", "gr", "gl", "j", "k", "kr", "l", "m", "n", "p", "ph", "qu", "r", "s", "t", "tr", "v", "w", "z"];
_local15 = ["a", "e", "ee", "i", "o", "ou", "u"];
if ((Math.random() * 100) < 50){
_local13 = (_local13 + _local14[Math.floor((Math.random() * _local14.length))]);
};
_local13 = (_local13 + _local15[Math.floor((Math.random() * _local15.length))]);
_local13 = (_local13 + _local14[Math.floor((Math.random() * _local14.length))]);
if ((Math.random() * 100) < 50){
_local13 = (_local13 + _local15[Math.floor((Math.random() * _local15.length))]);
if ((Math.random() * 100) < 50){
_local13 = (_local13 + _local14[Math.floor((Math.random() * _local14.length))]);
};
};
_local16 = Math.ceil((mygame.floor / 3));
_local17 = Math.floor((Math.random() * 9));
if (_local17 == 0){
mygame.entitytypes["mob_boss"].BASESTR = (mygame.entitytypes["mob_boss"].BASESTR + (_local16 * 2));
if (_local9[0].substr((_local9[0].length - 8), 8) == "skeleton"){
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13 + " THE STRONG BONED");
} else {
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE MUSCULAR");
};
} else {
if (_local17 == 1){
mygame.entitytypes["mob_boss"].BASECON = (mygame.entitytypes["mob_boss"].BASECON + (_local16 * 2));
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE HEAVY");
} else {
if (_local17 == 2){
mygame.entitytypes["mob_boss"].BASEWILL = (mygame.entitytypes["mob_boss"].BASEWILL + (_local16 * 2));
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE BULLHEADED");
} else {
if (_local17 == 3){
mygame.entitytypes["mob_boss"].BASEINT = (mygame.entitytypes["mob_boss"].BASEINT + (_local16 * 2));
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE DIABOLICAL");
} else {
if (_local17 == 4){
mygame.entitytypes["mob_boss"].BASESTR = (mygame.entitytypes["mob_boss"].BASESTR + _local16);
mygame.entitytypes["mob_boss"].BASECON = (mygame.entitytypes["mob_boss"].BASECON + _local16);
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE BUTCHER");
} else {
if (_local17 == 5){
mygame.entitytypes["mob_boss"].BASECON = (mygame.entitytypes["mob_boss"].BASECON + _local16);
mygame.entitytypes["mob_boss"].BASEWILL = (mygame.entitytypes["mob_boss"].BASEWILL + _local16);
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE ROCK");
} else {
if (_local17 == 6){
mygame.entitytypes["mob_boss"].BASEWILL = (mygame.entitytypes["mob_boss"].BASEWILL + _local16);
mygame.entitytypes["mob_boss"].BASEINT = (mygame.entitytypes["mob_boss"].BASEINT + _local16);
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE MASTERMIND");
} else {
if (_local17 == 7){
mygame.entitytypes["mob_boss"].BASESTR = (mygame.entitytypes["mob_boss"].BASESTR + _local16);
mygame.entitytypes["mob_boss"].BASEINT = (mygame.entitytypes["mob_boss"].BASEINT + _local16);
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE PROVEN");
} else {
if (_local17 == 8){
mygame.entitytypes["mob_boss"].BASESTR = (mygame.entitytypes["mob_boss"].BASESTR + _local16);
mygame.entitytypes["mob_boss"].BASEWILL = (mygame.entitytypes["mob_boss"].BASEWILL + _local16);
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE UNSTOPPABLE");
} else {
if (_local17 == 9){
mygame.entitytypes["mob_boss"].BASECON = (mygame.entitytypes["mob_boss"].BASECON + _local16);
mygame.entitytypes["mob_boss"].BASEINT = (mygame.entitytypes["mob_boss"].BASEINT + _local16);
mygame.entitylist[(mygame.entitylist.length - 1)].bossname = (_local13.toUpperCase() + " THE TACTICAL");
};
};
};
};
};
};
};
};
};
};
} else {
trace("Failed to find spawn location for boss");
};
};
_local2++;
};
}
public function carveout(){
var _local1:Number;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
var _local5:Number;
_local1 = 0;
_local2 = 0;
_local3 = false;
_local4 = 0;
_local5 = 50;
while (((!(_local3)) && ((_local5 > 0)))) {
_local1 = (30 + Math.floor((Math.random() * 40)));
_local2 = (30 + Math.floor((Math.random() * 40)));
if (tile[((wdth * _local2) + _local1)] == 0){
_local3 = true;
};
_local5--;
};
if (!_local3){
trace("ERROR FINDING CAVERN CARVE LOCATION");
} else {
tile[((wdth * _local2) + _local1)] = -2;
debugbmpd.setPixel32(_local1, _local2, 2285056819);
_local1 = 0;
while (_local1 < 20) {
_local2 = (wdth + 2);
while (_local2 < (tile.length - wdth)) {
_local4 = 0;
if (tile[(_local2 + 1)] == -2){
_local4 = (_local4 + 2);
};
if (tile[(_local2 + wdth)] == -2){
_local4 = (_local4 + 2);
};
if (tile[(_local2 - 1)] == -2){
_local4 = (_local4 + 2);
};
if (tile[(_local2 - wdth)] == -2){
_local4 = (_local4 + 2);
};
if ((((((_local4 > 0)) && ((((tile[_local2] == 0)) || ((((tile[_local2] < 0)) && ((floortype == 1)))))))) && ((Math.floor((Math.random() * 100)) < (36 + (_local4 * 8)))))){
debugbmpd.setPixel32((_local2 % wdth), Math.floor((_local2 / wdth)), 2285056819);
tile[_local2] = -3;
};
if (tile[((_local2 - wdth) - 2)] == -3){
tile[((_local2 - wdth) - 2)] = -2;
};
_local2++;
};
_local1++;
};
_local2 = (wdth + 2);
while (_local2 < (tile.length - wdth)) {
_local4 = 0;
if (tile[(_local2 + 1)] == -2){
_local4 = (_local4 + 2);
};
if (tile[(_local2 + wdth)] == -2){
_local4 = (_local4 + 2);
};
if (tile[(_local2 - 1)] == -2){
_local4 = (_local4 + 2);
};
if (tile[(_local2 - wdth)] == -2){
_local4 = (_local4 + 2);
};
if (_local4 >= 6){
debugbmpd.setPixel32((_local2 % wdth), Math.floor((_local2 / wdth)), 2285056819);
tile[_local2] = -3;
};
if (tile[((_local2 - wdth) - 2)] == -3){
tile[((_local2 - wdth) - 2)] = -2;
};
_local2++;
};
};
}
public function zerotiledec(_arg1:Number){
tiledec1[_arg1] = -1;
tiledec2[_arg1] = -1;
tiledec3[_arg1] = -1;
tiledec4[_arg1] = -1;
tiledec5[_arg1] = -1;
tiledec6[_arg1] = -1;
}
public function getentitypath(_arg1:entity, _arg2:entity, _arg3:Boolean=false){
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Array;
var _local12:Array;
var _local13:Boolean;
var _local14:Anode;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Anode;
var _local21:Number;
var _local22:Number;
var _local23:Number;
_local4 = Math.floor((_arg1.worldx / (40 / sqrtof2)));
_local5 = Math.floor((_arg1.worldy / (40 / sqrtof2)));
_local6 = Math.floor((_arg2.worldx / (40 / sqrtof2)));
_local7 = Math.floor((_arg2.worldy / (40 / sqrtof2)));
if (_arg3){
_local6 = (_local4 + (_local4 - _local6));
_local7 = (_local7 + (_local5 - _local7));
_local6 = ((_local6 + Math.floor((Math.random() * 10))) - 5);
_local7 = ((_local7 + Math.floor((Math.random() * 10))) - 5);
};
if (tile[((_local7 * wdth) + _local6)] < 1){
} else {
_local8 = 0;
_local9 = 0;
_local10 = new Array();
_local11 = new Array();
_local12 = new Array();
_local13 = false;
_local14 = null;
_local15 = 0;
_local16 = 0;
_local17 = 0;
_local18 = 0;
_local19 = 0;
_local20 = null;
_local8 = 0;
while (_local8 < tile.length) {
_local12.push(null);
_local8++;
};
_local11.push(new Anode(null, _local4, _local5, 0, (Math.abs((_local4 - _local6)) + Math.abs((_local5 - _local7)))));
_local12[((_local5 * wdth) + _local4)] = _local11[(_local11.length - 1)];
_local21 = 0;
while (((!(_local13)) && ((_local21 < 25)))) {
_local21++;
if (_local11.length > 0){
_local14 = _local11[0];
_local11[0] = _local11[(_local11.length - 1)];
_local11.splice((_local11.length - 1), 1);
_local18 = 1;
while (_local18 <= (_local11.length / 2)) {
if (((_local18 * 2) + 1) <= _local11.length){
if (_local11[((_local18 * 2) - 1)].esttotal < _local11[(_local18 * 2)].esttotal){
_local20 = _local11[(_local18 - 1)];
_local11[(_local18 - 1)] = _local11[((_local18 * 2) - 1)];
_local11[((_local18 * 2) - 1)] = _local20;
_local18 = (_local18 * 2);
} else {
_local20 = _local11[(_local18 - 1)];
_local11[(_local18 - 1)] = _local11[(_local18 * 2)];
_local11[(_local18 * 2)] = _local20;
_local18 = ((_local18 * 2) + 1);
};
} else {
_local20 = _local11[(_local18 - 1)];
_local11[(_local18 - 1)] = _local11[((_local18 * 2) - 1)];
_local11[((_local18 * 2) - 1)] = _local20;
_local18 = (_local18 * 2);
};
};
_local14.onopen = false;
_local14.onclosed = true;
if ((((_local14.x == _local6)) && ((_local14.y == _local7)))){
_local13 = true;
} else {
_local22 = 0;
_local23 = 0;
_local8 = 0;
while (_local8 < 4) {
if (_local8 == 0){
_local22 = (_local14.x - 1);
_local23 = _local14.y;
};
if (_local8 == 1){
_local22 = (_local14.x + 1);
_local23 = _local14.y;
};
if (_local8 == 2){
_local22 = _local14.x;
_local23 = (_local14.y - 1);
};
if (_local8 == 3){
_local22 = _local14.x;
_local23 = (_local14.y + 1);
};
_local15 = ((_local23 * wdth) + _local22);
_local17 = ((Math.abs((_local22 - _local6)) + Math.abs((_local23 - _local7))) * 1.5);
if ((((tile[_local15] > 0)) && ((_local14.esttotal < 25)))){
if (_local12[_local15] != null){
if (!_local12[_local15].onclosed){
if (_local12[_local15].onopen){
if (((_local14.cost + _local16) + _local17) < _local12[_local15].esttotal){
_local12[_local15].pnode = _local14;
_local12[_local15].cost = (_local14.cost + 1);
_local12[_local15].esttotal = (_local12[_local15].cost + _local17);
_local12[_local15].dir = _local8;
};
} else {
_local11.push(new Anode(_local14, _local22, _local23, (_local14.cost + 1), _local17, _local8));
_local12[_local15] = _local11[(_local11.length - 1)];
_local18 = _local11.length;
_local19 = Math.floor((_local18 / 2));
while (_local19 > 1) {
if (_local11[(_local18 - 1)].esttotal < _local11[(_local19 - 1)].esttotal){
_local20 = _local11[(_local18 - 1)];
_local11[(_local18 - 1)] = _local11[(_local19 - 1)];
_local11[(_local19 - 1)] = _local20;
};
_local18 = _local19;
_local19 = Math.floor((_local18 / 2));
};
};
};
} else {
_local11.push(new Anode(_local14, _local22, _local23, (_local14.cost + 1), _local17, _local8));
_local12[_local15] = _local11[(_local11.length - 1)];
_local18 = _local11.length;
_local19 = Math.floor((_local18 / 2));
while (_local19 > 1) {
if (_local11[(_local18 - 1)].esttotal < _local11[(_local19 - 1)].esttotal){
_local20 = _local11[(_local18 - 1)];
_local11[(_local18 - 1)] = _local11[(_local19 - 1)];
_local11[(_local19 - 1)] = _local20;
};
_local18 = _local19;
_local19 = Math.floor((_local18 / 2));
};
};
};
_local8++;
};
};
} else {
_local21 = 1000;
};
};
_local14 = _local12[((_local7 * wdth) + _local6)];
if (_local13){
while (_local14.pnode != null) {
_local10.push(_local14);
_local14 = _local14.pnode;
};
_local8 = (_local10.length - 1);
while (_local8 >= 0) {
_arg1.wpx.push(((_local10[_local8].x * (40 / sqrtof2)) + (20 / sqrtof2)));
_arg1.wpy.push(((_local10[_local8].y * (40 / sqrtof2)) + (20 / sqrtof2)));
_local8--;
};
} else {
_arg1.brain.FSMstate = "watchful";
};
};
}
public function paintfamily(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
_local2 = 0;
_local3 = 0;
_local4 = false;
_local5 = 0;
_local6 = 50;
while (((!(_local4)) && ((_local6 > 0)))) {
_local2 = (30 + Math.floor((Math.random() * 40)));
_local3 = (30 + Math.floor((Math.random() * 40)));
if (tile[((wdth * _local3) + _local2)] > 0){
_local4 = true;
};
_local6--;
};
if (!_local4){
trace("ERROR FINDING CAVERN CARVE LOCATION");
} else {
tilefamily[((wdth * _local3) + _local2)] = _arg1;
_local2 = 0;
while (_local2 < 20) {
_local3 = (wdth + 2);
while (_local3 < (tilefamily.length - wdth)) {
_local5 = 0;
if (tilefamily[(_local3 + 1)] == _arg1){
_local5 = (_local5 + 2);
};
if (tilefamily[(_local3 + wdth)] == _arg1){
_local5 = (_local5 + 2);
};
if (tilefamily[(_local3 - 1)] == _arg1){
_local5 = (_local5 + 2);
};
if (tilefamily[(_local3 - wdth)] == _arg1){
_local5 = (_local5 + 2);
};
if ((((((_local5 > 0)) && ((tile[_local3] >= 1)))) && ((Math.floor((Math.random() * 100)) < (36 + (_local5 * 8)))))){
tilefamily[_local3] = 100;
};
if (tilefamily[((_local3 - wdth) - 2)] == 100){
tilefamily[((_local3 - wdth) - 2)] = _arg1;
};
_local3++;
};
_local2++;
};
_local3 = (wdth + 2);
while (_local3 < (tilefamily.length - wdth)) {
_local5 = 0;
if (tilefamily[(_local3 + 1)] == -2){
_local5 = (_local5 + 2);
};
if (tilefamily[(_local3 + wdth)] == -2){
_local5 = (_local5 + 2);
};
if (tilefamily[(_local3 - 1)] == -2){
_local5 = (_local5 + 2);
};
if (tilefamily[(_local3 - wdth)] == -2){
_local5 = (_local5 + 2);
};
if (_local5 >= 6){
tilefamily[_local3] = 100;
};
if (tilefamily[((_local3 - wdth) - 2)] == 100){
tilefamily[((_local3 - wdth) - 2)] = _arg1;
};
_local3++;
};
};
}
public function dumpmap():String{
var _local1:Number;
var _local2:String;
var _local3:Number;
_local1 = 0;
_local1 = wdth;
_local1 = (_local1 + 40);
if (_local1 == 92){
_local1 = 126;
};
_local2 = "loaderstring+=\"";
_local2 = (_local2 + String.fromCharCode(_local1));
_local3 = 0;
while (_local3 < tile.length) {
if (((((_local3 % 80) == 0)) && (!((_local3 == 0))))){
_local2 = (_local2 + "\";\nloaderstring+=\"");
};
_local1 = tile[_local3];
if (_local1 > 1000){
_local1 = (_local1 - 1000);
};
_local1 = (_local1 + 40);
if (_local1 == 92){
_local1 = 126;
};
_local2 = (_local2 + String.fromCharCode(_local1));
_local3++;
};
_local2 = (_local2 + "\";\n");
return (_local2);
}
public function getpath(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Array{
var _local5:Number;
var _local6:Number;
var _local7:Array;
var _local8:Array;
var _local9:Array;
var _local10:Boolean;
var _local11:Anode;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Anode;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local5 = 0;
_local6 = 0;
_local7 = new Array();
_local8 = new Array();
_local9 = new Array();
_local10 = false;
_local11 = null;
_local12 = 0;
_local13 = 0;
_local14 = 0;
_local15 = 0;
_local16 = 0;
_local17 = null;
_local5 = 0;
while (_local5 < tile.length) {
_local9.push(null);
_local5++;
};
_local8.push(new Anode(null, _arg1, _arg2, 0, ((Math.abs((_arg1 - _arg3)) + Math.abs((_arg2 - _arg4))) * 20)));
_local9[((_arg2 * wdth) + _arg1)] = _local8[(_local8.length - 1)];
while (!(_local10)) {
if (_local8.length > 0){
_local11 = _local8[0];
_local8[0] = _local8[(_local8.length - 1)];
_local8.splice((_local8.length - 1), 1);
_local15 = 1;
while (_local15 <= (_local8.length / 2)) {
if (((_local15 * 2) + 1) <= _local8.length){
if (_local8[((_local15 * 2) - 1)].esttotal < _local8[(_local15 * 2)].esttotal){
_local17 = _local8[(_local15 - 1)];
_local8[(_local15 - 1)] = _local8[((_local15 * 2) - 1)];
_local8[((_local15 * 2) - 1)] = _local17;
_local15 = (_local15 * 2);
} else {
_local17 = _local8[(_local15 - 1)];
_local8[(_local15 - 1)] = _local8[(_local15 * 2)];
_local8[(_local15 * 2)] = _local17;
_local15 = ((_local15 * 2) + 1);
};
} else {
_local17 = _local8[(_local15 - 1)];
_local8[(_local15 - 1)] = _local8[((_local15 * 2) - 1)];
_local8[((_local15 * 2) - 1)] = _local17;
_local15 = (_local15 * 2);
};
};
_local11.onopen = false;
_local11.onclosed = true;
if ((((_local11.x == _arg3)) && ((_local11.y == _arg4)))){
_local10 = true;
} else {
_local18 = 0;
_local19 = 0;
_local20 = 0;
_local5 = 0;
while (_local5 < 4) {
if (_local5 == 0){
_local18 = (_local11.x - 1);
_local19 = _local11.y;
};
if (_local5 == 1){
_local18 = (_local11.x + 1);
_local19 = _local11.y;
};
if (_local5 == 2){
_local18 = _local11.x;
_local19 = (_local11.y - 1);
};
if (_local5 == 3){
_local18 = _local11.x;
_local19 = (_local11.y + 1);
};
if (_local5 == _local11.dir){
_local20 = 0;
} else {
_local20 = 50;
};
_local12 = ((_local19 * wdth) + _local18);
_local13 = (Aweights[((_local19 * wdth) + _local18)] + _local20);
_local14 = ((Math.abs((_local18 - _arg3)) + Math.abs((_local19 - _arg4))) * 20);
if (_local9[_local12] != null){
if (!_local9[_local12].onclosed){
if (_local9[_local12].onopen){
if (((_local11.cost + _local13) + _local14) < _local9[_local12].esttotal){
_local9[_local12].pnode = _local11;
_local9[_local12].cost = (_local11.cost + _local13);
_local9[_local12].esttotal = (_local9[_local12].cost + _local14);
_local9[_local12].dir = _local5;
};
} else {
_local8.push(new Anode(_local11, _local18, _local19, (_local11.cost + _local13), _local14, _local5));
_local9[_local12] = _local8[(_local8.length - 1)];
_local15 = _local8.length;
_local16 = Math.floor((_local15 / 2));
while (_local16 > 1) {
if (_local8[(_local15 - 1)].esttotal < _local8[(_local16 - 1)].esttotal){
_local17 = _local8[(_local15 - 1)];
_local8[(_local15 - 1)] = _local8[(_local16 - 1)];
_local8[(_local16 - 1)] = _local17;
};
_local15 = _local16;
_local16 = Math.floor((_local15 / 2));
};
};
};
} else {
_local8.push(new Anode(_local11, _local18, _local19, (_local11.cost + _local13), _local14, _local5));
_local9[_local12] = _local8[(_local8.length - 1)];
_local15 = _local8.length;
_local16 = Math.floor((_local15 / 2));
while (_local16 > 1) {
if (_local8[(_local15 - 1)].esttotal < _local8[(_local16 - 1)].esttotal){
_local17 = _local8[(_local15 - 1)];
_local8[(_local15 - 1)] = _local8[(_local16 - 1)];
_local8[(_local16 - 1)] = _local17;
};
_local15 = _local16;
_local16 = Math.floor((_local15 / 2));
};
};
_local5++;
};
};
} else {
_local10 = true;
};
};
_local11 = _local9[((_arg4 * wdth) + _arg3)];
while (_local11.pnode != null) {
_local7.push(_local11);
_local11 = _local11.pnode;
};
return (_local7);
}
public function createrooms(_arg1:Number):Boolean{
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:*;
floortype = Math.floor((Math.random() * 2));
_local2 = 10;
_local3 = true;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = 6;
roomlistx = new Array();
roomlisty = new Array();
roomlistw = new Array();
roomlisth = new Array();
do {
_local4 = 0;
while (_local4 < _arg1) {
roomlistx.push((((Math.random() * wdth) / 2) + (wdth / 4)));
roomlisty.push((((Math.random() * (tile.length / wdth)) / 2) + (wdth / 4)));
_local4++;
};
_local4 = 0;
while (_local4 < 50) {
_local5 = 0;
while (_local5 < (roomlistx.length - 1)) {
_local6 = (_local5 + 1);
while (_local6 < roomlistx.length) {
_local8 = Math.sqrt((((roomlistx[_local5] - roomlistx[_local6]) * (roomlistx[_local5] - roomlistx[_local6])) + ((roomlisty[_local5] - roomlisty[_local6]) * (roomlisty[_local5] - roomlisty[_local6]))));
if (_local8 < 12){
roomlistx[_local5] = (roomlistx[_local5] - (((roomlistx[_local6] - roomlistx[_local5]) / _local8) * ((12 - _local8) / 2)));
roomlisty[_local5] = (roomlisty[_local5] - (((roomlisty[_local6] - roomlisty[_local5]) / _local8) * ((12 - _local8) / 2)));
roomlistx[_local6] = (roomlistx[_local6] + (((roomlistx[_local6] - roomlistx[_local5]) / _local8) * ((12 - _local8) / 2)));
roomlisty[_local6] = (roomlisty[_local6] + (((roomlisty[_local6] - roomlisty[_local5]) / _local8) * ((12 - _local8) / 2)));
};
_local8 = Math.sqrt((((roomlistx[_local5] - (wdth / 2)) * (roomlistx[_local5] - (wdth / 2))) + ((roomlisty[_local5] - (wdth / 2)) * (roomlisty[_local5] - (wdth / 2)))));
if (_local8 > (wdth / 5)){
roomlistx[_local5] = (roomlistx[_local5] - (((roomlistx[_local5] - (wdth / 2)) / _local8) * ((_local8 - (wdth / 5)) / 2)));
roomlisty[_local5] = (roomlisty[_local5] - (((roomlisty[_local5] - (wdth / 2)) / _local8) * ((_local8 - (wdth / 5)) / 2)));
};
_local6++;
};
_local5++;
};
_local4++;
};
_local4 = 0;
while (_local4 < roomlistx.length) {
if ((((((((roomlistx[_local4] < 10)) || ((roomlistx[_local4] > 90)))) || ((roomlisty[_local4] < 10)))) || ((roomlisty[_local4] > 90)))){
_local3 = false;
};
_local4++;
};
_local2--;
} while (((!(_local3)) && ((_local2 > 0))));
if (_local2 <= 0){
return (false);
};
_local4 = 0;
while (_local4 < roomlistx.length) {
roomlistx[_local4] = Math.round(roomlistx[_local4]);
roomlisty[_local4] = Math.round(roomlisty[_local4]);
roomlistw.push(0);
roomlisth.push(0);
tile[((roomlisty[_local4] * wdth) + roomlistx[_local4])] = 1;
_local4++;
};
_local10 = false;
_local7 = 0;
while (_local7 < 8) {
_local4 = 0;
while (_local4 < roomlistx.length) {
_local10 = false;
_local5 = (-(roomlisth[_local4]) - 2);
while (_local5 < (roomlisth[_local4] + 3)) {
if ((((tile[(((((roomlisty[_local4] + _local5) * wdth) + roomlistx[_local4]) + roomlistw[_local4]) + 1)] == 1)) || ((tile[(((((roomlisty[_local4] + _local5) * wdth) + roomlistx[_local4]) + roomlistw[_local4]) + 2)] == 1)))){
_local10 = true;
};
if ((((tile[(((((roomlisty[_local4] + _local5) * wdth) + roomlistx[_local4]) - roomlistw[_local4]) - 1)] == 1)) || ((tile[(((((roomlisty[_local4] + _local5) * wdth) + roomlistx[_local4]) - roomlistw[_local4]) - 2)] == 1)))){
_local10 = true;
};
_local5++;
};
if (!_local10){
var _local11 = roomlistw;
var _local12 = _local4;
var _local13 = (_local11[_local12] + 1);
_local11[_local12] = _local13;
_local5 = -(roomlisth[_local4]);
while (_local5 < (roomlisth[_local4] + 1)) {
tile[((((roomlisty[_local4] + _local5) * wdth) + roomlistx[_local4]) + roomlistw[_local4])] = 1;
tile[((((roomlisty[_local4] + _local5) * wdth) + roomlistx[_local4]) - roomlistw[_local4])] = 1;
_local5++;
};
_local5 = (-(roomlisth[_local4]) - 1);
while (_local5 < (roomlisth[_local4] + 2)) {
tile[(((((roomlisty[_local4] + _local5) * wdth) + roomlistx[_local4]) + roomlistw[_local4]) + 1)] = -1;
tile[(((((roomlisty[_local4] + _local5) * wdth) + roomlistx[_local4]) - roomlistw[_local4]) - 1)] = -1;
_local5++;
};
};
_local10 = false;
_local5 = (-(roomlistw[_local4]) - 2);
while (_local5 < (roomlistw[_local4] + 3)) {
if ((((tile[(((((roomlisty[_local4] + roomlisth[_local4]) + 1) * wdth) + roomlistx[_local4]) + _local5)] == 1)) || ((tile[(((((roomlisty[_local4] + roomlisth[_local4]) + 2) * wdth) + roomlistx[_local4]) + _local5)] == 1)))){
_local10 = true;
};
if ((((tile[(((((roomlisty[_local4] - roomlisth[_local4]) - 1) * wdth) + roomlistx[_local4]) + _local5)] == 1)) || ((tile[(((((roomlisty[_local4] - roomlisth[_local4]) - 2) * wdth) + roomlistx[_local4]) + _local5)] == 1)))){
_local10 = true;
};
_local5++;
};
if (!_local10){
_local11 = roomlisth;
_local12 = _local4;
_local13 = (_local11[_local12] + 1);
_local11[_local12] = _local13;
_local5 = -(roomlistw[_local4]);
while (_local5 < (roomlistw[_local4] + 1)) {
tile[((((roomlisty[_local4] + roomlistw[_local4]) * wdth) + roomlistx[_local4]) + _local5)] = 1;
tile[((((roomlisty[_local4] - roomlistw[_local4]) * wdth) + roomlistx[_local4]) + _local5)] = 1;
_local5++;
};
_local5 = (-(roomlistw[_local4]) - 1);
while (_local5 < (roomlistw[_local4] + 2)) {
tile[(((((roomlisty[_local4] + roomlistw[_local4]) + 1) * wdth) + roomlistx[_local4]) + _local5)] = -1;
tile[(((((roomlisty[_local4] - roomlistw[_local4]) - 1) * wdth) + roomlistx[_local4]) + _local5)] = -1;
_local5++;
};
};
_local4++;
};
_local7++;
};
if (floortype == 1){
_local4 = 0;
while (_local4 < tile.length) {
if (tile[_local4] == 1){
tile[_local4] = 2;
};
_local4++;
};
};
return (true);
}
}
}//package
Section 43
//effect (effect)
package {
public class effect {
public var intensity:Number;
public var estr:String;
public var etype:String;
public function effect(_arg1:String, _arg2:Number, _arg3:String){
etype = _arg1;
intensity = _arg2;
estr = _arg3;
}
}
}//package
Section 44
//entity (entity)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class entity {
public var LVL:Number;// = 1
public var hp:Number;
public var onscreen:Boolean;
public var STR:Number;
public var regentick2:Number;// = 0
public var ii:Number;// = 0
public var BASEWILL:Number;
public var EID:Number;
public var BASERICE:Number;
public var worldx:Number;
public var etype:String;
public var ongoingtype:String;// = ""
public var hpvis:Boolean;// = false
public var regen:Number;// = 30
public var worldy:Number;
public var ARMOR:Number;
public var ttimer:Number;// = 32
public var moving:Boolean;// = false
public var BASERFIRE:Number;
public var voffs:Number;
public var entitytemplate:entitytype;
public var BASEINT:Number;
public var regentick:Number;// = 0
public var CON:Number;
public var dead:Boolean;
public var wev:Number;// = 0
public var maxhp:Number;
public var RELECTRIC:Number;
public var bossname:String;// = ""
public var noxp:Boolean;// = false
public var ongoing:Number;// = 0
public var RFIRE:Number;
public var screenx:Number;
public var screeny:Number;
public var thinktimer:Number;// = 0
public var duration:Number;// = 1000
public var elev:Number;// = 0
public var tworldx:Number;// = 0
public var tworldy:Number;// = 0
public var mygame:gamestage;
public var BASESTR:Number;
public var ongoingtimer:Number;// = 0
public var magic:Number;
public var wxv:Number;// = 0
public var charmed:Number;// = 0
public var attacheditem:item;
public var ctarget:entity;// = null
public var BASERELECTRIC:Number;
public var pacer:Number;// = 0
public var wpy:Array;
public var chargedeffect:String;// = ""
public var wpx:Array;
public var fatigue:Number;// = 0
public var maxmagic:Number;
public var depth:Number;
public var regenaccel:Number;// = 0
public var totarget:entity;// = null
public var INT:Number;
public var initialized:Boolean;
public var WILL:Number;
public var wyv:Number;// = 0
public var RICE:Number;
public var facing:String;
public var BASERPOISON:Number;
public var pearls:Number;// = 0
public var BASEARMOR:Number;
public var framecounter:Number;
public var BASECON:Number;
public var mass:Number;// = 0
public var brain:AI;
public var canim:animation;
public var RPOISON:Number;
public static var sqrtof2:Number = Math.sqrt(2);
public static var EIDinc:Number = 0;
public function entity(_arg1:String, _arg2:entitytype, _arg3:Number, _arg4:Number, _arg5:gamestage){
ii = 0;
elev = 0;
ttimer = 32;
wxv = 0;
wyv = 0;
wev = 0;
mass = 0;
pacer = 0;
duration = 1000;
bossname = "";
ctarget = null;
totarget = null;
charmed = 0;
noxp = false;
pearls = 0;
hpvis = false;
fatigue = 0;
chargedeffect = "";
thinktimer = 0;
moving = false;
tworldx = 0;
tworldy = 0;
ongoing = 0;
ongoingtype = "";
ongoingtimer = 0;
regentick = 0;
regenaccel = 0;
regen = 30;
regentick2 = 0;
LVL = 1;
super();
wpx = new Array();
wpy = new Array();
dead = false;
voffs = 0;
initialized = false;
mygame = _arg5;
entitytemplate = _arg2;
onscreen = false;
EIDinc++;
EID = EIDinc;
etype = _arg1;
worldx = _arg3;
worldy = _arg4;
facing = "SE";
canim = entitytemplate.findanim("idle");
if (etype.substr(0, 3) == "mob"){
framecounter = Math.floor((Math.random() * 10));
} else {
framecounter = 0;
};
if (etype == "vfx_selector"){
voffs = -1100;
canim = entitytemplate.findanim("idle");
};
if (etype == "vfx_selection"){
voffs = -1000;
canim = entitytemplate.findanim("grow");
};
if (etype == "vfx_spellselection"){
voffs = -1000;
canim = entitytemplate.findanim("idle");
};
if (etype == "vfx_zones"){
voffs = -1000;
duration = 800;
};
if (etype == "vfx_poofs"){
elev = 10;
duration = (40 + Math.floor((Math.random() * 10)));
canim = entitytemplate.findanim("smoke1");
};
if ((((etype.substr(0, 3) == "mob")) && (!((etype == "mob_pc"))))){
brain = new AI(this, entitytemplate.AItype, entitytemplate.vdist);
};
}
public function heal(_arg1:Number):Number{
var _local2:Number;
_local2 = 0;
_local2 = Math.round((_arg1 * 1));
hp = (hp + _local2);
if (entitytemplate.race == "celestial"){
hp = (hp + Math.round((_local2 / 4)));
mygame.messagelist.push(("<font color='#00FF55'>CELESTIAL BLOODLINE HEALS YOU FOR " + Math.round((_local2 / 4))));
};
if (etype == "mob_pc"){
mygame.messagelist.push(("<font color='#00FF55'>YOU HEAL FOR " + _local2));
} else {
mygame.messagelist.push(("<font color='#FF5500'>ENEMY HEALS FOR " + _local2));
};
return (_local2);
}
public function stamp(_arg1:BitmapData){
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = 0;
_local3 = 0;
_local4 = 0;
if (canim != null){
if (canim.tag == "blast"){
_local3 = (((mygame.mouseX / 2) - mygame.mouseY) / sqrtof2);
_local4 = ((mygame.mouseY + (mygame.mouseX / 2)) / sqrtof2);
mygame.blit.drawcone(_arg1, (Math.atan2(_local4, _local3) - (Math.PI / 4)));
} else {
_local2 = canim.frames[framecounter];
if (entitytemplate.billboard){
mygame.blit.blittile(_arg1, Math.round(screenx), (Math.round(screeny) - 20), entitytemplate.spritesheet, _local2, elev);
} else {
if (_local2 >= 30){
mygame.blit.blittile(_arg1, Math.round(screenx), (Math.round(screeny) - 20), entitytemplate.spritesheet, (_local2 + 30), elev);
} else {
if (facing.charAt(1) == "E"){
if (facing.charAt(0) == "S"){
mygame.blit.blittile(_arg1, Math.round(screenx), (Math.round(screeny) - 20), entitytemplate.spritesheet, _local2, elev);
} else {
mygame.blit.blittile(_arg1, Math.round(screenx), (Math.round(screeny) - 20), entitytemplate.spritesheet, (_local2 + 15), elev);
};
} else {
if (facing.charAt(0) == "S"){
mygame.blit.blittile(_arg1, Math.round(screenx), (Math.round(screeny) - 20), entitytemplate.spritesheet, (_local2 + 30), elev);
} else {
mygame.blit.blittile(_arg1, Math.round(screenx), (Math.round(screeny) - 20), entitytemplate.spritesheet, (_local2 + 45), elev);
};
};
};
};
if (mygame.ptarget == this){
if (ttimer > 1){
ttimer = (ttimer / 2);
};
mygame.blit.blittile(_arg1, Math.round(screenx), ((Math.round(screeny) - 70) - ttimer), mygame.entitytypes["vfx_indicators"].spritesheet, 0);
} else {
ttimer = 32;
};
if (charmed > 0){
mygame.blit.blittile(_arg1, Math.round(screenx), (Math.round(screeny) - 85), mygame.entitytypes["vfx_indicators"].spritesheet, 1);
};
if (((!((this == mygame.player))) && ((((hp < maxhp)) || (hpvis))))){
hpvis = true;
mygame.blit.blithpbar(_arg1, Math.round(screenx), (Math.round(screeny) - (entitytemplate.size * 7)), hp, maxhp);
};
};
};
if (ongoingtype == "freeze"){
mygame.blit.blittile(_arg1, Math.round(screenx), (Math.round(screeny) - 20), mygame.entitytypes["vfx_indicators"].spritesheet, 2);
};
if (chargedeffect.substr(0, 6) == "invuln"){
mygame.blit.blittile(_arg1, Math.round(screenx), (Math.round(screeny) - 20), mygame.entitytypes["vfx_indicators"].spritesheet, 3);
};
if (bossname != ""){
mygame.blit.drawtext(_arg1, screenx, (screeny - 80), bossname);
};
}
public function statupdate(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:*;
_local1 = 0;
_local2 = 0;
STR = BASESTR;
CON = BASECON;
WILL = BASEWILL;
INT = BASEINT;
ARMOR = BASEARMOR;
RFIRE = BASERFIRE;
RELECTRIC = BASERELECTRIC;
RPOISON = BASERPOISON;
RICE = BASERICE;
if (this == mygame.player){
_local3 = 0;
_local4 = (mygame.wasattacking - 2);
if (_local4 < 0){
_local4 = 0;
};
if (mygame.activetitles[9]){
ARMOR = (ARMOR + _local4);
};
if (mygame.activetitles[10]){
ARMOR = (ARMOR + (_local4 * 2));
};
if ((((mygame.player.entitytemplate.cclass == "duelist")) && ((mygame.wasattacking == 1)))){
STR = (STR + 3);
INT = (INT + 3);
};
_local1 = 0;
while (_local1 < 32) {
if (mygame.itemlist[(6 + _local1)] != null){
_local3++;
};
_local1++;
};
if (((mygame.activetitles[2]) && ((_local3 == 0)))){
STR++;
CON++;
WILL++;
INT++;
};
if (((mygame.activetitles[5]) && ((_local3 == 32)))){
ARMOR = (ARMOR + 2);
};
if (((((((mygame.activetitles[0]) && ((mygame.itemlist[0] == null)))) && ((mygame.itemlist[1] == null)))) && ((mygame.itemlist[4] == null)))){
ARMOR = (ARMOR + 8);
};
if (mygame.itemlist[0] != null){
ARMOR = (ARMOR + mygame.itemlist[0].basestat1);
};
if (mygame.itemlist[1] != null){
ARMOR = (ARMOR + mygame.itemlist[1].basestat1);
};
if (mygame.itemlist[4] != null){
ARMOR = (ARMOR + mygame.itemlist[4].basestat1);
};
_local1 = 0;
while (_local1 < 6) {
if (mygame.itemlist[_local1] != null){
_local2 = 0;
while (_local2 < mygame.itemlist[_local1].effectsconst.length) {
procedures.proc(this, mygame.itemlist[_local1].effectsconst[_local2].etype, mygame.itemlist[_local1].effectsconst[_local2].intensity, 0, ctarget);
_local2++;
};
};
_local1++;
};
};
maxmagic = ((WILL * 10) + (5 * LVL));
maxhp = ((CON * 10) + (20 * LVL));
if (etype == "mob_boss"){
maxhp = (maxhp * 2);
};
}
public function worldtoscreen(){
screenx = (((worldx - MovieClip(mygame).camx) + (worldy - MovieClip(mygame).camy)) * sqrtof2);
screeny = ((((worldy - MovieClip(mygame).camy) - (worldx - MovieClip(mygame).camx)) / 2) * sqrtof2);
screeny = (screeny - elev);
if ((((((((screenx > -400)) && ((screenx < 400)))) && ((screeny > -250)))) && ((screeny < 350)))){
onscreen = true;
} else {
onscreen = false;
};
depth = ((screeny + voffs) + (elev / 2));
}
public function giveongoing(_arg1:Number, _arg2:String, _arg3:Number){
if (etype != "mob_pc"){
if (brain.FSMstate == "watchful"){
ctarget = mygame.player;
brain.FSMstate = "pursuing";
};
};
ongoing = _arg1;
ongoingtype = _arg2;
ongoingtimer = _arg3;
}
public function aim(_arg1:Number, _arg2:Number){
if (_arg1 < -(_arg2)){
if (_arg1 > _arg2){
facing = "NW";
} else {
facing = "SW";
};
} else {
if (_arg1 > _arg2){
facing = "NE";
} else {
facing = "SE";
};
};
}
public function frameupdate(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (fatigue > 0){
fatigue--;
};
_local1 = 0;
pacer++;
_local2 = 0;
if (!initialized){
initialize();
} else {
if (!canim){
setanim("idle");
};
if ((((etype == "vfx_poofs")) && ((canim.tag == "healbone")))){
duration--;
if (duration <= 0){
dead = true;
};
_local1 = Math.sqrt((((mygame.player.worldx - worldx) * (mygame.player.worldx - worldx)) + ((mygame.player.worldy - worldy) * (mygame.player.worldy - worldy))));
if (_local1 < 5){
dead = true;
mygame.player.heal(20);
};
tworldx = (tworldx + (((mygame.player.worldx - worldx) / _local1) * 2));
tworldy = (tworldy + (((mygame.player.worldy - worldy) / _local1) * 2));
tworldx = (tworldx * 0.9);
tworldy = (tworldy * 0.9);
};
if ((((etype == "vfx_poofs")) && ((canim.tag == "bone")))){
duration--;
if (duration <= 0){
dead = true;
};
};
if (etype == "vfx_zones"){
if (duration > 0){
duration--;
if (duration <= 0){
dead = true;
};
_local3 = ((Math.random() * Math.PI) * 2);
if (canim.tag == "vines"){
_local1 = (Math.random() * 20);
mygame.entitylist.push(new entity("vfx_poofs", mygame.entitytypes["vfx_poofs"], (worldx + (_local1 * Math.cos(_local3))), (worldy + (_local1 * Math.sin(_local3))), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("vines");
_local2 = 0;
while (_local2 < mygame.screenentitylist.length) {
if ((((mygame.screenentitylist[_local2].etype.substr(0, 3) == "mob")) && (!((mygame.screenentitylist[_local2].etype == "mob_pc"))))){
_local1 = (((worldx - mygame.screenentitylist[_local2].worldx) * (worldx - mygame.screenentitylist[_local2].worldx)) + ((worldy - mygame.screenentitylist[_local2].worldy) * (worldy - mygame.screenentitylist[_local2].worldy)));
if (_local1 < (30 * 30)){
mygame.screenentitylist[_local2].giveongoing(0, "slow", (100 + Math.floor((Math.random() * 30))));
};
};
_local2++;
};
};
if (canim.tag == "swarm"){
_local1 = (Math.random() * 30);
mygame.entitylist.push(new entity("vfx_poofs", mygame.entitytypes["vfx_poofs"], (worldx + (_local1 * Math.cos(_local3))), (worldy + (_local1 * Math.sin(_local3))), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("swarm");
_local2 = 0;
while (_local2 < mygame.screenentitylist.length) {
if ((((mygame.screenentitylist[_local2].etype.substr(0, 3) == "mob")) && (!((mygame.screenentitylist[_local2].etype == "mob_pc"))))){
_local1 = (((worldx - mygame.screenentitylist[_local2].worldx) * (worldx - mygame.screenentitylist[_local2].worldx)) + ((worldy - mygame.screenentitylist[_local2].worldy) * (worldy - mygame.screenentitylist[_local2].worldy)));
if (_local1 < (30 * 30)){
mygame.screenentitylist[_local2].giveongoing((3 * (1 + (mygame.player.INT / 20))), "swarmed", (180 + Math.floor((Math.random() * 30))));
};
};
_local2++;
};
};
if (canim.tag == "heal"){
_local1 = (Math.random() * 20);
mygame.entitylist.push(new entity("vfx_poofs", mygame.entitytypes["vfx_poofs"], (worldx + (_local1 * Math.cos(_local3))), (worldy + (_local1 * Math.sin(_local3))), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("heal");
_local1 = (((worldx - mygame.player.worldx) * (worldx - mygame.player.worldx)) + ((worldy - mygame.player.worldy) * (worldy - mygame.player.worldy)));
if (_local1 < (30 * 30)){
if ((pacer % 6) == 0){
mygame.player.heal((3 * (1 + (mygame.player.INT / 20))));
};
};
};
if (canim.tag == "fire"){
_local1 = (Math.random() * 20);
mygame.entitylist.push(new entity("vfx_poofs", mygame.entitytypes["vfx_poofs"], (worldx + (_local1 * Math.cos(_local3))), (worldy + (_local1 * Math.sin(_local3))), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("fire1");
_local2 = 0;
while (_local2 < mygame.screenentitylist.length) {
if (mygame.screenentitylist[_local2].etype.substr(0, 3) == "mob"){
_local1 = (((worldx - mygame.screenentitylist[_local2].worldx) * (worldx - mygame.screenentitylist[_local2].worldx)) + ((worldy - mygame.screenentitylist[_local2].worldy) * (worldy - mygame.screenentitylist[_local2].worldy)));
if (_local1 < (30 * 30)){
if ((pacer % 6) == 0){
mygame.screenentitylist[_local2].damage((5 * (1 + (mygame.player.INT / 20))), "fire");
mygame.screenentitylist[_local2].giveongoing((2 * (1 + (mygame.player.INT / 20))), "fire", (90 + Math.floor((Math.random() * 30))));
};
};
};
_local2++;
};
};
};
};
regenaccel++;
if ((((((((((hp > 0)) && ((hp < maxhp)))) && (!((regen == 0))))) && ((this == mygame.player)))) && (!((entitytemplate.race == "skeleton"))))){
regentick++;
if (regenaccel > 20){
regentick++;
};
if (regenaccel > 40){
regentick++;
};
if (regenaccel > 60){
regentick++;
};
if (regenaccel > 80){
regentick++;
};
if (regenaccel > 100){
regentick++;
};
if (regenaccel > 120){
regentick++;
};
if (regenaccel > 140){
regentick++;
};
if ((((((entitytemplate.race == "werewolf")) && ((regentick > (regen * 0.66))))) || ((regentick > regen)))){
hp = (hp + Math.round((maxhp / 50)));
if (entitytemplate.race == "werewolf"){
hp = (hp + Math.round((maxhp / 100)));
};
regentick = 0;
};
};
if (magic < maxmagic){
regentick2++;
if (regenaccel > 40){
regentick2++;
};
if (regenaccel > 60){
regentick2++;
};
if (regenaccel > 80){
regentick2++;
};
if (regenaccel > 100){
regentick2++;
};
if (regenaccel > 120){
regentick2++;
};
if (regenaccel > 140){
regentick2++;
};
if (regentick2 > 30){
magic = (magic + Math.round((maxmagic / 50)));
regentick2 = 0;
};
};
mass = entitytemplate.mass;
if (ongoingtype == "freeze"){
mass = 10000;
};
worldx = (worldx + wxv);
worldy = (worldy + wyv);
if (etype == "prop_loot"){
elev = (elev + wev);
if (!(((elev == 0)) && ((wev == 0)))){
wev = (wev - 1);
};
if (elev < 0){
mygame.myroot.sounds.playsound("clink", 0, 0.4);
elev = 0;
wxv = (wxv * 0.5);
wyv = (wyv * 0.5);
wev = (-(wev) * 0.5);
if (Math.abs(wev) < 3){
wev = 0;
};
};
if (elev == 0){
wxv = (wxv * 0.8);
wyv = (wyv * 0.8);
};
};
if (etype == "mob_pc"){
elev = (elev + wev);
if (((!((((elev == 0)) && ((wev == 0))))) || (mygame.falling))){
wev = (wev - 1);
};
if (((!(mygame.falling)) && ((elev < 0)))){
elev = 0;
wxv = (wxv * 0.5);
wyv = (wyv * 0.5);
wev = (-(wev) * 0.5);
if (Math.abs(wev) < 3){
wev = 0;
};
};
};
if (ongoingtype != "freeze"){
if (moving){
if (canim.tag != "attack"){
_local4 = Math.sqrt((((tworldx - worldx) * (tworldx - worldx)) + ((tworldy - worldy) * (tworldy - worldy))));
if (_local4 > entitytemplate.speed){
move((((tworldx - worldx) / _local4) * entitytemplate.speed), (((tworldy - worldy) / _local4) * entitytemplate.speed));
} else {
if (canim.tag != "idle"){
setanim("idle");
};
worldx = tworldx;
worldy = tworldy;
moving = false;
};
};
};
};
if (etype == "vfx_poofs"){
if (canim.tag.substr(0, 4) == "proj"){
if (ctarget == null){
dead = true;
} else {
elev = 20;
_local5 = Math.sqrt((((worldx - ctarget.worldx) * (worldx - ctarget.worldx)) + ((worldy - ctarget.worldy) * (worldy - ctarget.worldy))));
if (_local5 < 10){
dead = true;
if (canim.tag == "proj2"){
ctarget.damage(LVL, "fire");
} else {
if (canim.tag == "proj3"){
ctarget.damage(LVL, "ice");
} else {
if (canim.tag == "proj4"){
ctarget.damage(LVL, "poison");
} else {
if (canim.tag == "proj5"){
ctarget.damage(LVL, "electric");
} else {
ctarget.damage(LVL);
};
};
};
};
} else {
worldx = (worldx - (((worldx - ctarget.worldx) / _local5) * 10));
worldy = (worldy - (((worldy - ctarget.worldy) / _local5) * 10));
};
};
};
if (canim.tag == "smoke1"){
elev++;
};
worldx = (worldx + tworldx);
worldy = (worldy + tworldy);
tworldx = (tworldx * 0.8);
tworldy = (tworldy * 0.8);
};
if (etype == "mob_enemy_flameskeleton"){
if ((pacer % 3) == 0){
mygame.entitylist.push(new entity("vfx_poofs", mygame.entitytypes["vfx_poofs"], ((worldx + (Math.random() * 10)) - 5), ((worldy + (Math.random() * 10)) - 5), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("fire1");
mygame.entitylist[(mygame.entitylist.length - 1)].elev = 20;
mygame.entitylist[(mygame.entitylist.length - 1)].voffs = -5;
};
};
if ((((etype.substr(0, 3) == "mob")) && (!((etype == "mob_pc"))))){
if (ongoingtimer > 0){
if ((((ongoingtype == "immobile")) && (((pacer % 10) == 0)))){
mygame.entitylist.push(new entity("vfx_poofs", mygame.entitytypes["vfx_poofs"], (worldx - 5), (worldy + 5), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("vines");
};
if (ongoingtype == "swarmed"){
if ((pacer % 6) == 0){
mygame.entitylist.push(new entity("vfx_poofs", mygame.entitytypes["vfx_poofs"], ((worldx - 10) + (Math.random() * 10)), (worldy + (Math.random() * 10)), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].elev = (Math.random() * 20);
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("swarm");
};
if ((pacer % 6) == 0){
damage(ongoing, "poison");
};
};
if (ongoingtype == "fire"){
if ((ongoingtimer % 3) == 0){
if ((pacer % 3) == 0){
mygame.entitylist.push(new entity("vfx_poofs", mygame.entitytypes["vfx_poofs"], ((worldx + (Math.random() * 10)) - 5), ((worldy + (Math.random() * 10)) - 5), mygame));
mygame.entitylist[(mygame.entitylist.length - 1)].setanim("fire1");
mygame.entitylist[(mygame.entitylist.length - 1)].elev = 20;
mygame.entitylist[(mygame.entitylist.length - 1)].voffs = -5;
};
if ((pacer % 6) == 0){
damage(ongoing, "fire");
};
};
};
ongoingtimer--;
if (ongoingtimer <= 0){
ongoing = 0;
ongoingtype = "";
};
};
if ((((hp <= 0)) && (!((this == mygame.player))))){
dead = true;
mygame.kills++;
if (etype == "mob_enemy_armoredfiresploder"){
procedures.proc(this, "asplode", 100);
};
if (etype.substr((etype.length - 8), 8) == "skeleton"){
mygame.skeletonkills++;
};
if (!noxp){
mygame.xp = (mygame.xp + (LVL * 100));
};
mygame.entitylist.push(new entity("vfx_poofs", mygame.entitytypes["vfx_poofs"], worldx, worldy, mygame));
if (etype == "mob_boss"){
mygame.generateitem(this);
mygame.entitylist[(mygame.entitylist.length - 1)].wev = 5;
mygame.entitylist[(mygame.entitylist.length - 1)].wxv = (-2 + (Math.random() * 4));
mygame.entitylist[(mygame.entitylist.length - 1)].wyv = (-2 + (Math.random() * 4));
mygame.generateitem(this);
mygame.entitylist[(mygame.entitylist.length - 1)].wev = 5;
mygame.entitylist[(mygame.entitylist.length - 1)].wxv = (-2 + (Math.random() * 4));
mygame.entitylist[(mygame.entitylist.length - 1)].wyv = (-2 + (Math.random() * 4));
mygame.generateitem(this);
mygame.entitylist[(mygame.entitylist.length - 1)].wev = 5;
mygame.entitylist[(mygame.entitylist.length - 1)].wxv = (-2 + (Math.random() * 4));
mygame.entitylist[(mygame.entitylist.length - 1)].wyv = (-2 + (Math.random() * 4));
} else {
if (!noxp){
if ((Math.random() * 100) >= (100 - mygame.magicfind)){
mygame.generateitem(this);
};
mygame.entitylist[(mygame.entitylist.length - 1)].wev = 5;
mygame.entitylist[(mygame.entitylist.length - 1)].wxv = (-2 + (Math.random() * 4));
mygame.entitylist[(mygame.entitylist.length - 1)].wyv = (-2 + (Math.random() * 4));
};
};
};
if (((!((ongoingtype == "freeze"))) && (!(dead)))){
thinktimer++;
brain.think();
};
};
if (ongoingtype != "freeze"){
framecounter++;
if (framecounter >= canim.frames.length){
if (!canim.loops){
if (canim.tag == "die"){
canim = entitytemplate.findanim("dead");
} else {
if (canim.tag == "grow"){
canim = entitytemplate.findanim("grown");
} else {
canim = entitytemplate.findanim("idle");
};
};
};
framecounter = 0;
};
ii = 0;
while (ii < canim.procindex.length) {
if (canim.procindex[ii] == framecounter){
if (canim.procedures[ii].substr(0, 3) == "hit"){
procedures.proc(this, canim.procedures[ii], LVL, 0);
} else {
procedures.proc(this, canim.procedures[ii], 0, entitytemplate.castcost, ctarget);
};
};
ii++;
};
} else {
mygame.player.regenaccel = 0;
};
depth = ((screeny + voffs) + (elev / 2));
if (etype == "vfx_selection"){
if (mygame.ptarget == null){
if (mygame.player.moving){
setanim("walk");
} else {
dead = true;
};
} else {
worldx = mygame.ptarget.worldx;
worldy = mygame.ptarget.worldy;
};
};
if (etype == "vfx_spellselection"){
worldx = (mygame.player.worldx + (((mygame.mouseX / 2) - mygame.mouseY) / sqrtof2));
worldy = (mygame.player.worldy + ((mygame.mouseY + (mygame.mouseX / 2)) / sqrtof2));
};
screenx = (((worldx - MovieClip(mygame).camx) + (worldy - MovieClip(mygame).camy)) * sqrtof2);
screeny = ((((worldy - MovieClip(mygame).camy) - (worldx - MovieClip(mygame).camx)) / 2) * sqrtof2);
screeny = (screeny - elev);
if ((((((((screenx > -400)) && ((screenx < 400)))) && ((screeny > -250)))) && ((screeny < 350)))){
onscreen = true;
} else {
onscreen = false;
};
if (hp > maxhp){
hp = maxhp;
};
if (magic > maxmagic){
magic = maxmagic;
};
};
}
public function damage(_arg1:Number, _arg2:String="physical", _arg3:entity=null):Number{
var _local4:Number;
var _local5:String;
var _local6:String;
if (_arg3 != mygame.player){
mygame.myroot.sounds.playsound(("hurt" + (Math.floor((Math.random() * 3)) + 1)), 0, 0.6);
};
if (chargedeffect.substr(0, 6) == "invuln"){
_arg1 = 0;
if (chargedeffect == "invuln"){
chargedeffect = "";
};
if (chargedeffect == "invuln2"){
chargedeffect = "invuln";
};
if (chargedeffect == "invuln3"){
chargedeffect = "invuln2";
};
};
if ((((((etype.substr((etype.length - 8), 8) == "skeleton")) && (mygame.activetitles[12]))) && ((charmed == 0)))){
_arg1 = (_arg1 * 1.5);
};
if (_arg3 != null){
if ((Math.random() * 100) > 70){
totarget = _arg3;
};
};
if (etype != "mob_pc"){
if (brain.FSMstate == "watchful"){
ctarget = mygame.player;
brain.FSMstate = "pursuing";
};
procedures.proc(mygame.player, "cry", 0, 0, this);
};
_local4 = 0;
_local5 = "ENEMY";
if (charmed > 0){
_local5 = "FRIEND";
};
_local6 = "";
if (_arg2 == "physical"){
_local4 = Math.round((_arg1 / (1 + (ARMOR / 20))));
} else {
if (_arg2 == "fire"){
if (RFIRE < 100){
_local4 = Math.round((_arg1 - (_arg1 * (0.01 * RFIRE))));
} else {
_local4 = 0;
magic = (magic + Math.round((_arg1 * (0.01 * (RFIRE - 100)))));
};
_local6 = " FIRE DAMAGE";
} else {
if (_arg2 == "ice"){
if (RICE < 100){
_local4 = Math.round((_arg1 - (_arg1 * (0.01 * RICE))));
} else {
_local4 = 0;
magic = (magic + Math.round((_arg1 * (0.01 * (RICE - 100)))));
};
_local6 = " ICE DAMAGE";
} else {
if (_arg2 == "poison"){
if (RPOISON < 100){
_local4 = Math.round((_arg1 - (_arg1 * (0.01 * RPOISON))));
} else {
_local4 = 0;
magic = (magic + Math.round((_arg1 * (0.01 * (RPOISON - 100)))));
};
_local6 = " POISON DAMAGE";
} else {
if (_arg2 == "electric"){
if (RELECTRIC < 100){
_local4 = Math.round((_arg1 - (_arg1 * (0.01 * RELECTRIC))));
} else {
_local4 = 0;
magic = (magic + Math.round((_arg1 * (0.01 * (RELECTRIC - 100)))));
};
_local6 = " ELECTRIC DAMAGE";
};
};
};
};
};
if (etype == "mob_pc"){
mygame.messagelist.push((("<font color='#FF0000'>ENEMY HITS YOU FOR " + _local4) + _local6));
} else {
if (_arg3 != null){
if (_arg3.etype == "mob_pc"){
mygame.messagelist.push((((("<font color='#AAFFAA'>YOU HIT " + _local5) + " FOR ") + _local4) + _local6));
} else {
if (_arg3.charmed > 0){
mygame.messagelist.push((((("<font color='#AAFFAA'>YOUR ALLY HITS " + _local5) + " FOR ") + _local4) + _local6));
} else {
mygame.messagelist.push((((("<font color='#FF0000'>ENEMY HITS " + _local5) + " FOR ") + _local4) + _local6));
};
};
} else {
mygame.messagelist.push((((("<font color='#AAFFAA'>YOU HIT " + _local5) + " FOR ") + _local4) + _local6));
};
};
if (etype == "mob_pc"){
mygame.damagetaken = (mygame.damagetaken + _local4);
};
hp = (hp - _local4);
regenaccel = 0;
return (_local4);
}
public function setanim(_arg1:String){
canim = entitytemplate.findanim(_arg1);
if (canim == null){
entitytemplate.findanim("idle");
};
framecounter = 0;
}
public function initialize(){
BASESTR = entitytemplate.BASESTR;
BASECON = entitytemplate.BASECON;
BASEWILL = entitytemplate.BASEWILL;
BASEINT = entitytemplate.BASEINT;
BASEARMOR = entitytemplate.BASEARMOR;
BASERFIRE = entitytemplate.BASERFIRE;
BASERELECTRIC = entitytemplate.BASERELECTRIC;
BASERPOISON = entitytemplate.BASERPOISON;
BASERICE = entitytemplate.BASERICE;
maxmagic = ((BASEWILL * 10) + (5 * LVL));
maxhp = ((BASECON * 10) + (20 * LVL));
if (etype == "mob_boss"){
maxhp = (maxhp * 2);
};
hp = maxhp;
magic = maxmagic;
initialized = true;
}
public function move(_arg1:Number, _arg2:Number){
if (ongoingtype != "immobile"){
if (ongoingtype == "slow"){
worldx = (worldx + (_arg1 / 5));
worldy = (worldy + (_arg2 / 5));
} else {
worldx = (worldx + _arg1);
worldy = (worldy + _arg2);
};
};
if (_arg1 < -(_arg2)){
if (_arg2 > _arg1){
facing = "SW";
} else {
facing = "NW";
};
};
if (_arg1 > -(_arg2)){
if (_arg2 > _arg1){
facing = "SE";
} else {
facing = "NE";
};
};
if (etype.substr(0, 3) == "mob"){
if (canim.tag != "run"){
setanim("run");
};
};
}
}
}//package
Section 45
//entitysprite (entitysprite)
package {
import flash.display.*;
public dynamic class entitysprite extends MovieClip {
public var anim:MovieClip;
}
}//package
Section 46
//entitytype (entitytype)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class entitytype {
public var LVL:Number;
public var DTYPE:String;// = "physical"
public var size:Number;
public var castcost:Number;
public var anims:Array;
public var redmultiplier:Number;// = 1
public var greenmultiplier:Number;// = 1
public var WEAPON1:Number;// = 1
public var WEAPON2:Number;// = 1
public var bluemultiplier:Number;// = 1
public var vdist:Number;
public var ARMS:Number;// = 1
public var etype:String;
public var BASESTR:Number;// = 10
public var BASEWILL:Number;// = 10
public var BODY:Number;// = 1
public var BASERICE:Number;// = 0
public var FEET:Number;// = 1
public var spritesheet:tilesheet;
public var billboard:Boolean;// = false
public var entitystamp:entitysprite;
public var BASERELECTRIC:Number;// = 0
public var speed:Number;
public var HELM:Number;// = 0
public var TAIL:Number;// = 1
public var race:String;
public var initialized:Boolean;
public var BASERFIRE:Number;// = 0
public var castrange:Number;
public var HEAD:Number;// = 1
public var BASEINT:Number;// = 10
public var AItype:String;
public var initstage:Number;// = 0
public var BASERPOISON:Number;// = 0
public var castminrange:Number;
public var mass:Number;
public var cclass:String;
public var BASECON:Number;// = 10
public var BASEARMOR:Number;// = 0
public function entitytype(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1, _arg6:Number=100, _arg7:String="melee", _arg8:Number=10, _arg9:Number=100, _arg10:Number=0){
initstage = 0;
billboard = false;
redmultiplier = 1;
greenmultiplier = 1;
bluemultiplier = 1;
BASESTR = 10;
BASECON = 10;
BASEWILL = 10;
BASEINT = 10;
BASEARMOR = 0;
BASERFIRE = 0;
BASERELECTRIC = 0;
BASERPOISON = 0;
BASERICE = 0;
DTYPE = "physical";
HEAD = 1;
HELM = 0;
BODY = 1;
FEET = 1;
ARMS = 1;
WEAPON1 = 1;
WEAPON2 = 1;
TAIL = 1;
super();
vdist = _arg6;
LVL = _arg5;
race = "neutral";
cclass = "neutral";
initialized = false;
etype = _arg1;
anims = new Array();
entitystamp = new entitysprite();
if (etype == "mob_boss"){
spritesheet = new tilesheet(200, 200, 62);
entitystamp.gotoAndStop("mob_enemy1");
} else {
spritesheet = new tilesheet(120, 120, 62);
entitystamp.gotoAndStop(etype);
};
size = _arg2;
mass = _arg3;
speed = _arg4;
castminrange = _arg10;
castrange = _arg9;
castcost = _arg8;
AItype = _arg7;
initstage = 0;
}
public function basestats(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:String="physical"){
BASESTR = _arg1;
BASECON = _arg2;
BASEWILL = _arg3;
BASEINT = _arg4;
BASEARMOR = _arg5;
BASERFIRE = _arg6;
BASERELECTRIC = _arg9;
BASERPOISON = _arg8;
BASERICE = _arg7;
DTYPE = _arg10;
}
public function reinitialize(){
initialized = false;
initstage = 0;
}
public function bodyparts(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number=1, _arg7:Number=100, _arg8:Number=1, _arg9:Number=1, _arg10:Number=1){
HEAD = _arg1;
BODY = _arg2;
FEET = _arg3;
ARMS = _arg4;
WEAPON1 = _arg5;
WEAPON2 = _arg6;
TAIL = _arg7;
redmultiplier = _arg8;
greenmultiplier = _arg9;
bluemultiplier = _arg10;
}
public function initialize(){
var _local1:Number;
_local1 = 0;
if (initstage == 0){
entitystamp.anim.gotoAndStop(1);
initstage++;
} else {
if (!billboard){
if (initstage <= 30){
addframe(initstage, (initstage - 1));
} else {
if (initstage <= 60){
addframe((initstage - 30), (initstage - 1), true);
} else {
addframe((initstage - 30), (initstage - 1));
};
};
} else {
addframe(initstage, (initstage - 1));
};
if (!billboard){
if (initstage <= 60){
entitystamp.anim.gotoAndStop(((initstage % 30) + 1));
} else {
entitystamp.anim.gotoAndStop(((initstage - 30) + 1));
};
} else {
entitystamp.anim.gotoAndStop((initstage + 1));
};
initstage++;
if (initstage > 62){
initialized = true;
};
};
}
public function addanimation(_arg1:String, _arg2:Array, _arg3:Boolean=false){
anims.push(new animation(_arg1, _arg3));
anims[(anims.length - 1)].loadanim(_arg2);
}
public function findanim(_arg1:String):animation{
var _local2:animation;
var _local3:Number;
_local2 = null;
_local3 = 0;
while (_local3 < anims.length) {
if (anims[_local3].tag == _arg1){
_local2 = anims[_local3];
};
_local3++;
};
return (_local2);
}
public function bossify(_arg1:entitytype){
var _local2:Number;
anims.splice(0, anims.length);
_local2 = 0;
while (_local2 < _arg1.anims.length) {
anims.push(_arg1.anims[_local2]);
_local2++;
};
LVL = _arg1.LVL;
entitystamp.gotoAndStop(_arg1.etype);
AItype = _arg1.AItype;
size = (_arg1.size * 1.5);
mass = (_arg1.mass * 10);
speed = (_arg1.speed * 1.5);
vdist = _arg1.vdist;
castrange = _arg1.castrange;
castcost = _arg1.castcost;
redmultiplier = _arg1.redmultiplier;
greenmultiplier = _arg1.greenmultiplier;
bluemultiplier = _arg1.bluemultiplier;
BASESTR = _arg1.BASESTR;
BASECON = (_arg1.BASECON * 3);
BASEWILL = _arg1.BASEWILL;
BASEINT = _arg1.BASEINT;
BASEARMOR = _arg1.BASEARMOR;
BASERFIRE = _arg1.BASERFIRE;
BASERELECTRIC = _arg1.BASERELECTRIC;
BASERPOISON = _arg1.BASERPOISON;
BASERICE = _arg1.BASERICE;
DTYPE = _arg1.DTYPE;
HEAD = _arg1.HEAD;
BODY = _arg1.BODY;
FEET = _arg1.FEET;
ARMS = _arg1.ARMS;
WEAPON1 = _arg1.WEAPON1;
WEAPON2 = _arg1.WEAPON2;
TAIL = _arg1.TAIL;
}
public function addframe(_arg1:Number, _arg2:Number, _arg3:Boolean=false){
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Matrix;
var _local8:ColorTransform;
_local4 = 0;
_local4 = 0;
while (_local4 < entitystamp.anim.numChildren) {
if ((entitystamp.anim.getChildAt(_local4) is EP_weapon)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(WEAPON1);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_headforward)){
if (HELM > 0){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop((HEAD + 100));
} else {
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(HEAD);
};
};
if ((entitystamp.anim.getChildAt(_local4) is EP_helm)){
if (HELM > 0){
if (HEAD > 9){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop((HELM + 100));
} else {
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(HELM);
};
} else {
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(100);
};
};
if ((entitystamp.anim.getChildAt(_local4) is EP_headbackward)){
if (HELM > 0){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(((HEAD + 100) + ((HELM - 1) * 15)));
} else {
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(HEAD);
};
};
if ((entitystamp.anim.getChildAt(_local4) is EP_bodyforward)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(BODY);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_bodybackward)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(BODY);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_leg)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(FEET);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_foot1)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(FEET);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_foot2)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(FEET);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_armstandard)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(ARMS);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_hand1)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(ARMS);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_hand2)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(ARMS);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_hand3)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(ARMS);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_hand4)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(ARMS);
};
if ((entitystamp.anim.getChildAt(_local4) is EP_tail)){
MovieClip(entitystamp.anim.getChildAt(_local4)).gotoAndStop(TAIL);
};
_local4++;
};
_local5 = (_arg2 % spritesheet.sheetwidth);
_local6 = Math.floor((_arg2 / spritesheet.sheetwidth));
_local7 = null;
if (etype == "mob_boss"){
if (_arg3){
_local7 = new Matrix(-1.5, 0, 0, 1.5, ((_local5 * 200) + 100), ((_local6 * 200) + 120));
} else {
_local7 = new Matrix(1.5, 0, 0, 1.5, ((_local5 * 200) + 100), ((_local6 * 200) + 120));
};
spritesheet.zero((_local5 * 200), (_local6 * 200), 200, 200);
} else {
if (_arg3){
_local7 = new Matrix(-1, 0, 0, 1, ((_local5 * 120) + 60), ((_local6 * 120) + 80));
} else {
_local7 = new Matrix(1, 0, 0, 1, ((_local5 * 120) + 60), ((_local6 * 120) + 80));
};
spritesheet.zero((_local5 * 120), (_local6 * 120), 120, 120);
};
if (((((!((redmultiplier == 1))) || (!((greenmultiplier == 1))))) || (!((bluemultiplier == 1))))){
_local8 = new ColorTransform();
_local8.redMultiplier = redmultiplier;
_local8.greenMultiplier = greenmultiplier;
_local8.blueMultiplier = bluemultiplier;
entitystamp.transform.colorTransform = _local8;
};
spritesheet.tiledata.draw(entitystamp, _local7, _local8);
}
}
}//package
Section 47
//EP_armstandard (EP_armstandard)
package {
import flash.display.*;
public dynamic class EP_armstandard extends MovieClip {
}
}//package
Section 48
//EP_bodybackward (EP_bodybackward)
package {
import flash.display.*;
public dynamic class EP_bodybackward extends MovieClip {
}
}//package
Section 49
//EP_bodyforward (EP_bodyforward)
package {
import flash.display.*;
public dynamic class EP_bodyforward extends MovieClip {
}
}//package
Section 50
//EP_foot1 (EP_foot1)
package {
import flash.display.*;
public dynamic class EP_foot1 extends MovieClip {
}
}//package
Section 51
//EP_foot2 (EP_foot2)
package {
import flash.display.*;
public dynamic class EP_foot2 extends MovieClip {
}
}//package
Section 52
//EP_hand1 (EP_hand1)
package {
import flash.display.*;
public dynamic class EP_hand1 extends MovieClip {
}
}//package
Section 53
//EP_hand2 (EP_hand2)
package {
import flash.display.*;
public dynamic class EP_hand2 extends MovieClip {
}
}//package
Section 54
//EP_hand3 (EP_hand3)
package {
import flash.display.*;
public dynamic class EP_hand3 extends MovieClip {
}
}//package
Section 55
//EP_hand4 (EP_hand4)
package {
import flash.display.*;
public dynamic class EP_hand4 extends MovieClip {
}
}//package
Section 56
//EP_headbackward (EP_headbackward)
package {
import flash.display.*;
public dynamic class EP_headbackward extends MovieClip {
}
}//package
Section 57
//EP_headforward (EP_headforward)
package {
import flash.display.*;
public dynamic class EP_headforward extends MovieClip {
}
}//package
Section 58
//EP_helm (EP_helm)
package {
import flash.display.*;
public dynamic class EP_helm extends MovieClip {
}
}//package
Section 59
//EP_leg (EP_leg)
package {
import flash.display.*;
public dynamic class EP_leg extends MovieClip {
}
}//package
Section 60
//EP_tail (EP_tail)
package {
import flash.display.*;
public dynamic class EP_tail extends MovieClip {
}
}//package
Section 61
//EP_weapon (EP_weapon)
package {
import flash.display.*;
public dynamic class EP_weapon extends MovieClip {
}
}//package
Section 62
//gamestage (gamestage)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.filters.*;
public class gamestage extends MovieClip {
public var ptarget:entity;
public var mouseclick:Boolean;
public var floor:Number;// = 1
public var clicked:entity;
public var distancetraveled:Number;// = 0
public var itemlist:Array;
public var statpoints:Number;
public var clickgrabber:clickgrab;
public var keymenu:Boolean;
public var hasmoved:Boolean;// = false
public var newstuff:Boolean;// = false
public var award:Number;// = -1
public var ptargeted:entity;
public var racespells:Array;
public var groundgel:Bitmap;
public var screenentitylist:Array;
public var mostattacking:Number;// = 0
public var falling:Boolean;// = false
public var camy:Number;// = 0
public var camx:Number;// = 0
public var myroot:MovieClip;
public var phud:hud;
public var entitytypes:Array;
public var screenheight:Number;// = 450
public var skeletonkills:Number;// = 0
public var damagetaken:Number;// = 0
public var controls:String;// = "setupA"
public var initialized:Boolean;// = false
public var kills:Number;// = 0
public var screenwidth:Number;// = 600
public var bgtilesheet1:tilesheet;
public var magicfind:Number;// = 40
public var bgtilesheet3:tilesheet;
public var player:entity;
public var bgtilesheet6:tilesheet;
public var bgtilesheet2:tilesheet;
public var bgtilesheet4:tilesheet;
public var initializer:Number;
public var playername:String;
public var blit:blitter;
public var newchar:charcreate;
public var xp:Number;
public var entitylist:Array;
public var quickbar:Array;
public var unlockedtitlesnum:Number;
public var bgtilesheet5:tilesheet;
public var keyjump:Boolean;
public var titles:Array;
public var ii:Number;// = 0
public var messagelist:Array;
public var keyleft:Boolean;
public var keyshoot:Boolean;
public var keyright:Boolean;
public var keyup:Boolean;
public var youarehere:minimapyou;
public var currentattacking:Number;// = 0
public var kicked:Boolean;// = false
public var selectedspell:spell;
public var keyctrl:Boolean;
public var hasattacked:Boolean;// = false
public var titletext:String;// = ""
public var keydown:Boolean;
public var dungeonfloor:dungeon;
public var savedptarget:entity;
public var entitylevellist:Array;
public var activetitles:Array;
public var minimap:MovieClip;
public var wealth:Number;
public var grounddata:BitmapData;
public var classspells:Array;
public var unlockedtitles:Array;
public var wasattacking:Number;// = 0
public var tilestamp:tileset;
public var selector:entity;
public var gamestate:String;// = "create"
public var dinitialized:Boolean;// = false
public static var sqrtof2:Number = Math.sqrt(2);
public function gamestage(_arg1:MovieClip){
var _local2:Number;
var _local3:Number;
kills = 0;
damagetaken = 0;
skeletonkills = 0;
wasattacking = 0;
currentattacking = 0;
mostattacking = 0;
distancetraveled = 0;
titletext = "";
falling = false;
kicked = false;
ii = 0;
controls = "setupA";
gamestate = "create";
screenwidth = 600;
screenheight = 450;
camx = 0;
camy = 0;
floor = 1;
award = -1;
newstuff = false;
hasmoved = false;
hasattacked = false;
magicfind = 40;
initialized = false;
dinitialized = false;
super();
myroot = _arg1;
wealth = 0;
statpoints = 0;
xp = 0;
playername = "";
unlockedtitles = new Array();
activetitles = new Array();
quickbar = new Array();
itemlist = new Array();
racespells = new Array();
classspells = new Array();
_local2 = 0;
while (_local2 < 38) {
itemlist.push(null);
_local2++;
};
_local2 = 0;
while (_local2 < 8) {
quickbar.push(-1);
_local2++;
};
_local2 = 0;
while (_local2 < 21) {
unlockedtitles.push(false);
_local2++;
};
_local2 = 0;
while (_local2 < 21) {
activetitles.push(false);
_local2++;
};
blit = new blitter(screenwidth, screenheight);
grounddata = blit.createsurface();
groundgel = new Bitmap(grounddata);
addChild(groundgel);
groundgel.x = (-(screenwidth) / 2);
groundgel.y = (-(screenheight) / 2);
groundgel.scaleX = 1;
groundgel.scaleY = 1;
clickgrabber = new clickgrab();
addChild(clickgrabber);
bgtilesheet1 = blit.createtilesheet(80, 44, 30);
bgtilesheet2 = blit.createtilesheet(80, 44, 30);
bgtilesheet3 = blit.createtilesheet(80, 44, 30);
bgtilesheet4 = blit.createtilesheet(80, 64, 30);
bgtilesheet5 = blit.createtilesheet(80, 84, 30);
bgtilesheet6 = blit.createtilesheet(80, 84, 30);
tilestamp = new tileset();
_local3 = 0;
while (_local3 < 30) {
tilestamp.gotoAndStop((_local3 + 1));
bgtilesheet1.tiledata.draw(tilestamp, new Matrix(1, 0, 0, 1, ((bgtilesheet1.tilewidth * (_local3 % bgtilesheet1.sheetwidth)) + (bgtilesheet1.tilewidth / 2)), ((bgtilesheet1.tileheight * Math.floor((_local3 / bgtilesheet1.sheetwidth))) + (bgtilesheet1.tileheight / 2))));
tilestamp.gotoAndStop((_local3 + 31));
bgtilesheet2.tiledata.draw(tilestamp, new Matrix(1, 0, 0, 1, ((bgtilesheet2.tilewidth * (_local3 % bgtilesheet2.sheetwidth)) + (bgtilesheet2.tilewidth / 2)), ((bgtilesheet2.tileheight * Math.floor((_local3 / bgtilesheet1.sheetwidth))) + (bgtilesheet2.tileheight / 2))));
tilestamp.gotoAndStop((_local3 + 61));
bgtilesheet3.tiledata.draw(tilestamp, new Matrix(1, 0, 0, 1, ((bgtilesheet3.tilewidth * (_local3 % bgtilesheet2.sheetwidth)) + (bgtilesheet3.tilewidth / 2)), ((bgtilesheet3.tileheight * Math.floor((_local3 / bgtilesheet1.sheetwidth))) + (bgtilesheet3.tileheight / 2))));
tilestamp.gotoAndStop((_local3 + 91));
bgtilesheet4.tiledata.draw(tilestamp, new Matrix(1, 0, 0, 1, ((bgtilesheet4.tilewidth * (_local3 % bgtilesheet2.sheetwidth)) + (bgtilesheet4.tilewidth / 2)), ((bgtilesheet4.tileheight * Math.floor((_local3 / bgtilesheet1.sheetwidth))) + (bgtilesheet4.tileheight / 2))));
tilestamp.gotoAndStop((_local3 + 121));
bgtilesheet5.tiledata.draw(tilestamp, new Matrix(1, 0, 0, 1, ((bgtilesheet5.tilewidth * (_local3 % bgtilesheet2.sheetwidth)) + (bgtilesheet5.tilewidth / 2)), ((bgtilesheet5.tileheight * Math.floor((_local3 / bgtilesheet1.sheetwidth))) + (bgtilesheet5.tileheight / 2))));
tilestamp.gotoAndStop((_local3 + 151));
bgtilesheet6.tiledata.draw(tilestamp, new Matrix(1, 0, 0, 1, ((bgtilesheet6.tilewidth * (_local3 % bgtilesheet2.sheetwidth)) + (bgtilesheet6.tilewidth / 2)), ((bgtilesheet6.tileheight * Math.floor((_local3 / bgtilesheet1.sheetwidth))) + (bgtilesheet6.tileheight / 2))));
_local3++;
};
entitylist = new Array();
screenentitylist = new Array();
titles = new Array();
titles = ["NUDIST", "NONVIOLENT", "ASCETIC", "HUMBLED", "KILLER", "HOARDER", "EXPLORER", "TRAVELED", "STONE SKIN", "BRAVE", "DAUNTLESS", "DEADLY", "BONEBANE", "STRONG", "TOUGH", "WISE", "INTELLIGENT", "IRON SKIN", "SPELUNKER", "EXPERIENCED", "MARATHONER", "STEEL SKIN", "LEGENDARY", "HERCULIAN", "INDOMITABLE", "IRON WILLED", "GENIUS", "LETHAL", "BONEMASTER", "ABYSSAL", "EPIC", "DEVASTATING"];
entitylevellist = new Array();
entitylevellist = [["mob_enemy_frog", "mob_enemy_headlessskeleton"], ["mob_enemy_frog2", "mob_enemy_skeleton"], ["mob_enemy_deepelf", "mob_enemy_frostskeleton", "mob_enemy_headlessskeleton+mob_enemy_headlessskeleton+mob_enemy_headlessskeleton"], ["mob_enemy_deepelfhealer", "mob_enemy_frogman"], ["mob_enemy_frogman2", "mob_enemy_flameskeleton", "mob_enemy_deepelfhealer+mob_enemy_deepelf"], ["mob_enemy_ghost", "mob_enemy_frogman2+mob_enemy_frog+mob_enemy_frog"], ["mob_enemy_beastskeleton", "mob_enemy_elementale", "mob_enemy_deepelfhealer+mob_enemy_deepelf+mob_enemy_deepelf"], ["mob_enemy_boarman", "mob_enemy_rbeastskeleton", "mob_enemy_ghost+mob_enemy_ghost"], ["mob_enemy_boarmanhealer", "mob_enemy_rbeastskeleton+mob_enemy_beastskeleton", "mob_enemy_juggernaut"], ["mob_enemy_armoredfire", "mob_enemy_boarmanhealer+mob_enemy_boarman"], ["mob_enemy_icejuggernaut", "mob_enemy_armoredfiresploder"], ["mob_enemy_elementale2", "mob_enemy_icejuggernaut+mob_enemy_icejuggernaut", "mob_enemy_armoredfiresploder+mob_enemy_armoredfiresploder", "mob_enemy_boarmanhealer+mob_enemy_boarman+mob_enemy_boarman"]];
entitytypes = new Array();
entitytypes["mob_pc"] = new entitytype("mob_pc", 9, 50, 3);
entitytypes["mob_pc"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_pc"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_pc"].addanimation("attack", [0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10]);
entitytypes["mob_pc"].addanimation("attacked", [9, 9, 9, 10, 10, 10]);
entitytypes["mob_pc"].addanimation("cast", [11, 11, 11, 11, 11, 11]);
entitytypes["mob_pc"].addanimation("die", [30, 30, 30, 30, 30, 31, 31, 31]);
entitytypes["mob_pc"].addanimation("dead", [31], true);
entitytypes["mob_pc"].findanim("attack").addproc("hit", 7);
entitytypes["mob_pc"].basestats(10, 10, 10, 10, 0, 0, 0, 0, 0);
entitytypes["mob_boss"] = new entitytype("mob_boss", 9, 50, 3);
entitytypes["mob_boss"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_boss"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_boss"].addanimation("attack", [0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10]);
entitytypes["mob_boss"].addanimation("attacked", [9, 9, 9, 10, 10, 10]);
entitytypes["mob_boss"].addanimation("cast", [11, 11, 11, 11, 11, 11]);
entitytypes["mob_boss"].addanimation("die", [30, 30, 30, 30, 30, 31, 31, 31]);
entitytypes["mob_boss"].addanimation("dead", [31], true);
entitytypes["mob_boss"].findanim("attack").addproc("hit", 7);
entitytypes["mob_boss"].basestats(10, 20, 10, 10, 0, 0, 0, 0, 0);
entitytypes["mob_boss"].bodyparts(100, 23, 23, 23, 1, 1, 23);
entitytypes["mob_enemy_frog"] = new entitytype("mob_enemy_frog", 9, 10, 1.6, 1, 75);
entitytypes["mob_enemy_frog"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_frog"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_frog"].addanimation("attack", [0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10]);
entitytypes["mob_enemy_frog"].findanim("attack").addproc("hit", 9);
entitytypes["mob_enemy_frog"].basestats(1, 1, 2, 2, 0, -50, -50, -100, -50);
entitytypes["mob_enemy_frog"].bodyparts(20, 20, 20, 20, 1, 1, 20);
entitytypes["mob_enemy_headlessskeleton"] = new entitytype("mob_enemy1", 9, 10, 2.3, 1, 25);
entitytypes["mob_enemy_headlessskeleton"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_headlessskeleton"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_headlessskeleton"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_headlessskeleton"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_headlessskeleton"].basestats(1, 2, 1, 1, 0, -50, -50, 25, -50);
entitytypes["mob_enemy_headlessskeleton"].bodyparts(100, 23, 23, 23, 1, 1, 23);
entitytypes["mob_enemy_frog2"] = new entitytype("mob_enemy_frog", 9, 10, 1.6, 2, 75);
entitytypes["mob_enemy_frog2"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_frog2"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_frog2"].addanimation("attack", [0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10]);
entitytypes["mob_enemy_frog2"].findanim("attack").addproc("hit", 9);
entitytypes["mob_enemy_frog2"].basestats(2, 1, 2, 2, 2, -50, -50, 50, -50, "poison");
entitytypes["mob_enemy_frog2"].bodyparts(21, 21, 21, 21, 1, 1, 21);
entitytypes["mob_enemy_skeleton"] = new entitytype("mob_enemy1", 9, 10, 2.3, 2, 100);
entitytypes["mob_enemy_skeleton"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_skeleton"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_skeleton"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_skeleton"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_skeleton"].basestats(1, 3, 2, 2, 0, -50, -50, 25, -50);
entitytypes["mob_enemy_skeleton"].bodyparts(23, 23, 23, 23, 1, 1, 23);
entitytypes["mob_enemy_frostskeleton"] = new entitytype("mob_enemy1", 9, 10, 2.3, 3, 100);
entitytypes["mob_enemy_frostskeleton"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_frostskeleton"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_frostskeleton"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_frostskeleton"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_frostskeleton"].basestats(3, 2, 2, 2, 0, -100, 50, 25, -25, "ice");
entitytypes["mob_enemy_frostskeleton"].bodyparts(23, 23, 23, 23, 2, 2, 23, 0.8, 1.4, 2);
entitytypes["mob_enemy_deepelf"] = new entitytype("mob_enemy1", 9, 10, 3, 3, 150);
entitytypes["mob_enemy_deepelf"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_deepelf"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_deepelf"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_deepelf"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_deepelf"].basestats(6, 3, 2, 2, 2, 0, 0, -25, -25);
entitytypes["mob_enemy_deepelf"].bodyparts(25, 25, 25, 25, 4, 4, 25);
entitytypes["mob_enemy_deepelfhealer"] = new entitytype("mob_enemy2", 9, 10, 2, 4, 150, "healer", 20);
entitytypes["mob_enemy_deepelfhealer"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_deepelfhealer"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_deepelfhealer"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_deepelfhealer"].addanimation("heal", [0, 0, 0, 0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13]);
entitytypes["mob_enemy_deepelfhealer"].findanim("attack").addproc("shootproj2", 5);
entitytypes["mob_enemy_deepelfhealer"].findanim("heal").addproc("healother", 14);
entitytypes["mob_enemy_deepelfhealer"].basestats(2, 2, 4, 4, 2, 0, 0, -25, -25);
entitytypes["mob_enemy_deepelfhealer"].bodyparts(26, 25, 25, 25, 19, 19, 25);
entitytypes["mob_enemy_frogman"] = new entitytype("mob_enemy1", 9, 10, 1.6, 4, 100);
entitytypes["mob_enemy_frogman"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_frogman"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_frogman"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_frogman"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_frogman"].basestats(4, 4, 4, 4, 0, -25, -25, -50, -25);
entitytypes["mob_enemy_frogman"].bodyparts(20, 20, 20, 20, 2, 2, 20);
entitytypes["mob_enemy_frogman2"] = new entitytype("mob_enemy1", 9, 10, 1.6, 5, 100);
entitytypes["mob_enemy_frogman2"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_frogman2"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_frogman2"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_frogman2"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_frogman2"].basestats(4, 5, 4, 4, 0, -25, -25, 50, -25);
entitytypes["mob_enemy_frogman2"].bodyparts(21, 21, 21, 21, 3, 3, 21);
entitytypes["mob_enemy_flameskeleton"] = new entitytype("mob_enemy1", 9, 10, 2.3, 5, 100);
entitytypes["mob_enemy_flameskeleton"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_flameskeleton"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_flameskeleton"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_flameskeleton"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_flameskeleton"].basestats(5, 5, 5, 5, 0, 75, -100, 25, 0, "fire");
entitytypes["mob_enemy_flameskeleton"].bodyparts(23, 23, 23, 23, 5, 5, 23, 1.5, 0.7, 0.5);
entitytypes["mob_enemy_ghost"] = new entitytype("mob_enemy1", 9, 10, 2.5, 6, 125);
entitytypes["mob_enemy_ghost"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_ghost"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_ghost"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_ghost"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_ghost"].basestats(8, 6, 5, 5, 10, -100, -100, -100, -100);
entitytypes["mob_enemy_ghost"].bodyparts(35, 35, 35, 35, 7, 7, 35);
entitytypes["mob_enemy_beastskeleton"] = new entitytype("mob_enemy1", 9, 10, 2.3, 7, 100);
entitytypes["mob_enemy_beastskeleton"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_beastskeleton"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_beastskeleton"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_beastskeleton"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_beastskeleton"].basestats(8, 8, 6, 6, 5, 0, 0, 50, 0);
entitytypes["mob_enemy_beastskeleton"].bodyparts(30, 30, 30, 30, 14, 14, 30);
entitytypes["mob_enemy_rbeastskeleton"] = new entitytype("mob_enemy2", 9, 10, 2, 8, 100, "ranged");
entitytypes["mob_enemy_rbeastskeleton"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_rbeastskeleton"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_rbeastskeleton"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_rbeastskeleton"].findanim("attack").addproc("shootproj4", 8);
entitytypes["mob_enemy_rbeastskeleton"].basestats(6, 6, 10, 12, 5, 0, 0, 50, 0);
entitytypes["mob_enemy_rbeastskeleton"].bodyparts(31, 30, 30, 30, 20, 20, 30);
entitytypes["mob_enemy_elementale"] = new entitytype("mob_enemy_orb", 9, 10, 2, 8, 120, "meleecaster", 10, 30);
entitytypes["mob_enemy_elementale"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_elementale"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_elementale"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_elementale"].addanimation("cast", [0, 0, 0, 0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13]);
entitytypes["mob_enemy_elementale"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_elementale"].findanim("cast").addproc("discharge", 14);
entitytypes["mob_enemy_elementale"].basestats(6, 8, 8, 8, 4, -25, -25, 50, 200);
entitytypes["mob_enemy_elementale"].bodyparts(45, 0, 0, 0, 0, 0, 0);
entitytypes["mob_enemy_boarman"] = new entitytype("mob_enemy1", 9, 10, 2.3, 9, 150);
entitytypes["mob_enemy_boarman"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_boarman"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_boarman"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_boarman"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_boarman"].basestats(8, 10, 8, 8, 6, 0, 25, -50, 0);
entitytypes["mob_enemy_boarman"].bodyparts(55, 55, 55, 55, 14, 14, 55);
entitytypes["mob_enemy_boarmanhealer"] = new entitytype("mob_enemy2", 9, 10, 2, 10, 150, "healer", 20);
entitytypes["mob_enemy_boarmanhealer"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_boarmanhealer"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_boarmanhealer"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_boarmanhealer"].addanimation("heal", [0, 0, 0, 0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13]);
entitytypes["mob_enemy_boarmanhealer"].findanim("attack").addproc("shootproj2", 5);
entitytypes["mob_enemy_boarmanhealer"].findanim("heal").addproc("healother", 14);
entitytypes["mob_enemy_boarmanhealer"].basestats(8, 8, 10, 14, 2, 25, 0, 0, 25);
entitytypes["mob_enemy_boarmanhealer"].bodyparts(56, 55, 55, 55, 19, 19, 55);
entitytypes["mob_enemy_juggernaut"] = new entitytype("mob_enemy1", 9, 10, 2.3, 11, 160, "meleecaster", 20, 160, 60);
entitytypes["mob_enemy_juggernaut"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_juggernaut"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_juggernaut"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_juggernaut"].addanimation("cast", [0, 0]);
entitytypes["mob_enemy_juggernaut"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_juggernaut"].findanim("cast").addproc("charge", 1);
entitytypes["mob_enemy_juggernaut"].basestats(8, 10, 8, 8, 10, 0, 0, 50, 50);
entitytypes["mob_enemy_juggernaut"].bodyparts(50, 50, 50, 50, 12, 12, 50);
entitytypes["mob_enemy_armoredfire"] = new entitytype("mob_enemy1", 9, 10, 2, 12, 160, "meleecaster", 20);
entitytypes["mob_enemy_armoredfire"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_armoredfire"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_armoredfire"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_armoredfire"].addanimation("cast", [0, 0, 0, 0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13]);
entitytypes["mob_enemy_armoredfire"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_armoredfire"].findanim("cast").addproc("fireblast", 14);
entitytypes["mob_enemy_armoredfire"].basestats(12, 10, 8, 8, 10, 150, -50, 0, 0);
entitytypes["mob_enemy_armoredfire"].bodyparts(40, 40, 40, 40, 4, 4, 40);
entitytypes["mob_enemy_icejuggernaut"] = new entitytype("mob_enemy1", 9, 10, 2.3, 11, 160, "meleecaster", 20, 160, 60);
entitytypes["mob_enemy_icejuggernaut"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_icejuggernaut"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_icejuggernaut"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_icejuggernaut"].addanimation("cast", [0, 0]);
entitytypes["mob_enemy_icejuggernaut"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_icejuggernaut"].findanim("cast").addproc("charge", 1);
entitytypes["mob_enemy_icejuggernaut"].basestats(10, 10, 10, 10, 10, -50, 150, 50, -25, "ice");
entitytypes["mob_enemy_icejuggernaut"].bodyparts(50, 50, 50, 50, 12, 12, 50, 0.8, 1.4, 2);
entitytypes["mob_enemy_armoredfiresploder"] = new entitytype("mob_enemy1", 9, 10, 2, 12, 160, "meleecaster", 20);
entitytypes["mob_enemy_armoredfiresploder"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_armoredfiresploder"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_armoredfiresploder"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_armoredfiresploder"].addanimation("cast", [0, 0, 0, 0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13]);
entitytypes["mob_enemy_armoredfiresploder"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_armoredfiresploder"].findanim("cast").addproc("fireblast", 14);
entitytypes["mob_enemy_armoredfiresploder"].basestats(12, 10, 12, 12, 10, 200, -50, 0, 0);
entitytypes["mob_enemy_armoredfiresploder"].bodyparts(41, 41, 41, 41, 13, 13, 41);
entitytypes["mob_enemy_elementale2"] = new entitytype("mob_enemy_orb", 9, 10, 2, 13, 120, "meleecaster", 10, 30);
entitytypes["mob_enemy_elementale2"].addanimation("idle", [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3], true);
entitytypes["mob_enemy_elementale2"].addanimation("run", [4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7], true);
entitytypes["mob_enemy_elementale2"].addanimation("attack", [0, 0, 0, 0, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10]);
entitytypes["mob_enemy_elementale2"].addanimation("cast", [0, 0, 0, 0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13]);
entitytypes["mob_enemy_elementale2"].findanim("attack").addproc("hit", 8);
entitytypes["mob_enemy_elementale2"].findanim("cast").addproc("discharge", 14);
entitytypes["mob_enemy_elementale2"].basestats(10, 12, 15, 15, 10, -25, -25, 50, 200);
entitytypes["mob_enemy_elementale2"].bodyparts(45, 0, 0, 0, 0, 0, 0, 1.4, 1.4, 0.4);
entitytypes["prop_loot"] = new entitytype("prop_loot", 8, 0, 0);
entitytypes["prop_loot"].addanimation("idle", [0], true);
entitytypes["prop_loot"].addanimation("weapon0", [0], true);
entitytypes["prop_loot"].addanimation("weapon1", [1], true);
entitytypes["prop_loot"].addanimation("weapon2", [2], true);
entitytypes["prop_loot"].addanimation("armor0", [3], true);
entitytypes["prop_loot"].addanimation("armor1", [4], true);
entitytypes["prop_loot"].addanimation("armor2", [5], true);
entitytypes["prop_loot"].addanimation("helm0", [6], true);
entitytypes["prop_loot"].addanimation("helm1", [7], true);
entitytypes["prop_loot"].addanimation("helm2", [8], true);
entitytypes["prop_loot"].addanimation("boots0", [9], true);
entitytypes["prop_loot"].addanimation("boots1", [10], true);
entitytypes["prop_loot"].addanimation("boots2", [11], true);
entitytypes["prop_loot"].addanimation("ring0", [12], true);
entitytypes["prop_loot"].addanimation("ring1", [13], true);
entitytypes["prop_loot"].addanimation("ring2", [14], true);
entitytypes["prop_loot"].addanimation("pearls0", [15], true);
entitytypes["prop_loot"].addanimation("pearls1", [16], true);
entitytypes["prop_loot"].addanimation("pearls2", [17], true);
entitytypes["prop_loot"].addanimation("pearls3", [18], true);
entitytypes["prop_loot"].addanimation("pearls4", [19], true);
entitytypes["vfx_selection"] = new entitytype("vfx_selection", 0, 0, 0);
entitytypes["vfx_selection"].billboard = true;
entitytypes["vfx_selection"].addanimation("grow", [0, 0, 0, 1, 1, 1], false);
entitytypes["vfx_selection"].addanimation("idle", [2, 2, 2, 2, 2, 2], true);
entitytypes["vfx_selection"].addanimation("inactive", [3, 3, 3, 3, 3, 3], true);
entitytypes["vfx_selection"].addanimation("walk", [0, 0, 0], true);
entitytypes["vfx_spellselection"] = new entitytype("vfx_spellselection", 0, 0, 0);
entitytypes["vfx_spellselection"].billboard = true;
entitytypes["vfx_spellselection"].addanimation("idle", [0, 0, 0, 0, 0, 0], true);
entitytypes["vfx_spellselection"].addanimation("circle", [0, 0, 0, 0, 0, 0], true);
entitytypes["vfx_spellselection"].addanimation("cone", [0, 0, 0, 0, 0, 0], true);
entitytypes["vfx_spellselection"].addanimation("select", [0, 0, 0, 0, 0, 0], true);
entitytypes["vfx_spellselection"].addanimation("fireburst", [0, 0]);
entitytypes["vfx_spellselection"].addanimation("icecone", [0, 0]);
entitytypes["vfx_spellselection"].findanim("fireburst").addproc("fireburst", 1);
entitytypes["vfx_spellselection"].findanim("icecone").addproc("icecone", 1);
entitytypes["vfx_poofs"] = new entitytype("vfx_poofs", 0, 0, 0);
entitytypes["vfx_poofs"].billboard = true;
entitytypes["vfx_poofs"].addanimation("dust1", [19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24]);
entitytypes["vfx_poofs"].addanimation("vines", [25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28]);
entitytypes["vfx_poofs"].addanimation("smoke1", [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4]);
entitytypes["vfx_poofs"].addanimation("cold1", [5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8]);
entitytypes["vfx_poofs"].addanimation("fire1", [9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12]);
entitytypes["vfx_poofs"].addanimation("swarm", [29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33]);
entitytypes["vfx_poofs"].addanimation("healbone", [34, 34, 34, 35, 35, 35, 36, 36, 36], true);
entitytypes["vfx_poofs"].addanimation("heal", [37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40]);
entitytypes["vfx_poofs"].addanimation("lightning", [41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44]);
entitytypes["vfx_poofs"].addanimation("bone", [34, 34, 34, 35, 35, 35, 36, 36, 36], true);
entitytypes["vfx_poofs"].addanimation("proj1", [13], true);
entitytypes["vfx_poofs"].addanimation("proj2", [14], true);
entitytypes["vfx_poofs"].addanimation("proj3", [15], true);
entitytypes["vfx_poofs"].addanimation("proj4", [16], true);
entitytypes["vfx_poofs"].addanimation("proj5", [17], true);
entitytypes["vfx_poofs"].addanimation("idle", [0], true);
entitytypes["vfx_poofs"].findanim("idle").addproc("die", 0);
entitytypes["vfx_indicators"] = new entitytype("vfx_indicators", 0, 0, 0);
entitytypes["vfx_indicators"].billboard = true;
entitytypes["vfx_indicators"].addanimation("idle", [0], true);
entitytypes["fixtures"] = new entitytype("fixtures", 10, 1000, 0);
entitytypes["fixtures"].billboard = true;
entitytypes["fixtures"].addanimation("lilly", [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16], true);
entitytypes["fixtures"].addanimation("pillar", [0], true);
entitytypes["fixtures"].addanimation("pillar2", [7], true);
entitytypes["fixtures"].addanimation("leftarch", [1], true);
entitytypes["fixtures"].addanimation("rightarch", [2], true);
entitytypes["fixtures"].addanimation("leftarch2", [3], true);
entitytypes["fixtures"].addanimation("rightarch2", [4], true);
entitytypes["fixtures"].addanimation("chest", [5], true);
entitytypes["fixtures"].addanimation("chestmine", [5], true);
entitytypes["fixtures"].addanimation("chestused", [6], true);
entitytypes["fixtures"].addanimation("pondstand", [17], true);
entitytypes["fixtures"].addanimation("statue1", [10], true);
entitytypes["fixtures"].addanimation("pillar3", [18], true);
entitytypes["fixtures"].addanimation("rock", [19], true);
entitytypes["fixtures"].addanimation("stalagmite", [20], true);
entitytypes["fixtureswt"] = new entitytype("fixtures", 10, 1000, 0);
entitytypes["fixtureswt"].billboard = true;
entitytypes["fixtureswt"].addanimation("bush", [8], true);
entitytypes["fixtureswt"].addanimation("leaves", [9], true);
entitytypes["vfx_zones"] = new entitytype("vfx_spellselection", 0, 0, 0);
entitytypes["vfx_zones"].billboard = true;
entitytypes["vfx_zones"].addanimation("vines", [9, 9, 9, 9, 9, 9], true);
entitytypes["vfx_zones"].addanimation("swarm", [0, 0, 0, 0, 0, 0], true);
entitytypes["vfx_zones"].addanimation("heal", [10, 10, 10, 10, 10, 10], true);
entitytypes["vfx_zones"].addanimation("fire", [11, 11, 11, 11, 11, 11], true);
entitytypes["vfx_zones"].addanimation("exit", [20, 20], true);
entitytypes["vfx_selector"] = new entitytype("vfx_selector", 0, 0, 0);
entitytypes["vfx_selector"].billboard = true;
entitytypes["vfx_selector"].addanimation("idle", [0, 0, 0, 0, 0, 0], true);
entitytypes["vfx_selector"].addanimation("grow", [2, 2, 3, 3, 4, 4]);
entitytypes["vfx_selector"].addanimation("grown", [4], true);
entitytypes["vfx_selector"].addanimation("moveto", [2], true);
entitytypes["vfx_selector"].addanimation("smallradius", [1, 1, 1, 1, 1, 1], true);
entitytypes["vfx_selector"].addanimation("blast", [0, 0, 0, 0, 0, 0], true);
entitytypes["vfx_selector"].addanimation("select", [5, 5, 5, 5, 5, 5], true);
entitytypes["vfx_selector"].addanimation("fail", [6, 6, 6, 6, 6, 6], true);
phud = new hud(this);
phud.y = 202;
phud.hudtext.htext.selectable = false;
phud.hudtext.mouseEnabled = false;
phud.hudtext.mouseChildren = false;
phud.mouseEnabled = false;
messagelist = new Array();
initializer = 0;
addEventListener(Event.ENTER_FRAME, frameupdate);
}
public function generateitem(_arg1:entity, _arg2:Number=0, _arg3:Number=0, _arg4:Number=-1){
var _local5:item;
var _local6:*;
var _local7:Array;
var _local8:Number;
var _local9:String;
var _local10:String;
var _local11:String;
var _local12:String;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (_arg4 == 0){
entitylist.push(new entity("prop_loot", entitytypes["prop_loot"], (_arg1.worldx + _arg2), (_arg1.worldy + _arg3), this));
_local5 = new item("weapon", 2, 3, 4, 1, 0);
_local5.isnew = false;
_local5.iicon = 2;
_local5.itemname = "TRAINING SWORD";
_local5.basestat1 = 3;
_local5.basestat2 = 5;
entitylist[(entitylist.length - 1)].attacheditem = _local5;
entitylist[(entitylist.length - 1)].setanim("weapon");
entitylist[(entitylist.length - 1)].attacheditem.iicon = 2;
} else {
_local6 = _arg1.LVL;
if (_arg1.etype == "fixtures"){
_local6 = floor;
};
if (_arg4 == -1){
_arg4 = Math.floor((Math.random() * 1000000));
} else {
_local6 = Math.floor((_arg4 / 1000000));
_arg4 = (_arg4 % 1000000);
};
_local7 = new Array();
_local8 = 0;
_local9 = "";
_local10 = "";
_local11 = "";
_local7.push("weaponsword");
_local7.push("pearls");
_local7.push("armor");
_local7.push("weaponaxe");
_local7.push("helm");
_local7.push("pearls");
_local7.push("boots");
_local7.push("weaponsword");
_local7.push("pearls");
_local7.push("armor");
_local7.push("helm");
_local7.push("boots");
_local7.push("pearls");
_local7.push("ring");
_local7.push("weaponsword");
_local7.push("armor");
_local7.push("weaponaxe");
_local7.push("helm");
_local7.push("boots");
_local7.push("pearls");
_local7.push("weaponstaff");
_local7.push("armor");
_local7.push("pearls");
_local7.push("helm");
_local7.push("boots");
_local7.push("pearls");
_local7.push("ring");
_local12 = _local7[Math.floor((((_arg4 % 173592) / 173592) * _local7.length))];
_local13 = 0;
if (_local12 == "weaponstaff"){
_local13 = 3;
};
entitylist.push(new entity("prop_loot", entitytypes["prop_loot"], (_arg1.worldx + _arg2), (_arg1.worldy + _arg3), this));
if (_local12 == "pearls"){
entitylist[(entitylist.length - 1)].pearls = (_local6 * 100);
_local14 = Math.floor((_local6 / 2));
if (_local14 > 4){
_local14 = 4;
};
entitylist[(entitylist.length - 1)].setanim(("pearls" + _local14));
} else {
entitylist[(entitylist.length - 1)].attacheditem = new item(_local12, 2, 5, 5, _local6, ((_local6 * 1000000) + _arg4));
procedures.setfamily(entitylist[(entitylist.length - 1)].attacheditem, _local6, _arg4);
_local15 = Math.floor((_arg4 / 100000));
if (_local15 < (5 + _local13)){
entitylist[(entitylist.length - 1)].attacheditem.rarity++;
procedures.setproperty(entitylist[(entitylist.length - 1)].attacheditem, (_local6 + _local13), _arg4);
};
if (_local15 < (2 + _local13)){
entitylist[(entitylist.length - 1)].attacheditem.rarity++;
procedures.setproperty(entitylist[(entitylist.length - 1)].attacheditem, (_local6 + _local13), _arg4);
};
entitylist[(entitylist.length - 1)].setanim((("" + _local12) + entitylist[(entitylist.length - 1)].attacheditem.rarity));
};
};
}
private function collidewalls(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = Math.floor((player.worldx / (40 / sqrtof2)));
_local5 = Math.floor((player.worldy / (40 / sqrtof2)));
_local6 = 0;
if (dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + _local4)] == 6){
dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + _local4)] = 10;
falling = true;
} else {
_local6 = 0;
while (_local6 < entitylist.length) {
_local4 = Math.floor((entitylist[_local6].worldx / (40 / sqrtof2)));
_local5 = Math.floor((entitylist[_local6].worldy / (40 / sqrtof2)));
if ((((entitylist[_local6].etype.substr(0, 3) == "mob")) || ((entitylist[_local6].etype.substr(0, 4) == "prop")))){
if (dungeonfloor.tile[(((_local5 - 1) * dungeonfloor.wdth) + _local4)] <= 0){
if (((entitylist[_local6].worldy / (40 / sqrtof2)) - Math.floor((entitylist[_local6].worldy / (40 / sqrtof2)))) < 0.25){
entitylist[_local6].worldy = ((Math.floor((entitylist[_local6].worldy / (40 / sqrtof2))) + 0.25) * (40 / sqrtof2));
entitylist[_local6].wyv = -(entitylist[_local6].wyv);
};
};
if (dungeonfloor.tile[(((_local5 + 1) * dungeonfloor.wdth) + _local4)] <= 0){
if (((entitylist[_local6].worldy / (40 / sqrtof2)) - Math.floor((entitylist[_local6].worldy / (40 / sqrtof2)))) > 0.75){
entitylist[_local6].worldy = ((Math.floor((entitylist[_local6].worldy / (40 / sqrtof2))) + 0.75) * (40 / sqrtof2));
entitylist[_local6].wyv = -(entitylist[_local6].wyv);
};
};
if (dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + (_local4 - 1))] <= 0){
if (((entitylist[_local6].worldx / (40 / sqrtof2)) - Math.floor((entitylist[_local6].worldx / (40 / sqrtof2)))) < 0.25){
entitylist[_local6].worldx = ((Math.floor((entitylist[_local6].worldx / (40 / sqrtof2))) + 0.25) * (40 / sqrtof2));
entitylist[_local6].wxv = -(entitylist[_local6].wxv);
};
};
if (dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + (_local4 + 1))] <= 0){
if (((entitylist[_local6].worldx / (40 / sqrtof2)) - Math.floor((entitylist[_local6].worldx / (40 / sqrtof2)))) > 0.75){
entitylist[_local6].worldx = ((Math.floor((entitylist[_local6].worldx / (40 / sqrtof2))) + 0.75) * (40 / sqrtof2));
entitylist[_local6].wxv = -(entitylist[_local6].wxv);
};
};
if ((((((dungeonfloor.tile[(((_local5 - 1) * dungeonfloor.wdth) + _local4)] > 0)) && ((dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + (_local4 + 1))] > 0)))) && ((dungeonfloor.tile[(((_local5 - 1) * dungeonfloor.wdth) + (_local4 + 1))] <= 0)))){
_local2 = (entitylist[_local6].worldx - ((_local4 + 1) * (40 / sqrtof2)));
_local3 = (entitylist[_local6].worldy - (_local5 * (40 / sqrtof2)));
_local1 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (_local1 < ((40 / sqrtof2) / 4)){
entitylist[_local6].worldx = (entitylist[_local6].worldx + ((_local2 / _local1) * (((40 / sqrtof2) / 4) - _local1)));
entitylist[_local6].worldy = (entitylist[_local6].worldy + ((_local3 / _local1) * (((40 / sqrtof2) / 4) - _local1)));
entitylist[_local6].wxv = -(entitylist[_local6].wxv);
entitylist[_local6].wyv = -(entitylist[_local6].wyv);
};
};
if ((((((dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + (_local4 + 1))] > 0)) && ((dungeonfloor.tile[(((_local5 + 1) * dungeonfloor.wdth) + _local4)] > 0)))) && ((dungeonfloor.tile[(((_local5 + 1) * dungeonfloor.wdth) + (_local4 + 1))] <= 0)))){
_local2 = (entitylist[_local6].worldx - ((_local4 + 1) * (40 / sqrtof2)));
_local3 = (entitylist[_local6].worldy - ((_local5 + 1) * (40 / sqrtof2)));
_local1 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (_local1 < ((40 / sqrtof2) / 4)){
entitylist[_local6].worldx = (entitylist[_local6].worldx + ((_local2 / _local1) * (((40 / sqrtof2) / 4) - _local1)));
entitylist[_local6].worldy = (entitylist[_local6].worldy + ((_local3 / _local1) * (((40 / sqrtof2) / 4) - _local1)));
entitylist[_local6].wxv = -(entitylist[_local6].wxv);
entitylist[_local6].wyv = -(entitylist[_local6].wyv);
};
};
if ((((((dungeonfloor.tile[(((_local5 + 1) * dungeonfloor.wdth) + _local4)] > 0)) && ((dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + (_local4 - 1))] > 0)))) && ((dungeonfloor.tile[(((_local5 + 1) * dungeonfloor.wdth) + (_local4 - 1))] <= 0)))){
_local2 = (entitylist[_local6].worldx - (_local4 * (40 / sqrtof2)));
_local3 = (entitylist[_local6].worldy - ((_local5 + 1) * (40 / sqrtof2)));
_local1 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (_local1 < ((40 / sqrtof2) / 4)){
entitylist[_local6].worldx = (entitylist[_local6].worldx + ((_local2 / _local1) * (((40 / sqrtof2) / 4) - _local1)));
entitylist[_local6].worldy = (entitylist[_local6].worldy + ((_local3 / _local1) * (((40 / sqrtof2) / 4) - _local1)));
entitylist[_local6].wxv = -(entitylist[_local6].wxv);
entitylist[_local6].wyv = -(entitylist[_local6].wyv);
};
};
if ((((((dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + (_local4 - 1))] > 0)) && ((dungeonfloor.tile[(((_local5 - 1) * dungeonfloor.wdth) + _local4)] > 0)))) && ((dungeonfloor.tile[(((_local5 - 1) * dungeonfloor.wdth) + (_local4 - 1))] <= 0)))){
_local2 = (entitylist[_local6].worldx - (_local4 * (40 / sqrtof2)));
_local3 = (entitylist[_local6].worldy - (_local5 * (40 / sqrtof2)));
_local1 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
if (_local1 < ((40 / sqrtof2) / 4)){
entitylist[_local6].worldx = (entitylist[_local6].worldx + ((_local2 / _local1) * (((40 / sqrtof2) / 4) - _local1)));
entitylist[_local6].worldy = (entitylist[_local6].worldy + ((_local3 / _local1) * (((40 / sqrtof2) / 4) - _local1)));
entitylist[_local6].wxv = -(entitylist[_local6].wxv);
entitylist[_local6].wyv = -(entitylist[_local6].wyv);
};
};
if (dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + _local4)] <= 0){
_local2 = ((entitylist[_local6].worldx % (40 / sqrtof2)) - ((40 / sqrtof2) / 2));
_local3 = ((entitylist[_local6].worldy % (40 / sqrtof2)) - ((40 / sqrtof2) / 2));
if (Math.abs(_local2) > Math.abs(_local3)){
if (_local2 > 0){
if (dungeonfloor.tile[(((_local5 * dungeonfloor.wdth) + _local4) + 1)] <= 0){
if (_local3 > 0){
entitylist[_local6].worldy = (Math.floor(((entitylist[_local6].worldy / (40 / sqrtof2)) + 1)) * (40 / sqrtof2));
} else {
entitylist[_local6].worldy = ((Math.floor((entitylist[_local6].worldy / (40 / sqrtof2))) * (40 / sqrtof2)) - 1);
};
} else {
entitylist[_local6].worldx = (Math.floor(((entitylist[_local6].worldx / (40 / sqrtof2)) + 1)) * (40 / sqrtof2));
};
} else {
if (dungeonfloor.tile[(((_local5 * dungeonfloor.wdth) + _local4) - 1)] <= 0){
if (_local3 > 0){
entitylist[_local6].worldy = (Math.floor(((entitylist[_local6].worldy / (40 / sqrtof2)) + 1)) * (40 / sqrtof2));
} else {
entitylist[_local6].worldy = ((Math.floor((entitylist[_local6].worldy / (40 / sqrtof2))) * (40 / sqrtof2)) - 1);
};
} else {
entitylist[_local6].worldx = ((Math.floor((entitylist[_local6].worldx / (40 / sqrtof2))) * (40 / sqrtof2)) - 1);
};
};
} else {
if (_local3 > 0){
if (dungeonfloor.tile[(((_local5 + 1) * dungeonfloor.wdth) + _local4)] <= 0){
if (_local2 > 0){
entitylist[_local6].worldx = (Math.floor(((entitylist[_local6].worldx / (40 / sqrtof2)) + 1)) * (40 / sqrtof2));
} else {
entitylist[_local6].worldx = ((Math.floor((entitylist[_local6].worldx / (40 / sqrtof2))) * (40 / sqrtof2)) - 1);
};
} else {
entitylist[_local6].worldy = (Math.floor(((entitylist[_local6].worldy / (40 / sqrtof2)) + 1)) * (40 / sqrtof2));
};
} else {
if (dungeonfloor.tile[(((_local5 - 1) * dungeonfloor.wdth) + _local4)] <= 0){
if (_local2 > 0){
entitylist[_local6].worldx = (Math.floor(((entitylist[_local6].worldx / (40 / sqrtof2)) + 1)) * (40 / sqrtof2));
} else {
entitylist[_local6].worldx = ((Math.floor((entitylist[_local6].worldx / (40 / sqrtof2))) * (40 / sqrtof2)) - 1);
};
} else {
entitylist[_local6].worldy = ((Math.floor((entitylist[_local6].worldy / (40 / sqrtof2))) * (40 / sqrtof2)) - 1);
};
};
};
};
} else {
if (((!((entitylist[_local6] == selector))) && (!((entitylist[_local6].etype == "fixtures"))))){
if (dungeonfloor.tile[((_local5 * dungeonfloor.wdth) + _local4)] <= 0){
entitylist[_local6].dead = true;
};
};
};
_local6++;
};
};
}
private function getplayerinput(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:entity;
_local1 = 0;
_local2 = 0;
if (controls == "setupA"){
if (((!((ptarget == null))) && ((gamestate == "running")))){
if (ptarget.dead){
ptarget = null;
} else {
_local2 = Math.sqrt((((player.worldx - ptarget.worldx) * (player.worldx - ptarget.worldx)) + ((player.worldy - ptarget.worldy) * (player.worldy - ptarget.worldy))));
if (_local2 < ((player.entitytemplate.size + ptarget.entitytemplate.size) + 5)){
if (ptarget.etype == "prop_loot"){
if (ptarget.pearls > 0){
wealth = (wealth + ptarget.pearls);
ptarget.dead = true;
} else {
_local3 = -1;
_local4 = 0;
while (_local4 < 32) {
if (itemlist[(6 + _local4)] == null){
_local3 = (_local4 + 6);
_local4 = 1000;
};
_local4++;
};
if (_local3 != -1){
newstuff = true;
ptarget.dead = true;
itemlist[_local3] = ptarget.attacheditem;
} else {
ptarget.tworldx = ((Math.random() * 10) - 5);
ptarget.tworldy = ((Math.random() * 10) - 5);
ptarget.wev = 5;
ptarget = null;
};
};
player.setanim("idle");
} else {
if (ptarget.etype == "fixtures"){
if (ptarget.canim.tag == "chest"){
_local5 = 0;
while (_local5 < 4) {
generateitem(ptarget);
entitylist[(entitylist.length - 1)].wev = 5;
entitylist[(entitylist.length - 1)].wxv = ((3 + (Math.random() * 2)) * Math.cos(((Math.random() * Math.PI) * 2)));
entitylist[(entitylist.length - 1)].wyv = ((3 + (Math.random() * 2)) * Math.sin(((Math.random() * Math.PI) * 2)));
_local5++;
};
};
ptarget.setanim("chestused");
ptarget = null;
} else {
if (((!((itemlist[3] == null))) && (!((player.canim.tag == "attack"))))){
hasattacked = true;
myroot.sounds.playsound(("whack" + (Math.floor((Math.random() * 3)) + 1)), 0, 0.8);
ptargeted = ptarget;
if (ptargeted.charmed == 0){
player.aim((ptarget.worldx - player.worldx), (ptarget.worldy - player.worldy));
player.setanim("attack");
} else {
player.setanim("idle");
};
};
};
};
} else {
if (player.canim.tag != "attack"){
_local1 = Math.atan2((ptarget.screeny * 2), ptarget.screenx);
_local1 = (_local1 + (Math.PI / 4));
player.move((player.entitytemplate.speed * Math.cos(_local1)), (player.entitytemplate.speed * Math.sin(_local1)));
distancetraveled = (distancetraveled + player.entitytemplate.speed);
};
};
};
};
if (gamestate == "prep_input"){
ii = 0;
while (ii < entitylist.length) {
if (entitylist[ii].etype == "vfx_selection"){
entitylist[ii].dead = true;
};
ii++;
};
gamestate = "waiting_input";
};
if (gamestate != "statup"){
if (gamestate != "waiting_input"){
if (clicked == player){
hasmoved = true;
ptarget = null;
player.moving = true;
player.tworldx = (player.worldx + (((mouseX / 2) - mouseY) / sqrtof2));
player.tworldy = (player.worldy + ((mouseY + (mouseX / 2)) / sqrtof2));
if (player.canim.tag != "run"){
player.setanim("run");
};
selector.worldx = player.tworldx;
selector.worldy = player.tworldy;
selector.setanim("moveto");
if (!mouseclick){
clicked = null;
};
};
if (((!((clicked == null))) && (!((clicked == player))))){
selector.setanim("grow");
ptarget = clicked;
player.moving = false;
clicked = null;
};
} else {
if (clicked != null){
_local6 = false;
if (selector.canim.tag == "smallradius"){
if (los(player, selector)){
procedures.proc(player, selectedspell.sproc, 0, selectedspell.scost, selector);
_local6 = true;
};
};
if (selector.canim.tag == "select"){
if (ptarget != null){
if (ptarget.etype.substr(0, 3) == "mob"){
if (los(player, ptarget)){
procedures.proc(player, selectedspell.sproc, player.INT, selectedspell.scost, ptarget);
_local6 = true;
};
};
};
};
if (selector.canim.tag == "blast"){
procedures.proc(player, selectedspell.sproc, 0, selectedspell.scost, selector);
_local6 = true;
};
if (_local6){
selector.setanim("idle");
selectedspell = null;
clicked = null;
gamestate = "running";
phud.cancelbar.gotoAndStop(1);
} else {
clicked = null;
};
} else {
if (selectedspell != null){
selector.setanim(selectedspell.stype);
if (selector.canim.tag == "select"){
_local7 = pickentity(mouseX, mouseY);
if (((!((_local7 == null))) && (los(player, _local7)))){
if (_local7.etype.substr(0, 3) == "mob"){
ptarget = _local7;
selector.worldx = ptarget.worldx;
selector.worldy = ptarget.worldy;
} else {
ptarget = null;
selector.worldx = (player.worldx + (((mouseX / 2) - mouseY) / sqrtof2));
selector.worldy = (player.worldy + ((mouseY + (mouseX / 2)) / sqrtof2));
selector.setanim("fail");
};
} else {
ptarget = null;
selector.worldx = (player.worldx + (((mouseX / 2) - mouseY) / sqrtof2));
selector.worldy = (player.worldy + ((mouseY + (mouseX / 2)) / sqrtof2));
selector.setanim("fail");
};
mouseclick = true;
} else {
if (selector.canim.tag == "blast"){
selector.worldx = player.worldx;
selector.worldy = player.worldy;
} else {
selector.worldx = (player.worldx + (((mouseX / 2) - mouseY) / sqrtof2));
selector.worldy = (player.worldy + ((mouseY + (mouseX / 2)) / sqrtof2));
if (los(player, selector)){
selector.setanim("smallradius");
} else {
selector.setanim("fail");
};
};
};
};
};
};
};
};
}
public function destroysummons(){
var _local1:Number;
_local1 = 0;
_local1 = 0;
while (_local1 < entitylist.length) {
if (entitylist[_local1].charmed == 1000){
entitylist[_local1].hp = 0;
};
_local1++;
};
}
public function die(){
removeEventListener(Event.ENTER_FRAME, frameupdate);
myroot.removeEventListener(KeyboardEvent.KEY_DOWN, keypressed);
clickgrabber.removeEventListener(MouseEvent.MOUSE_DOWN, mousepressed);
myroot.removeEventListener(MouseEvent.MOUSE_UP, mousereleased);
}
public function lospoint(_arg1:entity, _arg2:Number, _arg3:Number){
if (_arg1){
return (lospointpoint(_arg1.worldx, _arg1.worldy, _arg2, _arg3));
};
return (false);
}
public function frameupdate(_arg1:Event){
var _local2:*;
var _local3:Number;
var _local4:ColorTransform;
var _local5:ColorTransform;
var _local6:ColorTransform;
var _local7:ColorTransform;
if (!initialized){
init();
} else {
if (gamestate == "create"){
newchar.updatehud();
} else {
if (((((!((gamestate == "score"))) && (!((gamestate == "restart"))))) && (!((gamestate == "mainmenu"))))){
if (xp >= ((player.LVL * 100) * 20)){
xp = (xp - ((player.LVL * 100) * 20));
player.LVL++;
player.hp = (player.hp + 1000000);
statpoints = (statpoints + 4);
};
if (!dinitialized){
initdungeon();
} else {
phud.updatehud();
if (player.hp > 0){
getplayerinput();
};
updateentities();
if (gamestate == "running"){
if (myroot.sounds.vmusicvolume > 0.2){
myroot.sounds.vmusicvolume = (myroot.sounds.vmusicvolume - 0.001);
};
if (falling){
if (player.elev < -50){
phud.rip.gotoAndStop(3);
falling = false;
_local3 = 0;
do {
if (((!((entitylist[_local3] == player))) && (!((entitylist[_local3] == selector))))){
if (ptarget == entitylist[_local3]){
ptarget = null;
};
entitylist.splice(_local3, 1);
} else {
_local3++;
};
} while (_local3 < entitylist.length);
floor++;
dinitialized = false;
initializer = 1;
player.elev = 30;
player.wev = 0;
};
} else {
if (player.elev > 18){
phud.rip.gotoAndStop(1);
};
};
if (magicfind > 40){
magicfind--;
};
if (magicfind > 60){
magicfind = 60;
};
if (savedptarget != null){
ptarget = savedptarget;
savedptarget = null;
};
collideentities();
collidewalls();
collidewalls();
};
camx = player.worldx;
camy = player.worldy;
worldtoscreenentities();
drawground("under");
drawground("over");
cleanentities();
updatemessages();
if (gamestate == "rip"){
blit.zerosurface(grounddata);
phud.rip.gotoAndStop(2);
gamestate = "score";
myroot.addChild(myroot.agi);
myroot.agi.showScoreboardSubmit(wealth);
getaward();
};
_local2 = (player.hp / player.maxhp);
if ((((_local2 < 0.25)) && ((player.hp > 0)))){
_local4 = this.transform.colorTransform;
_local4.redMultiplier = 1;
_local4.greenMultiplier = (0.5 + (_local2 * 2));
_local4.blueMultiplier = (0.5 + (_local2 * 2));
this.transform.colorTransform = _local4;
} else {
if (player.hp > 0){
_local5 = this.transform.colorTransform;
_local5.redMultiplier = 1;
_local5.greenMultiplier = 1;
_local5.blueMultiplier = 1;
this.transform.colorTransform = _local5;
};
};
};
if (gamestate == "running"){
if (!hasmoved){
phud.tooltip.visible = true;
phud.tooltip.tooltext.text = "Click the ground anywhere to move.";
} else {
if (!hasattacked){
phud.tooltip.visible = true;
phud.tooltip.tooltext.text = "Click on an enemy to attack. You will continue attacking until you click elsewhere.";
} else {
phud.tooltip.visible = false;
};
};
};
};
};
if (gamestate == "score"){
phud.tooltip.visible = false;
_local6 = this.transform.colorTransform;
this.transform.colorTransform.redMultiplier = (((_local6.redMultiplier * 8) + 1) / 9);
_local6.greenMultiplier = (((_local6.greenMultiplier * 9) + 1) / 10);
_local6.blueMultiplier = (((_local6.blueMultiplier * 9) + 1) / 10);
this.transform.colorTransform = _local6;
if (phud.rip.getChildByName("cname") != null){
if (titles[award] == null){
phud.rip.award.visible = false;
} else {
phud.rip.award.visible = true;
phud.rip.award.awardtext.text = titles[award];
};
phud.rip.cname.htmlText = playername;
phud.rip.clevel.htmlText = ((((("Who was, in life, a level " + player.LVL) + " ") + player.entitytemplate.race) + " ") + player.entitytemplate.cclass);
phud.rip.ctitles.htmlText = titletext;
if (wealth > 0){
phud.rip.wealth.htmlText = (("whose wealth exceeded " + phud.prettynumber(wealth)) + " Mana Pearls");
} else {
phud.rip.wealth.htmlText = "who sadly had no wealth";
};
};
};
if (gamestate == "restart"){
_local7 = this.transform.colorTransform;
_local7.redMultiplier = 1;
_local7.greenMultiplier = 1;
_local7.blueMultiplier = 1;
this.transform.colorTransform = _local7;
zero();
};
};
}
public function zero(){
var _local1:Number;
kicked = false;
kills = 0;
damagetaken = 0;
skeletonkills = 0;
currentattacking = 0;
mostattacking = 0;
distancetraveled = 0;
messagelist.splice(0, messagelist.length);
phud.rip.gotoAndStop(1);
phud.inventory.gotoAndStop(1);
blit.zerosurface(grounddata);
wealth = 0;
_local1 = 0;
gamestate = "mainmenu";
floor = 1;
xp = 0;
racespells.splice(0, racespells.length);
classspells.splice(0, classspells.length);
ptarget = null;
player.tworldx = 0;
player.tworldy = 0;
player.moving = false;
_local1 = 0;
while (_local1 < 38) {
itemlist[_local1] = null;
_local1++;
};
_local1 = 0;
while (_local1 < 8) {
quickbar.push(-1);
_local1++;
};
_local1 = 0;
while (_local1 < 21) {
activetitles.push(false);
_local1++;
};
entitylist.splice(0, entitylist.length);
screenentitylist.splice(0, screenentitylist.length);
entitylist.push(new entity("mob_pc", entitytypes["mob_pc"], (50 * (40 / sqrtof2)), (50 * (40 / sqrtof2)), this));
player = entitylist[(entitylist.length - 1)];
entitylist.push(new entity("vfx_selector", entitytypes["vfx_selector"], -1000, 0, this));
selector = entitylist[(entitylist.length - 1)];
initializer = 0;
dinitialized = false;
clickgrabber.removeEventListener(MouseEvent.MOUSE_DOWN, mousepressed);
myroot.removeEventListener(MouseEvent.MOUSE_UP, mousereleased);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keypressed);
phud.die();
newchar = new charcreate(this);
addChild(newchar);
setChildIndex(newchar, (numChildren - 1));
myroot.gotoAndStop("mainmenu");
myroot.sounds.stopmusic();
myroot.sounds.musicsequence("1");
myroot.sounds.playmusic();
}
public function getaward(){
var _local1:Number;
var _local2:Number;
_local1 = 0;
_local2 = 0;
while (_local2 < 32) {
if (itemlist[(_local2 + 6)] != null){
_local1++;
};
_local2++;
};
trace((floor + " floor"));
trace((_local1 + " items in inventory"));
trace((damagetaken + " damage taken"));
trace((kills + " kills"));
trace((distancetraveled + " distance traveled"));
trace((mostattacking + " enemies fought at once"));
trace((skeletonkills + " skeletons killed"));
if ((((((((myroot.titles[0] == false)) && ((itemlist[0] == null)))) && ((itemlist[1] == null)))) && ((itemlist[4] == null)))){
award = 0;
};
if (myroot.titles[1] == false){
award = 1;
};
if ((((myroot.titles[2] == false)) && ((_local1 == 0)))){
award = 2;
};
if ((((myroot.titles[3] == false)) && ((floor == 1)))){
award = 3;
};
if ((((myroot.titles[4] == false)) && ((kills >= 1)))){
award = 4;
};
if ((((myroot.titles[5] == false)) && ((_local1 >= 32)))){
award = 5;
};
if ((((myroot.titles[6] == false)) && ((floor >= 2)))){
award = 6;
};
if ((((myroot.titles[7] == false)) && ((distancetraveled >= 5000)))){
award = 7;
};
if ((((myroot.titles[8] == false)) && ((damagetaken >= 5000)))){
award = 8;
};
if ((((myroot.titles[9] == false)) && ((mostattacking >= 5)))){
award = 9;
};
if ((((myroot.titles[10] == false)) && ((mostattacking >= 10)))){
award = 10;
};
if ((((myroot.titles[11] == false)) && ((kills >= 20)))){
award = 11;
};
if ((((myroot.titles[12] == false)) && ((skeletonkills >= 20)))){
award = 12;
};
if ((((myroot.titles[13] == false)) && ((player.STR >= 30)))){
award = 13;
};
if ((((myroot.titles[14] == false)) && ((player.CON >= 30)))){
award = 14;
};
if ((((myroot.titles[15] == false)) && ((player.WILL >= 30)))){
award = 15;
};
if ((((myroot.titles[16] == false)) && ((player.INT >= 30)))){
award = 16;
};
if ((((myroot.titles[17] == false)) && ((damagetaken >= 10000)))){
award = 17;
};
if ((((myroot.titles[18] == false)) && ((floor >= 5)))){
award = 18;
};
if ((((myroot.titles[19] == false)) && ((player.LVL >= 5)))){
award = 19;
};
if ((((myroot.titles[20] == false)) && ((distancetraveled >= 10000)))){
award = 20;
};
if ((((myroot.titles[21] == false)) && ((damagetaken >= 20000)))){
award = 21;
};
if ((((myroot.titles[23] == false)) && ((player.LVL >= 10)))){
award = 23;
};
if ((((myroot.titles[24] == false)) && ((player.STR >= 50)))){
award = 24;
};
if ((((myroot.titles[25] == false)) && ((player.CON >= 50)))){
award = 25;
};
if ((((myroot.titles[26] == false)) && ((player.WILL >= 50)))){
award = 26;
};
if ((((myroot.titles[27] == false)) && ((player.INT >= 50)))){
award = 27;
};
if ((((myroot.titles[28] == false)) && ((kills >= 100)))){
award = 28;
};
if ((((myroot.titles[29] == false)) && ((skeletonkills >= 50)))){
award = 29;
};
if ((((myroot.titles[22] == false)) && ((floor >= 10)))){
award = 22;
};
if ((((myroot.titles[30] == false)) && ((player.LVL >= 15)))){
award = 30;
};
if ((((myroot.titles[31] == false)) && ((kills >= 200)))){
award = 31;
};
myroot.titles[award] = true;
myroot.saveobject.data.titles = myroot.titles;
myroot.saveobject.flush();
}
private function drawentities(){
var _local1:Number;
_local1 = 0;
_local1 = 0;
while (_local1 < screenentitylist.length) {
screenentitylist[_local1].stamp(grounddata);
_local1++;
};
}
public function init(){
var _local1:entitytype;
if (!myroot.initialized){
myroot.init();
};
for each (_local1 in entitytypes) {
_local1.initialize();
};
entitylist.push(new entity("mob_pc", entitytypes["mob_pc"], (50 * (40 / sqrtof2)), (50 * (40 / sqrtof2)), this));
player = entitylist[(entitylist.length - 1)];
entitylist.push(new entity("vfx_selector", entitytypes["vfx_selector"], -1000, 0, this));
selector = entitylist[(entitylist.length - 1)];
minimap = new MovieClip();
minimap.x = ((-(screenwidth) / 2) + 100);
minimap.y = ((-(screenheight) / 2) + 60);
minimap.scaleX = 2;
minimap.mouseEnabled = false;
minimap.mouseChildren = false;
addChild(minimap);
addChild(phud);
youarehere = new minimapyou();
dungeonfloor = new dungeon(this);
minimap.addChild(dungeonfloor.debugbmp);
minimap.addChild(youarehere);
dungeonfloor.debugbmp.x = (-50 * sqrtof2);
dungeonfloor.debugbmp.y = 0;
dungeonfloor.debugbmp.rotation = -45;
newchar = new charcreate(this);
addChild(newchar);
initialized = true;
}
private function cleanentities(){
var _local1:Number;
_local1 = 0;
do {
if (entitylist[_local1].dead){
if (ptarget == entitylist[_local1]){
ptarget = null;
selector.setanim("idle");
};
entitylist[_local1].ctarget = null;
entitylist[_local1].totarget = null;
entitylist.splice(_local1, 1);
} else {
_local1++;
};
} while (_local1 < entitylist.length);
}
public function clearplayerinput(){
ii = 0;
while (ii < entitylist.length) {
if (entitylist[ii].etype == "vfx_selection"){
entitylist[ii].dead = true;
};
ii++;
};
ii = 0;
while (ii < entitylist.length) {
if (entitylist[ii].etype == "vfx_spellselection"){
entitylist[ii].dead = true;
};
ii++;
};
clicked = null;
gamestate = "running";
}
public function keypressed(_arg1:KeyboardEvent){
if (gamestate == "running"){
if (_arg1.keyCode == 49){
phud.castspell(0);
};
if (_arg1.keyCode == 50){
phud.castspell(1);
};
if (_arg1.keyCode == 51){
phud.castspell(2);
};
if (_arg1.keyCode == 52){
phud.castspell(3);
};
if (_arg1.keyCode == 53){
phud.castspell(4);
};
if (_arg1.keyCode == 54){
phud.castspell(5);
};
if (_arg1.keyCode == 55){
phud.castspell(6);
};
if (_arg1.keyCode == 56){
phud.castspell(7);
};
};
}
private function updatemessages(){
var _local1:Number;
_local1 = 0;
if (messagelist.length > 6){
while (messagelist.length > 6) {
messagelist.splice(0, 1);
};
};
phud.hudtext.htext.htmlText = "";
_local1 = 0;
while (_local1 < messagelist.length) {
phud.hudtext.htext.htmlText = (phud.hudtext.htext.htmlText + messagelist[_local1]);
phud.hudtext.htext.htmlText = (phud.hudtext.htext.htmlText + "</br>");
_local1++;
};
}
private function worldtoscreenentities(){
var _local1:Number;
var _local2:Number;
_local1 = 0;
_local2 = 0;
_local1 = 0;
while (_local1 < entitylist.length) {
if ((((((entitylist[_local1].etype == "vfx_selection")) || ((entitylist[_local1].etype == "vfx_spellselection")))) || ((gamestate == "running")))){
entitylist[_local1].worldtoscreen();
};
_local1++;
};
}
public function mousereleased(_arg1:MouseEvent){
mouseclick = false;
}
private function pickentity(_arg1:Number, _arg2:Number):entity{
var _local3:Array;
var _local4:entity;
var _local5:Number;
var _local6:Number;
_local3 = new Array();
_local4 = null;
_local5 = 0;
_local5 = 0;
while (_local5 < screenentitylist.length) {
if (((!((screenentitylist[_local5] == player))) && ((((((screenentitylist[_local5].etype.substr(0, 3) == "mob")) || ((screenentitylist[_local5].etype == "prop_loot")))) || ((((screenentitylist[_local5].etype == "fixtures")) && ((((screenentitylist[_local5].canim.tag == "chest")) || ((screenentitylist[_local5].canim.tag == "chestmine")))))))))){
if (screenentitylist[_local5].charmed == 0){
if ((((((((_arg1 > (screenentitylist[_local5].screenx - (screenentitylist[_local5].entitytemplate.size * 3)))) && ((_arg1 < (screenentitylist[_local5].screenx + (screenentitylist[_local5].entitytemplate.size * 3)))))) && ((_arg2 > (screenentitylist[_local5].screeny - (screenentitylist[_local5].entitytemplate.size * 5)))))) && ((_arg2 < (screenentitylist[_local5].screeny + screenentitylist[_local5].entitytemplate.size))))){
_local3.push(screenentitylist[_local5]);
};
};
};
_local5++;
};
_local6 = -1000;
_local5 = 0;
while (_local5 < _local3.length) {
if (_local3[_local5].screeny > _local6){
_local6 = _local3[_local5].screeny;
_local4 = _local3[_local5];
};
_local5++;
};
return (_local4);
}
public function los(_arg1:entity, _arg2:entity):Boolean{
if (((_arg1) && (_arg2))){
return (lospointpoint(_arg1.worldx, _arg1.worldy, _arg2.worldx, _arg2.worldy));
};
return (false);
}
public function lospointpoint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local5 = true;
_local6 = 0;
_local7 = 0;
_local8 = (_arg1 / (40 / sqrtof2));
_local9 = (_arg2 / (40 / sqrtof2));
_local10 = (_arg3 / (40 / sqrtof2));
_local11 = (_arg4 / (40 / sqrtof2));
_local12 = 0;
if (_local10 == _local8){
if (_local11 < _local9){
_local12 = _local9;
_local9 = _local11;
_local11 = _local12;
};
if (_local11 != _local9){
_local6 = Math.floor(_local9);
while (_local6 <= Math.ceil(_local11)) {
if (dungeonfloor.tile[(((_local9 + _local6) * dungeonfloor.wdth) + _local8)] <= 0){
_local5 = false;
};
_local6++;
};
} else {
trace("los calc detected from and to the same location");
};
} else {
if (_local10 < _local8){
_local12 = _local8;
_local8 = _local10;
_local10 = _local12;
_local12 = _local9;
_local9 = _local11;
_local11 = _local12;
};
_local13 = ((_local11 - _local9) / (_local10 - _local8));
_local14 = (_local9 - (_local8 * _local13));
_local15 = 0;
_local16 = 0;
_local6 = Math.floor(_local8);
while (_local6 < (Math.floor(_local10) + 1)) {
_local15 = ((_local6 * _local13) + _local14);
_local16 = (((_local6 + 1) * _local13) + _local14);
if ((((((_local9 < _local11)) && ((_local15 < _local9)))) || ((((_local9 > _local11)) && ((_local15 > _local9)))))){
_local15 = _local9;
};
if ((((((_local11 < _local9)) && ((_local16 < _local11)))) || ((((_local11 > _local9)) && ((_local16 > _local11)))))){
_local16 = _local11;
};
if (_local15 > _local16){
_local12 = _local16;
_local16 = _local15;
_local15 = _local12;
};
_local7 = Math.floor(_local15);
while (_local7 < (Math.floor(_local16) + 1)) {
if (dungeonfloor.tile[((_local7 * dungeonfloor.wdth) + _local6)] <= 0){
_local5 = false;
};
_local7++;
};
_local6++;
};
};
return (_local5);
}
private function updateentities(){
var _local1:Number;
var _local2:Number;
var _local3:entitytype;
var _local4:ColorTransform;
wasattacking = currentattacking;
currentattacking = 0;
if (((((selector.dead) || (!(selector)))) || ((selector == null)))){
entitylist.push(new entity("vfx_selector", entitytypes["vfx_selector"], -1000, 0, this));
selector = entitylist[(entitylist.length - 1)];
};
if (ptarget != null){
selector.worldx = ptarget.worldx;
selector.worldy = ptarget.worldy;
};
_local1 = 0;
_local2 = 0;
for each (_local3 in entitytypes) {
if (!_local3.initialized){
_local3.initialize();
};
};
screenentitylist.splice(0, screenentitylist.length);
_local1 = 0;
while (_local1 < entitylist.length) {
if ((((entitylist[_local1].etype.substr(0, 3) == "mob")) && (!((entitylist[_local1].etype == "mob_pc"))))){
if (entitylist[_local1].brain.FSMstate != "watchful"){
currentattacking++;
};
};
entitylist[_local1].statupdate();
if ((((((((entitylist[_local1].etype == "vfx_selector")) || ((entitylist[_local1].etype == "vfx_selection")))) || ((entitylist[_local1].etype == "vfx_spellselection")))) || ((gamestate == "running")))){
entitylist[_local1].frameupdate();
};
if (entitylist[_local1].onscreen){
_local2 = 0;
while (_local2 < screenentitylist.length) {
if (entitylist[_local1].depth < screenentitylist[_local2].depth){
break;
} else {
_local2++;
};
};
screenentitylist.splice(_local2, 0, entitylist[_local1]);
};
_local1++;
};
if (currentattacking > mostattacking){
mostattacking = currentattacking;
};
if (player.hp <= 0){
if (((!((player.canim.tag == "die"))) && (!((player.canim.tag == "dead"))))){
player.setanim("die");
};
player.moving = false;
_local4 = this.transform.colorTransform;
this.transform.colorTransform.redMultiplier = (_local4.redMultiplier * 0.95);
_local4.greenMultiplier = (_local4.greenMultiplier * 0.8);
_local4.blueMultiplier = (_local4.blueMultiplier * 0.8);
this.transform.colorTransform = _local4;
if (_local4.redMultiplier <= 0.1){
gamestate = "rip";
};
};
}
public function initdungeon(){
var _local1:Number;
var _local2:Boolean;
var _local3:String;
var _local4:Number;
_local1 = 0;
if (initializer == 0){
itemlist[3] = new item("weapon", 2, 3, 4, 1, 0);
itemlist[3].isnew = false;
itemlist[3].iicon = 2;
itemlist[3].itemname = "TRAINING SWORD";
itemlist[3].basestat1 = 3;
itemlist[3].basestat2 = 5;
initializer++;
} else {
if (initializer == 1){
clickgrabber.addEventListener(MouseEvent.MOUSE_DOWN, mousepressed);
myroot.addEventListener(MouseEvent.MOUSE_UP, mousereleased);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keypressed);
phud.wakeup();
player.setanim("idle");
dungeonfloor.newmap(100, 100);
if (dungeonfloor.createrooms(7)){
initializer++;
} else {
trace("ROOM CREATION ERROR... RETRYING");
};
} else {
if (initializer == 2){
dungeonfloor.carveout();
initializer++;
} else {
if (initializer == 3){
if (dungeonfloor.carvehalls(7)){
initializer++;
} else {
trace("HALL CARVING ERROR... RETRYING");
};
} else {
if (initializer == 4){
dungeonfloor.finishlevel(7);
if (floor == 1){
_local2 = true;
while (_local2) {
generateitem(player, 40, 30);
if (entitylist[(entitylist.length - 1)].pearls == 0){
_local2 = false;
} else {
entitylist[(entitylist.length - 1)].dead = true;
};
};
if (kicked){
_local1 = 0;
while (_local1 < 6) {
_local3 = "wildcard";
if (_local1 == 0){
_local3 = "weapon";
};
if (_local1 == 1){
_local3 = "armor";
};
if (_local1 == 2){
_local3 = "helm";
};
if (_local1 == 3){
_local3 = "boots";
};
if (_local1 == 4){
_local3 = "ring";
};
_local2 = true;
while (_local2) {
_local4 = (30 + (Math.random() * 20));
generateitem(player, (_local4 * Math.cos(((_local1 * 0.5) + 5))), (_local4 * Math.sin(((_local1 * 0.5) + 5))));
if ((((((entitylist[(entitylist.length - 1)].pearls == 0)) && ((entitylist[(entitylist.length - 1)].attacheditem.rarity > 0)))) && ((((_local3 == "wildcard")) || ((entitylist[(entitylist.length - 1)].attacheditem.itype == _local3)))))){
_local2 = false;
} else {
entitylist[(entitylist.length - 1)].dead = true;
};
};
_local1++;
};
};
};
phud.preloadquickbar();
entitytypes["mob_pc"].reinitialize();
dinitialized = true;
};
};
};
};
};
}
private function drawground(_arg1:String){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = false;
_local6 = Math.floor((camx / (40 / sqrtof2)));
_local7 = Math.floor((camy / (40 / sqrtof2)));
_local8 = (camx - (_local6 * (40 / sqrtof2)));
_local9 = (camy - (_local7 * (40 / sqrtof2)));
_local10 = -(Math.round(((_local8 + _local9) * sqrtof2)));
_local11 = Math.round((((_local9 - _local8) / 2) * sqrtof2));
_local12 = 0;
_local13 = 0;
_local14 = 0;
_local15 = 0;
_local16 = 0;
_local13 = -8;
while (_local13 < 9) {
_local15 = ((40 * _local13) - _local11);
if (_arg1 == "over"){
while ((((_local2 < screenentitylist.length)) && ((screenentitylist[_local2].depth < _local15)))) {
screenentitylist[_local2].stamp(grounddata);
_local2++;
};
};
_local12 = -6;
while (_local12 < 7) {
_local14 = 1;
while (_local14 <= 5) {
_local3 = dungeonfloor[("tiledec" + _local14)][((((_local7 + _local12) + _local13) * dungeonfloor.wdth) + ((_local6 + _local12) - _local13))];
if (_local3 >= 1000){
_local5 = true;
_local3 = (_local3 - 1000);
if ((((((((((((_local3 == 312)) || ((_local3 == 313)))) || ((_local3 == 314)))) || ((_local3 == 327)))) || ((_local3 == 328)))) || ((_local3 == 329)))){
_local5 = false;
};
} else {
_local5 = false;
};
_local4 = (Math.floor((_local3 / 100)) + 1);
_local3 = (_local3 % 100);
if (((!((_local3 == -1))) || ((_local14 == 1)))){
drawtile((((80 * _local12) + _local10) + 40), _local15, _local3, _local4, _arg1, _local5);
} else {
_local14 = 100;
};
_local14++;
};
_local12++;
};
_local15 = (((40 * _local13) + (40 / 2)) - _local11);
if (_arg1 == "over"){
while ((((_local2 < screenentitylist.length)) && ((screenentitylist[_local2].depth < _local15)))) {
screenentitylist[_local2].stamp(grounddata);
_local2++;
};
};
_local12 = -6;
while (_local12 < 6) {
_local14 = 1;
while (_local14 <= 5) {
_local3 = dungeonfloor[("tiledec" + _local14)][(((((_local7 + _local12) + _local13) + 1) * dungeonfloor.wdth) + ((_local6 + _local12) - _local13))];
if (_local3 >= 1000){
_local5 = true;
_local3 = (_local3 - 1000);
if ((((((((((((_local3 == 312)) || ((_local3 == 313)))) || ((_local3 == 314)))) || ((_local3 == 327)))) || ((_local3 == 328)))) || ((_local3 == 329)))){
_local5 = false;
};
} else {
_local5 = false;
};
_local4 = (Math.floor((_local3 / 100)) + 1);
_local3 = (_local3 % 100);
if (((!((_local3 == -1))) || ((_local14 == 1)))){
drawtile(((((80 * _local12) + (80 / 2)) + _local10) + 40), _local15, _local3, _local4, _arg1, _local5);
} else {
_local14 = 100;
};
_local14++;
};
_local12++;
};
_local13++;
};
}
public function mousepressed(_arg1:MouseEvent){
var _local2:entity;
_local2 = pickentity(mouseX, mouseY);
if (_local2 != null){
clicked = _local2;
} else {
clicked = player;
};
mouseclick = true;
}
public function drawtile(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
var _local7:Number;
var _local8:Number;
_local7 = 0;
_local8 = 0;
if (_arg4 > 6){
_arg4 = 6;
};
if (((_arg6) && ((_arg4 < 4)))){
_local8 = -40;
};
if (_arg4 == 4){
if ((((((((((((_arg3 == 12)) || ((_arg3 == 13)))) || ((_arg3 == 14)))) || ((_arg3 == 27)))) || ((_arg3 == 28)))) || ((_arg3 == 29)))){
_local8 = 30;
} else {
_local8 = -10;
};
if (_arg3 < 15){
_local7 = -20;
} else {
_local7 = 20;
};
};
if ((((_arg4 == 5)) || ((_arg4 == 6)))){
_local8 = -20;
};
if ((((_arg4 == 1)) && ((_arg3 == 0)))){
_local8 = 40;
};
if ((((((_arg4 == 5)) || ((_arg4 == 6)))) && ((_arg3 >= 14)))){
_local8 = 20;
};
if (_arg5 == "under"){
if (_arg6){
} else {
blit.blittile(grounddata, (_arg1 + _local7), (_arg2 + _local8), this[("bgtilesheet" + _arg4)], _arg3);
};
} else {
if (_arg6){
blit.blittile(grounddata, (_arg1 + _local7), (_arg2 + _local8), this[("bgtilesheet" + _arg4)], _arg3);
};
};
}
private function collideentities(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local2 = 0;
while (_local2 < (entitylist.length - 1)) {
if ((((entitylist[_local2].etype.substr(0, 3) == "mob")) || ((entitylist[_local2].etype == "fixtures")))){
_local1 = (_local2 + 1);
while (_local1 < entitylist.length) {
if ((((((entitylist[_local1].etype.substr(0, 3) == "mob")) || ((entitylist[_local1].etype == "fixtures")))) && (!((((entitylist[_local2].etype == "fixtures")) && ((entitylist[_local1].etype == "fixtures"))))))){
_local3 = (((entitylist[_local1].worldx - entitylist[_local2].worldx) * (entitylist[_local1].worldx - entitylist[_local2].worldx)) + ((entitylist[_local1].worldy - entitylist[_local2].worldy) * (entitylist[_local1].worldy - entitylist[_local2].worldy)));
if (_local3 < 1000){
_local3 = Math.sqrt(_local3);
_local4 = (entitylist[_local1].entitytemplate.size + entitylist[_local2].entitytemplate.size);
if (_local3 < _local4){
if (entitylist[_local1].mass < 1000){
entitylist[_local1].worldx = (entitylist[_local1].worldx + ((((entitylist[_local1].worldx - entitylist[_local2].worldx) / _local3) * (_local4 - _local3)) * ((0.5 * entitylist[_local2].mass) / (entitylist[_local1].mass + entitylist[_local2].mass))));
entitylist[_local1].worldy = (entitylist[_local1].worldy + ((((entitylist[_local1].worldy - entitylist[_local2].worldy) / _local3) * (_local4 - _local3)) * ((0.5 * entitylist[_local2].mass) / (entitylist[_local1].mass + entitylist[_local2].mass))));
};
if (entitylist[_local2].mass < 1000){
entitylist[_local2].worldx = (entitylist[_local2].worldx - ((((entitylist[_local1].worldx - entitylist[_local2].worldx) / _local3) * (_local4 - _local3)) * ((0.5 * entitylist[_local1].mass) / (entitylist[_local1].mass + entitylist[_local2].mass))));
entitylist[_local2].worldy = (entitylist[_local2].worldy - ((((entitylist[_local1].worldy - entitylist[_local2].worldy) / _local3) * (_local4 - _local3)) * ((0.5 * entitylist[_local1].mass) / (entitylist[_local1].mass + entitylist[_local2].mass))));
};
};
};
};
_local1++;
};
};
_local2++;
};
}
}
}//package
Section 63
//HSCMain (HSCMain)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class HSCMain extends MovieClip {
public var mgb:SimpleButton;
public var devKey:String;
public var loader:Loader;
public var urlRequest:URLRequest;
public var unlockedskeleton:Boolean;
public var urlStart:Number;
public var twb:SimpleButton;
public var domEnd:Number;
public var agi_url:String;
public var LastDot:Number;
public var fire3:MovieClip;
public var fire4:MovieClip;
public var fire2:MovieClip;
public var domain:String;
public var credb:SimpleButton;
public var initialized:Boolean;
public var instr:MovieClip;
public var urlEnd:Number;
public var saveobject:SharedObject;
public var agi;
public var gameKey:String;
public var ib:SimpleButton;
public var titles:Array;
public var fbb:SimpleButton;
public var availabletitles:Number;// = 2
public var sounds:VoidSound;
public var ii25:MovieClip;
public var url:String;
public var unlockedminotaur:Boolean;
public var logoed:Boolean;
public var game:gamestage;
public var pb:SimpleButton;
public function HSCMain(){
var _loc1_:Number;
this.game = null;
this.unlockedminotaur = false;
this.unlockedskeleton = false;
this.availabletitles = Number(2);
this.initialized = false;
this.logoed = false;
super();
addFrameScript(0, this.frame1, 1, this.frame2, 2, this.frame3, 3, this.frame4, 5, this.frame6, 9, this.frame10, 16, this.frame17, 18, this.frame19, 21, this.frame22);
this.saveobject = SharedObject.getLocal("saveobject");
this.titles = new Array();
_loc1_ = 0;
while (_loc1_ < 32) {
this.titles.push(false);
_loc1_++;
};
if (this.saveobject.data.titles){
_loc1_ = 0;
while (_loc1_ < 32) {
if (this.saveobject.data.titles[_loc1_]){
this.titles[_loc1_] = true;
};
_loc1_++;
};
};
this.sounds = new VoidSound();
}
public function twbc(_arg1:Event){
var _loc2_:String;
var _loc3_:URLRequest;
_loc2_ = null;
_loc3_ = new URLRequest("http://twitter.com/armorgames");
navigateToURL(_loc3_, _loc2_);
}
public function credbc(_arg1:Event){
this.ib.removeEventListener(MouseEvent.CLICK, this.pbc);
this.pb.removeEventListener(MouseEvent.CLICK, this.pbc);
this.credb.removeEventListener(MouseEvent.CLICK, this.credbc);
this.mgb.removeEventListener(MouseEvent.CLICK, this.mgbc);
this.fbb.removeEventListener(MouseEvent.CLICK, this.fbbc);
this.twb.removeEventListener(MouseEvent.CLICK, this.twbc);
gotoAndStop("showcreds");
}
public function loadComplete(_arg1:Event):void{
this.agi = _arg1.currentTarget.content;
addChild(this.agi);
this.agi.init(this.devKey, this.gameKey);
this.play();
}
function frame10(){
if (!(this.initialized)){
};
this.url = stage.loaderInfo.url;
this.urlStart = Number((this.url.indexOf("://") + 3));
this.urlEnd = Number(this.url.indexOf("/", this.urlStart));
this.domain = this.url.substring(this.urlStart, this.urlEnd);
this.LastDot = Number((this.domain.lastIndexOf(".") - 1));
this.domEnd = Number((this.domain.lastIndexOf(".", this.LastDot) + 1));
this.domain = this.domain.substring(this.domEnd, this.domain.length);
if (this.domain != "armorgames.com"){
this.pb.addEventListener(MouseEvent.CLICK, this.pbc);
};
this.ib.addEventListener(MouseEvent.CLICK, this.ibc);
this.credb.addEventListener(MouseEvent.CLICK, this.credbc);
this.mgb.addEventListener(MouseEvent.CLICK, this.mgbc);
this.fbb.addEventListener(MouseEvent.CLICK, this.fbbc);
this.twb.addEventListener(MouseEvent.CLICK, this.twbc);
this.fire2.gotoAndPlay(5);
this.fire3.gotoAndPlay(3);
this.fire4.gotoAndPlay(8);
stop();
}
function frame17(){
gotoAndStop("mainmenu");
}
function frame2(){
stage.stageFocusRect = false;
stage.showDefaultContextMenu = false;
stage.quality = "high";
this.url = stage.loaderInfo.url;
this.urlStart = Number((this.url.indexOf("://") + 3));
this.urlEnd = Number(this.url.indexOf("/", this.urlStart));
this.domain = this.url.substring(this.urlStart, this.urlEnd);
this.LastDot = Number((this.domain.lastIndexOf(".") - 1));
this.domEnd = Number((this.domain.lastIndexOf(".", this.LastDot) + 1));
this.domain = this.domain.substring(this.domEnd, this.domain.length);
}
function frame6(){
stop();
this.agi_url = "http://agi.armorgames.com/assets/agi/AGI.swf";
Security.allowDomain(this.agi_url);
this.devKey = "ecaf513b466c32bd679ae770af72a449";
this.gameKey = "hack-slash-crawl";
this.urlRequest = new URLRequest(this.agi_url);
this.loader = new Loader();
this.loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.loadComplete);
this.loader.load(this.urlRequest);
}
public function ibc(_arg1:Event){
this.ib.removeEventListener(MouseEvent.CLICK, this.pbc);
this.pb.removeEventListener(MouseEvent.CLICK, this.pbc);
this.credb.removeEventListener(MouseEvent.CLICK, this.credbc);
this.mgb.removeEventListener(MouseEvent.CLICK, this.mgbc);
this.fbb.removeEventListener(MouseEvent.CLICK, this.fbbc);
this.twb.removeEventListener(MouseEvent.CLICK, this.twbc);
gotoAndStop("showinstr");
}
function frame1(){
}
function frame4(){
stop();
}
function frame22(){
gotoAndStop("dontplay");
}
function frame3(){
}
function frame19(){
stop();
this.startgame();
}
public function pgbc(_arg1:Event){
var _loc2_:String;
var _loc3_:URLRequest;
_loc2_ = null;
_loc3_ = new URLRequest("http://armorgames.com/");
navigateToURL(_loc3_, _loc2_);
}
public function pbc(_arg1:Event){
this.ib.removeEventListener(MouseEvent.CLICK, this.pbc);
this.pb.removeEventListener(MouseEvent.CLICK, this.pbc);
this.credb.removeEventListener(MouseEvent.CLICK, this.credbc);
this.mgb.removeEventListener(MouseEvent.CLICK, this.mgbc);
this.fbb.removeEventListener(MouseEvent.CLICK, this.fbbc);
this.twb.removeEventListener(MouseEvent.CLICK, this.twbc);
gotoAndStop("startgame");
}
public function init(){
this.sounds.regsound(new whack1(), "whack1");
this.sounds.regsound(new whack2(), "whack2");
this.sounds.regsound(new whack3(), "whack3");
this.sounds.regsound(new hurt1(), "hurt1");
this.sounds.regsound(new hurt2(), "hurt2");
this.sounds.regsound(new hurt3(), "hurt3");
this.sounds.regsound(new shock(), "shock");
this.sounds.regsound(new clink(), "clink");
this.sounds.regsound(new whoosh(), "whoosh");
this.sounds.regmusic(new music1(), "music1");
this.sounds.regmusic(new music2(), "music2");
this.sounds.regmusic(new music3(), "music3");
this.sounds.musicsequence("1");
this.sounds.playmusic();
this.sounds.vsoundvolume = Number(0.5);
this.sounds.vmusicvolume = Number(0.5);
this.initialized = true;
}
public function endgame(){
this.game.die();
removeChild(this.game);
}
public function startgame(){
if (this.game == null){
this.game = new gamestage(this);
addChild(this.game);
this.game.x = Math.floor((stage.stageWidth / 2));
this.game.y = Math.floor((stage.stageHeight / 2));
} else {
this.game.gamestate = "create";
};
}
public function mgbc(_arg1:Event){
var _loc2_:String;
var _loc3_:URLRequest;
_loc2_ = null;
_loc3_ = new URLRequest("http://armorgames.com/");
navigateToURL(_loc3_, _loc2_);
}
public function lbc(_arg1:Event){
var param1:Event = _arg1;
param1 = param1;
var o:Object;
var boardID:String;
var evt:Event = param1;
this.ib.removeEventListener(MouseEvent.CLICK, this.pbc);
this.pb.removeEventListener(MouseEvent.CLICK, this.pbc);
this.credb.removeEventListener(MouseEvent.CLICK, this.credbc);
this.mgb.removeEventListener(MouseEvent.CLICK, this.mgbc);
this.fbb.removeEventListener(MouseEvent.CLICK, this.fbbc);
this.twb.removeEventListener(MouseEvent.CLICK, this.twbc);
gotoAndStop("showstuff");
o = {n:[8, 7, 2, 1, 5, 15, 13, 7, 2, 7, 10, 14, 11, 6, 6, 5], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
}
public function fbbc(_arg1:Event){
var _loc2_:String;
var _loc3_:URLRequest;
_loc2_ = null;
_loc3_ = new URLRequest("http://www.facebook.com/pages/Armor-Games/19522089061");
navigateToURL(_loc3_, _loc2_);
}
}
}//package
Section 64
//hud (hud)
package {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class hud extends MovieClip {
public var slot3:MovieClip;
public var slot8:MovieClip;
public var slot1:MovieClip;
public var tooltip:MovieClip;
public var xpbar:MovieClip;
public var quickglow:MovieClip;
public var spellpop:MovieClip;
public var slot2:MovieClip;
public var slot5:MovieClip;
public var rip:MovieClip;
public var hovering:Number;// = -1
public var lvlup:MovieClip;
public var inventory:MovieClip;
public var cancelbar:MovieClip;
public var sb:MovieClip;
public var magicbar:MovieClip;
public var invb:MovieClip;
public var dragging:Number;// = -1
public var lifebar:MovieClip;
public var hudtext:MovieClip;
public var mygame:gamestage;
public var slot7:MovieClip;
public var slot4:MovieClip;
public var slot6:MovieClip;
public static var sqrtof2:Number = Math.sqrt(2);
public function hud(_arg1:gamestage){
dragging = -1;
hovering = -1;
super();
mygame = _arg1;
tooltip.visible = false;
}
public function updateinfoblock(_arg1:MovieClip, _arg2:item){
var _local3:Number;
var _local4:Number;
_local3 = 0;
_local4 = _arg2.iicon;
if (_arg2.itype == "weapon"){
_local4 = (_local4 + 1);
};
if (_arg2.itype == "helm"){
_local4 = (_local4 + 50);
};
if (_arg2.itype == "armor"){
_local4 = (_local4 + 30);
};
if (_arg2.itype == "boots"){
_local4 = (_local4 + 70);
};
if (_arg2.itype == "ring"){
_local4 = (_local4 + 90);
};
if (_arg1.itemicon.currentFrame != _local4){
_arg1.itemicon.gotoAndStop(_local4);
};
_arg1.itemicon.iconsquare.gotoAndStop(1);
if (_arg2.rarity == 0){
_arg1.itemname.htmlText = "<font color='#FFFFFF'>";
};
if (_arg2.rarity == 1){
_arg1.itemname.htmlText = "<font color='#00FF00'>";
};
if (_arg2.rarity == 2){
_arg1.itemname.htmlText = "<font color='#4444FF'>";
};
_arg1.itemname.htmlText = (_arg1.itemname.htmlText + ((((("" + _arg2.itemprefix) + " ") + _arg2.itemname) + " ") + _arg2.itempostfix));
if (_arg2.itype == "weapon"){
_arg1.itemicon.rotation = 45;
_arg1.itemicon.scaleX = 2.5;
_arg1.itemicon.scaleY = 2.5;
_arg1.itemstats.htmlText = (((("<font color='#FFFFFF'>" + _arg2.basestat1) + "-") + _arg2.basestat2) + " DAMAGE</br></nbsp></br>");
};
if ((((((_arg2.itype == "armor")) || ((_arg2.itype == "helm")))) || ((_arg2.itype == "boots")))){
_arg1.itemicon.rotation = 0;
_arg1.itemicon.scaleX = 2;
_arg1.itemicon.scaleY = 2;
_arg1.itemstats.htmlText = (("<font color='#FFFFFF'>" + _arg2.basestat1) + " ARMOR</br></nbsp></br>");
};
if (_arg2.itype == "ring"){
_arg1.itemicon.rotation = 0;
_arg1.itemicon.scaleX = 2;
_arg1.itemicon.scaleY = 2;
_arg1.itemstats.htmlText = "";
};
_local3 = 0;
while (_local3 < _arg2.effectsconst.length) {
_arg1.itemstats.htmlText = (_arg1.itemstats.htmlText + (("<font color='#00FF00'>" + _arg2.effectsconst[_local3].estr) + "</br>"));
_local3++;
};
_local3 = 0;
while (_local3 < _arg2.effectsonhit.length) {
_arg1.itemstats.htmlText = (_arg1.itemstats.htmlText + (("<font color='#00FF00'>" + _arg2.effectsonhit[_local3].estr) + "</br>"));
_local3++;
};
if (_arg2.spells[0] != null){
_arg1.itemstats.htmlText = (_arg1.itemstats.htmlText + (("<font color='#FFFF00'>" + _arg2.spells[0].spellname) + "</br>"));
};
if (_arg2.spells[1] != null){
_arg1.itemstats.htmlText = (_arg1.itemstats.htmlText + (("<font color='#FFFF00'>" + _arg2.spells[1].spellname) + "</br>"));
};
}
public function keypressed(_arg1:KeyboardEvent){
trace("asdF");
if (mygame.gamestate == "running"){
if (_arg1.keyCode == 49){
castspell(0);
};
if (_arg1.keyCode == 50){
castspell(1);
};
if (_arg1.keyCode == 51){
castspell(2);
};
if (_arg1.keyCode == 52){
castspell(3);
};
if (_arg1.keyCode == 53){
castspell(4);
};
if (_arg1.keyCode == 54){
castspell(5);
};
if (_arg1.keyCode == 55){
castspell(6);
};
if (_arg1.keyCode == 56){
castspell(7);
};
};
}
public function preloadquickbar(){
var _local1:Number;
var _local2:Number;
_local1 = 0;
_local2 = 0;
_local1 = 0;
while (_local1 < 3) {
if (mygame.racespells[_local1] != null){
mygame.quickbar[_local2] = (_local1 + 100);
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < 3) {
if (mygame.classspells[_local1] != null){
mygame.quickbar[_local2] = (_local1 + 200);
_local2++;
};
_local1++;
};
}
public function updateinfoblockspell(_arg1:MovieClip, _arg2:spell){
_arg1.itemicon.rotation = 0;
_arg1.itemicon.scaleX = 2;
_arg1.itemicon.scaleY = 2;
_arg1.itemicon.gotoAndStop(_arg2.sicon);
_arg1.itemicon.iconsquare.gotoAndStop(1);
_arg1.itemname.htmlText = "<font color='#FFFFFF'>";
_arg1.itemname.htmlText = (_arg1.itemname.htmlText + _arg2.spellname);
_arg1.itemstats.htmlText = (((("<font color='#FFFF66'>" + _arg2.spelldesc) + "<br><br><font color='#4499FF'>COSTS ") + _arg2.scost) + " MAGIC");
}
public function wakeup(){
addEventListener(MouseEvent.CLICK, clicked);
addEventListener(MouseEvent.MOUSE_DOWN, mdown);
addEventListener(MouseEvent.MOUSE_UP, mup);
mygame.addEventListener(MouseEvent.MOUSE_MOVE, mmove);
addEventListener(KeyboardEvent.KEY_DOWN, keypressed);
visible = true;
}
public function castspell(_arg1:Number){
mygame.selectedspell = getspell(_arg1);
if (mygame.selectedspell != null){
if (mygame.selectedspell.stype == "self"){
procedures.proc(mygame.player, mygame.selectedspell.sproc, 0, mygame.selectedspell.scost);
} else {
if (mygame.selectedspell.stype != "select"){
mygame.savedptarget = mygame.ptarget;
};
mygame.ptarget = null;
mygame.clicked = null;
mygame.player.setanim("cast");
mygame.gamestate = "prep_input";
cancelbar.gotoAndStop(2);
};
};
}
public function clicked(_arg1:MouseEvent){
var _local2:Number;
if ((((((((mouseX < (sb.x + (sb.width / 2)))) && ((mouseX > (sb.x - (sb.width / 2)))))) && ((mouseY < (sb.y + (sb.height / 2)))))) && ((mouseY > (sb.y - (sb.height / 2)))))){
if (sb.currentFrame == 1){
mygame.myroot.sounds.vsoundvolume = 0;
mygame.myroot.sounds.vmusicvolume = 0;
sb.gotoAndStop(2);
} else {
mygame.myroot.sounds.vsoundvolume = 0.5;
mygame.myroot.sounds.vmusicvolume = 0.5;
sb.gotoAndStop(1);
};
};
if (mygame.player.hp > 0){
if ((((((((mouseX < (invb.x + (invb.invb.width / 2)))) && ((mouseX > (invb.x - (invb.invb.width / 2)))))) && ((mouseY < (invb.y + (invb.invb.height / 2)))))) && ((mouseY > (invb.y - (invb.invb.height / 2)))))){
if (mygame.gamestate == "running"){
mygame.ptarget = null;
mygame.gamestate = "paused";
inventory.gotoAndStop(2);
} else {
mygame.gamestate = "running";
inventory.gotoAndStop(1);
dragging = -1;
hovering = -1;
Mouse.show();
};
};
if (inventory.getChildByName("ii1") != null){
if ((((((((inventory.mouseX < (inventory.closeb.x + (inventory.closeb.width / 2)))) && ((inventory.mouseX > (inventory.closeb.x - (inventory.closeb.width / 2)))))) && ((inventory.mouseY < (inventory.closeb.y + (inventory.closeb.height / 2)))))) && ((inventory.mouseY > (inventory.closeb.y - (inventory.closeb.height / 2)))))){
mygame.gamestate = "running";
inventory.gotoAndStop(1);
dragging = -1;
Mouse.show();
};
} else {
if (mygame.gamestate == "waiting_input"){
if ((((((((mouseX < (cancelbar.x + (cancelbar.width / 2)))) && ((mouseX > (cancelbar.x - (cancelbar.width / 2)))))) && ((mouseY < (cancelbar.y + (cancelbar.height / 2)))))) && ((mouseY > (cancelbar.y - (cancelbar.height / 2)))))){
mygame.gamestate = "running";
cancelbar.gotoAndStop(1);
mygame.clearplayerinput();
};
} else {
if (mygame.gamestate == "running"){
_local2 = 0;
while (_local2 < 8) {
if ((((((((mouseX < (this[("slot" + (_local2 + 1))].x + (this[("slot" + (_local2 + 1))].width / 2)))) && ((mouseX > (this[("slot" + (_local2 + 1))].x - (this[("slot" + (_local2 + 1))].width / 2)))))) && ((mouseY < (this[("slot" + (_local2 + 1))].y + (this[("slot" + (_local2 + 1))].height / 2)))))) && ((mouseY > (this[("slot" + (_local2 + 1))].y - (this[("slot" + (_local2 + 1))].height / 2)))))){
spellpop.y = 200;
castspell(_local2);
};
_local2++;
};
};
};
};
} else {
if (rip.getChildByName("contb") != null){
if ((((((((rip.mouseX > (rip.contb.x - (rip.contb.width / 2)))) && ((rip.mouseX < (rip.contb.x + (rip.contb.width / 2)))))) && ((rip.mouseY > (rip.contb.y - (rip.contb.height / 2)))))) && ((rip.mouseY < (rip.contb.y + (rip.contb.height / 2)))))){
mygame.gamestate = "restart";
};
};
};
if (mygame.gamestate == "statup"){
_local2 = 0;
while (_local2 < 4) {
if ((((((((lvlup.mouseX > (lvlup[("b" + (_local2 + 1))].x - (lvlup[("b" + (_local2 + 1))].width / 2)))) && ((lvlup.mouseX < (lvlup[("b" + (_local2 + 1))].x + (lvlup[("b" + (_local2 + 1))].width / 2)))))) && ((lvlup.mouseY > (lvlup[("b" + (_local2 + 1))].y - (lvlup[("b" + (_local2 + 1))].height / 2)))))) && ((lvlup.mouseY < (lvlup[("b" + (_local2 + 1))].y + (lvlup[("b" + (_local2 + 1))].height / 2)))))){
if (_local2 == 0){
mygame.player.BASESTR++;
};
if (_local2 == 1){
mygame.player.BASECON++;
};
if (_local2 == 2){
mygame.player.BASEWILL++;
};
if (_local2 == 3){
mygame.player.BASEINT++;
};
mygame.statpoints--;
if (mygame.statpoints <= 0){
mygame.gamestate = "running";
};
};
_local2++;
};
};
}
public function die(){
removeEventListener(MouseEvent.CLICK, clicked);
removeEventListener(MouseEvent.MOUSE_DOWN, mdown);
removeEventListener(MouseEvent.MOUSE_UP, mup);
removeEventListener(MouseEvent.MOUSE_MOVE, mmove);
mygame.removeEventListener(KeyboardEvent.KEY_DOWN, keypressed);
visible = false;
}
public function getspell(_arg1:Number, _arg2:Boolean=false):spell{
var _local3:spell;
_local3 = null;
if (mygame.quickbar[_arg1] != -1){
if (mygame.quickbar[_arg1] < 100){
if (mygame.itemlist[Math.floor((mygame.quickbar[_arg1] / 2))] != null){
if (mygame.itemlist[Math.floor((mygame.quickbar[_arg1] / 2))].spells[(mygame.quickbar[_arg1] % 2)] != null){
if (((_arg2) || ((mygame.player.magic >= mygame.itemlist[Math.floor((mygame.quickbar[_arg1] / 2))].spells[(mygame.quickbar[_arg1] % 2)].scost)))){
_local3 = mygame.itemlist[Math.floor((mygame.quickbar[_arg1] / 2))].spells[(mygame.quickbar[_arg1] % 2)];
};
};
};
} else {
if (mygame.quickbar[_arg1] < 200){
if (mygame.racespells[(mygame.quickbar[_arg1] - 100)] != null){
if (((_arg2) || ((mygame.player.magic >= mygame.racespells[(mygame.quickbar[_arg1] - 100)].scost)))){
_local3 = mygame.racespells[(mygame.quickbar[_arg1] - 100)];
};
};
} else {
if (mygame.classspells[(mygame.quickbar[_arg1] - 200)] != null){
if (((_arg2) || ((mygame.player.magic >= mygame.classspells[(mygame.quickbar[_arg1] - 200)].scost)))){
_local3 = mygame.classspells[(mygame.quickbar[_arg1] - 200)];
};
};
};
};
};
return (_local3);
}
public function updatehud(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (mygame.newstuff){
if (invb.currentFrame != 2){
invb.gotoAndStop(2);
};
} else {
invb.gotoAndStop(1);
};
if (mygame.statpoints > 0){
cancelbar.gotoAndStop(1);
mygame.gamestate = "statup";
lvlup.y = -300;
lvlup.lvl.text = (("Level " + mygame.player.LVL) + " ACHIEVED");
lvlup.sta.text = (mygame.statpoints + " STAT POINTS AVAILABLE");
lvlup.st1.text = mygame.player.STR;
lvlup.st2.text = mygame.player.CON;
lvlup.st3.text = mygame.player.WILL;
lvlup.st4.text = mygame.player.INT;
} else {
lvlup.y = 1000;
};
if (dragging >= 100){
quickglow.play();
};
_local1 = 0;
mygame.youarehere.x = ((((mygame.player.worldx / (40 / sqrtof2)) - 50) + ((mygame.player.worldy / (40 / sqrtof2)) - 50)) / sqrtof2);
mygame.youarehere.y = ((((mygame.player.worldy / (40 / sqrtof2)) - 50) - ((mygame.player.worldx / (40 / sqrtof2)) - 50)) / sqrtof2);
lifebar.gotoAndStop(Math.round(((mygame.player.hp / mygame.player.maxhp) * 200)));
magicbar.gotoAndStop(Math.round(((mygame.player.magic / mygame.player.maxmagic) * 200)));
xpbar.gotoAndStop(Math.round(((mygame.xp / ((mygame.player.LVL * 100) * 20)) * 200)));
if (inventory.getChildByName("dragprompt") != null){
if (hovering > 0){
inventory.dragprompt.scaleX = (((inventory.dragprompt.scaleX * 2) + 0.4) / 3);
} else {
inventory.dragprompt.scaleX = (inventory.dragprompt.scaleX * 0.66);
};
inventory.dragprompt.scaleY = inventory.dragprompt.scaleX;
if (inventory.dragprompt.scaleX <= 0.1){
inventory.dragprompt.x = 1000;
} else {
inventory.dragprompt.x = inventory.mouseX;
inventory.dragprompt.y = inventory.mouseY;
inventory.dragprompt.rotation = (inventory.dragprompt.rotation - 1.5);
};
};
_local1 = 0;
while (_local1 < 8) {
if (mygame.quickbar[_local1] == -1){
this[("slot" + (_local1 + 1))].gotoAndStop(1);
this[("slot" + (_local1 + 1))].recharge.rbar.y = -80;
} else {
if (mygame.quickbar[_local1] < 100){
if (mygame.itemlist[Math.floor((mygame.quickbar[_local1] / 2))] == null){
mygame.quickbar[_local1] = -1;
this[("slot" + (_local1 + 1))].recharge.rbar.y = -80;
} else {
if (mygame.itemlist[Math.floor((mygame.quickbar[_local1] / 2))].spells[(mygame.quickbar[_local1] % 2)] == null){
mygame.quickbar[_local1] = -1;
this[("slot" + (_local1 + 1))].recharge.rbar.y = -80;
} else {
this[("slot" + (_local1 + 1))].gotoAndStop(mygame.itemlist[Math.floor((mygame.quickbar[_local1] / 2))].spells[(mygame.quickbar[_local1] % 2)].sicon);
this[("slot" + (_local1 + 1))].recharge.rbar.y = (0 - ((mygame.player.magic * 40) / mygame.itemlist[Math.floor((mygame.quickbar[_local1] / 2))].spells[(mygame.quickbar[_local1] % 2)].scost));
if (this[("slot" + (_local1 + 1))].recharge.rbar.y <= -40){
this[("slot" + (_local1 + 1))].recharge.rbar.y = -80;
};
};
};
} else {
if (mygame.quickbar[_local1] < 200){
if (mygame.racespells[(mygame.quickbar[_local1] - 100)] == null){
mygame.quickbar[_local1] = -1;
this[("slot" + (_local1 + 1))].recharge.rbar.y = -80;
} else {
this[("slot" + (_local1 + 1))].gotoAndStop(mygame.racespells[(mygame.quickbar[_local1] - 100)].sicon);
this[("slot" + (_local1 + 1))].recharge.rbar.y = (0 - ((mygame.player.magic * 40) / mygame.racespells[(mygame.quickbar[_local1] - 100)].scost));
if (this[("slot" + (_local1 + 1))].recharge.rbar.y <= -40){
this[("slot" + (_local1 + 1))].recharge.rbar.y = -80;
};
};
} else {
if (mygame.classspells[(mygame.quickbar[_local1] - 200)] == null){
mygame.quickbar[_local1] = -1;
this[("slot" + (_local1 + 1))].recharge.rbar.y = -80;
} else {
this[("slot" + (_local1 + 1))].gotoAndStop(mygame.classspells[(mygame.quickbar[_local1] - 200)].sicon);
this[("slot" + (_local1 + 1))].recharge.rbar.y = (0 - ((mygame.player.magic * 40) / mygame.classspells[(mygame.quickbar[_local1] - 200)].scost));
if (this[("slot" + (_local1 + 1))].recharge.rbar.y <= -40){
this[("slot" + (_local1 + 1))].recharge.rbar.y = -80;
};
};
};
};
};
_local1++;
};
if (inventory.getChildByName("infoblock") != null){
mygame.newstuff = false;
inventory.visible = true;
if (dragging != -1){
hovering = -1;
if (dragging < 100){
if ((((mygame.itemlist[dragging].itype == "weapon")) && ((inventory.ei4.iconsquareglow.currentFrame == 1)))){
inventory.ei4.iconsquareglow.gotoAndPlay(2);
};
if ((((mygame.itemlist[dragging].itype == "helm")) && ((inventory.ei1.iconsquareglow.currentFrame == 1)))){
inventory.ei1.iconsquareglow.gotoAndPlay(2);
};
if ((((mygame.itemlist[dragging].itype == "armor")) && ((inventory.ei2.iconsquareglow.currentFrame == 1)))){
inventory.ei2.iconsquareglow.gotoAndPlay(2);
};
if ((((mygame.itemlist[dragging].itype == "boots")) && ((inventory.ei5.iconsquareglow.currentFrame == 1)))){
inventory.ei5.iconsquareglow.gotoAndPlay(2);
};
if (mygame.itemlist[dragging].itype == "ring"){
if (inventory.ei3.iconsquareglow.currentFrame == 1){
inventory.ei3.iconsquareglow.gotoAndPlay(2);
};
if (inventory.ei6.iconsquareglow.currentFrame == 1){
inventory.ei6.iconsquareglow.gotoAndPlay(2);
};
};
};
};
if (hovering == -1){
inventory.infoblock.visible = false;
inventory.infoblock2.visible = false;
} else {
if (hovering < 100){
inventory.infoblock.visible = true;
updateinfoblock(inventory.infoblock, mygame.itemlist[hovering]);
if ((((mygame.itemlist[hovering].itype == "weapon")) && ((inventory.ei4.iconsquareglow.currentFrame == 1)))){
inventory.ei4.iconsquareglow.gotoAndPlay(2);
};
if ((((mygame.itemlist[hovering].itype == "helm")) && ((inventory.ei1.iconsquareglow.currentFrame == 1)))){
inventory.ei1.iconsquareglow.gotoAndPlay(2);
};
if ((((mygame.itemlist[hovering].itype == "armor")) && ((inventory.ei2.iconsquareglow.currentFrame == 1)))){
inventory.ei2.iconsquareglow.gotoAndPlay(2);
};
if ((((mygame.itemlist[hovering].itype == "boots")) && ((inventory.ei5.iconsquareglow.currentFrame == 1)))){
inventory.ei5.iconsquareglow.gotoAndPlay(2);
};
if (mygame.itemlist[hovering].itype == "ring"){
if (inventory.ei3.iconsquareglow.currentFrame == 1){
inventory.ei3.iconsquareglow.gotoAndPlay(2);
};
if (inventory.ei6.iconsquareglow.currentFrame == 1){
inventory.ei6.iconsquareglow.gotoAndPlay(2);
};
};
if ((((((mygame.itemlist[hovering].itype == "weapon")) && (!((mygame.itemlist[3] == null))))) && (!((hovering == 3))))){
inventory.infoblock2.visible = true;
updateinfoblock(inventory.infoblock2, mygame.itemlist[3]);
} else {
if ((((((mygame.itemlist[hovering].itype == "helm")) && (!((mygame.itemlist[0] == null))))) && (!((hovering == 0))))){
inventory.infoblock2.visible = true;
updateinfoblock(inventory.infoblock2, mygame.itemlist[0]);
} else {
if ((((((mygame.itemlist[hovering].itype == "armor")) && (!((mygame.itemlist[1] == null))))) && (!((hovering == 1))))){
inventory.infoblock2.visible = true;
updateinfoblock(inventory.infoblock2, mygame.itemlist[1]);
} else {
if ((((((mygame.itemlist[hovering].itype == "boots")) && (!((mygame.itemlist[4] == null))))) && (!((hovering == 4))))){
inventory.infoblock2.visible = true;
updateinfoblock(inventory.infoblock2, mygame.itemlist[4]);
} else {
if ((((((((((mygame.itemlist[hovering].itype == "ring")) && (!((mygame.itemlist[2] == null))))) && (!((mygame.itemlist[5] == null))))) && (!((hovering == 2))))) && (!((hovering == 5))))){
inventory.infoblock2.visible = true;
updateinfoblock(inventory.infoblock2, mygame.itemlist[2]);
} else {
inventory.infoblock2.visible = false;
};
};
};
};
};
} else {
if (hovering < 200){
inventory.infoblock.visible = true;
inventory.infoblock2.visible = false;
updateinfoblockspell(inventory.infoblock, mygame.itemlist[Math.floor(((hovering - 100) / 2))].spells[((hovering - 100) % 2)]);
} else {
if (hovering < 300){
inventory.infoblock.visible = true;
inventory.infoblock2.visible = false;
updateinfoblockspell(inventory.infoblock, mygame.racespells[(hovering - 200)]);
} else {
inventory.infoblock.visible = true;
inventory.infoblock2.visible = false;
updateinfoblockspell(inventory.infoblock, mygame.classspells[(hovering - 300)]);
};
};
};
};
} else {
inventory.visible = false;
};
if (inventory.getChildByName("statblock") != null){
inventory.pearldrop.wealth.htmlText = ("<font color='#FFFFFF'>" + prettynumber(mygame.wealth));
inventory.statblock.cname.htmlText = mygame.playername;
inventory.statblock.clevel.htmlText = ((((("Level " + mygame.player.LVL) + " ") + mygame.player.entitytemplate.race) + " ") + mygame.player.entitytemplate.cclass);
inventory.statblock.ctitles.htmlText = mygame.titletext;
inventory.statblock.stat1.htmlText = ((("" + mygame.player.hp) + "/") + mygame.player.maxhp);
inventory.statblock.stat2.htmlText = ((("" + mygame.player.magic) + "/") + mygame.player.maxmagic);
inventory.statblock.stat3.htmlText = ("<font color='#FFFFFF'>" + mygame.player.ARMOR);
inventory.statblock.stat4.htmlText = ("<font color='#FFFFFF'>" + mygame.player.BASESTR);
inventory.statblock.stat5.htmlText = ("<font color='#FFFFFF'>" + mygame.player.CON);
inventory.statblock.stat6.htmlText = ("<font color='#FFFFFF'>" + mygame.player.WILL);
inventory.statblock.stat7.htmlText = ("<font color='#FFFFFF'>" + mygame.player.INT);
inventory.statblock.stat8.htmlText = ("<font color='#FFFFFF'>" + mygame.player.RFIRE);
inventory.statblock.stat9.htmlText = ("<font color='#FFFFFF'>" + mygame.player.RICE);
inventory.statblock.stat10.htmlText = ("<font color='#FFFFFF'>" + mygame.player.RPOISON);
inventory.statblock.stat11.htmlText = ("<font color='#FFFFFF'>" + mygame.player.RELECTRIC);
if (mygame.player.STR > mygame.player.BASESTR){
inventory.statblock.stat4.htmlText = (inventory.statblock.stat4.htmlText + ("<font color='#00FF00'>+" + (mygame.player.STR - mygame.player.BASESTR)));
} else {
if (mygame.player.STR < mygame.player.BASESTR){
inventory.statblock.stat4.htmlText = (inventory.statblock.stat4.htmlText + ("<font color='#FF0000'>-" + (mygame.player.BASESTR - mygame.player.STR)));
};
};
if (mygame.player.CON > mygame.player.BASECON){
inventory.statblock.stat5.htmlText = (inventory.statblock.stat5.htmlText + ("<font color='#00FF00'>+" + (mygame.player.CON - mygame.player.BASECON)));
} else {
if (mygame.player.CON < mygame.player.BASECON){
inventory.statblock.stat5.htmlText = (inventory.statblock.stat5.htmlText + ("<font color='#FF0000'>-" + (mygame.player.BASECON - mygame.player.CON)));
};
};
if (mygame.player.WILL > mygame.player.BASEWILL){
inventory.statblock.stat6.htmlText = (inventory.statblock.stat6.htmlText + ("<font color='#00FF00'>+" + (mygame.player.WILL - mygame.player.BASEWILL)));
} else {
if (mygame.player.WILL < mygame.player.BASEWILL){
inventory.statblock.stat6.htmlText = (inventory.statblock.stat6.htmlText + ("<font color='#FF0000'>-" + (mygame.player.BASEWILL - mygame.player.WILL)));
};
};
if (mygame.player.INT > mygame.player.BASEINT){
inventory.statblock.stat7.htmlText = (inventory.statblock.stat7.htmlText + ("<font color='#00FF00'>+" + (mygame.player.INT - mygame.player.BASEINT)));
} else {
if (mygame.player.INT < mygame.player.BASEINT){
inventory.statblock.stat7.htmlText = (inventory.statblock.stat7.htmlText + ("<font color='#FF0000'>-" + (mygame.player.BASEINT - mygame.player.INT)));
};
};
_local1 = 0;
while (_local1 < 6) {
if (mygame.itemlist[_local1] == null){
if (inventory[("ei" + (_local1 + 1))].currentFrame != 1){
inventory[("ei" + (_local1 + 1))].gotoAndStop(1);
};
inventory[("ei" + (_local1 + 1))].iconsquare.gotoAndStop(2);
inventory[("s" + ((_local1 * 2) + 1))].gotoAndStop(0);
inventory[("s" + ((_local1 * 2) + 1))].iconsquare.gotoAndStop(0);
inventory[("s" + ((_local1 * 2) + 2))].gotoAndStop(0);
inventory[("s" + ((_local1 * 2) + 2))].iconsquare.gotoAndStop(0);
} else {
_local2 = mygame.itemlist[_local1].iicon;
if (mygame.itemlist[_local1].itype == "weapon"){
_local2 = (_local2 + 1);
};
if (mygame.itemlist[_local1].itype == "helm"){
_local2 = (_local2 + 50);
};
if (mygame.itemlist[_local1].itype == "armor"){
_local2 = (_local2 + 30);
};
if (mygame.itemlist[_local1].itype == "boots"){
_local2 = (_local2 + 70);
};
if (mygame.itemlist[_local1].itype == "ring"){
_local2 = (_local2 + 90);
};
if (inventory[("ei" + (_local1 + 1))].currentFrame != _local2){
inventory[("ei" + (_local1 + 1))].gotoAndStop(_local2);
};
inventory[("ei" + (_local1 + 1))].iconsquare.gotoAndStop((mygame.itemlist[_local1].rarity + 3));
if (mygame.itemlist[_local1].spells[0] == null){
inventory[("s" + ((_local1 * 2) + 1))].gotoAndStop(0);
inventory[("s" + ((_local1 * 2) + 1))].iconsquare.gotoAndStop(0);
} else {
inventory[("s" + ((_local1 * 2) + 1))].gotoAndStop(mygame.itemlist[_local1].spells[0].sicon);
inventory[("s" + ((_local1 * 2) + 1))].iconsquare.gotoAndStop(0);
};
if (mygame.itemlist[_local1].spells[1] == null){
inventory[("s" + ((_local1 * 2) + 2))].gotoAndStop(0);
inventory[("s" + ((_local1 * 2) + 2))].iconsquare.gotoAndStop(0);
} else {
inventory[("s" + ((_local1 * 2) + 2))].gotoAndStop(mygame.itemlist[_local1].spells[1].sicon);
inventory[("s" + ((_local1 * 2) + 2))].iconsquare.gotoAndStop(0);
};
};
_local1++;
};
_local1 = 0;
while (_local1 < 3) {
if (mygame.racespells[_local1] == null){
inventory[("rs" + (_local1 + 1))].gotoAndStop(0);
inventory[("rs" + (_local1 + 1))].iconsquare.gotoAndStop(0);
} else {
inventory[("rs" + (_local1 + 1))].gotoAndStop(mygame.racespells[_local1].sicon);
inventory[("rs" + (_local1 + 1))].iconsquare.gotoAndStop(0);
};
_local1++;
};
_local1 = 0;
while (_local1 < 3) {
if (mygame.classspells[_local1] == null){
inventory[("cs" + (_local1 + 1))].gotoAndStop(0);
inventory[("cs" + (_local1 + 1))].iconsquare.gotoAndStop(0);
} else {
inventory[("cs" + (_local1 + 1))].gotoAndStop(mygame.classspells[_local1].sicon);
inventory[("cs" + (_local1 + 1))].iconsquare.gotoAndStop(0);
};
_local1++;
};
if (mygame.itemlist[0] == null){
mygame.player.entitytemplate.HELM = 0;
} else {
mygame.player.entitytemplate.HELM = mygame.itemlist[0].iicon;
};
if (mygame.itemlist[1] == null){
mygame.player.entitytemplate.BODY = 1;
mygame.player.entitytemplate.BODY = 1;
} else {
mygame.player.entitytemplate.BODY = (mygame.itemlist[1].iicon + 1);
mygame.player.entitytemplate.ARMS = (mygame.itemlist[1].iicon + 1);
};
if (mygame.itemlist[3] == null){
mygame.player.entitytemplate.WEAPON1 = 100;
} else {
mygame.player.entitytemplate.WEAPON1 = mygame.itemlist[3].iicon;
};
if (mygame.itemlist[4] == null){
mygame.player.entitytemplate.FEET = 0;
} else {
mygame.player.entitytemplate.FEET = (mygame.itemlist[4].iicon + 1);
};
_local1 = 0;
while (_local1 < 32) {
if (mygame.itemlist[(6 + _local1)] == null){
inventory[("ii" + (_local1 + 1))].gotoAndStop(1);
inventory[("ii" + (_local1 + 1))].iconsquare.gotoAndStop(2);
} else {
_local3 = mygame.itemlist[(6 + _local1)].iicon;
if (mygame.itemlist[(6 + _local1)].itype == "weapon"){
_local3 = (_local3 + 1);
};
if (mygame.itemlist[(6 + _local1)].itype == "helm"){
_local3 = (_local3 + 50);
};
if (mygame.itemlist[(6 + _local1)].itype == "armor"){
_local3 = (_local3 + 30);
};
if (mygame.itemlist[(6 + _local1)].itype == "boots"){
_local3 = (_local3 + 70);
};
if (mygame.itemlist[(6 + _local1)].itype == "ring"){
_local3 = (_local3 + 90);
};
if (inventory[("ii" + (_local1 + 1))].currentFrame != _local3){
inventory[("ii" + (_local1 + 1))].gotoAndStop(_local3);
};
inventory[("ii" + (_local1 + 1))].iconsquare.gotoAndStop((mygame.itemlist[(6 + _local1)].rarity + 3));
if (mygame.itemlist[(6 + _local1)].isnew){
inventory[("ii" + (_local1 + 1))].iconsquarenew.gotoAndStop(2);
} else {
inventory[("ii" + (_local1 + 1))].iconsquarenew.gotoAndStop(1);
};
};
_local1++;
};
};
if (inventory.getChildByName("iidrag") != null){
if (dragging != -1){
Mouse.hide();
if (dragging < 100){
if (dragging >= 6){
inventory[("ii" + (dragging - 5))].gotoAndStop(1);
inventory[("ii" + (dragging - 5))].iconsquare.gotoAndStop(2);
} else {
inventory[("ei" + (dragging + 1))].gotoAndStop(1);
inventory[("ei" + (dragging + 1))].iconsquare.gotoAndStop(2);
};
_local4 = mygame.itemlist[dragging].iicon;
if (mygame.itemlist[dragging].itype == "weapon"){
_local4 = (_local4 + 1);
};
if (mygame.itemlist[dragging].itype == "helm"){
_local4 = (_local4 + 50);
};
if (mygame.itemlist[dragging].itype == "armor"){
_local4 = (_local4 + 30);
};
if (mygame.itemlist[dragging].itype == "boots"){
_local4 = (_local4 + 70);
};
if (mygame.itemlist[dragging].itype == "ring"){
_local4 = (_local4 + 90);
};
if (inventory.iidrag.currentFrame != _local4){
inventory.iidrag.gotoAndStop(_local4);
};
if (mygame.itemlist[dragging] != null){
inventory.iidrag.iconsquare.gotoAndStop((mygame.itemlist[dragging].rarity + 3));
};
} else {
if (dragging < 200){
inventory.iidrag.gotoAndStop(mygame.itemlist[Math.floor(((dragging - 100) / 2))].spells[((dragging - 100) % 2)].sicon);
inventory.iidrag.iconsquare.gotoAndStop(6);
} else {
if (dragging < 300){
inventory.iidrag.gotoAndStop(mygame.racespells[(dragging - 200)].sicon);
inventory.iidrag.iconsquare.gotoAndStop(6);
} else {
inventory.iidrag.gotoAndStop(mygame.classspells[(dragging - 300)].sicon);
inventory.iidrag.iconsquare.gotoAndStop(6);
};
};
};
inventory.iidrag.x = inventory.mouseX;
inventory.iidrag.y = inventory.mouseY;
} else {
Mouse.show();
inventory.iidrag.x = 1000;
};
};
}
public function mdown(_arg1:MouseEvent){
var _local2:Number;
_local2 = 0;
if (inventory.getChildByName("ii1") != null){
_local2 = 0;
while (_local2 < 32) {
if ((((((((inventory.mouseX > (inventory[("ii" + (_local2 + 1))].x - (inventory[("ii" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("ii" + (_local2 + 1))].x + (inventory[("ii" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("ii" + (_local2 + 1))].y - (inventory[("ii" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("ii" + (_local2 + 1))].y + (inventory[("ii" + (_local2 + 1))].height / 2)))))){
if (mygame.itemlist[(6 + _local2)] != null){
dragging = (6 + _local2);
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 6) {
if ((((((((inventory.mouseX > (inventory[("ei" + (_local2 + 1))].x - (inventory[("ei" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("ei" + (_local2 + 1))].x + (inventory[("ei" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("ei" + (_local2 + 1))].y - (inventory[("ei" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("ei" + (_local2 + 1))].y + (inventory[("ei" + (_local2 + 1))].height / 2)))))){
if (mygame.itemlist[_local2] != null){
dragging = _local2;
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 12) {
if ((((((((inventory.mouseX > (inventory[("s" + (_local2 + 1))].x - (inventory[("s" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("s" + (_local2 + 1))].x + (inventory[("s" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("s" + (_local2 + 1))].y - (inventory[("s" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("s" + (_local2 + 1))].y + (inventory[("s" + (_local2 + 1))].height / 2)))))){
if (mygame.itemlist[Math.floor((_local2 / 2))] != null){
if (mygame.itemlist[Math.floor((_local2 / 2))].spells[(_local2 % 2)] != null){
dragging = (100 + _local2);
};
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 3) {
if ((((((((inventory.mouseX > (inventory[("rs" + (_local2 + 1))].x - (inventory[("rs" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("rs" + (_local2 + 1))].x + (inventory[("rs" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("rs" + (_local2 + 1))].y - (inventory[("rs" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("rs" + (_local2 + 1))].y + (inventory[("rs" + (_local2 + 1))].height / 2)))))){
if (mygame.racespells[_local2] != null){
dragging = (200 + _local2);
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 3) {
if ((((((((inventory.mouseX > (inventory[("cs" + (_local2 + 1))].x - (inventory[("cs" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("cs" + (_local2 + 1))].x + (inventory[("cs" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("cs" + (_local2 + 1))].y - (inventory[("cs" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("cs" + (_local2 + 1))].y + (inventory[("cs" + (_local2 + 1))].height / 2)))))){
if (mygame.classspells[_local2] != null){
dragging = (300 + _local2);
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 8) {
if ((((((((inventory.mouseX > (inventory[("qc" + (_local2 + 1))].x - (inventory[("qc" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("qc" + (_local2 + 1))].x + (inventory[("qc" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("qc" + (_local2 + 1))].y - (inventory[("qc" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("qc" + (_local2 + 1))].y + (inventory[("qc" + (_local2 + 1))].height / 2)))))){
if (mygame.quickbar[_local2] != -1){
dragging = (mygame.quickbar[_local2] + 100);
mygame.quickbar[_local2] = -1;
};
};
_local2++;
};
};
}
public function mmove(_arg1:MouseEvent){
var _local2:Number;
var _local3:Boolean;
var _local4:spell;
_local2 = 0;
_local3 = false;
if (mygame.gamestate == "statup"){
tooltip.visible = false;
_local2 = 0;
while (_local2 < 4) {
if ((((((((lvlup.mouseX > (lvlup[("b" + (_local2 + 1))].x - (lvlup[("b" + (_local2 + 1))].width / 2)))) && ((lvlup.mouseX < (lvlup[("b" + (_local2 + 1))].x + (lvlup[("b" + (_local2 + 1))].width / 2)))))) && ((lvlup.mouseY > (lvlup[("b" + (_local2 + 1))].y - (lvlup[("b" + (_local2 + 1))].height / 2)))))) && ((lvlup.mouseY < (lvlup[("b" + (_local2 + 1))].y + (lvlup[("b" + (_local2 + 1))].height / 2)))))){
tooltip.visible = true;
if (_local2 == 0){
tooltip.tooltext.text = "Strength improves your ability to do physical damage.";
};
if (_local2 == 1){
tooltip.tooltext.text = "Stamina increases your total health, as well as your rate of regeneration.";
};
if (_local2 == 2){
tooltip.tooltext.text = "Willpower increases your total magic supply, as well as the rate at which your magic is replenished.";
};
if (_local2 == 3){
tooltip.tooltext.text = "Intellect improves your ability to do elemental damage, as well as the power of most spells.";
};
};
_local2++;
};
};
if (((!((inventory.getChildByName("statblock") == null))) && ((dragging == -1)))){
tooltip.visible = false;
_local2 = 1;
while (_local2 <= 11) {
if ((((((((inventory.statblock.mouseX > -100)) && ((inventory.statblock.mouseX < 100)))) && ((inventory.statblock.mouseY > ((44 + (16 * _local2)) - 8))))) && ((inventory.statblock.mouseY < ((44 + (16 * _local2)) + 8))))){
tooltip.visible = true;
if (_local2 == 1){
tooltip.tooltext.text = "Health is your life force. When you run out of health, you will die.";
};
if (_local2 == 2){
tooltip.tooltext.text = "Magic is the power source for your spells.";
};
if (_local2 == 3){
tooltip.tooltext.text = "Armor reduces the amount of physical damage you take. Elemental damage is not affected.";
};
if (_local2 == 4){
tooltip.tooltext.text = "Strength improves your ability to do physical damage.";
};
if (_local2 == 5){
tooltip.tooltext.text = "Stamina increases your total health, as well as your rate of regeneration.";
};
if (_local2 == 6){
tooltip.tooltext.text = "Willpower increases your total magic supply, as well as the rate at which your magic is replenished.";
};
if (_local2 == 7){
tooltip.tooltext.text = "Intellect improves your ability to do elemental damage, as well as the power of most spells.";
};
if (_local2 == 8){
tooltip.tooltext.text = "Fire resistance reduces the amount of fire damage you take.";
};
if (_local2 == 9){
tooltip.tooltext.text = "Ice resistance reduces the amount of ice damage you take.";
};
if (_local2 == 10){
tooltip.tooltext.text = "Poison resistance reduces the amount of poison damage you take.";
};
if (_local2 == 11){
tooltip.tooltext.text = "Electric resistance reduces the amount of electric damage you take.";
};
};
_local2++;
};
};
if (((!((inventory.getChildByName("ii1") == null))) && ((dragging == -1)))){
_local2 = 0;
while (_local2 < 32) {
if ((((((((inventory.mouseX > (inventory[("ii" + (_local2 + 1))].x - (inventory[("ii" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("ii" + (_local2 + 1))].x + (inventory[("ii" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("ii" + (_local2 + 1))].y - (inventory[("ii" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("ii" + (_local2 + 1))].y + (inventory[("ii" + (_local2 + 1))].height / 2)))))){
if (mygame.itemlist[(6 + _local2)] != null){
mygame.itemlist[(6 + _local2)].isnew = false;
hovering = (6 + _local2);
_local3 = true;
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 6) {
if ((((((((inventory.mouseX > (inventory[("ei" + (_local2 + 1))].x - (inventory[("ei" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("ei" + (_local2 + 1))].x + (inventory[("ei" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("ei" + (_local2 + 1))].y - (inventory[("ei" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("ei" + (_local2 + 1))].y + (inventory[("ei" + (_local2 + 1))].height / 2)))))){
if (mygame.itemlist[_local2] != null){
hovering = _local2;
_local3 = true;
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 12) {
if ((((((((inventory.mouseX > (inventory[("s" + (_local2 + 1))].x - (inventory[("s" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("s" + (_local2 + 1))].x + (inventory[("s" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("s" + (_local2 + 1))].y - (inventory[("s" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("s" + (_local2 + 1))].y + (inventory[("s" + (_local2 + 1))].height / 2)))))){
if (mygame.itemlist[Math.floor((_local2 / 2))] != null){
if (mygame.itemlist[Math.floor((_local2 / 2))].spells[(_local2 % 2)] != null){
hovering = (100 + _local2);
_local3 = true;
};
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 3) {
if ((((((((inventory.mouseX > (inventory[("rs" + (_local2 + 1))].x - (inventory[("rs" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("rs" + (_local2 + 1))].x + (inventory[("rs" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("rs" + (_local2 + 1))].y - (inventory[("rs" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("rs" + (_local2 + 1))].y + (inventory[("rs" + (_local2 + 1))].height / 2)))))){
if (mygame.racespells[_local2] != null){
hovering = (200 + _local2);
_local3 = true;
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 3) {
if ((((((((inventory.mouseX > (inventory[("cs" + (_local2 + 1))].x - (inventory[("cs" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("cs" + (_local2 + 1))].x + (inventory[("cs" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("cs" + (_local2 + 1))].y - (inventory[("cs" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("cs" + (_local2 + 1))].y + (inventory[("cs" + (_local2 + 1))].height / 2)))))){
if (mygame.classspells[_local2] != null){
hovering = (300 + _local2);
_local3 = true;
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 8) {
if ((((((((inventory.mouseX > (inventory[("qc" + (_local2 + 1))].x - (inventory[("qc" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("qc" + (_local2 + 1))].x + (inventory[("qc" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("qc" + (_local2 + 1))].y - (inventory[("qc" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("qc" + (_local2 + 1))].y + (inventory[("qc" + (_local2 + 1))].height / 2)))))){
if (mygame.quickbar[_local2] != -1){
hovering = (mygame.quickbar[_local2] + 100);
_local3 = true;
};
};
_local2++;
};
};
if (!_local3){
hovering = -1;
};
if (mygame.gamestate == "running"){
_local4 = null;
_local2 = 0;
while (_local2 < 8) {
if ((((((((mouseX > (this[("slot" + (_local2 + 1))].x - 20))) && ((mouseX < (this[("slot" + (_local2 + 1))].x + 20))))) && ((mouseY > (this[("slot" + (_local2 + 1))].y - 20))))) && ((mouseY < (this[("slot" + (_local2 + 1))].y + 20))))){
if (mygame.quickbar[_local2] != -1){
_local4 = getspell(_local2, true);
if (_local4 != null){
spellpop.x = this[("slot" + (_local2 + 1))].x;
spellpop.y = -100;
spellpop.infotitle.htmlText = ("<font color='#FFFF00'>" + _local4.spellname);
spellpop.infotext.htmlText = (((("<font color='#FFFFFF'>" + _local4.spelldesc) + "<br><br><font color='#4499FF'>COSTS ") + _local4.scost) + " MAGIC");
};
};
};
_local2++;
};
if (_local4 == null){
spellpop.y = 1000;
};
};
}
public function prettynumber(_arg1:Number):String{
var _local2:String;
var _local3:String;
_local2 = "";
_local3 = "";
while (_arg1 >= 1000) {
_local3 = "";
if ((_arg1 % 1000) < 100){
_local3 = (_local3 + "0");
};
if ((_arg1 % 1000) < 10){
_local3 = (_local3 + "0");
};
_local2 = ((("," + _local3) + (_arg1 % 1000)) + _local2);
_arg1 = Math.floor((_arg1 / 1000));
};
_local2 = (_arg1 + _local2);
return (_local2);
}
public function preloadspell(_arg1:Number){
var _local2:Number;
var _local3:Boolean;
_local2 = 0;
_local3 = false;
_local2 = 0;
while (_local2 < 8) {
if (mygame.quickbar[_local2] == _arg1){
_local3 = true;
};
_local2++;
};
if (!_local3){
_local2 = 0;
while (_local2 < 8) {
if (mygame.quickbar[_local2] == -1){
mygame.quickbar[_local2] = _arg1;
return;
};
_local2++;
};
};
}
public function mup(_arg1:MouseEvent){
var _local2:Number;
var _local3:item;
_local2 = 0;
if (((!((inventory.getChildByName("ii1") == null))) && (!((dragging == -1))))){
if (dragging < 100){
if ((((((((inventory.mouseX > (inventory.pearldrop.x - (inventory.pearldrop.width / 2)))) && ((inventory.mouseX < (inventory.pearldrop.x + (inventory.pearldrop.width / 2)))))) && ((inventory.mouseY > (inventory.pearldrop.y - (inventory.pearldrop.height / 2)))))) && ((inventory.mouseY < (inventory.pearldrop.y + (inventory.pearldrop.height / 2)))))){
mygame.wealth = (mygame.wealth + Math.floor(((mygame.itemlist[dragging].LVL * 100) * (1 + (0.5 * mygame.itemlist[dragging].rarity)))));
if (Math.floor(((mygame.itemlist[dragging].LVL * 100) * (1 + (0.5 * mygame.itemlist[dragging].rarity)))) == 0){
mygame.wealth = (mygame.wealth + 50);
};
mygame.itemlist[dragging] = null;
};
_local3 = null;
_local2 = 0;
while (_local2 < 32) {
if ((((((((inventory.mouseX > (inventory[("ii" + (_local2 + 1))].x - (inventory[("ii" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("ii" + (_local2 + 1))].x + (inventory[("ii" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("ii" + (_local2 + 1))].y - (inventory[("ii" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("ii" + (_local2 + 1))].y + (inventory[("ii" + (_local2 + 1))].height / 2)))))){
_local3 = mygame.itemlist[dragging];
mygame.itemlist[dragging] = mygame.itemlist[(6 + _local2)];
mygame.itemlist[(6 + _local2)] = _local3;
dragging = -1;
hovering = (6 + _local2);
Mouse.show();
if (dragging < 6){
mygame.entitytypes["mob_pc"].reinitialize();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < 6) {
if ((((((((inventory.mouseX > (inventory[("ei" + (_local2 + 1))].x - (inventory[("ei" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("ei" + (_local2 + 1))].x + (inventory[("ei" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("ei" + (_local2 + 1))].y - (inventory[("ei" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("ei" + (_local2 + 1))].y + (inventory[("ei" + (_local2 + 1))].height / 2)))))){
if ((((((((((((_local2 == 0)) && ((mygame.itemlist[dragging].itype == "helm")))) || ((((_local2 == 1)) && ((mygame.itemlist[dragging].itype == "armor")))))) || ((((_local2 == 3)) && ((mygame.itemlist[dragging].itype == "weapon")))))) || ((((_local2 == 4)) && ((mygame.itemlist[dragging].itype == "boots")))))) || ((((((_local2 == 2)) || ((_local2 == 5)))) && ((mygame.itemlist[dragging].itype == "ring")))))){
_local3 = mygame.itemlist[dragging];
mygame.itemlist[dragging] = mygame.itemlist[_local2];
mygame.itemlist[_local2] = _local3;
dragging = -1;
hovering = _local2;
Mouse.show();
mygame.entitytypes["mob_pc"].reinitialize();
if (mygame.itemlist[_local2].spells[0] != null){
inventory.shownewspells.gotoAndPlay(2);
inventory.shownewspells.spoint.gotoAndPlay(2);
inventory.shownewspells.spoint.x = inventory[("s" + ((_local2 * 2) + 1))].x;
inventory.shownewspells.spoint.y = inventory[("s" + ((_local2 * 2) + 1))].y;
preloadspell((_local2 * 2));
};
if (mygame.itemlist[_local2].spells[1] != null){
preloadspell(((_local2 * 2) + 1));
};
} else {
dragging = -1;
hovering = -1;
Mouse.show();
};
};
_local2++;
};
if (dragging != -1){
dragging = -1;
Mouse.show();
};
} else {
_local2 = 0;
while (_local2 < 8) {
if ((((((((inventory.mouseX > (inventory[("qc" + (_local2 + 1))].x - (inventory[("qc" + (_local2 + 1))].width / 2)))) && ((inventory.mouseX < (inventory[("qc" + (_local2 + 1))].x + (inventory[("qc" + (_local2 + 1))].width / 2)))))) && ((inventory.mouseY > (inventory[("qc" + (_local2 + 1))].y - (inventory[("qc" + (_local2 + 1))].height / 2)))))) && ((inventory.mouseY < (inventory[("qc" + (_local2 + 1))].y + (inventory[("qc" + (_local2 + 1))].height / 2)))))){
mygame.quickbar[_local2] = (dragging - 100);
dragging = -1;
hovering = -1;
Mouse.show();
};
_local2++;
};
if (dragging != -1){
dragging = -1;
Mouse.show();
};
};
};
}
}
}//package
Section 65
//hurt1 (hurt1)
package {
import flash.media.*;
public dynamic class hurt1 extends Sound {
}
}//package
Section 66
//hurt2 (hurt2)
package {
import flash.media.*;
public dynamic class hurt2 extends Sound {
}
}//package
Section 67
//hurt3 (hurt3)
package {
import flash.media.*;
public dynamic class hurt3 extends Sound {
}
}//package
Section 68
//item (item)
package {
public class item {
public var LVL:Number;// = 0
public var itempostfix:String;// = ""
public var effectsonhit:Array;
public var identified:Boolean;// = false
public var itemname:String;// = "GENERIC ITEM"
public var effectsconst:Array;
public var itype:String;// = "WEAPON"
public var itemprefix:String;// = ""
public var iicon:Number;// = 1
public var rarity:Number;// = 0
public var basestat1:Number;
public var basestat2:Number;
public var seed:Number;
public var isnew:Boolean;// = true
public var spells:Array;
public function item(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
isnew = true;
LVL = 0;
rarity = 0;
itype = "WEAPON";
iicon = 1;
itemname = "GENERIC ITEM";
itemprefix = "";
itempostfix = "";
identified = false;
super();
seed = _arg6;
basestat1 = _arg3;
basestat2 = _arg4;
itype = _arg1;
iicon = _arg2;
effectsconst = new Array();
effectsonhit = new Array();
spells = new Array();
spells.push(null);
spells.push(null);
}
public function clearitem(){
itemprefix = "";
itempostfix = "";
spells[0] = null;
spells[1] = null;
effectsconst.splice(effectsconst.length);
effectsonhit.splice(effectsonhit.length);
}
public function addspell(_arg1:Number, _arg2:spell){
spells[_arg1] = _arg2;
}
public function addeffect(_arg1:String, _arg2:effect){
if (_arg1 == "const"){
effectsconst.push(_arg2);
};
if (_arg1 == "onhit"){
effectsonhit.push(_arg2);
};
}
}
}//package
Section 69
//loadbar (loadbar)
package {
import flash.events.*;
import flash.display.*;
public class loadbar extends MovieClip {
public var loadanim:MovieClip;
private var bytesloaded:Number;
public var loadpercent:Number;
private var bytestotal:Number;
public function loadbar(){
bytestotal = MovieClip(parent).loaderInfo.bytesTotal;
addEventListener(Event.ENTER_FRAME, loading);
}
function loading(_arg1:Event){
bytesloaded = MovieClip(parent).loaderInfo.bytesLoaded;
loadpercent = ((bytesloaded * 100) / bytestotal);
if (loadanim){
loadanim.gotoAndStop(Math.round(loadpercent));
};
if (bytesloaded >= bytestotal){
removeEventListener(Event.ENTER_FRAME, loading);
MovieClip(parent).gotoAndStop("loaded");
};
}
}
}//package
Section 70
//minimapyou (minimapyou)
package {
import flash.display.*;
public dynamic class minimapyou extends MovieClip {
}
}//package
Section 71
//music1 (music1)
package {
import flash.media.*;
public dynamic class music1 extends Sound {
}
}//package
Section 72
//music2 (music2)
package {
import flash.media.*;
public dynamic class music2 extends Sound {
}
}//package
Section 73
//music3 (music3)
package {
import flash.media.*;
public dynamic class music3 extends Sound {
}
}//package
Section 74
//procedures (procedures)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class procedures {
public static var sqrtof2:Number = Math.sqrt(2);
public static function addprop(_arg1:item, _arg2:String, _arg3:Number=1){
var _local4:effect;
var _local5:spell;
_local4 = null;
_local5 = null;
if (_arg2 == "sharp"){
_arg1.itemprefix = "SHARP";
_arg1.basestat2 = (_arg1.basestat2 + Math.ceil((_arg1.basestat2 / 5)));
if (_arg1.basestat2 >= _arg1.basestat1){
_arg1.basestat2 = (_arg1.basestat1 + 1);
};
} else {
if (_arg2 == "razor"){
_arg1.itemprefix = "RAZOR";
_arg1.basestat2 = (_arg1.basestat2 + (2 * Math.ceil((_arg1.basestat2 / 5))));
if (_arg1.basestat2 >= _arg1.basestat1){
_arg1.basestat2 = (_arg1.basestat1 + 1);
};
} else {
if (_arg2 == "comfortable"){
_arg1.itemprefix = "COMFORTABLE";
_local4 = new effect("conboost", Math.ceil((_arg3 / 2)), (("+" + Math.ceil((_arg3 / 2))) + " STAMINA"));
_arg1.addeffect("const", _local4);
_local4 = new effect("willboost", Math.ceil((_arg3 / 2)), (("+" + Math.ceil((_arg3 / 2))) + " WILL"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "keen"){
_arg1.itemprefix = "KEEN";
_local4 = new effect("strboost", Math.ceil((_arg3 / 2)), (("+" + Math.ceil((_arg3 / 2))) + " STRENGTH"));
_arg1.addeffect("const", _local4);
_local4 = new effect("intboost", Math.ceil((_arg3 / 2)), (("+" + Math.ceil((_arg3 / 2))) + " INTELLECT"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "tough"){
_arg1.itemprefix = "TOUGH";
_local4 = new effect("strboost", Math.ceil((_arg3 / 2)), (("+" + Math.ceil((_arg3 / 2))) + " STRENGTH"));
_arg1.addeffect("const", _local4);
_local4 = new effect("conboost", Math.ceil((_arg3 / 2)), (("+" + Math.ceil((_arg3 / 2))) + " STAMINA"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "smart"){
_arg1.itemprefix = "SMART";
_local4 = new effect("willboost", Math.ceil((_arg3 / 2)), (("+" + Math.ceil((_arg3 / 2))) + " WILL"));
_arg1.addeffect("const", _local4);
_local4 = new effect("intboost", Math.ceil((_arg3 / 2)), (("+" + Math.ceil((_arg3 / 2))) + " INTELLECT"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "heavy"){
_arg1.itemprefix = "HEAVY";
_local4 = new effect("strboost", _arg3, (("+" + _arg3) + " STRENGTH"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "heartening"){
_arg1.itemprefix = "HEARTENING";
_local4 = new effect("conboost", _arg3, (("+" + _arg3) + " STAMINA"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "adamant"){
_arg1.itemprefix = "ADAMANT";
_local4 = new effect("willboost", _arg3, (("+" + _arg3) + " WILL"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "bright"){
_arg1.itemprefix = "BRIGHT";
_local4 = new effect("intboost", _arg3, (("+" + _arg3) + " INTELLECT"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "cool"){
_arg1.itemprefix = "COOL";
_local4 = new effect("rfireboost", (_arg3 * 5), (("+" + (_arg3 * 5)) + " FIRE RESIST"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "insulated"){
_arg1.itemprefix = "INSULATED";
_local4 = new effect("riceboost", (_arg3 * 5), (("+" + (_arg3 * 5)) + " ICE RESIST"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "sealed"){
_arg1.itemprefix = "SEALED";
_local4 = new effect("rpoisonboost", (_arg3 * 5), (("+" + (_arg3 * 5)) + " POISON RESIST"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "grounded"){
_arg1.itemprefix = "GROUNDED";
_local4 = new effect("relectricboost", (_arg3 * 5), (("+" + (_arg3 * 5)) + " ELECTRIC RESIST"));
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "vicious"){
_arg1.itemprefix = "VICIOUS";
_arg1.basestat1 = (_arg1.basestat1 + Math.ceil((_arg1.basestat1 / 5)));
_arg1.basestat2 = (_arg1.basestat2 + Math.ceil((_arg1.basestat2 / 5)));
} else {
if (_arg2 == "heated"){
_arg1.itemprefix = "HEATED";
_local4 = new effect("hitfire", Math.ceil((_arg3 / 2)), (("+" + Math.ceil((_arg3 / 2))) + " FIRE DAMAGE"));
_arg1.addeffect("onhit", _local4);
} else {
if (_arg2 == "burning"){
_arg1.itemprefix = "BURNING";
_local4 = new effect("hitfire", _arg3, (("+" + _arg3) + " FIRE DAMAGE"));
_arg1.addeffect("onhit", _local4);
} else {
if (_arg2 == "life"){
_arg1.itempostfix = "OF LIFE";
_local4 = new effect("conboost", 1, "+1 STAMINA");
_arg1.addeffect("const", _local4);
} else {
if (_arg2 == "gusts"){
_arg1.itempostfix = "OF GUSTS";
_local5 = new spell("blast", 103, 25, "frozenwind", "FROZEN WIND");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "flashfreeze"){
_arg1.itempostfix = "OF FLASH FREEZING";
_local5 = new spell("blast", 104, 200, "flashfreeze", "FLASH FREEZE");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "flamearc"){
_arg1.itempostfix = "OF FLAME ARC";
_local5 = new spell("blast", 105, 50, "fireblast", "FLAME ARC");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "fireblast"){
_arg1.itempostfix = "OF FIRE BLAST";
_local5 = new spell("blast", 106, 200, "fireblast2", "FIRE BLAST");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "vines"){
_arg1.itempostfix = "OF VINES";
_local5 = new spell("select", 113, 40, "entangle", "ENTANGLE");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "vinefields"){
_arg1.itempostfix = "OF VINEFIELDS";
_local5 = new spell("smallradius", 114, 80, "vinefield", "VINE FIELD");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "swarms"){
_arg1.itempostfix = "OF SWARMS";
_local5 = new spell("select", 109, 70, "swarm", "SWARM");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "bolt"){
_arg1.itempostfix = "OF BOLTS";
_local5 = new spell("select", 119, 50, "bolt", "BOLT");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "massswarms"){
_arg1.itempostfix = "OF MASSIVE SWARMS";
_local5 = new spell("smallradius", 110, 140, "massswarm", "MASSIVE SWARM");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "charging"){
_arg1.itempostfix = "OF CHARGING";
_local5 = new spell("select", 107, 30, "charge", "CHARGE");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "wildcharge"){
_arg1.itempostfix = "OF WILDCHARGE";
_local5 = new spell("select", 108, 40, "charge2", "WILD CHARGE");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "soothing"){
_arg1.itempostfix = "OF SOOTHING";
_local5 = new spell("self", 111, 30, "heal", "HEAL");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "light"){
_arg1.itempostfix = "OF LIGHT";
_local5 = new spell("smallradius", 112, 100, "sanctify", "SANCTIFY");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "fireburst"){
_arg1.itempostfix = "OF IGNITING";
_local5 = new spell("smallradius", 101, 60, "fireburst", "IGNITE");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "inferno"){
_arg1.itempostfix = "OF INFERNO";
_local5 = new spell("smallradius", 102, 200, "fireburst2", "INFERNO");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "invuln"){
_arg1.itempostfix = "OF SHIELDING";
_local5 = new spell("self", 121, 50, "invuln", "SHIELD");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "crit"){
_arg1.itempostfix = "OF CRITICAL STRIKING";
_local5 = new spell("self", 120, 30, "crit", "CRITICAL STRIKE");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "charm"){
_arg1.itempostfix = "OF ATTRACTION";
_local5 = new spell("select", 122, 100, "charm", "CHARM");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "skeleton"){
_arg1.itempostfix = "OF RAISE DEAD";
_local5 = new spell("smallradius", 117, 40, "createskeleton", "CREATE SKELETON");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "skeletons"){
_arg1.itempostfix = "OF SKELETONS";
_local5 = new spell("smallradius", 118, 160, "createskeletons", "CREATE SKELETONS");
_arg1.addspell(0, _local5);
} else {
if (_arg2 == "fishluck"){
_arg1.clearitem();
_arg1.itemname = "FISH";
_arg1.basestat1 = Math.floor((_arg1.basestat1 / 2));
_arg1.basestat2 = (_arg1.basestat1 + 1);
_arg1.iicon = 11;
_arg1.itempostfix = "OF LUCK";
_local4 = new effect("lucky", 1, "+20% chance to find treasure");
_arg1.addeffect("const", _local4);
} else {
trace(("Could not find property: " + _arg2));
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public static function enemies(_arg1:entity, _arg2:entity):Boolean{
if ((((_arg1.entitytemplate.etype == "mob_pc")) || ((_arg1.charmed > 0)))){
if ((((_arg2.entitytemplate.etype == "mob_pc")) || ((_arg2.charmed > 0)))){
return (false);
};
return (true);
//unresolved jump
};
if ((((_arg2.entitytemplate.etype == "mob_pc")) || ((_arg2.charmed > 0)))){
return (true);
};
return (false);
}
public static function setproperty(_arg1:item, _arg2:Number, _arg3:Number){
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
var _local8:Array;
var _local9:Array;
var _local10:Array;
_local4 = 0;
_local5 = 0;
if ((Math.floor((_arg3 / 10000)) % 10) < 4){
_arg2--;
};
if ((Math.floor((_arg3 / 10000)) % 10) < 2){
_arg2--;
};
if ((Math.floor((_arg3 / 10000)) % 10) > 6){
_arg2++;
};
if ((Math.floor((_arg3 / 10000)) % 10) > 8){
_arg2++;
};
if (_arg2 >= 10){
_arg2 = 9;
};
if (_arg2 < 0){
_arg2 = 0;
};
_local6 = (Math.floor((_arg3 / 100)) % 100);
_local7 = new Array();
_local8 = new Array();
_local9 = new Array();
_local10 = new Array();
_local5 = 0;
while (_local5 < 20) {
_local7.push([]);
_local7[_local5].push("comfortable");
_local7[_local5].push("keen");
_local7[_local5].push("tough");
_local7[_local5].push("smart");
_local7[_local5].push("sharp");
_local7[_local5].push("heavy");
_local7[_local5].push("heartening");
_local7[_local5].push("adamant");
_local7[_local5].push("bright");
_local7[_local5].push("vicious");
_local7[_local5].push("heated");
if (_local5 > 2){
_local7[_local5].push("razor");
};
if (_local5 > 8){
_local7[_local5].push("burning");
};
_local5++;
};
_local5 = 0;
while (_local5 < 20) {
_local8.push([]);
_local8[_local5].push("fishluck");
_local8[_local5].push("crit");
_local8[_local5].push("bolt");
_local8[_local5].push("fireburst");
_local8[_local5].push("flamearc");
_local8[_local5].push("charging");
_local8[_local5].push("swarms");
_local8[_local5].push("gusts");
if (_local5 > 3){
_local8[_local5].push("skeleton");
};
if (_local5 > 10){
_local8[_local5].push("skeletons");
};
if (_local5 > 9){
_local8[_local5].push("inferno");
};
if (_local5 > 5){
_local8[_local5].push("fireblast");
};
if (_local5 > 4){
_local8[_local5].push("wildcharge");
};
if (_local5 > 7){
_local8[_local5].push("massswarms");
};
if (_local5 > 9){
_local8[_local5].push("flashfreeze");
};
_local5++;
};
_local5 = 0;
while (_local5 < 20) {
_local9.push([]);
_local9[_local5].push("cool");
_local9[_local5].push("insulated");
_local9[_local5].push("sealed");
_local9[_local5].push("grounded");
_local9[_local5].push("comfortable");
_local9[_local5].push("keen");
_local9[_local5].push("tough");
_local9[_local5].push("smart");
_local9[_local5].push("heavy");
_local9[_local5].push("adamant");
_local9[_local5].push("bright");
_local9[_local5].push("heartening");
_local5++;
};
_local5 = 0;
while (_local5 < 20) {
_local10.push([]);
_local10[_local5].push("charm");
_local10[_local5].push("invuln");
_local10[_local5].push("life");
_local10[_local5].push("vines");
_local10[_local5].push("soothing");
_local10[_local5].push("charging");
if (_local5 > 3){
_local9[_local5].push("skeleton");
};
if (_local5 > 3){
_local9[_local5].push("vinefields");
};
if (_local5 > 4){
_local9[_local5].push("wildcharge");
};
if (_local5 > 7){
_local9[_local5].push("light");
};
if (_local5 > 10){
_local9[_local5].push("skeletons");
};
_local5++;
};
if (_arg1.itype == "weapon"){
if ((((((_arg1.itemprefix == "")) && ((((_arg3 % 6351) / 6351) > 0.5)))) || (!((_arg1.itempostfix == ""))))){
_local6 = Math.floor(((_local6 / 100) * _local7[_arg2].length));
procedures.addprop(_arg1, _local7[_arg2][_local6], ((_arg2 + 1) + Math.round(((_arg3 % 51789) / 51789))));
} else {
_local6 = Math.floor(((_local6 / 100) * _local8[_arg2].length));
procedures.addprop(_arg1, _local8[_arg2][_local6], ((_arg2 + 1) + Math.round(((_arg3 % 51789) / 51789))));
};
} else {
if ((((((((_arg1.itype == "ring")) || ((_arg1.itype == "armor")))) || ((_arg1.itype == "helm")))) || ((_arg1.itype == "boots")))){
if ((((((_arg1.itemprefix == "")) && ((((_arg3 % 6351) / 6351) > 0.5)))) || (!((_arg1.itempostfix == ""))))){
_local6 = Math.floor(((_local6 / 100) * _local9[_arg2].length));
procedures.addprop(_arg1, _local9[_arg2][_local6], ((_arg2 + 1) + Math.round(((_arg3 % 51789) / 51789))));
} else {
_local6 = Math.floor(((_local6 / 100) * _local10[_arg2].length));
procedures.addprop(_arg1, _local10[_arg2][_local6], ((_arg2 + 1) + Math.round(((_arg3 % 51789) / 51789))));
};
};
};
}
public static function proc(_arg1:entity, _arg2:String, _arg3:Number=0, _arg4:Number=0, _arg5:entity=null){
var _local6:String;
var _local7:Boolean;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:String;
var _local18:Number;
if (_arg5 == null){
_arg5 = _arg1;
};
_arg1.magic = (_arg1.magic - _arg4);
_local6 = "";
_local7 = false;
_local8 = 0;
_local9 = 0;
_local10 = 0;
_local11 = 0;
_local12 = 0;
_local13 = 0;
_local14 = 0;
_local15 = 0;
_local16 = 0;
if (_arg2 == "lucky"){
_arg1.mygame.magicfind = (_arg1.mygame.magicfind + 2);
} else {
if (_arg2 == "crit"){
_arg1.chargedeffect = "crit";
} else {
if (_arg2 == "invuln"){
_arg1.chargedeffect = "invuln3";
} else {
if (_arg2 == "strboost"){
_arg1.STR = (_arg1.STR + _arg3);
} else {
if (_arg2 == "conboost"){
_arg1.CON = (_arg1.CON + _arg3);
} else {
if (_arg2 == "willboost"){
_arg1.WILL = (_arg1.WILL + _arg3);
} else {
if (_arg2 == "intboost"){
_arg1.INT = (_arg1.INT + _arg3);
} else {
if (_arg2 == "die"){
_arg1.dead = true;
} else {
if (_arg2 == "heal"){
_local10 = _arg1.heal((20 * (1 + (_arg1.INT / 20))));
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], (_arg1.worldx - 5), (_arg1.worldy + 5), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("heal");
} else {
if (_arg2 == "healother"){
_local10 = _arg5.heal((20 * (1 + (_arg1.INT / 20))));
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], (_arg5.worldx - 5), (_arg5.worldy + 5), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("heal");
} else {
if (_arg2 == "rfireboost"){
_arg1.RFIRE = (_arg1.RFIRE + _arg3);
} else {
if (_arg2 == "riceboost"){
_arg1.RICE = (_arg1.RICE + _arg3);
} else {
if (_arg2 == "rpoisonboost"){
_arg1.RPOISON = (_arg1.RPOISON + _arg3);
} else {
if (_arg2 == "relectricboost"){
_arg1.RELECTRIC = (_arg1.RELECTRIC + _arg3);
} else {
if (_arg2 == "createskeleton"){
_arg1.mygame.destroysummons();
if (_arg1.INT < 14){
_local6 = "mob_enemy_skeleton";
} else {
if (_arg1.INT < 17){
_local6 = "mob_enemy_frostskeleton";
} else {
if (_arg1.INT < 20){
_local6 = "mob_enemy_flameskeleton";
} else {
if (_arg1.INT < 25){
_local6 = "mob_enemy_beastskeleton";
} else {
_local6 = "mob_enemy_beastskeleton";
};
};
};
};
_arg1.mygame.entitylist.push(new entity(_local6, _arg1.mygame.entitytypes[_local6], _arg1.mygame.selector.worldx, _arg1.mygame.selector.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].charmed = 1000;
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].noxp = true;
} else {
if (_arg2 == "createskeletons"){
_arg1.mygame.destroysummons();
if (_arg1.INT < 14){
_local6 = "mob_enemy_skeleton";
} else {
if (_arg1.INT < 17){
_local6 = "mob_enemy_frostskeleton";
} else {
if (_arg1.INT < 20){
_local6 = "mob_enemy_flameskeleton";
} else {
if (_arg1.INT < 25){
_local6 = "mob_enemy_beastskeleton";
} else {
_local6 = "mob_enemy_beastskeleton";
};
};
};
};
_arg1.mygame.entitylist.push(new entity(_local6, _arg1.mygame.entitytypes[_local6], (_arg1.mygame.selector.worldx - 12), (_arg1.mygame.selector.worldy - 8), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].charmed = 1000;
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].noxp = true;
_arg1.mygame.entitylist.push(new entity(_local6, _arg1.mygame.entitytypes[_local6], (_arg1.mygame.selector.worldx + 12), (_arg1.mygame.selector.worldy - 8), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].charmed = 1000;
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].noxp = true;
_arg1.mygame.entitylist.push(new entity(_local6, _arg1.mygame.entitytypes[_local6], _arg1.mygame.selector.worldx, (_arg1.mygame.selector.worldy + 10), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].charmed = 1000;
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].noxp = true;
} else {
if (_arg2 == "cry"){
_local15 = 0;
while (_local15 < _arg1.mygame.entitylist.length) {
if (_arg1.mygame.entitylist[_local15] != null){
if (((((!((_arg5 == _arg1.mygame.entitylist[_local15]))) && ((_arg1.mygame.entitylist[_local15].etype.substr(0, 3) == "mob")))) && (!((_arg1.mygame.entitylist[_local15].etype == "mob_pc"))))){
_local11 = (((_arg5.worldx - _arg1.mygame.entitylist[_local15].worldx) * (_arg5.worldx - _arg1.mygame.entitylist[_local15].worldx)) + ((_arg5.worldy - _arg1.mygame.entitylist[_local15].worldy) * (_arg5.worldy - _arg1.mygame.entitylist[_local15].worldy)));
if (_local11 < (_arg5.entitytemplate.vdist * _arg5.entitytemplate.vdist)){
if (_arg1.mygame.los(_arg5, _arg1.mygame.entitylist[_local15])){
if (_arg1.mygame.entitylist[_local15].brain.FSMstate == "watchful"){
_arg1.mygame.entitylist[_local15].ctarget = _arg1;
_arg1.mygame.entitylist[_local15].brain.FSMstate = "pursuing";
};
};
};
};
};
_local15++;
};
} else {
if (_arg2 == "hit"){
if (_arg1){
if (_arg1.mygame.player == _arg1){
if (_arg1.mygame.ptargeted != null){
if (_arg1.mygame.itemlist[3] != null){
_local12 = (_arg1.mygame.itemlist[3].basestat1 + Math.floor((Math.random() * ((_arg1.mygame.itemlist[3].basestat2 - _arg1.mygame.itemlist[3].basestat1) + 1))));
_local17 = "physical";
if (_arg1.entitytemplate.cclass == "cursed"){
_local18 = Math.floor((Math.random() * 4));
if (_local18 == 0){
_local17 = "fire";
};
if (_local18 == 1){
_local17 = "ice";
};
if (_local18 == 2){
_local17 = "electric";
};
if (_local18 == 3){
_local17 = "poison";
};
};
if (_arg1.chargedeffect == "crit"){
_local12 = (_local12 + (_local12 * (1 + (_arg1.INT / 20))));
_arg1.chargedeffect = "";
};
_local10 = _arg1.mygame.ptargeted.damage((_local12 * (1 + (_arg1.STR / 20))), _local17, _arg1);
_local15 = 0;
while (_local15 < _arg1.mygame.itemlist[3].effectsonhit.length) {
proc(_arg1, _arg1.mygame.itemlist[3].effectsonhit[_local15].etype, _arg1.mygame.itemlist[3].effectsonhit[_local15].intensity);
_local15++;
};
} else {
_local10 = _arg1.mygame.ptargeted.damage((1 * (1 + (_arg1.STR / 20))));
};
};
} else {
if (_arg1.ctarget != null){
if (_arg1.entitytemplate.DTYPE != "physical"){
_local10 = _arg1.ctarget.damage(((2 + (_arg3 * 2)) * (1 * (1 + (_arg1.STR / 20)))), _arg1.entitytemplate.DTYPE, _arg1);
} else {
_local10 = _arg1.ctarget.damage(((2 + (_arg3 * 2)) * (1 * (1 + (_arg1.INT / 20)))), _arg1.entitytemplate.DTYPE, _arg1);
};
};
};
if (_arg1.entitytemplate.race == "vampire"){
_local10 = _arg1.heal((_local10 / 6));
if (_local10 > 0){
_arg1.mygame.messagelist.push(("<font color='#00FF55'>VAMPIRIC HEALING HEALS YOU FOR " + _local10));
};
};
if (_arg1.entitytemplate.race == "demon"){
if (_arg1.mygame.ptargeted != null){
_local10 = _arg1.mygame.ptargeted.damage(((_arg1.LVL / 2) * (1 + (_arg1.INT / 20))), "fire");
};
};
};
} else {
if (_arg2 == "hitfire"){
_local12 = _arg3;
if (_arg1.mygame.ptargeted != null){
_local10 = _arg1.mygame.ptargeted.damage(_arg3, "fire");
};
} else {
if (_arg2 == "shootproj1"){
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.worldx, _arg1.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("proj1");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].ctarget = _arg5;
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].LVL = (10 * (1 + (_arg1.INT / 20)));
} else {
if (_arg2 == "shootproj2"){
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.worldx, _arg1.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("proj2");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].ctarget = _arg5;
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].LVL = (10 * (1 + (_arg1.INT / 20)));
} else {
if (_arg2 == "shootproj3"){
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.worldx, _arg1.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("proj3");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].ctarget = _arg5;
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].LVL = (10 * (1 + (_arg1.INT / 20)));
} else {
if (_arg2 == "shootproj4"){
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.worldx, _arg1.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("proj4");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].ctarget = _arg5;
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].LVL = (10 * (1 + (_arg1.INT / 20)));
} else {
if (_arg2 == "shootproj5"){
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.worldx, _arg1.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("proj5");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].ctarget = _arg5;
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].LVL = (10 * (1 + (_arg1.INT / 20)));
} else {
if (_arg2 == "charm"){
_arg5.charmed = (120 * (1 + (_arg1.INT / 20)));
} else {
if (_arg2 == "swarm"){
_arg5.giveongoing((4 * (1 + (_arg1.INT / 20))), "swarmed", (180 + Math.floor((Math.random() * 30))));
} else {
if (_arg2 == "entangle"){
_arg5.giveongoing(0, "immobile", (180 + Math.floor((Math.random() * 30))));
} else {
if (_arg2 == "sanctify"){
_arg1.mygame.entitylist.push(new entity("vfx_zones", _arg1.mygame.entitytypes["vfx_zones"], _arg1.mygame.selector.worldx, _arg1.mygame.selector.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("heal");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].duration = 400;
} else {
if (_arg2 == "vinefield"){
_arg1.mygame.entitylist.push(new entity("vfx_zones", _arg1.mygame.entitytypes["vfx_zones"], _arg1.mygame.selector.worldx, _arg1.mygame.selector.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("vines");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].duration = 200;
} else {
if (_arg2 == "massswarm"){
_arg1.mygame.entitylist.push(new entity("vfx_zones", _arg1.mygame.entitytypes["vfx_zones"], _arg1.mygame.selector.worldx, _arg1.mygame.selector.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("swarm");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].duration = 200;
} else {
if (_arg2 == "inferno"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
_arg1.mygame.entitylist.push(new entity("vfx_zones", _arg1.mygame.entitytypes["vfx_zones"], _arg1.mygame.selector.worldx, _arg1.mygame.selector.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("fire");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].duration = 200;
} else {
if (_arg2 == "scavenge"){
_local10 = _arg5.damage((30 * (1 + (_arg1.INT / 20))));
if (_arg5.hp <= 0){
_local15 = 0;
while (_local15 < 20) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg5.worldx, _arg5.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("healbone");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor((Math.random() * 9));
_local10 = ((Math.random() * Math.PI) * 2);
_local11 = (1 + (Math.random() * 10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_local15++;
};
};
} else {
if (_arg2 == "charge"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
_local14 = Math.sqrt((((_arg1.worldx - _arg5.worldx) * (_arg1.worldx - _arg5.worldx)) + ((_arg1.worldy - _arg5.worldy) * (_arg1.worldy - _arg5.worldy))));
_local15 = 0;
while (_local15 < Math.floor((_local14 / 5))) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], (_arg1.worldx + (((_arg5.worldx - _arg1.worldx) * _local15) / Math.floor((_local14 / 5)))), (_arg1.worldy + (((_arg5.worldy - _arg1.worldy) * _local15) / Math.floor((_local14 / 5)))), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("dust1");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor(((10 - ((_local15 * 10) / Math.floor((_local14 / 5)))) + (Math.random() * 5)));
_local10 = ((Math.random() * Math.PI) * 2);
_local11 = (1 + (Math.random() * 5));
_local11 = (_local11 / 2);
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_local15++;
};
_arg1.worldx = _arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].worldx;
_arg1.worldy = _arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].worldy;
_arg1.aim((_arg5.worldx - _arg1.worldx), (_arg5.worldy - _arg1.worldy));
if (_arg1 == _arg1.mygame.player){
_arg1.moving = false;
_arg1.setanim("attacked");
_arg1.mygame.ptarget = _arg5;
};
_local14 = (_local14 / 250);
if (_local14 > 1){
_local14 = 1;
};
_local10 = _arg5.damage(((30 * _local14) * (1 + (_arg1.STR / 20))));
} else {
if (_arg2 == "charge2"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
_local14 = Math.sqrt((((_arg1.worldx - _arg5.worldx) * (_arg1.worldx - _arg5.worldx)) + ((_arg1.worldy - _arg5.worldy) * (_arg1.worldy - _arg5.worldy))));
_local15 = 0;
while (_local15 < Math.floor((_local14 / 5))) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], (_arg1.worldx + (((_arg5.worldx - _arg1.worldx) * _local15) / Math.floor((_local14 / 5)))), (_arg1.worldy + (((_arg5.worldy - _arg1.worldy) * _local15) / Math.floor((_local14 / 5)))), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("dust1");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor(((10 - ((_local15 * 10) / Math.floor((_local14 / 5)))) + (Math.random() * 5)));
_local10 = ((Math.random() * Math.PI) * 2);
_local11 = (1 + (Math.random() * 5));
_local11 = (_local11 / 2);
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_local15++;
};
_local15 = 0;
while (_local15 < _arg1.mygame.screenentitylist.length) {
if (((((!((_arg1.mygame.screenentitylist[_local15] == _arg5))) && (!((_arg1.mygame.screenentitylist[_local15] == _arg1))))) && ((_arg1.mygame.screenentitylist[_local15].etype.substr(0, 3) == "mob")))){
_local7 = false;
_local16 = 0;
while (_local16 < 20) {
_local8 = (((_arg1.worldx * (20 - _local16)) + (_arg5.worldx * _local16)) / 20);
_local9 = (((_arg1.worldy * (20 - _local16)) + (_arg5.worldy * _local16)) / 20);
if ((((_arg1.mygame.screenentitylist[_local15].worldx - _local8) * (_arg1.mygame.screenentitylist[_local15].worldx - _local8)) + ((_arg1.mygame.screenentitylist[_local15].worldy - _local9) * (_arg1.mygame.screenentitylist[_local15].worldy - _local9))) < 81){
_local7 = true;
};
_local16++;
};
if (_local7){
_local10 = _arg1.mygame.screenentitylist[_local15].damage((15 * (1 + (_arg1.STR / 20))));
};
};
_local15++;
};
_arg1.worldx = _arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].worldx;
_arg1.worldy = _arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].worldy;
_arg1.aim((_arg5.worldx - _arg1.worldx), (_arg5.worldy - _arg1.worldy));
if (_arg1 == _arg1.mygame.player){
_arg1.moving = false;
_arg1.setanim("attacked");
_arg1.mygame.ptarget = _arg5;
};
_local14 = (_local14 / 250);
if (_local14 > 1){
_local14 = 1;
};
_local10 = _arg5.damage(((40 * _local14) * (1 + (_arg1.STR / 20))));
} else {
if (_arg2 == "fireburst"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
_local15 = 0;
while (_local15 < 20) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg5.worldx, _arg5.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("fire1");
_local10 = ((Math.random() * Math.PI) * 2);
_local11 = (1 + (Math.random() * 10));
_local11 = (10 - ((_local11 * _local11) / 10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor((Math.random() * 8));
_local15++;
};
_local15 = 0;
while (_local15 < _arg1.mygame.screenentitylist.length) {
if (_arg1.mygame.screenentitylist[_local15].etype.substr(0, 3) == "mob"){
if (procedures.enemies(_arg1, _arg1.mygame.screenentitylist[_local15])){
_local11 = (((_arg5.worldx - _arg1.mygame.screenentitylist[_local15].worldx) * (_arg5.worldx - _arg1.mygame.screenentitylist[_local15].worldx)) + ((_arg5.worldy - _arg1.mygame.screenentitylist[_local15].worldy) * (_arg5.worldy - _arg1.mygame.screenentitylist[_local15].worldy)));
if (_local11 < (30 * 30)){
_local10 = _arg1.mygame.screenentitylist[_local15].damage((25 * (1 + (_arg1.INT / 20))), "fire");
};
};
};
_local15++;
};
} else {
if (_arg2 == "discharge"){
_arg1.mygame.myroot.sounds.playsound("shock", 0, 0.5);
_local15 = 0;
while (_local15 < 5) {
_local10 = ((Math.random() * Math.PI) * 2);
_local11 = (10 + (Math.random() * 25));
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], (_arg1.worldx + (_local11 * Math.cos(_local10))), (_arg1.worldy + (_local11 * Math.sin(_local10))), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("lightning");
_local15++;
};
_local15 = 0;
while (_local15 < _arg1.mygame.screenentitylist.length) {
if (_arg1.mygame.screenentitylist[_local15].etype.substr(0, 3) == "mob"){
if (procedures.enemies(_arg1, _arg1.mygame.screenentitylist[_local15])){
_local11 = (((_arg1.worldx - _arg1.mygame.screenentitylist[_local15].worldx) * (_arg1.worldx - _arg1.mygame.screenentitylist[_local15].worldx)) + ((_arg1.worldy - _arg1.mygame.screenentitylist[_local15].worldy) * (_arg1.worldy - _arg1.mygame.screenentitylist[_local15].worldy)));
if (_local11 < (30 * 30)){
_local10 = _arg1.mygame.screenentitylist[_local15].damage((30 * (1 + (_arg1.INT / 20))), "electric");
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], ((_arg1.mygame.screenentitylist[_local15].worldx + _local11) - 5), (_arg1.mygame.screenentitylist[_local15].worldy + 5), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("lightning");
};
};
};
_local15++;
};
} else {
if (_arg2 == "asplode"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
_local15 = 0;
while (_local15 < 20) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.worldx, _arg1.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("fire1");
_local10 = ((Math.random() * Math.PI) * 2);
_local11 = (1 + (Math.random() * 10));
_local11 = (10 - ((_local11 * _local11) / 10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor((Math.random() * 8));
_local15++;
};
_local15 = 0;
while (_local15 < _arg1.mygame.screenentitylist.length) {
if (_arg1.mygame.screenentitylist[_local15].etype.substr(0, 3) == "mob"){
if (procedures.enemies(_arg1, _arg1.mygame.screenentitylist[_local15])){
_local11 = (((_arg1.worldx - _arg1.mygame.screenentitylist[_local15].worldx) * (_arg1.worldx - _arg1.mygame.screenentitylist[_local15].worldx)) + ((_arg1.worldy - _arg1.mygame.screenentitylist[_local15].worldy) * (_arg1.worldy - _arg1.mygame.screenentitylist[_local15].worldy)));
if (_local11 < (30 * 30)){
_local10 = _arg1.mygame.screenentitylist[_local15].damage((50 * (1 + (_arg1.INT / 20))), "fire");
};
};
};
_local15++;
};
} else {
if (_arg2 == "bolt"){
_arg1.mygame.myroot.sounds.playsound("shock", 0, 0.5);
_local10 = _arg5.damage((40 * (1 + (_arg1.INT / 20))), "electric");
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], ((_arg5.worldx + _local11) - 5), (_arg5.worldy + 5), _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("lightning");
} else {
if (_arg2 == "frozenwind"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
_local13 = Math.atan2(((_arg1.mygame.mouseY + (_arg1.mygame.mouseX / 2)) / sqrtof2), (((_arg1.mygame.mouseX / 2) - _arg1.mygame.mouseY) / sqrtof2));
_local15 = 0;
while (_local15 < 20) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.mygame.player.worldx, _arg1.mygame.player.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("cold1");
_local10 = ((_local13 - (Math.PI / 10)) + ((Math.random() * Math.PI) / 5));
_local11 = (Math.random() * 20);
_local11 = (25 - ((_local11 * _local11) / 20));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor((Math.random() * 8));
_local15++;
};
_local15 = 0;
while (_local15 < _arg1.mygame.screenentitylist.length) {
if ((((_arg1.mygame.screenentitylist[_local15].etype.substr(0, 3) == "mob")) && (!((_arg1.mygame.screenentitylist[_local15] == _arg1.mygame.player))))){
_local11 = Math.sqrt((((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx) * (_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)) + ((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy) * (_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy))));
_local10 = Math.atan2(-((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy)), -((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)));
if ((((((_local11 < (200 / 2))) && ((Math.abs((_local10 - _local13)) < (Math.PI / 10))))) || ((Math.abs((_local10 - _local13)) > ((Math.PI * 2) - (Math.PI / 10)))))){
_arg1.mygame.screenentitylist[_local15].damage((15 * (1 + (_arg1.INT / 20))), "ice");
};
};
_local15++;
};
} else {
if (_arg2 == "boneshrapnel"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
_local13 = Math.atan2(((_arg1.mygame.mouseY + (_arg1.mygame.mouseX / 2)) / sqrtof2), (((_arg1.mygame.mouseX / 2) - _arg1.mygame.mouseY) / sqrtof2));
_local15 = 0;
while (_local15 < 20) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.mygame.player.worldx, _arg1.mygame.player.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("bone");
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].duration = 20;
_local10 = ((_local13 - (Math.PI / 10)) + ((Math.random() * Math.PI) / 5));
_local11 = (Math.random() * 20);
_local11 = (25 - ((_local11 * _local11) / 20));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor((Math.random() * 8));
_local15++;
};
_local15 = 0;
while (_local15 < _arg1.mygame.screenentitylist.length) {
if ((((_arg1.mygame.screenentitylist[_local15].etype.substr(0, 3) == "mob")) && (!((_arg1.mygame.screenentitylist[_local15] == _arg1.mygame.player))))){
_local11 = Math.sqrt((((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx) * (_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)) + ((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy) * (_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy))));
_local10 = Math.atan2(-((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy)), -((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)));
if ((((((_local11 < (200 / 2))) && ((Math.abs((_local10 - _local13)) < (Math.PI / 10))))) || ((Math.abs((_local10 - _local13)) > ((Math.PI * 2) - (Math.PI / 10)))))){
_arg1.mygame.screenentitylist[_local15].damage((60 * (1 + (_arg1.INT / 20))));
};
};
_local15++;
};
_arg1.hp = (_arg1.hp - Math.floor((_arg1.maxhp / 4)));
_arg1.mygame.messagelist.push((("<font color='#FF0000'>YOU SACRIFICE " + Math.floor((_arg1.maxhp / 2))) + " LIFE"));
} else {
if (_arg2 == "flashfreeze"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
_local13 = Math.atan2(((_arg1.mygame.mouseY + (_arg1.mygame.mouseX / 2)) / sqrtof2), (((_arg1.mygame.mouseX / 2) - _arg1.mygame.mouseY) / sqrtof2));
_local15 = 0;
while (_local15 < 20) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.mygame.player.worldx, _arg1.mygame.player.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("cold1");
_local10 = ((_local13 - (Math.PI / 10)) + ((Math.random() * Math.PI) / 5));
_local11 = (Math.random() * 20);
_local11 = (25 - ((_local11 * _local11) / 20));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor((Math.random() * 8));
_local15++;
};
_local15 = 0;
while (_local15 < _arg1.mygame.screenentitylist.length) {
if ((((_arg1.mygame.screenentitylist[_local15].etype.substr(0, 3) == "mob")) && (!((_arg1.mygame.screenentitylist[_local15] == _arg1.mygame.player))))){
_local11 = Math.sqrt((((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx) * (_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)) + ((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy) * (_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy))));
_local10 = Math.atan2(-((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy)), -((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)));
if ((((((_local11 < (200 / 2))) && ((Math.abs((_local10 - _local13)) < (Math.PI / 10))))) || ((Math.abs((_local10 - _local13)) > ((Math.PI * 2) - (Math.PI / 10)))))){
_arg1.mygame.screenentitylist[_local15].damage((25 * (1 + (_arg1.INT / 20))), "ice");
_arg1.mygame.screenentitylist[_local15].giveongoing(0, "freeze", (180 + Math.floor((Math.random() * 30))));
_arg1.mygame.screenentitylist[_local15].setanim("idle");
};
};
_local15++;
};
} else {
if (_arg2 == "fireblast"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
if (_arg1.mygame.player == _arg1){
_local13 = Math.atan2(((_arg1.mygame.mouseY + (_arg1.mygame.mouseX / 2)) / sqrtof2), (((_arg1.mygame.mouseX / 2) - _arg1.mygame.mouseY) / sqrtof2));
} else {
_local13 = Math.atan2((_arg1.mygame.player.worldy - _arg1.worldy), (_arg1.mygame.player.worldx - _arg1.worldx));
};
_local15 = 0;
while (_local15 < 20) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.worldx, _arg1.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("fire1");
_local10 = ((_local13 - (Math.PI / 10)) + ((Math.random() * Math.PI) / 5));
_local11 = (Math.random() * 25);
_local11 = (25 - ((_local11 * _local11) / 25));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor((Math.random() * 8));
_local15++;
};
if (_arg1.mygame.player == _arg1){
_local15 = 0;
while (_local15 < _arg1.mygame.screenentitylist.length) {
if ((((_arg1.mygame.screenentitylist[_local15].etype.substr(0, 3) == "mob")) && (!((_arg1.mygame.screenentitylist[_local15] == _arg1.mygame.player))))){
_local11 = Math.sqrt((((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx) * (_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)) + ((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy) * (_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy))));
_local10 = Math.atan2(-((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy)), -((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)));
if ((((((_local11 < (200 / 2))) && ((Math.abs((_local10 - _local13)) < (Math.PI / 10))))) || ((Math.abs((_local10 - _local13)) > ((Math.PI * 2) - (Math.PI / 10)))))){
_arg1.mygame.screenentitylist[_local15].damage((20 * (1 + (_arg1.INT / 20))), "fire");
};
};
_local15++;
};
} else {
_local11 = Math.sqrt((((_arg1.mygame.player.worldx - _arg1.worldx) * (_arg1.mygame.player.worldx - _arg1.worldx)) + ((_arg1.mygame.player.worldy - _arg1.worldy) * (_arg1.mygame.player.worldy - _arg1.worldy))));
_local10 = Math.atan2((_arg1.mygame.player.worldy - _arg1.worldy), (_arg1.mygame.player.worldx - _arg1.worldx));
if ((((((_local11 < (200 / 2))) && ((Math.abs((_local10 - _local13)) < (Math.PI / 10))))) || ((Math.abs((_local10 - _local13)) > ((Math.PI * 2) - (Math.PI / 10)))))){
_arg1.mygame.player.damage((20 * (1 + (_arg1.INT / 20))), "fire");
};
};
} else {
if (_arg2 == "fireblast2"){
_arg1.mygame.myroot.sounds.playsound("whoosh", 0, 0.5);
if (_arg1.mygame.player == _arg1){
_local13 = Math.atan2(((_arg1.mygame.mouseY + (_arg1.mygame.mouseX / 2)) / sqrtof2), (((_arg1.mygame.mouseX / 2) - _arg1.mygame.mouseY) / sqrtof2));
} else {
_local13 = Math.atan2((_arg1.mygame.player.worldy - _arg1.worldy), (_arg1.mygame.player.worldx - _arg1.worldx));
};
_local15 = 0;
while (_local15 < 20) {
_arg1.mygame.entitylist.push(new entity("vfx_poofs", _arg1.mygame.entitytypes["vfx_poofs"], _arg1.worldx, _arg1.worldy, _arg1.mygame));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].setanim("fire1");
_local10 = ((_local13 - (Math.PI / 10)) + ((Math.random() * Math.PI) / 5));
_local11 = (Math.random() * 25);
_local11 = (25 - ((_local11 * _local11) / 25));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldx = (_local11 * Math.cos(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].tworldy = (_local11 * Math.sin(_local10));
_arg1.mygame.entitylist[(_arg1.mygame.entitylist.length - 1)].framecounter = Math.floor((Math.random() * 8));
_local15++;
};
if (_arg1.mygame.player == _arg1){
_local15 = 0;
while (_local15 < _arg1.mygame.screenentitylist.length) {
if ((((_arg1.mygame.screenentitylist[_local15].etype.substr(0, 3) == "mob")) && (!((_arg1.mygame.screenentitylist[_local15] == _arg1.mygame.player))))){
_local11 = Math.sqrt((((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx) * (_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)) + ((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy) * (_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy))));
_local10 = Math.atan2(-((_arg1.mygame.player.worldy - _arg1.mygame.screenentitylist[_local15].worldy)), -((_arg1.mygame.player.worldx - _arg1.mygame.screenentitylist[_local15].worldx)));
if ((((((_local11 < (200 / 2))) && ((Math.abs((_local10 - _local13)) < (Math.PI / 10))))) || ((Math.abs((_local10 - _local13)) > ((Math.PI * 2) - (Math.PI / 10)))))){
_arg1.mygame.screenentitylist[_local15].damage((30 * (1 + (_arg1.INT / 20))), "fire");
_arg1.mygame.screenentitylist[_local15].giveongoing((5 * (1 + (_arg1.INT / 20))), "fire", (180 + Math.floor((Math.random() * 30))));
};
};
_local15++;
};
} else {
_local11 = Math.sqrt((((_arg1.mygame.player.worldx - _arg1.worldx) * (_arg1.mygame.player.worldx - _arg1.worldx)) + ((_arg1.mygame.player.worldy - _arg1.worldy) * (_arg1.mygame.player.worldy - _arg1.worldy))));
_local10 = Math.atan2((_arg1.mygame.player.worldy - _arg1.worldy), (_arg1.mygame.player.worldx - _arg1.worldx));
if ((((((_local11 < (200 / 2))) && ((Math.abs((_local10 - _local13)) < (Math.PI / 10))))) || ((Math.abs((_local10 - _local13)) > ((Math.PI * 2) - (Math.PI / 10)))))){
_arg1.mygame.player.damage((30 * (1 + (_arg1.INT / 20))));
_arg1.mygame.player.giveongoing((5 * (1 + (_arg1.INT / 20))), "fire", (180 + Math.floor((Math.random() * 30))));
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public static function setfamily(_arg1:item, _arg2:Number, _arg3:Number){
var _local4:Number;
var _local5:Number;
_local4 = 0;
_local5 = 0;
if ((Math.floor((_arg3 / 10)) % 10) < 2){
_arg2--;
};
if ((Math.floor((_arg3 / 10)) % 10) < 1){
_arg2--;
};
if ((Math.floor((_arg3 / 10)) % 10) > 7){
_arg2++;
};
if ((Math.floor((_arg3 / 10)) % 10) > 8){
_arg2++;
};
if (_arg2 < 1){
_arg2 = 1;
};
_arg1.LVL = _arg2;
if (_arg1.itype.substr(0, 6) == "weapon"){
if (_arg1.itype == "weaponsword"){
if (_arg2 == 1){
_arg1.itemname = "WORN SWORD";
_arg1.basestat1 = 5;
_arg1.basestat2 = 7;
_arg1.iicon = 1;
};
if (_arg2 == 2){
_arg1.itemname = "IRON SWORD";
_arg1.basestat1 = 6;
_arg1.basestat2 = 8;
_arg1.iicon = 2;
};
if (_arg2 == 3){
_arg1.itemname = "COPPER SWORD";
_arg1.basestat1 = 6;
_arg1.basestat2 = 9;
_arg1.iicon = 3;
};
if (_arg2 == 4){
_arg1.itemname = "STEEL SWORD";
_arg1.basestat1 = 7;
_arg1.basestat2 = 10;
_arg1.iicon = 4;
};
if (_arg2 == 5){
_arg1.itemname = "CRAFTED SWORD";
_arg1.basestat1 = 7;
_arg1.basestat2 = 11;
_arg1.iicon = 5;
};
if (_arg2 == 6){
_arg1.itemname = "WIDE BLADE";
_arg1.basestat1 = 8;
_arg1.basestat2 = 12;
_arg1.iicon = 6;
};
if (_arg2 == 7){
_arg1.itemname = "TALWAR";
_arg1.basestat1 = 8;
_arg1.basestat2 = 13;
_arg1.iicon = 7;
};
if (_arg2 == 8){
_arg1.itemname = "SERRATED BLADE";
_arg1.basestat1 = 9;
_arg1.basestat2 = 14;
_arg1.iicon = 8;
};
if (_arg2 == 9){
_arg1.itemname = "DEEPFORGED BLADE";
_arg1.basestat1 = 9;
_arg1.basestat2 = 15;
_arg1.iicon = 9;
};
if (_arg2 == 10){
_arg1.itemname = "WINGED BLADE";
_arg1.basestat1 = 10;
_arg1.basestat2 = 16;
_arg1.iicon = 10;
};
if (_arg2 > 10){
_arg1.itemname = "PERFECT BLADE";
_arg1.iicon = (((_arg2 - 10) % 6) + 5);
_arg1.basestat1 = (12 + (_arg2 - 10));
_arg1.basestat2 = (16 + (_arg2 - 10));
};
};
if (_arg1.itype == "weaponaxe"){
if (_arg2 == 1){
_arg1.itemname = "AXE";
_arg1.basestat1 = 3;
_arg1.basestat2 = 8;
_arg1.iicon = 12;
};
if (_arg2 == 2){
_arg1.itemname = "AXE";
_arg1.basestat1 = 4;
_arg1.basestat2 = 9;
_arg1.iicon = 12;
};
if (_arg2 == 3){
_arg1.itemname = "SPIKED AXE";
_arg1.basestat1 = 4;
_arg1.basestat2 = 10;
_arg1.iicon = 13;
};
if (_arg2 == 4){
_arg1.itemname = "SPIKED AXE";
_arg1.basestat1 = 5;
_arg1.basestat2 = 11;
_arg1.iicon = 13;
};
if (_arg2 == 5){
_arg1.itemname = "JAWBONE AXE";
_arg1.basestat1 = 5;
_arg1.basestat2 = 12;
_arg1.iicon = 14;
};
if (_arg2 == 6){
_arg1.itemname = "DOUBLE AXE";
_arg1.basestat1 = 6;
_arg1.basestat2 = 13;
_arg1.iicon = 15;
};
if (_arg2 == 7){
_arg1.itemname = "DOUBLE AXE";
_arg1.basestat1 = 6;
_arg1.basestat2 = 14;
_arg1.iicon = 15;
};
if (_arg2 == 8){
_arg1.itemname = "BARDICHE";
_arg1.basestat1 = 7;
_arg1.basestat2 = 15;
_arg1.iicon = 16;
};
if (_arg2 == 9){
_arg1.itemname = "BARDICHE";
_arg1.basestat1 = 7;
_arg1.basestat2 = 16;
_arg1.iicon = 16;
};
if (_arg2 == 10){
_arg1.itemname = "WINGED AXE";
_arg1.basestat1 = 8;
_arg1.basestat2 = 17;
_arg1.iicon = 17;
};
if (_arg2 > 10){
_arg1.itemname = "PERFECT AXE";
_arg1.iicon = (14 + ((_arg2 - 10) % 4));
_arg1.basestat1 = Math.floor(((17 + (_arg2 - 10)) / 2));
_arg1.basestat2 = (17 + (_arg2 - 10));
};
};
if (_arg1.itype == "weaponstaff"){
if (_arg2 == 1){
_arg1.itemname = "CROOKED STAFF";
_arg1.basestat1 = 3;
_arg1.basestat2 = 4;
_arg1.iicon = 18;
};
if (_arg2 == 2){
_arg1.itemname = "CROOKED STAFF";
_arg1.basestat1 = 3;
_arg1.basestat2 = 5;
_arg1.iicon = 18;
};
if (_arg2 == 3){
_arg1.itemname = "WOODEN STAFF";
_arg1.basestat1 = 4;
_arg1.basestat2 = 5;
_arg1.iicon = 19;
};
if (_arg2 == 4){
_arg1.itemname = "WOODEN STAFF";
_arg1.basestat1 = 4;
_arg1.basestat2 = 6;
_arg1.iicon = 19;
};
if (_arg2 == 5){
_arg1.itemname = "BONE STAFF";
_arg1.basestat1 = 5;
_arg1.basestat2 = 6;
_arg1.iicon = 20;
};
if (_arg2 == 6){
_arg1.itemname = "BONE STAFF";
_arg1.basestat1 = 5;
_arg1.basestat2 = 7;
_arg1.iicon = 20;
};
if (_arg2 == 7){
_arg1.itemname = "MAGIC STAFF";
_arg1.basestat1 = 6;
_arg1.basestat2 = 7;
_arg1.iicon = 21;
};
if (_arg2 == 8){
_arg1.itemname = "DEEP STAFF";
_arg1.basestat1 = 6;
_arg1.basestat2 = 8;
_arg1.iicon = 22;
};
if (_arg2 == 9){
_arg1.itemname = "DEEP STAFF";
_arg1.basestat1 = 7;
_arg1.basestat2 = 8;
_arg1.iicon = 22;
};
if (_arg2 == 10){
_arg1.itemname = "SUNDERED STAFF";
_arg1.basestat1 = 7;
_arg1.basestat2 = 9;
_arg1.iicon = 23;
};
if (_arg2 > 10){
_arg1.itemname = "PERFECT STAFF";
_arg1.iicon = (((_arg2 - 10) % 4) + 20);
_arg1.basestat1 = (7 + (_arg2 - 10));
_arg1.basestat2 = (9 + (_arg2 - 10));
};
};
_arg1.itype = "weapon";
};
if (_arg1.itype == "armor"){
if (_arg2 == 1){
_arg1.itemname = "WORN ARMOR";
_arg1.basestat1 = 2;
_arg1.basestat2 = 2;
_arg1.iicon = 1;
};
if (_arg2 == 2){
_arg1.itemname = "IRON ARMOR";
_arg1.basestat1 = 3;
_arg1.basestat2 = 3;
_arg1.iicon = 2;
};
if (_arg2 == 3){
_arg1.itemname = "COPPER ARMOR";
_arg1.basestat1 = 4;
_arg1.basestat2 = 4;
_arg1.iicon = 3;
};
if (_arg2 == 4){
_arg1.itemname = "STEEL ARMOR";
_arg1.basestat1 = 5;
_arg1.basestat2 = 5;
_arg1.iicon = 4;
};
if (_arg2 == 5){
_arg1.itemname = "SILVER ARMOR";
_arg1.basestat1 = 6;
_arg1.basestat2 = 6;
_arg1.iicon = 5;
};
if (_arg2 == 6){
_arg1.itemname = "HORNED ARMOR";
_arg1.basestat1 = 7;
_arg1.basestat2 = 7;
_arg1.iicon = 6;
};
if (_arg2 == 7){
_arg1.itemname = "SPIKED ARMOR";
_arg1.basestat1 = 8;
_arg1.basestat2 = 8;
_arg1.iicon = 7;
};
if (_arg2 == 8){
_arg1.itemname = "DEEPFORGED ARMOR";
_arg1.basestat1 = 9;
_arg1.basestat2 = 9;
_arg1.iicon = 8;
};
if (_arg2 == 9){
_arg1.itemname = "WINGED ARMOR";
_arg1.basestat1 = 10;
_arg1.basestat2 = 10;
_arg1.iicon = 9;
};
if (_arg2 >= 10){
_arg1.itemname = "PERFECT ARMOR";
_arg1.iicon = (((_arg2 - 10) % 6) + 4);
_arg1.basestat1 = (_arg2 + 1);
_arg1.basestat2 = (_arg2 + 1);
};
};
if (_arg1.itype == "helm"){
if (_arg2 == 1){
_arg1.itemname = "WORN HELM";
_arg1.basestat1 = 1;
_arg1.basestat2 = 1;
_arg1.iicon = 1;
};
if (_arg2 == 2){
_arg1.itemname = "IRON HELM";
_arg1.basestat1 = 1;
_arg1.basestat2 = 1;
_arg1.iicon = 2;
};
if (_arg2 == 3){
_arg1.itemname = "COPPER HELM";
_arg1.basestat1 = 1;
_arg1.basestat2 = 1;
_arg1.iicon = 3;
};
if (_arg2 == 4){
_arg1.itemname = "STEEL HELM";
_arg1.basestat1 = 2;
_arg1.basestat2 = 2;
_arg1.iicon = 4;
};
if (_arg2 == 5){
_arg1.itemname = "SILVER HELM";
_arg1.basestat1 = 2;
_arg1.basestat2 = 2;
_arg1.iicon = 5;
};
if (_arg2 == 6){
_arg1.itemname = "HORNED HELM";
_arg1.basestat1 = 2;
_arg1.basestat2 = 2;
_arg1.iicon = 6;
};
if (_arg2 == 7){
_arg1.itemname = "SPIKED HELM";
_arg1.basestat1 = 3;
_arg1.basestat2 = 3;
_arg1.iicon = 7;
};
if (_arg2 == 8){
_arg1.itemname = "DEEPFORGED HELM";
_arg1.basestat1 = 3;
_arg1.basestat2 = 3;
_arg1.iicon = 8;
};
if (_arg2 == 9){
_arg1.itemname = "WINGED HELM";
_arg1.basestat1 = 3;
_arg1.basestat2 = 3;
_arg1.iicon = 9;
};
if (_arg2 >= 10){
_arg1.itemname = "PERFECT HELM";
_arg1.iicon = (((_arg2 - 10) % 6) + 4);
_arg1.basestat1 = Math.ceil((_arg2 / 3));
_arg1.basestat2 = Math.ceil((_arg2 / 3));
_arg1.iicon = 9;
};
};
if (_arg1.itype == "boots"){
if (_arg2 == 1){
_arg1.itemname = "WORN BOOTS";
_arg1.basestat1 = 1;
_arg1.basestat2 = 1;
_arg1.iicon = 1;
};
if (_arg2 == 2){
_arg1.itemname = "IRON BOOTS";
_arg1.basestat1 = 1;
_arg1.basestat2 = 1;
_arg1.iicon = 2;
};
if (_arg2 == 3){
_arg1.itemname = "COPPER BOOTS";
_arg1.basestat1 = 1;
_arg1.basestat2 = 1;
_arg1.iicon = 3;
};
if (_arg2 == 4){
_arg1.itemname = "STEEL BOOTS";
_arg1.basestat1 = 2;
_arg1.basestat2 = 2;
_arg1.iicon = 4;
};
if (_arg2 == 5){
_arg1.itemname = "SILVER BOOTS";
_arg1.basestat1 = 2;
_arg1.basestat2 = 2;
_arg1.iicon = 5;
};
if (_arg2 == 6){
_arg1.itemname = "HORNED BOOTS";
_arg1.basestat1 = 2;
_arg1.basestat2 = 2;
_arg1.iicon = 6;
};
if (_arg2 == 7){
_arg1.itemname = "SPIKED BOOTS";
_arg1.basestat1 = 3;
_arg1.basestat2 = 3;
_arg1.iicon = 7;
};
if (_arg2 == 8){
_arg1.itemname = "DEEPFORGED BOOTS";
_arg1.basestat1 = 3;
_arg1.basestat2 = 3;
_arg1.iicon = 8;
};
if (_arg2 == 9){
_arg1.itemname = "WINGED BOOTS";
_arg1.basestat1 = 3;
_arg1.basestat2 = 3;
_arg1.iicon = 9;
};
if (_arg2 >= 10){
_arg1.itemname = "PERFECT BOOTS";
_arg1.iicon = (((_arg2 - 10) % 6) + 4);
_arg1.basestat1 = Math.ceil((_arg2 / 3));
_arg1.basestat2 = Math.ceil((_arg2 / 3));
};
};
if (_arg1.itype == "ring"){
if (_arg2 == 1){
_arg1.itemname = "DIRTY RING";
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
_arg1.iicon = 1;
};
if (_arg2 == 2){
_arg1.itemname = "IRON RING";
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
_arg1.iicon = 2;
};
if (_arg2 == 3){
_arg1.itemname = "COPPER RING";
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
_arg1.iicon = 3;
};
if (_arg2 == 4){
_arg1.itemname = "STEEL RING";
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
_arg1.iicon = 4;
};
if (_arg2 == 5){
_arg1.itemname = "SILVER RING";
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
_arg1.iicon = 5;
};
if (_arg2 == 6){
_arg1.itemname = "CRAFTED RING";
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
_arg1.iicon = 6;
};
if (_arg2 == 7){
_arg1.itemname = "AMYTHEST RING";
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
_arg1.iicon = 7;
};
if (_arg2 == 8){
_arg1.itemname = "RUBY RING";
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
_arg1.iicon = 8;
};
if (_arg2 == 9){
_arg1.itemname = "DIAMOND RING";
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
_arg1.iicon = 9;
};
if (_arg2 >= 10){
_arg1.itemname = "PERFECT RING";
_arg1.iicon = (((_arg2 - 10) % 3) + 7);
_arg1.basestat1 = 0;
_arg1.basestat2 = 0;
};
};
_arg1.basestat1 = (_arg1.basestat1 + (Math.floor((((Math.floor(_arg3) % 3791) / 3791) * (_arg1.basestat1 / 5))) - Math.floor((_arg1.basestat1 / 10))));
_arg1.basestat2 = (_arg1.basestat2 + (Math.floor((((Math.floor(_arg3) % 9173) / 9173) * (_arg1.basestat2 / 5))) - Math.floor((_arg1.basestat2 / 10))));
if (_arg1.basestat1 < 1){
_arg1.basestat1 = 1;
};
if (_arg1.basestat1 >= _arg1.basestat2){
_arg1.basestat2 = (_arg1.basestat1 + 1);
};
}
}
}//package
Section 75
//shock (shock)
package {
import flash.media.*;
public dynamic class shock extends Sound {
}
}//package
Section 76
//spell (spell)
package {
public class spell {
public var scost:Number;
public var sproc:String;
public var sicon:Number;
public var stype:String;
public var spellname:String;// = "GENERIC SPELL"
public var spelldesc:String;// = "GENERIC SPELL"
public function spell(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String, _arg5:String){
spellname = "GENERIC SPELL";
spelldesc = "GENERIC SPELL";
super();
stype = _arg1;
sicon = _arg2;
scost = _arg3;
sproc = _arg4;
spellname = _arg5;
if (spellname == "FROZEN WIND"){
spelldesc = "Damage enemies in an arc with frost";
};
if (spellname == "FLASH FREEZE"){
spelldesc = "Damage enemies in an arc with frost, as well as freezing them solid for a time";
};
if (spellname == "ENTANGLE"){
spelldesc = "Prevent one enemy from moving for a time, though they can still attack";
};
if (spellname == "VINE FIELD"){
spelldesc = "Create a field of vines that slows any enemy passing through";
};
if (spellname == "FIRE BREATH"){
spelldesc = "Damage enemies in an arc with fire";
};
if (spellname == "FLAME ARC"){
spelldesc = "Damage enemies in an arc with fire";
};
if (spellname == "FIRE BLAST"){
spelldesc = "Damage enemies in an arc with fire, as well as lighting them on fire for a time";
};
if (spellname == "SWARM"){
spelldesc = "Steadily Damage one enemy over time with poison";
};
if (spellname == "MASSIVE SWARM"){
spelldesc = "Create a swarm of insects, Steadily damaging any enemy passing through";
};
if (spellname == "CHARGE"){
spelldesc = "Rush to a single enemy in an instant, dealing a strong blow on arrival";
};
if (spellname == "WILD CHARGE"){
spelldesc = "Rush and attack a single enemy, as well as damaging any enemy along your path";
};
if (spellname == "SCAVENGE"){
spelldesc = "Damage a single enemy, who if killed by this spell will be rendered to bones and used to heal";
};
if (spellname == "BONE SHRAPNEL"){
spelldesc = "Sacrifice half of your maximum health to do massive damage in an arc";
};
if (spellname == "CREATE SKELETON"){
spelldesc = "Create a skeleton minion to fight for you";
};
if (spellname == "CREATE SKELETONS"){
spelldesc = "Create three skeleton minion to fight for you";
};
if (spellname == "HEAL"){
spelldesc = "Restore some of your lost health";
};
if (spellname == "SANCTIFY"){
spelldesc = "Create a sanctified circle, constantly healing any friend or foe within";
};
if (spellname == "IGNITE"){
spelldesc = "Detonate the air in a location you can see, damaging nearby enemies with fire";
};
if (spellname == "INFERNO"){
spelldesc = "Ignite an area with fire, damaging any enemy passing through";
};
if (spellname == "CHARM"){
spelldesc = "Causes an enemy to temporarily ally itself with you.";
};
if (spellname == "CRITICAL STRIKE"){
spelldesc = "Causes your next attack to hit much harder";
};
if (spellname == "SHIELD"){
spelldesc = "Completely protects you from the next three attacks";
};
if (spellname == "BOLT"){
spelldesc = "Electrify a single opponent with a bolt of lightning";
};
}
}
}//package
Section 77
//textblitter (textblitter)
package {
import flash.display.*;
import flash.text.*;
public dynamic class textblitter extends MovieClip {
public var textblit:TextField;
}
}//package
Section 78
//tileset (tileset)
package {
import flash.display.*;
public dynamic class tileset extends MovieClip {
}
}//package
Section 79
//tilesheet (tilesheet)
package {
import flash.display.*;
import flash.geom.*;
public class tilesheet {
public var tileheight:Number;
public var sheetwidth:Number;
public var tilewidth:Number;
public var tiledata:BitmapData;
public var numtiles:Number;
public function tilesheet(_arg1:Number, _arg2:Number, _arg3:Number){
tilewidth = _arg1;
tileheight = _arg2;
numtiles = _arg3;
sheetwidth = Math.ceil(Math.sqrt(_arg3));
tiledata = new BitmapData((tilewidth * sheetwidth), (tileheight * Math.ceil((numtiles / sheetwidth))), true, 0);
}
public function sharpen(){
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Number;
var _local7:Number;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
while (_local6 < tiledata.height) {
_local7 = 0;
while (_local7 < tiledata.width) {
_local1 = tiledata.getPixel32(_local7, _local6);
_local5 = ((_local1 >> 24) & 0xFF);
_local2 = ((_local1 >> 16) & 0xFF);
_local3 = ((_local1 >> 8) & 0xFF);
_local4 = (_local1 & 0xFF);
if ((((_local5 > 0)) && ((_local5 < 85)))){
tiledata.setPixel32(_local7, _local6, 0);
};
if ((((_local5 > 85)) && ((_local5 < 170)))){
tiledata.setPixel32(_local7, _local6, 1996488704);
};
if ((((_local5 > 170)) && ((_local5 < 0xFF)))){
tiledata.setPixel32(_local7, _local6, 4278190080);
};
_local7++;
};
_local6++;
};
}
public function zero(_arg1:Number=0, _arg2:Number=0, _arg3:Number=-1, _arg4:Number=-1){
if (_arg3 == -1){
_arg3 = (tilewidth * sheetwidth);
};
if (_arg4 == -1){
_arg4 = (tileheight * Math.ceil((numtiles / sheetwidth)));
};
tiledata.fillRect(new Rectangle(_arg1, _arg2, _arg3, _arg4), 0);
}
public function drawlines(){
var _local1:Number;
var _local2:Number;
_local1 = 0;
while (_local1 < tiledata.height) {
_local2 = 0;
while (_local2 < tiledata.width) {
if (((((((((_local2 % tilewidth) == 0)) || (((_local1 % tileheight) == 0)))) || (((_local2 % tilewidth) == (tilewidth - 1))))) || (((_local1 % tileheight) == (tileheight - 1))))){
tiledata.setPixel32(_local2, _local1, 1996488704);
};
_local2++;
};
_local1++;
};
}
}
}//package
Section 80
//uichoice (uichoice)
package {
import flash.display.*;
import flash.text.*;
public class uichoice extends MovieClip {
public var unlocked:Boolean;// = false
public var choicetext:TextField;
public var speed:Number;
public var choice:String;
public var lastx:Number;
public var choicetext2:TextField;
public function uichoice(_arg1:String){
unlocked = false;
super();
choice = _arg1;
choicetext.htmlText = choice;
}
}
}//package
Section 81
//uispinner (uispinner)
package {
import flash.events.*;
import flash.display.*;
public class uispinner extends MovieClip {
public var choicet:Number;// = -1
public var larrow:MovieClip;
public var hovering:Number;// = -1
public var hoveroffs:Number;// = 100
public var myui:charcreate;
public var offset:Number;// = 0
public var choice:Number;// = 0
public var rarrow:MovieClip;
public var rando:MovieClip;
public var choices:Array;
public static var PI:Number = 3.14159265358979;
public function uispinner(){
hovering = -1;
hoveroffs = 100;
offset = 0;
choice = 0;
choicet = -1;
super();
addEventListener(MouseEvent.CLICK, clicked);
choices = new Array();
}
public function clicked(_arg1:MouseEvent){
if (hovering > -1){
choice = hovering;
} else {
if ((((((((mouseX < (rando.x + 10))) && ((mouseX > (rando.x - 10))))) && ((mouseY < (rando.y + 10))))) && ((mouseY > (rando.y - 10))))){
choicet = Math.floor((Math.random() * choices.length));
offset = (200 + ((choicet * (PI * 2)) / choices.length));
};
if ((((((((mouseX < (larrow.x + 12))) && ((mouseX > (larrow.x - 12))))) && ((mouseY < (larrow.y + 10))))) && ((mouseY > (larrow.y - 10))))){
choice--;
};
if ((((((((mouseX < (rarrow.x + 12))) && ((mouseX > (rarrow.x - 12))))) && ((mouseY < (rarrow.y + 10))))) && ((mouseY > (rarrow.y - 10))))){
choice++;
};
if (choice < 0){
choice = (choices.length - 1);
};
if (choice > (choices.length - 1)){
choice = 0;
};
};
}
public function addchoice(_arg1:uichoice){
choices.push(_arg1);
addChild(choices[(choices.length - 1)]);
choicet = Math.floor((Math.random() * choices.length));
offset = (200 + ((choicet * (PI * 2)) / choices.length));
}
public function updatehud(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = 0;
if ((((Math.abs(mouseY) < 10)) && ((Math.abs(mouseX) < 210)))){
_local3 = -1;
_local4 = 50;
_local5 = 0;
_local1 = 0;
while (_local1 < choices.length) {
if (choices[_local1].alpha > 0.2){
_local5 = Math.abs((choices[_local1].x - mouseX));
if (_local5 < _local4){
_local3 = _local1;
_local4 = _local5;
};
};
_local1++;
};
if (_local3 != -1){
hovering = _local3;
myui.hovering = (_local3 + hoveroffs);
} else {
hovering = -1;
};
} else {
hovering = -1;
};
_local2 = 0;
if (choicet > -1){
offset = (((offset * 2) + ((choicet * (2 * PI)) / choices.length)) / 3);
choice = (Math.round((((offset * choices.length) / (2 * PI)) + choices.length)) % choices.length);
if (Math.abs((offset - ((choicet * (2 * PI)) / choices.length))) < 0.1){
choicet = -1;
};
} else {
if (offset > (((choice * (2 * PI)) / choices.length) + PI)){
offset = (offset - (2 * PI));
};
if (offset < (((choice * (2 * PI)) / choices.length) - PI)){
offset = (offset + (2 * PI));
};
offset = (((offset * 2) + ((choice * (2 * PI)) / choices.length)) / 3);
};
_local1 = 0;
while (_local1 < choices.length) {
choices[_local1].lastx = choices[_local1].x;
choices[_local1].x = (180 * Math.sin((-(offset) + ((_local1 * (2 * PI)) / choices.length))));
if (choice != _local1){
choices[_local1].x = (choices[_local1].x + (10 * (choices[_local1].x / Math.abs(choices[_local1].x))));
};
choices[_local1].speed = (1 + Math.floor((Math.abs((choices[_local1].x - choices[_local1].lastx)) / 2)));
if (choices[_local1].speed > 10){
choices[_local1].speed = 10;
};
choices[_local1].scaleX = (1 * Math.cos((-(offset) + ((_local1 * (2 * PI)) / choices.length))));
choices[_local1].alpha = Math.cos((-(offset) + ((_local1 * (2 * PI)) / choices.length)));
choices[_local1].gotoAndStop((Math.floor((choices[_local1].speed / 2)) + 1));
if (choices[_local1].unlocked){
choices[_local1].choicetext.htmlText = ("<font color='#FFFFFF'>" + choices[_local1].choice);
} else {
choices[_local1].choicetext.htmlText = ("<font color='#FF0000'>" + choices[_local1].choice);
};
choices[_local1].choicetext2.htmlText = "";
if (_local1 == choice){
choices[_local1].choicetext2.htmlText = choices[_local1].choicetext.htmlText;
};
_local1++;
};
}
public function die(){
removeEventListener(MouseEvent.CLICK, clicked);
}
}
}//package
Section 82
//whack1 (whack1)
package {
import flash.media.*;
public dynamic class whack1 extends Sound {
}
}//package
Section 83
//whack2 (whack2)
package {
import flash.media.*;
public dynamic class whack2 extends Sound {
}
}//package
Section 84
//whack3 (whack3)
package {
import flash.media.*;
public dynamic class whack3 extends Sound {
}
}//package
Section 85
//whoosh (whoosh)
package {
import flash.media.*;
public dynamic class whoosh extends Sound {
}
}//package
Section 86
//VoidSound (VoidSound)
package {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
class VoidSound {
private var vchannels:Array;
private var vmusiclist:Array;
private var soundvolume:Number;
private var currentchannel:Number;
private var vmusic:Dictionary;
private var vmusicsequence:String;
private var vtransform:SoundTransform;
private var vmusicmarker:Number;
private var vsounds:Dictionary;
private var vmusicchannel;
private var musicvolume:Number;
function VoidSound(){
var _local1:Number;
super();
musicvolume = 1;
soundvolume = 1;
vmusicmarker = 0;
vmusicsequence = "0";
vmusiclist = new Array();
currentchannel = 0;
vtransform = new SoundTransform(1);
vsounds = new Dictionary();
vmusic = new Dictionary();
vchannels = new Array();
_local1 = 0;
while (_local1 < 10) {
vchannels.push(new SoundChannel());
_local1++;
};
vmusicchannel = new SoundChannel();
}
public function regsound(_arg1:Sound, _arg2:String):void{
vsounds[_arg2] = _arg1;
}
public function get vmusicvolume():Number{
return (musicvolume);
}
public function get vsoundvolume():Number{
return (soundvolume);
}
public function musicswap(_arg1:Event){
vmusicmarker++;
if (vmusicmarker > (vmusicsequence.length - 1)){
vmusicmarker = 0;
};
vtransform.volume = musicvolume;
vtransform.pan = 0;
if (vmusic[vmusiclist[(vmusicsequence.charCodeAt(vmusicmarker) - 48)]] == null){
trace("invalid music");
} else {
vmusicchannel = vmusic[vmusiclist[(vmusicsequence.charCodeAt(vmusicmarker) - 48)]].play(0, 0, vtransform);
};
vmusicchannel.addEventListener(Event.SOUND_COMPLETE, musicswap);
}
public function regmusic(_arg1:Sound, _arg2:String):void{
vmusic[_arg2] = _arg1;
vmusiclist.push(_arg2);
}
public function playsound(_arg1:String, _arg2:int=0, _arg3:Number=1, _arg4:int=0, _arg5:Number=0, _arg6:Number=0){
var _local7:Number;
if (((!((_arg5 == 0))) || (!((_arg6 == 0))))){
_local7 = (Math.sqrt(((_arg5 * _arg5) + (_arg6 * _arg6))) / 180);
if (_local7 < 1){
_local7 = 1;
};
vtransform.volume = ((soundvolume * _arg3) / _local7);
vtransform.pan = (_arg5 / 200);
} else {
vtransform.volume = (soundvolume * _arg3);
vtransform.pan = 0;
};
if (vsounds[_arg1] == null){
trace("invalid sound");
} else {
vchannels[currentchannel] = vsounds[_arg1].play(_arg2, _arg4, vtransform);
};
currentchannel++;
if (currentchannel > (vchannels.length - 1)){
currentchannel = 0;
};
}
public function set vmusicvolume(_arg1:Number){
if (_arg1 < 0){
_arg1 = 0;
};
musicvolume = _arg1;
vtransform.volume = musicvolume;
vmusicchannel.soundTransform = vtransform;
}
public function stopmusic(){
if (vmusicchannel != null){
vmusicchannel.stop();
};
}
public function musicsequence(_arg1:String):void{
vmusicsequence = _arg1;
}
public function set vsoundvolume(_arg1:Number){
if (_arg1 < 0){
_arg1 = 0;
};
soundvolume = _arg1;
}
public function playmusic(){
vmusicmarker = 0;
vtransform.volume = musicvolume;
vtransform.pan = 0;
if (vmusic[vmusiclist[0]] == null){
trace("invalid music");
} else {
vmusicchannel = vmusic[vmusiclist[(vmusicsequence.charCodeAt(vmusicmarker) - 48)]].play(0, 0, vtransform);
};
vmusicchannel.addEventListener(Event.SOUND_COMPLETE, musicswap);
}
}
}//package