Frame 1
fscommand ("showmenu", "false");
Stage.showMenu = false;
var CPMStarPoolID = 2035;
var CPMStarSubPoolID = 100;
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie((("http://server.cpmstar.com/adviewas2.swf?poolid=" + CPMStarPoolID) + "&subpoolid=") + CPMStarSubPoolID);
function fadePreloader() {
preloaderBar.onEnterFrame = function () {
if (this._alpha > 0) {
this._alpha = this._alpha - 4;
} else {
this.removeMovieClip();
delete this.onEnterFrame;
_root.fadeStartButton();
}
};
}
function fadeStartButton() {
startGameButt._visible = true;
startGameButt._alpha = 0;
_root.onEnterFrame = function () {
if (startGameButt._alpha < 100) {
startGameButt._alpha = startGameButt._alpha + 4;
} else {
delete _root.onEnterFrame;
}
};
startGameButt.onRelease = function () {
_root.gotoAndStop(3);
};
}
stopAllSounds();
var domainName = _url.substring(7);
domainName = domainName.toLowerCase();
if (domainName.substring(0, 3) == "www") {
domainName = domainName.substring(4);
}
var end = domainName.indexOf("/");
domainName = domainName.substring(0, end);
startGameButt._visible = false;
this.onEnterFrame = function () {
totalBytes = this.getBytesTotal();
loadedBytes = this.getBytesLoaded();
remainingBytes = totalBytes - loadedBytes;
percentDone = int((loadedBytes / totalBytes) * 100);
myText.text = Math.round(percentDone) + "%";
preloaderBar.loaderBar._width = 284 * (percentDone * 0.01);
if (percentDone >= 100) {
delete this.onEnterFrame;
setTimeout(fadePreloader, 800);
}
};
stop();
Instance of Symbol 35 MovieClip [titleLikwidGames] in Frame 1
on (release) {
getURL ("http://www.likwidgames.com", "_blank");
}
Frame 2
stopAllSounds();
Frame 3
_root.createEmptyMovieClip("firstMusicMc", 9999999);
levelMusic = new Sound(firstMusicMc);
levelMusic.attachSound("levelSnd");
worldMapMusic = new Sound(firstMusicMc);
worldMapMusic.attachSound("worldMapMusic");
themeMusicSnd = new Sound(firstMusicMc);
themeMusicSnd.attachSound("themeMusicSnd");
gameoverSnd = new Sound(firstSoundMc);
gameoverSnd.attachSound("gameoverSnd");
likwidIntroSnd = new Sound(firstSoundMc);
likwidIntroSnd.attachSound("likwidIntroSnd");
_root.createEmptyMovieClip("firstSoundMc", 999999);
startLevelSnd = new Sound(firstSoundMc);
startLevelSnd.attachSound("startLevelSnd");
swordSnd = new Sound(firstSoundMc);
swordSnd.attachSound("swordSnd");
archerSnd = new Sound(firstSoundMc);
archerSnd.attachSound("archerSnd");
damageSnd = new Sound(firstSoundMc);
damageSnd.attachSound("damageSnd");
missSnd = new Sound(firstSoundMc);
missSnd.attachSound("missSnd");
deathSnd = new Sound(firstSoundMc);
deathSnd.attachSound("deathSnd");
fireSnd = new Sound(firstSoundMc);
fireSnd.attachSound("fireSnd");
lightningSnd = new Sound(firstSoundMc);
lightningSnd.attachSound("lightningSnd");
healSnd = new Sound(firstSoundMc);
healSnd.attachSound("healSnd");
poisonSnd = new Sound(firstSoundMc);
poisonSnd.attachSound("poisonSnd");
freezeSnd = new Sound(firstSoundMc);
freezeSnd.attachSound("freezeSnd");
foundItemSnd = new Sound(firstSoundMc);
foundItemSnd.attachSound("foundItemSnd");
levelupSnd = new Sound(firstSoundMc);
levelupSnd.attachSound("levelupSnd");
endLevelSnd = new Sound(firstSoundMc);
endLevelSnd.attachSound("endLevelSnd");
chooseTileSnd = new Sound(firstSoundMc);
chooseTileSnd.attachSound("chooseTileSnd");
buttonSnd = new Sound(firstSoundMc);
buttonSnd.attachSound("buttonSnd");
treasureDropSnd = new Sound(firstSoundMc);
treasureDropSnd.attachSound("treasureDropSnd");
expSnd = new Sound(firstSoundMc);
expSnd.attachSound("expSnd");
lockpickBreakSnd = new Sound(firstSoundMc);
lockpickBreakSnd.attachSound("lockpickBreakSnd");
lockUnlockedSnd = new Sound(firstSoundMc);
lockUnlockedSnd.attachSound("lockUnlockedSnd");
lockpickingSnd = new Sound(firstSoundMc);
lockpickingSnd.attachSound("lockpickingSnd");
treasureOpenSnd = new Sound(firstSoundMc);
treasureOpenSnd.attachSound("treasureOpenSnd");
stopAllSounds();
stop();
Frame 4
MovieClip.prototype.fluxTint = function ($colObj, $amountStart, $amountEnd, $pace, $loop, $limit) {
this.$colour = new Color(this);
var $loops = 0;
var $unlimited = (($limit == undefined) ? true : false);
var $way = (($amountStart <= $amountEnd) ? "up" : "down");
var $top = (($amountStart <= $amountEnd) ? ($amountEnd) : ($amountStart));
var $bottom = (($amountStart <= $amountEnd) ? ($amountStart) : ($amountEnd));
var $a_curr = $amountStart;
this.onEnterFrame = function () {
this.$colour.setTint($colObj.r, $colObj.g, $colObj.b, $a_curr);
if ($way == "up") {
if ($a_curr >= $top) {
$loops = $loops + 0.5;
var _local2 = (!$loop) || (((!$unlimited) && ($loop)) && ($loops >= $limit));
if (_local2) {
delete this.onEnterFrame;
}
$way = "down";
}
$a_curr = $a_curr + $pace;
} else if ($way == "down") {
if ($a_curr <= $bottom) {
$loops = $loops + 0.5;
var _local2 = (!$loop) || (((!$unlimited) && ($loop)) && ($loops >= $limit));
if (_local2) {
delete this.onEnterFrame;
}
$way = "up";
}
$a_curr = $a_curr - $pace;
}
};
};
Color.prototype.setTint = function (r, g, b, amount) {
var _local4 = 100 - amount;
var _local2 = new Object();
_local2.ra = (_local2.ga = (_local2.ba = _local4));
var _local3 = amount / 100;
_local2.rb = r * _local3;
_local2.gb = g * _local3;
_local2.bb = b * _local3;
this.setTransform(_local2);
};
function initVars() {
gold = 0;
enemiesKilledCount = 0;
timePlayed = 0;
lockpicking = 1;
inventory = new Array();
treasures = new Array();
treasuresUnlocked = 0;
showTreasureTutorial = true;
equipment = new Array();
enemyArr = new Array();
defenderArr = new Array();
tutorialNum = 0;
tutorialCompleted = false;
grandpaCount = 0;
warriorGuildCount = 0;
thiefGuildCount = 0;
levelsUnlocked = 0;
curMission = null;
missionsArr = new Array();
missionsArr = [[["tutorial", 1, true]], [["Mutant Pond", 3, false], ["The Athelas Leaf", 4, false], ["Venom Snakes!", 5, false], ["Mutant Leader", 7, false], ["The Desert Sting", 8, false]], [["Ancient Pyramids", 3, false], ["Super Venom", 4, false], ["Oasis", 5, false], ["Eye Guys", 7, false]], [["Lava Monsters", 3, false], ["Death Rock Cave", 4, false], ["Ring of Fire", 5, false], ["Lava River", 7, false], ["Cave Ogres", 7, false], ["Ogre Lord", 7, false]]];
addDefender("Kronus");
}
function initGame() {
createEmptyMovieClip("interfaceMC", 99);
interfaceMC.attachMovie("frame-MC", "frameMC", 99);
initItems();
}
function initItems() {
itemNameListArr = ["Lockpicking Guide", "Healing Herb", "HP Potion", "sm. HP Potion", "lg. HP Potion", "Mana Root", "sm. Mana Potion", "Mana Potion", "Elixer", "Mega Elixer", "Antidote", "Resurrection", "Magic Tonic", "HP Booster", "Power Bar", "Iron Tusk", "Rusty Lockpick", "Iron Lockpick", "Ultra Lockpick", "Poison Scroll", "Shock Scroll", "Freeze Scroll"];
equipmentNameListArr = ["Rusty Sword", "Iron Sword", "Broad Sword", "Falchion", "Flame Sword", "Wood Staff", "Wand", "Element Staff", "Lava Wand", "Wooden Bow", "Long Bow", "Marksman Bow", "Rusty Armor", "Iron Armor", "Chain Mail", "Plate Armor", "Cloth Robe", "Cloak", "Silk Robe", "Amber Robe", "Iron Vest", "Iron Doublet", "Rose Gilet", "Amulet of Warding", "Iron Ring", "Lucky Ribbon", "Magic Ring", "Power Glove", "Ruby Pin", "Silver Necklace", "Speed Boots", "Thief Gloves"];
itemListArr = new Array();
i = 0;
while (i < itemNameListArr.length) {
assignItem(itemNameListArr[i], true);
i++;
}
e = 0;
while (e < equipmentNameListArr.length) {
assignEquipment(equipmentNameListArr[e], true);
e++;
}
}
function initMap(levelName) {
if (_root.soundOn == true) {
_root.startLevelSnd.start();
}
worldMapMC.markers._visible = false;
worldMapMC.mapMenu._visible = false;
worldMapMC.mapSave._visible = false;
worldMapMC.mapGames._visible = false;
mapInfoArr = getMap(levelName);
_root.levelName = levelName;
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
var _local2 = new mx.transitions.Tween(worldMapMC, "blur", mx.transitions.easing.Regular.easeIn, 0, 200, 2, true);
var _local3 = new mx.transitions.Tween(worldMapMC, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, 2, true);
_local2.onMotionChanged = function () {
worldMapMC.filters = [new flash.filters.BlurFilter(worldMapMC.blur, worldMapMC.blur, 1)];
};
_local2.onMotionFinished = function () {
worldMapMC.removeMovieClip();
buildMap(mapInfoArr[0], mapInfoArr[1], mapInfoArr[2], mapInfoArr[3], levelName);
};
}
function buildMap(tileMap, heightMap, charMap, levelItems, levelName) {
if (_root.soundOn == true) {
_root.worldMapMusic.stop();
_root.levelMusic.start(0, 999);
}
BG.removeMovieClip();
display.removeMovieClip();
screenMoverMC.removeMovieClip();
charStats.removeMovieClip();
createEmptyMovieClip("BG", 1);
BG.attachMovie("BG-MC", "BG", 1);
if ((((((levelName.toString() == "Death Rock Cave") || (levelName.toString() == "Ring of Fire")) || (levelName.toString() == "Death Rock")) || (levelName.toString() == "Lava River")) || (levelName.toString() == "Cave Ogres")) || (levelName.toString() == "Ogre Lord")) {
BG.BG.gotoAndStop(2);
}
createEmptyMovieClip("display", 2);
display.createEmptyMovieClip("tiles", 2);
createEmptyMovieClip("charStats", 10);
turnArr = new Array();
defenderLevelArr = new Array();
enemyArr = new Array();
display._x = 250;
display._y = 150;
_root.levelItems = levelItems;
h = 0;
while (h < tileMap.length) {
w = 0;
while (w < tileMap[0].length) {
tileMap[h][w] = int(tileMap[h][w]);
heightMap[h][w] = int(heightMap[h][w]);
d = (((((w + h) * tileSize) / 2) * 300) + ((w - h) * tileSize)) + 1;
var _local4 = _root.display.tiles.attachMovie("tiles", (("tile_" + w) + "_") + h, d);
_local4.cacheAsBitmap = true;
_local4._x = (w - h) * tileSize;
_local4._y = ((w + h) * tileSize) / 2;
_local4.range._visible = false;
_local4.selected._visible = false;
_local4.x = h;
_local4.y = w;
_local4.inRange = false;
_local4.tileHit.useHandCursor = false;
_local4.gotoAndStop(tileMap[h][w]);
_local4.treasure = null;
_local4.walkable = true;
if ((((((((((((((((((((((((tileMap[h][w] == 16) || (tileMap[h][w] == 22)) || (tileMap[h][w] == 23)) || (tileMap[h][w] == 24)) || (tileMap[h][w] == 25)) || (tileMap[h][w] == 26)) || (tileMap[h][w] == 33)) || (tileMap[h][w] == 34)) || (tileMap[h][w] == 35)) || (tileMap[h][w] == 36)) || (tileMap[h][w] == 37)) || (tileMap[h][w] == 7)) || (tileMap[h][w] == 8)) || (tileMap[h][w] == 9)) || (tileMap[h][w] == 10)) || (tileMap[h][w] == 11)) || (tileMap[h][w] == 12)) || (tileMap[h][w] == 44)) || (tileMap[h][w] == 45)) || (tileMap[h][w] == 46)) || (tileMap[h][w] == 61)) || (tileMap[h][w] == 62)) || (tileMap[h][w] == 63)) || (tileMap[h][w] == 64)) {
_local4.walkable = false;
}
tileMap[h][w] = _local4;
if (heightMap[h][w] != 0) {
_local4.hasHeight = true;
_local4._y = _local4._y - (30 * heightMap[h][w]);
}
if (charMap[h][w][1] == "human") {
addDefenderToMap(_local4, charMap[h][w][0], charMap[h][w][2]);
} else if (charMap[h][w][1] == "enemy") {
addEnemy(_local4, charMap[h][w][0], charMap[h][w][2]);
}
_local4.tileHit.onRollOver = function () {
if ((_root.verifyRange(this._parent) == true) && (_root.currentTurn.type == "human")) {
makeOutline(this._parent);
}
};
_local4.tileHit.onRollOut = function () {
_root.display.tiles.tileOutline._visible = false;
};
_local4.tileHit.onRelease = function () {
if (_root.verifyRange(this._parent) == true) {
if ((_root.tutorialNum == 2) && (this._parent != _level0.display.tiles.tile_4_11)) {
} else {
_root.charStats.windowActions.removeMovieClip();
_root.findPath(_root.currentTurn, this._parent.x, this._parent.y, _root.currentTurn.x, _root.currentTurn.y);
}
}
};
w++;
}
h++;
}
_root.display.cacheAsBitmap = true;
_root.display.tiles.cacheAsBitmap = true;
_root.display.tiles._width = _root.display.tiles._width * 0.8;
_root.display.tiles._height = _root.display.tiles._height * 0.8;
_root.display.tiles.attachMovie("tileOutline", "tileOutline", 99999999);
_root.display.tiles.tileOutline._visible = false;
_root.display.tiles._x = _root.display.tiles._x + 230;
levelGold = 0;
levelScore = 0;
gameOver = false;
charTurn = 0;
inBattle = true;
turnArr.sort(turnOrder);
trace("TURN ARR: " + turnArr);
t = 0;
while (t < turnArr.length) {
trace(turnArr[t][0].turnArrName);
t++;
}
mapIntro();
_root.currentTurn.swapDepths(_root.display.tiles.getNextHighestDepth());
}
function mapIntro() {
myColor = new Color(_root.display);
myColor.setTint(0, 0, 0, 100);
BG._alpha = 0;
var _local2 = new mx.transitions.Tween(BG, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, 2, true);
_local2.onMotionFinished = function () {
showGameMask(1);
};
}
function fadeMapIn() {
tintNum = 100;
_root.display.onEnterFrame = function () {
myColor = new Color(_root.display);
if (_root.tintNum > 0) {
myColor.setTint(0, 0, 0, _root.tintNum);
_root.tintNum = _root.tintNum - 4;
} else {
delete this.onEnterFrame;
setTimeout(_root.checkTurn, 1000);
}
};
}
function levelComplete() {
if (_root.soundOn == true) {
_root.endLevelSnd.start();
}
inBattle = false;
charStats.removeMovieClip();
showGameMask(2);
}
function gameOverFunc() {
inBattle = false;
gameOver = true;
charStats.removeMovieClip();
if (_root.soundOn == true) {
_root.levelMusic.stop();
_root.gameoverSnd.start();
}
showGameMask(3);
}
function displayGameOverOptions() {
BG.removeMovieClip();
display.removeMovieClip();
screenMoverMC.removeMovieClip();
charStats.removeMovieClip();
interfaceMC.removeMovieClip();
var _local2 = new mx.transitions.Tween(gameMask, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 5, true);
_local2.onMotionFinished = function () {
_root.loadTitleScreen();
gameMask.removeMovieClip();
};
}
function displayLevelGold() {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
gameMask.mcC.gameMaskMC.gotoAndStop(2);
_root.createEmptyMovieClip("levelItemInfo", _root.getNextHighestDepth());
levelItemInfo._alpha = 0;
itemInfoBox = levelItemInfo.attachMovie("statusItemAlert", "levelGoldInfo", _root.levelItemInfo.getNextHighestDepth(), {_x:300, _y:210});
addText(itemInfoBox, "titleTxt" + i, 0, 40, 200, 50, "Gold gained:", 16, 0);
itemInfoBox.attachMovie("goldIcon", "goldIcon", itemInfoBox.getNextHighestDepth(), {_x:63, _y:65});
addText(itemInfoBox, "itemName" + i, 95, 67, 200, 50, levelGold, 24, 0, false);
_root.gold = _root.gold + levelGold;
cancelButtonMC = itemInfoBox.createEmptyMovieClip("cancelButtonMC", itemInfoBox.getNextHighestDepth());
addText(cancelButtonMC, "tfield", 0, 105, 200, 20, "Continue", 14, 6050119);
cancelButtonMC.MC = itemInfoBox;
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (_root.levelItems.length > 0) {
_root.displayLevelItems();
_root.addLevelItems();
} else {
_root.endLevelFunc();
}
this.MC.removeMovieClip();
};
var _local3 = new mx.transitions.Tween(levelItemInfo, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 1, true);
}
function addLevelItems() {
r1 = 0;
while (r1 < _root.levelItems.length) {
thisItem = getRewardItemInfo(_root.levelItems[r1]);
if (thisItem.ATT == undefined) {
assignItem(thisItem.NAME);
} else {
assignEquipment(thisItem.NAME);
}
r1++;
}
}
function displayLevelItems() {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
_root.createEmptyMovieClip("levelItemInfo", _root.getNextHighestDepth());
i = levelItems.length - 1;
while (i > -1) {
thisItem = getRewardItemInfo(levelItems[i]);
itemInfoBox = levelItemInfo.attachMovie("textBox2MC", "textBox2MC" + i, _root.levelItemInfo.getNextHighestDepth(), {_x:290, _y:190});
addText(itemInfoBox, "titleTxt" + i, 0, 45, 235, 50, "Item Aquired:", 16, 0);
itemIcon = itemInfoBox.attachMovie(thisItem.ICON, thisItem.ICON, itemInfoBox.getNextHighestDepth(), {_x:105, _y:90});
addText(itemInfoBox, "itemName" + i, 0, 125, 235, 50, "1 x " + thisItem.NAME, 11, 0);
cancelButtonMC = itemInfoBox.createEmptyMovieClip("cancelButtonMC", itemInfoBox.getNextHighestDepth());
addText(cancelButtonMC, "tfield" + i, 0, 170, 235, 20, "Continue", 14, 6050119);
cancelButtonMC.MC = itemInfoBox;
cancelButtonMC.num = i;
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (this.num == (_root.levelItems.length - 1)) {
_root.endLevelFunc();
}
this.MC.removeMovieClip();
};
i--;
}
}
function endLevelFunc() {
_root.levelItemInfo.removeMovieClip();
_root.gameMask.removeMovieClip();
checkLevelUnlock(levelName);
loadWorldMap(levelsUnlocked);
if (gameComplete == true) {
endGameAlert();
}
if (levelName == "tutorial") {
mapLevelInfoMC = _root.worldMapMC.createEmptyMovieClip("mapLevelInfoMC", worldMapMC.getNextHighestDepth());
overlayMC = mapLevelInfoMC.attachMovie("overlayGraphic", "overlayGraphic", 1);
overlayMC.onRollOver = function () {
this.useHandCursor = false;
};
mapLevelInfoMC._alpha = 0;
var _local3 = new mx.transitions.Tween(mapLevelInfoMC, "_alpha", mx.transitions.easing.Regular.easeIn, 0, 100, 0.5, true);
_root.mapGrandpa();
}
}
function makeOutline(tile) {
_root.display.tiles.tileOutline._visible = true;
_root.display.tiles.tileOutline._x = tile._x;
_root.display.tiles.tileOutline._y = tile._y - 13;
}
function verifyRange(tile) {
if (_root.showingRange == true) {
if (tile.inRange == true) {
return(true);
}
}
return(false);
}
function checkForTutorial(customTut) {
if (customTut == undefined) {
tutTemp = _root.tutorialNum;
} else {
tutTemp = customTut;
}
if (tutorialCompleted != true) {
switch (tutTemp) {
case 0 :
tutTxt = "This menu indicates that it is your turn. Here you are able to \"MOVE\" your character, \"ACTION\" (Attack, Use Item), \"WAIT\" to end your turn, or view your \"STATUS\". \n\nNow, move to the enemy and attack it.";
var _local2 = {r:255, g:255, b:255};
_root.charStats.windowActions.fluxTint(_local2, 0, 60, 5, true);
showTutorialAlert(tutTxt, 220, 210);
break;
case 1 :
tutTxt = "\n\nThe BLUE squares display the tiles you are able to move to. Select the tile in front of the enemy to move to it.";
showTutorialAlert(tutTxt, 180, 310);
break;
case 2 :
if (_root.currentTurn.hasMoved == true) {
tutTxt = "After you MOVE or WAIT, you will be able to choose the direction you face. \n\nPlan ahead and strategize. An attack from behind or a tile higher than the enemy will do extra damage.";
showTutorialAlert(tutTxt, 180, 310);
}
break;
case 3 :
tutTxt = "\nNow, select \"ACTION\", and \"ATTACK\" from the menu. \n\nHere you will be able to choose the type of attack you wish to use.";
showTutorialAlert(tutTxt, 180, 310);
break;
case 4 :
tutTxt = "These RED tiles show your attack range. If there is an enemy on one of these tiles, they will appear RED and you will be able to click to attack them. \n\nBefore you attack, be sure to mouse over enemies to view their stats.";
showTutorialAlert(tutTxt, 180, 310);
break;
case 5 :
tutTxt = "You will gain EXP for attacking an enemy, but defeating them will earn you more. Some enemies will even drop TREASURE CHESTS after being defeated. \n\nYou will learn about these after picking one up later.";
showTutorialAlert(tutTxt, 180, 310);
break;
case 6 :
tutTxt = "After your turn has ended, the enemy will get their turn to move. Turn order is determined by the SPEED stat of all characters and enemies. \n\nYou can learn more about this by choosing \"STATUS\" from the game menu.";
showTutorialAlert(tutTxt, 220, 210);
break;
case 7 :
tutTxt = "You have now learned the basics of battling. \n\nBe careful out there. If you are defeated, you can only continue from the last time you saved your game. \n\nGood luck!";
showTutorialAlert(tutTxt, 220, 210);
break;
case "Level Up" :
tutTxt = "Congratulations, you have earned enough EXP and have gained a level! \n\nAt every level, you character's stats increase. You can view your stats by selecting \"STATUS\" during your turn.";
showTutorialAlert(tutTxt, 220, 210);
_root.tutorialCompleted = true;
break;
case "Treasure" :
tutTxt = "\nYou have picked up a treasure chest. Go see Grandpa when you are finished this battle to learn how to unlock them.";
showTutorialAlert(tutTxt, 220, 210);
}
}
}
function showTutorialAlert(tutTxt, xVal, yVal) {
tutScreen.removeMovieClip();
createEmptyMovieClip("tutScreen", 20);
tutScreen._alpha = 0;
var _local3 = new mx.transitions.Tween(tutScreen, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 1, true);
overlayMC = tutScreen.attachMovie("overlayGraphic", "overlayGraphic", 1);
overlayMC.onRollOver = function () {
this.useHandCursor = false;
};
textBoxMC = tutScreen.attachMovie("textBox1GFX", "textBoxMC", tutScreen.getNextHighestDepth(), {_x:xVal, _y:yVal});
addText(textBoxMC, "titleTxt2" + _root.tutorialNum, 35, 37, 410, 200, tutTxt, 12, 6050119, false, true);
closeButtonMC = textBoxMC.createEmptyMovieClip("closeButtonMC", textBoxMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 300, 135, 190, 20, "Continue", 12, 6050119);
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (_root.tutorialNum != 4) {
_root.tutorialNum++;
}
if ((_root.tutorialNum == 6) || (_root.tutorialNum == 7)) {
_root.checkForTutorial();
} else {
_root.charStats.windowActions.fluxTint(colObj, 0, 0, 50, false);
_root.tutScreen.removeMovieClip();
}
};
textBoxMC.attachMovie("textBoxArrow", "textBoxArrow", textBoxMC.getNextHighestDepth(), {_x:344, _y:136});
}
function addDefender(defenderName) {
defenderMC = initCharStats(defenderName);
defenderArr.push(defenderMC);
}
function addDefenderToMap(defenderTile, defenderName, defenderDirection) {
d = 0;
while (d < defenderArr.length) {
if (defenderName == defenderArr[d].name) {
defender = defenderArr[d];
defender.num = d;
}
d++;
}
if (defender.HP > 0) {
var _local8 = _root.display.tiles.attachMovie("defenders", defenderName, defenderTile.getDepth() + 1, {_x:defenderTile._x + 40, _y:defenderTile._y - 10});
_local8.gotoAndStop(defenderName);
_local8.charMC.gotoAndStop(defenderDirection);
defender.MC = _local8;
defender.MC.stats = defender;
defender.type = "human";
defender.tile = defenderTile;
defender.x = defenderTile.x;
defender.y = defenderTile.y;
defender.turnArrName = defenderName;
defender.curDirection = defenderDirection;
defender.height = heightMap[defender.x][defender.y];
charMap[defender.x][defender.y] = defender;
tileMap[defender.x][defender.y].walkable = false;
defender.MC.cacheAsBitmap = true;
defender.dead = false;
defender.MC._width = defender.MC._width * 1.4;
defender.MC._height = defender.MC._height * 1.4;
if (defender.ailments.length > 0) {
a = 0;
while (a < defender.ailments.length) {
if (defender.ailments[a] == "poison") {
var _local2 = {r:31, g:211, b:0};
defender.MC.charMC.fluxTint(_local2, 0, 60, 5, true);
}
a++;
}
}
turnArr.push([defender, defender.SPD]);
defenderLevelArr.push(defender);
}
}
function showRange(defender) {
rangeTiles = new Array();
rangeCount = 1;
down = false;
i = defender.x - defender.range;
while (i < ((defender.x + defender.range) + 1)) {
tileMap[i][i2].range._visible = false;
i2 = defender.y;
while (i2 < (rangeCount + defender.y)) {
addTileToRange(tileMap[i][i2], i, i2);
i2++;
}
i3 = defender.y;
while (i3 > (defender.y - rangeCount)) {
addTileToRange(tileMap[i][i3], i, i3);
i3--;
}
if (rangeCount < (defender.range + 1)) {
if (down != true) {
rangeCount++;
} else {
rangeCount--;
}
} else {
down = true;
rangeCount--;
}
i++;
}
verifyRangeTiles();
showingRange = true;
}
function addTileToRange(tile, i, i2) {
tilesAroundArr = [_root.display.tiles[(("tile_" + (tile.y + 1)) + "_") + tile.x], _root.display.tiles[(("tile_" + (tile.y - 1)) + "_") + tile.x], _root.display.tiles[(("tile_" + tile.y) + "_") + (tile.x + 1)], _root.display.tiles[(("tile_" + tile.y) + "_") + (tile.x - 1)]];
tile.range.fluxTint(colObj, 0, 0, 20, false);
rangeTiles.push(tile);
if ((tile.walkable != false) && (tile.deadChar != true)) {
tile.range._visible = true;
_root.tileMap[i][i2].inRange = true;
} else if (tile.treasure != null) {
tile.range._visible = true;
_root.tileMap[i][i2].inRange = true;
} else {
var colObj = {r:255, g:50, b:50};
}
}
function verifyRangeTiles() {
r = 0;
while (r < rangeTiles.length) {
tilesAroundArr = [_root.display.tiles[(("tile_" + (rangeTiles[r].y + 1)) + "_") + rangeTiles[r].x], _root.display.tiles[(("tile_" + (rangeTiles[r].y - 1)) + "_") + rangeTiles[r].x], _root.display.tiles[(("tile_" + rangeTiles[r].y) + "_") + (rangeTiles[r].x + 1)], _root.display.tiles[(("tile_" + rangeTiles[r].y) + "_") + (rangeTiles[r].x - 1)]];
badTiles = 0;
t = 0;
while (t < tilesAroundArr.length) {
if ((tilesAroundArr[t].walkable == false) || (tilesAroundArr[t].inRange != true)) {
badTiles++;
}
t++;
}
if (badTiles == 4) {
rangeTiles[r].inRange = false;
rangeTiles[r].range._visible = false;
rangeTiles[r].fluxTint(colObj, 0, 0, 20, false);
}
r++;
}
}
function resetRange(tiles) {
r = 0;
while (r < tiles.length) {
tiles[r].inRange = false;
tiles[r].range._visible = false;
var _local3 = {r:255, g:255, b:255};
tiles[r].fluxTint(_local3, 0, 0, 20, false);
r++;
}
_root.display.tileOutline._visible = false;
}
function checkLevelUp(char) {
if (char.EXP >= expList(char.lvl)) {
char.lvl++;
_root.charStats.charInfo.charLvl.text = char.lvl;
levelUpStats(char);
animateEXPPrep("LEVEL UP", char, 2);
_root.checkForTutorial("Level Up");
} else {
setTimeout(remOverlay, 750);
}
}
function resetDefenderFuncs() {
e = 0;
while (e < defenderArr.length) {
defenderArr[e].MC.enabled = true;
defenderArr[e].MC._alpha = 100;
defenderArr[e].MC.fluxTint(colObj, 0, 0, 99, false);
defenderArr[e].MC.hover.onRollOver = function () {
this.useHandCursor = false;
if (this._parent.stats.name != _root.currentTurn.name) {
if (this._parent.stats.dead != true) {
var _local4 = {r:255, g:255, b:255};
this._parent.fluxTint(_local4, 0, 50, 15, false, 1);
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this._parent.stats, _local3);
}
}
};
defenderArr[e].MC.hover.onRollOut = function () {
if (this._parent.stats.name != _root.currentTurn.name) {
if (this._parent.stats.dead != true) {
var _local3 = {r:255, g:255, b:255};
this._parent.fluxTint(_local3, 50, 0, 15, false);
_root.charStats.charInfo2.removeMovieClip();
}
}
};
e++;
}
}
function addDefenderAlert(defenderName) {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
addDefender(defenderName);
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
defenderAlertMC = worldMapMC.mapLevelInfoMC.attachMovie("textBox2MC", "textBoxMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:297, _y:197});
addText(defenderAlertMC, "titleTxt" + _root.grandpaCount, 0, 35, 230, 50, defenderName, 18, 0);
addText(defenderAlertMC, "titleTxt2" + _root.grandpaCount, 35, 150, 410, 80, "Has joined your party!", 12, 6050119, false, true);
var _local3 = defenderAlertMC.attachMovie("defenders", "defender_" + defenderName, defenderAlertMC.getNextHighestDepth(), {_x:115, _y:115});
_local3.gotoAndStop(defenderName);
_local3._xscale = _local3._xscale * 1.15;
_local3._yscale = _local3._yscale * 1.15;
closeButtonMC = defenderAlertMC.createEmptyMovieClip("closeButtonMC", defenderAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 20, 185, 190, 20, "Close", 12, 6050119);
closeButtonMC.defenderName = defenderName;
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (this.defenderName == "Kage") {
_root.mapAddLevelPopup(2, "Athelas");
} else if (this.defenderName == "Aryana") {
_root.mapAddLevelPopup(5, "Sandos");
}
};
}
function addEnemy(enemyTile, enemyType, enemyDirection) {
var _local4 = _root.display.tiles.attachMovie("enemies", "enemy_" + enemyTile.getDepth(), enemyTile.getDepth() + 1, {_x:enemyTile._x + 40, _y:enemyTile._y - 10});
_local4.gotoAndStop(enemyType);
_local4.charMC.gotoAndStop(enemyDirection);
enemy = getEnemyStats(enemyType);
enemy.MC = _local4;
enemy.MC.stats = enemy;
enemy.type = "enemy";
enemy.tile = enemyTile;
enemy.turnArrName = "enemy_" + enemyTile.getDepth();
enemy.x = enemyTile.x;
enemy.y = enemyTile.y;
enemy.curDirection = enemyDirection;
char.dead = false;
enemy.height = heightMap[enemy.x][enemy.y];
charMap[enemy.x][enemy.y] = enemy;
enemyArr.push(enemy);
enemy.num = enemyArr.length - 1;
tileMap[enemy.x][enemy.y].walkable = false;
enemy.MC.cacheAsBitmap = true;
enemy.MC._width = enemy.MC._width * 1.4;
enemy.MC._height = enemy.MC._height * 1.4;
turnArr.push([enemy, enemy.SPD]);
if (enemy.ailments.length > 0) {
a = 0;
while (a < enemy.ailments.length) {
if (enemy.ailments[a] == "poison") {
var _local6 = {r:31, g:211, b:0};
enemy.charMC.fluxTint(_local6, 0, 60, 5, true);
}
a++;
}
}
enemy.MC.onRollOver = function () {
this.useHandCursor = false;
if (this.stats.dead != true) {
var _local4 = {r:255, g:255, b:255};
this.fluxTint(_local4, 0, 70, 15, false, 1);
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this.stats, _local3);
}
};
enemy.MC.onRollOut = function () {
if (this.stats.dead != true) {
var _local3 = {r:255, g:255, b:255};
this.fluxTint(_local3, 70, 0, 15, false);
_root.charStats.charInfo2.removeMovieClip();
}
};
}
function resetCharFuncs() {
resetDefenderFuncs();
resetEnemyFuncs();
}
function resetEnemyFuncs() {
e = 0;
while (e < enemyArr.length) {
enemyArr[e].MC.enabled = true;
enemyArr[e].MC._alpha = 100;
enemyArr[e].MC.fluxTint(colObj, 0, 0, 99, false);
enemyArr[e].MC.onRollOver = function () {
this.useHandCursor = false;
if (this.stats.dead != true) {
var _local4 = {r:255, g:255, b:255};
this.fluxTint(_local4, 0, 70, 15, false, 1);
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this.stats, _local3);
}
};
enemyArr[e].MC.onRollOut = function () {
if (this.stats.dead != true) {
var _local3 = {r:255, g:255, b:255};
this.fluxTint(_local3, 70, 0, 15, false);
_root.charStats.charInfo2.removeMovieClip();
}
};
delete enemyArr[e].onRelease;
e++;
}
}
function findClosestDefender(enemy) {
closestDist = null;
closestDefender = null;
e = 0;
while (e < _root.defenderLevelArr.length) {
var _local4 = Math.abs(_root.defenderLevelArr[e].x - enemy.x);
var _local3 = Math.abs(_root.defenderLevelArr[e].y - enemy.y);
var _local2 = _local4 + _local3;
if ((_local2 < closestDist) || (closestDist == null)) {
if (defenderLevelArr[e].dead != true) {
closestDist = _local2;
closestDefender = _root.defenderLevelArr[e];
}
}
e++;
}
return(closestDefender);
}
function resetEnemyRollRelease() {
r = 0;
while (r < attackArr.length) {
attackArr[r].MC.onRollOver = function () {
this.useHandCursor = false;
if (this.stats.dead != true) {
var _local4 = {r:255, g:255, b:255};
this.fluxTint(_local4, 0, 70, 15, false, 1);
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this.stats, _local3);
}
};
attackArr[r].MC.onRollOut = function () {
if (this.stats.dead != true) {
var _local3 = {r:255, g:255, b:255};
this.fluxTint(_local3, 70, 0, 15, false);
_root.charStats.charInfo2.removeMovieClip();
}
};
r++;
}
}
function removeEnemyFromArray(deadChar) {
e = 0;
while (e < enemyArr.length) {
if (enemyArr[e].num == deadChar.num) {
enemyArr.splice(e, 1);
break;
}
e++;
}
}
function findPath(char, startx, starty, targetx, targety) {
path = {};
path.Unchecked_Neighbours = [];
path.done = false;
path.name = (("node_" + starty) + "_") + startx;
var _local7 = Math.abs(startx - targetx) + Math.abs(starty - targety);
path[path.name] = {x:startx, y:starty, parentx:null, parenty:null, cost:_local7};
path.Unchecked_Neighbours[path.Unchecked_Neighbours.length] = path[path.name];
while (path.Unchecked_Neighbours.length > 0) {
var _local1 = path.Unchecked_Neighbours.shift();
if ((_local1.x == targetx) and (_local1.y == targety)) {
makePath(_local1, char);
char.oldDir = null;
char.dir = null;
if (char.type == "enemy") {
setTimeout(moveChar, 500, char, charPath);
} else {
moveChar(char, charPath);
}
path.done = true;
break;
}
_local1.visited = true;
addNode(char, _local1, _local1.x + 1, _local1.y, targetx, targety);
addNode(char, _local1, _local1.x - 1, _local1.y, targetx, targety);
addNode(char, _local1, _local1.x, _local1.y + 1, targetx, targety);
addNode(char, _local1, _local1.x, _local1.y - 1, targetx, targety);
}
if (path.done) {
return(true);
}
trace("PATH IS BLOCKED!!");
pathBlocked(char, startx, starty, targetx, targety);
return(false);
}
function addNode(char, ob, x, y, targetx, targety) {
path.name = (("node_" + y) + "_") + x;
if (_root.tileMap[x][y] != undefined) {
if (char.type == "human") {
if ((_root.tileMap[x][y].walkable != false) || (char == _root.charMap[x][y])) {
if (path[path.name].cost == undefined) {
var _local3 = Math.abs(x - targetx) + Math.abs(y - targety);
path[path.name] = {x:x, y:y, parentx:ob.x, parenty:ob.y, cost:_local3};
var _local2 = 0;
while (_local2 < path.Unchecked_Neighbours.length) {
if (_local3 < path.Unchecked_Neighbours[_local2].cost) {
path.Unchecked_Neighbours.splice(_local2, 0, path[path.name]);
break;
}
_local2++;
}
if (_local2 >= path.Unchecked_Neighbours.length) {
path.Unchecked_Neighbours[path.Unchecked_Neighbours.length] = path[path.name];
}
}
}
} else if ((_root.tileMap[x][y].walkable != false) || (char == _root.charMap[x][y])) {
if (_root.tileMap[x][y].deadChar != true) {
if (path[path.name].cost == undefined) {
var _local3 = Math.abs(x - targetx) + Math.abs(y - targety);
path[path.name] = {x:x, y:y, parentx:ob.x, parenty:ob.y, cost:_local3};
var _local2 = 0;
while (_local2 < path.Unchecked_Neighbours.length) {
if (_local3 < path.Unchecked_Neighbours[_local2].cost) {
path.Unchecked_Neighbours.splice(_local2, 0, path[path.name]);
break;
}
_local2++;
}
if (_local2 >= path.Unchecked_Neighbours.length) {
path.Unchecked_Neighbours[path.Unchecked_Neighbours.length] = path[path.name];
}
}
}
}
}
}
function makePath(ob, char) {
if ((char.type == "human") && (_root.soundOn == true)) {
_root.chooseTileSnd.start();
}
resetRange(rangeTiles);
game.path = [];
charPath = new Array();
while (ob.parentx != null) {
game.path[game.path.length] = ob.x;
game.path[game.path.length] = ob.y;
ob = path[(("node_" + ob.parenty) + "_") + ob.parentx];
charPath.push(_root.display.tiles[(("tile_" + ob.y) + "_") + ob.x]);
}
if (char.type == "enemy") {
if (charPath.length == 1) {
if (charPath[0] == char.targetChar.tile) {
char.MC.charMC.viewMC.gotoAndStop(1);
resetRange(rangeTiles);
faceChar(char);
prepAttack(char);
} else {
setTimeout(checkTurn, 500);
}
}
charPath.pop();
targetTile = checkDeadTile(char, charPath);
} else {
var _local4 = {r:255, g:255, b:255};
targetTile = charPath[charPath.length - 1];
targetTile.range._visible = true;
targetTile.range.fluxTint(_local4, 0, 70, 4, true);
}
moveCount = 0;
}
function checkDeadTile(char, charPath) {
if (char.range > charPath.length) {
targetTile = charPath[charPath.length - 1];
} else {
targetTile = charPath[char.range - 1];
}
if (targetTile.deadChar == true) {
charPath.pop();
if (charPath.length == 0) {
targetTile = null;
faceChar(char);
setTimeout(checkTurn, 500);
} else if (char.range > charPath.length) {
targetTile = charPath[charPath.length - 1];
} else {
targetTile = charPath[char.range - 1];
}
}
var _local3 = {r:255, g:0, b:0};
targetTile.range._visible = true;
targetTile.range.fluxTint(_local3, 20, 70, 4, true);
return(targetTile);
}
function pathBlocked(char, startx, starty, targetx, targety) {
foundBlockedPath = false;
while (foundBlockedPath == false) {
randArrNum = Math.floor(Math.random() * rangeTiles.length);
if ((rangeTiles[randArrNum].walkable != false) && (rangeTiles[randArrNum] != undefined)) {
foundBlockedPath = true;
findPath(char, rangeTiles[randArrNum].x, rangeTiles[randArrNum].y, targetx, targety);
} else {
foundBlockedPath = false;
}
}
}
function moveChar(char, charPath) {
char.MC.indicator.playerIndicator.removeMovieClip();
if (charPath[moveCount] != undefined) {
tileMap[char.x][char.y].walkable = true;
charMap[char.x][char.y] = 0;
oldX = char.x;
oldY = char.y;
char.x = charPath[moveCount].x;
char.y = charPath[moveCount].y;
char.tile = tileMap[char.x][char.y];
charMap[char.x][char.y] = char;
charPath[moveCount].walkable = false;
char.height = heightMap[char.x][char.y];
xDif = char.MC._x - (charPath[moveCount]._x + 40);
yDif = char.MC._y - (charPath[moveCount]._y - 10);
var _local2 = new mx.transitions.Tween(_root.display.tiles, "_x", mx.transitions.easing.None.easeNone, _root.display.tiles._x, _root.display.tiles._x + xDif, moveSpeed, true);
var _local4 = new mx.transitions.Tween(_root.display.tiles, "_y", mx.transitions.easing.None.easeNone, _root.display.tiles._y, _root.display.tiles._y + yDif, moveSpeed, true);
if (checkDirection(char, char.x, oldX, char.y, oldY) == true) {
if (char.oldDir != char.dir) {
char.MC.charMC.viewMC.gotoAndPlay(2);
}
halfX = char.MC._x + (((charPath[moveCount]._x + 40) - char.MC._x) / 1.25);
halfY = char.MC._y + (((charPath[moveCount]._y - 10) - char.MC._y) / 1.25);
var _local3 = new mx.transitions.Tween(char.MC, "_x", mx.transitions.easing.None.easeNone, char.MC._x, halfX, moveSpeed * 0.8, true);
var _local5 = new mx.transitions.Tween(char.MC, "_y", mx.transitions.easing.None.easeNone, char.MC._y, halfY, moveSpeed * 0.8, true);
_local3.onMotionFinished = function () {
char.MC.swapDepths(charPath[moveCount].getDepth() + 1);
var _local1 = new mx.transitions.Tween(char.MC, "_x", mx.transitions.easing.None.easeNone, char.MC._x, charPath[moveCount]._x + 40, moveSpeed * 0.17, true);
var _local2 = new mx.transitions.Tween(char.MC, "_y", mx.transitions.easing.None.easeNone, char.MC._y, charPath[moveCount]._y - 10, moveSpeed * 0.17, true);
_local1.onMotionFinished = function () {
doneMove(char, charPath);
};
};
} else {
if (char.oldDir != char.dir) {
char.MC.charMC.viewMC.gotoAndPlay(2);
}
var _local3 = new mx.transitions.Tween(char.MC, "_x", mx.transitions.easing.None.easeNone, char.MC._x, charPath[moveCount]._x + 40, moveSpeed, true);
var _local5 = new mx.transitions.Tween(char.MC, "_y", mx.transitions.easing.None.easeNone, char.MC._y, charPath[moveCount]._y - 10, moveSpeed, true);
_local3.onMotionFinished = function () {
doneMove(char, charPath);
};
char.MC.swapDepths(charPath[moveCount].getDepth() + 1);
}
}
}
function doneMove(char) {
if (((char.x == charPath[charPath.length - 1].x) && (char.y == charPath[charPath.length - 1].y)) && (char.type == "enemy")) {
if (((char.y - char.targetChar.y) == 0) || ((char.x - char.targetChar.x) == 0)) {
if (((((char.x - char.targetChar.x) == -1) || ((char.x - char.targetChar.x) == 1)) || ((char.y - char.targetChar.y) == -1)) || ((char.y - char.targetChar.y) == 1)) {
char.MC.charMC.viewMC.gotoAndStop(1);
targetTile.fluxTint(colObj, 20, 0, 2, false);
targetTile.range._visible = false;
faceChar(char);
resetRange(rangeTiles);
prepAttack(char);
} else {
endTurn(char);
}
} else {
endTurn(char);
}
} else if (((moveCount != (charPath.length - 1)) && (char.type == "human")) || ((moveCount < (char.range - 1)) && (char.type == "enemy"))) {
moveCount++;
moveChar(char, charPath);
} else {
endTurn(char);
}
}
function endTurn(char) {
char.MC.charMC.viewMC.gotoAndStop(1);
targetTile.range.fluxTint(colObj, 20, 0, 2, false);
targetTile.range._visible = false;
resetRange(rangeTiles);
if (char.type == "human") {
if (char.tile.treasure != null) {
addTreasure(char.tile.treasure.difficulty);
showFoundTreasureAlert(char.tile.treasure.difficulty);
char.tile.treasure.removeMovieClip();
char.tile.treasure = null;
char.tile.deadChar = false;
} else {
faceDirection(char);
}
} else if ((char.type == "enemy") && (char.spells.length > 0)) {
enemySpell = getSpellInfo(char.spells[0][0]);
spellRangeArr = enemyCheckSpellRange(char, enemySpell);
if ((spellRangeArr.length > 0) && (char.MP >= enemySpell.MPCost)) {
char.targetChar = spellRangeArr[0];
faceChar(char);
setTimeout(enemyCastSpell, 500, char, enemySpell);
} else {
setTimeout(checkTurn, 500);
}
} else {
char.curDirection = char.MC.charMC._currentframe;
setTimeout(checkTurn, 500);
}
}
function hideNotification(notification) {
var _local2 = new mx.transitions.Tween(notification, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, 0.5, true);
_local2.onMotionFinished = function () {
notification.removeMovieClip();
};
faceDirection(_root.currentTurn);
}
function checkDirection(char, X1, X2, Y1, Y2) {
char.oldDir = char.dir;
if (X1 == X2) {
if (Y1 > Y2) {
char.MC.charMC.gotoAndStop(1);
char.dir = 1;
// unexpected jump
}
char.MC.charMC.gotoAndStop(3);
char.dir = 3;
return(true);
}
if (Y1 == Y2) {
if (X1 > X2) {
char.MC.charMC.gotoAndStop(2);
char.dir = 2;
} else {
char.MC.charMC.gotoAndStop(4);
char.dir = 4;
return(true);
}
}
}
function faceChar(char) {
trace((("CHAR X: " + char.x) + " CHAR Y: ") + char.y);
trace((("targetChar X: " + char.targetChar.x) + " targetChar Y: ") + char.targetChar.y);
if (char.y < char.targetChar.y) {
trace((char.name + " IS ABOVE ") + char.targetChar.name);
if (char.x > char.targetChar.x) {
char.MC.charMC.gotoAndStop(4);
char.curDirection = 4;
} else {
char.MC.charMC.gotoAndStop(1);
char.curDirection = 1;
}
} else if (char.y > char.targetChar.y) {
trace((char.name + " IS BELOW ") + char.targetChar.name);
if ((char.x > char.targetChar.x) || (char.x == char.targetChar.x)) {
char.MC.charMC.gotoAndStop(3);
char.curDirection = 3;
} else {
char.MC.charMC.gotoAndStop(2);
char.curDirection = 2;
}
} else {
trace((char.name + " IS SAME Y AS ") + char.targetChar.name);
if (char.x < char.targetChar.x) {
char.MC.charMC.gotoAndStop(2);
char.curDirection = 2;
} else {
char.MC.charMC.gotoAndStop(4);
char.curDirection = 4;
}
}
}
function faceDirection(char, endTurnEarly) {
_root.currentTurn.hasMoved = true;
_root.endTurnEarly = endTurnEarly;
checkForTutorial();
var _local10 = _root.display.tiles.createEmptyMovieClip("windowDirection", _root.display.tiles.getNextHighestDepth());
_local10._x = char.MC._x - 40;
_local10._y = char.MC._y - 100;
_local10.useHandCursor = false;
dirButtonArr = new Array();
dirButtonArr = [["dirArrowDR", 50, 25], ["dirArrowDL", 10, 25], ["dirArrowUL", 10, 5], ["dirArrowUR", 50, 5]];
curDirButton = null;
d = 0;
while (d < dirButtonArr.length) {
var _local3 = _local10.attachMovie(dirButtonArr[d][0], dirButtonArr[d][0], d, {_x:dirButtonArr[d][1], _y:dirButtonArr[d][2]});
_local3._height = _local3._height * 1.4;
_local3._width = _local3._width * 1.4;
_local3.dirFrame = d + 1;
_local3.onRollOver = function () {
_root.curDirButton.fluxTint(colObj, 0, 0, 0, false);
_root.curDirButton.gotoAndStop(1);
this.gotoAndStop(2);
_root.curDirButton = this;
var colObj = {r:255, g:255, b:0};
this.fluxTint(colObj, 0, 70, 15, true);
_root.currentTurn.MC.charMC.gotoAndStop(this.dirFrame);
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.currentTurn.curDirection = this.dirFrame;
_root.charStats.windowActions.removeMovieClip();
_root.display.tiles.windowDirection.removeMovieClip();
if (_root.endTurnEarly == true) {
trace("END EARLY!!");
_root.checkTurn();
} else {
trace("DID NOT END EARLY, SHOW ACTIONS");
trace("TUT NUM: " + _root.tutorialNum);
_root.currentTurn.hasMoved = true;
_root.charStats.attachMovie("windowActions", "windowActions", _root.charStats.getNextHighestDepth(), {_x:50, _y:500});
var _local3 = new mx.transitions.Tween(_root.charStats.windowActions, "_y", mx.transitions.easing.Strong.easeOut, 400, 125, 1, true);
_local3.onMotionFinished = function () {
_root.checkForTutorial();
};
_root.displayActions(_root.currentTurn);
}
};
if (_root.currentTurn.MC.charMC._currentframe == (d + 1)) {
var colObj = {r:255, g:255, b:0};
_local3.fluxTint(colObj, 0, 70, 15, true);
_local3.gotoAndStop(2);
_root.curDirButton = _local3;
}
d++;
}
}
function initCharStats(defName) {
switch (defName) {
case "Kronus" :
char = new Object();
char.name = defName;
char.classType = "Knight";
char.lvl = 1;
char.HP = 25;
char.HPMax = char.HP;
char.MP = 0;
char.MPMax = char.MP;
char.DEF = 3;
char.STR = 4;
char.MAG = 0;
char.EXP = 0;
char.SPD = 4;
char.LCK = 5;
char.range = 3;
char.attacks = new Array();
char.attacks = ["SLICE"];
char.spells = new Array();
char.ailments = new Array();
char.WEAPON = null;
char.ARMOR = null;
char.ACCESSORY = null;
return(char);
case "Kage" :
char = new Object();
char.name = defName;
char.classType = "Mage";
char.lvl = 3;
char.HP = 50;
char.HPMax = char.HP;
char.MP = 50;
char.MPMax = char.MP;
char.DEF = 3;
char.STR = 4;
char.MAG = 9;
char.EXP = 0;
char.SPD = 5;
char.LCK = 5;
char.range = 3;
char.attacks = new Array();
char.attacks = ["CLUB"];
char.spells = new Array();
char.spells = [["HEAL"], ["FLAME"]];
char.ailments = new Array();
char.WEAPON = null;
char.ARMOR = null;
char.ACCESSORY = null;
return(char);
case "Aryana" :
char = new Object();
char.name = defName;
char.classType = "Archer";
char.lvl = 5;
char.HP = 60;
char.HPMax = char.HP;
char.MP = 0;
char.MPMax = char.MP;
char.DEF = 6;
char.STR = 8;
char.MAG = 0;
char.EXP = 0;
char.SPD = 9;
char.LCK = 7;
char.range = 4;
char.attacks = new Array();
char.attacks = ["SHOOT"];
char.spells = new Array();
char.ailments = new Array();
char.WEAPON = null;
char.ARMOR = null;
char.ACCESSORY = null;
return(char);
}
}
function getAttackFunc(attackName) {
switch (attackName) {
case "SLICE" :
_root.attackMelee(_root.currentTurn);
break;
case "CLUB" :
_root.attackMelee(_root.currentTurn);
break;
case "SHOOT" :
_root.attackShoot(_root.currentTurn);
}
}
function getCharStats(char, defName) {
switch (defName) {
case "Kronus" :
char.name = defName;
char.classType = "Knight";
char.lvl = 1;
char.HP = 25;
char.HPMax = char.HP;
char.MP = 0;
char.MPMax = char.MP;
char.DEF = 3;
char.STR = 4;
char.MAG = 0;
char.EXP = 0;
char.SPD = 4;
char.LCK = 5;
char.range = 3;
char.attacks = new Array();
char.attacks = [["SLICE", _root.attackMelee]];
char.spells = new Array();
char.ailments = new Array();
char.WEAPON = null;
char.ARMOR = null;
char.ACCESSORY = null;
break;
case "Kage" :
char.name = defName;
char.classType = "Mage";
char.lvl = 1;
char.HP = 20;
char.HPMax = char.HP;
char.MP = 50;
char.MPMax = char.MP;
char.DEF = 1;
char.STR = 1;
char.MAG = 4;
char.EXP = 0;
char.SPD = 5;
char.LCK = 5;
char.range = 3;
char.attacks = new Array();
char.attacks = [["CLUB", _root.attackMelee]];
char.spells = new Array();
char.spells = [["HEAL"], ["FLAME"], ["POISON"], ["SHOCK"], ["FREEZE"]];
char.ailments = new Array();
char.WEAPON = null;
char.ARMOR = null;
char.ACCESSORY = null;
break;
case "Aryana" :
char.name = defName;
char.classType = "Archer";
char.lvl = 1;
char.HP = 20;
char.HPMax = char.HP;
char.MP = 0;
char.MPMax = char.MP;
char.DEF = 2;
char.STR = 3;
char.MAG = 0;
char.EXP = 0;
char.SPD = 6;
char.LCK = 7;
char.range = 4;
char.attacks = new Array();
char.attacks = [["SHOOT", _root.attackShoot]];
char.spells = new Array();
char.ailments = new Array();
char.WEAPON = null;
char.ARMOR = null;
char.ACCESSORY = null;
}
}
function expList(level) {
switch (level) {
case 1 :
return(12);
case 2 :
return(50);
case 3 :
return(90);
case 4 :
return(160);
case 5 :
return(300);
case 6 :
return(500);
case 7 :
return(800);
case 8 :
return(1200);
case 9 :
return(1600);
case 10 :
return(2100);
case 11 :
return(2500);
case 12 :
return(3000);
case 13 :
return(3600);
case 14 :
return(4400);
case 15 :
return(5200);
case 16 :
return(6200);
case 17 :
return(7500);
case 18 :
return(9000);
case 19 :
return(11000);
}
return(20000);
}
function levelUpStats(char) {
if (_root.soundOn == true) {
_root.levelupSnd.start();
}
switch (char.classType) {
case "Knight" :
if (char.lvl == 2) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.STR = char.STR + 1;
char.LCK = char.LCK + 1;
} else if (char.lvl == 3) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.SPD = char.SPD + 1;
} else if (char.lvl == 4) {
char.HPMax = char.HPMax + 5;
char.STR = char.STR + 1;
char.SPD = char.SPD + 1;
} else if (char.lvl == 5) {
char.HPMax = char.HPMax + 5;
char.STR = char.STR + 1;
char.DEF = char.DEF + 1;
} else if (char.lvl == 6) {
char.HPMax = char.HPMax + 5;
char.STR = char.STR + 1;
char.DEF = char.DEF + 1;
char.SPD = char.SPD + 1;
} else if (char.lvl == 7) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
} else if (char.lvl == 8) {
char.HPMax = char.HPMax + 5;
char.STR = char.STR + 1;
} else if (char.lvl == 9) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.LCK = char.LCK + 1;
} else if (char.lvl == 10) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.STR = char.STR + 1;
} else {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.STR = char.STR + 1;
}
break;
case "Mage" :
if (char.lvl == 4) {
char.HPMax = char.HPMax + 5;
char.MPMax = char.MPMax + 5;
char.MAG = char.MAG + 1;
} else if (char.lvl == 4) {
char.HPMax = char.HPMax + 5;
char.MPMax = char.MPMax + 2;
char.STR = char.STR + 1;
char.MAG = char.MAG + 1;
} else if (char.lvl == 5) {
char.HPMax = char.HPMax + 2;
char.MPMax = char.MPMax + 2;
char.DEF = char.DEF + 1;
char.MAG = char.MAG + 1;
} else if (char.lvl == 6) {
char.HPMax = char.HPMax + 5;
char.MPMax = char.MPMax + 5;
char.SPD = char.SPD + 1;
} else if (char.lvl == 7) {
char.HPMax = char.HPMax + 5;
char.MPMax = char.MPMax + 2;
char.STR = char.STR + 1;
char.MAG = char.MAG + 1;
} else if (char.lvl == 8) {
char.HPMax = char.HPMax + 5;
char.MPMax = char.MPMax + 5;
char.SPD = char.SPD + 1;
} else if (char.lvl == 9) {
char.HPMax = char.HPMax + 5;
char.MPMax = char.MPMax + 2;
char.STR = char.STR + 1;
char.MAG = char.MAG + 1;
} else if (char.lvl == 10) {
char.HPMax = char.HPMax + 2;
char.MPMax = char.MPMax + 5;
char.DEF = char.DEF + 1;
char.MAG = char.MAG + 1;
} else {
char.HPMax = char.HPMax + 2;
char.MPMax = char.MPMax + 2;
char.DEF = char.DEF + 1;
char.MAG = char.MAG + 1;
}
break;
case "Archer" :
if (char.lvl == 2) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.STR = char.STR + 1;
char.LCK = char.LCK + 1;
} else if (char.lvl == 3) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.SPD = char.SPD + 1;
} else if (char.lvl == 4) {
char.HPMax = char.HPMax + 5;
char.STR = char.STR + 1;
char.SPD = char.SPD + 1;
} else if (char.lvl == 5) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
} else if (char.lvl == 6) {
char.HPMax = char.HPMax + 5;
char.STR = char.STR + 1;
char.SPD = char.SPD + 1;
} else if (char.lvl == 7) {
char.HPMax = char.HPMax + 5;
char.SPD = char.SPD + 1;
} else if (char.lvl == 8) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.STR = char.STR + 1;
} else if (char.lvl == 9) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.LCK = char.LCK + 1;
} else if (char.lvl == 10) {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.STR = char.STR + 1;
} else {
char.HPMax = char.HPMax + 5;
char.DEF = char.DEF + 1;
char.STR = char.STR + 1;
}
}
}
function getEnemyStats(type) {
enemy = new Object();
switch (type) {
case "beetle1" :
enemy.name = "Mutant Beetle";
enemy.lvl = 1;
enemy.HP = 15;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 1;
enemy.STR = 4;
enemy.WEP = 0;
enemy.EXP = 4;
enemy.GOLD = 3;
enemy.SPD = 1;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 1;
enemy.ailments = new Array();
return(enemy);
case "beetle2" :
enemy.name = "Red Beetle";
enemy.lvl = 1;
enemy.HP = 30;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 1;
enemy.STR = 6;
enemy.WEP = 0;
enemy.EXP = 8;
enemy.GOLD = 6;
enemy.SPD = 1;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 1;
enemy.ailments = new Array();
return(enemy);
case "beetle3" :
enemy.name = "Super Beetle";
enemy.lvl = 1;
enemy.HP = 65;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 4;
enemy.STR = 4;
enemy.WEP = 0;
enemy.EXP = 20;
enemy.GOLD = 20;
enemy.SPD = 1;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 2;
enemy.ailments = new Array();
return(enemy);
case "snake1" :
enemy.name = "Garden Snake";
enemy.lvl = 1;
enemy.HP = 25;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 1.5;
enemy.STR = 5;
enemy.WEP = 0;
enemy.EXP = 6;
enemy.GOLD = 5;
enemy.SPD = 1;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 1;
enemy.ailments = new Array();
return(enemy);
case "snake2" :
enemy.name = "Venom Snake";
enemy.lvl = 1;
enemy.HP = 25;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 1.5;
enemy.STR = 7;
enemy.WEP = 0;
enemy.EXP = 25;
enemy.GOLD = 20;
enemy.SPD = 1;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 2;
enemy.ailments = new Array();
enemy.poisonous = true;
return(enemy);
case "snake3" :
enemy.name = "Anaconda";
enemy.lvl = 1;
enemy.HP = 80;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 8;
enemy.STR = 8;
enemy.WEP = 0;
enemy.EXP = 60;
enemy.GOLD = 40;
enemy.SPD = 10;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 2;
enemy.ailments = new Array();
return(enemy);
case "mutant1" :
enemy.name = "Mutant";
enemy.lvl = 1;
enemy.HP = 20;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 2;
enemy.STR = 5;
enemy.WEP = 0;
enemy.EXP = 20;
enemy.GOLD = 10;
enemy.SPD = 6;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 1;
enemy.ailments = new Array();
return(enemy);
case "mutant3" :
enemy.name = "Mutant Leader";
enemy.lvl = 1;
enemy.HP = 100;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 5;
enemy.STR = 8;
enemy.WEP = 0;
enemy.EXP = 100;
enemy.GOLD = 100;
enemy.SPD = 10;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 1;
enemy.ailments = new Array();
return(enemy);
case "scorpion1" :
enemy.name = "Scorpion";
enemy.lvl = 1;
enemy.HP = 40;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 6;
enemy.STR = 7;
enemy.WEP = 0;
enemy.EXP = 40;
enemy.GOLD = 25;
enemy.SPD = 6;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 2;
enemy.ailments = new Array();
return(enemy);
case "scorpion2" :
enemy.name = "Fire Scorpion";
enemy.lvl = 1;
enemy.HP = 65;
enemy.HPMax = enemy.HP;
enemy.MP = 8;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 8;
enemy.STR = 5;
enemy.MAG = 10;
enemy.WEP = 0;
enemy.EXP = 60;
enemy.GOLD = 30;
enemy.SPD = 1;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 2;
enemy.ailments = new Array();
enemy.poisonous = true;
enemy.spells = new Array();
enemy.spells = [["FLAME"]];
return(enemy);
case "eyeguy1" :
enemy.name = "Eye Guy";
enemy.lvl = 1;
enemy.HP = 85;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 7;
enemy.STR = 8;
enemy.WEP = 0;
enemy.EXP = 60;
enemy.GOLD = 35;
enemy.SPD = 15;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 2;
enemy.ailments = new Array();
return(enemy);
case "skeleton1" :
enemy.name = "Skeleton";
enemy.lvl = 1;
enemy.HP = 100;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 10;
enemy.STR = 10;
enemy.WEP = 0;
enemy.EXP = 80;
enemy.GOLD = 40;
enemy.SPD = 8;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 3;
enemy.ailments = new Array();
return(enemy);
case "skeleton2" :
enemy.name = "Skeletal Mage";
enemy.lvl = 1;
enemy.HP = 100;
enemy.HPMax = enemy.HP;
enemy.MP = 20;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.MAG = 12;
enemy.DEF = 8;
enemy.STR = 5;
enemy.WEP = 0;
enemy.EXP = 90;
enemy.GOLD = 42;
enemy.SPD = 1;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 3;
enemy.ailments = new Array();
enemy.spells = new Array();
enemy.spells = [["SHOCK"]];
return(enemy);
case "flameskull1" :
enemy.name = "Flaming Skull";
enemy.lvl = 1;
enemy.HP = 90;
enemy.HPMax = enemy.HP;
enemy.MP = 14;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 6;
enemy.STR = 4;
enemy.MAG = 8;
enemy.EXP = 65;
enemy.GOLD = 40;
enemy.SPD = 10;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 4;
enemy.ailments = new Array();
enemy.spells = new Array();
enemy.spells = [["FLAME"]];
return(enemy);
case "flameskull2" :
enemy.name = "Ether Skull";
enemy.lvl = 1;
enemy.HP = 120;
enemy.HPMax = enemy.HP;
enemy.MP = 14;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 8;
enemy.STR = 8;
enemy.MAG = 10;
enemy.EXP = 75;
enemy.GOLD = 45;
enemy.SPD = 10;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 4;
enemy.ailments = new Array();
enemy.spells = new Array();
enemy.spells = [["SHOCK"]];
return(enemy);
case "flameskull3" :
enemy.name = "Poison Mist";
enemy.lvl = 1;
enemy.HP = 140;
enemy.HPMax = enemy.HP;
enemy.MP = 25;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 8;
enemy.STR = 8;
enemy.MAG = 12;
enemy.EXP = 100;
enemy.GOLD = 50;
enemy.SPD = 10;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 4;
enemy.ailments = new Array();
enemy.spells = new Array();
enemy.spells = [["POISON"]];
enemy.poisonous = true;
return(enemy);
case "ogre1" :
enemy.name = "Ogre";
enemy.lvl = 1;
enemy.HP = 150;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 10;
enemy.STR = 10;
enemy.WEP = 0;
enemy.EXP = 100;
enemy.GOLD = 55;
enemy.SPD = 1;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 4;
enemy.ailments = new Array();
return(enemy);
case "ogre3" :
enemy.name = "Ogre Lord";
enemy.lvl = 1;
enemy.HP = 300;
enemy.HPMax = enemy.HP;
enemy.MP = 0;
enemy.MPMax = enemy.MP;
enemy.lvl = 1;
enemy.DEF = 16;
enemy.STR = 15;
enemy.WEP = 0;
enemy.EXP = 600;
enemy.GOLD = 200;
enemy.SPD = 1;
enemy.range = 3;
enemy.LCK = 5;
enemy.difficulty = 4;
enemy.ailments = new Array();
return(enemy);
}
}
function attackMelee(char) {
checkForTutorial();
char.MC.fluxTint(colObj, 0, 0, 1, false);
checkMelee(char);
r = 0;
while (r < attackArr.length) {
if (attackArr.dead != true) {
var colObj = {r:255, g:0, b:0};
attackArr[r].MC.fluxTint(colObj, 0, 60, 5, true);
attackArr[r].MC.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (_root.tutorialNum == 4) {
_root.tutorialNum++;
}
_root.resetRange(_root.attackRangeArr);
this.enabled = false;
this.useHandCursor = false;
this.fluxTint(colObj, 0, 0, 1, false);
_root.currentTurn.targetChar = this.stats;
_root.faceChar(_root.currentTurn);
prepAttack(_root.currentTurn);
_root.currentTurn.MC.enabled = false;
this.enabled = false;
};
attackArr[r].MC.onRollOver = function () {
this.useHandCursor = true;
var _local4 = {r:255, g:255, b:255};
this.fluxTint(_local4, 0, 70, 15, false, 1);
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this.stats, _local3);
};
attackArr[r].MC.onRollOut = function () {
var _local3 = {r:255, g:0, b:0};
this.fluxTint(_local3, 0, 60, 5, true);
_root.charStats.charInfo2.removeMovieClip();
};
}
r++;
}
}
function checkMelee(char) {
attackRangeArr = new Array();
attackRangeArr = [tileMap[char.x][char.y - 1], tileMap[char.x][char.y + 1], tileMap[char.x - 1][char.y], tileMap[char.x + 1][char.y]];
attackArr = new Array();
m = 0;
while (m < attackRangeArr.length) {
e = 0;
while (e < enemyArr.length) {
if (tileMap[enemyArr[e].x][enemyArr[e].y] == attackRangeArr[m]) {
attackArr.push(enemyArr[e]);
}
e++;
}
attackRangeArr[m].range._visible = true;
var _local1 = {r:255, g:0, b:0};
attackRangeArr[m].range.fluxTint(_local1, 0, 70, 99, false, 1);
m++;
}
}
function prepAttack(char) {
disableCharRollOvers();
char.MC.indicator.playerIndicator.removeMovieClip();
addOverlay(char, char.targetChar);
if ((char.type == "enemy") && (char.spells.length > 0)) {
enemySpell = getSpellInfo(char.spells[0][0]);
if (char.MP >= enemySpell.MPCost) {
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local4 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(char.targetChar, _local3);
spellShowVS();
setTimeout(prepSpell, 1000, enemySpell, char.targetChar);
} else {
setTimeout(attackTarget, 250, char);
}
} else {
setTimeout(attackTarget, 250, char);
}
}
function attackTarget(char) {
_root.charStats.windowActions.removeMovieClip();
target = char.targetChar;
char.missed = checkMiss(char, target);
if (char.missed == false) {
damage = Math.ceil((0.5 * char.STR) * (char.STR / target.DEF));
criticalHit = checkCriticalHit(char);
if (criticalHit == true) {
damage = Math.ceil(damage * 1.5);
}
if (charBehindTarget(char.curDirection, target.curDirection) == true) {
damage = Math.ceil(damage * 1.25);
}
if (char.height > target.height) {
damage = Math.ceil(damage * 1.25);
} else if (char.height < target.height) {
damage = Math.floor(damage * 0.75);
}
if (damage < 1) {
damage = 1;
}
if (char.type == "enemy") {
setTimeout(showTargetInfo, 0, damage, char, target);
} else {
setTimeout(showVS, 0, char, damage, target);
}
} else {
criticalHit = false;
damage = "MISS";
if (char.type == "enemy") {
setTimeout(showTargetInfo, 0, damage, char, target);
} else {
setTimeout(showVS, 0, char, damage, target);
}
}
}
function showTargetInfo(damage, char, target) {
var _local2 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", 2, {_x:850, _y:440});
var _local4 = new mx.transitions.Tween(_local2, "_x", mx.transitions.easing.Strong.easeOut, _local2._x, 490, 1, true);
updateCharacterInfo(target, _local2);
setTimeout(showVS, 200, char, damage, target);
}
function showVS(char, damage, target) {
_root.charStats.VS.removeMovieClip();
_root.charStats.attachMovie("VS-MC", "VS", _root.charStats.getNextHighestDepth(), {_x:360, _y:470});
setTimeout(attackAnimation, 600, char, damage, target);
}
function attackAnimation(char, damage, target) {
char.MC.charMC.viewMC.gotoAndPlay("attack");
if (_root.soundOn == true) {
if (char.missed != true) {
if (char.type == "enemy") {
_root.damageSnd.start();
} else if (char.classType == "Knight") {
_root.swordSnd.start();
}
} else {
_root.missSnd.start();
}
}
setTimeout(displayDamage, 300, damage, target, char);
}
function checkDeath(char) {
if (char.HP <= 0) {
char.HP = 0;
targetDeath(char);
} else if ((_root.currentTurn.type == "human") && (_root.currentTurn.missed != true)) {
hitEXP = 2;
_root.currentTurn.EXP = _root.currentTurn.EXP + hitEXP;
expString = hitEXP + " EXP";
animateEXPPrep(expString, _root.currentTurn, 2);
} else {
remOverlay();
}
}
function checkLevelComplete() {
if (enemyArr.length == 0) {
return(true);
}
return(false);
}
function endAttack() {
if ((_root.currentTurn.type == "enemy") && (checkGameOver(_root.currentTurn.targetChar) == true)) {
gameOverFunc();
} else if (checkLevelComplete() == true) {
levelComplete();
} else {
resetCharFuncs();
if (_root.currentTurn.type == "enemy") {
checkTurn();
} else {
_root.currentTurn.hasAttacked = true;
_root.charStats.charInfo2.removeMovieClip();
_root.charStats.VS.removeMovieClip();
showActions(currentTurn);
}
}
}
function checkGameOver(char) {
if ((char.classType == "Knight") && (char.HP <= 0)) {
return(true);
}
return(false);
}
function targetDeath(deadChar, poisonDeath) {
deadChar.dead = true;
if (deadChar.type == "enemy") {
enemiesKilledCount++;
if (enemiesKilledCount == 100) {
warriorGuildCount++;
}
removeEnemyFromArray(deadChar);
if (poisonDeath != true) {
_root.currentTurn.EXP = _root.currentTurn.EXP + deadChar.EXP;
expString = deadChar.EXP + " EXP";
animateEXPPrep(expString, _root.currentTurn, 2);
}
levelGold = levelGold + deadChar.GOLD;
if (enemyArr.length > 0) {
dropTreasure = rollTreasure();
}
a = 0;
while (a < deadChar.ailments.length) {
if (deadChar.ailments[a] == "frozen") {
deadChar.freezeMC.removeMovieClip();
}
a++;
}
} else if (deadChar.type == "human") {
if (_root.soundOn == true) {
_root.deathSnd.start();
}
dropTreasure = false;
if (poisonDeath != true) {
setTimeout(remOverlay, 750);
}
}
t = 0;
while (t < turnArr.length) {
if (turnArr[t][0].turnArrName == deadChar.turnArrName) {
trace("REMOVE: " + turnArr[t][0].turnArrName);
turnArr.splice(t, 1);
break;
}
t++;
}
tileMap[deadChar.x][deadChar.y].walkable = true;
tileMap[deadChar.x][deadChar.y].deadChar = true;
deadChar.dead = true;
deadChar.enabled = false;
deadChar.MC.charMC.gotoAndStop("dead");
}
function checkMiss(char, target) {
if (charBehindTarget(char.curDirection, target.curDirection) == true) {
return(false);
}
randRoll = Math.floor(Math.random() * 100);
evasionRate = (target.SPD - char.SPD) * 5;
if (evasionRate < 0) {
evasionRate = 5;
}
if (randRoll < evasionRate) {
return(true);
}
return(false);
}
function checkCriticalHit(char) {
randRoll = Math.floor(Math.random() * 100);
if (randRoll <= char.LCK) {
return(true);
}
return(false);
}
function rollPoison() {
randRoll = Math.floor(Math.random() * 100);
if (randRoll <= 25) {
return(true);
}
return(false);
}
function charBehindTarget(charDir, targetDir) {
if (charDir == targetDir) {
return(true);
}
return(false);
}
function displayDamage(damage, target, char) {
damageArr = damage.toString().split("");
_root.display.tiles.createEmptyMovieClip("damageTxt", _root.display.tiles.getNextHighestDepth());
wordWidth = 0;
if (criticalHit == true) {
animateCritPrep("CRITICAL!", target, 1);
}
if (damage == 0) {
_root.display.tiles.damageTxt._visible = false;
}
d = 0;
while (d < damageArr.length) {
var _local3 = _root.display.tiles.damageTxt.attachMovie("damageTxt", "damageTxt" + d, _root.display.tiles.damageTxt.getNextHighestDepth(), {_x:wordWidth + (target.MC._x - (damageArr.length * 7)), _y:(target.MC._y - target.MC._height) + 5});
_local3._width = _local3._width * 1.6;
_local3._height = _local3._height * 1.6;
_local3.num = d + 1;
if (char.missed == true) {
_local3.gotoAndStop(3);
}
_local3.txt.text = damageArr[d];
_local3.txt.autoSize = true;
wordWidth = wordWidth + (_local3.txt._width + 2);
setTimeout(animateDamage, d * 100, _local3, target);
d++;
}
if (char.missed != true) {
target.HP = target.HP - damage;
if (target.HP < 0) {
target.HP = 0;
}
trace("LOCAL HP: " + defenderArr[0].HP);
trace("SAVE HP: " + game.data.defenderArr[0].HP);
updateCharacterInfo(target, _root.charStats.charInfo2);
if (damage != 0) {
var _local9 = {r:255, g:255, b:255};
_root.charStats.charInfo2.meterHP.fluxTint(_local9, 0, 100, 35, true, 1);
_local9 = {r:255, g:0, b:0};
target.fluxTint(_local9, 0, 70, 15, true, 1);
if (target.type == "human") {
shakeCount = 0;
var _local8 = new mx.transitions.Tween(_root.display.tiles, "_x", mx.transitions.easing.Bounce.easeIn, _root.display.tiles._x, _root.display.tiles._x + 7, 0.05, true);
_local8.onMotionFinished = function () {
shakeCount++;
if (shakeCount < 5) {
this.yoyo();
}
};
if (char.poisonous == true) {
if (rollPoison() == true) {
spellPoisonAnim(target);
}
}
} else {
shakeCount = 0;
shakeStartX = target.MC._x;
var _local8 = new mx.transitions.Tween(target.MC, "_x", mx.transitions.easing.Bounce.easeIn, target.MC._x, target.MC._x + 5, 0.05, true);
_local8.onMotionFinished = function () {
shakeCount++;
if (shakeCount < 5) {
this.yoyo();
} else {
trace("Stop the SHAKE");
trace((("CUR X: " + target.MC._x) + " ORIG X: ") + shakeStartX);
target.MC._x = shakeStartX;
}
};
}
}
}
}
function animateDamage(txt, target) {
dmgTxtTween = new mx.transitions.Tween(txt, "_y", mx.transitions.easing.Elastic.easeOut, txt._y, txt._y - 15, 1.5, true);
if (txt.num == damageArr.length) {
dmgTxtTween.onMotionFinished = function () {
_root.display.tiles.damageTxt.removeMovieClip();
setTimeout(checkDeath, 250, target);
};
}
}
function animateEXPPrep(expAmt, target, frame) {
if ((_root.soundOn == true) && (expAmt != "LEVEL UP")) {
_root.expSnd.start();
}
expArr = expAmt.toString().split("");
_root.display.tiles.createEmptyMovieClip("expTxt", _root.display.tiles.getNextHighestDepth());
wordWidth2 = 0;
d = 0;
while (d < expArr.length) {
var _local2 = _root.display.tiles.expTxt.attachMovie("damageTxt", "expTxt" + d, _root.display.tiles.expTxt.getNextHighestDepth(), {_x:wordWidth2 + (target.MC._x - (expArr.length * 6)), _y:target.MC._y - target.MC._height});
_local2.num = d + 1;
_local2.gotoAndStop(frame);
_local2.txt.text = expArr[d];
_local2.txt.autoSize = true;
_local2._width = _local2._width * 1.2;
_local2._height = _local2._height * 1.2;
wordWidth2 = wordWidth2 + (_local2.txt._width - 2);
setTimeout(animateEXPTxt, d * 100, _local2, target);
d++;
}
}
function animateEXPTxt(txt, target) {
expTxtTween = new mx.transitions.Tween(txt, "_y", mx.transitions.easing.Elastic.easeOut, txt._y, txt._y - 10, 1.5, true);
if (txt.num == expArr.length) {
expTxtTween.onMotionFinished = function () {
_root.display.tiles.expTxt.removeMovieClip();
checkLevelUp(_root.currentTurn);
};
}
}
function animateCritPrep(critTxt, target, frame) {
critTxtArr = critTxt.toString().split("");
_root.display.tiles.createEmptyMovieClip("critTxt", _root.display.tiles.getNextHighestDepth());
wordWidth2 = 0;
d = 0;
while (d < critTxtArr.length) {
var _local2 = _root.display.tiles.critTxt.attachMovie("damageTxt", "critTxt" + d, _root.display.tiles.critTxt.getNextHighestDepth(), {_x:wordWidth2 + (target.MC._x - (critTxtArr.length * 4)), _y:(target.MC._y - target.MC._height) - 15});
_local2._width = _local2._width * 1;
_local2._height = _local2._height * 1;
_local2.num = d + 1;
_local2.gotoAndStop(frame);
_local2.txt.text = critTxtArr[d];
_local2.txt.autoSize = true;
wordWidth2 = wordWidth2 + (_local2.txt._width - 2);
setTimeout(animateCritTxt, d * 75, _local2, target);
d++;
}
}
function animateCritTxt(txt, target) {
critTxtTween = new mx.transitions.Tween(txt, "_y", mx.transitions.easing.Elastic.easeOut, txt._y, txt._y - 10, 1.5, true);
if (txt.num == critTxtArr.length) {
critTxtTween.onMotionFinished = function () {
_root.display.tiles.critTxt.removeMovieClip();
};
}
}
function attackShoot(char) {
checkShootRange(char);
}
function checkShootRange(char) {
shootRange = 4;
attackRangeArr = new Array();
attackArr = new Array();
rangeCount = 1;
down = false;
i = char.x - shootRange;
while (i < ((char.x + shootRange) + 1)) {
var _local2 = {r:255, g:0, b:0};
i2 = char.y;
while (i2 < (rangeCount + char.y)) {
tileMap[i][i2].range._visible = true;
tileMap[i][i2].range.fluxTint(_local2, 0, 70, 99, false, 1);
attackRangeArr.push(tileMap[i][i2]);
e = 0;
while (e < enemyArr.length) {
if (tileMap[enemyArr[e].x][enemyArr[e].y] == tileMap[i][i2]) {
attackArr.push(enemyArr[e]);
}
e++;
}
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i2]) {
attackArr.push(defenderLevelArr[e]);
}
e++;
}
i2++;
}
i3 = char.y;
while (i3 > (char.y - rangeCount)) {
tileMap[i][i3].range._visible = true;
tileMap[i][i3].range.fluxTint(_local2, 0, 70, 99, false, 1);
attackRangeArr.push(tileMap[i][i3]);
e = 0;
while (e < enemyArr.length) {
if (tileMap[enemyArr[e].x][enemyArr[e].y] == tileMap[i][i3]) {
attackArr.push(enemyArr[e]);
}
e++;
}
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i3]) {
attackArr.push(defenderLevelArr[e]);
}
e++;
}
i3--;
}
if (rangeCount < (shootRange + 1)) {
if (down != true) {
rangeCount++;
} else {
rangeCount--;
}
} else {
down = true;
rangeCount--;
}
i++;
}
shootEnemiesInRange(spell);
}
function shootEnemiesInRange(spell) {
r = 0;
while (r < attackArr.length) {
if (attackArr[r].type == "human") {
attackArr[r].MC.enabled = false;
attackArr[r].MC._alpha = 50;
} else {
var colObj = {r:255, g:0, b:0};
attackArr[r].MC.fluxTint(colObj, 0, 60, 5, true);
attackArr[r].MC.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.enabled = false;
this.useHandCursor = false;
_root.currentTurn._alpha = 100;
_root.currentTurn.targetChar = this.stats;
trace(_root.currentTurn.targetChar);
_root.faceChar(_root.currentTurn);
_root.resetRange(_root.attackRangeArr);
_root.disableCharRollOvers();
this.fluxTint(colObj, 0, 0, 1, false);
_root.spellShowVS();
_root.currentTurn.MC.indicator.playerIndicator.removeMovieClip();
_root.addOverlay(_root.currentTurn, this.stats);
setTimeout(archerAnimation, 2000, _root.currentTurn);
setTimeout(arrowAnimation, 2250, _root.currentTurn, this.stats);
};
attackArr[r].MC.onRollOver = function () {
this.useHandCursor = true;
var _local4 = {r:255, g:255, b:255};
this.fluxTint(_local4, 0, 70, 15, false, 1);
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this.stats, _local3);
};
attackArr[r].MC.onRollOut = function () {
var _local3 = {r:255, g:0, b:0};
this.fluxTint(_local3, 0, 60, 5, true);
_root.charStats.charInfo2.removeMovieClip();
};
}
r++;
}
}
function archerAnimation(char) {
if (_root.soundOn == true) {
if (char.missed != true) {
_root.archerSnd.start();
}
}
char.MC.charMC.viewMC.gotoAndPlay("attack");
}
function arrowAnimation(char, target) {
arrowMC = _root.display.tiles.attachMovie("arrowMC", "arrowMC", _root.display.tiles.getNextHighestDepth());
myPath = new Path(char.MC._x, char.MC._y);
myPath.moveTo(char.MC._x, char.MC._y);
myPath.curveTo((char.MC._x + target.MC._x) / 2, (char.MC._y + target.MC._y) / 5, target.MC._x, target.MC._y);
arrowSpeed = 10 / myPath._length;
t = 0;
arrowMC.onEnterFrame = function () {
t = t + arrowSpeed;
if (t > 1) {
t = 0;
}
myPath.traverse(this, t, true);
};
}
function archerArrowAnimEnd() {
char = _root.currentTurn;
target = _root.currentTurn.targetChar;
char.missed = checkMiss(char, target);
if (char.missed == false) {
damage = Math.ceil((0.5 * char.STR) * (char.STR / target.DEF));
criticalHit = checkCriticalHit(char);
if (criticalHit == true) {
damage = Math.ceil(damage * 1.5);
}
if (charBehindTarget(char.curDirection, target.curDirection) == true) {
damage = Math.ceil(damage * 1.25);
}
if (char.height > target.height) {
damage = Math.ceil(damage * 1.25);
} else if (char.height < target.height) {
damage = Math.floor(damage * 0.75);
}
if (damage < 0) {
damage = 0;
}
} else {
criticalHit = false;
damage = "MISS";
}
setTimeout(displayDamage, 0, damage, target, char);
}
function getSpellInfo(spellName) {
switch (spellName) {
case "HEAL" :
thisSpell = new Object();
thisSpell.NAME = "HEAL";
thisSpell.FUNC = _root.spellHeal;
thisSpell.RANGE = 4;
thisSpell.STR = 20;
thisSpell.MPCost = 6;
return(thisSpell);
case "FLAME" :
thisSpell = new Object();
thisSpell.NAME = "FLAME";
thisSpell.FUNC = _root.spellFlame;
thisSpell.RANGE = 4;
thisSpell.STR = 0.3;
thisSpell.MPCost = 6;
return(thisSpell);
case "POISON" :
thisSpell = new Object();
thisSpell.NAME = "POISON";
thisSpell.FUNC = _root.spellPoison;
thisSpell.RANGE = 5;
thisSpell.MPCost = 8;
return(thisSpell);
case "FREEZE" :
thisSpell = new Object();
thisSpell.NAME = "FREEZE";
thisSpell.FUNC = _root.spellFreeze;
thisSpell.RANGE = 4;
thisSpell.MPCost = 12;
return(thisSpell);
case "SHOCK" :
thisSpell = new Object();
thisSpell.NAME = "SHOCK";
thisSpell.FUNC = _root.spellShock;
thisSpell.RANGE = 4;
thisSpell.STR = 0.5;
thisSpell.MPCost = 12;
return(thisSpell);
}
}
function prepSpell(spell, target) {
itemTxt = _root.interfaceMC.createEmptyMovieClip("itemTxt", _root.interfaceMC.getNextHighestDepth());
addText(itemTxt, "tfield", 0, 60, 800, 60, spell.NAME, 30, 16777215);
itemTxt._alpha = 0;
var _local3 = new mx.transitions.Tween(itemTxt, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 1.5, true);
_local3.onMotionFinished = function () {
var _local1 = new mx.transitions.Tween(itemTxt, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 1, true);
_local1.onMotionFinished = function () {
setTimeout(spell.FUNC, 100, target, spell.STR);
setTimeout(removeCharMana, 700, spell.MPCost);
};
};
}
function removeCharMana(spellCost) {
_root.currentTurn.MP = _root.currentTurn.MP - spellCost;
updateCharacterInfo(_root.currentTurn, _root.charStats.charInfo);
}
function checkSpellRange(spell, char) {
if (spell.NAME != "HEAL") {
checkSpellRangeEnemy(char, spell);
} else {
checkSpellRangeHuman(char, spell);
}
}
function checkSpellRangeEnemy(char, spell) {
attackRangeArr = new Array();
attackArr = new Array();
rangeCount = 1;
down = false;
i = char.x - spell.RANGE;
while (i < ((char.x + spell.RANGE) + 1)) {
var _local2 = {r:255, g:0, b:0};
i2 = char.y;
while (i2 < (rangeCount + char.y)) {
tileMap[i][i2].range._visible = true;
tileMap[i][i2].range.fluxTint(_local2, 0, 70, 99, false, 1);
attackRangeArr.push(tileMap[i][i2]);
e = 0;
while (e < enemyArr.length) {
if (tileMap[enemyArr[e].x][enemyArr[e].y] == tileMap[i][i2]) {
attackArr.push(enemyArr[e]);
}
e++;
}
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i2]) {
attackArr.push(defenderLevelArr[e]);
}
e++;
}
i2++;
}
i3 = char.y;
while (i3 > (char.y - rangeCount)) {
tileMap[i][i3].range._visible = true;
tileMap[i][i3].range.fluxTint(_local2, 0, 70, 99, false, 1);
attackRangeArr.push(tileMap[i][i3]);
e = 0;
while (e < enemyArr.length) {
if (tileMap[enemyArr[e].x][enemyArr[e].y] == tileMap[i][i3]) {
attackArr.push(enemyArr[e]);
}
e++;
}
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i3]) {
attackArr.push(defenderLevelArr[e]);
}
e++;
}
i3--;
}
if (rangeCount < (spell.RANGE + 1)) {
if (down != true) {
rangeCount++;
} else {
rangeCount--;
}
} else {
down = true;
rangeCount--;
}
i++;
}
spellEnemiesInRange(spell);
}
function spellEnemiesInRange(spell) {
r = 0;
while (r < attackArr.length) {
if ((attackArr[r].type == "human") || (attackArr[r].dead == true)) {
attackArr[r].MC.enabled = false;
attackArr[r].MC._alpha = 50;
} else {
var colObj = {r:255, g:0, b:0};
attackArr[r].MC.fluxTint(colObj, 0, 60, 5, true);
attackArr[r].MC.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.enabled = false;
this.useHandCursor = false;
_root.currentTurn._alpha = 100;
_root.resetRange(_root.attackRangeArr);
_root.currentTurn.targetChar = this.stats;
_root.faceChar(_root.currentTurn);
_root.disableCharRollOvers();
this.fluxTint(colObj, 0, 0, 1, false);
_root.spellShowVS();
_root.addOverlay(_root.currentTurn, this.stats);
setTimeout(prepSpell, 750, spell, this.stats);
};
attackArr[r].MC.onRollOver = function () {
this.useHandCursor = true;
var _local4 = {r:255, g:255, b:255};
this.fluxTint(_local4, 0, 70, 15, false, 1);
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this.stats, _local3);
};
attackArr[r].MC.onRollOut = function () {
var _local3 = {r:255, g:0, b:0};
this.fluxTint(_local3, 0, 60, 5, true);
_root.charStats.charInfo2.removeMovieClip();
};
}
r++;
}
}
function checkSpellRangeHuman(char, spell) {
attackRangeArr = new Array();
attackArr = new Array();
rangeCount = 1;
down = false;
i = char.x - spell.RANGE;
while (i < ((char.x + spell.RANGE) + 1)) {
var _local2 = {r:255, g:66, b:239};
i2 = char.y;
while (i2 < (rangeCount + char.y)) {
tileMap[i][i2].range._visible = true;
tileMap[i][i2].range.fluxTint(_local2, 0, 50, 99, false, 1);
attackRangeArr.push(tileMap[i][i2]);
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i2]) {
attackArr.push(defenderLevelArr[e]);
}
e++;
}
e = 0;
while (e < enemyArr.length) {
if (tileMap[enemyArr[e].x][enemyArr[e].y] == tileMap[i][i2]) {
attackArr.push(enemyArr[e]);
}
e++;
}
i2++;
}
i3 = char.y;
while (i3 > (char.y - rangeCount)) {
tileMap[i][i3].range._visible = true;
tileMap[i][i3].range.fluxTint(_local2, 0, 50, 99, false, 1);
attackRangeArr.push(tileMap[i][i3]);
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i3]) {
attackArr.push(defenderLevelArr[e]);
}
e++;
}
e = 0;
while (e < enemyArr.length) {
if (tileMap[enemyArr[e].x][enemyArr[e].y] == tileMap[i][i3]) {
attackArr.push(enemyArr[e]);
}
e++;
}
i3--;
}
if (rangeCount < (spell.RANGE + 1)) {
if (down != true) {
rangeCount++;
} else {
rangeCount--;
}
} else {
down = true;
rangeCount--;
}
i++;
}
spellHumansInRange(spell);
}
function spellHumansInRange(spell) {
e = 0;
while (e < enemyArr.length) {
enemyArr[e].MC.enabled = false;
e++;
}
r = 0;
while (r < attackArr.length) {
if ((attackArr[r].type == "enemy") || (attackArr[r].dead == true)) {
attackArr[r].MC._alpha = 50;
attackArr[r].MC.enabled = false;
} else {
var colObj = {r:255, g:255, b:255};
attackArr[r].MC.fluxTint(colObj, 0, 60, 5, true);
attackArr[r].MC.hover.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this._parent.enabled = false;
this.useHandCursor = false;
_root.resetRange(_root.attackRangeArr);
_root.currentTurn.targetChar = this._parent.stats;
if (_root.currentTurn.targetChar.name == _root.currentTurn.name) {
_root.charStats.charInfo2.removeMovieClip();
} else {
_root.faceChar(_root.currentTurn);
}
_root.disableCharRollOvers();
this._parent.fluxTint(colObj, 0, 0, 1, false);
_root.addOverlay(_root.currentTurn, this._parent.stats);
setTimeout(prepSpell, 2000, spell, this._parent.stats);
};
attackArr[r].MC.hover.onRollOver = function () {
this.useHandCursor = true;
var _local4 = {r:255, g:255, b:255};
this._parent.fluxTint(_local4, 0, 70, 15, false, 1);
if (this._parent != _root.currentTurn) {
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this._parent.stats, _local3);
}
};
attackArr[r].MC.hover.onRollOut = function () {
var _local3 = {r:255, g:255, b:255};
this._parent.fluxTint(_local3, 0, 60, 5, true);
_root.charStats.charInfo2.removeMovieClip();
};
}
r++;
}
}
function disableCharRollOvers() {
r = 0;
while (r < defenderLevelArr.length) {
defenderLevelArr[r].MC._alpha = 100;
defenderLevelArr[r].MC.enabled = false;
defenderLevelArr[r].MC.fluxTint(colObj, 0, 0, 1, false);
defenderLevelArr[r].MC.attackRange = false;
delete defenderLevelArr[r].MC.hover.onRelease;
delete defenderLevelArr[r].MC.hover.onRollOver;
delete defenderLevelArr[r].MC.hover.onRollOut;
r++;
}
r = 0;
while (r < enemyArr.length) {
enemyArr[r].MC._alpha = 100;
enemyArr[r].MC.enabled = false;
enemyArr[r].MC.fluxTint(colObj, 0, 0, 1, false);
enemyArr[r].MC.attackRange = false;
delete enemyArr[r].MC.onRelease;
delete enemyArr[r].MC.onRollOver;
delete enemyArr[r].MC.onRollOut;
r++;
}
}
function spellShowVS() {
_root.charStats.VS.removeMovieClip();
_root.charStats.attachMovie("VS-MC", "VS", _root.charStats.getNextHighestDepth(), {_x:360, _y:470});
}
function spellAttack(char, target, spellSTR) {
damage = Math.ceil((spellSTR * char.MAG) * (char.MAG / target.DEF));
criticalHit = checkCriticalHit(char);
if (criticalHit == true) {
damage = Math.ceil(damage * 1.5);
}
if (char.height > target.height) {
damage = Math.ceil(damage * 1.25);
} else if (char.height < target.height) {
damage = Math.floor(damage * 0.75);
}
if (damage < 0) {
damage = 0;
}
attackAnimation(char, damage, target);
}
function spellFlame(target, spellSTR) {
_root.currentTurn.targetChar = target;
setTimeout(spellAttack, 500, _root.currentTurn, target, spellSTR);
setTimeout(spellFlameAnim, 750, target);
}
function spellFlameAnim(target) {
if (_root.soundOn == true) {
_root.fireSnd.start();
}
var _local2 = _root.display.tiles.attachMovie("flameMC", "flameMC", _root.display.tiles.getNextHighestDepth());
_local2._x = target.MC._x - 20;
_local2._y = target.MC._y - 20;
}
function spellHeal(target, spellSTR) {
_root.currentTurn.targetChar = target;
if (_root.currentTurn.name == target.name) {
attackAnimation(_root.currentTurn, 0, target);
setTimeout(spellHealAnim, 500, _root.currentTurn, _root.charStats.charInfo, spellSTR);
} else {
attackAnimation(_root.currentTurn, 0, target, false);
setTimeout(spellHealAnim, 500, target, _root.charStats.charInfo2, spellSTR);
}
}
function spellHealAnim(target, infoBox, spellSTR) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
if ((target.HP + spellSTR) > target.HPMax) {
target.HP = target.HPMax;
} else {
target.HP = target.HP + spellSTR;
}
animateItemTxtPrep(spellSTR + " HP", target, 7);
updateCharacterInfo(target, infoBox);
var _local3 = {r:255, g:255, b:255};
_root.charStats.charInfo2.meterHP.fluxTint(_local3, 0, 100, 20, true, 1);
target.MC.fluxTint(_local3, 0, 100, 20, true, 1);
}
function spellShock(target, spellSTR) {
_root.currentTurn.targetChar = target;
setTimeout(spellAttack, 500, _root.currentTurn, target, spellSTR);
setTimeout(spellShockAnim, 500, target);
}
function spellShockAnim(target) {
if (_root.soundOn == true) {
_root.lightningSnd.start();
}
var _local2 = _root.display.tiles.attachMovie("spellLightningMC", "spellLightningMC", _root.display.tiles.getNextHighestDepth());
_local2._x = target.MC._x - 300;
_local2._y = target.MC._y - 560;
}
function spellPoison(target) {
_root.currentTurn.targetChar = target;
attackAnimation(_root.currentTurn, 0, target);
setTimeout(spellPoisonAnim, 500, target);
}
function spellPoisonAnim(target) {
if (_root.soundOn == true) {
_root.poisonSnd.start();
}
_root.display.tiles.attachMovie("poisonSmokeMC", "poisonSmokeMC", _root.display.tiles.getNextHighestDepth(), {_x:target.MC._x - (target.MC._width / 2), _y:target.MC._y - (target.MC._height / 2)});
if (checkIfPoisoned(target) == false) {
target.ailments.push("poison");
}
var _local3 = {r:31, g:211, b:0};
target.MC.charMC.fluxTint(_local3, 0, 60, 5, true);
}
function checkIfPoisoned(target) {
a = 0;
while (a < target.ailments.length) {
if (target.ailments[a] == "poison") {
return(true);
}
a++;
}
return(false);
}
function spellFreeze(target) {
_root.currentTurn.targetChar = target;
attackAnimation(_root.currentTurn, 0, target);
setTimeout(spellFreezeAnim, 200, target);
}
function spellFreezeAnim(target) {
if (_root.soundOn == true) {
_root.freezeSnd.start();
}
target.ailments.push("frozen");
freezeMC = _root.display.tiles.attachMovie("spellFreezeMC", "spellFreezeMC" + target.num, target.MC.getDepth() + 3, {_x:_root.display.tiles[(("tile_" + target.y) + "_") + target.x]._x + 15, _y:_root.display.tiles[(("tile_" + target.y) + "_") + target.x]._y - 55});
target.freezeMC = freezeMC;
target.freezeAmt = 2;
}
function checkFrozen(char) {
a = 0;
while (a < char.ailments.length) {
if (char.ailments[a] == "frozen") {
char.freezeAmt--;
if (char.freezeAmt == 0) {
char.ailments.splice(a, 1);
char.freezeMC.removeMovieClip();
} else {
charTurn++;
}
break;
}
a++;
}
}
function enemyCheckSpellRange(char, spell) {
attackRangeArr = new Array();
attackArr = new Array();
rangeCount = 1;
down = false;
i = char.x - spell.RANGE;
while (i < ((char.x + spell.RANGE) + 1)) {
i2 = char.y;
while (i2 < (rangeCount + char.y)) {
attackRangeArr.push(tileMap[i][i2]);
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i2]) {
trace(defenderLevelArr[e].name + " IS IN RANGE!!!");
attackArr.push(defenderLevelArr[e]);
}
e++;
}
i2++;
}
i3 = char.y;
while (i3 > (char.y - rangeCount)) {
attackRangeArr.push(tileMap[i][i3]);
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i3]) {
trace(defenderLevelArr[e].name + " IS IN RANGE!!!");
attackArr.push(defenderLevelArr[e]);
}
e++;
}
i3--;
}
if (rangeCount < (spell.RANGE + 1)) {
if (down != true) {
rangeCount++;
} else {
rangeCount--;
}
} else {
down = true;
rangeCount--;
}
i++;
}
return(attackArr);
}
function enemyCastSpell(char, enemySpell) {
disableCharRollOvers();
char.MC.indicator.playerIndicator.removeMovieClip();
addOverlay(char, char.targetChar);
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local4 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(char.targetChar, _local3);
spellShowVS();
setTimeout(prepSpell, 700, enemySpell, char.targetChar);
}
function loadTitleScreen() {
if (_root.soundOn == true) {
_root.worldMapMusic.stop();
_root.levelMusic.stop();
_root.themeMusicSnd.start(0, 999);
}
themeMusicOn = true;
_root.attachMovie("titleScreenMC", "titleScreen", 1);
themeMusicButton = titleScreen.attachMovie("themeMusicButton", "themeMusicButton", titleScreen.getNextHighestDepth(), {_x:697, _y:566});
themeMusicButton.onRelease = function () {
if (_root.themeMusicOn == true) {
_root.themeMusicSnd.stop();
_root.themeMusicOn = false;
_root.soundOn = false;
this._alpha = 30;
} else {
_root.themeMusicSnd.start(0, 999);
_root.themeMusicOn = true;
_root.soundOn = true;
this._alpha = 100;
}
};
titleLikwidGames = titleScreen.attachMovie("titleLikwidGames", "titleLikwidGames", titleScreen.getNextHighestDepth(), {_x:616, _y:22});
titleLikwidGames.onRelease = function () {
getURL ("http://www.likwidgames.com", "_blank");
};
titleScreen._alpha = 0;
var _local3 = new mx.transitions.Tween(titleScreen, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 5, true);
newButtonMC = titleScreen.createEmptyMovieClip("newButtonMC", titleScreen.getNextHighestDepth());
addText(newButtonMC, "newTxt", 100, 520, 150, 20, "New Game", 24, 16777215, false);
newButtonMC.onRollOver = function () {
this.newTxt.textColor = 16770048 /* 0xFFE400 */;
};
newButtonMC.onRollOut = function () {
this.newTxt.textColor = 16777215 /* 0xFFFFFF */;
};
newButtonMC.onPress = function () {
this.newTxt.textColor = 16777215 /* 0xFFFFFF */;
_root.titleScreen.newButtonMC.enabled = false;
_root.titleScreen.continueButtonMC.enabled = false;
mySave.clear();
initVars();
initGame();
_root.interfaceMC._visible = false;
var _local3 = new mx.transitions.Tween(titleScreen, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 5, true);
_local3.onMotionFinished = function () {
_root.interfaceMC._visible = true;
_root.loadWorldMap(levelsUnlocked);
};
};
continueButtonMC = titleScreen.createEmptyMovieClip("continueButtonMC", titleScreen.getNextHighestDepth());
addText(continueButtonMC, "contTxt", 330, 520, 150, 20, "Continue", 24, 16777215, false);
if (mySave.data.timePlayed != undefined) {
continueButtonMC.onRollOver = function () {
this.contTxt.textColor = 16770048 /* 0xFFE400 */;
};
continueButtonMC.onRollOut = function () {
this.contTxt.textColor = 16777215 /* 0xFFFFFF */;
};
continueButtonMC.onPress = function () {
this.contTxt.textColor = 16777215 /* 0xFFFFFF */;
_root.titleScreen.newButtonMC.enabled = false;
_root.titleScreen.continueButtonMC.enabled = false;
loadSavedVars();
initGame();
_root.interfaceMC._visible = false;
var _local3 = new mx.transitions.Tween(titleScreen, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 5, true);
_local3.onMotionFinished = function () {
_root.interfaceMC._visible = true;
_root.loadWorldMap(levelsUnlocked);
};
};
} else {
continueButtonMC._alpha = 38;
}
moreGamesButtonMC = titleScreen.createEmptyMovieClip("moreGamesButtonMC", titleScreen.getNextHighestDepth());
addText(moreGamesButtonMC, "newTxt", 550, 520, 300, 20, "More Games", 24, 16777215, false);
moreGamesButtonMC.onRollOver = function () {
this.newTxt.textColor = 16770048 /* 0xFFE400 */;
};
moreGamesButtonMC.onRollOut = function () {
this.newTxt.textColor = 16777215 /* 0xFFFFFF */;
};
moreGamesButtonMC.onPress = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1367&subid=titleScreenLink", "_blank");
};
}
function turnOrder(rec1, rec2) {
var _local2;
var _local1;
_local2 = rec1[1];
_local1 = rec2[1];
if (_local2 > _local1) {
return(-1);
}
if (_local1 > _local2) {
return(1);
}
return(0);
}
function checkTurn() {
dropTreasure = false;
resetEnemyRange();
screenMoverMC._visible = false;
checkCharAilments(_root.currentTurn);
}
function checkCharAilments(char) {
if (_root.currentTurn.ailments.length > 0) {
a = 0;
while (a < char.ailments.length) {
if (char.ailments[a] == "poison") {
var _local3 = {r:31, g:211, b:0};
char.MC.charMC.fluxTint(_local3, 0, 60, 5, true);
char.MC.indicator.playerIndicator.removeMovieClip();
setTimeout(ailmentPoison, 500, char);
break;
}
a++;
}
} else {
nextTurn();
}
}
function nextTurn() {
var _local6 = new mx.transitions.Tween(_root.charStats.charInfo, "_x", mx.transitions.easing.Strong.easeOut, _root.charStats.charInfo._x, -350, 0.75, true);
var _local7 = new mx.transitions.Tween(_root.charStats.charInfo2, "_x", mx.transitions.easing.Strong.easeOut, _root.charStats.charInfo2._x, 850, 0.75, true);
_root.charStats.VS.removeMovieClip();
checkFrozen(turnArr[charTurn][0]);
if (charTurn > (turnArr.length - 1)) {
charTurn = 0;
}
_root.currentTurn.MC.indicator.playerIndicator.removeMovieClip();
char = turnArr[charTurn][0];
_root.currentTurn = char;
var _local2 = {x:char.MC._x, y:char.MC._y};
_root.display.tiles.localToGlobal(_local2);
moveX = (Stage.width / 2) - _local2.x;
moveY = (Stage.height / 2) - _local2.y;
var _local4 = new mx.transitions.Tween(_root.display.tiles, "_x", mx.transitions.easing.Strong.easeOut, _root.display.tiles._x, _root.display.tiles._x + moveX, 1.5, true);
var _local5 = new mx.transitions.Tween(_root.display.tiles, "_y", mx.transitions.easing.Strong.easeOut, _root.display.tiles._y, (_root.display.tiles._y + moveY) - 50, 1.5, true);
_local4.onMotionFinished = function () {
_root.charStats.charInfo.removeMovieClip();
_root.charStats.charInfo2.removeMovieClip();
var _local2 = _root.charStats.attachMovie("charInfoL-MC", "charInfo", 1, {_x:-350, _y:440});
var _local3 = new mx.transitions.Tween(_local2, "_x", mx.transitions.easing.Strong.easeOut, _local2._x, 20, 1, true);
updateCharacterInfo(char, _local2);
if (char.type == "enemy") {
addPlayerIndicator(char);
defender = findClosestDefender(char);
char.targetChar = defender;
char.blockCheckNum = 1;
showRange(char);
setTimeout(findPath, 600, char, defender.x, defender.y, char.x, char.y);
} else {
char.hasMoved = false;
char.hasAttacked = false;
showActions(char);
}
};
charTurn++;
}
function updateCharacterInfo(char, charInfo) {
if (char.type == "enemy") {
charInfo.gotoAndStop(2);
}
charInfo.charName.text = char.name;
charInfo.charName.autoSize = true;
charInfo.charLvl._x = charInfo.charName._x + (charInfo.charName._width + 30);
charInfo.charLvlTxt._x = charInfo.charName._x + (charInfo.charName._width + 10);
charInfo.HP.text = checkZero(char.HP);
charInfo.HPMax.text = checkZero(char.HPMax);
charInfo.MP.text = checkZero(char.MP);
charInfo.MPMax.text = checkZero(char.MPMax);
charInfo.charLvl.text = char.lvl;
meterWidth = 150;
var _local4 = new mx.transitions.Tween(charInfo.MPMask, "_x", mx.transitions.easing.Strong.easeOut, charInfo.MPMask._x, -90 + Math.ceil(meterWidth * (char.MP / char.MPMax)), 1, true);
var _local3 = new mx.transitions.Tween(charInfo.HPMask, "_x", mx.transitions.easing.Strong.easeOut, charInfo.HPMask._x, -90 + Math.ceil(meterWidth * (char.HP / char.HPMax)), 1, true);
}
function checkZero(num) {
if (num < 10) {
num = "00" + num;
} else if ((num > 9) && (num < 100)) {
num = "0" + num;
}
return(num);
}
function showActions(char) {
_root.charStats.windowActions.removeMovieClip();
_root.charStats.attachMovie("windowActions", "windowActions", _root.charStats.getNextHighestDepth(), {_x:50, _y:500});
var _local2 = new mx.transitions.Tween(_root.charStats.windowActions, "_y", mx.transitions.easing.Strong.easeOut, 400, 125, 1, true);
_local2.onMotionFinished = function () {
checkForTutorial();
};
displayActions(char);
}
function displayActions(char) {
char.MC.indicator.playerIndicator.removeMovieClip();
addPlayerIndicator(char);
buttons = _root.charStats.windowActions.createEmptyMovieClip("buttons", 1);
buttons._y = -5;
var _local5 = buttons.attachMovie("actionButton", "moveButton", 1, {_x:13, _y:140});
_local5.name = "MOVE";
_local5.actionName.text = _local5.name;
if (char.hasMoved != true) {
_local5.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local5.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local5.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.showRange(_root.currentTurn);
_root.charStats.windowActions.buttons.removeMovieClip();
_root.charStats.windowActions.windowActionsMask.removeMovieClip();
_root.charStats.windowActions.createEmptyMovieClip("buttons", 1);
_root.menuAddCancel(0, false);
_root.checkForTutorial();
};
} else {
_local5._alpha = 30;
}
var _local3 = buttons.attachMovie("actionButton", "actionBut", 2, {_x:13, _y:170});
_local3.name = "ACTION";
_local3.actionName.text = _local3.name;
if (_root.tutorialCompleted == false) {
if (((char.hasAttacked != true) && (tutorialNum != 0)) && (tutorialNum != 2)) {
_local3.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
menuAddActions(_root.currentTurn);
};
} else {
_local3._alpha = 30;
}
} else if (char.hasAttacked != true) {
_local3.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
menuAddActions(_root.currentTurn);
};
} else {
_local3._alpha = 30;
}
var _local4 = buttons.attachMovie("actionButton", "waitBut", 3, {_x:13, _y:200});
_local4.name = "END TURN";
_local4.actionName.text = _local4.name;
if ((_root.tutorialCompleted == false) && (_root.tutorialNum < 8)) {
trace("TUT NUM WAIT: " + _root.tutorialNum);
if ((((tutorialNum != 0) && (tutorialNum != 2)) && (tutorialNum != 3)) && (tutorialNum != 4)) {
_local4.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local4.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local4.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.currentTurn.MC.indicator.playerIndicator.removeMovieClip();
if (_root.currentTurn.hasMoved == true) {
_root.checkTurn();
} else {
_root.currentTurn.hasMoved = true;
_root.faceDirection(_root.currentTurn);
}
_root.charStats.windowActions.removeMovieClip();
};
} else {
_local4._alpha = 30;
}
} else {
trace("IN ELSE");
_local4.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local4.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local4.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.currentTurn.MC.indicator.playerIndicator.removeMovieClip();
if (_root.currentTurn.hasMoved == true) {
_root.checkTurn();
} else {
_root.currentTurn.hasMoved = true;
_root.faceDirection(_root.currentTurn, true);
}
_root.charStats.windowActions.removeMovieClip();
};
}
var _local6 = buttons.attachMovie("actionButton", "statusBut", 4, {_x:13, _y:230});
_local6.name = "STATUS";
_local6.actionName.text = _local6.name;
_local6.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local6.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local6.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.showStatus();
};
}
function menuAddActions(char) {
_root.charStats.windowActions.buttons.removeMovieClip();
_root.charStats.windowActions.windowActionsMask.removeMovieClip();
_root.charStats.windowActions.createEmptyMovieClip("buttons", 1);
menuCount = 0;
var _local5 = _root.charStats.windowActions.buttons.attachMovie("actionButton", "attackBut" + a, _root.charStats.windowActions.buttons.getNextHighestDepth(), {_x:13, _y:(30 * menuCount) + 135});
_local5.name = "ATTACKS";
_local5.actionName.text = _local5.name;
_local5.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local5.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local5.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.menuAddSubmenu(_root.char.attacks);
};
menuCount++;
if (char.spells.length > 0) {
var _local4 = _root.charStats.windowActions.buttons.attachMovie("actionButton", "spellsBut" + a, _root.charStats.windowActions.buttons.getNextHighestDepth(), {_x:13, _y:(30 * menuCount) + 135});
_local4.name = "SPELLS";
_local4.actionName.text = _local4.name;
_local4.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local4.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local4.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.menuAddSpellsMenu(_root.char.spells);
};
menuCount++;
}
var _local3 = _root.charStats.windowActions.buttons.attachMovie("actionButton", "itemsBut" + a, _root.charStats.windowActions.buttons.getNextHighestDepth(), {_x:13, _y:(30 * menuCount) + 135});
_local3.name = "ITEMS";
_local3.actionName.text = _local3.name;
_local3.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.menuAddItemMenu(_root.inventory);
};
menuCount++;
menuAddCancel(menuCount, false);
}
function menuAddSubmenu(arr) {
_root.charStats.windowActions.buttons.removeMovieClip();
_root.charStats.windowActions.windowActionsMask.removeMovieClip();
_root.charStats.windowActions.createEmptyMovieClip("buttons", 1);
_root.charStats.windowActions.attachMovie("windowActionsMask", "windowActionsMask", _root.charStats.windowActions.getNextHighestDepth(), {_x:85, _y:195});
_root.charStats.windowActions.buttons.setMask(_root.charStats.windowActions.windowActionsMask);
a = 0;
while (a < arr.length) {
var _local3 = _root.charStats.windowActions.buttons.attachMovie("actionButton", "attackBut" + a, _root.charStats.windowActions.buttons.getNextHighestDepth(), {_x:13, _y:(30 * a) + 135});
_local3.name = arr[a];
_local3.actionName.text = _local3.name;
_local3.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.getAttackFunc(this.name);
};
a++;
}
menuAddCancel(a, true);
addMenuArrows(arr.length);
}
function menuAddItemMenu(arr) {
_root.charStats.windowActions.buttons.removeMovieClip();
_root.charStats.windowActions.windowActionsMask.removeMovieClip();
_root.charStats.windowActions.createEmptyMovieClip("buttons", 1);
_root.charStats.windowActions.attachMovie("windowActionsMask", "windowActionsMask", _root.charStats.windowActions.getNextHighestDepth(), {_x:85, _y:195});
_root.charStats.windowActions.buttons.setMask(_root.charStats.windowActions.windowActionsMask);
itemCount = 0;
a = 0;
while (a < arr.length) {
if (arr[a].battleUsable != false) {
var _local3 = _root.charStats.windowActions.buttons.attachMovie("actionButton", "itemBut" + itemCount, _root.charStats.windowActions.buttons.getNextHighestDepth(), {_x:13, _y:(30 * itemCount) + 135});
_local3.NAME = arr[a].NAME;
_local3.actionName.text = _local3.NAME;
_local3.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.NAME;
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.NAME;
};
_local3.FUNC = getItemBattleFunc(arr[a]);
_local3.ITEM = arr[a];
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.currentTurn.MC.indicator.playerIndicator.removeMovieClip();
if (this.ITEM.NAME == "Mega Elixer") {
_root.addOverlay(_root.currentTurn, null);
setTimeout(prepBattleItem, 2000, this.FUNC, _root.currentTurn, this.ITEM);
} else {
_root.checkItemRange(_root.currentTurn, this.ITEM);
}
_root.charStats.windowActions.buttons.removeMovieClip();
_root.charStats.windowActions.windowActionsMask.removeMovieClip();
_root.charStats.windowActions.createEmptyMovieClip("buttons", 1);
_root.menuAddCancel(0, false);
_root.charStats.windowActions.downArrow.removeMovieClip();
_root.charStats.windowActions.upArrow.removeMovieClip();
};
itemCount++;
}
a++;
}
menuAddCancel(itemCount, true);
addMenuArrows(itemCount);
}
function menuAddSpellsMenu(arr) {
charStats.windowActions.buttons.removeMovieClip();
charStats.windowActions.windowActionsMask.removeMovieClip();
charStats.windowActions.createEmptyMovieClip("buttons", 1);
_root.charStats.windowActions.attachMovie("windowActionsMask", "windowActionsMask", _root.charStats.windowActions.getNextHighestDepth(), {_x:85, _y:195});
charStats.windowActions.buttons.setMask(charStats.windowActions.windowActionsMask);
itemCount = 0;
a = 0;
while (a < arr.length) {
var _local3 = charStats.windowActions.buttons.attachMovie("spellTxtButton", "spellTxtButton" + itemCount, charStats.windowActions.buttons.getNextHighestDepth(), {_x:37, _y:(30 * itemCount) + 135});
mySpell = getSpellInfo(arr[a][0]);
_local3.spell = mySpell;
_local3.spellName.text = mySpell.NAME;
_local3.spellMana.text = mySpell.MPCost + " MP";
if (_root.currentTurn.MP >= mySpell.MPCost) {
_local3.onRollOver = function () {
this.gotoAndStop(2);
this.spellName.text = this.spell.NAME;
this.spellMana.text = this.spell.MPCost + " MP";
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
this.spellName.text = this.spell.NAME;
this.spellMana.text = this.spell.MPCost + " MP";
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.currentTurn.MC.indicator.playerIndicator.removeMovieClip();
_root.checkSpellRange(this.spell, _root.currentTurn);
_root.charStats.windowActions.buttons.removeMovieClip();
_root.charStats.windowActions.windowActionsMask.removeMovieClip();
_root.charStats.windowActions.createEmptyMovieClip("buttons", 1);
_root.menuAddCancel(0, false);
_root.charStats.windowActions.downArrow.removeMovieClip();
_root.charStats.windowActions.upArrow.removeMovieClip();
};
} else {
_local3._alpha = 30;
}
itemCount++;
a++;
}
menuAddCancel(itemCount, true);
addMenuArrows(itemCount);
}
function addMenuArrows(arrLength) {
if (arrLength > 3) {
var _local4 = _root.charStats.windowActions.attachMovie("menuArrow", "downArrow", 3, {_x:80, _y:255});
var _local3 = _root.charStats.windowActions.attachMovie("menuArrow", "upArrow", 4, {_x:80, _y:120});
_local3._visible = false;
_local4._yscale = -100;
scrollNum = 0;
arrSize = arrLength + 1;
_local4.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (_root.scrollNum < (_root.arrSize - 4)) {
_root.charStats.windowActions.buttons._y = _root.charStats.windowActions.buttons._y - 30;
_root.scrollNum++;
_root.checkScrollArrows();
}
};
_local4.onRollOver = function () {
this.gotoAndStop(2);
};
_local4.onRollOut = function () {
this.gotoAndStop(1);
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if ((_root.scrollNum + _root.arrSize) > _root.arrSize) {
_root.charStats.windowActions.buttons._y = _root.charStats.windowActions.buttons._y + 30;
_root.scrollNum--;
_root.checkScrollArrows();
}
};
_local3.onRollOver = function () {
this.gotoAndStop(2);
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
};
}
}
function checkScrollArrows() {
if ((scrollNum + 4) == arrSize) {
_root.charStats.windowActions.downArrow._visible = false;
} else {
_root.charStats.windowActions.downArrow._visible = true;
}
if ((scrollNum + 4) == 4) {
_root.charStats.windowActions.upArrow._visible = false;
} else {
_root.charStats.windowActions.upArrow._visible = true;
}
}
function menuAddCancel(num, sub) {
var _local3 = _root.charStats.windowActions.buttons.attachMovie("actionButton", "cancelBut" + a, _root.charStats.windowActions.buttons.getNextHighestDepth(), {_x:13, _y:(30 * num) + 135});
_local3.name = "CANCEL";
_local3.actionName.text = _local3.name;
_local3.onRollOver = function () {
this.gotoAndStop(2);
this.actionName.text = this.name;
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
this.actionName.text = this.name;
};
if (sub == true) {
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.resetEnemyRange();
_root.cancelAction(_root.currentTurn, true);
};
} else {
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.cancelAction(_root.currentTurn, false);
};
}
}
function cancelAction(char, sub) {
resetCharFuncs();
resetRange(attackRangeArr);
resetRange(meleeArr);
resetRange(rangeTiles);
charStats.windowActions.downArrow.removeMovieClip();
charStats.windowActions.upArrow.removeMovieClip();
if (sub == true) {
menuAddActions(char);
} else {
displayActions(char);
}
}
function addOverlay(char, target) {
e = 0;
while (e < enemyArr.length) {
enemyArr[e].enabled = false;
e++;
}
var _local2 = _root.display.tiles.attachMovie("overlay-MC", "overlayMC", _root.display.tiles.getNextHighestDepth());
_local2._width = _local2._width * 4;
_local2._height = _local2._height * 4;
_local2._x = _root.display.tiles._x - 1500;
_local2._y = _root.display.tiles._y - 1000;
if (char.MC._y < target.MC._y) {
char.MC.swapDepths(_root.display.tiles.getNextHighestDepth());
target.MC.swapDepths(_root.display.tiles.getNextHighestDepth());
} else {
target.MC.swapDepths(_root.display.tiles.getNextHighestDepth());
char.MC.swapDepths(_root.display.tiles.getNextHighestDepth());
}
_root.charStats.windowActions._visible = false;
}
function remOverlay() {
_root.display.tiles.overlayMC.gotoAndPlay(21);
setTimeout(charOverlayDepth, 1000);
if (dropTreasure == true) {
setTimeout(dropTreasureFunc, 1000);
} else {
setTimeout(endAttack, 1200);
}
}
function dropTreasureFunc() {
if (_root.soundOn == true) {
_root.treasureDropSnd.start();
}
var _local2 = _root.display.tiles.attachMovie("treasureIcon", "treasureIcon", _root.currentTurn.targetChar.tile.getDepth() + 2, {_x:_root.currentTurn.targetChar.tile._x + 20, _y:_root.currentTurn.targetChar.tile._y - 20});
_local2.difficulty = _root.currentTurn.targetChar.difficulty;
tileMap[_root.currentTurn.targetChar.x][_root.currentTurn.targetChar.y].treasure = _local2;
_root.currentTurn.targetChar.MC.removeMovieClip();
setTimeout(endAttack, 2500);
}
function charOverlayDepth() {
_root.currentTurn.MC.enabled = true;
_root.currentTurn.targetChar.MC.enabled = true;
_root.currentTurn.MC.swapDepths(_root.currentTurn.tile.getDepth() + 1);
if (_root.currentTurn.targetChar.dead == true) {
_root.currentTurn.targetChar.MC.swapDepths(_root.currentTurn.targetChar.tile.getDepth() + 3);
} else {
_root.currentTurn.targetChar.MC.swapDepths(_root.currentTurn.targetChar.tile.getDepth() + 1);
a = 0;
while (a < _root.currentTurn.targetChar.ailments.length) {
if (_root.currentTurn.targetChar.ailments[a] == "frozen") {
_root.currentTurn.targetChar.freezeMC.swapDepths(_root.currentTurn.targetChar.tile.getDepth() + 3);
}
a++;
}
}
}
function addText(mcParent, txtName, txtX, txtY, txtWidth, txtHeight, txt, txtSize, color, centered, addLineHeight) {
txtName = mcParent.createTextField(txtName, mcParent.getNextHighestDepth(), txtX, txtY, txtWidth, txtHeight);
txtName.type = "dynamic";
txtName.multiline = true;
txtName.wordWrap = true;
txtName.border = false;
txtName.selectable = false;
txtName.embedFonts = true;
txtName.antiAliasType = "advanced";
myformat = new TextFormat();
if (addLineHeight == true) {
myformat.leading = 5;
}
myformat.font = "txtBoxFont";
myformat.size = txtSize;
myformat.bold = true;
if (centered == false) {
myformat.align = "left";
} else if (centered == "right") {
myformat.align = "right";
} else {
myformat.align = "center";
}
if (color == undefined) {
myformat.color = 16777215 /* 0xFFFFFF */;
} else {
myformat.color = color;
}
txtName.text = txt;
txtName.setTextFormat(myformat);
}
function addPlayerIndicator(char) {
char.MC.indicator.attachMovie("playerIndicator", "playerIndicator", 1);
}
function timeCounter() {
trace("BEFORE");
trace("LOCAL: " + timePlayed);
trace("SO: " + mySave.data.timePlayed);
timePlayed++;
trace("AFTER");
trace("LOCAL: " + timePlayed);
trace("SO: " + mySave.data.timePlayed);
}
function createIntroMask() {
_root.gameMask.removeMovieClip();
this.createEmptyMovieClip("gameMask", 4);
gameMask.createEmptyMovieClip("mcMask", gameMask.getNextHighestDepth());
gameMask.mcMask.lineStyle(1, 16777215, 0);
gameMask.mcMask.beginFill(16777215, 100);
gameMask.mcMask.moveTo(0, 0);
gameMask.mcMask.lineTo(wMask, 0);
gameMask.mcMask.lineTo(wMask, hMask);
gameMask.mcMask.lineTo(0, hMask);
gameMask.mcMask.lineTo(0, 0);
gameMask.mcMask.endFill();
gameMask.setMask(gameMask.mcMask);
gameMask.createEmptyMovieClip("sqMsk", gameMask.getNextHighestDepth());
gameMask._x = (gameMask.mcMask._x = (gameMask.sqMsk._x = xMask));
gameMask._y = (gameMask.mcMask._y = (gameMask.sqMsk._y = yMask));
}
function startMask() {
var _local2;
var _local1;
if (((((nbIHD == 0) || (nbIHD == 1)) || (nbIHD == 2)) || (nbIHD == 3)) || (nbIHD == 4)) {
_local2 = nbIHD;
} else {
rnd = (nbH - 0.001) * Math.random();
rr = 0;
while (rr < nbH) {
if ((rnd >= rr) && (rnd < (rr + 1))) {
_local2 = arH[rr];
}
rr++;
}
}
if (((((nbIVD == 0) || (nbIVD == 1)) || (nbIVD == 2)) || (nbIVD == 3)) || (nbIVD == 4)) {
_local1 = nbIVD;
} else {
rnd = (nbV - 0.001) * Math.random();
rr = 0;
while (rr < nbV) {
if ((rnd >= rr) && (rnd < (rr + 1))) {
_local1 = arV[rr];
}
rr++;
}
}
i = 0;
while (i < nbCols) {
j = 0;
while (j < nbRows) {
z = (nbRows * i) + j;
mc = gameMask.sqMsk.sqM.attachMovie("Square", "mcSquare" + z, gameMask.sqMsk.sqM.getNextHighestDepth(), initSquare);
mc.init = true;
mc.ix = i;
mc.jy = j;
mc.IHD = _local2;
mc.IVD = _local1;
mc.starting = true;
j++;
}
i++;
}
}
function finishedGameMask() {
if (inBattle == true) {
setTimeout(fadeGameMask, 2000);
} else if (gameOver == true) {
setTimeout(displayGameOverOptions, 2000);
} else {
setTimeout(displayLevelGold, 2000);
}
}
function fadeGameMask() {
gameMask.onEnterFrame = function () {
this._alpha = this._alpha - 3;
if (this._alpha <= 0) {
delete this.onEnterFrame;
_root.fadeMapIn();
}
};
}
function makeARectangle(mc, nbColor, nbAlpha) {
var _local3 = (-wSq) / 2;
var _local2 = (-hSq) / 2;
mc.lineStyle(1, nbColor, 0);
mc.beginFill(nbColor, nbAlpha);
mc.moveTo(_local3, _local2);
mc.lineTo(_local3 + wSq, _local2);
mc.lineTo(_local3 + wSq, _local2 + hSq);
mc.lineTo(_local3, _local2 + hSq);
mc.lineTo(_local3, _local2);
mc.endFill();
}
function showGameMask(num) {
createIntroMask();
gameMask.sqMsk.createEmptyMovieClip("sqM", gameMask.sqMsk.getNextHighestDepth());
gameMask.createEmptyMovieClip("mcC", gameMask.getNextHighestDepth());
if (num == 1) {
gameMask.mcC.attachMovie("gameMaskMC", "gameMaskMC", 99);
} else if (num == 2) {
if (_root.missionType == "mission") {
gameMask.mcC.attachMovie("gameMaskMissionCompleteMC", "gameMaskMC", 99);
} else {
gameMask.mcC.attachMovie("gameMaskLevelCompleteMC", "gameMaskMC", 99);
}
} else if (num == 3) {
gameMask.mcC.attachMovie("gameMaskGameOverMC", "gameMaskMC", 99);
}
gameMask.mcC.setMask(gameMask.sqMsk.sqM);
startMask();
}
function initLockpicking(lockDifficulty, curLockpick) {
statusScreen.createEmptyMovieClip("lockpickGame", statusScreen.getNextHighestDepth());
treasureBG = _root.statusScreen.lockpickGame.attachMovie("treasureBG", "treasureBG", _root.statusScreen.lockpickGame.getNextHighestDepth());
addText(treasureBG);
lock = _root.statusScreen.lockpickGame.attachMovie("lockMC", "lockMC", _root.statusScreen.lockpickGame.getNextHighestDepth(), {_x:408, _y:298});
lockpickInfo = _root.statusScreen.lockpickGame.attachMovie("lockpickInfo", "lockpickInfo", _root.statusScreen.lockpickGame.getNextHighestDepth(), {_x:580, _y:510});
unlockRange = getUnlockRange(lockpicking, lockDifficulty);
_root.treasureDifficulty = lockDifficulty;
addLockPick(curLockpick.STR, curLockpick);
}
function addLockPick(lockpickType, curLockpick) {
lockpick = _root.statusScreen.lockpickGame.attachMovie("lockpickMC", "lockpickMC", _root.statusScreen.lockpickGame.getNextHighestDepth(), {_x:405, _y:310});
lockpick.gotoAndStop(lockpickType);
lockpick.moveAmt = 0;
lockpick.MC = curLockpick;
lockpick.durability = getLockpickDurability(lockpickType);
lockpick.unlockNum = Math.floor(Math.random() * 180);
if (Math.floor(Math.random() * 2) == 1) {
lockpick.unlockNum = lockpick.unlockNum * -1;
}
lockpick.onPress = function () {
if (_root.soundOn == true) {
_root.lockpickingSnd.start(0, 999);
}
this.onEnterFrame = function () {
Mouse.hide();
this.prevRotation = this._rotation;
this._rotation = Math.floor(rotatePick(_xmouse, this._x, _ymouse, this._y));
if (this._rotation != this.prevRotation) {
this.moveDiff = this._rotation - this.prevRotation;
if (this.moveDiff < 0) {
this.moveDiff = this.moveDiff * -1;
}
if (this.moveDiff < 300) {
this.moveAmt = this.moveAmt + this.moveDiff;
}
lockpickInfo.lockpickMask._x = 33 - Math.ceil(146 * (this.moveAmt / this.durability));
if (this.moveAmt >= this.durability) {
Mouse.show();
breakPick(this);
}
if ((this._rotation > (this.unlockNum - _root.unlockRange)) && (this._rotation < (this.unlockNum + _root.unlockRange))) {
if (this.unlocking != true) {
_root.shakePick(this);
this.unlocking = true;
_root.timePickInt = setTimeout(_root.timePick, 2000, this);
}
} else {
this.unlocking = false;
clearTimeout(_root.timePickInt);
}
}
};
};
lockpick.onRelease = function () {
Mouse.show();
_root.lockpickingSnd.stop();
delete this.onEnterFrame;
};
lockpick.onRollOut = function () {
Mouse.show();
delete this.onEnterFrame;
};
}
function rotatePick(x1, x2, y1, y2) {
return((Math.atan2(y1 - y2, x1 - x2) * 180) / Math.PI);
}
function getLockpickDurability(type) {
switch (type) {
case 1 :
return(500);
case 2 :
return(1000);
case 3 :
return(2000);
}
}
function getUnlockRange(skillLevel, lockDifficulty) {
switch (lockDifficulty) {
case 1 :
return(Math.floor(3 + (skillLevel * 1)));
case 2 :
return(Math.floor(skillLevel * 0.2));
case 3 :
return(Math.floor(skillLevel * 0.1));
case 4 :
return(Math.floor(skillLevel * 0.025));
}
}
function breakPick(lockpick) {
_root.lockpickingSnd.stop();
if (_root.soundOn == true) {
_root.lockpickBreakSnd.start();
}
removeItemQTY(lockpick.MC);
delete lockpick.onEnterFrame;
lockpick.removeMovieClip();
brokePickTxt = _root.statusScreen.lockpickGame.attachMovie("textBox1MC", "brokePickTxt", _root.statusScreen.lockpickGame.getNextHighestDepth(), {_x:160, _y:215});
_root.addText(brokePickTxt, "titleTxt", 0, 45, 475, 50, "SNAP!", 24, 0);
_root.addText(brokePickTxt, "infoTxt", 0, 80, 475, 50, "You have broken your lockpick.", 14, 6050119);
cancelButtonMC = brokePickTxt.createEmptyMovieClip("cancelButtonMC", brokePickTxt.getNextHighestDepth());
addText(cancelButtonMC, "tfield", 140, 120, 190, 20, "Close", 16, 6050119);
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.statusShowTreasures();
_root.statusScreen.lockpickGame.removeMovieClip();
};
}
function shakePick(lockpick) {
var _local4 = new mx.transitions.Tween(lockpick.pick, "_y", mx.transitions.easing.Bounce.easeIn, lockpick.pick._y, lockpick.pick._y + 4, 0.04, true);
_local4.onMotionFinished = function () {
if (_root.statusScreen.lockpickGame.lockpickMC.unlocking == true) {
this.yoyo();
} else {
_root.statusScreen.lockpickGame.lockpickMC.pick._x = 0;
_root.statusScreen.lockpickGame.lockpickMC.pick._y = -34;
}
};
}
function timePick(lockpick) {
if (lockpick.unlocking == true) {
lockpick.unlocking = false;
setTimeout(unlockTreasure, 500);
delete lockpick.onEnterFrame;
}
}
function unlockTreasure() {
if (_root.soundOn == true) {
_root.lockpickingSnd.stop();
_root.treasureOpenSnd.start();
}
Mouse.show();
_root.statusScreen.lockpickGame.lockpickMC.removeMovieClip();
var _local2 = new mx.transitions.Tween(_root.statusScreen.lockpickGame.lockMC, "_rotation", mx.transitions.easing.Back.easeIn, 0, 90, 2, true);
setTimeout(showTreasure, 2000);
}
function showTreasure() {
treasuresUnlocked++;
if ((treasuresUnlocked == 50) && (thiefGuildCount == 0)) {
thiefGuildCount++;
}
if (_root.soundOn == true) {
_root.startLevelSnd.start();
}
treasureOverlay = _root.statusScreen.lockpickGame.attachMovie("treasureOverlay", "treasureOverlay", _root.statusScreen.lockpickGame.getNextHighestDepth(), {_x:410, _y:295});
var _local3 = new mx.transitions.Tween(treasureOverlay, "_xscale", mx.transitions.easing.Strong.easeIn, 1, 10000, 1.5, true);
var _local6 = new mx.transitions.Tween(treasureOverlay, "_yscale", mx.transitions.easing.Strong.easeIn, 1, 10000, 1.5, true);
_local3.onMotionFinished = function () {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
randLootArr = getTreasureLoot(_root.treasureDifficulty);
randLoot = randLootArr[0];
treasureInfo = _root.statusScreen.lockpickGame.attachMovie("textBox1MC", "treasureInfo", _root.statusScreen.lockpickGame.getNextHighestDepth(), {_x:160, _y:215});
_root.addText(treasureInfo, "titleTxt", 0, 45, 475, 50, "Inside the treasure you discover:", 14, 6050119);
if (randLoot == "Gold") {
lootIcon = "iconGold";
} else {
i = 0;
while (i < inventory.length) {
if (inventory[i].NAME == randLoot) {
lootIcon = inventory[i].ICON;
break;
}
i++;
}
}
if (randLoot == "Gold") {
itemIcon = treasureInfo.attachMovie(lootIcon, lootIcon, treasureInfo.getNextHighestDepth(), {_x:180, _y:77});
_root.addText(treasureInfo, "infoTxt", 210, 80, 475, 50, randLootArr[1] + " Gold", 14, 0, false);
} else {
itemIcon = treasureInfo.attachMovie(lootIcon, lootIcon, treasureInfo.getNextHighestDepth(), {_x:140, _y:77});
_root.addText(treasureInfo, "infoTxt", 170, 80, 475, 50, "1 x " + randLoot, 14, 0, false);
}
var _local5 = new mx.transitions.Tween(treasureInfo, "_alpha", mx.transitions.easing.Strong.easeIn, 0, 100, 1, true);
_root.statusScreen.statusBG.coinsTxt.text = gold;
closeButtonMC = treasureInfo.createEmptyMovieClip("closeButtonMC", treasureInfo.getNextHighestDepth());
addText(closeButtonMC, "tfield", 140, 120, 190, 20, "Close", 16, 6050119);
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.removeTreasure(_root.treasureDifficulty);
_root.statusShowTreasures();
_root.checkLockpickingLevelUp(_root.treasureDifficulty);
_root.statusScreen.lockpickGame.removeMovieClip();
};
};
}
function assignItem(itemName, makingItemList) {
switch (itemName) {
case "Healing Herb" :
item = new Object();
item.NAME = itemName;
item.VAL = 10;
item.DESC = "Restores 10 HP to one character.";
item.ICON = "iconHealingHerb";
item.TYPE = 1;
item.battleUsable = true;
item.STR = 10;
item.FUNC = new Function(itemHPPotion);
item.battleFUNC = new Function(itemHPPotionBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "sm. HP Potion" :
item = new Object();
item.NAME = itemName;
item.VAL = 25;
item.DESC = "Restores 25 HP to one character.";
item.ICON = "iconSmallPotion";
item.TYPE = 1;
item.battleUsable = true;
item.STR = 25;
item.FUNC = new Function(itemHPPotion);
item.battleFUNC = new Function(itemHPPotionBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "HP Potion" :
item = new Object();
item.NAME = itemName;
item.VAL = 150;
item.DESC = "Restores 80 HP to one character.";
item.ICON = "iconMediumPotion";
item.TYPE = 1;
item.battleUsable = true;
item.STR = 80;
item.FUNC = new Function(itemHPPotion);
item.battleFUNC = new Function(itemHPPotionBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "lg. HP Potion" :
item = new Object();
item.NAME = itemName;
item.VAL = 300;
item.DESC = "Restores 150 HP to one character.";
item.ICON = "iconLargePotion";
item.TYPE = 1;
item.battleUsable = true;
item.STR = 150;
item.FUNC = new Function(itemHPPotion);
item.battleFUNC = new Function(itemHPPotionBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Mana Root" :
item = new Object();
item.NAME = itemName;
item.VAL = 24;
item.DESC = "Restores 10 MP to one character.";
item.ICON = "iconManaRoot";
item.TYPE = 1;
item.battleUsable = true;
item.STR = 10;
item.FUNC = new Function(itemMPPotion);
item.battleFUNC = new Function(itemMPPotionBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "sm. Mana Potion" :
item = new Object();
item.NAME = itemName;
item.VAL = 80;
item.DESC = "Restores 25 MP to one character.";
item.ICON = "iconSmallManaPotion";
item.TYPE = 1;
item.battleUsable = true;
item.STR = 25;
item.FUNC = new Function(itemMPPotion);
item.battleFUNC = new Function(itemMPPotionBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Mana Potion" :
item = new Object();
item.NAME = itemName;
item.VAL = 200;
item.DESC = "Restores 60 MP to one character.";
item.ICON = "iconManaPotion";
item.TYPE = 1;
item.battleUsable = true;
item.STR = 60;
item.FUNC = new Function(itemMPPotion);
item.battleFUNC = new Function(itemMPPotionBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Elixer" :
item = new Object();
item.NAME = itemName;
item.VAL = 500;
item.DESC = "Completely restore HP and MP of one character.";
item.ICON = "iconElixer";
item.TYPE = 1;
item.battleUsable = true;
item.FUNC = new Function(itemElixer);
item.battleFUNC = new Function(itemElixerBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Mega Elixer" :
item = new Object();
item.NAME = itemName;
item.VAL = 1000;
item.DESC = "Completely restore HP and MP of the entire party.";
item.ICON = "iconMegaElixer";
item.TYPE = 2;
item.battleUsable = true;
item.FUNC = new Function(itemMegaElixer);
item.battleFUNC = new Function(itemMegaElixerBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Antidote" :
item = new Object();
item.NAME = itemName;
item.VAL = 35;
item.DESC = "Cure a character of poison.";
item.ICON = "iconAntidote";
item.TYPE = 1;
item.battleUsable = true;
item.FUNC = new Function(itemAntidote);
item.battleFUNC = new Function(itemAntidoteBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Resurrection" :
item = new Object();
item.NAME = itemName;
item.VAL = 300;
item.DESC = "Fully revives a dead party member.";
item.ICON = "iconResurrection";
item.TYPE = 1;
item.battleUsable = true;
item.FUNC = new Function(itemResurrection);
item.battleFUNC = new Function(itemResurrectionBattle);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Magic Tonic" :
item = new Object();
item.NAME = itemName;
item.VAL = 2;
item.DESC = "Increase maximum MP of a character by 5";
item.ICON = "iconMagicTonic";
item.TYPE = 1;
item.battleUsable = false;
item.FUNC = new Function(itemMagicTonic);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "HP Booster" :
item = new Object();
item.NAME = itemName;
item.VAL = 2;
item.DESC = "Increase maximum HP of a character by 10";
item.ICON = "iconHPBooster";
item.TYPE = 1;
item.battleUsable = false;
item.FUNC = new Function(itemHPBooster);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Power Bar" :
item = new Object();
item.NAME = itemName;
item.VAL = 2;
item.DESC = "Increase STR (strength) of a character by 1";
item.ICON = "iconPowerBar";
item.TYPE = 1;
item.battleUsable = false;
item.FUNC = new Function(itemPowerBar);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Iron Tusk" :
item = new Object();
item.NAME = itemName;
item.VAL = 2;
item.DESC = "Increase DEF (defense) of a character by 1";
item.ICON = "iconIronTusk";
item.TYPE = 1;
item.battleUsable = false;
item.FUNC = new Function(itemIronTusk);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Rusty Lockpick" :
item = new Object();
item.NAME = itemName;
item.VAL = 20;
item.DESC = "Used to pick the lock off a treasure chest";
item.ICON = "iconRustyLockpick";
item.TYPE = 3;
item.FUNC = new Function(statusShowTreasures);
item.battleUsable = false;
item.STR = 1;
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Iron Lockpick" :
item = new Object();
item.NAME = itemName;
item.VAL = 100;
item.DESC = "Used to pick the lock off a treasure chest";
item.ICON = "iconIronLockpick";
item.TYPE = 3;
item.battleUsable = false;
item.STR = 2;
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Ultra Lockpick" :
item = new Object();
item.NAME = itemName;
item.VAL = 600;
item.DESC = "Used to pick the lock off a treasure chest";
item.ICON = "iconUltraLockpick";
item.TYPE = 3;
item.battleUsable = false;
item.STR = 3;
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Poison Scroll" :
item = new Object();
item.NAME = itemName;
item.VAL = 2;
item.DESC = "An ancient scroll that contains the Poison spell";
item.ICON = "iconSpellScroll";
item.TYPE = 2;
item.battleUsable = false;
item.FUNC = new Function(itemPoisonScroll);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Shock Scroll" :
item = new Object();
item.NAME = itemName;
item.VAL = 2;
item.DESC = "An ancient scroll that contains the Shock spell";
item.ICON = "iconSpellScroll";
item.TYPE = 2;
item.battleUsable = false;
item.FUNC = new Function(itemShockScroll);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Freeze Scroll" :
item = new Object();
item.NAME = itemName;
item.VAL = 2;
item.DESC = "An ancient scroll that contains the Freeze spell";
item.ICON = "iconSpellScroll";
item.TYPE = 2;
item.battleUsable = false;
item.FUNC = new Function(itemFreezeScroll);
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else if (checkItemExists(itemName) == false) {
inventory.push(item);
}
break;
case "Lockpicking Guide" :
item = new Object();
item.NAME = itemName;
item.VAL = null;
item.DESC = "A guide that shows you how to pick a treasure's lock.";
item.ICON = "iconLockpickManual";
item.TYPE = 4;
item.battleUsable = false;
item.STR = 10;
item.QTY = 1;
if (makingItemList == true) {
itemListArr.push(item);
} else {
if (checkItemExists(itemName) != false) {
break;
}
inventory.push(item);
}
}
}
function getItemFunc(item, char) {
switch (item.NAME) {
case "Healing Herb" :
trace("FOUND: " + item.NAME);
itemHPPotion(char, item);
break;
case "sm. HP Potion" :
itemHPPotion(char, item);
break;
case "HP Potion" :
itemHPPotion(char, item);
break;
case "lg. HP Potion" :
itemHPPotion(char, item);
break;
case "Mana Root" :
itemMPPotion(char, item);
break;
case "sm. Mana Potion" :
itemMPPotion(char, item);
break;
case "Mana Potion" :
itemMPPotion(char, item);
break;
case "Elixer" :
itemElixer(char, item);
break;
case "Mega Elixer" :
itemMegaElixer(item);
break;
case "Antidote" :
itemAntidote(char, item);
break;
case "Resurrection" :
itemResurrection(char, item);
break;
case "Magic Tonic" :
itemMagicTonic(char, item);
break;
case "HP Booster" :
itemHPBooster(char, item);
break;
case "Power Bar" :
itemPowerBar(char, item);
break;
case "Iron Tusk" :
itemIronTusk(char, item);
break;
case "Poison Scroll" :
itemPoisonScroll(item);
break;
case "Shock Scroll" :
itemShockScroll(item);
break;
case "Freeze Scroll" :
itemFreezeScroll(item);
}
}
function getItemBattleFunc(item) {
switch (item.NAME) {
case "Healing Herb" :
trace("RETURN THIS ONE");
return(new Function(itemHPPotionBattle));
case "sm. HP Potion" :
return(new Function(itemHPPotionBattle));
case "HP Potion" :
return(new Function(itemHPPotionBattle));
case "lg. HP Potion" :
return(new Function(itemHPPotionBattle));
case "Mana Root" :
return(new Function(itemMPPotionBattle));
case "sm. Mana Potion" :
return(new Function(itemMPPotionBattle));
case "Mana Potion" :
return(new Function(itemMPPotionBattle));
case "Elixer" :
return(new Function(itemElixerBattle));
case "Mega Elixer" :
return(new Function(itemMegaElixerBattle));
case "Antidote" :
return(new Function(itemAntidoteBattle));
case "Resurrection" :
return(new Function(itemResurrectionBattle));
}
}
function statusShowItems() {
curItem = null;
statusScreen.statusRight.removeMovieClip();
var _local6 = statusScreen.createEmptyMovieClip("statusRight", statusScreen.getNextHighestDepth());
_local6._x = 230;
var _local3 = statusScreen.statusRight.attachMovie("statusItems", "statusItems", statusScreen.statusRight.getNextHighestDepth(), {_x:16, _y:20});
_local3.createEmptyMovieClip("itemHolder", _local3.getNextHighestDepth());
i = 0;
while (i < inventory.length) {
itemNameClip = _local3.itemHolder.createEmptyMovieClip("itemNameClip" + i, _local3.itemHolder.getNextHighestDepth());
if ((i % 2) == 0) {
itemIcon = itemNameClip.attachMovie(inventory[i].ICON, inventory[i].ICON, itemNameClip.getNextHighestDepth(), {_x:40, _y:(i * 15) + 60});
addText(itemNameClip, "titleTxt" + inventory[i].NAME, 100, (i * 15) + 65, 150, 20, inventory[i].NAME, 12, 6050119, false);
itemQtyClip = _local3.itemHolder.createEmptyMovieClip("itemQtyClip" + i, _local3.itemHolder.getNextHighestDepth());
addText(itemQtyClip, "itemQTY" + inventory[i].NAME, 75, (i * 15) + 65, 35, 20, inventory[i].QTY + " x", 12, 0, false);
} else {
itemIcon = itemNameClip.attachMovie(inventory[i].ICON, inventory[i].ICON, itemNameClip.getNextHighestDepth(), {_x:280, _y:((i - 1) * 15) + 60});
addText(itemNameClip, "titleTxt" + inventory[i].NAME, 340, ((i - 1) * 15) + 65, 150, 20, inventory[i].NAME, 12, 6050119, false);
itemQtyClip = _local3.itemHolder.createEmptyMovieClip("itemQtyClip" + i, _local3.itemHolder.getNextHighestDepth());
addText(itemQtyClip, "itemQTY" + inventory[i].NAME, 315, ((i - 1) * 15) + 65, 35, 20, inventory[i].QTY + " x", 12, 0, false);
}
itemNameClip.tfield = itemNameClip["titleTxt" + inventory[i].NAME];
itemNameClip.infoBox = _local3.itemInfo;
itemNameClip.invItem = inventory[i];
itemNameClip.ICON = itemIcon;
itemNameClip.onRollOver = function () {
this.tfield.textColor = 0;
this.infoBox.text = this.invItem.DESC;
};
itemNameClip.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
this.infoBox.text = "";
};
itemNameClip.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
if (this.invItem.TYPE == 3) {
_root.statusShowTreasures();
} else if (this.invItem.TYPE == 4) {
showLockPickingGuide();
} else {
showItemAlert(this.invItem);
}
};
i++;
}
itemCheckForScroll();
}
function showLockPickingGuide() {
lockpickingGuide = _root.statusScreen.createEmptyMovieClip("lockpickingGuide", _root.statusScreen.getNextHighestDepth());
lockpickingGuideMC = lockpickingGuide.attachMovie("lockpickingGuideMC", "lockpickingGuideMC", lockpickingGuide.getNextHighestDepth());
lockpickingGuideMC.onRollOver = function () {
this.useHandCursor = false;
};
cancelButtonMC = lockpickingGuide.createEmptyMovieClip("cancelButtonMC", lockpickingGuide.getNextHighestDepth());
addText(cancelButtonMC, "tfield", 678, 550, 190, 20, "CLOSE GUIDE", 11, 16777215, false);
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 16773568 /* 0xFFF1C0 */;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 16777215 /* 0xFFFFFF */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.statusScreen.lockpickingGuide.removeMovieClip();
statusShowItems();
};
}
function showItemAlert(item) {
_root.statusScreen.createEmptyMovieClip("itemAlert", _root.statusScreen.getNextHighestDepth());
box = _root.statusScreen.itemAlert.createEmptyMovieClip("box", 1);
box.beginFill(0);
box.lineTo(0, 600);
box.lineTo(800, 600);
box.lineTo(800, 0);
box.lineTo(0, 0);
box._alpha = 50;
box.onRollOver = function () {
this.useHandCursor = false;
};
itemAlertMC = _root.statusScreen.itemAlert.attachMovie("statusItemAlert", "statusItemAlert", _root.statusScreen.itemAlert.getNextHighestDepth(), {_x:400, _y:140});
useButtonMC = itemAlertMC.createEmptyMovieClip("useButtonMC", itemAlertMC.getNextHighestDepth());
addText(useButtonMC, "tfield", 5, 35, 190, 20, "Use", 13, 6050119);
useButtonMC.invItem = item;
useButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
useButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
useButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
if (this.invItem.TYPE == 1) {
statusShowChars(this.invItem);
} else {
_root.getItemFunc(this.invItem);
}
_root.statusScreen.itemAlert.removeMovieClip();
};
dropButtonMC = itemAlertMC.createEmptyMovieClip("dropButtonMC", itemAlertMC.getNextHighestDepth());
addText(dropButtonMC, "tfield", 5, 65, 190, 20, "Drop", 13, 6050119);
dropButtonMC.invItem = item;
dropButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
dropButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
dropButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
dropItem(this.invItem);
_root.statusScreen.itemAlert.removeMovieClip();
};
cancelButtonMC = itemAlertMC.createEmptyMovieClip("cancelButtonMC", itemAlertMC.getNextHighestDepth());
addText(cancelButtonMC, "tfield", 5, 95, 190, 20, "Cancel", 13, 6050119);
cancelButtonMC.invItem = item;
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.statusScreen.itemAlert.removeMovieClip();
statusShowItems();
};
}
function checkItemExists(itemName) {
i = 0;
while (i < inventory.length) {
if (inventory[i].NAME == itemName) {
inventory[i].QTY++;
return(true);
}
i++;
}
return(false);
}
function removeItemQTY(item) {
trace("REMOVE: " + item.NAME);
trace("QTY BEFORE: " + item.QTY);
item.QTY--;
trace("QTY AFTER: " + item.QTY);
if (item.QTY <= 0) {
i = 0;
while (i < inventory.length) {
if (inventory[i].NAME == item.NAME) {
inventory.splice(i, 1);
break;
}
i++;
}
}
}
function dropItem(item) {
item.QTY--;
if (item.QTY <= 0) {
i = 0;
while (i < inventory.length) {
if (inventory[i].NAME == item.NAME) {
inventory.splice(i, 1);
break;
}
i++;
}
}
statusShowItems();
}
function getItemInfo(itemName) {
i2 = 0;
while (i2 < inventory.length) {
if (inventory[i2].NAME == itemName) {
return(inventory[i2]);
}
i2++;
}
e2 = 0;
while (e2 < equipment.length) {
if (equipment[e2].NAME == itemName) {
return(equipment[e2]);
}
e2++;
}
return(false);
}
function itemCheckForScroll() {
if (inventory.length > 18) {
maskMC = statusScreen.statusRight.statusItems.attachMovie("windowActionsMask", "windowActionsMask", statusScreen.statusRight.statusItems.getNextHighestDepth(), {_x:265, _y:212});
maskMC._width = 480;
maskMC._height = 280;
statusScreen.statusRight.statusItems.itemHolder.setMask(maskMC);
var _local4 = statusScreen.statusRight.statusItems.attachMovie("menuArrow", "downArrow", statusScreen.statusRight.statusItems.getNextHighestDepth(), {_x:250, _y:345});
var _local3 = statusScreen.statusRight.statusItems.attachMovie("menuArrow", "upArrow", statusScreen.statusRight.statusItems.getNextHighestDepth(), {_x:250, _y:45});
_local3._visible = false;
_local4._yscale = -100;
_root.scrollNum = 0;
_root.arrSize = inventory.length + 1;
_local4.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (_root.scrollNum < (_root.arrSize - 7)) {
_root.statusScreen.statusRight.statusItems.itemHolder._y = _root.statusScreen.statusRight.statusItems.itemHolder._y - 30;
_root.scrollNum++;
_root.itemCheckScrollArrows();
}
};
_local4.onRollOver = function () {
this.gotoAndStop(2);
};
_local4.onRollOut = function () {
this.gotoAndStop(1);
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if ((_root.scrollNum + _root.arrSize) > _root.arrSize) {
_root.statusScreen.statusRight.statusItems.itemHolder._y = _root.statusScreen.statusRight.statusItems.itemHolder._y + 30;
_root.scrollNum--;
_root.itemCheckScrollArrows();
}
};
_local3.onRollOver = function () {
this.gotoAndStop(2);
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
};
}
}
function itemCheckScrollArrows() {
tempScrollNum = Math.floor(_root.arrSize / 2) * 2;
if ((_root.scrollNum + 23) == tempScrollNum) {
_root.statusScreen.statusRight.statusItems.downArrow._visible = false;
} else {
_root.statusScreen.statusRight.statusItems.downArrow._visible = true;
}
if ((_root.scrollNum + 18) == 18) {
_root.statusScreen.statusRight.statusItems.upArrow._visible = false;
} else {
_root.statusScreen.statusRight.statusItems.upArrow._visible = true;
}
}
function itemHPPotion(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
if ((_root.defenderArr[char.num].HP + item.STR) > _root.defenderArr[char.num].HPMax) {
_root.defenderArr[char.num].HP = _root.defenderArr[char.num].HPMax;
} else {
_root.defenderArr[char.num].HP = _root.defenderArr[char.num].HP + item.STR;
}
_root.enableLeftNav();
_root.statusShowChars();
var _local4 = {r:255, g:255, b:255};
char.meterHP.fluxTint(_local4, 0, 100, 20, true, 1);
removeItemQTY(item);
}
function itemMPPotion(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
if ((_root.defenderArr[char.num].MP + item.STR) > _root.defenderArr[char.num].MPMax) {
_root.defenderArr[char.num].MP = _root.defenderArr[char.num].MPMax;
} else {
_root.defenderArr[char.num].MP = _root.defenderArr[char.num].MP + item.STR;
}
_root.enableLeftNav();
_root.statusShowChars();
var _local4 = {r:255, g:255, b:255};
char.meterMP.fluxTint(_local4, 0, 100, 20, true, 1);
removeItemQTY(item);
}
function itemElixer(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
_root.defenderArr[char.num].HP = _root.defenderArr[char.num].HPMax;
_root.defenderArr[char.num].MP = _root.defenderArr[char.num].MPMax;
_root.enableLeftNav();
_root.statusShowChars();
var _local3 = {r:255, g:255, b:255};
char.meterHP.fluxTint(_local3, 0, 100, 20, true, 1);
char.meterMP.fluxTint(_local3, 0, 100, 20, true, 1);
removeItemQTY(item);
}
function itemMegaElixer(item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
_root.statusShowChars();
c = 0;
while (c < defenderArr.length) {
char = defenderArr[c];
char.MP = char.MPMax;
char.HP = char.HPMax;
c++;
}
_root.statusShowChars();
c = 0;
while (c < defenderArr.length) {
char = statusScreen.statusRight[defenderArr[c].name + "Stats"];
var _local2 = {r:255, g:255, b:255};
char.meterMP.fluxTint(_local2, 0, 100, 20, true, 1);
char.meterHP.fluxTint(_local2, 0, 100, 20, true, 1);
c++;
}
removeItemQTY(item);
}
function itemAntidote(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
a = 0;
while (a < char.ailments.length) {
if (char.ailments[a] == "poison") {
char.ailments.splice(a, 1);
break;
}
a++;
}
_root.enableLeftNav();
_root.statusShowChars();
charMC = statusScreen.statusRight[char.name + "Stats"][char.name + "MC"];
var _local3 = {r:255, g:255, b:255};
charMC.fluxTint(_local3, 0, 100, 20, true, 1);
removeItemQTY(item);
}
function itemResurrection(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
_root.defenderArr[char.num].HP = _root.defenderArr[char.num].HPMax;
_root.defenderArr[char.num].MP = _root.defenderArr[char.num].MPMax;
_root.enableLeftNav();
_root.statusShowChars();
var _local3 = {r:255, g:255, b:255};
char.meterHP.fluxTint(_local3, 0, 100, 20, true, 1);
char.meterMP.fluxTint(_local3, 0, 100, 20, true, 1);
removeItemQTY(item);
char.dead = false;
}
function itemMagicTonic(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
char.MPMax = char.MPMax + 5;
_root.enableLeftNav();
_root.statusShowChars();
charMC = statusScreen.statusRight[char.name + "Stats"][char.name + "MC"];
var _local3 = {r:255, g:255, b:255};
charMC.fluxTint(_local3, 0, 100, 20, true, 1);
checkStatusAilments(char, charMC);
removeItemQTY(item);
}
function itemHPBooster(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
char.HPMax = char.HPMax + 10;
_root.enableLeftNav();
_root.statusShowChars();
charMC = statusScreen.statusRight[char.name + "Stats"][char.name + "MC"];
var _local3 = {r:255, g:255, b:255};
charMC.fluxTint(_local3, 0, 100, 20, true, 1);
checkStatusAilments(char, charMC);
removeItemQTY(item);
}
function itemPowerBar(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
char.STR = char.STR + 1;
_root.enableLeftNav();
_root.statusShowChars();
charMC = statusScreen.statusRight[char.name + "Stats"][char.name + "MC"];
var _local3 = {r:255, g:255, b:255};
charMC.fluxTint(_local3, 0, 100, 20, true, 1);
checkStatusAilments(char, charMC);
removeItemQTY(item);
}
function itemIronTusk(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
char.DEF = char.DEF + 1;
_root.enableLeftNav();
_root.statusShowChars();
charMC = statusScreen.statusRight[char.name + "Stats"][char.name + "MC"];
var _local3 = {r:255, g:255, b:255};
charMC.fluxTint(_local3, 0, 100, 20, true, 1);
checkStatusAilments(char, charMC);
removeItemQTY(item);
}
function itemPoisonScroll(item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
_root.statusShowChars();
d = 0;
while (d < defenderArr.length) {
if (defenderArr[d].classType == "Mage") {
defenderArr[d].spells.push(["POISON"]);
}
d++;
}
_root.statusShowChars();
removeItemQTY(item);
showLearnedSpellAlert("POISON");
}
function itemShockScroll(item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
_root.statusShowChars();
d = 0;
while (d < defenderArr.length) {
if (defenderArr[d].classType == "Mage") {
defenderArr[d].spells.push(["SHOCK"]);
}
d++;
}
_root.statusShowChars();
removeItemQTY(item);
showLearnedSpellAlert("SHOCK");
}
function itemFreezeScroll(item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
_root.statusShowChars();
d = 0;
while (d < defenderArr.length) {
if (defenderArr[d].classType == "Mage") {
defenderArr[d].spells.push(["FREEZE"]);
}
d++;
}
_root.statusShowChars();
removeItemQTY(item);
showLearnedSpellAlert("FREEZE");
}
function showLearnedSpellAlert(spellName) {
_root.createEmptyMovieClip("itemAlert", _root.getNextHighestDepth());
box = _root.itemAlert.createEmptyMovieClip("box", 1);
box.beginFill(0);
box.lineTo(0, 600);
box.lineTo(800, 600);
box.lineTo(800, 0);
box.lineTo(0, 0);
box._alpha = 50;
box.onRollOver = function () {
this.useHandCursor = false;
};
itemAlertMC = _root.itemAlert.attachMovie("statusItemAlert", "statusItemAlert", _root.itemAlert.getNextHighestDepth(), {_x:400, _y:140});
addText(itemAlertMC, "tfield", 5, 40, 190, 20, "Kage learned:", 13, 6050119);
addText(itemAlertMC, "tfield2", 5, 65, 190, 20, spellName, 16, 0);
cancelButtonMC = itemAlertMC.createEmptyMovieClip("cancelButtonMC", itemAlertMC.getNextHighestDepth());
addText(cancelButtonMC, "tfield", 5, 105, 190, 20, "Close", 13, 6050119);
cancelButtonMC.invItem = item;
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.itemAlert.removeMovieClip();
};
}
function prepBattleItem(itemFunc, char, invItem) {
itemTxt = _root.interfaceMC.createEmptyMovieClip("itemTxt", _root.interfaceMC.getNextHighestDepth());
addText(itemTxt, "tfield", 0, 60, 800, 60, invItem.NAME, 30, 16777215);
itemTxt._alpha = 0;
var _local3 = new mx.transitions.Tween(itemTxt, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 2, true);
_local3.onMotionFinished = function () {
var _local1 = new mx.transitions.Tween(itemTxt, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 1.5, true);
_local1.onMotionFinished = function () {
itemFunc = getItemBattleFunc(invItem);
itemFunc(char, invItem);
};
};
}
function itemHPPotionBattle(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
if ((_root.defenderLevelArr[char.num].HP + item.STR) > _root.defenderLevelArr[char.num].HPMax) {
_root.defenderLevelArr[char.num].HP = _root.defenderLevelArr[char.num].HPMax;
} else {
_root.defenderLevelArr[char.num].HP = _root.defenderLevelArr[char.num].HP + item.STR;
}
animateItemTxtPrep(("+" + item.STR) + " HP", char, 1);
if (char == _root.currentTurn) {
updateCharacterInfo(char, _root.charStats.charInfo);
var _local4 = {r:255, g:255, b:255};
_root.charStats.charInfo.meterHP.fluxTint(_local4, 0, 100, 20, true, 1);
} else {
updateCharacterInfo(char, _root.charStats.charInfo2);
var _local4 = {r:255, g:255, b:255};
_root.charStats.charInfo2.meterHP.fluxTint(_local4, 0, 100, 20, true, 1);
}
char.MC.fluxTint(_local4, 0, 100, 20, true, 1);
removeItemQTY(item);
setTimeout(remOverlay, 2000);
}
function itemMPPotionBattle(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
if ((_root.defenderLevelArr[char.num].MP + item.STR) > _root.defenderLevelArr[char.num].MPMax) {
_root.defenderLevelArr[char.num].MP = _root.defenderLevelArr[char.num].MPMax;
} else {
_root.defenderLevelArr[char.num].MP = _root.defenderLevelArr[char.num].MP + item.STR;
}
animateItemTxtPrep(item.STR + " MP", char, 3);
if (char.name == _root.currentTurn.name) {
updateCharacterInfo(char, _root.charStats.charInfo);
var _local4 = {r:255, g:255, b:255};
_root.charStats.charInfo.meterMP.fluxTint(_local4, 0, 100, 20, true, 1);
} else {
updateCharacterInfo(char, _root.charStats.charInfo2);
var _local4 = {r:255, g:255, b:255};
_root.charStats.charInfo2.meterMP.fluxTint(_local4, 0, 100, 20, true, 1);
}
removeItemQTY(item);
setTimeout(remOverlay, 2000);
}
function itemElixerBattle(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
_root.defenderLevelArr[char.num].HP = _root.defenderLevelArr[char.num].HPMax;
_root.defenderLevelArr[char.num].MP = _root.defenderLevelArr[char.num].MPMax;
animateItemTxtPrep("HP/MP Maxed", char, 2);
if (char == _root.currentTurn) {
updateCharacterInfo(char, _root.charStats.charInfo);
var _local3 = {r:255, g:255, b:255};
_root.charStats.charInfo.meterMP.fluxTint(_local3, 0, 100, 20, true, 1);
_root.charStats.charInfo.meterHP.fluxTint(_local3, 0, 100, 20, true, 1);
} else {
updateCharacterInfo(char, _root.charStats.charInfo2);
var _local3 = {r:255, g:255, b:255};
_root.charStats.charInfo2.meterMP.fluxTint(_local3, 0, 100, 20, true, 1);
_root.charStats.charInfo2.meterHP.fluxTint(_local3, 0, 100, 20, true, 1);
}
char.MC.fluxTint(_local3, 0, 100, 20, true, 1);
removeItemQTY(item);
setTimeout(remOverlay, 2000);
}
function itemMegaElixerBattle(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
d = 0;
while (d < defenderLevelArr.length) {
defenderLevelArr[d].HP = _root.defenderLevelArr[d].HPMax;
defenderLevelArr[d].MP = _root.defenderLevelArr[d].MPMax;
animateItemTxtPrep("HP/MP Maxed", defenderLevelArr[d], 7);
var _local2 = {r:255, g:255, b:255};
defenderLevelArr[d].MC.fluxTint(_local2, 0, 100, 20, true, 1);
d++;
}
updateCharacterInfo(char, _root.charStats.charInfo);
_root.charStats.charInfo.meterMP.fluxTint(_local2, 0, 100, 20, true, 1);
_root.charStats.charInfo.meterHP.fluxTint(_local2, 0, 100, 20, true, 1);
removeItemQTY(item);
setTimeout(remOverlay, 2000);
}
function itemAntidoteBattle(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
a = 0;
while (a < char.ailments.length) {
if (char.ailments[a] == "poison") {
char.ailments.splice(a, 1);
break;
}
a++;
}
var _local3 = {r:255, g:255, b:255};
char.MC.charMC.fluxTint(_local3, 0, 100, 20, true, 1);
removeItemQTY(item);
setTimeout(remOverlay, 2000);
}
function itemResurrectionBattle(char, item) {
if (_root.soundOn == true) {
_root.healSnd.start();
}
char.dead = false;
char.MC.charMC.gotoAndStop(char.curDirection);
turnArr.push([char, char.SPD]);
tileMap[char.x][char.y].walkable = false;
tileMap[char.x][char.y].deadChar = false;
char.enabled = true;
char.HP = char.HPMax;
char.MP = char.MPMax;
var _local3 = {r:255, g:255, b:255};
char.MC.charMC.fluxTint(_local3, 0, 100, 20, true, 1);
removeItemQTY(item);
setTimeout(remOverlay, 2000);
}
function animateItemTxtPrep(critTxt, target, frame) {
critTxtArr = critTxt.toString().split("");
itemTxt = _root.display.tiles.createEmptyMovieClip("itemTxt" + _root.display.tiles.getNextHighestDepth(), _root.display.tiles.getNextHighestDepth());
wordWidth2 = 0;
t = 0;
while (t < critTxtArr.length) {
var _local2 = itemTxt.attachMovie("damageTxt", "critTxt" + t, itemTxt.getNextHighestDepth(), {_x:wordWidth2 + (target.MC._x - (critTxtArr.length * 4)), _y:(target.MC._y - target.MC._height) + 15});
_local2._width = _local2._width * 1.2;
_local2._height = _local2._height * 1.2;
_local2.num = t + 1;
_local2.gotoAndStop(frame);
_local2.txt.text = critTxtArr[t];
_local2.txt.autoSize = true;
wordWidth2 = wordWidth2 + (_local2.txt._width - 2);
setTimeout(animateItemTxt, t * 75, _local2, itemTxt);
t++;
}
}
function animateItemTxt(txt, MCHolder) {
critTxtTween = new mx.transitions.Tween(txt, "_y", mx.transitions.easing.Elastic.easeOut, txt._y, txt._y - 10, 1.5, true);
if (txt.num == critTxtArr.length) {
critTxtTween.onMotionFinished = function () {
MCHolder.removeMovieClip();
};
}
}
function addOverlayMultiple(char, target) {
var _local2 = _root.display.tiles.attachMovie("overlay-MC", "overlayMC", _root.display.tiles.getNextHighestDepth());
_local2._width = _local2._width * 4;
_local2._height = _local2._height * 4;
_local2._x = _root.display.tiles._x - 1500;
_local2._y = _root.display.tiles._y - 1000;
if (char.MC._y < target._y) {
char.MC.swapDepths(_root.display.tiles.getNextHighestDepth());
target.MC.swapDepths(_root.display.tiles.getNextHighestDepth());
} else {
target.MC.swapDepths(_root.display.tiles.getNextHighestDepth());
char.MC.swapDepths(_root.display.tiles.getNextHighestDepth());
}
_root.charStats.windowActions._visible = false;
}
function remOverlayMultiple() {
_root.display.tiles.overlayMC.gotoAndPlay(21);
setTimeout(charOverlayDepth, 1000);
if (dropTreasure == true) {
setTimeout(dropTreasureFunc, 1000);
} else {
setTimeout(endAttack, 1500);
}
}
function checkItemRange(char, item) {
attackRangeArr = new Array();
itemRange = 1;
attackArr = new Array();
rangeCount = 1;
down = false;
i = char.x - itemRange;
while (i < ((char.x + itemRange) + 1)) {
var _local2 = {r:255, g:66, b:239};
i2 = char.y;
while (i2 < (rangeCount + char.y)) {
tileMap[i][i2].range._visible = true;
tileMap[i][i2].range.fluxTint(_local2, 0, 50, 99, false, 1);
attackRangeArr.push(tileMap[i][i2]);
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i2]) {
attackArr.push(defenderLevelArr[e]);
}
e++;
}
e = 0;
while (e < enemyArr.length) {
if (tileMap[enemyArr[e].x][enemyArr[e].y] == tileMap[i][i2]) {
attackArr.push(enemyArr[e]);
}
e++;
}
i2++;
}
i3 = char.y;
while (i3 > (char.y - rangeCount)) {
tileMap[i][i3].range._visible = true;
tileMap[i][i3].range.fluxTint(_local2, 0, 50, 99, false, 1);
attackRangeArr.push(tileMap[i][i3]);
e = 0;
while (e < defenderLevelArr.length) {
if (tileMap[defenderLevelArr[e].x][defenderLevelArr[e].y] == tileMap[i][i3]) {
attackArr.push(defenderLevelArr[e]);
}
e++;
}
e = 0;
while (e < enemyArr.length) {
if (tileMap[enemyArr[e].x][enemyArr[e].y] == tileMap[i][i3]) {
attackArr.push(enemyArr[e]);
}
e++;
}
i3--;
}
if (rangeCount < (itemRange + 1)) {
if (down != true) {
rangeCount++;
} else {
rangeCount--;
}
} else {
down = true;
rangeCount--;
}
i++;
}
itemHumansInRange(item);
}
function itemHumansInRange(item) {
if (item.NAME == "Resurrection") {
itemHumansInRangeResurrection(item);
} else {
e = 0;
while (e < enemyArr.length) {
enemyArr[e].enabled = false;
e++;
}
r = 0;
while (r < attackArr.length) {
if ((attackArr[r].type == "enemy") || (attackArr[r].dead == true)) {
attackArr[r].MC._alpha = 50;
attackArr[r].MC.enabled = false;
} else {
var colObj = {r:255, g:255, b:255};
attackArr[r].MC.fluxTint(colObj, 0, 60, 5, true);
attackArr[r].MC.hover.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this._parent.enabled = false;
this._parent.useHandCursor = false;
_root.resetRange(_root.attackRangeArr);
_root.disableCharRollOvers();
this._parent.fluxTint(colObj, 0, 0, 1, false);
_root.addOverlay(_root.currentTurn, this._parent.stats);
setTimeout(prepBattleItem, 2000, item.battleFUNC, this._parent.stats, item);
};
attackArr[r].MC.hover.onRollOver = function () {
this.useHandCursor = true;
var _local4 = {r:255, g:255, b:255};
this._parent.fluxTint(_local4, 0, 70, 15, false, 1);
if (this._parent.stats != _root.currentTurn) {
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this._parent.stats, _local3);
}
};
attackArr[r].MC.hover.onRollOut = function () {
var _local3 = {r:255, g:255, b:255};
this._parent.fluxTint(_local3, 0, 60, 5, true);
_root.charStats.charInfo2.removeMovieClip();
};
}
r++;
}
}
}
function itemHumansInRangeResurrection(item) {
e = 0;
while (e < enemyArr.length) {
enemyArr[e].enabled = false;
e++;
}
r = 0;
while (r < attackArr.length) {
if ((attackArr[r].type == "enemy") || (attackArr[r].dead != true)) {
attackArr[r].MC._alpha = 50;
attackArr[r].MC.enabled = false;
} else {
var colObj = {r:255, g:255, b:255};
attackArr[r].MC.fluxTint(colObj, 0, 60, 5, true);
attackArr[r].MC.hover.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this._parent.enabled = false;
this._parent.useHandCursor = false;
_root.resetRange(_root.attackRangeArr);
_root.disableCharRollOvers();
this._parent.fluxTint(colObj, 0, 0, 1, false);
_root.addOverlay(_root.currentTurn, this._parent.stats);
setTimeout(prepBattleItem, 2000, item.battleFUNC, this._parent.stats, item);
};
attackArr[r].MC.hover.onRollOver = function () {
this.useHandCursor = true;
var _local4 = {r:255, g:255, b:255};
this._parent.fluxTint(_local4, 0, 70, 15, false, 1);
if (this._parent.stats != _root.currentTurn) {
var _local3 = _root.charStats.attachMovie("charInfoR-MC", "charInfo2", _root.charStats.getNextHighestDepth(), {_x:850, _y:440});
var _local7 = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.Strong.easeOut, _local3._x, 490, 1, true);
updateCharacterInfo(this._parent.stats, _local3);
}
};
attackArr[r].MC.hover.onRollOut = function () {
var _local3 = {r:255, g:255, b:255};
this._parent.fluxTint(_local3, 0, 60, 5, true);
_root.charStats.charInfo2.removeMovieClip();
};
}
r++;
}
}
function assignEquipment(itemName, makingItemList) {
switch (itemName) {
case "Rusty Sword" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconRustySword";
item.VAL = 2;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["STR", 1]];
item.classType = new Array();
item.classType = ["Knight"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Iron Sword" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconIronSword";
item.VAL = 80;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["STR", 3]];
item.classType = new Array();
item.classType = ["Knight"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Broad Sword" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconBroadSword";
item.VAL = 250;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["STR", 5]];
item.classType = new Array();
item.classType = ["Knight"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Falchion" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconFalchion";
item.VAL = 500;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["STR", 7]];
item.classType = new Array();
item.classType = ["Knight"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Flame Sword" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconFlameSword";
item.VAL = 2;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["STR", 9]];
item.classType = new Array();
item.classType = ["Knight"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Wood Staff" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconWoodStaff";
item.VAL = 30;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["MAG", 2]];
item.classType = new Array();
item.classType = ["Mage"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Wand" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconWand";
item.VAL = 70;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["MAG", 3]];
item.classType = new Array();
item.classType = ["Mage"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Element Staff" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconElementStaff";
item.VAL = 225;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["MAG", 5]];
item.classType = new Array();
item.classType = ["Mage"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Lava Wand" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconLavaWand";
item.VAL = 500;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["MAG", 7]];
item.classType = new Array();
item.classType = ["Mage"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Wooden Bow" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconWoodenBow";
item.VAL = 100;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["STR", 2]];
item.classType = new Array();
item.classType = ["Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Long Bow" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconLongBow";
item.VAL = 250;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["STR", 4]];
item.classType = new Array();
item.classType = ["Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Cupid Bow" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconCupidBow";
item.VAL = 500;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["STR", 6]];
item.classType = new Array();
item.classType = ["Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Marksman Bow" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconMarksmanBow";
item.VAL = 500;
item.TYPE = 1;
item.ATT = new Array();
item.ATT = [["STR", 8]];
item.classType = new Array();
item.classType = ["Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Rusty Armor" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconRustyArmor";
item.VAL = 2;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 1]];
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Iron Armor" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconIronArmor";
item.VAL = 90;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 3]];
item.classType = new Array();
item.classType = ["Knight"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Chain Mail" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconChainMail";
item.VAL = 200;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 5]];
item.classType = new Array();
item.classType = ["Knight"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Plate Armor" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconPlateArmor";
item.VAL = 575;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 7]];
item.classType = new Array();
item.classType = ["Knight"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Cloth Robe" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconClothRobe";
item.VAL = 32;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 1]];
item.classType = new Array();
item.classType = ["Mage"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Cloak" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconCloak";
item.VAL = 75;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 3]];
item.classType = new Array();
item.classType = ["Mage"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Silk Robe" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconSilkRobe";
item.VAL = 220;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 5]];
item.classType = new Array();
item.classType = ["Mage"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Amber Robe" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconSilkRobe";
item.VAL = 550;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 7]];
item.classType = new Array();
item.classType = ["Mage"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Iron Vest" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconIronVest";
item.VAL = 60;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 3]];
item.classType = new Array();
item.classType = ["Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Iron Doublet" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconIronDoublet";
item.VAL = 225;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 5]];
item.classType = new Array();
item.classType = ["Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Rose Gilet" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconRoseGilet";
item.VAL = 525;
item.TYPE = 2;
item.ATT = new Array();
item.ATT = [["DEF", 7]];
item.classType = new Array();
item.classType = ["Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Iron Ring" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconIronRing";
item.VAL = 50;
item.TYPE = 3;
item.ATT = new Array();
item.ATT = [["DEF", 1]];
item.DESC = "Increases DEF by 1";
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Magic Ring" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconMagicRing";
item.VAL = 80;
item.TYPE = 3;
item.ATT = new Array();
item.ATT = [["MAG", 1]];
item.DESC = "Increases MAG by 1";
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Amulet of Warding" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconAmuletWarding";
item.VAL = 200;
item.TYPE = 3;
item.ATT = new Array();
item.ATT = [["DEF", 1], ["MAG", 1]];
item.DESC = "Increases DEF by 1 and MAG by 1";
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Lucky Ribbon" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconLuckyRibbon";
item.VAL = 500;
item.TYPE = 3;
item.ATT = new Array();
item.ATT = [["LCK", 5]];
item.DESC = "Increases LUCK by 5";
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Power Glove" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconPowerGlove";
item.VAL = 600;
item.TYPE = 3;
item.ATT = new Array();
item.ATT = [["STR", 3]];
item.DESC = "Increases STR by 3";
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Ruby Pin" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconRubyPin";
item.VAL = 300;
item.TYPE = 3;
item.ATT = new Array();
item.ATT = [["STR", 1], ["DEF", 1]];
item.DESC = "Increases STR by 1 and DEF by 1";
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Silver Necklace" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconSilverNecklace";
item.VAL = 180;
item.TYPE = 3;
item.ATT = new Array();
item.ATT = [["STR", 1], ["SPD", 1]];
item.DESC = "Increases STR by 1 and SPD by 1";
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Speed Boots" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconSpeedBoots";
item.VAL = 700;
item.TYPE = 3;
item.ATT = new Array();
item.ATT = [["SPD", 5]];
item.DESC = "Increases SPD by 5";
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
break;
case "Thief Gloves" :
item = new Object();
item.NAME = itemName;
item.ICON = "iconThiefGloves";
item.VAL = 2;
item.TYPE = 3;
item.ATT = new Array();
item.ATT = null;
item.DESC = "Increases chances of getting treasures from enemies.";
item.classType = new Array();
item.classType = ["Knight", "Mage", "Archer"];
item.QTY = 1;
item.USED = false;
if (makingItemList == true) {
itemListArr.push(item);
} else {
equipment.push(item);
}
}
}
function statusShowEquipment(charNum) {
if (charNum == undefined) {
charNum = 0;
}
statusScreen.statusRight.removeMovieClip();
var _local8 = statusScreen.createEmptyMovieClip("statusRight", statusScreen.getNextHighestDepth());
_local8._x = 230;
var _local4 = statusScreen.statusRight.attachMovie("statusEquipment", "statusEquipment", statusScreen.statusRight.getNextHighestDepth(), {_x:16, _y:20});
if (_root.inBattle != true) {
if (defenderArr.length > 1) {
statusAddNextCharacterButton("equipment", charNum, _local4);
}
}
var _local7 = _local4.attachMovie("defenders", "defender_" + defenderArr[charNum].name, _local4.getNextHighestDepth(), {_x:95, _y:110});
_local7.gotoAndStop(defenderArr[charNum].name);
_local7._xscale = _local7._xscale * 1.15;
_local7._yscale = _local7._yscale * 1.15;
if (defenderArr[charNum].HP == 0) {
_local4.attachMovie("iconDeath", "iconDeath", _local4.getNextHighestDepth(), {_x:18, _y:28});
}
checkStatusAilments(defenderArr[charNum], _local7);
_local4.charName.text = defenderArr[charNum].name;
_local4.charSTR.text = defenderArr[charNum].STR;
_local4.charDEF.text = defenderArr[charNum].DEF;
_local4.charLCK.text = defenderArr[charNum].LCK;
_local4.charSPD.text = defenderArr[charNum].SPD;
_local4.charMAG.text = defenderArr[charNum].MAG;
_local4.charRange.text = defenderArr[charNum].range;
equipArr = new Array();
equipArr = [defenderArr[charNum].WEAPON, defenderArr[charNum].ARMOR, defenderArr[charNum].ACCESSORY];
e = 0;
while (e < equipArr.length) {
itemNameClip = _local4.createEmptyMovieClip(equipArr[e].NAME + "Clip", _local4.getNextHighestDepth());
itemIcon = itemNameClip.attachMovie(equipArr[e].ICON, equipArr[e].ICON, itemNameClip.getNextHighestDepth(), {_x:287, _y:(e * 29) + 65});
if ((equipArr[e].NAME == undefined) || (equipArr[e].NAME == null)) {
addText(itemNameClip, "titleTxt" + equipArr[e].NAME, 320, (e * 29) + 70, 250, 20, "None", 12, 6050119, false);
} else {
addText(itemNameClip, "titleTxt" + equipArr[e].NAME, 320, (e * 29) + 70, 120, 20, equipArr[e].NAME, 12, 6050119, false);
addRemoveEquipButton(defenderArr[charNum], equipArr[e], e, charNum);
}
itemNameClip.tfield = itemNameClip["titleTxt" + equipArr[e].NAME];
itemNameClip.invItem = equipArr[e];
itemNameClip.ICON = itemIcon;
itemNameClip.TYPE = e + 1;
itemNameClip.CHAR = defenderArr[charNum];
itemNameClip.curCharNum = charNum;
itemNameClip.onRollOver = function () {
this.tfield.textColor = 0;
};
itemNameClip.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
itemNameClip.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
groupEquipment(this.CHAR, this.TYPE, this.curCharNum);
};
e++;
}
}
function addRemoveEquipButton(char, equipment, num, charNum) {
trace("CHAR NUM REMOVE: " + charNum);
removeTxtClip = statusScreen.statusRight.statusEquipment.createEmptyMovieClip(equipment.NAME + "RemoveTxt", statusScreen.statusRight.statusEquipment.getNextHighestDepth());
addText(removeTxtClip, "removeTxt" + equipment.NAME, 460, (num * 29) + 71, 100, 20, "Remove", 10, 6050119, false);
removeTxtClip.equip = equipment;
removeTxtClip.tfield = removeTxtClip["removeTxt" + equipment.NAME];
removeTxtClip.TYPE = num + 1;
removeTxtClip.charNum = charNum;
removeTxtClip.char = char;
trace("CHAR NUM: " + charNum);
removeTxtClip.onRollOver = function () {
this.tfield.textColor = 0;
};
removeTxtClip.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
removeTxtClip.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
equipmentType = this.equip;
a = 0;
while (a < equipmentType.ATT.length) {
this.char[equipmentType.ATT[a][0]] = this.char[equipmentType.ATT[a][0]] - equipmentType.ATT[a][1];
a++;
}
e = 0;
while (e < _root.equipment.length) {
if (_root.equipment[e].NAME == equipmentType.NAME) {
if (_root.equipment[e].USED == true) {
_root.equipment[e].USED = false;
break;
}
}
e++;
}
switch (this.TYPE) {
case 1 :
_root.defenderArr[this.charNum].WEAPON = null;
break;
case 2 :
_root.defenderArr[this.charNum].ARMOR = null;
break;
case 3 :
_root.defenderArr[this.charNum].ACCESSORY = null;
}
_root.statusShowEquipment(this.charNum);
};
}
function groupEquipment(char, type, charNum) {
statusScreen.statusRight.statusEquipment.equipmentOptions.removeMovieClip();
statusScreen.statusRight.statusEquipment.windowActionsMask.removeMovieClip();
statusScreen.statusRight.statusEquipment.titleTxt.removeMovieClip();
statusScreen.statusRight.statusEquipment.createEmptyMovieClip("equipmentOptions", statusScreen.statusRight.statusEquipment.getNextHighestDepth());
statusScreen.statusRight.statusEquipment.createEmptyMovieClip("titleTxt", statusScreen.statusRight.statusEquipment.getNextHighestDepth());
addText(statusScreen.statusRight.statusEquipment.titleTxt, "catTitle", 50, 207, 250, 20, getEquipmentClassName(type), 16, 0, false);
equipCounter = 0;
e = 0;
while (e < equipment.length) {
if (equipment[e].TYPE == type) {
c = 0;
while (c < equipment[e].classType.length) {
if (equipment[e].classType[c] == char.classType) {
if (equipment[e].USED != true) {
displayEquipment(equipment[e], equipCounter, char, charNum);
equipCounter++;
}
break;
}
c++;
}
}
e++;
}
equipCheckForScroll(equipCounter);
}
function getEquipmentClassName(type) {
switch (type) {
case 1 :
return("WEAPONS");
case 2 :
return("ARMOR");
case 3 :
return("ACCESSORIES");
}
}
function displayEquipment(myEquipment, counter, char, charNum) {
itemNameClip = statusScreen.statusRight.statusEquipment.equipmentOptions.createEmptyMovieClip(myEquipment.NAME + "Clip", statusScreen.statusRight.statusEquipment.equipmentOptions.getNextHighestDepth());
if ((counter % 2) == 0) {
itemIcon = itemNameClip.attachMovie(myEquipment.ICON, myEquipment.ICON, itemNameClip.getNextHighestDepth(), {_x:50, _y:(counter * 15) + 237});
addText(itemNameClip, "titleTxt" + myEquipment.NAME, 80, (counter * 15) + 242, 250, 20, myEquipment.NAME, 12, 6050119, false);
} else {
itemIcon = itemNameClip.attachMovie(myEquipment.ICON, myEquipment.ICON, itemNameClip.getNextHighestDepth(), {_x:300, _y:((counter - 1) * 15) + 237});
addText(itemNameClip, "titleTxt" + myEquipment.NAME, 330, ((counter - 1) * 15) + 242, 250, 20, myEquipment.NAME, 12, 6050119, false);
}
itemNameClip.tfield = itemNameClip["titleTxt" + myEquipment.NAME];
itemNameClip.invItem = myEquipment;
itemNameClip.ICON = itemIcon;
itemNameClip.CHAR = char;
itemNameClip.curCharNum = charNum;
itemNameClip.onRollOver = function () {
this.tfield.textColor = 0;
if (this.invItem.ATT == null) {
statusEquipmentDescMC = statusScreen.statusRight.statusEquipment.attachMovie("statusEquipmentDescMC", "statusEquipmentDescMC", statusScreen.statusRight.statusEquipment.getNextHighestDepth(), {_x:40, _y:400});
_root.addText(statusEquipmentDescMC, "descTXT", 0, 20, 440, 60, this.invItem.DESC, 12, 6050119);
} else {
showEquipmentIncrease(this.invItem, this.CHAR);
}
};
itemNameClip.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
statusScreen.statusRight.statusEquipment.statusEquipmentDescMC.removeMovieClip();
statusScreen.statusRight.statusEquipment.attributeTxt.removeMovieClip();
};
itemNameClip.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
equipChar(this.CHAR, this.invItem.NAME, this.curCharNum);
};
}
function equipChar(char, equipmentName, charNum, initEquip) {
e = 0;
while (e < equipment.length) {
if (equipment[e].NAME == equipmentName) {
switch (equipment[e].TYPE) {
case 1 :
increaseEquipmentAttributes(char, char.WEAPON, equipment[e]);
break;
case 2 :
increaseEquipmentAttributes(char, char.ARMOR, equipment[e]);
break;
case 3 :
increaseEquipmentAttributes(char, char.ACCESSORY, equipment[e]);
}
if (initEquip != true) {
statusShowEquipment(charNum);
}
break;
}
e++;
}
}
function increaseEquipmentAttributes(char, equipmentType, equipmentAdding) {
if (equipmentType != null) {
a = 0;
while (a < equipmentType.ATT.length) {
char[equipmentType.ATT[a][0]] = char[equipmentType.ATT[a][0]] - equipmentType.ATT[a][1];
a++;
}
e = 0;
while (e < equipment.length) {
if (equipment[e].NAME == equipmentType.NAME) {
if (equipment[e].USED == true) {
equipment[e].USED = false;
break;
}
}
e++;
}
}
a = 0;
while (a < equipmentAdding.ATT.length) {
char[equipmentAdding.ATT[a][0]] = char[equipmentAdding.ATT[a][0]] + equipmentAdding.ATT[a][1];
a++;
}
switch (equipmentAdding.TYPE) {
case 1 :
char.WEAPON = equipmentAdding;
break;
case 2 :
char.ARMOR = equipmentAdding;
break;
case 3 :
char.ACCESSORY = equipmentAdding;
}
e = 0;
while (e < equipment.length) {
if (equipment[e].NAME == equipmentAdding.NAME) {
if (equipment[e].USED != true) {
equipment[e].USED = true;
break;
}
}
e++;
}
}
function checkEquipmentExists(itemName) {
i = 0;
while (i < equipment.length) {
if (equipment[i].NAME == itemName) {
equipment[i].QTY++;
return(true);
}
i++;
}
return(false);
}
function removeEquipmentQTY(item) {
i = 0;
while (i < equipment.length) {
if (equipment[i].NAME == item.NAME) {
equipment.splice(i, 1);
break;
}
i++;
}
}
function dropEquipment(item) {
item.QTY--;
if (item.QTY <= 0) {
i = 0;
while (i < equipment.length) {
if ((equipment[i].NAME == item.NAME) && (equipment[i].USED != true)) {
equipment.splice(i, 1);
break;
}
i++;
}
}
statusShowItems();
}
function showEquipmentIncrease(item, char) {
statusScreen.statusRight.statusEquipment.attributeTxt.removeMovieClip();
txtHolder = statusScreen.statusRight.statusEquipment.createEmptyMovieClip("attributeTxt", statusScreen.statusRight.statusEquipment.getNextHighestDepth());
attArr = [["STR", 170, 413], ["DEF", 328, 413], ["LCK", 170, 441], ["MAG", 475, 413], ["SPD", 328, 441], ["range", 475, 441]];
a = 0;
while (a < attArr.length) {
STRDiff = compareAttributes(attArr[a][0], item, char);
addText(txtHolder, "STRtxt", attArr[a][1], attArr[a][2], 120, 20, STRDiff[0], 12, STRDiff[1], false);
a++;
}
}
function getEquipmentType(char, item) {
switch (item.TYPE) {
case 1 :
return(char.WEAPON);
case 2 :
return(char.ARMOR);
case 3 :
return(char.ACCESSORY);
}
}
function compareAttributes(charAtt, item, char) {
attNum = null;
i = 0;
while (i < item.ATT.length) {
if (item.ATT[i][0] == charAtt) {
attNum = i;
newItemStat = item.ATT[i][1];
break;
}
i++;
}
diffReturn = new Array();
if (attNum == null) {
charEquipArr = getEquipmentType(char, item).ATT;
curItemStat = null;
i = 0;
while (i < charEquipArr.length) {
if (charEquipArr[i][0] == charAtt) {
curItemStat = charEquipArr[i][1];
break;
}
i++;
}
if (curItemStat == null) {
diffReturn.push("");
diffReturn.push("0x930000");
return(diffReturn);
}
diffReturn.push("-" + curItemStat);
diffReturn.push("0x930000");
return(diffReturn);
}
charEquipArr = getEquipmentType(char, item).ATT;
curItemStat = null;
i = 0;
while (i < charEquipArr.length) {
if (charEquipArr[i][0] == charAtt) {
curItemStat = charEquipArr[i][1];
break;
}
i++;
}
if (curItemStat == null) {
diffReturn.push("+" + newItemStat);
diffReturn.push("0x0078ff");
return(diffReturn);
}
diff = newItemStat - curItemStat;
if (diff < 0) {
diffReturn.push(diff);
diffReturn.push("0x930000");
return(diffReturn);
}
diffReturn.push("+" + diff);
diffReturn.push("0x0078ff");
return(diffReturn);
}
function equipCheckForScroll(counter) {
if (counter > 8) {
maskMC = statusScreen.statusRight.statusEquipment.attachMovie("windowActionsMask", "windowActionsMask", statusScreen.statusRight.statusEquipment.getNextHighestDepth(), {_x:265, _y:300});
maskMC._width = 480;
maskMC._height = 120;
statusScreen.statusRight.statusEquipment.equipmentOptions.setMask(maskMC);
var _local4 = statusScreen.statusRight.statusEquipment.titleTxt.attachMovie("menuArrow", "downArrow", statusScreen.statusRight.statusEquipment.titleTxt.getNextHighestDepth(), {_x:250, _y:355});
var _local3 = statusScreen.statusRight.statusEquipment.titleTxt.attachMovie("menuArrow", "upArrow", statusScreen.statusRight.statusEquipment.titleTxt.getNextHighestDepth(), {_x:250, _y:220});
_local3._visible = false;
_local4._yscale = -100;
_root.scrollNum = 0;
_root.arrSize = counter + 1;
_local4.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (_root.scrollNum < (_root.arrSize - 7)) {
_root.statusScreen.statusRight.statusEquipment.equipmentOptions._y = _root.statusScreen.statusRight.statusEquipment.equipmentOptions._y - 30;
_root.scrollNum++;
_root.equipCheckScrollArrows();
}
};
_local4.onRollOver = function () {
this.gotoAndStop(2);
};
_local4.onRollOut = function () {
this.gotoAndStop(1);
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if ((_root.scrollNum + _root.arrSize) > _root.arrSize) {
_root.statusScreen.statusRight.statusEquipment.equipmentOptions._y = _root.statusScreen.statusRight.statusEquipment.equipmentOptions._y + 30;
_root.scrollNum--;
_root.equipCheckScrollArrows();
}
};
_local3.onRollOver = function () {
this.gotoAndStop(2);
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
};
}
}
function equipCheckScrollArrows() {
tempScrollNum = Math.floor(_root.arrSize / 2) * 2;
if ((_root.scrollNum + 9) == tempScrollNum) {
_root.statusScreen.statusRight.statusEquipment.titleTxt.downArrow._visible = false;
} else {
_root.statusScreen.statusRight.statusEquipment.titleTxt.downArrow._visible = true;
}
if ((_root.scrollNum + 8) == 8) {
_root.statusScreen.statusRight.statusEquipment.titleTxt.upArrow._visible = false;
} else {
_root.statusScreen.statusRight.statusEquipment.titleTxt.upArrow._visible = true;
}
}
function addTreasure(type) {
switch (type) {
case 1 :
if (checkTreasureExists(type) == false) {
item = new Object();
item.TYPE = type;
item.NAME = "Easy Treasure";
item.MIN = 0;
item.ICON = "iconTreasure";
item.LOOT = treasureEasy;
item.QTY = 1;
treasures.push(item);
}
break;
case 2 :
if (checkTreasureExists(type) == false) {
item = new Object();
item.TYPE = type;
item.NAME = "Medium Treasure";
item.MIN = 10;
item.ICON = "iconTreasure";
item.LOOT = treasureMedium;
item.QTY = 1;
treasures.push(item);
}
break;
case 3 :
if (checkTreasureExists(type) == false) {
item = new Object();
item.TYPE = type;
item.NAME = "Hard Treasure";
item.MIN = 25;
item.ICON = "iconTreasure";
item.LOOT = treasureHard;
item.QTY = 1;
treasures.push(item);
}
break;
case 4 :
if (checkTreasureExists(type) != false) {
break;
}
item = new Object();
item.TYPE = type;
item.NAME = "Very Hard Treasure";
item.MIN = 50;
item.ICON = "iconTreasure";
item.LOOT = treasureVeryHard;
item.QTY = 1;
treasures.push(item);
}
}
function checkTreasureExists(type) {
i = 0;
while (i < treasures.length) {
if (treasures[i].TYPE == type) {
treasures[i].QTY++;
return(true);
}
i++;
}
return(false);
}
function statusShowTreasures() {
curItem = null;
statusScreen.statusRight.removeMovieClip();
statusScreen.alert.removeMovieClip();
var _local9 = statusScreen.createEmptyMovieClip("statusRight", statusScreen.getNextHighestDepth());
_local9._x = 230;
var _local3 = statusScreen.statusRight.attachMovie("statusTreasures", "statusTreasures", statusScreen.statusRight.getNextHighestDepth(), {_x:16, _y:20});
i = 0;
while (i < treasures.length) {
itemNameClip = _local3.createEmptyMovieClip("itemNameClip" + i, _local3.getNextHighestDepth());
itemIcon = itemNameClip.attachMovie(treasures[i].ICON, treasures[i].ICON, itemNameClip.getNextHighestDepth(), {_x:40, _y:(i * 30) + 60});
addText(itemNameClip, "titleTxt" + treasures[i].NAME, 100, (i * 30) + 65, 150, 20, treasures[i].NAME, 12, 6050119, false);
itemQtyClip = _local3.createEmptyMovieClip("itemQtyClip" + i, _local3.getNextHighestDepth());
addText(itemQtyClip, "itemQTY" + treasures[i].NAME, 75, (i * 30) + 65, 35, 20, treasures[i].QTY + " x", 12, 0, false);
itemNameClip.tfield = itemNameClip["titleTxt" + treasures[i].NAME];
itemNameClip.infoBox = _local3.itemInfo;
itemNameClip.treasure = treasures[i];
itemNameClip.ICON = itemIcon;
itemNameClip.onRollOver = function () {
this.tfield.textColor = 0;
this.infoBox.text = this.invItem.DESC;
var _local2 = {r:255, g:255, b:255};
this.ICON.fluxTint(_local2, 0, 70, 10, true);
};
itemNameClip.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
this.infoBox.text = "";
var _local2 = {r:255, g:255, b:255};
this.ICON.fluxTint(_local2, 60, 0, 20, false);
};
itemNameClip.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
this.ICON.fluxTint(colObj, 60, 0, 20, false);
if (_root.lockpicking >= this.treasure.MIN) {
if (checkLockpickInventory() == true) {
_root.showTreasureAlert(this.treasure);
} else {
_root.showTreasureNoLockpicksAlert();
}
} else {
_root.showTreasureLevelAlert(this.treasure.MIN);
}
};
i++;
}
}
function showTreasureAlert(treasure) {
_root.statusScreen.createEmptyMovieClip("alert", _root.statusScreen.getNextHighestDepth());
box = _root.statusScreen.alert.createEmptyMovieClip("box", 1);
box.beginFill(0);
box.lineTo(0, 600);
box.lineTo(800, 600);
box.lineTo(800, 0);
box.lineTo(0, 0);
box._alpha = 50;
box.onRollOver = function () {
this.useHandCursor = false;
};
alertMC = _root.statusScreen.alert.attachMovie("statusItemAlert", "statusItemAlert", _root.statusScreen.alert.getNextHighestDepth(), {_x:300, _y:165});
useButtonMC = alertMC.createEmptyMovieClip("useButtonMC", alertMC.getNextHighestDepth());
addText(useButtonMC, "tfield", 5, 50, 190, 20, "Unlock", 16, 6050119);
useButtonMC.treasure = treasure;
useButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
useButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
useButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.showLockPicksAlert(this.treasure.TYPE);
};
cancelButtonMC = alertMC.createEmptyMovieClip("cancelButtonMC", alertMC.getNextHighestDepth());
addText(cancelButtonMC, "tfield", 5, 85, 190, 20, "Cancel", 16, 6050119);
cancelButtonMC.invItem = item;
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.statusScreen.alert.removeMovieClip();
statusShowTreasures();
};
}
function showLockPicksAlert(treasureDifficulty) {
_root.statusScreen.alert.removeMovieClip();
_root.statusScreen.createEmptyMovieClip("alert", _root.statusScreen.getNextHighestDepth());
box = _root.statusScreen.alert.createEmptyMovieClip("box", 1);
box.beginFill(0);
box.lineTo(0, 600);
box.lineTo(800, 600);
box.lineTo(800, 0);
box.lineTo(0, 0);
box._alpha = 50;
box.onRollOver = function () {
this.useHandCursor = false;
};
treasureInfo = _root.statusScreen.alert.attachMovie("textBox1MC", "treasureInfo", _root.statusScreen.alert.getNextHighestDepth(), {_x:160, _y:175});
_root.addText(treasureInfo, "titleTxt", 0, 40, 475, 50, "Select a Lockpick to use", 16, 0);
i = 0;
while (i < inventory.length) {
if (inventory[i].NAME == "Rusty Lockpick") {
LP1 = inventory[i];
} else if (inventory[i].NAME == "Iron Lockpick") {
LP2 = inventory[i];
} else if (inventory[i].NAME == "Ultra Lockpick") {
LP3 = inventory[i];
}
i++;
}
if ((LP1 == undefined) || (LP1.QTY == 0)) {
LP1 = new Object();
LP1.ICON = "iconRustyLockpick";
LP1.NAME = "Rusty Lockpick";
LP1.QTY = 0;
}
if ((LP2 == undefined) || (LP2.QTY == 0)) {
LP2 = new Object();
LP2.ICON = "iconIronLockpick";
LP2.NAME = "Iron Lockpick";
LP2.QTY = 0;
}
if ((LP3 == undefined) || (LP3.QTY == 0)) {
LP3 = new Object();
LP3.ICON = "iconUltraLockpick";
LP3.NAME = "Ultra Lockpick";
LP3.QTY = 0;
}
l = 1;
while (l < 4) {
LPMC = this["LP" + l];
itemNameClip = treasureInfo.createEmptyMovieClip("itemNameClip" + l, treasureInfo.getNextHighestDepth());
itemIcon = itemNameClip.attachMovie(LPMC.ICON, LPMC.ICON, itemNameClip.getNextHighestDepth(), {_x:((l - 1) * 140) + 85, _y:80});
addText(itemNameClip, "titleTxt" + LPMC.NAME, ((l - 1) * 140) + 60, 120, 150, 20, LPMC.NAME, 11, 6050119, false);
itemQtyClip = treasureInfo.createEmptyMovieClip("itemQtyClip1", treasureInfo.getNextHighestDepth());
addText(itemQtyClip, "itemQTY" + LPMC.NAME, ((l - 1) * 140) + 40, 120, 35, 20, LPMC.QTY + " x", 11, 0, false);
if (LPMC.QTY > 0) {
itemNameClip.tfield = itemNameClip["titleTxt" + LPMC.NAME];
itemNameClip.Lockpick = LPMC;
itemNameClip.ICON = itemIcon;
itemNameClip.DIFF = treasureDifficulty;
itemNameClip.onRollOver = function () {
this.tfield.textColor = 0;
var _local2 = {r:255, g:255, b:255};
this.ICON.fluxTint(_local2, 0, 70, 10, true);
};
itemNameClip.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
var _local2 = {r:255, g:255, b:255};
this.ICON.fluxTint(_local2, 60, 0, 20, false);
};
itemNameClip.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.initLockpicking(this.DIFF, this.Lockpick);
};
} else {
itemNameClip._alpha = 40;
itemQtyClip._alpha = 40;
}
l++;
}
}
function showTreasureLevelAlert(difficulty) {
_root.statusScreen.createEmptyMovieClip("alert", _root.statusScreen.getNextHighestDepth());
box = _root.statusScreen.alert.createEmptyMovieClip("box", 1);
box.beginFill(0);
box.lineTo(0, 600);
box.lineTo(800, 600);
box.lineTo(800, 0);
box.lineTo(0, 0);
box._alpha = 50;
box.onRollOver = function () {
this.useHandCursor = false;
};
treasureInfo = _root.statusScreen.alert.attachMovie("textBox1MC", "treasureInfo", _root.statusScreen.alert.getNextHighestDepth(), {_x:160, _y:175});
_root.addText(treasureInfo, "titleTxt", 0, 50, 475, 50, "You must have a Lock Picking skill of", 14, 6050119);
_root.addText(treasureInfo, "infoTxt", 0, 75, 475, 50, ("at least " + difficulty) + " to pick this treasure", 14, 6050119);
cancelButtonMC = treasureInfo.createEmptyMovieClip("cancelButtonMC", treasureInfo.getNextHighestDepth());
addText(cancelButtonMC, "tfield", 140, 120, 190, 20, "Close", 16, 6050119);
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
statusShowTreasures();
};
}
function showTreasureNoLockpicksAlert() {
_root.statusScreen.createEmptyMovieClip("alert", _root.statusScreen.getNextHighestDepth());
box = _root.statusScreen.alert.createEmptyMovieClip("box", 1);
box.beginFill(0);
box.lineTo(0, 600);
box.lineTo(800, 600);
box.lineTo(800, 0);
box.lineTo(0, 0);
box._alpha = 50;
box.onRollOver = function () {
this.useHandCursor = false;
};
treasureInfo = _root.statusScreen.alert.attachMovie("textBox1MC", "treasureInfo", _root.statusScreen.alert.getNextHighestDepth(), {_x:160, _y:175});
_root.addText(treasureInfo, "titleTxt", 0, 50, 475, 50, "You must have at least one Lock Pick in", 14, 6050119);
_root.addText(treasureInfo, "infoTxt", 0, 75, 475, 50, "your inventory to attempt this treasure.", 14, 6050119);
cancelButtonMC = treasureInfo.createEmptyMovieClip("cancelButtonMC", treasureInfo.getNextHighestDepth());
addText(cancelButtonMC, "tfield", 140, 120, 190, 20, "Close", 16, 6050119);
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
statusShowTreasures();
};
}
function checkLockpickInventory() {
i = 0;
while (i < inventory.length) {
if (inventory[i].NAME == "Rusty Lockpick") {
return(true);
}
if (inventory[i].NAME == "Iron Lockpick") {
return(true);
}
if (inventory[i].NAME == "Ultra Lockpick") {
return(true);
}
i++;
}
return(false);
}
function removeTreasure(difficulty) {
i = 0;
while (i < treasures.length) {
if (treasures[i].TYPE == difficulty) {
treasures[i].QTY--;
if (treasures[i].QTY <= 0) {
treasures.splice(i, 1);
}
break;
}
i++;
}
}
function showLockpickLvlAlert() {
_root.statusScreen.createEmptyMovieClip("alert", _root.statusScreen.getNextHighestDepth());
box = _root.statusScreen.alert.createEmptyMovieClip("box", 1);
box.beginFill(0);
box.lineTo(0, 600);
box.lineTo(800, 600);
box.lineTo(800, 0);
box.lineTo(0, 0);
box._alpha = 50;
box.onRollOver = function () {
this.useHandCursor = false;
};
treasureInfo = _root.statusScreen.alert.attachMovie("textBox1MC", "treasureInfo", _root.statusScreen.alert.getNextHighestDepth(), {_x:160, _y:175});
_root.addText(treasureInfo, "titleTxt", 0, 45, 475, 50, "Congratulations!", 24, 0);
_root.addText(treasureInfo, "infoTxt", 0, 80, 475, 50, "Your Lock Picking skill has increased to level " + _root.lockpicking, 14, 6050119);
cancelButtonMC = treasureInfo.createEmptyMovieClip("cancelButtonMC", treasureInfo.getNextHighestDepth());
addText(cancelButtonMC, "tfield", 140, 120, 190, 20, "Close", 16, 6050119);
cancelButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
cancelButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
cancelButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
statusShowTreasures();
};
}
function showFoundTreasureAlert(treasureDifficulty) {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
treasureAlert = _root.interfaceMC.createEmptyMovieClip("treasureAlert", _root.interfaceMC.getNextHighestDepth());
box = treasureAlert.createEmptyMovieClip("box", 1);
box.beginFill(0);
box.lineTo(0, 600);
box.lineTo(800, 600);
box.lineTo(800, 0);
box.lineTo(0, 0);
box._alpha = 50;
box.onRollOver = function () {
this.useHandCursor = false;
};
switch (treasureDifficulty) {
case 1 :
treasureTypeTxt = "Easy Treasure Chest";
break;
case 2 :
treasureTypeTxt = "Medium Treasure Chest";
break;
case 3 :
treasureTypeTxt = "Hard Treasure Chest";
break;
case 4 :
treasureTypeTxt = "Very Hard Treasure Chest";
}
treasureInfo = treasureAlert.attachMovie("textBox2MC", "textBoxMC", treasureAlert.getNextHighestDepth(), {_x:297, _y:197});
addText(treasureInfo, "titleTxt" + _root.grandpaCount, 5, 45, 230, 50, "Item Aquired", 18, 0);
addText(treasureInfo, "titleTxt2" + _root.grandpaCount, 5, 130, 230, 80, treasureTypeTxt, 12, 6050119);
var _local4 = treasureInfo.attachMovie("iconTreasure", "iconTreasure", treasureInfo.getNextHighestDepth(), {_x:105, _y:90});
closeButtonMC = treasureInfo.createEmptyMovieClip("closeButtonMC", treasureInfo.getNextHighestDepth());
addText(closeButtonMC, "tfield", 20, 170, 190, 20, "Close", 12, 6050119);
closeButtonMC.defenderName = defenderName;
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.checkForTutorial("Treasure");
_root.faceDirection(_root.currentTurn);
_root.interfaceMC.treasureAlert.removeMovieClip();
};
var _local3 = new mx.transitions.Tween(treasureInfo, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 0.75, true);
}
function checkLockpickingLevelUp(difficulty) {
prevLockpicking = lockpicking;
switch (difficulty) {
case 1 :
if (lockpicking < 10) {
lockpicking++;
} else if ((lockpicking >= 10) && (lockpicking < 25)) {
lockpicking = lockpicking + 0.5;
} else {
lockpicking = lockpicking + 0.25;
}
break;
case 2 :
if (lockpicking < 25) {
lockpicking++;
} else if ((lockpicking >= 25) && (lockpicking < 50)) {
lockpicking = lockpicking + 0.5;
} else {
lockpicking = lockpicking + 0.25;
}
break;
case 3 :
if (lockpicking < 50) {
lockpicking++;
} else if (lockpicking >= 50) {
lockpicking = lockpicking + 0.5;
}
break;
case 4 :
if (lockpicking < 100) {
lockpicking++;
} else {
if (lockpicking < 100) {
break;
}
lockpicking = lockpicking + 0.5;
}
}
if (Math.floor(prevLockpicking) < Math.floor(lockpicking)) {
_root.showLockpickLvlAlert();
}
}
function getTreasureLoot(difficulty) {
t = 0;
while (t < treasures.length) {
if (treasures[t].TYPE == difficulty) {
lootArr = treasures[t].LOOT;
break;
}
t++;
}
randLootNum = Math.floor(Math.random() * 100);
l = 0;
while (l < lootArr.length) {
thisLoot = lootArr[l];
if (randLootNum <= thisLoot[1]) {
if (thisLoot[0] == "Gold") {
_root.gold = _root.gold + thisLoot[2];
} else {
assignItem(thisLoot[0]);
}
return([thisLoot[0], thisLoot[2]]);
}
l++;
}
}
function rollTreasure() {
if (enemiesKilledCount == 1) {
return(true);
}
randRoll = Math.floor(Math.random() * 100);
if (randRoll <= checkForThiefGloves()) {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
return(true);
}
return(false);
}
function checkForThiefGloves() {
d = 0;
while (d < defenderLevelArr.length) {
if (defenderLevelArr[d].ACCESSORY.NAME == "Thief Gloves") {
return(50);
}
d++;
}
return(20);
}
function formatTime() {
mins = Math.floor(timePlayed / 60);
if (mins < 10) {
mins = "0" + mins;
}
hours = timePlayed - (mins * 60);
if (hours < 10) {
hours = "0" + hours;
}
return((mins + ":") + hours);
}
function showStatus() {
screenMoverMC._visible = false;
this.createEmptyMovieClip("statusScreen", 98);
statusBG = statusScreen.attachMovie("statusBG", "statusBG", _root.statusScreen.getNextHighestDepth());
statusBG.onRollOver = function () {
this.useHandCursor = false;
};
statusBG.timeTxt.text = formatTime();
statusBG.coinsTxt.text = gold;
statusLeftNav();
if (inBattle == true) {
statusCharacter(_root.currentTurn.num);
} else {
statusShowChars();
}
}
function statusShowChars(item) {
statusScreen.cancelBut.removeMovieClip();
statusScreen.statusRight.removeMovieClip();
var _local6 = statusScreen.createEmptyMovieClip("statusRight", statusScreen.getNextHighestDepth());
_local6._x = 230;
var _local12 = statusScreen.attachMovie("statusCharsBG", "statusCharsBG", statusScreen.getNextHighestDepth(), {_x:230, _y:0});
c = 0;
while (c < defenderArr.length) {
charStat = _local6.attachMovie("statusCharStats", defenderArr[c].name + "Stats", _local6.getNextHighestDepth(), {_x:10, _y:(c * 118) + 3});
var _local3 = charStat.attachMovie("defenders", "defender_" + defenderArr[c].name, charStat.getNextHighestDepth(), {_x:65, _y:90});
_local3.gotoAndStop(defenderArr[c].name);
_local3._xscale = _local3._xscale * 1.15;
_local3._yscale = _local3._yscale * 1.15;
_local3.gotoAndStop(defenderArr[c].classType);
checkStatusAilments(defenderArr[c], _local3);
charStat.num = c;
charStat.char = defenderArr[c];
charStat.charName.text = defenderArr[c].name;
charStat.charClass.text = defenderArr[c].classType;
charStat.charLevel.text = "level " + defenderArr[c].lvl;
charStat.HPTxt.text = (checkZero(defenderArr[c].HP) + "/") + checkZero(defenderArr[c].HPMax);
charStat.MPTxt.text = (checkZero(defenderArr[c].MP) + "/") + checkZero(defenderArr[c].MPMax);
charStat.EXPTxt.text = (checkZero(defenderArr[c].EXP) + "/") + checkZero(expList(defenderArr[c].lvl));
charStat.HPMask._x = 144 + Math.ceil(146 * (defenderArr[c].HP / defenderArr[c].HPMax));
charStat.MPMask._x = 144 + Math.ceil(146 * (defenderArr[c].MP / defenderArr[c].MPMax));
charStat.EXPMask._x = 144 + Math.ceil(146 * (defenderArr[c].EXP / expList(defenderArr[c].lvl)));
if (defenderArr[c].HP == 0) {
charStat.attachMovie("iconDeath", "iconDeath", charStat.getNextHighestDepth(), {_x:90, _y:40});
var _local5 = {r:255, g:0, b:0};
charStat.fluxTint(_local5, 0, 50, 50, false);
charStat.HPMask._x = 0;
}
if (item == undefined) {
charStat.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
statusCharacter(this.num);
};
} else {
charStat.invItem = item;
if (item.NAME == "Resurrection") {
if (defenderArr[c].HP <= 0) {
charStat.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.getItemFunc(this.invItem, this.char);
};
}
} else if (defenderArr[c].HP > 0) {
charStat.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.getItemFunc(this.invItem, this.char);
};
}
}
if (item.NAME == "Resurrection") {
if (defenderArr[c].HP <= 0) {
if ((defenderArr[c].HP > 0) || (item.NAME == "Resurrection")) {
charStat.onRollOver = function () {
var _local2 = {r:255, g:255, b:255};
this.boxMC.fluxTint(_local2, 0, 80, 10, false);
};
charStat.onRollOut = function () {
var _local2 = {r:255, g:255, b:255};
this.boxMC.fluxTint(_local2, 80, 0, 10, false);
};
}
}
} else if ((defenderArr[c].HP > 0) || (item.NAME == "Resurrection")) {
charStat.onRollOver = function () {
var _local2 = {r:255, g:255, b:255};
this.boxMC.fluxTint(_local2, 0, 80, 10, false);
};
charStat.onRollOut = function () {
var _local2 = {r:255, g:255, b:255};
this.boxMC.fluxTint(_local2, 80, 0, 10, false);
};
}
c++;
}
if (item != undefined) {
disableLeftNav();
}
}
function statusLeftNav() {
_root.statusScreen.leftNav.removeMovieClip();
leftNav = _root.statusScreen.createEmptyMovieClip("leftNav", _root.statusScreen.getNextHighestDepth());
if (inBattle == true) {
leftNavArr = [["menuStats", statusCharacter], ["menuEquipment", statusShowEquipment], ["menuSound", setSound], ["menuExit", exitStatus]];
} else {
leftNavArr = [["menuStats", statusShowChars], ["menuItems", statusShowItems], ["menuEquipment", statusShowEquipment], ["menuTreasures", statusShowTreasures], ["menuSound", setSound], ["menuExit", exitStatus]];
}
l = 0;
while (l < leftNavArr.length) {
navButt = leftNav.attachMovie(leftNavArr[l][0], leftNavArr[l][0], leftNav.getNextHighestDepth(), {_x:35, _y:(l * 55) + 40});
if (leftNavArr[l][0] == "menuSound") {
if (soundOn == false) {
navButt.attachMovie("iconDisabled", "disabled", navButt.getNextHighestDepth(), {_x:130, _y:10});
}
}
navButt.NAME = leftNavArr[l][0];
navButt.FUNC = new Function(leftNavArr[l][1]);
navButt.onRollOver = function () {
this.gotoAndStop(2);
};
navButt.onRollOut = function () {
this.gotoAndStop(1);
};
navButt.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if ((this.NAME == "menuEquipment") && (_root.inBattle == true)) {
this.FUNC(_root.currentTurn.num);
} else {
this.FUNC();
}
};
l++;
}
}
function disableLeftNav() {
cancelBut = _root.statusScreen.createEmptyMovieClip("cancelBut", _root.statusScreen.getNextHighestDepth());
addText(cancelBut, "titleTxt", 80, 450, 300, 20, "CANCEL", 16, 268435447, false);
cancelBut.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.enableLeftNav();
_root.statusShowChars();
};
_root.statusScreen.leftNav._alpha = 30;
_root.statusScreen.leftNav.onRollOver = function () {
this.useHandCursor = false;
};
}
function enableLeftNav() {
_root.statusScreen.leftNav._alpha = 100;
delete _root.statusScreen.leftNav.onRollOver;
}
function statusCharacter(charNum) {
if (charNum == undefined) {
charNum = 0;
}
if (inBattle == true) {
charNum = _root.currentTurn.num;
}
statusScreen.statusRight.removeMovieClip();
var _local5 = statusScreen.createEmptyMovieClip("statusRight", statusScreen.getNextHighestDepth());
_local5._x = 230;
var _local3 = statusScreen.statusRight.attachMovie("statusStatsMain", "statusStatsMain", statusScreen.statusRight.getNextHighestDepth(), {_x:16, _y:20});
if ((defenderArr.length > 1) && (inBattle != true)) {
statusAddNextCharacterButton("stats", charNum, _local3);
}
var _local4 = _local3.attachMovie("defenders", "defender_" + defenderArr[charNum].name, _local3.getNextHighestDepth(), {_x:95, _y:110});
_local4.gotoAndStop(defenderArr[charNum].name);
_local4._xscale = _local4._xscale * 1.15;
_local4._yscale = _local4._yscale * 1.15;
checkStatusAilments(defenderArr[charNum], _local4);
_local3.charName.text = defenderArr[charNum].name;
_local3.charClass.text = defenderArr[charNum].classType;
_local3.charLvl.text = defenderArr[charNum].lvl;
_local3.HPTxt.text = (checkZero(defenderArr[charNum].HP) + "/") + checkZero(defenderArr[charNum].HPMax);
_local3.MPTxt.text = (checkZero(defenderArr[charNum].MP) + "/") + checkZero(defenderArr[charNum].MPMax);
_local3.charEXP.text = defenderArr[charNum].EXP;
_local3.charEXPNext.text = expList(defenderArr[charNum].lvl);
_local3.charSTR.text = defenderArr[charNum].STR;
_local3.charDEF.text = defenderArr[charNum].DEF;
_local3.charLCK.text = defenderArr[charNum].LCK;
_local3.charSPD.text = defenderArr[charNum].SPD;
_local3.charMAG.text = defenderArr[charNum].MAG;
_local3.charRange.text = defenderArr[charNum].range;
_local3.charLockpicking.text = Math.floor(lockpicking);
_local3.HPMask._x = 30 + Math.ceil(194 * (defenderArr[charNum].HP / defenderArr[charNum].HPMax));
_local3.MPMask._x = 30 + Math.ceil(194 * (defenderArr[charNum].MP / defenderArr[charNum].MPMax));
if (defenderArr[charNum].HP == 0) {
_local3.attachMovie("iconDeath", "iconDeath", _local3.getNextHighestDepth(), {_x:18, _y:28});
_local3.HPMask._x = 0;
var _local6 = {r:255, g:0, b:0};
_local5.fluxTint(_local6, 0, 50, 10, false);
}
}
function statusAddNextCharacterButton(currentScreen, charNum, MC) {
statusNextCharButton = MC.attachMovie("statusNextCharButton", "statusNextCharButton", MC.getNextHighestDepth());
statusNextCharButton._x = 370;
statusNextCharButton._y = 27;
if ((charNum + 2) > defenderArr.length) {
charNum = -1;
}
statusNextCharButton.NUM = charNum;
statusNextCharButton.currentScreen = currentScreen;
statusNextCharButton.onRollOver = function () {
this.tfield.textColor = 0;
};
statusNextCharButton.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
statusNextCharButton.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (this.currentScreen == "equipment") {
statusShowEquipment(this.NUM + 1);
} else if (this.currentScreen == "stats") {
statusCharacter(this.NUM + 1);
}
};
}
function checkStatusAilments(char, charMC) {
a = 0;
while (a < char.ailments.length) {
if (char.ailments[a] == "poison") {
var _local1 = {r:31, g:211, b:0};
charMC.fluxTint(_local1, 0, 60, 5, true);
}
a++;
}
}
function setSound() {
if (soundOn == true) {
soundOn = false;
_root.levelMusic.stop();
_root.worldMapMusic.stop();
} else {
soundOn = true;
if (inBattle == true) {
_root.levelMusic.start(0, 999);
} else {
_root.worldMapMusic.start(0, 999);
}
}
statusLeftNav();
}
function exitStatus() {
screenMoverMC._visible = true;
statusScreen.removeMovieClip();
}
function ailmentPoison(char) {
if (_root.soundOn == true) {
_root.damageSnd.start();
}
poisonDMG = 5;
char.HP = char.HP - poisonDMG;
updateCharacterInfo(char, _root.charStats.charInfo);
var _local5 = {r:255, g:255, b:255};
_root.charStats.charInfo.meterHP.fluxTint(_local5, 0, 100, 35, true, 1);
_local5 = {r:255, g:0, b:0};
char.MC.fluxTint(_local5, 0, 70, 15, true, 1);
shakeCount = 0;
var _local4 = new mx.transitions.Tween(_root.display.tiles, "_x", mx.transitions.easing.Bounce.easeIn, _root.display.tiles._x, _root.display.tiles._x + 7, 0.05, true);
_local4.onMotionFinished = function () {
shakeCount++;
if (shakeCount < 5) {
this.yoyo();
}
};
poisonDamageTxt("-" + poisonDMG, char);
}
function poisonDamageTxt(damage, char) {
damageArr = damage.toString().split("");
_root.display.tiles.createEmptyMovieClip("damageTxt", _root.display.tiles.getNextHighestDepth());
wordWidth = 0;
d = 0;
while (d < damageArr.length) {
var _local2 = _root.display.tiles.damageTxt.attachMovie("damageTxt", "damageTxt" + d, _root.display.tiles.damageTxt.getNextHighestDepth(), {_x:(wordWidth + char.MC._x) - (damageArr.length * 7), _y:(char.MC._y - char.MC._height) + 5});
_local2._width = _local2._width * 1.6;
_local2._height = _local2._height * 1.6;
_local2.gotoAndStop(5);
_local2.num = d + 1;
_local2.txt.text = damageArr[d];
_local2.txt.autoSize = true;
wordWidth = wordWidth + (_local2.txt._width + 2);
setTimeout(animatePoisonDamage, d * 100, _local2, char);
d++;
}
}
function animatePoisonDamage(txt, char) {
dmgTxtTween = new mx.transitions.Tween(txt, "_y", mx.transitions.easing.Elastic.easeOut, txt._y, txt._y - 15, 1.5, true);
if (txt.num == damageArr.length) {
dmgTxtTween.onMotionFinished = function () {
_root.display.tiles.damageTxt.removeMovieClip();
if (char.HP <= 0) {
trace(char);
var _local2 = {r:0, g:0, b:0};
char.MC.charMC.fluxTint(_local2, 0, 0, 1, false);
targetDeath(char, true);
if (checkLevelComplete() == true) {
levelComplete();
} else {
trace("SOMEONE DIED POISONED");
if ((char.type == "human") && (checkGameOver(char) == true)) {
trace("MAIN CHAR DIED POISONED");
gameOverFunc();
} else {
setTimeout(nextTurn, 250, char);
}
}
} else {
setTimeout(nextTurn, 250, char);
}
};
}
}
function loadWorldMap(num) {
if (_root.soundOn == true) {
_root.levelMusic.stop();
_root.themeMusicSnd.stop();
_root.worldMapMusic.start(0, 999);
}
titleScreen.removeMovieClip();
BG.removeMovieClip();
display.removeMovieClip();
screenMoverMC.removeMovieClip();
charStats.removeMovieClip();
worldMapMC.removeMovieClip();
createEmptyMovieClip("worldMapMC", 1);
worldMapMC.attachMovie("worldMap", "worldMap", 1);
addClouds();
addLava();
addMapMarkers(num);
addMapMenu();
}
function addClouds() {
cloudArr = new Array();
cloudArr = [["cloud1", -150, 0], ["cloud2", 200, 100], ["cloud1", 550, 400], ["cloud2", -450, 430]];
worldMapMC.createEmptyMovieClip("clouds", 2);
c = 0;
while (c < cloudArr.length) {
cloud = worldMapMC.clouds.attachMovie(cloudArr[c][0], "cloud" + c, c, {_x:cloudArr[c][1], _y:cloudArr[c][2]});
cloud._alpha = 65;
cloud.onEnterFrame = function () {
this._x = this._x - 1;
if (this._x <= (-this._width)) {
this._x = 900;
}
};
c++;
}
}
function addLava() {
lavaAlphaTween.stop();
lavaAlphaTween = new mx.transitions.Tween(worldMapMC.worldMap.lavaMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 100, 60, 1.5, true);
lavaAlphaTween.onMotionFinished = function () {
this.yoyo();
};
}
function addMapMarkers(num) {
worldMapMC.createEmptyMovieClip("markers", 3);
mapMarkerArr = new Array();
mapMarkerArr = [[1, 255, 462, "Grandpa's House", 200, 447, 140, 20], [2, 380, 480, "Deep Woods", 340, 500, 110, 20], [1, 475, 435, "Athelas", 445, 455, 70, 20], [2, 575, 445, "Athelas Grove", 550, 465, 70, 30], [2, 385, 410, "Jungle", 345, 395, 110, 20], [1, 270, 255, "Sandos", 245, 270, 70, 20], [2, 247, 300, "Sandos Dunes", 220, 320, 70, 30], [2, 105, 272, "Great Pyramids", 115, 270, 80, 30], [2, 550, 240, "The Oasis", 520, 258, 80, 20], [1, 525, 122, "Damascus", 475, 142, 80, 20], [2, 322, 130, "Damascus Ruins", 300, 148, 80, 30], [2, 390, 100, "Death Rock", 355, 120, 100, 20]];
m = 0;
while (m < (num + 1)) {
marker = worldMapMC.markers.attachMovie("mapMarker" + mapMarkerArr[m][0], "marker" + m, worldMapMC.markers.getNextHighestDepth(), {_x:mapMarkerArr[m][1], _y:mapMarkerArr[m][2]});
marker.num = m;
marker.NAME = mapMarkerArr[m][3];
markerTxtMC = worldMapMC.markers.createEmptyMovieClip("mapClip" + m, worldMapMC.markers.getNextHighestDepth());
addText(markerTxtMC, "markerShadow", mapMarkerArr[m][4] + 1.5, mapMarkerArr[m][5] + 1.5, mapMarkerArr[m][6], mapMarkerArr[m][7], mapMarkerArr[m][3], 13, 0, true);
addText(markerTxtMC, "markerName", mapMarkerArr[m][4], mapMarkerArr[m][5], mapMarkerArr[m][6], mapMarkerArr[m][7], mapMarkerArr[m][3], 13, 16777215, true);
markerTxtMC.markerMC = marker;
markerTxtMC.num = m;
markerTxtMC.NAME = mapMarkerArr[m][3];
markerTxtMC.onRollOver = function () {
this.markerShadow.textColor = 16777215 /* 0xFFFFFF */;
var _local2 = {r:255, g:255, b:255};
this.markerMC.fluxTint(_local2, 0, 50, 20, true);
};
markerTxtMC.onRollOut = function () {
this.markerShadow.textColor = 0;
this.markerMC.fluxTint(colObj, 0, 0, 20, false);
};
markerTxtMC.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.mapAddLevelPopup(this.num, this.NAME);
};
marker.txtBox = markerTxtMC;
marker.onRollOver = function () {
this.txtBox.markerShadow.textColor = 16777215 /* 0xFFFFFF */;
var _local2 = {r:255, g:255, b:255};
this.fluxTint(_local2, 0, 50, 20, true);
};
marker.onRollOut = function () {
this.txtBox.markerShadow.textColor = 0;
this.fluxTint(colObj, 0, 0, 20, false);
};
marker.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.mapAddLevelPopup(this.num, this.NAME);
};
m++;
}
}
function mapAddLevelPopup(num, levelName) {
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
mapLevelInfoMC = _root.worldMapMC.createEmptyMovieClip("mapLevelInfoMC", worldMapMC.getNextHighestDepth());
overlayMC = mapLevelInfoMC.attachMovie("overlayGraphic", "overlayGraphic", 1);
overlayMC.onRollOver = function () {
this.useHandCursor = false;
};
mapInfoMC = mapLevelInfoMC.attachMovie("mapTextbox1", "mapLevelTxtBox", 2, {_x:300, _y:200});
addText(mapInfoMC, "mapInfoTitle", 0, 40, 220, 20, levelName, 16, 0, true);
thisLevelArr = mapGetLevelInfo(levelName);
mapAddSubMenu(thisLevelArr[0], num, levelName, thisLevelArr[1]);
}
function mapGetLevelInfo(levelName) {
switch (levelName) {
case "Grandpa's House" :
if (levelsUnlocked >= 2) {
return([["grandpa", "treasures", "leave"]]);
}
trace("TUT NUM: " + tutorialNum);
if (tutorialNum == 0) {
return([["grandpa", "leave"]]);
}
return([["rest", "grandpa", "treasures", "leave"]]);
case "Deep Woods" :
return([["battle", "leave"]]);
case "Athelas" :
if (defenderArr.length < 2) {
addDefenderAlert("Kage");
assignEquipment("Wood Staff");
assignEquipment("Cloth Robe");
equipChar(defenderArr[1], "Wood Staff", null, true);
equipChar(defenderArr[1], "Cloth Robe", null, true);
unlockMission(missionsArr[1], "Mutant Pond");
unlockMission(missionsArr[1], "The Athelas Leaf");
} else {
if (checkMissionsAvailable(missionsArr[1]) == true) {
return([["inn", "shop", "missions", "mage", "leave"]]);
}
return([["inn", "shop", "mage", "leave"]]);
}
case "Athelas Grove" :
if (levelsUnlocked >= 3) {
m = 0;
while (m < missionsArr[1].length) {
if (((missionsArr[1][m][0] == "The Athelas Leaf") && (missionsArr[1][m][2] == true)) && (curMission == missionsArr[1][m][0])) {
return([["startMission", "leave"], ["The Athelas Leaf"]]);
}
m++;
}
return([["battle", "leave"]]);
}
return([["battle", "leave"]]);
case "Jungle" :
m = 0;
while (m < missionsArr[1].length) {
if (((missionsArr[1][m][0] == "Venom Snakes!") && (missionsArr[1][m][2] == true)) && (curMission == missionsArr[1][m][0])) {
return([["startMission", "leave"], ["Venom Snakes!"]]);
}
m++;
}
return([["battle", "leave"]]);
case "Sandos" :
if (defenderArr.length < 3) {
addDefenderAlert("Aryana");
assignEquipment("Wooden Bow");
assignEquipment("Iron Vest");
equipChar(defenderArr[2], "Wooden Bow", null, true);
equipChar(defenderArr[2], "Iron Vest", null, true);
} else {
if (levelsUnlocked == 5) {
return([["startMission", "leave"], ["The Desert Sting"]]);
}
if (checkMissionsAvailable(missionsArr[2]) == true) {
return([["inn", "shop", "missions", "warrior", "leave"]]);
}
return([["inn", "shop", "warrior", "leave"]]);
}
case "Sandos Dunes" :
m = 0;
while (m < missionsArr[2].length) {
if (((missionsArr[2][m][0] == "Eye Guys") && (missionsArr[2][m][2] == true)) && (curMission == missionsArr[2][m][0])) {
return([["startMission", "leave"], ["Eye Guys"]]);
}
m++;
}
return([["battle", "leave"]]);
case "Great Pyramids" :
m = 0;
while (m < missionsArr[2].length) {
if (((missionsArr[2][m][0] == "Ancient Pyramids") && (missionsArr[2][m][2] == true)) && (curMission == missionsArr[2][m][0])) {
return([["startMission", "leave"], ["Ancient Pyramids"]]);
}
m++;
}
return([["battle", "leave"]]);
case "The Oasis" :
m = 0;
while (m < missionsArr[2].length) {
if (((missionsArr[2][m][0] == "Oasis") && (missionsArr[2][m][2] == true)) && (curMission == missionsArr[2][m][0])) {
return([["startMission", "leave"], ["Oasis"]]);
}
m++;
}
return([["battle", "leave"]]);
case "Damascus" :
if (checkMissionsAvailable(missionsArr[3]) == true) {
return([["inn", "shop", "missions", "thief", "leave"]]);
}
return([["inn", "shop", "thief", "leave"]]);
case "Damascus Ruins" :
m = 0;
while (m < missionsArr[3].length) {
if (((missionsArr[3][m][0] == "Lava Monsters") && (missionsArr[3][m][2] == true)) && (curMission == missionsArr[3][m][0])) {
return([["startMission", "leave"], ["Lava Monsters"]]);
}
if (((missionsArr[3][m][0] == "Ring of Fire") && (missionsArr[3][m][2] == true)) && (curMission == missionsArr[3][m][0])) {
return([["startMission", "leave"], ["Ring of Fire"]]);
}
m++;
}
return([["battle", "leave"]]);
case "Death Rock" :
m = 0;
while (m < missionsArr[3].length) {
if (((missionsArr[3][m][0] == "Death Rock Cave") && (missionsArr[3][m][2] == true)) && (curMission == missionsArr[3][m][0])) {
return([["startMission", "leave"], ["Death Rock Cave"]]);
}
if (((missionsArr[3][m][0] == "Lava River") && (missionsArr[3][m][2] == true)) && (curMission == missionsArr[3][m][0])) {
return([["startMission", "leave"], ["Lava River"]]);
}
if (((missionsArr[3][m][0] == "Cave Ogres") && (missionsArr[3][m][2] == true)) && (curMission == missionsArr[3][m][0])) {
return([["startMission", "leave"], ["Cave Ogres"]]);
}
if (((missionsArr[3][m][0] == "Ogre Lord") && (missionsArr[3][m][2] == true)) && (curMission == missionsArr[3][m][0])) {
return([["startMission", "leave"], ["Ogre Lord"]]);
}
m++;
}
return([["battle", "leave"]]);
}
}
function checkMissionsAvailable(arr) {
missionCount = 0;
m = 0;
while (m < arr.length) {
if (arr[m][2] == true) {
missionCount++;
}
m++;
}
if (missionCount > 0) {
return(true);
}
return(false);
}
function mapAddSubMenu(arr, markerNum, levelName, missionName) {
vSpacer = 28;
if (arr.length == 4) {
vAlign = 72;
} else if (arr.length == 3) {
vAlign = 84;
} else if (arr.length == 2) {
vAlign = 95;
} else if (arr.length == 5) {
vAlign = 68;
vSpacer = 23;
}
s = 0;
while (s < arr.length) {
txtButton = worldMapMC.mapLevelInfoMC.mapLevelTxtBox.createEmptyMovieClip("txtButton" + s, worldMapMC.mapLevelInfoMC.mapLevelTxtBox.getNextHighestDepth());
addText(txtButton, "mapInfoTitle", 0, (s * vSpacer) + vAlign, 220, 20, mapGetSubMenuName(arr[s]), 12, 6444877, true);
txtButton.onRollOver = function () {
this.mapInfoTitle.textColor = 0;
};
txtButton.onRollOut = function () {
this.mapInfoTitle.textColor = 6444877 /* 0x62574D */;
};
txtButton.NAME = arr[s];
txtButton.markerNum = markerNum;
txtButton.levelName = levelName;
txtButton.missionName = missionName;
txtButton.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
mapGetSubMenuFunc(this.NAME, this.markerNum, this.levelName, this.missionName);
};
s++;
}
}
function mapGetSubMenuName(menuName) {
switch (menuName) {
case "rest" :
return("REST");
case "inn" :
return("INN");
case "grandpa" :
return("VISIT GRANDPA");
case "treasures" :
return("ASK ABOUT TREASURES");
case "shop" :
return("SHOP");
case "missions" :
return("MISSIONS");
case "startMission" :
return("START MISSION");
case "battle" :
return("BATTLE");
case "leave" :
return("LEAVE");
case "mage" :
return("MAGE GUILD");
case "warrior" :
return("WARRIOR GUILD");
case "thief" :
return("THIEF GUILD");
}
}
function mapGetSubMenuFunc(menuName, markerNum, levelName, missionName) {
switch (menuName) {
case "grandpa" :
mapGrandpa();
break;
case "rest" :
mapRest();
break;
case "treasures" :
mapGrandpaTreasures();
break;
case "inn" :
mapInn(levelName);
break;
case "battle" :
mapStartBattle(levelName);
break;
case "missions" :
mapMissions(levelName);
break;
case "startMission" :
mapStartBattle(missionName);
break;
case "shop" :
mapShop(levelName);
break;
case "leave" :
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
break;
case "mage" :
mapMageGuild();
break;
case "warrior" :
mapWarriorGuild();
break;
case "thief" :
mapThiefGuild();
}
}
function addMapTextbox() {
restAlertMC = worldMapMC.mapLevelInfoMC.attachMovie("textBox1GFX", "textBoxMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:230, _y:210});
addMapPortrait();
}
function addMapPortrait() {
textBoxPortrait = restAlertMC.attachMovie("textBoxPortrait", "textBoxPortrait", restAlert.getNextHighestDepth(), {_x:-153, _y:0});
}
function mapStartBattle(levelName) {
_root.initMap(levelName);
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
}
function addMapMenu() {
worldMapMC.attachMovie("mapMenu", "mapMenu", worldMapMC.getNextHighestDepth());
worldMapMC.mapMenu._x = 40;
worldMapMC.mapMenu._y = 35;
worldMapMC.mapMenu.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.showStatus();
};
worldMapMC.attachMovie("mapSave", "mapSave", worldMapMC.getNextHighestDepth());
worldMapMC.mapSave._x = 40;
worldMapMC.mapSave._y = 67;
worldMapMC.mapSave.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.saveGame();
};
worldMapMC.attachMovie("mapGames", "mapGames", worldMapMC.getNextHighestDepth());
worldMapMC.mapGames._x = 40;
worldMapMC.mapGames._y = 99;
worldMapMC.mapGames.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1367&subid=worldMap", "_blank");
};
}
function mapRest() {
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
worldMapMC.mapLevelInfoMC.textBoxGold.removeMovieClip();
mapRestRecoverHPMP();
restOverlay = worldMapMC.attachMovie("mapInnOverlay", "mapInnOverlay", worldMapMC.getNextHighestDepth());
restOverlay._alpha = 0;
var _local1 = new mx.transitions.Tween(restOverlay, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
_local1.onMotionFinished = function () {
setTimeout(mapRestComplete, 1000, restOverlay);
};
}
function mapRestRecoverHPMP() {
c = 0;
while (c < defenderArr.length) {
char = defenderArr[c];
char.MP = char.MPMax;
char.HP = char.HPMax;
char.dead = false;
a = 0;
while (a < char.ailments.length) {
if (char.ailments[a] == "poison") {
char.ailments.splice(a, 1);
break;
}
a++;
}
c++;
}
}
function mapRestComplete(restOverlay) {
var _local1 = new mx.transitions.Tween(restOverlay, "_alpha", mx.transitions.easing.Regular.easeInOut, 100, 0, 3, true);
_local1.onMotionFinished = function () {
mapRestCompleteAlert();
};
}
function mapRestCompleteAlert() {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
restAlertMC = worldMapMC.mapLevelInfoMC.attachMovie("statusItemAlert", "restAlertMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:300, _y:210});
var _local3 = new mx.transitions.Tween(restAlertMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.5, true);
addText(restAlertMC, "titleTxt", 5, 58, 190, 50, "HP/MP Restored!", 13, 6050119);
closeButtonMC = restAlertMC.createEmptyMovieClip("closeButtonMC", restAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 5, 95, 190, 20, "Close", 12, 6050119);
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
};
}
function mapInn(levelName) {
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
innPrice = getInnPrice(levelName);
worldMapMC.mapLevelInfoMC.attachMovie("textBoxGold", "textBoxGold", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:560, _y:165});
addText(worldMapMC.mapLevelInfoMC.textBoxGold, "goldTxt", 15, 25, 100, 20, gold + " G", 13, 0, "right");
addMapTextbox();
textBoxPortrait.attachMovie("textBoxInn", "textBoxInn", textBoxPortrait.getNextHighestDepth());
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt", 35, 37, 410, 50, ("Welcome to the " + levelName) + " Inn", 18, 0, false);
if (checkInnSoldOut(levelName) != true) {
if (gold >= innPrice) {
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2", 35, 65, 410, 120, ("Relax in one of our cozy rooms and fully recover your party's HP and MP. It costs " + innPrice) + " gold to stay at the Inn.\n\nWould you like a room for the night?", 12, 6050119, false, true);
yesButtonMC = restAlertMC.createEmptyMovieClip("yesButtonMC", restAlertMC.getNextHighestDepth());
addText(yesButtonMC, "tfield", 345, 116, 30, 20, "Yes", 12, 6050119, false);
yesButtonMC.price = innPrice;
yesButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
yesButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
yesButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.gold = _root.gold - this.price;
_root.mapRest();
_root.worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
};
noButtonMC = restAlertMC.createEmptyMovieClip("noButtonMC", restAlertMC.getNextHighestDepth());
addText(noButtonMC, "tfield", 390, 116, 25, 20, "No", 12, 6050119, false);
noButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
noButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
noButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
};
} else {
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2", 35, 65, 410, 120, ("Relax in one of our cozy rooms and fully recover your party's HP and MP. It costs " + innPrice) + " gold to stay at the Inn.\n\nSorry, but it seems you do not have enough money to stay here.", 12, 6050119, false, true);
leaveButtonMC = restAlertMC.createEmptyMovieClip("leaveButtonMC", restAlertMC.getNextHighestDepth());
addText(leaveButtonMC, "tfield", 380, 134, 50, 20, "Leave", 12, 6050119, false);
leaveButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
leaveButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
leaveButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
};
restAlertMC.attachMovie("textBoxArrow", "textBoxArrow", restAlertMC.getNextHighestDepth(), {_x:365, _y:135});
}
} else {
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2", 35, 65, 410, 120, "I'm sorry, but we have no more room available for tonight. Please check a different Inn for vacancies.", 12, 6050119, false, true);
leaveButtonMC = restAlertMC.createEmptyMovieClip("leaveButtonMC", restAlertMC.getNextHighestDepth());
addText(leaveButtonMC, "tfield", 380, 134, 50, 20, "Leave", 12, 6050119, false);
leaveButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
leaveButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
leaveButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
};
restAlertMC.attachMovie("textBoxArrow", "textBoxArrow", restAlertMC.getNextHighestDepth(), {_x:365, _y:135});
}
}
function getInnPrice(levelName) {
switch (levelName) {
case "Athelas" :
return(50);
case "Sandos" :
return(100);
case "Damascus" :
return(200);
}
}
function checkInnSoldOut(levelName) {
switch (levelName) {
case "Athelas" :
if (levelsUnlocked >= 5) {
return(true);
}
return(false);
case "Sandos" :
if (levelsUnlocked >= 9) {
return(true);
}
return(false);
case "Damascus" :
return(false);
}
}
function mapGrandpa() {
trace("IN GRANDPA!");
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
addMapTextbox();
textBoxPortrait.attachMovie("textBoxGrandpa", "textBoxGrandpa", textBoxPortrait.getNextHighestDepth());
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt" + _root.grandpaCount, 35, 37, 410, 50, "Grandpa:", 18, 0, false);
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2" + _root.grandpaCount, 35, 65, 410, 80, getGrandpaTxt(_root.grandpaCount), 12, 6050119, false, true);
closeButtonMC = restAlertMC.createEmptyMovieClip("closeButtonMC", restAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 300, 140, 190, 20, "Continue", 12, 6050119);
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
if (_root.grandpaCount == 0) {
_root.initMap("tutorial");
} else if (_root.grandpaCount == 1) {
_root.levelsUnlocked++;
_root.grandpaCount++;
_root.loadWorldMap(_root.levelsUnlocked);
} else if (_root.grandpaCount == 2) {
if (defenderArr[0].lvl >= 3) {
_root.grandpaCount++;
_root.mapGrandpa();
} else {
_root.loadWorldMap(_root.levelsUnlocked);
}
} else if (_root.grandpaCount == 3) {
_root.levelsUnlocked++;
_root.grandpaCount++;
_root.loadWorldMap(_root.levelsUnlocked);
} else if (_root.grandpaCount == 4) {
_root.loadWorldMap(_root.levelsUnlocked);
} else if (_root.grandpaCount == 5) {
_root.loadWorldMap(_root.levelsUnlocked);
}
};
restAlertMC.attachMovie("textBoxArrow", "textBoxArrow", restAlertMC.getNextHighestDepth(), {_x:344, _y:141});
}
function getGrandpaTxt(num) {
switch (num) {
case 0 :
assignEquipment("Rusty Sword");
assignEquipment("Rusty Armor");
equipChar(defenderArr[0], "Rusty Sword", null, true);
equipChar(defenderArr[0], "Rusty Armor", null, true);
return("Oh Kronus, it's terrible! My backyard has been invaded by evil creatures. Now that you're old enough, please take my old war gear and do what you can to get rid of them before they do any more damage.");
case 1 :
c = 0;
while (c < defenderArr.length) {
char = defenderArr[c];
char.MP = char.MPMax;
char.HP = char.HPMax;
char.dead = false;
a = 0;
while (a < char.ailments.length) {
if (char.ailments[a] == "poison") {
char.ailments.splice(a, 1);
break;
}
a++;
}
c++;
}
return("Great job! You have proven that you are a true warrior. Head east to the Deep Woods and continue gaining experience. When you have reached level 3, come see me again. Be sure to REST here between battles.");
case 2 :
if (defenderArr[0].lvl >= 3) {
return("Congratulations! At this level, you are now able to begin doing missions. Help the citizens out and find out why these evil creatures are invading our land.");
}
return("Sorry, but you have not yet reached level 3. Keep battling and gaining experience. I cannot let you venture out into the dangerous world until you are ready.");
case 3 :
return("Travel east to Athelas, where an eager Mage is willing to help you on your journey. Good luck!");
case 4 :
return("Hello Kronus, it is great to see you again! I have taught you everything that I know, please do your best to help us out. Good luck out there!");
}
}
function mapGrandpaTreasures() {
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
addMapTextbox();
textBoxPortrait.attachMovie("textBoxGrandpa", "textBoxGrandpa", textBoxPortrait.getNextHighestDepth());
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt" + _root.grandpaCount, 35, 37, 410, 50, "Grandpa:", 18, 0, false);
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2" + _root.grandpaCount, 35, 65, 410, 80, mapGrandpaTreasureTxt(), 12, 6050119, false, true);
closeButtonMC = restAlertMC.createEmptyMovieClip("closeButtonMC", restAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 300, 140, 190, 20, "Continue", 12, 6050119);
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
if (levelsUnlocked >= 2) {
_root.loadWorldMap(_root.levelsUnlocked);
} else if (_root.checkGrandpaLockPickManual() == false) {
_root.giveLockPickManualAlert();
} else if (_root.checkGrandpaLockpick() == false) {
_root.giveLockPickAlert();
} else {
_root.loadWorldMap(_root.levelsUnlocked);
}
};
restAlertMC.attachMovie("textBoxArrow", "textBoxArrow", restAlertMC.getNextHighestDepth(), {_x:344, _y:141});
}
function mapGrandpaTreasureTxt() {
if (levelsUnlocked >= 2) {
return("I'm sorry but I do not have any more lockpicks to offer you. I hear the shops in the cities sell them.");
}
if (checkGrandpaLockpick() == false) {
if (checkGrandpaLockPickManual() == false) {
return("I'm afraid I can no longer unlock these chests, however, I do have a nice guide that will teach you how to Lock Pick. Here is an old Lockpick of mine to get you started.");
}
return("I see you have broken your lockpick, here have another.");
}
return("Come back when you need another Lockpick!");
}
function checkGrandpaLockpick() {
i2 = 0;
while (i2 < inventory.length) {
if (inventory[i2].NAME == "Rusty Lockpick") {
return(true);
}
i2++;
}
return(false);
}
function checkGrandpaLockPickManual() {
i3 = 0;
while (i3 < inventory.length) {
if (inventory[i3].NAME == "Lockpicking Guide") {
return(true);
}
i3++;
}
return(false);
}
function giveLockPickManualAlert() {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
assignItem("Lockpicking Guide");
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
defenderAlertMC = worldMapMC.mapLevelInfoMC.attachMovie("textBox2MC", "textBoxMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:297, _y:197});
addText(defenderAlertMC, "titleTxt" + _root.grandpaCount, 5, 45, 230, 50, "Item Aquired", 18, 0);
addText(defenderAlertMC, "titleTxt2" + _root.grandpaCount, 5, 130, 230, 80, "Lockpicking Guide", 12, 6050119);
var _local3 = defenderAlertMC.attachMovie("iconLockpickManual", "iconLockpickManual", defenderAlertMC.getNextHighestDepth(), {_x:105, _y:90});
closeButtonMC = defenderAlertMC.createEmptyMovieClip("closeButtonMC", defenderAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 20, 170, 190, 20, "Close", 12, 6050119);
closeButtonMC.defenderName = defenderName;
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.giveLockPickAlert();
};
}
function giveLockPickAlert() {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
assignItem("Rusty Lockpick");
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
defenderAlertMC = worldMapMC.mapLevelInfoMC.attachMovie("textBox2MC", "textBoxMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:297, _y:197});
addText(defenderAlertMC, "titleTxt" + _root.grandpaCount, 5, 45, 230, 50, "Item Aquired", 18, 0);
addText(defenderAlertMC, "titleTxt2" + _root.grandpaCount, 5, 130, 230, 80, "Rusty Lockpick", 12, 6050119);
var _local3 = defenderAlertMC.attachMovie("iconRustyLockpick", "iconRustyLockpick", defenderAlertMC.getNextHighestDepth(), {_x:105, _y:90});
closeButtonMC = defenderAlertMC.createEmptyMovieClip("closeButtonMC", defenderAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 20, 170, 190, 20, "Close", 12, 6050119);
closeButtonMC.defenderName = defenderName;
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.loadWorldMap(_root.levelsUnlocked);
};
}
function mapMissions(city) {
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
addMapTextbox();
textBoxPortrait.attachMovie("textBoxMissions", "textBoxMissions", textBoxPortrait.getNextHighestDepth());
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt", 35, 37, 410, 50, city + " Missions", 18, 0, false);
if (checkMissions(city) == false) {
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2", 35, 65, 410, 120, "Sorry, but there are no missions currently available. ", 12, 6050119, false, true);
leaveButtonMC = restAlertMC.createEmptyMovieClip("leaveButtonMC", restAlertMC.getNextHighestDepth());
addText(leaveButtonMC, "tfield", 380, 134, 50, 20, "Leave", 12, 6050119, false);
leaveButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
leaveButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
leaveButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
};
restAlertMC.attachMovie("textBoxArrow", "textBoxArrow", restAlertMC.getNextHighestDepth(), {_x:365, _y:135});
} else {
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2", 35, 65, 410, 120, "We currently have the following missions available:", 12, 6050119, false, true);
missionList = new Array();
missionList = getMissionList(city);
missionCount = 0;
m = 0;
while (m < missionList.length) {
if (missionList[m][2] == true) {
missionNameMC = worldMapMC.mapLevelInfoMC.textBoxMC.createEmptyMovieClip("missionNameMC" + m, worldMapMC.mapLevelInfoMC.textBoxMC.getNextHighestDepth());
addText(missionNameMC, "mission" + m, 50, (missionCount * 21) + 88, 200, 20, "- " + missionList[m][0], 12, 6050119, false);
missionNameMC.tfield = missionNameMC["mission" + m];
missionNameMC.missionName = missionList[m][0];
missionNameMC.difficulty = missionList[m][1];
missionNameMC.city = city;
missionNameMC.onRollOver = function () {
this.tfield.textColor = 0;
};
missionNameMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
missionNameMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.getMissionInfo(this.missionName, this.difficulty, this.city);
};
missionCount++;
}
m++;
}
leaveButtonMC = restAlertMC.createEmptyMovieClip("leaveButtonMC", restAlertMC.getNextHighestDepth());
addText(leaveButtonMC, "tfield", 380, 134, 50, 20, "Leave", 12, 6050119, false);
leaveButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
leaveButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
leaveButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
};
}
}
function checkMissions(city) {
switch (city) {
case "Grandpa's House" :
return(checkMissionsAvailable(missionsArr[0]));
case "Athelas" :
return(checkMissionsAvailable(missionsArr[1]));
case "Sandos" :
return(checkMissionsAvailable(missionsArr[2]));
case "Damascus" :
return(checkMissionsAvailable(missionsArr[3]));
}
}
function getMissionList(city) {
switch (city) {
case "Grandpa's House" :
return(missionsArr[0]);
case "Athelas" :
return(missionsArr[1]);
case "Sandos" :
return(missionsArr[2]);
case "Damascus" :
return(missionsArr[3]);
}
}
function getMissionInfo(missionName, missionDifficultyLevel, missionCity) {
_root.worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
restAlertMC = worldMapMC.mapLevelInfoMC.attachMovie("textBox3MC", "mapLevelTxtBox", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:230, _y:210});
addMapPortrait();
textBoxPortrait.attachMovie("textBoxMissions", "textBoxMissions", textBoxPortrait.getNextHighestDepth());
addText(worldMapMC.mapLevelInfoMC.mapLevelTxtBox, "titleTxt", 35, 37, 410, 50, missionName, 18, 0, false);
addText(worldMapMC.mapLevelInfoMC.mapLevelTxtBox, "titleTxt2", 35, 65, 410, 120, getMissionDescription(missionName), 12, 6050119, false, true);
addText(worldMapMC.mapLevelInfoMC.mapLevelTxtBox, "titleTxt", 35, 160, 410, 50, "Rewards", 16, 0, false);
missionRewardArr = new Array();
missionRewardArr = getMissionReward(missionName);
m = 0;
while (m < missionRewardArr.length) {
rewardItem = getRewardItemInfo(missionRewardArr[m]);
rewardMC = worldMapMC.mapLevelInfoMC.mapLevelTxtBox.createEmptyMovieClip("itemNameClip" + m, worldMapMC.mapLevelInfoMC.mapLevelTxtBox.getNextHighestDepth());
if ((m % 2) == 0) {
itemIcon = rewardMC.attachMovie(rewardItem.ICON, rewardItem.ICON, itemNameClip.getNextHighestDepth(), {_x:40, _y:(m * 15) + 185});
addText(rewardMC, "titleTxt" + rewardItem.NAME, 70, (m * 15) + 190, 150, 20, "1 x " + rewardItem.NAME, 12, 6050119, false);
} else {
itemIcon = rewardMC.attachMovie(rewardItem.ICON, rewardItem.ICON, itemNameClip.getNextHighestDepth(), {_x:250, _y:((m - 1) * 15) + 185});
addText(rewardMC, "titleTxt" + rewardItem.NAME, 280, ((m - 1) * 15) + 190, 150, 20, "1 x " + rewardItem.NAME, 12, 6050119, false);
}
m++;
}
yesButtonMC = worldMapMC.mapLevelInfoMC.mapLevelTxtBox.createEmptyMovieClip("yesButtonMC", worldMapMC.mapLevelInfoMC.mapLevelTxtBox.getNextHighestDepth());
addText(yesButtonMC, "tfield", 40, 260, 110, 20, "Accept Mission", 11, 6050119, false);
yesButtonMC.missionName = missionName;
yesButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
yesButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
yesButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.getMissionFunc(this.missionName);
};
addText(worldMapMC.mapLevelInfoMC.mapLevelTxtBox, "tfield", 145, 260, 200, 20, ("( reccommended level: " + missionDifficultyLevel) + " )", 10, 7077888, false);
noButtonMC = worldMapMC.mapLevelInfoMC.mapLevelTxtBox.createEmptyMovieClip("yesButtonMC", worldMapMC.mapLevelInfoMC.mapLevelTxtBox.getNextHighestDepth());
addText(noButtonMC, "tfield", 380, 260, 55, 20, "Cancel", 11, 6050119, false);
noButtonMC.cityName = missionCity;
noButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
noButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
noButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.mapMissions(this.cityName);
};
}
function getMissionDescription(missionName) {
switch (missionName) {
case "Mutant Pond" :
return("Mutants have been terrorizing the town's pond. Put an end to their chaos once and for all.");
case "The Athelas Leaf" :
return("Travel to the Athelas Grove and defeat the monsters to retrieve the Athelas Leaf. This leaf is very important for my research, and I will reward you greatly for your troubles.");
case "Venom Snakes!" :
return("Go north to the Jungle and kill off the venomous snakes that make this area dangerous. (Don't forget your antitodes for this one!)");
case "Mutant Leader" :
return("The leader of the mutants has gotten word that their gang has been defeated. Finish him off to finally restore peace in this town.");
case "The Desert Sting" :
return("Travel to Sandos, where you will meet an archer who will assist you on your missions. Work as a group to defeat the creatures in this new area.");
case "Ancient Pyramids" :
return("The Ancient Pyramids are at risk of being destroyed. Clear out the enemies who insist on attacking these landmarks.");
case "Super Venom" :
return("A local scientist would like to study the ultra powerful venom in the fire scorpions. Hunt down and return the body of these rare insects for his studies.");
case "Oasis" :
return("Rumor has it that there is an Oasis somewhere outside of Sandos with rare treasures to be discovered. Hurry and find this location before other treasure hunters get to it.");
case "Eye Guys" :
return("Strange, large-eyed mutants have been appearing in the Sandos Dunes. Where are these mutants coming from? Are they being sent here by someone? Eliminate them and investigate further.");
case "Lava Monsters" :
return("After the recent volcano eruption, monster made of lava have made their home at Damascus Ruins. Please go there and do what you can to make sure they don't make it to town.");
case "Death Rock Cave" :
return("Deep within the ruins of the old volcanic town of Damascus is a cave known as Death Rock. A highly skilled group of adventurers are needed to explore this dangerous area");
case "Ring of Fire" :
return("Several types of ghouls have been spotted in a fiery area in Damascus Ruins called the Ring of Fire. Who are these evil souls and why are they attacking peaceful citizens?");
case "Lava River" :
return("Skeletal mages and ghouls are using their magic powers to guard a secret group of enemies within the volcano. Eliminate them so we can find out who is behind this evil.");
case "Cave Ogres" :
return("After defeating the ghouls and mages, there have been sightings of powerful ogres within the cave. Could these be the monsters behind all of the destruction?");
case "Ogre Lord" :
return("Defeat the Ogre Lord and his gang to finally restore peace to this land");
}
}
function getMissionFunc(missionName) {
_root.curMission = missionName;
switch (missionName) {
case "Mutant Pond" :
initMap(missionName);
break;
case "The Athelas Leaf" :
levelsUnlocked = 3;
_root.loadWorldMap(levelsUnlocked);
break;
case "Venom Snakes!" :
levelsUnlocked = 4;
_root.loadWorldMap(levelsUnlocked);
break;
case "Mutant Leader" :
initMap(missionName);
break;
case "The Desert Sting" :
levelsUnlocked = 5;
_root.loadWorldMap(levelsUnlocked);
break;
case "Ancient Pyramids" :
levelsUnlocked = 7;
_root.loadWorldMap(levelsUnlocked);
break;
case "Super Venom" :
initMap(missionName);
break;
case "Oasis" :
_root.levelsUnlocked = 8;
_root.loadWorldMap(levelsUnlocked);
break;
case "Eye Guys" :
_root.loadWorldMap(levelsUnlocked);
break;
case "Lava Monsters" :
levelsUnlocked = 10;
_root.loadWorldMap(levelsUnlocked);
break;
case "Death Rock Cave" :
if (levelsUnlocked < 11) {
_root.levelsUnlocked = 11;
}
_root.loadWorldMap(levelsUnlocked);
break;
case "Ring of Fire" :
_root.loadWorldMap(levelsUnlocked);
break;
case "Lava River" :
_root.levelsUnlocked = 11;
_root.loadWorldMap(levelsUnlocked);
break;
case "Cave Ogres" :
_root.loadWorldMap(levelsUnlocked);
break;
case "Ogre Lord" :
_root.loadWorldMap(levelsUnlocked);
}
}
function removeMission(missName) {
m = 0;
while (m < missionsArr.length) {
m1 = 0;
while (m1 < missionsArr[m].length) {
if (missionsArr[m][m1][0] == missName) {
missionsArr[m][m1][2] = false;
break;
}
m1++;
}
m++;
}
}
function getMissionReward(missionName) {
switch (missionName) {
case "tutorial" :
return(["Healing Herb"]);
case "Mutant Pond" :
return(["sm. HP Potion", "Iron Ring"]);
case "The Athelas Leaf" :
return(["Mana Root", "Iron Tusk", "Antidote"]);
case "Venom Snakes!" :
return(["sm. HP Potion", "Antidote", "Rusty Lockpick"]);
case "Mutant Leader" :
return(["Magic Ring", "Power Bar"]);
case "The Desert Sting" :
return(["Resurrection", "Mana Root"]);
case "Ancient Pyramids" :
return(["sm. Mana Potion", "HP Potion", "Antidote", "Antidote"]);
case "Super Venom" :
return(["Iron Lockpick", "HP Booster"]);
case "Oasis" :
return(["Amulet of Warding", "Silver Necklace"]);
case "Eye Guys" :
return(["lg. HP Potion", "Iron Tusk"]);
case "Lava Monsters" :
return(["Magic Tonic", "Mana Potion"]);
case "Death Rock Cave" :
return(["Ruby Pin", "lg. HP Potion"]);
case "Ring of Fire" :
return(["Iron Lockpick", "lg. HP Potion"]);
case "Lava River" :
return(["Power Glove"]);
case "Cave Ogres" :
return(["lg. HP Potion", "Mana Potion", "Elixer"]);
case "Ogre Lord" :
return(["Iron Tusk", "HP Booster", "Power Bar", "Magic Tonic"]);
}
}
function getRewardItemInfo(itemName) {
i2 = 0;
while (i2 < itemListArr.length) {
if (itemName == itemListArr[i2].NAME) {
return(itemListArr[i2]);
}
i2++;
}
return(false);
}
function assignRewards() {
r = 0;
while (r < missionRewardArr.length) {
assignItem(missionRewardArr[r]);
r++;
}
}
function getMap(mapName) {
mapName = mapName.toString();
if (mapName == "tutorial") {
tileMap = [[1, 2, 3, 1, 2, 1, 6, 12], [1, 6, 1, 2, 3, 1, 1, 1], [12, 2, 1, 1, 6, 3, 1, 2], [2, 1, 1, 2, 1, 1, 5, 1], [1, 3, 1, 1, 5, 9, 2, 6], [1, 6, 3, 1, 1, 2, 1, 1], [1, 3, 9, 13, 1, 1, 1, 2], [1, 1, 13, 1, 1, 3, 2, 1], [1, 3, 2, 1, 6, 1, 1, 3], [1, 2, 1, 1, 1, 2, 1, 1], [12, 5, 1, 1, 2, 1, 3, 1], [1, 1, 4, 3, 1, 1, 1, 5], [1, 6, 2, 1, 1, 1, 2, 1], [1, 2, 1, 3, 1, 2, 6, 1], [1, 3, 3, 1, 1, 1, 1, 1]];
heightMap = [[3, 3, 2, 2, 2, 2, 2, 2], [3, 2, 2, 1, 1, 1, 2, 2], [2, 2, 1, 1, 1, 1, 1, 2], [2, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 2, 2, 1], [2, 2, 1, 1, 1, 1, 2, 1], [2, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1]];
charMap = [[0, ["snake1", "enemy", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, ["beetle1", "enemy", 2], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, ["Kronus", "human", 4], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Deep Woods") {
thisLevelEnemies = new Array();
thisLevelEnemies = ["beetle1", "beetle2", "snake1"];
randomMapNum = Math.ceil(Math.random() * 2);
if (randomMapNum == 1) {
tileMap = [[12, 12, 12, 12, 1, 1, 6, 2, 12, 12], [12, 1, 3, 7, 1, 1, 1, 1, 8, 12], [12, 1, 1, 2, 1, 1, 3, 1, 1, 1], [12, 2, 5, 1, 1, 2, 5, 1, 1, 1], [12, 1, 1, 1, 1, 6, 1, 1, 1, 1], [1, 6, 3, 1, 2, 1, 1, 1, 1, 2], [3, 1, 1, 3, 5, 1, 1, 1, 1, 3], [1, 12, 12, 1, 1, 3, 2, 1, 1, 1], [1, 12, 9, 5, 1, 1, 1, 1, 1, 1], [12, 9, 12, 3, 1, 6, 1, 5, 1, 1], [12, 1, 6, 2, 1, 2, 1, 1, 1, 6], [3, 2, 3, 1, 1, 1, 1, 3, 1, 1], [1, 2, 3, 1, 1, 2, 1, 1, 5, 1], [1, 1, 6, 2, 1, 3, 2, 2, 1, 3], [1, 2, 1, 1, 1, 1, 1, 1, 1, 1]];
heightMap = [[3, 3, 2, 2, 2, 1, 1, 2, 2, 3], [2, 2, 2, 1, 1, 1, 1, 1, 2, 2], [2, 1, 1, 1, 1, 1, 1, 1, 1, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 2], [1, 2, 1, 1, 1, 1, 1, 1, 2, 2], [1, 2, 2, 1, 1, 1, 1, 1, 2, 2], [1, 2, 2, 1, 1, 1, 1, 1, 1, 2], [1, 2, 1, 1, 1, 1, 1, 1, 1, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3]], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, checkLevelAddDefender(2, 4), 0, ["Kronus", "human", 4], 0, checkLevelAddDefender(1, 4), 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else {
tileMap = [[1, 1, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [2, 1, 6, 1, 1, 12, 8, 12, 1, 5, 7, 12, 12, 12, 4], [3, 1, 1, 1, 5, 3, 1, 2, 3, 1, 4, 1, 3, 2, 12], [1, 5, 1, 20, 1, 1, 1, 6, 1, 3, 1, 1, 2, 1, 3], [18, 19, 18, 19, 13, 5, 1, 1, 3, 1, 1, 1, 2, 1, 1], [18, 18, 19, 20, 19, 1, 1, 2, 1, 2, 1, 6, 1, 5, 1], [1, 1, 1, 19, 1, 3, 4, 1, 1, 1, 1, 1, 3, 2, 1], [6, 3, 1, 6, 1, 1, 6, 1, 2, 1, 2, 3, 3, 4, 1], [1, 2, 1, 1, 5, 2, 1, 1, 1, 3, 6, 1, 12, 12, 12], [1, 1, 1, 2, 1, 1, 1, 1, 1, 12, 12, 12, 4, 7, 12]];
heightMap = [[2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0, 0], [0, ["Kronus", "human", 1], 0, checkLevelAddDefender(1, 1), checkLevelAddDefender(2, 1), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
}
_root.missionType = "level";
mapReward = getMissionReward(mapName);
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Mutant Pond") {
tileMap = [[1, 1, 1, 1, 2, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1], [5, 2, 6, 1, 1, 5, 1, 1, 3, 1, 1, 2, 11, 6, 1], [1, 9, 3, 1, 3, 6, 1, 2, 1, 1, 3, 6, 1, 1, 1], [1, 1, 1, 2, 13, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1], [1, 13, 1, 1, 1, 10, 23, 23, 23, 10, 1, 1, 2, 1, 1], [5, 1, 1, 1, 23, 23, 22, 22, 22, 23, 23, 10, 9, 13, 1], [1, 1, 1, 23, 22, 22, 22, 22, 22, 22, 22, 23, 10, 4, 3], [2, 1, 1, 24, 22, 22, 22, 22, 22, 22, 22, 22, 1, 6, 1], [1, 6, 1, 24, 22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 1], [1, 1, 1, 1, 22, 22, 22, 22, 22, 22, 22, 10, 5, 2, 1], [1, 2, 1, 1, 1, 10, 22, 22, 22, 1, 1, 1, 3, 1, 1], [6, 4, 1, 6, 4, 1, 14, 15, 14, 1, 1, 2, 1, 1, 2], [1, 1, 1, 6, 13, 2, 14, 14, 15, 1, 6, 4, 1, 1, 1], [1, 9, 5, 1, 1, 5, 15, 14, 14, 3, 1, 1, 2, 13, 1], [1, 3, 1, 1, 1, 2, 14, 15, 14, 1, 1, 1, 3, 1, 1]];
heightMap = [[3, 2, 2, 2, 1, 1, 1, 2, 2, 3, 2, 2, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1], [2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1], [3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1], [3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, ["mutant1", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, ["mutant1", "enemy", 1], 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [["mutant1", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["mutant1", "enemy", 2], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], 0, ["Kage", "human", 4], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "The Athelas Leaf") {
tileMap = [[12, 1, 1, 8, 1, 1, 12, 1, 1, 1, 12, 1, 1, 1, 1], [1, 6, 1, 1, 1, 1, 2, 1, 1, 11, 1, 1, 1, 2, 1], [1, 1, 2, 1, 4, 3, 1, 1, 2, 1, 1, 3, 3, 8, 1], [1, 1, 1, 12, 1, 1, 1, 5, 3, 1, 2, 1, 6, 1, 1], [1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 3, 2, 4, 1, 1], [12, 1, 1, 1, 3, 1, 1, 1, 1, 12, 6, 1, 1, 1, 1], [1, 2, 1, 1, 12, 1, 1, 6, 1, 1, 1, 3, 1, 12, 1], [1, 11, 5, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 5, 2], [3, 8, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 2, 1], [6, 1, 1, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 11, 1, 1, 2, 1, 1, 3, 3, 1], [1, 1, 2, 11, 1, 1, 1, 1, 1, 1, 12, 1, 1, 1, 1], [1, 12, 1, 1, 1, 4, 1, 1, 1, 3, 3, 1, 1, 6, 1], [1, 2, 1, 8, 1, 3, 1, 6, 1, 1, 1, 5, 1, 1, 1], [1, 1, 1, 1, 1, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1]];
heightMap = [[1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 2, 2, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1], [1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1], [1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["beetle3", "enemy", 2], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, ["beetle2", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["beetle2", "enemy", 2], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, ["beetle3", "enemy", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], 0, ["Kage", "human", 4], 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Athelas Grove") {
thisLevelEnemies = new Array();
thisLevelEnemies = ["beetle3", "mutant1", "beetle2"];
_root.missionType = "level";
randomMapNum = Math.ceil(Math.random() * 2);
if (randomMapNum == 1) {
tileMap = [[12, 1, 1, 8, 1, 1, 12, 1, 1, 1, 12, 1, 1, 1, 1], [1, 6, 1, 1, 1, 1, 2, 1, 1, 11, 1, 1, 1, 2, 1], [1, 1, 2, 1, 4, 3, 1, 1, 2, 1, 1, 3, 3, 8, 1], [1, 1, 1, 12, 1, 1, 1, 5, 3, 1, 2, 1, 6, 1, 1], [1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 3, 2, 4, 1, 1], [12, 1, 1, 1, 3, 1, 1, 1, 1, 12, 6, 1, 1, 1, 1], [1, 2, 1, 1, 12, 1, 1, 6, 1, 1, 1, 3, 1, 12, 1], [1, 11, 5, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 5, 2], [3, 8, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 2, 1], [6, 1, 1, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 11, 1, 1, 2, 1, 1, 3, 3, 1], [1, 1, 2, 11, 1, 1, 1, 1, 1, 1, 12, 1, 1, 1, 1], [1, 12, 1, 1, 1, 4, 1, 1, 1, 3, 3, 1, 1, 6, 1], [1, 2, 1, 8, 1, 3, 1, 6, 1, 1, 1, 5, 1, 1, 1], [1, 1, 1, 1, 1, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1]];
heightMap = [[1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 2, 2, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1], [1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1], [1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, ["beetle2", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], checkLevelAddDefender(2, 4), ["Kage", "human", 4], 0, 0, 0, 0, 0, 0]];
} else if (randomMapNum == 2) {
tileMap = [[1, 12, 1, 12, 3, 1, 1, 1, 12, 1], [1, 2, 1, 13, 3, 1, 12, 1, 4, 1], [12, 1, 1, 1, 1, 1, 2, 1, 6, 3], [1, 1, 3, 1, 1, 1, 1, 3, 1, 1], [1, 6, 1, 2, 20, 18, 17, 20, 19, 17], [2, 1, 1, 1, 20, 18, 18, 18, 17, 20], [12, 12, 4, 1, 18, 17, 1, 1, 2, 1], [1, 1, 1, 1, 17, 20, 2, 6, 3, 1], [3, 1, 1, 2, 18, 18, 1, 1, 2, 1], [1, 1, 1, 6, 17, 18, 2, 4, 1, 13], [1, 13, 1, 2, 18, 19, 2, 1, 2, 1], [1, 1, 1, 3, 18, 18, 1, 3, 3, 1], [2, 1, 1, 1, 20, 17, 1, 3, 13, 1], [6, 1, 13, 1, 18, 18, 1, 1, 2, 1], [1, 12, 1, 1, 19, 17, 1, 1, 1, 1]];
heightMap = [[4, 4, 3, 3, 3, 3, 2, 2, 2, 2], [4, 3, 3, 2, 2, 2, 2, 2, 2, 2], [3, 3, 2, 2, 2, 2, 2, 2, 2, 2], [3, 2, 2, 2, 2, 2, 2, 2, 2, 2], [3, 2, 2, 2, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2]];
charMap = [[[getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 1], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], 0], [0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 3], 0, checkLevelAddDefender(2, 3)], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
}
mapReward = getMissionReward(mapName);
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Venom Snakes!") {
tileMap = [[1, 1, 1, 1, 1, 6, 22, 22, 22, 22, 22, 22], [1, 3, 1, 2, 1, 10, 1, 22, 22, 22, 22, 22], [1, 5, 6, 1, 3, 5, 1, 1, 1, 22, 22, 22], [3, 2, 1, 1, 2, 1, 1, 2, 1, 1, 22, 22], [1, 10, 1, 3, 1, 3, 2, 6, 1, 1, 1, 22], [1, 1, 1, 6, 1, 1, 1, 1, 3, 1, 10, 1], [22, 22, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1], [22, 22, 22, 1, 1, 10, 2, 1, 1, 1, 6, 2], [22, 22, 22, 22, 22, 1, 1, 1, 6, 1, 2, 1], [22, 22, 22, 22, 22, 22, 1, 1, 2, 1, 1, 1], [22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 5, 1], [22, 22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 1]];
heightMap = [[2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0], [2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], [2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 0], [1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1], [0, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1]];
charMap = [[0, ["Kage", "human", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [["Kronus", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["snake2", "enemy", 2], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["snake2", "enemy", 3], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["snake2", "enemy", 4], 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Jungle") {
return(levelJungle(mapName));
}
if (mapName == "Mutant Leader") {
tileMap = [[2, 1, 1, 2, 1, 1, 1, 1, 2, 6], [2, 1, 1, 13, 1, 2, 1, 1, 2, 2], [1, 6, 2, 1, 1, 1, 2, 13, 1, 1], [13, 1, 19, 17, 19, 17, 18, 19, 1, 1], [1, 1, 20, 19, 17, 20, 18, 20, 2, 6], [1, 2, 18, 17, 18, 18, 19, 18, 2, 13], [1, 6, 19, 20, 17, 19, 17, 19, 1, 1], [1, 13, 1, 2, 1, 6, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 2, 1], [1, 6, 1, 1, 2, 2, 1, 1, 1, 2]];
heightMap = [[2, 2, 2, 1, 1, 1, 1, 2, 2, 2], [2, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 1, 1, 1, 1, 1, 1, 1, 1, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 2, 2, 1, 1, 1, 1, 2, 2, 2]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [["mutant3", "enemy", 1], 0, 0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 3]], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, ["Kronus", "human", 4], 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "The Desert Sting") {
tileMap = [[60, 55, 55, 55, 55, 55, 55, 55, 55, 60, 57, 55], [55, 57, 55, 55, 60, 57, 55, 57, 62, 55, 63, 58], [64, 56, 57, 55, 55, 56, 58, 55, 57, 55, 55, 55], [55, 57, 58, 57, 55, 57, 55, 55, 55, 56, 55, 55], [55, 57, 57, 55, 55, 57, 55, 55, 55, 55, 57, 55], [55, 55, 55, 56, 55, 55, 56, 55, 57, 56, 60, 55], [57, 62, 56, 55, 56, 58, 55, 57, 55, 55, 55, 55], [55, 55, 57, 55, 55, 55, 60, 55, 57, 58, 55, 55], [55, 55, 58, 55, 55, 57, 55, 57, 57, 55, 56, 55], [55, 57, 57, 55, 55, 55, 57, 57, 55, 55, 56, 55], [55, 60, 55, 55, 57, 55, 55, 55, 64, 55, 57, 55], [55, 57, 55, 55, 56, 55, 57, 58, 55, 55, 55, 55]];
heightMap = [[3, 2, 2, 2, 1, 1, 2, 3, 3, 2, 2, 2], [3, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1], [3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["scorpion1", "enemy", 2], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, ["scorpion1", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, ["snake2", "enemy", 3], 0, 0, 0], [0, 0, 0, 0, ["scorpion1", "enemy", 3], 0, 0, 0, 0, 0, 0, 0], [0, ["Aryana", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [["Kage", "human", 1], 0, ["Kronus", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Sandos Dunes") {
return(levelSandosDunes(mapName));
}
if (mapName == "Ancient Pyramids") {
return(levelAncientPyramids(mapName));
}
if (mapName == "Great Pyramids") {
return(levelGreatPyramids(mapName));
}
if (mapName == "Super Venom") {
tileMap = [[55, 57, 57, 59, 55, 56, 57, 57, 57, 57, 57, 60], [57, 56, 57, 57, 57, 57, 56, 58, 56, 57, 55, 56], [55, 57, 57, 63, 56, 57, 61, 57, 57, 55, 57, 55], [55, 58, 57, 56, 55, 57, 57, 56, 55, 57, 62, 55], [57, 56, 57, 55, 57, 55, 55, 57, 57, 56, 57, 57], [56, 57, 56, 57, 55, 60, 57, 55, 57, 57, 57, 57], [56, 57, 61, 57, 57, 57, 57, 55, 55, 55, 56, 57], [57, 57, 55, 57, 59, 57, 55, 55, 55, 57, 55, 56], [57, 56, 55, 57, 57, 57, 55, 57, 57, 57, 58, 57], [57, 60, 57, 57, 57, 56, 57, 55, 57, 55, 57, 55], [55, 56, 57, 62, 56, 55, 58, 57, 55, 56, 55, 57], [57, 57, 57, 57, 55, 57, 55, 57, 55, 57, 55, 57]];
heightMap = [[3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3], [3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3], [2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 3], [2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [["scorpion2", "enemy", 1], 0, 0, 0, 0, 0, 0, ["scorpion2", "enemy", 2], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, ["scorpion2", "enemy", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 3], ["Aryana", "human", 4], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 3], 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Oasis") {
tileMap = [[22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22], [22, 22, 22, 1, 1, 1, 3, 1, 1, 3, 1, 1, 24, 22, 22], [22, 22, 1, 5, 1, 2, 1, 1, 9, 1, 2, 5, 1, 24, 22], [22, 1, 1, 1, 3, 3, 6, 1, 1, 1, 1, 1, 3, 1, 24], [22, 3, 6, 1, 1, 1, 1, 1, 2, 1, 6, 1, 11, 1, 24], [22, 1, 1, 2, 3, 13, 1, 3, 1, 3, 1, 13, 1, 1, 24], [22, 1, 9, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 24], [22, 1, 2, 1, 1, 1, 3, 1, 1, 6, 9, 1, 1, 1, 24], [22, 1, 10, 1, 2, 1, 11, 1, 1, 3, 3, 1, 2, 1, 24], [22, 23, 23, 3, 1, 1, 1, 2, 1, 5, 1, 1, 1, 24, 22], [22, 22, 22, 23, 23, 23, 1, 1, 1, 1, 1, 24, 23, 22, 22], [22, 22, 22, 22, 22, 22, 22, 27, 27, 23, 23, 22, 22, 22, 22], [22, 22, 22, 22, 22, 22, 22, 27, 27, 22, 22, 22, 22, 22, 22], [22, 22, 22, 22, 22, 22, 22, 27, 27, 22, 22, 22, 22, 22, 22], [22, 22, 22, 22, 22, 22, 22, 27, 27, 22, 22, 22, 22, 22, 22]];
heightMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, ["scorpion2", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["snake3", "enemy", 2], 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["snake3", "enemy", 2], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, ["scorpion2", "enemy", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], ["Aryana", "human", 4], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 4], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "The Oasis") {
return(levelTheOasis(mapName));
}
if (mapName == "Eye Guys") {
tileMap = [[56, 59, 57, 56, 57, 57, 18, 17, 57, 55, 57, 57], [58, 57, 57, 57, 57, 62, 17, 18, 57, 57, 60, 57], [57, 57, 57, 56, 57, 57, 18, 18, 57, 56, 57, 62], [57, 56, 61, 57, 60, 55, 18, 17, 57, 59, 57, 55], [56, 58, 57, 57, 57, 57, 17, 18, 18, 18, 17, 18], [57, 56, 57, 57, 60, 57, 18, 17, 17, 18, 18, 18], [57, 60, 55, 57, 57, 57, 56, 57, 57, 55, 57, 55], [55, 57, 62, 57, 55, 61, 56, 57, 60, 57, 57, 57], [57, 55, 57, 56, 57, 55, 57, 57, 57, 55, 57, 58]];
heightMap = [[4, 3, 3, 2, 2, 1, 0, 0, 1, 1, 2, 2], [3, 3, 2, 2, 1, 1, 0, 0, 1, 1, 2, 2], [3, 2, 2, 1, 1, 1, 0, 0, 1, 1, 1, 2], [2, 2, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[["Kage", "human", 1], ["Aryana", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, ["eyeguy1", "enemy", 3], 0], [["Kronus", "human", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, ["eyeguy1", "enemy", 3], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["eyeguy1", "enemy", 2], 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Damascus Ruins") {
return(levelDamascusRuins(mapName));
}
if (mapName == "Lava Monsters") {
return(levelLavaMonsters(mapName));
}
if (mapName == "Death Rock Cave") {
tileMap = [[38, 38, 40, 38, 38, 41, 38, 38, 38, 38, 40, 38], [38, 39, 40, 38, 38, 38, 40, 38, 38, 40, 38, 38], [38, 39, 40, 38, 41, 38, 39, 38, 39, 38, 40, 38], [38, 40, 38, 40, 41, 38, 41, 38, 40, 40, 39, 38], [40, 38, 41, 40, 39, 39, 38, 38, 40, 41, 38, 38], [38, 38, 38, 38, 38, 38, 41, 38, 39, 40, 38, 38], [40, 38, 39, 41, 38, 40, 43, 40, 40, 41, 38, 38], [40, 38, 38, 38, 38, 42, 43, 42, 40, 38, 38, 39], [41, 38, 41, 40, 38, 43, 43, 42, 38, 38, 41, 38], [38, 40, 38, 40, 38, 42, 42, 43, 38, 38, 38, 38], [38, 38, 38, 38, 41, 43, 42, 43, 38, 38, 39, 38], [38, 41, 38, 39, 38, 42, 43, 43, 40, 38, 38, 38]];
heightMap = [[1, 1, 1, 2, 3, 3, 3, 2, 2, 2, 1, 1], [1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1], [2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [3, 2, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [3, 2, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, ["skeleton1", "enemy", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, ["skeleton1", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, ["skeleton1", "enemy", 2], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, ["Kage", "human", 4], 0, ["Aryana", "human", 4], 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Ring of Fire") {
tileMap = [[34, 34, 33, 35, 33, 34, 35, 34, 35, 35, 33, 36, 34, 35, 35], [34, 36, 35, 34, 51, 48, 48, 48, 48, 48, 48, 35, 33, 36, 33], [35, 35, 34, 48, 48, 48, 48, 50, 48, 48, 48, 48, 48, 34, 35], [34, 34, 48, 48, 48, 51, 48, 48, 48, 51, 50, 51, 48, 48, 34], [34, 33, 48, 51, 48, 50, 48, 34, 35, 48, 48, 48, 48, 48, 34], [33, 34, 48, 48, 48, 48, 36, 33, 34, 35, 35, 48, 48, 48, 34], [34, 34, 48, 50, 48, 33, 34, 33, 34, 34, 35, 48, 51, 48, 34], [34, 35, 48, 48, 51, 48, 34, 36, 35, 35, 47, 48, 50, 48, 33], [34, 34, 48, 48, 48, 48, 48, 34, 34, 47, 48, 51, 48, 48, 36], [33, 34, 35, 48, 48, 51, 50, 48, 48, 48, 51, 48, 48, 34, 35], [34, 34, 34, 35, 48, 51, 48, 51, 48, 50, 48, 48, 34, 33, 34], [34, 35, 36, 34, 34, 34, 48, 48, 48, 48, 34, 34, 33, 34, 35], [34, 35, 35, 34, 35, 35, 35, 38, 39, 35, 34, 35, 36, 34, 33], [34, 33, 35, 35, 36, 35, 35, 38, 39, 33, 35, 35, 33, 35, 34], [34, 35, 34, 34, 34, 33, 35, 38, 39, 35, 33, 34, 34, 34, 35]];
heightMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["flameskull2", "enemy", 2], ["flameskull2", "enemy", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, ["flameskull1", "enemy", 2], 0, 0, 0, 0, 0, 0, ["flameskull1", "enemy", 2], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["Aryana", "human", 4], ["Kronus", "human", 4], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 4], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Lava River") {
return(levelLavaRiver(mapName));
}
if (mapName == "Cave Ogres") {
tileMap = [[40, 40, 34, 33, 34, 34, 33, 34, 40, 40, 40, 40], [40, 38, 40, 43, 43, 43, 43, 43, 40, 39, 40, 40], [40, 38, 40, 43, 43, 43, 43, 43, 40, 40, 41, 40], [40, 41, 40, 35, 35, 34, 43, 43, 35, 34, 34, 40], [40, 40, 38, 33, 34, 34, 43, 43, 34, 33, 34, 40], [40, 40, 39, 34, 33, 34, 43, 43, 34, 35, 34, 36], [34, 42, 42, 34, 34, 34, 40, 40, 34, 33, 36, 34], [34, 42, 42, 34, 36, 34, 40, 41, 39, 35, 34, 34], [33, 42, 42, 34, 36, 34, 40, 40, 41, 34, 34, 34], [34, 42, 42, 35, 34, 34, 38, 40, 40, 34, 37, 35], [34, 42, 42, 34, 34, 34, 41, 39, 39, 35, 34, 33], [34, 42, 42, 34, 33, 34, 34, 35, 34, 34, 33, 35], [40, 39, 40, 38, 34, 34, 36, 34, 33, 34, 36, 34], [40, 40, 40, 40, 40, 34, 34, 33, 34, 34, 34, 34]];
heightMap = [[2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3], [3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3], [4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [3, 3, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2], [2, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2], [2, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1], [1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1], [1, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1], [1, 2, 2, 1, 1, 1, 2, 3, 2, 1, 1, 1], [1, 2, 2, 1, 1, 1, 2, 3, 2, 1, 2, 1], [1, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1], [1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["ogre1", "enemy", 3], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, ["ogre1", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["ogre1", "enemy", 4], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, ["Kronus", "human", 4], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, ["Aryana", "human", 4], ["Kage", "human", 4], 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
if (mapName == "Ogre Lord") {
return(levelOgreLord(mapName));
}
if (mapName == "Death Rock") {
return(levelDeathRock(mapName));
}
}
function checkLevelUnlock(levelName) {
levelName = levelName.toString();
switch (levelName) {
case "tutorial" :
_root.grandpaCount++;
break;
case "Mutant Pond" :
removeMission(levelName);
if (checkMissionsAvailable(missionsArr[1]) == false) {
unlockMission(missionsArr[1], "Mutant Leader");
}
break;
case "The Athelas Leaf" :
removeMission(levelName);
unlockMission(missionsArr[1], "Venom Snakes!");
break;
case "Venom Snakes!" :
removeMission(levelName);
if (checkMissionsAvailable(missionsArr[1]) == false) {
unlockMission(missionsArr[1], "Mutant Leader");
}
break;
case "Mutant Leader" :
removeMission(levelName);
unlockMission(missionsArr[1], "The Desert Sting");
break;
case "The Desert Sting" :
_root.levelsUnlocked++;
removeMission(levelName);
unlockMission(missionsArr[2], "Ancient Pyramids");
unlockMission(missionsArr[2], "Super Venom");
break;
case "Ancient Pyramids" :
removeMission(levelName);
if (checkMissionsAvailable(missionsArr[2]) == false) {
trace("UNLOCK OASIS MISSION!!!");
unlockMission(missionsArr[2], "Oasis");
}
break;
case "Super Venom" :
removeMission(levelName);
if (checkMissionsAvailable(missionsArr[2]) == false) {
trace("UNLOCK OASIS MISSION!!!");
unlockMission(missionsArr[2], "Oasis");
}
break;
case "Oasis" :
removeMission(levelName);
unlockMission(missionsArr[2], "Eye Guys");
break;
case "Eye Guys" :
_root.levelsUnlocked = 9;
removeMission(levelName);
unlockMission(missionsArr[3], "Lava Monsters");
break;
case "Lava Monsters" :
removeMission(levelName);
unlockMission(missionsArr[3], "Death Rock");
unlockMission(missionsArr[3], "Ring of Fire");
break;
case "Death Rock" :
removeMission(levelName);
if (checkMissionsAvailable(missionsArr[3]) == false) {
unlockMission(missionsArr[3], "Lava River");
}
break;
case "Ring of Fire" :
removeMission(levelName);
if (checkMissionsAvailable(missionsArr[3]) == false) {
unlockMission(missionsArr[3], "Lava River");
}
break;
case "Lava River" :
removeMission(levelName);
if (checkMissionsAvailable(missionsArr[3]) == false) {
unlockMission(missionsArr[3], "Cave Ogres");
}
break;
case "Cave Ogres" :
removeMission(levelName);
if (checkMissionsAvailable(missionsArr[3]) == false) {
unlockMission(missionsArr[3], "Ogre Lord");
}
break;
case "Ogre Lord" :
removeMission(levelName);
trace("END GAME");
gameComplete = true;
}
}
function unlockMission(arr, missionName) {
m = 0;
while (m < arr.length) {
if (arr[m][0] == missionName) {
arr[m][2] = true;
break;
}
m++;
}
}
function getRandomLevelEnemy(arr) {
randomEnemyNum = Math.floor(Math.random() * arr.length);
return(arr[randomEnemyNum]);
}
function checkLevelAddDefender(defenderNum, dir) {
if (_root.defenderArr[defenderNum] != undefined) {
if (defenderNum == 1) {
return(["Kage", "human", dir]);
}
if (defenderNum == 2) {
return(["Aryana", "human", dir]);
}
}
return(0);
}
function levelJungle(mapName) {
thisLevelEnemies = new Array();
thisLevelEnemies = ["beetle3", "snake2", "snake3"];
_root.missionType = "level";
randomMapNum = Math.ceil(Math.random() * 2);
if (randomMapNum == 1) {
tileMap = [[12, 12, 1, 1, 2, 1, 1, 1, 12, 12], [12, 1, 2, 1, 1, 2, 1, 1, 1, 12], [10, 1, 1, 1, 1, 1, 9, 1, 1, 2], [1, 2, 1, 1, 1, 2, 1, 1, 10, 1], [1, 1, 1, 2, 1, 1, 1, 1, 1, 1], [22, 22, 22, 22, 27, 27, 22, 22, 22, 22], [22, 22, 22, 22, 27, 27, 22, 22, 22, 22], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 10, 1, 1, 1, 2, 2, 1, 10, 1], [1, 1, 1, 2, 1, 1, 1, 1, 1, 1], [12, 1, 9, 2, 1, 1, 2, 1, 1, 7], [12, 1, 2, 1, 1, 1, 1, 1, 2, 1], [7, 1, 10, 1, 1, 1, 1, 2, 4, 1], [2, 1, 1, 1, 2, 1, 1, 1, 1, 1], [1, 1, 1, 2, 1, 1, 1, 1, 2, 1]];
heightMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, ["Kronus", "human", 4], ["Kage", "human", 4], checkLevelAddDefender(2, 4), 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else if (randomMapNum == 2) {
tileMap = [[1, 1, 1, 1, 1, 6, 22, 22, 22, 22, 22, 22], [1, 3, 1, 2, 1, 10, 1, 22, 22, 22, 22, 22], [1, 5, 6, 1, 3, 5, 1, 1, 1, 22, 22, 22], [3, 2, 1, 1, 2, 1, 1, 2, 1, 1, 22, 22], [1, 10, 1, 3, 1, 3, 2, 6, 1, 1, 1, 22], [1, 1, 1, 6, 1, 1, 1, 1, 3, 1, 10, 1], [22, 22, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1], [22, 22, 22, 1, 1, 10, 2, 1, 1, 1, 6, 2], [22, 22, 22, 22, 22, 1, 1, 1, 6, 1, 2, 1], [22, 22, 22, 22, 22, 22, 1, 1, 2, 1, 1, 1], [22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 5, 1], [22, 22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 1]];
heightMap = [[2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0], [2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], [2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 0], [1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1], [0, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1]];
charMap = [[0, ["Kage", "human", 2], checkLevelAddDefender(2, 2), 0, 0, 0, 0, 0, 0, 0, 0, 0], [["Kronus", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 4], 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
}
mapReward = getMissionReward(mapName);
return([tileMap, heightMap, charMap, mapReward]);
}
function levelSandosDunes(mapName) {
thisLevelEnemies = new Array();
thisLevelEnemies = ["beetle3", "snake3", "scorpion1"];
_root.missionType = "level";
randomMapNum = Math.ceil(Math.random() * 2);
if (randomMapNum == 1) {
tileMap = [[56, 59, 57, 56, 57, 57, 18, 17, 57, 55, 57, 57], [58, 57, 57, 57, 57, 62, 17, 18, 57, 57, 60, 57], [57, 57, 57, 56, 57, 57, 18, 18, 57, 56, 57, 62], [57, 56, 61, 57, 60, 55, 18, 17, 57, 59, 57, 55], [56, 58, 57, 57, 57, 57, 17, 18, 18, 18, 17, 18], [57, 56, 57, 57, 60, 57, 18, 17, 17, 18, 18, 18], [57, 60, 55, 57, 57, 57, 56, 57, 57, 55, 57, 55], [55, 57, 62, 57, 55, 61, 56, 57, 60, 57, 57, 57], [57, 55, 57, 56, 57, 55, 57, 57, 57, 55, 57, 58]];
heightMap = [[4, 3, 3, 2, 2, 1, 0, 0, 1, 1, 2, 2], [3, 3, 2, 2, 1, 1, 0, 0, 1, 1, 2, 2], [3, 2, 2, 1, 1, 1, 0, 0, 1, 1, 1, 2], [2, 2, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[["Kage", "human", 1], ["Aryana", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0], [["Kronus", "human", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else if (randomMapNum == 2) {
tileMap = [[60, 55, 55, 55, 55, 55, 55, 55, 55, 60, 57, 55], [55, 57, 55, 55, 60, 57, 55, 57, 62, 55, 63, 58], [64, 56, 57, 55, 55, 56, 58, 55, 57, 55, 55, 55], [55, 57, 58, 57, 55, 57, 55, 55, 55, 56, 55, 55], [55, 57, 57, 55, 55, 57, 55, 55, 55, 55, 57, 55], [55, 55, 55, 56, 55, 55, 56, 55, 57, 56, 60, 55], [57, 62, 56, 55, 56, 58, 55, 57, 55, 55, 55, 55], [55, 55, 57, 55, 55, 55, 60, 55, 57, 58, 55, 55], [55, 55, 58, 55, 55, 57, 55, 57, 57, 55, 56, 55], [55, 57, 57, 55, 55, 55, 57, 57, 55, 55, 56, 55], [55, 60, 55, 55, 57, 55, 55, 55, 64, 55, 57, 55], [55, 57, 55, 55, 56, 55, 57, 58, 55, 55, 55, 55]];
heightMap = [[3, 2, 2, 2, 1, 1, 2, 3, 3, 2, 2, 2], [3, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1], [3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0, 0, 0], [0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0, 0, 0, 0, 0, 0, 0], [0, ["Aryana", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [["Kage", "human", 1], 0, ["Kronus", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
}
mapReward = getMissionReward(mapName);
return([tileMap, heightMap, charMap, mapReward]);
}
function levelAncientPyramids(mapName) {
tileMap = [[57, 57, 55, 55, 57, 55, 55, 55, 55, 55, 55, 63, 55, 55, 55, 55, 55, 55, 58, 55], [57, 57, 57, 57, 56, 57, 57, 56, 55, 57, 55, 56, 55, 55, 55, 57, 57, 57, 57, 55], [55, 56, 57, 55, 55, 57, 55, 55, 55, 55, 55, 55, 55, 57, 57, 55, 55, 60, 56, 55], [57, 55, 55, 55, 57, 55, 55, 55, 60, 55, 55, 56, 57, 55, 59, 55, 55, 55, 55, 55], [55, 55, 55, 55, 56, 55, 55, 55, 56, 55, 55, 55, 56, 55, 55, 55, 55, 56, 55, 56], [55, 56, 55, 55, 55, 55, 56, 55, 55, 55, 55, 55, 55, 55, 56, 55, 55, 55, 63, 55], [55, 55, 55, 56, 56, 55, 55, 55, 55, 56, 55, 55, 56, 55, 56, 64, 55, 57, 55, 55], [57, 56, 55, 55, 55, 56, 55, 57, 57, 63, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55], [60, 57, 55, 55, 55, 57, 55, 55, 55, 55, 55, 58, 56, 55, 57, 60, 56, 55, 57, 55], [55, 55, 55, 55, 64, 55, 55, 60, 55, 56, 55, 55, 55, 57, 55, 55, 55, 55, 57, 55], [55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 57, 55, 56, 55, 55, 55, 55, 55], [55, 55, 57, 55, 55, 57, 57, 57, 57, 55, 56, 57, 57, 64, 56, 56, 55, 57, 55, 55], [55, 55, 55, 64, 57, 55, 59, 55, 55, 62, 55, 55, 60, 55, 55, 57, 59, 55, 56, 55], [55, 58, 55, 55, 55, 57, 55, 55, 55, 55, 55, 56, 55, 55, 55, 55, 57, 55, 55, 55], [55, 55, 57, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 55]];
heightMap = [[7, 6, 5, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4], [6, 6, 5, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3], [5, 5, 5, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2], [4, 4, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["scorpion1", "enemy", 2], 0], [0, 0, ["snake3", "enemy", 1], 0, 0, 0, 0, 0, 0, ["scorpion1", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, ["snake3", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["beetle3", "enemy", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, ["scorpion1", "enemy", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 3], 0, ["Kage", "human", 4]], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Aryana", "human", 3], 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
function levelGreatPyramids(mapName) {
thisLevelEnemies = new Array();
thisLevelEnemies = ["beetle3", "snake3", "scorpion1", "scorpion2"];
_root.missionType = "level";
randomMapNum = Math.ceil(Math.random() * 2);
if (randomMapNum == 1) {
tileMap = [[57, 57, 57, 57, 57, 56, 57, 56, 57, 59, 57, 57], [57, 55, 57, 64, 58, 55, 56, 57, 57, 56, 57, 63], [55, 57, 59, 57, 56, 57, 57, 57, 57, 60, 57, 57], [57, 56, 57, 56, 57, 57, 57, 56, 56, 55, 57, 56], [57, 57, 57, 56, 55, 58, 55, 57, 57, 64, 57, 55], [56, 60, 57, 57, 57, 56, 57, 57, 57, 57, 56, 57], [57, 57, 57, 63, 57, 57, 57, 56, 56, 55, 60, 56], [57, 57, 55, 57, 56, 57, 56, 57, 57, 57, 57, 57], [57, 56, 57, 57, 60, 57, 55, 57, 57, 56, 57, 57], [57, 64, 57, 55, 57, 57, 55, 57, 59, 57, 57, 58], [57, 57, 57, 56, 57, 57, 64, 57, 58, 57, 57, 56], [57, 57, 56, 57, 57, 57, 57, 57, 56, 57, 57, 56]];
heightMap = [[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, ["Kronus", "human", 4], 0, 0, ["Kage", "human", 4], 0, ["Aryana", "human", 4], 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else if (randomMapNum == 2) {
tileMap = [[57, 57, 55, 55, 57, 55, 55, 55, 55, 55, 55, 63, 55, 55, 55, 55, 55, 55, 58, 55], [57, 57, 57, 57, 56, 57, 57, 56, 55, 57, 55, 56, 55, 55, 55, 57, 57, 57, 57, 55], [55, 56, 57, 55, 55, 57, 55, 55, 55, 55, 55, 55, 55, 57, 57, 55, 55, 60, 56, 55], [57, 55, 55, 55, 57, 55, 55, 55, 60, 55, 55, 56, 57, 55, 59, 55, 55, 55, 55, 55], [55, 55, 55, 55, 56, 55, 55, 55, 56, 55, 55, 55, 56, 55, 55, 55, 55, 56, 55, 56], [55, 56, 55, 55, 55, 55, 56, 55, 55, 55, 55, 55, 55, 55, 56, 55, 55, 55, 63, 55], [55, 55, 55, 56, 56, 55, 55, 55, 55, 56, 55, 55, 56, 55, 56, 64, 55, 57, 55, 55], [57, 56, 55, 55, 55, 56, 55, 57, 57, 63, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55], [60, 57, 55, 55, 55, 57, 55, 55, 55, 55, 55, 58, 56, 55, 57, 60, 56, 55, 57, 55], [55, 55, 55, 55, 64, 55, 55, 60, 55, 56, 55, 55, 55, 57, 55, 55, 55, 55, 57, 55], [55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 57, 55, 56, 55, 55, 55, 55, 55], [55, 55, 57, 55, 55, 57, 57, 57, 57, 55, 56, 57, 57, 64, 56, 56, 55, 57, 55, 55], [55, 55, 55, 64, 57, 55, 59, 55, 55, 62, 55, 55, 60, 55, 55, 57, 59, 55, 56, 55], [55, 58, 55, 55, 55, 57, 55, 55, 55, 55, 55, 56, 55, 55, 55, 55, 57, 55, 55, 55], [55, 55, 57, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 55]];
heightMap = [[7, 6, 5, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4], [6, 6, 5, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3], [5, 5, 5, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2], [4, 4, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0], [0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 1], 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, ["scorpion1", "enemy", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 3], 0, ["Kage", "human", 4]], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Aryana", "human", 3], 0]];
}
mapReward = getMissionReward(mapName);
return([tileMap, heightMap, charMap, mapReward]);
}
function levelTheOasis(mapName) {
thisLevelEnemies = new Array();
thisLevelEnemies = ["scorpion2", "snake3", "eyeguy1"];
_root.missionType = "level";
randomMapNum = Math.ceil(Math.random() * 2);
if (randomMapNum == 1) {
tileMap = [[1, 4, 1, 1, 2, 9, 1, 6, 1, 1, 2, 1], [1, 2, 1, 1, 1, 1, 4, 1, 3, 1, 1, 3], [1, 1, 2, 23, 23, 23, 23, 23, 22, 1, 1, 2], [3, 1, 1, 24, 22, 22, 22, 22, 22, 22, 1, 3], [2, 1, 24, 22, 22, 22, 22, 22, 22, 22, 22, 2], [1, 6, 24, 22, 22, 1, 10, 24, 22, 22, 22, 1], [1, 1, 24, 22, 22, 10, 9, 24, 22, 22, 22, 2], [1, 3, 24, 22, 22, 10, 1, 24, 22, 22, 22, 1], [6, 1, 24, 22, 22, 1, 10, 24, 22, 22, 22, 2], [2, 4, 24, 22, 22, 23, 23, 22, 22, 22, 22, 1], [1, 3, 24, 22, 22, 22, 22, 22, 22, 22, 22, 3], [1, 2, 22, 22, 22, 22, 22, 22, 22, 22, 1, 1], [3, 1, 1, 1, 22, 22, 22, 22, 22, 1, 3, 2], [2, 6, 1, 3, 1, 1, 6, 1, 3, 2, 1, 1], [1, 1, 1, 2, 1, 1, 3, 1, 1, 1, 2, 1]];
heightMap = [[2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 3, 3], [2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3], [2, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 2], [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1], [1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 1], 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0], [[getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["Aryana", "human", 3], 0, ["Kage", "human", 4]]];
} else if (randomMapNum == 2) {
tileMap = [[22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22], [22, 22, 22, 1, 1, 1, 3, 1, 1, 3, 1, 1, 24, 22, 22], [22, 22, 1, 5, 1, 2, 1, 1, 9, 1, 2, 5, 1, 24, 22], [22, 1, 1, 1, 3, 3, 6, 1, 1, 1, 1, 1, 3, 1, 24], [22, 3, 6, 1, 1, 1, 1, 1, 2, 1, 6, 1, 11, 1, 24], [22, 1, 1, 2, 3, 13, 1, 3, 1, 3, 1, 13, 1, 1, 24], [22, 1, 9, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 24], [22, 1, 2, 1, 1, 1, 3, 1, 1, 6, 9, 1, 1, 1, 24], [22, 1, 10, 1, 2, 1, 11, 1, 1, 3, 3, 1, 2, 1, 24], [22, 23, 23, 3, 1, 1, 1, 2, 1, 5, 1, 1, 1, 24, 22], [22, 22, 22, 23, 23, 23, 1, 1, 1, 1, 1, 24, 23, 22, 22], [22, 22, 22, 22, 22, 22, 22, 27, 27, 23, 23, 22, 22, 22, 22], [22, 22, 22, 22, 22, 22, 22, 27, 27, 22, 22, 22, 22, 22, 22], [22, 22, 22, 22, 22, 22, 22, 27, 27, 22, 22, 22, 22, 22, 22], [22, 22, 22, 22, 22, 22, 22, 27, 27, 22, 22, 22, 22, 22, 22]];
heightMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], ["Aryana", "human", 4], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 4], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
}
mapReward = getMissionReward(mapName);
return([tileMap, heightMap, charMap, mapReward]);
}
function levelDamascusRuins(mapName) {
thisLevelEnemies = new Array();
thisLevelEnemies = ["scorpion2", "skeleton1", "flameskull1"];
_root.missionType = "level";
randomMapNum = Math.ceil(Math.random() * 2);
if (randomMapNum == 1) {
tileMap = [[48, 48, 50, 48, 48, 47, 48, 48, 49, 48, 45, 49, 50, 49, 48], [47, 44, 48, 51, 48, 48, 51, 49, 49, 47, 48, 48, 47, 48, 35], [48, 48, 50, 45, 50, 47, 49, 46, 48, 49, 48, 51, 51, 34, 33], [48, 49, 49, 48, 49, 48, 48, 48, 51, 50, 48, 51, 34, 35, 33], [48, 49, 47, 48, 48, 48, 51, 50, 48, 35, 34, 34, 34, 34, 34], [50, 49, 51, 48, 51, 50, 48, 51, 48, 34, 36, 33, 37, 34, 36], [51, 49, 48, 48, 48, 48, 51, 34, 34, 35, 33, 34, 34, 34, 34], [48, 49, 48, 46, 51, 50, 51, 35, 33, 34, 35, 36, 34, 33, 34], [48, 50, 48, 48, 48, 50, 51, 35, 34, 36, 34, 35, 34, 33, 34], [48, 48, 48, 51, 48, 51, 48, 34, 34, 33, 34, 33, 35, 34, 35]];
heightMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0], [0, ["Aryana", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, ["Kronus", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, ["Kage", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
} else if (randomMapNum == 2) {
tileMap = [[34, 34, 33, 35, 33, 34, 35, 34, 35, 35, 33, 36, 34, 35, 35], [34, 36, 35, 34, 51, 48, 48, 48, 48, 48, 48, 35, 33, 36, 33], [35, 35, 34, 48, 48, 48, 48, 50, 48, 48, 48, 48, 48, 34, 35], [34, 34, 48, 48, 48, 51, 48, 48, 48, 51, 50, 51, 48, 48, 34], [34, 33, 48, 51, 48, 50, 48, 34, 35, 48, 48, 48, 48, 48, 34], [33, 34, 48, 48, 48, 48, 36, 33, 34, 35, 35, 48, 48, 48, 34], [34, 34, 48, 50, 48, 33, 34, 33, 34, 34, 35, 48, 51, 48, 34], [34, 35, 48, 48, 51, 48, 34, 36, 35, 35, 47, 48, 50, 48, 33], [34, 34, 48, 48, 48, 48, 48, 34, 34, 47, 48, 51, 48, 48, 36], [33, 34, 35, 48, 48, 51, 50, 48, 48, 48, 51, 48, 48, 34, 35], [34, 34, 34, 35, 48, 51, 48, 51, 48, 50, 48, 48, 34, 33, 34], [34, 35, 36, 34, 34, 34, 48, 48, 48, 48, 34, 34, 33, 34, 35], [34, 35, 35, 34, 35, 35, 35, 38, 39, 35, 34, 35, 36, 34, 33], [34, 33, 35, 35, 36, 35, 35, 38, 39, 33, 35, 35, 33, 35, 34], [34, 35, 34, 34, 34, 33, 35, 38, 39, 35, 33, 34, 34, 34, 35]];
heightMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["Aryana", "human", 4], ["Kronus", "human", 4], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 4], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
}
mapReward = getMissionReward(mapName);
return([tileMap, heightMap, charMap, mapReward]);
}
function levelLavaMonsters(mapName) {
tileMap = [[48, 48, 50, 48, 48, 47, 48, 48, 49, 48, 45, 49, 50, 49, 48], [47, 44, 48, 51, 48, 48, 51, 49, 49, 47, 48, 48, 47, 48, 35], [48, 48, 50, 45, 50, 47, 49, 46, 48, 49, 48, 51, 51, 34, 33], [48, 49, 49, 48, 49, 48, 48, 48, 51, 50, 48, 51, 34, 35, 33], [48, 49, 47, 48, 48, 48, 51, 50, 48, 35, 34, 34, 34, 34, 34], [50, 49, 51, 48, 51, 50, 48, 51, 48, 34, 36, 33, 37, 34, 36], [51, 49, 48, 48, 48, 48, 51, 34, 34, 35, 33, 34, 34, 34, 34], [48, 49, 48, 46, 51, 50, 51, 35, 33, 34, 35, 36, 34, 33, 34], [48, 50, 48, 48, 48, 50, 51, 35, 34, 36, 34, 35, 34, 33, 34], [48, 48, 48, 51, 48, 51, 48, 34, 34, 33, 34, 33, 35, 34, 35]];
heightMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["flameskull1", "enemy", 3], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, ["flameskull1", "enemy", 2], 0, 0, 0, 0, 0, 0], [0, ["Aryana", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, ["flameskull1", "enemy", 3], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, ["Kronus", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, ["Kage", "human", 1], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
function levelLavaRiver(mapName) {
tileMap = [[41, 40, 39, 38, 40, 41, 41, 41, 38, 41, 40, 41, 41, 38, 41, 41, 38, 41, 41, 38], [38, 41, 39, 38, 38, 38, 41, 38, 39, 41, 41, 38, 40, 41, 41, 39, 40, 40, 38, 41], [41, 38, 38, 41, 39, 41, 40, 41, 41, 41, 41, 41, 41, 41, 40, 40, 41, 40, 38, 38], [34, 35, 34, 34, 34, 36, 42, 42, 42, 34, 35, 34, 34, 34, 41, 38, 38, 41, 39, 38], [34, 34, 36, 34, 35, 35, 42, 42, 42, 34, 35, 35, 34, 36, 34, 34, 41, 38, 41, 41], [34, 36, 34, 34, 35, 34, 42, 42, 42, 34, 35, 34, 35, 34, 37, 34, 34, 34, 34, 34], [41, 38, 41, 41, 41, 38, 41, 41, 41, 41, 38, 41, 41, 34, 34, 35, 35, 34, 36, 35], [41, 41, 40, 41, 40, 41, 40, 38, 38, 40, 41, 38, 41, 41, 34, 36, 34, 34, 35, 35], [41, 38, 41, 38, 38, 41, 39, 41, 39, 38, 41, 39, 38, 41, 41, 41, 38, 38, 41, 41], [41, 41, 38, 40, 39, 41, 41, 38, 41, 41, 38, 41, 41, 39, 41, 38, 40, 40, 38, 41]];
heightMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 3], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Aryana", "human", 3], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, ["skeleton2", "enemy", 4], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["skeleton2", "enemy", 4], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, ["flameskull1", "enemy", 1], 0, 0, 0, 0, 0, 0, 0, ["flameskull2", "enemy", 3], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["flameskull2", "enemy", 3], 0, 0, 0]];
mapReward = getMissionReward(mapName);
return([tileMap, heightMap, charMap, mapReward]);
}
function levelOgreLord(mapName) {
tileMap = [[34, 34, 35, 35, 39, 39, 39, 39, 39, 39, 39, 39, 39, 40, 39, 38, 35, 35, 35, 35], [34, 36, 35, 35, 39, 40, 39, 40, 39, 39, 39, 39, 39, 40, 39, 38, 35, 35, 36, 35], [35, 33, 35, 35, 35, 39, 39, 39, 40, 39, 39, 39, 41, 41, 41, 35, 35, 35, 33, 35], [33, 35, 35, 34, 34, 35, 35, 38, 39, 39, 39, 39, 39, 35, 35, 35, 35, 35, 33, 36], [34, 35, 35, 33, 37, 35, 35, 35, 39, 39, 39, 39, 35, 35, 35, 35, 35, 35, 35, 35], [33, 35, 36, 34, 35, 34, 35, 35, 39, 39, 39, 41, 35, 34, 33, 35, 35, 37, 35, 34], [35, 34, 35, 33, 36, 34, 35, 35, 39, 39, 39, 39, 35, 33, 35, 35, 34, 33, 35, 35], [36, 35, 37, 34, 35, 34, 35, 35, 40, 39, 39, 40, 35, 35, 35, 36, 35, 35, 34, 33], [34, 35, 35, 35, 33, 35, 35, 35, 39, 39, 39, 39, 35, 35, 35, 34, 34, 35, 35, 33], [34, 34, 35, 35, 35, 34, 33, 35, 41, 41, 40, 39, 34, 35, 35, 33, 35, 36, 34, 33], [35, 35, 35, 33, 37, 34, 34, 35, 39, 39, 41, 41, 35, 34, 33, 33, 37, 35, 34, 35], [35, 35, 34, 35, 35, 35, 33, 35, 39, 39, 40, 39, 35, 35, 33, 36, 35, 35, 35, 35], [35, 35, 34, 35, 36, 35, 34, 35, 39, 39, 39, 39, 35, 34, 35, 35, 35, 33, 35, 35], [35, 35, 36, 35, 35, 35, 35, 35, 39, 41, 39, 39, 35, 35, 34, 34, 34, 33, 35, 35], [35, 37, 35, 35, 33, 33, 35, 35, 39, 39, 41, 41, 35, 35, 37, 34, 36, 35, 33, 35], [35, 33, 34, 33, 35, 37, 35, 35, 39, 40, 39, 39, 35, 35, 34, 35, 33, 35, 35, 34], [35, 36, 33, 34, 36, 35, 35, 35, 41, 39, 39, 39, 35, 35, 33, 35, 35, 35, 35, 35], [35, 34, 33, 35, 34, 34, 35, 35, 39, 39, 40, 39, 35, 35, 36, 34, 35, 35, 33, 35], [35, 35, 34, 35, 35, 34, 35, 35, 40, 39, 39, 39, 35, 35, 34, 35, 35, 37, 33, 35], [35, 35, 33, 35, 34, 33, 35, 35, 39, 39, 39, 39, 35, 35, 35, 34, 35, 35, 35, 35]];
heightMap = [[0, 0, 0, 0, 1, 2, 3, 3, 3, 4, 4, 3, 3, 3, 2, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["ogre3", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["ogre1", "enemy", 2], ["ogre1", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["flameskull2", "enemy", 2], ["flameskull3", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["skeleton2", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["scorpion2", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["snake3", "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 4], 0, ["Aryana", "human", 4], 0, 0, 0, 0, 0, 0, 0, 0]];
mapReward = getMissionReward(mapName);
_root.missionType = "mission";
return([tileMap, heightMap, charMap, mapReward]);
}
function levelDeathRock(mapName) {
thisLevelEnemies = new Array();
thisLevelEnemies = ["skeleton1", "skeleton2", "flameskull2", "flameskull3", "ogre1"];
_root.missionType = "level";
randomMapNum = Math.ceil(Math.random() * 2);
if (randomMapNum == 1) {
tileMap = [[41, 40, 39, 38, 40, 41, 41, 41, 38, 41, 40, 41, 41, 38, 41, 41, 38, 41, 41, 38], [38, 41, 39, 38, 38, 38, 41, 38, 39, 41, 41, 38, 40, 41, 41, 39, 40, 40, 38, 41], [41, 38, 38, 41, 39, 41, 40, 41, 41, 41, 41, 41, 41, 41, 40, 40, 41, 40, 38, 38], [34, 35, 34, 34, 34, 36, 34, 42, 42, 34, 35, 34, 34, 34, 41, 38, 38, 41, 39, 38], [34, 34, 36, 34, 35, 35, 35, 42, 42, 34, 35, 35, 34, 36, 34, 34, 41, 38, 41, 41], [34, 36, 34, 34, 35, 34, 34, 42, 42, 34, 35, 34, 35, 34, 37, 34, 34, 34, 34, 34], [41, 38, 41, 41, 41, 38, 41, 41, 41, 41, 38, 41, 41, 34, 34, 35, 35, 34, 36, 35], [41, 41, 40, 41, 40, 41, 40, 38, 38, 40, 41, 38, 41, 41, 34, 36, 34, 34, 35, 35], [41, 38, 41, 38, 38, 41, 39, 41, 39, 38, 41, 39, 38, 41, 41, 41, 38, 38, 41, 41], [41, 41, 38, 40, 39, 41, 41, 38, 41, 41, 38, 41, 41, 39, 41, 38, 40, 40, 38, 41]];
heightMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kage", "human", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Kronus", "human", 3], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ["Aryana", "human", 3], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 4], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 4], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 1], 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 3], 0, 0, 0]];
} else if (randomMapNum == 2) {
tileMap = [[38, 38, 40, 38, 38, 41, 38, 38, 38, 38, 40, 38], [38, 39, 40, 38, 38, 38, 40, 38, 38, 40, 38, 38], [38, 39, 40, 38, 41, 38, 39, 38, 39, 38, 40, 38], [38, 40, 38, 40, 41, 38, 41, 38, 40, 40, 39, 38], [40, 38, 41, 40, 39, 39, 38, 38, 40, 41, 38, 38], [38, 38, 38, 38, 38, 38, 41, 38, 39, 40, 38, 38], [40, 38, 39, 41, 38, 40, 43, 40, 40, 41, 38, 38], [40, 38, 38, 38, 38, 42, 43, 42, 40, 38, 38, 39], [41, 38, 41, 40, 38, 43, 43, 42, 38, 38, 41, 38], [38, 40, 38, 40, 38, 42, 42, 43, 38, 38, 38, 38], [38, 38, 38, 38, 41, 43, 42, 43, 38, 38, 39, 38], [38, 41, 38, 39, 38, 42, 43, 43, 40, 38, 38, 38]];
heightMap = [[1, 1, 1, 2, 3, 3, 3, 2, 2, 2, 1, 1], [1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1], [2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [3, 2, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [3, 2, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1]];
charMap = [[0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, [getRandomLevelEnemy(thisLevelEnemies), "enemy", 2], 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, ["Kronus", "human", 4], 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, ["Kage", "human", 4], 0, ["Aryana", "human", 4], 0, 0, 0, 0]];
}
mapReward = getMissionReward(mapName);
return([tileMap, heightMap, charMap, mapReward]);
}
function mapShop(city) {
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
addMapTextbox();
textBoxPortrait.attachMovie("textBoxShop", "textBoxShop", textBoxPortrait.getNextHighestDepth());
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt", 35, 37, 410, 50, city + " Shop", 18, 0, false);
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2", 35, 65, 410, 120, ("Welcome to the " + city) + " shop! Please take a look at what we have to offer or feel free to sell any unwanted items to me.", 12, 6050119, false, true);
buyButtonMC = worldMapMC.mapLevelInfoMC.textBoxMC.createEmptyMovieClip("buyButtonMC", worldMapMC.mapLevelInfoMC.textBoxMC.getNextHighestDepth());
addText(buyButtonMC, "tfield", 45, 134, 40, 20, "Buy", 12, 6050119, false);
buyButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
buyButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
buyButtonMC.city = city;
buyButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.mapShopBuy(this.city);
};
sellButtonMC = worldMapMC.mapLevelInfoMC.textBoxMC.createEmptyMovieClip("sellButtonMC", worldMapMC.mapLevelInfoMC.textBoxMC.getNextHighestDepth());
addText(sellButtonMC, "tfield", 120, 134, 40, 20, "Sell", 12, 6050119, false);
sellButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
sellButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
sellButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.mapShopSell(this.city);
};
leaveButtonMC = worldMapMC.mapLevelInfoMC.textBoxMC.createEmptyMovieClip("leaveButtonMC", worldMapMC.mapLevelInfoMC.textBoxMC.getNextHighestDepth());
addText(leaveButtonMC, "tfield", 380, 134, 50, 20, "Leave", 12, 6050119, false);
leaveButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
leaveButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
leaveButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
};
}
function mapShopBuy(city) {
_root.worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.removeMovieClip();
shopBuyMC = worldMapMC.mapLevelInfoMC.createEmptyMovieClip("shopBuyMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth());
shopBuyMC.attachMovie("textBox1MC", "textBoxDescription", shopBuyMC.getNextHighestDepth(), {_x:230, _y:450});
shopBuyMC.attachMovie("textBoxGold", "textBoxGold", shopBuyMC.getNextHighestDepth(), {_x:560, _y:165});
addText(shopBuyMC.textBoxGold, "goldTxt", 15, 25, 100, 20, gold + " G", 13, 0, "right");
restAlertMC = shopBuyMC.attachMovie("textBox3MC", "mapLevelTxtBox", shopBuyMC.getNextHighestDepth(), {_x:230, _y:210});
addMapPortrait();
textBoxPortrait.attachMovie("textBoxShop", "textBoxShop", textBoxPortrait.getNextHighestDepth());
shopBuyMC._y = shopBuyMC._y - 100;
addText(shopBuyMC.mapLevelTxtBox, "titleTxt", 35, 37, 410, 50, city + " Shop", 18, 0, false);
shopBuyMC.mapLevelTxtBox.createEmptyMovieClip("itemHolder", shopBuyMC.mapLevelTxtBox.getNextHighestDepth());
shopInventoryArr = getShopInventory(city);
s = 0;
while (s < shopInventoryArr.length) {
shopItem = getRewardItemInfo(shopInventoryArr[s]);
shopItemMC = shopBuyMC.mapLevelTxtBox.itemHolder.createEmptyMovieClip("itemNameClip" + m, shopBuyMC.mapLevelTxtBox.itemHolder.getNextHighestDepth());
itemIcon = shopItemMC.attachMovie(shopItem.ICON, "ICON", shopItemMC.getNextHighestDepth(), {_x:40, _y:(s * 28) + 70});
addText(shopItemMC, "titleTxt", 70, (s * 28) + 75, 300, 20, shopItem.NAME, 11, 6050119, false);
addText(shopItemMC, "priceTxt", 260, (s * 28) + 75, 100, 20, shopItem.VAL + " G", 11, 0, "right");
addText(shopItemMC, "ownedTxt", 390, (s * 28) + 75, 100, 20, "Owned: " + shopGetOwnedAmt(shopItem), 10, 6050119, false);
shopItemMC.thisItem = shopItem;
if (shopItem.ATT == undefined) {
shopItemMC.type = "item";
} else {
shopItemMC.type = "equipment";
}
shopItemMC.city = city;
shopItemMC.onRollOver = function () {
this.titleTxt.textColor = 0;
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder.removeMovieClip();
if (this.type == "item") {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.createEmptyMovieClip("descriptionHolder", 1);
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder, "titleTxt", 40, 85, 400, 20, "Item Description", 16, 0, false);
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder, "descTXT", 40, 110, 400, 60, this.thisItem.DESC, 11, 6050119, false);
} else if (this.thisItem.TYPE == 3) {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.createEmptyMovieClip("descriptionHolder", 1);
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder, "titleTxt", 40, 85, 400, 20, "Item Description", 16, 0, false);
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder, "descTXT", 40, 110, 400, 60, this.thisItem.DESC, 11, 6050119, false);
} else {
_root.shopEquipmentDetails(this.thisItem);
}
};
shopItemMC.onRollOut = function () {
this.titleTxt.textColor = 6050119 /* 0x5C5147 */;
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder.removeMovieClip();
};
shopItemMC.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
shopItemConfirmation(this, city);
};
s++;
}
shopCheckForScroll(shopInventoryArr);
shopLeaveButton = restAlertMC.attachMovie("shopLeaveButton", "shopLeaveButton", restAlertMC.getNextHighestDepth());
shopLeaveButton._x = 385;
shopLeaveButton._y = 35;
shopLeaveButton.onRollOver = function () {
this.tfield.textColor = 0;
};
shopLeaveButton.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
shopLeaveButton.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
};
}
function getShopInventory(city) {
switch (city) {
case "Athelas" :
return(["Healing Herb", "sm. HP Potion", "Antidote", "Mana Root", "Rusty Lockpick", "Iron Sword", "Iron Armor", "Cloak", "Wand", "Iron Ring"]);
case "Sandos" :
return(["HP Potion", "sm. Mana Potion", "Antidote", "Resurrection", "Iron Lockpick", "Broad Sword", "Chain Mail", "Silk Robe", "Element Staff", "Long Bow", "Iron Doublet", "Ruby Pin"]);
case "Damascus" :
return(["lg. HP Potion", "Mana Potion", "Elixer", "Resurrection", "Ultra Lockpick", "Falchion", "Plate Armor", "Amber Robe", "Lava Wand", "Marksman Bow", "Rose Gilet", "Speed Boots"]);
}
}
function shopEquipmentDetails(item) {
descriptionHolder = _root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.createEmptyMovieClip("descriptionHolder", 1);
defenderCount = 0;
d = 0;
while (d < defenderArr.length) {
c = 0;
while (c < item.classType.length) {
if (defenderArr[d].classType == item.classType[c]) {
var _local2 = descriptionHolder.attachMovie("defenders", "defender_" + defenderArr[d].name, descriptionHolder.getNextHighestDepth(), {_x:(defenderCount * 95) + 65, _y:120});
_local2.gotoAndStop(defenderArr[d].name);
defenderCount++;
equipDiff = shopCompareStats(defenderArr[d], item);
if (equipDiff[0] > 1) {
diffIcon = descriptionHolder.attachMovie("shopDiffIncrease", "diff" + defenderArr[d].name, descriptionHolder.getNextHighestDepth(), {_x:defenderCount * 95, _y:105});
addText(descriptionHolder, "diffTxt", defenderCount * 93, 125, 120, 20, equipDiff[0], 12, equipDiff[1], false);
var _local4 = {r:255, g:255, b:255};
diffIcon.fluxTint(_local4, 0, 30, 8, true);
} else if (equipDiff[0] < 0) {
diffIcon = descriptionHolder.attachMovie("shopDiffDecrease", "diff" + defenderArr[d].name, descriptionHolder.getNextHighestDepth(), {_x:defenderCount * 95, _y:105});
addText(descriptionHolder, "diffTxt", defenderCount * 93, 125, 120, 20, equipDiff[0], 12, equipDiff[1], false);
var _local4 = {r:255, g:255, b:255};
diffIcon.fluxTint(_local4, 0, 30, 8, true);
} else {
diffIcon = descriptionHolder.attachMovie("shopDiffEqual", "diff" + defenderArr[d].name, descriptionHolder.getNextHighestDepth(), {_x:defenderCount * 95, _y:105});
}
diffIcon._height = diffIcon._height * 0.75;
diffIcon._width = diffIcon._width * 0.75;
}
c++;
}
d++;
}
}
function shopCompareStats(char, item) {
s = 0;
if (s < item.ATT.length) {
return(compareAttributes(item.ATT[s][0], item, char));
}
}
function shopItemConfirmation(item, city) {
overlayMC = worldMapMC.mapLevelInfoMC.shopBuyMC.attachMovie("overlayGraphic", "overlayGraphic2", worldMapMC.mapLevelInfoMC.shopBuyMC.getNextHighestDepth());
overlayMC._alpha = 50;
overlayMC.onRollOver = function () {
this.useHandCursor = false;
};
shopConfirmMC = worldMapMC.mapLevelInfoMC.shopBuyMC.attachMovie("statusItemAlert", "shopConfirmMC", worldMapMC.mapLevelInfoMC.shopBuyMC.getNextHighestDepth(), {_x:375, _y:285});
_root.addText(shopConfirmMC, "titleTxt", 35, 40, 400, 20, "Buy this item?", 16, 0, false);
trace((((("GOLD: " + _root.gold) + " ITEM VAL: ") + item.thisItem.VAL) + " DIF: ") + (_root.gold - item.thisItem.VAL));
if ((_root.gold - item.thisItem.VAL) < 0) {
yesButtonMC = shopConfirmMC.createEmptyMovieClip("yesButtonMC", shopConfirmMC.getNextHighestDepth());
addText(yesButtonMC, "tfield", 20, 72, 160, 20, "Not enough money", 12, 6050119);
} else {
yesButtonMC = shopConfirmMC.createEmptyMovieClip("yesButtonMC", shopConfirmMC.getNextHighestDepth());
addText(yesButtonMC, "tfield", 85, 72, 50, 20, "Yes", 12, 6050119, false);
yesButtonMC.thisItem = item;
yesButtonMC.city = city;
yesButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
yesButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
yesButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
shopBuyItem(this.thisItem, this.city);
_root.worldMapMC.mapLevelInfoMC.overlayGraphic2.removeMovieClip();
_root.worldMapMC.mapLevelInfoMC.shopConfirmMC.removeMovieClip();
};
}
noButtonMC = shopConfirmMC.createEmptyMovieClip("noButtonMC", shopConfirmMC.getNextHighestDepth());
addText(noButtonMC, "tfield", 85, 100, 50, 20, "No", 12, 6050119, false);
noButtonMC.thisItem = item;
noButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
noButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
noButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.overlayGraphic2.removeMovieClip();
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.shopConfirmMC.removeMovieClip();
};
}
function shopBuyItem(item, city) {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
if (item.type == "item") {
assignItem(item.thisItem.NAME);
} else {
assignEquipment(item.thisItem.NAME);
}
_root.gold = _root.gold - item.thisItem.VAL;
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxGold.goldTxt.removeTextField();
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxGold, "goldTxt", 15, 25, 100, 20, _root.gold + " G", 13, 0, "right");
_root.mapShopBuy(city);
}
function shopGetOwnedAmt(item, selling) {
if (shopItem.ATT == undefined) {
e = 0;
while (e < inventory.length) {
if (inventory[e].NAME == item.NAME) {
return(inventory[e].QTY);
}
e++;
}
return(0);
}
equipQTYCount = 0;
e = 0;
while (e < equipment.length) {
if (equipment[e].NAME == item.NAME) {
if (selling == true) {
if (equipment[e].USED != true) {
equipQTYCount++;
}
} else {
equipQTYCount++;
}
}
e++;
}
return(equipQTYCount);
}
function mapShopSell(city) {
_root.worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.removeMovieClip();
shopBuyMC = worldMapMC.mapLevelInfoMC.createEmptyMovieClip("shopBuyMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth());
shopBuyMC.attachMovie("textBox1MC", "textBoxDescription", shopBuyMC.getNextHighestDepth(), {_x:230, _y:450});
shopBuyMC.attachMovie("textBoxGold", "textBoxGold", shopBuyMC.getNextHighestDepth(), {_x:560, _y:165});
addText(shopBuyMC.textBoxGold, "goldTxt", 15, 25, 100, 20, gold + " G", 13, 0, "right");
restAlertMC = shopBuyMC.attachMovie("textBox3MC", "mapLevelTxtBox", shopBuyMC.getNextHighestDepth(), {_x:230, _y:210});
addMapPortrait();
textBoxPortrait.attachMovie("textBoxShop", "textBoxShop", textBoxPortrait.getNextHighestDepth());
shopBuyMC._y = shopBuyMC._y - 100;
addText(shopBuyMC.mapLevelTxtBox, "titleTxt", 35, 37, 410, 50, "Sell your items", 18, 0, false);
shopBuyMC.mapLevelTxtBox.createEmptyMovieClip("itemHolder", shopBuyMC.mapLevelTxtBox.getNextHighestDepth());
tempArr = new Array();
t = 0;
while (t < equipment.length) {
if (equipment[t].USED != true) {
inTempArr = false;
j = 0;
while (j < tempArr.length) {
if (tempArr[j].NAME == equipment[t].NAME) {
inTempArr = true;
}
j++;
}
if (inTempArr != true) {
tempArr.push(equipment[t]);
}
}
t++;
}
equipmentInventoryArr = new Array();
equipmentInventoryArr = tempArr.concat(inventory);
sCount = 0;
s = 0;
while (s < equipmentInventoryArr.length) {
shopItem = equipmentInventoryArr[s];
if (shopItem.VAL != null) {
shopItemMC = shopBuyMC.mapLevelTxtBox.itemHolder.createEmptyMovieClip("itemNameClip" + m, shopBuyMC.mapLevelTxtBox.itemHolder.getNextHighestDepth());
itemIcon = shopItemMC.attachMovie(shopItem.ICON, "ICON", shopItemMC.getNextHighestDepth(), {_x:40, _y:(sCount * 28) + 70});
addText(shopItemMC, "titleTxt", 70, (sCount * 28) + 75, 300, 20, shopItem.NAME, 11, 6050119, false);
addText(shopItemMC, "priceTxt", 260, (sCount * 28) + 75, 100, 20, Math.ceil(shopItem.VAL / 2) + " G", 11, 0, "right");
addText(shopItemMC, "ownedTxt", 390, (sCount * 28) + 75, 100, 20, "Avail: " + shopGetOwnedAmt(shopItem, true), 10, 6050119, false);
shopItemMC.thisItem = shopItem;
if (shopItem.ATT == undefined) {
shopItemMC.type = "item";
} else {
shopItemMC.type = "equipment";
}
shopItemMC.city = city;
shopItemMC.onRollOver = function () {
this.titleTxt.textColor = 0;
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder.removeMovieClip();
if (this.type == "item") {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.createEmptyMovieClip("descriptionHolder", 1);
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder, "titleTxt", 40, 85, 400, 20, "Item Description", 16, 0, false);
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder, "descTXT", 40, 110, 400, 60, this.thisItem.DESC, 11, 6050119, false);
} else if (this.thisItem.TYPE == 3) {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.createEmptyMovieClip("descriptionHolder", 1);
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder, "titleTxt", 40, 85, 400, 20, "Item Description", 16, 0, false);
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder, "descTXT", 40, 110, 400, 60, this.thisItem.DESC, 11, 6050119, false);
} else {
_root.shopEquipmentDetails(this.thisItem);
}
};
shopItemMC.onRollOut = function () {
this.titleTxt.textColor = 6050119 /* 0x5C5147 */;
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxDescription.descriptionHolder.removeMovieClip();
};
shopItemMC.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
shopSellConfirmation(this, city);
};
sCount++;
}
s++;
}
shopCheckForScroll(equipmentInventoryArr);
shopLeaveButton = restAlertMC.attachMovie("shopLeaveButton", "shopLeaveButton", restAlertMC.getNextHighestDepth());
shopLeaveButton._x = 385;
shopLeaveButton._y = 35;
shopLeaveButton.onRollOver = function () {
this.tfield.textColor = 0;
};
shopLeaveButton.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
shopLeaveButton.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.worldMapMC.mapLevelInfoMC.removeMovieClip();
};
}
function shopSellConfirmation(item, city) {
overlayMC = worldMapMC.mapLevelInfoMC.shopBuyMC.attachMovie("overlayGraphic", "overlayGraphic2", worldMapMC.mapLevelInfoMC.shopBuyMC.getNextHighestDepth());
overlayMC._alpha = 50;
overlayMC.onRollOver = function () {
this.useHandCursor = false;
};
shopConfirmMC = worldMapMC.mapLevelInfoMC.shopBuyMC.attachMovie("statusItemAlert", "shopConfirmMC", worldMapMC.mapLevelInfoMC.shopBuyMC.getNextHighestDepth(), {_x:375, _y:285});
_root.addText(shopConfirmMC, "titleTxt", 35, 40, 400, 20, "Sell this item?", 16, 0, false);
yesButtonMC = shopConfirmMC.createEmptyMovieClip("yesButtonMC", shopConfirmMC.getNextHighestDepth());
addText(yesButtonMC, "tfield", 85, 72, 50, 20, "Yes", 12, 6050119, false);
yesButtonMC.thisItem = item;
yesButtonMC.city = city;
yesButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
yesButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
yesButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
shopSellItem(this.thisItem, this.city);
_root.worldMapMC.mapLevelInfoMC.overlayGraphic2.removeMovieClip();
_root.worldMapMC.mapLevelInfoMC.shopConfirmMC.removeMovieClip();
};
noButtonMC = shopConfirmMC.createEmptyMovieClip("noButtonMC", shopConfirmMC.getNextHighestDepth());
addText(noButtonMC, "tfield", 85, 100, 50, 20, "No", 12, 6050119, false);
noButtonMC.thisItem = item;
noButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
noButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
noButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.overlayGraphic2.removeMovieClip();
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.shopConfirmMC.removeMovieClip();
};
}
function shopSellItem(item, city) {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
if (item.type == "item") {
removeItemQTY(item.thisItem);
} else {
dropEquipment(item.thisItem);
}
_root.gold = _root.gold + Math.ceil(item.thisItem.VAL / 2);
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxGold.goldTxt.removeTextField();
_root.addText(_root.worldMapMC.mapLevelInfoMC.shopBuyMC.textBoxGold, "goldTxt", 15, 25, 100, 20, _root.gold + " G", 13, 0, "right");
_root.mapShopSell(city);
}
function shopCheckForScroll(scrollArr) {
if (scrollArr.length > 7) {
maskMC = worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.attachMovie("windowActionsMask", "windowActionsMask", worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.getNextHighestDepth(), {_x:240, _y:176});
maskMC._width = 440;
maskMC._height = 198;
shopBuyMC.mapLevelTxtBox.itemHolder.setMask(maskMC);
var _local4 = worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.attachMovie("menuArrow", "downArrow", worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.getNextHighestDepth(), {_x:250, _y:280});
var _local3 = worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.attachMovie("menuArrow", "upArrow", worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.getNextHighestDepth(), {_x:250, _y:60});
_local3._visible = false;
_local4._yscale = -100;
_root.scrollNum = 0;
_root.arrSize = scrollArr.length + 1;
_local4.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if (_root.scrollNum < (_root.arrSize - 7)) {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.itemHolder._y = _root.worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.itemHolder._y - 28;
_root.scrollNum++;
_root.shopCheckScrollArrows();
}
};
_local4.onRollOver = function () {
this.gotoAndStop(2);
};
_local4.onRollOut = function () {
this.gotoAndStop(1);
};
_local3.onRelease = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
if ((_root.scrollNum + _root.arrSize) > _root.arrSize) {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.itemHolder._y = _root.worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.itemHolder._y + 28;
_root.scrollNum--;
_root.shopCheckScrollArrows();
}
};
_local3.onRollOver = function () {
this.gotoAndStop(2);
};
_local3.onRollOut = function () {
this.gotoAndStop(1);
};
}
}
function shopCheckScrollArrows() {
if ((_root.scrollNum + 8) == _root.arrSize) {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.downArrow._visible = false;
} else {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.downArrow._visible = true;
}
if ((_root.scrollNum + 7) == 7) {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.upArrow._visible = false;
} else {
_root.worldMapMC.mapLevelInfoMC.shopBuyMC.mapLevelTxtBox.upArrow._visible = true;
}
}
function mapWarriorGuild() {
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
addMapTextbox();
textBoxPortrait.attachMovie("textBoxWarrior", "textBoxWarrior", textBoxPortrait.getNextHighestDepth());
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt" + _root.warriorGuildCount, 35, 37, 410, 50, "Warrior Guild", 18, 0, false);
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2" + _root.warriorGuildCount, 35, 65, 410, 120, getWarriorGuildTxt(_root.warriorGuildCount), 12, 6050119, false, true);
closeButtonMC = restAlertMC.createEmptyMovieClip("closeButtonMC", restAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 300, 140, 190, 20, "Continue", 12, 6050119);
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
if (_root.warriorGuildCount == 0) {
_root.loadWorldMap(_root.levelsUnlocked);
} else if (_root.warriorGuildCount == 1) {
_root.giveFlameSwordAlert();
_root.warriorGuildCount++;
} else if (_root.warriorGuildCount == 2) {
_root.loadWorldMap(_root.levelsUnlocked);
}
};
restAlertMC.attachMovie("textBoxArrow", "textBoxArrow", restAlertMC.getNextHighestDepth(), {_x:344, _y:141});
}
function getWarriorGuildTxt(num) {
switch (num) {
case 0 :
return(("Welcome to the Warrior Guild. Come back when you have defeated 100 enemies, and we will give you an extremely powerful elemental sword. \n\nYou have currently defeated " + _root.enemiesKilledCount) + " enemies.");
case 1 :
return("Wow, you must be very strong to be able to defeat those enemies so quickly. As I promised, here is your Flame Sword.");
case 2 :
return("Never stop fighting, there are always bigger enemies to defeat and better treasures to discover.");
}
}
function giveFlameSwordAlert() {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
assignEquipment("Flame Sword");
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
defenderAlertMC = worldMapMC.mapLevelInfoMC.attachMovie("textBox2MC", "textBoxMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:297, _y:197});
addText(defenderAlertMC, "titleTxt" + _root.grandpaCount, 5, 45, 230, 50, "Item Aquired", 18, 0);
addText(defenderAlertMC, "titleTxt2" + _root.grandpaCount, 5, 130, 230, 80, "Flame Sword", 12, 6050119);
var _local3 = defenderAlertMC.attachMovie("iconFlameSword", "iconFlameSword", defenderAlertMC.getNextHighestDepth(), {_x:105, _y:90});
closeButtonMC = defenderAlertMC.createEmptyMovieClip("closeButtonMC", defenderAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 20, 170, 190, 20, "Close", 12, 6050119);
closeButtonMC.defenderName = defenderName;
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.loadWorldMap(_root.levelsUnlocked);
};
}
function mapThiefGuild() {
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
addMapTextbox();
textBoxPortrait.attachMovie("textBoxThief", "textBoxThief", textBoxPortrait.getNextHighestDepth());
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt" + _root.grandpaCount, 35, 37, 410, 50, "Thief Guild", 18, 0, false);
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2" + _root.grandpaCount, 35, 65, 410, 80, getThiefGuildTxt(_root.thiefGuildCount), 12, 6050119, false, true);
closeButtonMC = restAlertMC.createEmptyMovieClip("closeButtonMC", restAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 300, 140, 190, 20, "Continue", 12, 6050119);
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
if (_root.thiefGuildCount == 0) {
_root.loadWorldMap(_root.levelsUnlocked);
} else if (_root.thiefGuildCount == 1) {
_root.giveThiefGlovesAlert();
_root.thiefGuildCount++;
} else if (_root.thiefGuildCount == 2) {
_root.loadWorldMap(_root.levelsUnlocked);
}
};
restAlertMC.attachMovie("textBoxArrow", "textBoxArrow", restAlertMC.getNextHighestDepth(), {_x:344, _y:141});
}
function getThiefGuildTxt(num) {
switch (num) {
case 0 :
return(("Welcome to the Thief Guild. Come back when you have unlocked 50 treasures, and we will give you a very rare item to make your thief skills more enjoyable. \nYou have currently unlocked " + _root.treasuresUnlocked) + " treasures.");
case 1 :
return("Excellent! As promised, here are your very own Thief Gloves. Where these during a battle to double the chance of enemies dropping treasures after you defeat them.");
case 2 :
return("I hope you are enjoying your Thief Gloves.");
}
}
function giveThiefGlovesAlert() {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
assignEquipment("Thief Gloves");
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
defenderAlertMC = worldMapMC.mapLevelInfoMC.attachMovie("textBox2MC", "textBoxMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:297, _y:197});
addText(defenderAlertMC, "titleTxt" + _root.grandpaCount, 5, 45, 230, 50, "Item Aquired", 18, 0);
addText(defenderAlertMC, "titleTxt2" + _root.grandpaCount, 5, 130, 230, 80, "Thief Gloves", 12, 6050119);
var _local3 = defenderAlertMC.attachMovie("iconThiefGloves", "iconThiefGloves", defenderAlertMC.getNextHighestDepth(), {_x:105, _y:90});
closeButtonMC = defenderAlertMC.createEmptyMovieClip("closeButtonMC", defenderAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 20, 170, 190, 20, "Close", 12, 6050119);
closeButtonMC.defenderName = defenderName;
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.loadWorldMap(_root.levelsUnlocked);
};
}
function mapMageGuild() {
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
spellTeachArr = findSpellToTeach();
addMapTextbox();
textBoxPortrait.attachMovie("textBoxMage", "textBoxMage", textBoxPortrait.getNextHighestDepth());
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt" + _root.grandpaCount, 35, 37, 410, 50, "Mage Guild", 18, 0, false);
mageGuildTxt = getMageGuildTxt(spellTeachArr[0], spellTeachArr[1]);
if (spellTeachArr == null) {
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2" + _root.grandpaCount, 35, 65, 410, 80, "You have learned everything you can from us. Please go out and protect the world with your powerful spells.", 12, 6050119, false, true);
} else {
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2" + _root.grandpaCount, 35, 65, 410, 80, mageGuildTxt[0], 12, 6050119, false, true);
}
closeButtonMC = restAlertMC.createEmptyMovieClip("closeButtonMC", restAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 300, 140, 190, 20, "Continue", 12, 6050119);
closeButtonMC.giveSpell = mageGuildTxt[1];
closeButtonMC.spellName = spellTeachArr[0];
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
this.tfield.textColor = 0;
if (this.giveSpell != true) {
_root.loadWorldMap(_root.levelsUnlocked);
} else {
_root.giveSpellAlert(this.spellName);
}
};
restAlertMC.attachMovie("textBoxArrow", "textBoxArrow", restAlertMC.getNextHighestDepth(), {_x:344, _y:141});
}
function getMageGuildTxt(spellName, reqLvl) {
if (reqLvl == undefined) {
return([null, false]);
}
if (_root.defenderArr[1].lvl >= reqLvl) {
return([("Congratulations, you are now able to learn " + spellName) + ". Please use this scroll to memorize this spell.", true]);
}
return([("Welcome young mage. We have many spells to teach you when you are ready. Please come back when you are level " + reqLvl) + " to learn your next spell.", false]);
}
function findSpellToTeach() {
checkSpellsArr = [["POISON", 5, "Poison Scroll"], ["SHOCK", 7, "Shock Scroll"], ["FREEZE", 9, "Freeze Scroll"]];
s1 = 0;
while (s1 < checkSpellsArr.length) {
knowsSpell = false;
s = 0;
while (s < defenderArr[1].spells.length) {
if (defenderArr[1].spells[s] == checkSpellsArr[s1][0]) {
knowsSpell = true;
}
s++;
}
if (knowsSpell == false) {
hasScroll = false;
s2 = 0;
while (s2 < _root.inventory.length) {
if (_root.inventory[s2].NAME == checkSpellsArr[s1][2]) {
hasScroll = true;
}
s2++;
}
if (hasScroll == false) {
return([checkSpellsArr[s1][0], checkSpellsArr[s1][1]]);
}
}
s1++;
}
return(null);
}
function giveSpellAlert(spellName) {
if (_root.soundOn == true) {
_root.foundItemSnd.start();
}
switch (spellName) {
case "POISON" :
assignItem("Poison Scroll");
break;
case "SHOCK" :
assignItem("Shock Scroll");
break;
case "FREEZE" :
assignItem("Freeze Scroll");
}
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
defenderAlertMC = worldMapMC.mapLevelInfoMC.attachMovie("textBox2MC", "textBoxMC", worldMapMC.mapLevelInfoMC.getNextHighestDepth(), {_x:297, _y:197});
addText(defenderAlertMC, "titleTxt" + _root.grandpaCount, 5, 45, 230, 50, "Item Aquired", 18, 0);
addText(defenderAlertMC, "titleTxt2" + _root.grandpaCount, 5, 130, 230, 80, spellName + " SCROLL", 12, 6050119);
var _local3 = defenderAlertMC.attachMovie("iconSpellScroll", "iconSpellScroll", defenderAlertMC.getNextHighestDepth(), {_x:105, _y:90});
closeButtonMC = defenderAlertMC.createEmptyMovieClip("closeButtonMC", defenderAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 20, 170, 190, 20, "Close", 12, 6050119);
closeButtonMC.defenderName = defenderName;
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.loadWorldMap(_root.levelsUnlocked);
};
}
function endGameAlert() {
mapLevelInfoMC = _root.worldMapMC.createEmptyMovieClip("mapLevelInfoMC", worldMapMC.getNextHighestDepth());
overlayMC = mapLevelInfoMC.attachMovie("overlayGraphic", "overlayGraphic", 1);
overlayMC.onRollOver = function () {
this.useHandCursor = false;
};
worldMapMC.mapLevelInfoMC.textBoxMC.removeMovieClip();
worldMapMC.mapLevelInfoMC.mapLevelTxtBox.removeMovieClip();
addMapTextbox();
worldMapMC.mapLevelInfoMC.textBoxMC._x = worldMapMC.mapLevelInfoMC.textBoxMC._x - 50;
worldMapMC.mapLevelInfoMC.textBoxMC.textBoxPortrait.removeMovieClip();
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt" + _root.grandpaCount, 35, 37, 410, 50, "Congratulations!", 18, 0, false);
addText(worldMapMC.mapLevelInfoMC.textBoxMC, "titleTxt2" + _root.grandpaCount, 35, 65, 410, 80, "You have defeated the Ogre Lord and have made this land a safe place once again, but your adventure is still far from over. There are still many rare treasures to be found out there!", 12, 6050119, false, true);
closeButtonMC = restAlertMC.createEmptyMovieClip("closeButtonMC", restAlertMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 300, 140, 190, 20, "Continue", 12, 6050119);
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
if (_root.soundOn == true) {
_root.buttonSnd.start();
}
_root.loadWorldMap(_root.levelsUnlocked);
};
restAlertMC.attachMovie("textBoxArrow", "textBoxArrow", restAlertMC.getNextHighestDepth(), {_x:344, _y:141});
}
function checkSO() {
mySave = SharedObject.getLocal("tacticsSave");
}
function saveGame() {
saveGameVars();
if (mySave.flush() == true) {
trace("SAVED SUCCESSFULLY");
} else {
trace("ERROR SAVING");
}
mySave.flush();
}
function saveGameVars() {
trace("SAVING GAME");
mySave.data.gold = Number(gold);
mySave.data.enemiesKilledCount = Number(enemiesKilledCount);
mySave.data.timePlayed = Number(timePlayed);
mySave.data.lockpicking = Number(lockpicking);
mySave.data.inventory = new Array();
mySave.data.inventory = duplicateArray(inventory);
mySave.data.treasures = new Array();
mySave.data.treasures = duplicateArray(treasures);
mySave.data.treasuresUnlocked = treasuresUnlocked;
mySave.data.showTreasureTutorial = showTreasureTutorial;
mySave.data.equipment = new Array();
mySave.data.equipment = duplicateArray(equipment);
mySave.data.defenderArr = new Array();
mySave.data.defenderArr = _root.duplicateArray(_root.defenderArr);
mySave.data.tutorialNum = Number(tutorialNum);
mySave.data.tutorialCompleted = tutorialCompleted;
mySave.data.grandpaCount = Number(grandpaCount);
mySave.data.warriorGuildCount = Number(warriorGuildCount);
mySave.data.thiefGuildCount = Number(thiefGuildCount);
mySave.data.levelsUnlocked = Number(levelsUnlocked);
mySave.data.missionsArr = new Array();
mySave.data.missionsArr = missionsArr;
showSaveAlert();
}
function duplicateArray(arrName) {
tempArrCopy = new Array();
d = 0;
while (d < arrName.length) {
if (typeof(arrName[d]) == "object") {
newObj = arrName[d].copy();
} else {
newObj = arrName[d].copy2();
}
tempArrCopy.push(newObj);
trace("DUPLICATING: " + newObj);
d++;
}
return(tempArrCopy);
}
function saveDefenders() {
game.data.char = new Object();
game.data.char.health = Number(char.health);
game.data.char.mana = Number(char.mana);
game.data.char = new Object();
game.data.char.name = String(defName);
game.data.char.classType = String("Knight");
game.data.char.lvl = Number(char.lvl);
game.data.char.HP = Number(char.HP);
game.data.char.HPMax = game.data.char.HP;
game.data.char.MP = Number(char.MP);
game.data.char.MPMax = game.data.char.MP;
game.data.char.DEF = Number(char.DEF);
game.data.char.STR = Number(char.STR);
game.data.char.MAG = Number(char.MAG);
game.data.char.EXP = Number(char.EXP);
game.data.char.SPD = Number(char.SPD);
game.data.char.LCK = Number(char.LCK);
game.data.char.range = Number(char.range);
game.data.char.attacks = new Array();
game.data.char.attacks = char.attacks;
game.data.char.spells = new Array();
game.data.char.spells = char.spells;
game.data.char.ailments = new Array();
game.data.char.ailments = char.ailments;
game.data.char.WEAPON = char.WEAPON;
game.data.char.ARMOR = char.ARMOR;
game.data.char.ACCESSORY = char.ACCESSORY;
}
function showSaveAlert() {
createEmptyMovieClip("tutScreen", 20);
tutScreen._alpha = 0;
var _local3 = new mx.transitions.Tween(tutScreen, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 1, true);
overlayMC = tutScreen.attachMovie("overlayGraphic", "overlayGraphic", 1);
overlayMC.onRollOver = function () {
this.useHandCursor = false;
};
textBoxMC = tutScreen.attachMovie("textBox2MC", "textBoxMC", tutScreen.getNextHighestDepth(), {_x:280, _y:190});
addText(textBoxMC, "titleTxt2" + _root.tutorialNum, 50, 65, 160, 300, "Your progress has been saved.", 15, 6050119, false, true);
closeButtonMC = textBoxMC.createEmptyMovieClip("closeButtonMC", textBoxMC.getNextHighestDepth());
addText(closeButtonMC, "tfield", 25, 135, 190, 20, "Continue", 12, 6050119);
closeButtonMC.onRollOver = function () {
this.tfield.textColor = 0;
};
closeButtonMC.onRollOut = function () {
this.tfield.textColor = 6050119 /* 0x5C5147 */;
};
closeButtonMC.onPress = function () {
_root.tutScreen.removeMovieClip();
};
textBoxMC.attachMovie("textBoxArrow", "textBoxArrow", textBoxMC.getNextHighestDepth(), {_x:70, _y:136});
}
function loadSavedVars() {
gold = mySave.data.gold;
enemiesKilledCount = mySave.data.enemiesKilledCount;
timePlayed = mySave.data.timePlayed;
lockpicking = mySave.data.lockpicking;
inventory = mySave.data.inventory;
treasures = mySave.data.treasures;
treasuresUnlocked = mySave.data.treasuresUnlocked;
showTreasureTutorial = mySave.data.showTreasureTutorial;
equipment = mySave.data.equipment;
defenderArr = mySave.data.defenderArr;
tutorialNum = mySave.data.tutorialNum;
tutorialCompleted = mySave.data.tutorialCompleted;
grandpaCount = mySave.data.grandpaCount;
warriorGuildCount = mySave.data.warriorGuildCount;
thiefGuildCount = mySave.data.thiefGuildCount;
levelsUnlocked = mySave.data.levelsUnlocked;
curMission = null;
missionsArr = mySave.data.missionsArr;
}
keylistener = new Object();
keylistener.onKeyDown = function () {
if (Key.getCode() == 32) {
_root.spaceDown = true;
}
};
keylistener.onKeyUp = function () {
if (Key.getCode() == 32) {
_root.spaceDown = false;
}
};
Key.addListener(keylistener);
var arV = new Array();
var arH = new Array();
var wSq = 30;
var hSq = 30;
var nbSqColor = 16777215;
var nbSpeed = 5;
var nbIHD = 1;
var nbIVD = 3;
var xMask = 0;
var yMask = 0;
var wMask = 800;
var hMask = 600;
var nbCols = Math.ceil(wMask / wSq);
var nbRows = Math.ceil(hMask / hSq);
var nbTotal = (nbCols * nbRows);
var nbOK = 0;
var nbMidOK = false;
var nbV = arV.length;
var nbH = arH.length;
var initSquare = new Object();
initSquare.onEnterFrame = function () {
if (this.init) {
makeARectangle(this, nbSqColor, 100);
this._x = (this.ix * wSq) + (wSq / 2);
this._y = (this.jy * hSq) + (hSq / 2);
this._xscale = (this._yscale = 0);
switch (this.IHD) {
case 0 :
this.lagIx = 0;
break;
case 1 :
this.lagIx = this.ix;
break;
case 2 :
this.lagIx = nbCols - this.ix;
break;
case 3 :
this.lagIx = Math.abs((nbCols / 2) - this.ix);
break;
case 4 :
this.lagIx = Math.min(this.ix, nbCols - this.ix);
}
switch (this.IVD) {
case 0 :
this.lagIy = 0;
break;
case 1 :
this.lagIy = this.jy;
break;
case 2 :
this.lagIy = nbRows - this.jy;
break;
case 3 :
this.lagIy = Math.abs((nbRows / 2) - this.jy);
break;
case 4 :
this.lagIy = Math.min(this.jy, nbRows - this.jy);
}
this.lagI = this.lagIx + this.lagIy;
this.speed = nbSpeed;
this.t = 0;
this.init = false;
nbMidOK = false;
} else if (this.t >= this.lagI) {
this._xscale = this._xscale + this.speed;
this._yscale = this._yscale + this.speed;
if ((this._xscale >= 100) || (this._yscale >= 100)) {
this._xscale = 100;
this._yscale = 100;
delete this.onEnterFrame;
nbOK++;
this.starting = false;
this.t = 0;
if (nbOK >= nbTotal) {
finishedGameMask();
nbMidOK = true;
nbOK = 0;
}
}
} else {
this.t = this.t + 1;
}
};
treasureEasy = new Array();
treasureEasy = [["Gold", 40, Math.floor(Math.random() * 15) + 15], ["Healing Herb", 60], ["Mana Root", 80], ["Antidote", 100]];
treasureMedium = new Array();
treasureMedium = [["Gold", 40, Math.floor(Math.random() * 15) + 75], ["sm. HP Potion", 60], ["Iron Ring", 80], ["Rusty Lockpick", 100]];
treasureHard = new Array();
treasureHard = [["Gold", 40, Math.floor(Math.random() * 55) + 120], ["Iron Lockpick", 50], ["sm. Mana Potion", 70], ["HP Potion", 90], ["Ruby Pin", 100]];
treasureVeryHard = new Array();
treasureVeryHard = [["Gold", 30, Math.floor(Math.random() * 80) + 220], ["Resurrection", 40], ["Mana Potion", 50], ["lg. HP Potion", 60], ["Elixer", 70], ["Mega Elixer", 80], ["Iron Tusk", 90], ["Magic Tonic", 100]];
Object.prototype.copy2 = function () {
var _local2;
var _local3 = new this.__proto__.constructor();
for (_local2 in this) {
_local3[_local2] = this[_local2];
}
return(_local3);
};
ASSetPropFlags(Object.prototype, "copy2", 1);
Object.prototype.copy = function () {
var _local2 = new Object();
for (var _local3 in this) {
_local2[_local3] = this[_local3];
}
return(_local2);
};
checkSO();
resizeAmt = 1;
moveSpeed = 0.5;
tileSize = 41 * resizeAmt;
charTurn = -1;
inMenu = false;
soundOn = true;
mouseIsDown = false;
gameComplete = false;
setInterval(timeCounter, 60000);
loadTitleScreen();
stop();
Instance of Symbol 1777 MovieClip in Frame 4
onClipEvent (mouseDown) {
if (_root.spaceDown == true) {
_root.display.startDrag();
Key.removeListener(_root.keylistener);
}
}
onClipEvent (mouseUp) {
_root.spaceDown = false;
_root.display.stopDrag();
Key.addListener(_root.keylistener);
}
Symbol 16 MovieClip [RainDropEffectAS2] Frame 1
#initclip 14
Object.registerClass("RainDropEffectAS2", net.flashfilter.effects.E01_raindrop);
#endinitclip
news = "To purchase this effect visit http://www.flash-filter.net";
Symbol 40 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 1
this.onRollOver = function () {
this.logo_ro.gotoAndStop(2);
};
this.onRollOut = function () {
this.logo_ro.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.logo_ro.gotoAndStop(1);
};
this.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1367&subid=preloader", "_blank");
};
Symbol 1778 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 1779 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 1780 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 1781 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 1782 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1783 MovieClip [__Packages.mx.transitions.easing.Back] Frame 0
class mx.transitions.easing.Back
{
function Back () {
}
static function easeIn(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / d;
return((((c * t) * t) * (((s + 1) * t) - s)) + b);
}
static function easeOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = (t / d) - 1;
return((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
static function easeInOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1784 MovieClip [__Packages.Path] Frame 0
class Path
{
var _segments, _length, _position, hasOwnProperty;
function Path (start_x, start_y) {
init(start_x, start_y);
}
function init(start_x, start_y) {
_segments = new Array();
_length = 0;
if (arguments.length) {
moveTo(start_x, start_y);
} else {
moveTo(0, 0);
}
}
function clear() {
init(0, 0);
}
function moveTo(start_x, start_y) {
_segments[_segments.length] = {d:0, start:{_x:_position._x, _y:_position._y}, end:{_x:start_x, _y:start_y}, type:"M"};
_position = {_x:start_x, _y:start_y};
return(this);
}
function lineTo(end_x, end_y) {
var _local3 = end_x - _position._x;
var _local2 = end_y - _position._y;
var _local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_segments[_segments.length] = {d:_local4, start:_position, end:{_x:end_x, _y:end_y}, type:"L"};
_length = _length + _local4;
_position = {_x:end_x, _y:end_y};
return(this);
}
function circleTo(end_x, end_y, arc, dir) {
if (dir == undefined) {
dir = "CW";
}
if (arc == undefined) {
arc = 0.5;
}
if (arc > 1) {
arc = 1;
} else if (arc <= 0) {
return(lineTo(end_x, end_y));
}
if (dir == "CCW") {
arc = 1 - arc;
}
var _local13 = {_x:(_position._x + end_x) / 2, _y:(_position._y + end_y) / 2};
var _local4 = end_x - _position._x;
var _local3 = end_y - _position._y;
var _local11 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local7 = _local11 / 2;
var _local8 = _local7 / Math.tan(arc * Math.PI);
var _local10 = _local7 / Math.sin(arc * Math.PI);
var _local9 = Math.atan2(_local3, _local4) + (Math.PI/2);
_local13._x = _local13._x + (Math.cos(_local9) * _local8);
_local13._y = _local13._y + (Math.sin(_local9) * _local8);
var _local17 = Math.atan2(_position._y - _local13._y, _position._x - _local13._x);
var _local15 = Math.atan2(end_y - _local13._y, end_x - _local13._x);
if (dir == "CW") {
if (_local15 < _local17) {
_local15 = _local15 + (Math.PI*2);
}
} else if (_local17 < _local15) {
_local17 = _local17 + (Math.PI*2);
}
_local11 = _local10 * Math.abs(_local15 - _local17);
_segments[_segments.length] = {d:_local11, r:_local10, a1:_local17, a2:_local15, o:_local13, dir:dir, type:"C"};
_length = _length + _local11;
_position = {_x:end_x, _y:end_y};
return(this);
}
function circleCWTo(end_x, end_y, arc) {
return(circleTo(end_x, end_y, arc, "CW"));
}
function circleCCWTo(end_x, end_y, arc) {
return(circleTo(end_x, end_y, arc, "CCW"));
}
function curveTo(con_x, con_y, end_x, end_y) {
var _local3 = divideBezier(_position._x, _position._y, con_x, con_y, end_x, end_y);
_segments[_segments.length] = {d:_local3.d, start:_position, con:{_x:con_x, _y:con_y}, end:{_x:end_x, _y:end_y}, segs:_local3, type:"B"};
_length = _length + _local3.d;
_position = {_x:end_x, _y:end_y};
return(this);
}
function divideBezier(x1, y1, x2, y2, x3, y3) {
var _local2;
var _local15;
var _local14;
var _local12;
var _local11;
var _local9;
var _local8;
var _local7;
var _local6;
var _local29;
var _local13 = new Array();
var _local5 = {_x:x1, _y:y1};
var _local22 = x2 - x1;
var _local20 = y2 - y1;
var _local21 = x3 - x2;
var _local19 = y3 - y2;
var _local16 = Math.atan2;
var _local18 = Math.sqrt;
var _local17 = 0;
var _local36;
var _local3;
var _local10;
var _local30 = _local16(_local20, _local22);
var _local4 = 1;
while (_local4 < curveToAccuracy) {
_local2 = _local4 / curveToAccuracy;
_local15 = x1 + (_local22 * _local2);
_local12 = (x2 + (_local21 * _local2)) - _local15;
_local14 = y1 + (_local20 * _local2);
_local11 = (y2 + (_local19 * _local2)) - _local14;
_local7 = _local15 + (_local12 * _local2);
_local6 = _local14 + (_local11 * _local2);
_local9 = _local7 - _local5._x;
_local8 = _local6 - _local5._y;
_local29 = _local18((_local9 * _local9) + (_local8 * _local8));
_local17 = _local17 + _local29;
_local10 = _local16(_local11, _local12);
_local3 = _local10 - _local30;
if (_local3 > Math.PI) {
_local3 = _local3 - (Math.PI*2);
} else if (_local3 < -3.14159265358979) {
_local3 = _local3 + (Math.PI*2);
}
_local13[_local13.length] = {d:_local29, start:_local5, end:{_x:_local7, _y:_local6}, a:{base:_local30, d:_local3}};
_local30 = _local10;
_local5 = {_x:_local7, _y:_local6};
_local4++;
}
_local9 = x3 - _local5._x;
_local8 = y3 - _local5._y;
_local29 = _local18((_local9 * _local9) + (_local8 * _local8));
_local17 = _local17 + _local29;
_local10 = _local16(_local19, _local21);
_local13[_local13.length] = {d:_local29, start:_local5, end:{_x:x3, _y:y3}, a:{base:_local30, d:_local10 - _local30}};
_local13.d = _local17;
return(_local13);
}
function setInBezier(obj, t, segments, orient, extra) {
if (t < 0) {
t = 0;
} else if (t > 1) {
t = 1;
}
var _local2 = segments[0];
var _local8 = segments.d * t;
var _local3 = 0;
var _local7 = 0;
var _local4 = segments.length + 1;
var _local1 = 1;
while (_local1 < _local4) {
_local7 = _local1 - 1;
_local2 = segments[_local7];
if ((_local1 == _local4) || ((_local3 + _local2.d) >= _local8)) {
break;
}
_local3 = _local3 + _local2.d;
_local1++;
}
if (!_local2.d) {
t = 0;
} else {
t = (_local8 - _local3) / _local2.d;
}
var _local11 = _local2.end._x - _local2.start._x;
var _local10 = _local2.end._y - _local2.start._y;
obj._x = _local2.start._x + (_local11 * t);
obj._y = _local2.start._y + (_local10 * t);
if (extra) {
obj.t = t;
obj.n = _local7;
obj.divs = segments.length;
}
if (orient) {
obj._rotation = ((_local2.a.base + (_local2.a.d * t)) * 180) / Math.PI;
}
}
function reverse() {
var _local3 = _segments;
var _local2 = _local3.length;
var _local4 = new Path(_local3[_local2 - 1].end._x, _local3[_local2 - 1].end._y);
while (_local2--) {
if (_local3[_local2].type == "M") {
_local4._segments[_local4._segments.length] = {d:0, start:{_x:_local3[_local2].end._x, _y:_local3[_local2].end._y}, end:{_x:_local3[_local2].start._x, _y:_local3[_local2].start._y}, type:"M"};
} else if (_local3[_local2].type == "L") {
_local4._segments[_local4._segments.length] = {d:_local3[_local2].d, start:{_x:_local3[_local2].end._x, _y:_local3[_local2].end._y}, end:{_x:_local3[_local2].start._x, _y:_local3[_local2].start._y}, type:"L"};
} else if (_local3[_local2].type == "C") {
_local4._segments[_local4._segments.length] = {d:_local3[_local2].d, r:_local3[_local2].r, a1:_local3[_local2].a2, a2:_local3[_local2].a1, o:{_x:_local3[_local2].o._x, _y:_local3[_local2].o._y}, dir:((_local3[_local2].dir == "CW") ? "CCW" : "CW"), type:"C"};
} else if (_local3[_local2].type == "B") {
var _local9 = divideBezier(_local3[_local2].end._x, _local3[_local2].end._y, _local3[_local2].con._x, _local3[_local2].con._y, _local3[_local2].start._x, _local3[_local2].start._y);
_local4._segments[_local4._segments.length] = {d:_local3[_local2].d, start:{_x:_local3[_local2].end._x, _y:_local3[_local2].end._y}, con:{_x:_local3[_local2].con._x, _y:_local3[_local2].con._y}, end:{_x:_local3[_local2].start._x, _y:_local3[_local2].start._y}, segs:_local9, type:"B"};
}
}
_local4._length = _length;
if (hasOwnProperty("curveToAccuracy")) {
_local4.curveToAccuracy = curveToAccuracy;
}
return(_local4);
}
function traverse(obj, t, orient, wrap) {
if ((wrap == undefined) || (wrap == true)) {
if ((t < 0) || (t > 1)) {
t = t - Math.floor(t);
}
} else if (t < 0) {
t = 0;
} else if (t > 1) {
t = 1;
}
var _local3 = _segments[0];
var _local10 = _length * t;
var _local7 = 0;
var _local8 = 0;
var _local9 = _segments.length + 1;
var _local4 = 1;
while (_local4 < _local9) {
_local8 = _local4 - 1;
_local3 = _segments[_local8];
if ((_local4 == _local9) || ((_local7 + _local3.d) >= _local10)) {
break;
}
_local7 = _local7 + _local3.d;
_local4++;
}
if (_local3.type == "M") {
delete obj.onEnterFrame;
obj.removeMovieClip();
_root.archerArrowAnimEnd();
}
if (!_local3.d) {
t = 0;
} else {
t = (_local10 - _local7) / _local3.d;
}
if (_local3.type == "L") {
var _local13 = _local3.end._x - _local3.start._x;
var _local12 = _local3.end._y - _local3.start._y;
obj._x = _local3.start._x + (_local13 * t);
obj._y = _local3.start._y + (_local12 * t);
if (orient) {
obj._rotation = (Math.atan2(_local12, _local13) * 180) / Math.PI;
}
} else if (_local3.type == "C") {
var _local14 = _local3.a1;
var _local15 = _local3.a2;
var _local11 = _local14 + ((_local15 - _local14) * t);
obj._x = _local3.o._x + (Math.cos(_local11) * _local3.r);
obj._y = _local3.o._y + (Math.sin(_local11) * _local3.r);
if (orient) {
obj._rotation = ((_local3.dir == "CW") ? (((_local11 * 180) / Math.PI) + 90) : (((_local11 * 180) / Math.PI) - 90));
}
} else if (_local3.type == "B") {
setInBezier(obj, t, _local3.segs, orient);
}
return(this);
}
function mcCircleTo(cen_x, cen_y, a1, a2, r, dir) {
dir = ((dir == "CCW") ? -1 : 1);
var _local6 = Math.cos;
var _local7 = Math.sin;
var _local13 = Math.abs(a2 - a1);
var _local12 = Math.floor(_local13 / (Math.PI/4)) + 1;
var _local5 = (dir * _local13) / (2 * _local12);
var _local8 = r / _local6(_local5);
var _local4 = 0;
while (_local4 < _local12) {
a2 = a1 + _local5;
a1 = a2 + _local5;
curveTo(cen_x + (_local6(a2) * _local8), cen_y + (_local7(a2) * _local8), cen_x + (_local6(a1) * r), cen_y + (_local7(a1) * r));
_local4++;
}
return(this);
}
function draw(mc, n) {
var _local3 = _segments;
if (n == undefined) {
n = _local3.length;
}
var _local2 = 0;
while (_local2 < n) {
if (_local3[_local2].type == "M") {
mc.moveTo(_local3[_local2].end._x, _local3[_local2].end._y);
} else if (_local3[_local2].type == "L") {
mc.lineTo(_local3[_local2].end._x, _local3[_local2].end._y);
} else if (_local3[_local2].type == "C") {
mcCircleTo.call(mc, _local3[_local2].o._x, _local3[_local2].o._y, _local3[_local2].a1, _local3[_local2].a2, _local3[_local2].r, _local3[_local2].dir);
} else if (_local3[_local2].type == "B") {
mc.curveTo(_local3[_local2].con._x, _local3[_local2].con._y, _local3[_local2].end._x, _local3[_local2].end._y);
}
_local2++;
}
return(this);
}
function drawUpTo(mc, t, wrap) {
if ((wrap == undefined) || (wrap == true)) {
if ((t < 0) || (t > 1)) {
t = t - Math.floor(t);
} else if (t < 0) {
t = 0;
} else if (t > 1) {
t = 1;
}
}
var _local2 = _segments[0];
var _local9 = _length * t;
var _local5 = 0;
var _local7 = 0;
var _local6 = _segments.length + 1;
var _local3 = 1;
while (_local3 < _local6) {
_local7 = _local3 - 1;
_local2 = _segments[_local7];
if ((_local3 == _local6) || ((_local5 + _local2.d) >= _local9)) {
break;
}
_local5 = _local5 + _local2.d;
_local3++;
}
if (!_local2.d) {
t = 0;
} else {
t = (_local9 - _local5) / _local2.d;
}
draw(mc, _local7);
if (_local2.type == "M") {
mc.moveTo(_local2.end._x, _local2.end._y);
} else if (_local2.type == "L") {
mc.lineTo(_local2.start._x + ((_local2.end._x - _local2.start._x) * t), _local2.start._y + ((_local2.end._y - _local2.start._y) * t));
} else if (_local2.type == "C") {
mcCircleTo.call(mc, _local2.o._x, _local2.o._y, _local2.a1, _local2.a1 + ((_local2.a2 - _local2.a1) * t), _local2.r, _local2.dir);
} else if (_local2.type == "B") {
var _local8 = new Object();
setInBezier(_local8, t, _local2.segs, false, true);
var _local11 = (_local8.n / _local8.divs) + (_local8.t / _local8.divs);
mc.curveTo(_local2.start._x + ((_local2.con._x - _local2.start._x) * _local11), _local2.start._y + ((_local2.con._y - _local2.start._y) * _local11), _local8._x, _local8._y);
}
return(this);
}
var curveToAccuracy = 10;
}
Symbol 1785 MovieClip [__Packages.mx.transitions.easing.Bounce] Frame 0
class mx.transitions.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1786 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1787 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 8 MovieClip [__Packages.net.flashfilter.effects.SuperEffect] Frame 0
!!!ERROR
Symbol 9 MovieClip [__Packages.net.flashfilter.effects.E01_raindrop] Frame 0
!!!ERROR
Symbol 17 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
!!!ERROR
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 10
stop();
Symbol 76 MovieClip Frame 1
this._parent.stop();
this.link.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1367&subid=splash", "_blank");
};
Symbol 76 MovieClip Frame 151
this._parent.stop();
this.link.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1367&subid=splash", "_blank");
};
Symbol 76 MovieClip Frame 161
stop();
this._parent.gotoAndPlay(2);
Symbol 81 MovieClip Frame 1
function drop2() {
rainFilter.createDrop(160, 50);
}
function drop3() {
rainFilter.createDrop(460, 50);
}
var rainFilter = this.attachMovie("RainDropEffectAS2", "RainDropEffectAS2", 1);
rainFilter.init(myLogo, 4, 1.5, true, false);
rainFilter.createDrop(320, 130);
setTimeout(drop2, 800);
setTimeout(drop3, 1400);
Symbol 85 MovieClip Frame 2
rainDropInstance._visible = false;
_root.likwidIntroSnd.start();
Instance of Symbol 77 MovieClip in Symbol 85 MovieClip Frame 2
on (release) {
getURL ("http://www.likwidgames.com", "_blank");
}
Instance of Symbol 16 MovieClip [RainDropEffectAS2] "rainDropInstance" in Symbol 85 MovieClip Frame 2
//component parameters
onClipEvent (construct) {
_targetInstanceName = "";
_dropInterval = 0;
_mouseSensetive = true;
_refreshEveryFrame = false;
_waveHeight = 9;
}
Symbol 85 MovieClip Frame 191
_root.gotoAndStop(4);
stop();
Symbol 91 MovieClip [treasureIcon] Frame 1
play();
Symbol 91 MovieClip [treasureIcon] Frame 25
play();
Symbol 91 MovieClip [treasureIcon] Frame 41
stop();
Symbol 221 MovieClip [tiles] Frame 1
stop();
Symbol 227 MovieClip Frame 1
stop();
Symbol 232 MovieClip [tileOutline] Frame 1
stop();
Symbol 236 MovieClip [miniTiles] Frame 1
stop();
Symbol 236 MovieClip [miniTiles] Frame 2
stop();
Symbol 236 MovieClip [miniTiles] Frame 3
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 2
play();
Symbol 258 MovieClip Frame 19
gotoAndPlay (2);
Symbol 258 MovieClip Frame 20
play();
Symbol 258 MovieClip Frame 33
gotoAndStop (1);
Symbol 280 MovieClip Frame 1
stop();
Symbol 280 MovieClip Frame 2
play();
Symbol 280 MovieClip Frame 19
gotoAndPlay (2);
Symbol 280 MovieClip Frame 20
play();
Symbol 280 MovieClip Frame 33
gotoAndStop (1);
Symbol 283 MovieClip Frame 1
stop();
Symbol 283 MovieClip Frame 2
stop();
Symbol 283 MovieClip Frame 3
stop();
Symbol 283 MovieClip Frame 4
stop();
Symbol 283 MovieClip Frame 5
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 323 MovieClip Frame 1
stop();
Symbol 323 MovieClip Frame 2
play();
Symbol 323 MovieClip Frame 19
gotoAndPlay (2);
Symbol 323 MovieClip Frame 31
gotoAndStop (1);
Symbol 344 MovieClip Frame 1
stop();
Symbol 344 MovieClip Frame 2
play();
Symbol 344 MovieClip Frame 19
gotoAndPlay (2);
Symbol 344 MovieClip Frame 31
gotoAndStop (1);
Symbol 347 MovieClip Frame 1
stop();
Symbol 347 MovieClip Frame 2
stop();
Symbol 347 MovieClip Frame 3
stop();
Symbol 347 MovieClip Frame 4
stop();
Symbol 347 MovieClip Frame 5
stop();
Symbol 371 MovieClip Frame 1
stop();
Symbol 371 MovieClip Frame 2
play();
Symbol 371 MovieClip Frame 19
gotoAndPlay (2);
Symbol 371 MovieClip Frame 31
gotoAndStop (1);
Symbol 392 MovieClip Frame 1
stop();
Symbol 392 MovieClip Frame 2
play();
Symbol 392 MovieClip Frame 19
gotoAndPlay (2);
Symbol 392 MovieClip Frame 31
gotoAndStop (1);
Symbol 395 MovieClip Frame 1
stop();
Symbol 395 MovieClip Frame 2
stop();
Symbol 395 MovieClip Frame 3
stop();
Symbol 395 MovieClip Frame 4
stop();
Symbol 395 MovieClip Frame 5
stop();
Symbol 396 MovieClip [defenders] Frame 1
stop();
Symbol 396 MovieClip [defenders] Frame 2
stop();
Symbol 396 MovieClip [defenders] Frame 3
stop();
Symbol 414 MovieClip Frame 1
stop();
Symbol 414 MovieClip Frame 2
play();
Symbol 414 MovieClip Frame 17
gotoAndPlay (2);
Symbol 414 MovieClip Frame 18
play();
Symbol 414 MovieClip Frame 30
gotoAndStop (1);
Symbol 431 MovieClip Frame 1
stop();
Symbol 431 MovieClip Frame 2
play();
Symbol 431 MovieClip Frame 17
gotoAndPlay (2);
Symbol 431 MovieClip Frame 18
play();
Symbol 431 MovieClip Frame 30
gotoAndStop (1);
Symbol 434 MovieClip Frame 1
stop();
Symbol 434 MovieClip Frame 2
stop();
Symbol 434 MovieClip Frame 3
stop();
Symbol 434 MovieClip Frame 4
stop();
Symbol 434 MovieClip Frame 5
stop();
Symbol 451 MovieClip Frame 1
stop();
Symbol 451 MovieClip Frame 2
play();
Symbol 451 MovieClip Frame 17
gotoAndPlay (2);
Symbol 451 MovieClip Frame 18
play();
Symbol 451 MovieClip Frame 30
gotoAndStop (1);
Symbol 468 MovieClip Frame 1
stop();
Symbol 468 MovieClip Frame 2
play();
Symbol 468 MovieClip Frame 17
gotoAndPlay (2);
Symbol 468 MovieClip Frame 18
play();
Symbol 468 MovieClip Frame 30
gotoAndStop (1);
Symbol 471 MovieClip Frame 1
stop();
Symbol 471 MovieClip Frame 2
stop();
Symbol 471 MovieClip Frame 3
stop();
Symbol 471 MovieClip Frame 4
stop();
Symbol 471 MovieClip Frame 5
stop();
Symbol 488 MovieClip Frame 1
stop();
Symbol 488 MovieClip Frame 2
play();
Symbol 488 MovieClip Frame 17
gotoAndPlay (2);
Symbol 488 MovieClip Frame 18
play();
Symbol 488 MovieClip Frame 30
gotoAndStop (1);
Symbol 505 MovieClip Frame 1
stop();
Symbol 505 MovieClip Frame 2
play();
Symbol 505 MovieClip Frame 17
gotoAndPlay (2);
Symbol 505 MovieClip Frame 18
play();
Symbol 505 MovieClip Frame 30
gotoAndStop (1);
Symbol 508 MovieClip Frame 1
stop();
Symbol 508 MovieClip Frame 2
stop();
Symbol 508 MovieClip Frame 3
stop();
Symbol 508 MovieClip Frame 4
stop();
Symbol 508 MovieClip Frame 5
stop();
Symbol 529 MovieClip Frame 1
stop();
Symbol 529 MovieClip Frame 2
play();
Symbol 529 MovieClip Frame 17
gotoAndPlay (2);
Symbol 529 MovieClip Frame 18
play();
Symbol 529 MovieClip Frame 28
gotoAndStop (1);
Symbol 550 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 2
play();
Symbol 550 MovieClip Frame 17
gotoAndPlay (2);
Symbol 550 MovieClip Frame 18
play();
Symbol 550 MovieClip Frame 28
gotoAndStop (1);
Symbol 553 MovieClip Frame 1
stop();
Symbol 553 MovieClip Frame 2
stop();
Symbol 553 MovieClip Frame 3
stop();
Symbol 553 MovieClip Frame 4
stop();
Symbol 553 MovieClip Frame 5
stop();
Symbol 574 MovieClip Frame 1
stop();
Symbol 574 MovieClip Frame 2
play();
Symbol 574 MovieClip Frame 17
gotoAndPlay (2);
Symbol 574 MovieClip Frame 18
play();
Symbol 574 MovieClip Frame 28
gotoAndStop (1);
Symbol 595 MovieClip Frame 1
stop();
Symbol 595 MovieClip Frame 2
play();
Symbol 595 MovieClip Frame 17
gotoAndPlay (2);
Symbol 595 MovieClip Frame 18
play();
Symbol 595 MovieClip Frame 28
gotoAndStop (1);
Symbol 598 MovieClip Frame 1
stop();
Symbol 598 MovieClip Frame 2
stop();
Symbol 598 MovieClip Frame 3
stop();
Symbol 598 MovieClip Frame 4
stop();
Symbol 598 MovieClip Frame 5
stop();
Symbol 619 MovieClip Frame 1
stop();
Symbol 619 MovieClip Frame 2
play();
Symbol 619 MovieClip Frame 17
gotoAndPlay (2);
Symbol 619 MovieClip Frame 18
play();
Symbol 619 MovieClip Frame 28
gotoAndStop (1);
Symbol 640 MovieClip Frame 1
stop();
Symbol 640 MovieClip Frame 2
play();
Symbol 640 MovieClip Frame 17
gotoAndPlay (2);
Symbol 640 MovieClip Frame 18
play();
Symbol 640 MovieClip Frame 28
gotoAndStop (1);
Symbol 643 MovieClip Frame 1
stop();
Symbol 643 MovieClip Frame 2
stop();
Symbol 643 MovieClip Frame 3
stop();
Symbol 643 MovieClip Frame 4
stop();
Symbol 643 MovieClip Frame 5
stop();
Symbol 660 MovieClip Frame 1
stop();
Symbol 660 MovieClip Frame 2
play();
Symbol 660 MovieClip Frame 17
gotoAndPlay (2);
Symbol 660 MovieClip Frame 18
play();
Symbol 660 MovieClip Frame 35
gotoAndStop (1);
Symbol 677 MovieClip Frame 1
stop();
Symbol 677 MovieClip Frame 2
play();
Symbol 677 MovieClip Frame 17
gotoAndPlay (2);
Symbol 677 MovieClip Frame 18
play();
Symbol 677 MovieClip Frame 35
gotoAndStop (1);
Symbol 680 MovieClip Frame 1
stop();
Symbol 680 MovieClip Frame 2
stop();
Symbol 680 MovieClip Frame 3
stop();
Symbol 680 MovieClip Frame 4
stop();
Symbol 680 MovieClip Frame 5
stop();
Symbol 697 MovieClip Frame 1
stop();
Symbol 697 MovieClip Frame 2
play();
Symbol 697 MovieClip Frame 17
gotoAndPlay (2);
Symbol 697 MovieClip Frame 18
play();
Symbol 697 MovieClip Frame 35
gotoAndStop (1);
Symbol 714 MovieClip Frame 1
stop();
Symbol 714 MovieClip Frame 2
play();
Symbol 714 MovieClip Frame 17
gotoAndPlay (2);
Symbol 714 MovieClip Frame 18
play();
Symbol 714 MovieClip Frame 35
gotoAndStop (1);
Symbol 717 MovieClip Frame 1
stop();
Symbol 717 MovieClip Frame 2
stop();
Symbol 717 MovieClip Frame 3
stop();
Symbol 717 MovieClip Frame 4
stop();
Symbol 717 MovieClip Frame 5
stop();
Symbol 738 MovieClip Frame 1
stop();
Symbol 738 MovieClip Frame 2
play();
Symbol 738 MovieClip Frame 17
gotoAndPlay (2);
Symbol 738 MovieClip Frame 18
play();
Symbol 738 MovieClip Frame 35
gotoAndStop (1);
Symbol 759 MovieClip Frame 1
stop();
Symbol 759 MovieClip Frame 2
play();
Symbol 759 MovieClip Frame 17
gotoAndPlay (2);
Symbol 759 MovieClip Frame 18
play();
Symbol 759 MovieClip Frame 35
gotoAndStop (1);
Symbol 762 MovieClip Frame 1
stop();
Symbol 762 MovieClip Frame 2
stop();
Symbol 762 MovieClip Frame 3
stop();
Symbol 762 MovieClip Frame 4
stop();
Symbol 762 MovieClip Frame 5
stop();
Symbol 783 MovieClip Frame 1
stop();
Symbol 783 MovieClip Frame 2
play();
Symbol 783 MovieClip Frame 17
gotoAndPlay (2);
Symbol 783 MovieClip Frame 18
play();
Symbol 783 MovieClip Frame 35
gotoAndStop (1);
Symbol 804 MovieClip Frame 1
stop();
Symbol 804 MovieClip Frame 2
play();
Symbol 804 MovieClip Frame 17
gotoAndPlay (2);
Symbol 804 MovieClip Frame 18
play();
Symbol 804 MovieClip Frame 35
gotoAndStop (1);
Symbol 807 MovieClip Frame 1
stop();
Symbol 807 MovieClip Frame 2
stop();
Symbol 807 MovieClip Frame 3
stop();
Symbol 807 MovieClip Frame 4
stop();
Symbol 807 MovieClip Frame 5
stop();
Symbol 826 MovieClip Frame 1
stop();
Symbol 826 MovieClip Frame 2
play();
Symbol 826 MovieClip Frame 17
gotoAndPlay (2);
Symbol 826 MovieClip Frame 18
play();
Symbol 826 MovieClip Frame 34
gotoAndStop (1);
Symbol 845 MovieClip Frame 1
stop();
Symbol 845 MovieClip Frame 2
play();
Symbol 845 MovieClip Frame 17
gotoAndPlay (2);
Symbol 845 MovieClip Frame 18
play();
Symbol 845 MovieClip Frame 34
gotoAndStop (1);
Symbol 848 MovieClip Frame 1
stop();
Symbol 848 MovieClip Frame 2
stop();
Symbol 848 MovieClip Frame 3
stop();
Symbol 848 MovieClip Frame 4
stop();
Symbol 848 MovieClip Frame 5
stop();
Symbol 867 MovieClip Frame 1
stop();
Symbol 867 MovieClip Frame 2
play();
Symbol 867 MovieClip Frame 17
gotoAndPlay (2);
Symbol 867 MovieClip Frame 18
play();
Symbol 867 MovieClip Frame 33
gotoAndStop (1);
Symbol 886 MovieClip Frame 1
stop();
Symbol 886 MovieClip Frame 2
play();
Symbol 886 MovieClip Frame 17
gotoAndPlay (2);
Symbol 886 MovieClip Frame 18
play();
Symbol 886 MovieClip Frame 33
gotoAndStop (1);
Symbol 889 MovieClip Frame 1
stop();
Symbol 889 MovieClip Frame 2
stop();
Symbol 889 MovieClip Frame 3
stop();
Symbol 889 MovieClip Frame 4
stop();
Symbol 889 MovieClip Frame 5
stop();
Symbol 908 MovieClip Frame 1
stop();
Symbol 908 MovieClip Frame 2
play();
Symbol 908 MovieClip Frame 17
gotoAndPlay (2);
Symbol 908 MovieClip Frame 18
play();
Symbol 908 MovieClip Frame 33
gotoAndStop (1);
Symbol 927 MovieClip Frame 1
stop();
Symbol 927 MovieClip Frame 2
play();
Symbol 927 MovieClip Frame 17
gotoAndPlay (2);
Symbol 927 MovieClip Frame 18
play();
Symbol 927 MovieClip Frame 33
gotoAndStop (1);
Symbol 930 MovieClip Frame 1
stop();
Symbol 930 MovieClip Frame 2
stop();
Symbol 930 MovieClip Frame 3
stop();
Symbol 930 MovieClip Frame 4
stop();
Symbol 930 MovieClip Frame 5
stop();
Symbol 937 MovieClip Frame 1
Symbol 948 MovieClip Frame 1
stop();
Symbol 948 MovieClip Frame 2
play();
Symbol 948 MovieClip Frame 17
gotoAndPlay (2);
Symbol 948 MovieClip Frame 18
play();
Symbol 948 MovieClip Frame 35
gotoAndStop (1);
Symbol 966 MovieClip Frame 1
stop();
Symbol 966 MovieClip Frame 2
play();
Symbol 966 MovieClip Frame 17
gotoAndPlay (2);
Symbol 966 MovieClip Frame 18
play();
Symbol 966 MovieClip Frame 35
gotoAndStop (1);
Symbol 969 MovieClip Frame 1
stop();
Symbol 969 MovieClip Frame 2
stop();
Symbol 969 MovieClip Frame 3
stop();
Symbol 969 MovieClip Frame 4
stop();
Symbol 969 MovieClip Frame 5
stop();
Symbol 976 MovieClip Frame 1
Symbol 987 MovieClip Frame 1
stop();
Symbol 987 MovieClip Frame 2
play();
Symbol 987 MovieClip Frame 17
gotoAndPlay (2);
Symbol 987 MovieClip Frame 18
play();
Symbol 987 MovieClip Frame 33
gotoAndStop (1);
Symbol 1005 MovieClip Frame 1
stop();
Symbol 1005 MovieClip Frame 2
play();
Symbol 1005 MovieClip Frame 17
gotoAndPlay (2);
Symbol 1005 MovieClip Frame 18
play();
Symbol 1005 MovieClip Frame 33
gotoAndStop (1);
Symbol 1008 MovieClip Frame 1
stop();
Symbol 1008 MovieClip Frame 2
stop();
Symbol 1008 MovieClip Frame 3
stop();
Symbol 1008 MovieClip Frame 4
stop();
Symbol 1008 MovieClip Frame 5
stop();
Symbol 1015 MovieClip Frame 1
Symbol 1026 MovieClip Frame 1
stop();
Symbol 1026 MovieClip Frame 2
play();
Symbol 1026 MovieClip Frame 17
gotoAndPlay (2);
Symbol 1026 MovieClip Frame 18
play();
Symbol 1026 MovieClip Frame 35
gotoAndStop (1);
Symbol 1044 MovieClip Frame 1
stop();
Symbol 1044 MovieClip Frame 2
play();
Symbol 1044 MovieClip Frame 17
gotoAndPlay (2);
Symbol 1044 MovieClip Frame 18
play();
Symbol 1044 MovieClip Frame 35
gotoAndStop (1);
Symbol 1047 MovieClip Frame 1
stop();
Symbol 1047 MovieClip Frame 2
stop();
Symbol 1047 MovieClip Frame 3
stop();
Symbol 1047 MovieClip Frame 4
stop();
Symbol 1047 MovieClip Frame 5
stop();
Symbol 1062 MovieClip Frame 1
stop();
Symbol 1062 MovieClip Frame 2
play();
Symbol 1062 MovieClip Frame 13
gotoAndPlay (2);
Symbol 1062 MovieClip Frame 14
play();
Symbol 1062 MovieClip Frame 37
gotoAndStop (1);
Symbol 1077 MovieClip Frame 1
stop();
Symbol 1077 MovieClip Frame 2
play();
Symbol 1077 MovieClip Frame 13
gotoAndPlay (2);
Symbol 1077 MovieClip Frame 14
play();
Symbol 1077 MovieClip Frame 37
gotoAndStop (1);
Symbol 1080 MovieClip Frame 1
stop();
Symbol 1080 MovieClip Frame 2
stop();
Symbol 1080 MovieClip Frame 3
stop();
Symbol 1080 MovieClip Frame 4
stop();
Symbol 1080 MovieClip Frame 5
stop();
Symbol 1095 MovieClip Frame 1
stop();
Symbol 1095 MovieClip Frame 2
play();
Symbol 1095 MovieClip Frame 13
gotoAndPlay (2);
Symbol 1095 MovieClip Frame 14
play();
Symbol 1095 MovieClip Frame 37
gotoAndStop (1);
Symbol 1110 MovieClip Frame 1
stop();
Symbol 1110 MovieClip Frame 2
play();
Symbol 1110 MovieClip Frame 13
gotoAndPlay (2);
Symbol 1110 MovieClip Frame 14
play();
Symbol 1110 MovieClip Frame 37
gotoAndStop (1);
Symbol 1113 MovieClip Frame 1
stop();
Symbol 1113 MovieClip Frame 2
stop();
Symbol 1113 MovieClip Frame 3
stop();
Symbol 1113 MovieClip Frame 4
stop();
Symbol 1113 MovieClip Frame 5
stop();
Symbol 1114 MovieClip [enemies] Frame 1
stop();
Symbol 1114 MovieClip [enemies] Frame 2
stop();
Symbol 1114 MovieClip [enemies] Frame 3
stop();
Symbol 1114 MovieClip [enemies] Frame 4
stop();
Symbol 1114 MovieClip [enemies] Frame 5
stop();
Symbol 1114 MovieClip [enemies] Frame 6
stop();
Symbol 1114 MovieClip [enemies] Frame 7
stop();
Symbol 1114 MovieClip [enemies] Frame 8
stop();
Symbol 1114 MovieClip [enemies] Frame 10
stop();
Symbol 1114 MovieClip [enemies] Frame 11
stop();
Symbol 1114 MovieClip [enemies] Frame 12
stop();
Symbol 1114 MovieClip [enemies] Frame 14
stop();
Symbol 1114 MovieClip [enemies] Frame 17
stop();
Symbol 1114 MovieClip [enemies] Frame 18
stop();
Symbol 1114 MovieClip [enemies] Frame 20
stop();
Symbol 1114 MovieClip [enemies] Frame 21
stop();
Symbol 1114 MovieClip [enemies] Frame 22
stop();
Symbol 1114 MovieClip [enemies] Frame 23
stop();
Symbol 1114 MovieClip [enemies] Frame 25
stop();
Symbol 1117 MovieClip Frame 1
this.onRollOver = function () {
this.logo_ro.gotoAndStop(2);
};
this.onRollOut = function () {
this.logo_ro.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.logo_ro.gotoAndStop(1);
};
this.onRelease = function () {
getURL ("http://www.bubblebox.com/clickreg.php?type=gamestats&id=1367&subid=titleScreenLogo", "_blank");
};
Symbol 1126 Button
on (rollOver) {
this.onEnterFrame = function () {
_root.display._y = _root.display._y + 3;
};
}
on (rollOut) {
delete this.onEnterFrame;
}
Symbol 1127 Button
on (rollOver) {
this.onEnterFrame = function () {
_root.display._y = _root.display._y - 3;
};
}
on (rollOut) {
delete this.onEnterFrame;
}
Symbol 1128 Button
on (rollOver) {
this.onEnterFrame = function () {
_root.display._x = _root.display._x + 3;
};
}
on (rollOut) {
delete this.onEnterFrame;
}
Symbol 1129 Button
on (rollOver) {
this.onEnterFrame = function () {
_root.display._x = _root.display._x - 3;
};
}
on (rollOut) {
delete this.onEnterFrame;
}
Symbol 1130 Button
on (rollOver) {
this.onEnterFrame = function () {
_root.display._x = _root.display._x + 3;
_root.display._y = _root.display._y - 3;
};
}
on (rollOut) {
delete this.onEnterFrame;
}
Symbol 1131 Button
on (rollOver) {
this.onEnterFrame = function () {
_root.display._x = _root.display._x - 3;
_root.display._y = _root.display._y - 3;
};
}
on (rollOut) {
delete this.onEnterFrame;
}
Symbol 1132 Button
on (rollOver) {
this.onEnterFrame = function () {
_root.display._x = _root.display._x - 3;
_root.display._y = _root.display._y + 3;
};
}
on (rollOut) {
delete this.onEnterFrame;
}
Symbol 1133 Button
on (rollOver) {
this.onEnterFrame = function () {
_root.display._x = _root.display._x + 3;
_root.display._y = _root.display._y + 3;
};
}
on (rollOut) {
delete this.onEnterFrame;
}
Symbol 1139 MovieClip [dirArrowUR] Frame 1
stop();
Symbol 1139 MovieClip [dirArrowUR] Frame 2
stop();
Symbol 1142 MovieClip [dirArrowUL] Frame 1
stop();
Symbol 1142 MovieClip [dirArrowUL] Frame 2
stop();
Symbol 1147 MovieClip [dirArrowDL] Frame 1
stop();
Symbol 1147 MovieClip [dirArrowDL] Frame 2
stop();
Symbol 1150 MovieClip [dirArrowDR] Frame 1
stop();
Symbol 1150 MovieClip [dirArrowDR] Frame 2
stop();
Symbol 1156 MovieClip [gameMaskLevelCompleteMC] Frame 1
stop();
Symbol 1156 MovieClip [gameMaskLevelCompleteMC] Frame 2
stop();
Symbol 1163 MovieClip [menuArrow] Frame 1
stop();
Symbol 1163 MovieClip [menuArrow] Frame 2
stop();
Symbol 1167 MovieClip [actionButton] Frame 1
stop();
Symbol 1167 MovieClip [actionButton] Frame 2
stop();
Symbol 1167 MovieClip [actionButton] Frame 3
stop();
Symbol 1174 MovieClip [spellTxtButton] Frame 1
stop();
Symbol 1174 MovieClip [spellTxtButton] Frame 2
stop();
Symbol 1174 MovieClip [spellTxtButton] Frame 3
stop();
Symbol 1178 MovieClip [VS-MC] Frame 20
stop();
Symbol 1184 MovieClip [BG-MC] Frame 1
stop();
Symbol 1184 MovieClip [BG-MC] Frame 2
stop();
Symbol 1185 MovieClip [overlay-MC] Frame 20
stop();
Symbol 1185 MovieClip [overlay-MC] Frame 21
play();
Symbol 1185 MovieClip [overlay-MC] Frame 40
stop();
this.removeMovieClip();
Symbol 1191 MovieClip [windowActions] Frame 1
stop();
Symbol 1191 MovieClip [windowActions] Frame 2
stop();
Symbol 1203 MovieClip [damageTxt] Frame 1
stop();
Symbol 1203 MovieClip [damageTxt] Frame 2
stop();
Symbol 1203 MovieClip [damageTxt] Frame 3
stop();
Symbol 1203 MovieClip [damageTxt] Frame 4
stop();
Symbol 1203 MovieClip [damageTxt] Frame 5
stop();
Symbol 1203 MovieClip [damageTxt] Frame 6
stop();
Symbol 1242 MovieClip [charInfoL-MC] Frame 1
stop();
Symbol 1242 MovieClip [charInfoL-MC] Frame 2
stop();
Symbol 1265 MovieClip [charInfoR-MC] Frame 1
stop();
Symbol 1265 MovieClip [charInfoR-MC] Frame 2
stop();
Symbol 1466 MovieClip [lockpickMC] Frame 1
stop();
Symbol 1466 MovieClip [lockpickMC] Frame 2
stop();
Symbol 1466 MovieClip [lockpickMC] Frame 3
stop();
Symbol 1481 MovieClip [lockpickInfo] Frame 1
stop();
Symbol 1488 MovieClip [poisonSmokeMC] Frame 41
stop();
Symbol 1499 MovieClip Frame 1
play();
Symbol 1499 MovieClip Frame 19
stop();
Symbol 1507 MovieClip [spellFreezeMC] Frame 120
gotoAndPlay (30);
Symbol 1517 MovieClip [spellLightningMC] Frame 30
this.removeMovieClip();
Symbol 1623 MovieClip [menuStats] Frame 1
stop();
Symbol 1623 MovieClip [menuStats] Frame 2
stop();
Symbol 1630 MovieClip [menuItems] Frame 1
stop();
Symbol 1630 MovieClip [menuItems] Frame 2
stop();
Symbol 1635 MovieClip [menuEquipment] Frame 1
stop();
Symbol 1635 MovieClip [menuEquipment] Frame 2
stop();
Symbol 1642 MovieClip [menuSound] Frame 1
stop();
Symbol 1642 MovieClip [menuSound] Frame 2
stop();
Symbol 1649 MovieClip [menuTreasures] Frame 1
stop();
Symbol 1649 MovieClip [menuTreasures] Frame 2
stop();
Symbol 1654 MovieClip [menuExit] Frame 1
stop();
Symbol 1654 MovieClip [menuExit] Frame 2
stop();
Symbol 1659 MovieClip [menuSave] Frame 1
stop();
Symbol 1659 MovieClip [menuSave] Frame 2
stop();
Symbol 1743 MovieClip [gameMaskMissionCompleteMC] Frame 1
stop();
Symbol 1743 MovieClip [gameMaskMissionCompleteMC] Frame 2
stop();
Symbol 1770 MovieClip Frame 2
stopAllSounds();