Frame 1
function urls_check() {
var _local1 = 0;
while (_local1 < urls.length) {
if (_url.indexOf(urls[_local1]) > -1) {
lock = false;
armorgames = true;
return(true);
}
_local1++;
}
return(false);
}
var armorgames = false;
stop();
var urls = new Array();
urls.push("armorgames.com");
urls.push("goblinarena.com");
urls.push("games.armorgames.com");
urls.push("preview.armorgames.com");
urls.push("cache.armorgames.com");
urls.push("cdn.armorgames.com");
urls.push("gamemedia.armorgames.com");
urls_check();
if (!armorgames) {
mochi.as2.MochiAd.showPreGameAd({id:"f7cf9e22513d2fab", res:"700x500"});
armorgames_logo_2._y = 1000;
}
_global.forestsounds = 1;
_global.musicsounds = 1;
_global.themesounds = 1;
_global.slotno = 0;
_global.mousescroll = 0;
_global.tips = true;
_global.bonuskey = Math.round(Math.random() * 10000000);
_global.bonuscode = ((("SO" + Math.round((_global.bonuskey / 5) + 78)) + "S") + Math.round(_global.bonuskey * 1.75)) + "T";
var firstime = true;
var slots1 = [];
var slots2 = [];
var slots3 = [];
slots1[0] = 0;
slots1[1] = 0;
slots1[2] = 0;
slots1[3] = 0;
slots2[0] = 0;
slots2[1] = 0;
slots2[2] = 0;
slots2[3] = 0;
slots3[0] = 0;
slots3[1] = 0;
slots3[2] = 0;
slots3[3] = 0;
var levelscomplete = [];
levelscomplete[1] = 1;
levelscomplete[2] = 0;
levelscomplete[3] = 0;
levelscomplete[4] = 0;
levelscomplete[5] = 0;
levelscomplete[6] = 0;
levelscomplete[7] = 0;
levelscomplete[8] = 0;
levelscomplete[9] = 0;
levelscomplete[10] = 0;
levelscomplete[11] = 0;
levelscomplete[12] = 0;
levelscomplete[13] = 0;
localInfo = SharedObject.getLocal("clan2");
if (localInfo.data.bonusunlock == undefined) {
_global.bonusunlocked = false;
} else {
_global.bonusunlocked = true;
}
if (localInfo.data.slot1 == undefined) {
} else {
slots1[0] = localInfo.data.slot1;
slots1[1] = localInfo.data.slot1_class;
slots1[2] = localInfo.data.slot1_level;
slots1[3] = localInfo.data.slot1_difficulty;
}
if (localInfo.data.slot2 == undefined) {
} else {
slots2[0] = localInfo.data.slot2;
slots2[1] = localInfo.data.slot2_class;
slots2[2] = localInfo.data.slot2_level;
slots2[3] = localInfo.data.slot2_difficulty;
}
if (localInfo.data.slot3 == undefined) {
} else {
slots3[0] = localInfo.data.slot3;
slots3[1] = localInfo.data.slot3_class;
slots3[2] = localInfo.data.slot3_level;
slots3[3] = localInfo.data.slot3_difficulty;
}
stop();
Instance of Symbol 389 MovieClip [frontlink] in Frame 1
on (press) {
getURL ("http://www.goblinarena.com", blank);
}
Instance of Symbol 430 MovieClip [ArmorGames_logo] "armorgames_logo_2" in Frame 1
on (press) {
getURL ("http://armor.ag/MoreGames", blank);
}
Frame 2
function generateParticles(xPos, yPos) {
trace("get here");
var _local6 = 30 + (Math.random() * 20);
var _local5 = 0;
while (_local5 < _local6) {
var _local2 = this.attachMovie("particleObj", "particleObj" + particleCounter, this.getNextHighestDepth());
_local2._x = (xPos - (Math.random() * 30)) + 15;
_local2._y = (yPos - (Math.random() * 30)) + 15;
_local2._alpha = 30;
_local2._xscale = (_local2._yscale = 400 + (Math.random() * 600));
_local2._rotation = Math.random() * 360;
_local2.blendMode = 8;
_local2.filters = [blurfilter];
_local2.dirX = Math.random() > 0.5;
_local2.dirY = Math.random() > 0.5;
_local2.speedX = Math.random() * 18;
_local2.speedY = Math.random() * 18;
_local2.onEnterFrame = function () {
var _local3 = this.speedX * Math.random();
var _local2 = this.speedY * Math.random();
this._y = this._y - (this.dirY ? (_local2) : (-_local2));
this._x = this._x - (this.dirX ? (_local3) : (-_local3));
this._xscale = (this._yscale = this._yscale - 10);
if (this._alpha > 0) {
this._alpha--;
} else {
this.onEnterFrame = null;
}
};
particleCounter++;
_local5++;
}
}
var particleCounter = 0;
var maxParticleCount = 40;
var isMouseDown = false;
var blurfilter = (new flash.filters.BlurFilter(9, 9, 1));
if (armorgames) {
goblinarenasplash.stop();
} else {
ag_intro.stop();
ag_intro.removeMovieClip();
ag_intro._x = 2000;
}
stop();
Instance of Symbol 235 MovieClip [agscreen] "ag_intro" in Frame 2
on (press) {
getURL ("http://armor.ag/MoreGames", blank);
}
Frame 27
gotoAndStop (50);
Frame 50
stop();
_global.mainVolume = 0.5;
_global.ambience = 0.5;
_root.attachMovie("musiconject", "musicobject", 1201);
musicobject._y = -50;
musicobject.music = new Sound(musicobject);
musicobject.music.attachSound("TheStormL2");
musicobject.music.setVolume(100 * _global.mainVolume);
musicobject.music.start(0, 99);
Frame 51
function get_url() {
return(window.top.location.toString());
}
function dhero() {
if (overhero) {
if (_root._currentframe == 51) {
_root.abilitybox._x = 160;
_root.abilitybox._y = _ymouse - 110;
} else if (_xmouse > 370) {
_root.abilitybox._x = _xmouse - 307;
_root.abilitybox._y = _ymouse - 110;
} else {
_root.abilitybox._x = Math.min(_xmouse, 360);
_root.abilitybox._y = _ymouse - 110;
}
} else {
_root.abilitybox._x = 1000;
}
if (introslide) {
titlemenu._x = titlemenu._x - 15;
if (titlemenu._x < 450) {
introslide = false;
}
}
}
stop();
_global.difficulty = 1;
_global.chief = "chief4";
_global.AIchief = "chief4";
_global.scene = 2;
_global.skillpoints = 3;
_global.experience = 0;
_global.gexperience = 0;
_global.masterlevel = 1;
_global.vault = 0;
_global.masonry = 0;
_global.fame = 0;
_global.thrift = 0;
_global.training = 0;
_global.fortitude = 0;
_global.wisdom = 0;
_global.presence = 0;
_global.herohealth = 0;
_global.backstab = 0;
_global.fistpower = 0;
_global.herowisdom = 0;
_global.lionrider = 0;
_global.dragonrider = 0;
_global.grow = 0;
_global.herocritical = 0;
_global.meteor = 0;
_global.herolearned = 0;
_global.troll = 0;
_global.bloodlust = 0;
_global.golem = 0;
_global.heal = 0;
_global.herovampire = 0;
_global.tips = true;
_global.tip1 = 0;
_global.tip2 = 0;
_global.tip3 = 0;
_global.tip4 = 0;
_global.tip5 = 0;
_global.tip6 = 0;
_global.tip7 = 0;
_global.tip8 = 0;
_global.tip9 = 0;
_global.tip10 = 0;
_global.tip11 = 0;
_global.tip12 = 0;
var masterlevelxp = [];
masterlevelxp[1] = 0;
masterlevelxp[2] = 2000;
masterlevelxp[3] = 3000;
masterlevelxp[4] = 5000;
masterlevelxp[5] = 10000;
masterlevelxp[6] = 15000;
masterlevelxp[7] = 22000;
masterlevelxp[8] = 30000;
masterlevelxp[9] = 40000;
masterlevelxp[10] = 60000;
masterlevelxp[11] = 90000 /* 0x015F90 */;
masterlevelxp[12] = 120000 /* 0x01D4C0 */;
masterlevelxp[13] = 150000 /* 0x0249F0 */;
masterlevelxp[14] = 180000 /* 0x02BF20 */;
masterlevelxp[15] = 240000 /* 0x03A980 */;
masterlevelxp[16] = 300000 /* 0x0493E0 */;
masterlevelxp[17] = 360000 /* 0x057E40 */;
masterlevelxp[18] = 450000 /* 0x06DDD0 */;
masterlevelxp[19] = 550000 /* 0x086470 */;
masterlevelxp[20] = 700000 /* 0x0AAE60 */;
masterlevelxp[21] = 800000 /* 0x0C3500 */;
masterlevelxp[22] = 900000 /* 0x0DBBA0 */;
masterlevelxp[23] = 1000000 /* 0x0F4240 */;
masterlevelxp[24] = 1100000 /* 0x10C8E0 */;
masterlevelxp[25] = 1200000 /* 0x124F80 */;
masterlevelxp[26] = 1300000 /* 0x13D620 */;
masterlevelxp[27] = 1400000 /* 0x155CC0 */;
masterlevelxp[28] = 1500000 /* 0x16E360 */;
masterlevelxp[29] = 1600000 /* 0x186A00 */;
masterlevelxp[30] = 2000000 /* 0x1E8480 */;
masterlevelxp[31] = 1000000000000;
var introslide = false;
var urls = "";
var overhero = false;
var describehero;
if (firstime) {
describehero = setInterval(dhero, 10);
} else {
startbutton._x = 1000;
_root.introslide = true;
if (_root.levelscomplete[2] > 0) {
expansionad._x = 30;
}
_root.link1._y = _root.link1._y - 100;
_root.link2._y = _root.link2._y - 100;
if (_root.armorgames) {
_root.armorgames_logo._y = 320;
_root.armorgames_logo._x = -90;
_root.facebook_link._y = 290;
} else {
_root.facebook_link._y = 365;
}
}
if (armorgames) {
titlemenu.gotoAndStop(2);
}
Instance of Symbol 535 MovieClip [facebooklink] "facebook_link" in Frame 51
on (press) {
if (_root.armorgames) {
getURL ("http://www.facebook.com/ArmorGames", blank);
} else {
getURL ("http://www.facebook.com/GoblinArenaGames", blank);
}
}
Instance of Symbol 388 MovieClip "link2" in Frame 51
on (press) {
getURL ("http://www.goblinarena.com", blank);
}
Instance of Symbol 384 MovieClip [goblinarenaicon] "link1" in Frame 51
on (press) {
getURL ("http://www.goblinarena.com", blank);
}
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 542 MovieClip [startbutton] "startbutton" in Frame 51
on (press) {
_root.introslide = true;
this._x = 1000;
_root.firstime = false;
_root.link1._y = _root.link1._y - 100;
_root.link2._y = _root.link2._y - 100;
if (_root.armorgames) {
_root.armorgames_logo._y = 320;
_root.armorgames_logo._x = -90;
_root.facebook_link._y = 290;
} else {
_root.facebook_link._y = 365;
}
}
Instance of Symbol 576 MovieClip [expansionadd] "expansionad" in Frame 51
on (press) {
getURL ("http://www.goblinarena.com", blank);
}
Instance of Symbol 430 MovieClip [ArmorGames_logo] "armorgames_logo" in Frame 51
on (press) {
getURL ("http://armor.ag/MoreGames", blank);
}
Frame 52
_global.gold = 250 + (_global.thrift * 50);
if (_global.bonusunlocked) {
_global.gold = Math.round(_global.gold * 1.2);
}
Frame 53
function groundmaker(xland) {
if (currentMap == 1) {
rot = 90;
wave = 0.0002;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland < 270)) {
amp = 130;
} else if ((xland > 1370) and (xland < 1920)) {
amp = 130;
} else if ((xland > 2470) and (xland < 2750)) {
amp = 90;
} else if ((xland > 3290) and (xland < 3750)) {
amp = -60;
} else {
amp = 3;
}
xrad = (xland * 180) / Math.PI;
return(360 + (Math.sin(xrad * wave) * amp));
}
if (currentMap == 2) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland <= 250)) {
return(360);
}
if ((xland > 250) and (xland <= 1500)) {
return(360);
}
if ((xland > 1500) and (xland <= 2000)) {
return(((-(xland - 1500)) * 0.1) + 360);
}
if ((xland > 2000) and (xland <= 2100)) {
return(((xland - 2000) * 0.5) + 310);
}
if ((xland > 2100) and (xland <= 2300)) {
return(((-(xland - 2100)) * 0.25) + 360);
}
if ((xland > 2300) and (xland <= 2800)) {
return(((xland - 2300) * 0.1) + 310);
}
if ((xland > 2800) and (xland <= 3290)) {
return(360);
}
if ((xland > 3290) and (xland < 3790)) {
return(((-(xland - 3290)) * 0.5) + 360);
}
return(250);
}
if (currentMap == 3) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland <= 250)) {
return(360);
}
if ((xland > 250) and (xland <= 1500)) {
return(360);
}
if ((xland > 1500) and (xland <= 2000)) {
return(((-(xland - 1500)) * 0.1) + 360);
}
if ((xland > 2000) and (xland <= 2100)) {
return(((xland - 2000) * 0.5) + 310);
}
if ((xland > 2100) and (xland <= 2300)) {
return(((-(xland - 2100)) * 0.25) + 360);
}
if ((xland > 2300) and (xland <= 2800)) {
return(((xland - 2300) * 0.1) + 310);
}
if ((xland > 2800) and (xland <= 3290)) {
return(360);
}
if ((xland > 3290) and (xland < 3790)) {
return(((-(xland - 3290)) * 0.5) + 360);
}
return(250);
}
if (currentMap == 4) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland < 270)) {
wave = 0.0002;
amp = 3;
} else if ((xland > 830) and (xland < 2550)) {
wave = 0.00013;
amp = 36;
} else if ((xland > 3290) and (xland < 3750)) {
wave = 0.0002;
amp = -60;
} else {
amp = 3;
}
xrad = (xland * 180) / Math.PI;
return(360 + (Math.sin(xrad * wave) * amp));
}
if (currentMap == 5) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland < 270)) {
wave = 0.0002;
amp = 3;
} else if ((xland > 1090) and (xland < 2750)) {
wave = 0.0001;
amp = 100;
} else if ((xland > 3290) and (xland < 3750)) {
wave = 0.0002;
amp = -60;
} else {
amp = 3;
}
xrad = (xland * 180) / Math.PI;
return(360 + (Math.sin(xrad * wave) * amp));
}
if (currentMap == 6) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland <= 250)) {
return(360);
}
if ((xland > 250) and (xland <= 4000)) {
return(360);
}
return(250);
}
if (currentMap == 7) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland <= 300)) {
return(360);
}
if ((xland > 300) and (xland <= 350)) {
return(((xland - 300) * 1) + 360);
}
if ((xland > 350) and (xland <= 3200)) {
return(410);
}
if ((xland > 3200) and (xland <= 3250)) {
return(((-(xland - 3200)) * 1) + 410);
}
if (xland > 3250) {
return(360);
}
if ((xland > 2300) and (xland <= 2800)) {
return(((xland - 2300) * 0.1) + 310);
}
if ((xland > 2800) and (xland <= 3290)) {
return(360);
}
if ((xland > 3290) and (xland < 3790)) {
return(((-(xland - 3290)) * 0.5) + 360);
}
return(250);
}
if (currentMap == 8) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland < 270)) {
wave = 0.0002;
amp = 3;
} else if ((xland > 1350) and (xland < 2750)) {
wave = 4E-5;
amp = 200;
} else if ((xland > 3290) and (xland < 3750)) {
wave = 0.0002;
amp = -60;
} else {
amp = 3;
}
xrad = (xland * 180) / Math.PI;
return(360 + (Math.sin(xrad * wave) * amp));
}
if (currentMap == 9) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland <= 250)) {
return(360);
}
if ((xland > 250) and (xland <= 1000)) {
return(360);
}
if ((xland > 1000) and (xland <= 1200)) {
return(((xland - 1000) * 0.5) + 360);
}
if ((xland > 1200) and (xland <= 2200)) {
return(((-(xland - 1200)) * 0.3) + 460);
}
if ((xland > 2200) and (xland <= 2300)) {
return(((xland - 2200) * 0.4) + 160);
}
if ((xland > 2300) and (xland <= 2800)) {
return(((xland - 2300) * 0.32) + 200);
}
if ((xland > 2800) and (xland <= 3290)) {
return(360);
}
if ((xland > 3290) and (xland < 3790)) {
return(((-(xland - 3290)) * 0.5) + 360);
}
return(250);
}
if (currentMap == 10) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland <= 250)) {
return(360);
}
if ((xland > 250) and (xland <= 1000)) {
return(360);
}
if ((xland > 1000) and (xland <= 1010)) {
return(((-(xland - 1000)) * 1) + 360);
}
if ((xland > 1010) and (xland <= 2000)) {
return(350);
}
if ((xland > 2000) and (xland <= 2010)) {
return(((xland - 2000) * 2) + 350);
}
if ((xland > 2010) and (xland <= 2400)) {
return(370);
}
if ((xland > 2400) and (xland <= 2410)) {
return(((-(xland - 2400)) * 1) + 370);
}
if ((xland > 2410) and (xland <= 3250)) {
return(360);
}
if ((xland > 3250) and (xland < 3790)) {
return(360);
}
return(250);
}
if (currentMap == 11) {
rot = 90;
wave = 0.0002;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland < 270)) {
amp = -6;
} else if ((xland > 1370) and (xland < 1920)) {
amp = 130;
} else if ((xland > 2470) and (xland < 2750)) {
amp = 90;
} else if ((xland > 3290) and (xland < 3750)) {
amp = -60;
} else {
amp = 3;
}
xrad = (xland * 180) / Math.PI;
return(360 + (Math.sin(xrad * wave) * amp));
}
if (currentMap == 12) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland <= 250)) {
return(360);
}
if ((xland > 250) and (xland <= 4000)) {
return(360);
}
return(360);
}
if (currentMap == 13) {
rot = 180;
radRot = (rot * Math.PI) / 180;
var _local2 = false;
if ((xland > -250) and (xland <= 250)) {
return(360);
}
if ((xland > 250) and (xland <= 1500)) {
return(360);
}
if ((xland > 1500) and (xland <= 2000)) {
return(((-(xland - 1500)) * 0.1) + 360);
}
if ((xland > 2000) and (xland <= 2100)) {
return(((xland - 2000) * 0.5) + 310);
}
if ((xland > 2100) and (xland <= 2300)) {
return(((-(xland - 2100)) * 0.25) + 360);
}
if ((xland > 2300) and (xland <= 2800)) {
return(((xland - 2300) * 0.1) + 310);
}
if ((xland > 2800) and (xland <= 3290)) {
return(360);
}
if ((xland > 3290) and (xland < 3790)) {
return(((-(xland - 3290)) * 0.5) + 360);
}
return(250);
}
}
function setupunits() {
var _local1 = 1;
while (_local1 < (maxmen + 1)) {
char[_local1] = {unit:"baseman", active:false, targetx:0, targety:0, altercount:0, altered:false, alterx:0, altery:0, target:0, moving:false, frame:0, moveCount:0, team:1, unittype:"footman", armorlvl:0, damagelvl:8, hpCurrent:0, hpMax:100, isHit:false, die:0, range:20, shooting:0, melee:false, mcount:0, ranged:false, starget:0, mtarget:0, rtarget:0, dice:6, nodice:2, pathcount:0, radius:10, group:0, momentum:0, xspeed:2, yspeed:0, hit:false, hyp:0, amp:3, mcy:380, distx:0, disty:0, oldx:0, oldy:0, mcrad:0, queued:false, special:"", specialcount:0, stuncount:0, inwater:false, poisoncount:0, knockcount:0, knockx:0, knocky:0, second:false};
_local1++;
}
char[1000] = {unit:"baseman", active:false, targetx:0, targety:0, altercount:0, altered:false, alterx:0, altery:0, target:0, moving:false, frame:0, moveCount:0, team:1, unittype:"tower", armorlvl:0, damagelvl:60, hpCurrent:100, hpMax:100, isHit:false, die:0, range:700, shooting:0, melee:false, mcount:0, ranged:true, starget:0, mtarget:0, rtarget:0, dice:6, nodice:2, pathcount:0, radius:10, group:0, momentum:0, xspeed:2, yspeed:0, hit:false, hyp:0, amp:3, mcy:380, distx:0, disty:0, oldx:0, oldy:0, mcrad:0, queued:false, special:"", specialcount:0, stuncount:0, inwater:false, second:false};
char[2000] = {unit:"baseman", active:false, targetx:0, targety:0, altercount:0, altered:false, alterx:0, altery:0, target:0, moving:false, frame:0, moveCount:0, team:2, unittype:"tower", armorlvl:0, damagelvl:60, hpCurrent:100, hpMax:100, isHit:false, die:0, range:700, shooting:0, melee:false, mcount:0, ranged:true, starget:0, mtarget:0, rtarget:0, dice:6, nodice:2, pathcount:0, radius:10, group:0, momentum:0, xspeed:2, yspeed:0, hit:false, hyp:0, amp:3, mcy:380, distx:0, disty:0, oldx:0, oldy:0, mcrad:0, queued:false, special:"", specialcount:0, stuncount:0, inwater:false, second:false};
char[1001] = {unit:"baseman", active:false, targetx:0, targety:0, altercount:0, altered:false, alterx:0, altery:0, target:0, moving:false, frame:0, moveCount:0, team:1, unittype:"tower", armorlvl:0, damagelvl:60, hpCurrent:100, hpMax:100, isHit:false, die:0, range:700, shooting:0, melee:false, mcount:0, ranged:true, starget:0, mtarget:0, rtarget:0, dice:6, nodice:2, pathcount:0, radius:10, group:0, momentum:0, xspeed:2, yspeed:0, hit:false, hyp:0, amp:3, mcy:380, distx:0, disty:0, oldx:0, oldy:0, mcrad:0, queued:false, special:"", specialcount:0, stuncount:0, inwater:false, second:false};
char[2001] = {unit:"baseman", active:false, targetx:0, targety:0, altercount:0, altered:false, alterx:0, altery:0, target:0, moving:false, frame:0, moveCount:0, team:2, unittype:"tower", armorlvl:0, damagelvl:60, hpCurrent:100, hpMax:100, isHit:false, die:0, range:700, shooting:0, melee:false, mcount:0, ranged:true, starget:0, mtarget:0, rtarget:0, dice:6, nodice:2, pathcount:0, radius:10, group:0, momentum:0, xspeed:2, yspeed:0, hit:false, hyp:0, amp:3, mcy:380, distx:0, disty:0, oldx:0, oldy:0, mcrad:0, queued:false, special:"", specialcount:0, stuncount:0, inwater:false, second:false};
}
function setupbullets() {
var _local1 = 1;
while (_local1 < (maxbullet + 1)) {
bullet[_local1] = {type:"arrow", active:false, owner:0, momentum:0, rtarget:0, xspeed:0, yspeed:0, hit:false, hyp:0, amp:3, mcy:300, distx:0, disty:0, oldx:0, oldy:0, mcrad:0, wind:0, sound:""};
_local1++;
}
}
function setupcrows() {
var _local1 = 1;
while (_local1 < 6) {
crows[_local1] = {treetarget:"arrow", flying:false, flyhigh:0, targetheight:0, randomcount:Math.round(Math.random() * 500), yoffset:0, xoffset:0};
_local1++;
}
}
function createunit(owner, unit) {
if (((owner == 2) and (unit == "dragon")) and (dragonpopAI > 0)) {
} else if ((((heronumber == 0) and (owner == 1)) or ((heroAINumber == 0) and (owner == 2))) or (unit != "hero")) {
char[nextman].hpCurrent = 100;
char[nextman].hpMax = 100;
char[nextman].damagelvl = 10;
char[nextman].mtarget = 0;
char[nextman].mcount = 0;
char[nextman].rtarget = 0;
char[nextman].starget = 0;
char[nextman].shooting = 0;
char[nextman].melee = false;
char[nextman].active = true;
char[nextman].ranged = false;
char[nextman].xspeed = 3;
char[nextman].mcy = 320;
char[nextman].poisoncount = 0;
char[nextman].knockcount = 0;
char[nextman].knockx = 0;
char[nextman].knocky = 0;
char[nextman].second = false;
switch (unit) {
case "slave" :
game.attachMovie("slave", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "slave";
char[nextman].hpCurrent = 50;
char[nextman].hpMax = 50;
if (owner == 1) {
char[nextman].damagelvl = 8 + int((8 * Math.pow(1.2, meleeWeapons)) - 8);
char[nextman].armor = meleeArmor * 1.5;
char[nextman].hpCurrent = 50 + int((50 * Math.pow(1.1, meleeArmor)) - 50);
char[nextman].hpMax = 50 + int((50 * Math.pow(1.1, meleeArmor)) - 50);
} else {
char[nextman].damagelvl = 8 + int((8 * Math.pow(1.2, AImeleeWeapons)) - 8);
char[nextman].armor = AImeleeArmor * 1.5;
char[nextman].hpCurrent = 50 + int((50 * Math.pow(1.1, AImeleeArmor)) - 50);
char[nextman].hpMax = 50 + int((50 * Math.pow(1.1, AImeleeArmor)) - 50);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("combat_whoosh_04");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("466142_SOUNDDOGS_Si");
break;
case "soldier" :
game.attachMovie("soldier", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "soldier";
char[nextman].hpCurrent = 85;
char[nextman].hpMax = 85;
if (owner == 1) {
char[nextman].damagelvl = 11 + int((11 * Math.pow(1.2, meleeWeapons)) - 11);
char[nextman].armor = meleeArmor * 1.5;
char[nextman].hpCurrent = 85 + int((85 * Math.pow(1.1, meleeArmor)) - 85);
char[nextman].hpMax = 85 + int((85 * Math.pow(1.1, meleeArmor)) - 85);
} else {
char[nextman].damagelvl = 11 + int((11 * Math.pow(1.2, AImeleeWeapons)) - 11);
char[nextman].armor = AImeleeArmor * 1.5;
char[nextman].hpCurrent = 85 + int((85 * Math.pow(1.1, AImeleeArmor)) - 85);
char[nextman].hpMax = 85 + int((85 * Math.pow(1.1, AImeleeArmor)) - 85);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("547622_SOUNDDOGS__ax");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("worker_die1");
break;
case "babydemon" :
game.attachMovie("shadowdemon", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "babydemon";
char[nextman].hpCurrent = 1000;
char[nextman].hpMax = 1000;
if (owner == 1) {
char[nextman].damagelvl = 65 + int((65 * Math.pow(1.8, meleeWeapons)) - 65);
char[nextman].armor = meleeArmor * 1.5;
char[nextman].hpCurrent = 1000 + int((1000 * Math.pow(1.8, meleeArmor)) - 1000);
char[nextman].hpMax = 1000 + int((1000 * Math.pow(1.8, meleeArmor)) - 1000);
} else {
char[nextman].damagelvl = 65 + int((65 * Math.pow(1.8, AImeleeWeapons)) - 65);
char[nextman].armor = AImeleeArmor * 1.5;
char[nextman].hpCurrent = 1000 + int((1000 * Math.pow(1.8, AImeleeArmor)) - 1000);
char[nextman].hpMax = 1000 + int((1000 * Math.pow(1.8, AImeleeArmor)) - 1000);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("behemoth_attack1f");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("behemoth_die4");
break;
case "archer" :
game.attachMovie("archer", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "archer";
char[nextman].ranged = true;
char[nextman].range = 250;
char[nextman].xspeed = 3;
char[nextman].hpCurrent = 40;
char[nextman].hpMax = 40;
if (owner == 1) {
char[nextman].damagelvl = 6 + int((6 * Math.pow(1.2, bowDamage)) - 6);
char[nextman].armor = rangedArmor * 1.5;
char[nextman].hpCurrent = 40 + int((40 * Math.pow(1.1, rangedArmor)) - 40);
char[nextman].hpMax = 40 + int((40 * Math.pow(1.1, rangedArmor)) - 40);
} else {
char[nextman].damagelvl = 6 + int((6 * Math.pow(1.2, AIbowDamage)) - 6);
char[nextman].armor = AIrangedArmor * 1.5;
char[nextman].hpCurrent = 40 + int((40 * Math.pow(1.1, AIrangedArmor)) - 40);
char[nextman].hpMax = 40 + int((40 * Math.pow(1.1, AIrangedArmor)) - 40);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("archer_attack2");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("466142_SOUNDDOGS_Si");
break;
case "assasin" :
game.attachMovie("assasin", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "assasin";
char[nextman].hpCurrent = 100;
char[nextman].hpMax = 100;
char[nextman].xspeed = 4;
if (owner == 1) {
char[nextman].damagelvl = 15 + int((15 * Math.pow(1.2, meleeWeapons)) - 15);
char[nextman].armor = meleeArmor * 1.5;
char[nextman].hpCurrent = 100 + int((100 * Math.pow(1.1, meleeArmor)) - 100);
char[nextman].hpMax = 100 + int((100 * Math.pow(1.1, meleeArmor)) - 100);
} else {
char[nextman].damagelvl = 15 + int((15 * Math.pow(1.2, AImeleeWeapons)) - 15);
char[nextman].armor = AImeleeArmor * 1.5;
char[nextman].hpCurrent = 100 + int((100 * Math.pow(1.1, AImeleeArmor)) - 100);
char[nextman].hpMax = 100 + int((100 * Math.pow(1.1, AImeleeArmor)) - 100);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("130784_SOUNDDOGS_WE");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("daemon_die1");
break;
case "lionrider" :
game.attachMovie("lionrider", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "lionrider";
char[nextman].range = 300;
char[nextman].hpCurrent = 280;
char[nextman].hpMax = 280;
char[nextman].xspeed = 5;
if (owner == 1) {
char[nextman].damagelvl = 25 + int((25 * Math.pow(1.2, meleeWeapons)) - 25);
char[nextman].armor = meleeArmor * 1.5;
char[nextman].hpCurrent = 280 + int((280 * Math.pow(1.1, meleeArmor)) - 280);
char[nextman].hpMax = 280 + int((280 * Math.pow(1.1, meleeArmor)) - 280);
} else {
char[nextman].damagelvl = 25 + int((25 * Math.pow(1.2, AImeleeWeapons)) - 25);
char[nextman].armor = AImeleeArmor * 1.5;
char[nextman].hpCurrent = 280 + int((280 * Math.pow(1.1, AImeleeArmor)) - 280);
char[nextman].hpMax = 280 + int((280 * Math.pow(1.1, AImeleeArmor)) - 280);
}
game["unit" + nextman].rattacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].rattacksound.attachSound("archer_attack2");
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("lion_growl");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("lion_moan");
break;
case "lion" :
game.attachMovie("chief4b", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "lion";
char[nextman].hpCurrent = 200;
char[nextman].hpMax = 200;
char[nextman].xspeed = 6;
if (owner == 1) {
char[nextman].damagelvl = 25 + int((25 * Math.pow(1.2, meleeWeapons)) - 25);
char[nextman].armor = meleeArmor * 1.5;
char[nextman].hpCurrent = 200 + int((200 * Math.pow(1.1, meleeArmor)) - 200);
char[nextman].hpMax = 200 + int((200 * Math.pow(1.1, meleeArmor)) - 200);
} else {
char[nextman].damagelvl = 25 + int((25 * Math.pow(1.2, AImeleeWeapons)) - 25);
char[nextman].armor = AImeleeArmor * 1.5;
char[nextman].hpCurrent = 200 + int((200 * Math.pow(1.1, AImeleeArmor)) - 200);
char[nextman].hpMax = 200 + int((200 * Math.pow(1.1, AImeleeArmor)) - 200);
}
game["unit" + nextman].rattacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].rattacksound.attachSound("archer_attack2");
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("lion_growl");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("lion_moan");
break;
case "largelion" :
game.attachMovie("chief4b", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "largelion";
char[nextman].hpCurrent = 1200;
char[nextman].hpMax = 1200;
char[nextman].xspeed = 7;
if (owner == 1) {
char[nextman].damagelvl = 80 + int((80 * Math.pow(1.2, meleeWeapons)) - 80);
char[nextman].armor = meleeArmor * 1.5;
char[nextman].hpCurrent = 1200 + int((1200 * Math.pow(1.1, meleeArmor)) - 1200);
char[nextman].hpMax = 1200 + int((1200 * Math.pow(1.1, meleeArmor)) - 1200);
} else {
char[nextman].damagelvl = 80 + int((80 * Math.pow(1.2, AImeleeWeapons)) - 80);
char[nextman].armor = AImeleeArmor * 1.5;
char[nextman].hpCurrent = 1200 + int((1200 * Math.pow(1.1, AImeleeArmor)) - 1200);
char[nextman].hpMax = 1200 + int((1200 * Math.pow(1.1, AImeleeArmor)) - 1200);
}
game["unit" + nextman].rattacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].rattacksound.attachSound("archer_attack2");
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("lion_growl");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("lion_moan");
break;
case "elitelionrider" :
game.attachMovie("lionrider", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "elitelionrider";
char[nextman].range = 350;
char[nextman].hpCurrent = 750;
char[nextman].hpMax = 750;
char[nextman].xspeed = 6;
if (owner == 1) {
char[nextman].damagelvl = 55 + int((55 * Math.pow(1.2, meleeWeapons)) - 55);
char[nextman].armor = meleeArmor * 2.5;
char[nextman].hpCurrent = 750 + int((750 * Math.pow(1.1, meleeArmor)) - 750);
char[nextman].hpMax = 750 + int((750 * Math.pow(1.1, meleeArmor)) - 750);
} else {
char[nextman].damagelvl = 55 + int((55 * Math.pow(1.2, AImeleeWeapons)) - 55);
char[nextman].armor = AImeleeArmor * 2.5;
char[nextman].hpCurrent = 750 + int((750 * Math.pow(1.1, AImeleeArmor)) - 750);
char[nextman].hpMax = 750 + int((750 * Math.pow(1.1, AImeleeArmor)) - 750);
}
game["unit" + nextman].rattacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].rattacksound.attachSound("archer_attack2");
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("lion_growl");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("lion_moan");
break;
case "battletroll" :
game.attachMovie("battletroll", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "battletroll";
char[nextman].ranged = true;
char[nextman].range = 300;
char[nextman].hpCurrent = 1000;
char[nextman].hpMax = 1000;
char[nextman].xspeed = 4;
if (owner == 1) {
char[nextman].damagelvl = 85 + int((85 * Math.pow(1.2, bowDamage)) - 85);
char[nextman].armor = rangedArmor * 1.5;
char[nextman].hpCurrent = 1000 + int((1000 * Math.pow(1.1, rangedArmor)) - 1000);
char[nextman].hpMax = 1000 + int((1000 * Math.pow(1.1, rangedArmor)) - 1000);
} else {
char[nextman].damagelvl = 85 + int((85 * Math.pow(1.2, AIbowDamage)) - 85);
char[nextman].armor = AIrangedArmor * 1.5;
char[nextman].hpCurrent = 1000 + int((1000 * Math.pow(1.1, AIrangedArmor)) - 1000);
char[nextman].hpMax = 1000 + int((1000 * Math.pow(1.1, AIrangedArmor)) - 1000);
}
game["unit" + nextman].rattacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].rattacksound.attachSound("679151_SOUNDDOGS__fi");
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("behemoth_attack1g");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("behemoth_die4");
break;
case "golem" :
game.attachMovie("golem", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "golem";
char[nextman].hpCurrent = 4000;
char[nextman].hpMax = 4000;
char[nextman].xspeed = 4;
if (owner == 1) {
char[nextman].damagelvl = 100 + int((100 * Math.pow(1.2, meleeWeapons)) - 100);
char[nextman].armor = 10 + (meleeArmor * 2.5);
char[nextman].hpCurrent = 2000 + int((2000 * Math.pow(1.1, meleeArmor)) - 2000);
char[nextman].hpMax = 2000 + int((2000 * Math.pow(1.1, meleeArmor)) - 2000);
} else {
char[nextman].damagelvl = 100 + int((100 * Math.pow(1.2, AImeleeWeapons)) - 100);
char[nextman].armor = 10 + (AImeleeArmor * 2.5);
char[nextman].hpCurrent = 2000 + int((2000 * Math.pow(1.1, AImeleeArmor)) - 2000);
char[nextman].hpMax = 2000 + int((2000 * Math.pow(1.1, AImeleeArmor)) - 2000);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("behemoth_attack1g");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("behemoth_die4");
break;
case "undeadknight" :
game.attachMovie("UndeadKnight", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "undeadknight";
char[nextman].hpCurrent = 2000;
char[nextman].hpMax = 2000;
char[nextman].xspeed = 4;
if (owner == 1) {
char[nextman].damagelvl = 80 + int((80 * Math.pow(1.5, meleeWeapons)) - 80);
char[nextman].armor = 10 + (meleeArmor * 4.5);
char[nextman].hpCurrent = 2000 + int((2000 * Math.pow(1.5, meleeArmor)) - 2000);
char[nextman].hpMax = 2000 + int((2000 * Math.pow(1.5, meleeArmor)) - 2000);
} else {
char[nextman].damagelvl = 80 + int((80 * Math.pow(1.5, AImeleeWeapons)) - 80);
char[nextman].armor = 10 + (AImeleeArmor * 4.5);
char[nextman].hpCurrent = 2000 + int((2000 * Math.pow(1.5, AImeleeArmor)) - 2000);
char[nextman].hpMax = 2000 + int((2000 * Math.pow(1.5, AImeleeArmor)) - 2000);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("combat_whoosh_02");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("behemoth_die3");
break;
case "drake" :
game.attachMovie("firedrake", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "drake";
if (owner == 1) {
char[nextman].hpCurrent = 900 + int((900 * Math.pow(1.2, drakeGrow)) - 900);
char[nextman].hpMax = 900 + int((900 * Math.pow(1.2, drakeGrow)) - 900);
char[nextman].damagelvl = 35 + int((35 * Math.pow(1.2, drakeGrow)) - 35);
char[nextman].xspeed = 4;
char[nextman].armor = drakeGrow * 1;
} else {
char[nextman].hpCurrent = 900 + int((900 * Math.pow(1.2, AIdrakeGrow)) - 900);
char[nextman].hpMax = 900 + int((900 * Math.pow(1.2, AIdrakeGrow)) - 900);
char[nextman].damagelvl = 35 + int((35 * Math.pow(1.2, AIdrakeGrow)) - 35);
char[nextman].xspeed = 4;
char[nextman].armor = AIdrakeGrow * 1;
if (currentMap == 7) {
char[nextman].hpCurrent = 1500 + int((1500 * Math.pow(1.2, AIdrakeGrow)) - 1500);
char[nextman].hpMax = 1500 + int((1500 * Math.pow(1.2, AIdrakeGrow)) - 1500);
char[nextman].damagelvl = 55 + int((55 * Math.pow(1.2, AIdrakeGrow)) - 55);
char[nextman].xspeed = 5;
char[nextman].armor = AIdrakeGrow * 2;
}
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("behemoth_attack1g");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("behemoth_die2");
game["unit" + nextman].exitsound = new Sound(game["unit" + nextman]);
game["unit" + nextman].exitsound.attachSound("lion_snarl");
game["unit" + nextman].exitsound.setVolume(100 * _global.mainVolume);
game["unit" + nextman].exitsound.start(0, 1);
break;
case "shadowdemon" :
game.attachMovie("shadowdemon", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
game["unit" + nextman].filters = [demonGlowFilter];
game["unit" + nextman]._alpha = 55;
char[nextman].unit = "shadowdemon";
if (((owner == 1) and shadowdemon2) or ((owner == 2) and AIshadowdemon2)) {
game["unit" + nextman].blendMode = "difference";
char[nextman].hpCurrent = 15000;
char[nextman].hpMax = 15000;
char[nextman].damagelvl = 600;
char[nextman].xspeed = 6;
char[nextman].armor = 30;
} else {
char[nextman].hpCurrent = 3500;
char[nextman].hpMax = 3500;
char[nextman].damagelvl = 120;
char[nextman].xspeed = 5;
char[nextman].armor = 5;
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("behemoth_attack1f");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("behemoth_die4");
game["unit" + nextman].exitsound = new Sound(game["unit" + nextman]);
game["unit" + nextman].exitsound.attachSound("fresh meat");
game["unit" + nextman].exitsound.setVolume(100 * _global.mainVolume);
game["unit" + nextman].exitsound.start(0, 1);
break;
case "wizard" :
game.attachMovie("wizard", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "wizard";
char[nextman].ranged = true;
char[nextman].range = 250;
char[nextman].xspeed = 3;
char[nextman].hpCurrent = 90;
char[nextman].hpMax = 90;
if (owner == 1) {
char[nextman].damagelvl = 12 + int((12 * Math.pow(1.25, fireballSpell)) - 12);
char[nextman].armor = rangedArmor * 1.5;
char[nextman].hpCurrent = 90 + int((90 * Math.pow(1.1, rangedArmor)) - 90);
char[nextman].hpMax = 90 + int((90 * Math.pow(1.1, rangedArmor)) - 90);
} else {
char[nextman].damagelvl = 12 + int((12 * Math.pow(1.25, AIfireballSpell)) - 12);
char[nextman].armor = AIrangedArmor * 1.5;
char[nextman].hpCurrent = 90 + int((90 * Math.pow(1.1, AIrangedArmor)) - 90);
char[nextman].hpMax = 90 + int((90 * Math.pow(1.1, AIrangedArmor)) - 90);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("Whoosh");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("archmage_die2");
break;
case "babywing" :
game.attachMovie("wingeddemon", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "babywing";
char[nextman].ranged = true;
char[nextman].range = 300;
char[nextman].xspeed = 4;
char[nextman].hpCurrent = 4500;
char[nextman].hpMax = 4500;
if (owner == 1) {
char[nextman].damagelvl = 280 + int((280 * Math.pow(1.9, fireballSpell)) - 280);
char[nextman].armor = rangedArmor * 1.5;
char[nextman].hpCurrent = 4500 + int((4500 * Math.pow(1.9, rangedArmor)) - 4500);
char[nextman].hpMax = 4500 + int((4500 * Math.pow(1.9, rangedArmor)) - 4500);
} else {
char[nextman].damagelvl = 280 + int((280 * Math.pow(1.9, AIfireballSpell)) - 280);
char[nextman].armor = AIrangedArmor * 1.5;
char[nextman].hpCurrent = 4500 + int((4500 * Math.pow(1.9, AIrangedArmor)) - 4500);
char[nextman].hpMax = 4500 + int((4500 * Math.pow(1.9, AIrangedArmor)) - 4500);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("dragonbreath");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("moan");
game["unit" + nextman].exitsound = new Sound(game["unit" + nextman]);
game["unit" + nextman].exitsound.attachSound("lion_snarl");
game["unit" + nextman].exitsound.setVolume(100 * _global.mainVolume);
game["unit" + nextman].exitsound.start(0, 1);
break;
case "dragon" :
game.attachMovie("dragon", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "dragon";
char[nextman].ranged = true;
char[nextman].range = 450;
char[nextman].altitude = 70 + int(Math.random() * 60);
char[nextman].xspeed = 4;
char[nextman].hpCurrent = 5000;
char[nextman].hpMax = 5000;
if (owner == 1) {
char[nextman].damagelvl = 200 + int((200 * Math.pow(1.25, fireballSpell)) - 200);
char[nextman].armor = rangedArmor * 1.5;
char[nextman].hpCurrent = 5000 + int((5000 * Math.pow(1.1, rangedArmor)) - 5000);
char[nextman].hpMax = 5000 + int((5000 * Math.pow(1.1, rangedArmor)) - 5000);
} else {
char[nextman].damagelvl = 200 + int((200 * Math.pow(1.25, AIfireballSpell)) - 200);
char[nextman].armor = AIrangedArmor * 1.5;
char[nextman].hpCurrent = 5000 + int((5000 * Math.pow(1.1, AIrangedArmor)) - 5000);
char[nextman].hpMax = 5000 + int((5000 * Math.pow(1.1, AIrangedArmor)) - 5000);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("dragonbreath");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("moan");
game["unit" + nextman].exitsound = new Sound(game["unit" + nextman]);
game["unit" + nextman].exitsound.attachSound("lion_snarl");
game["unit" + nextman].exitsound.setVolume(100 * _global.mainVolume);
game["unit" + nextman].exitsound.start(0, 1);
break;
case "spiderrider" :
game.attachMovie("spiderrider", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "spiderrider";
char[nextman].ranged = true;
char[nextman].range = 300;
char[nextman].xspeed = 4;
char[nextman].hpCurrent = 220;
char[nextman].hpMax = 220;
if (owner == 1) {
char[nextman].damagelvl = 25 + int((25 * Math.pow(1.2, bowDamage)) - 25);
char[nextman].armor = rangedArmor * 1.5;
char[nextman].hpCurrent = 220 + int((220 * Math.pow(1.1, rangedArmor)) - 220);
char[nextman].hpMax = 220 + int((220 * Math.pow(1.1, rangedArmor)) - 220);
} else {
char[nextman].damagelvl = 25 + int((25 * Math.pow(1.2, AIbowDamage)) - 25);
char[nextman].armor = AIrangedArmor * 1.5;
char[nextman].hpCurrent = 220 + int((220 * Math.pow(1.1, AIrangedArmor)) - 220);
char[nextman].hpMax = 220 + int((220 * Math.pow(1.1, AIrangedArmor)) - 220);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("archer_attack2");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("archer_die4");
break;
case "catapult" :
game.attachMovie("catapult", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "catapult";
char[nextman].ranged = true;
char[nextman].range = 200;
char[nextman].xspeed = 2;
char[nextman].hpCurrent = 1200;
char[nextman].hpMax = 1200;
char[nextman].damagelvl = 200;
char[nextman].armor = 5;
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("679151_SOUNDDOGS__fi");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("aexp2");
break;
case "hero" :
if (owner == 1) {
game.attachMovie(_global.chief, "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
game["unit" + nextman].exitsound = new Sound(game["unit" + nextman]);
game["unit" + nextman].exitsound.attachSound("time to pay");
game["unit" + nextman].exitsound.setVolume(100 * _global.mainVolume);
game["unit" + nextman].exitsound.start(0, 1);
} else {
game.attachMovie(_global.AIchief, "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
heroAIDie++;
}
game["unit" + nextman].filters = [yellowGlowFilter];
char[nextman].unit = "chief";
char[nextman].xspeed = 5;
if (owner == 1) {
if (_global.chief == "chief5") {
char[nextman].xspeed = 7;
} else if (_global.chief == "chief6") {
char[nextman].xspeed = 9;
char[nextman].ranged = true;
char[nextman].range = 300;
} else if (_global.chief == "chief2") {
char[nextman].xspeed = 5;
char[nextman].ranged = true;
char[nextman].range = 300;
trace("HERO IS RANGED!!!");
} else {
char[nextman].xspeed = 5;
}
} else if (_global.AIchief == "chief5") {
char[nextman].xspeed = 7;
} else if (_global.AIchief == "chief6") {
char[nextman].xspeed = 9;
char[nextman].ranged = true;
char[nextman].range = 300;
trace("HERO IS RANGED!!!");
} else if (_global.AIchief == "chief2") {
char[nextman].xspeed = 5;
char[nextman].ranged = true;
char[nextman].range = 300;
trace("HERO IS RANGED!!!");
} else if (_global.AIchief == "ChampionKnight") {
char[nextman].xspeed = 4;
trace("HERO IS RANGED!!!");
} else {
char[nextman].xspeed = 5;
}
if (owner == 1) {
char[nextman].hpCurrent = int(herohp * Math.pow(gainrate, herolvl));
char[nextman].hpMax = int(herohp * Math.pow(gainrate, herolvl));
char[nextman].damagelvl = int(herodmg * Math.pow(gainrate, herolvl));
heronumber = nextman;
} else {
char[nextman].hpCurrent = int(heroAIhp * Math.pow(gainrate, heroAILevel));
char[nextman].hpMax = int(heroAIhp * Math.pow(gainrate, heroAILevel));
char[nextman].damagelvl = int(heroAIdmg * Math.pow(gainrate, heroAILevel));
heroAIXp = heroAIXp + ((500 * difficulty) * ((heroAIDie * currentMap) / 4));
heroAINumber = nextman;
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("combat_whoosh_02");
game["unit" + nextman].attacksound1 = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound1.attachSound("465491_SOUNDDOGS_Ki");
game["unit" + nextman].attacksound2 = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound2.attachSound("hammer_strike_armor_chain_04");
game["unit" + nextman].attacksound3 = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound3.attachSound("hammer_strike_body_slash_05");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("ahhhh");
game["unit" + nextman].stompsound = new Sound(game["unit" + nextman]);
game["unit" + nextman].stompsound.attachSound("214735_SOUNDDOGS_pu");
break;
default :
game.attachMovie("wargrider", "unit" + nextman, 1000 + nextman, {_x:170, _y:450});
char[nextman].unit = "wargrider";
char[nextman].xspeed = 4;
char[nextman].hpCurrent = 320;
char[nextman].hpMax = 320;
if (owner == 1) {
char[nextman].damagelvl = 30 + int((30 * Math.pow(1.2, meleeWeapons)) - 30);
char[nextman].armor = 3 + (meleeArmor * 1.5);
char[nextman].hpCurrent = 320 + int((320 * Math.pow(1.1, meleeArmor)) - 320);
char[nextman].hpMax = 320 + int((320 * Math.pow(1.1, meleeArmor)) - 320);
} else {
char[nextman].damagelvl = 30 + int((30 * Math.pow(1.2, AImeleeWeapons)) - 30);
char[nextman].armor = 3 + (AImeleeArmor * 1.5);
char[nextman].hpCurrent = 320 + int((320 * Math.pow(1.1, AImeleeArmor)) - 320);
char[nextman].hpMax = 320 + int((320 * Math.pow(1.1, AImeleeArmor)) - 320);
}
game["unit" + nextman].attacksound = new Sound(game["unit" + nextman]);
game["unit" + nextman].attacksound.attachSound("combat_whoosh_02");
game["unit" + nextman].diesound = new Sound(game["unit" + nextman]);
game["unit" + nextman].diesound.attachSound("behemoth_die1");
}
game["unit" + nextman]._y = 320;
if (owner == 1) {
playerpop++;
char[nextman].team = 1;
game["unit" + nextman]._xscale = -90;
game["unit" + nextman]._yscale = 90;
if ((char[nextman].unit == "wargrider") or (char[nextman].unit == "spiderrider")) {
} else if (char[nextman].unit == "drake") {
game["unit" + nextman]._xscale = -50 - ((50 * drakeGrow) * 0.1);
game["unit" + nextman]._yscale = 50 + ((50 * drakeGrow) * 0.1);
} else if (char[nextman].unit == "shadowdemon") {
if (shadowdemon2) {
game["unit" + nextman]._xscale = -120;
game["unit" + nextman]._yscale = 120;
} else {
game["unit" + nextman]._xscale = -80;
game["unit" + nextman]._yscale = 80;
}
} else if (char[nextman].unit == "catapult") {
game["unit" + nextman]._xscale = -60;
game["unit" + nextman]._yscale = 60;
} else if (char[nextman].unit == "lionrider") {
game["unit" + nextman]._xscale = -80;
game["unit" + nextman]._yscale = 80;
} else if (char[nextman].unit == "lion") {
game["unit" + nextman]._xscale = -70;
game["unit" + nextman]._yscale = 70;
} else if (char[nextman].unit == "babydemon") {
game["unit" + nextman]._xscale = -60 - (meleeWeapons * 4);
game["unit" + nextman]._yscale = 60 + (meleeWeapons * 4);
} else if (char[nextman].unit == "babywing") {
game["unit" + nextman]._xscale = -60 - (meleeWeapons * 6);
game["unit" + nextman]._yscale = 60 + (meleeWeapons * 6);
} else if (char[nextman].unit == "elitelionrider") {
myPColor = new Color(game["unit" + nextman]);
myPColorTransform = new Object();
myPColorTransform = {ra:100, ga:0, ba:0, rb:0, gb:0, bb:0};
myPColor.setTransform(myPColorTransform);
} else if (char[nextman].unit == "battletroll") {
game["unit" + nextman]._xscale = -100;
game["unit" + nextman]._yscale = 100;
} else if (char[nextman].unit == "golem") {
game["unit" + nextman]._xscale = -100;
game["unit" + nextman]._yscale = 100;
} else if (char[nextman].unit == "dragon") {
game["unit" + nextman]._xscale = -100;
game["unit" + nextman]._yscale = 100;
}
} else {
char[nextman].team = 2;
game["unit" + nextman]._x = 3390;
char[nextman].xspeed = char[nextman].xspeed * -1;
game["unit" + nextman]._xscale = 90;
game["unit" + nextman]._yscale = 90;
if ((char[nextman].unit == "wargrider") or (char[nextman].unit == "spiderrider")) {
} else if (char[nextman].unit == "drake") {
game["unit" + nextman]._xscale = 50 + ((50 * AIdrakeGrow) * 0.1);
game["unit" + nextman]._yscale = 50 + ((50 * AIdrakeGrow) * 0.1);
if (currentMap == 7) {
myPColor = new Color(game["unit" + nextman]);
myPColorTransform = new Object();
myPColorTransform = {ra:-50, ga:100, ba:0, rb:0, gb:0, bb:0};
myPColor.setTransform(myPColorTransform);
game["unit" + nextman]._xscale = 70 + ((70 * AIdrakeGrow) * 0.15);
game["unit" + nextman]._yscale = 70 + ((70 * AIdrakeGrow) * 0.15);
}
} else if ((unit == "hero") and (_global.AIchief == "undeadknight")) {
game["unit" + nextman]._xscale = 110;
game["unit" + nextman]._yscale = 110;
} else if (char[nextman].unit == "shadowdemon") {
if (AIshadowdemon2) {
game["unit" + nextman]._xscale = 130;
game["unit" + nextman]._yscale = 130;
} else {
game["unit" + nextman]._xscale = 80;
game["unit" + nextman]._yscale = 80;
}
} else if (char[nextman].unit == "catapult") {
game["unit" + nextman]._xscale = 60;
game["unit" + nextman]._yscale = 60;
} else if (char[nextman].unit == "lionrider") {
game["unit" + nextman]._xscale = 80;
game["unit" + nextman]._yscale = 80;
} else if (char[nextman].unit == "lion") {
game["unit" + nextman]._xscale = 70;
game["unit" + nextman]._yscale = 70;
} else if (char[nextman].unit == "babydemon") {
game["unit" + nextman]._xscale = 60 + (meleeWeapons * 4);
game["unit" + nextman]._yscale = 60 + (meleeWeapons * 4);
} else if (char[nextman].unit == "babywing") {
game["unit" + nextman]._xscale = 60 + (meleeWeapons * 6);
game["unit" + nextman]._yscale = 60 + (meleeWeapons * 6);
} else if (char[nextman].unit == "elitelionrider") {
myPColor = new Color(game["unit" + nextman]);
myPColorTransform = new Object();
myPColorTransform = {ra:100, ga:0, ba:0, rb:0, gb:0, bb:0};
myPColor.setTransform(myPColorTransform);
} else if (char[nextman].unit == "battletroll") {
game["unit" + nextman]._xscale = 100;
game["unit" + nextman]._yscale = 100;
} else if (char[nextman].unit == "golem") {
game["unit" + nextman]._xscale = 100;
game["unit" + nextman]._yscale = 100;
} else if (char[nextman].unit == "dragon") {
game["unit" + nextman]._xscale = 100;
game["unit" + nextman]._yscale = 100;
}
}
game["unit" + nextman].hb._visible = false;
game.attachMovie("healthbar", "healthbar" + nextman, 1100 + nextman);
var _local3 = 1;
while (_local3 < (maxmen + 1)) {
nextman++;
if (nextman > maxmen) {
nextman = 1;
}
if (!char[nextman].active) {
break;
}
_local3++;
}
}
}
function aimen() {
addmen--;
if (addmen < 0) {
addmen = buildinterval;
ranunit = 0;
if (armies[0].slave > 0) {
ranunit = 1;
armies[0].slave--;
} else if (armies[0].soldier > 0) {
ranunit = 2;
armies[0].soldier--;
} else if (armies[0].archer > 0) {
ranunit = 3;
armies[0].archer--;
} else if (armies[0].wizard > 0) {
ranunit = 4;
armies[0].wizard--;
} else if (armies[0].assassin > 0) {
ranunit = 5;
armies[0].assassin--;
} else if (armies[0].wolfrider > 0) {
ranunit = 8;
armies[0].wolfrider--;
} else if (armies[0].spiderrider > 0) {
ranunit = 6;
armies[0].spiderrider--;
} else if (armies[0].drake > 0) {
ranunit = 7;
armies[0].drake--;
} else if (armies[0].dragon > 0) {
ranunit = 9;
armies[0].dragon--;
} else if (armies[0].lionrider > 0) {
ranunit = 10;
armies[0].lionrider--;
} else if (armies[0].battletroll > 0) {
ranunit = 11;
armies[0].battletroll--;
} else if (armies[0].golem > 0) {
ranunit = 12;
armies[0].golem--;
} else if (armies[0].elitelionrider > 0) {
ranunit = 13;
armies[0].elitelionrider--;
} else if (armies[0].babydemon > 0) {
ranunit = 14;
armies[0].babydemon--;
} else if (armies[0].babywing > 0) {
ranunit = 15;
armies[0].babywing--;
} else if (armies[0].lion > 0) {
ranunit = 16;
armies[0].lion--;
} else if (armies[0].largelion > 0) {
ranunit = 17;
armies[0].largelion--;
} else if (armies[0].undeadknight > 0) {
ranunit = 18;
armies[0].undeadknight--;
}
if (AIpop < 25) {
switch (ranunit) {
case 1 :
createunit(2, "slave");
return;
case 2 :
createunit(2, "soldier");
return;
case 3 :
createunit(2, "archer");
return;
case 4 :
createunit(2, "wizard");
return;
case 5 :
createunit(2, "assasin");
return;
case 6 :
createunit(2, "spiderrider");
return;
case 7 :
createunit(2, "drake");
return;
case 8 :
createunit(2, "wargrider");
return;
case 9 :
createunit(2, "dragon");
return;
case 10 :
createunit(2, "lionrider");
return;
case 11 :
createunit(2, "battletroll");
return;
case 12 :
createunit(2, "golem");
return;
case 13 :
createunit(2, "elitelionrider");
return;
case 14 :
createunit(2, "babydemon");
return;
case 15 :
createunit(2, "babywing");
return;
case 16 :
createunit(2, "lion");
return;
case 17 :
createunit(2, "largelion");
return;
case 18 :
createunit(2, "undeadknight");
return;
}
}
}
}
function setAIWave() {
if (AIAutoDefense > 0) {
AIAutoDefense--;
}
waveLevel = Math.min(1 + Math.round(gamecount / (intervals * 4)), 12);
var _local1 = 0;
if ((gamecount % intervals) == 0) {
if (AIAutoDefense > 0) {
gamecount = gamecount + (framerate * 5);
}
wavecount++;
if (AIAutoDefense > 0) {
_local1 = waveLevel + 24;
} else if ((wavecount % 5) == 0) {
_local1 = waveLevel + 24;
} else if ((wavecount % 3) == 0) {
_local1 = waveLevel + 12;
} else {
_local1 = waveLevel;
}
armies[0].slave = armies[_local1].slave;
armies[0].archer = armies[_local1].archer;
armies[0].soldier = armies[_local1].soldier;
armies[0].assassin = armies[_local1].assassin;
armies[0].wizard = armies[_local1].wizard;
armies[0].wolfrider = armies[_local1].wolfrider;
armies[0].spiderrider = armies[_local1].spiderrider;
armies[0].drake = armies[_local1].drake;
armies[0].dragon = armies[_local1].dragon;
armies[0].lionrider = armies[_local1].lionrider;
armies[0].elitelionrider = armies[_local1].elitelionrider;
armies[0].battletroll = armies[_local1].battletroll;
armies[0].golem = armies[_local1].golem;
armies[0].babydemon = armies[_local1].babydemon;
armies[0].babywing = armies[_local1].babywing;
armies[0].lion = armies[_local1].lion;
armies[0].largelion = armies[_local1].largelion;
armies[0].undeadknight = armies[_local1].undeadknight;
}
if ((gamecount > 15000) and (currentMap > (12 - (difficulty * 2)))) {
AIshadowdemon2 = true;
}
}
function cuemen() {
if (unitcue[cuecounter].active) {
_root.attachMovie("cuedetails", "cuedetails", 26);
if (unitcue[nextcue].active) {
_root.cuedetails.maxunits = "QUEUE LIMIT REACHED";
} else {
_root.cuedetails.maxunits = "";
}
_root.cuedetails._x = 400;
_root.cuedetails._y = -4;
_root.cuedetails.attachMovie("i" + unitcue[cuecounter].unit, "currentunit", 1);
_root.cuedetails.currentunit._x = 205;
_root.cuedetails.currentunit._y = 16;
var _local3 = cuecounter + 1;
if (_local3 > 10) {
_local3 = 1;
}
var _local2 = 1;
while ((unitcue[_local3].active and (_local2 < 11)) and (_local3 != cuecounter)) {
_root.cuedetails.attachMovie("i" + unitcue[_local3].unit, "cuespace" + _local2, 1 + _local2);
_root.cuedetails["cuespace" + _local2]._x = 170 - (15 * _local2);
_root.cuedetails["cuespace" + _local2]._y = 16;
_local3++;
_local2++;
if (_local3 > 10) {
_local3 = 1;
}
}
unitcue[cuecounter].percentage = unitcue[cuecounter].percentage + 3;
_root.cuedetails.loadbar._yscale = unitcue[cuecounter].percentage;
if (unitcue[cuecounter].percentage > 99) {
if (playerpop < maxpop) {
_root.cuedetails.maxunits = "";
unitcue[cuecounter].percentage = 0;
unitcue[cuecounter].active = false;
var _local4 = unitcue[cuecounter].unit;
switch (_local4) {
case "slave" :
createunit(1, "slave");
break;
case "soldier" :
createunit(1, "soldier");
break;
case "archer" :
createunit(1, "archer");
break;
case "wizard" :
createunit(1, "wizard");
break;
case "assasin" :
createunit(1, "assasin");
break;
case "drake" :
createunit(1, "drake");
break;
case "shadowdemon" :
createunit(1, "shadowdemon");
break;
case "spiderrider" :
createunit(1, "spiderrider");
break;
case "catapult" :
createunit(1, "catapult");
break;
case "lionrider" :
createunit(1, "lionrider");
break;
case "elitelionrider" :
createunit(1, "elitelionrider");
break;
case "battletroll" :
createunit(1, "battletroll");
break;
case "golem" :
createunit(1, "golem");
break;
case "dragon" :
createunit(1, "dragon");
break;
case "lion" :
createunit(1, "lion");
break;
case "largelion" :
createunit(1, "largelion");
break;
case "undeadknight" :
createunit(1, "undeadknight");
break;
default :
createunit(1, "wargrider");
}
cuecounter++;
if (cuecounter > 10) {
cuecounter = 1;
}
} else {
unitcue[cuecounter].percentage = 99;
_root.cuedetails.loadbar._yscale = unitcue[cuecounter].percentage;
_root.cuedetails.maxunits = "GOBLIN LIMIT REACHED";
}
}
} else {
_root.cuedetails.removeMovieClip();
}
}
function addtocue(owner, unit) {
if ((dragonpop < 1) or (unit != "dragon")) {
var _local3 = 0;
switch (unit) {
case "slave" :
_local3 = slavecost;
break;
case "soldier" :
_local3 = soldiercost;
break;
case "archer" :
_local3 = archercost;
break;
case "wizard" :
_local3 = wizardcost;
break;
case "dragon" :
_local3 = dragoncost;
break;
case "assasin" :
_local3 = assasincost;
break;
case "spiderrider" :
_local3 = spiderridercost;
break;
case "drake" :
_local3 = drakecost;
break;
case "shadowdemon" :
_local3 = 0;
break;
case "lionrider" :
_local3 = lionridercost;
break;
case "elitelionrider" :
_local3 = elitelionridercost;
break;
case "battletroll" :
_local3 = battletrollcost;
break;
case "golem" :
_local3 = golemcost;
break;
case "undeadknight" :
_local3 = undeadknightcost;
break;
case "catapult" :
_local3 = 0;
break;
case "lion" :
_local3 = lioncost;
break;
case "largelion" :
_local3 = largelioncost;
break;
default :
_local3 = wolfridercost;
}
if (_global.gold >= _local3) {
if (!unitcue[nextcue].active) {
_global.gold = _global.gold - _local3;
unitcue[nextcue].active = true;
unitcue[nextcue].percentage = 0;
unitcue[nextcue].unit = unit;
nextcue++;
if (nextcue > 10) {
nextcue = 1;
}
} else {
_root.cuedetails.maxunits = "QUEUE LIMIT REACHED";
}
}
} else {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "You Can Only Have\r1 Dragon\rAt a time!";
}
}
function moveunits() {
var _local1 = 1;
while (_local1 < (maxmen + 1)) {
if (char[_local1].knockcount > 0) {
flinging(_local1);
} else if (char[_local1].active and (char[_local1].stuncount == 0)) {
if (((((char[_local1].melee and (char[_local1].mtarget != 0)) and (char[_local1].mtarget < 100)) and ((heronumber != _local1) or (!heroflee))) and ((heroAINumber != _local1) or (!heroAIFlee))) and (char[_local1].shooting == 0)) {
unitmelee(_local1);
} else if (char[_local1].special != "") {
special(_local1);
} else if (((char[_local1].melee and ((heronumber != _local1) or (!heroflee))) and ((heroAINumber != _local1) or (!heroAIFlee))) and (char[_local1].shooting == 0)) {
if (getDist(game["unit" + _local1]._x, game["unit" + _local1]._y, game["tower" + (3 - char[_local1].team)]._x, game["tower" + (3 - char[_local1].team)]._y) > 150) {
char[_local1].melee = false;
char[_local1].mtarget = 0;
}
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].active) {
if (char[_local1].team != char[_local2].team) {
if (getDist(game["unit" + _local1]._x, game["unit" + _local1]._y, game["unit" + _local2]._x, game["unit" + _local2]._y) < 30) {
char[_local1].mtarget = _local2;
break;
}
}
}
_local2++;
}
unitmelee(_local1);
} else if (((char[_local1].shooting > 0) and ((heronumber != _local1) or (!heroflee))) and ((heroAINumber != _local1) or (!heroAIFlee))) {
shoot(_local1, char[_local1].rtarget);
} else {
var _local11 = 1;
if (((game["unit" + _local1]._x > 1730) and (game["unit" + _local1]._x < 1840)) and ((currentMap == 1) or (currentMap == 11))) {
_local11 = 0.5;
if (!char[_local1].inwater) {
game["unit" + _local1].splashsound = new Sound(game["unit" + _local1]);
game["unit" + _local1].splashsound.attachSound("splash_dive_05");
game["unit" + _local1].splashsound.setVolume(volumeControl(game["unit" + _local1]._x) * 0.7);
game["unit" + _local1].splashsound.setPan(surroundSound(game["unit" + _local1]._x));
game["unit" + _local1].splashsound.start();
}
char[_local1].inwater = true;
} else {
char[_local1].inwater = false;
}
if (game["unit" + _local1]._y >= (char[_local1].mcy - 10)) {
game["unit" + _local1]._y = char[_local1].mcy - 10;
char[_local1].yspeed = 0;
char[_local1].hit = true;
} else {
char[_local1].yspeed = char[_local1].yspeed + (grav - Math.abs(char[_local1].momentum / 2));
game["unit" + _local1]._y = game["unit" + _local1]._y + char[_local1].yspeed;
if (char[_local1].momentum < 0) {
char[_local1].momentum = char[_local1].momentum + 0.2;
} else if (char[_local1].momentum > 0) {
char[_local1].momentum = char[_local1].momentum - 0.2;
}
if (game["unit" + _local1]._y <= (char[_local1].mcy - 30)) {
}
}
char[_local1].mcy = groundmaker(game["unit" + _local1]._x);
if (char[_local1].unit == "dragon") {
char[_local1].mcy = char[_local1].altitude;
}
char[_local1].distx = game["unit" + _local1]._x - char[_local1].oldx;
char[_local1].disty = game["unit" + _local1]._y - char[_local1].oldy;
char[_local1].hyp = Math.sqrt((char[_local1].distx * char[_local1].distx) + (char[_local1].disty * char[_local1].disty));
radian = Math.asin(char[_local1].disty / char[_local1].hyp);
angle = (char[_local1].radian * 180) / Math.PI;
char[_local1].oldx = game["unit" + _local1]._x;
char[_local1].oldy = game["unit" + _local1]._y;
var _local8 = char[_local1].team;
var _local4 = 3 - _local8;
var _local3 = true;
if (((heronumber != _local1) or (!heroflee)) and ((heroAINumber != _local1) or (!heroAIFlee))) {
var _local9 = char[_local1].range;
var _local6 = 0;
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
var _local5 = 0;
if (char[_local2].active) {
if (_local8 != char[_local2].team) {
if (char[_local1].ranged) {
if (char[_local2].unit == "dragon") {
_local5 = 200;
if ((currentMap == 6) or (currentMap == 12)) {
if ((game.fronttrees.t1._x + 1150) > game["unit" + _local1]._x) {
if ((game.fronttrees.t1._x - 10) < game["unit" + _local1]._x) {
if (char[_local1].unit != "dragon") {
_local5 = -900;
}
}
}
}
} else if (char[_local1].unit == "dragon") {
if ((currentMap == 6) or (currentMap == 12)) {
if ((game.fronttrees.t1._x + 1150) > game["unit" + _local2]._x) {
if ((game.fronttrees.t1._x - 10) < game["unit" + _local2]._x) {
_local5 = -900;
}
}
}
}
var _local7 = getDist(game["unit" + _local1]._x, game["unit" + _local1]._y, game["unit" + _local2]._x, game["unit" + _local2]._y);
if (_local7 < (_local9 + _local5)) {
if (char[_local1].unit == "catapult") {
_local3 = false;
game["unit" + _local1].gotoAndStop(51);
break;
}
if (char[_local2].unit == "dragon") {
shoot(_local1, _local2);
char[_local1].rtarget = _local2;
_local3 = false;
if (char[_local1].unit != "dragon") {
game["unit" + _local1].gotoAndPlay(51);
}
_local6 = _local2;
break;
}
_local9 = _local7;
_local6 = _local2;
}
} else if (getDist(game["unit" + _local1]._x, game["unit" + _local1]._y, game["unit" + _local2]._x, game["unit" + _local2]._y) < 30) {
char[_local1].melee = true;
game["unit" + _local1].gotoAndStop(51);
char[_local1].mtarget = _local2;
char[_local1].mcount = 28;
break;
}
} else if (!char[_local1].ranged) {
if (char[_local1].xspeed > 0) {
if ((((((!char[_local2].ranged) and ((Math.abs(char[_local1].xspeed) <= Math.abs(char[_local2].xspeed)) or (char[_local2].melee or char[_local2].queued))) and (_local2 != heronumber)) and (_local2 != heroAINumber)) and (_local1 != heronumber)) and (_local1 != heroAINumber)) {
if ((game["unit" + _local2]._x > game["unit" + _local1]._x) and (game["unit" + _local1]._x > 220)) {
if (game["unit" + _local2]._x < (game["unit" + _local1]._x + 30)) {
_local3 = false;
char[_local1].queued = true;
if (char[_local2].melee) {
char[_local1].second = true;
} else {
char[_local1].second = false;
}
if (char[_local2].melee and (!char[_local2].queued)) {
char[_local1].melee = true;
char[_local1].mtarget = char[_local2].mtarget;
}
break;
}
}
}
} else if ((((((!char[_local2].ranged) and ((Math.abs(char[_local1].xspeed) <= Math.abs(char[_local2].xspeed)) or (char[_local2].melee or char[_local2].queued))) and (_local2 != heronumber)) and (_local2 != heroAINumber)) and (_local1 != heronumber)) and (_local1 != heroAINumber)) {
if ((game["unit" + _local2]._x < game["unit" + _local1]._x) and (game["unit" + _local1]._x < 3330)) {
if (game["unit" + _local2]._x > (game["unit" + _local1]._x - 30)) {
_local3 = false;
char[_local1].queued = true;
if (char[_local2].melee) {
char[_local1].second = true;
} else {
char[_local1].second = false;
}
if (char[_local2].melee and (!char[_local2].queued)) {
char[_local1].melee = true;
char[_local1].mtarget = char[_local2].mtarget;
}
break;
}
}
}
}
}
_local2++;
}
if (_local6 > 0) {
trace("closetarget = " + _local6);
shoot(_local1, _local6);
char[_local1].rtarget = _local6;
_local3 = false;
if (char[_local1].unit != "dragon") {
game["unit" + _local1].gotoAndPlay(51);
}
} else {
char[_local1].rtarget = 0;
char[_local1].shooting = 0;
}
}
if (char[_local1].ranged) {
if (((heronumber != _local1) or (!heroflee)) and ((heroAINumber != _local1) or (!heroAIFlee))) {
if ((char[_local1].rtarget == 0) or (char[_local1].rtarget > 999)) {
if (char[_local1].unit == "catapult") {
if (getDist(game["unit" + _local1]._x, game["unit" + _local1]._y, game["tower" + _local4]._x, game["tower" + _local4]._y) < 900) {
shoot(_local1, 1000 * _local4);
char[_local1].rtarget = 1000 * _local4;
_local3 = false;
game["unit" + _local1].gotoAndPlay(51);
}
} else if (getDist(game["unit" + _local1]._x, game["unit" + _local1]._y, game["tower" + _local4]._x, game["tower" + _local4]._y) < (char[_local1].range - 30)) {
shoot(_local1, 1000 * _local4);
char[_local1].rtarget = 1000 * _local4;
_local3 = false;
if (char[_local1].unit != "dragon") {
game["unit" + _local1].gotoAndPlay(51);
}
}
}
}
} else if (((heronumber != _local1) or (!heroflee)) and ((heroAINumber != _local1) or (!heroAIFlee))) {
if (getDist(game["unit" + _local1]._x, game["unit" + _local1]._y, game["tower" + _local4]._x, game["tower" + _local4]._y) < 100) {
char[_local1].melee = true;
game["unit" + _local1].gotoAndStop(51);
char[_local1].mtarget = 100 + _local4;
char[_local1].mcount = 28;
_local3 = false;
}
}
if (heroflee) {
if (heronumber == _local1) {
if (Math.abs(game["unit" + _local1]._x - game["tower" + char[_local1].team]._x) < 20) {
heronumber = 0;
heroflee = false;
game["unit" + _local1].removeMovieClip();
char[_local1].active = false;
rivival = 1000;
game["healthbar" + _local1].removeMovieClip();
playerpop--;
}
}
}
if (heroAIFlee) {
if (heroAINumber == _local1) {
if (Math.abs(game["unit" + _local1]._x - game["tower" + char[_local1].team]._x) < 20) {
heroAINumber = 0;
game["unit" + _local1].removeMovieClip();
game["healthbar" + _local1].removeMovieClip();
char[_local1].active = false;
heroAIRestore = 0;
heroAIOut = false;
heroAIFlee = false;
}
}
}
if (_local3) {
game["unit" + _local1]._x = game["unit" + _local1]._x + (char[_local1].xspeed * _local11);
if (char[_local1].queued) {
game["unit" + _local1].gotoAndPlay(1);
char[_local1].queued = false;
}
if (char[_local1].unit == "catapult") {
game["unit" + _local1]._rotation = getAngle(game["unit" + _local1]._x - 35, groundmaker(game["unit" + _local1]._x - 35), game["unit" + _local1]._x + 40, groundmaker(game["unit" + _local1]._x + 40));
}
if (game["unit" + _local1]._currentframe > 50) {
game["unit" + _local1].gotoAndPlay(1);
}
} else if (((char[_local1].unit == "lionrider") or (char[_local1].unit == "elitelionrider")) and (!char[_local1].melee)) {
var _local10 = false;
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
var _local5 = 0;
if (char[_local2].active) {
if (_local8 != char[_local2].team) {
if (char[_local2].unit == "dragon") {
_local5 = 200;
if ((currentMap == 6) or (currentMap == 12)) {
if ((game.fronttrees.t1._x + 1150) > game["unit" + _local1]._x) {
if ((game.fronttrees.t1._x - 10) < game["unit" + _local1]._x) {
if (char[_local1].unit != "dragon") {
_local5 = -900;
}
}
}
}
} else if (char[_local1].unit == "dragon") {
if ((currentMap == 6) or (currentMap == 12)) {
if ((game.fronttrees.t1._x + 1150) > game["unit" + _local2]._x) {
if ((game.fronttrees.t1._x - 10) < game["unit" + _local2]._x) {
_local5 = -900;
}
}
}
}
if (getDist(game["unit" + _local1]._x, game["unit" + _local1]._y, game["unit" + _local2]._x, game["unit" + _local2]._y) < (char[_local1].range + _local5)) {
shoot(_local1, _local2);
char[_local1].rtarget = _local2;
_local3 = false;
game["unit" + _local1].gotoAndPlay(151);
_local10 = true;
break;
}
}
}
_local2++;
}
if (!_local10) {
game["unit" + _local1].gotoAndStop(100);
}
} else if (!char[_local1].ranged) {
game["unit" + _local1].gotoAndStop(100);
}
}
} else if (char[_local1].active) {
char[_local1].stuncount--;
} else {
if ((game["unit" + _local1]._currentframe < 100) and (char[_local1].unit != "shadowdemon")) {
game["unit" + _local1].gotoAndPlay(101);
}
if (game["unit" + _local1]._alpha > 0) {
game["unit" + _local1]._alpha--;
if (game["unit" + _local1]._alpha == 85) {
game["unit" + _local1].thumpsound = new Sound(game["unit" + _local1]);
game["unit" + _local1].thumpsound.attachSound("body_fall_floor");
game["unit" + _local1].thumpsound.setVolume(volumeControl(game["unit" + _local1]._x));
game["unit" + _local1].thumpsound.setPan(surroundSound(game["unit" + _local1]._x));
game["unit" + _local1].thumpsound.start();
}
if (game["unit" + _local1]._alpha == 0) {
if (char[_local1].team == 1) {
playerpop--;
}
}
} else {
game["unit" + _local1].removeMovieClip();
}
}
game["healthbar" + _local1]._x = game["unit" + _local1]._x;
game["healthbar" + _local1]._y = game["unit" + _local1]._y + 20;
_local1++;
}
}
function hotKeys() {
if (Key.isDown(49)) {
hotkeycount++;
if (hotkeycount < 2) {
_root.addtocue(1, "slave");
}
} else if (Key.isDown(50)) {
hotkeycount++;
if (hotkeycount < 2) {
_root.addtocue(1, "archer");
}
} else if (Key.isDown(51)) {
hotkeycount++;
if (hotkeycount < 2) {
_root.addtocue(1, "soldier");
}
} else if (Key.isDown(52)) {
hotkeycount++;
if (hotkeycount < 2) {
if (_root.experience < _root.assasinexp) {
} else {
_root.addtocue(1, "assasin");
}
}
} else if (Key.isDown(53)) {
hotkeycount++;
if (hotkeycount < 2) {
if (_root.experience < _root.wizardexp) {
} else {
_root.addtocue(1, "wizard");
}
}
} else if (Key.isDown(54)) {
hotkeycount++;
if (hotkeycount < 2) {
if (_root.experience < _root.wargriderexp) {
} else {
_root.addtocue(1, "wargrider");
}
}
} else if (Key.isDown(81)) {
hotkeycount++;
if (hotkeycount < 2) {
if (_root.experience < _root.spiderriderexp) {
} else {
_root.addtocue(1, "spiderrider");
}
}
} else if (Key.isDown(87)) {
hotkeycount++;
if (hotkeycount < 2) {
if (_global.lionrider > 0) {
if (_root.experience < _root.elitelionriderexp) {
if (_root.experience < _root.lionriderexp) {
} else {
_root.addtocue(1, "lionrider");
}
} else {
_root.addtocue(1, "elitelionrider");
}
}
}
} else if (Key.isDown(69)) {
hotkeycount++;
if (hotkeycount < 2) {
if (_root.experience < _root.drakeexp) {
} else {
_root.addtocue(1, "drake");
}
}
} else if (Key.isDown(82)) {
hotkeycount++;
if (hotkeycount < 2) {
if (_global.golem > 0) {
if (_root.experience < _root.golemexp) {
} else {
_root.addtocue(1, "golem");
}
}
}
} else if (Key.isDown(84)) {
hotkeycount++;
if (hotkeycount < 2) {
if (_global.troll > 0) {
if (_root.experience < _root.battletrollexp) {
} else {
_root.addtocue(1, "battletroll");
}
}
}
} else if (Key.isDown(89)) {
hotkeycount++;
if (hotkeycount < 2) {
if (_global.dragonrider > 0) {
if (_root.experience < _root.dragonexp) {
} else {
_root.addtocue(1, "dragon");
}
}
}
} else {
hotkeycount = 0;
}
}
function scrolling() {
visicount++;
if (visicount > 4) {
visicount = 0;
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].active) {
if (game["unit" + _local2]._x > (Math.abs(game._x) - 100)) {
if (game["unit" + _local2]._x < (Math.abs(game._x) + 800)) {
game["unit" + _local2]._visible = true;
} else {
game["unit" + _local2]._visible = false;
}
} else {
game["unit" + _local2]._visible = false;
}
}
if (game._x > -800) {
game.tower1._visible = true;
game.tower1cover._visible = true;
} else {
game.tower1._visible = false;
game.tower1cover._visible = false;
}
if (game._x < -2390) {
game.tower2._visible = true;
game.tower2cover._visible = true;
} else {
game.tower2._visible = false;
game.tower2cover._visible = false;
}
_local2++;
}
}
if (gamecount > 2) {
if ((Key.isDown(39) or Key.isDown(68)) or (((_global.mousescroll == 1) and (_xmouse > 650)) and (_ymouse < 400))) {
if (game._x > -2790) {
game._x = game._x - 25;
game.mountains1._x = game.mountains1._x + 12;
game.mountains2._x = game.mountains2._x + 22;
game.sun._x = game.sun._x + 25;
}
} else if (Key.isDown(37) or Key.isDown(65)) {
if (game._x < -30) {
game._x = game._x + 25;
game.mountains1._x = game.mountains1._x - 12;
game.mountains2._x = game.mountains2._x - 22;
game.sun._x = game.sun._x - 25;
}
} else if ((((_global.mousescroll == 1) and (_xmouse < 105)) and (_xmouse > 44)) and (_ymouse < 360)) {
scrollback++;
if (scrollback > 10) {
if (game._x < -30) {
game._x = game._x + 25;
game.mountains1._x = game.mountains1._x - 12;
game.mountains2._x = game.mountains2._x - 22;
game.sun._x = game.sun._x - 25;
}
}
} else {
scrollback = 0;
}
if (Key.isDown(38)) {
}
game.dark._x = -game._x;
}
}
function getDist(px1, py1, px2, py2) {
x = px2 - px1;
y = py2 - py1;
hyp = Math.sqrt((x * x) + (y * y));
return(hyp);
}
function getAngle(px1, py1, px2, py2) {
x = px2 - px1;
y = py2 - py1;
hyp = Math.sqrt((x * x) + (y * y));
cos = x / hyp;
rad = Math.acos(cos);
deg = 180 / (Math.PI / rad);
if (y < 0) {
deg = -deg;
} else if ((y == 0) && (x < 0)) {
deg = 180;
}
return(deg);
}
function unitmelee(i) {
char[i].mcount++;
extradrop(i);
var _local4 = char[i].mtarget;
if (((((heronumber != _local4) or (!heroflee)) and ((heroAINumber != _local4) or (!heroAIFlee))) or (getDist(game["unit" + i]._x, game["unit" + i]._y, game["unit" + _local4]._x, game["unit" + _local4]._y) < 50)) and (_local4 != 0)) {
if ((char[_local4].hpCurrent < 1) or (Math.abs(game["unit" + i]._x - game["unit" + _local4]._x) > 100)) {
char[i].mcount = 0;
game["unit" + i].gotoAndPlay(1);
char[i].queued = false;
char[i].mtarget = 0;
char[i].melee = false;
} else {
if ((char[i].mcount > 30) or (((i == heronumber) and (bladefurrycount > 0)) and (char[i].mcount > 10))) {
char[i].mcount = 0;
game["unit" + i].gotoAndPlay(51);
trace("sound Volume = " + Math.max(100 - (Math.abs((game["unit" + i]._x + game._x) - 300) / 10), 0));
if ((i == heronumber) or (i == heroAINumber)) {
var _local7 = Math.round((Math.random() * 2.49) + 1);
game["unit" + i]["attacksound" + _local7].setVolume(volumeControl(game["unit" + i]._x));
game["unit" + i]["attacksound" + _local7].setPan(surroundSound(game["unit" + i]._x));
game["unit" + i]["attacksound" + _local7].start();
} else {
game["unit" + i].attacksound.setVolume(volumeControl(game["unit" + i]._x));
game["unit" + i].attacksound.setPan(surroundSound(game["unit" + i]._x));
game["unit" + i].attacksound.start();
}
} else if ((((bloodluster > 0) or (morpher > 0)) and (i == heronumber)) and (char[i].mcount > 18)) {
char[i].mcount = 0;
game["unit" + i].gotoAndPlay(51);
var _local7 = Math.round((Math.random() * 2.49) + 1);
game["unit" + i]["attacksound" + _local7].setVolume(volumeControl(game["unit" + i]._x));
game["unit" + i]["attacksound" + _local7].setPan(surroundSound(game["unit" + i]._x));
game["unit" + i]["attacksound" + _local7].start();
} else if ((((AIbloodluster > 0) or (AImorpher > 0)) and (i == heroAINumber)) and (char[i].mcount > 18)) {
char[i].mcount = 0;
game["unit" + i].gotoAndPlay(51);
var _local7 = Math.round((Math.random() * 2.49) + 1);
game["unit" + i]["attacksound" + _local7].setVolume(volumeControl(game["unit" + i]._x));
game["unit" + i]["attacksound" + _local7].setPan(surroundSound(game["unit" + i]._x));
game["unit" + i]["attacksound" + _local7].start();
} else if (char[i].mcount == 6) {
if (_local4 > 100) {
var _local6 = 0;
if (char[i].team == 1) {
_local6 = 2;
} else {
_local6 = 1;
}
_root[("tower" + _local6) + "hp"] = _root[("tower" + _local6) + "hp"] - int((char[i].damagelvl / 2) + ((char[i].damagelvl / 2) * Math.random()));
if (_local6 == 2) {
AIAutoDefense = 1500;
}
deathcheck(i, _local4);
} else {
game.attachMovie("bloodspatter", "explosion" + i, 1390 + i);
game["explosion" + i]._x = game["unit" + _local4]._x;
game["explosion" + i]._y = game["unit" + _local4]._y - 10;
var _local5 = int(((char[i].damagelvl / 2) + ((char[i].damagelvl / 2) * Math.random())) - char[_local4].armorlvl);
if ((game["unit" + i]._y + 8) < game["unit" + _local4]._y) {
_local5 = Math.round(_local5 * 1.2);
}
var _local9 = false;
var _local8 = false;
if ((char[i].unit == "assasin") and (char[i].team == 1)) {
if (_global.backstab > 0) {
if ((Math.random() * 100) < (20 * _global.backstab)) {
_local5 = _local5 + 100;
trace("backstab loaded");
_local9 = true;
}
}
} else if (i == heronumber) {
if (knocking) {
char[_local4].knockcount = 400;
char[_local4].knockx = 7 + (Math.random() * 10);
char[_local4].knocky = 7 + (Math.random() * 14);
com.darronschall.DynamicRegistration.initialize(game["unit" + _local4]);
game["unit" + _local4].setRegistration(30, 20);
game["unit" + _local4].gotoAndPlay(101);
}
if ((Math.random() * 100) < ((_global.herocritical * 5) + 1)) {
_local8 = true;
_local5 = _local5 * 2;
}
char[heronumber].hpCurrent = char[heronumber].hpCurrent + int(_local5 * ((_global.herovampire * 3) / 100));
if (char[heronumber].hpCurrent > char[heronumber].hpMax) {
char[heronumber].hpCurrent = char[heronumber].hpMax;
}
} else if ((bloodlusttimer > 0) and (char[i].team == 1)) {
_local5 = _local5 * 1.3;
}
if (i == heroAINumber) {
if (AIknocking > 0) {
char[_local4].knockcount = 400;
char[_local4].knockx = 8 + (Math.random() * 15);
char[_local4].knocky = 8 + (Math.random() * 20);
com.darronschall.DynamicRegistration.initialize(game["unit" + _local4]);
game["unit" + _local4].setRegistration(20, 15);
game["unit" + _local4].gotoAndPlay(101);
}
}
if (_local4 == heronumber) {
if (shielder > 0) {
_local5 = 0;
}
}
if (_local4 == heroAINumber) {
if (AIshielder > 0) {
_local5 = 0;
}
}
char[_local4].hpCurrent = char[_local4].hpCurrent - _local5;
game["unit" + _local4].bloodsound = new Sound(game["unit" + _local4]);
if ((Math.random() * 10) > 9) {
game["unit" + _local4].bloodsound.attachSound("blood_splat_03");
} else if ((Math.random() * 10) > 9) {
game["unit" + _local4].bloodsound.attachSound("blood_splat_04");
}
game["unit" + _local4].bloodsound.setVolume(0.5 * volumeControl(game["unit" + _local4]._x));
game["unit" + _local4].bloodsound.setPan(surroundSound(game["unit" + _local4]._x));
game["unit" + _local4].bloodsound.start();
game.attachMovie("dmgup", "dmgup" + _local4, 1700 + _local4);
game["dmgup" + _local4]._x = game["unit" + _local4]._x;
game["dmgup" + _local4]._y = game["unit" + _local4]._y - 30;
game["dmgup" + _local4].goldup = _local5;
if (_local9) {
game["dmgup" + _local4].goldup = "Backstab " + _local5;
trace("BACKSTABBING!!!!!!!!!!!!!");
} else if (_local8) {
game["dmgup" + _local4].goldup = "Critical " + _local5;
}
deathcheck(i, _local4);
}
}
if (_local4 > 100) {
} else if (char[_local4].hpCurrent < 1) {
char[i].mcount = 0;
char[i].melee = false;
game["unit" + i].gotoAndPlay(1);
}
if (char[i].queued) {
if (getDist(game["unit" + i]._x, game["unit" + i]._y, game["unit" + _local4]._x, game["unit" + _local4]._y) < 30) {
char[i].queued = false;
}
}
}
} else {
char[i].mcount = 0;
game["unit" + i].gotoAndPlay(1);
char[i].queued = false;
char[i].mtarget = 0;
char[i].melee = false;
}
}
function movebullets() {
hittime++;
if (hittime > 3) {
hittime = 1;
}
var _local3 = 1;
while (_local3 < (maxbullet + 1)) {
if (bullet[_local3].active) {
var _local5 = bullet[_local3].owner;
var _local7 = char[_local5].unit;
if (game["bullet" + _local3]._y >= (bullet[_local3].mcy + 10)) {
if (_local7 == "archer") {
bullet[_local3].active = false;
bullet[_local3].yspeed = 0;
bullet[_local3].xspeed = 0;
} else if ((_local7 == "wizard") or (_local7 == "dragon")) {
game.attachMovie("explosion1", "explosion" + _local3, 1300 + _local3);
game["explosion" + _local3]._x = game["bullet" + _local3]._x + bullet[_local3].xspeed;
game["explosion" + _local3]._y = game["bullet" + _local3]._y;
game["bullet" + _local3].removeMovieClip();
bullet[_local3].active = false;
} else if (_local7 == "spiderrider") {
game.attachMovie("explosion3", "explosion" + _local3, 1300 + _local3);
game["explosion" + _local3]._x = game["bullet" + _local3]._x + bullet[_local3].xspeed;
game["explosion" + _local3]._y = game["bullet" + _local3]._y;
game["bullet" + _local3].removeMovieClip();
bullet[_local3].active = false;
} else if ((_local5 > 99) or (_local7 == "catapult")) {
game.attachMovie("groundspatter", "explosion" + _local3, 1300 + _local3);
game["explosion" + _local3]._x = game["bullet" + _local3]._x;
game["explosion" + _local3]._y = game["bullet" + _local3]._y;
game["explosion" + _local3].bulletsound = new Sound(game["explosion" + _local3]);
game["explosion" + _local3].bulletsound.attachSound(bullet[_local3].sound);
game["explosion" + _local3].bulletsound.setVolume(volumeControl(game["bullet" + _local3]._x));
game["explosion" + _local3].bulletsound.setPan(surroundSound(game["bullet" + _local3]._x));
game["explosion" + _local3].bulletsound.start();
game["bullet" + _local3].removeMovieClip();
bullet[_local3].active = false;
} else if (game["bullet" + _local3]._y >= (bullet[_local3].mcy + 5)) {
trace("hit ground2");
game.attachMovie("explosion1", "explosion" + _local3, 1300 + _local3);
game["explosion" + _local3]._x = game["bullet" + _local3]._x + bullet[_local3].xspeed;
game["explosion" + _local3]._y = game["bullet" + _local3]._y;
game["bullet" + _local3].removeMovieClip();
bullet[_local3].active = false;
}
} else {
if (_local5 > 999) {
bullet[_local3].yspeed = bullet[_local3].yspeed + ((grav * 4) - (Math.abs(bullet[_local3].momentum) / 2));
} else {
bullet[_local3].yspeed = bullet[_local3].yspeed + ((grav * 2.75) - Math.abs(bullet[_local3].momentum / 2));
}
game["bullet" + _local3]._y = game["bullet" + _local3]._y + bullet[_local3].yspeed;
if (bullet[_local3].momentum < 0) {
bullet[_local3].momentum = bullet[_local3].momentum + 1;
} else if (bullet[_local3].momentum > 0) {
bullet[_local3].momentum = bullet[_local3].momentum - 1;
}
}
bullet[_local3].mcy = groundmaker(game["bullet" + _local3]._x);
bullet[_local3].distx = game["bullet" + _local3]._x - bullet[_local3].oldx;
bullet[_local3].disty = game["bullet" + _local3]._y - bullet[_local3].oldy;
bullet[_local3].hyp = Math.sqrt((bullet[_local3].distx * bullet[_local3].distx) + (char[_local3].disty * bullet[_local3].disty));
bullet[_local3].oldx = game["bullet" + _local3]._x;
bullet[_local3].oldy = game["bullet" + _local3]._y;
game["bullet" + _local3]._x = game["bullet" + _local3]._x + bullet[_local3].xspeed;
if (bullet[_local3].active) {
if (hittime == 1) {
if (char[char[_local5].rtarget].active) {
var _local4 = char[_local5].rtarget;
if ((game["unit" + _local4]._x + 80) > game["bullet" + _local3]._x) {
if ((game["unit" + _local4]._x - 80) < game["bullet" + _local3]._x) {
if (game["bullet" + _local3].hb.hitTest(game["unit" + _local4].hb)) {
if (_local7 == "archer") {
game.attachMovie("bloodspatter", "explosion" + _local3, 1300 + _local3);
} else if (_local5 > 99) {
game.attachMovie("groundspatter", "explosion" + _local3, 1300 + _local3);
} else if (_local7 == "spiderrider") {
game.attachMovie("explosion3", "explosion" + _local3, 1300 + _local3);
char[_local4].poisoncount = 600;
myPColor = new Color(game["unit" + _local4]);
myPColorTransform = new Object();
myPColorTransform = {rb:0, gb:150, bb:0};
myPColor.setTransform(myPColorTransform);
} else {
game.attachMovie("explosion1", "explosion" + _local3, 1300 + _local3);
}
game["explosion" + _local3].bulletsound = new Sound(game["explosion" + _local3]);
game["explosion" + _local3].bulletsound.attachSound(bullet[_local3].sound);
game["explosion" + _local3].bulletsound.setVolume(volumeControl(game["bullet" + _local3]._x));
game["explosion" + _local3].bulletsound.setPan(surroundSound(game["bullet" + _local3]._x));
game["explosion" + _local3].bulletsound.start();
game["explosion" + _local3]._x = game["bullet" + _local3]._x + bullet[_local3].xspeed;
game["explosion" + _local3]._y = game["bullet" + _local3]._y;
game["bullet" + _local3].removeMovieClip();
bullet[_local3].active = false;
var _local6 = int(((char[_local5].damagelvl / 2) + ((char[_local5].damagelvl / 2) * Math.random())) - char[_local4].armorlvl);
if (_local5 == 1000) {
_local6 = int((((char[_local5].damagelvl / 2) + ((char[_local5].damagelvl / 2) * Math.random())) - char[_local4].armorlvl) * (1 + (0.25 * turretSize)));
}
if (_local5 == 1001) {
_local6 = 250;
}
if (_local5 == 2000) {
_local6 = int((((char[_local5].damagelvl / 2) + ((char[_local5].damagelvl / 2) * Math.random())) - char[_local4].armorlvl) * (1 + (0.25 * AIturretSize)));
}
if (_local5 == 2001) {
_local6 = 250;
}
var _local8 = false;
if (_local5 == heronumber) {
if (knocking) {
char[_local4].knockcount = 400;
char[_local4].knockx = 7 + (Math.random() * 10);
char[_local4].knocky = 7 + (Math.random() * 14);
com.darronschall.DynamicRegistration.initialize(game["unit" + _local4]);
game["unit" + _local4].setRegistration(30, 20);
game["unit" + _local4].gotoAndPlay(101);
}
if ((Math.random() * 100) < ((_global.herocritical * 5) + 1)) {
_local8 = true;
_local6 = _local6 * 2;
}
char[heronumber].hpCurrent = char[heronumber].hpCurrent + int(_local6 * ((_global.herovampire * 3) / 100));
if (char[heronumber].hpCurrent > char[heronumber].hpMax) {
char[heronumber].hpCurrent = char[heronumber].hpMax;
}
} else if ((bloodlusttimer > 0) and (char[_local5].team == 1)) {
_local6 = _local6 * 1.3;
}
if (_local4 == heronumber) {
if (shielder > 0) {
_local6 = 0;
}
}
if (_local4 == heroAINumber) {
if (AIshielder > 0) {
_local6 = 0;
}
}
char[_local4].hpCurrent = char[_local4].hpCurrent - _local6;
game.attachMovie("dmgup", "dmgup" + _local4, 1700 + _local4);
game["dmgup" + _local4]._x = game["unit" + _local4]._x;
game["dmgup" + _local4]._y = game["unit" + _local4]._y - 30;
game["dmgup" + _local4].goldup = _local6;
if (_local8) {
game["dmgup" + _local4].goldup = "Critical " + _local6;
}
deathcheck(_local3, _local4);
}
}
}
} else {
var _local4 = 1;
while (_local4 < (maxmen + 1)) {
if (char[_local4].active) {
if (char[_local5].team != char[_local4].team) {
if ((game["unit" + _local4]._x + 80) > game["bullet" + _local3]._x) {
if ((game["unit" + _local4]._x - 80) < game["bullet" + _local3]._x) {
if (game["bullet" + _local3].hb.hitTest(game["unit" + _local4].hb)) {
if (_local7 == "archer") {
game.attachMovie("bloodspatter", "explosion" + _local3, 1300 + _local3);
} else if (_local5 > 99) {
game.attachMovie("groundspatter", "explosion" + _local3, 1300 + _local3);
} else if (_local7 == "spiderrider") {
game.attachMovie("explosion3", "explosion" + _local3, 1300 + _local3);
char[_local4].poisoncount = 600;
myPColor = new Color(game["unit" + _local4]);
myPColorTransform = new Object();
myPColorTransform = {rb:0, gb:150, bb:0};
myPColor.setTransform(myPColorTransform);
} else {
game.attachMovie("explosion1", "explosion" + _local3, 1300 + _local3);
}
game["explosion" + _local3].bulletsound = new Sound(game["explosion" + _local3]);
game["explosion" + _local3].bulletsound.attachSound(bullet[_local3].sound);
game["explosion" + _local3].bulletsound.setVolume(volumeControl(game["bullet" + _local3]._x));
game["explosion" + _local3].bulletsound.setPan(surroundSound(game["bullet" + _local3]._x));
game["explosion" + _local3].bulletsound.start();
game["explosion" + _local3]._x = game["bullet" + _local3]._x + bullet[_local3].xspeed;
game["explosion" + _local3]._y = game["bullet" + _local3]._y;
game["bullet" + _local3].removeMovieClip();
bullet[_local3].active = false;
var _local6 = int(((char[_local5].damagelvl / 2) + ((char[_local5].damagelvl / 2) * Math.random())) - char[_local4].armorlvl);
if (_local5 == 1000) {
_local6 = int((((char[_local5].damagelvl / 2) + ((char[_local5].damagelvl / 2) * Math.random())) - char[_local4].armorlvl) * (1 + (0.25 * turretSize)));
}
if (_local5 == 1001) {
_local6 = 250;
}
if (_local5 == 2000) {
_local6 = int((((char[_local5].damagelvl / 2) + ((char[_local5].damagelvl / 2) * Math.random())) - char[_local4].armorlvl) * (1 + (0.25 * AIturretSize)));
}
if (_local5 == 2001) {
_local6 = 250;
}
var _local8 = false;
if (_local5 == heronumber) {
if (knocking) {
char[_local4].knockcount = 400;
char[_local4].knockx = 7 + (Math.random() * 10);
char[_local4].knocky = 7 + (Math.random() * 14);
com.darronschall.DynamicRegistration.initialize(game["unit" + _local4]);
game["unit" + _local4].setRegistration(30, 20);
game["unit" + _local4].gotoAndPlay(101);
}
if ((Math.random() * 100) < ((_global.herocritical * 5) + 1)) {
_local8 = true;
_local6 = _local6 * 2;
}
char[heronumber].hpCurrent = char[heronumber].hpCurrent + int(_local6 * ((_global.herovampire * 3) / 100));
if (char[heronumber].hpCurrent > char[heronumber].hpMax) {
char[heronumber].hpCurrent = char[heronumber].hpMax;
}
} else if ((bloodlusttimer > 0) and (char[_local5].team == 1)) {
_local6 = _local6 * 1.3;
}
if (_local4 == heronumber) {
if (shielder > 0) {
_local6 = 0;
}
}
if (_local4 == heroAINumber) {
if (AIshielder > 0) {
_local6 = 0;
}
}
char[_local4].hpCurrent = char[_local4].hpCurrent - _local6;
game.attachMovie("dmgup", "dmgup" + _local4, 1700 + _local4);
game["dmgup" + _local4]._x = game["unit" + _local4]._x;
game["dmgup" + _local4]._y = game["unit" + _local4]._y - 30;
game["dmgup" + _local4].goldup = _local6;
if (_local8) {
game["dmgup" + _local4].goldup = "Critical " + _local6;
}
deathcheck(_local3, _local4);
}
}
}
}
}
_local4++;
}
}
var _local9 = 0;
if (char[_local5].team == 1) {
_local9 = 2;
} else {
_local9 = 1;
}
if (char[_local5].team == 2) {
if (game["bullet" + _local3]._x < 200) {
if (_local7 == "catapult") {
game.attachMovie("groundspatter", "explosion" + _local3, 1300 + _local3);
} else {
game.attachMovie("explosion1", "explosion" + _local3, 1300 + _local3);
}
game["explosion" + _local3]._x = game["bullet" + _local3]._x + (bullet[_local3].xspeed * 2);
game["explosion" + _local3]._y = game["bullet" + _local3]._y;
game["bullet" + _local3].removeMovieClip();
bullet[_local3].active = false;
_root[("tower" + _local9) + "hp"] = _root[("tower" + _local9) + "hp"] - int((char[_local5].damagelvl / 4) + ((char[_local5].damagelvl / 4) * Math.random()));
}
} else if (game["bullet" + _local3]._x > 3365) {
if (char[_local5].team == 1) {
if (_local7 == "catapult") {
game.attachMovie("groundspatter", "explosion" + _local3, 1300 + _local3);
} else {
game.attachMovie("explosion1", "explosion" + _local3, 1300 + _local3);
}
game["explosion" + _local3]._x = game["bullet" + _local3]._x + (bullet[_local3].xspeed * 2);
game["explosion" + _local3]._y = game["bullet" + _local3]._y;
game["bullet" + _local3].removeMovieClip();
bullet[_local3].active = false;
_root[("tower" + _local9) + "hp"] = _root[("tower" + _local9) + "hp"] - int((char[_local5].damagelvl / 4) + ((char[_local5].damagelvl / 4) * Math.random()));
AIAutoDefense = 1500;
}
}
}
}
if ((((((_local7 == "wizard") or (_local7 == "dragon")) or (_local7 == "babywing")) or ((_local5 == heronumber) and ((_global.chief != "chief6") and (_global.chief != "chief5")))) or ((_local5 == heroAINumber) and ((_global.AIchief != "chief6") and (_global.AIchief != "chief5")))) or (_local5 == 1001)) {
game.attachMovie("firewind", ("wind" + (_local3 * 10)) + bullet[_local3].wind, (50000 + (_local3 * 10)) + bullet[_local3].wind);
} else if (_local7 == "spiderrider") {
game.attachMovie("poisonwind", ("wind" + (_local3 * 10)) + bullet[_local3].wind, (50000 + (_local3 * 10)) + bullet[_local3].wind);
} else {
game.attachMovie("wind", ("wind" + (_local3 * 10)) + bullet[_local3].wind, (50000 + (_local3 * 10)) + bullet[_local3].wind);
}
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._x = game["bullet" + _local3]._x;
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._y = game["bullet" + _local3]._y;
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._xscale = 100;
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._yscale = 150;
if ((_local7 == "dragon") or (_local5 == 1001)) {
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._xscale = 300;
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._yscale = 400;
} else if (_local7 == "babywing") {
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._xscale = 200;
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._yscale = 200;
}
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._rotation = game["bullet" + _local3]._rotation;
if (game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._rotation == 0) {
game[("wind" + (_local3 * 10)) + bullet[_local3].wind]._alpha = 0;
}
var _local10 = bullet[_local3].wind - 1;
if (_local10 < 0) {
_local10 = windmax;
}
game["bullet" + _local3]._rotation = 270 + getAngle(game["bullet" + _local3]._x, game["bullet" + _local3]._y, game[("wind" + (_local3 * 10)) + _local10]._x, game[("wind" + (_local3 * 10)) + _local10]._y);
bullet[_local3].wind++;
if (bullet[_local3].wind > windmax) {
bullet[_local3].wind = 0;
}
}
_local3++;
}
}
function shoot(j, n) {
if (char[j].unit != "dragon") {
extradrop(j);
}
char[j].shooting++;
if (j > 999) {
if (char[j].shooting == 10) {
}
}
if ((((char[j].shooting == 15) or ((char[j].unit == "dragon") and (char[j].shooting == 10))) or (((j == heronumber) and (furyfirecount > 0)) and (char[j].shooting == 5))) or (((j == heroAINumber) and (AIfuryfirecount > 0)) and (char[j].shooting == 5))) {
nextbullet++;
if (nextbullet > maxbullet) {
nextbullet = 1;
}
if (((((char[j].unit == "archer") or (char[j].unit == "lionrider")) or (char[j].unit == "elitelionrider")) or ((j == heronumber) and (_global.chief == "chief6"))) or ((j == heroAINumber) and (_global.AIchief == "chief6"))) {
game.attachMovie("arrow", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x, _y:game["unit" + j]._y + 30});
bullet[nextbullet].sound = "arrowhit";
} else if (((j == heronumber) and (_global.chief == "chief5")) or ((j == heroAINumber) and (_global.AIchief == "chief5"))) {
game.attachMovie("spinningblade", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x, _y:game["unit" + j]._y + 30});
bullet[nextbullet].sound = "arrowhit";
} else if (j > 999) {
game.attachMovie("cannonball", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x, _y:game["unit" + j]._y + 30});
bullet[nextbullet].sound = "cinematic_hit_explosion";
} else if ((char[j].unit == "catapult") or (char[j].unit == "battletroll")) {
game.attachMovie("cannonball", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x, _y:game["unit" + j]._y - 100});
bullet[nextbullet].sound = "aexp2";
} else if (char[j].unit == "spiderrider") {
game.attachMovie("poisonball", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x, _y:game["unit" + j]._y + 30});
bullet[nextbullet].sound = "arrowhit";
} else if ((char[j].unit == "wizard") or (char[j].unit == "chief")) {
game.attachMovie("firebolt", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x, _y:game["unit" + j]._y + 30});
bullet[nextbullet].sound = "archmage_hit2";
} else if (char[j].unit == "dragon") {
if (char[j].team == 1) {
game.attachMovie("firebolt", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x + 60, _y:game["unit" + j]._y + 30});
} else {
game.attachMovie("firebolt", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x - 60, _y:game["unit" + j]._y + 30});
}
bullet[nextbullet].sound = "archmage_hit2";
} else if (char[j].unit == "babywing") {
game.attachMovie("firebolt", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x, _y:game["unit" + j]._y + 10});
bullet[nextbullet].sound = "archmage_hit2";
} else {
game.attachMovie("firebolt", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x, _y:game["unit" + j]._y + 30});
bullet[nextbullet].sound = "Fireball";
}
if (char[j].unit == "catapult") {
game["bullet" + nextbullet]._y = game["unit" + j]._y - 50;
bullet[nextbullet].mcy = game["unit" + j]._y - 50;
} else {
game["bullet" + nextbullet]._y = game["unit" + j]._y - 10;
bullet[nextbullet].mcy = game["unit" + j]._y - 10;
}
if (j > 999) {
if (j == 1000) {
game["bullet" + nextbullet]._y = 80;
bullet[nextbullet].mcy = 100;
game["bullet" + nextbullet]._x = game.tower1._x + 50;
game.attachMovie("explosion2", "explosion51", 31351);
game.explosion51._x = game.tower1._x + 70;
game.explosion51._y = 70;
game.explosion51._yscale = 120;
game.explosion51._xscale = 120;
} else {
game["bullet" + nextbullet]._y = 80;
bullet[nextbullet].mcy = 100;
game["bullet" + nextbullet]._x = game.tower2._x - 50;
game.attachMovie("explosion2", "explosion51", 31351);
game.explosion51._x = game.tower2._x - 70;
game.explosion51._y = 70;
game.explosion51._yscale = 120;
game.explosion51._xscale = 120;
}
}
if (char[j].unit == "wizard") {
if (char[j].team == 1) {
game["bullet" + nextbullet]._yscale = 50 + ((50 * fireballSpell) * 0.25);
game["bullet" + nextbullet]._xscale = 50 + ((50 * fireballSpell) * 0.25);
} else {
game["bullet" + nextbullet]._yscale = 50 + ((50 * AIfireballSpell) * 0.25);
game["bullet" + nextbullet]._xscale = 50 + ((50 * AIfireballSpell) * 0.25);
}
} else if (char[j].unit == "dragon") {
game["bullet" + nextbullet]._yscale = 200;
game["bullet" + nextbullet]._xscale = 200;
} else if (j == 1000) {
game["bullet" + nextbullet]._yscale = 50 + ((50 * turretSize) * 0.25);
game["bullet" + nextbullet]._xscale = 50 + ((50 * turretSize) * 0.25);
} else if (j == 2000) {
game["bullet" + nextbullet]._yscale = 50 + ((50 * AIturretSize) * 0.25);
game["bullet" + nextbullet]._xscale = 50 + ((50 * AIturretSize) * 0.25);
} else if (char[j].unit == "catapult") {
game["bullet" + nextbullet]._yscale = 100;
game["bullet" + nextbullet]._xscale = 100;
} else if (j == heronumber) {
if (furyfirecount > 0) {
game["bullet" + nextbullet]._yscale = 200;
game["bullet" + nextbullet]._xscale = 200;
} else {
game["bullet" + nextbullet]._yscale = 200;
game["bullet" + nextbullet]._xscale = 200;
}
} else if (j == heroAINumber) {
if (AIfuryfirecount > 0) {
game["bullet" + nextbullet]._yscale = 200;
game["bullet" + nextbullet]._xscale = 200;
} else {
game["bullet" + nextbullet]._yscale = 100;
game["bullet" + nextbullet]._xscale = 100;
}
} else {
game["bullet" + nextbullet]._yscale = 100;
game["bullet" + nextbullet]._xscale = 100;
}
if (j < 1000) {
if ((char[j].unit == "lionrider") or (char[j].unit == "elitelionrider")) {
game["unit" + j].rattacksound.setVolume(volumeControl(game["unit" + j]._x));
game["unit" + j].rattacksound.setPan(surroundSound(game["unit" + j]._x));
game["unit" + j].rattacksound.start();
} else {
game["unit" + j].attacksound.setVolume(volumeControl(game["unit" + j]._x));
game["unit" + j].attacksound.setPan(surroundSound(game["unit" + j]._x));
game["unit" + j].attacksound.start();
}
} else if (j == 1000) {
game.tower1.attacksound = new Sound(game.tower1);
game.tower1.attacksound.attachSound("cannon02");
game.tower1.attacksound.setVolume(volumeControl(game.tower1._x) * 0.6);
game.tower1.attacksound.setPan(surroundSound(game.tower1._x));
game.tower1.attacksound.start();
} else {
game.tower2.attacksound = new Sound(game.tower2);
game.tower2.attacksound.attachSound("cannon02");
game.tower2.attacksound.setVolume(volumeControl(game.tower2._x) * 0.6);
game.tower2.attacksound.setPan(surroundSound(game.tower2._x));
game.tower2.attacksound.start();
}
bullet[nextbullet].owner = j;
bullet[nextbullet].active = true;
bullet[nextbullet].yspeed = 2;
bullet[nextbullet].rtarget = n;
if (j > 999) {
bullet[nextbullet].yspeed = 12;
}
var _local5 = 2 + ((game["unit" + j]._y - game["unit" + n]._y) / 55);
if (_local5 > 6) {
_local5 = 6;
} else if (_local5 < -1) {
_local5 = -1;
}
if ((char[n].unit == "dragon") and (char[j].unit != "dragon")) {
_local5 = 5 + ((game["unit" + j]._y - game["unit" + n]._y) / int((Math.random() * 20) + 100));
}
if (char[n].unit != "dragon") {
var _local6 = 0;
var _local4 = 1;
while (_local4 < 4) {
if ((((game["unit" + j]._x > game["unit" + n]._x) and (game["unit" + j]._x > game["beacon" + _local4]._x)) and (game["beacon" + _local4]._x > game["unit" + n]._x)) or (((game["unit" + j]._x < game["unit" + n]._x) and (game["unit" + j]._x < game["beacon" + _local4]._x)) and (game["beacon" + _local4]._x < game["unit" + n]._x))) {
if ((((game["unit" + j]._y - 15) > game["beacon" + _local4]._y) or (Math.abs(game["unit" + j]._x - game["beacon" + _local4]._x) > 40)) and (((game["unit" + n]._y - 15) > game["beacon" + _local4]._y) or (Math.abs(game["unit" + n]._x - game["beacon" + _local4]._x) > 40))) {
_local6 = _local4;
break;
}
}
_local4++;
}
}
if (_local6 > 0) {
_local5 = 2 + ((game["unit" + j]._y - game["beacon" + _local6]._y) / (25 + (40 * Math.random())));
if (_local5 > 6) {
_local5 = 6;
} else if (_local5 < 0) {
_local5 = 0;
}
}
if (j > 999) {
_local5 = -27;
bullet[nextbullet].yspeed = 40;
}
if (n > 150) {
_local5 = 2;
if (char[j].xspeed > 0) {
bullet[nextbullet].xspeed = 15;
if (char[j].unit == "catapult") {
bullet[nextbullet].xspeed = 20;
_local5 = 5;
}
} else {
bullet[nextbullet].xspeed = -15;
if (char[j].unit == "catapult") {
bullet[nextbullet].xspeed = -20;
_local5 = 5;
}
}
if (char[j].unit == "dragon") {
}
} else {
if (char[j].xspeed > 0) {
bullet[nextbullet].xspeed = 4 + (9 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 240));
if (char[bullet[nextbullet].owner].unit == "wizard") {
bullet[nextbullet].xspeed = 4 + (9 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 250));
}
if (bullet[nextbullet].xspeed < 4) {
bullet[nextbullet].xspeed = 4;
}
if ((char[n].unit == "dragon") and (char[j].unit != "dragon")) {
bullet[nextbullet].xspeed = 9 + (15 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 240));
}
if ((char[bullet[nextbullet].owner].unit == "dragon") and (char[n].unit != "dragon")) {
if (char[j].queued or (char[j].mcount > 0)) {
if (char[j].team == 1) {
bullet[nextbullet].xspeed = ((-11.5 * (((game["unit" + j]._x - game["unit" + n]._x) + 60) / 240)) + (Math.random() * 2)) - 1;
} else {
bullet[nextbullet].xspeed = ((-11.5 * (((game["unit" + j]._x - game["unit" + n]._x) - 60) / 240)) + (Math.random() * 2)) - 1;
}
} else if (char[j].team == 1) {
bullet[nextbullet].xspeed = ((-11.5 * (((game["unit" + j]._x - game["unit" + n]._x) + 60) / 240)) + (Math.random() * 2)) - 3;
} else {
bullet[nextbullet].xspeed = ((-11.5 * (((game["unit" + j]._x - game["unit" + n]._x) - 60) / 240)) + (Math.random() * 2)) - 3;
}
}
if ((char[n].unit == "dragon") and (char[j].unit == "dragon")) {
bullet[nextbullet].xspeed = 2 + (9 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 240));
bullet[nextbullet].yspeed = 0;
_local5 = 0;
}
if (_local6 > 0) {
bullet[nextbullet].xspeed = 2 + (7 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 270));
if (char[bullet[nextbullet].owner].unit == "wizard") {
bullet[nextbullet].xspeed = 2 + (7 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 280));
}
}
} else {
bullet[nextbullet].xspeed = -4 - (9 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 240));
if (char[bullet[nextbullet].owner].unit == "wizard") {
bullet[nextbullet].xspeed = -4 - (9 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 250));
}
if (bullet[nextbullet].xspeed > -4) {
bullet[nextbullet].xspeed = -4;
}
if ((char[n].unit == "dragon") and (char[j].unit != "dragon")) {
bullet[nextbullet].xspeed = -9 - (15 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 240));
}
if ((char[bullet[nextbullet].owner].unit == "dragon") and (char[n].unit != "dragon")) {
if (char[j].queued or (char[j].mcount > 0)) {
if (char[j].team == 1) {
bullet[nextbullet].xspeed = ((-11 * (((game["unit" + j]._x - game["unit" + n]._x) + 60) / 250)) + (Math.random() * 2)) - 1;
} else {
bullet[nextbullet].xspeed = ((-11 * (((game["unit" + j]._x - game["unit" + n]._x) - 60) / 250)) + (Math.random() * 2)) - 1;
}
} else if (char[j].team == 1) {
bullet[nextbullet].xspeed = ((-11 * (((game["unit" + j]._x - game["unit" + n]._x) + 60) / 250)) + (Math.random() * 3)) - 1;
} else {
bullet[nextbullet].xspeed = ((-11 * (((game["unit" + j]._x - game["unit" + n]._x) - 60) / 250)) + (Math.random() * 3)) - 1;
}
}
if ((char[n].unit == "dragon") and (char[j].unit == "dragon")) {
bullet[nextbullet].xspeed = -2 - (9 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 240));
bullet[nextbullet].yspeed = 0;
_local5 = 0;
}
if (_local6 > 0) {
bullet[nextbullet].xspeed = -1 - (7 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 240));
if (char[bullet[nextbullet].owner].unit == "wizard") {
bullet[nextbullet].xspeed = -1 - (7 * (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 250));
}
}
}
if (j == 1000) {
bullet[nextbullet].xspeed = -2 + (22 * (Math.abs(game.tower1._x - game["unit" + n]._x) / 360));
}
if (j == 2000) {
bullet[nextbullet].xspeed = 2 - (22 * (Math.abs(game.tower2._x - game["unit" + n]._x) / 360));
}
}
if (j < 1000) {
if (_local6 > 0) {
_local5 = _local5 + (Math.abs(game["unit" + j]._x - game["beacon" + _local6]._x) / 80);
bullet[nextbullet].yspeed = -6;
} else {
_local5 = _local5 + (Math.abs(game["unit" + j]._x - game["unit" + n]._x) / 80);
}
bullet[nextbullet].momentum = 3.5 + _local5;
if ((char[n].unit == "dragon") and (char[j].unit == "dragon")) {
bullet[nextbullet].momentum = 2;
bullet[nextbullet].yspeed = -18;
}
} else {
if ((char[n].unit == "dragon") and (char[i].unit != "dragon")) {
bullet[nextbullet].yspeed = -20;
bullet[nextbullet].momentum = 1;
} else {
bullet[nextbullet].yspeed = 0;
bullet[nextbullet].momentum = 1;
}
if (j == 1000) {
if (multiShot > 0) {
var _local7 = nextbullet;
multishooting(j, 1, _local7);
if (multiShot > 1) {
multishooting(j, 2, _local7);
if (multiShot > 2) {
multishooting(j, 3, _local7);
if (multiShot > 3) {
multishooting(j, 4, _local7);
if (multiShot > 4) {
multishooting(j, 5, _local7);
}
}
}
}
}
} else if (j == 2000) {
if (AImultiShot > 0) {
var _local7 = nextbullet;
multishooting(j, 1, _local7);
if (AImultiShot > 1) {
multishooting(j, 2, _local7);
if (AImultiShot > 2) {
multishooting(j, 3, _local7);
if (AImultiShot > 3) {
multishooting(j, 4, _local7);
if (AImultiShot > 4) {
multishooting(j, 5, _local7);
}
}
}
}
}
}
}
if (n == 1000) {
bullet[nextbullet].xspeed = -15;
bullet[nextbullet].yspeed = -15;
bullet[nextbullet].momentum = 5;
if (char[j].unit == "catapult") {
bullet[nextbullet].xspeed = -25;
bullet[nextbullet].yspeed = -25;
bullet[nextbullet].momentum = 5;
} else if (char[j].unit == "dragon") {
bullet[nextbullet].xspeed = -25;
bullet[nextbullet].yspeed = 0;
bullet[nextbullet].momentum = 2;
}
}
if (n == 2000) {
bullet[nextbullet].xspeed = 15;
bullet[nextbullet].yspeed = -15;
bullet[nextbullet].momentum = 5;
if (char[j].unit == "catapult") {
bullet[nextbullet].xspeed = 25;
bullet[nextbullet].yspeed = -25;
bullet[nextbullet].momentum = 5;
} else if (char[j].unit == "dragon") {
bullet[nextbullet].xspeed = 25;
bullet[nextbullet].yspeed = 0;
bullet[nextbullet].momentum = 2;
}
}
game["bullet" + nextbullet].hb._visible = false;
} else if ((char[j].shooting > 31) and (char[j].unit == "dragon")) {
char[j].rtarget = 0;
char[j].shooting = 0;
} else if (char[j].shooting > 60) {
char[j].shooting = 1;
if (((n > 100) or (char[j].unit == "lionrider")) or (char[j].unit == "elitelionrider")) {
char[j].rtarget = 0;
char[j].shooting = 0;
}
} else if (char[j].shooting == 2) {
if ((char[n].hpCurrent > 0) and (n < 1000)) {
var _local8 = 0;
if (char[n].unit == "dragon") {
_local8 = 200;
}
if (getDist(game["unit" + j]._x, game["unit" + j]._y, game["unit" + n]._x, game["unit" + n]._y) < (char[j].range + _local8)) {
if (char[j].unit != "dragon") {
game["unit" + j].gotoAndPlay(51);
}
if ((char[j].unit == "lionrider") or (char[j].unit == "elitelionrider")) {
game["unit" + j].gotoAndPlay(151);
}
} else {
char[j].shooting = 0;
char[j].rtarget = 0;
game["unit" + j].gotoAndPlay(1);
}
} else if (n > 100) {
if (char[j].unit != "dragon") {
game["unit" + j].gotoAndPlay(51);
}
if ((char[j].unit == "lionrider") or (char[j].unit == "elitelionrider")) {
game["unit" + j].gotoAndPlay(151);
}
} else {
char[j].shooting = 0;
char[j].rtarget = 0;
game["unit" + j].gotoAndPlay(1);
}
} else {
if (j == 1000) {
if (char[j].shooting > (55 - (turretSpeed * 7))) {
char[j].shooting = 1;
}
}
if (j == 2000) {
if (char[j].shooting > (55 - (AIturretSpeed * 7))) {
char[j].shooting = 1;
}
}
if (j == heronumber) {
if (furyfirecount > 0) {
if (char[j].shooting > 6) {
char[j].shooting = 1;
}
} else if (char[j].shooting > 18) {
char[j].shooting = 1;
}
}
if (j == heroAINumber) {
if (AIfuryfirecount > 0) {
if (char[j].shooting > 6) {
char[j].shooting = 1;
}
} else if (char[j].shooting > 18) {
char[j].shooting = 1;
}
}
}
}
function multishooting(n, can, primarybullet) {
trace("multi shooting");
nextbullet++;
if (nextbullet > maxbullet) {
nextbullet = 1;
}
game.attachMovie("cannonball", "bullet" + nextbullet, 1200 + nextbullet, {_x:game["unit" + j]._x, _y:game["unit" + j]._y + 30});
game["bullet" + nextbullet]._y = 80;
game["bullet" + nextbullet].hb._visible = false;
bullet[nextbullet].mcy = 100;
if (n == 1000) {
game["bullet" + nextbullet]._x = game.tower1._x + 50;
game["bullet" + nextbullet]._yscale = 50 + ((50 * turretSize) * 0.25);
game["bullet" + nextbullet]._xscale = 50 + ((50 * turretSize) * 0.25);
} else {
game["bullet" + nextbullet]._x = game.tower2._x - 50;
game["bullet" + nextbullet]._yscale = 50 + ((50 * AIturretSize) * 0.25);
game["bullet" + nextbullet]._xscale = 50 + ((50 * AIturretSize) * 0.25);
}
var _local2 = 0;
if (can == 1) {
_local2 = 2;
} else if (can == 2) {
_local2 = -2;
} else if (can == 3) {
_local2 = 4;
} else if (can == 4) {
_local2 = -4;
} else if (can == 5) {
_local2 = 6;
}
bullet[nextbullet].type = bullet[primarybullet].type;
bullet[nextbullet].active = bullet[primarybullet].active;
bullet[nextbullet].owner = bullet[primarybullet].owner;
bullet[nextbullet].momentum = bullet[primarybullet].momentum;
bullet[nextbullet].rtarget = bullet[primarybullet].rtarget;
bullet[nextbullet].xspeed = bullet[primarybullet].xspeed + _local2;
bullet[nextbullet].yspeed = bullet[primarybullet].yspeed;
bullet[nextbullet].hit = bullet[primarybullet].hit;
bullet[nextbullet].hyp = bullet[primarybullet].hyp;
bullet[nextbullet].mcy = bullet[primarybullet].mcy;
bullet[nextbullet].distx = bullet[primarybullet].distx;
bullet[nextbullet].disty = bullet[primarybullet].disty;
bullet[nextbullet].oldx = bullet[primarybullet].oldx;
bullet[nextbullet].oldy = bullet[primarybullet].oldy;
bullet[nextbullet].mcrad = bullet[primarybullet].mcrad;
bullet[nextbullet].wind = bullet[primarybullet].wind;
bullet[nextbullet].sound = bullet[primarybullet].sound;
}
function deathcheck(i, j) {
game["healthbar" + j].hbgreen._xscale = int((char[j].hpCurrent / char[j].hpMax) * 100);
if ((char[j].hpCurrent < 1) and char[j].active) {
game["healthbar" + j].removeMovieClip();
char[j].active = false;
game["unit" + j].gotoAndPlay(101);
char[i].mcount = 0;
char[i].shooting = 0;
char[i].melee = false;
if (char[i].ranged and char[j].melee) {
var _local5 = 0;
while (_local5 < (maxmen + 1)) {
if (!char[_local5].ranged) {
if (char[_local5].team == char[j].team) {
char[_local5].melee = false;
}
}
_local5++;
}
}
game["unit" + j].diesound.setVolume(volumeControl(game["unit" + j]._x));
game["unit" + j].diesound.setPan(surroundSound(game["unit" + j]._x));
game["unit" + j].diesound.start();
game["unit" + i].gotoAndPlay(1);
if (i == heronumber) {
heroxp = heroxp + int(char[j].hpMax * (1 + (_global.herolearned * 0.1)));
}
if (i == heroAINumber) {
heroAIXp = heroAIXp + char[j].hpMax;
}
if (j == heronumber) {
heronumber = 0;
rivival = 2000;
heroflee = false;
}
if (j == heroAINumber) {
heroAINumber = 0;
heroAIRestore = 0;
heroAIDeath = 1000;
heroAIOut = false;
heroAIFlee = false;
}
var _local3 = 0;
if (char[j].team == 1) {
switch (char[j].unit) {
case "slave" :
_local3 = slavecost;
break;
case "soldier" :
_local3 = soldiercost;
break;
case "archer" :
_local3 = archercost;
break;
case "wizard" :
_local3 = wizardcost * 0.9;
break;
case "dragon" :
_local3 = dragoncost * 0.2;
break;
case "assasin" :
_local3 = assasincost * 0.9;
break;
case "spiderrider" :
_local3 = spiderridercost * 0.8;
break;
case "drake" :
_local3 = drakecost * 0.6;
break;
case "wargrider" :
_local3 = wolfridercost * 0.8;
break;
case "lionrider" :
_local3 = lionridercost * 0.7;
break;
case "elitelionrider" :
_local3 = elitelionridercost * 0.6;
break;
case "battletroll" :
_local3 = battletrollcost * 0.5;
break;
case "golem" :
_local3 = golemcost * 0.6;
break;
case "undeadknight" :
_local3 = undeadknightcost * 0.75;
break;
case "babydemon" :
_local3 = babydemoncost * 0.6;
break;
case "babywing" :
_local3 = babywingcost * 0.6;
break;
case "lion" :
_local3 = lioncost;
break;
case "largelion" :
_local3 = largelioncost;
break;
default :
_local3 = 2000;
}
} else {
switch (char[j].unit) {
case "slave" :
_local3 = slavecost;
break;
case "soldier" :
_local3 = soldiercost;
break;
case "archer" :
_local3 = archercost;
break;
case "wizard" :
_local3 = wizardcost;
break;
case "dragon" :
_local3 = dragoncost;
break;
case "assasin" :
_local3 = assasincost;
break;
case "spiderrider" :
_local3 = spiderridercost;
break;
case "drake" :
_local3 = drakecost;
if (currentMap == 7) {
_local3 = drakecost * 3;
}
break;
case "wargrider" :
_local3 = wolfridercost;
break;
case "lionrider" :
_local3 = lionridercost;
break;
case "elitelionrider" :
_local3 = elitelionridercost;
break;
case "battletroll" :
_local3 = battletrollcost;
break;
case "golem" :
_local3 = golemcost;
break;
case "undeadknight" :
_local3 = undeadknightcost;
break;
case "babydemon" :
_local3 = babydemoncost;
break;
case "babywing" :
_local3 = babywingcost;
break;
case "lion" :
_local3 = lioncost;
break;
case "largelion" :
_local3 = largelioncost;
break;
default :
_local3 = 2000;
}
}
killbonus = killbonus + 2;
game.attachMovie("goldup", "goldup" + j, 1700 + j);
game["goldup" + j]._x = game["unit" + j]._x;
game["goldup" + j]._y = game["unit" + j]._y - 30;
var _local6 = int((game["goldup" + j]._x / 800) + 1);
if (_local6 > 2) {
reputation = (reputation + _local6) - 2;
game.attachMovie("trophyup", "trophyup" + j, 1800 + j);
game["trophyup" + j]._x = game["unit" + j]._x + 5;
game["trophyup" + j]._y = game["unit" + j]._y - 22;
}
if (char[j].team == 1) {
_global.gold = _global.gold + (int((_local3 / (1 - (0.05 * _global.fame))) / 8) * _local6);
game["goldup" + j].goldup = int((_local3 / (1 - (0.05 * _global.fame))) / 8) * _local6;
experience = experience + (((_local3 / (1 - (0.05 * _global.fame))) * _local6) / 2);
playerpop--;
} else {
_global.gold = _global.gold + (int((_local3 / (1 - (0.05 * _global.fame))) / 5) * _local6);
game["goldup" + j].goldup = int((_local3 / (1 - (0.05 * _global.fame))) / 5) * _local6;
experience = experience + ((_local3 / (1 - (0.05 * _global.fame))) * _local6);
if (experience >= 6000) {
if (_root.options2.ldb4.locked._currentframe == 2) {
_root.options2.ldb4.locked.gotoAndStop(1);
_root.herodashboard.ldb4.locked.gotoAndStop(1);
_root.attachMovie("unlockedherotxt", "unlockedherotxt", 300);
_root.unlockedherotxt._x = 250;
_root.unlockedherotxt._y = 100;
}
}
if (char[j].unit == "chief") {
heroAIOut = false;
heroAIDeath = 1000;
heroAIRestore = 0;
}
if (((i != heronumber) and (char[heronumber].mcount > 0)) or (char[heronumber].shooting > 0)) {
heroxp = heroxp + int((char[j].hpMax * (1 + (_global.herolearned * 0.1))) / 2);
}
}
}
if ((tower1hp < 1) and (!gameover)) {
trace("gameover - defeat");
game.tower1.gotoAndPlay(2);
game.tower1.cover.removeMovieClip();
game.tower1.destroysound = new Sound(game.tower1);
game.tower1.destroysound.attachSound("aexp6");
game.tower1.destroysound.setVolume(1.7 * volumeControl(game.tower1._x));
game.tower1.destroysound.setPan(surroundSound(game.tower1._x));
game.tower1.destroysound.start();
gameover = true;
game.attachMovie("fire_smoke2", "fire_smoke2", 999995457);
game.fire_smoke2._x = game.tower1._x - 150;
game.fire_smoke2._y = -240;
game.fire_smoke2._xscale = 220;
game.fire_smoke2._yscale = 220;
}
if ((tower2hp < 1) and (!gameover)) {
trace("gameover - victory");
game.tower2.gotoAndPlay(2);
game.tower2.cover.removeMovieClip();
game.tower2.destroysound = new Sound(game.tower2);
game.tower2.destroysound.attachSound("aexp6");
game.tower2.destroysound.setVolume(1.7 * volumeControl(game.tower2._x));
game.tower2.destroysound.setPan(surroundSound(game.tower2._x));
game.tower2.destroysound.start();
gameover = true;
levelscomplete[_global.scene]++;
game.attachMovie("fire_smoke2", "fire_smoke2", 999995457);
game.fire_smoke2._x = game.tower2._x - 200;
game.fire_smoke2._y = -240;
game.fire_smoke2._xscale = 220;
game.fire_smoke2._yscale = 220;
}
}
function herostomp() {
if ((heronumber > 0) and (herohp > 0)) {
game["unit" + heronumber].gotoAndPlay(51);
game["unit" + heronumber].stompsound.setVolume(volumeControl(game["unit" + heronumber]._x));
game["unit" + heronumber].stompsound.setPan(surroundSound(game["unit" + heronumber]._x));
game["unit" + heronumber].stompsound.start();
char[heronumber].special = "stomp";
char[heronumber].specialcount = 1;
char[heronumber].mcount = 0;
char[heronumber].melee = false;
char[heronumber].mtarget = 0;
stompdown = 1200;
}
}
function AIherostomp() {
if (heroAINumber > 0) {
game["unit" + heroAINumber].gotoAndPlay(51);
game["unit" + heroAINumber].stompsound.setVolume(volumeControl(game["unit" + heroAINumber]._x));
game["unit" + heroAINumber].stompsound.setPan(surroundSound(game["unit" + heroAINumber]._x));
game["unit" + heroAINumber].stompsound.start();
char[heroAINumber].special = "stomp";
char[heroAINumber].specialcount = 1;
char[heroAINumber].mcount = 0;
char[heroAINumber].melee = false;
char[heroAINumber].mtarget = 0;
AIstompdown = 1200;
}
}
function bloodlusting() {
if ((heronumber > 0) and (herohp > 0)) {
bloodluster = 300;
char[heronumber].damagelvl = int(int(herodmg * Math.pow(gainrate, herolvl)) * 1.25);
if (heroflee) {
char[heronumber].xspeed = char[heronumber].xspeed - 3;
} else {
char[heronumber].xspeed = char[heronumber].xspeed + 3;
}
myColor = new Color(game["unit" + heronumber]);
myColorTransform = new Object();
myColorTransform = {rb:150, gb:0, bb:0};
myColor.setTransform(myColorTransform);
bloodon = 1200;
}
}
function BloodOff() {
bloodluster--;
if (bloodluster < 1) {
char[heronumber].damagelvl = int(herodmg * Math.pow(gainrate, herolvl));
if (heroflee) {
char[heronumber].xspeed = char[heronumber].xspeed + 3;
} else {
char[heronumber].xspeed = char[heronumber].xspeed - 3;
}
myColor = new Color(game["unit" + heronumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
}
function AIbloodlusting() {
if (heroAINumber > 0) {
AIbloodluster = 300;
char[heroAINumber].damagelvl = int(int(heroAIdmg * Math.pow(gainrate, heroAILevel)) * 1.25);
if (heroAIFlee) {
char[heroAINumber].xspeed = char[heroAINumber].xspeed + 3;
} else {
char[heroAINumber].xspeed = char[heroAINumber].xspeed - 3;
}
myColor = new Color(game["unit" + heroAINumber]);
myColorTransform = new Object();
myColorTransform = {rb:150, gb:0, bb:0};
myColor.setTransform(myColorTransform);
AIbloodon = 1200;
}
}
function AIBloodOff() {
AIbloodluster--;
if (AIbloodluster < 1) {
char[heroAINumber].damagelvl = int(heroAIdmg * Math.pow(gainrate, heroAILevel));
if (heroAIFlee) {
char[heroAINumber].xspeed = char[heroAINumber].xspeed - 3;
} else {
char[heroAINumber].xspeed = char[heroAINumber].xspeed + 3;
}
myColor = new Color(game["unit" + heroAINumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
}
function morphing() {
if ((heronumber > 0) and (herohp > 0)) {
morpher = 500;
char[heronumber].damagelvl = int(int(herodmg * Math.pow(gainrate, herolvl)) * 1.5);
if (heroflee) {
char[heronumber].xspeed = char[heronumber].xspeed - 5;
} else {
char[heronumber].xspeed = char[heronumber].xspeed + 5;
}
var _local1 = game["unit" + heronumber].getDepth();
var _local3 = game["unit" + heronumber]._x;
var _local4 = game["unit" + heronumber]._y;
var _local2 = game["unit" + heronumber]._xscale;
game.attachMovie("chief4b", "unit" + heronumber, _local1);
game["unit" + heronumber]._x = _local3;
game["unit" + heronumber]._y = _local4;
game["unit" + heronumber].hb._visible = false;
game["unit" + heronumber].gotoAndStop(51);
game["unit" + heronumber]._xscale = _local2;
myColor = new Color(game["unit" + heronumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
morphon = 1500;
}
}
function MorphOff() {
morpher--;
if (morpher < 1) {
char[heronumber].damagelvl = int(herodmg * Math.pow(gainrate, herolvl));
var _local1 = game["unit" + heronumber].getDepth();
var _local3 = game["unit" + heronumber]._x;
var _local4 = game["unit" + heronumber]._y;
var _local2 = game["unit" + heronumber]._xscale;
game.attachMovie("chief4", "unit" + heronumber, _local1);
game["unit" + heronumber]._x = _local3;
game["unit" + heronumber]._y = _local4;
game["unit" + heronumber].hb._visible = false;
game["unit" + heronumber].gotoAndStop(51);
game["unit" + heronumber]._xscale = _local2;
if (heroflee) {
char[heronumber].xspeed = char[heronumber].xspeed + 5;
} else {
char[heronumber].xspeed = char[heronumber].xspeed - 5;
}
myColor = new Color(game["unit" + heronumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
}
function AImorphing() {
if (heroAINumber > 0) {
AImorpher = 300;
char[heroAINumber].damagelvl = int(int(heroAIdmg * Math.pow(gainrate, heroAILevel)) * 1.5);
if (heroAIFlee) {
char[heroAINumber].xspeed = char[heroAINumber].xspeed + 5;
} else {
char[heroAINumber].xspeed = char[heroAINumber].xspeed - 5;
}
var _local1 = game["unit" + heroAINumber].getDepth();
var _local3 = game["unit" + heroAINumber]._x;
var _local4 = game["unit" + heroAINumber]._y;
var _local2 = game["unit" + heroAINumber]._xscale;
game.attachMovie("chief4b", "unit" + heroAINumber, _local1);
game["unit" + heroAINumber]._x = _local3;
game["unit" + heroAINumber]._y = _local4;
game["unit" + heroAINumber].hb._visible = false;
game["unit" + heroAINumber].gotoAndStop(51);
game["unit" + heroAINumber]._xscale = _local2;
myColor = new Color(game["unit" + heroAINumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
AImorphon = 1500;
}
}
function AIMorphOff() {
AImorpher--;
if (AImorpher < 1) {
var _local1 = game["unit" + heroAINumber].getDepth();
var _local3 = game["unit" + heroAINumber]._x;
var _local4 = game["unit" + heroAINumber]._y;
var _local2 = game["unit" + heroAINumber]._xscale;
game.attachMovie("chief4", "unit" + heroAINumber, _local1);
game["unit" + heroAINumber]._x = _local3;
game["unit" + heroAINumber]._y = _local4;
game["unit" + heroAINumber].hb._visible = false;
game["unit" + heroAINumber].gotoAndStop(51);
game["unit" + heroAINumber]._xscale = _local2;
char[heroAINumber].damagelvl = int(heroAIdmg * Math.pow(gainrate, heroAILevel));
if (heroAIFlee) {
char[heroAINumber].xspeed = char[heroAINumber].xspeed - 5;
} else {
char[heroAINumber].xspeed = char[heroAINumber].xspeed + 5;
}
myColor = new Color(game["unit" + heroAINumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
}
function shielding() {
if ((heronumber > 0) and (herohp > 0)) {
shielder = 300;
myColor = new Color(game["unit" + heronumber]);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:0};
myColor.setTransform(myColorTransform);
shieldon = 1200;
}
}
function ShieldOff() {
shielder--;
if (shielder < 1) {
myColor = new Color(game["unit" + heronumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
}
function AIshielding() {
if (heroAINumber > 0) {
AIshielder = 300;
myColor = new Color(game["unit" + heroAINumber]);
myColorTransform = new Object();
myColorTransform = {rb:200, gb:200, bb:0};
myColor.setTransform(myColorTransform);
AIshieldon = 1200;
}
}
function AIShieldOff() {
AIshielder--;
if (AIbloodluster < 1) {
myColor = new Color(game["unit" + heroAINumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
}
function Knocking() {
if ((heronumber > 0) and (herohp > 0)) {
knocking = 450;
myColor = new Color(game["unit" + heronumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:200};
myColor.setTransform(myColorTransform);
knockon = 1500;
}
}
function KnockOff() {
knocking--;
if (knocking < 1) {
myColor = new Color(game["unit" + heronumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
}
function AIKnocking() {
if (heroAINumber > 0) {
AIknocking = 550;
myColor = new Color(game["unit" + heroAINumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:200};
myColor.setTransform(myColorTransform);
AIknockon = 1500;
}
}
function AIKnockOff() {
AIknocking--;
if (AIknocking < 1) {
myColor = new Color(game["unit" + heroAINumber]);
myColorTransform = new Object();
myColorTransform = {rb:0, gb:0, bb:0};
myColor.setTransform(myColorTransform);
}
}
function knocked(hero, target) {
trace(target + " has been kncoked back");
}
function flinging(unit) {
char[unit].knockcount--;
char[unit].rtarget = 0;
char[unit].mtarget = 0;
char[unit].queued = false;
char[unit].melee = false;
char[unit].mcount = 0;
char[unit].shooting = 0;
if (game["unit" + unit]._x > 3395) {
char[unit].knockx = 0;
}
if (game["unit" + unit]._x < 160) {
char[unit].knockx = 0;
}
if ((game["unit" + unit]._y > (groundmaker(game["unit" + unit]._x) - 10)) or (char[unit].knockcount == 0)) {
if (char[unit].knockcount > 20) {
char[unit].knockcount = 20;
}
game["unit" + unit]._rotation2 = 0;
game["unit" + unit]._y = groundmaker(game["unit" + unit]._x);
char[unit].knockx = 0;
char[unit].knocky = 0;
} else {
if (char[unit].team == 2) {
game["unit" + unit]._x = game["unit" + unit]._x + char[unit].knockx;
game["unit" + unit]._rotation2 = game["unit" + unit]._rotation2 + 30;
} else {
game["unit" + unit]._x = game["unit" + unit]._x - char[unit].knockx;
game["unit" + unit]._rotation2 = game["unit" + unit]._rotation2 - 30;
}
game["unit" + unit]._y = game["unit" + unit]._y - char[unit].knocky;
char[unit].knocky = char[unit].knocky - 0.8;
char[unit].knockx = char[unit].knockx - 0.05;
if (char[unit].knockx < 0) {
char[unit].knockx = 0;
}
}
}
function AIFist(fistx) {
AIfiston = true;
AIfistdown = true;
game.attachMovie("mightyfist", "AImightyfist", 2222222);
game.AImightyfist._x = fistx;
}
function AIMegaFist(fistx) {
AIomegafiston = true;
AIomegafistdown = true;
game.attachMovie("omegafist", "AImightyfist", 2222222);
game.AImightyfist._x = fistx;
}
function fistControl() {
game.mightyfist.hb._visible = false;
if (fiston or omegafiston) {
if (fistdown or omegafistdown) {
if ((game.mightyfist._y + 30) > groundmaker(game.mightyfist._x)) {
if (game.mightyfist._alpha > 99) {
var _local3 = 1;
while (_local3 < (maxmen + 1)) {
if (char[_local3].team != 1) {
if (game.mightyfist.hitTest(game["unit" + _local3].hb)) {
game.mightyfist.fistsound = new Sound(game.mightyfist);
game.mightyfist.fistsound.attachSound("aexp2");
game.mightyfist.fistsound.setVolume(volumeControl(game.mightyfist._x));
game.mightyfist.fistsound.setPan(surroundSound(game.mightyfist._x));
game.mightyfist.fistsound.start();
game.attachMovie("dmgup", "dmgup" + _local3, 1700 + _local3);
game["dmgup" + _local3]._x = game["unit" + _local3]._x;
game["dmgup" + _local3]._y = game["unit" + _local3]._y - 30;
if (omegafistdown) {
char[_local3].hpCurrent = char[_local3].hpCurrent - (1000 * (1 + (0.3 * _global.fistpower)));
game["dmgup" + _local3].goldup = 1000 * (1 + (0.3 * _global.fistpower));
} else {
char[_local3].hpCurrent = char[_local3].hpCurrent - (100 * (1 + (0.3 * _global.fistpower)));
game["dmgup" + _local3].goldup = 100 * (1 + (0.3 * _global.fistpower));
}
deathcheck(1001, _local3);
}
}
_local3++;
}
}
game.mightyfist._alpha = game.mightyfist._alpha - 5;
if (game.mightyfist._alpha < 10) {
game.mightyfist.swapDepths(1);
game.mightyfist.removeMovieClip();
if (fiston) {
fistcharge = 2500;
fistdown = false;
fiston = false;
}
if (omegafiston) {
omegafistcharge = 10000;
omegafistdown = false;
omegafiston = false;
}
}
} else {
game.mightyfist._y = game.mightyfist._y + 50;
}
} else {
game.mightyfist._x = _xmouse - _root.game._x;
game.mightyfist._y = 50;
}
}
}
function AIfistControl() {
game.AImightyfist.hb._visible = false;
if (AIfiston or AIomegafiston) {
if (AIfistdown or AIomegafistdown) {
if ((game.AImightyfist._y + 30) > groundmaker(game.AImightyfist._x)) {
if (game.AImightyfist._alpha > 99) {
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].team == 1) {
if (game.AImightyfist.hitTest(game["unit" + _local2].hb)) {
game.AImightyfist.fistsound = new Sound(game.AImightyfist);
game.AImightyfist.fistsound.attachSound("aexp2");
game.AImightyfist.fistsound.setVolume(volumeControl(game.AImightyfist._x));
game.AImightyfist.fistsound.setPan(surroundSound(game.AImightyfist._x));
game.AImightyfist.fistsound.start();
game.attachMovie("dmgup", "dmgup" + _local2, 1700 + _local2);
game["dmgup" + _local2]._x = game["unit" + _local2]._x;
game["dmgup" + _local2]._y = game["unit" + _local2]._y - 30;
if (AIomegafistdown) {
char[_local2].hpCurrent = char[_local2].hpCurrent - 1000;
game["dmgup" + _local2].goldup = 1000;
} else {
char[_local2].hpCurrent = char[_local2].hpCurrent - 100;
game["dmgup" + _local2].goldup = 100;
}
deathcheck(1001, _local2);
}
}
_local2++;
}
}
game.AImightyfist._alpha = game.AImightyfist._alpha - 5;
if (game.AImightyfist._alpha < 10) {
game.AImightyfist.swapDepths(1);
game.AImightyfist.removeMovieClip();
if (AIfiston) {
AIfistcharge = 2500;
AIfistdown = false;
AIfiston = false;
}
if (AIomegafiston) {
AIomegafistcharge = 10000;
AIomegafistdown = false;
AIomegafiston = false;
}
}
} else {
game.AImightyfist._y = game.AImightyfist._y + 50;
}
} else {
game.AImightyfist._x = _xmouse - _root.game._x;
game.AImightyfist._y = 50;
}
}
}
function growControl() {
game.growspell.hb._visible = false;
if (growon) {
if (growdown) {
if ((game.growspell._y + 30) > groundmaker(game.growspell._x)) {
if (game.growspell._alpha > 99) {
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].team == 1) {
if (game.growspell.hitTest(game["unit" + _local2].hb)) {
game["unit" + _local2]._xscale = game["unit" + _local2]._xscale * 1.25;
game["unit" + _local2]._yscale = game["unit" + _local2]._yscale * 1.25;
char[_local2].hpCurrent = char[_local2].hpCurrent + (char[_local2].hpMax * 0.5);
char[_local2].hpMax = char[_local2].hpMax * 1.5;
char[_local2].damagelvl = char[_local2].damagelvl * 1.5;
}
}
_local2++;
}
}
game.growspell._alpha = game.growspell._alpha - 5;
if (game.growspell._alpha < 10) {
game.growspell.swapDepths(1);
game.growspell.removeMovieClip();
if (growon) {
growcharge = 10000;
growdown = false;
growon = false;
}
}
} else {
game.growspell._y = game.growspell._y + 50;
}
} else {
game.growspell._x = _xmouse - _root.game._x;
game.growspell._y = 50;
}
}
}
function lightning() {
if (stormcharge == 0) {
game.attachMovie("dark", "dark", 1112600);
trace("attaching darkness");
}
stormcharge = 3000;
storm = false;
if (lightningcount < maxlightning) {
if ((Math.random() * 100) < 15) {
lightningcount++;
game.attachMovie("lightning" + int((Math.random() * 6) + 1), "lightning" + lightningcount, 12700 + lightningcount);
game.createEmptyMovieClip("lightningsound" + lightningcount, (12700 + maxlightning) + lightningcount);
game["lightning" + lightningcount].hb._visible = false;
game["lightning" + lightningcount]._x = 0 + int(Math.random() * 4600);
game["lightning" + lightningcount]._y = 250;
game["lightning" + lightningcount]._yscale = 150;
game["lightning" + lightningcount]._xscale = 150;
if ((game["lightning" + lightningcount]._x > (game.dark._x - 500)) and (game["lightning" + lightningcount]._x < (game.dark._x + 500))) {
game.dark.gotoAndPlay(7);
game["lightningsound" + lightningcount].lightningsound = new Sound(game["lightningsound" + lightningcount]);
game["lightningsound" + lightningcount].lightningsound.attachSound("Lightnin-Dylan_Hi-8584_hifi");
game["lightningsound" + lightningcount].lightningsound.setVolume(volumeControl(game["lightning" + lightningcount]._x));
game["lightningsound" + lightningcount].lightningsound.setPan(surroundSound(game["lightning" + lightningcount]._x));
game["lightningsound" + lightningcount].lightningsound.start();
}
if (_global.sounds) {
lightningsound.start(0, 1);
}
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].team != 1) {
if (game["lightning" + lightningcount].hb.hitTest(game["unit" + _local2].hb)) {
char[_local2].hpCurrent = char[_local2].hpCurrent - 50;
game.attachMovie("dmgup", "dmgup" + _local2, 1700 + _local2);
game["dmgup" + _local2]._x = game["unit" + _local2]._x;
game["dmgup" + _local2]._y = game["unit" + _local2]._y - 30;
game["dmgup" + _local2].goldup = 50;
deathcheck(1001, _local2);
}
}
_local2++;
}
}
} else {
game.dark.gotoAndPlay(10);
game.dark.removeMovieClip();
trace("darkness played at 10");
lightningcount = 0;
lightningstorm = false;
}
game.dark._x = -game._x;
}
function bloodlustfog() {
if (bloodlusttimer > 0) {
bloodlusttimer--;
if (bloodlusttimer < 100) {
_root.game.bloodlustspell._alpha--;
}
} else {
bloodluston = false;
bloodlustcharge = 6000;
_root.game.bloodlustspell.removeMovieClip();
}
}
function heroregen() {
if (heronumber != 0) {
char[heronumber].hpCurrent = char[heronumber].hpCurrent + 1;
game["healthbar" + heronumber].hbgreen._xscale = int((char[heronumber].hpCurrent / char[heronumber].hpMax) * 100);
if (char[heronumber].hpCurrent > char[heronumber].hpMax) {
char[heronumber].hpCurrent = char[heronumber].hpMax;
}
}
}
function healfog() {
if (healtimer > 0) {
healtimer--;
if (healtimer < 100) {
_root.game.healspell._alpha--;
}
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].team == 1) {
char[_local2].hpCurrent = char[_local2].hpCurrent + 3;
game["healthbar" + _local2].hbgreen._xscale = int((char[_local2].hpCurrent / char[_local2].hpMax) * 100);
if (char[_local2].hpCurrent > char[_local2].hpMax) {
char[_local2].hpCurrent = char[_local2].hpMax;
}
}
_local2++;
}
} else {
healon = false;
healcharge = 6000;
_root.game.healspell.removeMovieClip();
}
}
function meteoring() {
if (meteorcharge == 0) {
}
meteorcharge = 7000;
meteor = false;
if (meteorcount < maxmeteor) {
if ((Math.random() * 100) < 50) {
meteorcount++;
nextbullet++;
if (nextbullet > maxbullet) {
nextbullet = 1;
}
game.attachMovie("meteor", "bullet" + nextbullet, 1200 + nextbullet, {_x:200 + int(2000 * Math.random()), _y:-30});
bullet[nextbullet].sound = "archmage_hit2";
bullet[nextbullet].owner = 1001;
bullet[nextbullet].active = true;
bullet[nextbullet].yspeed = 2;
bullet[nextbullet].rtarget = 2000;
bullet[nextbullet].xspeed = 7;
bullet[nextbullet].yspeed = 0;
bullet[nextbullet].momentum = 0;
bullet[nextbullet].mcy = game["bullet" + nextbullet]._y;
game["bullet" + nextbullet].hb._visible = false;
game["bullet" + nextbullet].gotoAndPlay(2);
}
} else {
meteorcount = 0;
meteorstorm = false;
}
}
function AIlightning() {
if (AIstormcharge < 1) {
game.attachMovie("dark", "dark", 1112600);
trace("attaching darkness");
}
AIstormcharge = 4000;
AIstorm = false;
if (AIlightningcount < AImaxlightning) {
if ((Math.random() * 100) < 15) {
AIlightningcount++;
game.attachMovie("lightning" + int((Math.random() * 6) + 1), "lightning" + AIlightningcount, 12700 + AIlightningcount);
game.createEmptyMovieClip("lightningsound" + AIlightningcount, (12700 + AImaxlightning) + AIlightningcount);
myColor = new Color(game["lightning" + AIlightningcount]);
myColorTransform = new Object();
myColorTransform = {rb:150, gb:0, bb:0};
myColor.setTransform(myColorTransform);
game["lightning" + AIlightningcount].hb._visible = false;
game["lightning" + AIlightningcount]._x = 0 + int(Math.random() * 4600);
game["lightning" + AIlightningcount]._y = 250;
game["lightning" + AIlightningcount]._yscale = 150;
game["lightning" + AIlightningcount]._xscale = 150;
if ((game["lightning" + AIlightningcount]._x > (game.dark._x - 500)) and (game["lightning" + AIlightningcount]._x < (game.dark._x + 500))) {
game.dark.gotoAndPlay(7);
game["lightningsound" + AIlightningcount].lightningsound = new Sound(game["lightningsound" + AIlightningcount]);
game["lightningsound" + AIlightningcount].lightningsound.attachSound("Lightnin-Dylan_Hi-8584_hifi");
game["lightningsound" + AIlightningcount].lightningsound.setVolume(volumeControl(game["lightning" + AIlightningcount]._x));
game["lightningsound" + AIlightningcount].lightningsound.setPan(surroundSound(game["lightning" + AIlightningcount]._x));
game["lightningsound" + AIlightningcount].lightningsound.start();
}
if (_global.sounds) {
lightningsound.start(0, 1);
}
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].team == 1) {
if (game["lightning" + AIlightningcount].hb.hitTest(game["unit" + _local2].hb)) {
char[_local2].hpCurrent = char[_local2].hpCurrent - 50;
game.attachMovie("dmgup", "dmgup" + _local2, 1700 + _local2);
game["dmgup" + _local2]._x = game["unit" + _local2]._x;
game["dmgup" + _local2]._y = game["unit" + _local2]._y - 30;
game["dmgup" + _local2].goldup = 50;
deathcheck(1001, _local2);
}
}
_local2++;
}
}
} else {
game.dark.gotoAndPlay(10);
game.dark.removeMovieClip();
trace("darkness played at 10");
AIlightningcount = 0;
AIlightningstorm = false;
}
game.dark._x = -game._x;
}
function special(i) {
char[i].specialcount++;
if (char[i].specialcount > 30) {
char[i].special = "";
char[i].specialcount = 0;
game["unit" + i].gotoAndPlay(1);
} else if (char[i].specialcount == 12) {
game.attachMovie("shockwave", "shockwave", 11253);
game.shockwave._x = game["unit" + i]._x;
game.shockwave._y = game["unit" + i]._y + 16;
var _local1 = 1;
while (_local1 < (maxmen + 1)) {
if (char[_local1].unit != "dragon") {
if (char[_local1].active and (char[i].team != char[_local1].team)) {
if (Math.abs(game.shockwave._x - game["unit" + _local1]._x) < 300) {
game["unit" + _local1].gotoAndStop(99);
char[_local1].stuncount = 180;
char[_local1].hpCurrent = char[_local1].hpCurrent - 10;
game.attachMovie("dmgup", "dmgup" + _local1, 1700 + _local1);
game["dmgup" + _local1]._x = game["unit" + _local1]._x;
game["dmgup" + _local1]._y = game["unit" + _local1]._y - 30;
game["dmgup" + _local1].goldup = 10;
deathcheck(i, _local1);
}
}
}
_local1++;
}
}
}
function herolevels() {
var _local3;
var _local2 = 1;
while (_local2 < 16) {
if (heroxp > levelxp[_local2]) {
_local3 = _local2;
} else {
break;
}
_local2++;
}
if (_local3 > herolvl) {
_root.attachMovie("lvlupherotxt", "lvlupherotxt", 300);
_root.lvlupherotxt._x = 250;
_root.lvlupherotxt._y = 100;
herolvl = _local3;
char[heronumber].hpCurrent = char[heronumber].hpCurrent + int((herohp * Math.pow(gainrate, herolvl)) / 3);
char[heronumber].hpMax = int(herohp * Math.pow(gainrate, herolvl));
if (char[heronumber].hpCurrent > char[heronumber].hpMax) {
char[heronumber].hpCurrent = char[heronumber].hpMax;
}
char[heronumber].damagelvl = int(herodmg * Math.pow(gainrate, herolvl));
if (herolvl > 1) {
_root.options2.ldb5.locked.gotoAndStop(1);
_root.herodashboard.options2.ldb5.locked.gotoAndStop(1);
}
}
_local2 = 1;
while (_local2 < 16) {
if (heroAIXp > levelxp[_local2]) {
_local3 = _local2;
} else {
break;
}
_local2++;
}
if (_local3 > heroAILevel) {
heroAILevel = _local3;
char[heroAInumber].hpCurrent = char[heroAInumber].hpCurrent + int((heroAIhp * Math.pow(gainrate, heroAILevel)) / 3);
char[heroAInumber].hpMax = int(heroAIhp * Math.pow(gainrate, heroAILevel));
if (char[heroAInumber].hpCurrent > char[heroAInumber].hpMax) {
char[heroAInumber].hpCurrent = char[heroAInumber].hpMax;
}
char[heroAInumber].damagelvl = int(heroAIdmg * Math.pow(gainrate, heroAILevel));
}
}
function recruitlocks() {
if (experience < archerexp) {
_root.options2.lockarcher.gotoAndStop(2);
} else if (_root.options2.lockarcher._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ((((("--- " + archerexp) + "XP ---") + newline) + "Archer Unit") + newline) + "UNLOCKED!";
_root.options2.lockarcher.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < soldierexp) {
_root.options2.locksoldier.gotoAndStop(2);
} else if (_root.options2.locksoldier._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ((((("--- " + soldierexp) + "XP ---") + newline) + "Soldier Unit") + newline) + "UNLOCKED!";
_root.options2.locksoldier.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < assasinexp) {
_root.options2.lockassassin.gotoAndStop(2);
} else if (_root.options2.lockassassin._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ((((("--- " + assasinexp) + "XP ---") + newline) + "Assassin Unit") + newline) + "UNLOCKED!";
_root.options2.lockassassin.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < wizardexp) {
_root.options2.lockwizard.gotoAndStop(2);
} else if (_root.options2.lockwizard._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ((((("--- " + wizardexp) + "XP ---") + newline) + "Wizard Unit") + newline) + "UNLOCKED!";
_root.options2.lockwizard.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < wargriderexp) {
_root.options2.lockwolfrider.gotoAndStop(2);
} else if (_root.options2.lockwolfrider._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ((((("--- " + wargriderexp) + "XP ---") + newline) + "Wolf Rider Unit") + newline) + "UNLOCKED!";
_root.options2.lockwolfrider.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
// swfAction0x16 // Unknown action
}
if (experience < lionriderexp) {
_root.options2.locklionrider.gotoAndStop(2);
} else if (_root.options2.locklionrider._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ((((("--- " + lionriderexp) + "XP ---") + newline) + "Lion Rider Unit") + newline) + "UNLOCKED!";
_root.options2.locklionrider.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < battletrollexp) {
_root.options2.lockbattletroll.gotoAndStop(2);
} else if (_root.options2.lockbattletroll._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ((((("--- " + battletrollexp) + "XP ---") + newline) + "Battle Troll Unit") + newline) + "UNLOCKED!";
_root.options2.lockbattletroll.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < golemexp) {
_root.options2.lockgolem.gotoAndStop(2);
} else if (_root.options2.lockgolem._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ((((("--- " + golemexp) + "XP ---") + newline) + "Infernal Golem Unit") + newline) + "UNLOCKED!";
_root.options2.lockgolem.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < dragonexp) {
_root.options2.lockdragon.gotoAndStop(2);
} else if (_root.options2.lockdragon._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ((((("--- " + dragonexp) + "XP ---") + newline) + "Dragon Rider Unit") + newline) + "UNLOCKED!";
_root.options2.lockdragon.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < spiderriderexp) {
_root.options2.lockspiderrider.gotoAndStop(2);
} else if (_root.options2.lockspiderrider._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 65000XP ---\rSpider Rider Unit\rUNLOCKED!";
_root.options2.lockspiderrider.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < drakeexp) {
_root.options2.lockdrake.gotoAndStop(2);
} else if (_root.options2.lockdrake._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 120000XP ---\rFire Drake Unit\rUNLOCKED!";
_root.options2.lockdrake.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if (experience < 10000) {
_root.options2.ldb16.locked.gotoAndStop(2);
} else {
if (fistcharge > 0) {
_root.options2.ldb16.gotoAndStop(1);
} else {
_root.options2.ldb16.gotoAndStop(2);
}
mightyfist = true;
if (fistcharge > 0) {
fistcharge--;
} else if (_global.tip6 == 0) {
_root.options2.ldb16.gotoAndStop(2);
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(7);
pausegame = true;
_global.tip6 = 1;
}
if (_root.options2.ldb16.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 10,000XP ---\rFist of Might\rUNLOCKED!";
_root.options2.ldb16.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
}
if (experience < 200000) {
_root.options2.ldb20.locked.gotoAndStop(2);
} else {
if (omegafistcharge > 0) {
_root.options2.ldb20.gotoAndStop(1);
} else {
_root.options2.ldb20.gotoAndStop(2);
}
omegafist = true;
if (omegafistcharge > 0) {
omegafistcharge--;
}
if (_root.options2.ldb20.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 200,000XP ---\rOmega Fist\rUNLOCKED!";
_root.options2.ldb20.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
}
if (experience < 50000) {
_root.options2.ldb18.locked.gotoAndStop(2);
} else {
if (catapultcharge > 0) {
_root.options2.ldb18.gotoAndStop(1);
} else {
_root.options2.ldb18.gotoAndStop(2);
if (_global.tip8 == 0) {
_root.options2.ldb17.gotoAndStop(2);
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(9);
pausegame = true;
_global.tip8 = 1;
}
}
catapult = true;
if (catapultcharge > 0) {
catapultcharge--;
}
if (_root.options2.ldb18.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 50,000XP ---\rBattle Catapult\rUNLOCKED!";
_root.options2.ldb18.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
}
if (experience < 100000) {
_root.options2.ldb19.locked.gotoAndStop(2);
} else {
if (shadowdemoncharge > 0) {
_root.options2.ldb19.gotoAndStop(1);
} else {
_root.options2.ldb19.gotoAndStop(2);
}
if (shadowdemoncharge > 0) {
shadowdemoncharge--;
}
if (_root.options2.ldb19.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 100,000XP ---\rShadow Demon\rUNLOCKED!";
_root.options2.ldb19.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
}
if (experience < 25000) {
_root.options2.ldb17.locked.gotoAndStop(2);
} else {
if (stormcharge > 0) {
_root.options2.ldb17.gotoAndStop(1);
} else {
_root.options2.ldb17.gotoAndStop(2);
}
storm = true;
if (stormcharge > 0) {
stormcharge--;
if (_global.tip7 == 0) {
_root.options2.ldb17.gotoAndStop(2);
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(8);
pausegame = true;
_global.tip7 = 1;
}
}
if (_root.options2.ldb17.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 25,000XP ---\rLightning Storm\rUNLOCKED!";
_root.options2.ldb17.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
}
if ((experience < 300000) or (_global.meteor < 1)) {
_root.options2.ldb21.locked.gotoAndStop(2);
} else {
if (meteorcharge > 0) {
_root.options2.ldb21.gotoAndStop(1);
} else {
_root.options2.ldb21.gotoAndStop(2);
}
meteor = true;
if (meteorcharge > 0) {
meteorcharge--;
}
if (_root.options2.ldb21.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 300,000XP ---\rMeteor Storm\rUNLOCKED!";
_root.options2.ldb21.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
}
if (experience < 6000) {
_root.options2.ldb4.locked.gotoAndStop(2);
_root.herodashboard.ldb4.locked.gotoAndStop(2);
} else if (_root.options2.ldb4.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 6000XP ---\rCall Chief\rUNLOCKED!";
_root.options2.ldb4.locked.gotoAndStop(1);
_root.herodashboard.ldb4.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
if ((experience < 150000) or (_global.grow < 1)) {
_root.options2.ldb23.locked.gotoAndStop(2);
} else {
if (growcharge > 0) {
_root.options2.ldb23.gotoAndStop(1);
} else {
_root.options2.ldb23.gotoAndStop(2);
}
grow = true;
if (growcharge > 0) {
growcharge--;
}
if (_root.options2.ldb23.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 150,000XP ---\rGrow Spell\rUNLOCKED!";
_root.options2.ldb23.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
}
if ((experience < 75000) or (_global.bloodlust < 1)) {
_root.options2.ldb25.locked.gotoAndStop(2);
} else {
if (bloodlustcharge > 0) {
_root.options2.ldb25.gotoAndStop(1);
} else {
_root.options2.ldb25.gotoAndStop(2);
}
if (bloodlustcharge > 0) {
bloodlustcharge--;
}
if (_root.options2.ldb25.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 75,000XP ---\rBlood Lust Spell\rUNLOCKED!";
_root.options2.ldb25.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
}
if ((experience < 40000) or (_global.heal < 1)) {
_root.options2.ldb27.locked.gotoAndStop(2);
} else {
if (healcharge > 0) {
_root.options2.ldb27.gotoAndStop(1);
} else {
_root.options2.ldb27.gotoAndStop(2);
}
if (healcharge > 0) {
healcharge--;
}
if (_root.options2.ldb27.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 40,000XP ---\rHeal Spell\rUNLOCKED!";
_root.options2.ldb27.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
}
}
function turretshooting() {
if (!gameover) {
var _local1 = 1;
while (_local1 < 3) {
if (char[_local1 * 1000].shooting > 0) {
shoot(_local1 * 1000, char[_local1 * 1000].rtarget);
} else {
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
var _local3 = 0;
if (char[_local2].active) {
if (char[_local1 * 1000].team != char[_local2].team) {
if (char[_local2].unit == "dragon") {
_local3 = 200;
}
if (getDist(game["tower" + _local1]._x, 100, game["unit" + _local2]._x, game["unit" + _local2]._y) < (char[_local1 * 1000].range + _local3)) {
char[_local1 * 1000].shooting = 5;
shoot(_local1 * 1000, _local2);
char[_local1 * 1000].rtarget = _local2;
break;
}
char[_local1 * 1000].rtarget = 0;
char[_local1 * 1000].shooting = 0;
}
}
_local2++;
}
}
_local1++;
}
}
}
function formatAsDollars(amount) {
if (isNaN(amount)) {
return("$0.00");
}
amount = Math.round(amount * 100) / 100;
var _local6 = String(amount);
var _local3 = _local6.split(".");
if (_local3[1] == undefined) {
_local3[1] = "00";
}
if (_local3[1].length == 1) {
_local3[1] = _local3[1] + "0";
}
var _local4 = new Array();
var _local2;
var _local1 = _local3[0].length;
while (_local1 > 0) {
_local2 = Math.max(_local1 - 3, 0);
_local4.unshift(_local3[0].slice(_local2, _local1));
_local1 = _local2;
}
_local3[0] = _local4.join(",");
return(_local3[0]);
}
function treefade(n) {
var _local3 = false;
var _local1 = 1;
while (_local1 < (maxmen + 1)) {
if (char[_local1].unit != "dragon") {
if ((currentMap == 6) or (currentMap == 12)) {
if (n == 1) {
if ((game.fronttrees["t" + n]._x + 1150) > game["unit" + _local1]._x) {
if ((game.fronttrees["t" + n]._x - 10) < game["unit" + _local1]._x) {
_local3 = true;
}
}
}
} else if ((game.fronttrees["t" + n]._x + 80) > game["unit" + _local1]._x) {
if ((game.fronttrees["t" + n]._x - 80) < game["unit" + _local1]._x) {
_local3 = true;
}
}
}
_local1++;
}
if (_local3) {
game.fronttrees["t" + n]._alpha = 35;
} else {
game.fronttrees["t" + n]._alpha = 100;
}
}
function clearmenu() {
if (_xmouse > 350) {
_root.options2.removeMovieClip();
}
if (_ymouse < 300) {
}
}
function setAIArmies() {
armies[0] = {slave:3, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
trace("first instance = " + armies[0].slave);
if (currentMap == 2) {
armies[1] = {slave:3, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[2] = {slave:4, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[3] = {slave:4, archer:3, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[4] = {slave:2, archer:3, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[5] = {slave:0, archer:2, soldier:2, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[6] = {slave:0, archer:2, soldier:3, assassin:1, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[7] = {slave:0, archer:2, soldier:0, assassin:3, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[8] = {slave:0, archer:1, soldier:0, assassin:5, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[9] = {slave:0, archer:0, soldier:0, assassin:3, wizard:4, wolfrider:0, spiderrider:0, drake:0};
armies[10] = {slave:0, archer:0, soldier:0, assassin:2, wizard:4, wolfrider:1, spiderrider:0, drake:0};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:2, wolfrider:3, spiderrider:0, drake:0};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:5, spiderrider:1, drake:0};
armies[13] = {slave:4, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[14] = {slave:6, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[15] = {slave:6, archer:4, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[16] = {slave:3, archer:5, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[17] = {slave:0, archer:3, soldier:3, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[18] = {slave:0, archer:3, soldier:4, assassin:1, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[19] = {slave:0, archer:2, soldier:0, assassin:4, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[20] = {slave:0, archer:1, soldier:0, assassin:7, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[21] = {slave:0, archer:0, soldier:0, assassin:5, wizard:6, wolfrider:0, spiderrider:0, drake:0};
armies[22] = {slave:0, archer:0, soldier:0, assassin:3, wizard:6, wolfrider:1, spiderrider:0, drake:0};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:3, wolfrider:3, spiderrider:0, drake:0};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:7, spiderrider:1, drake:0};
armies[25] = {slave:6, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[26] = {slave:8, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[27] = {slave:8, archer:6, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[28] = {slave:4, archer:6, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[29] = {slave:0, archer:4, soldier:4, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[30] = {slave:0, archer:4, soldier:6, assassin:2, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[31] = {slave:0, archer:3, soldier:0, assassin:4, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[32] = {slave:0, archer:2, soldier:0, assassin:10, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[33] = {slave:0, archer:0, soldier:0, assassin:6, wizard:8, wolfrider:0, spiderrider:0, drake:0};
armies[34] = {slave:0, archer:0, soldier:0, assassin:4, wizard:8, wolfrider:2, spiderrider:0, drake:0};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:4, wolfrider:6, spiderrider:0, drake:0};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:10, spiderrider:2, drake:0};
// unexpected jump
}
if (currentMap < 3) {
armies[1] = {slave:3, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
trace("2nd instance = " + armies[1].slave);
armies[2] = {slave:4, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[3] = {slave:2, archer:3, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[4] = {slave:0, archer:2, soldier:3, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[5] = {slave:0, archer:2, soldier:2, assassin:1, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[6] = {slave:0, archer:2, soldier:0, assassin:3, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[7] = {slave:0, archer:0, soldier:0, assassin:6, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[8] = {slave:0, archer:0, soldier:5, assassin:0, wizard:3, wolfrider:0, spiderrider:0, drake:0};
armies[9] = {slave:0, archer:0, soldier:0, assassin:3, wizard:4, wolfrider:2, spiderrider:0, drake:0};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:4, wolfrider:5, spiderrider:0, drake:0};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:5, spiderrider:4, drake:0};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:3, spiderrider:5, drake:3};
armies[13] = {slave:6, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[14] = {slave:9, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[15] = {slave:4, archer:7, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[16] = {slave:0, archer:5, soldier:7, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[17] = {slave:0, archer:5, soldier:5, assassin:3, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[18] = {slave:0, archer:5, soldier:0, assassin:8, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[19] = {slave:0, archer:0, soldier:0, assassin:12, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[20] = {slave:0, archer:0, soldier:7, assassin:0, wizard:5, wolfrider:0, spiderrider:0, drake:0};
armies[21] = {slave:0, archer:0, soldier:0, assassin:3, wizard:8, wolfrider:4, spiderrider:0, drake:0};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:7, wolfrider:8, spiderrider:0, drake:0};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:10, spiderrider:5, drake:0};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:6, drake:4};
armies[25] = {slave:9, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[26] = {slave:13, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[27] = {slave:9, archer:6, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[28] = {slave:0, archer:6, soldier:9, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[29] = {slave:0, archer:8, soldier:6, assassin:5, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[30] = {slave:0, archer:7, soldier:0, assassin:10, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[31] = {slave:0, archer:0, soldier:0, assassin:18, wizard:0, wolfrider:0, spiderrider:0, drake:0};
armies[32] = {slave:0, archer:0, soldier:12, assassin:0, wizard:6, wolfrider:0, spiderrider:0, drake:0};
armies[33] = {slave:0, archer:0, soldier:0, assassin:5, wizard:10, wolfrider:3, spiderrider:0, drake:0};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:8, wolfrider:12, spiderrider:2, drake:0};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:12, spiderrider:8, drake:1};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:9, spiderrider:9, drake:5};
// unexpected jump
}
if (currentMap < 5) {
armies[1] = {slave:5, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[2] = {slave:4, archer:2, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[3] = {slave:0, archer:3, soldier:4, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[4] = {slave:0, archer:3, soldier:3, assassin:2, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[5] = {slave:0, archer:2, soldier:0, assassin:5, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[6] = {slave:0, archer:0, soldier:0, assassin:5, wizard:3, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[7] = {slave:0, archer:0, soldier:0, assassin:6, wizard:4, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:4, wolfrider:3, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:3, wolfrider:5, spiderrider:2, drake:0, dragon:0, lionrider:0};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:5, spiderrider:4, drake:0, dragon:0, lionrider:0};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:6, spiderrider:4, drake:0, dragon:0, lionrider:0};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:5, spiderrider:4, drake:3, dragon:0, lionrider:0};
armies[13] = {slave:5, archer:0, soldier:4, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[14] = {slave:6, archer:3, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[15] = {slave:0, archer:5, soldier:6, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[16] = {slave:0, archer:5, soldier:5, assassin:3, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[17] = {slave:0, archer:3, soldier:0, assassin:8, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[18] = {slave:0, archer:0, soldier:0, assassin:8, wizard:5, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[19] = {slave:0, archer:0, soldier:0, assassin:9, wizard:6, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:9, wolfrider:7, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:5, wolfrider:6, spiderrider:5, drake:0, dragon:0, lionrider:0};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:7, spiderrider:6, drake:0, dragon:0, lionrider:0};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:8, spiderrider:7, drake:0, dragon:0, lionrider:0};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:9, spiderrider:4, drake:6, dragon:0, lionrider:0};
armies[25] = {slave:7, archer:0, soldier:5, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[26] = {slave:8, archer:4, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[27] = {slave:0, archer:6, soldier:8, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[28] = {slave:0, archer:6, soldier:6, assassin:4, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[29] = {slave:0, archer:4, soldier:0, assassin:10, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[30] = {slave:0, archer:0, soldier:0, assassin:10, wizard:6, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[31] = {slave:0, archer:0, soldier:0, assassin:12, wizard:8, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:8, wolfrider:6, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:6, wolfrider:8, spiderrider:4, drake:0, dragon:0, lionrider:0};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:9, spiderrider:8, drake:0, dragon:0, lionrider:0};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:12, spiderrider:8, drake:0, dragon:0, lionrider:0};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:8, spiderrider:2, drake:6, dragon:0, lionrider:0};
// unexpected jump
}
if (currentMap == 6) {
armies[1] = {slave:0, archer:0, soldier:0, assassin:6, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:0, babywing:0};
armies[1] = {slave:0, archer:0, soldier:0, assassin:8, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:0, babywing:0};
armies[2] = {slave:0, archer:0, soldier:0, assassin:10, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:0, babywing:0};
armies[3] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:0};
armies[4] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:2, babywing:0};
armies[5] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:3, babywing:0};
armies[6] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:1};
armies[7] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:3, babywing:1};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:1};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:1};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:1};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:1};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:1};
armies[13] = {slave:0, archer:0, soldier:0, assassin:8, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:0, babywing:0};
armies[14] = {slave:0, archer:0, soldier:0, assassin:10, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:0, babywing:0};
armies[15] = {slave:0, archer:0, soldier:0, assassin:12, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:0, babywing:0};
armies[16] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:0};
armies[17] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:2, babywing:0};
armies[18] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:3, babywing:1};
armies[19] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:3, babywing:1};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:4, babywing:1};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:4, babywing:1};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:5, babywing:1};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:5, babywing:1};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:5, babywing:1};
armies[25] = {slave:0, archer:0, soldier:0, assassin:10, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:0, babywing:0};
armies[26] = {slave:0, archer:0, soldier:0, assassin:12, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:0, babywing:0};
armies[27] = {slave:0, archer:0, soldier:0, assassin:14, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:0};
armies[28] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:1, babywing:0};
armies[29] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:2, babywing:0};
armies[30] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:3, babywing:1};
armies[31] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:4, babywing:1};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:5, babywing:1};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:6, babywing:1};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:6, babywing:1};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:6, babywing:1};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, babydemon:6, babywing:2};
// unexpected jump
}
if (currentMap == 7) {
armies[1] = {slave:0, archer:0, soldier:5, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[2] = {slave:0, archer:2, soldier:4, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[3] = {slave:0, archer:0, soldier:0, assassin:4, wizard:3, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[4] = {slave:0, archer:0, soldier:0, assassin:0, wizard:3, wolfrider:6, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[5] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:6, spiderrider:2, drake:1, dragon:0, lionrider:0};
armies[6] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:4, drake:2, dragon:0, lionrider:0};
armies[7] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:4, dragon:0, lionrider:0};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:6, dragon:0, lionrider:0};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:1, drake:6, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:7, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:8, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:9, dragon:0, lionrider:0, battletroll:1, golem:1};
armies[13] = {slave:0, archer:0, soldier:8, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[14] = {slave:0, archer:4, soldier:6, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[15] = {slave:0, archer:0, soldier:0, assassin:6, wizard:5, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[16] = {slave:0, archer:0, soldier:0, assassin:0, wizard:5, wolfrider:9, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[17] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:9, spiderrider:3, drake:0, dragon:0, lionrider:2};
armies[18] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:3, spiderrider:2, drake:3, dragon:0, lionrider:3};
armies[19] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:6, dragon:0, lionrider:0};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:3, drake:6, dragon:0, lionrider:0};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:2, drake:7, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:9, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:10, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:3, drake:12, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[25] = {slave:0, archer:0, soldier:10, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[26] = {slave:0, archer:4, soldier:8, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[27] = {slave:0, archer:0, soldier:0, assassin:8, wizard:6, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[28] = {slave:0, archer:0, soldier:0, assassin:0, wizard:6, wolfrider:12, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[29] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:12, spiderrider:4, drake:0, dragon:0, lionrider:0};
armies[30] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:4, drake:4, dragon:0, lionrider:0};
armies[31] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:8, dragon:0, lionrider:0};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:9, dragon:0, lionrider:0};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:4, drake:11, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:12, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:13, dragon:0, lionrider:0, battletroll:0, golem:0};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:14, dragon:0, lionrider:0, battletroll:0, golem:0};
// unexpected jump
}
if (currentMap == 8) {
armies[1] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:2, largelion:0};
armies[2] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:3, largelion:0};
armies[3] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:0};
armies[4] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:1};
armies[5] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:2, lion:4, largelion:1};
armies[6] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:4, lion:3, largelion:3};
armies[7] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:4, lion:0, largelion:4};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:0, elitelionrider:5, lion:0, largelion:4};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:6, lion:0, largelion:4};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:7, lion:0, largelion:3};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:8, lion:0, largelion:2};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:0, elitelionrider:9, lion:0, largelion:1};
armies[13] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:2, largelion:0};
armies[14] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:3, largelion:0};
armies[15] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:0};
armies[16] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:1};
armies[17] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:2, lion:4, largelion:1};
armies[18] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:4, lion:3, largelion:3};
armies[19] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:4, lion:0, largelion:4};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:0, elitelionrider:5, lion:0, largelion:4};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:6, lion:0, largelion:4};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:7, lion:0, largelion:3};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:8, lion:0, largelion:2};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:0, elitelionrider:9, lion:0, largelion:1};
armies[25] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:3, largelion:0};
armies[26] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:0};
armies[27] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:5, largelion:0};
armies[28] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:6, largelion:1};
armies[29] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:2, lion:6, largelion:2};
armies[30] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:5, lion:5, largelion:5};
armies[31] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:5, lion:0, largelion:5};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:0, elitelionrider:6, lion:0, largelion:5};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:7, lion:0, largelion:5};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:8, lion:0, largelion:4};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:9, lion:0, largelion:3};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:0, elitelionrider:10, lion:0, largelion:2};
} else if (currentMap == 9) {
armies[1] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:0};
armies[2] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:0};
armies[3] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:1};
armies[4] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:1};
armies[5] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:2};
armies[6] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:3};
armies[7] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:3};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:0, elitelionrider:0, lion:0, undeadknight:4};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:4};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:5};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:5};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:6};
armies[13] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:0};
armies[14] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:0};
armies[15] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:1};
armies[16] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:2};
armies[17] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:2};
armies[18] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:3};
armies[19] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:3};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:0, elitelionrider:0, lion:0, undeadknight:4};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:5};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:6};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:7};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:8};
armies[25] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:0};
armies[26] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:1};
armies[27] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:2};
armies[28] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:3};
armies[29] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:4};
armies[30] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:5};
armies[31] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:0, undeadknight:5};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:0, elitelionrider:0, lion:0, undeadknight:6};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:7};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:8};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:9};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:0, elitelionrider:0, lion:0, undeadknight:10, battletroll:0, golem:0};
} else if (currentMap == 10) {
armies[1] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:2, largelion:0};
armies[2] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:3, largelion:0};
armies[3] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:0};
armies[4] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:1};
armies[5] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:2, lion:4, largelion:1};
armies[6] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:4, lion:3, largelion:3};
armies[7] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:4, lion:0, largelion:4};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:0, elitelionrider:5, lion:0, largelion:4};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:6, lion:0, largelion:4};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:7, lion:0, largelion:3};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:8, lion:0, largelion:2};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:0, elitelionrider:9, lion:0, largelion:1};
armies[13] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:2, largelion:0};
armies[14] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:3, largelion:0};
armies[15] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:0};
armies[16] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:1};
armies[17] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:2, lion:4, largelion:1};
armies[18] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:4, lion:3, largelion:3};
armies[19] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:4, lion:0, largelion:4};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:0, elitelionrider:5, lion:0, largelion:4};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:6, lion:0, largelion:4};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:7, lion:0, largelion:3};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:8, lion:0, largelion:2};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:0, elitelionrider:9, lion:0, largelion:1};
armies[25] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:3, largelion:0};
armies[26] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:4, largelion:0};
armies[27] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:5, largelion:0};
armies[28] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0, lion:6, largelion:1};
armies[29] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:2, lion:6, largelion:2};
armies[30] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:5, lion:5, largelion:5};
armies[31] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:5, lion:0, largelion:5};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:0, elitelionrider:6, lion:0, largelion:5};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:7, lion:0, largelion:5};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:8, lion:0, golem:4};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:8, lion:0, golem:5};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:0, elitelionrider:8, lion:0, largelion:0, battletroll:0, golem:6};
} else if (currentMap == 11) {
armies[1] = {slave:0, archer:0, soldier:5, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[2] = {slave:0, archer:2, soldier:4, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[3] = {slave:0, archer:0, soldier:0, assassin:4, wizard:3, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[4] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:6, spiderrider:3, drake:0, dragon:0, lionrider:0};
armies[5] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:2, drake:2, dragon:0, elitelionrider:2};
armies[6] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:4, dragon:1, elitelionrider:4};
armies[7] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:4, dragon:1, elitelionrider:4};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:3, dragon:3, lionrider:0, battletroll:1, golem:0};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:0, dragon:3, lionrider:0, battletroll:2, golem:0};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:2, dragon:3, lionrider:0, battletroll:3, golem:0};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:1, drake:1, dragon:3, lionrider:0, battletroll:4, golem:0};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:1, drake:0, dragon:4, lionrider:0, battletroll:4, golem:1};
armies[13] = {slave:0, archer:0, soldier:8, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[14] = {slave:0, archer:4, soldier:6, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[15] = {slave:0, archer:0, soldier:0, assassin:6, wizard:5, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[16] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:9, spiderrider:5, drake:0, dragon:0, lionrider:0};
armies[17] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:3, drake:4, dragon:0, lionrider:2};
armies[18] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:6, dragon:1, elitelionrider:3};
armies[19] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:6, dragon:2, elitelionrider:6, battletroll:1, golem:0};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:2, dragon:4, elitelionrider:3, battletroll:2, golem:0};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:1, drake:0, dragon:4, elitelionrider:2, battletroll:3, golem:0};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:9, dragon:3, lionrider:0, battletroll:4, golem:0};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:5, dragon:5, lionrider:0, battletroll:5, golem:1};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:6, lionrider:0, battletroll:6, golem:2};
armies[25] = {slave:0, archer:0, soldier:8, assassin:2, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[26] = {slave:0, archer:4, soldier:4, assassin:4, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[27] = {slave:0, archer:0, soldier:0, assassin:4, wizard:4, wolfrider:2, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[28] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:8, spiderrider:4, drake:1, dragon:0, elitelionrider:4};
armies[29] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:4, dragon:0, elitelionrider:4, battletroll:0, golem:0};
armies[30] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:4, drake:4, dragon:1, elitelionrider:4, battletroll:1, golem:0};
armies[31] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:6, dragon:2, elitelionrider:0, battletroll:1, golem:0};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:4, dragon:2, elitelionrider:0, battletroll:1, golem:0};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:4, dragon:2, elitelionrider:4, battletroll:3, golem:1};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:4, elitelionrider:0, battletroll:4, golem:2};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:6, elitelionrider:0, battletroll:6, golem:3};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:8, elitelionrider:0, battletroll:8, golem:4};
} else if (currentMap == 12) {
armies[1] = {slave:0, archer:0, soldier:5, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[2] = {slave:0, archer:2, soldier:4, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[3] = {slave:0, archer:0, soldier:0, assassin:4, wizard:3, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[4] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:6, spiderrider:3, drake:0, dragon:0, lionrider:0};
armies[5] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:2, drake:2, dragon:0, elitelionrider:2};
armies[6] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:4, dragon:1, elitelionrider:4};
armies[7] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:4, dragon:1, elitelionrider:4};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:3, dragon:3, lionrider:0, battletroll:1, golem:0};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:0, dragon:3, lionrider:0, battletroll:2, golem:0};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:2, dragon:3, lionrider:0, battletroll:3, golem:0};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:1, drake:1, dragon:3, lionrider:0, battletroll:4, golem:0};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:1, drake:0, dragon:4, lionrider:0, battletroll:4, golem:1};
armies[13] = {slave:0, archer:0, soldier:8, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[14] = {slave:0, archer:4, soldier:6, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[15] = {slave:0, archer:0, soldier:0, assassin:6, wizard:5, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[16] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:9, spiderrider:5, drake:0, dragon:0, lionrider:0};
armies[17] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:3, drake:4, dragon:0, elitelionrider:2};
armies[18] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:6, dragon:1, elitelionrider:3};
armies[19] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:6, dragon:2, elitelionrider:6, battletroll:1, golem:0};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:2, dragon:4, elitelionrider:3, battletroll:2, golem:0};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:1, drake:0, dragon:4, elitelionrider:2, battletroll:3, golem:0};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:9, dragon:3, elitelionrider:0, battletroll:4, golem:0};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:5, dragon:5, elitelionrider:0, battletroll:5, golem:1, undeadknight:1};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:6, elitelionrider:0, battletroll:6, golem:2, undeadknight:2};
armies[25] = {slave:0, archer:0, soldier:8, assassin:2, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0};
armies[26] = {slave:0, archer:4, soldier:4, assassin:4, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, elitelionrider:0};
armies[27] = {slave:0, archer:0, soldier:0, assassin:4, wizard:4, wolfrider:2, spiderrider:0, drake:0, dragon:0, elitelionrider:0};
armies[28] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:8, spiderrider:4, drake:1, dragon:0, elitelionrider:4};
armies[29] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:4, dragon:0, elitelionrider:4, battletroll:0, golem:0};
armies[30] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:4, drake:4, dragon:1, elitelionrider:4, battletroll:1, golem:0};
armies[31] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:6, dragon:2, elitelionrider:0, battletroll:1, golem:0};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:4, dragon:2, elitelionrider:0, battletroll:1, golem:0};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:4, dragon:2, elitelionrider:4, battletroll:3, golem:1};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:4, elitelionrider:0, battletroll:4, golem:2, undeadknight:1};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:6, elitelionrider:0, battletroll:6, golem:1, undeadknight:2};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:8, elitelionrider:0, battletroll:8, golem:0, undeadknight:5};
} else if (currentMap == 13) {
armies[1] = {slave:0, archer:0, soldier:5, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[2] = {slave:0, archer:2, soldier:4, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[3] = {slave:0, archer:0, soldier:0, assassin:4, wizard:3, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[4] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:6, spiderrider:3, drake:0, dragon:0, lionrider:0};
armies[5] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:2, drake:2, dragon:0, elitelionrider:2};
armies[6] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:4, dragon:1, elitelionrider:4};
armies[7] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:4, dragon:1, elitelionrider:4};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:3, dragon:1, lionrider:0, battletroll:1, golem:0};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:2, golem:0};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:2, dragon:1, lionrider:0, battletroll:3, golem:0};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:1, drake:1, dragon:1, lionrider:0, battletroll:4, golem:0};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:1, drake:0, dragon:1, lionrider:0, battletroll:5, golem:0};
armies[13] = {slave:0, archer:0, soldier:8, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[14] = {slave:0, archer:4, soldier:6, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[15] = {slave:0, archer:0, soldier:0, assassin:6, wizard:5, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[16] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:9, spiderrider:5, drake:0, dragon:0, lionrider:0};
armies[17] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:3, drake:4, dragon:0, elitelionrider:2};
armies[18] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:6, dragon:1, elitelionrider:3};
armies[19] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:6, dragon:1, elitelionrider:6, battletroll:1, golem:0};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:2, dragon:1, elitelionrider:3, battletroll:2, golem:0};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:0, dragon:1, elitelionrider:2, battletroll:3, golem:0};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:4, golem:0};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:6, golem:1};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:9, golem:0};
armies[25] = {slave:0, archer:0, soldier:8, assassin:2, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[26] = {slave:0, archer:4, soldier:4, assassin:4, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[27] = {slave:0, archer:0, soldier:0, assassin:4, wizard:4, wolfrider:2, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[28] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:8, spiderrider:4, drake:1, dragon:0, elitelionrider:4};
armies[29] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:4, dragon:0, elitelionrider:4, battletroll:0, golem:0};
armies[30] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:0, dragon:1, elitelionrider:4, battletroll:1, golem:0};
armies[31] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:1, golem:0};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:2, golem:0};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, elitelionrider:4, battletroll:6, golem:0};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:9, golem:0, undeadknight:2, babywing:0};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:10, golem:0, undeadknight:3, babywing:1};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:14, golem:0, undeadknight:4, babywing:2};
} else {
armies[1] = {slave:0, archer:0, soldier:5, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[2] = {slave:0, archer:2, soldier:4, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[3] = {slave:0, archer:0, soldier:0, assassin:4, wizard:3, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[4] = {slave:0, archer:0, soldier:0, assassin:0, wizard:3, wolfrider:6, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[5] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:6, spiderrider:2, drake:0, dragon:0, lionrider:1};
armies[6] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:4, drake:2, dragon:0, lionrider:2};
armies[7] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:4, dragon:0, lionrider:4};
armies[8] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:1, dragon:1, lionrider:9};
armies[9] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:1, drake:0, dragon:1, lionrider:2, battletroll:1, golem:0};
armies[10] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:6, dragon:2, lionrider:0, battletroll:1, golem:0};
armies[11] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:3, dragon:3, lionrider:0, battletroll:3, golem:0};
armies[12] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:0, dragon:4, lionrider:0, battletroll:4, golem:1};
armies[13] = {slave:0, archer:0, soldier:8, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[14] = {slave:0, archer:4, soldier:6, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[15] = {slave:0, archer:0, soldier:0, assassin:6, wizard:5, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[16] = {slave:0, archer:0, soldier:0, assassin:0, wizard:5, wolfrider:9, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[17] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:9, spiderrider:3, drake:0, dragon:0, lionrider:2};
armies[18] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:3, spiderrider:2, drake:3, dragon:0, lionrider:3};
armies[19] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:2, drake:6, dragon:0, lionrider:6};
armies[20] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:3, drake:2, dragon:2, lionrider:6};
armies[21] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:2, drake:0, dragon:2, lionrider:5, battletroll:2, golem:0};
armies[22] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:2, spiderrider:0, drake:9, dragon:3, lionrider:0, battletroll:2, golem:0};
armies[23] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:5, dragon:5, lionrider:0, battletroll:3, golem:0};
armies[24] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:3, drake:0, dragon:6, lionrider:0, battletroll:6, golem:2};
armies[25] = {slave:0, archer:0, soldier:10, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[26] = {slave:0, archer:4, soldier:8, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[27] = {slave:0, archer:0, soldier:0, assassin:8, wizard:6, wolfrider:0, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[28] = {slave:0, archer:0, soldier:0, assassin:0, wizard:6, wolfrider:12, spiderrider:0, drake:0, dragon:0, lionrider:0};
armies[29] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:12, spiderrider:4, drake:0, dragon:0, lionrider:2};
armies[30] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:4, drake:4, dragon:0, lionrider:4};
armies[31] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:8, dragon:1, lionrider:8};
armies[32] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:4, drake:2, dragon:1, lionrider:4};
armies[33] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:4, spiderrider:4, drake:0, dragon:1, lionrider:4, battletroll:2, golem:0};
armies[34] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:2, golem:0};
armies[35] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:6, dragon:1, lionrider:0, battletroll:6, golem:1};
armies[36] = {slave:0, archer:0, soldier:0, assassin:0, wizard:0, wolfrider:0, spiderrider:0, drake:0, dragon:1, lionrider:0, battletroll:8, golem:2};
}
}
function heroAI() {
heroAICount++;
if (heroAICount > ((15000 * (1 - (currentMap / 35))) - (2000 * difficulty))) {
if (heroAIOut) {
if (char[heroAINumber].stuncount > 0) {
heroAIFlee = false;
} else if (!heroAIFlee) {
if ((char[heroAINumber].hpCurrent < 50) or (char[heroAINumber].hpCurrent < (char[heroAINumber].hpMax * 0.05))) {
fleeing(2);
}
if (_global.AIchief == "chief2") {
if (AIshieldon < 1) {
AIshielding();
}
} else if (AIstompdown == 0) {
AIstompcount++;
if (AIstompcount > 50) {
AIstompcount = 0;
var _local3 = 0;
trace("we are getting here STOMP!!!");
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if ((char[_local2].team == 1) and (char[_local2].hpCurrent > 0)) {
if (char[_local2].unit != "dragon") {
if (Math.abs(game["unit" + _local2]._x - game["unit" + heroAINumber]._x) < 250) {
trace("dist = " + Math.abs(game["unit" + _local2]._x - game["unit" + heroAINumber]._x));
_local3++;
}
}
}
_local2++;
}
if (_local3 > 4) {
trace("overfour");
AIherostomp();
}
}
}
if (_global.AIchief == "chief4") {
if (AImorphon < 1) {
AImorphing();
}
} else if (AIbloodon < 1) {
AIbloodlusting();
}
if (_global.AIchief == "chief") {
if (AIknockon < 1) {
AIKnocking();
}
}
if (heroAILevel > 3) {
if (AIfuryfirecount > 0) {
AIfuryfirecount--;
char[heroAINumber].ranged = true;
char[heroAINumber].range = 300;
char[heroAINumber].mtarget = 0;
char[heroAINumber].mcount = 0;
} else {
if ((_global.AIchief != "chief6") and (_global.AIchief != "chief2")) {
char[heroAINumber].ranged = false;
char[heroAINumber].range = 0;
char[heroAINumber].shooting = 0;
}
AIfuryfirecharge--;
if (AIfuryfirecharge < 0) {
AIfuryfirecharge = 1200;
AIfuryfirecount = 500;
}
}
} else {
AIfuryfirecharge = 1200;
}
} else {
trace("checking here each time");
char[heroAINumber].mtarget = 0;
char[heroAINumber].queued = false;
char[heroAINumber].melee = false;
char[heroAINumber].mcount = 0;
if (game["unit" + heroAINumber]._currentframe > 20) {
game["unit" + heroAINumber].gotoAndPlay(1);
}
trace("char[heroAINumber].mtarget = " + char[heroAINumber].mtarget);
}
} else if (heroAIDeath > 0) {
heroAIDeath--;
} else {
heroAIRestore++;
if (heroAIRestore > 1000) {
createunit(2, "hero");
heroAIOut = true;
}
}
}
}
function fleeing(i) {
if (i == 1) {
char[heronumber].xspeed = -Math.abs(char[heronumber].xspeed);
game["unit" + heronumber]._xscale = 90;
game["unit" + heronumber].gotoAndPlay(1);
char[heronumber].melee = false;
char[heronumber].mcount = 0;
char[heronumber].mtarget = 0;
char[heronumber].starget = 0;
char[heronumber].rtarget = 0;
char[heronumber].shooting = 0;
heroflee = true;
} else {
char[heroAINumber].xspeed = Math.abs(char[heroAINumber].xspeed);
game["unit" + heroAINumber]._xscale = -90;
game["unit" + heroAINumber].gotoAndPlay(1);
char[heroAINumber].melee = false;
char[heroAINumber].mcount = 0;
char[heroAINumber].mtarget = 0;
char[heroAINumber].queued = false;
char[heroAINumber].starget = 0;
char[heroAINumber].rtarget = 0;
char[heroAINumber].shooting = 0;
heroAIFlee = true;
}
}
function populationalign() {
playerpop = 0;
AIpop = 0;
var _local1 = 1;
while (_local1 < (maxmen + 1)) {
if (char[_local1].active) {
if (char[_local1].team == 1) {
if (char[_local1].hpCurrent > 0) {
playerpop++;
}
} else if (char[_local1].hpCurrent > 0) {
AIpop++;
}
}
_local1++;
}
}
function AITowerUpgrades() {
if (AIturretSpeed < 5) {
AIturretSpeed = Math.max((heroAICount - (7000 * (1 - (currentMap / 30)))) / (15000 - (difficulty * 2900)), 0);
}
if (AIturretSize < 5) {
AIturretSize = Math.max((heroAICount - (7500 * (1 - (currentMap / 30)))) / (15000 - (difficulty * 2900)), 0);
}
if (AImultiShot < 5) {
AImultiShot = Math.max((heroAICount - (7000 * (1 - (currentMap / 30)))) / (14000 - (difficulty * 2600)), 0);
}
if (AItowerHP < 5) {
var _local6 = AItowerHP;
AItowerHP = Math.max((heroAICount - (4000 * (1 - (currentMap / 30)))) / (9000 - (difficulty * 2000)), 0);
if (AItowerHP > _local6) {
tower2hpm = tower2hpm + 500;
if (tower2hpm > Math.min(1000 * currentMap, 5000)) {
tower2hpm = Math.min(1000 * currentMap, 5000);
} else {
tower2hp = tower2hp + 500;
}
}
}
if (AIrepairRate < 5) {
AIrepairRate = Math.max((heroAICount - (7000 * (1 - (currentMap / 20)))) / (11000 - (difficulty * 2400)), 0);
}
AICatapultCharge--;
if (AICatapultCharge < 1) {
createunit(2, "catapult");
AICatapultCharge = 5000;
}
AIShadowDemonCharge--;
if (AIShadowDemonCharge < 1) {
createunit(2, "shadowdemon");
AIShadowDemonCharge = 5000;
}
AIFistCharge--;
if (AIFistCharge < 1) {
var _local4 = 0;
var _local3 = 0;
var _local1 = 1;
while (_local1 < 200) {
_local3 = 0;
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].team == 1) {
if (game["unit" + _local2]._x < ((_local1 * 15) + 20)) {
if (game["unit" + _local2]._x > ((_local1 * 15) - 20)) {
_local3++;
if (_local3 > 5) {
_local4 = _local1 * 15;
}
}
}
}
_local2++;
}
_local1++;
}
trace("locationx = " + _local4);
if (_local4 > 0) {
AIFist(_local4);
AIFistCharge = 2500;
} else {
AIFistCharge = 100;
}
}
AIomegafistcharge--;
if (AIomegafistcharge < 1) {
var _local4 = 0;
var _local3 = 0;
var _local1 = 1;
while (_local1 < 200) {
_local3 = 0;
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].team == 1) {
if (game["unit" + _local2]._x < ((_local1 * 15) + 40)) {
if (game["unit" + _local2]._x > ((_local1 * 15) - 40)) {
_local3++;
if (_local3 > 6) {
_local4 = _local1 * 15;
}
}
}
}
_local2++;
}
_local1++;
}
trace("locationx = " + _local4);
if (_local4 > 0) {
AIMegaFist(_local4);
AIomegafistcharge = 10000;
} else {
AIomegafistcharge = 100;
}
}
AIstormcharge--;
if (AIstormcharge < 1) {
var _local5 = 0;
var _local2 = 1;
while (_local2 < (maxmen + 1)) {
if (char[_local2].team == 1) {
if (char[_local2].active) {
_local5++;
if (_local5 > 12) {
AIlightningstorm = true;
}
}
}
_local2++;
}
}
}
function AIUnitUpgrades() {
if (AImeleeWeapons < 5) {
AImeleeWeapons = Math.max((heroAICount - (5000 * (1 - (currentMap / 20)))) / (11000 - (difficulty * 1000)), 0);
}
if (AImeleeArmor < 5) {
AImeleeArmor = Math.max((heroAICount - (6500 * (1 - (currentMap / 20)))) / (11000 - (difficulty * 1000)), 0);
}
if (AIbowDamage < 5) {
AIbowDamage = Math.max((heroAICount - (5500 * (1 - (currentMap / 20)))) / (11000 - (difficulty * 1000)), 0);
}
if (AIrangedArmor < 5) {
AIrangedArmor = Math.max((heroAICount - (7500 * (1 - (currentMap / 20)))) / (11000 - (difficulty * 1000)), 0);
}
if (AIfireballSpell < 5) {
AIfireballSpell = Math.max((heroAICount - (25000 * (1 - (currentMap / 20)))) / (10000 - (difficulty * 1000)), 0);
}
if (AIdrakeGrow < 5) {
AIdrakeGrow = Math.max((heroAICount - (60000 * (1 - (currentMap / 20)))) / (8000 - (difficulty * 1000)), 0);
}
}
function repairTowers() {
repaircount++;
if (repaircount > 20) {
repaircount = 0;
if (tower1hp < tower1hpm) {
tower1hp = tower1hp + ((1 + repairRate) + _global.fortitude);
if (_global.tip9 == 0) {
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(10);
pausegame = true;
_global.tip9 = 1;
}
}
if (tower1hp > tower1hpm) {
tower1hp = tower1hpm;
}
if (tower2hp < tower2hpm) {
tower2hp = tower2hp + (1 + AIrepairRate);
}
if (tower2hp > tower2hpm) {
tower2hp = tower2hpm;
}
}
}
function volumeControl(ix) {
var _local2 = 0;
_local2 = Math.max(100 - (Math.abs((ix + game._x) - 300) / 15), 0) * _global.mainVolume;
return(_local2);
}
function surroundSound(ix) {
var _local2 = 0;
_local2 = Math.min(Math.max(((ix + game._x) - 300) / 4, -100), 100) * _global.mainVolume;
return(_local2);
}
function gameend() {
pausegame = true;
_root.attachMovie("endgame", "endgame", 2125);
_root.endgame._y = 10;
_root.endgame._x = 80;
timecompleted = gamecount / 20;
herobonus = Math.pow(2, herolvl) * Math.pow(1.5, currentMap);
expbonus = Math.min(Math.round((experience * Math.pow(1.3, currentMap)) / 1000), Math.round(5000 * Math.pow(1.5, currentMap)));
repbonus = Math.min(Math.round((reputation * Math.pow(1.5, currentMap)) / 8), Math.round(5000 * Math.pow(1.5, currentMap)));
killbonus = Math.min(Math.round(killbonus * Math.pow(1.5, currentMap)), Math.round(5000 * Math.pow(1.5, currentMap)));
if (tower1hp < 1) {
timebonus = Math.round(timecompleted);
victorybonus = 0;
totalbonus = ((((killbonus + herobonus) + victorybonus) + expbonus) + repbonus) + timebonus;
_root.endgame.gotoAndStop(2);
} else {
if (newgrounds) {
if (currentMap == 4) {
com.newgrounds.API.unlockMedal("Mighty River");
}
if (currentMap == 8) {
com.newgrounds.API.unlockMedal("Great Dunes");
}
if (currentMap == 13) {
com.newgrounds.API.unlockMedal("Supremecy");
}
if (currentMap == 6) {
com.newgrounds.API.unlockMedal("Demon Rise");
}
if (currentMap == 9) {
com.newgrounds.API.unlockMedal("Undead Knights");
}
}
timebonus = Math.max(Math.round(((10000 * currentMap) - timecompleted) / 5), 0);
if (levelscomplete[currentMap] == 0) {
victorybonus = 2000 * Math.pow(2, Math.round(currentMap / 2));
} else {
victorybonus = 500 * Math.pow(2, Math.round(currentMap / 2));
}
totalbonus = ((((killbonus + herobonus) + victorybonus) + expbonus) + repbonus) + timebonus;
_root.endgame.gotoAndStop(1);
}
}
function crowmovement() {
var _local1 = 1;
while (_local1 < 5) {
if (crows[_local1].flying) {
if ((game.backtrees["t" + crows[_local1].treetarget]._x + crows[_local1].xoffset) > (game.backtrees["c" + _local1]._x + 10)) {
game.backtrees["c" + _local1]._x = game.backtrees["c" + _local1]._x + 7;
game.backtrees["c" + _local1]._xscale = Math.abs(game.backtrees["c" + _local1]._xscale);
} else if ((game.backtrees["t" + crows[_local1].treetarget]._x + crows[_local1].xoffset) < (game.backtrees["c" + _local1]._x - 10)) {
game.backtrees["c" + _local1]._x = game.backtrees["c" + _local1]._x - 7;
game.backtrees["c" + _local1]._xscale = -Math.abs(game.backtrees["c" + _local1]._xscale);
} else if ((game.backtrees["t" + crows[_local1].treetarget]._y + crows[_local1].yoffset) < (game.backtrees["c" + _local1]._y + 15)) {
crows[_local1].flying = false;
crows[_local1].randomcount = Math.round(Math.random() * 500);
game.backtrees["c" + _local1].gotoAndStop(1);
} else {
game.backtrees["c" + _local1]._rotation = 0;
}
if (Math.abs((game.backtrees["t" + crows[_local1].treetarget]._x + crows[_local1].xoffset) - game.backtrees["c" + _local1]._x) > 400) {
if (game.backtrees["c" + _local1]._y > crows[_local1].flyhigh) {
game.backtrees["c" + _local1]._y = game.backtrees["c" + _local1]._y - 3;
if (game.backtrees["c" + _local1]._xscale < 0) {
game.backtrees["c" + _local1]._rotation = 15;
} else {
game.backtrees["c" + _local1]._rotation = 345;
}
} else {
game.backtrees["c" + _local1]._rotation = 0;
}
} else if (game.backtrees["c" + _local1]._y < (game.backtrees["t" + crows[_local1].treetarget]._y + crows[_local1].yoffset)) {
game.backtrees["c" + _local1]._y = game.backtrees["c" + _local1]._y + 4;
if (game.backtrees["c" + _local1]._xscale < 0) {
game.backtrees["c" + _local1]._rotation = 345;
} else {
game.backtrees["c" + _local1]._rotation = 15;
}
} else {
game.backtrees["c" + _local1]._rotation = 0;
}
} else {
game.backtrees["c" + _local1]._rotation = 0;
if (crows[_local1].randomcount > 0) {
crows[_local1].randomcount--;
} else {
crows[_local1].flying = true;
crows[_local1].treetarget = Math.round(Math.random() * 9.49) + 1;
crows[_local1].flyhigh = Math.round((Math.random() * 100) - 130);
crows[_local1].xoffset = Math.round((Math.random() * 30) + 30);
crows[_local1].yoffset = Math.round((Math.random() * 30) + 50);
game.backtrees["c" + _local1].gotoAndPlay(10);
}
}
_local1++;
}
}
function posioncontrol() {
var _local1 = 1;
while (_local1 < (maxmen + 1)) {
if (char[_local1].poisoncount > 0) {
char[_local1].poisoncount--;
if (char[_local1].poisoncount > 0) {
if ((char[_local1].poisoncount % 20) == 0) {
char[_local1].hpCurrent = char[_local1].hpCurrent - 2;
game.attachMovie("dmgup", "dmgup" + _local1, 1700 + _local1);
game["dmgup" + _local1]._x = game["unit" + _local1]._x;
game["dmgup" + _local1]._y = game["unit" + _local1]._y - 30;
game["dmgup" + _local1].goldup = 2;
if (char[_local1].team == 2) {
deathcheck(1000, _local1);
} else {
deathcheck(2000, _local1);
}
}
} else {
myPColor = new Color(game["unit" + _local1]);
myPColorTransform = new Object();
myPColorTransform = {rb:0, gb:0, bb:0};
myPColor.setTransform(myPColorTransform);
}
}
_local1++;
}
}
function movebackdrop() {
game.mountains2.ship1._x = game.mountains2.ship1._x + 0.6;
game.mountains2.ship2._x = game.mountains2.ship2._x + 0.3;
if (game.mountains2.ship1._x > 1700) {
game.mountains2.ship1._x = -150;
}
if (game.mountains2.ship2._x > 1700) {
game.mountains2.ship2._x = -100;
}
game.mountains2.ship3._x = game.mountains2.ship3._x - 0.5;
game.mountains2.ship4._x = game.mountains2.ship4._x - 0.15;
if (game.mountains2.ship3._x < -200) {
game.mountains2.ship3._x = 1700;
}
if (game.mountains2.ship4._x < -200) {
game.mountains2.ship4._x = 1700;
}
}
function doTrail(container, targetX, targetY, type) {
var _local4 = flash.display.BitmapData.loadBitmap(currentBitmap);
var _local2 = container.createEmptyMovieClip("main_holder" + container.getNextHighestDepth(), container.getNextHighestDepth());
var _local3 = _local2.createEmptyMovieClip("internal_holder", _local2.getNextHighestDepth());
_local3._x = (-_local4.width) / 2;
_local3._y = (-_local4.height) / 2;
_local3.attachBitmap(_local4, _local3.getNextHighestDepth());
_local2._x = (targetX + random(4)) - 8;
_local2._y = (targetY + random(4)) - 8;
_local2._rotation = random(360);
var _local5 = random(50) + 50;
_local2._xscale = _local5;
_local2._yscale = _local5;
_local2.speed = random(5) + 3;
_local2.onEnterFrame = function () {
this._xscale = this._xscale + this.speed;
this._yscale = this._yscale + this.speed;
this._y = this._y - this.speed;
this._alpha = this._alpha - this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function extradrop(k) {
if (game["unit" + k]._y >= (char[k].mcy - 10)) {
game["unit" + k]._y = char[k].mcy - 10;
char[k].yspeed = 0;
char[k].hit = true;
} else {
char[k].yspeed = char[k].yspeed + (grav - Math.abs(char[k].momentum / 2));
game["unit" + k]._y = game["unit" + k]._y + char[k].yspeed;
if (char[k].momentum < 0) {
char[k].momentum = char[k].momentum + 0.2;
} else if (char[k].momentum > 0) {
char[k].momentum = char[k].momentum - 0.2;
}
}
char[k].mcy = groundmaker(game["unit" + k]._x);
}
function dragonpopulation() {
dragonpop = 0;
dragonpopAI = 0;
var _local1 = 0;
while (_local1 < (maxmen + 1)) {
if (char[_local1].team == 1) {
if (char[_local1].unit == "dragon") {
if (char[_local1].hpCurrent > 0) {
if (char[_local1].active) {
dragonpop++;
}
}
}
} else if (char[_local1].unit == "dragon") {
if (char[_local1].hpCurrent > 0) {
if (char[_local1].active) {
dragonpopAI++;
}
}
}
_local1++;
}
_local1 = 0;
while (_local1 < 15) {
if (unitcue[_local1].unit == "dragon") {
if (unitcue[_local1].active) {
dragonpop++;
}
}
_local1++;
}
}
function tipmanagement() {
if (_global.tips) {
if (_global.tip1 == 0) {
if (gamecount == 80) {
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(2);
pausegame = true;
_global.tip1 = 1;
}
}
if (_global.tip2 == 0) {
if (experience > 1000) {
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(3);
pausegame = true;
_global.tip2 = 1;
}
}
if (_global.tip3 == 0) {
if (experience > 4000) {
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(4);
pausegame = true;
_global.tip3 = 1;
}
}
if (_global.tip4 == 0) {
if (gamecount == 2000) {
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(5);
pausegame = true;
_global.tip4 = 1;
}
}
}
}
function spellsReady() {
var _local4 = 0;
var _local2 = 1;
while (_local2 < 10) {
switch (_local2) {
case 1 :
_local4 = omegafistcharge;
break;
case 2 :
_local4 = shadowdemoncharge;
break;
case 3 :
_local4 = catapultcharge;
break;
case 4 :
_local4 = stormcharge;
break;
case 5 :
_local4 = fistcharge;
break;
case 6 :
_local4 = meteorcharge;
break;
case 7 :
_local4 = growcharge;
break;
case 8 :
_local4 = bloodlustcharge;
break;
case 9 :
_local4 = healcharge;
break;
default :
_local4 = fistcharge;
}
if (spellsAvailable[_local2] == 0) {
if (_local4 < 1) {
spellsAvailable[_local2] = 1;
var _local3 = 1;
while (_local3 < 10) {
if (spellSlot[_local3] == 0) {
_root.attachMovie("spellAvailability", "spellAvailability" + _local3, 160 + _local3);
_root["spellAvailability" + _local3].gotoAndStop(_local2);
_root["spellAvailability" + _local3]._y = 75;
_root["spellAvailability" + _local3]._x = 25 + (_local3 * 50);
_root.attachMovie("starsparkle", "sp", 170 + _local3);
_root.sp._x = 45 + (_local3 * 50);
_root.sp._y = 75;
spellSlot[_local3] = _local2;
break;
}
_local3++;
}
}
} else if (_local4 > 0) {
spellsAvailable[_local2] = 0;
var _local3 = 1;
while (_local3 < 10) {
if (spellSlot[_local3] == _local2) {
_root["spellAvailability" + _local3].removeMovieClip();
spellSlot[_local3] = 0;
}
_local3++;
}
}
_local2++;
}
}
_root._quality = "High";
musicobject.music.stop();
var doubleclick = 0;
var dccount = 0;
var scrollback = 0;
var visicount = 0;
var timecompleted = 0;
var pausegame = false;
var lx = 0;
var ly = 0;
var oldx = 0;
var oldy = 0;
var grav = 0.6;
var accel = 0;
var drag = 0.1;
var xspeed = 10;
var yspeed = 0;
var momentum = 2;
var jump = 0;
var up = 0;
var count = 0;
var amp = 3;
var wave = 0.0002;
var hyp = 0;
var hit = false;
var addmen = 20;
var windmax = 5;
var treecount = 1;
var treemax = 10;
var difficulty = _global.difficulty;
var framerate = 30;
var intervals = ((40 - (difficulty * 5)) * framerate);
var buildinterval = 25;
var waveLevel = 1;
var wavecount = 1;
var gamecount = 0;
var playerpop = 0;
var AIpop = 0;
var maxpop = 20;
var hittime = 1;
var repaircount = 0;
var currentMap = _global.scene;
var shadowdemon2 = false;
var AIshadowdemon2 = false;
var hotkeycount = 0;
var gainrate = 1.3;
var fiston = false;
var fistcharge = 200;
var fistdown = false;
var fistx = 0;
var omegafiston = false;
var omegafistcharge = 200;
var omegafistdown = false;
var omegafistx = 0;
var maxlightning = 100;
var lightningcount = 0;
var lightningstorm = false;
var storm = false;
var stormcharge = 200;
var catapult = false;
var catapultcharge = 100;
var shadowdemon = false;
var shadowdemoncharge = 100;
var meteorcharge = 100;
var meteor = false;
var maxmeteor = 500;
var meteorcount = 0;
var meteorstorm = false;
var mightyfist = false;
var mightyfistplayer = 1;
var omegafist = false;
var grow = false;
var growon = false;
var growcharge = 200;
var growdown = false;
var growx = 0;
var bloodluston = false;
var bloodlustcharge = 200;
var bloodlusttimer = 0;
var healon = false;
var healcharge = 200;
var healtimer = 0;
var meleeWeapons = 0;
var meleeArmor = 0;
var bowDamage = 0;
var rangedArmor = 0;
var fireballSpell = 0;
var drakeGrow = 0;
var turretSpeed = 0;
var turretSize = 0;
var multiShot = 0;
var towerHP = 0;
var repairRate = 0;
var AImeleeWeapons = 0;
var AImeleeArmor = 0;
var AIbowDamage = 0;
var AIrangedArmor = 0;
var AIfireballSpell = 0;
var AIdrakeGrow = 0;
var AICatapultCharge = ((30000 * (1 - (currentMap / 35))) - (4000 * difficulty));
var AIShadowDemonCharge = ((40000 * (1 - (currentMap / 35))) - (4000 * difficulty));
var AIFistCharge = ((12000 * (1 - (currentMap / 35))) - (1200 * difficulty));
var AIomegafistcharge = ((55000 * (1 - (currentMap / 35))) - (4000 * difficulty));
var AImaxlightning = 100;
var AIlightningcount = 0;
var AIlightningstorm = false;
var AIstorm = false;
var AIstormcharge = ((20000 * (1 - (currentMap / 35))) - (2500 * difficulty));
var AIfuryfirecount = 0;
var AIfuryfirecharge = 1000;
var AIturretSpeed = 0;
var AIturretSize = 0;
var AImultiShot = 0;
var AItowerHP = 0;
var AIrepairRate = 0;
var AIAutoDefense = 0;
var heroAICount = 0;
var heroAILevel = 1;
var heroAIRestore = 0;
var heroAIOut = false;
var heroAIFlee = false;
var heroAIDeath = 0;
var heroAINumber = 0;
var heroAIXp = (0 + (Math.round(currentMap / 4) * 500));
var heroAIDie = 0;
var heroAIhp = 400;
var heroAIhpm = 400;
var heroAIdmg = 15;
if (_global.AIchief == "chief5") {
heroAIhp = 500;
heroAIhpm = 500;
heroAIdmg = 18;
} else if (_global.AIchief == "chief4") {
heroAIhp = 500;
heroAIhpm = 500;
heroAIdmg = 17;
} else if (_global.AIchief == "chief") {
heroAIhp = 450;
heroAIhpm = 450;
heroAIdmg = 19;
} else if (_global.AIchief == "wingeddemon") {
heroAIhp = 1200;
heroAIhpm = 1200;
heroAIdmg = 50;
} else if (_global.AIchief == "undeadknight") {
heroAIhp = 1500;
heroAIhpm = 1500;
heroAIdmg = 50;
} else if (_global.AIchief == "ChampionKnight") {
heroAIhp = 800;
heroAIhpm = 800;
heroAIdmg = 35;
}
heroAIhp = heroAIhp + (Math.round(currentMap / 4) * 50);
heroAIhpm = heroAIhpm + (Math.round(currentMap / 4) * 50);
var randomchecks = 0;
var furyfirecount = 0;
var furyfirecharge = 1000;
var bladefurry = 1000;
var bladefurryon = false;
var bladefurrycount = 0;
var battletrollexp = 300000;
if (_global.troll == 0) {
battletrollexp = 99999999 /* 0x5F5E0FF */;
}
var golemexp = 220000;
if (_global.golem == 0) {
golemexp = 99999999 /* 0x5F5E0FF */;
}
var lionriderexp = 40000;
if (_global.lionrider == 0) {
lionriderexp = 99999999 /* 0x5F5E0FF */;
}
var elitelionriderexp = 99999999;
if (_global.lionrider == 0) {
elitelionriderexp = 99999999 /* 0x5F5E0FF */;
}
var dragonexp = 350000;
if (_global.dragonrider == 0) {
dragonexp = 99999999 /* 0x5F5E0FF */;
}
var dragonpop = 0;
var dragonpopAI = 0;
var archerexp = 1000;
var soldierexp = 4000;
var assasinexp = 15000;
var drakeexp = 120000;
var spiderriderexp = 90000;
var wargriderexp = 75000;
var wizardexp = 26000;
var blackGlowFilter = (new flash.filters.GlowFilter(0, 0.9, 20, 20, 1, 3, false, false));
var yellowGlowFilter = (new flash.filters.GlowFilter(16771900, 1, 25, 25, 1, 1, false, false));
var redGlowFilter = (new flash.filters.GlowFilter(13959168, 1, 25, 25, 3, 3, true, false));
var demonGlowFilter = (new flash.filters.GlowFilter(13959168, 1, 5, 5, 3, 3, false, false));
lightningsound = new Sound();
lightningsound.attachSound("Lightnin-Dylan_Hi-8584_hifi");
var gameover = false;
var nextman = 1;
var maxmen = 50;
var char = [];
setupunits();
var nextbullet = 1;
var maxbullet = 40;
var bullet = [];
setupbullets();
var goldrate = (6 - difficulty);
var experience = (1000 * _global.wisdom);
var goldcounter = 0;
var vaultcounter = 0;
var crows = [];
setupcrows();
var heronumber = 0;
var stompdown = 0;
var bloodon = 0;
var bloodluster = 0;
var morphon = 0;
var morpher = 0;
var knockon = 0;
var knocker = 0;
var rivival = 180;
var herolvl = 1;
var herohp = 400;
var herohpm = 400;
var herodmg = 15;
var heroxp = (0 + (_global.herowisdom * 500));
var heroflee = false;
var herotheme = 0;
if (_global.chief == "chief5") {
herohp = 500;
herohpm = 500;
herodmg = 18;
} else if (_global.chief == "chief4") {
herohp = 500;
herohpm = 500;
herodmg = 17;
} else if (_global.chief == "chief") {
herohp = 450;
herohpm = 450;
herodmg = 19;
}
herohp = herohp + (_global.herohealth * 50);
herohpm = herohpm + (_global.herohealth * 50);
var AIstompdown = 0;
var AIstompcount = 0;
var AIbloodon = 0;
var AIbloodluster = 0;
var AImorphon = 0;
var AImorpher = 0;
var AIknockon = 0;
var AIknocker = 0;
var shieldon = 0;
var shielder = 0;
var AIshieldon = 0;
var AIshielder = 0;
var slavecost = Math.round(50 * (1 - (0.05 * _global.fame)));
var archercost = Math.round(75 * (1 - (0.05 * _global.fame)));
var soldiercost = Math.round(100 * (1 - (0.05 * _global.fame)));
var assasincost = Math.round(140 * (1 - (0.05 * _global.fame)));
var wizardcost = Math.round(190 * (1 - (0.05 * _global.fame)));
var lionridercost = Math.round(750 * (1 - (0.05 * _global.fame)));
var elitelionridercost = Math.round(3500 * (1 - (0.05 * _global.fame)));
var lioncost = Math.round(200 * (1 - (0.05 * _global.fame)));
var largelioncost = Math.round(2000 * (1 - (0.05 * _global.fame)));
var battletrollcost = Math.round(13000 * (1 - (0.05 * _global.fame)));
var golemcost = Math.round(5000 * (1 - (0.05 * _global.fame)));
var wolfridercost = Math.round(400 * (1 - (0.05 * _global.fame)));
var spiderridercost = Math.round(450 * (1 - (0.05 * _global.fame)));
var drakecost = Math.round(1200 * (1 - (0.05 * _global.fame)));
var dragoncost = Math.round(100000 * (1 - (0.05 * _global.fame)));
var babywingcost = Math.round(25000 * (1 - (0.05 * _global.fame)));
var babydemoncost = Math.round(5000 * (1 - (0.05 * _global.fame)));
var undeadknightcost = Math.round(20000 * (1 - (0.05 * _global.fame)));
var killbonus = 0;
var victorybonus = 0;
var timebonus = 0;
var herobonus = 0;
var expbonus = 0;
var repbonus = 0;
var totalbonus = 0;
var spellsAvailable = [];
spellsAvailable[1] = 0;
spellsAvailable[2] = 0;
spellsAvailable[3] = 0;
spellsAvailable[4] = 0;
spellsAvailable[5] = 0;
spellsAvailable[6] = 0;
spellsAvailable[7] = 0;
spellsAvailable[8] = 0;
spellsAvailable[9] = 0;
var spellSlot = [];
spellSlot[1] = 0;
spellSlot[2] = 0;
spellSlot[3] = 0;
spellSlot[4] = 0;
spellSlot[5] = 0;
spellSlot[6] = 0;
spellSlot[7] = 0;
spellSlot[8] = 0;
spellSlot[9] = 0;
var levelxp = [];
levelxp[1] = 0;
levelxp[2] = 400;
levelxp[3] = 1000;
levelxp[4] = 2000;
levelxp[5] = 4000;
levelxp[6] = 8000;
levelxp[7] = 16000;
levelxp[8] = 32000;
levelxp[9] = 64000;
levelxp[10] = 128000 /* 0x01F400 */;
levelxp[11] = 256000 /* 0x03E800 */;
levelxp[12] = 512000 /* 0x07D000 */;
levelxp[13] = 728000 /* 0x0B1BC0 */;
levelxp[14] = 1024000 /* 0x0FA000 */;
levelxp[15] = 1536000 /* 0x177000 */;
levelxp[16] = 999999999 /* 0x3B9AC9FF */;
var armies = [];
setAIArmies();
var tower1hp = (5000 + (_global.fortitude * 1000));
var tower1hpm = (5000 + (_global.fortitude * 1000));
var tower2hp = Math.min(1000 * currentMap, 5000);
var tower2hpm = Math.min(1000 * currentMap, 5000);
var reputation = (_global.presence * 50);
var cuecounter = 1;
var nextcue = 1;
var unitcue = [];
var i = 1;
while (i < 11) {
unitcue[i] = {unit:"none", percent:0, active:false};
i++;
}
_root.attachMovie("frame", "frame", 200, {_x:-536.1, _y:-400.1});
_root.attachMovie("gameoptions", "gameoptions", 20);
_root.gameoptions._x = 42;
_root.gameoptions._y = 448;
_root.attachMovie("gamestats", "gamestats", 21);
_root.gamestats._x = 0;
_root.gamestats._y = 0;
_root.attachMovie("herodashboard", "herodashboard", 36);
_root.herodashboard._x = 275;
_root.herodashboard._y = 450;
if (_global.chief == "chief4") {
_root.options2.gotoAndStop(4);
_root.herodashboard.options2.gotoAndStop(4);
} else if (_global.chief == "chief2") {
_root.options2.gotoAndStop(2);
_root.herodashboard.options2.gotoAndStop(2);
} else if (_global.chief == "chief5") {
_root.options2.gotoAndStop(5);
_root.herodashboard.options2.gotoAndStop(5);
} else if (_global.chief == "chief6") {
_root.options2.gotoAndStop(6);
_root.herodashboard.options2.gotoAndStop(6);
}
_root.attachMovie("pausenow", "pausenow", 22);
_root.pausenow._x = 1630;
_root.pausenow._y = 435;
_root.attachMovie("gameinterface", "border", 19);
_root.attachMovie("sky", "sky", 5);
_root.createEmptyMovieClip("game", 10);
game.attachMovie("sky", "sky", 2);
game.sky._xscale = 1000;
game._x = -65;
game.attachMovie("tower1", "tower1", 200, {_x:140, _y:370});
game.tower1._xscale = -150;
game.tower1._yscale = 150;
game.tower1.attachMovie("healthbar", "healthbar", 2);
game.tower1.healthbar._xscale = -200;
game.tower1.healthbar._y = -150;
game.attachMovie("tower1cover", "tower1cover", 3200, {_x:140, _y:370});
game.tower1cover._xscale = -150;
game.tower1cover._yscale = 150;
game.attachMovie("tower1", "tower2", 201, {_x:3415, _y:370});
game.tower2._xscale = 150;
game.tower2._yscale = 150;
game.tower2.attachMovie("healthbar", "healthbar", 2);
game.tower2.healthbar._xscale = 200;
game.tower2.healthbar._y = -150;
game.attachMovie("tower1cover", "tower2cover", 3201, {_x:3415, _y:370});
game.tower2cover._xscale = 150;
game.tower2cover._yscale = 150;
if ((currentMap == 1) or (currentMap == 11)) {
game.attachMovie("water", "water", 1909, {_x:1627, _y:450});
}
game.attachMovie("mountains1", "mountains1", 5, {_x:-100, _y:200, _xscale:100});
game.mountains1.gotoAndStop(currentMap);
game.mountains1.base.gotoAndStop(currentMap);
game.attachMovie("mountains2", "mountains2", 4, {_x:-100, _y:150, _xscale:100});
game.mountains2.gotoAndStop(currentMap);
game.attachMovie("sun", "sun", 3, {_x:500, _y:50, _xscale:100});
game.sun.gotoAndStop(currentMap);
sky.gotoAndStop(currentMap);
game.sky.gotoAndStop(currentMap);
game.attachMovie("backtrees", "backtrees", 6, {_x:-100, _y:150, _xscale:100});
game.backtrees.gotoAndStop(currentMap);
game.attachMovie("fronttrees", "fronttrees", 75000, {_x:-100, _y:250, _xscale:100});
game.fronttrees.gotoAndStop(currentMap);
if ((currentMap == 1) or (currentMap == 11)) {
game.attachMovie("beacon1", "beacon1", 76001, {_x:1500, _y:225, _xscale:100});
game.attachMovie("beacon1", "beacon3", 76002, {_x:1930, _y:355, _xscale:100});
game.attachMovie("beacon1", "beacon2", 76003, {_x:2600, _y:265, _xscale:100});
}
_root.musicobject.music.stop();
_root.musicobject.removeMovieClip();
_root.attachMovie("musiconject", "musicobject2", 1202);
musicobject.ambience = new Sound(musicobject);
musicobject.ambience.attachSound("Birds-By-The-Creek");
musicobject.ambience.setVolume((100 * _global.ambience) * _global.forestsounds);
musicobject.ambience.start(0, 99);
_root.attachMovie("musiconject", "musicobject3", 1204);
musicobject3.drums = new Sound(musicobject3);
if (((currentMap == 11) or (currentMap == 4)) or (currentMap == 3)) {
musicobject3.drums.attachSound("Birds-By-The-Creek");
} else if (currentMap == 13) {
musicobject3.drums.attachSound("Battledrums2");
} else {
musicobject3.drums.attachSound("Battledrums");
}
musicobject3.drums.setVolume((50 * _global.mainVolume) * _global.musicsounds);
musicobject3.drums.start(0, 99);
_root.attachMovie("musiconject", "interfacesound", 1206);
interfacesound.upgradesound = new Sound(interfacesound);
interfacesound.upgradesound.attachSound("powerup_summon_shield_block_01");
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
this.game.createEmptyMovieClip("circle_mc", 10);
with (game.circle_mc) {
var fillType = "linear";
if (currentMap == 1) {
var colors = [10053171, 7163137];
var earth = flash.display.BitmapData.loadBitmap("dirt1.jpg");
} else if (currentMap == 2) {
var colors = [6698512, 6698512];
var earth = flash.display.BitmapData.loadBitmap("rock2.jpg");
} else if (currentMap == 3) {
var colors = [5319179, 5319179];
var earth = flash.display.BitmapData.loadBitmap("rock2.jpg");
} else if (currentMap == 4) {
var colors = [5319179, 5319179];
var earth = flash.display.BitmapData.loadBitmap("rock4.jpg");
} else if (currentMap == 5) {
var colors = [592133, 592133];
var earth = flash.display.BitmapData.loadBitmap("snowtexture.jpg");
} else if (currentMap == 6) {
var colors = [10066329, 10066329];
var earth = flash.display.BitmapData.loadBitmap("snow2.jpg");
} else if (currentMap == 7) {
var colors = [1973510, 1973510];
var earth = flash.display.BitmapData.loadBitmap("rock3.jpg");
} else if (currentMap == 8) {
var colors = [16777011, 12683010];
var earth = flash.display.BitmapData.loadBitmap("rock3.jpg");
} else if (currentMap == 9) {
var colors = [1841667, 1841667];
var earth = flash.display.BitmapData.loadBitmap("grass3.jpg");
} else if (currentMap == 10) {
var colors = [11959823, 11959823];
var earth = flash.display.BitmapData.loadBitmap("grass3.jpg");
} else if (currentMap == 11) {
var colors = [10053171, 7163137];
var earth = flash.display.BitmapData.loadBitmap("dirt1.jpg");
} else if (currentMap == 12) {
var colors = [1376256, 1376256];
var earth = flash.display.BitmapData.loadBitmap("grass3.jpg");
} else if (currentMap == 13) {
var colors = [3355443, 3355443];
var earth = flash.display.BitmapData.loadBitmap("grass3.jpg");
} else {
var colors = [16777011, 12683010];
}
var alphas = [100, 100];
var ratios = [0, 255];
var matrix = (new flash.geom.Matrix());
rot = 90;
radRot = (rot * Math.PI) / 180;
matrix.createGradientBox(500, 300, radRot, 0, 100);
var spreadMethod = "pad";
game.circle_mc.beginGradientFill(fillType, colors, alphas, ratios, matrix, spreadMethod);
lineStyle(0, 0, 100);
moveTo(0, 300);
}
var g = 0;
while (g < 1000) {
lx = lx + 5;
ly = groundmaker(lx);
if (currentMap == 4) {
if (lx > 1580) {
if (lx < 2220) {
ly = 900;
}
}
}
with (game.circle_mc) {
curveTo(lx, ly, lx, ly);
}
g++;
}
with (game.circle_mc) {
lineTo(5000, 800);
lineTo(0, 800);
lineTo(0, 300);
}
onEnterFrame = function () {
if (!pausegame) {
if (AIAutoDefense > 0) {
intervals = (40 - (difficulty * 6)) * framerate;
} else {
intervals = (40 - (difficulty * 5)) * framerate;
}
gamecount++;
if (gamecount == 2) {
if (_global.difficulty < 5) {
if (_global.scene == 2) {
_root.attachMovie("tutorial", "tutorial", 2125);
_root.tutorial._y = 100;
_root.tutorial._x = 200;
pausegame = true;
}
}
}
setAIWave();
heroAI();
dragonpopulation();
aimen();
cuemen();
moveunits();
turretshooting();
scrolling();
spellsReady();
hotKeys();
movebullets();
recruitlocks();
if (currentMap != 8) {
crowmovement();
}
posioncontrol();
movebackdrop();
tipmanagement();
if (bloodluster > 0) {
BloodOff();
}
if (AIbloodluster > 0) {
AIBloodOff();
}
if (morpher > 0) {
MorphOff();
}
if (AImorpher > 0) {
AIMorphOff();
}
if (shielder > 0) {
ShieldOff();
}
if (knocking > 0) {
KnockOff();
}
if (AIknocking > 0) {
AIKnockOff();
}
if (AIshielder > 0) {
AIShieldOff();
}
fistControl();
growControl();
omegafistControl();
AIfistControl();
if (lightningstorm) {
lightning();
}
if (AIlightningstorm) {
AIlightning();
}
if (meteorstorm) {
meteoring();
}
if (bloodluston) {
bloodlustfog();
}
if (healon) {
healfog();
}
if (_global.bonusunlocked) {
heroregen();
}
randomchecks++;
if (randomchecks > 100) {
populationalign();
randomchecks = 0;
}
if (doubleclick > 0) {
dccount++;
if (dccount > 12) {
doubleclick = 0;
}
} else {
dccount = 0;
}
if (heronumber == 0) {
if (herotheme > 0) {
if (herotheme == 2) {
if (_global.themesounds == 1) {
}
}
}
} else {
game["unit" + i].attacksound.setVolume(volumeControl(game["unit" + heronumber]._x));
if (_global.themesounds == 1) {
}
}
if (currentMap != 8) {
treefade(treecount);
treecount++;
if (treecount > treemax) {
treecount = 1;
}
}
AIUnitUpgrades();
AITowerUpgrades();
repairTowers();
_root.gamestats.goldcount = formatAsDollars(int(_global.gold));
_root.gamestats.reputation = formatAsDollars(reputation);
_root.gamestats.experience = formatAsDollars(experience);
_root.gamestats.population = (playerpop + " / ") + maxpop;
if (heronumber > 0) {
_root.herodashboard.healthbartxt = (formatAsDollars(char[heronumber].hpCurrent) + " / ") + formatAsDollars(char[heronumber].hpMax);
trace("_root.herodashboard.healthbartxt = " + _root.herodashboard.healthbartxt);
_root.herodashboard.herohealthbar.hbgreen._xscale = int((char[heronumber].hpCurrent / char[heronumber].hpMax) * 100);
} else {
_root.herodashboard.healthbartxt = (formatAsDollars(int(herohp * Math.pow(gainrate, herolvl))) + " / ") + formatAsDollars(int(herohp * Math.pow(gainrate, herolvl)));
_root.herodashboard.herohealthbar.hbgreen._xscale = 100;
}
_root.herodashboard.xpbartxt = (formatAsDollars(heroxp) + " / ") + formatAsDollars(levelxp[herolvl + 1]);
_root.herodashboard.heroXPbar.pb._xscale = int((heroxp / levelxp[herolvl + 1]) * 100);
if ((heronumber > 0) or (rivival == 0)) {
if (_root.herodashboard._y > 1000) {
_root.herodashboard._y = 450;
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- HERO REVIVED! ---\rChief is now\rReady to Fight.";
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
if (_global.tip5 == 0) {
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(6);
pausegame = true;
_global.tip5 = 1;
}
}
if (heroflee) {
_root.herodashboard.statustxt = "FLEEING";
} else if (heronumber == 0) {
_root.herodashboard.statustxt = "READY";
} else if (char[heronumber].mcount > 0) {
_root.herodashboard.statustxt = "FIGHTING";
} else {
_root.herodashboard.statustxt = "MARCHING";
}
_root.herodashboard.leveltxt = herolvl;
} else {
_root.herodashboard._y = 1435;
}
goldcounter++;
if (goldcounter >= 24) {
goldcounter = 0;
_global.gold = (_global.gold + goldrate) + (reputation / 50);
trace("goldrate = " + goldrate);
trace("reputation = " + reputation);
}
vaultcounter++;
if (vaultcounter >= 240) {
vaultcounter = 0;
_global.gold = _global.gold + (_global.gold * ((_global.vault + 1) / 200));
}
game.tower1.healthbar.hbgreen._xscale = Math.max(int((tower1hp / tower1hpm) * 100), 0);
game.tower2.healthbar.hbgreen._xscale = Math.max(int((tower2hp / tower2hpm) * 100), 0);
if (herolvl > 1) {
if (_global.chief == "chief5") {
if (bladefurry > 0) {
bladefurry--;
_root.options2.ldb5.gotoAndStop(1);
_root.herodashboard.options2.ldb5.gotoAndStop(1);
} else {
_root.options2.ldb5.gotoAndStop(2);
_root.herodashboard.options2.ldb5.gotoAndStop(2);
}
if (bladefurrycount > 0) {
bladefurrycount--;
}
} else if (stompdown > 0) {
stompdown--;
_root.options2.ldb5.gotoAndStop(1);
_root.herodashboard.options2.ldb5.gotoAndStop(1);
} else {
_root.options2.ldb5.gotoAndStop(2);
_root.herodashboard.options2.ldb5.gotoAndStop(2);
}
_root.options2.ldb5.locked.gotoAndStop(1);
_root.herodashboard.options2.ldb5.locked.gotoAndStop(1);
} else {
_root.options2.ldb5.locked.gotoAndStop(2);
_root.herodashboard.options2.ldb5.locked.gotoAndStop(2);
if (_global.chief == "chief5") {
bladefurry = 1500;
} else {
stompdown = 1200;
}
}
if (heroAILevel > 1) {
if (AIstompdown > 0) {
AIstompdown--;
}
} else {
AIstompdown = 1200;
}
if (herolvl > 1) {
if (shieldon > 0) {
shieldon--;
_root.options2.ldb5.gotoAndStop(1);
_root.herodashboard.options2.ldb5.gotoAndStop(1);
} else {
_root.options2.ldb5.gotoAndStop(2);
_root.herodashboard.options2.ldb5.gotoAndStop(2);
}
_root.options2.ldb5.locked.gotoAndStop(1);
_root.herodashboard.options2.ldb5.locked.gotoAndStop(1);
} else {
_root.options2.ldb5.locked.gotoAndStop(2);
_root.herodashboard.options2.ldb5.locked.gotoAndStop(2);
shieldon = 1200;
}
if (heroAILevel > 1) {
if (AIshieldon > 0) {
AIshieldon--;
}
} else {
AIshieldon = 1200;
}
if (herolvl > 2) {
if (bloodon > 0) {
bloodon--;
_root.options2.ldb6.gotoAndStop(1);
_root.herodashboard.options2.ldb6.gotoAndStop(1);
} else {
_root.options2.ldb6.gotoAndStop(2);
_root.herodashboard.options2.ldb6.gotoAndStop(2);
}
_root.options2.ldb6.locked.gotoAndStop(1);
_root.herodashboard.options2.ldb6.locked.gotoAndStop(1);
} else {
_root.options2.ldb6.locked.gotoAndStop(2);
_root.herodashboard.options2.ldb6.locked.gotoAndStop(2);
bloodon = 1200;
}
if (heroAILevel > 2) {
if (AIbloodon > 0) {
AIbloodon--;
}
} else {
AIbloodon = 1200;
}
if (herolvl > 2) {
if (morphon > 0) {
morphon--;
_root.options2.ldb6.gotoAndStop(1);
_root.herodashboard.options2.ldb6.gotoAndStop(1);
} else {
_root.options2.ldb6.gotoAndStop(2);
_root.herodashboard.options2.ldb6.gotoAndStop(2);
}
_root.options2.ldb6.locked.gotoAndStop(1);
_root.herodashboard.options2.ldb6.locked.gotoAndStop(1);
} else {
_root.options2.ldb6.locked.gotoAndStop(2);
_root.herodashboard.options2.ldb6.locked.gotoAndStop(2);
morphon = 1200;
}
if (herolvl > 2) {
if (knockon > 0) {
knockon--;
_root.options2.ldb6.gotoAndStop(1);
_root.herodashboard.options2.ldb6.gotoAndStop(1);
} else {
_root.options2.ldb6.gotoAndStop(2);
_root.herodashboard.options2.ldb6.gotoAndStop(2);
}
_root.options2.ldb6.locked.gotoAndStop(1);
_root.herodashboard.options2.ldb6.locked.gotoAndStop(1);
} else {
_root.options2.ldb6.locked.gotoAndStop(2);
_root.herodashboard.options2.ldb6.locked.gotoAndStop(2);
knockon = 1200;
}
if (_global.AIchief == "chief") {
if (heroAILevel > 2) {
if (AIknockon > 0) {
AIknockon--;
}
} else {
AIknockon = 1200;
}
}
if (heroAILevel > 2) {
if (AImorphon > 0) {
AImorphon--;
}
} else {
AImorphon = 1200;
}
if (herolvl > 3) {
if (furyfirecount > 0) {
furyfirecount--;
char[heronumber].ranged = true;
char[heronumber].range = 300;
char[heronumber].mtarget = 0;
char[heronumber].mcount = 0;
} else if ((_global.chief != "chief6") and (_global.chief != "chief2")) {
char[heronumber].ranged = false;
char[heronumber].range = 0;
char[heronumber].shooting = 0;
}
if (furyfirecharge > 0) {
furyfirecharge--;
_root.options2.ldb7.gotoAndStop(1);
_root.herodashboard.options2.ldb7.gotoAndStop(1);
} else {
_root.options2.ldb7.gotoAndStop(2);
_root.herodashboard.options2.ldb7.gotoAndStop(2);
}
_root.options2.ldb7.locked.gotoAndStop(1);
_root.herodashboard.options2.ldb7.locked.gotoAndStop(1);
} else {
_root.options2.ldb7.locked.gotoAndStop(2);
_root.herodashboard.options2.ldb7.locked.gotoAndStop(2);
furyfirecharge = 1200;
}
if (experience >= 6000) {
if (rivival > 0) {
rivival--;
_root.options2.ldb4.gotoAndStop(1);
_root.herodashboard.herodashboard.ldb4.gotoAndStop(1);
} else {
if (_root.options2.ldb4.locked._currentframe == 2) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 250;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- 6000XP ---\rCall Chief\rUNLOCKED!";
_root.options2.ldb4.locked.gotoAndStop(1);
_root.herodashboard.ldb4.locked.gotoAndStop(1);
interfacesound.upgradesound.setVolume(50 * _global.mainVolume);
interfacesound.upgradesound.start(0, 1);
}
_root.options2.ldb4.gotoAndStop(2);
_root.herodashboard.ldb4.gotoAndStop(2);
}
} else {
_root.options2.ldb4.locked.gotoAndStop(2);
_root.herodashboard.ldb4.gotoAndStop(2);
rivival = 2000;
}
_root.options2.ldb0._yscale = int((rivival / 2000) * 100);
_root.herodashboard.ldb0._yscale = int((rivival / 2000) * 100);
if (_global.chief == "chief5") {
_root.options2.ldb1._yscale = int((bladefurry / 1500) * 100);
_root.herodashboard.options2.ldb1._yscale = int((bladefurry / 1500) * 100);
} else if (_global.chief == "chief2") {
_root.options2.ldb1._yscale = int((shieldon / 1200) * 100);
_root.herodashboard.options2.ldb1._yscale = int((shieldon / 1200) * 100);
} else {
_root.options2.ldb1._yscale = int((stompdown / 1200) * 100);
_root.herodashboard.options2.ldb1._yscale = int((stompdown / 1200) * 100);
}
if (_global.chief == "chief4") {
_root.options2.ldb2._yscale = int((morphon / 1500) * 100);
_root.herodashboard.options2.ldb2._yscale = int((morphon / 1500) * 100);
} else if (_global.chief == "chief") {
_root.options2.ldb2._yscale = int((knockon / 1500) * 100);
_root.herodashboard.options2.ldb2._yscale = int((knockon / 1500) * 100);
} else {
_root.options2.ldb2._yscale = int((bloodon / 1200) * 100);
_root.herodashboard.options2.ldb2._yscale = int((bloodon / 1200) * 100);
}
_root.options2.ldb3._yscale = int((furyfirecharge / 3000) * 100);
_root.options2.ldb10._yscale = int((fistcharge / 2500) * 100);
_root.options2.ldb11._yscale = int((stormcharge / 3000) * 100);
_root.options2.ldb12._yscale = int((catapultcharge / 4000) * 100);
_root.options2.ldb13._yscale = int((shadowdemoncharge / 5000) * 100);
_root.options2.ldb14._yscale = int((omegafistcharge / 10000) * 100);
_root.options2.ldb15._yscale = int((meteorcharge / 10000) * 100);
_root.options2.ldb22._yscale = int((growcharge / 10000) * 100);
_root.options2.ldb24._yscale = int((bloodlustcharge / 6000) * 100);
_root.options2.ldb26._yscale = int((healcharge / 6000) * 100);
_root.herodashboard.options2.ldb3._yscale = int((furyfirecharge / 3000) * 100);
_root.herodashboard.options2.ldb10._yscale = int((fistcharge / 2500) * 100);
_root.herodashboard.options2.ldb11._yscale = int((stormcharge / 3000) * 100);
_root.herodashboard.options2.ldb12._yscale = int((catapultcharge / 4000) * 100);
_root.herodashboard.options2.ldb13._yscale = int((shadowdemoncharge / 5000) * 100);
_root.herodashboard.options2.ldb14._yscale = int((omegafistcharge / 10000) * 100);
_root.herodashboard.options2.ldb15._yscale = int((meteorcharge / 10000) * 100);
_root.herodashboard.options2.ldb22._yscale = int((growcharge / 10000) * 100);
_root.herodashboard.options2.ldb24._yscale = int((bloodlustcharge / 6000) * 100);
_root.herodashboard.options2.ldb26._yscale = int((healcharge / 6000) * 100);
herolevels();
}
};
this.onMouseDown = function () {
if (fiston) {
fistdown = true;
} else if (omegafiston) {
omegafistdown = true;
} else if (growon) {
growdown = true;
}
};
var currentBitmap = "smoke_black.png";
stop();
Frame 55
g1.hb._visible = false;
g2.hb._visible = false;
g3.hb._visible = false;
g4.hb._visible = false;
g1b.hb._visible = false;
g2b.hb._visible = false;
g3b.hb._visible = false;
g4b.hb._visible = false;
Instance of Symbol 216 MovieClip [menubutton] in Frame 55
on (rollOver) {
this.gotoAndStop(2);
_root.g1._x = 1100;
_root.g1b._x = 100;
}
on (rollOut) {
this.gotoAndStop(1);
_root.g1._x = 100;
_root.g1b._x = 1100;
}
on (release) {
_global.difficulty = 1;
_root.gotoAndStop(56);
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 55
on (rollOver) {
this.gotoAndStop(2);
_root.g2._x = 1265.75;
_root.g2b._x = 265.75;
}
on (rollOut) {
this.gotoAndStop(1);
_root.g2._x = 265.75;
_root.g2b._x = 1265.75;
}
on (release) {
_global.difficulty = 2;
_root.gotoAndStop(56);
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 55
on (rollOver) {
this.gotoAndStop(2);
_root.g3._x = 1417.35;
_root.g3b._x = 417.35;
}
on (rollOut) {
this.gotoAndStop(1);
_root.g3._x = 417.35;
_root.g3b._x = 1417.35;
}
on (release) {
_global.difficulty = 3;
_root.gotoAndStop(56);
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 55
on (rollOver) {
this.gotoAndStop(2);
_root.g4._x = 1604.4;
_root.g4b._x = 604.4;
}
on (rollOut) {
this.gotoAndStop(1);
_root.g4._x = 604.4;
_root.g4b._x = 1604.4;
}
on (release) {
_global.difficulty = 4;
_root.gotoAndStop(56);
}
Instance of Symbol 2998 MovieClip in Frame 55
on (press) {
getURL ("http://www.goblinarena.com", blank);
}
Frame 56
g1.hb._visible = false;
g2.hb._visible = false;
g3.hb._visible = false;
g4.hb._visible = false;
g5.hb._visible = false;
g1b.hb._visible = false;
g2b.hb._visible = false;
g3b.hb._visible = false;
g4b.hb._visible = false;
g5b.hb._visible = false;
if (_global.bonusunlocked) {
bonuslock1._x = 2000;
bonuslock2._x = 2000;
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 56
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.g1._x = _root.g1._x + 1000;
_root.g1b._x = _root.g1b._x - 1000;
_root.abilitybox.ability_header.text = "Warlock";
_root.abilitybox.ability_txt.text = "Ranged Hero that blasts fireballs and can cast invincibility.";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
_root.abilitybox._x = 11180;
_root.abilitybox._y = 1140;
_root.g1._x = _root.g1._x - 1000;
_root.g1b._x = _root.g1b._x + 1000;
}
on (release) {
_global.chief = "chief2";
_root.overhero = false;
clearInterval(_root.dhero);
_root.gotoAndStop(58);
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 56
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.g2._x = _root.g2._x + 1000;
_root.g2b._x = _root.g2b._x - 1000;
_root.abilitybox.ability_header.text = "Warrior";
_root.abilitybox.ability_txt.text = "A strong melee hero with stomp/stun ability.";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
_root.g2._x = _root.g2._x - 1000;
_root.g2b._x = _root.g2b._x + 1000;
}
on (release) {
_global.chief = "chief";
_root.overhero = false;
clearInterval(_root.dhero);
_root.gotoAndStop(58);
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 56
on (rollOver) {
_root.overhero = true;
this.gotoAndStop(2);
_root.g3._x = _root.g3._x + 1000;
_root.g3b._x = _root.g3b._x - 1000;
_root.abilitybox.ability_header.text = "Beast Master";
_root.abilitybox.ability_txt.text = "Half Beast and Half goblin can morph into a Lion.";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
_root.abilitybox._x = 1180;
_root.abilitybox._y = 1140;
_root.g3._x = _root.g3._x - 1000;
_root.g3b._x = _root.g3b._x + 1000;
}
on (release) {
_global.chief = "chief4";
_root.overhero = false;
clearInterval(_root.dhero);
_root.gotoAndStop(58);
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 56
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.g4._x = _root.g4._x + 1000;
_root.g4b._x = _root.g4b._x - 1000;
_root.abilitybox.ability_header.text = "Dragon Guard";
if (_global.bonusunlocked) {
_root.abilitybox.ability_txt.text = "Most Lethal Melee Hero, with blade fury. Strong and Agile.";
} else {
_root.abilitybox.ability_txt.text = "Most Lethal Melee Hero, with blade fury. Strong and Agile.\rLOCKED\rClick to Unlock this Hero, Bonus Levels, Gold and Skill Points.";
}
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
_root.abilitybox._x = 1180;
_root.abilitybox._y = 1040;
_root.g4._x = _root.g4._x - 1000;
_root.g4b._x = _root.g4b._x + 1000;
}
on (release) {
if (_global.bonusunlocked) {
_global.chief = "chief5";
_root.overhero = false;
clearInterval(_root.dhero);
_root.gotoAndStop(58);
} else {
_root.attachMovie("BonusBox", "BonusBox", 2125);
_root.BonusBox._x = 150;
_root.BonusBox._y = 50;
}
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 56
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.g5._x = _root.g5._x + 1000;
_root.g5b._x = _root.g5b._x - 1000;
_root.abilitybox.ability_header.text = "Elite Assassin";
if (_global.bonusunlocked) {
_root.abilitybox.ability_txt.text = "Very Agile Ranged Unit. Fastest moving hero with deadly arrows.";
} else {
_root.abilitybox.ability_txt.text = "Very Agile Ranged Unit. Fastest moving hero with deadly arrows.\rLOCKED\rClick to Unlock this Hero, Bonus Levels, Gold and Skill Points.";
}
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
_root.abilitybox._x = 1180;
_root.abilitybox._y = 1040;
_root.g5._x = _root.g5._x - 1000;
_root.g5b._x = _root.g5b._x + 1000;
}
on (release) {
if (_global.bonusunlocked) {
_global.chief = "chief6";
_root.overhero = false;
clearInterval(_root.dhero);
_root.gotoAndStop(58);
} else {
_root.attachMovie("BonusBox", "BonusBox", 2125);
_root.BonusBox._x = 150;
_root.BonusBox._y = 50;
}
}
Frame 57
_root.s2.gotoAndStop(2);
if (_global.bonusunlocked) {
_root.s9.gotoAndStop(2);
_root.s6.gotoAndStop(2);
}
if (levelscomplete[2] > 0) {
_root.s3.gotoAndStop(2);
_root.s2.gotoAndStop(4);
}
if (levelscomplete[3] > 0) {
_root.s4.gotoAndStop(2);
_root.s3.gotoAndStop(4);
}
if (levelscomplete[4] > 0) {
_root.s5.gotoAndStop(2);
_root.s4.gotoAndStop(4);
}
if (levelscomplete[5] > 0) {
_root.s7.gotoAndStop(2);
_root.s5.gotoAndStop(4);
}
if (levelscomplete[6] > 0) {
_root.s6.gotoAndStop(4);
}
if (levelscomplete[7] > 0) {
_root.s8.gotoAndStop(2);
_root.s7.gotoAndStop(4);
}
if (levelscomplete[8] > 0) {
_root.s10.gotoAndStop(2);
_root.s8.gotoAndStop(4);
}
if (levelscomplete[9] > 0) {
_root.s9.gotoAndStop(4);
}
if (levelscomplete[10] > 0) {
_root.s11.gotoAndStop(2);
_root.s10.gotoAndStop(4);
}
if (levelscomplete[11] > 0) {
_root.s12.gotoAndStop(2);
_root.s11.gotoAndStop(4);
}
if (levelscomplete[12] > 0) {
_root.s13.gotoAndStop(2);
_root.s12.gotoAndStop(4);
_root.s9.gotoAndStop(2);
_root.s6.gotoAndStop(2);
}
if (_global.slotno == 1) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot1 = 1;
localInfo.data.slot1_class = _global.chief;
localInfo.data.slot1_level = _global.masterlevel;
localInfo.data.slot1_exp = _global.gexperience;
localInfo.data.slot1_difficulty = _global.difficulty;
localInfo.data.slot1_class = _global.chief;
localInfo.data.slot1_skillpoints = _global.skillpoints;
localInfo.data.slot1_vault = _global.vault;
localInfo.data.slot1_masonry = _global.masonry;
localInfo.data.slot1_fame = _global.fame;
localInfo.data.slot1_thrift = _global.thrift;
localInfo.data.slot1_training = _global.training;
localInfo.data.slot1_fortitude = _global.fortitude;
localInfo.data.slot1_wisdom = _global.wisdom;
localInfo.data.slot1_presence = _global.presence;
localInfo.data.slot1_herohealth = _global.herohealth;
localInfo.data.slot1_backstab = _global.backstab;
localInfo.data.slot1_fistpower = _global.fistpower;
localInfo.data.slot1_herowisdom = _global.herowisdom;
localInfo.data.slot1_lionrider = _global.lionrider;
localInfo.data.slot1_dragonrider = _global.dragonrider;
localInfo.data.slot1_grow = _global.grow;
localInfo.data.slot1_herocritical = _global.herocritical;
localInfo.data.slot1_meteor = _global.meteor;
localInfo.data.slot1_herolearned = _global.herolearned;
localInfo.data.slot1_troll = _global.troll;
localInfo.data.slot1_bloodlust = _global.bloodlust;
localInfo.data.slot1_golem = _global.golem;
localInfo.data.slot1_heal = _global.heal;
localInfo.data.slot1_herovampire = _global.herovampire;
localInfo.data.slot1_lvl2 = levelscomplete[2];
localInfo.data.slot1_lvl3 = levelscomplete[3];
localInfo.data.slot1_lvl4 = levelscomplete[4];
localInfo.data.slot1_lvl5 = levelscomplete[5];
localInfo.data.slot1_lvl6 = levelscomplete[6];
localInfo.data.slot1_lvl7 = levelscomplete[7];
localInfo.data.slot1_lvl8 = levelscomplete[8];
localInfo.data.slot1_lvl9 = levelscomplete[9];
localInfo.data.slot1_lvl10 = levelscomplete[10];
localInfo.data.slot1_lvl11 = levelscomplete[11];
localInfo.data.slot1_lvl12 = levelscomplete[12];
localInfo.data.slot1_lvl13 = levelscomplete[13];
localInfo.data.slot1_tip1 = _global.tip1;
localInfo.data.slot1_tip2 = _global.tip2;
localInfo.data.slot1_tip3 = _global.tip3;
localInfo.data.slot1_tip4 = _global.tip4;
localInfo.data.slot1_tip5 = _global.tip5;
localInfo.data.slot1_tip6 = _global.tip6;
localInfo.data.slot1_tip7 = _global.tip7;
localInfo.data.slot1_tip8 = _global.tip8;
localInfo.data.slot1_tip9 = _global.tip9;
localInfo.data.slot1_tip10 = _global.tip10;
localInfo.data.slot1_tip11 = _global.tip11;
localInfo.data.slot1_tip12 = _global.tip12;
} else if (_global.slotno == 2) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot2 = 1;
localInfo.data.slot2_class = _global.chief;
localInfo.data.slot2_level = _global.masterlevel;
localInfo.data.slot2_exp = _global.gexperience;
localInfo.data.slot2_difficulty = _global.difficulty;
localInfo.data.slot2_class = _global.chief;
localInfo.data.slot2_skillpoints = _global.skillpoints;
localInfo.data.slot2_vault = _global.vault;
localInfo.data.slot2_masonry = _global.masonry;
localInfo.data.slot2_fame = _global.fame;
localInfo.data.slot2_thrift = _global.thrift;
localInfo.data.slot2_training = _global.training;
localInfo.data.slot2_fortitude = _global.fortitude;
localInfo.data.slot2_wisdom = _global.wisdom;
localInfo.data.slot2_presence = _global.presence;
localInfo.data.slot2_herohealth = _global.herohealth;
localInfo.data.slot2_backstab = _global.backstab;
localInfo.data.slot2_fistpower = _global.fistpower;
localInfo.data.slot2_herowisdom = _global.herowisdom;
localInfo.data.slot2_lionrider = _global.lionrider;
localInfo.data.slot2_dragonrider = _global.dragonrider;
localInfo.data.slot2_grow = _global.grow;
localInfo.data.slot2_herocritical = _global.herocritical;
localInfo.data.slot2_meteor = _global.meteor;
localInfo.data.slot2_herolearned = _global.herolearned;
localInfo.data.slot2_troll = _global.troll;
localInfo.data.slot2_bloodlust = _global.bloodlust;
localInfo.data.slot2_golem = _global.golem;
localInfo.data.slot2_heal = _global.heal;
localInfo.data.slot2_herovampire = _global.herovampire;
localInfo.data.slot2_lvl2 = levelscomplete[2];
localInfo.data.slot2_lvl3 = levelscomplete[3];
localInfo.data.slot2_lvl4 = levelscomplete[4];
localInfo.data.slot2_lvl5 = levelscomplete[5];
localInfo.data.slot2_lvl6 = levelscomplete[6];
localInfo.data.slot2_lvl7 = levelscomplete[7];
localInfo.data.slot2_lvl8 = levelscomplete[8];
localInfo.data.slot2_lvl9 = levelscomplete[9];
localInfo.data.slot2_lvl10 = levelscomplete[10];
localInfo.data.slot2_lvl11 = levelscomplete[11];
localInfo.data.slot2_lvl12 = levelscomplete[12];
localInfo.data.slot2_lvl13 = levelscomplete[13];
localInfo.data.slot2_tip1 = _global.tip1;
localInfo.data.slot2_tip2 = _global.tip2;
localInfo.data.slot2_tip3 = _global.tip3;
localInfo.data.slot2_tip4 = _global.tip4;
localInfo.data.slot2_tip5 = _global.tip5;
localInfo.data.slot2_tip6 = _global.tip6;
localInfo.data.slot2_tip7 = _global.tip7;
localInfo.data.slot2_tip8 = _global.tip8;
localInfo.data.slot2_tip9 = _global.tip9;
localInfo.data.slot2_tip10 = _global.tip10;
localInfo.data.slot2_tip11 = _global.tip11;
localInfo.data.slot2_tip12 = _global.tip12;
} else if (_global.slotno == 3) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot3 = 1;
localInfo.data.slot3_class = _global.chief;
localInfo.data.slot3_level = _global.masterlevel;
localInfo.data.slot3_exp = _global.gexperience;
localInfo.data.slot3_difficulty = _global.difficulty;
localInfo.data.slot3_class = _global.chief;
localInfo.data.slot3_skillpoints = _global.skillpoints;
localInfo.data.slot3_vault = _global.vault;
localInfo.data.slot3_masonry = _global.masonry;
localInfo.data.slot3_fame = _global.fame;
localInfo.data.slot3_thrift = _global.thrift;
localInfo.data.slot3_training = _global.training;
localInfo.data.slot3_fortitude = _global.fortitude;
localInfo.data.slot3_wisdom = _global.wisdom;
localInfo.data.slot3_presence = _global.presence;
localInfo.data.slot3_herohealth = _global.herohealth;
localInfo.data.slot3_backstab = _global.backstab;
localInfo.data.slot3_fistpower = _global.fistpower;
localInfo.data.slot3_herowisdom = _global.herowisdom;
localInfo.data.slot3_lionrider = _global.lionrider;
localInfo.data.slot3_dragonrider = _global.dragonrider;
localInfo.data.slot3_grow = _global.grow;
localInfo.data.slot3_herocritical = _global.herocritical;
localInfo.data.slot3_meteor = _global.meteor;
localInfo.data.slot3_herolearned = _global.herolearned;
localInfo.data.slot3_troll = _global.troll;
localInfo.data.slot3_bloodlust = _global.bloodlust;
localInfo.data.slot3_golem = _global.golem;
localInfo.data.slot3_heal = _global.heal;
localInfo.data.slot3_herovampire = _global.herovampire;
localInfo.data.slot3_lvl2 = levelscomplete[2];
localInfo.data.slot3_lvl3 = levelscomplete[3];
localInfo.data.slot3_lvl4 = levelscomplete[4];
localInfo.data.slot3_lvl5 = levelscomplete[5];
localInfo.data.slot3_lvl6 = levelscomplete[6];
localInfo.data.slot3_lvl7 = levelscomplete[7];
localInfo.data.slot3_lvl8 = levelscomplete[8];
localInfo.data.slot3_lvl9 = levelscomplete[9];
localInfo.data.slot3_lvl10 = levelscomplete[10];
localInfo.data.slot3_lvl11 = levelscomplete[11];
localInfo.data.slot3_lvl12 = levelscomplete[12];
localInfo.data.slot3_lvl13 = levelscomplete[13];
localInfo.data.slot3_tip1 = _global.tip1;
localInfo.data.slot3_tip2 = _global.tip2;
localInfo.data.slot3_tip3 = _global.tip3;
localInfo.data.slot3_tip4 = _global.tip4;
localInfo.data.slot3_tip5 = _global.tip5;
localInfo.data.slot3_tip6 = _global.tip6;
localInfo.data.slot3_tip7 = _global.tip7;
localInfo.data.slot3_tip8 = _global.tip8;
localInfo.data.slot3_tip9 = _global.tip9;
localInfo.data.slot3_tip10 = _global.tip10;
localInfo.data.slot3_tip11 = _global.tip11;
localInfo.data.slot3_tip12 = _global.tip12;
}
Instance of Symbol 3021 MovieClip [selectlevel] "s5" in Frame 57
on (rollOver) {
if (_root.levelscomplete[4] > 0) {
this.gotoAndStop(3);
_root.ability_txt.text = "In the depths of the night a dark clan of warriors attack their rivals from the shadows, beware of the assassins!";
} else {
_root.ability_txt.text = "Not available, completion of 'Mighty River' is required.";
}
_root.screenshot.gotoAndStop(5);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[5] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if (_root.levelscomplete[4] > 0) {
_global.scene = 5;
_global.AIchief = "chief6";
_root.gotoAndPlay(52);
}
}
Instance of Symbol 3021 MovieClip [selectlevel] "s4" in Frame 57
on (rollOver) {
if (_root.levelscomplete[3] > 0) {
this.gotoAndStop(3);
_root.ability_txt.text = "At the end of the forest there is a massive raging river that can only be passed by one bridge guarded by a small fortification.";
} else {
_root.ability_txt.text = "Not available, completion of 'Forest Lane' is required.";
}
_root.screenshot.gotoAndStop(4);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[4] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if (_root.levelscomplete[3] > 0) {
_global.scene = 4;
_global.AIchief = "chief2";
_root.gotoAndPlay(52);
}
}
Instance of Symbol 3021 MovieClip [selectlevel] "s3" in Frame 57
on (rollOver) {
if (_root.levelscomplete[2] > 0) {
this.gotoAndStop(3);
_root.ability_txt.text = "On the fringe of the barren lands lies a strip of forest that has been densely populated by a clan of highly defensive Forest Goblins led by a strong Warrior Zimroc. Beware of his battle stomp.";
} else {
_root.ability_txt.text = "Not available, completion of 'Red Plains' is required.";
}
_root.screenshot.gotoAndStop(3);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[3] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if (_root.levelscomplete[2] > 0) {
_global.scene = 3;
_global.AIchief = "chief";
_root.gotoAndPlay(52);
}
}
Instance of Symbol 3021 MovieClip [selectlevel] "s2" in Frame 57
on (rollOver) {
this.gotoAndStop(3);
_root.ability_txt.text = "The blood rock clan have been growing in power, nestled in the mountains they are well protected. The clan is led by a warlock who is well known for his magical abilities to make himself invunerable to physical attacks whilst blasting fireballs at his enemies.";
_root.screenshot.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(2);
if (_root.levelscomplete[2] > 0) {
this.gotoAndStop(4);
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
_global.scene = 2;
_global.AIchief = "chief2";
_root.gotoAndPlay(52);
}
Instance of Symbol 3021 MovieClip [selectlevel] "s10" in Frame 57
on (rollOver) {
if (_root.levelscomplete[8] > 0) {
this.gotoAndStop(3);
_root.ability_txt.text = "Further across the desert there is a wide and deep canyon that must be traversed. Unexpectedly spies find there is another colony of beast trainers. Enraged by the defeat of their cousins they seem to have been preparing for revenge.";
} else {
_root.ability_txt.text = "Not available, completion of 'Great Dunes' is required.";
}
_root.screenshot.gotoAndStop(10);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[10] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if (_root.levelscomplete[8] > 0) {
_global.scene = 10;
_global.AIchief = "chief4";
_root.gotoAndPlay(52);
}
}
Instance of Symbol 3021 MovieClip [selectlevel] "s11" in Frame 57
on (rollOver) {
if ((_root.levelscomplete[9] > 0) or (_root.levelscomplete[10] > 0)) {
this.gotoAndStop(3);
_root.ability_txt.text = "A lush green forest lays before you. There seems to be an abundance of wild life, small rivers and birds singing in the treas. However, towering above the trees is a great tower and the shadows of Dragons flying overhead. Beware!";
} else {
_root.ability_txt.text = "Not available, completion of 'Deep Canyon' is required.";
}
_root.screenshot.gotoAndStop(11);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[11] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if ((_root.levelscomplete[9] > 0) or (_root.levelscomplete[10] > 0)) {
_global.scene = 11;
_global.AIchief = "chief6";
_root.gotoAndPlay(52);
}
}
Instance of Symbol 3021 MovieClip [selectlevel] "s12" in Frame 57
on (rollOver) {
if (_root.levelscomplete[11] > 0) {
this.gotoAndStop(3);
_root.ability_txt.text = "Recently a scout had located a cave full of precious metals, however it seems another Clan has recently found it as well and have begun to slaughter your miners. The only way to this clan is through the cave itself.";
} else {
_root.ability_txt.text = "Not available, completion of 'Lost Forest' is required.";
}
_root.screenshot.gotoAndStop(12);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[12] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if (_root.levelscomplete[11] > 0) {
_global.scene = 12;
_global.AIchief = "chief6";
_root.gotoAndPlay(52);
}
}
Instance of Symbol 3021 MovieClip [selectlevel] "s13" in Frame 57
on (rollOver) {
if (_root.levelscomplete[12] > 0) {
this.gotoAndStop(3);
_root.ability_txt.text = "Now before you stands the ultimate threat to your survival. I great champion that has been heralded for his many victories. Many strongholds have fallen to the unknown Champion. Know goblin has ever seen his face, some even suspect that he is not goblin at all but even a Human!";
} else {
_root.ability_txt.text = "Not available, completion of 'Cave Pass' is required.";
}
_root.screenshot.gotoAndStop(13);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[13] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if (_root.levelscomplete[12] > 0) {
_global.scene = 13;
_global.AIchief = "ChampionKnight";
_root.gotoAndPlay(52);
}
}
Instance of Symbol 3021 MovieClip [selectlevel] "s7" in Frame 57
on (rollOver) {
if (_root.levelscomplete[5] > 0) {
this.gotoAndStop(3);
_root.ability_txt.text = "In the murky swamp lives a filthy clan that have trained a vast amount of serpents to do their bidding.";
} else {
_root.ability_txt.text = "Not available, completion of 'Night Stalker' is required.";
}
_root.screenshot.gotoAndStop(6);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[7] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if (_root.levelscomplete[5] > 0) {
_global.scene = 7;
_global.AIchief = "chief";
_root.gotoAndPlay(52);
}
}
Instance of Symbol 3021 MovieClip [selectlevel] "s8" in Frame 57
on (rollOver) {
if (_root.levelscomplete[7] > 0) {
this.gotoAndStop(3);
_root.ability_txt.text = "Through the swamp you arrive at the large sandy dunes of the Comehen Desert. Bordered over one of the greatest dunes is an outpost of sand dwellers. These goblins have been known to be breeding large beasts for easy transport through the desert.";
} else {
_root.ability_txt.text = "Not available, completion of 'Swamp Things' is required.";
}
_root.screenshot.gotoAndStop(8);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[8] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if (_root.levelscomplete[7] > 0) {
_global.scene = 8;
_global.AIchief = "chief4";
_root.gotoAndPlay(52);
}
}
Instance of Symbol 3024 MovieClip [selectlevel2] "s6" in Frame 57
on (rollOver) {
if (_global.bonusunlocked) {
this.gotoAndStop(3);
_root.ability_txt.text = "In one of you outposts, some of your acoyltes have unleashed a rift between the demon world that has taken control of the stronghold. The goblins are possessed and lead by a powerful demon lord.";
} else {
_root.ability_txt.text = "BONUS LEVEL - LOCKED.\rClick to Unlock this LEVEL, Bonus HEROES, Gold and Skill Points.";
}
_root.screenshot.gotoAndStop(7);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[6] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
}
on (release) {
if (_global.bonusunlocked) {
_global.scene = 6;
_global.AIchief = "wingeddemon";
_root.gotoAndPlay(52);
} else {
_root.attachMovie("BonusBox", "BonusBox", 2125);
_root.BonusBox._x = 150;
_root.BonusBox._y = 50;
}
_root.screenshot.gotoAndStop(1);
}
Instance of Symbol 3024 MovieClip [selectlevel2] "s9" in Frame 57
on (rollOver) {
if (_global.bonusunlocked) {
this.gotoAndStop(3);
_root.ability_txt.text = "The Necro clan have finally realised the ability to raise the dead knights of the past, slowly they are building a great army to challenge your new found leadership.";
} else {
_root.ability_txt.text = "BONUS LEVEL - LOCKED.\rClick to Unlock this LEVEL, Bonus HEROES, Gold and Skill Points.";
}
_root.screenshot.gotoAndStop(9);
}
on (rollOut) {
if (this._currentframe > 2) {
this.gotoAndStop(2);
if (_root.levelscomplete[9] > 0) {
this.gotoAndStop(4);
}
_root.ability_txt.text = "Please Select an available Level to Play.";
}
_root.screenshot.gotoAndStop(1);
}
on (release) {
if (_global.bonusunlocked) {
_global.scene = 9;
_global.AIchief = "undeadknight";
_root.gotoAndPlay(52);
} else {
_root.attachMovie("BonusBox", "BonusBox", 2125);
_root.BonusBox._x = 150;
_root.BonusBox._y = 50;
}
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 57
on (release) {
_root.gotoAndStop(51);
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 57
on (release) {
_root.gotoAndStop(58);
}
Frame 58
stop();
if (_global.tip11 == 0) {
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 100;
_root.Tip._x = 200;
_root.Tip.gotoAndStop(11);
_global.tip11 = 1;
}
if (_root.levelscomplete[13] > 0) {
if (_global.tip12 == 0) {
_root.attachMovie("Tip", "Tip", 2125);
_root.Tip._y = 0;
_root.Tip._x = 0;
_root.Tip.gotoAndStop(12);
_global.tip12 = 1;
}
}
leveltxt = "Level " + _global.masterlevel;
exptxt = "Experience " + Math.round(_global.gexperience);
skillpointstxt.text = _global.skillpoints;
icon_thrift.iconholder.iconno.text = _global.thrift + "/5";
icon_thrift.gotoAndStop(1);
icon_masonry.iconholder.iconno.text = _global.masonry + "/5";
if (_global.thrift > 0) {
icon_masonry.gotoAndStop(1);
} else {
icon_masonry.gotoAndStop(2);
}
icon_fame.iconholder.iconno.text = _global.fame + "/5";
if (_global.masonry > 0) {
icon_fame.gotoAndStop(1);
} else {
icon_fame.gotoAndStop(2);
}
icon_vault.iconholder.iconno.text = _global.vault + "/5";
if (_global.fame > 0) {
icon_vault.gotoAndStop(1);
} else {
icon_vault.gotoAndStop(2);
}
icon_training.iconholder.iconno.text = _global.training + "/5";
if (_global.vault > 0) {
icon_training.gotoAndStop(1);
} else {
icon_training.gotoAndStop(2);
}
icon_fortitude.iconholder.iconno.text = _global.fortitude + "/5";
if (_global.training > 0) {
icon_fortitude.gotoAndStop(1);
} else {
icon_fortitude.gotoAndStop(2);
}
icon_wisdom.iconholder.iconno.text = _global.wisdom + "/5";
if (_global.fortitude > 0) {
icon_wisdom.gotoAndStop(1);
} else {
icon_wisdom.gotoAndStop(2);
}
icon_presence.iconholder.iconno.text = _global.presence + "/5";
if (_global.wisdom > 0) {
icon_presence.gotoAndStop(1);
} else {
icon_presence.gotoAndStop(2);
}
icon_herohealth.iconholder.iconno.text = _global.herohealth + "/10";
if (_global.masonry > 0) {
icon_herohealth.gotoAndStop(1);
} else {
icon_herohealth.gotoAndStop(2);
}
icon_backstab.iconholder.iconno.text = _global.backstab + "/5";
if (_global.herohealth > 0) {
icon_backstab.gotoAndStop(1);
} else {
icon_backstab.gotoAndStop(2);
}
icon_fistpower.iconholder.iconno.text = _global.fistpower + "/5";
if (_global.backstab > 0) {
icon_fistpower.gotoAndStop(1);
} else {
icon_fistpower.gotoAndStop(2);
}
icon_herowisdom.iconholder.iconno.text = _global.herowisdom + "/10";
if (_global.fame > 0) {
icon_herowisdom.gotoAndStop(1);
} else {
icon_herowisdom.gotoAndStop(2);
}
icon_lionrider.iconholder.iconno.text = _global.lionrider + "/1";
if (_global.herowisdom > 0) {
icon_lionrider.gotoAndStop(1);
} else {
icon_lionrider.gotoAndStop(2);
}
icon_dragonrider.iconholder.iconno.text = _global.dragonrider + "/1";
if (_global.wisdom > 0) {
icon_dragonrider.gotoAndStop(1);
} else {
icon_dragonrider.gotoAndStop(2);
}
icon_grow.iconholder.iconno.text = _global.grow + "/1";
if (_global.golem > 0) {
icon_grow.gotoAndStop(1);
} else {
icon_grow.gotoAndStop(2);
}
icon_herocritical.iconholder.iconno.text = _global.herocritical + "/10";
if (_global.training > 0) {
icon_herocritical.gotoAndStop(1);
} else {
icon_herocritical.gotoAndStop(2);
}
icon_meteor.iconholder.iconno.text = _global.meteor + "/1";
if (_global.herocritical > 0) {
icon_meteor.gotoAndStop(1);
} else {
icon_meteor.gotoAndStop(2);
}
icon_herolearned.iconholder.iconno.text = _global.herolearned + "/10";
if (_global.fortitude > 0) {
icon_herolearned.gotoAndStop(1);
} else {
icon_herolearned.gotoAndStop(2);
}
icon_troll.iconholder.iconno.text = _global.troll + "/1";
if (_global.herolearned > 0) {
icon_troll.gotoAndStop(1);
} else {
icon_troll.gotoAndStop(2);
}
icon_bloodlust.iconholder.iconno.text = _global.bloodlust + "/1";
if (_global.troll > 0) {
icon_bloodlust.gotoAndStop(1);
} else {
icon_bloodlust.gotoAndStop(2);
}
icon_golem.iconholder.iconno.text = _global.golem + "/1";
if (_global.vault > 0) {
icon_golem.gotoAndStop(1);
} else {
icon_golem.gotoAndStop(2);
}
icon_heal.iconholder.iconno.text = _global.heal + "/1";
if (_global.dragonrider > 0) {
icon_heal.gotoAndStop(1);
} else {
icon_heal.gotoAndStop(2);
}
icon_herovampire.iconholder.iconno.text = _global.herovampire + "/10";
if (_global.presence > 0) {
icon_herovampire.gotoAndStop(1);
} else {
icon_herovampire.gotoAndStop(2);
}
if (_global.slotno == 1) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot1 = 1;
localInfo.data.slot1_class = _global.chief;
localInfo.data.slot1_level = _global.masterlevel;
localInfo.data.slot1_exp = _global.gexperience;
localInfo.data.slot1_difficulty = _global.difficulty;
localInfo.data.slot1_class = _global.chief;
localInfo.data.slot1_skillpoints = _global.skillpoints;
localInfo.data.slot1_vault = _global.vault;
localInfo.data.slot1_masonry = _global.masonry;
localInfo.data.slot1_fame = _global.fame;
localInfo.data.slot1_thrift = _global.thrift;
localInfo.data.slot1_training = _global.training;
localInfo.data.slot1_fortitude = _global.fortitude;
localInfo.data.slot1_wisdom = _global.wisdom;
localInfo.data.slot1_presence = _global.presence;
localInfo.data.slot1_herohealth = _global.herohealth;
localInfo.data.slot1_backstab = _global.backstab;
localInfo.data.slot1_fistpower = _global.fistpower;
localInfo.data.slot1_herowisdom = _global.herowisdom;
localInfo.data.slot1_lionrider = _global.lionrider;
localInfo.data.slot1_dragonrider = _global.dragonrider;
localInfo.data.slot1_grow = _global.grow;
localInfo.data.slot1_herocritical = _global.herocritical;
localInfo.data.slot1_meteor = _global.meteor;
localInfo.data.slot1_herolearned = _global.herolearned;
localInfo.data.slot1_troll = _global.troll;
localInfo.data.slot1_bloodlust = _global.bloodlust;
localInfo.data.slot1_golem = _global.golem;
localInfo.data.slot1_heal = _global.heal;
localInfo.data.slot1_herovampire = _global.herovampire;
localInfo.data.slot1_lvl2 = levelscomplete[2];
localInfo.data.slot1_lvl3 = levelscomplete[3];
localInfo.data.slot1_lvl4 = levelscomplete[4];
localInfo.data.slot1_lvl5 = levelscomplete[5];
localInfo.data.slot1_lvl6 = levelscomplete[6];
localInfo.data.slot1_lvl7 = levelscomplete[7];
localInfo.data.slot1_lvl8 = levelscomplete[8];
localInfo.data.slot1_lvl9 = levelscomplete[9];
localInfo.data.slot1_lvl10 = levelscomplete[10];
localInfo.data.slot1_lvl11 = levelscomplete[11];
localInfo.data.slot1_lvl12 = levelscomplete[12];
localInfo.data.slot1_lvl13 = levelscomplete[13];
localInfo.data.slot1_tip1 = _global.tip1;
localInfo.data.slot1_tip2 = _global.tip2;
localInfo.data.slot1_tip3 = _global.tip3;
localInfo.data.slot1_tip4 = _global.tip4;
localInfo.data.slot1_tip5 = _global.tip5;
localInfo.data.slot1_tip6 = _global.tip6;
localInfo.data.slot1_tip7 = _global.tip7;
localInfo.data.slot1_tip8 = _global.tip8;
localInfo.data.slot1_tip9 = _global.tip9;
localInfo.data.slot1_tip10 = _global.tip10;
localInfo.data.slot1_tip11 = _global.tip11;
localInfo.data.slot1_tip12 = _global.tip12;
} else if (_global.slotno == 2) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot2 = 1;
localInfo.data.slot2_class = _global.chief;
localInfo.data.slot2_level = _global.masterlevel;
localInfo.data.slot2_exp = _global.gexperience;
localInfo.data.slot2_difficulty = _global.difficulty;
localInfo.data.slot2_class = _global.chief;
localInfo.data.slot2_skillpoints = _global.skillpoints;
localInfo.data.slot2_vault = _global.vault;
localInfo.data.slot2_masonry = _global.masonry;
localInfo.data.slot2_fame = _global.fame;
localInfo.data.slot2_thrift = _global.thrift;
localInfo.data.slot2_training = _global.training;
localInfo.data.slot2_fortitude = _global.fortitude;
localInfo.data.slot2_wisdom = _global.wisdom;
localInfo.data.slot2_presence = _global.presence;
localInfo.data.slot2_herohealth = _global.herohealth;
localInfo.data.slot2_backstab = _global.backstab;
localInfo.data.slot2_fistpower = _global.fistpower;
localInfo.data.slot2_herowisdom = _global.herowisdom;
localInfo.data.slot2_lionrider = _global.lionrider;
localInfo.data.slot2_dragonrider = _global.dragonrider;
localInfo.data.slot2_grow = _global.grow;
localInfo.data.slot2_herocritical = _global.herocritical;
localInfo.data.slot2_meteor = _global.meteor;
localInfo.data.slot2_herolearned = _global.herolearned;
localInfo.data.slot2_troll = _global.troll;
localInfo.data.slot2_bloodlust = _global.bloodlust;
localInfo.data.slot2_golem = _global.golem;
localInfo.data.slot2_heal = _global.heal;
localInfo.data.slot2_herovampire = _global.herovampire;
localInfo.data.slot2_lvl2 = levelscomplete[2];
localInfo.data.slot2_lvl3 = levelscomplete[3];
localInfo.data.slot2_lvl4 = levelscomplete[4];
localInfo.data.slot2_lvl5 = levelscomplete[5];
localInfo.data.slot2_lvl6 = levelscomplete[6];
localInfo.data.slot2_lvl7 = levelscomplete[7];
localInfo.data.slot2_lvl8 = levelscomplete[8];
localInfo.data.slot2_lvl9 = levelscomplete[9];
localInfo.data.slot2_lvl10 = levelscomplete[10];
localInfo.data.slot2_lvl11 = levelscomplete[11];
localInfo.data.slot2_lvl12 = levelscomplete[12];
localInfo.data.slot2_lvl13 = levelscomplete[13];
localInfo.data.slot2_tip1 = _global.tip1;
localInfo.data.slot2_tip2 = _global.tip2;
localInfo.data.slot2_tip3 = _global.tip3;
localInfo.data.slot2_tip4 = _global.tip4;
localInfo.data.slot2_tip5 = _global.tip5;
localInfo.data.slot2_tip6 = _global.tip6;
localInfo.data.slot2_tip7 = _global.tip7;
localInfo.data.slot2_tip8 = _global.tip8;
localInfo.data.slot2_tip9 = _global.tip9;
localInfo.data.slot2_tip10 = _global.tip10;
localInfo.data.slot2_tip11 = _global.tip11;
localInfo.data.slot2_tip12 = _global.tip12;
} else if (_global.slotno == 3) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot3 = 1;
localInfo.data.slot3_class = _global.chief;
localInfo.data.slot3_level = _global.masterlevel;
localInfo.data.slot3_exp = _global.gexperience;
localInfo.data.slot3_difficulty = _global.difficulty;
localInfo.data.slot3_class = _global.chief;
localInfo.data.slot3_skillpoints = _global.skillpoints;
localInfo.data.slot3_vault = _global.vault;
localInfo.data.slot3_masonry = _global.masonry;
localInfo.data.slot3_fame = _global.fame;
localInfo.data.slot3_thrift = _global.thrift;
localInfo.data.slot3_training = _global.training;
localInfo.data.slot3_fortitude = _global.fortitude;
localInfo.data.slot3_wisdom = _global.wisdom;
localInfo.data.slot3_presence = _global.presence;
localInfo.data.slot3_herohealth = _global.herohealth;
localInfo.data.slot3_backstab = _global.backstab;
localInfo.data.slot3_fistpower = _global.fistpower;
localInfo.data.slot3_herowisdom = _global.herowisdom;
localInfo.data.slot3_lionrider = _global.lionrider;
localInfo.data.slot3_dragonrider = _global.dragonrider;
localInfo.data.slot3_grow = _global.grow;
localInfo.data.slot3_herocritical = _global.herocritical;
localInfo.data.slot3_meteor = _global.meteor;
localInfo.data.slot3_herolearned = _global.herolearned;
localInfo.data.slot3_troll = _global.troll;
localInfo.data.slot3_bloodlust = _global.bloodlust;
localInfo.data.slot3_golem = _global.golem;
localInfo.data.slot3_heal = _global.heal;
localInfo.data.slot3_herovampire = _global.herovampire;
localInfo.data.slot3_lvl2 = levelscomplete[2];
localInfo.data.slot3_lvl3 = levelscomplete[3];
localInfo.data.slot3_lvl4 = levelscomplete[4];
localInfo.data.slot3_lvl5 = levelscomplete[5];
localInfo.data.slot3_lvl6 = levelscomplete[6];
localInfo.data.slot3_lvl7 = levelscomplete[7];
localInfo.data.slot3_lvl8 = levelscomplete[8];
localInfo.data.slot3_lvl9 = levelscomplete[9];
localInfo.data.slot3_lvl10 = levelscomplete[10];
localInfo.data.slot3_lvl11 = levelscomplete[11];
localInfo.data.slot3_lvl12 = levelscomplete[12];
localInfo.data.slot3_lvl13 = levelscomplete[13];
localInfo.data.slot3_tip1 = _global.tip1;
localInfo.data.slot3_tip2 = _global.tip2;
localInfo.data.slot3_tip3 = _global.tip3;
localInfo.data.slot3_tip4 = _global.tip4;
localInfo.data.slot3_tip5 = _global.tip5;
localInfo.data.slot3_tip6 = _global.tip6;
localInfo.data.slot3_tip7 = _global.tip7;
localInfo.data.slot3_tip8 = _global.tip8;
localInfo.data.slot3_tip9 = _global.tip9;
localInfo.data.slot3_tip10 = _global.tip10;
localInfo.data.slot3_tip11 = _global.tip11;
localInfo.data.slot3_tip12 = _global.tip12;
}
Instance of Symbol 3074 MovieClip [icon_wisdom] "icon_herowisdom" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.herowisdom);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.herowisdom < 10) {
trace("trace 3");
_global.herowisdom++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_herowisdom.iconholder.iconno.text = _global.herowisdom + "/10";
_root.abilitybox.ability_header.text = ("Hero Wisdom [" + _global.herowisdom) + "/10]";
}
if (_global.herowisdom < 10) {
_root.abilitybox.ability_txt.text = ((("Increases Hero Startup Experience by " + ((1 + _global.herowisdom) * 500)) + ". [Currently ") + (_global.herowisdom * 500)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Hero Startup Experience. MAXED at 5,000XP.";
}
_root.icon_lionrider.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Hero Wisdom [" + _global.herowisdom) + "/10]";
if (_global.herowisdom < 10) {
_root.abilitybox.ability_txt.text = ((("Increases Hero Startup Experience by " + ((1 + _global.herowisdom) * 500)) + ". [Currently ") + (_global.herowisdom * 500)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Hero Startup Experience. MAXED at 5,000XP.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Hero Wisdom Requires Fame";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3077 MovieClip [icon_fortitude] "icon_fortitude" in Frame 58
on (release) {
trace("_global.skillpoints = " + _global.skillpoints);
trace("_global.fortitude = " + _global.fortitude);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.fortitude < 5) {
trace("trace 3");
_global.fortitude++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_fortitude.iconholder.iconno.text = _global.fortitude + "/5";
_root.abilitybox.ability_header.text = ("Fortitude Upgrade [" + _global.fortitude) + "/5]";
}
if (_global.fortitude < 5) {
_root.abilitybox.ability_txt.text = ((((((("Increases Tower Hit Points by " + ((1 + _global.fortitude) * 1000)) + " and repair rate by ") + (1 + _global.fortitude)) + ". [Currently ") + (_global.fortitude * 1000)) + " and ") + _global.fortitude) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Tower Hit Points and Repair Rate. MAXED at 5,000HP and Bonus and +5 Repair Rate.";
}
_root.icon_wisdom.gotoAndStop(1);
_root.icon_herolearned.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Fortitude Upgrade [" + _global.fortitude) + "/5]";
if (_global.fortitude < 5) {
_root.abilitybox.ability_txt.text = ((((((("Increases Tower Hit Points by " + ((1 + _global.fortitude) * 1000)) + " and repair rate by ") + (1 + _global.fortitude)) + ". [Currently ") + (_global.fortitude * 1000)) + " and ") + _global.fortitude) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Tower Hit Points and Repair Rate. MAXED at 5,000HP and Bonus and +5 Repair Rate.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Fortitude Requires Training";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3078 MovieClip [icon_presence] "icon_presence" in Frame 58
on (release) {
trace("_global.presence = " + _global.skillpoints);
trace("_global.presence = " + _global.presence);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.presence < 5) {
trace("trace 3");
_global.presence++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_presence.iconholder.iconno.text = _global.presence + "/5";
_root.abilitybox.ability_header.text = ("Presence Upgrade [" + _global.presence) + "/5]";
}
if (_global.presence < 5) {
_root.abilitybox.ability_txt.text = ((("Increases Startup Reputation by " + ((1 + _global.presence) * 50)) + ". [Currently ") + (_global.presence * 50)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Startup Reputation. MAXED at 250.";
}
_root.icon_herovampire.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Presence Upgrade [" + _global.presence) + "/5]";
if (_global.presence < 5) {
_root.abilitybox.ability_txt.text = ((("Increases Startup Reputation by " + ((1 + _global.presence) * 50)) + ". [Currently ") + (_global.presence * 50)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Startup Reputation. MAXED at 250.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Presence REQUIRES Wisdom";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3080 MovieClip [icon_criticalstrike] "icon_herocritical" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.herocritical);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.herocritical < 10) {
trace("trace 3");
_global.herocritical++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_herocritical.iconholder.iconno.text = _global.herocritical + "/10";
_root.abilitybox.ability_header.text = ("Hero Critical [" + _global.herocritical) + "/10]";
}
if (_global.herocritical < 10) {
_root.abilitybox.ability_txt.text = ((("Adds chance to do critical (double) damage. +" + ((1 + _global.herocritical) * 5)) + "% chance. [Currently +") + (_global.herocritical * 5)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Adds chance to do critical (double) damage. MAXED at +50% chance.";
}
_root.icon_meteor.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Hero Critical [" + _global.herocritical) + "/10]";
if (_global.herocritical < 10) {
_root.abilitybox.ability_txt.text = ((("Adds chance to do critical (double) damage. +" + ((1 + _global.herocritical) * 5)) + "% chance. [Currently +") + (_global.herocritical * 5)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Adds chance to do critical (double) damage. MAXED at +50% chance.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Hero Critical Requires Training";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3083 MovieClip [icon_heroxpgain] "icon_herolearned" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.herolearned);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.herolearned < 10) {
trace("trace 3");
_global.herolearned++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_herolearned.iconholder.iconno.text = _global.herolearned + "/10";
_root.abilitybox.ability_header.text = ("Learned Hero [" + _global.herolearned) + "/10]";
}
if (_global.herolearned < 10) {
_root.abilitybox.ability_txt.text = ((("Increase the rate your hero gaines experience. +" + ((1 + _global.herolearned) * 10)) + "%. [Currently +") + (_global.herolearned * 10)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Increase the rate your hero gaines experience. MAXED at +100%.";
}
_root.icon_troll.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Learned Hero [" + _global.herolearned) + "/10]";
if (_global.herolearned < 10) {
_root.abilitybox.ability_txt.text = ((("Increase the rate your hero gaines experience. +" + ((1 + _global.herolearned) * 10)) + "%. [Currently +") + (_global.herolearned * 10)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Increase the rate your hero gaines experience. MAXED at +100%.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Hero Critical Requires Fortitude";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3086 MovieClip [icon_vampire] "icon_herovampire" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.herovampire);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.herovampire < 10) {
trace("trace 3");
_global.herovampire++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_herovampire.iconholder.iconno.text = _global.herovampire + "/10";
_root.abilitybox.ability_header.text = ("Hero Vampirism [" + _global.herovampire) + "/10]";
}
if (_global.herovampire < 10) {
_root.abilitybox.ability_txt.text = ((("Your hero obsorbs a small percentage from the damage done to his opponent. +" + ((1 + _global.herovampire) * 3)) + "%. [Currently +") + (_global.herovampire * 3)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Your hero obsorbs a small percentage from the damage done to his opponent. MAXED at +30%.";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Hero Vampirism [" + _global.herovampire) + "/10]";
if (_global.herovampire < 10) {
_root.abilitybox.ability_txt.text = ((("Your hero obsorbs a small percentage from the damage done to his opponent. +" + ((1 + _global.herovampire) * 3)) + "%. [Currently +") + (_global.herovampire * 3)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Your hero obsorbs a small percentage from the damage done to his opponent. MAXED at +30%.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Hero Critical Requires Training";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 58
on (release) {
if (_global.slotno == 1) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot1 = 1;
localInfo.data.slot1_class = _global.chief;
localInfo.data.slot1_level = _global.masterlevel;
localInfo.data.slot1_exp = _global.gexperience;
localInfo.data.slot1_difficulty = _global.difficulty;
localInfo.data.slot1_class = _global.chief;
localInfo.data.slot1_skillpoints = _global.skillpoints;
localInfo.data.slot1_vault = _global.vault;
localInfo.data.slot1_masonry = _global.masonry;
localInfo.data.slot1_fame = _global.fame;
localInfo.data.slot1_thrift = _global.thrift;
localInfo.data.slot1_training = _global.training;
localInfo.data.slot1_fortitude = _global.fortitude;
localInfo.data.slot1_wisdom = _global.wisdom;
localInfo.data.slot1_presence = _global.presence;
localInfo.data.slot1_herohealth = _global.herohealth;
localInfo.data.slot1_backstab = _global.backstab;
localInfo.data.slot1_fistpower = _global.fistpower;
localInfo.data.slot1_herowisdom = _global.herowisdom;
localInfo.data.slot1_lionrider = _global.lionrider;
localInfo.data.slot1_dragonrider = _global.dragonrider;
localInfo.data.slot1_grow = _global.grow;
localInfo.data.slot1_herocritical = _global.herocritical;
localInfo.data.slot1_meteor = _global.meteor;
localInfo.data.slot1_herolearned = _global.herolearned;
localInfo.data.slot1_troll = _global.troll;
localInfo.data.slot1_bloodlust = _global.bloodlust;
localInfo.data.slot1_golem = _global.golem;
localInfo.data.slot1_heal = _global.heal;
localInfo.data.slot1_herovampire = _global.herovampire;
localInfo.data.slot1_lvl2 = _root.levelscomplete[2];
localInfo.data.slot1_lvl3 = _root.levelscomplete[3];
localInfo.data.slot1_lvl4 = _root.levelscomplete[4];
localInfo.data.slot1_lvl5 = _root.levelscomplete[5];
localInfo.data.slot1_lvl6 = _root.levelscomplete[6];
localInfo.data.slot1_lvl7 = _root.levelscomplete[7];
localInfo.data.slot1_lvl8 = _root.levelscomplete[8];
localInfo.data.slot1_lvl9 = _root.levelscomplete[9];
localInfo.data.slot1_lvl10 = _root.levelscomplete[10];
localInfo.data.slot1_lvl11 = _root.levelscomplete[11];
localInfo.data.slot1_lvl12 = _root.levelscomplete[12];
localInfo.data.slot1_lvl13 = _root.levelscomplete[13];
localInfo.data.slot1_tip1 = _global.tip1;
localInfo.data.slot1_tip2 = _global.tip2;
localInfo.data.slot1_tip3 = _global.tip3;
localInfo.data.slot1_tip4 = _global.tip4;
localInfo.data.slot1_tip5 = _global.tip5;
localInfo.data.slot1_tip6 = _global.tip6;
localInfo.data.slot1_tip7 = _global.tip7;
localInfo.data.slot1_tip8 = _global.tip8;
localInfo.data.slot1_tip9 = _global.tip9;
localInfo.data.slot1_tip10 = _global.tip10;
localInfo.data.slot1_tip11 = _global.tip11;
localInfo.data.slot1_tip12 = _global.tip12;
localInfo.data.bonusunlocked = _global.bonusunlocked;
} else if (_global.slotno == 2) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot2 = 1;
localInfo.data.slot2_class = _global.chief;
localInfo.data.slot2_level = _global.masterlevel;
localInfo.data.slot2_exp = _global.gexperience;
localInfo.data.slot2_difficulty = _global.difficulty;
localInfo.data.slot2_class = _global.chief;
localInfo.data.slot2_skillpoints = _global.skillpoints;
localInfo.data.slot2_vault = _global.vault;
localInfo.data.slot2_masonry = _global.masonry;
localInfo.data.slot2_fame = _global.fame;
localInfo.data.slot2_thrift = _global.thrift;
localInfo.data.slot2_training = _global.training;
localInfo.data.slot2_fortitude = _global.fortitude;
localInfo.data.slot2_wisdom = _global.wisdom;
localInfo.data.slot2_presence = _global.presence;
localInfo.data.slot2_herohealth = _global.herohealth;
localInfo.data.slot2_backstab = _global.backstab;
localInfo.data.slot2_fistpower = _global.fistpower;
localInfo.data.slot2_herowisdom = _global.herowisdom;
localInfo.data.slot2_lionrider = _global.lionrider;
localInfo.data.slot2_dragonrider = _global.dragonrider;
localInfo.data.slot2_grow = _global.grow;
localInfo.data.slot2_herocritical = _global.herocritical;
localInfo.data.slot2_meteor = _global.meteor;
localInfo.data.slot2_herolearned = _global.herolearned;
localInfo.data.slot2_troll = _global.troll;
localInfo.data.slot2_bloodlust = _global.bloodlust;
localInfo.data.slot2_golem = _global.golem;
localInfo.data.slot2_heal = _global.heal;
localInfo.data.slot2_herovampire = _global.herovampire;
localInfo.data.slot2_lvl2 = _root.levelscomplete[2];
localInfo.data.slot2_lvl3 = _root.levelscomplete[3];
localInfo.data.slot2_lvl4 = _root.levelscomplete[4];
localInfo.data.slot2_lvl5 = _root.levelscomplete[5];
localInfo.data.slot2_lvl6 = _root.levelscomplete[6];
localInfo.data.slot2_lvl7 = _root.levelscomplete[7];
localInfo.data.slot2_lvl8 = _root.levelscomplete[8];
localInfo.data.slot2_lvl9 = _root.levelscomplete[9];
localInfo.data.slot2_lvl10 = _root.levelscomplete[10];
localInfo.data.slot2_lvl11 = _root.levelscomplete[11];
localInfo.data.slot2_lvl12 = _root.levelscomplete[12];
localInfo.data.slot2_lvl13 = _root.levelscomplete[13];
localInfo.data.slot2_tip1 = _global.tip1;
localInfo.data.slot2_tip2 = _global.tip2;
localInfo.data.slot2_tip3 = _global.tip3;
localInfo.data.slot2_tip4 = _global.tip4;
localInfo.data.slot2_tip5 = _global.tip5;
localInfo.data.slot2_tip6 = _global.tip6;
localInfo.data.slot2_tip7 = _global.tip7;
localInfo.data.slot2_tip8 = _global.tip8;
localInfo.data.slot2_tip9 = _global.tip9;
localInfo.data.slot2_tip10 = _global.tip10;
localInfo.data.slot2_tip11 = _global.tip11;
localInfo.data.slot2_tip12 = _global.tip12;
localInfo.data.bonusunlocked = _global.bonusunlocked;
} else if (_global.slotno == 3) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot3 = 1;
localInfo.data.slot3_class = _global.chief;
localInfo.data.slot3_level = _global.masterlevel;
localInfo.data.slot3_exp = _global.gexperience;
localInfo.data.slot3_difficulty = _global.difficulty;
localInfo.data.slot3_class = _global.chief;
localInfo.data.slot3_skillpoints = _global.skillpoints;
localInfo.data.slot3_vault = _global.vault;
localInfo.data.slot3_masonry = _global.masonry;
localInfo.data.slot3_fame = _global.fame;
localInfo.data.slot3_thrift = _global.thrift;
localInfo.data.slot3_training = _global.training;
localInfo.data.slot3_fortitude = _global.fortitude;
localInfo.data.slot3_wisdom = _global.wisdom;
localInfo.data.slot3_presence = _global.presence;
localInfo.data.slot3_herohealth = _global.herohealth;
localInfo.data.slot3_backstab = _global.backstab;
localInfo.data.slot3_fistpower = _global.fistpower;
localInfo.data.slot3_herowisdom = _global.herowisdom;
localInfo.data.slot3_lionrider = _global.lionrider;
localInfo.data.slot3_dragonrider = _global.dragonrider;
localInfo.data.slot3_grow = _global.grow;
localInfo.data.slot3_herocritical = _global.herocritical;
localInfo.data.slot3_meteor = _global.meteor;
localInfo.data.slot3_herolearned = _global.herolearned;
localInfo.data.slot3_troll = _global.troll;
localInfo.data.slot3_bloodlust = _global.bloodlust;
localInfo.data.slot3_golem = _global.golem;
localInfo.data.slot3_heal = _global.heal;
localInfo.data.slot3_herovampire = _global.herovampire;
localInfo.data.slot3_lvl2 = _root.levelscomplete[2];
localInfo.data.slot3_lvl3 = _root.levelscomplete[3];
localInfo.data.slot3_lvl4 = _root.levelscomplete[4];
localInfo.data.slot3_lvl5 = _root.levelscomplete[5];
localInfo.data.slot3_lvl6 = _root.levelscomplete[6];
localInfo.data.slot3_lvl7 = _root.levelscomplete[7];
localInfo.data.slot3_lvl8 = _root.levelscomplete[8];
localInfo.data.slot3_lvl9 = _root.levelscomplete[9];
localInfo.data.slot3_lvl10 = _root.levelscomplete[10];
localInfo.data.slot3_lvl11 = _root.levelscomplete[11];
localInfo.data.slot3_lvl12 = _root.levelscomplete[12];
localInfo.data.slot3_lvl13 = _root.levelscomplete[13];
localInfo.data.slot3_tip1 = _global.tip1;
localInfo.data.slot3_tip2 = _global.tip2;
localInfo.data.slot3_tip3 = _global.tip3;
localInfo.data.slot3_tip4 = _global.tip4;
localInfo.data.slot3_tip5 = _global.tip5;
localInfo.data.slot3_tip6 = _global.tip6;
localInfo.data.slot3_tip7 = _global.tip7;
localInfo.data.slot3_tip8 = _global.tip8;
localInfo.data.slot3_tip9 = _global.tip9;
localInfo.data.slot3_tip10 = _global.tip10;
localInfo.data.slot3_tip11 = _global.tip11;
localInfo.data.slot3_tip12 = _global.tip12;
localInfo.data.bonusunlocked = _global.bonusunlocked;
}
trace("SLOT = " + _global.slotno);
trace("Level 1 = " + _root.levelscomplete[2]);
trace("Level 1[1] = " + localInfo.data.slot1_lvl2);
_root.overhero = false;
_root.gotoAndStop(57);
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 58
on (release) {
if (_global.slotno == 1) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot1 = 1;
localInfo.data.slot1_class = _global.chief;
localInfo.data.slot1_level = _global.masterlevel;
localInfo.data.slot1_exp = _global.gexperience;
localInfo.data.slot1_difficulty = _global.difficulty;
localInfo.data.slot1_class = _global.chief;
localInfo.data.slot1_skillpoints = _global.skillpoints;
localInfo.data.slot1_vault = _global.vault;
localInfo.data.slot1_masonry = _global.masonry;
localInfo.data.slot1_fame = _global.fame;
localInfo.data.slot1_thrift = _global.thrift;
localInfo.data.slot1_training = _global.training;
localInfo.data.slot1_fortitude = _global.fortitude;
localInfo.data.slot1_wisdom = _global.wisdom;
localInfo.data.slot1_presence = _global.presence;
localInfo.data.slot1_herohealth = _global.herohealth;
localInfo.data.slot1_backstab = _global.backstab;
localInfo.data.slot1_fistpower = _global.fistpower;
localInfo.data.slot1_herowisdom = _global.herowisdom;
localInfo.data.slot1_lionrider = _global.lionrider;
localInfo.data.slot1_dragonrider = _global.dragonrider;
localInfo.data.slot1_grow = _global.grow;
localInfo.data.slot1_herocritical = _global.herocritical;
localInfo.data.slot1_meteor = _global.meteor;
localInfo.data.slot1_herolearned = _global.herolearned;
localInfo.data.slot1_troll = _global.troll;
localInfo.data.slot1_bloodlust = _global.bloodlust;
localInfo.data.slot1_golem = _global.golem;
localInfo.data.slot1_heal = _global.heal;
localInfo.data.slot1_herovampire = _global.herovampire;
localInfo.data.slot1_lvl2 = _root.levelscomplete[2];
localInfo.data.slot1_lvl3 = _root.levelscomplete[3];
localInfo.data.slot1_lvl4 = _root.levelscomplete[4];
localInfo.data.slot1_lvl5 = _root.levelscomplete[5];
localInfo.data.slot1_lvl6 = _root.levelscomplete[6];
localInfo.data.slot1_lvl7 = _root.levelscomplete[7];
localInfo.data.slot1_lvl8 = _root.levelscomplete[8];
localInfo.data.slot1_lvl9 = _root.levelscomplete[9];
localInfo.data.slot1_lvl10 = _root.levelscomplete[10];
localInfo.data.slot1_lvl11 = _root.levelscomplete[11];
localInfo.data.slot1_lvl12 = _root.levelscomplete[12];
localInfo.data.slot1_lvl13 = _root.levelscomplete[13];
localInfo.data.slot1_tip1 = _global.tip1;
localInfo.data.slot1_tip2 = _global.tip2;
localInfo.data.slot1_tip3 = _global.tip3;
localInfo.data.slot1_tip4 = _global.tip4;
localInfo.data.slot1_tip5 = _global.tip5;
localInfo.data.slot1_tip6 = _global.tip6;
localInfo.data.slot1_tip7 = _global.tip7;
localInfo.data.slot1_tip8 = _global.tip8;
localInfo.data.slot1_tip9 = _global.tip9;
localInfo.data.slot1_tip10 = _global.tip10;
localInfo.data.slot1_tip11 = _global.tip11;
localInfo.data.slot1_tip12 = _global.tip12;
localInfo.data.bonusunlocked = _global.bonusunlocked;
} else if (_global.slotno == 2) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot2 = 1;
localInfo.data.slot2_class = _global.chief;
localInfo.data.slot2_level = _global.masterlevel;
localInfo.data.slot2_exp = _global.gexperience;
localInfo.data.slot2_difficulty = _global.difficulty;
localInfo.data.slot2_class = _global.chief;
localInfo.data.slot2_skillpoints = _global.skillpoints;
localInfo.data.slot2_vault = _global.vault;
localInfo.data.slot2_masonry = _global.masonry;
localInfo.data.slot2_fame = _global.fame;
localInfo.data.slot2_thrift = _global.thrift;
localInfo.data.slot2_training = _global.training;
localInfo.data.slot2_fortitude = _global.fortitude;
localInfo.data.slot2_wisdom = _global.wisdom;
localInfo.data.slot2_presence = _global.presence;
localInfo.data.slot2_herohealth = _global.herohealth;
localInfo.data.slot2_backstab = _global.backstab;
localInfo.data.slot2_fistpower = _global.fistpower;
localInfo.data.slot2_herowisdom = _global.herowisdom;
localInfo.data.slot2_lionrider = _global.lionrider;
localInfo.data.slot2_dragonrider = _global.dragonrider;
localInfo.data.slot2_grow = _global.grow;
localInfo.data.slot2_herocritical = _global.herocritical;
localInfo.data.slot2_meteor = _global.meteor;
localInfo.data.slot2_herolearned = _global.herolearned;
localInfo.data.slot2_troll = _global.troll;
localInfo.data.slot2_bloodlust = _global.bloodlust;
localInfo.data.slot2_golem = _global.golem;
localInfo.data.slot2_heal = _global.heal;
localInfo.data.slot2_herovampire = _global.herovampire;
localInfo.data.slot2_lvl2 = _root.levelscomplete[2];
localInfo.data.slot2_lvl3 = _root.levelscomplete[3];
localInfo.data.slot2_lvl4 = _root.levelscomplete[4];
localInfo.data.slot2_lvl5 = _root.levelscomplete[5];
localInfo.data.slot2_lvl6 = _root.levelscomplete[6];
localInfo.data.slot2_lvl7 = _root.levelscomplete[7];
localInfo.data.slot2_lvl8 = _root.levelscomplete[8];
localInfo.data.slot2_lvl9 = _root.levelscomplete[9];
localInfo.data.slot2_lvl10 = _root.levelscomplete[10];
localInfo.data.slot2_lvl11 = _root.levelscomplete[11];
localInfo.data.slot2_lvl12 = _root.levelscomplete[12];
localInfo.data.slot2_lvl13 = _root.levelscomplete[13];
localInfo.data.slot2_tip1 = _global.tip1;
localInfo.data.slot2_tip2 = _global.tip2;
localInfo.data.slot2_tip3 = _global.tip3;
localInfo.data.slot2_tip4 = _global.tip4;
localInfo.data.slot2_tip5 = _global.tip5;
localInfo.data.slot2_tip6 = _global.tip6;
localInfo.data.slot2_tip7 = _global.tip7;
localInfo.data.slot2_tip8 = _global.tip8;
localInfo.data.slot2_tip9 = _global.tip9;
localInfo.data.slot2_tip10 = _global.tip10;
localInfo.data.slot2_tip11 = _global.tip11;
localInfo.data.slot2_tip12 = _global.tip12;
localInfo.data.bonusunlocked = _global.bonusunlocked;
} else if (_global.slotno == 3) {
localInfo = SharedObject.getLocal("clan2");
localInfo.data.slot3 = 1;
localInfo.data.slot3_class = _global.chief;
localInfo.data.slot3_level = _global.masterlevel;
localInfo.data.slot3_exp = _global.gexperience;
localInfo.data.slot3_difficulty = _global.difficulty;
localInfo.data.slot3_class = _global.chief;
localInfo.data.slot3_skillpoints = _global.skillpoints;
localInfo.data.slot3_vault = _global.vault;
localInfo.data.slot3_masonry = _global.masonry;
localInfo.data.slot3_fame = _global.fame;
localInfo.data.slot3_thrift = _global.thrift;
localInfo.data.slot3_training = _global.training;
localInfo.data.slot3_fortitude = _global.fortitude;
localInfo.data.slot3_wisdom = _global.wisdom;
localInfo.data.slot3_presence = _global.presence;
localInfo.data.slot3_herohealth = _global.herohealth;
localInfo.data.slot3_backstab = _global.backstab;
localInfo.data.slot3_fistpower = _global.fistpower;
localInfo.data.slot3_herowisdom = _global.herowisdom;
localInfo.data.slot3_lionrider = _global.lionrider;
localInfo.data.slot3_dragonrider = _global.dragonrider;
localInfo.data.slot3_grow = _global.grow;
localInfo.data.slot3_herocritical = _global.herocritical;
localInfo.data.slot3_meteor = _global.meteor;
localInfo.data.slot3_herolearned = _global.herolearned;
localInfo.data.slot3_troll = _global.troll;
localInfo.data.slot3_bloodlust = _global.bloodlust;
localInfo.data.slot3_golem = _global.golem;
localInfo.data.slot3_heal = _global.heal;
localInfo.data.slot3_herovampire = _global.herovampire;
localInfo.data.slot3_lvl2 = _root.levelscomplete[2];
localInfo.data.slot3_lvl3 = _root.levelscomplete[3];
localInfo.data.slot3_lvl4 = _root.levelscomplete[4];
localInfo.data.slot3_lvl5 = _root.levelscomplete[5];
localInfo.data.slot3_lvl6 = _root.levelscomplete[6];
localInfo.data.slot3_lvl7 = _root.levelscomplete[7];
localInfo.data.slot3_lvl8 = _root.levelscomplete[8];
localInfo.data.slot3_lvl9 = _root.levelscomplete[9];
localInfo.data.slot3_lvl10 = _root.levelscomplete[10];
localInfo.data.slot3_lvl11 = _root.levelscomplete[11];
localInfo.data.slot3_lvl12 = _root.levelscomplete[12];
localInfo.data.slot3_lvl13 = _root.levelscomplete[13];
localInfo.data.slot3_tip1 = _global.tip1;
localInfo.data.slot3_tip2 = _global.tip2;
localInfo.data.slot3_tip3 = _global.tip3;
localInfo.data.slot3_tip4 = _global.tip4;
localInfo.data.slot3_tip5 = _global.tip5;
localInfo.data.slot3_tip6 = _global.tip6;
localInfo.data.slot3_tip7 = _global.tip7;
localInfo.data.slot3_tip8 = _global.tip8;
localInfo.data.slot3_tip9 = _global.tip9;
localInfo.data.slot3_tip10 = _global.tip10;
localInfo.data.slot3_tip11 = _global.tip11;
localInfo.data.slot3_tip12 = _global.tip12;
localInfo.data.bonusunlocked = _global.bonusunlocked;
}
_root.overhero = false;
_root.gotoAndStop(51);
}
Instance of Symbol 3092 MovieClip [icon_vault] "icon_vault" in Frame 58
on (release) {
trace("_global.skillpoints = " + _global.skillpoints);
trace("_global.vault = " + _global.vault);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.vault < 5) {
trace("trace 3");
_global.vault++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_vault.iconholder.iconno.text = _global.vault + "/5";
_root.abilitybox.ability_header.text = ("Vault Upgrade [" + _global.vault) + "/5]";
}
if (_global.vault < 5) {
_root.abilitybox.ability_txt.text = ((("Increases interest earned on gold by " + ((1 + _global.vault) * 0.5)) + "% every 10 seconds. [Currently ") + (_global.vault * 0.5)) + "%]";
} else {
_root.abilitybox.abiltiy_txt.text = "Increases interest earned on gold. MAXED at 3% every 10 seconds.";
}
_root.icon_training.gotoAndStop(1);
_root.icon_golem.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Vault Upgrade [" + _global.vault) + "/5]";
if (_global.vault < 5) {
_root.abilitybox.ability_txt.text = ((("Increases interest earned on gold by " + ((1 + _global.vault) * 0.5)) + "% every 10 seconds. [Currently ") + (_global.vault * 0.5)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Increases interest earned on gold. MAXED at 2.5% every 10 seconds.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Vault REQUIRES Fame";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3093 MovieClip [icon_masonry] "icon_masonry" in Frame 58
on (release) {
trace("_global.skillpoints = " + _global.skillpoints);
trace("_global.masonry = " + _global.masonry);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.masonry < 5) {
trace("trace 3");
_global.masonry++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_masonry.iconholder.iconno.text = _global.masonry + "/5";
_root.icon_fame.gotoAndStop(1);
_root.icon_herohealth.gotoAndStop(1);
}
_root.abilitybox.ability_header.text = ("Masonry [" + _global.masonry) + "/5]";
if (_global.masonry < 5) {
_root.abilitybox.ability_txt.text = ((("Reduces Tower Upgrade Cost by " + ((1 + _global.masonry) * 5)) + "%. [Currently +") + (_global.masonry * 5)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Reduces Tower Upgrade Cost. MAXED at 25% Reduction.";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Masonry [" + _global.masonry) + "/5]";
if (_global.masonry < 5) {
_root.abilitybox.ability_txt.text = ((("Reduces Tower Upgrade Cost by " + ((1 + _global.masonry) * 5)) + "%. [Currently +") + (_global.masonry * 5)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Reduces Tower Upgrade Cost. MAXED at 25% Reduction.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Masonry REQUIRES Thrift";
}
}
on (rollOut) {
_root.overhero = false;
_root.abilitybox._y = 1000;
}
Instance of Symbol 3097 MovieClip [icon_fame] "icon_fame" in Frame 58
on (release) {
trace("_global.skillpoints = " + _global.skillpoints);
trace("_global.fame = " + _global.fame);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.fame < 5) {
trace("trace 3");
_global.fame++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_fame.iconholder.iconno.text = _global.fame + "/5";
_root.icon_vault.gotoAndStop(1);
_root.icon_herowisdom.gotoAndStop(1);
}
_root.abilitybox.ability_header.text = ("Fame [" + _global.fame) + "/5]";
if (_global.fame < 5) {
_root.abilitybox.ability_txt.text = ((("Reduces Unit Recruiting Cost by " + ((1 + _global.fame) * 5)) + "%. [Currently +") + (_global.fame * 5)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Reduces Unit Recruiting Cost. MAXED at 25% Reduction.";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Fame [" + _global.fame) + "/5]";
if (_global.fame < 5) {
_root.abilitybox.ability_txt.text = ((("Reduces Unit Recruiting Cost by " + ((1 + _global.fame) * 5)) + "%. [Currently +") + (_global.fame * 5)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Reduces Unit Recruiting Cost. MAXED at 25% Reduction.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Fame REQUIRES Masonry";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3099 MovieClip [icon_thrift] "icon_thrift" in Frame 58
on (release) {
trace("_global.skillpoints = " + _global.skillpoints);
trace("_global.thrift = " + _global.thrift);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.thrift < 5) {
trace("trace 3");
_global.thrift++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_thrift.iconholder.iconno.text = _global.thrift + "/5";
}
_root.abilitybox.ability_header.text = ("Thrift Ability [" + _global.thrift) + "/5]";
if (_global.thrift < 5) {
_root.abilitybox.ability_txt.text = ((("Increases Startup Gold by " + ((1 + _global.thrift) * 50)) + "GP. [Currently +") + (_global.thrift * 50)) + "GP]";
} else {
_root.abilitybox.ability_txt.text = "Increases Startup Experience. MAXED at +250GP.";
}
_root.icon_masonry.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Thrift Ability [" + _global.thrift) + "/5]";
if (_global.thrift < 5) {
_root.abilitybox.ability_txt.text = ((("Increases Startup Gold by " + ((1 + _global.thrift) * 50)) + "GP. [Currently +") + (_global.thrift * 50)) + "GP]";
} else {
_root.abilitybox.ability_txt.text = "Increases Startup Experience. MAXED at +250GP.";
}
}
on (rollOut) {
_root.overhero = false;
_root.abilitybox._y = 1000;
}
Instance of Symbol 3101 MovieClip [icon_training] "icon_training" in Frame 58
on (release) {
trace("_global.skillpoints = " + _global.skillpoints);
trace("_global.training = " + _global.training);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.training < 5) {
trace("trace 3");
_global.training++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_training.iconholder.iconno.text = _global.training + "/5";
_root.icon_fortitude.gotoAndStop(1);
_root.icon_herocritical.gotoAndStop(1);
}
_root.abilitybox.ability_header.text = ("Training Mastery [" + _global.training) + "/5]";
if (_global.training < 5) {
_root.abilitybox.ability_txt.text = ((("Reduces Unit Upgrade Cost by " + ((1 + _global.training) * 5)) + "%. [Currently +") + (_global.training * 5)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Reduces Unit Upgrade Cost. MAXED at 25% Reduction.";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Training Mastery [" + _global.training) + "/5]";
if (_global.training < 5) {
_root.abilitybox.ability_txt.text = ((("Reduces Unit Upgrade Cost by " + ((1 + _global.training) * 5)) + "%. [Currently +") + (_global.training * 5)) + "%]";
} else {
_root.abilitybox.ability_txt.text = "Reduces Unit Upgrade Cost. MAXED at 25% Reduction.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Training REQUIRES Vault";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3074 MovieClip [icon_wisdom] "icon_wisdom" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.wisdom);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.wisdom < 5) {
trace("trace 3");
_global.wisdom++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_wisdom.iconholder.iconno.text = _global.wisdom + "/5";
_root.abilitybox.ability_header.text = ("Wisdom Upgrade [" + _global.wisdom) + "/5]";
}
if (_global.wisdom < 5) {
_root.abilitybox.ability_txt.text = ((("Increases Startup Experience by " + ((1 + _global.wisdom) * 1000)) + ". [Currently ") + (_global.wisdom * 1000)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Startup Experience. MAXED at 5,000XP.";
}
_root.icon_presence.gotoAndStop(1);
_root.icon_dragonrider.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Wisdom Upgrade [" + _global.wisdom) + "/5]";
if (_global.wisdom < 5) {
_root.abilitybox.ability_txt.text = ((("Increases Startup Experience by " + ((1 + _global.wisdom) * 1000)) + ". [Currently ") + (_global.wisdom * 1000)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Startup Experience. MAXED at 5,000XP.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Wisdom Requires Fortitude";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3105 MovieClip [icon_health] "icon_herohealth" in Frame 58
on (release) {
trace("_global.skillpoints = " + _global.skillpoints);
trace("_global.herohealth = " + _global.herohealth);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.herohealth < 10) {
trace("trace 3");
_global.herohealth++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_herohealth.iconholder.iconno.text = _global.herohealth + "/10";
_root.icon_backstab.gotoAndStop(1);
}
_root.abilitybox.ability_header.text = ("Hero Health [" + _global.herohealth) + "/10]";
if (_global.herohealth < 10) {
_root.abilitybox.ability_txt.text = ((("Increases Hero's Base Health by " + ((1 + _global.herohealth) * 50)) + ". [Currently +") + (_global.herohealth * 50)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Hero's Base Health. MAXED at +500 hit points.";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Hero Health Bonus [" + _global.herohealth) + "/10]";
if (_global.herohealth < 10) {
_root.abilitybox.ability_txt.text = ((("Increases Heros Base Health by " + ((1 + _global.herohealth) * 50)) + ". [Currently +") + (_global.herohealth * 50)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increases Heros Base Health. MAXED at +500 hit points.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Hero Health Bonus REQUIRES Masonry";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3106 MovieClip [icon_assassin] "icon_backstab" in Frame 58
on (release) {
trace("_global.skillpoints = " + _global.skillpoints);
trace("_global.backstab = " + _global.backstab);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.backstab < 5) {
trace("trace 3");
_global.backstab++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_backstab.iconholder.iconno.text = _global.backstab + "/5";
_root.icon_fistpower.gotoAndStop(1);
}
_root.abilitybox.ability_header.text = ("Assassin Backstab [" + _global.backstab) + "/5]";
if (_global.backstab < 5) {
_root.abilitybox.ability_txt.text = ("Gives Assassin Ability to backstab " + (20 * _global.backstab)) + "% chance of +100 damage.";
} else {
_root.abilitybox.ability_txt.text = ("Gives Assassin Ability to backstab " + (20 * _global.backstab)) + "% chance of +100 damage. [MAXED]";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Assassin Backstab [" + _global.backstab) + "/5]";
if (_global.backstab < 5) {
_root.abilitybox.ability_txt.text = ("Gives Assassin Ability to backstab " + (20 * _global.backstab)) + "% chance of +100 damage.";
} else {
_root.abilitybox.ability_txt.text = "Gives Assassin Ability to backstab 100% chance of +100 damage. [MAXED]";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Backstab REQUIRES Hero Health";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3107 MovieClip [icon_lionrider] "icon_lionrider" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.lionrider);
trace("trace 1");
if ((_global.skillpoints > 1) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.lionrider < 1) {
trace("trace 3");
_global.lionrider++;
_global.skillpoints = _global.skillpoints - 2;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_lionrider.iconholder.iconno.text = _global.lionrider + "/1";
_root.abilitybox.ability_header.text = ("Lion Rider [" + _global.lionrider) + "/1] {2 Skill Points}";
}
if (_global.lionrider < 1) {
_root.abilitybox.ability_txt.text = "Unlock Lion Rider Unit, a fast powerful unit with both melee and ranged attack.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Lion Rider Unit, a fast powerful unit with both melee and ranged attack. [RESEARCHED]";
}
_root.icon_lionrider.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Lion Rider [" + _global.lionrider) + "/1] {2 Skill Points}";
if (_global.lionrider < 1) {
_root.abilitybox.ability_txt.text = "Unlock Lion Rider Unit, a fast powerful unit with both melee and ranged attack.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Lion Rider Unit, a fast powerful unit with both melee and ranged attack. [RESEARCHED]";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Lion Rider Requires Hero Wisdom";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3108 MovieClip [icon_dragonrider] "icon_dragonrider" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.dragonrider);
trace("trace 1");
if ((_global.skillpoints > 3) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.dragonrider < 1) {
trace("trace 3");
_global.dragonrider++;
_global.skillpoints = _global.skillpoints - 4;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_dragonrider.iconholder.iconno.text = _global.dragonrider + "/1";
_root.abilitybox.ability_header.text = ("Dragon Rider [" + _global.dragonrider) + "/1] {4 Skill Points}";
}
if (_global.dragonrider < 1) {
_root.abilitybox.ability_txt.text = "Unlock Dragon Rider Unit, A powerful flying unit that breaths fire.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Dragon Rider Unit, A powerful flying unit that breaths fire. [RESEARCHED]";
}
_root.icon_heal.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("dragon Rider [" + _global.dragonrider) + "/1] {4 Skill Points}";
if (_global.dragonrider < 1) {
_root.abilitybox.ability_txt.text = "Unlock Dragon Rider Unit, A powerful flying unit that breaths fire.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Dragon Rider Unit, A powerful flying unit that breaths fire. [RESEARCHED]";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Dragon Rider Requires Wisdom";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3109 MovieClip [icon_troll] "icon_troll" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.troll);
trace("trace 1");
if ((_global.skillpoints > 2) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.troll < 1) {
trace("trace 3");
_global.troll++;
_global.skillpoints = _global.skillpoints - 3;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_troll.iconholder.iconno.text = _global.troll + "/1";
_root.abilitybox.ability_header.text = ("Unlock Troll [" + _global.troll) + "/1] {3 Skill Points}";
}
if (_global.troll < 1) {
_root.abilitybox.ability_txt.text = "Unlock Troll, A very strong melee unit that can through boulders.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Troll, A very strong melee unit that can through boulders. [RESEARCHED]";
}
_root.icon_bloodlust.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Unlock Troll [" + _global.troll) + "/1] {3 Skill Points}";
if (_global.troll < 1) {
_root.abilitybox.ability_txt.text = "Unlock Troll, A very strong melee unit that can through boulders.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Troll, A very strong melee unit that can through boulders. [RESEARCHED]";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Troll Requires Learned Hero";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3110 MovieClip [icon_golem] "icon_golem" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.golem);
trace("trace 1");
if ((_global.skillpoints > 1) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.golem < 1) {
trace("trace 3");
_global.golem++;
_global.skillpoints = _global.skillpoints - 2;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_golem.iconholder.iconno.text = _global.golem + "/1";
_root.abilitybox.ability_header.text = ("Unlock Golem [" + _global.golem) + "/1] {2 Skill Points}";
}
if (_global.golem < 1) {
_root.abilitybox.ability_txt.text = "Unlock Golem, The Ultimate Melee Unit, with a lot of attack damage and health.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Golem, The Ultimate Melee Unit, with a lot of attack damage and health. [RESEARCHED]";
}
_root.icon_grow.gotoAndStop(1);
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Unlock Golem [" + _global.golem) + "/1] {2 Skill Points}";
if (_global.golem < 1) {
_root.abilitybox.ability_txt.text = "Unlock Golem, The Ultimate Melee Unit, with a lot of attack damage and health.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Golem, The Ultimate Melee Unit, with a lot of attack damage and health. [RESEARCHED]";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Golem Requires Vault";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3111 MovieClip [icon_fistresearch] "icon_fistpower" in Frame 58
on (release) {
trace("_global.skillpoints = " + _global.skillpoints);
trace("_global.fistpower = " + _global.fistpower);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.fistpower < 5) {
trace("trace 3");
_global.fistpower++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_fistpower.iconholder.iconno.text = _global.fistpower + "/5";
}
_root.abilitybox.ability_header.text = ("Fist Power [" + _global.fistpower) + "/5]";
if (_global.fistpower < 5) {
_root.abilitybox.ability_txt.text = ((("Increase Power of Mighty and Mega Fist by " + ((1 + _global.fistpower) * 30)) + "%. [Currently +") + (_global.fistpower * 30)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increase Power of Mighty and Mega Fist. MAXED at +150%.";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Fist Power [" + _global.fistpower) + "/5]";
if (_global.fistpower < 5) {
_root.abilitybox.ability_txt.text = ((("Increase Power of Mighty and Mega Fist by " + ((1 + _global.fistpower) * 20)) + "%. [Currently +") + (_global.fistpower * 20)) + "]";
} else {
_root.abilitybox.ability_txt.text = "Increase Power of Mighty and Mega Fist. MAXED at +100%.";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Fist Power REQUIRES Backstab";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3112 MovieClip [icon_grow] "icon_grow" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.grow);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.grow < 1) {
trace("trace 3");
_global.grow++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_grow.iconholder.iconno.text = _global.grow + "/1";
_root.abilitybox.ability_header.text = ("Grow Spell [" + _global.grow) + "/1]";
}
if (_global.grow < 1) {
_root.abilitybox.ability_txt.text = "Unlock Spell Grow - Increases Units, size, health and attack.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Spell Grow - Increases Units, size, health and attack. [RESEARCHED]";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Grow Spell [" + _global.grow) + "/1]";
if (_global.grow < 1) {
_root.abilitybox.ability_txt.text = "Unlock Spell Grow - Increases Units, size, health and attack.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Spell Grow - Increases Units, size, health and attack. [RESEARCHED]";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Grow Spell Requires Dragon Rider";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3113 MovieClip [icon_meteor] "icon_meteor" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.meteor);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.meteor < 1) {
trace("trace 3");
_global.meteor++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_meteor.iconholder.iconno.text = _global.meteor + "/1";
_root.abilitybox.ability_header.text = ("Meteor Spell [" + _global.meteor) + "/1]";
}
if (_global.meteor < 1) {
_root.abilitybox.ability_txt.text = "Unlock Spell Meteor - Rains down meteors on yor half of the field. A powerful defense.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Spell Meteor - Rains down meteors on yor half of the field. A powerful defense. [RESEARCHED]";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Meteor Spell [" + _global.meteor) + "/1]";
if (_global.meteor < 1) {
_root.abilitybox.ability_txt.text = "Unlock Spell Meteor - Rains down meteors on yor half of the field. A powerful defense.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Spell Meteor - Rains down meteors on yor half of the field. A powerful defense. [RESEARCHED]";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Meteor Spell Requires Hero Critical";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3114 MovieClip [icon_bloodlust] "icon_bloodlust" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.bloodlust);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.bloodlust < 1) {
trace("trace 3");
_global.bloodlust++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_bloodlust.iconholder.iconno.text = _global.bloodlust + "/1";
_root.abilitybox.ability_header.text = ("Blood Lust Spell [" + _global.bloodlust) + "/1]";
}
if (_global.bloodlust < 1) {
_root.abilitybox.ability_txt.text = "Unlock Spell Blood Lust - Blood Fog covers the land giving all your units 50% more attack damage.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Spell Blood Lust - Blood Fog covers the land giving all your units 50% more attack damage. [RESEARCHED]";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Blood Lust Spell [" + _global.bloodlust) + "/1]";
if (_global.bloodlust < 1) {
_root.abilitybox.ability_txt.text = "Unlock Spell Blood Lust - Blood Fog covers the land giving units your units more attack damage.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Spell Blood Lust - Blood Fog covers the land giving units your units more attack damage. [RESEARCHED]";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Blood Lust Spell Requires Troll";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3115 MovieClip [icon_heal] "icon_heal" in Frame 58
on (release) {
trace("_global.wisdom = " + _global.skillpoints);
trace("_global.wisdom = " + _global.heal);
trace("trace 1");
if ((_global.skillpoints > 0) and (this._currentframe == 1)) {
trace("trace 2");
if (_global.heal < 1) {
trace("trace 3");
_global.heal++;
_global.skillpoints--;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_heal.iconholder.iconno.text = _global.heal + "/1";
_root.abilitybox.ability_header.text = ("Heal Spell [" + _global.heal) + "/1]";
}
if (_global.heal < 1) {
_root.abilitybox.ability_txt.text = "Unlock Heal Spell - A Healing Fog covers the land healing your units +50 health per second.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Hell Spell - A Healing Fog covers the land healing your units +50 health per second. [RESEARCHED]";
}
}
}
on (rollOver) {
_root.overhero = true;
_root.abilitybox.ability_header.text = ("Heal Spell [" + _global.heal) + "/1]";
if (_global.heal < 1) {
_root.abilitybox.ability_txt.text = "Unlock Heal Spell - A Healing Fog covers the land healing your units +50 health per second.";
} else {
_root.abilitybox.ability_txt.text = "Unlock Hell Spell - A Healing Fog covers the land healing your units +50 health per second. [RESEARCHED]";
}
if (this._currentframe == 2) {
_root.abilitybox.ability_header.text = "Heal Spell Requires Golem";
}
}
on (rollOut) {
_root.abilitybox._y = 1000;
_root.overhero = false;
}
Instance of Symbol 3122 MovieClip [repickbutton] in Frame 58
on (release) {
_global.skillpoints = _global.masterlevel * 3;
if (_global.bonusunlocked) {
_global.skillpoints = _global.skillpoints + 10;
}
_global.vault = 0;
_global.masonry = 0;
_global.fame = 0;
_global.thrift = 0;
_global.training = 0;
_global.fortitude = 0;
_global.wisdom = 0;
_global.presence = 0;
_global.herohealth = 0;
_global.backstab = 0;
_global.fistpower = 0;
_global.herowisdom = 0;
_global.lionrider = 0;
_global.dragonrider = 0;
_global.grow = 0;
_global.herocritical = 0;
_global.meteor = 0;
_global.herolearned = 0;
_global.troll = 0;
_global.bloodlust = 0;
_global.golem = 0;
_global.heal = 0;
_global.herovampire = 0;
_root.skillpointstxt.text = _global.skillpoints;
_root.icon_thrift.iconholder.iconno.text = _global.thrift + "/5";
_root.icon_thrift.gotoAndStop(1);
_root.icon_masonry.iconholder.iconno.text = _global.masonry + "/5";
if (_global.thrift > 0) {
_root.icon_masonry.gotoAndStop(1);
} else {
_root.icon_masonry.gotoAndStop(2);
}
_root.icon_fame.iconholder.iconno.text = _global.fame + "/5";
if (_global.masonry > 0) {
_root.icon_fame.gotoAndStop(1);
} else {
_root.icon_fame.gotoAndStop(2);
}
_root.icon_vault.iconholder.iconno.text = _global.vault + "/5";
if (_global.fame > 0) {
_root.icon_vault.gotoAndStop(1);
} else {
_root.icon_vault.gotoAndStop(2);
}
_root.icon_training.iconholder.iconno.text = _global.training + "/5";
if (_global.vault > 0) {
_root.icon_training.gotoAndStop(1);
} else {
_root.icon_training.gotoAndStop(2);
}
_root.icon_fortitude.iconholder.iconno.text = _global.fortitude + "/5";
if (_global.training > 0) {
_root.icon_fortitude.gotoAndStop(1);
} else {
_root.icon_fortitude.gotoAndStop(2);
}
_root.icon_wisdom.iconholder.iconno.text = _global.wisdom + "/5";
if (_global.fortitude > 0) {
_root.icon_wisdom.gotoAndStop(1);
} else {
_root.icon_wisdom.gotoAndStop(2);
}
_root.icon_presence.iconholder.iconno.text = _global.presence + "/5";
if (_global.wisdom > 0) {
_root.icon_presence.gotoAndStop(1);
} else {
_root.icon_presence.gotoAndStop(2);
}
_root.icon_herohealth.iconholder.iconno.text = _global.herohealth + "/5";
if (_global.masonry > 0) {
_root.icon_herohealth.gotoAndStop(1);
} else {
_root.icon_herohealth.gotoAndStop(2);
}
_root.icon_backstab.iconholder.iconno.text = _global.backstab + "/1";
if (_global.herohealth > 0) {
_root.icon_backstab.gotoAndStop(1);
} else {
_root.icon_backstab.gotoAndStop(2);
}
_root.icon_fistpower.iconholder.iconno.text = _global.fistpower + "/5";
if (_global.backstab > 0) {
_root.icon_fistpower.gotoAndStop(1);
} else {
_root.icon_fistpower.gotoAndStop(2);
}
_root.icon_herowisdom.iconholder.iconno.text = _global.herowisdom + "/5";
if (_global.fame > 0) {
_root.icon_herowisdom.gotoAndStop(1);
} else {
_root.icon_herowisdom.gotoAndStop(2);
}
_root.icon_lionrider.iconholder.iconno.text = _global.lionrider + "/1";
if (_global.herowisdom > 0) {
_root.icon_lionrider.gotoAndStop(1);
} else {
_root.icon_lionrider.gotoAndStop(2);
}
_root.icon_dragonrider.iconholder.iconno.text = _global.dragonrider + "/1";
if (_global.wisdom > 0) {
_root.icon_dragonrider.gotoAndStop(1);
} else {
_root.icon_dragonrider.gotoAndStop(2);
}
_root.icon_grow.iconholder.iconno.text = _global.grow + "/1";
if (_global.golem > 0) {
_root.icon_grow.gotoAndStop(1);
} else {
_root.icon_grow.gotoAndStop(2);
}
_root.icon_herocritical.iconholder.iconno.text = _global.herocritical + "/5";
if (_global.training > 0) {
_root.icon_herocritical.gotoAndStop(1);
} else {
_root.icon_herocritical.gotoAndStop(2);
}
_root.icon_meteor.iconholder.iconno.text = _global.meteor + "/1";
if (_global.herocritical > 0) {
_root.icon_meteor.gotoAndStop(1);
} else {
_root.icon_meteor.gotoAndStop(2);
}
_root.icon_herolearned.iconholder.iconno.text = _global.herolearned + "/5";
if (_global.fortitude > 0) {
_root.icon_herolearned.gotoAndStop(1);
} else {
_root.icon_herolearned.gotoAndStop(2);
}
icon_troll.iconholder.iconno.text = _global.troll + "/1";
if (_global.herolearned > 0) {
_root.icon_troll.gotoAndStop(1);
} else {
_root.icon_troll.gotoAndStop(2);
}
_root.icon_bloodlust.iconholder.iconno.text = _global.bloodlust + "/1";
if (_global.troll > 0) {
_root.icon_bloodlust.gotoAndStop(1);
} else {
_root.icon_bloodlust.gotoAndStop(2);
}
_root.icon_golem.iconholder.iconno.text = _global.golem + "/1";
if (_global.vault > 0) {
_root.icon_golem.gotoAndStop(1);
} else {
_root.icon_golem.gotoAndStop(2);
}
_root.icon_heal.iconholder.iconno.text = _global.heal + "/1";
if (_global.dragonrider > 0) {
_root.icon_heal.gotoAndStop(1);
} else {
_root.icon_heal.gotoAndStop(2);
}
_root.icon_herovampire.iconholder.iconno.text = _global.herovampire + "/5";
if (_global.presence > 0) {
_root.icon_herovampire.gotoAndStop(1);
} else {
_root.icon_herovampire.gotoAndStop(2);
}
}
Frame 59
function herosname(n) {
var _local1 = "";
if (n == "chief2") {
_local1 = "Warlock";
}
if (n == "chief") {
_local1 = "Warrior";
}
if (n == "chief4") {
_local1 = "Beast Master";
}
if (n == "chief5") {
_local1 = "Dragon Gaurd";
}
if (n == "chief6") {
_local1 = "Elite Assin";
}
return(_local1);
}
function difficulty(n) {
var _local1 = "";
switch (n) {
case 1 :
_local1 = "Easy";
break;
case 2 :
_local1 = "Normal";
break;
case 3 :
_local1 = "Hard";
break;
case 4 :
_local1 = "Impossible";
break;
default :
_local1 = "Impossible";
}
return(_local1);
}
localInfo = SharedObject.getLocal("clan2");
if (localInfo.data.slot1 == undefined) {
} else {
slots1[0] = localInfo.data.slot1;
slots1[1] = localInfo.data.slot1_class;
slots1[2] = localInfo.data.slot1_level;
slots1[3] = localInfo.data.slot1_difficulty;
}
if (localInfo.data.slot2 == undefined) {
} else {
slots2[0] = localInfo.data.slot2;
slots2[1] = localInfo.data.slot2_class;
slots2[2] = localInfo.data.slot2_level;
slots2[3] = localInfo.data.slot2_difficulty;
}
if (localInfo.data.slot3 == undefined) {
} else {
slots3[0] = localInfo.data.slot3;
slots3[1] = localInfo.data.slot3_class;
slots3[2] = localInfo.data.slot3_level;
slots3[3] = localInfo.data.slot3_difficulty;
}
trace("slots1[0]=" + slots1[0]);
if (slots1[0] != 0) {
slot1txt = (((("Slot 1 - " + herosname(slots1[1])) + ", Lvl ") + slots1[2]) + ", ") + difficulty(slots1[3]);
}
if (slots2[0] != 0) {
slot2txt = (((("Slot 2 - " + herosname(slots2[1])) + ", Lvl ") + slots2[2]) + ", ") + difficulty(slots2[3]);
}
if (slots3[0] != 0) {
slot3txt = (((("Slot 3 - " + herosname(slots3[1])) + ", Lvl ") + slots3[2]) + ", ") + difficulty(slots3[3]);
}
Instance of Symbol 3124 MovieClip [longbutton] in Frame 59
on (release) {
_global.slotno = 1;
if (_root.slots1[0] == 0) {
_global.slotno = 1;
_root.slots1[0] = 0;
_global.chief = localInfo.data.slot1_class;
_global.masterlevel = 1;
_global.difficulty = 1;
if (_global.bonusunlocked) {
_global.skillpoints = 13;
} else {
_global.skillpoints = 3;
}
_global.gexperience = 0;
_global.vault = 0;
_global.masonry = 0;
_global.fame = 0;
_global.thrift = 0;
_global.training = 0;
_global.fortitude = 0;
_global.wisdom = 0;
_global.presence = 0;
_global.herohealth = 0;
_global.backstab = 0;
_global.fistpower = 0;
_global.herowisdom = 0;
_global.lionrider = 0;
_global.dragonrider = 0;
_global.grow = 0;
_global.herocritical = 0;
_global.meteor = 0;
_global.herolearned = 0;
_global.troll = 0;
_global.bloodlust = 0;
_global.golem = 0;
_global.heal = 0;
_global.herovampire = 0;
_global.tips = true;
_root.levelscomplete[2] = 0;
_root.levelscomplete[3] = 0;
_root.levelscomplete[4] = 0;
_root.levelscomplete[5] = 0;
_root.levelscomplete[6] = 0;
_root.levelscomplete[7] = 0;
_root.levelscomplete[8] = 0;
_root.levelscomplete[9] = 0;
_root.levelscomplete[10] = 0;
_root.levelscomplete[11] = 0;
_root.levelscomplete[12] = 0;
_root.levelscomplete[13] = 0;
_root.gotoAndStop(55);
} else {
localInfo = SharedObject.getLocal("clan2");
if (localInfo.data.slot1 == undefined) {
trace("slot1 is undefined in frame 59, button1");
} else {
_global.chief = localInfo.data.slot1_class;
_global.masterlevel = localInfo.data.slot1_level;
_global.difficulty = localInfo.data.slot1_difficulty;
_global.skillpoints = localInfo.data.slot1_skillpoints;
_global.gexperience = localInfo.data.slot1_exp;
_global.vault = localInfo.data.slot1_vault;
_global.masonry = localInfo.data.slot1_masonry;
_global.fame = localInfo.data.slot1_fame;
_global.thrift = localInfo.data.slot1_thrift;
_global.training = localInfo.data.slot1_training;
_global.fortitude = localInfo.data.slot1_fortitude;
_global.wisdom = localInfo.data.slot1_wisdom;
_global.presence = localInfo.data.slot1_presence;
_global.herohealth = localInfo.data.slot1_herohealth;
_global.backstab = localInfo.data.slot1_backstab;
_global.fistpower = localInfo.data.slot1_fistpower;
_global.herowisdom = localInfo.data.slot1_herowisdom;
_global.lionrider = localInfo.data.slot1_lionrider;
_global.dragonrider = localInfo.data.slot1_dragonrider;
_global.grow = localInfo.data.slot1_grow;
_global.herocritical = localInfo.data.slot1_herocritical;
_global.meteor = localInfo.data.slot1_meteor;
_global.herolearned = localInfo.data.slot1_herolearned;
_global.troll = localInfo.data.slot1_troll;
_global.bloodlust = localInfo.data.slot1_bloodlust;
_global.golem = localInfo.data.slot1_golem;
_global.heal = localInfo.data.slot1_heal;
_global.herovampire = localInfo.data.slot1_herovampire;
_root.levelscomplete[2] = localInfo.data.slot1_lvl2;
_root.levelscomplete[3] = localInfo.data.slot1_lvl3;
_root.levelscomplete[4] = localInfo.data.slot1_lvl4;
_root.levelscomplete[5] = localInfo.data.slot1_lvl5;
_root.levelscomplete[6] = localInfo.data.slot1_lvl6;
_root.levelscomplete[7] = localInfo.data.slot1_lvl7;
_root.levelscomplete[8] = localInfo.data.slot1_lvl8;
_root.levelscomplete[9] = localInfo.data.slot1_lvl9;
_root.levelscomplete[10] = localInfo.data.slot1_lvl10;
_root.levelscomplete[11] = localInfo.data.slot1_lvl11;
_root.levelscomplete[12] = localInfo.data.slot1_lvl12;
_root.levelscomplete[13] = localInfo.data.slot1_lvl13;
trace("Precense = " + _global.presence);
_global.tip1 = localInfo.data.slot1_tip1;
_global.tip2 = localInfo.data.slot1_tip2;
_global.tip3 = localInfo.data.slot1_tip3;
_global.tip4 = localInfo.data.slot1_tip4;
_global.tip5 = localInfo.data.slot1_tip5;
_global.tip6 = localInfo.data.slot1_tip6;
_global.tip7 = localInfo.data.slot1_tip7;
_global.tip8 = localInfo.data.slot1_tip8;
_global.tip9 = localInfo.data.slot1_tip9;
_global.tip10 = localInfo.data.slot1_tip10;
_global.tip11 = localInfo.data.slot1_tip11;
_global.tip12 = localInfo.data.slot1_tip12;
trace("_root.levelscomplete[2] = " + _root.levelscomplete[2]);
trace("_global.grow = " + _global.grow);
}
_root.gotoAndStop(57);
}
}
Instance of Symbol 3124 MovieClip [longbutton] in Frame 59
on (release) {
_global.slotno = 3;
if (_root.slots3[0] == 0) {
_global.slotno = 3;
_root.slots3[0] = 0;
_global.chief = localInfo.data.slot3_class;
_global.masterlevel = 1;
_global.difficulty = 1;
if (_global.bonusunlocked) {
_global.skillpoints = 13;
} else {
_global.skillpoints = 3;
}
_global.gexperience = 0;
_global.vault = 0;
_global.masonry = 0;
_global.fame = 0;
_global.thrift = 0;
_global.training = 0;
_global.fortitude = 0;
_global.wisdom = 0;
_global.presence = 0;
_global.herohealth = 0;
_global.backstab = 0;
_global.fistpower = 0;
_global.herowisdom = 0;
_global.lionrider = 0;
_global.dragonrider = 0;
_global.grow = 0;
_global.herocritical = 0;
_global.meteor = 0;
_global.herolearned = 0;
_global.troll = 0;
_global.bloodlust = 0;
_global.golem = 0;
_global.heal = 0;
_global.herovampire = 0;
_global.tips = true;
_root.levelscomplete[2] = 0;
_root.levelscomplete[3] = 0;
_root.levelscomplete[4] = 0;
_root.levelscomplete[5] = 0;
_root.levelscomplete[6] = 0;
_root.levelscomplete[7] = 0;
_root.levelscomplete[8] = 0;
_root.levelscomplete[9] = 0;
_root.levelscomplete[10] = 0;
_root.levelscomplete[11] = 0;
_root.levelscomplete[12] = 0;
_root.levelscomplete[13] = 0;
_root.gotoAndStop(55);
} else {
localInfo = SharedObject.getLocal("clan2");
if (localInfo.data.slot3 == undefined) {
trace("slot3 is undefined in frame 59, button1");
} else {
_global.chief = localInfo.data.slot3_class;
_global.masterlevel = localInfo.data.slot3_level;
_global.difficulty = localInfo.data.slot3_difficulty;
_global.skillpoints = localInfo.data.slot3_skillpoints;
_global.gexperience = localInfo.data.slot3_exp;
_global.vault = localInfo.data.slot3_vault;
_global.masonry = localInfo.data.slot3_masonry;
_global.fame = localInfo.data.slot3_fame;
_global.thrift = localInfo.data.slot3_thrift;
_global.training = localInfo.data.slot3_training;
_global.fortitude = localInfo.data.slot3_fortitude;
_global.wisdom = localInfo.data.slot3_wisdom;
_global.presence = localInfo.data.slot3_presence;
_global.herohealth = localInfo.data.slot3_herohealth;
_global.backstab = localInfo.data.slot3_backstab;
_global.fistpower = localInfo.data.slot3_fistpower;
_global.herowisdom = localInfo.data.slot3_herowisdom;
_global.lionrider = localInfo.data.slot3_lionrider;
_global.dragonrider = localInfo.data.slot3_dragonrider;
_global.grow = localInfo.data.slot3_grow;
_global.herocritical = localInfo.data.slot3_herocritical;
_global.meteor = localInfo.data.slot3_meteor;
_global.herolearned = localInfo.data.slot3_herolearned;
_global.troll = localInfo.data.slot3_troll;
_global.bloodlust = localInfo.data.slot3_bloodlust;
_global.golem = localInfo.data.slot3_golem;
_global.heal = localInfo.data.slot3_heal;
_global.herovampire = localInfo.data.slot3_herovampire;
_root.levelscomplete[2] = localInfo.data.slot3_lvl2;
_root.levelscomplete[3] = localInfo.data.slot3_lvl3;
_root.levelscomplete[4] = localInfo.data.slot3_lvl4;
_root.levelscomplete[5] = localInfo.data.slot3_lvl5;
_root.levelscomplete[6] = localInfo.data.slot3_lvl6;
_root.levelscomplete[7] = localInfo.data.slot3_lvl7;
_root.levelscomplete[8] = localInfo.data.slot3_lvl8;
_root.levelscomplete[9] = localInfo.data.slot3_lvl9;
_root.levelscomplete[10] = localInfo.data.slot3_lvl10;
_root.levelscomplete[11] = localInfo.data.slot3_lvl11;
_root.levelscomplete[12] = localInfo.data.slot3_lvl12;
_root.levelscomplete[13] = localInfo.data.slot3_lvl13;
trace("Precense = " + _global.presence);
_global.tip1 = localInfo.data.slot3_tip1;
_global.tip2 = localInfo.data.slot3_tip2;
_global.tip3 = localInfo.data.slot3_tip3;
_global.tip4 = localInfo.data.slot3_tip4;
_global.tip5 = localInfo.data.slot3_tip5;
_global.tip6 = localInfo.data.slot3_tip6;
_global.tip7 = localInfo.data.slot3_tip7;
_global.tip8 = localInfo.data.slot3_tip8;
_global.tip9 = localInfo.data.slot3_tip9;
_global.tip10 = localInfo.data.slot3_tip10;
_global.tip11 = localInfo.data.slot3_tip11;
_global.tip12 = localInfo.data.slot3_tip12;
}
_root.gotoAndStop(57);
}
}
Instance of Symbol 3124 MovieClip [longbutton] in Frame 59
on (release) {
_global.slotno = 2;
if (_root.slots2[0] == 0) {
_global.slotno = 2;
_root.slots2[0] = 0;
_global.chief = localInfo.data.slot2_class;
_global.masterlevel = 1;
_global.difficulty = 1;
if (_global.bonusunlocked) {
_global.skillpoints = 13;
} else {
_global.skillpoints = 3;
}
_global.gexperience = 0;
_global.vault = 0;
_global.masonry = 0;
_global.fame = 0;
_global.thrift = 0;
_global.training = 0;
_global.fortitude = 0;
_global.wisdom = 0;
_global.presence = 0;
_global.herohealth = 0;
_global.backstab = 0;
_global.fistpower = 0;
_global.herowisdom = 0;
_global.lionrider = 0;
_global.dragonrider = 0;
_global.grow = 0;
_global.herocritical = 0;
_global.meteor = 0;
_global.herolearned = 0;
_global.troll = 0;
_global.bloodlust = 0;
_global.golem = 0;
_global.heal = 0;
_global.herovampire = 0;
_global.tips = true;
_root.levelscomplete[2] = 0;
_root.levelscomplete[3] = 0;
_root.levelscomplete[4] = 0;
_root.levelscomplete[5] = 0;
_root.levelscomplete[6] = 0;
_root.levelscomplete[7] = 0;
_root.levelscomplete[8] = 0;
_root.levelscomplete[9] = 0;
_root.levelscomplete[10] = 0;
_root.levelscomplete[11] = 0;
_root.levelscomplete[12] = 0;
_root.levelscomplete[13] = 0;
_root.gotoAndStop(55);
} else {
localInfo = SharedObject.getLocal("clan2");
if (localInfo.data.slot2 == undefined) {
trace("slot2 is undefined in frame 59, button1");
} else {
_global.chief = localInfo.data.slot2_class;
_global.masterlevel = localInfo.data.slot2_level;
_global.difficulty = localInfo.data.slot2_difficulty;
_global.skillpoints = localInfo.data.slot2_skillpoints;
_global.gexperience = localInfo.data.slot2_exp;
_global.vault = localInfo.data.slot2_vault;
_global.masonry = localInfo.data.slot2_masonry;
_global.fame = localInfo.data.slot2_fame;
_global.thrift = localInfo.data.slot2_thrift;
_global.training = localInfo.data.slot2_training;
_global.fortitude = localInfo.data.slot2_fortitude;
_global.wisdom = localInfo.data.slot2_wisdom;
_global.presence = localInfo.data.slot2_presence;
_global.herohealth = localInfo.data.slot2_herohealth;
_global.backstab = localInfo.data.slot2_backstab;
_global.fistpower = localInfo.data.slot2_fistpower;
_global.herowisdom = localInfo.data.slot2_herowisdom;
_global.lionrider = localInfo.data.slot2_lionrider;
_global.dragonrider = localInfo.data.slot2_dragonrider;
_global.grow = localInfo.data.slot2_grow;
_global.herocritical = localInfo.data.slot2_herocritical;
_global.meteor = localInfo.data.slot2_meteor;
_global.herolearned = localInfo.data.slot2_herolearned;
_global.troll = localInfo.data.slot2_troll;
_global.bloodlust = localInfo.data.slot2_bloodlust;
_global.golem = localInfo.data.slot2_golem;
_global.heal = localInfo.data.slot2_heal;
_global.herovampire = localInfo.data.slot2_herovampire;
_root.levelscomplete[2] = localInfo.data.slot2_lvl2;
_root.levelscomplete[3] = localInfo.data.slot2_lvl3;
_root.levelscomplete[4] = localInfo.data.slot2_lvl4;
_root.levelscomplete[5] = localInfo.data.slot2_lvl5;
_root.levelscomplete[6] = localInfo.data.slot2_lvl6;
_root.levelscomplete[7] = localInfo.data.slot2_lvl7;
_root.levelscomplete[8] = localInfo.data.slot2_lvl8;
_root.levelscomplete[9] = localInfo.data.slot2_lvl9;
_root.levelscomplete[10] = localInfo.data.slot2_lvl10;
_root.levelscomplete[11] = localInfo.data.slot2_lvl11;
_root.levelscomplete[12] = localInfo.data.slot2_lvl12;
_root.levelscomplete[13] = localInfo.data.slot2_lvl13;
trace("Precense = " + _global.presence);
_global.tip1 = localInfo.data.slot2_tip1;
_global.tip2 = localInfo.data.slot2_tip2;
_global.tip3 = localInfo.data.slot2_tip3;
_global.tip4 = localInfo.data.slot2_tip4;
_global.tip5 = localInfo.data.slot2_tip5;
_global.tip6 = localInfo.data.slot2_tip6;
_global.tip7 = localInfo.data.slot2_tip7;
_global.tip8 = localInfo.data.slot2_tip8;
_global.tip9 = localInfo.data.slot2_tip9;
_global.tip10 = localInfo.data.slot2_tip10;
_global.tip11 = localInfo.data.slot2_tip11;
_global.tip12 = localInfo.data.slot2_tip12;
}
_root.gotoAndStop(57);
}
}
Instance of Symbol 216 MovieClip [menubutton] in Frame 59
on (release) {
_root.gotoAndStop(51);
}
Instance of Symbol 3130 MovieClip [resetbutton] in Frame 59
on (release) {
_global.slotno = 1;
_root.slots1[0] = 0;
_global.chief = localInfo.data.slot1_class;
_global.masterlevel = 1;
_global.difficulty = 1;
if (_global.bonusunlocked) {
_global.skillpoints = 13;
} else {
_global.skillpoints = 3;
}
_global.gexperience = 0;
_global.vault = 0;
_global.masonry = 0;
_global.fame = 0;
_global.thrift = 0;
_global.training = 0;
_global.fortitude = 0;
_global.wisdom = 0;
_global.presence = 0;
_global.herohealth = 0;
_global.backstab = 0;
_global.fistpower = 0;
_global.herowisdom = 0;
_global.lionrider = 0;
_global.dragonrider = 0;
_global.grow = 0;
_global.herocritical = 0;
_global.meteor = 0;
_global.herolearned = 0;
_global.troll = 0;
_global.bloodlust = 0;
_global.golem = 0;
_global.heal = 0;
_global.herovampire = 0;
_global.tips = true;
_root.levelscomplete[2] = 0;
_root.levelscomplete[3] = 0;
_root.levelscomplete[4] = 0;
_root.levelscomplete[5] = 0;
_root.levelscomplete[6] = 0;
_root.levelscomplete[7] = 0;
_root.levelscomplete[8] = 0;
_root.levelscomplete[9] = 0;
_root.levelscomplete[10] = 0;
_root.levelscomplete[11] = 0;
_root.levelscomplete[12] = 0;
_root.levelscomplete[13] = 0;
_root.slot1txt = "Slot 1 - New Game";
}
Instance of Symbol 3130 MovieClip [resetbutton] in Frame 59
on (release) {
_global.slotno = 2;
_root.slots2[0] = 0;
_global.chief = localInfo.data.slot2_class;
_global.masterlevel = 1;
_global.difficulty = 1;
if (_global.bonusunlocked) {
_global.skillpoints = 13;
} else {
_global.skillpoints = 3;
}
_global.gexperience = 0;
_global.vault = 0;
_global.masonry = 0;
_global.fame = 0;
_global.thrift = 0;
_global.training = 0;
_global.fortitude = 0;
_global.wisdom = 0;
_global.presence = 0;
_global.herohealth = 0;
_global.backstab = 0;
_global.fistpower = 0;
_global.herowisdom = 0;
_global.lionrider = 0;
_global.dragonrider = 0;
_global.grow = 0;
_global.herocritical = 0;
_global.meteor = 0;
_global.herolearned = 0;
_global.troll = 0;
_global.bloodlust = 0;
_global.golem = 0;
_global.heal = 0;
_global.herovampire = 0;
_global.tips = true;
_root.levelscomplete[2] = 0;
_root.levelscomplete[3] = 0;
_root.levelscomplete[4] = 0;
_root.levelscomplete[5] = 0;
_root.levelscomplete[6] = 0;
_root.levelscomplete[7] = 0;
_root.levelscomplete[8] = 0;
_root.levelscomplete[9] = 0;
_root.levelscomplete[10] = 0;
_root.levelscomplete[11] = 0;
_root.levelscomplete[12] = 0;
_root.levelscomplete[13] = 0;
_root.slot2txt = "Slot 2 - New Game";
}
Instance of Symbol 3130 MovieClip [resetbutton] in Frame 59
on (release) {
_global.slotno = 3;
_root.slots3[0] = 0;
_global.chief = localInfo.data.slot3_class;
_global.masterlevel = 1;
_global.difficulty = 1;
if (_global.bonusunlocked) {
_global.skillpoints = 13;
} else {
_global.skillpoints = 3;
}
_global.gexperience = 0;
_global.vault = 0;
_global.masonry = 0;
_global.fame = 0;
_global.thrift = 0;
_global.training = 0;
_global.fortitude = 0;
_global.wisdom = 0;
_global.presence = 0;
_global.herohealth = 0;
_global.backstab = 0;
_global.fistpower = 0;
_global.herowisdom = 0;
_global.lionrider = 0;
_global.dragonrider = 0;
_global.grow = 0;
_global.herocritical = 0;
_global.meteor = 0;
_global.herolearned = 0;
_global.troll = 0;
_global.bloodlust = 0;
_global.golem = 0;
_global.heal = 0;
_global.herovampire = 0;
_global.tips = true;
_root.levelscomplete[2] = 0;
_root.levelscomplete[3] = 0;
_root.levelscomplete[4] = 0;
_root.levelscomplete[5] = 0;
_root.levelscomplete[6] = 0;
_root.levelscomplete[7] = 0;
_root.levelscomplete[8] = 0;
_root.levelscomplete[9] = 0;
_root.levelscomplete[10] = 0;
_root.levelscomplete[11] = 0;
_root.levelscomplete[12] = 0;
_root.levelscomplete[13] = 0;
_root.slot3txt = "Slot 3 - New Game";
}
Symbol 80 MovieClip [unlockedherotxt] Frame 136
this.removeMovieClip();
Symbol 83 MovieClip [shockwave] Frame 13
this.removeMovieClip();
Symbol 90 MovieClip [ParticleObj] Frame 24
removeMovieClip(this);
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 1
stop();
Symbol 109 MovieClip [Preloader] Frame 1
function enterFrameHandler() {
var _local2 = 0;
_local2 = _root.getBytesLoaded() / _root.getBytesTotal();
if (loadingBar) {
loadingBar.gotoAndStop(int(_local2 * (loadingBar._totalframes - 1)) + 1);
}
if ((_local2 >= 1) && (haltComplete != true)) {
onEnterFrame = null;
gotoAndStop ("loaded");
}
}
stop();
var autoPlay;
var className;
var haltComplete;
onEnterFrame = enterFrameHandler;
Symbol 109 MovieClip [Preloader] Frame 10
function _onPlayClick() {
_root.nextFrame();
_root.play();
_parent._onLoaded();
}
if (playButton) {
playButton.onRelease = _onPlayClick;
playButton.stop();
}
if (autoPlay) {
_onPlayClick(null);
}
Symbol 111 MovieClip [Newgrounds API Classes] Frame 1
#initclip 33
Object.registerClass("Newgrounds API Classes", com.newgrounds.shims.APIShim);
#endinitclip
Symbol 166 MovieClip [FlashAd] Frame 1
#initclip 34
Object.registerClass("FlashAd", com.newgrounds.components.FlashAdBase);
#endinitclip
function initPlayButton() {
if (this.playButton) {
this.playButton.onRelease = onPlayClick;
if (!this.showPlayButton) {
this.playButton._visible = false;
}
}
}
function onPlayClick() {
removeAd();
_visible = false;
}
stop();
Symbol 166 MovieClip [FlashAd] Frame 2
initPlayButton();
Symbol 166 MovieClip [FlashAd] Frame 10
initPlayButton();
Symbol 166 MovieClip [FlashAd] Frame 20
initPlayButton();
Symbol 167 MovieClip [APIConnector] Frame 1
function _onLoaded() {
gotoAndStop ("invisible");
if (_redirect) {
com.newgrounds.API.loadOfficialVersion();
return(undefined);
}
}
function _apiConnect() {
var _local2 = com.newgrounds.API;
if (_local2 && (!_local2.connected)) {
if (!apiId) {
com.newgrounds.Logger.logError("No API ID entered in the API Connector component.", "You can create an API ID for this submission at http://newgrounds.com/account/flashapi", "Enter your API ID into the API Connector using the Component Inspector (Window -> Component Inspector).");
return(undefined);
}
switch (debugMode) {
case "Off" :
default :
_local2.debugMode = _local2.RELEASE_MODE;
break;
case "Simulate Logged-in User" :
_local2.debugMode = _local2.DEBUG_MODE_LOGGED_IN;
break;
case "Simulate Logged-out User" :
_local2.debugMode = _local2.DEBUG_MODE_LOGGED_OUT;
break;
case "Simulate New Version" :
_local2.debugMode = _local2.DEBUG_MODE_NEW_VERSION;
break;
case "Simulate Host Blocked" :
_local2.debugMode = _local2.DEBUG_MODE_HOST_BLOCKED;
}
if (loader) {
loader.haltComplete = true;
}
_local2.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, _onConnected);
_local2.connect(_root, apiId, encryptionKey, movieVersion);
}
}
function _onConnected(event) {
if (loader) {
loader.haltComplete = false;
}
if ((redirectOnNewVersion && (event.__get__success())) && (event.__get__data().newVersion)) {
_redirect = true;
}
if ((redirectOnHostBlocked && (!event.__get__success())) && (event.__get__error() == com.newgrounds.APIEvent.ERROR_HOST_BLOCKED)) {
_redirect = true;
}
if (_redirect) {
gotoAndStop ("adPreloader");
forceAlwaysOnTop();
}
}
function forceAlwaysOnTop() {
var _local2 = getNextHighestDepth();
swapDepths(_local2);
if (Stage) {
_x = ((Stage.width - _width) / 2);
_y = ((Stage.height - _height) / 2);
_visible = true;
}
if (_root && (_root instanceof MovieClip)) {
MovieClip(_root).stop();
}
}
stop();
if (_root && (_root instanceof MovieClip)) {
MovieClip(_root).stop();
}
var apiId;
var encryptionKey;
var movieVersion;
var debugMode;
var connectorType;
var redirectOnHostBlocked;
var redirectOnNewVersion;
var adType;
var className;
var _redirect;
_x = int(_x);
_y = int(_y);
if (!debugMode) {
debugMode = "Simulate Logged-in User";
}
if (!connectorType) {
connectorType = "Flash Ad + Preloader";
}
if (!adType) {
adType = "Video";
}
if (ad) {
ad.adType = adType;
}
switch (connectorType) {
case "Flash Ad + Preloader" :
gotoAndStop ("adPreloader");
break;
case "Flash Ad Only" :
gotoAndStop ("ad");
break;
case "Invisible" :
gotoAndStop ("invisible");
}
_apiConnect();
Instance of Symbol 166 MovieClip [FlashAd] "ad" in Symbol 167 MovieClip [APIConnector] Frame 1
//component parameters
onClipEvent (construct) {
apiId = "";
showBorder = true;
adType = "Video";
}
Instance of Symbol 109 MovieClip [Preloader] "loader" in Symbol 167 MovieClip [APIConnector] Frame 1
//component parameters
onClipEvent (construct) {
autoPlay = false;
mainClass = "";
}
Symbol 171 MovieClip [groundspatter] Frame 2
var xstr = [];
var ystr = [];
var galpha = 100;
var limit = [];
var i = 0;
while (i < 10) {
this.attachMovie("groundchunk", "bp" + i, 10000 + i);
xstr[i] = (Math.random() * 10) - 5;
ystr[i] = Math.random() * 8;
limit[i] = (Math.random() * 20) + 50;
this["bp" + i]._x = (Math.random() * 6) - 3;
this["bp" + i]._y = (Math.random() * 6) + 5;
this["bp" + i]._xscale = (Math.random() * 10) + 60;
this["bp" + i]._yscale = (Math.random() * 10) + 60;
i++;
}
Symbol 171 MovieClip [groundspatter] Frame 4
if (galpha > 1) {
galpha = galpha - 3;
var i = 0;
while (i < 10) {
if (this["bp" + i]._y < limit[i]) {
this["bp" + i]._x = this["bp" + i]._x + xstr[i];
this["bp" + i]._y = this["bp" + i]._y - ystr[i];
ystr[i] = ystr[i] - 0.8;
this["bp" + i]._rotation = this["bp" + i]._rotation + (xstr[i] * 4);
}
this["bp" + i]._alpha = galpha;
i++;
}
gotoAndPlay (3);
} else {
this.swapDepths(1);
var i = 0;
while (i < 10) {
this["bp" + i].swapDepths(1);
this["bp" + i].removeMovieClip();
this["bp" + i].removeMovieClip();
i++;
}
this.removeMovieClip();
gotoAndStop (1);
}
Symbol 178 MovieClip [dmgup] Frame 15
this.removeMovieClip();
Symbol 179 MovieClip [bloodspatter] Frame 2
var xstr = [];
var ystr = [];
var galpha = 100;
var limit = [];
var i = 0;
while (i < 5) {
this.attachMovie("blooddrop", "bp" + i, 10000 + i);
xstr[i] = (Math.random() * 6) - 3;
ystr[i] = Math.random() * 4;
limit[i] = (Math.random() * 20) + 20;
this["bp" + i]._x = (Math.random() * 6) - 3;
this["bp" + i]._y = (Math.random() * 6) + 5;
this["bp" + i]._xscale = (Math.random() * 10) + 60;
this["bp" + i]._yscale = (Math.random() * 10) + 60;
i++;
}
Symbol 179 MovieClip [bloodspatter] Frame 4
if (galpha > 1) {
galpha = galpha - 5;
var i = 0;
while (i < 5) {
if (this["bp" + i]._y < limit[i]) {
this["bp" + i]._x = this["bp" + i]._x + xstr[i];
this["bp" + i]._y = this["bp" + i]._y - ystr[i];
ystr[i] = ystr[i] - 0.8;
}
this["bp" + i]._alpha = galpha;
i++;
}
gotoAndPlay (3);
} else {
this.swapDepths(1);
var i = 0;
while (i < 5) {
this["bp" + i].swapDepths(1);
this["bp" + i].removeMovieClip();
this["bp" + i].removeMovieClip();
i++;
}
this.removeMovieClip();
gotoAndStop (1);
}
Symbol 187 MovieClip Frame 1
stop();
Symbol 188 MovieClip [loadbar2] Frame 1
stop();
Symbol 188 MovieClip [loadbar2] Frame 2
stop();
Symbol 190 MovieClip [cannonball] Frame 1
hb._visible = false;
Symbol 199 MovieClip [wind] Frame 6
stop();
this.removeMovieClip();
Symbol 201 MovieClip [unlockedtxt] Frame 124
this.removeMovieClip();
Symbol 203 MovieClip [lvlupherotxt] Frame 136
this.removeMovieClip();
Symbol 205 MovieClip [smashed] Frame 1
this._alpha--;
Symbol 216 MovieClip [menubutton] Frame 1
stop();
Symbol 234 MovieClip [ag_intro_mc] Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 234 MovieClip [ag_intro_mc] Frame 225
stop();
_parent.removeMovieClip();
_parent._x = 2000;
_root.goblinarenasplash.play();
Symbol 240 MovieClip [sky] Frame 1
stop();
Symbol 240 MovieClip [sky] Frame 3
stop();
Symbol 240 MovieClip [sky] Frame 8
stop();
Symbol 240 MovieClip [sky] Frame 11
stop();
Symbol 258 MovieClip [mountaincurve] Frame 1
stop();
Symbol 292 MovieClip [mountains1] Frame 1
stop();
Symbol 292 MovieClip [mountains1] Frame 11
stop();
Symbol 352 MovieClip [tower1] Frame 1
stop();
Symbol 352 MovieClip [tower1] Frame 2
var r1xstr = [];
var r1ystr = [];
var r2xstr = [];
var r2ystr = [];
var r3xstr = [];
var r3ystr = [];
var galpha = 100;
var r1limit = [];
var r2limit = [];
var r3limit = [];
var i = 0;
while (i < 6) {
r1xstr[i] = (Math.random() * 10) - 5;
r1ystr[i] = (Math.random() * 10) + 5;
r1limit[i] = (Math.random() * 10) + 250;
r2xstr[i] = (Math.random() * 10) - 5;
r2ystr[i] = (Math.random() * 10) + 5;
r2limit[i] = (Math.random() * 10) + 250;
r3xstr[i] = (Math.random() * 10) - 5;
r3ystr[i] = (Math.random() * 10) + 5;
r3limit[i] = (Math.random() * 10) + 250;
r4xstr[i] = (Math.random() * 10) - 5;
r4ystr[i] = (Math.random() * 10) + 5;
r4limit[i] = (Math.random() * 10) + 250;
i++;
}
Symbol 352 MovieClip [tower1] Frame 4
trace("GALPHA =" + galpha);
if (galpha > 1) {
galpha = galpha - 0.5;
var i = 0;
while (i < 6) {
if (this.r1["t" + i]._y < r1limit[i]) {
this.r1["t" + i]._x = this.r1["t" + i]._x + r1xstr[i];
this.r1["t" + i]._y = this.r1["t" + i]._y - r1ystr[i];
this.r1["t" + i]._rotation = this.r1["t" + i]._rotation + (r1xstr[i] * 3);
r1ystr[i] = r1ystr[i] - 0.8;
}
if (this.r2["t" + i]._y < r2limit[i]) {
this.r2["t" + i]._x = this.r2["t" + i]._x + r2xstr[i];
this.r2["t" + i]._y = this.r2["t" + i]._y - r2ystr[i];
this.r2["t" + i]._rotation = this.r2["t" + i]._rotation + (r2xstr[i] * 3);
r2ystr[i] = r2ystr[i] - 0.8;
}
if (this.r3["t" + i]._y < r3limit[i]) {
this.r3["t" + i]._x = this.r3["t" + i]._x + r3xstr[i];
this.r3["t" + i]._y = this.r3["t" + i]._y - r3ystr[i];
this.r3["t" + i]._rotation = this.r3["t" + i]._rotation + (r3xstr[i] * 3);
r3ystr[i] = r3ystr[i] - 0.8;
}
if (this.r4["t" + i]._y < r4limit[i]) {
this.r4["t" + i]._x = this.r4["t" + i]._x + r4xstr[i];
this.r4["t" + i]._y = this.r4["t" + i]._y - r4ystr[i];
this.r4["t" + i]._rotation = this.r4["t" + i]._rotation + (r4xstr[i] * 3);
r4ystr[i] = r4ystr[i] - 0.8;
}
i++;
}
gotoAndPlay (3);
} else {
trace("END THE GAME FROM TOWER");
gotoAndStop (5);
}
Symbol 352 MovieClip [tower1] Frame 5
stop();
_root.gameend();
this.removeMovieClip();
Symbol 361 MovieClip [mountains2] Frame 1
stop();
Symbol 361 MovieClip [mountains2] Frame 4
stop();
Symbol 361 MovieClip [mountains2] Frame 11
stop();
Symbol 384 MovieClip [goblinarenaicon] Frame 1
stop();
Instance of Symbol 388 MovieClip "link2" in Symbol 389 MovieClip [frontlink] Frame 1
on (press) {
getURL ("http://www.goblinarena.com", blank);
}
Symbol 409 MovieClip Frame 26
stop();
Instance of Symbol 391 MovieClip "test" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
_parent._parent.stop();
counta = 1;
countb = 100;
countc = 200;
coont = 0;
}
onClipEvent (enterFrame) {
coont = coont + 1;
counta = counta + 1;
countb = countb + 1;
countc = countc + 1;
if (counta > 98) {
counta = 1;
countb = 100;
countc = 200;
}
_parent.hota.duplicateMovieClip("hota" + counta, counta);
_parent.hotb.duplicateMovieClip("hotb" + countb, countb);
_parent.hotc.duplicateMovieClip("hotc" + countc, countc);
}
Instance of Symbol 393 MovieClip "guideclip" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
radians = 0;
}
onClipEvent (enterFrame) {
radians = radians + Number(_parent.speed);
xval = _parent.mid._x + (Number(_parent.sizer) * Math.cos(radians));
yval = _parent.mid._y + (Number(_parent.sizer) * Math.sin(radians));
this._x = xval;
this._y = yval;
}
Instance of Symbol 393 MovieClip "mid" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 406 MovieClip in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
tecst = 0;
if (Number(_parent.checkpercy)) {
this._alpha = 100;
} else {
this._alpha = 0;
}
}
onClipEvent (enterFrame) {
percy = Math.floor((100 * _root.getBytesLoaded()) / _root.getBytesTotal());
tecst = percy;
if (percy > 99) {
if (_root.armorgames) {
_parent._parent.gotoAndPlay(_parent._parent._currentframe + 1);
}
}
}
Instance of Symbol 409 MovieClip "hota" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this._xscale = Number(_parent.maxsize);
this._yscale = Number(_parent.maxsize);
this._x = _parent.guideclip._x;
this._y = _parent.guideclip._y;
if (this._name == "hota") {
this._alpha = 0;
} else {
this._alpha = 100;
play();
}
}
onClipEvent (enterFrame) {
if (this._name == "hota") {
} else if (this._xscale > 0) {
this._xscale = this._xscale / Number(_parent.taildec);
this._yscale = this._yscale / Number(_parent.taildec);
}
}
Instance of Symbol 412 MovieClip "hotb" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this._xscale = Number(_parent.maxsize);
this._yscale = Number(_parent.maxsize);
this._x = _parent.guideclip._x;
this._y = _parent.guideclip._y;
if (this._name == "hotb") {
this._alpha = 0;
} else {
this._alpha = 100;
}
}
onClipEvent (enterFrame) {
if (this._name == "hotb") {
} else if (this._xscale > 0) {
this._xscale = this._xscale / Number(_parent.taildec);
this._yscale = this._yscale / Number(_parent.taildec);
}
}
Instance of Symbol 414 MovieClip "hotc" in Symbol 420 MovieClip Frame 1
onClipEvent (load) {
this._xscale = Number(_parent.maxsize);
this._yscale = Number(_parent.maxsize);
this._x = _parent.guideclip._x;
this._y = _parent.guideclip._y;
if (this._name == "hotc") {
this._alpha = 0;
} else {
this._alpha = 100;
play();
}
}
onClipEvent (enterFrame) {
if (this._name == "hotc") {
} else if (this._xscale > 0) {
this._xscale = this._xscale / Number(_parent.taildec);
this._yscale = this._yscale / Number(_parent.taildec);
}
}
Symbol 119 MovieClip [__Packages.com.newgrounds.APIConnection] Frame 0
class com.newgrounds.APIConnection
{
var _hostURL, hostDomain, sessionId, publisherId, encryptionKey, userEmail, username, userId, userpageFormat, initialized;
function APIConnection () {
reset();
}
function get hostURL() {
return(_hostURL);
}
function set hostURL(value) {
_hostURL = value;
hostDomain = null;
if (_hostURL) {
var _local2 = _hostURL.split("/");
if ((_local2[0] != "file:") && (_hostURL != "localhost")) {
hostDomain = _local2[2];
}
}
if (!hostDomain) {
hostDomain = "localhost";
}
//return(hostURL);
}
function get sandboxType() {
return(System.security.sandboxType);
}
function get isNetworkHost() {
switch (sandboxType) {
case "localWithFile" :
case "localWithNetwork" :
case "localTrusted" :
case "application" :
return(false);
case "remote" :
}
return(true);
}
function get hasUserSession() {
return(((sessionId != null) && (sessionId != "")) && (publisherId != 0));
}
function get connected() {
return(connectionState == CONNECTED);
}
function reset() {
connectionState = NOT_CONNECTED;
encryptionKey = null;
sessionId = null;
userEmail = null;
username = null;
userId = 0;
userpageFormat = 0;
}
function assertInitialized() {
if (!initialized) {
com.newgrounds.Logger.logError("You must initialized the API using API.connect() before using this command.");
return(false);
}
return(true);
}
function assertConnected() {
if ((!connectionState) == CONNECTED) {
com.newgrounds.Logger.logError("You must establish a connection using API.connect() before using this command.");
return(false);
}
return(true);
}
function sendSimpleCommand(command, completeHandler, parameters, secureParameters) {
if (parameters == undefined) {
parameters = null;
}
if (secureParameters == undefined) {
secureParameters = null;
}
var _local2 = new com.newgrounds.APICommand(command);
_local2.__set__parameters(parameters);
_local2.__set__secureParameters(secureParameters);
if (completeHandler != null) {
_local2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, completeHandler);
}
_local2.send(this);
}
function sendCommand(command) {
command.send(this);
}
function loadInBrowser(command, newWindow, parameters) {
if (newWindow == undefined) {
newWindow = true;
}
if (parameters == undefined) {
parameters = null;
}
var _local2 = new com.newgrounds.APICommand(command);
_local2.__set__parameters(parameters);
_local2.loadInBrowser(this, newWindow);
}
static var NOT_CONNECTED = "notConnected";
static var CONNECTING = "connecting";
static var CONNECTED = "connected";
var connectionState = NOT_CONNECTED;
var apiURL = "http://www.ngads.com/gateway_v2.php";
}
Symbol 113 MovieClip [__Packages.com.newgrounds.EventDispatcher] Frame 0
class com.newgrounds.EventDispatcher
{
var _listeners;
function EventDispatcher () {
_listeners = {};
}
function addEventListener(type, listener) {
if (!_listeners[type]) {
_listeners[type] = [];
}
if (typeof(listener) == "function") {
_listeners[type].push({target:null, func:listener});
} else {
_listeners[type].push(listener);
}
}
function removeEventListener(type, listener) {
var _local3 = _listeners[type];
if (_local3) {
var _local5 = _local3.length;
var _local2 = 0;
while (_local2 < _local5) {
if ((_local3[_local2].func == listener) || (_local3[_local2] == listener)) {
_local3.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
}
function dispatchEvent(event) {
var _local4 = _listeners[event.__get__type()];
if (_local4) {
var _local5 = _local4.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local3 = _local4[_local2];
_local3.func.call(_local3.target, event);
_local2++;
}
}
return(true);
}
}
Symbol 112 MovieClip [__Packages.com.newgrounds.Event] Frame 0
class com.newgrounds.Event
{
var _type;
function Event (type) {
_type = type;
}
function get type() {
return(_type);
}
}
Symbol 114 MovieClip [__Packages.com.newgrounds.APIEventDispatcher] Frame 0
class com.newgrounds.APIEventDispatcher extends com.newgrounds.EventDispatcher
{
static var _globalDispatcher;
function APIEventDispatcher () {
super();
}
static function get globalDispatcher() {
return(_globalDispatcher);
}
static function set globalDispatcher(value) {
_globalDispatcher = value;
//return(globalDispatcher);
}
static function initEventQueue() {
setInterval(runEventQueue, 50);
return([]);
}
function dispatchEvent(event) {
_eventQueue.push({dispatcher:this, event:event});
return(true);
}
function actualDispatchEvent(event) {
var _local3 = super.dispatchEvent(event);
if (_globalDispatcher && (this != _globalDispatcher)) {
_globalDispatcher.dispatchEvent(event);
}
}
static function runEventQueue(event) {
var _local3 = _eventQueue.length;
if (_local3) {
var _local4 = _eventQueue;
_eventQueue = [];
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = _local4[_local1];
_local2.dispatcher.actualDispatchEvent(_local2.event);
_local1++;
}
}
}
static var _eventQueue = initEventQueue();
}
Symbol 117 MovieClip [__Packages.com.newgrounds.encoders.BaseN] Frame 0
class com.newgrounds.encoders.BaseN
{
var _hash, _base, _reverseHash;
function BaseN (hash) {
if (hash) {
_hash = hash;
} else {
_hash = DEFAULT_HASH;
}
_base = _hash.length;
_reverseHash = new Object();
var _local2 = 0;
while (_local2 < _hash.length) {
_reverseHash[_hash.charAt(_local2)] = _local2;
_local2++;
}
}
function encodeUint(number, minimumChars) {
if (minimumChars == undefined) {
minimumChars = 1;
}
var _local2 = "";
var _local3 = number;
while (_local3 != 0) {
_local2 = _hash.charAt(_local3 % _base) + _local2;
_local3 = _local3 / _base;
_local3 = int(_local3);
}
while (_local2.length < minimumChars) {
_local2 = _hash.charAt(0) + _local2;
}
return(_local2);
}
function decodeUint(encodedNumber) {
var _local3 = 0;
var _local2 = 0;
while (_local2 < encodedNumber.length) {
_local3 = _local3 * _base;
_local3 = _local3 + _reverseHash[encodedNumber.charAt(_local2)];
_local2++;
}
return(_local3);
}
static var DEFAULT_HASH = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
}
Symbol 123 MovieClip [__Packages.com.newgrounds.APICommand] Frame 0
class com.newgrounds.APICommand extends com.newgrounds.APIEventDispatcher
{
static var _throttleTimestamp, bridge;
var _command, _parameters, _secureParameters, _hasTimeout, _preventCache, _files, _loader, _timeoutTimer, dispatchEvent;
function APICommand (command) {
super();
_command = command;
_parameters = new Object();
_secureParameters = new Object();
_hasTimeout = true;
}
static function stopPendingCommands() {
for (var _local2 in _pendingCommands) {
var _local1 = _pendingCommands[_local2];
_local1.close();
}
_pendingCommands = [];
}
static function onThrottleTimer(event) {
if ((getTimer() - _throttleTimestamp) >= THROTTLE_INTERVAL) {
_throttleCount = 0;
_throttleCount = 0;
while (_commandQueue.length && (_throttleCount < THROTTLE_THRESHOLD)) {
var _local1 = _commandQueue.shift();
_local1.command.send(_local1.connection);
_throttleCount++;
}
}
}
static function encryptHex(hexValue) {
var _local4 = hexValue.length % 6;
var _local3 = "";
var _local1 = 0;
while (_local1 < hexValue.length) {
_local3 = _local3 + _encryptor.encodeUint(int("0x" + hexValue.substr(_local1, 6)), 4);
_local1 = _local1 + 6;
}
return(_local4.toString() + _local3);
}
function get command() {
return(_command);
}
function set command(value) {
_command = value;
//return(command);
}
function get hasTimeout() {
return(_hasTimeout);
}
function set hasTimeout(val) {
_hasTimeout = val;
//return(hasTimeout);
}
function get parameters() {
return(_parameters);
}
function set parameters(object) {
_parameters = new Object();
if (object) {
for (var _local3 in object) {
_parameters[_local3] = object[_local3];
}
}
//return(parameters);
}
function get preventCache() {
return(_preventCache);
}
function set preventCache(value) {
_preventCache = value;
//return(preventCache);
}
function get secureParameters() {
return(_secureParameters);
}
function set secureParameters(object) {
_secureParameters = new Object();
if (object) {
for (var _local3 in object) {
_secureParameters[_local3] = object[_local3];
}
}
//return(secureParameters);
}
function get hasSecureParameters() {
for (var _local2 in _secureParameters) {
return(true);
}
return(false);
}
function addFile(filename, data, dataField, contentType) {
if (contentType == undefined) {
contentType = "application/octet-stream";
}
if (!_files) {
_files = new Object();
}
var _local3 = {filename:filename, data:data, dataField:dataField, contentType:contentType};
_files[filename] = _local3;
}
function removeFile(filename) {
if (_files) {
delete _files[filename];
}
}
function clearFiles() {
_files = null;
}
function close() {
if (_loader) {
clearInterval(_timeoutTimer);
var _local2 = 0;
while (_local2 < _pendingCommands.length) {
if (_pendingCommands[_local2] == this) {
_pendingCommands.splice(_local2, 1);
break;
}
_local2++;
}
_loader = null;
}
}
function loadInBrowser(connection, newWindow) {
_parameters.command_id = _command;
_parameters.tracker_id = (connection.apiId ? (connection.apiId) : 1);
if (connection.debug) {
_parameters.debug = 1;
}
var _local3 = (connection.apiURL + "?host=") + escape(connection.hostDomain);
for (var _local4 in _parameters) {
_local3 = _local3 + ((("&" + escape(_local4)) + "=") + escape(_parameters[_local4]));
}
var _local6;
if (newWindow) {
_local6 = "_blank";
} else {
_local6 = "_top";
}
_root.getURL(_local3, _local6);
}
function send(connection) {
if (_throttleCount >= THROTTLE_THRESHOLD) {
_commandQueue.push({connection:connection, command:this});
} else {
sendInternal(connection);
}
}
function sendInternal(connection) {
var _local4;
_local4 = new LoadVars();
_local4.command_id = _command;
_local4.tracker_id = connection.apiId;
if (connection.debug) {
_local4.debug = 1;
}
if (_preventCache) {
_local4.seed = Math.random();
}
var _local2;
var _local3;
var _local7;
for (_local2 in _parameters) {
_local3 = _parameters[_local2];
if (_local3 != null) {
if (typeof(_local3) == "boolean") {
_local4[_local2] = int(_local3);
} else {
_local4[_local2] = _local3;
}
}
}
if (hasSecureParameters) {
var _local6 = new Object();
for (_local2 in _secureParameters) {
_local3 = _secureParameters[_local2];
if (_local3 != null) {
if (typeof(_local3) == "boolean") {
_local6[_local2] = int(_local3);
} else {
_local6[_local2] = _local3;
}
}
}
var _local8 = "";
_local7 = 0;
while (_local7 < 16) {
_local8 = _local8 + ENCRYPTOR_RADIX.charAt(int(Math.random() * ENCRYPTOR_RADIX.length));
_local7++;
}
_local4.command_id = "securePacket";
_local6.command_id = _command;
_local6.as_version = 3;
_local6.session_id = connection.sessionId;
_local6.user_email = connection.userEmail;
_local6.publisher_id = connection.publisherId;
_local6.seed = _local8;
var _local13 = com.newgrounds.crypto.MD5.hash(_local8);
var _local11 = com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(_local6), connection.encryptionKey);
_local4.secure = encryptHex(_local13 + _local11);
}
com.newgrounds.Logger.logInternal("Sending packet:", _local4);
var _local12;
_local12 = "application/x-www-form-urlencoded";
for (_local2 in _local4) {
if (typeof(_local4[_local2]) == "object") {
_local4[_local2] = com.newgrounds.encoders.json.JSON.encode(_local4[_local2]);
}
}
if (_files) {
for (var _local10 in _files) {
var _local5 = _files[_local10];
if (typeof(_local5.data) == "string") {
_local4[_local10] = _local5.data;
} else {
_local4[_local10] = com.newgrounds.encoders.json.JSON.encode(_local5.data);
}
}
}
_pendingCommands.push(this);
_throttleCount++;
_throttleTimestamp = getTimer();
startLoader(connection.apiURL, _local4, _local12);
}
function startLoader(url, data, contentType) {
_loader = LoadVars(data);
_loader.onData = as2CompleteHandler;
_loader.contentType = contentType;
_loader.sendAndLoad(url, _loader, "POST");
if (_hasTimeout) {
setInterval(this, onTimeout, TIMEOUT_INTERVAL);
}
}
function as2CompleteHandler(data) {
var _local3;
var _local2 = 0;
while (_local2 < _pendingCommands.length) {
if (_pendingCommands[_local2]._loader == this) {
_local3 = _pendingCommands[_local2];
break;
}
_local2++;
}
_local3.onComplete(data);
}
function onTimeout(event) {
close();
com.newgrounds.Logger.logError("Command timed out.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_TIMED_OUT));
}
function onError(error) {
com.newgrounds.Logger.logError("Error when sending command:", error);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_UNKNOWN));
close();
}
function onComplete(data) {
com.newgrounds.Logger.logInternal("Received packet:", data);
try {
if ((!data) || (data == "")) {
throw new Error();
}
var _local2 = com.newgrounds.encoders.json.JSON.decode(data);
if (!_local2) {
throw new Error();
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, _local2, ((_local2 && (_local2.success)) ? (com.newgrounds.APIEvent.ERROR_NONE) : (com.newgrounds.APIEvent.ERROR_COMMAND_FAILED))));
if (bridge) {
bridge.sendEvent(_local2.command_id, _local2);
}
} catch(e) {
com.newgrounds.Logger.logError("Invalid response returned from server: " + data);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_BAD_RESPONSE));
}
close();
}
static var TIMEOUT_INTERVAL = 10000;
static var THROTTLE_INTERVAL = 10050;
static var THROTTLE_TICK_INTERVAL = 1000;
static var THROTTLE_THRESHOLD = 24;
static var _throttleCount = 0;
static var _commandQueue = [];
static var _throttleTimer = setInterval(onThrottleTimer, THROTTLE_TICK_INTERVAL);
static var ENCRYPTOR_RADIX = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
static var _encryptor = new com.newgrounds.encoders.BaseN(ENCRYPTOR_RADIX);
static var _pendingCommands = [];
static var CRLF = "\r\n";
}
Symbol 118 MovieClip [__Packages.com.newgrounds.Bridge] Frame 0
class com.newgrounds.Bridge
{
var _widgetId, _inConnection, _outConnection;
function Bridge (id) {
_widgetId = id;
_inConnection = new LocalConnection();
_outConnection = new LocalConnection();
_inConnection.receiveEvent = receiveEvent;
_inConnection.connect("rec_" + _widgetId);
com.newgrounds.Logger.addEventListener(com.newgrounds.APIEvent.LOG, {target:this, func:onLogMessage});
}
function onLogMessage(event) {
try {
_outConnection.send(_widgetId, "sendEvent", "trace", String(event.__get__data()));
} catch(error) {
}
}
function sendEvent(command, parameters) {
if (_outConnection) {
parameters = {data:parameters};
try {
_outConnection.send(_widgetId, "sendEvent", command, parameters);
} catch(error) {
}
}
}
function receiveEvent(event, parameters) {
}
function onStatus(event) {
}
}
Symbol 115 MovieClip [__Packages.com.newgrounds.APIEvent] Frame 0
class com.newgrounds.APIEvent extends com.newgrounds.Event
{
var _error, _success, _data, __get__type;
function APIEvent (type, data, error) {
super(type);
if (data == undefined) {
data = null;
}
if (error == undefined) {
error = null;
}
if (((!error) || (error == "")) || (error == ERROR_NONE)) {
_error = ERROR_NONE;
_success = true;
} else {
_error = error;
_success = false;
}
if (data) {
_data = data;
} else {
_data = {};
}
}
function clone() {
return(new com.newgrounds.APIEvent(__get__type(), _data, _error));
}
function get success() {
return(_success);
}
function get data() {
return(_data);
}
function get error() {
return(_error);
}
static var COMMAND_COMPLETE = "commandComplete";
static var MEDAL_UNLOCK_CONFIRMED = "medalUnlockConfirmed";
static var ICON_LOADED = "iconLoaded";
static var API_CONNECTED = "movieConnected";
static var LOG = "log";
static var MEDAL_UNLOCKED = "medalUnlocked";
static var SCORES_LOADED = "scoresLoaded";
static var SCORE_POSTED = "scorePosted";
static var QUERY_COMPLETE = "queryComplete";
static var FILE_LOADED = "fileLoaded";
static var FILE_SAVED = "fileSaved";
static var FILE_DELETED = "fileDeleted";
static var FILE_REQUESTED = "fileRequested";
static var VOTE_COMPLETE = "voteComplete";
static var ERROR_NONE = "noError";
static var ERROR_UNKNOWN = "unknownError";
static var ERROR_COMMAND_FAILED = "commandFailed";
static var ERROR_NOT_CONNECTED = "notConnected";
static var ERROR_INVALID_ARGUMENT = "invalidArgument";
static var ERROR_TIMED_OUT = "timedOut";
static var ERROR_BAD_FILE = "badFile";
static var ERROR_BAD_RESPONSE = "badResponse";
static var ERROR_SENDING_COMMAND = "errorSendingCommand";
static var ERROR_HOST_BLOCKED = "hostBlocked";
static var ERROR_ALREADY_VOTED = "alreadyVoted";
static var ERROR_NOT_LOGGED_IN = "notLoggedIn";
static var ERROR_WRONG_ENCRYPTION_KEY = "wrongEncryptionKey";
}
Symbol 134 MovieClip [__Packages.com.newgrounds.API] Frame 0
class com.newgrounds.API
{
static var _serverTime, _adFeedURL, _movieVersion, _bridge, _requestedSaveGroupId, _requestedSaveFileId, _movieName, _newVersion, _saveFilePath, _imageFilePath;
function API () {
}
static function get connected() {
return(_connection.__get__connected());
}
static function get isNetworkHost() {
return(_connection.__get__isNetworkHost());
}
static function get apiId() {
_connection.assertInitialized();
return(_connection.apiId);
}
static function get debugMode() {
return(_debugMode);
}
static function set debugMode(val) {
_debugMode = val;
//return(debugMode);
}
static function get publisherId() {
_connection.assertInitialized();
return(_connection.publisherId);
}
static function get sessionId() {
_connection.assertInitialized();
return(_connection.sessionId);
}
static function get hostDomain() {
_connection.assertInitialized();
return(_connection.hostDomain);
}
static function get hostURL() {
_connection.assertInitialized();
return(_connection.__get__hostURL());
}
static function get isNewgrounds() {
return(_connection.publisherId == 1);
}
static function get hasUserSession() {
_connection.assertInitialized();
return(_connection.__get__hasUserSession());
}
static function get username() {
_connection.assertInitialized();
return(_connection.username);
}
static function get userId() {
_connection.assertInitialized();
return(_connection.userId);
}
static function assertConnected(eventType) {
if (eventType == undefined) {
eventType = null;
}
if (_connection.assertConnected()) {
return(true);
}
if (eventType) {
dispatchEvent(eventType, null, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED);
}
return(false);
}
static function get serverTime() {
return(_serverTime);
}
static function get adsApproved() {
return(_adsApproved);
}
static function get adFeedURL() {
return(_adFeedURL);
}
static function get medals() {
return(_medalsArray);
}
static function get scoreBoards() {
return(_scoreBoardsArray);
}
static function get saveGroups() {
return(_saveGroupsArray);
}
static function connect(_root, apiId, encryptionKey, movieVersion) {
if (encryptionKey == undefined) {
encryptionKey = null;
}
if (movieVersion == undefined) {
movieVersion = "";
}
com.newgrounds.APIEventDispatcher.__set__globalDispatcher(_dispatcher);
System.security.loadPolicyFile("http://apifiles.ngfiles.com/crossdomain.xml");
if (_connection.initialized) {
com.newgrounds.Logger.logError("Connection already in progress. Please call API.disconnect() before attempting another connection.");
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED);
return(undefined);
}
apiId = trimWhitespace(apiId);
if (encryptionKey) {
encryptionKey = trimWhitespace(encryptionKey);
}
if ((!apiId) || (apiId == "")) {
com.newgrounds.Logger.logError("No apiId given. Please use the API ID from your API settings page.");
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(undefined);
}
com.newgrounds.Logger.logMessage(("====== Newgrounds API v" + VERSION) + " ======");
_connection.connectionState = com.newgrounds.APIConnection.CONNECTING;
_root=_root;//parameter overwritten
_movieVersion = movieVersion;
_connection.apiId = apiId;
var _local4;
_local4 = apiId.indexOf(":");
if (_local4 != -1) {
_connection.trackerId = int(apiId.substring(0, _local4));
} else {
_connection.trackerId = int(apiId);
}
if (!_connection.trackerId) {
com.newgrounds.Logger.logError("Invalid API ID: " + apiId);
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(undefined);
}
_connection.encryptionKey = encryptionKey;
_connection.initialized = true;
_connection.__set__hostURL(_root._url);
doConnect(_root);
}
static function doConnect(flashVars) {
if (isNetworkHost && (_debugMode != RELEASE_MODE)) {
com.newgrounds.Logger.logMessage("Live file detected, turning off debug mode.");
_debugMode = RELEASE_MODE;
}
if (flashVars && (flashVars.NewgroundsAPI_SandboxID)) {
_bridge = new com.newgrounds.Bridge(flashVars.NewgroundsAPI_SandboxID);
com.newgrounds.APICommand.bridge = _bridge;
}
if (_debugMode == RELEASE_MODE) {
if (flashVars) {
if (flashVars.NewgroundsAPI_UserName) {
_connection.username = flashVars.NewgroundsAPI_UserName;
}
if (flashVars.NewgroundsAPI_UserID) {
_connection.userId = flashVars.NewgroundsAPI_UserID;
}
if (flashVars.NewgroundsAPI_PublisherID) {
_connection.publisherId = flashVars.NewgroundsAPI_PublisherID;
}
if (flashVars.NewgroundsAPI_UserpageFormat) {
_connection.userpageFormat = flashVars.NewgroundsAPI_UserpageFormat;
}
if (flashVars.NewgroundsAPI_SessionID) {
_connection.sessionId = flashVars.NewgroundsAPI_SessionID;
}
if (flashVars.NewgroundsAPI_SaveGroupID) {
_requestedSaveGroupId = flashVars.NewgroundsAPI_SaveGroupID;
}
if (flashVars.NewgroundsAPI_SaveFileID) {
_requestedSaveFileId = flashVars.NewgroundsAPI_SaveFileID;
}
}
} else {
_connection.debug = true;
if ((_debugMode == DEBUG_MODE_LOGGED_IN) || (_debugMode == DEBUG_MODE_LOGGED_OUT)) {
_connection.publisherId = 1;
}
if (_debugMode == DEBUG_MODE_LOGGED_IN) {
_connection.sessionId = "D3bu64p1U53R";
_connection.userId = 10;
_connection.username = "API-Debugger";
}
}
_connection.sendSimpleCommand("connectMovie", onConnect, {host:_connection.hostDomain, movie_version:_movieVersion, publisher_id:_connection.publisherId});
}
static function onConnect(event) {
var _local1 = event.__get__data();
if (!event.__get__success()) {
com.newgrounds.Logger.logError("Unable to connect to the API.");
_connection.reset();
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, event.__get__data(), event.__get__error());
return(undefined);
}
if (debugMode != RELEASE_MODE) {
_adFeedURL = TEST_AD_FEED_URL;
} else if (_local1.ad_url) {
_adFeedURL = unescape(_local1.ad_url);
}
switch (_local1.ad_status) {
case -1 :
com.newgrounds.Logger.logWarning("Your movie is not approved to run Flash Ads.");
break;
case 0 :
com.newgrounds.Logger.logWarning("Your movie is still awaiting approval to run Flash Ads.");
break;
case 1 :
com.newgrounds.Logger.logMessage("Your movie is approved to run Flash Ads!");
}
_adsApproved = _local1.ad_status == 1;
if ((_debugMode == DEBUG_MODE_HOST_BLOCKED) || (_local1.deny_host)) {
com.newgrounds.Logger.logWarning(_connection.hostDomain + " does not have permission to host this movie!", "Update your API configuration to allow this host.");
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {officialURL:unescape(_local1.movie_url)}, com.newgrounds.APIEvent.ERROR_HOST_BLOCKED);
_connection.reset();
return(undefined);
}
_movieName = (_local1.movieName ? (_local1.movieName) : "");
com.newgrounds.Logger.logMessage("Connecting to the Newgrounds API Gateway...", ("----- " + _local1.movie_name) + " -----");
if (_debugMode == DEBUG_MODE_NEW_VERSION) {
_local1.movie_version = "Debug Mode";
}
if (_local1.movie_version) {
com.newgrounds.Logger.logMessage("A new version of this movie is available.", "Current version:\t" + _movieVersion, "Newest version:\t" + _local1.movie_version, "Use API.loadOfficialVersion() to link to the latest version.");
_newVersion = true;
} else {
_newVersion = false;
}
_serverTime = new Date(int(_local1.time) * 1000);
if (_local1.request_portal_url) {
_connection.sendSimpleCommand("setPortalID", null, {portal_url:_connection.__get__hostURL()});
}
_connection.sendSimpleCommand("preloadSettings", onMetadataLoaded, {publisher_id:_connection.publisherId, user_id:_connection.userId});
}
static function onMetadataLoaded(event) {
var _local11 = event.__get__data();
var _local4;
var _local1;
if (!event.__get__success()) {
com.newgrounds.Logger.logWarning("Unable to load movie metadata.");
disconnect();
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, null, event.__get__error());
return(undefined);
}
var _local10 = 0;
if (_local11.medals) {
_local10 = _local11.medals.length;
var _local18;
if (hasUserSession) {
_local18 = loadLocal("medals_unlocked_" + username);
} else {
_local18 = loadLocal("medals_unlocked");
}
_local4 = 0;
while (_local4 < _local10) {
var _local5 = _local11.medals[_local4];
var _local15 = _local5.medal_unlocked;
var _local17 = _local18 && (_local18[_local5.medal_id]);
var _local14 = (hasUserSession ? (_local15) : (_local17));
if (debugMode != RELEASE_MODE) {
_local14 = false;
}
var _local6 = new com.newgrounds.Medal(_connection, _local5.medal_id, _local5.medal_name, _local5.medal_description, Boolean(int(_local5.secret)), _local14, _local5.medal_value, _local5.medal_difficulty, _local5.medal_icon);
_local6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, onMedalUnlocked, false, 0, true);
_local6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed, false, 0, true);
_medals[_local6.__get__name()] = _local6;
_medalsArray.push(_local6);
com.newgrounds.Logger.logMessage(_local6);
if ((hasUserSession && (_local17)) && (!_local15)) {
com.newgrounds.Logger.logMessage(("Server missed the \"" + _local6.__get__name()) + "\" unlock. Resending...");
_local6.unlock();
}
_local4++;
}
}
com.newgrounds.Logger.logMessage(((_local10 + " medal") + ((_local10 != 1) ? "s" : "")) + " initialized.");
_local10 = 0;
if (_local11.score_boards) {
_local10 = _local11.score_boards.length;
_local4 = 0;
while (_local4 < _local10) {
var _local16 = _local11.score_boards[_local4];
var _local9 = new com.newgrounds.ScoreBoard(_connection, _local16.name, _local16.id);
_scoreBoards[_local9.__get__name()] = _local9;
_scoreBoardsArray.push(_local9);
com.newgrounds.Logger.logMessage(_local9);
_local4++;
}
}
com.newgrounds.Logger.logMessage(((_local10 + " scoreboard") + ((_local10 != 1) ? "s" : "")) + " initialized.");
_local10 = 0;
if (_local11.save_groups) {
_local10 = _local11.save_groups.length;
_local4 = 0;
while (_local4 < _local10) {
var _local2 = _local11.save_groups[_local4];
var _local13 = [];
if (_local2.keys) {
_local1 = 0;
while (_local1 < _local2.keys.length) {
var _local7 = _local2.keys[_local1];
_local13.push(new com.newgrounds.SaveKey(_local7.name, _local7.id, _local7.type));
_local1++;
}
}
var _local12 = [];
if (_local2.ratings) {
_local1 = 0;
while (_local1 < _local2.ratings.length) {
var _local3 = _local2.ratings[_local1];
_local12.push(new com.newgrounds.SaveRating(_local3.name, _local3.id, _local3.float, _local3.min, _local3.max));
_local1++;
}
}
var _local8 = new com.newgrounds.SaveGroup(_connection, _local2.group_name, _local2.group_id, _local2.group_type, _local13, _local12);
_saveGroups[_local8.__get__name()] = _local8;
_saveGroupsArray.push(_local8);
com.newgrounds.Logger.logMessage(_local8);
_local4++;
}
}
com.newgrounds.Logger.logMessage(((_local10 + " save group") + ((_local10 != 1) ? "s" : "")) + " initialized.");
if (_local11.save_file_path) {
_saveFilePath = _local11.save_file_path + "/";
com.newgrounds.SaveFile._saveFilePath = _saveFilePath;
com.newgrounds.Logger.logInternal("Save file path: " + _saveFilePath);
}
if (_local11.image_file_path) {
_imageFilePath = _local11.image_file_path + "/";
com.newgrounds.SaveFile._imageFilePath = _imageFilePath;
com.newgrounds.Logger.logInternal("Image file path: " + _imageFilePath);
}
com.newgrounds.Logger.logMessage("Connection complete!");
_connection.connectionState = com.newgrounds.APIConnection.CONNECTED;
dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {movieName:_movieName, newVersion:_newVersion});
if (_requestedSaveFileId && (_requestedSaveGroupId)) {
addEventListener(com.newgrounds.APIEvent.FILE_LOADED, onRequestedFileLoaded);
loadSaveFile(_requestedSaveFileId, false);
}
}
static function disconnect() {
if (!_connection.__get__connected()) {
com.newgrounds.Logger.logWarning("The Newgrounds API is already disconnected.");
return(undefined);
}
_connection.reset();
for (var _local2 in _medals) {
var _local1 = _medals[_local2];
_local1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, onMedalUnlocked);
_local1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, onMedalUnlockConfirmed);
}
_newVersion = false;
_medals = new Object();
_medalsArray = [];
_scoreBoards = new Object();
_scoreBoardsArray = [];
_saveGroups = new Object();
_saveGroupsArray = [];
_sharedObjects = new Object();
_imageFilePath = null;
_saveFilePath = null;
com.newgrounds.Logger.logMessage("Disconnected from the Newgrounds API.");
}
static function loadNewgrounds() {
_connection.loadInBrowser("loadNewgrounds");
}
static function loadOfficialVersion() {
if (_connection.assertInitialized()) {
_connection.loadInBrowser("loadOfficialVersion", false);
}
}
static function loadMySite() {
if (_connection.assertInitialized()) {
_connection.loadInBrowser("loadMySite");
}
}
static function loadCustomLink(linkName) {
if (_connection.assertInitialized()) {
_connection.loadInBrowser("loadCustomLink", true, {link:linkName});
}
}
static function getMedal(medalName) {
return(_medals[medalName]);
}
static function unlockMedal(medalName) {
if (!assertConnected()) {
return(undefined);
}
var _local1 = _medals[medalName];
if (!_local1) {
com.newgrounds.Logger.logError(("No medal named \"" + medalName) + "\" w.");
return(undefined);
}
_local1.unlock();
}
static function onMedalUnlocked(event) {
if (event.__get__success()) {
var _local2 = com.newgrounds.Medal(event.__get__data());
var _local1;
if (hasUserSession) {
_local1 = loadLocal("medals_unlocked_" + username);
if (!_local1) {
_local1 = new Object();
}
_local1[_local2.__get__id()] = true;
saveLocal("medals_unlocked_" + username, _local1);
} else {
_local1 = loadLocal("medals_unlocked");
if (!_local1) {
_local1 = new Object();
}
_local1[com.newgrounds.Medal(event.__get__data()).__get__id()] = true;
saveLocal("medals_unlocked", _local1);
com.newgrounds.Logger.logMessage(("User instanceof not logged in. Medal \"" + _local2.__get__name()) + "\" unlocked locally.");
}
}
}
static function onMedalUnlockConfirmed(event) {
if (hasUserSession) {
var _local1 = loadLocal("medals_unlocked_" + username);
if (!_local1) {
_local1 = new Object();
} else {
delete _local1[com.newgrounds.Medal(event.__get__data()).__get__id()];
}
saveLocal("medals_unlocked_" + username, _local1);
}
}
static function clearLocalMedals() {
for (var _local2 in _medals) {
var _local1 = _medals[_local2];
_local1.setUnlocked(false);
}
if (!hasUserSession) {
saveLocal("medals_unlocked", new Object());
}
}
static function getScoreBoard(scoreBoardName) {
if (!assertConnected()) {
return(null);
}
return(_scoreBoards[scoreBoardName]);
}
static function loadScores(scoreBoardName, period, firstResult, numResults, tag) {
if (period == undefined) {
period = "All-Time";
}
if (firstResult == undefined) {
firstResult = 1;
}
if (numResults == undefined) {
numResults = 10;
}
if (tag == undefined) {
tag = null;
}
if (!assertConnected()) {
return(null);
}
var _local1 = _scoreBoards[scoreBoardName];
if (!_local1) {
com.newgrounds.Logger.logError(("No scoreboard named \"" + scoreBoardName) + "\" w.");
dispatchEvent(com.newgrounds.APIEvent.SCORES_LOADED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(null);
}
_local1.__set__period(period);
_local1.__set__firstResult(firstResult);
_local1.__set__numResults(numResults);
_local1.__set__tag(tag);
_local1.loadScores();
return(_local1);
}
static function postScore(scoreBoardName, numericScore, tag) {
if (tag == undefined) {
tag = null;
}
if (!assertConnected()) {
return(undefined);
}
if (!hasUserSession) {
com.newgrounds.Logger.logError("The user must be logged-in to post a score.");
dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN);
return(undefined);
}
var _local1 = _scoreBoards[scoreBoardName];
if (!_local1) {
com.newgrounds.Logger.logError(("No scoreboard named \"" + scoreBoardName) + "\" w.");
dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT);
return(undefined);
}
_local1.postScore(numericScore, tag);
}
static function getSaveGroup(groupName) {
if (!assertConnected()) {
return(null);
}
return(_saveGroups[groupName]);
}
static function getSaveGroupById(id) {
for (var _local3 in _saveGroups) {
var _local1 = _saveGroups[_local3];
if (_local1.__get__id() == id) {
return(_local1);
}
}
return(null);
}
static function createSaveFile(groupName) {
if (!assertConnected()) {
return(null);
}
var _local1 = getSaveGroup(groupName);
if (!_local1) {
com.newgrounds.Logger.logError(("The save group \"" + groupName) + "\" w found.");
return(null);
}
return(new com.newgrounds.SaveFile(_local1));
}
static function loadSaveFile(saveId, loadContents) {
if (loadContents == undefined) {
loadContents = true;
}
_connection.sendSimpleCommand("loadSaveFile", onFileLoaded, {save_id:saveId, get_contents:loadContents});
}
static function onFileLoaded(event) {
var _local2;
if (event.__get__success()) {
_local2 = com.newgrounds.SaveFile.fromObject(getSaveGroupById(event.__get__data().group_id), event.__get__data().file);
if (event.__get__data().get_contents) {
_local2.load();
} else {
dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, _local2);
}
} else {
com.newgrounds.Logger.logError("Unable to load file:", event.__get__error());
dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, null, event.__get__error());
}
}
static function createSaveQuery(groupName) {
if (!assertConnected()) {
return(null);
}
var _local1 = getSaveGroup(groupName);
if (!_local1) {
com.newgrounds.Logger.logError(("The save group \"" + groupName) + "\" w found.");
return(null);
}
var _local2 = new com.newgrounds.SaveQuery(_local1);
return(_local2);
}
static function createSaveQueryByDate(groupName, sortDescending) {
if (sortDescending == undefined) {
sortDescending = true;
}
var _local1 = createSaveQuery(groupName);
if (!_local1) {
return(null);
}
_local1.sortOn(com.newgrounds.SaveQuery.CREATED_ON, sortDescending);
return(_local1);
}
static function createSaveQueryByName(groupName, filename, exactMatch, sortDescending) {
if (exactMatch == undefined) {
exactMatch = false;
}
if (sortDescending == undefined) {
sortDescending = false;
}
var _local1 = createSaveQuery(groupName);
_local1.addCondition(com.newgrounds.SaveQuery.FILE_NAME, (exactMatch ? (com.newgrounds.SaveQuery.OPERATOR_EQUAL) : (com.newgrounds.SaveQuery.OPERATOR_CONTAINS)), filename);
return(_local1);
}
static function createSaveQueryByRating(groupName, ratingName, sortDescending) {
if (sortDescending == undefined) {
sortDescending = true;
}
var _local1 = createSaveQuery(groupName);
_local1.sortOn(ratingName, sortDescending);
return(_local1);
}
static function onRequestedFileLoaded(event) {
removeEventListener(com.newgrounds.APIEvent.FILE_LOADED, onRequestedFileLoaded);
if (event.__get__success()) {
var _local1 = event.__get__data();
if (_local1) {
dispatchEvent(com.newgrounds.APIEvent.FILE_REQUESTED, _local1);
}
}
}
static function addEventListener(eventType, listener, priority, useWeakReference) {
if (priority == undefined) {
priority = 0;
}
if (useWeakReference == undefined) {
useWeakReference = true;
}
_dispatcher.addEventListener(eventType, listener, false, priority, useWeakReference);
}
static function removeEventListener(eventType, listener) {
_dispatcher.removeEventListener(eventType, listener);
}
static function dispatchEvent(event, data, error) {
if (data == undefined) {
data = null;
}
if (error == undefined) {
error = null;
}
_dispatcher.dispatchEvent(new com.newgrounds.APIEvent(event, data, error));
}
static function saveLocal(saveId, saveData) {
try {
var _local3;
var _local2 = (("ng_ap_secure_" + _connection.trackerId) + "_") + com.newgrounds.crypto.RC4.encrypt(saveId, _connection.encryptionKey);
if (!_sharedObjects[saveId]) {
_sharedObjects[saveId] = SharedObject.getLocal(_local2);
}
_local3 = _sharedObjects[saveId];
_local3.data.data = encodeData(saveData);
} catch(_local) {
if (Error( /* Error999 */
) != null) {
var error = Error( /* Error999 */
);
com.newgrounds.Logger.logError("Unable to save local data.", error);
return(false);
}
Error( /* Error999 */
);
throw /* Error999 */
;
}
return(true);
}
static function loadLocal(saveId) {
try {
var _local1;
var _local3 = (("ng_ap_secure_" + _connection.trackerId) + "_") + com.newgrounds.crypto.RC4.encrypt(saveId, _connection.encryptionKey);
if (!_sharedObjects[saveId]) {
_sharedObjects[saveId] = SharedObject.getLocal(_local3);
}
_local1 = _sharedObjects[saveId];
if ((_local1 && (_local1.data)) && (_local1.data.data)) {
return(decodeData(_local1.data.data));
}
return(null);
} catch(error:Error) {
com.newgrounds.Logger.logError("Unable to load local data.", error);
}
return(null);
}
static function logCustomEvent(eventName) {
if (assertConnected()) {
com.newgrounds.Logger.logMessage("Logged event: " + eventName);
_connection.sendSimpleCommand("logCustomEvent", null, {event:eventName});
}
}
static function encodeData(data) {
if (!_connection.assertInitialized()) {
return(null);
}
return(com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(data), _connection.encryptionKey));
}
static function decodeData(data) {
if (!_connection.assertInitialized()) {
return(null);
}
try {
return(com.newgrounds.encoders.json.JSON.decode(com.newgrounds.crypto.RC4.decrypt(data, _connection.encryptionKey)));
} catch(error:Error) {
}
return(null);
}
static function stopPendingCommands() {
com.newgrounds.APICommand.stopPendingCommands();
com.newgrounds.Logger.logMessage("Pending commands stopped.");
}
static function trimWhitespace(string) {
if (!string) {
return(null);
}
var _local3 = 0;
while (string.charAt(_local3) == " ") {
_local3++;
}
var _local1 = string.length - 1;
while ((string.charAt(_local1) == " ") && (_local1 >= 0)) {
_local1--;
}
return(string.slice(_local3, _local1 + 1));
}
static var VERSION = "3.1.12 AS2";
static var RELEASE_MODE = "releaseMode";
static var DEBUG_MODE_LOGGED_IN = "debugModeLoggedIn";
static var DEBUG_MODE_LOGGED_OUT = "debugModeLoggedOut";
static var DEBUG_MODE_NEW_VERSION = "debugModeNewVersion";
static var DEBUG_MODE_HOST_BLOCKED = "debugModeHostBlocked";
static var TEST_AD_FEED_URL = "http://www.ngads.com/adtest.php";
static var _dispatcher = new com.newgrounds.APIEventDispatcher();
static var _connection = new com.newgrounds.APIConnection();
static var _debugMode = DEBUG_MODE_LOGGED_IN;
static var _adsApproved = false;
static var _medals = new Object();
static var _medalsArray = [];
static var _scoreBoards = new Object();
static var _scoreBoardsArray = [];
static var _saveGroups = new Object();
static var _saveGroupsArray = [];
static var _sharedObjects = new Object();
}
Symbol 131 MovieClip [__Packages.com.newgrounds.encoders.ImageScanner] Frame 0
class com.newgrounds.encoders.ImageScanner
{
var _baseN, _encodeAlpha, _maxPerChannel;
function ImageScanner (hashLength, charsPerPixel) {
if (hashLength) {
_hash = DEFAULT_HASH.substr(0, hashLength);
}
_baseN = new com.newgrounds.encoders.BaseN(_hash);
if (charsPerPixel) {
_charsPerPixel = charsPerPixel;
}
encodeAlpha = (false);
}
function get encodeAlpha() {
return(_encodeAlpha);
}
function set encodeAlpha(v) {
_encodeAlpha = v;
_maxPerChannel = int(Math.pow(_hash.length, _charsPerPixel / (_encodeAlpha ? 4 : 3)));
if (_maxPerChannel > 256) {
_maxPerChannel = 256;
}
//return(encodeAlpha);
}
function encode(source, callbackFunction, callbackObject) {
var _local4 = {callbackFunction:callbackFunction, callbackObject:callbackObject, source:source, x:0, y:0, output:null};
var _local2 = source.width.toString();
var _local3 = source.height.toString();
while (_local2.length < 3) {
_local2 = "0" + _local2;
}
while (_local3.length < 3) {
_local3 = "0" + _local3;
}
_local4.output = _local2 + _local3;
var _local6 = setInterval(this, "doEncode", WORK_INTERVAL, _local4);
_local4.interval = _local6;
}
function decode(source, callbackFunction, callbackObject) {
var _local4 = {callbackFunction:callbackFunction, callbackObject:callbackObject, source:source, i:6, x:0, y:0, output:null};
var _local3 = source.substr(0, 3);
var _local2 = source.substr(3, 3);
while (_local3.charAt(0) == "0") {
_local3 = _local3.substr(1);
}
while (_local2.charAt(0) == "0") {
_local2 = _local2.substr(1);
}
var _local7 = int(_local3);
var _local8 = int(_local2);
_local4.output = new flash.display.BitmapData(_local7, _local8, _encodeAlpha);
var _local6 = setInterval(this, "doDecode", WORK_INTERVAL, _local4);
_local4.interval = _local6;
}
function doEncode(state) {
var _local3 = getTimer();
while ((state.y < state.source.height) && ((getTimer() - _local3) < WORK_INTERVAL)) {
state.output = state.output + encodePixel(state.source.getPixel32(state.x, state.y));
state.x++;
if (state.x == state.source.width) {
state.x = 0;
state.y++;
}
}
if (state.y == state.source.height) {
clearInterval(state.interval);
state.callbackFunction.call(state.callbackObject, state.output);
}
}
function doDecode(state) {
var _local4 = getTimer();
while ((state.y < state.output.height) && ((getTimer() - _local4) < WORK_INTERVAL)) {
var _local3 = decodePixel(state.source.substr(state.i, _charsPerPixel));
state.output.setPixel32(state.x, state.y, _local3);
state.i = state.i + _charsPerPixel;
state.x++;
if (state.x == state.output.width) {
state.x = 0;
state.y++;
}
}
if (state.y == state.output.height) {
clearInterval(state.interval);
state.callbackFunction.call(state.callbackObject, state.output);
}
}
function encodePixel(pixel) {
var _local3 = (pixel >> 24) & 255;
var _local4 = (pixel >> 16) & 255;
var _local5 = (pixel >> 8) & 255;
var _local2 = pixel & 255;
_local3 = int((_local3 / 256) * _maxPerChannel);
_local4 = int((_local4 / 256) * _maxPerChannel);
_local5 = int((_local5 / 256) * _maxPerChannel);
_local2 = int((_local2 / 256) * _maxPerChannel);
var _local7 = (((_local4 * _maxPerChannel) * _maxPerChannel) + (_local5 * _maxPerChannel)) + _local2;
if (_encodeAlpha) {
_local7 = _local7 + (((_local3 * _maxPerChannel) * _maxPerChannel) * _maxPerChannel);
}
return(_baseN.encodeUint(_local7, _charsPerPixel));
}
function decodePixel(encodedPixel) {
var _local3 = 255;
var _local5;
var _local6;
var _local4;
var _local7 = 0;
var _local2 = _baseN.decodeUint(encodedPixel);
_local4 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
_local6 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
_local5 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
if (_encodeAlpha) {
_local3 = _local2 % _maxPerChannel;
_local2 = _local2 / int(_maxPerChannel);
}
return((((_local3 << 24) | (_local5 << 16)) | (_local6 << 8)) | _local4);
}
static var DEFAULT_HASH = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&";
var _hash = DEFAULT_HASH;
var _charsPerPixel = 2;
static var WORK_INTERVAL = 33.3333333333333;
}
Symbol 132 MovieClip [__Packages.com.newgrounds.SaveFile] Frame 0
class com.newgrounds.SaveFile extends com.newgrounds.APIEventDispatcher
{
static var _currentFile;
var _iconLoader, _group, _keys, _ratings, _numVotes, _name, _description, _id, _data, _dataLoader, _fileSize, _readOnly, _draft, _authorId, _authorName, _views, _createdDate, _modifiedDate, dispatchEvent, _encodedIcon, _encodedData, _encoderQueue, _encoding, _dataLoaded, _encodingParent, _encodingProperty, _dataURL;
function SaveFile (group) {
super();
_iconLoader = new com.newgrounds.BitmapLoader(DEFAULT_ICON, null);
_group = group;
_keys = {};
_ratings = {};
_numVotes = {};
}
static function get currentFile() {
return(_currentFile);
}
static function fromObject(group, fileData) {
var _local3 = new com.newgrounds.SaveFile(group);
_local3._name = fileData.filename;
_local3._description = fileData.description;
_local3._id = fileData.save_id;
_local3._authorId = fileData.user_id;
_local3._authorName = fileData.user_name;
_local3._createdDate = fileData.created;
_local3._modifiedDate = fileData.last_update;
_local3._views = fileData.views;
if (fileData.thumb && (fileData.thumb != "")) {
_local3._iconLoader.__set__url(_imageFilePath + fileData.thumb);
}
_local3._dataURL = _saveFilePath + fileData.file;
_local3._fileSize = fileData.file_size;
_local3._approved = fileData.status != STATUS_UNAPPROVED;
_local3._readOnly = false;
_local3._public = (fileData.status != STATUS_PRIVATE) && (fileData.status != STATUS_UNAPPROVED);
for (var _local8 in fileData.keys) {
var _local6 = fileData.keys[_local8];
var _local4 = group.getKeyById(_local6.id);
if (_local4) {
_local3._keys[_local4.__get__name()] = _local4.validateValue(_local6.value);
}
}
for (var _local9 in fileData.ratings) {
var _local5 = fileData.ratings[_local9];
var _local2 = group.getRatingById(_local5.id);
if (_local2) {
_local3._ratings[_local2.__get__name()] = _local2.validateValue(_local5.score);
_local3._numVotes[_local2.__get__name()] = int(_local5.votes);
}
}
return(_local3);
}
function get group() {
return(_group);
}
function get name() {
return(_name);
}
function set name(val) {
_name = val;
//return(name);
}
function get description() {
return(_description);
}
function set description(val) {
_description = val;
//return(description);
}
function get id() {
return(_id);
}
function get data() {
return(_data);
}
function set data(val) {
_data = val;
//return(data);
}
function get bytesLoaded() {
if (_data) {
return(bytesTotal);
}
if (!_dataLoader) {
return(0);
}
return(_dataLoader.getBytesLoaded());
}
function get bytesTotal() {
return(_fileSize);
}
function get readOnly() {
return(_readOnly);
}
function get draft() {
return(_draft);
}
function set draft(v) {
_draft = v;
//return(draft);
}
function get authorId() {
return(_authorId);
}
function get authorName() {
return(_authorName);
}
function get keys() {
return(_keys);
}
function get ratings() {
return(_ratings);
}
function get numVotes() {
return(_numVotes);
}
function get views() {
return(_views);
}
function get createdDate() {
return(_createdDate);
}
function get updatedDate() {
return(_modifiedDate);
}
function toString() {
return("Save File: " + _name);
}
function get icon() {
return(_iconLoader.__get__bitmapData());
}
function set icon(v) {
createIcon(v);
//return(icon);
}
function get iconLoaded() {
return(_iconLoader.__get__loaded());
}
function createIcon(source) {
var _local9 = new flash.display.BitmapData(ICON_WIDTH, ICON_HEIGHT, false, 0);
var _local7;
var _local6;
var _local10 = 0;
var _local8 = 0;
if (source instanceof flash.display.BitmapData) {
_local7 = source.width;
_local6 = source.height;
} else if (source instanceof MovieClip) {
var _local2 = MovieClip(source).getBounds(source);
_local7 = _local2.xMax - _local2.xMin;
_local6 = _local2.yMax - _local2.yMin;
_local10 = _local2.xMin;
_local8 = _local2.yMin;
}
var _local4 = new flash.geom.Matrix();
var _local5;
_local5 = Math.min(ICON_WIDTH / _local7, ICON_HEIGHT / _local6);
_local4.translate(-_local10, -_local8);
_local4.scale(_local5, _local5);
_local4.translate((ICON_WIDTH - (_local7 * _local5)) / 2, (ICON_HEIGHT - (_local6 * _local5)) / 2);
_local9.draw(source, _local4);
_iconLoader.__set__bitmapData(_local9);
}
function attachIcon(parent) {
if (_iconLoader) {
return(_iconLoader.attachBitmap(parent));
}
com.newgrounds.Logger.logError("No icon available for this sumbission.");
return(null);
}
function deleteFile() {
if (!_group.__get__connection().__get__hasUserSession()) {
com.newgrounds.Logger.logError("The user must be logged-in to delete a file.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return(undefined);
}
if (!_id) {
com.newgrounds.Logger.logError("The file does not exist.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return(undefined);
}
var _local2 = new com.newgrounds.APICommand("deleteSaveFile");
_local2.__get__secureParameters().save_id = _id;
_local2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {target:this, func:onFileDeleted});
_group.__get__connection().sendCommand(_local2);
}
function save() {
if (!_group.__get__connection().__get__hasUserSession()) {
com.newgrounds.Logger.logError("The user must be logged-in to save a file.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN));
return(undefined);
}
com.newgrounds.BitmapLoader._cacheSeed++;
_currentFile = this;
if (iconLoaded) {
ICON_IMAGE_SCANNER.encode(icon, onIconEncoded, this);
} else {
encodeData(true);
}
}
function onIconEncoded(encodedIcon) {
_encodedIcon = encodedIcon;
encodeData(true);
}
function doSave() {
var _local4 = new com.newgrounds.APICommand("saveFile");
_local4.__get__secureParameters().group = _group.id;
_local4.__get__secureParameters().user_name = _group.__get__connection().username;
_local4.__get__secureParameters().filename = _name;
_local4.__get__secureParameters().description = _description;
if (_draft) {
_local4.__get__secureParameters().draft = true;
}
if (_id && (!_readOnly)) {
_local4.__get__secureParameters().overwrite = 1;
_local4.__get__secureParameters().save_id = _id;
}
var _local8 = [];
for (var _local9 in _keys) {
var _local2 = _group.getKey(_local9);
if (_local2) {
_local8.push({id:_local2.__get__id(), value:_local2.validateValue(_keys[_local9])});
} else {
com.newgrounds.Logger.logError(((("No key named \"" + _local9) + "\" in save group \"") + _group.__get__name()) + "\".");
}
}
_local4.__get__secureParameters().keys = _local8;
var _local7 = [];
for (var _local10 in _ratings) {
var _local3 = _group.getRating(_local10);
if (_local3) {
_local7.push({id:_local3.__get__id(), value:_local3.validateValue(_ratings[_local10])});
} else {
com.newgrounds.Logger.logError(((("No rating named \"" + _local10) + "\" in save group \"") + _group.__get__name()) + "\".");
}
}
_local4.__get__secureParameters().ratings = _local7;
if (typeof(_encodedData) == "string") {
_local4.addFile("file", _encodedData, "file");
} else {
_local4.addFile("file", com.newgrounds.encoders.json.JSON.encode(_encodedData), "file");
}
if (iconLoaded) {
_local4.addFile("thumbnail", _encodedIcon, "thumbnail");
}
_local4.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {target:this, func:onSaveComplete});
_group.__get__connection().sendCommand(_local4);
}
function encodeData(encode) {
_encoderQueue = [];
_encoding = encode;
if (encode) {
_encodedData = _data;
preEncodeObject(this, "_encodedData");
} else {
preEncodeObject(this, "_data");
}
encodeObject();
}
function preEncodeObject(parent, property) {
var _local3 = parent[property];
var _local5;
try {
if (_encoding) {
_local5 = _local3 instanceof flash.display.BitmapData;
} else {
_local5 = _local3.type == "__bitmap";
}
} catch(error) {
}
var _local2 = _local3;
var _local8;
if (_local5) {
_encoderQueue.push({parent:parent, property:property});
} else if ((typeof(_local3) == "object") && (!_local8)) {
if (_encoding) {
if (_local3 instanceof Array) {
_local2 = [];
} else {
_local2 = {};
}
for (var _local4 in _local3) {
_local2[_local4] = _local3[_local4];
}
parent[property] = _local2;
}
for (var _local4 in _local2) {
preEncodeObject(_local2, _local4);
}
}
}
function encodeObject() {
if (!_encoderQueue.length) {
if (_encoding) {
doSave();
} else {
_dataLoaded = true;
checkLoadComplete();
}
return(undefined);
}
var _local6 = _encoderQueue.pop();
var _local4 = _local6.parent;
var _local3 = _local6.property;
var _local2 = _local4[_local3];
var _local5;
if (_encoding) {
_local5 = {type:"__bitmap", width:_local2.width, height:_local2.height, transparent:_local2.transparent};
_local4[_local3] = _local5;
_encodingParent = _local5;
_encodingProperty = "data";
DATA_IMAGE_SCANNER.__set__encodeAlpha(_local2.transparent);
DATA_IMAGE_SCANNER.encode(flash.display.BitmapData(_local2), encodeBitmapComplete, this);
} else {
_encodingParent = _local4;
_encodingProperty = _local3;
DATA_IMAGE_SCANNER.__set__encodeAlpha(_local2.transparent);
DATA_IMAGE_SCANNER.decode(String(_local2.data), encodeBitmapComplete, this);
}
}
function encodeBitmapComplete(data) {
_encodingParent[_encodingProperty] = data;
encodeObject();
}
function load() {
_currentFile = this;
_dataLoaded = false;
_data = null;
if (!iconLoaded) {
_iconLoader.addEventListener(com.newgrounds.APIEvent.ICON_LOADED, {target:this, func:onIconLoaded});
_iconLoader.load();
}
_dataLoader = new LoadVars();
var file = this;
_dataLoader.onData = function (data) {
file.onDataLoaded(data);
};
_dataLoader.load((_dataURL + "&random=") + Math.random());
}
function onIconLoaded(event) {
if ((!event.__get__success()) && (_iconLoader.__get__url())) {
com.newgrounds.Logger.logWarning("Unable to load the icon for this save file.");
}
_iconLoader.removeEventListener(com.newgrounds.APIEvent.ICON_LOADED, onIconLoaded);
checkLoadComplete();
}
function checkLoadComplete() {
if (_dataLoaded && (iconLoaded)) {
com.newgrounds.Logger.logMessage("Data loaded.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this));
}
}
function onDataLoaded(data) {
try {
if (data) {
if (data.charAt(0) == "{") {
_data = com.newgrounds.encoders.json.JSON.decode(String(data));
} else {
_data = String(data);
}
encodeData(false);
}
} catch(error:Error) {
com.newgrounds.Logger.logError("Error while loading data:", error);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE));
}
}
function onDataError(error) {
com.newgrounds.Logger.logError("Unable to load data:", error);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE));
}
function onSaveComplete(event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage(("File \"" + _name) + "\" saved!");
if (event.__get__data()) {
_id = event.__get__data().save_id;
_dataURL = unescape(event.__get__data().file_url);
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this));
} else {
com.newgrounds.Logger.logError(("Error saving file \"" + _name) + "\":", event.__get__error());
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this, event.__get__error()));
}
}
function sendVote(ratingName, vote) {
var _local2 = _group.getRating(ratingName);
if (!_local2) {
com.newgrounds.Logger.logError(("No save rating named \"" + ratingName) + "\" exists for this save group.");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return(undefined);
}
vote = _local2.validateValue(vote);
if (isNaN(vote)) {
com.newgrounds.Logger.logError(((((((("Invalid vote (" + vote) + "). ") + ratingName) + " allows a range of ") + _local2.__get__minimum()) + "-") + _local2.__get__maximum()) + ".");
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return(undefined);
}
com.newgrounds.Logger.logMessage(((((("Voting " + vote) + " for ") + ratingName) + " on ") + _name) + "...");
_group.__get__connection().sendSimpleCommand("rateSaveFile", {target:this, func:onVoteComplete}, null, {group:_group.__get__id(), save_id:_id, rating_id:_local2.__get__id(), vote:vote});
}
function onVoteComplete(event) {
var _local2 = event.__get__error();
if (event.__get__data().already_voted) {
com.newgrounds.Logger.logError("Vote failed. You've already voted on this rating today.");
_local2 = com.newgrounds.APIEvent.ERROR_ALREADY_VOTED;
}
if (_local2 == com.newgrounds.APIEvent.ERROR_NONE) {
var _local3 = _group.getRatingById(event.__get__data().rating_id);
if (_local3) {
_ratings[_local3.__get__name()] = _local3.validateValue(event.__get__data().score);
}
com.newgrounds.Logger.logMessage("Vote complete!");
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, this, _local2));
}
function onFileDeleted(event) {
if (event.__get__success()) {
_id = 0;
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, this, event.__get__error()));
}
function clone() {
var _local3 = new com.newgrounds.SaveFile(_group);
_local3._data = _data;
_local3._description = _description;
_local3._draft = _draft;
_local3._fileSize = _fileSize;
_local3._iconLoader.__set__bitmapData(_iconLoader.bitmapData);
var _local2;
for (_local2 in _keys) {
_local3._keys[_local2] = _keys[_local2];
}
for (_local2 in _ratings) {
_local3._ratings[_local2] = _ratings[_local2];
}
for (_local2 in _numVotes) {
_local3._numVotes[_local2] = _numVotes[_local2];
}
_local3._name = _name;
return(_local3);
}
static var ICON_WIDTH = 90;
static var ICON_HEIGHT = 90;
static var DEFAULT_ICON = new flash.display.BitmapData(ICON_WIDTH, ICON_HEIGHT, false, 0);
static var STATUS_PRIVATE = 0;
static var STATUS_SHARED = 1;
static var STATUS_UNAPPROVED = 2;
static var STATUS_APPROVED = 3;
static var _imageFilePath = "";
static var _saveFilePath = "";
static var ICON_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner();
static var DATA_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner(64, 6);
}
Symbol 130 MovieClip [__Packages.com.newgrounds.SaveGroup] Frame 0
class com.newgrounds.SaveGroup
{
var _connection, _id, _name, _type, _keysArray, _ratingsArray, _keys, _ratings;
function SaveGroup (connection, name, id, type, keys, ratings) {
_connection = connection;
_id = id;
_name = name;
_type = type;
_keysArray = keys;
_ratingsArray = ratings;
_keys = new Object();
_ratings = new Object();
var _local11;
for (var _local7 in keys) {
var _local2 = keys[_local7];
_keys[_local2.__get__name()] = _local2;
}
for (var _local6 in ratings) {
var _local3 = ratings[_local6];
_ratings[_local3.__get__name()] = _local3;
}
}
function get connection() {
return(_connection);
}
function get name() {
return(_name);
}
function get type() {
return(_type);
}
function get id() {
return(_id);
}
function get keys() {
return(_keysArray);
}
function get ratings() {
return(_ratingsArray);
}
function getKey(name) {
return(_keys[name]);
}
function getRating(name) {
return(_ratings[name]);
}
function getKeyById(id) {
for (var _local4 in _keys) {
var _local2 = _keys[_local4];
if (_local2.__get__id() == id) {
return(_local2);
}
}
return(null);
}
function getRatingById(id) {
for (var _local4 in _ratings) {
var _local2 = _ratings[_local4];
if (_local2.__get__id() == id) {
return(_local2);
}
}
return(null);
}
function toString() {
return((((("SaveGroup: " + name) + " Keys: ") + _keysArray) + " Ratings: ") + _ratingsArray);
}
static var TYPE_SYSTEM = 0;
static var TYPE_PRIVATE = 1;
static var TYPE_PUBLIC = 2;
static var TYPE_MODERATED = 3;
}
Symbol 128 MovieClip [__Packages.com.newgrounds.SaveKey] Frame 0
class com.newgrounds.SaveKey
{
var _name, _id, _type;
function SaveKey (name, id, type) {
_name = name;
_id = id;
_type = type;
}
function get name() {
return(_name);
}
function get id() {
return(_id);
}
function get type() {
return(_type);
}
function validateValue(value) {
switch (_type) {
case TYPE_INTEGER :
value = Number(value);
if (!isNaN(value)) {
var _local3 = int(value);
if (_local3 != value) {
com.newgrounds.Logger.logWarning(((((("Float value " + value) + " given for integer key \"") + _name) + "\". Clamping to ") + _local3) + ".");
}
return(_local3);
}
break;
case TYPE_FLOAT :
value = Number(value);
if (!isNaN(value)) {
return(isNaN(Number(value)));
}
break;
case TYPE_BOOLEAN :
return(Boolean(value) && (int(value) != 0));
case TYPE_STRING :
return((value ? (value.toString()) : ""));
}
return(null);
}
function toString() {
return(_name);
}
static var TYPE_FLOAT = 1;
static var TYPE_INTEGER = 2;
static var TYPE_STRING = 3;
static var TYPE_BOOLEAN = 4;
}
Symbol 129 MovieClip [__Packages.com.newgrounds.SaveRating] Frame 0
class com.newgrounds.SaveRating
{
var _name, _id, _isFloat, _minimum, _maximum;
function SaveRating (name, id, isFloat, minimum, maximum) {
_name = name;
_id = id;
_isFloat = isFloat;
_minimum = minimum;
_maximum = maximum;
}
function get name() {
return(_name);
}
function get id() {
return(_id);
}
function get isFloat() {
return(_isFloat);
}
function get minimum() {
return(_minimum);
}
function get maximum() {
return(_maximum);
}
function validateValue(value) {
var _local2 = Number(value);
if (isNaN(_local2)) {
com.newgrounds.Logger.logError(("Invalid value for rating \"" + _name) + "\".");
return(NaN);
}
if (_local2 < _minimum) {
com.newgrounds.Logger.logWarning(((((_local2 + " is out of acceptable range for rating \"") + _name) + "\". Clamping to ") + _minimum) + ".");
return(_minimum);
}
if (_local2 > _maximum) {
com.newgrounds.Logger.logWarning(((((_local2 + " is out of acceptable range for rating \"") + _name) + "\". Clamping to ") + _maximum) + ".");
return(_maximum);
}
if (!isFloat) {
var _local3 = int(_local2);
if (_local3 != _local2) {
com.newgrounds.Logger.logWarning(((((("Float value " + _local2) + " given for integer rating \"") + _name) + "\". Clamping to ") + _local3) + ".");
}
return(_local3);
}
return(_local2);
}
function toString() {
return(_name);
}
}
Symbol 124 MovieClip [__Packages.com.newgrounds.BitmapLoader] Frame 0
class com.newgrounds.BitmapLoader extends com.newgrounds.APIEventDispatcher
{
var _bitmapData, _url, _loader, _loaderClip, dispatchEvent;
function BitmapLoader (defaultBitmap, url) {
super();
_bitmapData = defaultBitmap;
_url = url;
}
function get url() {
return(_url);
}
function set url(v) {
_loaded = false;
_url = v;
//return(url);
}
function get bitmapData() {
return(_bitmapData);
}
function set bitmapData(v) {
_bitmapData = v;
_loaded = true;
//return(bitmapData);
}
function get loaded() {
return(_loaded);
}
function disposeLoader() {
if (_loader) {
if (_loaderClip._parent == _root) {
_loader.unloadClip(_loaderClip.bitmap);
_loaderClip.removeMovieClip();
}
_loader = null;
_loaderClip = null;
}
}
function load() {
if ((!_url) || (_url == "")) {
onLoadComplete();
return(undefined);
}
_loaded = false;
if (_bitmapData) {
_bitmapData.dispose();
_bitmapData = null;
}
disposeLoader();
attachBitmap(null);
}
function attachBitmap(parent) {
if (!parent) {
parent = _root;
}
var _local5 = parent.getNextHighestDepth();
var _local3 = parent.createEmptyMovieClip("__bitmap" + _local5, _local5);
if (((!_loaded) && (_url)) && (_url != "")) {
_local3.createEmptyMovieClip("bitmap", 0);
_loader = new MovieClipLoader();
_loaderClip = _local3;
if (parent == _root) {
_loaderClip._visible = false;
}
var thisObj = this;
_loaderClip.onEnterFrame = function () {
thisObj.pollLoad();
};
_loader.addListener({onLoadError:function () {
thisObj.onLoadComplete();
}});
_loader.loadClip(_url, _local3.bitmap);
} else {
_local3.attachBitmap(_bitmapData, 0);
}
return(_local3);
}
function pollLoad() {
if (_loaderClip._width) {
onLoadComplete();
}
}
function onLoadComplete() {
var _local2;
if ((_loader && (_loaderClip)) && (_loaderClip._width)) {
try {
_loaderClip.onEnterFrame = null;
_local2 = new flash.display.BitmapData(_loaderClip._width, _loaderClip._height, true, 0);
_local2.draw(_loaderClip);
_bitmapData = _local2;
_loaded = true;
} catch(error) {
if (_local2) {
_local2.dispose();
}
}
}
disposeLoader();
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.ICON_LOADED, this, (_loaded ? null : (com.newgrounds.APIEvent.ERROR_BAD_FILE))));
}
static var _cacheSeed = 0;
var _loaded = true;
}
Symbol 133 MovieClip [__Packages.com.newgrounds.SaveQuery] Frame 0
class com.newgrounds.SaveQuery extends com.newgrounds.APIEventDispatcher
{
var _group, _connection, _files, _lookupKeys, _lookupRatings, _fileConditions, _keyConditions, _ratingConditions, _sortFields, dispatchEvent;
function SaveQuery (group) {
super();
_group = group;
_connection = group.connection;
reset();
}
function get group() {
return(_group);
}
function get resultsPerPage() {
return(_resultsPerPage);
}
function set resultsPerPage(val) {
_resultsPerPage = Math.min(Math.max(val, 1), 100);
//return(resultsPerPage);
}
function get page() {
return(_page);
}
function set page(val) {
_page = Math.max(val, 1);
//return(page);
}
function prevPage() {
page = ((page-1));
}
function nextPage() {
page = ((page+1));
}
function get isRandomized() {
return(_isRandomized);
}
function set isRandomized(val) {
_isRandomized = val;
//return(isRandomized);
}
function get files() {
return(_files);
}
function reset() {
_page = 1;
_resultsPerPage = 10;
_isRandomized = false;
_lookupKeys = [];
_lookupRatings = [];
_fileConditions = [];
_keyConditions = [];
_ratingConditions = [];
_sortFields = [];
_files = [];
includeAllFields();
}
function clone() {
var _local2 = new com.newgrounds.SaveQuery(_group);
_local2._page = _page;
_local2._resultsPerPage = _resultsPerPage;
_local2._isRandomized = _isRandomized;
_local2._lookupKeys = _lookupKeys.concat();
_local2._lookupRatings = _lookupRatings.concat();
_local2._fileConditions = _fileConditions.concat();
_local2._keyConditions = _keyConditions.concat();
_local2._ratingConditions = _ratingConditions.concat();
return(_local2);
}
function includeAllFields() {
for (var _local5 in _group.__get__keys()) {
var _local2 = _group.__get__keys()[_local5];
_lookupKeys.push(_local2.__get__id());
}
for (var _local4 in _group.__get__ratings()) {
var _local3 = _group.__get__ratings()[_local4];
_lookupRatings.push(_local3.__get__id());
}
}
function addCondition(field, operator, value) {
var _local2;
_local2 = 0;
while (_local2 < FILE_FIELDS.length) {
if (FILE_FIELDS[_local2] == field) {
break;
}
_local2++;
}
if (_local2 == FILE_FIELDS.length) {
_local2 = -1;
}
if (_local2 >= 0) {
_fileConditions.push({field:_local2, operator:operator, value:value});
} else {
var _local4 = _group.getKey(field);
if (_local4) {
value = _local4.validateValue(value);
_keyConditions.push({key_id:_local4.__get__id(), operator:operator, value:value});
return(undefined);
}
var _local3 = field.split(".");
var _local6 = _group.getRating(_local3[0]);
if (_local6) {
if (_local3[1] != "votes") {
value = _local6.validateValue(value);
}
_ratingConditions.push({rating_id:_local6.__get__id(), operator:operator, value:value, column:(_local3[1] ? (_local3[1]) : "score")});
return(undefined);
}
com.newgrounds.Logger.logError(((("The save group \"" + _group.__get__name()) + "\" does not have a field named \"") + field) + "\".");
}
}
function sortOn(field, sortDescending) {
if (sortDescending == undefined) {
sortDescending = false;
}
var _local2;
_local2 = 0;
while (_local2 < FILE_FIELDS.length) {
if (FILE_FIELDS[_local2] == field) {
break;
}
_local2++;
}
if (_local2 == FILE_FIELDS.length) {
_local2 = -1;
}
if (_local2 >= 0) {
_sortFields.push({table:TABLE_FILES, field:_local2, desc:sortDescending});
} else {
var _local5 = _group.getKey(field);
if (_local5) {
_sortFields.push({table:TABLE_KEYS, field:_local5.__get__id(), desc:sortDescending});
return(undefined);
}
var _local3 = field.split(".");
var _local6 = _group.getRating(_local3[0]);
if (_local6) {
_sortFields.push({table:TABLE_RATINGS, field:_local6.__get__id(), desc:sortDescending, extra:(_local3[1] ? (_local3[1]) : "score")});
return(undefined);
}
com.newgrounds.Logger.logError(((("The save group \"" + _group.__get__name()) + "\" does not have a field named \"") + field) + "\".");
}
}
function execute() {
var _local5 = {};
_local5.page = _page;
_local5.num_results = _resultsPerPage;
if (_isRandomized) {
_local5.randomize = 1;
}
if (_lookupKeys && (_lookupKeys.length)) {
_local5.lookup_keys = _lookupKeys;
}
if (_lookupRatings && (_lookupRatings.length)) {
_local5.lookup_ratings = _lookupRatings;
}
if (_fileConditions && (_fileConditions.length)) {
_local5.file_conditions = _fileConditions;
}
if (_keyConditions && (_keyConditions.length)) {
_local5.key_conditions = _keyConditions;
}
if (_ratingConditions && (_ratingConditions.length)) {
_local5.rating_conditions = _ratingConditions;
}
if (_sortFields && (_sortFields.length)) {
_local5.sort_conditions = _sortFields;
}
_connection.sendSimpleCommand("lookupSaveFiles", {target:this, func:onQueryComplete}, {publisher_id:_connection.publisherId, group_id:_group.__get__id(), query:_local5});
}
function onQueryComplete(event) {
if (event.__get__success()) {
var _local4 = event.__get__data();
_files = [];
if (_local4.files) {
var _local2 = 0;
while (_local2 < _local4.files.length) {
var _local3 = com.newgrounds.SaveFile.fromObject(_group, _local4.files[_local2]);
if (_local3) {
_files.push(_local3);
}
_local2++;
}
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this));
} else {
com.newgrounds.Logger.logError("Query failed: " + event.__get__error());
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this, event.__get__error()));
}
}
static var FILE_ID = "fileId";
static var AUTHOR_ID = "authorId";
static var AUTHOR_NAME = "authorName";
static var FILE_NAME = "fileName";
static var CREATED_ON = "createdOn";
static var UPDATED_ON = "updatedOn";
static var FILE_VIEWS = "fileViews";
static var FILE_STATUS = "fileStatus";
static var FILE_FIELDS = [FILE_ID, AUTHOR_ID, AUTHOR_NAME, FILE_NAME, CREATED_ON, UPDATED_ON, FILE_VIEWS, FILE_STATUS];
static var OPERATOR_EQUAL = "=";
static var OPERATOR_LESS_THAN = "<";
static var OPERATOR_GREATER_THAN = ">";
static var OPERATOR_NOT_EQUAL = "!=";
static var OPERATOR_LESS_OR_EQUAL = "<=";
static var OPERATOR_GREATER_OR_EQUAL = ">=";
static var OPERATOR_CONTAINS = "*";
static var OPERATOR_NOT_CONTAINS = "!*";
static var OPERATOR_NOT_BEGINS_WITH = "!*=";
static var OPERATOR_NOT_ENDS_WITH = "!=*";
static var OPERATOR_BEGINS_WITH = "*=";
static var OPERATOR_ENDS_WITH = "=*";
static var TABLE_FILES = 1;
static var TABLE_KEYS = 2;
static var TABLE_RATINGS = 3;
var _page = 1;
var _resultsPerPage = 10;
var _isRandomized = false;
}
Symbol 125 MovieClip [__Packages.com.newgrounds.Medal] Frame 0
class com.newgrounds.Medal extends com.newgrounds.APIEventDispatcher
{
var _connection, _id, _name, _description, _secret, _unlocked, _value, _difficulty, _iconLoader, dispatchEvent;
function Medal (connection, id, name, description, secret, unlocked, value, difficultyId, iconURL) {
super();
_connection = connection;
_id = id;
_name = name;
_description = description;
_secret = secret;
_unlocked = unlocked;
_value = value;
_difficulty = DIFFICULTIES[difficultyId];
_iconLoader = new com.newgrounds.BitmapLoader(DEFAULT_ICON, iconURL);
_iconLoader.load();
}
function get difficulty() {
return(_difficulty);
}
function get icon() {
return(_iconLoader.__get__bitmapData());
}
function get id() {
return(_id);
}
function get name() {
return(_name);
}
function get description() {
return(_description);
}
function get secret() {
return(_secret);
}
function get unlocked() {
return(_unlocked);
}
function get value() {
return(_value);
}
function toString() {
return((((((("Medal: " + _name) + "\t\t(") + (_unlocked ? "unlocked, " : "locked, ")) + _value) + "pts, ") + _difficulty) + ")");
}
function attachIcon(parent) {
return(_iconLoader.attachBitmap(parent));
}
function unlock() {
if (_unlocked) {
com.newgrounds.Logger.logWarning(("Medal \"" + _name) + "\" is already unlocked.");
return(undefined);
}
com.newgrounds.Logger.logMessage(("Unlocking medal \"" + name) + "\"...");
_unlocked = true;
if (_connection.__get__hasUserSession()) {
_connection.sendSimpleCommand("unlockMedal", {target:this, func:onUnlockConfirmed}, null, {medal_id:id});
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCKED, this));
}
function setUnlocked(unlocked) {
_unlocked = unlocked;
}
function onUnlockConfirmed(event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage(("Medal \"" + name) + "\" unlocked.");
} else {
com.newgrounds.Logger.logError(("Failed to unlock \"" + name) + "\"!");
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, this, event.__get__error()));
}
static var ICON_WIDTH = 50;
static var ICON_HEIGHT = 50;
static var DEFAULT_ICON = flash.display.BitmapData.loadBitmap("DefaultMedalIcon");
static var DIFFICULTY_EASY = "Easy";
static var DIFFICULTY_MODERATE = "Moderate";
static var DIFFICULTY_CHALLENGING = "Challenging";
static var DIFFICULTY_DIFFICULT = "Difficult";
static var DIFFICULTY_BRUTAL = "Brutal";
static var DIFFICULTIES = ["Unknown", DIFFICULTY_EASY, DIFFICULTY_MODERATE, DIFFICULTY_CHALLENGING, DIFFICULTY_DIFFICULT, DIFFICULTY_BRUTAL];
}
Symbol 127 MovieClip [__Packages.com.newgrounds.ScoreBoard] Frame 0
class com.newgrounds.ScoreBoard extends com.newgrounds.APIEventDispatcher
{
var _connection, _name, _id, _scores, _tag, dispatchEvent;
function ScoreBoard (connection, name, id) {
super();
_connection = connection;
_name = name;
_id = id;
}
function get name() {
return(_name);
}
function get scores() {
return(_scores);
}
function get period() {
return(_period);
}
function set period(val) {
_period = val;
//return(period);
}
function get firstResult() {
return(_firstResult);
}
function set firstResult(val) {
_firstResult = Math.max(1, val);
//return(firstResult);
}
function get numResults() {
return(_numResults);
}
function set numResults(val) {
_numResults = val;
//return(numResults);
}
function get tag() {
return(_tag);
}
function set tag(val) {
_tag = val;
//return(tag);
}
function get page() {
return(Math.ceil((_firstResult - 1) / _numResults) + 1);
}
function prevPage() {
if (firstResult > _numResults) {
firstResult = firstResult - _numResults;
}
}
function nextPage() {
firstResult = firstResult + _numResults;
}
function loadScores() {
_connection.sendSimpleCommand("loadScores", {target:this, func:onScoresLoaded}, {publisher_id:_connection.publisherId, board:_id, page:((_firstResult - 1) / _numResults) + 1, num_results:_numResults, period:_period, tag:_tag});
}
function postScore(numericScore, tag) {
if (tag == undefined) {
tag = null;
}
if (isNaN(numericScore)) {
com.newgrounds.Logger.logError("Cannot post invalid score: " + numericScore);
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT));
return(undefined);
}
com.newgrounds.Logger.logMessage(((((("Posting a score of " + numericScore) + " by ") + _connection.username) + " to scoreboard \"") + _name) + "\"...");
_connection.sendSimpleCommand("postScore", {target:this, func:onScorePosted}, null, {user_name:_connection.username, board:_id, value:numericScore, tag:tag});
}
function onScoresLoaded(event) {
var _local4 = event.__get__data();
_scores = [];
var _local5;
if (_local4.first_result) {
_local5 = _local4.first_result;
} else {
_local5 = _firstResult;
}
if (_local4.scores) {
var _local3 = 0;
while (_local3 < _local4.scores.length) {
var _local2 = _local4.scores[_local3];
if (_local2) {
_scores[_local3] = new com.newgrounds.Score(_local5, _local2.username, _local2.value, _local2.numeric_value, _local2.tag);
}
_local3++;
_local5++;
}
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORES_LOADED, this));
}
function onScorePosted(event) {
if (event.__get__success()) {
com.newgrounds.Logger.logMessage("Score posted!");
var _local4 = event.__get__data();
var _local2 = {};
_local2.score = _local4.value;
_local2.scoreBoard = this;
} else {
com.newgrounds.Logger.logError("Error posting score: " + event.__get__error());
}
dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, _local2, event.__get__error()));
}
function toString() {
return("Scoreboard: " + _name);
}
static var TODAY = "Today";
static var THIS_WEEK = "This Week";
static var THIS_MONTH = "This Month";
static var THIS_YEAR = "This Year";
static var ALL_TIME = "All-Time";
var _period = ALL_TIME;
var _firstResult = 1;
var _numResults = 10;
}
Symbol 116 MovieClip [__Packages.com.newgrounds.Logger] Frame 0
class com.newgrounds.Logger
{
function Logger () {
}
static function logInternal() {
var _local2 = arguments;
log(PRIORITY_INTERNAL, _local2);
}
static function logMessage() {
var _local2 = arguments;
log(PRIORITY_MESSAGE, _local2);
}
static function logWarning() {
var _local2 = arguments;
log(PRIORITY_WARNING, _local2);
}
static function logError() {
var _local2 = arguments;
log(PRIORITY_ERROR, _local2);
}
static function log(priority, messages) {
if (priority == undefined) {
priority = PRIORITY_MESSAGE;
}
if (messages == undefined) {
messages = null;
}
if (priority >= _messageLevel) {
var _local1 = 0;
while (_local1 < messages.length) {
trace(HEADER + messages[_local1]);
_eventDispatcher.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.LOG, messages[_local1]));
_local1++;
}
}
if (priority >= _throwLevel) {
throw new Error(messages.join(newline));
}
}
static function addEventListener(event, listener) {
_eventDispatcher.addEventListener(event, listener, false, 0, false);
}
static var PRIORITY_INTERNAL = 0;
static var PRIORITY_MESSAGE = 1;
static var PRIORITY_WARNING = 2;
static var PRIORITY_ERROR = 3;
static var PRIORITY_MAX = 4;
static var HEADER = "[Newgrounds API] :: ";
static var _eventDispatcher = new com.newgrounds.EventDispatcher();
static var _messageLevel = PRIORITY_MESSAGE;
static var _throwLevel = PRIORITY_MAX;
}
Symbol 3133 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local27);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local24 = 11000;
var _local19 = options.ad_timeout;
if (options.skip) {
_local19 = 0;
}
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local15 = _getRes(options);
var _local5 = _local15[0];
var _local14 = _local15[1];
mc._x = _local5 * 0.5;
mc._y = _local14 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local5 * -0.5;
chk._y = _local14 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local7._visible = false;
delete options.no_progress_bar;
} else {
_local7._x = 10;
_local7._y = _local14 - 20;
}
var _local23 = options.color;
delete options.color;
var _local21 = options.background;
delete options.background;
var _local25 = options.outline;
delete options.outline;
var _local6 = _local7.createEmptyMovieClip("_outline", 1);
_local6.beginFill(_local21);
_local6.moveTo(0, 0);
_local6.lineTo(_local5 - 20, 0);
_local6.lineTo(_local5 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
_local6.endFill();
var _local4 = _local7.createEmptyMovieClip("_inside", 2);
_local4.beginFill(_local23);
_local4.moveTo(0, 0);
_local4.lineTo(_local5 - 20, 0);
_local4.lineTo(_local5 - 20, 10);
_local4.lineTo(0, 10);
_local4.lineTo(0, 0);
_local4.endFill();
_local4._xscale = 0;
var _local8 = _local7.createEmptyMovieClip("_outline", 3);
_local8.lineStyle(0, _local25, 100);
_local8.moveTo(0, 0);
_local8.lineTo(_local5 - 20, 0);
_local8.lineTo(_local5 - 20, 10);
_local8.lineTo(0, 10);
_local8.lineTo(0, 0);
chk.ad_msec = _local24;
chk.ad_timeout = _local19;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local10 = this._parent._parent;
var _local3 = _local10;
while ((!_local3.getBytesTotal()) && (_local3)) {
_local3 = _local3._parent;
}
if (!_local3) {
_local3 = _root;
}
var _local13 = this._parent._mochiad_ctr;
var _local7 = getTimer() - this.started;
var _local5 = false;
var _local6 = _local3.getBytesTotal();
var _local9 = _local3.getBytesLoaded();
var _local4 = (100 * _local9) / _local6;
var _local12 = (100 * _local7) / chk.ad_msec;
var _local11 = this._mochiad_bar._inside;
var _local15 = Math.min(100, Math.min(_local4 || 0, _local12));
_local15 = Math.max(this.last_pcnt, _local15);
this.last_pcnt = _local15;
_local11._xscale = _local15;
options.ad_progress(_local15);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {id:"hostLoadPcnt", pcnt:_local4}, clip._mochiad._containerLCName);
if (_local4 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local8 = _local13.getBytesTotal();
if ((_local8 > 0) || (typeof(_local8) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local7 > chk.ad_timeout) && (_local4 == 100)) {
options.ad_failed();
_local5 = true;
}
}
if (_local7 > chk.ad_msec) {
_local5 = true;
}
if (((_local6 > 0) && (_local9 >= _local6)) && (_local5)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local10 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local10);
var clip = options.clip;
var _local9 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local3 = clip._mochiad;
_local3.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local11 = _local5[0];
var _local8 = _local5[1];
_local3._x = _local11 * 0.5;
_local3._y = _local8 * 0.5;
var chk = _local3.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local9;
chk.started = getTimer();
chk.showing = false;
_local3.lc.adLoaded = options.ad_loaded;
_local3.lc.adSkipped = options.ad_skipped;
_local3.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
_local3.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local21 = false;
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local12 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local12);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local6 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local6._mochiad_loaded) {
return(null);
}
var _local11 = options.depth;
delete options.depth;
var mc = _local6.createEmptyMovieClip("_mochiad", _local11);
var _local10 = _getRes(options);
options.res = (_local10[0] + "x") + _local10[1];
options.server = options.server + options.id;
delete options.id;
_local6._mochiad_loaded = true;
if (_local6._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = mc.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local9 = _local4.server;
delete _local4.server;
var _local13 = _allowDomains(_local9);
mc.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new Object();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = mc;
_local5.name = _local8;
_local5.hostname = _local13;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
mc.lc = _local5;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
_local4.lc = _local8;
_local4.st = getTimer();
if (!options.skip) {
_local4.loadMovie(_local9 + ".swf", "POST");
}
return(mc);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
containerNotify(clip, {id:"unload"}, clip._mochiad._containerLCName);
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
containerRpcResult(clip, callbackID, _local4, clip._mochiad._containerLCName);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
containerRpcResult(clip, callbackID, _local3, clip._mochiad._containerLCName);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
static function containerNotify(clip, args, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.notify) {
_local1.notify(args);
} else {
new LocalConnection().send(lcName, "notify", args);
}
}
static function containerRpcResult(clip, callbackID, val, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.rpcResult) {
_local1.rpcResult(callbackID, val);
} else {
new LocalConnection().send(lcName, "rpcResult", callbackID, val);
}
}
}
Symbol 3134 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 3135 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.9.5 as2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
onError("NotConnected");
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError("IOError");
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError(errorCode);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "services" :
mochi.as2.MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "social" :
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError("IOError");
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError("NotConnected");
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError("NotConnected");
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://link.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static var CONNECTED = "onConnected";
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 3136 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function getAchievements(properties) {
mochi.as2.MochiServices.send("events_getAchievements", properties);
}
static function unlockAchievement(properties) {
mochi.as2.MochiServices.send("events_unlockAchievement", properties);
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function showAwards(options) {
mochi.as2.MochiServices.send("events_showAwards", options, null, null);
}
static function setNotifications(style) {
mochi.as2.MochiServices.send("events_setNotifications", style, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
static var ACHIEVEMENTS_OWNED = "AchievementOwned";
static var ACHIEVEMENT_NEW = "AchievementReceived";
static var GAME_ACHIEVEMENTS = "GameAchievements";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var IO_PENDING = "IOPending";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var FORMAT_NONE = "NoForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 3137 MovieClip [__Packages.mochi.as2.MochiCoins] Frame 0
class mochi.as2.MochiCoins
{
function MochiCoins () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showStore(options) {
mochi.as2.MochiServices.send("coins_showStore", {options:options}, null, null);
}
static function showItem(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showItem call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showItem", {options:options}, null, null);
}
static function showVideo(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showVideo call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showVideo", {options:options}, null, null);
}
static function getStoreItems() {
mochi.as2.MochiServices.send("coins_getStoreItems");
}
static function requestFunding(properties) {
mochi.as2.MochiServices.send("social_requestFunding", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var STORE_SHOW = "StoreShow";
static var STORE_HIDE = "StoreHide";
static var ITEM_OWNED = "ItemOwned";
static var ITEM_NEW = "ItemNew";
static var STORE_ITEMS = "StoreItems";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 3138 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("social_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("social_hideLoginWidget");
}
static function requestLogin(properties) {
mochi.as2.MochiServices.send("social_requestLogin", properties);
}
static function getFriendsList(properties) {
mochi.as2.MochiServices.send("social_getFriendsList", properties);
}
static function showProfile(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("social_showProfile", options);
}
static function postToStream(properties) {
mochi.as2.MochiServices.send("social_postToStream", properties);
}
static function inviteFriends(properties) {
mochi.as2.MochiServices.send("social_inviteFriends", properties);
}
static function requestFan(properties) {
mochi.as2.MochiServices.send("social_requestFan", properties);
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("social_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var FRIEND_LIST = "FriendsList";
static var PROFILE_DATA = "ProfileData";
static var GAMEPLAY_DATA = "GameplayData";
static var ACTION_CANCELED = "onCancel";
static var ACTION_COMPLETE = "onComplete";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 135 MovieClip [__Packages.com.newgrounds.components.FlashAdBase] Frame 0
class com.newgrounds.components.FlashAdBase extends MovieClip
{
var gotoAndStop, _x, _y, stop, onUnload, _adListener, adContainer, newgroundsButton, _fullScreen, clear, _ad, _adFeedLoader, _width, _height, beginFill, moveTo, lineTo, endFill;
function FlashAdBase () {
super();
try {
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
} catch(error) {
}
gotoAndStop("idle");
_x = int(_x);
_y = int(_y);
stop();
if (_newgroundsButton) {
_newgroundsButton.onRelease = onNGClick;
}
onUnload = removeAd;
var _local4 = this;
_adListener = {onLoadError:function (target, error, httpStatus) {
target._parent.onAdError(target, error, httpStatus);
}};
if (fullScreen) {
drawFullScreenRect();
}
if (com.newgrounds.API.__get__adFeedURL()) {
loadAdFeed();
} else {
com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, {target:this, func:loadAdFeed});
}
}
function get _adContainer() {
return(adContainer);
}
function get _newgroundsButton() {
return(newgroundsButton);
}
function get fullScreen() {
return(_fullScreen);
}
function set fullScreen(v) {
_fullScreen = v;
if (v) {
drawFullScreenRect();
} else {
clear();
}
//return(fullScreen);
}
function get showBorder() {
return(_showBorder);
}
function set showBorder(value) {
_showBorder = value;
if (_showBorder) {
if (_ad) {
var _local2 = _ad.getProgress(_adContainer);
if (_local2.bytesLoaded >= _local2.bytesTotal) {
gotoAndStop("loaded");
} else {
gotoAndStop("loading");
}
} else {
gotoAndStop("idle");
}
} else {
gotoAndStop("noBorder");
}
//return(showBorder);
}
function loadAdFeed(event) {
if (event == undefined) {
event = null;
}
_adFeedLoader = new LoadVars();
var target = this;
_adFeedLoader.onData = function (data) {
target.onAdFeedLoaded(data);
};
_adFeedLoader.load(com.newgrounds.API.__get__adFeedURL(), _adFeedLoader);
}
function onAdFeedLoaded(data) {
if (data && (data != "")) {
loadAd(data);
} else {
onAdError();
}
}
function loadAd(adURL) {
if (adType != VIDEO_ADS) {
if (adURL.indexOf("?") >= 0) {
adURL = adURL + "&";
} else {
adURL = adURL + "?";
}
adURL = adURL + "blockoverlays=1";
}
_ad = new MovieClipLoader();
_ad.addListener(_adListener);
_adContainer._lockroot = true;
_ad.loadClip(adURL, _adContainer);
}
function removeAd() {
_adFeedLoader.onData = null;
_adFeedLoader = null;
_ad.removeListener(_adListener);
if (_adContainer) {
_ad.unloadClip(_adContainer);
}
_ad = null;
}
function onAdError(target, error, httpStatus) {
com.newgrounds.Logger.logError("Unable to load ad.");
removeAd();
}
function onNGClick() {
com.newgrounds.API.loadNewgrounds();
}
function drawFullScreenRect() {
_x = (Stage.width - _width) / 2;
_y = (Stage.height - _height) / 2;
beginFill(0);
moveTo(-Stage.width, -Stage.height);
lineTo(Stage.width, -Stage.height);
lineTo(Stage.width, Stage.height);
lineTo(-Stage.width, Stage.height);
lineTo(-Stage.width, -Stage.height);
endFill();
}
var _showBorder = true;
var adType = com.newgrounds.components.FlashAdBase.prototype.VIDEO_ADS;
var VIDEO_ADS = "Video";
var SIMPLE_ADS = "Simple";
}
Symbol 3139 MovieClip [__Packages.com.darronschall.DynamicRegistration] Frame 0
class com.darronschall.DynamicRegistration
{
var xreg, yreg, localToGlobal, _parent, _x, _y, _xscale, _yscale, _rotation, _xmouse, _ymouse;
function DynamicRegistration () {
}
static function initialize(target_mc) {
var p = _global.com.darronschall.DynamicRegistration.prototype;
target_mc.xreg = 0;
target_mc.yreg = 0;
target_mc.setRegistration = p.setRegistration;
target_mc.setPropRel = p.setPropRel;
with (target_mc) {
addProperty("_x2", p.get_x2, p.set_x2);
addProperty("_y2", p.get_y2, p.set_y2);
addProperty("_xscale2", p.get_xscale2, p.set_xscale2);
addProperty("_yscale2", p.get_yscale2, p.set_yscale2);
addProperty("_rotation2", p.get_rotation2, p.set_rotation2);
addProperty("_xmouse2", p.get_xmouse2, null);
addProperty("_ymouse2", p.get_ymouse2, null);
}
}
function setRegistration(x, y) {
xreg = x;
yreg = y;
}
function get_x2() {
var _local2 = {x:xreg, y:yreg};
localToGlobal(_local2);
_parent.globalToLocal(_local2);
return(_local2.x);
}
function set_x2(value) {
var _local2 = {x:xreg, y:yreg};
localToGlobal(_local2);
_parent.globalToLocal(_local2);
_x = _x + (value - _local2.x);
}
function get_y2() {
var _local2 = {x:xreg, y:yreg};
localToGlobal(_local2);
_parent.globalToLocal(_local2);
return(_local2.y);
}
function set_y2(value) {
var _local2 = {x:xreg, y:yreg};
localToGlobal(_local2);
_parent.globalToLocal(_local2);
_y = _y + (value - _local2.y);
}
function set_xscale2(value) {
setPropRel("_xscale", value);
}
function get_xscale2() {
return(_xscale);
}
function set_yscale2(value) {
setPropRel("_yscale", value);
}
function get_yscale2() {
return(_yscale);
}
function set_rotation2(value) {
setPropRel("_rotation", value);
}
function get_rotation2() {
return(_rotation);
}
function get_xmouse2() {
return(_xmouse - xreg);
}
function get_ymouse2() {
return(_ymouse - yreg);
}
function setPropRel(property, amount) {
var _local3 = {x:xreg, y:yreg};
localToGlobal(_local3);
_parent.globalToLocal(_local3);
this[property] = amount;
var _local2 = {x:xreg, y:yreg};
localToGlobal(_local2);
_parent.globalToLocal(_local2);
_x = _x - (_local2.x - _local3.x);
_y = _y - (_local2.y - _local3.y);
}
}
Symbol 110 MovieClip [__Packages.com.newgrounds.shims.APIShim] Frame 0
class com.newgrounds.shims.APIShim extends MovieClip
{
function APIShim () {
super();
}
}
Symbol 120 MovieClip [__Packages.com.newgrounds.crypto.MD5] Frame 0
class com.newgrounds.crypto.MD5
{
function MD5 () {
}
static function hash(src) {
return(hex_md5(src));
}
static function hex_md5(src) {
return(binl2hex(core_md5(str2binl(src), src.length * 8)));
}
static function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local4 = 1732584193 /* 0x67452301 */;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var _local5 = 0;
while (_local5 < x.length) {
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
var _local7 = _local1;
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 0], 7, -680876936);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 3], 22, -1044525330);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 4], 7, -176418897);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 7], 22, -45705983);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 8], 7, 1770035416);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 11], 22, -1990404162);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 12], 7, 1804603682);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 15], 22, 1236535329);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 1], 5, -165796510);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 0], 20, -373897302);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 5], 5, -701558691);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 4], 20, -405537848);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 9], 5, 568446438);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 8], 20, 1163531501);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 13], 5, -1444681467);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 12], 20, -1926607734);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 5], 4, -378558);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 14], 23, -35309556);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 1], 4, -1530992060);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 10], 23, -1094730640);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 13], 4, 681279174);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 6], 23, 76029189);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 9], 4, -640364487);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 2], 23, -995338651);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 0], 6, -198630844);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 5], 21, -57434055);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 12], 6, 1700485571);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 1], 21, -2054922799);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 8], 6, 1873313359);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 13], 21, 1309151649);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 4], 6, -145523070);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 9], 21, -343485551);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local1 = safe_add(_local1, _local7);
_local5 = _local5 + 16;
}
return(new Array(_local4, _local3, _local2, _local1));
}
static function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
static function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
static function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
static function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
static function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
static function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
static function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
static function str2binl(str) {
var _local3 = new Array();
var _local4 = 255;
var _local1 = 0;
while (_local1 < (str.length * 8)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((str.charCodeAt(_local1 / 8) & _local4) << (_local1 % 32));
_local1 = _local1 + 8;
}
return(_local3);
}
static function binl2hex(binarray) {
var _local4 = new String("");
var _local3 = new String("0123456789abcdef");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
}
Symbol 121 MovieClip [__Packages.com.newgrounds.crypto.RC4] Frame 0
class com.newgrounds.crypto.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function encryptbin(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(_local2);
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 122 MovieClip [__Packages.com.newgrounds.encoders.json.JSON] Frame 0
class com.newgrounds.encoders.json.JSON
{
static var start, cache, interval;
function JSON () {
}
static function encode(arg, noquotes) {
var _local3;
var _local2;
var _local6;
var _local1 = "";
var _local4;
if (arg.isSServerVar()) {
var _local8 = "sservervariable";
} else {
var _local8 = typeof(arg);
}
switch (_local8) {
case "sservervariable" :
return("?" + arg.getEncodedValue());
case "object" :
if (arg) {
if (arg instanceof Array) {
_local2 = 0;
while (_local2 < arg.length) {
_local4 = encode(arg[_local2]);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + _local4;
_local2++;
}
return(("[" + _local1) + "]");
}
if (typeof(arg.toString) != "undefined") {
for (_local2 in arg) {
_local4 = arg[_local2];
if ((typeof(_local4) != "undefined") && (typeof(_local4) != "function")) {
_local4 = encode(_local4);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + ((encode(_local2) + ":") + _local4);
}
}
return(("{" + _local1) + "}");
}
}
return("null");
case "number" :
return((isFinite(arg) ? (String(arg)) : "null"));
case "string" :
_local6 = arg.length;
if (noquotes) {
var _local7 = "";
} else {
var _local7 = "\"";
}
_local1 = _local7;
_local2 = 0;
while (_local2 < _local6) {
_local3 = arg.charAt(_local2);
if (_local3 >= " ") {
if ((_local3 == "\\") || (_local3 == "\"")) {
_local1 = _local1 + "\\";
}
_local1 = _local1 + _local3;
} else {
switch (_local3) {
case "\b" :
_local1 = _local1 + "\\b";
break;
case "\f" :
_local1 = _local1 + "\\f";
break;
case newline :
_local1 = _local1 + "\\n";
break;
case "\r" :
_local1 = _local1 + "\\r";
break;
case "\t" :
_local1 = _local1 + "\\t";
break;
default :
_local3 = _local3.charCodeAt();
_local1 = _local1 + (("\\u00" + Math.floor(_local3 / 16).toString(16)) + (_local3 % 16).toString(16));
}
}
_local2 = _local2 + 1;
}
return(_local1 + _local7);
case "boolean" :
return(String(arg));
}
return("null");
}
static function background_encode(arg, callback) {
if (busy) {
trace("[Newgrounds Encoder] :: Cannot encode a new file until the previous file is completed");
return(false);
}
if (!callback) {
trace("[Newgrounds Encoder] :: Missing a callback function, skipping encode");
return(false);
}
busy = true;
var _local2 = new Date();
start = _local2.getTime();
cache = {busy:false, complete:false, arg:arg, target:arg, parents:[], encoded:"", callback:callback, encode_chunk:function () {
com.newgrounds.encoders.json.JSON.encode_chunk();
}};
if (getType(arg) == "object") {
cache.encoded = "{";
} else if (getType(arg) == "array") {
cache.encoded = "[";
}
interval = setInterval(cache, "encode_chunk", 25);
return(true);
}
static function background_decode(arg, callback) {
if (busy) {
trace("[Newgrounds Encoder] :: Cannot decode a new file until the previous file is completed");
return(false);
}
if (!callback) {
trace("[Newgrounds Encoder] :: Missing a callback function, skipping decode");
return(false);
}
busy = true;
var _local1 = new Date();
start = _local1.getTime();
cache = {busy:false, callback:callback, complete:false, arg:arg, pos:0, parents:["root"], target:null, scratch:"", decode_chunk:function () {
com.newgrounds.encoders.json.JSON.decode_chunk();
}};
interval = setInterval(cache, "decode_chunk", 25);
return(true);
}
static function decode(text) {
var at = 0;
var ch = " ";
var _value;
var _error = function (m) {
throw {name:"JSONError", message:m, at:at - 1, text:text};
};
var _next = function () {
ch = text.charAt(at);
at = at + 1;
return(ch);
};
var _white = function () {
while (ch) {
if (ch <= " ") {
_next();
} else if (ch == "/") {
switch (_next()) {
case "/" :
while ((_next() && (ch != newline)) && (ch != "\r")) {
}
break;
case "*" :
_next();
for(;;){
if (ch) {
if (ch == "*") {
if (_next() == "/") {
_next();
// unexpected jump
}
} else {
_next();
}
} else {
_error("Unterminated comment");
}
};
break;
default :
_error("Syntax error");
}
} else {
return;
}
}
};
var _string = function () {
var _local4;
var _local1 = "";
var _local3;
var _local2;
var _local5 = false;
if (ch == "\"") {
while (_next()) {
if (ch == "\"") {
_next();
return(_local1);
}
if (ch == "\\") {
switch (_next()) {
case "b" :
_local1 = _local1 + "\b";
break;
case "f" :
_local1 = _local1 + "\f";
break;
case "n" :
_local1 = _local1 + newline;
break;
case "r" :
_local1 = _local1 + "\r";
break;
case "t" :
_local1 = _local1 + "\t";
break;
case "u" :
_local2 = 0;
_local4 = 0;
while (_local4 < 4) {
_local3 = parseInt(_next(), 16);
if (!isFinite(_local3)) {
_local5 = true;
break;
}
_local2 = (_local2 * 16) + _local3;
_local4 = _local4 + 1;
}
if (_local5) {
_local5 = false;
break;
}
_local1 = _local1 + String.fromCharCode(_local2);
break;
default :
_local1 = _local1 + ch;
}
} else {
_local1 = _local1 + ch;
}
}
}
_error("Bad string");
};
var _array = function () {
var _local1 = [];
if (ch == "[") {
_next();
_white();
if (ch == "]") {
_next();
return(_local1);
}
while (ch) {
_local1.push(_value());
_white();
if (ch == "]") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad array");
};
var _object = function () {
var _local2;
var _local1 = {};
if (ch == "{") {
_next();
_white();
if (ch == "}") {
_next();
return(_local1);
}
while (ch) {
_local2 = _string();
_white();
if (ch != ":") {
break;
}
_next();
_local1[_local2] = _value();
_white();
if (ch == "}") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad object");
};
var _number = function () {
var _local1 = "";
var _local2;
if (ch == "-") {
_local1 = "-";
_next();
}
while ((ch >= "0") && (ch <= "9")) {
_local1 = _local1 + ch;
_next();
}
if (ch == ".") {
_local1 = _local1 + ".";
while ((_next() && (ch >= "0")) && (ch <= "9")) {
_local1 = _local1 + ch;
}
}
_local2 = 1 * _local1;
if (!isFinite(_local2)) {
_error("Bad number");
} else {
return(_local2);
}
};
var _word = function () {
switch (ch) {
case "t" :
if (((_next() == "r") && (_next() == "u")) && (_next() == "e")) {
_next();
return(true);
}
break;
case "f" :
if ((((_next() == "a") && (_next() == "l")) && (_next() == "s")) && (_next() == "e")) {
_next();
return(false);
}
break;
case "n" :
if (!(((_next() == "u") && (_next() == "l")) && (_next() == "l"))) {
break;
}
_next();
return(null);
}
_error("Syntax error");
};
_value = function () {
_white();
switch (ch) {
case "{" :
return(_object());
case "[" :
return(_array());
case "\"" :
return(_string());
case "-" :
return(_number());
}
return((((ch >= "0") && (ch <= "9")) ? (_number()) : (_word())));
};
return(_value());
}
static function getType(v) {
if (v instanceof Array) {
return("array");
}
return(typeof(v));
}
static function decode_chunk() {
if ((!cache.busy) && (!cache.complete)) {
cache.busy = true;
var _local1 = 0;
while (_local1 < decode_chunks) {
chunk_decoder();
if (cache.complete) {
break;
}
_local1++;
}
trace(Math.round((cache.pos / cache.arg.length) * 100) + "% decoded");
cache.busy = false;
}
if (cache.complete) {
var _local2 = new Date();
busy = false;
clearInterval(interval);
cache.callback(cache.root, _local2.getTime() - start);
cache.arg = "";
}
}
static function encode_chunk() {
if ((!cache.busy) && (!cache.complete)) {
cache.busy = true;
var _local1 = 0;
while (_local1 < encode_chunks) {
chunk_encoder();
if (cache.complete) {
break;
}
_local1++;
}
cache.busy = false;
}
if (cache.complete) {
var _local3 = new Date();
var _local2 = _local3.getTime();
busy = false;
clearInterval(interval);
cache.callback(cache.encoded, _local2 - start);
cache.encoded = "";
}
}
static function chunk_decoder() {
function _object() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
com.newgrounds.encoders.json.JSON.cache.mode = "object";
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 != "\"") {
throw "Malformed object key in encoded string. Keys must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.json.JSON.cache.scratch = "";
_setTargetValue({});
} else if (_local1 == ",") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 != "\"") {
throw "Malformed object key in encoded string. Keys must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.json.JSON.cache.scratch = "";
} else if (_local1 == "}") {
_useParent();
} else if (_local1 == "\"") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 != ":") {
throw "Malformed object notation. Object keys and values must be separated by colons(:)";
}
_addParent(com.newgrounds.encoders.json.JSON.cache.scratch);
com.newgrounds.encoders.json.JSON.cache.mode = null;
} else {
if (_local1 == "\\") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
}
com.newgrounds.encoders.json.JSON.cache.scratch = com.newgrounds.encoders.json.JSON.cache.scratch + _local1;
}
com.newgrounds.encoders.json.JSON.cache.pos++;
}
function _array() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
com.newgrounds.encoders.json.JSON.cache.mode = "array";
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
_setTargetValue([]);
if (_local1 != "]") {
_addArrayKey();
} else {
_useParent();
}
return(undefined);
}
if (_local1 == ",") {
_addArrayKey();
} else if (_local1 == "]") {
_useParent();
}
com.newgrounds.encoders.json.JSON.cache.pos++;
}
function _boolean() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 == "t") {
_setTargetValue(true);
com.newgrounds.encoders.json.JSON.cache.pos = com.newgrounds.encoders.json.JSON.cache.pos + 3;
} else if (_local1 == "f") {
_setTargetValue(false);
com.newgrounds.encoders.json.JSON.cache.pos = com.newgrounds.encoders.json.JSON.cache.pos + 4;
} else {
throw "Bool values must be true or false";
}
_useParent();
}
function _null() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (_local1 == "n") {
_setTargetValue(null);
com.newgrounds.encoders.json.JSON.cache.pos = com.newgrounds.encoders.json.JSON.cache.pos + 2;
} else {
throw "Null values must be null";
}
_useParent();
}
function _string() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
if (_local1 != "\"") {
throw "Strings must be wrapped in quotes (\"\")";
}
com.newgrounds.encoders.json.JSON.cache.scratch = "";
com.newgrounds.encoders.json.JSON.cache.mode = "string";
} else if (_local1 == "\"") {
_setTargetValue(com.newgrounds.encoders.json.JSON.cache.scratch);
_useParent();
} else {
if (_local1 == "\\") {
com.newgrounds.encoders.json.JSON.cache.pos++;
_local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
switch (_local1) {
case "n" :
_local1 = newline;
break;
case "r" :
_local1 = newline;
break;
case "t" :
_local1 = "\t";
break;
case "u" :
_local1 = "\\" + _local1;
}
}
com.newgrounds.encoders.json.JSON.cache.scratch = com.newgrounds.encoders.json.JSON.cache.scratch + _local1;
}
com.newgrounds.encoders.json.JSON.cache.pos++;
}
function _number() {
var _local1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos);
var _local2 = "01234567890.-";
if (!com.newgrounds.encoders.json.JSON.cache.mode) {
com.newgrounds.encoders.json.JSON.cache.mode = "number";
com.newgrounds.encoders.json.JSON.cache.scratch = "";
}
if (_local2.indexOf(_local1) < 0) {
_setTargetValue(Number(com.newgrounds.encoders.json.JSON.cache.scratch));
_useParent();
} else {
com.newgrounds.encoders.json.JSON.cache.scratch = com.newgrounds.encoders.json.JSON.cache.scratch + _local1;
com.newgrounds.encoders.json.JSON.cache.pos++;
}
}
function _setTargetValue(newval) {
var _local2 = _getParent().obj;
var _local1 = com.newgrounds.encoders.json.JSON.cache.parents[com.newgrounds.encoders.json.JSON.cache.parents.length - 1];
_local2[_local1] = newval;
}
function _useParent() {
com.newgrounds.encoders.json.JSON.cache.mode = com.newgrounds.encoders.json.JSON.getType(_getParent().obj);
com.newgrounds.encoders.json.JSON.cache.parents.pop();
}
function _getParent() {
var _local2 = com.newgrounds.encoders.json.JSON.cache;
var _local1 = 0;
while (_local1 < (com.newgrounds.encoders.json.JSON.cache.parents.length - 1)) {
_local2 = _local2[com.newgrounds.encoders.json.JSON.cache.parents[_local1]];
_local1++;
}
return({obj:_local2, name:com.newgrounds.encoders.json.JSON.cache.parents[_local1]});
}
function _getCurrent() {
var _local2 = com.newgrounds.encoders.json.JSON.cache;
var _local1 = 0;
while (_local1 < com.newgrounds.encoders.json.JSON.cache.parents.length) {
_local2 = _local2[com.newgrounds.encoders.json.JSON.cache.parents[_local1]];
_local1++;
}
return({obj:_local2, name:com.newgrounds.encoders.json.JSON.cache.parents[_local1]});
}
function _addParent(child) {
com.newgrounds.encoders.json.JSON.cache.parents.push(child);
}
function _addArrayKey() {
var _local1 = _getCurrent().obj.length;
com.newgrounds.encoders.json.JSON.cache.parents.push(_local1);
com.newgrounds.encoders.json.JSON.cache.mode = null;
}
if (cache.pos >= cache.arg.length) {
cache.complete = true;
return(undefined);
}
if (cache.mode) {
eval ("_" + cache.mode)();
} else {
var char = cache.arg.charAt(cache.pos);
switch (char) {
case "{" :
_object();
return;
case "[" :
_array();
return;
case "\"" :
_string();
return;
case "n" :
_null();
return;
case "t" :
_boolean();
return;
case "f" :
_boolean();
return;
default :
_number();
}
}
}
static function chunk_encoder() {
if (cache.complete) {
return(undefined);
}
var _local2 = getType(cache.target);
switch (_local2) {
case "number" :
cache.encoded = cache.encoded + cache.target;
getParent();
break;
case "string" :
cache.encoded = cache.encoded + (("\"" + cache.target.split("\"").join("\\\"")) + "\"");
getParent();
break;
case "boolean" :
cache.encoded = cache.encoded + ((cache.target == true) ? "true" : "false");
getParent();
break;
case "null" :
cache.encoded = cache.encoded + "null";
getParent();
break;
case "array" :
if (cache.target.length < 1) {
cache.encoded = cache.encoded + "]";
getParent();
} else {
cache.parents.push(cache.target);
cache.target = cache.target[0];
if (getType(cache.target) == "array") {
cache.encoded = cache.encoded + "[";
} else if (getType(cache.target) == "object") {
cache.encoded = cache.encoded + "{";
}
}
break;
case "object" :
for (var _local1 in cache.target) {
break;
}
if (_local1 === undefined) {
cache.encoded = cache.encoded + "}";
getParent();
} else {
cache.parents.push(cache.target);
cache.target = cache.target[_local1];
cache.encoded = cache.encoded + (("\"" + _local1.split("\"").join("\\\"")) + "\":");
if (getType(cache.target) == "array") {
cache.encoded = cache.encoded + "[";
} else if (getType(cache.target) == "object") {
cache.encoded = cache.encoded + "{";
}
}
break;
default :
cache.encoded = cache.encoded + "null";
getParent();
}
}
static function getParent() {
if (cache.parents.length > 0) {
var _local1 = cache.parents.pop();
if (getType(_local1) == "array") {
_local1.shift();
} else {
for (var _local3 in _local1) {
delete _local1[_local3];
break;
}
}
if ((getType(_local1) == "object") or (getType(_local1) == "array")) {
for (var _local2 in _local1) {
break;
}
if (!(_local2 === undefined)) {
cache.encoded = cache.encoded + ",";
}
}
cache.target = _local1;
} else {
cache.complete = true;
}
}
static var encode_chunks = 20000;
static var decode_chunks = 20000;
static var busy = false;
}
Symbol 126 MovieClip [__Packages.com.newgrounds.Score] Frame 0
class com.newgrounds.Score
{
var _rank, _username, _score, _numericValue, _tag;
function Score (rank, username, score, numericValue, tag) {
(_rank = rank);
(_username = username);
_score = score;
_numericValue = numericValue;
_tag = tag;
}
function get numericValue() {
return(_numericValue);
}
function get rank() {
return(_rank);
}
function get score() {
return(_score);
}
function get tag() {
return(_tag);
}
function get username() {
return(_username);
}
function toString() {
return((((_rank + ".\t") + _username) + "\t") + _score);
}
}
Symbol 440 MovieClip [musiconject] Frame 10
stop();
Symbol 460 MovieClip Frame 35
stop();
Instance of Symbol 442 MovieClip [linktogoblinarena] in Symbol 468 MovieClip [GoblinArenaSplash] Frame 1
on (press) {
getURL ("http://www.goblinarena.com", blank);
}
Symbol 468 MovieClip [GoblinArenaSplash] Frame 228
stop();
_root.play();
Symbol 483 MovieClip [menubuttonSmall] Frame 1
stop();
Symbol 485 MovieClip [intro] Frame 1
var scrollintro = 0.5;
attachMovie("introtxt", "introtxt", 3);
introtxt._x = 165;
introtxt._y = 500;
Instance of Symbol 216 MovieClip [menubutton] in Symbol 485 MovieClip [intro] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
if (_parent.scrollintro == 0.5) {
_parent.scrollintro = 1.5;
} else {
_parent.scrollintro = 0.5;
}
}
Instance of Symbol 483 MovieClip [menubuttonSmall] in Symbol 485 MovieClip [intro] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndPlay(51);
}
Symbol 485 MovieClip [intro] Frame 2
introtxt._y = introtxt._y - scrollintro;
Symbol 485 MovieClip [intro] Frame 3
introtxt._y = introtxt._y - scrollintro;
if (introtxt._y < -700) {
introtxt.removeMovieClip();
gotoAndPlay (4);
} else {
gotoAndPlay (2);
}
Symbol 485 MovieClip [intro] Frame 21
_root.gotoAndPlay(51);
Symbol 494 MovieClip [star_mc] Frame 1
max_wait = random(100) + 30;
wait = 0;
Symbol 494 MovieClip [star_mc] Frame 2
wait++;
Symbol 494 MovieClip [star_mc] Frame 3
if (wait < max_wait) {
gotoAndPlay(_currentframe - 1);
}
Symbol 495 MovieClip [sun] Frame 1
stop();
Symbol 495 MovieClip [sun] Frame 3
stop();
Symbol 495 MovieClip [sun] Frame 8
stop();
Symbol 495 MovieClip [sun] Frame 11
stop();
Symbol 503 MovieClip [tickbox] Frame 1
stop();
Symbol 503 MovieClip [tickbox] Frame 2
stop();
Symbol 511 MovieClip [slider] Frame 1
this.ratio = 0;
dragger.onPress = function () {
this.startDrag(true, 0, 0, line._width, 0);
this.onEnterFrame = function () {
ratio = this._x / line._width;
_global.mainVolume = ratio;
_root.musicobject.ambience.setVolume((_global.mainVolume * 100) * _global.forestsounds);
_root.musicobject2.theme.setVolume(((50 * _global.mainVolume) * (_root.herotheme / 100)) * _global.themesounds);
_root.musicobject.music.setVolume((100 * _global.mainVolume) * _global.forestsounds);
_root.musicobject3.drums.setVolume((50 * _global.mainVolume) * _global.musicsounds);
_global.mainVolume = ratio;
};
};
dragger.onRelease = (dragger.onreleaseOutside = stopDrag);
Symbol 528 MovieClip [menu2] Frame 1
if (_root._quality == "LOW") {
this.ql.gotoAndStop(2);
}
if (_root._quality == "MEDIUM") {
this.qm.gotoAndStop(2);
}
if (_root._quality == "HIGH") {
this.qh.gotoAndStop(2);
}
if (_global.forestsounds == 1) {
this.volumeA.gotoAndStop(2);
} else {
this.volumeA.gotoAndStop(3);
}
if (_global.musicsounds == 1) {
this.volumeM.gotoAndStop(2);
} else {
this.volumeM.gotoAndStop(3);
}
if (_global.themesounds == 1) {
this.volumeH.gotoAndStop(2);
} else {
this.volumeH.gotoAndStop(3);
}
if (_global.mousescroll == 1) {
this.ms.gotoAndStop(2);
} else {
this.ms.gotoAndStop(3);
}
this.musicslider.dragger._x = _global.mainVolume * this.musicslider.line._width;
Instance of Symbol 503 MovieClip [tickbox] "qh" in Symbol 528 MovieClip [menu2] Frame 1
on (release) {
_root._quality = "High";
this.gotoAndStop(2);
_parent.qm.gotoAndStop(1);
_parent.ql.gotoAndStop(1);
}
Instance of Symbol 503 MovieClip [tickbox] "qm" in Symbol 528 MovieClip [menu2] Frame 1
on (release) {
_root._quality = "Medium";
this.gotoAndStop(2);
_parent.ql.gotoAndStop(1);
_parent.qh.gotoAndStop(1);
}
Instance of Symbol 503 MovieClip [tickbox] "ql" in Symbol 528 MovieClip [menu2] Frame 1
on (release) {
_root._quality = "Low";
this.gotoAndStop(2);
_parent.qm.gotoAndStop(1);
_parent.qh.gotoAndStop(1);
}
Instance of Symbol 511 MovieClip [slider] "musicslider" in Symbol 528 MovieClip [menu2] Frame 1
onClipEvent (load) {
}
onClipEvent (enterFrame) {
}
Instance of Symbol 503 MovieClip [tickbox] "volumeA" in Symbol 528 MovieClip [menu2] Frame 1
on (release) {
if (_global.forestsounds == 1) {
this.gotoAndStop(3);
_global.forestsounds = 0;
} else {
this.gotoAndStop(2);
_global.forestsounds = 1;
}
_root.musicobject.ambience.setVolume((_global.mainVolume * 100) * _global.forestsounds);
_root.musicobject2.theme.setVolume(((50 * _global.mainVolume) * (_root.herotheme / 100)) * _global.themesounds);
_root.musicobject.music.setVolume((100 * _global.mainVolume) * _global.forestsounds);
_root.musicobject3.drums.setVolume((50 * _global.mainVolume) * _global.musicsounds);
}
Instance of Symbol 503 MovieClip [tickbox] "volumeM" in Symbol 528 MovieClip [menu2] Frame 1
on (release) {
if (_global.musicsounds == 1) {
this.gotoAndStop(3);
_global.musicsounds = 0;
} else {
this.gotoAndStop(2);
_global.musicsounds = 1;
}
_root.musicobject.ambience.setVolume((_global.mainVolume * 100) * _global.forestsounds);
_root.musicobject2.theme.setVolume(((50 * _global.mainVolume) * (_root.herotheme / 100)) * _global.themesounds);
_root.musicobject.music.setVolume((100 * _global.mainVolume) * _global.forestsounds);
_root.musicobject3.drums.setVolume((50 * _global.mainVolume) * _global.musicsounds);
}
Instance of Symbol 503 MovieClip [tickbox] "volumeH" in Symbol 528 MovieClip [menu2] Frame 1
on (release) {
if (_global.themesounds == 1) {
this.gotoAndStop(3);
_global.themesounds = 0;
} else {
this.gotoAndStop(2);
_global.themesounds = 1;
}
_root.musicobject.ambience.setVolume((_global.mainVolume * 100) * _global.forestsounds);
_root.musicobject2.theme.setVolume(((50 * _global.mainVolume) * (_root.herotheme / 100)) * _global.themesounds);
_root.musicobject.music.setVolume((100 * _global.mainVolume) * _global.forestsounds);
_root.musicobject3.drums.setVolume((50 * _global.mainVolume) * _global.musicsounds);
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 528 MovieClip [menu2] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.mmenu.removeMovieClip();
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 528 MovieClip [menu2] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop(55);
_root.mmenu.removeMovieClip();
}
Instance of Symbol 503 MovieClip [tickbox] "ms" in Symbol 528 MovieClip [menu2] Frame 1
on (release) {
if (_global.mousescroll == 1) {
this.gotoAndStop(3);
_global.mousescroll = 0;
} else {
this.gotoAndStop(2);
_global.mousescroll = 1;
}
}
Symbol 532 MovieClip [howto] Frame 1
if (_root._quality == "LOW") {
this.ql.gotoAndStop(2);
}
if (_root._quality == "MEDIUM") {
this.qm.gotoAndStop(2);
}
if (_root._quality == "HIGH") {
this.qh.gotoAndStop(2);
}
this.musicslider.dragger._x = _global.mainVolume * this.musicslider.line._width;
Instance of Symbol 216 MovieClip [menubutton] in Symbol 532 MovieClip [howto] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.mmenu.removeMovieClip();
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 532 MovieClip [howto] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop(55);
_root.mmenu.removeMovieClip();
}
Symbol 537 MovieClip Frame 48
stop();
Symbol 573 MovieClip [BonusBox] Frame 1
stop();
bonusaddress = "HTTP://www.goblinarena.com/clan-wars-2-red-dawn-bonus.php?ID=" + _global.bonuskey;
if (_global.bonusunlocked) {
gotoAndPlay (155);
}
Instance of Symbol 555 MovieClip in Symbol 573 MovieClip [BonusBox] Frame 1
on (release) {
_root.BonusBox.removeMovieClip();
}
Instance of Symbol 559 MovieClip in Symbol 573 MovieClip [BonusBox] Frame 1
on (release) {
var sendText = "http://www.GoblinArena.com/clan-wars-2-red-dawn-bonus.php?";
sendText = sendText + ("ID=" + _global.bonuskey);
getURL (sendText, "_blank");
_root.BonusBox.gotoAndStop(2);
}
Symbol 573 MovieClip [BonusBox] Frame 2
_root.BonusBox.codeentered.text = "Enter Code here.";
_root.BonusBox.addressfield.text = bonusaddress;
_root.BonusBox.codeentered.onSetFocus = function () {
_root.BonusBox.codeentered.text = "";
};
Instance of Symbol 555 MovieClip in Symbol 573 MovieClip [BonusBox] Frame 2
on (release) {
_root.BonusBox.removeMovieClip();
}
Instance of Symbol 566 MovieClip [button] in Symbol 573 MovieClip [BonusBox] Frame 2
on (release) {
trace("codeentered=" + _root.BonusBox.codeentered.text);
if (_root.BonusBox.codeentered.text == _global.bonuscode) {
_global.bonusunlocked = true;
localInfo = SharedObject.getLocal("clan2");
localInfo.data.bonusunlock = _global.bonusunlocked;
localInfo.data.slot1_skillpoints = localInfo.data.slot1_skillpoints + 10;
localInfo.data.slot2_skillpoints = localInfo.data.slot2_skillpoints + 10;
localInfo.data.slot3_skillpoints = localInfo.data.slot3_skillpoints + 10;
_global.skillpoints = _global.skillpoints + 10;
if (_global.bonusunlocked) {
_root.bonuslock1._x = 2000;
_root.bonuslock2._x = 2000;
}
_root.BonusBox.gotoAndPlay(155);
} else {
_root.BonusBox.gotoAndPlay(4);
}
}
Symbol 573 MovieClip [BonusBox] Frame 3
stop();
Symbol 573 MovieClip [BonusBox] Frame 154
gotoAndStop (1);
Symbol 573 MovieClip [BonusBox] Frame 155
stop();
Instance of Symbol 555 MovieClip in Symbol 573 MovieClip [BonusBox] Frame 155
on (release) {
_root.BonusBox.removeMovieClip();
}
Symbol 573 MovieClip [BonusBox] Frame 450
_root.BonusBox.removeMovieClip();
Symbol 589 MovieClip [titlemenu] Frame 1
stop();
Instance of Symbol 216 MovieClip [menubutton] in Symbol 589 MovieClip [titlemenu] Frame 1
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.abilitybox.ability_header.text = "Play Game!!!";
_root.abilitybox.ability_txt.text = "Click to get started. First select difficulty, choose your hero and begin the battle!";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
}
on (release) {
clearInterval(_root.fireid);
_root.marco.removeMovieClip();
_root.clip.removeMovieClip();
_root.mc0.removeMovieClip();
_root.gotoAndStop(59);
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 589 MovieClip [titlemenu] Frame 1
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.abilitybox.ability_header.text = "How to Play";
_root.abilitybox.ability_txt.text = "UNLOCK the BONUS CONTENT! Extra HEROES, Extra SKILL POINTS, UNLOCK BONUS LEVELS and Extra GOLD on EVERY BATTLE(ALL FOR FREE!).";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
}
on (release) {
_root.attachMovie("BonusBox", "BonusBox", 2125);
_root.BonusBox._x = 150;
_root.BonusBox._y = 50;
}
on (press) {
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 589 MovieClip [titlemenu] Frame 1
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.abilitybox.ability_header.text = "Game Options";
_root.abilitybox.ability_txt.text = "Change graphic and sounds settings.";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
}
on (release) {
_root.attachMovie("menu2", "mmenu", 2125);
if (_root._quality == "high") {
_root.mmenu.qh.gotoAndStop(2);
}
if (_root._quality == "medium") {
_root.mmenu.qm.gotoAndStop(2);
}
if (_root._quality == "low") {
_root.mmenu.ql.gotoAndStop(2);
}
_root.mmenu._x = 80;
_root.mmenu._y = 60;
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 589 MovieClip [titlemenu] Frame 1
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.abilitybox.ability_header.text = "Play More Games";
_root.abilitybox.ability_txt.text = "Click here to see, our other great games at GoblinArena.com";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
}
on (press) {
getURL ("http://goblinarena.com", blank);
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 589 MovieClip [titlemenu] Frame 1
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.abilitybox.ability_header.text = "Strategy Guide";
_root.abilitybox.ability_txt.text = "Click to view the strategy guide at GoblinArena.com";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
}
on (press) {
getURL ("http://www.goblinarena.com", blank);
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 589 MovieClip [titlemenu] Frame 2
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.abilitybox.ability_header.text = "Game Options";
_root.abilitybox.ability_txt.text = "Change graphic and sounds settings.";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
}
on (release) {
_root.attachMovie("menu2", "mmenu", 2125);
if (_root._quality == "high") {
_root.mmenu.qh.gotoAndStop(2);
}
if (_root._quality == "medium") {
_root.mmenu.qm.gotoAndStop(2);
}
if (_root._quality == "low") {
_root.mmenu.ql.gotoAndStop(2);
}
_root.mmenu._x = 80;
_root.mmenu._y = 60;
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 589 MovieClip [titlemenu] Frame 2
on (rollOver) {
this.gotoAndStop(2);
_root.overhero = true;
_root.abilitybox.ability_header.text = "Play More Games";
_root.abilitybox.ability_txt.text = "Click here to see, our other great games at ArmorGames.com";
}
on (rollOut) {
this.gotoAndStop(1);
_root.overhero = false;
}
on (press) {
getURL ("http://armor.ag/MoreGames", blank);
}
Symbol 674 MovieClip [wizard] Frame 13
gotoAndPlay (1);
Symbol 674 MovieClip [wizard] Frame 66
stop();
Symbol 674 MovieClip [wizard] Frame 111
stop();
Symbol 747 MovieClip [wargrider] Frame 13
gotoAndPlay (1);
Symbol 747 MovieClip [wargrider] Frame 60
stop();
Symbol 747 MovieClip [wargrider] Frame 112
stop();
Symbol 822 MovieClip [soldier] Frame 16
gotoAndPlay (1);
Symbol 822 MovieClip [soldier] Frame 60
stop();
Symbol 822 MovieClip [soldier] Frame 108
stop();
Symbol 885 MovieClip [slave] Frame 13
gotoAndPlay (1);
Symbol 885 MovieClip [slave] Frame 58
stop();
Symbol 885 MovieClip [slave] Frame 110
stop();
Symbol 964 MovieClip [assasin] Frame 12
gotoAndPlay (1);
Symbol 964 MovieClip [assasin] Frame 66
stop();
Symbol 964 MovieClip [assasin] Frame 111
stop();
Symbol 1047 MovieClip [archer] Frame 13
gotoAndPlay (1);
Symbol 1047 MovieClip [archer] Frame 66
stop();
Symbol 1047 MovieClip [archer] Frame 112
stop();
Symbol 1156 MovieClip [chief] Frame 13
gotoAndPlay (1);
Symbol 1156 MovieClip [chief] Frame 61
stop();
Symbol 1156 MovieClip [chief] Frame 114
stop();
Symbol 1159 MovieClip Frame 1
hb._visible = false;
Symbol 1160 MovieClip [firebolt] Frame 1
hb._visible = false;
Symbol 1161 MovieClip [explosion2] Frame 16
this.removeMovieClip();
Symbol 1163 MovieClip [tower1cover] Frame 1
stop();
Symbol 1164 MovieClip [gamebutton] Frame 1
stop();
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1182 MovieClip [gameoptions] Frame 1
on (release) {
_root.attachMovie("recruitoptions", "options2", 23);
_root.options2._x = 0;
_root.options2._y = 0;
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Recruit Units";
_root.icondescriptions.ability_txt.text = "Purchase a unit to march into the battlefield.";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1182 MovieClip [gameoptions] Frame 1
on (release) {
_root.attachMovie("uptoweroptions", "options2", 23);
_root.options2._x = 0;
_root.options2._y = 0;
_root.doubleclick++;
if (_root.doubleclick > 1) {
_root.game._x = -65;
_root.game.mountains1._x = -100;
_root.game.mountains2._x = -100;
_root.game.sun._x = 500;
_root.doubleclick = 0;
_root.visicount = 5;
}
_root.options2.turretSpeedTxt = _root.turretSpeed;
_root.options2.turretDamageTxt = _root.turretSize;
_root.options2.turretMultiTxt = _root.multiShot;
_root.options2.turretHPTxt = _root.towerHP;
_root.options2.repairRateTxt = _root.repairRate;
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Upgrade Tower and Turret";
_root.icondescriptions.ability_txt.text = "Purchase upgrades for stronghold, increase defense and repair rates or increase canon power, speed etc.";
}
on (rollOut) {
_root.optionslabel.removeMovieClip();
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1182 MovieClip [gameoptions] Frame 1
on (release) {
_root.attachMovie("upunitoptions", "options2", 23);
_root.options2._x = 0;
_root.options2._y = 0;
if (_root.elitelionriderexp < 90000) {
_root.options2.elitetick.gotoAndStop(2);
}
if (_root.shadowdemon2) {
_root.options2.demontick.gotoAndStop(2);
}
_root.options2.mDamageTxt = _root.meleeWeapons;
_root.options2.mArmorTxt = _root.meleeArmor;
_root.options2.rDamageTxt = _root.bowDamage;
_root.options2.rArmorTxt = _root.rangedArmor;
_root.options2.fireballTxt = _root.fireballSpell;
_root.options2.drakeGrowTxt = _root.drakeGrow;
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Upgrade Units";
_root.icondescriptions.ability_txt.text = "Upgrade unit attack damage or defense.";
}
on (rollOut) {
_root.optionslabel.removeMovieClip();
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1182 MovieClip [gameoptions] Frame 1
on (release) {
_root.attachMovie("spelloptions", "options2", 23);
_root.options2._x = 0;
_root.options2._y = 0;
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Spells/Skills";
_root.icondescriptions.ability_txt.text = "Cast spells or use special skills such as shadow demon, mighty fist or catapult.";
}
on (rollOut) {
_root.optionslabel.removeMovieClip();
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1182 MovieClip [gameoptions] Frame 1
on (release) {
_root.attachMovie("herooptions", "options2", 23);
if (_global.chief == "chief4") {
_root.options2.gotoAndStop(4);
} else if (_global.chief == "chief2") {
_root.options2.gotoAndStop(2);
} else if (_global.chief == "chief5") {
_root.options2.gotoAndStop(5);
} else if (_global.chief == "chief6") {
_root.options2.gotoAndStop(6);
}
_root.options2._x = 0;
_root.options2._y = 0;
_root.doubleclick++;
if (_root.doubleclick > 1) {
if (_root.heronumber > 0) {
trace("double clikc");
var dist = Math.max(Math.min(_root.game["unit" + _root.heronumber]._x - 500, 2690), 65);
_root.game._x = ((-Math.round(dist / 25)) * 25) - 65;
_root.game.mountains1._x = (Math.round(dist / 25) * 12) - 100;
_root.game.mountains2._x = (Math.round(dist / 25) * 22) - 100;
_root.game.sun._x = (Math.round(dist / 25) * 25) + 500;
_root.visicount = 5;
_root.doubleclick = 0;
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Hero Control";
_root.icondescriptions.ability_txt.text = "Hero control allows you to use special skills or direct your hero to either attack or flee.";
}
on (rollOut) {
_root.optionslabel.removeMovieClip();
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1182 MovieClip [gameoptions] Frame 1
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Game Menu";
_root.icondescriptions.ability_txt.text = "Pause game, change sound volume, music, ambience or quit current level.";
}
on (rollOut) {
_root.optionslabel.removeMovieClip();
_root.icondescriptions.removeMovieClip();
}
on (release) {
_root.pausegame = true;
_root.attachMovie("menu", "mmenu", 2125);
if (_root._quality == "high") {
_root.mmenu.qh.gotoAndStop(2);
}
if (_root._quality == "medium") {
_root.mmenu.qm.gotoAndStop(2);
}
if (_root._quality == "low") {
_root.mmenu.ql.gotoAndStop(2);
}
_root.mmenu._x = 80;
_root.mmenu._y = 60;
_root.Tip.removeMovieClip();
}
Symbol 1187 MovieClip [goldup] Frame 15
this.removeMovieClip();
Symbol 1190 MovieClip [trophyup] Frame 15
this.removeMovieClip();
Symbol 1285 MovieClip [spiderrider] Frame 15
gotoAndPlay (1);
Symbol 1285 MovieClip [spiderrider] Frame 66
stop();
Symbol 1285 MovieClip [spiderrider] Frame 116
stop();
Symbol 1376 MovieClip [firedrake] Frame 18
gotoAndPlay (1);
Symbol 1376 MovieClip [firedrake] Frame 64
stop();
Symbol 1376 MovieClip [firedrake] Frame 113
stop();
Symbol 1475 MovieClip [chief2] Frame 13
gotoAndPlay (1);
Symbol 1475 MovieClip [chief2] Frame 70
stop();
Symbol 1475 MovieClip [chief2] Frame 113
stop();
Symbol 1501 MovieClip [crow] Frame 1
stop();
Symbol 1501 MovieClip [crow] Frame 21
gotoAndPlay (10);
Symbol 1543 MovieClip [backtrees] Frame 1
stop();
Symbol 1543 MovieClip [backtrees] Frame 9
stop();
Symbol 1543 MovieClip [backtrees] Frame 11
stop();
Symbol 1543 MovieClip [backtrees] Frame 12
stop();
Symbol 1543 MovieClip [backtrees] Frame 14
stop();
Symbol 1600 MovieClip [fronttrees] Frame 1
stop();
Symbol 1600 MovieClip [fronttrees] Frame 11
stop();
Instance of Symbol 1604 MovieClip [pausing] "pausenow" in Symbol 1605 MovieClip [pausenow] Frame 1
on (release) {
if (_root.pausegame) {
_root.pausegame = false;
_root.mmenu.removeMovieClip();
_root.pausesign.removeMovieClip();
} else {
_root.pausegame = true;
_root.attachMovie("pausesign", "pausesign", 25);
_root.pausesign._x = 350;
_root.pausesign._y = 250;
}
}
Symbol 1619 MovieClip [lightning1] Frame 1
_root.darkness.removeMovieClip();
Symbol 1619 MovieClip [lightning1] Frame 7
stop();
_root.attachMovie("darkness", "darkness", 12);
_root.darkness._x = -100;
_root.darkness._y = -100;
this.removeMovieClip();
Symbol 1622 MovieClip [lightning2] Frame 1
_root.darkness.removeMovieClip();
Symbol 1622 MovieClip [lightning2] Frame 7
stop();
_root.attachMovie("darkness", "darkness", 12);
_root.darkness._x = -100;
_root.darkness._y = -100;
this.removeMovieClip();
Symbol 1625 MovieClip [lightning3] Frame 1
_root.darkness.removeMovieClip();
Symbol 1625 MovieClip [lightning3] Frame 7
stop();
_root.attachMovie("darkness", "darkness", 12);
_root.darkness._x = -100;
_root.darkness._y = -100;
this.removeMovieClip();
Symbol 1628 MovieClip [lightning4] Frame 1
_root.darkness.removeMovieClip();
Symbol 1628 MovieClip [lightning4] Frame 9
stop();
_root.attachMovie("darkness", "darkness", 12);
_root.darkness._x = -100;
_root.darkness._y = -100;
this.removeMovieClip();
Symbol 1631 MovieClip [lightning5] Frame 1
_root.darkness.removeMovieClip();
Symbol 1631 MovieClip [lightning5] Frame 7
stop();
_root.attachMovie("darkness", "darkness", 12);
_root.darkness._x = -100;
_root.darkness._y = -100;
this.removeMovieClip();
Symbol 1634 MovieClip [lightning6] Frame 1
_root.darkness.removeMovieClip();
Symbol 1634 MovieClip [lightning6] Frame 7
stop();
_root.attachMovie("darkness", "darkness", 12);
_root.darkness._x = -100;
_root.darkness._y = -100;
this.removeMovieClip();
Symbol 1642 MovieClip [dark] Frame 6
stop();
Symbol 1642 MovieClip [dark] Frame 9
gotoAndStop (6);
Symbol 1642 MovieClip [dark] Frame 15
stop();
_root.game.dark.removeMovieClip();
Symbol 1649 MovieClip [catapult] Frame 6
gotoAndPlay (1);
Symbol 1649 MovieClip [catapult] Frame 72
gotoAndStop (51);
Symbol 1649 MovieClip [catapult] Frame 106
stop();
Symbol 1685 MovieClip [shadowdemon] Frame 14
gotoAndPlay (1);
Symbol 1685 MovieClip [shadowdemon] Frame 60
stop();
Symbol 1685 MovieClip [shadowdemon] Frame 111
stop();
Symbol 1693 MovieClip [soundobject] Frame 2
stop();
Symbol 1699 MovieClip [menu] Frame 1
if (_root._quality == "LOW") {
this.ql.gotoAndStop(2);
}
if (_root._quality == "MEDIUM") {
this.qm.gotoAndStop(2);
}
if (_root._quality == "HIGH") {
this.qh.gotoAndStop(2);
}
if (_global.forestsounds == 1) {
this.volumeA.gotoAndStop(2);
} else {
this.volumeA.gotoAndStop(3);
}
if (_global.musicsounds == 1) {
this.volumeM.gotoAndStop(2);
} else {
this.volumeM.gotoAndStop(3);
}
if (_global.themesounds == 1) {
this.volumeH.gotoAndStop(2);
} else {
this.volumeH.gotoAndStop(3);
}
if (_global.mousescroll == 1) {
this.ms.gotoAndStop(2);
} else {
this.ms.gotoAndStop(3);
}
this.musicslider.dragger._x = _global.mainVolume * this.musicslider.line._width;
Instance of Symbol 503 MovieClip [tickbox] "qh" in Symbol 1699 MovieClip [menu] Frame 1
on (release) {
_root._quality = "High";
this.gotoAndStop(2);
_parent.qm.gotoAndStop(1);
_parent.ql.gotoAndStop(1);
}
Instance of Symbol 503 MovieClip [tickbox] "qm" in Symbol 1699 MovieClip [menu] Frame 1
on (release) {
_root._quality = "Medium";
this.gotoAndStop(2);
_parent.ql.gotoAndStop(1);
_parent.qh.gotoAndStop(1);
}
Instance of Symbol 503 MovieClip [tickbox] "ql" in Symbol 1699 MovieClip [menu] Frame 1
on (release) {
_root._quality = "Low";
this.gotoAndStop(2);
_parent.qm.gotoAndStop(1);
_parent.qh.gotoAndStop(1);
}
Instance of Symbol 511 MovieClip [slider] "musicslider" in Symbol 1699 MovieClip [menu] Frame 1
onClipEvent (load) {
}
onClipEvent (enterFrame) {
}
Instance of Symbol 503 MovieClip [tickbox] "volumeA" in Symbol 1699 MovieClip [menu] Frame 1
on (release) {
if (_global.forestsounds == 1) {
this.gotoAndStop(3);
_global.forestsounds = 0;
} else {
this.gotoAndStop(2);
_global.forestsounds = 1;
}
_root.musicobject.ambience.setVolume((_global.mainVolume * 100) * _global.forestsounds);
_root.musicobject2.theme.setVolume(((50 * _global.mainVolume) * (_root.herotheme / 100)) * _global.themesounds);
_root.musicobject.music.setVolume((100 * _global.mainVolume) * _global.forestsounds);
_root.musicobject3.drums.setVolume((50 * _global.mainVolume) * _global.musicsounds);
}
Instance of Symbol 503 MovieClip [tickbox] "volumeM" in Symbol 1699 MovieClip [menu] Frame 1
on (release) {
if (_global.musicsounds == 1) {
this.gotoAndStop(3);
_global.musicsounds = 0;
} else {
this.gotoAndStop(2);
_global.musicsounds = 1;
}
_root.musicobject.ambience.setVolume((_global.mainVolume * 100) * _global.forestsounds);
_root.musicobject2.theme.setVolume(((50 * _global.mainVolume) * (_root.herotheme / 100)) * _global.themesounds);
_root.musicobject.music.setVolume((100 * _global.mainVolume) * _global.forestsounds);
_root.musicobject3.drums.setVolume((50 * _global.mainVolume) * _global.musicsounds);
}
Instance of Symbol 503 MovieClip [tickbox] "volumeH" in Symbol 1699 MovieClip [menu] Frame 1
on (release) {
if (_global.themesounds == 1) {
this.gotoAndStop(3);
_global.themesounds = 0;
} else {
this.gotoAndStop(2);
_global.themesounds = 1;
}
_root.musicobject.ambience.setVolume((_global.mainVolume * 100) * _global.forestsounds);
_root.musicobject2.theme.setVolume(((50 * _global.mainVolume) * (_root.herotheme / 100)) * _global.themesounds);
_root.musicobject.music.setVolume((100 * _global.mainVolume) * _global.forestsounds);
_root.musicobject3.drums.setVolume((50 * _global.mainVolume) * _global.musicsounds);
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1699 MovieClip [menu] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.pausegame = false;
_root.pausesign.removeMovieClip();
_root.mmenu.removeMovieClip();
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1699 MovieClip [menu] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.tower1hp = 0;
_root.gameend();
_root.mmenu.removeMovieClip();
}
Instance of Symbol 503 MovieClip [tickbox] "ms" in Symbol 1699 MovieClip [menu] Frame 1
on (release) {
if (_global.mousescroll == 1) {
this.gotoAndStop(3);
_global.mousescroll = 0;
} else {
this.gotoAndStop(2);
_global.mousescroll = 1;
}
}
Symbol 1740 MovieClip [endgame] Frame 1
var hours = Math.floor(_root.timecompleted / 3600);
var minutes = (Math.floor(_root.timecompleted / 60) - (hours * 60));
var seconds = ((Math.floor(_root.timecompleted) - (minutes * 60)) - (hours * 3600));
if (hours < 1) {
hours = "00";
} else if (hours < 10) {
hours = "0" + hours;
}
if (minutes < 1) {
minutes = "00";
} else if (minutes < 10) {
minutes = "0" + minutes;
}
if (seconds < 1) {
seconds = "00";
} else if (seconds < 10) {
seconds = "0" + seconds;
}
var formattime = ((((hours + ":") + minutes) + ":") + seconds);
this.gametime = formattime;
var bonuscap = Math.round((_root.masterlevelxp[_global.masterlevel + 1] - _root.masterlevelxp[_global.masterlevel]) * 2.5);
var bonusscale = 1;
if (_root.totalbonus > bonuscap) {
bonusscale = bonuscap / _root.totalbonus;
_root.totalbonus = bonuscap;
_root.killbonus = Math.round(_root.killbonus * bonusscale);
_root.victorybonus = Math.round(_root.victorybonus * bonusscale);
_root.timebonus = Math.round(_root.timebonus * bonusscale);
_root.herobonus = Math.round(_root.herobonus * bonusscale);
_root.expbonus = Math.round(_root.expbonus * bonusscale);
_root.repbonus = Math.round(_root.repbonus * bonusscale);
}
this.killbonus_txt.text = 0;
this.victorybonus_txt.text = 0;
this.timebonus_txt.text = 0;
this.herobonus_txt.text = 0;
this.expbonus_txt.text = 0;
this.repbonus_txt.text = 0;
this.totalbonus_txt.text = 0;
var killbonuscount = 0;
var victorybonuscount = 0;
var timebonuscount = 0;
var herobonuscount = 0;
var expbonuscount = 0;
var repbonuscount = 0;
var totalbonuscount = 0;
var incrementer = (Math.round(_root.totalbonus / 200) + 1);
var timer = 0;
countdown = function () {
timer++;
trace(timer);
if (totalbonuscount >= (_root.totalbonus - 20)) {
trace("clear interval");
clearInterval(countdownInterval);
}
trace("totalbonus" + totalbonuscount);
if (killbonuscount < _root.killbonus) {
killbonuscount = killbonuscount + incrementer;
totalbonuscount = totalbonuscount + incrementer;
_root.endgame.killbonus_txt.text = killbonuscount;
}
if (victorybonuscount < _root.victorybonus) {
victorybonuscount = victorybonuscount + incrementer;
totalbonuscount = totalbonuscount + incrementer;
_root.endgame.victorybonus_txt.text = victorybonuscount;
}
if (timebonuscount < _root.timebonus) {
timebonuscount = timebonuscount + incrementer;
totalbonuscount = totalbonuscount + incrementer;
_root.endgame.timebonus_txt.text = timebonuscount;
trace("timebonuscount=" + timebonuscount);
}
if (herobonuscount < _root.herobonus) {
herobonuscount = herobonuscount + incrementer;
totalbonuscount = totalbonuscount + incrementer;
_root.endgame.herobonus_txt.text = herobonuscount;
}
if (expbonuscount < _root.expbonus) {
expbonuscount = expbonuscount + incrementer;
totalbonuscount = totalbonuscount + incrementer;
_root.endgame.expbonus_txt.text = expbonuscount;
}
if (repbonuscount < _root.repbonus) {
repbonuscount = repbonuscount + incrementer;
totalbonuscount = totalbonuscount + incrementer;
_root.endgame.repbonus_txt.text = repbonuscount;
}
_root.endgame.totalbonus_txt.text = totalbonuscount;
if (((_global.gexperience - _root.totalbonus) + totalbonuscount) > _root.masterlevelxp[_global.masterlevel + 1]) {
_global.masterlevel++;
_global.skillpoints = _global.skillpoints + 3;
}
_root.endgame.skillgain.skills_txt.text = _global.skillpoints;
_root.endgame.skillgain.masterxpbartxt.text = (Math.round((_global.gexperience - _root.totalbonus) + totalbonuscount) + " / ") + _root.masterlevelxp[_global.masterlevel + 1];
_root.endgame.skillgain.masterXPbar.pb._xscale = int(((((_global.gexperience - _root.totalbonus) + totalbonuscount) - _root.masterlevelxp[_global.masterlevel]) / (_root.masterlevelxp[_global.masterlevel + 1] - _root.masterlevelxp[_global.masterlevel])) * 100);
};
if (_root.totalbonus > 0) {
_global.gexperience = _global.gexperience + Math.round(_root.totalbonus);
countdownInterval = setInterval(countdown, 2);
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1740 MovieClip [endgame] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.onEnterFrame = null;
_root.sky.removeMovieClip();
_root.game.removeMovieClip();
_root.gameoptions.removeMovieClip();
_root.gamestats.removeMovieClip();
_root.options2.removeMovieClip();
_root.pausenow.removeMovieClip();
_root.herodashboard.removeMovieClip();
_root.musicobject.ambience.stop();
_root.musicobject.removeMovieClip();
_root.pausegame = false;
_root.optionslabel.removeMovieClip();
_root.cuedetails.removeMovieClip();
_root.musicobject2.theme.stop();
_root.musicobject2.removeMovieClip();
_root.musicobject3.drums.stop();
_root.musicobject3.removeMovieClip();
_root.border.removeMovieClip();
trace("go to frame 58");
trace(_root._currentframe);
if (_global.skillpoints > 0) {
_root.gotoAndStop(58);
} else {
_root.gotoAndStop(58);
}
trace(_root._currentframe);
_root.attachMovie("musiconject", "musicobject", 1201);
_root.musicobject._y = -50;
_root.musicobject.music = new Sound(_root.musicobject);
_root.musicobject.music.attachSound("TheStormL2");
_root.musicobject.music.setVolume(100 * _global.mainVolume);
_root.musicobject.music.start(0, 99);
_parent.clearInterval(countdownInterval);
_root.totalbonus = 0;
_root.gotoAndStop(58);
_root.onEnterFrame = null;
_root.sky.removeMovieClip();
_root.game.removeMovieClip();
_root.gameoptions.removeMovieClip();
_root.gamestats.removeMovieClip();
_root.options2.removeMovieClip();
_root.pausenow.removeMovieClip();
_root.herodashboard.removeMovieClip();
_root.musicobject.ambience.stop();
var i = 1;
while (i < 10) {
_root["spellAvailability" + i].removeMovieClip();
i++;
}
_root.pausegame = false;
_root.optionslabel.removeMovieClip();
_root.icondescriptions.removeMovieClip();
_root.cuedetails.removeMovieClip();
_root.musicobject2.theme.stop();
_root.musicobject2.removeMovieClip();
_root.musicobject3.drums.stop();
_root.musicobject3.removeMovieClip();
_root.border.removeMovieClip();
_root.endgame.removeMovieClip();
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1740 MovieClip [endgame] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (press) {
if (_root.armorgames) {
getURL ("http://armor.ag/MoreGames", blank);
} else {
getURL ("http://www.goblinarena.com", blank);
}
}
Symbol 1740 MovieClip [endgame] Frame 2
var hours = Math.floor(_root.timecompleted / 3600);
var minutes = (Math.floor(_root.timecompleted / 60) - (hours * 60));
var seconds = ((Math.floor(_root.timecompleted) - (minutes * 60)) - (hours * 3600));
if (hours < 1) {
hours = "00";
} else if (hours < 10) {
hours = "0" + hours;
}
if (minutes < 1) {
minutes = "00";
} else if (minutes < 10) {
minutes = "0" + minutes;
}
if (seconds < 1) {
seconds = "00";
} else if (seconds < 10) {
seconds = "0" + seconds;
}
var formattime = ((((hours + ":") + minutes) + ":") + seconds);
this.gametime = formattime;
Symbol 1790 MovieClip [tutorial] Frame 1
stop();
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1790 MovieClip [tutorial] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.pausegame = false;
_root.pausesign.removeMovieClip();
_root.mmenu.removeMovieClip();
_root.tutorial.removeMovieClip();
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1790 MovieClip [tutorial] Frame 1
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_parent.gotoAndStop(2);
}
Symbol 1790 MovieClip [tutorial] Frame 2
gotoAndStop (3);
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1790 MovieClip [tutorial] Frame 2
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_parent.gotoAndStop(_parent._currentframe + 1);
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1790 MovieClip [tutorial] Frame 2
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.pausegame = false;
_root.pausesign.removeMovieClip();
_root.mmenu.removeMovieClip();
_root.tutorial.removeMovieClip();
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1790 MovieClip [tutorial] Frame 3
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_parent.gotoAndStop(_parent._currentframe - 1);
}
Symbol 1790 MovieClip [tutorial] Frame 4
gotoAndStop (5);
Symbol 1790 MovieClip [tutorial] Frame 9
gotoAndStop (10);
Symbol 1790 MovieClip [tutorial] Frame 10
_root.attachMovie("recruitoptions", "options2", 23);
_root.options2._x = 0;
_root.options2._y = 0;
Symbol 1790 MovieClip [tutorial] Frame 11
_root.attachMovie("uptoweroptions", "options2", 23);
_root.options2._x = 0;
_root.options2._y = 0;
Symbol 1790 MovieClip [tutorial] Frame 12
_root.attachMovie("upunitoptions", "options2", 23);
_root.options2._x = 0;
_root.options2._y = 0;
Symbol 1790 MovieClip [tutorial] Frame 13
_root.attachMovie("spelloptions", "options2", 23);
_root.options2._x = 0;
_root.options2._y = 0;
Symbol 1790 MovieClip [tutorial] Frame 14
_root.attachMovie("herooptions", "options2", 23);
if (_global.chief == "chief4") {
_root.options2.gotoAndStop(4);
} else if (_global.chief == "chief2") {
_root.options2.gotoAndStop(2);
} else if (_global.chief == "chief5") {
_root.options2.gotoAndStop(5);
}
_root.options2._x = 0;
_root.options2._y = 0;
Symbol 1790 MovieClip [tutorial] Frame 16
gotoAndStop (17);
Instance of Symbol 216 MovieClip [menubutton] in Symbol 1790 MovieClip [tutorial] Frame 18
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.pausegame = false;
_root.pausesign.removeMovieClip();
_root.mmenu.removeMovieClip();
_root.tutorial.removeMovieClip();
}
Symbol 1819 MovieClip [backdrop3] Frame 1
stop();
Symbol 1819 MovieClip [backdrop3] Frame 6
stop();
Symbol 1820 MovieClip [explosion1] Frame 16
this.removeMovieClip();
Symbol 1821 MovieClip [explosion3] Frame 16
this.removeMovieClip();
Symbol 1822 MovieClip [firewind] Frame 6
stop();
this.removeMovieClip();
Symbol 1855 MovieClip [dragon] Frame 16
gotoAndPlay (1);
Symbol 1855 MovieClip [dragon] Frame 116
stop();
Symbol 1934 MovieClip [lionrider] Frame 9
gotoAndPlay (1);
Symbol 1934 MovieClip [lionrider] Frame 60
stop();
Symbol 1934 MovieClip [lionrider] Frame 109
stop();
Symbol 1934 MovieClip [lionrider] Frame 168
stop();
Instance of Symbol 1947 MovieClip [goldcoin] in Symbol 1956 MovieClip [gamestats] Frame 1
on (rollOver) {
_root.attachMovie("abilitybox", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 50;
_root.icondescriptions.ability_header.text = "GOLD";
_root.icondescriptions.ability_txt.text = "Use gold to purchase units, unit upgrades and stronghold upgrades. You gain gold through reputation and killiing enemy units";
}
on (rollOut) {
_root.icondescriptions._x = -500;
_root.icondescriptions._y = -500;
}
Instance of Symbol 1189 MovieClip in Symbol 1956 MovieClip [gamestats] Frame 1
on (rollOver) {
_root.attachMovie("abilitybox", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 50;
_root.icondescriptions.ability_header.text = "REPUTATION";
_root.icondescriptions.ability_txt.text = "Reputation increases your regular gold income. Reputation is earned when you kill or lose a unit in close to the enemy's stronghold.";
}
on (rollOut) {
_root.icondescriptions._x = -500;
_root.icondescriptions._y = -500;
}
Instance of Symbol 1952 MovieClip [exp] in Symbol 1956 MovieClip [gamestats] Frame 1
on (rollOver) {
_root.attachMovie("abilitybox", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 50;
_root.icondescriptions.ability_header.text = "EXPERIENCE";
_root.icondescriptions.ability_txt.text = "Experience is needed to unlock units, spells and skills. More experience is earned per kill or unit lost when they are closer to the enemy's stronghold.";
}
on (rollOut) {
_root.icondescriptions._x = -500;
_root.icondescriptions._y = -500;
}
Instance of Symbol 1954 MovieClip in Symbol 1956 MovieClip [gamestats] Frame 1
on (rollOver) {
_root.attachMovie("abilitybox", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 50;
_root.icondescriptions.ability_header.text = "POPULATION";
_root.icondescriptions.ability_txt.text = "The population is the current number of units you have on the battlefiled, total cap is 20 units.";
}
on (rollOut) {
_root.icondescriptions._x = -500;
_root.icondescriptions._y = -500;
}
Symbol 1982 MovieClip [locked2] Frame 1
stop();
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
_root.addtocue(1, "slave");
_root.pausegame = false;
_root.Tip.removeMovieClip();
_global.tip1 = 1;
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Goblin Slave";
_root.icondescriptions.ability_txt.text = ((((((((("Weak Melee Unit - " + _root.slavecost) + " Gold") + newline) + "HP:") + (50 + int((50 * Math.pow(1.1, _root.meleeArmor)) - 50))) + ", Attack:") + (8 + int((8 * Math.pow(1.2, _root.meleeWeapons)) - 8))) + ", Range:Melee") + newline) + "Basic unit";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_root.experience < _root.archerexp) {
} else {
_root.addtocue(1, "archer");
_root.pausegame = false;
_root.Tip.removeMovieClip();
_global.tip2 = 1;
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 290;
_root.icondescriptions.ability_header.text = "Goblin Archer";
if (_root.experience < _root.archerexp) {
_root.icondescriptions.ability_txt.text = ("Goblin Archer[LOCKED] - " + _root.archerexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((((("Light Ranged Unit - " + _root.archercost) + " Gold") + newline) + "HP:") + (40 + int((40 * Math.pow(1.1, _root.rangedArmor)) - 40))) + ", Attack:") + (6 + int((6 * Math.pow(1.2, _root.bowDamage)) - 6))) + ", Range:250") + newline) + "A good early support uni.t";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_root.experience < _root.soldierexp) {
} else {
_root.addtocue(1, "soldier");
_root.pausegame = false;
_root.Tip.removeMovieClip();
_global.tip3 = 1;
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 256;
_root.icondescriptions.ability_header.text = "Goblin Soldier";
if (_root.experience < _root.soldierexp) {
_root.icondescriptions.ability_txt.text = ("Goblin Soldier[LOCKED] - " + _root.soldierexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((((("Light Melee Unit - " + _root.soldiercost) + " Gold") + newline) + "HP:") + (85 + int((85 * Math.pow(1.1, _root.meleeArmor)) - 85))) + ", Attack:") + (11 + int((11 * Math.pow(1.2, _root.meleeWeapons)) - 11))) + ", Range:Melee") + newline) + "Tougher and stronger than Slave";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_root.experience < _root.assasinexp) {
} else {
_root.addtocue(1, "assasin");
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 222;
_root.icondescriptions.ability_header.text = "Goblin Assassin";
if (_root.experience < _root.assasinexp) {
_root.icondescriptions.ability_txt.text = ("Goblin Assassin[LOCKED] - " + _root.assasinexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((((("Light Melee Unit - " + _root.assasincost) + " Gold") + newline) + "HP:") + (100 + int((100 * Math.pow(1.1, _root.meleeArmor)) - 100))) + ", Attack:") + (15 + int((15 * Math.pow(1.2, _root.meleeWeapons)) - 15))) + ", Range:Melee") + newline) + "Faster and stronger than a soldier.";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_root.experience < _root.wizardexp) {
} else {
_root.addtocue(1, "wizard");
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 188;
_root.icondescriptions.ability_header.text = "Goblin Mage";
if (_root.experience < _root.wizardexp) {
_root.icondescriptions.ability_txt.text = ("Goblin Mage[LOCKED] - " + _root.wizardexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((((("Medium Ranged Attack - " + _root.wizardcost) + " Gold") + newline) + "HP:") + (90 + int((90 * Math.pow(1.1, rangedArmor)) - 90))) + ", Attack:") + (12 + int((12 * Math.pow(1.25, _root.fireballSpell)) - 12))) + ", Range:250") + newline) + "Hurls Fireballs against opponents.";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_root.experience < _root.wargriderexp) {
} else {
_root.addtocue(1, "wargrider");
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 154;
_root.icondescriptions.ability_header.text = "Goblin Wolf Rider";
if (_root.experience < _root.wargriderexp) {
_root.icondescriptions.ability_txt.text = ("Goblin Wolf Rider[LOCKED] - " + _root.wargriderexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((((("Heavy Mounted Unit - " + _root.wolfridercost) + " Gold") + newline) + "HP:") + (320 + int((320 * Math.pow(1.1, _root.meleeArmor)) - 320))) + ", Attack:") + (30 + int((30 * Math.pow(1.2, _root.meleeWeapons)) - 30))) + ", Range:Melee") + newline) + "Fortified Armor - High Damage.";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_root.experience < _root.spiderriderexp) {
} else {
_root.addtocue(1, "spiderrider");
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 120;
_root.icondescriptions.ability_header.text = "Goblin Spider Rider";
if (_root.experience < _root.spiderriderexp) {
_root.icondescriptions.ability_txt.text = ("Goblin Spider Rider[LOCKED] - " + _root.spiderriderexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((((("Medium Ranged Unit - " + _root.spiderridercost) + " Gold") + newline) + "HP:") + (220 + int((220 * Math.pow(1.1, _root.rangedArmor)) - 220))) + ", Attack:") + (25 + int((25 * Math.pow(1.2, _root.bowDamage)) - 25))) + ", Range:300") + newline) + "Shoots Poison arrows";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_root.experience < _root.drakeexp) {
} else {
_root.addtocue(1, "drake");
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 52;
_root.icondescriptions.ability_header.text = "Goblin Drake";
if (_root.experience < _root.drakeexp) {
_root.icondescriptions.ability_txt.text = ("Goblin Drake[LOCKED] - " + _root.drakeexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((((("Heavy Ground Unit - " + _root.drakecost) + " Gold") + newline) + "HP:") + (900 + int((900 * Math.pow(1.2, _root.drakeGrow)) - 900))) + ", Attack:") + (35 + int((35 * Math.pow(1.2, _root.drakeGrow)) - 35))) + ", Range:Melee") + newline) + "Grows - More health, Size and Damage";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_global.lionrider > 0) {
if (_root.experience < _root.elitelionriderexp) {
if (_root.experience < _root.lionriderexp) {
} else {
_root.addtocue(1, "lionrider");
}
} else {
_root.addtocue(1, "elitelionrider");
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 86;
_root.icondescriptions.ability_header.text = "Lion Rider";
if (_global.lionrider > 0) {
if (_root.experience < _root.elitelionriderexp) {
if (_root.experience < _root.lionriderexp) {
_root.icondescriptions.ability_txt.text = ("Lion Rider[LOCKED] - " + _root.lionriderexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((("Fast Medium Melee & Light Ranged Unit - " + _root.lionridercost) + " Gold") + newline) + "HP:") + (280 + int((280 * Math.pow(1.1, _root.meleeArmor)) - 280))) + ", Attack:") + (25 + int((25 * Math.pow(1.2, _root.meleeWeapons)) - 25))) + ", Range:250[Shoots while in queue]";
}
} else {
_root.icondescriptions.ability_header.text = "Elite Lion Rider";
_root.icondescriptions.ability_txt.text = ((((((("Fast Strong Melee & Long Ranged Unit - " + _root.elitelionridercost) + " Gold") + newline) + "HP:") + (750 + int((750 * Math.pow(1.1, _root.meleeArmor)) - 750))) + ", Attack:") + (55 + int((55 * Math.pow(1.2, _root.meleeWeapons)) - 55))) + ", Range:250[Shoots while in queue]";
}
} else {
_root.icondescriptions.ability_txt.text = "Lion Rider[LOCKED] - Unit Research Required";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_global.dragonrider > 0) {
if (_root.experience < _root.dragonexp) {
} else {
_root.addtocue(1, "dragon");
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 0;
_root.icondescriptions.ability_header.text = "Dragon Rider";
if (_global.dragonrider > 0) {
if (_root.experience < _root.dragonexp) {
_root.icondescriptions.ability_txt.text = ("Dragon Rider[LOCKED] - " + _root.dragonexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((("Powerful Flying Ranged Unit - " + _root.dragoncost) + " Gold") + newline) + "HP:") + (5000 + int((5000 * Math.pow(1.1, _root.rangedArmor)) - 5000))) + ", Attack:") + (200 + int((200 * Math.pow(1.25, _root.fireballSpell)) - 200))) + ", Range:450";
}
} else {
_root.icondescriptions.ability_txt.text = "Dragon Rider[LOCKED] - Unit Research Required";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_global.troll > 0) {
if (_root.experience < _root.battletrollexp) {
} else {
_root.addtocue(1, "battletroll");
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 0;
_root.icondescriptions.ability_header.text = "Battle Troll";
if (_global.troll > 0) {
if (_root.experience < _root.battletrollexp) {
_root.icondescriptions.ability_txt.text = ("Battle Troll[LOCKED] - " + _root.battletrollexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((("Powerful Ranged Unit - " + _root.battletrollcost) + " Gold") + newline) + "HP:") + (2000 + int((2000 * Math.pow(1.1, _root.rangedArmor)) - 2000))) + ", Attack:") + (125 + int((125 * Math.pow(1.2, _root.bowDamage)) - 125))) + ", Range:300";
}
} else {
_root.icondescriptions.ability_txt.text = "Battle Troll[LOCKED] - Unit Research Required";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 1998 MovieClip [recruitoptions] Frame 1
on (release) {
if (_global.golem > 0) {
if (_root.experience < _root.golemexp) {
} else {
_root.addtocue(1, "golem");
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 20;
_root.icondescriptions.ability_header.text = "Infernal Golem";
if (_global.golem > 0) {
if (_root.experience < _root.golemexp) {
_root.icondescriptions.ability_txt.text = ("Infernal Golem[LOCKED] - " + _root.golemexp) + "XP Required";
} else {
_root.icondescriptions.ability_txt.text = ((((((("Very Tough and Powerful Ground Unit" + _root.golemcost) + " Gold") + newline) + "HP:") + (2000 + int((2000 * Math.pow(1.1, _root.meleeArmor)) - 2000))) + ", Attack:") + (100 + int((100 * Math.pow(1.2, _root.meleeWeapons)) - 100))) + ", Range:Melee";
}
} else {
_root.icondescriptions.ability_txt.text = "Infernal Golem[LOCKED] - Unit Research Required";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2012 MovieClip [uptoweroptions] Frame 1
on (release) {
var oldy = _root.turretSpeed;
switch (_root.turretSpeed) {
case 0 :
if (_global.gold >= (500 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (500 * (1 - (0.05 * _global.masonry)));
_root.turretSpeed++;
}
break;
case 1 :
if (_global.gold >= (1000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (1000 * (1 - (0.05 * _global.masonry)));
_root.turretSpeed++;
}
break;
case 2 :
if (_global.gold >= (2000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (2000 * (1 - (0.05 * _global.masonry)));
_root.turretSpeed++;
}
break;
case 3 :
if (_global.gold >= (4000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (4000 * (1 - (0.05 * _global.masonry)));
_root.turretSpeed++;
}
break;
case 4 :
if (_global.gold >= (8000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (8000 * (1 - (0.05 * _global.masonry)));
_root.turretSpeed++;
}
break;
}
_parent.turretSpeedTxt = _root.turretSpeed;
if (oldy < _root.turretSpeed) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- TOWER UPGRADE ---\rTurret Fire\rRate Increased!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Increase Turret Fire Rate";
switch (_root.turretSpeed) {
case 0 :
_root.icondescriptions.ability_txt.text = Math.round(500 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Turret Fire Rate [+25%]";
break;
case 1 :
_root.icondescriptions.ability_txt.text = Math.round(1000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Turret Fire Rate [+50%]";
break;
case 2 :
_root.icondescriptions.ability_txt.text = Math.round(2000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Turret Fire Rate [+75%]";
break;
case 3 :
_root.icondescriptions.ability_txt.text = Math.round(4000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Turret Fire Rate [+100%]";
break;
case 4 :
_root.icondescriptions.ability_txt.text = Math.round(8000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Turret Fire Rate [+125%]";
break;
default :
_root.icondescriptions.ability_txt.text = "Fire Rate is MAXED OUT";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2012 MovieClip [uptoweroptions] Frame 1
on (release) {
var oldy = _root.turretSize;
switch (_root.turretSize) {
case 0 :
if (_global.gold >= (400 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (400 * (1 - (0.05 * _global.masonry)));
_root.turretSize++;
}
break;
case 1 :
if (_global.gold >= (1000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (1000 * (1 - (0.05 * _global.masonry)));
_root.turretSize++;
}
break;
case 2 :
if (_global.gold >= (2500 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (2500 * (1 - (0.05 * _global.masonry)));
_root.turretSize++;
}
break;
case 3 :
if (_global.gold >= (5000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (5000 * (1 - (0.05 * _global.masonry)));
_root.turretSize++;
}
break;
case 4 :
if (_global.gold >= (10000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (10000 * (1 - (0.05 * _global.masonry)));
_root.turretSize++;
}
break;
}
_parent.turretDamageTxt = _root.turretSize;
if (oldy < _root.turretSize) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- TOWER UPGRADE ---\rTurret Cannonball\rSize Increased!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Increase Size of Canon Balls";
switch (_root.turretSize) {
case 0 :
_root.icondescriptions.ability_txt.text = Math.round(400 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Canon Size (Increased Damage and Radius) [+25%]";
break;
case 1 :
_root.icondescriptions.ability_txt.text = Math.round(1000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Canon Size (Increased Damage and Radius) [+50%]";
break;
case 2 :
_root.icondescriptions.ability_txt.text = Math.round(2500 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Canon Size (Increased Damage and Radius) [+75%]";
break;
case 3 :
_root.icondescriptions.ability_txt.text = Math.round(5000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Canon Size (Increased Damage and Radius) [+100%]";
break;
case 4 :
_root.icondescriptions.ability_txt.text = Math.round(10000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower's Canon Size (Increased Damage and Radius) [+125%]";
break;
default :
_root.icondescriptions.ability_txt.text = "Upgrade Tower's Canon Size is MAXED OUT";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2012 MovieClip [uptoweroptions] Frame 1
on (release) {
var oldy = _root.multiShot;
switch (_root.multiShot) {
case 0 :
if (_global.gold >= (250 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (250 * (1 - (0.05 * _global.masonry)));
_root.multiShot++;
}
break;
case 1 :
if (_global.gold >= (1000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (1000 * (1 - (0.05 * _global.masonry)));
_root.multiShot++;
}
break;
case 2 :
if (_global.gold >= (2500 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (2500 * (1 - (0.05 * _global.masonry)));
_root.multiShot++;
}
break;
case 3 :
if (_global.gold >= (5000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (5000 * (1 - (0.05 * _global.masonry)));
_root.multiShot++;
}
break;
case 4 :
if (_global.gold >= (10000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (10000 * (1 - (0.05 * _global.masonry)));
_root.multiShot++;
}
break;
}
_parent.turretMultiTxt = _root.multiShot;
if (oldy < _root.multiShot) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ("--- TOWER UPGRADE ---\rTurret MultiShot\rNow " + (_root.multiShot + 1)) + " balls!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Increase Turret Number of Canon Balls";
switch (_root.multiShot) {
case 0 :
_root.icondescriptions.ability_txt.text = Math.round(250 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower to fire 2 cannon balls at a time";
break;
case 1 :
_root.icondescriptions.ability_txt.text = Math.round(1000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower to fire 3 cannon balls at a time";
break;
case 2 :
_root.icondescriptions.ability_txt.text = Math.round(2500 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower to fire 4 cannon balls at a time";
break;
case 3 :
_root.icondescriptions.ability_txt.text = Math.round(5000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower to fire 5 cannon balls at a time";
break;
case 4 :
_root.icondescriptions.ability_txt.text = Math.round(10000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower to fire 6 cannon balls at a time";
break;
default :
_root.icondescriptions.ability_txt.text = "Upgrade Tower Multi cannon balls is MAXED OUT";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2012 MovieClip [uptoweroptions] Frame 1
on (release) {
var oldy = _root.towerHP;
switch (_root.towerHP) {
case 0 :
if (_global.gold >= (200 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (200 * (1 - (0.05 * _global.masonry)));
_root.towerHP++;
_root.tower1hp = _root.tower1hp + 500;
_root.tower1hpm = _root.tower1hpm + 500;
}
break;
case 1 :
if (_global.gold >= (1000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (1000 * (1 - (0.05 * _global.masonry)));
_root.towerHP++;
_root.tower1hp = _root.tower1hp + 500;
_root.tower1hpm = _root.tower1hpm + 500;
}
break;
case 2 :
if (_global.gold >= (2500 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (2500 * (1 - (0.05 * _global.masonry)));
_root.towerHP++;
_root.tower1hp = _root.tower1hp + 500;
_root.tower1hpm = _root.tower1hpm + 500;
}
break;
case 3 :
if (_global.gold >= (5000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (5000 * (1 - (0.05 * _global.masonry)));
_root.towerHP++;
_root.tower1hp = _root.tower1hp + 500;
_root.tower1hpm = _root.tower1hpm + 500;
}
break;
case 4 :
if (_global.gold >= (10000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (10000 * (1 - (0.05 * _global.masonry)));
_root.towerHP++;
_root.tower1hp = _root.tower1hp + 500;
_root.tower1hpm = _root.tower1hpm + 500;
}
break;
}
_parent.turretHPTxt = _root.towerHP;
if (oldy < _root.towerHP) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ("--- TOWER UPGRADE ---\rTower HitPoints\rNow " + _root.tower1hpm) + "!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Increase Tower Hit Points";
switch (_root.towerHP) {
case 0 :
_root.icondescriptions.ability_txt.text = Math.round(200 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower Hit Points by +500";
break;
case 1 :
_root.icondescriptions.ability_txt.text = Math.round(1000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower Hit Points by +1000";
break;
case 2 :
_root.icondescriptions.ability_txt.text = Math.round(2500 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower Hit Points by +1500";
break;
case 3 :
_root.icondescriptions.ability_txt.text = Math.round(5000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower Hit Points by +2000";
break;
case 4 :
_root.icondescriptions.ability_txt.text = Math.round(10000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower Hit Points by +2500";
break;
default :
_root.icondescriptions.ability_txt.text = "Upgrade Tower Hit Points is MAXED OUT";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2012 MovieClip [uptoweroptions] Frame 1
on (release) {
var oldy = _root.repairRate;
switch (_root.repairRate) {
case 0 :
if (_global.gold >= (200 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (200 * (1 - (0.05 * _global.masonry)));
_root.repairRate++;
}
break;
case 1 :
if (_global.gold >= (1000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (1000 * (1 - (0.05 * _global.masonry)));
_root.repairRate++;
}
break;
case 2 :
if (_global.gold >= (2500 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (2500 * (1 - (0.05 * _global.masonry)));
_root.repairRate++;
}
break;
case 3 :
if (_global.gold >= (5000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (5000 * (1 - (0.05 * _global.masonry)));
_root.repairRate++;
}
break;
case 4 :
if (_global.gold >= (10000 * (1 - (0.05 * _global.masonry)))) {
_global.gold = _global.gold - (10000 * (1 - (0.05 * _global.masonry)));
_root.repairRate++;
}
break;
}
_parent.repairRateTxt = _root.repairRate;
if (oldy < _root.repairRate) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = ("--- TOWER UPGRADE ---\rTower Repair Rate\rNow " + (_root.repairRate + 1)) + "HP Per Sec!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Increase Tower Repair Rate";
switch (_root.repairRate) {
case 0 :
_root.icondescriptions.ability_txt.text = Math.round(200 * (1 - (0.05 * _global.masonry))) + "P - Upgrade Tower Repair Rate by +1 HP Per Second";
break;
case 1 :
_root.icondescriptions.ability_txt.text = Math.round(1000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower Repair Rate by +2 HP Per Second";
break;
case 2 :
_root.icondescriptions.ability_txt.text = Math.round(2500 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower Repair Rate by +3 HP Per Second";
break;
case 3 :
_root.icondescriptions.ability_txt.text = Math.round(5000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower Repair Rate by +4 HP Per Second";
break;
case 4 :
_root.icondescriptions.ability_txt.text = Math.round(10000 * (1 - (0.05 * _global.masonry))) + "GP - Upgrade Tower Repair Rate by +5 HP Per Second";
break;
default :
_root.icondescriptions.ability_txt.text = "Upgrade Tower Repair Rate is MAXED OUT";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2026 MovieClip [upunitoptions] Frame 1
on (release) {
var oldy = _root.meleeWeapons;
if (_global.gold >= ((((Math.pow(2, _root.meleeWeapons) + 1) + _root.meleeWeapons) * 200) * (1 - (0.05 * _global.training)))) {
_global.gold = _global.gold - ((((Math.pow(2, _root.meleeWeapons) + 1) + _root.meleeWeapons) * 200) * (1 - (0.05 * _global.training)));
_root.meleeWeapons++;
}
_parent.mDamageTxt = _root.meleeWeapons;
if (oldy < _root.meleeWeapons) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- UNIT UPGRADE ---\rMelee Unit\rDamage Increased!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Upgrade Melee Units Attack";
_root.icondescriptions.ability_txt.text = ((Math.round((((Math.pow(2, _root.meleeWeapons) + 1) + _root.meleeWeapons) * 200) * (1 - (0.05 * _global.training))) + "GP - Upgrade Melee Damage [+") + ((_root.meleeWeapons + 1) * 20)) + "%] (Slave, Soldier, Assassin and Worg Rider)";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2026 MovieClip [upunitoptions] Frame 1
on (release) {
var oldy = _root.meleeArmor;
if (_global.gold >= ((((Math.pow(2, _root.meleeArmor) + 1) + _root.meleeArmor) * 200) * (1 - (0.05 * _global.training)))) {
_global.gold = _global.gold - ((((Math.pow(2, _root.meleeArmor) + 1) + _root.meleeArmor) * 200) * (1 - (0.05 * _global.training)));
_root.meleeArmor++;
}
_parent.mArmorTxt = _root.meleeArmor;
if (oldy < _root.meleeArmor) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- UNIT UPGRADE ---\rMelee Unit\rArmor Increased!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Upgrade Melee Unit's Armour";
_root.icondescriptions.ability_txt.text = ((Math.round((((Math.pow(2, _root.meleeArmor) + 1) + _root.meleeArmor) * 200) * (1 - (0.05 * _global.training))) + "GP - Upgrade Melee Armor [+") + ((_root.meleeArmor + 1) * 1.5)) + "] (Slave, Soldier, Assassin and Worg Rider)";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2026 MovieClip [upunitoptions] Frame 1
on (release) {
var oldy = _root.bowDamage;
if (_global.gold >= ((((Math.pow(2, _root.bowDamage) + 1) + _root.bowDamage) * 200) * (1 - (0.05 * _global.training)))) {
_global.gold = _global.gold - ((((Math.pow(2, _root.bowDamage) + 1) + _root.bowDamage) * 200) * (1 - (0.05 * _global.training)));
_root.bowDamage++;
}
_parent.rDamageTxt = _root.bowDamage;
if (oldy < _root.bowDamage) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- UNIT UPGRADE ---\rRanged Unit\rDamage Increased!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Upgrade Ranged Damage(Non-Fire)";
_root.icondescriptions.ability_txt.text = ((Math.round((((Math.pow(2, _root.bowDamage) + 1) + _root.bowDamage) * 200) * (1 - (0.05 * _global.training))) + "GP - Upgrade Ranged Damage [+") + ((_root.bowDamage + 1) * 20)) + "%] (Archer and Spider Rider)";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2026 MovieClip [upunitoptions] Frame 1
on (release) {
var oldy = _root.rangedArmor;
if (_global.gold >= ((((Math.pow(2, _root.rangedArmor) + 1) + _root.rangedArmor) * 200) * (1 - (0.05 * _global.training)))) {
_global.gold = _global.gold - ((((Math.pow(2, _root.rangedArmor) + 1) + _root.rangedArmor) * 200) * (1 - (0.05 * _global.training)));
_root.rangedArmor++;
}
_parent.rArmorTxt = _root.rangedArmor;
if (oldy < _root.rangedArmor) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- UNIT UPGRADE ---\rRanged Unit\rArmor Increased!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Upgrade Ranged Armor";
_root.icondescriptions.ability_txt.text = ((Math.round((((Math.pow(2, _root.rangedArmor) + 1) + _root.rangedArmor) * 200) * (1 - (0.05 * _global.training))) + "GP - Upgrade Ranged Armor [+") + ((_root.rangedArmor + 1) * 1.5)) + "] (Archer, Wizard and Spider Rider)";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2026 MovieClip [upunitoptions] Frame 1
on (release) {
var oldy = _root.fireballSpell;
if (_global.gold >= ((((Math.pow(2, _root.fireballSpell) + 1) + _root.fireballSpell) * 250) * (1 - (0.05 * _global.training)))) {
_global.gold = _global.gold - ((((Math.pow(2, _root.fireballSpell) + 1) + _root.fireballSpell) * 250) * (1 - (0.05 * _global.training)));
_root.fireballSpell++;
}
_parent.fireballTxt = _root.fireballSpell;
if (oldy < _root.fireballSpell) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- UNIT UPGRADE ---\rWizard Unit\rFireball Upgraded!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Upgrade Fire Attacks";
_root.icondescriptions.ability_txt.text = ((Math.round((((Math.pow(2, _root.fireballSpell) + 1) + _root.fireballSpell) * 250) * (1 - (0.05 * _global.training))) + "GP - Upgrade Wizard FireBall and Dragon Breath, Increases: Damage, Blast Radius, Size and Force [+") + ((_root.fireballSpell + 1) * 25)) + "%]";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2026 MovieClip [upunitoptions] Frame 1
on (release) {
var oldy = _root.drakeGrow;
if (_global.gold >= ((((Math.pow(2, _root.drakeGrow) + 1) + _root.drakeGrow) * 1200) * (1 - (0.05 * _global.training)))) {
_global.gold = _global.gold - ((((Math.pow(2, _root.drakeGrow) + 1) + _root.drakeGrow) * 1200) * (1 - (0.05 * _global.training)));
_root.drakeGrow++;
}
_parent.drakeGrowTxt = _root.drakeGrow;
if (oldy < _root.drakeGrow) {
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- UNIT UPGRADE ---\rDrake Unit\rIs More Powerful!";
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Upgrade Drake Greatness(Size)";
_root.icondescriptions.ability_txt.text = ((Math.round((((Math.pow(2, _root.drakeGrow) + 1) + _root.drakeGrow) * 1200) * (1 - (0.05 * _global.training))) + "GP - Great Drake +") + (_root.drakeGrow + 1)) + "1, Increases the Damage, Size, Health and Armor of the Fire Drake";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2026 MovieClip [upunitoptions] Frame 1
on (release) {
if ((_global.gold >= 10000) and (_root.elitelionriderexp > 100000)) {
_global.gold = _global.gold - 10000;
_root.elitelionriderexp = 40000;
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- UNIT UPGRADE ---\rLion Riders are now\rElite Lion Riders!";
_parent.elitetick.gotoAndStop(2);
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Research Elite Lion Riders";
if (_root.elitelionriderexp > 100000) {
_root.icondescriptions.ability_txt.text = "10,000GP - Upgrade Lion Riders to Elite Lion Riders, stronger, faster and more resilient in battle.";
} else {
_root.icondescriptions.ability_txt.text = "Elite Lion Riders is already researched.";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2026 MovieClip [upunitoptions] Frame 1
on (release) {
if ((_global.gold >= 50000) and (_root.shadowdemon2 == false)) {
_global.gold = _global.gold - 50000;
_root.shadowdemon2 = true;
_root.attachMovie("unlockedtxt", "unlockedtxt", 301);
_root.unlockedtxt._x = 200;
_root.unlockedtxt._y = 200;
_root.unlockedtxt.lockedtxt = "--- UNIT UPGRADE ---\rShadow Demon has now become\rInfernal Shadow Demon!";
_parent.demontick.gotoAndStop(2);
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Research Infernal Shadow Demon";
if (_root.shadowdemon2 == false) {
_root.icondescriptions.ability_txt.text = "50,000GP - Upgrade Shadow Demon to Infernal Shadow Demon, stronger, faster and more resilient in battle.";
} else {
_root.icondescriptions.ability_txt.text = "Infernal Shadow Demon is already researched.";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2032 MovieClip [spelloptions] Frame 1
on (release) {
if (_root.mightyfist) {
if (_root.fistcharge < 1) {
_root.pausegame = false;
_root.Tip.removeMovieClip();
_global.tip6 = 1;
_root.fiston = true;
_root.game.attachMovie("mightyfist", "mightyfist", 2222221);
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Mighty Fist";
if (_root.experience >= 10000) {
_root.icondescriptions.ability_txt.text = "Mighty Fist comes down from heaven to smash opponents!";
} else {
_root.icondescriptions.ability_txt.text = "Mighty Fist [LOCKED] - Requires 10,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2032 MovieClip [spelloptions] Frame 1
on (release) {
if (_root.storm) {
if (_root.stormcharge < 1) {
_root.pausegame = false;
_root.Tip.removeMovieClip();
_global.tip7 = 1;
_root.lightningstorm = true;
_root.lightningcount = 0;
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Lightning Storm";
if (_root.experience >= 25000) {
_root.icondescriptions.ability_txt.text = "Calls down a Lighning Storm to create havoc in the enemies ranks!";
} else {
_root.icondescriptions.ability_txt.text = "Lightning Storm [LOCKED] - Requires 25,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2032 MovieClip [spelloptions] Frame 1
on (release) {
if (_root.experience >= 50000) {
if (_root.catapultcharge < 1) {
_root.addtocue(1, "catapult");
_root.catapultcharge = 4000;
_root.pausegame = false;
_root.Tip.removeMovieClip();
_global.tip9 = 1;
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Mighty Battle Catapult";
if (_root.experience >= 50000) {
_root.icondescriptions.ability_txt.text = "Construct and Issue a Mighty Battle Catapult - Attacks Enemy Tower Only!";
} else {
_root.icondescriptions.ability_txt.text = "Mighty Battle Catapult [LOCKED] - Requires 50,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2032 MovieClip [spelloptions] Frame 1
on (release) {
if (_root.experience >= 100000) {
if (_root.shadowdemoncharge < 1) {
_root.addtocue(1, "shadowdemon");
_root.shadowdemoncharge = 5000;
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Summon Shadow Demon";
if (_root.experience >= 100000) {
_root.icondescriptions.ability_txt.text = "Summon Shadow Demon - Powerful being from the afterlife - Strong Melee Unit!";
} else {
_root.icondescriptions.ability_txt.text = "Summon Shadow Demon [LOCKED] - Requires 100,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2032 MovieClip [spelloptions] Frame 1
on (release) {
if (_root.omegafist) {
if (_root.omegafistcharge < 1) {
_root.omegafiston = true;
_root.game.attachMovie("omegafist", "mightyfist", 2222221);
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Omega Fist";
if (_root.experience >= 200000) {
_root.icondescriptions.ability_txt.text = "Omega Fist comes down from heaven [10x More Powerful than Mighty Fist]";
} else {
_root.icondescriptions.ability_txt.text = "Omega Fist [LOCKED] - Requires 200,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2032 MovieClip [spelloptions] Frame 1
on (release) {
if (_global.meteor > 0) {
if (_root.meteor) {
if (_root.meteorcharge < 1) {
_root.meteorstorm = true;
_root.meteorcount = 0;
}
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Meteor Storm";
if (_global.meteor > 0) {
if (_root.experience >= 300000) {
_root.icondescriptions.ability_txt.text = "Ultimate Defense Hail of Meteors on your half of the field";
} else {
_root.icondescriptions.ability_txt.text = "Meteor Storm [LOCKED] - Requires 300,000 Experience";
}
} else {
_root.icondescriptions.ability_txt.text = "Meteor Storm [LOCKED] - Requires Spell Research";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2032 MovieClip [spelloptions] Frame 1
on (release) {
if (_global.grow > 0) {
if (_root.grow) {
if (_root.growcharge < 1) {
_root.growon = true;
_root.growcount = 0;
_root.game.attachMovie("growspell", "growspell", 2222221);
}
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Grow Spell";
if (_global.grow > 0) {
if (_root.experience >= 150000) {
_root.icondescriptions.ability_txt.text = "Grow Spell - Increases the attack, health and size of your units.";
} else {
_root.icondescriptions.ability_txt.text = "Grow Spell [LOCKED] - Requires 150,000 Experience";
}
} else {
_root.icondescriptions.ability_txt.text = "Grow Spell [LOCKED] - Requires Speal Research";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2032 MovieClip [spelloptions] Frame 1
on (release) {
if (_global.bloodlust > 0) {
if (_root.bloodlustcharge < 1) {
_root.bloodlusttimer = 1000;
_root.bloodluston = true;
_root.bloodlustcharge = 6000;
_root.game.attachMovie("bloodlustspell", "bloodlustspell", 12601);
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Blood Lust";
if (_global.bloodlust > 0) {
if (_root.experience >= 75000) {
_root.icondescriptions.ability_txt.text = "Blood Lust Spell - Increases the attack damage of all your units temporarily.";
} else {
_root.icondescriptions.ability_txt.text = "Blood Lust Spell [LOCKED] - Requires 75,000 Experience";
}
} else {
_root.icondescriptions.ability_txt.text = "Blood Lust Spell [LOCKED] - Requires Spell Research";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2032 MovieClip [spelloptions] Frame 1
on (release) {
if (_global.heal > 0) {
if (_root.healcharge < 1) {
_root.healtimer = 1000;
_root.healon = true;
_root.healcharge = 6000;
_root.game.attachMovie("healspell", "healspell", 12602);
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Heal Spell";
if (_global.heal > 0) {
if (_root.experience >= 40000) {
_root.icondescriptions.ability_txt.text = "Heal Spell - Heals all your units +50hp per second.";
} else {
_root.icondescriptions.ability_txt.text = "Heal Spell [LOCKED] - Requires 40,000 Experience";
}
} else {
_root.icondescriptions.ability_txt.text = "Heal Spell [LOCKED] - Requires Spell Research";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Symbol 2052 MovieClip [herooptions] Frame 1
stop();
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 1
on (release) {
if (_root.heroflee) {
_root.char[_root.heronumber].xspeed = -_root.char[_root.heronumber].xspeed;
_root.game["unit" + _root.heronumber]._xscale = -90;
_root.game["unit" + _root.heronumber].gotoAndPlay(1);
_root.heroflee = false;
} else if (_root.rivival < 1) {
_root.createunit(1, "hero");
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Release Hero to Battle";
if (_root.experience > 6000) {
_root.icondescriptions.ability_txt.text = "Call clan chief to come out to battle!";
} else {
_root.icondescriptions.ability_txt.text = "Clan Chief [LOCKED] - 6000XP Required";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 1
on (release) {
_root.fleeing(1);
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Recall Hero to Tower";
_root.icondescriptions.ability_txt.text = "Hero will begin the journey back to the tower to rest until ready to fight again";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 1
on (release) {
if (_root.stompdown < 1) {
_root.herostomp();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Battle Slam";
if (_root.herolvl > 1) {
_root.icondescriptions.ability_txt.text = "Hero will slam the ground stunning all nearby ground enemy units and doing 50hp damage.";
} else {
_root.icondescriptions.ability_txt.text = "Battle Slam [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 1
on (release) {
if (_root.knockon < 1) {
_root.Knocking();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Knock Back";
if (_root.herolvl > 2) {
_root.icondescriptions.ability_txt.text = "Knock Back - For a short time the hero can smash their oppenents into the air or down to the ground";
} else {
_root.icondescriptions.ability_txt.text = "Knock Back [LOCKED] - Requires a Level 3 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 1
on (release) {
if (_root.furyfirecharge < 1) {
_root.furyfirecount = 500;
_root.furyfirecharge = 3000;
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Fury Fire";
if (_root.herolvl > 3) {
_root.icondescriptions.ability_txt.text = "Fury Fire - Hero shoots rapid fireballs for a short time!";
} else {
_root.icondescriptions.ability_txt.text = "Fury Fire [LOCKED] - Requires a Level 4 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 2
on (release) {
if (_root.shieldon < 1) {
_root.shielding();
}
}
on (rollOver) {
_root.attachMovie("optionslabel", "optionslabel", 24);
_root.optionslabel._x = 15;
_root.optionslabel._y = 420;
if (_root.herolvl > 1) {
_root.optionslabel.olabel = "Makes the hero invunerable to all attack damage for a short time.";
} else {
_root.optionslabel.olabel = "Invincibility [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.optionslabel.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 2
on (release) {
if (_root.bloodon < 1) {
_root.bloodlusting();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Blood Lust";
if (_root.herolvl > 2) {
_root.icondescriptions.ability_txt.text = "Blood Lust - Hero is filled with anger, they moves faster and attacks increase in damage!";
} else {
_root.icondescriptions.ability_txt.text = "Blood Lust [LOCKED] - Requires a Level 3 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 3
on (release) {
if (_root.stompdown < 1) {
_root.herostomp();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Battle Slam";
if (_root.herolvl > 1) {
_root.icondescriptions.ability_txt.text = "Hero will slam the ground stunning all nearby ground enemy units and doing 50hp damage.";
} else {
_root.icondescriptions.ability_txt.text = "Battle Slam [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 4
on (release) {
if (_root.morphon < 1) {
_root.morphing();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Lion Morph";
if (_root.herolvl > 2) {
_root.icondescriptions.ability_header.text = "Lion Morph - Faster Attacking and Speed, Does more damage but takes more Damage aswell!";
} else {
_root.icondescriptions.ability_header.text = "Lion Morph [LOCKED] - Requires a Level 3 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 5
on (release) {
if (_root.bladefurry < 1) {
_root.bladefurryon = true;
_root.bladefurrycount = 500;
_root.bladefurry = 1500;
}
}
on (rollOver) {
_root.attachMovie("optionslabel", "optionslabel", 24);
_root.optionslabel._x = 15;
_root.optionslabel._y = 420;
if (_root.herolvl > 1) {
_root.optionslabel.olabel = "Blade Whirl - Significantly Increase Hero Attack Rate!";
} else {
_root.optionslabel.olabel = "Blade Whirl [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.optionslabel.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 5
on (release) {
if (_root.bloodon < 1) {
_root.bloodlusting();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Blood Lust";
if (_root.herolvl > 2) {
_root.icondescriptions.ability_txt.text = "Blood Lust - Hero is filled with anger, they moves faster and attacks increase in damage!";
} else {
_root.icondescriptions.ability_txt.text = "Blood Lust [LOCKED] - Requires a Level 3 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 5
on (release) {
if (_root.furyfirecharge < 1) {
_root.furyfirecount = 500;
_root.furyfirecharge = 3000;
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Flying Blades";
if (_root.herolvl > 3) {
_root.icondescriptions.ability_txt.text = "Flying Blades - Hero throws razor sharp spinning blades in rapid succession!";
} else {
_root.icondescriptions.ability_txt.text = "Flying Blades [LOCKED] - Requires a Level 4 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 6
on (release) {
if (_root.stompdown < 1) {
_root.herostomp();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Battle Slam";
if (_root.herolvl > 1) {
_root.icondescriptions.ability_txt.text = "Hero will slam the ground stunning all nearby ground enemy units and doing 50hp damage.";
} else {
_root.icondescriptions.ability_txt.text = "Battle Slam [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2052 MovieClip [herooptions] Frame 6
on (release) {
if (_root.furyfirecharge < 1) {
_root.furyfirecount = 500;
_root.furyfirecharge = 3000;
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Fury Fire";
if (_root.herolvl > 3) {
_root.icondescriptions.ability_txt.text = "Fury Fire - Hero shoots rapid fireballs for a short time!";
} else {
_root.icondescriptions.ability_txt.text = "Fury Fire [LOCKED] - Requires a Level 4 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Symbol 2062 MovieClip [herooptionsdash] Frame 1
stop();
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 1
on (release) {
if (_root.stompdown < 1) {
_root.herostomp();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Battle Slam";
if (_root.herolvl > 1) {
_root.icondescriptions.ability_txt.text = "Hero will slam the ground stunning all nearby ground enemy units and doing 50hp damage.";
} else {
_root.icondescriptions.ability_txt.text = "Battle Slam [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 1
on (release) {
if (_root.knockon < 1) {
_root.Knocking();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Knock Back";
if (_root.herolvl > 2) {
_root.icondescriptions.ability_txt.text = "Knock Back - For a short time the hero can smash their oppenents into the air or down to the ground";
} else {
_root.icondescriptions.ability_txt.text = "Knock Back [LOCKED] - Requires a Level 3 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 1
on (release) {
if (_root.furyfirecharge < 1) {
_root.furyfirecount = 500;
_root.furyfirecharge = 3000;
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Fury Fire";
if (_root.herolvl > 3) {
_root.icondescriptions.ability_txt.text = "Fury Fire - Hero shoots rapid fireballs for a short time!";
} else {
_root.icondescriptions.ability_txt.text = "Fury Fire [LOCKED] - Requires a Level 4 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 2
on (release) {
if (_root.shieldon < 1) {
_root.shielding();
}
}
on (rollOver) {
_root.attachMovie("optionslabel", "optionslabel", 24);
_root.optionslabel._x = 15;
_root.optionslabel._y = 420;
if (_root.herolvl > 1) {
_root.optionslabel.olabel = "Makes the hero invunerable to all attack damage for a short time.";
} else {
_root.optionslabel.olabel = "Invincibility [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.optionslabel.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 2
on (release) {
if (_root.bloodon < 1) {
_root.bloodlusting();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Blood Lust";
if (_root.herolvl > 2) {
_root.icondescriptions.ability_txt.text = "Blood Lust - Hero is filled with anger, they moves faster and attacks increase in damage!";
} else {
_root.icondescriptions.ability_txt.text = "Blood Lust [LOCKED] - Requires a Level 3 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 3
on (release) {
if (_root.stompdown < 1) {
_root.herostomp();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Battle Slam";
if (_root.herolvl > 1) {
_root.icondescriptions.ability_txt.text = "Hero will slam the ground stunning all nearby ground enemy units and doing 50hp damage.";
} else {
_root.icondescriptions.ability_txt.text = "Battle Slam [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 4
on (release) {
if (_root.morphon < 1) {
_root.morphing();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Lion Morph";
if (_root.herolvl > 2) {
_root.icondescriptions.ability_header.text = "Lion Morph - Faster Attacking and Speed, Does more damage but takes more Damage aswell!";
} else {
_root.icondescriptions.ability_header.text = "Lion Morph [LOCKED] - Requires a Level 3 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 5
on (release) {
if (_root.bladefurry < 1) {
_root.bladefurryon = true;
_root.bladefurrycount = 500;
_root.bladefurry = 1500;
}
}
on (rollOver) {
_root.attachMovie("optionslabel", "optionslabel", 24);
_root.optionslabel._x = 15;
_root.optionslabel._y = 420;
if (_root.herolvl > 1) {
_root.optionslabel.olabel = "Blade Whirl - Significantly Increase Hero Attack Rate!";
} else {
_root.optionslabel.olabel = "Blade Whirl [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.optionslabel.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 5
on (release) {
if (_root.bloodon < 1) {
_root.bloodlusting();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Blood Lust";
if (_root.herolvl > 2) {
_root.icondescriptions.ability_txt.text = "Blood Lust - Hero is filled with anger, they moves faster and attacks increase in damage!";
} else {
_root.icondescriptions.ability_txt.text = "Blood Lust [LOCKED] - Requires a Level 3 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 5
on (release) {
if (_root.furyfirecharge < 1) {
_root.furyfirecount = 500;
_root.furyfirecharge = 3000;
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Flying Blades";
if (_root.herolvl > 3) {
_root.icondescriptions.ability_txt.text = "Flying Blades - Hero throws razor sharp spinning blades in rapid succession!";
} else {
_root.icondescriptions.ability_txt.text = "Flying Blades [LOCKED] - Requires a Level 4 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 6
on (release) {
if (_root.stompdown < 1) {
_root.herostomp();
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Battle Slam";
if (_root.herolvl > 1) {
_root.icondescriptions.ability_txt.text = "Hero will slam the ground stunning all nearby ground enemy units and doing 50hp damage.";
} else {
_root.icondescriptions.ability_txt.text = "Battle Slam [LOCKED] - Requires a Level 2 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2062 MovieClip [herooptionsdash] Frame 6
on (release) {
if (_root.furyfirecharge < 1) {
_root.furyfirecount = 500;
_root.furyfirecharge = 3000;
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Fury Fire";
if (_root.herolvl > 3) {
_root.icondescriptions.ability_txt.text = "Fury Fire - Hero shoots rapid fireballs for a short time!";
} else {
_root.icondescriptions.ability_txt.text = "Fury Fire [LOCKED] - Requires a Level 4 Hero";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2063 MovieClip [herodashboard] Frame 1
on (release) {
if (_root.heroflee) {
_root.char[_root.heronumber].xspeed = -_root.char[_root.heronumber].xspeed;
_root.game["unit" + _root.heronumber]._xscale = -90;
_root.game["unit" + _root.heronumber].gotoAndPlay(1);
_root.heroflee = false;
} else if (_root.rivival < 1) {
_root.createunit(1, "hero");
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Release Hero to Battle";
if (_root.experience > 6000) {
_root.icondescriptions.ability_txt.text = "Call clan chief to come out to battle!";
} else {
_root.icondescriptions.ability_txt.text = "Clan Chief [LOCKED] - 6000XP Required";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2063 MovieClip [herodashboard] Frame 1
on (release) {
_root.fleeing(1);
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Recall Hero to Tower";
_root.icondescriptions.ability_txt.text = "Hero will begin the journey back to the tower to rest until ready to fight again";
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Symbol 2153 MovieClip [chief4] Frame 20
gotoAndPlay (1);
Symbol 2153 MovieClip [chief4] Frame 61
stop();
Symbol 2153 MovieClip [chief4] Frame 111
stop();
Symbol 2210 MovieClip [chief4b] Frame 9
gotoAndPlay (1);
Symbol 2210 MovieClip [chief4b] Frame 61
stop();
Symbol 2210 MovieClip [chief4b] Frame 109
stop();
Symbol 2286 MovieClip [battletroll] Frame 17
gotoAndPlay (1);
Symbol 2286 MovieClip [battletroll] Frame 60
stop();
Symbol 2286 MovieClip [battletroll] Frame 108
stop();
Symbol 2286 MovieClip [battletroll] Frame 161
stop();
Symbol 2407 MovieClip [chief5] Frame 12
gotoAndPlay (1);
Symbol 2407 MovieClip [chief5] Frame 63
stop();
Symbol 2407 MovieClip [chief5] Frame 116
stop();
Symbol 2407 MovieClip [chief5] Frame 169
gotoAndStop (64);
Symbol 2489 MovieClip [chief6] Frame 11
gotoAndPlay (1);
Symbol 2489 MovieClip [chief6] Frame 66
stop();
Symbol 2489 MovieClip [chief6] Frame 113
stop();
Symbol 2601 MovieClip [golem] Frame 24
gotoAndPlay (1);
Symbol 2601 MovieClip [golem] Frame 71
stop();
Symbol 2601 MovieClip [golem] Frame 111
atop();
Symbol 2660 MovieClip [meteor] Frame 1
play();
play();
Symbol 2667 MovieClip [spinningblade] Frame 1
hb._visible = false;
Symbol 2672 MovieClip [poisonwind] Frame 6
stop();
this.removeMovieClip();
Symbol 2696 MovieClip [wingeddemon] Frame 16
gotoAndPlay (1);
Symbol 2696 MovieClip [wingeddemon] Frame 57
stop();
Symbol 2696 MovieClip [wingeddemon] Frame 106
stop();
Symbol 2764 MovieClip [UndeadKnight] Frame 10
gotoAndPlay (2);
Symbol 2764 MovieClip [UndeadKnight] Frame 63
stop();
Symbol 2764 MovieClip [UndeadKnight] Frame 111
stop();
Symbol 2805 MovieClip [ChampionKnight] Frame 13
gotoAndPlay (1);
Symbol 2805 MovieClip [ChampionKnight] Frame 58
stop();
Symbol 2805 MovieClip [ChampionKnight] Frame 105
stop();
Instance of Symbol 216 MovieClip [menubutton] in Symbol 2984 MovieClip [Tip] Frame 2
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_root.pausegame = false;
_parent.removeMovieClip();
}
Instance of Symbol 503 MovieClip [tickbox] "ms" in Symbol 2984 MovieClip [Tip] Frame 2
on (release) {
if (_global.tips == true) {
this.gotoAndStop(3);
_global.tips = false;
} else {
this.gotoAndStop(2);
_global.tips = true;
}
}
Instance of Symbol 544 MovieClip in Symbol 2984 MovieClip [Tip] Frame 12
on (press) {
getURL ("http://www.goblinarena.com/clan-wars-2-return-of-the-humans.php", blank);
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 2984 MovieClip [Tip] Frame 12
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_parent.gotoAndStop(13);
}
Instance of Symbol 2971 MovieClip "gametitlepic2" in Symbol 2984 MovieClip [Tip] Frame 13
on (press) {
getURL ("http://www.goblinarena.com/clan-wars-2-return-of-the-humans.php", blank);
}
Instance of Symbol 216 MovieClip [menubutton] in Symbol 2984 MovieClip [Tip] Frame 13
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (release) {
_parent.removeMovieClip();
}
Symbol 2990 MovieClip [spellAvailability] Frame 1
stop();
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2990 MovieClip [spellAvailability] Frame 1
on (release) {
if (_root.omegafist) {
if (_root.omegafistcharge < 1) {
_root.omegafiston = true;
_root.game.attachMovie("omegafist", "mightyfist", 2222221);
_root.icondescriptions.removeMovieClip();
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Omega Fist";
if (_root.experience >= 200000) {
_root.icondescriptions.ability_txt.text = "Omega Fist comes down from heaven [10x More Powerful than Mighty Fist]";
} else {
_root.icondescriptions.ability_txt.text = "Omega Fist [LOCKED] - Requires 200,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2990 MovieClip [spellAvailability] Frame 2
on (release) {
if (_root.experience >= 100000) {
if (_root.shadowdemoncharge < 1) {
_root.addtocue(1, "shadowdemon");
_root.shadowdemoncharge = 5000;
_root.icondescriptions.removeMovieClip();
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Summon Shadow Demon";
if (_root.experience >= 100000) {
_root.icondescriptions.ability_txt.text = "Summon Shadow Demon - Powerful being from the afterlife - Strong Melee Unit!";
} else {
_root.icondescriptions.ability_txt.text = "Summon Shadow Demon [LOCKED] - Requires 100,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2990 MovieClip [spellAvailability] Frame 3
on (release) {
if (_root.experience >= 50000) {
if (_root.catapultcharge < 1) {
_root.addtocue(1, "catapult");
_root.catapultcharge = 4000;
_root.pausegame = false;
_root.Tip.removeMovieClip();
_global.tip9 = 1;
_root.icondescriptions.removeMovieClip();
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Mighty Battle Catapult";
if (_root.experience >= 50000) {
_root.icondescriptions.ability_txt.text = "Construct and Issue a Mighty Battle Catapult - Attacks Enemy Tower Only!";
} else {
_root.icondescriptions.ability_txt.text = "Mighty Battle Catapult [LOCKED] - Requires 50,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2990 MovieClip [spellAvailability] Frame 4
on (release) {
if (_root.storm) {
if (_root.stormcharge < 1) {
_root.pausegame = false;
_root.Tip.removeMovieClip();
_global.tip7 = 1;
_root.lightningstorm = true;
_root.lightningcount = 0;
_root.icondescriptions.removeMovieClip();
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Lightning Storm";
if (_root.experience >= 25000) {
_root.icondescriptions.ability_txt.text = "Calls down a Lighning Storm to create havoc in the enemies ranks!";
} else {
_root.icondescriptions.ability_txt.text = "Lightning Storm [LOCKED] - Requires 25,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2990 MovieClip [spellAvailability] Frame 5
on (release) {
if (_root.mightyfist) {
if (_root.fistcharge < 1) {
_root.pausegame = false;
_root.Tip.removeMovieClip();
_global.tip6 = 1;
_root.fiston = true;
_root.game.attachMovie("mightyfist", "mightyfist", 2222221);
_root.icondescriptions.removeMovieClip();
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Mighty Fist";
if (_root.experience >= 10000) {
_root.icondescriptions.ability_txt.text = "Mighty Fist comes down from heaven to smash opponents!";
} else {
_root.icondescriptions.ability_txt.text = "Mighty Fist [LOCKED] - Requires 10,000 Experience";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2990 MovieClip [spellAvailability] Frame 6
on (release) {
if (_global.meteor > 0) {
if (_root.meteor) {
if (_root.meteorcharge < 1) {
_root.meteorstorm = true;
_root.meteorcount = 0;
_root.icondescriptions.removeMovieClip();
}
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Meteor Storm";
if (_global.meteor > 0) {
if (_root.experience >= 300000) {
_root.icondescriptions.ability_txt.text = "Ultimate Defense Hail of Meteors on your half of the field";
} else {
_root.icondescriptions.ability_txt.text = "Meteor Storm [LOCKED] - Requires 300,000 Experience";
}
} else {
_root.icondescriptions.ability_txt.text = "Meteor Storm [LOCKED] - Requires Spell Research";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2990 MovieClip [spellAvailability] Frame 7
on (release) {
if (_global.grow > 0) {
if (_root.grow) {
if (_root.growcharge < 1) {
_root.growon = true;
_root.growcount = 0;
_root.game.attachMovie("growspell", "growspell", 2222221);
_root.icondescriptions.removeMovieClip();
}
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Grow Spell";
if (_global.grow > 0) {
if (_root.experience >= 150000) {
_root.icondescriptions.ability_txt.text = "Grow Spell - Increases the attack, health and size of your units.";
} else {
_root.icondescriptions.ability_txt.text = "Grow Spell [LOCKED] - Requires 150,000 Experience";
}
} else {
_root.icondescriptions.ability_txt.text = "Grow Spell [LOCKED] - Requires Speal Research";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2990 MovieClip [spellAvailability] Frame 8
on (release) {
if (_global.bloodlust > 0) {
if (_root.bloodlustcharge < 1) {
_root.bloodlusttimer = 1000;
_root.bloodluston = true;
_root.bloodlustcharge = 6000;
_root.game.attachMovie("bloodlustspell", "bloodlustspell", 12601);
_root.icondescriptions.removeMovieClip();
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Blood Lust";
if (_global.bloodlust > 0) {
if (_root.experience >= 75000) {
_root.icondescriptions.ability_txt.text = "Blood Lust Spell - Increases the attack damage of all your units temporarily.";
} else {
_root.icondescriptions.ability_txt.text = "Blood Lust Spell [LOCKED] - Requires 75,000 Experience";
}
} else {
_root.icondescriptions.ability_txt.text = "Blood Lust Spell [LOCKED] - Requires Spell Research";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Instance of Symbol 1164 MovieClip [gamebutton] in Symbol 2990 MovieClip [spellAvailability] Frame 9
on (release) {
if (_global.heal > 0) {
if (_root.healcharge < 1) {
_root.healtimer = 1000;
_root.healon = true;
_root.healcharge = 6000;
_root.game.attachMovie("healspell", "healspell", 12602);
_root.icondescriptions.removeMovieClip();
}
}
}
on (rollOver) {
_root.attachMovie("abilitybox2", "icondescriptions", 77777);
_root.icondescriptions._x = 50;
_root.icondescriptions._y = 335;
_root.icondescriptions.ability_header.text = "Heal Spell";
if (_global.heal > 0) {
if (_root.experience >= 40000) {
_root.icondescriptions.ability_txt.text = "Heal Spell - Heals all your units +50hp per second.";
} else {
_root.icondescriptions.ability_txt.text = "Heal Spell [LOCKED] - Requires 40,000 Experience";
}
} else {
_root.icondescriptions.ability_txt.text = "Heal Spell [LOCKED] - Requires Spell Research";
}
}
on (rollOut) {
_root.icondescriptions.removeMovieClip();
}
Symbol 2991 MovieClip [starsparkle] Frame 2
var xstr = [];
var ystr = [];
var galpha = 100;
var limit = [];
var i = 0;
while (i < 15) {
this.attachMovie("star_mc", "bp" + i, 10000 + i);
xstr[i] = (Math.random() * 6) - 3;
ystr[i] = Math.random() * 4;
limit[i] = (Math.random() * 120) + 150;
this["bp" + i]._x = (Math.random() * 6) - 3;
this["bp" + i]._y = (Math.random() * 8) + 8;
this["bp" + i]._xscale = (Math.random() * 600) + 300;
this["bp" + i]._yscale = (Math.random() * 600) + 300;
i++;
}
Symbol 2991 MovieClip [starsparkle] Frame 4
if (galpha > 1) {
galpha = galpha - 2;
var i = 0;
while (i < 15) {
if (this["bp" + i]._y < limit[i]) {
this["bp" + i]._x = this["bp" + i]._x + xstr[i];
this["bp" + i]._y = this["bp" + i]._y - ystr[i];
this["bp" + i]._rotation = this["bp" + i]._rotation + 5;
ystr[i] = ystr[i] - 0.4;
}
this["bp" + i]._alpha = galpha;
i++;
}
gotoAndPlay (3);
} else {
this.swapDepths(1);
var i = 0;
while (i < 15) {
this["bp" + i].swapDepths(1);
this["bp" + i].removeMovieClip();
this["bp" + i].removeMovieClip();
i++;
}
this.removeMovieClip();
gotoAndStop (1);
}
Symbol 3021 MovieClip [selectlevel] Frame 1
stop();
Symbol 3024 MovieClip [selectlevel2] Frame 1
stop();
Symbol 3051 MovieClip [levelscreenshot] Frame 1
stop();
Symbol 3074 MovieClip [icon_wisdom] Frame 2
stop();
Symbol 3078 MovieClip [icon_presence] Frame 2
stop();
Symbol 3080 MovieClip [icon_criticalstrike] Frame 2
stop();
Symbol 3083 MovieClip [icon_heroxpgain] Frame 2
stop();
Symbol 3086 MovieClip [icon_vampire] Frame 2
stop();
Symbol 3105 MovieClip [icon_health] Frame 2
stop();
Symbol 3106 MovieClip [icon_assassin] Frame 2
stop();
Symbol 3107 MovieClip [icon_lionrider] Frame 2
stop();
Symbol 3108 MovieClip [icon_dragonrider] Frame 2
stop();
Symbol 3109 MovieClip [icon_troll] Frame 2
stop();
Symbol 3110 MovieClip [icon_golem] Frame 2
stop();
Symbol 3111 MovieClip [icon_fistresearch] Frame 2
stop();
Symbol 3112 MovieClip [icon_grow] Frame 2
stop();
Symbol 3113 MovieClip [icon_meteor] Frame 2
stop();
Symbol 3114 MovieClip [icon_bloodlust] Frame 2
stop();
Symbol 3115 MovieClip [icon_heal] Frame 2
stop();