Frame 1
function simpanData() {
sudahMain = true;
Cookies = SharedObject.getLocal("theHutDefenseGame");
i = 1;
while (i <= simpanSemua.length) {
Cookies.data["hutDefenseData" + i] = eval (simpanSemua[i]);
i++;
}
Cookies.flush();
}
function loadData() {
Cookies = SharedObject.getLocal("theHutDefenseGame");
i = 1;
while (i <= simpanSemua.length) {
_root[simpanSemua[i]] = Cookies.data["hutDefenseData" + i];
i++;
}
Cookies.flush();
}
function initData() {
coinKe = 0;
manaKe = 200;
expKe = 0;
pilihGubug = 1;
speedKini = 1;
posisiWorldMap = 1;
xposisiWorldMap = 1;
totalKalah = 0;
posisiMenang = true;
i = 1;
while (i <= 61) {
_root["menangGubug" + i] = false;
_root["aktifGubug" + i] = false;
i++;
}
_root.aktifGubug1 = true;
_root.aktifGubug5 = true;
_root.aktifGubug9 = true;
_root.aktifGubug13 = true;
_root.aktifGubug17 = true;
_root.aktifGubug22 = true;
_root.aktifGubug27 = true;
_root.aktifGubug32 = true;
_root.aktifGubug37 = true;
_root.aktifGubug42 = true;
_root.aktifGubug47 = true;
_root.aktifGubug52 = true;
_root.aktifGubug57 = true;
_root.aktifGubug58 = true;
_root.aktifGubug59 = true;
_root.aktifGubug60 = true;
levelManaPlus = 0;
levelMoneyPlus = 0;
levelExpPlus = 0;
levelBasePlus = 0;
levelRecoveryPlus = 0;
levelDelayPlus = 0;
levelHutPlus = 0;
levelLifePlus = 0;
levelEnemyPlus = 0;
levelDamagePlus = 0;
levelTreasurePlus = 0;
levelCavePlus = 0;
levelSpellPlus = 0;
levelCriticalPlus = 0;
levelSpeedPlus = 0;
levelArmorPlus = 0;
levelStrikePlus = 0;
levelSlowPlus = 0;
levelLuckPlus = 0;
levelRangePlus = 0;
levelUnit1 = 1;
levelUnit2 = 1;
levelUnit3 = 0;
levelUnit4 = 0;
levelUnit5 = 0;
levelUnit6 = 0;
levelUnit7 = 0;
levelUnit8 = 0;
levelUnit9 = 0;
kiniExp1 = 0;
kiniExp2 = 0;
kiniExp3 = 0;
kiniExp4 = 0;
kiniExp5 = 0;
kiniExp6 = 0;
kiniExp7 = 0;
kiniExp8 = 0;
kiniExp9 = 0;
maxExp1 = 200;
maxExp2 = 250;
maxExp3 = 300;
maxExp4 = 350;
maxExp5 = 400;
maxExp6 = 450;
maxExp7 = 500;
maxExp8 = 550;
maxExp9 = 600;
levelSpell1 = 0;
levelSpell2 = 0;
levelSpell3 = 0;
levelSpell4 = 0;
levelSpell5 = 0;
levelSpell6 = 0;
levelSpell7 = 0;
levelSpell8 = 0;
levelSpell9 = 0;
levelSpell10 = 0;
levelHut = 1;
levelTower = 0;
levelCave = 0;
maxHutCapacity1 = 50;
maxHutCapacity2 = 100;
maxHutCapacity3 = 150;
maxHutCapacity1 = Math.ceil(maxHutCapacity1);
maxHutCapacity2 = Math.ceil(maxHutCapacity2);
maxHutCapacity3 = Math.ceil(maxHutCapacity3);
xmaxHutCapacity1 = 50;
xmaxHutCapacity2 = 100;
xmaxHutCapacity3 = 150;
xmaxHutCapacity1 = Math.ceil(xmaxHutCapacity1);
xmaxHutCapacity2 = Math.ceil(xmaxHutCapacity2);
xmaxHutCapacity3 = Math.ceil(xmaxHutCapacity3);
towerDamage1 = 200;
towerDamage2 = 800;
towerDamage3 = 1600;
xtowerDamage1 = 200;
xtowerDamage2 = 800;
xtowerDamage3 = 1600;
maxCaveCapacity7 = 50;
maxCaveCapacity8 = 75;
maxCaveCapacity7 = Math.ceil(maxCaveCapacity7);
maxCaveCapacity8 = Math.ceil(maxCaveCapacity8);
xmaxCaveCapacity7 = 50;
xmaxCaveCapacity8 = 75;
xmaxCaveCapacity7 = Math.ceil(xmaxCaveCapacity7);
xmaxCaveCapacity8 = Math.ceil(xmaxCaveCapacity8);
magicPunya1 = 0;
magicPunya2 = 0;
magicPunya3 = 0;
magicPunya4 = 0;
magicPunya5 = 0;
magicPunya6 = 0;
magicPunya7 = 0;
magicPunya8 = 0;
magicPunya9 = 0;
magicPunya10 = 0;
magicPunya11 = 0;
magicPunya12 = 0;
dapatMedal1 = false;
dapatMedal2 = false;
dapatMedal3 = false;
dapatMedal4 = false;
dapatMedal5 = false;
dapatMedal6 = false;
dapatMedal7 = false;
dapatMedal8 = false;
dapatMedal9 = false;
dapatMedal10 = false;
dapatMedal11 = false;
dapatMedal12 = false;
dapatMedal13 = false;
dapatMedal14 = false;
dapatMedal15 = false;
dapatMedal16 = false;
dapatMedal17 = false;
dapatMedal18 = false;
dapatMedal19 = false;
dapatMedal20 = false;
dapatMedal21 = false;
dapatMedal22 = false;
dapatMedal23 = false;
dapatMedal24 = false;
dapatMedal25 = false;
dapatMedal26 = false;
dapatMedal27 = false;
dapatMedal28 = false;
dapatMedal29 = false;
dapatMedal30 = false;
dapatMedal31 = false;
dapatMedal32 = false;
dapatMedal33 = false;
dapatMedal34 = false;
dapatMedal35 = false;
dapatMedal36 = false;
dapatMedal37 = false;
dapatMedal38 = false;
dapatMedal39 = false;
dapatMedal40 = false;
dapatMedal41 = false;
dapatMedal42 = false;
dapatMedal43 = false;
dapatMedal44 = false;
dapatMedal45 = false;
dapatMedal46 = false;
dapatMedal47 = false;
dapatMedal48 = false;
dapatMedal49 = false;
dapatMedal50 = false;
sudahTutorial1 = false;
sudahTutorial2 = false;
sudahTutorial3 = false;
awalTutorial = true;
dapatBintang1 = 0;
dapatBintang2 = 0;
dapatBintang3 = 0;
dapatBintang4 = 0;
dapatBintang5 = 0;
dapatBintang6 = 0;
dapatBintang7 = 0;
dapatBintang8 = 0;
dapatBintang9 = 0;
dapatBintang10 = 0;
dapatBintang11 = 0;
dapatBintang12 = 0;
dapatBintang13 = 0;
dapatBintang14 = 0;
dapatBintang15 = 0;
dapatBintang16 = 0;
dapatBintang17 = 0;
dapatBintang18 = 0;
dapatBintang19 = 0;
dapatBintang20 = 0;
dapatBintang21 = 0;
dapatBintang22 = 0;
dapatBintang23 = 0;
dapatBintang24 = 0;
dapatBintang25 = 0;
dapatBintang26 = 0;
dapatBintang27 = 0;
dapatBintang28 = 0;
dapatBintang29 = 0;
dapatBintang30 = 0;
dapatBintang31 = 0;
dapatBintang32 = 0;
dapatBintang33 = 0;
dapatBintang34 = 0;
dapatBintang35 = 0;
dapatBintang36 = 0;
dapatBintang37 = 0;
dapatBintang38 = 0;
dapatBintang39 = 0;
dapatBintang40 = 0;
dapatBintang41 = 0;
dapatBintang42 = 0;
dapatBintang43 = 0;
dapatBintang44 = 0;
dapatBintang45 = 0;
dapatBintang46 = 0;
dapatBintang47 = 0;
dapatBintang48 = 0;
dapatBintang49 = 0;
dapatBintang50 = 0;
dapatBintang51 = 0;
dapatBintang52 = 0;
dapatBintang53 = 0;
dapatBintang54 = 0;
dapatBintang55 = 0;
dapatBintang56 = 0;
dapatBintang57 = 0;
dapatBintang58 = 0;
dapatBintang59 = 0;
dapatBintang60 = 0;
}
function backMenu() {
myMusic.stop();
myMusic = new Sound(zmusic);
myMusic.attachSound("backMenu");
myMusic.start(0, 1);
myMusic.setVolume(volume1);
myMusic.onSoundComplete = backMenu;
}
function backMain() {
myMusic.stop();
myMusic = new Sound(zmusic);
myMusic.attachSound("backMain");
myMusic.start(0, 1);
myMusic.setVolume(volume1);
myMusic.onSoundComplete = backMain;
}
function backMain2() {
myMusic.stop();
myMusic = new Sound(zmusic);
myMusic.attachSound("backMain2");
myMusic.start(0, 1);
myMusic.setVolume(volume1);
myMusic.onSoundComplete = backMain2;
}
function backMain3() {
myMusic.stop();
myMusic = new Sound(zmusic);
myMusic.attachSound("backMain3");
myMusic.start(0, 1);
myMusic.setVolume(volume1);
myMusic.onSoundComplete = backMain3;
}
function backMati() {
zrand = random(3) + 1;
mySound = new Sound(zsound);
mySound.attachSound("backMati" + zrand);
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backPukul() {
zrand = random(2) + 1;
mySound = new Sound(zsound);
mySound.attachSound("backPukul" + zrand);
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backSword() {
mySound = new Sound(zsound);
mySound.attachSound("backSword");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backPanah() {
mySound = new Sound(zsound);
mySound.attachSound("backPanah");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backSpear() {
mySound = new Sound(zsound);
mySound.attachSound("backSpear");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backPanahLempar() {
mySound = new Sound(zsound);
mySound.attachSound("backPanahLempar");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backLempar() {
mySound = new Sound(zsound);
mySound.attachSound("backLempar");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backBird() {
mySound = new Sound(zsound);
mySound.attachSound("backBird");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backTembak() {
mySound = new Sound(zsound);
mySound.attachSound("backTembak");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backBangun() {
mySound = new Sound(zsound);
mySound.attachSound("backBangun");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backBangun2() {
mySound = new Sound(zsound);
mySound.attachSound("backBangun2");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
stop();
fscommand ("fullscreen", false);
fscommand ("allowscale", true);
fscommand ("showmenu", false);
Stage.showMenu = false;
persen = "Loading";
this.onEnterFrame = function () {
persen = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
xxpersen = ("Loading " + persen) + " %";
logo_mc.loading.gotoAndStop(persen);
if (persen >= 100) {
gotoAndStop ("completed");
delete this.onEnterFrame;
}
};
simpanSemua = new Array("", "sudahMain", "coinKe", "manaKe", "expKe", "pilihGubug", "speedKini", "posisiMenang", "menangGubug1", "menangGubug2", "menangGubug3", "menangGubug4", "menangGubug5", "menangGubug6", "menangGubug7", "menangGubug8", "menangGubug9", "menangGubug10", "menangGubug11", "menangGubug12", "menangGubug13", "menangGubug14", "menangGubug15", "menangGubug16", "menangGubug17", "menangGubug18", "menangGubug19", "menangGubug20", "menangGubug21", "menangGubug22", "menangGubug23", "menangGubug24", "menangGubug25", "menangGubug26", "menangGubug27", "menangGubug28", "menangGubug29", "menangGubug30", "menangGubug31", "menangGubug32", "menangGubug33", "menangGubug34", "menangGubug35", "menangGubug36", "menangGubug37", "menangGubug38", "menangGubug39", "menangGubug40", "menangGubug41", "menangGubug42", "menangGubug43", "menangGubug44", "menangGubug45", "menangGubug46", "menangGubug47", "menangGubug48", "menangGubug49", "menangGubug50", "menangGubug51", "menangGubug52", "menangGubug53", "menangGubug54", "menangGubug55", "menangGubug56", "menangGubug57", "menangGubug58", "menangGubug59", "menangGubug60", "menangGubug61", "aktifGubug1", "aktifGubug2", "aktifGubug3", "aktifGubug4", "aktifGubug5", "aktifGubug6", "aktifGubug7", "aktifGubug8", "aktifGubug9", "aktifGubug10", "aktifGubug11", "aktifGubug12", "aktifGubug13", "aktifGubug14", "aktifGubug15", "aktifGubug16", "aktifGubug17", "aktifGubug18", "aktifGubug19", "aktifGubug20", "aktifGubug21", "aktifGubug22", "aktifGubug23", "aktifGubug24", "aktifGubug25", "aktifGubug26", "aktifGubug27", "aktifGubug28", "aktifGubug29", "aktifGubug30", "aktifGubug31", "aktifGubug32", "aktifGubug33", "aktifGubug34", "aktifGubug35", "aktifGubug36", "aktifGubug37", "aktifGubug38", "aktifGubug39", "aktifGubug40", "aktifGubug41", "aktifGubug42", "aktifGubug43", "aktifGubug44", "aktifGubug45", "aktifGubug46", "aktifGubug47", "aktifGubug48", "aktifGubug49", "aktifGubug50", "aktifGubug51", "aktifGubug52", "aktifGubug53", "aktifGubug54", "aktifGubug55", "aktifGubug56", "aktifGubug57", "aktifGubug58", "aktifGubug59", "aktifGubug60", "aktifGubug61", "levelManaPlus", "levelMoneyPlus", "levelExpPlus", "levelBasePlus", "levelRecoveryPlus", "levelDelayPlus", "levelHutPlus", "levelLifePlus", "levelEnemyPlus", "levelDamagePlus", "levelTreasurePlus", "levelCavePlus", "levelSpellPlus", "levelCriticalPlus", "levelSpeedPlus", "levelArmorPlus", "levelStrikePlus", "levelSlowPlus", "levelLuckPlus", "levelRangePlus", "levelUnit1", "levelUnit2", "levelUnit3", "levelUnit4", "levelUnit5", "levelUnit6", "levelUnit7", "levelUnit8", "levelUnit9", "kiniExp1", "kiniExp2", "kiniExp3", "kiniExp4", "kiniExp5", "kiniExp6", "kiniExp7", "kiniExp8", "kiniExp9", "maxExp1", "maxExp2", "maxExp3", "maxExp4", "maxExp5", "maxExp6", "maxExp7", "maxExp8", "maxExp9", "levelSpell1", "levelSpell2", "levelSpell3", "levelSpell4", "levelSpell5", "levelSpell6", "levelSpell7", "levelSpell8", "levelSpell9", "levelSpell10", "levelHut", "levelTower", "levelCave", "maxHutCapacity1", "maxHutCapacity2", "maxHutCapacity3", "xmaxHutCapacity1", "xmaxHutCapacity2", "xmaxHutCapacity3", "towerDamage1", "towerDamage2", "towerDamage3", "xtowerDamage1", "xtowerDamage2", "xtowerDamage3", "maxCaveCapacity7", "maxCaveCapacity8", "xmaxCaveCapacity7", "xmaxCaveCapacity8", "magicPunya1", "magicPunya2", "magicPunya3", "magicPunya4", "magicPunya5", "magicPunya6", "magicPunya7", "magicPunya8", "magicPunya9", "magicPunya10", "magicPunya11", "magicPunya12", "posisiWorldMap", "dapatMedal1", "dapatMedal2", "dapatMedal3", "dapatMedal4", "dapatMedal5", "dapatMedal6", "dapatMedal7", "dapatMedal8", "dapatMedal9", "dapatMedal10", "dapatMedal11", "dapatMedal12", "dapatMedal13", "dapatMedal14", "dapatMedal15", "dapatMedal16", "dapatMedal17", "dapatMedal18", "dapatMedal19", "dapatMedal20", "dapatMedal21", "dapatMedal22", "dapatMedal23", "dapatMedal24", "dapatMedal25", "dapatMedal26", "dapatMedal27", "dapatMedal28", "dapatMedal29", "dapatMedal30", "dapatMedal31", "dapatMedal32", "dapatMedal33", "dapatMedal34", "dapatMedal35", "dapatMedal36", "dapatMedal37", "dapatMedal38", "dapatMedal39", "dapatMedal40", "dapatMedal41", "dapatMedal42", "dapatMedal43", "dapatMedal44", "dapatMedal45", "dapatMedal46", "dapatMedal47", "dapatMedal48", "dapatMedal49", "dapatMedal50", "totalMenangLevel", "totalTrainUnit", "totalBangunan", "totalKillEnemy", "totalBuyUpgrades", "sudahTutorial1", "sudahTutorial2", "sudahTutorial3", "awalTutorial", "dapatBintang1", "dapatBintang2", "dapatBintang3", "dapatBintang4", "dapatBintang5", "dapatBintang6", "dapatBintang7", "dapatBintang8", "dapatBintang9", "dapatBintang10", "dapatBintang11", "dapatBintang12", "dapatBintang13", "dapatBintang14", "dapatBintang15", "dapatBintang16", "dapatBintang17", "dapatBintang18", "dapatBintang19", "dapatBintang20", "dapatBintang21", "dapatBintang22", "dapatBintang23", "dapatBintang24", "dapatBintang25", "dapatBintang26", "dapatBintang27", "dapatBintang28", "dapatBintang29", "dapatBintang30", "dapatBintang31", "dapatBintang32", "dapatBintang33", "dapatBintang34", "dapatBintang35", "dapatBintang36", "dapatBintang37", "dapatBintang38", "dapatBintang39", "dapatBintang40", "dapatBintang41", "dapatBintang42", "dapatBintang43", "dapatBintang44", "dapatBintang45", "dapatBintang46", "dapatBintang47", "dapatBintang48", "dapatBintang49", "dapatBintang50", "dapatBintang51", "dapatBintang52", "dapatBintang53", "dapatBintang54", "dapatBintang55", "dapatBintang56", "dapatBintang57", "dapatBintang58", "dapatBintang59", "dapatBintang60", "xposisiWorldMap", "totalKalah");
sudahMain = false;
qualityGame = 1;
_quality = "HIGH";
adaSuara = true;
zmusic = attachMovie("indi3", "zmusic", 7);
zmusic._x = -500;
zmusic._y = -500;
zsound = attachMovie("indi3", "zsound", 8);
zsound._x = -750;
zsound._y = -750;
volume1 = 50;
volume2 = 25;
loadData();
if (sudahMain == undefined) {
totalMenangLevel = 0;
totalTrainUnit = 0;
totalBangunan = 0;
totalKillEnemy = 0;
totalBuyUpgrades = 0;
initData();
}
Frame 20
stop();
_urlStart = _url.indexOf("://") + 3;
_urlEnd = _url.indexOf("/", _urlStart);
domain = _url.substring(_urlStart, _urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
if (domain == "armorgames.com") {
gotoAndStop (31);
} else {
getURL ("http://thegames8.com/hut-defense-2.html", "_self");
}
Frame 25
stop();
Frame 26
gotoAndStop ("sitelock");
Frame 31
play();
Frame 265
gotoAndStop (266);
Frame 266
function resetContinue() {
continue_btn._visible = true;
}
stop();
if (asalMulaCredit == "credit") {
asalMulaCredit = undefined;
} else {
backMenu();
}
msgBox_mc.gotoAndStop(1);
msgBox_mc3._visible = false;
new_btn.onRelease = function () {
if (sudahMain == true) {
msgBox_mc3._visible = true;
msgBox_mc3.yes_btn.onRelease = function () {
initData();
if (xposisiWorldMap == 1) {
gotoAndStop (268);
} else if (xposisiWorldMap == 2) {
gotoAndStop (269);
} else if (xposisiWorldMap == 3) {
gotoAndStop (270);
} else if (xposisiWorldMap == 4) {
gotoAndStop (271);
} else if (xposisiWorldMap == 5) {
gotoAndStop (272);
}
};
msgBox_mc3.no_btn.onRelease = function () {
msgBox_mc3._visible = false;
};
} else {
initData();
if (xposisiWorldMap == 1) {
gotoAndStop (268);
} else if (xposisiWorldMap == 2) {
gotoAndStop (269);
} else if (xposisiWorldMap == 3) {
gotoAndStop (270);
} else if (xposisiWorldMap == 4) {
gotoAndStop (271);
} else if (xposisiWorldMap == 5) {
gotoAndStop (272);
}
}
};
continue_btn.onRelease = function () {
if (sudahMain == true) {
loadData();
if (xposisiWorldMap == 1) {
gotoAndStop (268);
} else if (xposisiWorldMap == 2) {
gotoAndStop (269);
} else if (xposisiWorldMap == 3) {
gotoAndStop (270);
} else if (xposisiWorldMap == 4) {
gotoAndStop (271);
} else if (xposisiWorldMap == 5) {
gotoAndStop (272);
}
} else {
continue_btn._visible = false;
msgBox_mc.gotoAndPlay(2);
}
};
credits_btn.onRelease = function () {
gotoAndStop ("credits");
};
if (volume1 != 0) {
sound_mc.gotoAndStop(1);
} else {
sound_mc.gotoAndStop(2);
}
sound_mc.onRelease = function () {
if (volume1 != 0) {
volume1 = 0;
volume2 = 0;
sound_mc.gotoAndStop(2);
} else {
volume1 = 50;
volume2 = 25;
sound_mc.gotoAndStop(1);
}
myMusic.setVolume(volume1);
mySound.setVolume(volume2);
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
like_btn.onRelease = function () {
getURL ("http://www.facebook.com/ArmorGames", "_blank");
};
Frame 267
stop();
msgBox_mc2.close_btn.onRelease = function () {
asalMulaCredit = "credit";
gotoAndStop ("utama");
};
Frame 268
function klikPeti() {
this.gotoAndStop(3);
delete this.onRelease;
posisiMenang = false;
tambahanMana = 150;
tambahanCoin = 200;
if (levelTreasurePlus == 1) {
persentase = 50;
} else if (levelTreasurePlus == 2) {
persentase = 75;
} else if (levelTreasurePlus == 3) {
persentase = 100;
} else if (levelTreasurePlus == 4) {
persentase = 125;
} else {
persentase = 0;
}
xtambahanMana = tambahanMana * (persentase / 100);
xtambahanCoin = tambahanCoin * (persentase / 100);
tambahanMana = tambahanMana + xtambahanMana;
tambahanCoin = tambahanCoin + xtambahanCoin;
tambahanMana = Math.ceil(tambahanMana);
tambahanCoin = Math.ceil(tambahanCoin);
randDapat = random(2);
if (randDapat == 0) {
manaKe = manaKe + tambahanMana;
} else if (randDapat == 1) {
coinKe = coinKe + tambahanCoin;
}
animDapat = attachMovie("animDapat2", "animDapat", 999);
animDapat._x = this._x;
animDapat._y = this._y;
animDapat.mana_mc._visible = false;
animDapat.coin_mc._visible = false;
animDapat.manaKe = "";
animDapat.coinKe = "";
if (randDapat == 0) {
animDapat.mana_mc._visible = true;
animDapat.manaKe = tambahanMana;
} else if (randDapat == 1) {
animDapat.coin_mc._visible = true;
animDapat.coinKe = tambahanCoin;
}
}
function klikGubug() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (indi <= 4) {
pilihGubug = 7;
} else if (indi <= 8) {
pilihGubug = 5;
} else if (indi <= 12) {
pilihGubug = 6;
} else if (indi <= 16) {
pilihGubug = 8;
}
sudahTutorial1 = true;
pilihLevel = indi;
removeMovieClip(animDapat);
gotoAndStop (278);
}
function overGubug() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
msgBox_mc.namaArea = "Area " + indi;
this.gotoAndStop(2);
}
function outGubug() {
msgBox_mc._visible = false;
this.gotoAndStop(1);
}
function overGubug2() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
msgBox_mc.namaArea = "Area " + indi;
this.gotoAndStop(7);
}
function outGubug2() {
msgBox_mc._visible = false;
this.gotoAndStop(6);
}
stop();
if (volume1 != 0) {
myMusic.setVolume(25);
}
posisiWorldMap = 1;
skill_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (273);
};
monster_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (274);
};
building_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (275);
};
magic_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (276);
};
medal_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (277);
};
menu_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (266);
};
i = 1;
while (i <= 16) {
if (_root["aktifGubug" + i] == true) {
if (_root["menangGubug" + i] == true) {
if (_root["dapatBintang" + i] <= 2) {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
} else {
_root["gubug" + i].gotoAndStop(6);
_root["gubug" + i].onRollOver = overGubug2;
_root["gubug" + i].onRollOut = outGubug2;
}
} else {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
}
} else {
_root["gubug" + i].gotoAndStop(5);
}
i++;
}
msgBox_mc._visible = false;
if (posisiMenang == true) {
peti_mc.gotoAndStop(2);
peti_mc.onRelease = klikPeti;
} else {
peti_mc.gotoAndStop(1);
}
msgBox_mc.onEnterFrame = function () {
if (_root._xmouse >= 690) {
this._x = _root._xmouse - 65;
} else {
this._x = _root._xmouse + 65;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
};
sudahMenangGubug = 0;
i = 1;
while (i <= 16) {
if (_root["menangGubug" + i] == true) {
sudahMenangGubug++;
}
i++;
}
if (sudahMenangGubug >= 16) {
if (xposisiWorldMap == 1) {
xposisiWorldMap = 2;
gotoAndStop ("map2");
}
}
tutorial_mc._visible = false;
if (awalTutorial == true) {
if (sudahTutorial1 == false) {
tutorial_mc._visible = true;
gubug5.enabled = false;
gubug9.enabled = false;
gubug13.enabled = false;
}
}
tutorial_mc.skip_btn.onRelease = function () {
awalTutorial = false;
tutorial_mc._visible = false;
gubug5.enabled = true;
gubug9.enabled = true;
gubug13.enabled = true;
};
i = 1;
while (i <= 16) {
_root["gubug" + i].bintang1._visible = true;
_root["gubug" + i].bintang2._visible = true;
_root["gubug" + i].bintang3._visible = true;
if (_root["dapatBintang" + i] == 0) {
_root["gubug" + i].bintang1._visible = false;
_root["gubug" + i].bintang2._visible = false;
_root["gubug" + i].bintang3._visible = false;
} else if (_root["dapatBintang" + i] == 1) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(2);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 2) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 3) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(1);
}
i++;
}
if (xposisiWorldMap == 1) {
panahKiri._visible = false;
panahKanan._visible = false;
} else if (xposisiWorldMap >= 2) {
panahKiri._visible = false;
panahKanan._visible = true;
}
panahKiri.onRelease = function () {
};
panahKanan.onRelease = function () {
gotoAndStop ("map2");
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 269
function klikPeti() {
peti_mc.gotoAndStop(3);
delete this.onRelease;
posisiMenang = false;
tambahanMana = 350;
tambahanCoin = 400;
if (levelTreasurePlus == 1) {
persentase = 50;
} else if (levelTreasurePlus == 2) {
persentase = 75;
} else if (levelTreasurePlus == 3) {
persentase = 100;
} else if (levelTreasurePlus == 4) {
persentase = 125;
} else {
persentase = 0;
}
xtambahanMana = tambahanMana * (persentase / 100);
xtambahanCoin = tambahanCoin * (persentase / 100);
tambahanMana = tambahanMana + xtambahanMana;
tambahanCoin = tambahanCoin + xtambahanCoin;
tambahanMana = Math.ceil(tambahanMana);
tambahanCoin = Math.ceil(tambahanCoin);
randDapat = random(2);
if (randDapat == 0) {
manaKe = manaKe + tambahanMana;
} else if (randDapat == 1) {
coinKe = coinKe + tambahanCoin;
}
animDapat = attachMovie("animDapat2", "animDapat", 999);
animDapat._x = this._x;
animDapat._y = this._y;
animDapat.mana_mc._visible = false;
animDapat.coin_mc._visible = false;
animDapat.manaKe = "";
animDapat.coinKe = "";
if (randDapat == 0) {
animDapat.mana_mc._visible = true;
animDapat.manaKe = tambahanMana;
} else if (randDapat == 1) {
animDapat.coin_mc._visible = true;
animDapat.coinKe = tambahanCoin;
}
}
function klikGubug() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (indi <= 21) {
pilihGubug = 3;
} else if (indi <= 26) {
pilihGubug = 4;
} else if (indi <= 31) {
pilihGubug = 2;
} else if (indi <= 36) {
pilihGubug = 1;
}
pilihLevel = indi;
removeMovieClip(animDapat);
gotoAndStop (278);
}
function overGubug() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
msgBox_mc.namaArea = "Area " + indi;
this.gotoAndStop(2);
}
function outGubug() {
msgBox_mc._visible = false;
this.gotoAndStop(1);
}
function overGubug2() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
msgBox_mc.namaArea = "Area " + indi;
this.gotoAndStop(7);
}
function outGubug2() {
msgBox_mc._visible = false;
this.gotoAndStop(6);
}
stop();
if (volume1 != 0) {
myMusic.setVolume(25);
}
posisiWorldMap = 2;
skill_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (273);
};
monster_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (274);
};
building_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (275);
};
magic_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (276);
};
medal_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (277);
};
menu_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (266);
};
i = 17;
while (i <= 36) {
if (_root["aktifGubug" + i] == true) {
if (_root["menangGubug" + i] == true) {
if (_root["dapatBintang" + i] <= 2) {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
} else {
_root["gubug" + i].gotoAndStop(6);
_root["gubug" + i].onRollOver = overGubug2;
_root["gubug" + i].onRollOut = outGubug2;
}
} else {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
}
} else {
_root["gubug" + i].gotoAndStop(5);
}
i++;
}
msgBox_mc._visible = false;
if (posisiMenang == true) {
peti_mc.gotoAndStop(2);
peti_mc.onRelease = klikPeti;
} else {
peti_mc.gotoAndStop(1);
}
msgBox_mc.onEnterFrame = function () {
if (_root._xmouse >= 690) {
this._x = _root._xmouse - 65;
} else {
this._x = _root._xmouse + 65;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
};
sudahMenangGubug = 0;
i = 17;
while (i <= 36) {
if (_root["menangGubug" + i] == true) {
sudahMenangGubug++;
}
i++;
}
if (sudahMenangGubug >= 20) {
if (xposisiWorldMap == 2) {
xposisiWorldMap = 3;
gotoAndStop ("map3");
}
}
i = 17;
while (i <= 36) {
_root["gubug" + i].bintang1._visible = true;
_root["gubug" + i].bintang2._visible = true;
_root["gubug" + i].bintang3._visible = true;
if (_root["dapatBintang" + i] == 0) {
_root["gubug" + i].bintang1._visible = false;
_root["gubug" + i].bintang2._visible = false;
_root["gubug" + i].bintang3._visible = false;
} else if (_root["dapatBintang" + i] == 1) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(2);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 2) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 3) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(1);
}
i++;
}
if (xposisiWorldMap == 2) {
panahKiri._visible = true;
panahKanan._visible = false;
} else if (xposisiWorldMap >= 3) {
panahKiri._visible = true;
panahKanan._visible = true;
}
panahKiri.onRelease = function () {
gotoAndStop ("map1");
};
panahKanan.onRelease = function () {
gotoAndStop ("map3");
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 270
function klikPeti() {
peti_mc.gotoAndStop(3);
delete this.onRelease;
posisiMenang = false;
tambahanMana = 550;
tambahanCoin = 600;
if (levelTreasurePlus == 1) {
persentase = 50;
} else if (levelTreasurePlus == 2) {
persentase = 75;
} else if (levelTreasurePlus == 3) {
persentase = 100;
} else if (levelTreasurePlus == 4) {
persentase = 125;
} else {
persentase = 0;
}
xtambahanMana = tambahanMana * (persentase / 100);
xtambahanCoin = tambahanCoin * (persentase / 100);
tambahanMana = tambahanMana + xtambahanMana;
tambahanCoin = tambahanCoin + xtambahanCoin;
tambahanMana = Math.ceil(tambahanMana);
tambahanCoin = Math.ceil(tambahanCoin);
randDapat = random(2);
if (randDapat == 0) {
manaKe = manaKe + tambahanMana;
} else if (randDapat == 1) {
coinKe = coinKe + tambahanCoin;
}
animDapat = attachMovie("animDapat2", "animDapat", 999);
animDapat._x = this._x;
animDapat._y = this._y;
animDapat.mana_mc._visible = false;
animDapat.coin_mc._visible = false;
animDapat.manaKe = "";
animDapat.coinKe = "";
if (randDapat == 0) {
animDapat.mana_mc._visible = true;
animDapat.manaKe = tambahanMana;
} else if (randDapat == 1) {
animDapat.coin_mc._visible = true;
animDapat.coinKe = tambahanCoin;
}
}
function klikGubug() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (indi <= 41) {
pilihGubug = 9;
} else if (indi <= 46) {
pilihGubug = 10;
}
pilihLevel = indi;
removeMovieClip(animDapat);
gotoAndStop (278);
}
function overGubug() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
msgBox_mc.namaArea = "Area " + indi;
this.gotoAndStop(2);
}
function outGubug() {
msgBox_mc._visible = false;
this.gotoAndStop(1);
}
function overGubug2() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
msgBox_mc.namaArea = "Area " + indi;
this.gotoAndStop(7);
}
function outGubug2() {
msgBox_mc._visible = false;
this.gotoAndStop(6);
}
stop();
if (volume1 != 0) {
myMusic.setVolume(25);
}
posisiWorldMap = 3;
skill_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (273);
};
monster_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (274);
};
building_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (275);
};
magic_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (276);
};
medal_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (277);
};
menu_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (266);
};
i = 37;
while (i <= 46) {
if (_root["aktifGubug" + i] == true) {
if (_root["menangGubug" + i] == true) {
if (_root["dapatBintang" + i] <= 2) {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
} else {
_root["gubug" + i].gotoAndStop(6);
_root["gubug" + i].onRollOver = overGubug2;
_root["gubug" + i].onRollOut = outGubug2;
}
} else {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
}
} else {
_root["gubug" + i].gotoAndStop(5);
}
i++;
}
msgBox_mc._visible = false;
if (posisiMenang == true) {
peti_mc.gotoAndStop(2);
peti_mc.onRelease = klikPeti;
} else {
peti_mc.gotoAndStop(1);
}
msgBox_mc.onEnterFrame = function () {
if (_root._xmouse >= 690) {
this._x = _root._xmouse - 65;
} else {
this._x = _root._xmouse + 65;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
};
sudahMenangGubug = 0;
i = 37;
while (i <= 46) {
if (_root["menangGubug" + i] == true) {
sudahMenangGubug++;
}
i++;
}
if (sudahMenangGubug >= 10) {
if (xposisiWorldMap == 3) {
xposisiWorldMap = 4;
gotoAndStop ("map4");
}
}
i = 37;
while (i <= 46) {
_root["gubug" + i].bintang1._visible = true;
_root["gubug" + i].bintang2._visible = true;
_root["gubug" + i].bintang3._visible = true;
if (_root["dapatBintang" + i] == 0) {
_root["gubug" + i].bintang1._visible = false;
_root["gubug" + i].bintang2._visible = false;
_root["gubug" + i].bintang3._visible = false;
} else if (_root["dapatBintang" + i] == 1) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(2);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 2) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 3) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(1);
}
i++;
}
if (xposisiWorldMap == 3) {
panahKiri._visible = true;
panahKanan._visible = false;
} else if (xposisiWorldMap >= 4) {
panahKiri._visible = true;
panahKanan._visible = true;
}
panahKiri.onRelease = function () {
gotoAndStop ("map2");
};
panahKanan.onRelease = function () {
gotoAndStop ("map4");
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 271
function klikPeti() {
peti_mc.gotoAndStop(3);
delete this.onRelease;
posisiMenang = false;
tambahanMana = 300;
tambahanCoin = 400;
if (levelTreasurePlus == 1) {
persentase = 50;
} else if (levelTreasurePlus == 2) {
persentase = 75;
} else if (levelTreasurePlus == 3) {
persentase = 100;
} else if (levelTreasurePlus == 4) {
persentase = 125;
} else {
persentase = 0;
}
xtambahanMana = tambahanMana * (persentase / 100);
xtambahanCoin = tambahanCoin * (persentase / 100);
tambahanMana = tambahanMana + xtambahanMana;
tambahanCoin = tambahanCoin + xtambahanCoin;
randDapat = random(2);
if (randDapat == 0) {
manaKe = manaKe + tambahanMana;
} else if (randDapat == 1) {
coinKe = coinKe + tambahanCoin;
}
animDapat = attachMovie("animDapat2", "animDapat", 999);
animDapat._x = this._x;
animDapat._y = this._y;
animDapat.mana_mc._visible = false;
animDapat.coin_mc._visible = false;
animDapat.manaKe = "";
animDapat.coinKe = "";
if (randDapat == 0) {
animDapat.mana_mc._visible = true;
animDapat.manaKe = tambahanMana;
} else if (randDapat == 1) {
animDapat.coin_mc._visible = true;
animDapat.coinKe = tambahanCoin;
}
}
function klikGubug() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (indi <= 51) {
pilihGubug = 11;
} else if (indi <= 56) {
pilihGubug = 12;
}
pilihLevel = indi;
removeMovieClip(animDapat);
gotoAndStop (278);
}
function overGubug() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
msgBox_mc.namaArea = "Area " + indi;
this.gotoAndStop(2);
}
function outGubug() {
msgBox_mc._visible = false;
this.gotoAndStop(1);
}
function overGubug2() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
msgBox_mc.namaArea = "Area " + indi;
this.gotoAndStop(7);
}
function outGubug2() {
msgBox_mc._visible = false;
this.gotoAndStop(6);
}
stop();
if (volume1 != 0) {
myMusic.setVolume(25);
}
posisiWorldMap = 4;
skill_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (273);
};
monster_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (274);
};
building_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (275);
};
magic_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (276);
};
medal_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (277);
};
menu_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (266);
};
i = 47;
while (i <= 56) {
if (_root["aktifGubug" + i] == true) {
if (_root["menangGubug" + i] == true) {
if (_root["dapatBintang" + i] <= 2) {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
} else {
_root["gubug" + i].gotoAndStop(6);
_root["gubug" + i].onRollOver = overGubug2;
_root["gubug" + i].onRollOut = outGubug2;
}
} else {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
}
} else {
_root["gubug" + i].gotoAndStop(5);
}
i++;
}
msgBox_mc._visible = false;
if (posisiMenang == true) {
peti_mc.gotoAndStop(2);
peti_mc.onRelease = klikPeti;
} else {
peti_mc.gotoAndStop(1);
}
msgBox_mc.onEnterFrame = function () {
if (_root._xmouse >= 690) {
this._x = _root._xmouse - 65;
} else {
this._x = _root._xmouse + 65;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
};
sudahMenangGubug = 0;
i = 47;
while (i <= 56) {
if (_root["menangGubug" + i] == true) {
sudahMenangGubug++;
}
i++;
}
if (sudahMenangGubug >= 10) {
if (xposisiWorldMap == 4) {
xposisiWorldMap = 5;
gotoAndStop ("map5");
}
}
i = 47;
while (i <= 56) {
_root["gubug" + i].bintang1._visible = true;
_root["gubug" + i].bintang2._visible = true;
_root["gubug" + i].bintang3._visible = true;
if (_root["dapatBintang" + i] == 0) {
_root["gubug" + i].bintang1._visible = false;
_root["gubug" + i].bintang2._visible = false;
_root["gubug" + i].bintang3._visible = false;
} else if (_root["dapatBintang" + i] == 1) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(2);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 2) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 3) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(1);
}
i++;
}
if (xposisiWorldMap == 4) {
panahKiri._visible = true;
panahKanan._visible = false;
} else if (xposisiWorldMap >= 5) {
panahKiri._visible = true;
panahKanan._visible = true;
}
panahKiri.onRelease = function () {
gotoAndStop ("map3");
};
panahKanan.onRelease = function () {
gotoAndStop ("map5");
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 272
function klikPeti() {
peti_mc.gotoAndStop(3);
delete this.onRelease;
posisiMenang = false;
tambahanMana = 300;
tambahanCoin = 400;
if (levelTreasurePlus == 1) {
persentase = 50;
} else if (levelTreasurePlus == 2) {
persentase = 75;
} else if (levelTreasurePlus == 3) {
persentase = 100;
} else if (levelTreasurePlus == 4) {
persentase = 125;
} else {
persentase = 0;
}
xtambahanMana = tambahanMana * (persentase / 100);
xtambahanCoin = tambahanCoin * (persentase / 100);
tambahanMana = tambahanMana + xtambahanMana;
tambahanCoin = tambahanCoin + xtambahanCoin;
randDapat = random(2);
if (randDapat == 0) {
manaKe = manaKe + tambahanMana;
} else if (randDapat == 1) {
coinKe = coinKe + tambahanCoin;
}
animDapat = attachMovie("animDapat2", "animDapat", 999);
animDapat._x = this._x;
animDapat._y = this._y;
animDapat.mana_mc._visible = false;
animDapat.coin_mc._visible = false;
animDapat.manaKe = "";
animDapat.coinKe = "";
if (randDapat == 0) {
animDapat.mana_mc._visible = true;
animDapat.manaKe = tambahanMana;
} else if (randDapat == 1) {
animDapat.coin_mc._visible = true;
animDapat.coinKe = tambahanCoin;
}
}
function klikGubug() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (indi == 57) {
pilihGubug = 13;
} else if (indi == 58) {
pilihGubug = 14;
} else if (indi == 59) {
pilihGubug = 15;
} else if (indi == 60) {
pilihGubug = 16;
} else if (indi == 61) {
pilihGubug = 17;
}
pilihLevel = indi;
removeMovieClip(animDapat);
gotoAndStop (278);
}
function overGubug() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (indi == 61) {
msgBox_mc.namaArea = "Final Boss";
} else {
msgBox_mc.namaArea = "Area " + indi;
}
this.gotoAndStop(2);
}
function outGubug() {
msgBox_mc._visible = false;
this.gotoAndStop(1);
}
function overGubug2() {
msgBox_mc._visible = true;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (indi == 61) {
msgBox_mc.namaArea = "Final Boss";
} else {
msgBox_mc.namaArea = "Area " + indi;
}
this.gotoAndStop(7);
}
function outGubug2() {
msgBox_mc._visible = false;
this.gotoAndStop(6);
}
stop();
if (volume1 != 0) {
myMusic.setVolume(25);
}
sudahMenangGubug = 0;
i = 57;
while (i <= 60) {
if (_root["menangGubug" + i] == true) {
sudahMenangGubug++;
}
i++;
}
if (sudahMenangGubug >= 4) {
_root.aktifGubug61 = true;
}
posisiWorldMap = 5;
skill_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (273);
};
monster_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (274);
};
building_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (275);
};
magic_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (276);
};
medal_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (277);
};
menu_btn.onRelease = function () {
removeMovieClip(animDapat);
gotoAndStop (266);
};
i = 57;
while (i <= 61) {
if (_root["aktifGubug" + i] == true) {
if (_root["menangGubug" + i] == true) {
if (_root["dapatBintang" + i] <= 2) {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
} else {
_root["gubug" + i].gotoAndStop(6);
_root["gubug" + i].onRollOver = overGubug2;
_root["gubug" + i].onRollOut = outGubug2;
}
} else {
_root["gubug" + i].onRelease = klikGubug;
_root["gubug" + i].onRollOver = overGubug;
_root["gubug" + i].onRollOut = outGubug;
_root["gubug" + i].gotoAndStop(1);
}
} else {
_root["gubug" + i].gotoAndStop(5);
}
i++;
}
msgBox_mc._visible = false;
if (posisiMenang == true) {
peti_mc.gotoAndStop(2);
peti_mc.onRelease = klikPeti;
} else {
peti_mc.gotoAndStop(1);
}
msgBox_mc.onEnterFrame = function () {
if (_root._xmouse >= 690) {
this._x = _root._xmouse - 65;
} else {
this._x = _root._xmouse + 65;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
};
i = 57;
while (i <= 61) {
_root["gubug" + i].bintang1._visible = true;
_root["gubug" + i].bintang2._visible = true;
_root["gubug" + i].bintang3._visible = true;
if (_root["dapatBintang" + i] == 0) {
_root["gubug" + i].bintang1._visible = false;
_root["gubug" + i].bintang2._visible = false;
_root["gubug" + i].bintang3._visible = false;
} else if (_root["dapatBintang" + i] == 1) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(2);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 2) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + i] == 3) {
_root["gubug" + i].bintang1.gotoAndStop(1);
_root["gubug" + i].bintang2.gotoAndStop(1);
_root["gubug" + i].bintang3.gotoAndStop(1);
}
i++;
}
if (xposisiWorldMap == 5) {
panahKiri._visible = true;
panahKanan._visible = false;
}
panahKiri.onRelease = function () {
gotoAndStop ("map4");
};
panahKanan.onRelease = function () {
};
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 273
function cekUpgradeSkill() {
i = 1;
while (i <= 4) {
if (levelManaPlus >= 4) {
_root["manaPlus" + i].gotoAndStop(1);
} else {
_root["manaPlus" + i].gotoAndStop(2);
}
if (levelMoneyPlus >= 4) {
_root["moneyPlus" + i].gotoAndStop(1);
} else {
_root["moneyPlus" + i].gotoAndStop(2);
}
if (levelExpPlus >= 4) {
_root["expPlus" + i].gotoAndStop(1);
} else {
_root["expPlus" + i].gotoAndStop(2);
}
if (levelBasePlus >= 4) {
_root["basePlus" + i].gotoAndStop(1);
} else {
_root["basePlus" + i].gotoAndStop(2);
}
if (levelRecoveryPlus >= 4) {
_root["recoveryPlus" + i].gotoAndStop(1);
} else {
_root["recoveryPlus" + i].gotoAndStop(2);
}
if (levelDelayPlus >= 4) {
_root["delayPlus" + i].gotoAndStop(1);
} else {
_root["delayPlus" + i].gotoAndStop(2);
}
if (levelHutPlus >= 4) {
_root["hutPlus" + i].gotoAndStop(1);
} else {
_root["hutPlus" + i].gotoAndStop(2);
}
if (levelLifePlus >= 4) {
_root["lifePlus" + i].gotoAndStop(1);
} else {
_root["lifePlus" + i].gotoAndStop(2);
}
if (levelEnemyPlus >= 4) {
_root["enemyPlus" + i].gotoAndStop(1);
} else {
_root["enemyPlus" + i].gotoAndStop(2);
}
if (levelDamagePlus >= 4) {
_root["damagePlus" + i].gotoAndStop(1);
} else {
_root["damagePlus" + i].gotoAndStop(2);
}
if (levelTreasurePlus >= 4) {
_root["treasurePlus" + i].gotoAndStop(1);
} else {
_root["treasurePlus" + i].gotoAndStop(2);
}
if (levelCavePlus >= 4) {
_root["cavePlus" + i].gotoAndStop(1);
} else {
_root["cavePlus" + i].gotoAndStop(2);
}
if (levelSpellPlus >= 4) {
_root["spellPlus" + i].gotoAndStop(1);
} else {
_root["spellPlus" + i].gotoAndStop(2);
}
if (levelCriticalPlus >= 4) {
_root["criticalPlus" + i].gotoAndStop(1);
} else {
_root["criticalPlus" + i].gotoAndStop(2);
}
if (levelSpeedPlus >= 4) {
_root["speedPlus" + i].gotoAndStop(1);
} else {
_root["speedPlus" + i].gotoAndStop(2);
}
if (levelArmorPlus >= 4) {
_root["armorPlus" + i].gotoAndStop(1);
} else {
_root["armorPlus" + i].gotoAndStop(2);
}
if (levelStrikePlus >= 4) {
_root["strikePlus" + i].gotoAndStop(1);
} else {
_root["strikePlus" + i].gotoAndStop(2);
}
if (levelSlowPlus >= 4) {
_root["slowPlus" + i].gotoAndStop(1);
} else {
_root["slowPlus" + i].gotoAndStop(2);
}
if (levelLuckPlus >= 4) {
_root["luckPlus" + i].gotoAndStop(1);
} else {
_root["luckPlus" + i].gotoAndStop(2);
}
if (levelRangePlus >= 4) {
_root["rangePlus" + i].gotoAndStop(1);
} else {
_root["rangePlus" + i].gotoAndStop(2);
}
delete _root["manaPlus" + i].onRelease;
delete _root["moneyPlus" + i].onRelease;
delete _root["expPlus" + i].onRelease;
delete _root["basePlus" + i].onRelease;
delete _root["recoveryPlus" + i].onRelease;
delete _root["delayPlus" + i].onRelease;
delete _root["hutPlus" + i].onRelease;
delete _root["lifePlus" + i].onRelease;
delete _root["enemyPlus" + i].onRelease;
delete _root["damagePlus" + i].onRelease;
delete _root["treasurePlus" + i].onRelease;
delete _root["cavePlus" + i].onRelease;
delete _root["spellPlus" + i].onRelease;
delete _root["criticalPlus" + i].onRelease;
delete _root["speedPlus" + i].onRelease;
delete _root["armorPlus" + i].onRelease;
delete _root["strikePlus" + i].onRelease;
delete _root["slowPlus" + i].onRelease;
delete _root["luckPlus" + i].onRelease;
delete _root["rangePlus" + i].onRelease;
_root["manaPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelManaPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeMana[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeMana[indi] + "\nCoin Cost: ") + (hargaUpgradeMana[indi - 1] * (levelManaPlus + 1));
}
msgBox_mc._visible = true;
};
_root["manaPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["moneyPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelMoneyPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeMoney[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeMoney[indi] + "\nCoin Cost: ") + (hargaUpgradeMoney[indi - 1] * (levelMoneyPlus + 1));
}
msgBox_mc._visible = true;
};
_root["moneyPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["expPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelExpPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeExp[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeExp[indi] + "\nCoin Cost: ") + (hargaUpgradeExp[indi - 1] * (levelExpPlus + 1));
}
msgBox_mc._visible = true;
};
_root["expPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["basePlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelBasePlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeBase[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeBase[indi] + "\nCoin Cost: ") + (hargaUpgradeBase[indi - 1] * (levelBasePlus + 1));
}
msgBox_mc._visible = true;
};
_root["basePlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["recoveryPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelRecoveryPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeRecovery[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeRecovery[indi] + "\nCoin Cost: ") + (hargaUpgradeRecovery[indi - 1] * (levelRecoveryPlus + 1));
}
msgBox_mc._visible = true;
};
_root["recoveryPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["delayPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelDelayPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeDelay[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeDelay[indi] + "\nCoin Cost: ") + (hargaUpgradeDelay[indi - 1] * (levelDelayPlus + 1));
}
msgBox_mc._visible = true;
};
_root["delayPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["hutPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelHutPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeHut[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeHut[indi] + "\nCoin Cost: ") + (hargaUpgradeHut[indi - 1] * (levelHutPlus + 1));
}
msgBox_mc._visible = true;
};
_root["hutPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["lifePlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelLifePlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeLife[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeLife[indi] + "\nCoin Cost: ") + (hargaUpgradeLife[indi - 1] * (levelLifePlus + 1));
}
msgBox_mc._visible = true;
};
_root["lifePlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["enemyPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelEnemyPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeEnemy[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeEnemy[indi] + "\nCoin Cost: ") + (hargaUpgradeEnemy[indi - 1] * (levelEnemyPlus + 1));
}
msgBox_mc._visible = true;
};
_root["enemyPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["damagePlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelDamagePlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeDamage[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeDamage[indi] + "\nCoin Cost: ") + (hargaUpgradeDamage[indi - 1] * (levelDamagePlus + 1));
}
msgBox_mc._visible = true;
};
_root["damagePlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["treasurePlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelTreasurePlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeTreasure[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeTreasure[indi] + "\nCoin Cost: ") + (hargaUpgradeTreasure[indi - 1] * (levelTreasurePlus + 1));
}
msgBox_mc._visible = true;
};
_root["treasurePlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["cavePlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelCavePlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeCave[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeCave[indi] + "\nCoin Cost: ") + (hargaUpgradeCave[indi - 1] * (levelCavePlus + 1));
}
msgBox_mc._visible = true;
};
_root["cavePlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["spellPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelSpellPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeSpell[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeSpell[indi] + "\nCoin Cost: ") + (hargaUpgradeSpell[indi - 1] * (levelSpellPlus + 1));
}
msgBox_mc._visible = true;
};
_root["spellPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["criticalPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelCriticalPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeCritical[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeCritical[indi] + "\nCoin Cost: ") + (hargaUpgradeCritical[indi - 1] * (levelCriticalPlus + 1));
}
msgBox_mc._visible = true;
};
_root["criticalPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["speedPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelSpeedPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeSpeed[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeSpeed[indi] + "\nCoin Cost: ") + (hargaUpgradeSpeed[indi - 1] * (levelSpeedPlus + 1));
}
msgBox_mc._visible = true;
};
_root["speedPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["armorPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelArmorPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeArmor[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeArmor[indi] + "\nCoin Cost: ") + (hargaUpgradeArmor[indi - 1] * (levelArmorPlus + 1));
}
msgBox_mc._visible = true;
};
_root["armorPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["strikePlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelStrikePlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeStrike[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeStrike[indi] + "\nCoin Cost: ") + (hargaUpgradeStrike[indi - 1] * (levelStrikePlus + 1));
}
msgBox_mc._visible = true;
};
_root["strikePlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["slowPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelSlowPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeSlow[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeSlow[indi] + "\nCoin Cost: ") + (hargaUpgradeSlow[indi - 1] * (levelSlowPlus + 1));
}
msgBox_mc._visible = true;
};
_root["slowPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["luckPlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelLuckPlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeLuck[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeLuck[indi] + "\nCoin Cost: ") + (hargaUpgradeLuck[indi - 1] * (levelLuckPlus + 1));
}
msgBox_mc._visible = true;
};
_root["luckPlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
_root["rangePlus" + i].onRollOver = function () {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelRangePlus >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeRange[indi] + "\nFull Upgrade";
} else {
msgBox_mc.namaUpgrade = (namaUpgradeRange[indi] + "\nCoin Cost: ") + (hargaUpgradeRange[indi - 1] * (levelRangePlus + 1));
}
msgBox_mc._visible = true;
};
_root["rangePlus" + i].onRollOut = function () {
msgBox_mc._visible = false;
};
i++;
}
_root["manaPlus" + (levelManaPlus + 1)].gotoAndStop(1);
_root["manaPlus" + (levelManaPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeMana[levelManaPlus] * (levelManaPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeMana[levelManaPlus] * (levelManaPlus + 1));
levelManaPlus++;
cekUpgradeSkill();
}
};
_root["moneyPlus" + (levelMoneyPlus + 1)].gotoAndStop(1);
_root["moneyPlus" + (levelMoneyPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeMoney[levelMoneyPlus] * (levelMoneyPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeMoney[levelMoneyPlus] * (levelMoneyPlus + 1));
levelMoneyPlus++;
cekUpgradeSkill();
}
};
_root["expPlus" + (levelExpPlus + 1)].gotoAndStop(1);
_root["expPlus" + (levelExpPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeExp[levelExpPlus] * (levelExpPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeExp[levelExpPlus] * (levelExpPlus + 1));
levelExpPlus++;
cekUpgradeSkill();
}
};
_root["basePlus" + (levelBasePlus + 1)].gotoAndStop(1);
_root["basePlus" + (levelBasePlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeBase[levelBasePlus] * (levelBasePlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeBase[levelBasePlus] * (levelBasePlus + 1));
levelBasePlus++;
cekUpgradeSkill();
}
};
_root["recoveryPlus" + (levelRecoveryPlus + 1)].gotoAndStop(1);
_root["recoveryPlus" + (levelRecoveryPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeRecovery[levelRecoveryPlus] * (levelRecoveryPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeRecovery[levelRecoveryPlus] * (levelRecoveryPlus + 1));
levelRecoveryPlus++;
cekUpgradeSkill();
}
};
_root["delayPlus" + (levelDelayPlus + 1)].gotoAndStop(1);
_root["delayPlus" + (levelDelayPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeDelay[levelDelayPlus] * (levelDelayPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeDelay[levelDelayPlus] * (levelDelayPlus + 1));
levelDelayPlus++;
cekUpgradeSkill();
}
};
_root["hutPlus" + (levelHutPlus + 1)].gotoAndStop(1);
_root["hutPlus" + (levelHutPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeHut[levelHutPlus] * (levelHutPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeHut[levelHutPlus] * (levelHutPlus + 1));
levelHutPlus++;
cekUpgradeSkill();
}
};
_root["lifePlus" + (levelLifePlus + 1)].gotoAndStop(1);
_root["lifePlus" + (levelLifePlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeLife[levelLifePlus] * (levelLifePlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeLife[levelLifePlus] * (levelLifePlus + 1));
levelLifePlus++;
cekUpgradeSkill();
}
};
_root["enemyPlus" + (levelEnemyPlus + 1)].gotoAndStop(1);
_root["enemyPlus" + (levelEnemyPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeEnemy[levelEnemyPlus] * (levelEnemyPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeEnemy[levelEnemyPlus] * (levelEnemyPlus + 1));
levelEnemyPlus++;
cekUpgradeSkill();
}
};
_root["damagePlus" + (levelDamagePlus + 1)].gotoAndStop(1);
_root["damagePlus" + (levelDamagePlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeDamage[levelDamagePlus] * (levelDamagePlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeDamage[levelDamagePlus] * (levelDamagePlus + 1));
levelDamagePlus++;
cekUpgradeSkill();
}
};
_root["treasurePlus" + (levelTreasurePlus + 1)].gotoAndStop(1);
_root["treasurePlus" + (levelTreasurePlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeTreasure[levelTreasurePlus] * (levelTreasurePlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeTreasure[levelTreasurePlus] * (levelTreasurePlus + 1));
levelTreasurePlus++;
cekUpgradeSkill();
}
};
_root["cavePlus" + (levelCavePlus + 1)].gotoAndStop(1);
_root["cavePlus" + (levelCavePlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeCave[levelCavePlus] * (levelCavePlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeCave[levelCavePlus] * (levelCavePlus + 1));
levelCavePlus++;
cekUpgradeSkill();
}
};
_root["spellPlus" + (levelSpellPlus + 1)].gotoAndStop(1);
_root["spellPlus" + (levelSpellPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeSpell[levelSpellPlus] * (levelSpellPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeSpell[levelSpellPlus] * (levelSpellPlus + 1));
levelSpellPlus++;
cekUpgradeSkill();
}
};
_root["criticalPlus" + (levelCriticalPlus + 1)].gotoAndStop(1);
_root["criticalPlus" + (levelCriticalPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeCritical[levelCriticalPlus] * (levelCriticalPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeCritical[levelCriticalPlus] * (levelCriticalPlus + 1));
levelCriticalPlus++;
cekUpgradeSkill();
}
};
_root["speedPlus" + (levelSpeedPlus + 1)].gotoAndStop(1);
_root["speedPlus" + (levelSpeedPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeSpeed[levelSpeedPlus] * (levelSpeedPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeSpeed[levelSpeedPlus] * (levelSpeedPlus + 1));
levelSpeedPlus++;
cekUpgradeSkill();
}
};
_root["armorPlus" + (levelArmorPlus + 1)].gotoAndStop(1);
_root["armorPlus" + (levelArmorPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeArmor[levelArmorPlus] * (levelArmorPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeArmor[levelArmorPlus] * (levelArmorPlus + 1));
levelArmorPlus++;
cekUpgradeSkill();
}
};
_root["strikePlus" + (levelStrikePlus + 1)].gotoAndStop(1);
_root["strikePlus" + (levelStrikePlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeStrike[levelStrikePlus] * (levelStrikePlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeStrike[levelStrikePlus] * (levelStrikePlus + 1));
levelStrikePlus++;
cekUpgradeSkill();
}
};
_root["slowPlus" + (levelSlowPlus + 1)].gotoAndStop(1);
_root["slowPlus" + (levelSlowPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeSlow[levelSlowPlus] * (levelSlowPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeSlow[levelSlowPlus] * (levelSlowPlus + 1));
levelSlowPlus++;
cekUpgradeSkill();
}
};
_root["luckPlus" + (levelLuckPlus + 1)].gotoAndStop(1);
_root["luckPlus" + (levelLuckPlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeLuck[levelLuckPlus] * (levelLuckPlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeLuck[levelLuckPlus] * (levelLuckPlus + 1));
levelLuckPlus++;
cekUpgradeSkill();
}
};
_root["rangePlus" + (levelRangePlus + 1)].gotoAndStop(1);
_root["rangePlus" + (levelRangePlus + 1)].onRelease = function () {
if (coinKe >= (hargaUpgradeRange[levelRangePlus] * (levelRangePlus + 1))) {
totalBuyUpgrades++;
coinKe = coinKe - (hargaUpgradeRange[levelRangePlus] * (levelRangePlus + 1));
levelRangePlus++;
cekUpgradeSkill();
}
};
}
stop();
back_btn.onRelease = function () {
if (posisiWorldMap == 1) {
gotoAndStop (268);
} else if (posisiWorldMap == 2) {
gotoAndStop (269);
} else if (posisiWorldMap == 3) {
gotoAndStop (270);
} else if (posisiWorldMap == 4) {
gotoAndStop (271);
} else if (posisiWorldMap == 5) {
gotoAndStop (272);
}
};
msgBox_mc._visible = false;
msgBox_mc.onEnterFrame = function () {
if (_root._xmouse >= 590) {
this._x = (_root._xmouse - 65) - 50;
} else {
this._x = (_root._xmouse + 65) + 50;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
xcoinKe = "COIN: " + coinKe;
xmanaKe = "MANA: " + manaKe;
};
hargaUpgradeMana = new Array(100, 200, 300, 400);
namaUpgradeMana = new Array("", "Mana Plus Level 1\nIncrease mana gain 25% each kill the enemy.", "Mana Plus Level 2\nIncrease mana gain 50% each kill the enemy.", "Mana Plus Level 3\nIncrease mana gain 75% each kill the enemy.", "Mana Plus Level 4\nIncrease mana gain 100% each kill the enemy.");
hargaUpgradeMoney = new Array(100, 200, 300, 400);
namaUpgradeMoney = new Array("", "Gold Plus Level 1\nIncrease gold gain 25% each kill the enemy.", "Gold Plus Level 2\nIncrease gold gain 50% each kill the enemy.", "Gold Plus Level 3\nIncrease gold gain 75% each kill the enemy.", "Gold Plus Level 4\nIncrease gold gain 100% each kill the enemy.");
hargaUpgradeExp = new Array(100, 200, 300, 400);
namaUpgradeExp = new Array("", "Exp Plus Level 1\nIncrease exp gain 100% each kill the enemy.", "Exp Plus Level 2\nIncrease exp gain 200% each kill the enemy.", "Exp Plus Level 3\nIncrease exp gain 300% each kill the enemy.", "Exp Plus Level 4\nIncrease exp gain 400% each kill the enemy.");
hargaUpgradeBase = new Array(50, 100, 150, 200);
namaUpgradeBase = new Array("", "Life Plus Level 1\nIncrease Game Life 25% each level.", "Life Plus Level 2\nIncrease Game Life 50% each level.", "Life Plus Level 3\nIncrease Game Life 75% each level.", "Life Plus Level 4\nIncrease Game Life 100% each level.");
hargaUpgradeRecovery = new Array(200, 300, 400, 500);
namaUpgradeRecovery = new Array("", "Recovery Plus Level 1\nIncrease life recovery speed by 25%.", "Recovery Plus Level 2\nIncrease life recovery speed by 50%.", "Recovery Plus Level 3\nIncrease life recovery speed by 75%.", "Recovery Plus Level 4\nIncrease life recovery speed by 100%.");
hargaUpgradeDelay = new Array(200, 300, 400, 500);
namaUpgradeDelay = new Array("", "Delay Plus Level 1\nIncrease treasure regeneration by 25%.", "Delay Plus Level 2\nIncrease treasure regeneration by 50%.", "Delay Plus Level 3\nIncrease treasure regeneration by 75%.", "Delay Plus Level 4\nIncrease treasure regeneration by 100%.");
hargaUpgradeHut = new Array(500, 1000, 1500, 2000);
namaUpgradeHut = new Array("", "Hut Plus Level 1\nIncrease maximum hut capacity by 20%.", "Hut Plus Level 2\nIncrease maximum hut capacity by 30%.", "Hut Plus Level 3\nIncrease maximum hut capacity by 40%.", "Hut Plus Level 4\nIncrease maximum hut capacity by 50%.");
hargaUpgradeLife = new Array(250, 500, 750, 1000);
namaUpgradeLife = new Array("", "Life Plus Level 1\nIncrease all monster unit's life by 25%.", "Life Plus Level 2\nIncrease all monster unit's life by 50%.", "Life Plus Level 3\nIncrease all monster unit's life by 75%.", "Life Plus Level 4\nIncrease all monster unit's life by 100%.");
hargaUpgradeEnemy = new Array(50, 100, 150, 200);
namaUpgradeEnemy = new Array("", "Enemy Plus Level 1\nAdd enemy waves each level by 1 wave.", "Enemy Plus Level 2\nAdd enemy waves each level by 2 waves.", "Enemy Plus Level 3\nAdd enemy waves each level by 3 waves.", "Enemy Plus Level 4\nAdd enemy waves each level by 4 waves.");
hargaUpgradeDamage = new Array(250, 500, 750, 1000);
namaUpgradeDamage = new Array("", "Damage Plus Level 1\nIncrease all monster unit's damage by 25%.", "Damage Plus Level 2\nIncrease all monster unit's damage by 50%.", "Damage Plus Level 3\nIncrease all monster unit's damage by 75%.", "Damage Plus Level 4\nIncrease all monster unit's damage by 100%.");
hargaUpgradeTreasure = new Array(200, 400, 600, 800);
namaUpgradeTreasure = new Array("", "Treasure Plus Level 1\nIncrease treasure loads by 50%", "Treasure Plus Level 2\nIncrease treasure loads by 75%", "Treasure Plus Level 3\nIncrease treasure loads by 100%", "Treasure Plus Level 4\nIncrease treasure loads by 125%");
hargaUpgradeCave = new Array(500, 1000, 1500, 2000);
namaUpgradeCave = new Array("", "Cave Plus Level 1\nIncrease maximum cave capacity by 25%.", "Cave Plus Level 2\nIncrease maximum cave capacity by 50%.", "Cave Plus Level 3\nIncrease maximum cave capacity by 75%.", "Cave Plus Level 4\nIncrease maximum cave capacity by 100%.");
hargaUpgradeSpell = new Array(500, 1000, 1500, 2000);
namaUpgradeSpell = new Array("", "Spell Plus Level 1\nDecrease mana cost for all spells by 10%", "Spell Plus Level 2\nDecrease mana cost for all spells by 20%", "Spell Plus Level 3\nDecrease mana cost for all spells by 30%", "Spell Plus Level 4\nDecrease mana cost for all spells by 40%");
hargaUpgradeCritical = new Array(500, 1000, 1500, 2000);
namaUpgradeCritical = new Array("", "Critical Plus Level 1\nFaster critical spell hit by 20%", "Critical Plus Level 2\nFaster critical spell hit by 30%", "Critical Plus Level 3\nFaster critical spell hit by 40%", "Critical Plus Level 4\nFaster critical spell hit by 50%");
hargaUpgradeSpeed = new Array(200, 400, 600, 800);
namaUpgradeSpeed = new Array("", "Speed Plus Level 1\nIncrease all monster unit's speed by 25%.", "Speed Plus Level 2\nIncrease all monster unit's speed by 50%.", "Speed Plus Level 3\nIncrease all monster unit's speed by 75%.", "Speed Plus Level 4\nIncrease all monster unit's speed by 100%.");
hargaUpgradeArmor = new Array(200, 400, 600, 800);
namaUpgradeArmor = new Array("", "Armor Plus Level 1\nIncrease all monster unit's armor by 25%.", "Armor Plus Level 2\nIncrease all monster unit's armor by 50%.", "Armor Plus Level 3\nIncrease all monster unit's armor by 75%.", "Armor Plus Level 4\nIncrease all monster unit's armor by 100%.");
hargaUpgradeStrike = new Array(500, 1000, 1500, 2000);
namaUpgradeStrike = new Array("", "Strike Plus Level 1\nTarget two different strikes location at once.", "Strike Plus Level 2\nTarget three different strikes location at once.", "Strike Plus Level 3\nTarget four different strikes location at once.", "Strike Plus Level 4\nTarget five different strikes location at once.");
hargaUpgradeSlow = new Array(200, 400, 600, 800);
namaUpgradeSlow = new Array("", "Slow Plus Level 1\nSlow the enemy speed by 10%", "Slow Plus Level 2\nSlow the enemy speed by 20%", "Slow Plus Level 3\nSlow the enemy speed by 30%", "Slow Plus Level 4\nSlow the enemy speed by 40%");
hargaUpgradeLuck = new Array(200, 400, 600, 800);
namaUpgradeLuck = new Array("", "Luck Plus Level 1\nIncrease all monster unit's luck attack by 20%.", "Luck Plus Level 2\nIncrease all monster unit's luck attack by 30%.", "Luck Plus Level 3\nIncrease all monster unit's luck attack by 40%.", "Luck Plus Level 4\nIncrease all monster unit's luck attack by 50%.");
hargaUpgradeRange = new Array(200, 400, 600, 800);
namaUpgradeRange = new Array("", "Range Plus Level 1\nIncrease all monster unit's range by 5%.", "Range Plus Level 2\nIncrease all monster unit's range by 10%.", "Range Plus Level 3\nIncrease all monster unit's range by 15%.", "Range Plus Level 4\nIncrease all monster unit's range by 20%.");
cekUpgradeSkill();
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 274
function cekMonsterSkill() {
msgBox_mc._visible = false;
i = 1;
while (i <= 10) {
j = 1;
while (j <= 4) {
_root[("unit" + i) + j].gotoAndStop(2);
delete _root[("unit" + i) + j].onRelease;
delete _root[("spell" + i) + j].onRelease;
delete _root[("unit" + i) + j].onRollOver;
delete _root[("spell" + i) + j].onRollOver;
delete _root[("unit" + i) + j].onRollOut;
delete _root[("spell" + i) + j].onRollOut;
if (_root["levelSpell" + i] >= 4) {
_root[("spell" + i) + j].gotoAndStop(1);
_root[("spell" + i) + j].onRollOver = overSpell;
_root[("spell" + i) + j].onRollOut = outSpell;
} else {
_root[("spell" + i) + j].gotoAndStop(2);
}
if (_root["levelUnit" + i] >= 3) {
_root[("unit" + i) + j].gotoAndStop(1);
_root[("unit" + i) + j].onRollOver = overUnit;
_root[("unit" + i) + j].onRollOut = outUnit;
} else {
_root[("unit" + i) + j].gotoAndStop(2);
}
j++;
}
i++;
}
kiniLevelUnit = 0;
i = 1;
while (i <= 9) {
if (_root["levelUnit" + i] >= 1) {
j = _root["levelUnit" + i] + 1;
_root[("unit" + i) + j].gotoAndStop(1);
_root[("unit" + i) + j].onRelease = klikUnit;
_root[("unit" + i) + j].onRollOver = overUnit;
_root[("unit" + i) + j].onRollOut = outUnit;
} else if (kiniLevelUnit == 0) {
kiniLevelUnit = i;
}
i++;
}
i = kiniLevelUnit;
while (i <= kiniLevelUnit) {
j = _root["levelUnit" + i] + 1;
_root[("unit" + i) + j].gotoAndStop(1);
_root[("unit" + i) + j].onRelease = klikUnit;
_root[("unit" + i) + j].onRollOver = overUnit;
_root[("unit" + i) + j].onRollOut = outUnit;
i++;
}
kiniLevelSpell = 0;
i = 1;
while (i <= 10) {
if (_root["levelSpell" + i] >= 1) {
j = _root["levelSpell" + i] + 1;
_root[("spell" + i) + j].gotoAndStop(1);
_root[("spell" + i) + j].onRelease = klikSpell;
_root[("spell" + i) + j].onRollOver = overSpell;
_root[("spell" + i) + j].onRollOut = outSpell;
} else if (kiniLevelSpell == 0) {
kiniLevelSpell = i;
}
i++;
}
i = kiniLevelSpell;
while (i <= kiniLevelSpell) {
j = _root["levelSpell" + i] + 1;
_root[("spell" + i) + j].gotoAndStop(1);
_root[("spell" + i) + j].onRelease = klikSpell;
_root[("spell" + i) + j].onRollOver = overSpell;
_root[("spell" + i) + j].onRollOut = outSpell;
i++;
}
}
function klikUnit() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 3, 2))) {
indi = myStr.substr(myStr.length - 2, 1);
} else {
indi = myStr.substr(myStr.length - 3, 2);
}
if (_root["levelUnit" + indi] == 0) {
if (coinKe >= hargaBuyUnit[indi]) {
totalBuyUpgrades++;
coinKe = coinKe - hargaBuyUnit[indi];
_root["levelUnit" + indi]++;
}
}
cekMonsterSkill();
}
function overUnit() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 3, 2))) {
indi = myStr.substr(myStr.length - 2, 1);
} else {
indi = myStr.substr(myStr.length - 3, 2);
}
if (_root["levelUnit" + indi] == 0) {
msgBox_mc.namaUpgrade = (namaUpgradeMonster[indi] + ", Click this unit to unlock.\nCoin Cost: ") + hargaBuyUnit[indi];
} else if (_root["levelUnit" + indi] >= 3) {
msgBox_mc.namaUpgrade = namaUpgradeMonster[indi] + ", This unit is full upgraded.";
} else {
msgBox_mc.namaUpgrade = ((((((namaUpgradeMonster[indi] + ", Level ") + _root["levelUnit" + indi]) + ", Exp: ") + _root["kiniExp" + indi]) + "/") + (_root["maxExp" + indi] * _root["levelUnit" + indi])) + ", Use this unit on the battle to increases exp and level.";
}
msgBox_mc._visible = true;
}
function outUnit() {
msgBox_mc._visible = false;
}
function klikSpell() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 3, 2))) {
indi = myStr.substr(myStr.length - 2, 1);
} else {
indi = myStr.substr(myStr.length - 3, 2);
}
if (_root["levelSpell" + indi] == 0) {
if (manaKe >= hargaLockSpell[indi]) {
manaKe = manaKe - hargaLockSpell[indi];
_root["levelSpell" + indi]++;
}
} else if (manaKe >= (hargaBuySpell[indi] * _root["levelSpell" + indi])) {
totalBuyUpgrades++;
manaKe = manaKe - (hargaBuySpell[indi] * _root["levelSpell" + indi]);
_root["levelSpell" + indi]++;
}
cekMonsterSkill();
}
function overSpell() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 3, 2))) {
indi = myStr.substr(myStr.length - 2, 1);
} else {
indi = myStr.substr(myStr.length - 3, 2);
}
if (_root["levelSpell" + indi] == 0) {
msgBox_mc.namaUpgrade = (namaUpgradeSpell[indi] + ", Click this spell to unlock.\nMana Cost: ") + hargaLockSpell[indi];
} else if (_root["levelSpell" + indi] >= 4) {
msgBox_mc.namaUpgrade = namaUpgradeSpell[indi] + ", This spell is full upgraded.";
} else {
msgBox_mc.namaUpgrade = (((namaUpgradeSpell[indi] + ", Level ") + _root["levelSpell" + indi]) + ", Click this spell to upgrade.\nMana Cost: ") + (hargaBuySpell[indi] * _root["levelSpell" + indi]);
}
msgBox_mc._visible = true;
}
function outSpell() {
msgBox_mc._visible = false;
}
stop();
back_btn.onRelease = function () {
if (posisiWorldMap == 1) {
gotoAndStop (268);
} else if (posisiWorldMap == 2) {
gotoAndStop (269);
} else if (posisiWorldMap == 3) {
gotoAndStop (270);
} else if (posisiWorldMap == 4) {
gotoAndStop (271);
} else if (posisiWorldMap == 5) {
gotoAndStop (272);
}
};
msgBox_mc._visible = false;
msgBox_mc.onEnterFrame = function () {
if (_root._xmouse >= 590) {
this._x = (_root._xmouse - 65) - 50;
} else {
this._x = (_root._xmouse + 65) + 50;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
xcoinKe = "COIN: " + coinKe;
xmanaKe = "MANA: " + manaKe;
};
hargaBuyUnit = new Array("", 1000, 1500, 2000, 5000, 6000, 7500, 10000, 12500, 15000);
hargaLockSpell = new Array("", 250, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000);
hargaBuySpell = new Array("", 125, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500);
namaUpgradeMonster = new Array("", "Knife", "Sword", "Axe", "Crossbow", "Wand", "Dragon (Need Cave)", "Fire Dragon (Need Cave)", "Earth Dragon (Need Cave)", "Giant (Need Cave)");
namaUpgradeSpell = new Array("", "Fire (Burn The Enemy)", "Ice (Freeze The Enemy)", "Poison (Poison The Enemy)", "Stone (Dirrect Hit)", "Wind (Multiple Hit)", "Thunder (Add Fire Spell)", "Heal (Heal Nearby Units)", "Strom (Add Ice Spell)", "Protect (Protect Nearby Units)", "Confuse (Make Enemy Attack Ally");
cekMonsterSkill();
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 275
function upgradeBuilding() {
i = 1;
while (i <= 3) {
_root["hut" + i].gotoAndStop(2);
_root["tower" + i].gotoAndStop(2);
_root["cave" + i].gotoAndStop(2);
_root["hut" + i].onRollOver = overHut;
_root["hut" + i].onRollOut = outHut;
_root["tower" + i].onRollOver = overTower;
_root["tower" + i].onRollOut = outTower;
_root["cave" + i].onRollOver = overCave;
_root["cave" + i].onRollOut = outCave;
delete _root["hut" + i].onRelease;
delete _root["tower" + i].onRelease;
delete _root["cave" + i].onRelease;
if (levelHut >= 3) {
_root["hut" + i].gotoAndStop(1);
_root["hut" + i].onRollOver = overHut;
_root["hut" + i].onRollOut = outHut;
} else {
_root["hut" + i].gotoAndStop(2);
}
if (levelTower >= 3) {
_root["tower" + i].gotoAndStop(1);
_root["tower" + i].onRollOver = overTower;
_root["tower" + i].onRollOut = outTower;
} else {
_root["tower" + i].gotoAndStop(2);
}
if (levelCave >= 2) {
_root["cave" + i].gotoAndStop(1);
_root["cave" + i].onRollOver = overCave;
_root["cave" + i].onRollOut = outCave;
} else {
_root["cave" + i].gotoAndStop(2);
}
i++;
}
_root["hut" + (levelHut + 1)].gotoAndStop(1);
_root["hut" + (levelHut + 1)].onRelease = klikHut;
_root["tower" + (levelTower + 1)].gotoAndStop(1);
_root["tower" + (levelTower + 1)].onRelease = klikTower;
_root["tower" + (levelTower + 1)].onRollOver = overTower;
_root["tower" + (levelTower + 1)].onRollOut = outTower;
_root["cave" + (levelCave + 1)].gotoAndStop(1);
_root["cave" + (levelCave + 1)].onRelease = klikCave;
_root["cave" + (levelCave + 1)].onRollOver = overCave;
_root["cave" + (levelCave + 1)].onRollOut = outCave;
}
function klikHut() {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (coinKe >= hargaHut[indi]) {
totalBuyUpgrades++;
coinKe = coinKe - hargaHut[indi];
levelHut++;
upgradeBuilding();
}
}
function overHut() {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelHut == 0) {
if (this._currentframe == 1) {
msgBox_mc.namaUpgrade = (namaUpgradeHut[indi] + ", Click this hut to buy. Coin Cost: ") + hargaHut[indi];
} else {
msgBox_mc.namaUpgrade = namaUpgradeHut[indi];
}
} else if (levelHut >= 3) {
msgBox_mc.namaUpgrade = namaUpgradeHut[indi] + ", This hut is full upgraded.";
} else if (this._currentframe == 1) {
msgBox_mc.namaUpgrade = (((namaUpgradeHut[indi] + ", Max Unit Capacity: ") + _root["maxHutCapacity" + indi]) + ", Click to buy. Coin Cost: ") + hargaHut[indi];
} else {
msgBox_mc.namaUpgrade = (namaUpgradeHut[indi] + ", Max Unit Capacity: ") + _root["maxHutCapacity" + indi];
}
msgBox_mc._visible = true;
}
function outHut() {
msgBox_mc._visible = false;
}
function klikTower() {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (coinKe >= hargaTower[indi]) {
totalBuyUpgrades++;
coinKe = coinKe - hargaTower[indi];
levelTower++;
upgradeBuilding();
}
}
function overTower() {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (levelTower >= 3) {
msgBox_mc.namaUpgrade = namaUpgradeTower[indi] + ", This tower is full upgraded.";
} else if (this._currentframe == 1) {
msgBox_mc.namaUpgrade = (((namaUpgradeTower[indi] + ", Tower Damages: ") + _root["towerDamage" + indi]) + ", Click to buy. Coin Cost: ") + hargaTower[indi];
} else {
msgBox_mc.namaUpgrade = (namaUpgradeTower[indi] + ", Tower Damages: ") + _root["towerDamage" + indi];
}
msgBox_mc._visible = true;
}
function outTower() {
msgBox_mc._visible = false;
}
function klikCave() {
myStr = new String(this);
indi = myStr.substr(myStr.length - 1, 1);
if (coinKe >= hargaCave[indi]) {
totalBuyUpgrades++;
coinKe = coinKe - hargaCave[indi];
levelCave++;
upgradeBuilding();
}
}
function overCave() {
myStr = new String(this);
indi = Number(myStr.substr(myStr.length - 1, 1));
if (levelCave >= 2) {
msgBox_mc.namaUpgrade = namaUpgradeCave[indi] + ", This cave is full upgraded.";
} else if (this._currentframe == 1) {
msgBox_mc.namaUpgrade = (((namaUpgradeCave[indi] + ", Max Cave Capacity: ") + _root["maxCaveCapacity" + (indi + 6)]) + ", Click to buy. Coin Cost: ") + hargaCave[indi];
} else {
msgBox_mc.namaUpgrade = (namaUpgradeCave[indi] + ", Max Cave Capacity: ") + _root["maxCaveCapacity" + (indi + 6)];
}
msgBox_mc._visible = true;
}
function outCave() {
msgBox_mc._visible = false;
}
stop();
back_btn.onRelease = function () {
if (posisiWorldMap == 1) {
gotoAndStop (268);
} else if (posisiWorldMap == 2) {
gotoAndStop (269);
} else if (posisiWorldMap == 3) {
gotoAndStop (270);
} else if (posisiWorldMap == 4) {
gotoAndStop (271);
} else if (posisiWorldMap == 5) {
gotoAndStop (272);
}
};
msgBox_mc._visible = false;
msgBox_mc.onEnterFrame = function () {
if (_root._xmouse >= 590) {
this._x = (_root._xmouse - 65) - 50;
} else {
this._x = (_root._xmouse + 65) + 50;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
xcoinKe = "COIN: " + coinKe;
xmanaKe = "MANA: " + manaKe;
};
hargaHut = new Array("", 1000, 2000, 3000);
hargaTower = new Array("", 2000, 4000, 8000);
hargaCave = new Array("", 3000, 6000);
namaUpgradeHut = new Array("", "Small Hut", "Medium Hut", "Large Hut");
namaUpgradeTower = new Array("", "Ice Fire Tower", "Acid Wind Tower", "Mega Spells Tower");
namaUpgradeCave = new Array("", "Small Cave", "Large Cave");
upgradeBuilding();
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 276
function cekMagicSpell() {
hargaBuyMagicSpell = new Array("", 500, 750, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000);
namaUpgradeMagicSpell = new Array("", "Stone Rain", "Arrow Rain", "Shuriken Rain", "Acid Rain", "Fire Burn", "Snow Breeze", "Deadly Gas", "Lightning Blizt", "Mega Typhoon", "Earthquake", "Strom Wind", "Meteor Strike");
damageUpgradeMagicSpell = new Array("", 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300);
i = 1;
while (i <= 12) {
if (_root["magicPunya" + i] == true) {
_root["spell" + i].gotoAndStop(1);
delete _root["spell" + i].onRelease;
_root["spell" + i].onRollOver = overSpell;
_root["spell" + i].onRollOut = outSpell;
} else {
_root["spell" + i].gotoAndStop(2);
_root["spell" + i].onRelease = klikSpell;
_root["spell" + i].onRollOver = overSpell;
_root["spell" + i].onRollOut = outSpell;
}
i++;
}
}
function klikSpell() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = myStr.substr(myStr.length - 1, 1);
} else {
indi = myStr.substr(myStr.length - 2, 2);
}
if (manaKe >= hargaBuyMagicSpell[indi]) {
totalBuyUpgrades++;
manaKe = manaKe - hargaBuyMagicSpell[indi];
_root["magicPunya" + indi] = true;
cekMagicSpell();
}
}
function overSpell() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = myStr.substr(myStr.length - 1, 1);
} else {
indi = myStr.substr(myStr.length - 2, 2);
}
if (this._currentframe == 1) {
msgBox_mc.namaUpgrade = ((namaUpgradeMagicSpell[indi] + ", Damages: ") + damageUpgradeMagicSpell[indi]) + ", This spell is already owned";
} else {
msgBox_mc.namaUpgrade = (((namaUpgradeMagicSpell[indi] + ", Damages: ") + damageUpgradeMagicSpell[indi]) + ", Mana Cost: ") + hargaBuyMagicSpell[indi];
}
msgBox_mc._visible = true;
}
function outSpell() {
msgBox_mc._visible = false;
}
stop();
back_btn.onRelease = function () {
if (posisiWorldMap == 1) {
gotoAndStop (268);
} else if (posisiWorldMap == 2) {
gotoAndStop (269);
} else if (posisiWorldMap == 3) {
gotoAndStop (270);
} else if (posisiWorldMap == 4) {
gotoAndStop (271);
} else if (posisiWorldMap == 5) {
gotoAndStop (272);
}
};
msgBox_mc._visible = false;
msgBox_mc.onEnterFrame = function () {
if (_root._xmouse >= 590) {
this._x = (_root._xmouse - 65) - 50;
} else {
this._x = (_root._xmouse + 65) + 50;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
xcoinKe = "COIN: " + coinKe;
xmanaKe = "MANA: " + manaKe;
};
cekMagicSpell();
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 277
function overMedal() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
frameBox_mc = attachMovie("frameBox_mc", "frameBox_mc", 900);
frameBox_mc.gotoAndStop(3);
frameBox_mc._x = -500;
frameBox_mc._y = -500;
frameBox_mc.namaMsg = namaMedal[indi];
frameBox_mc.onEnterFrame = enterMsgBox;
}
function outMedal() {
removeMovieClip(frameBox_mc);
}
function enterMsgBox() {
if (_root._xmouse >= 590) {
this._x = (_root._xmouse - 65) - 50;
} else {
this._x = (_root._xmouse + 65) + 50;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
}
stop();
back_btn.onRelease = function () {
removeMovieClip(frameBox_mc);
if (posisiWorldMap == 1) {
gotoAndStop (268);
} else if (posisiWorldMap == 2) {
gotoAndStop (269);
} else if (posisiWorldMap == 3) {
gotoAndStop (270);
} else if (posisiWorldMap == 4) {
gotoAndStop (271);
} else if (posisiWorldMap == 5) {
gotoAndStop (272);
}
};
namaMedal = new Array("", "Win 6 Levels", "Win 12 Levels", "Win 18 Levels", "Win 24 Levels", "Win 30 Levels", "Win 36 Levels", "Win 42 Levels", "Win 48 Levels", "Win 54 Levels", "Win Final Boss Level", "Train 20 units", "Train 40 units", "Train 80 units", "Train 160 units", "Train 320 units", "Train 640 units", "Train 1280 units", "Train 2560 units", "Train 5120 units", "Train 10240 units", "Build 20 buildings", "Build 100 buildings", "Build 180 buildings", "Build 260 buildings", "Build 340 buildings", "Build 420 buildings", "Build 500 buildings", "Build 580 buildings", "Build 620 buildings", "Build 700 buildings", "Kill 400 enemies", "Kill 1400 enemies", "Kill 2400 enemies", "Kill 3400 enemies", "Kill 4400 enemies", "Kill 5400 enemies", "Kill 6400 enemies", "Kill 7400 enemies", "Kill 8400 enemies", "Kill 9400 enemies", "Buy 50 Upgrades", "Buy 60 Upgrades", "Buy 70 Upgrades", "Buy 80 Upgrades", "Buy 90 Upgrades", "Buy 100 Upgrades", "Buy 110 Upgrades", "Buy 120 Upgrades", "Buy 130 Upgrades", "Buy 140 Upgrades");
i = 1;
while (i <= 50) {
if (_root["dapatMedal" + i] == false) {
_root["medal" + i].gotoAndStop(2);
_root["medal" + i].onRollOver = overMedal;
_root["medal" + i].onRollOut = outMedal;
} else {
_root["medal" + i].gotoAndStop(1);
_root["medal" + i].onRollOver = overMedal;
_root["medal" + i].onRollOut = outMedal;
}
i++;
}
more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Frame 278
function initWave4() {
delayWave = 0;
maxWave = 500;
maxDelayMusuh = 100;
if (xlevelKe == 52) {
if (levelEnemyPlus == 0) {
waveMax = 2;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
} else if (xlevelKe == 53) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
} else if (xlevelKe == 54) {
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
} else if (xlevelKe == 55) {
if (levelEnemyPlus == 0) {
waveMax = 8;
} else if (levelEnemyPlus == 1) {
waveMax = 9;
} else if (levelEnemyPlus == 2) {
waveMax = 10;
} else if (levelEnemyPlus == 3) {
waveMax = 11;
} else if (levelEnemyPlus == 4) {
waveMax = 12;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
} else if (xlevelKe == 56) {
if (levelEnemyPlus == 0) {
waveMax = 9;
} else if (levelEnemyPlus == 1) {
waveMax = 10;
} else if (levelEnemyPlus == 2) {
waveMax = 11;
} else if (levelEnemyPlus == 3) {
waveMax = 12;
} else if (levelEnemyPlus == 4) {
waveMax = 13;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
}
if (xlevelKe == 57) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 8, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 8, 7, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 8, 7, 8, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 8, 7, 8, 7, 8);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8, 7, 8, 7, 8, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, 7, 8, 7, 8, 7, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 8, 7, 8, 7, 8, 7, 8, 7, 8);
}
}
if (xlevelKe == 58) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 8, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 8, 7, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 8, 7, 8, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 8, 7, 8, 7, 8);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8, 7, 8, 7, 8, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, 7, 8, 7, 8, 7, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 7, 8, 7, 8, 7, 8, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 7, 8, 7, 8, 7, 8, 7, 8);
}
}
if (xlevelKe == 59) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 4, 6, 4, 6, 4, 6, 4, 6, 4, 6, 4, 6, 4, 6, 4, 6, 4, 6, 4, 8, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 7, 5, 8, 8, 8, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 8, 8, 8, 8, 8);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
}
if (xlevelKe == 60) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 4, 7, 4, 7, 4, 7, 4, 7, 4, 7, 4, 7, 4, 7, 4, 7, 5, 7, 5, 7, 5, 7, 5, 7, 5, 7, 5, 7, 8, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 7, 6, 7, 3, 7, 6, 7, 3, 7, 6, 7, 3, 7, 6, 7, 3, 7, 6, 7, 3, 7, 6, 7, 3, 7, 6, 7, 3, 8, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 8, 6, 8, 6, 8, 6, 8, 6, 8, 6, 8, 6, 8, 6, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 8, 8, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
}
if (xlevelKe == 61) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 3, 4, 5, 6, 7, 8, 7, 6, 5, 6, 4, 3, 2, 6, 6, 3, 5, 7, 8, 6, 4, 5, 6, 7, 7, 5, 8, 8, 7, 7, 6, 6, 9, 9, 9);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 6, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 6, 4, 5, 6, 7, 8, 6, 9, 9, 9, 9);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 6, 7, 8, 9, 9, 9, 9, 9);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 8, 7, 8, 9, 9, 9, 9, 9, 9);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 9);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 9, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9);
}
}
awalDelayMusuh = maxDelayMusuh * 5;
xdelayMusuh = awalDelayMusuh;
kiniKeluarMusuh = 1;
maxKeluarMusuh = keluarMusuh.length;
selesaiWave = false;
}
function initWave3() {
delayWave = 0;
maxWave = 500;
maxDelayMusuh = 100;
if (xlevelKe == 42) {
maxDelayMusuh = 75;
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
}
} else if (xlevelKe == 43) {
maxDelayMusuh = 70;
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
}
} else if (xlevelKe == 44) {
maxDelayMusuh = 65;
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
}
} else if (xlevelKe == 45) {
maxDelayMusuh = 60;
if (levelEnemyPlus == 0) {
waveMax = 8;
} else if (levelEnemyPlus == 1) {
waveMax = 9;
} else if (levelEnemyPlus == 2) {
waveMax = 10;
} else if (levelEnemyPlus == 3) {
waveMax = 11;
} else if (levelEnemyPlus == 4) {
waveMax = 12;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
}
} else if (xlevelKe == 46) {
maxDelayMusuh = 55;
if (levelEnemyPlus == 0) {
waveMax = 9;
} else if (levelEnemyPlus == 1) {
waveMax = 10;
} else if (levelEnemyPlus == 2) {
waveMax = 11;
} else if (levelEnemyPlus == 3) {
waveMax = 12;
} else if (levelEnemyPlus == 4) {
waveMax = 13;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
}
}
if (xlevelKe == 47) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
} else if (xlevelKe == 48) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
} else if (xlevelKe == 49) {
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
} else if (xlevelKe == 50) {
if (levelEnemyPlus == 0) {
waveMax = 8;
} else if (levelEnemyPlus == 1) {
waveMax = 9;
} else if (levelEnemyPlus == 2) {
waveMax = 10;
} else if (levelEnemyPlus == 3) {
waveMax = 11;
} else if (levelEnemyPlus == 4) {
waveMax = 12;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
} else if (xlevelKe == 51) {
if (levelEnemyPlus == 0) {
waveMax = 9;
} else if (levelEnemyPlus == 1) {
waveMax = 10;
} else if (levelEnemyPlus == 2) {
waveMax = 11;
} else if (levelEnemyPlus == 3) {
waveMax = 12;
} else if (levelEnemyPlus == 4) {
waveMax = 13;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 8, 8, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 8, 8, 8, 8, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 5, 5, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 6, 7, 7, 8, 8);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 8, 8);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8);
}
}
awalDelayMusuh = maxDelayMusuh * 5;
xdelayMusuh = awalDelayMusuh;
kiniKeluarMusuh = 1;
maxKeluarMusuh = keluarMusuh.length;
selesaiWave = false;
}
function initWave2() {
delayWave = 0;
maxWave = 500;
maxDelayMusuh = 100;
if (xlevelKe == 25) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 2, 3, 3, 3, 4, 4, 5, 5);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
}
} else if (xlevelKe == 26) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 2, 3, 3, 3, 4, 4, 5, 5);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
}
} else if (xlevelKe == 27) {
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 2, 3, 3, 3, 4, 4, 5, 5);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
}
} else if (xlevelKe == 28) {
if (levelEnemyPlus == 0) {
waveMax = 8;
} else if (levelEnemyPlus == 1) {
waveMax = 9;
} else if (levelEnemyPlus == 2) {
waveMax = 10;
} else if (levelEnemyPlus == 3) {
waveMax = 11;
} else if (levelEnemyPlus == 4) {
waveMax = 12;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 1, 2, 2, 3, 3, 4, 4);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 2, 3, 3, 3, 4, 4, 5, 5);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
}
}
if (xlevelKe == 29) {
maxDelayMusuh = 65;
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 1, 2, 3, 4, 5);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
}
} else if (xlevelKe == 30) {
maxDelayMusuh = 60;
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 1, 2, 3, 4, 5);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
}
} else if (xlevelKe == 31) {
maxDelayMusuh = 55;
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 1, 2, 3, 4, 5);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
}
} else if (xlevelKe == 32) {
maxDelayMusuh = 50;
if (levelEnemyPlus == 0) {
waveMax = 8;
} else if (levelEnemyPlus == 1) {
waveMax = 9;
} else if (levelEnemyPlus == 2) {
waveMax = 10;
} else if (levelEnemyPlus == 3) {
waveMax = 11;
} else if (levelEnemyPlus == 4) {
waveMax = 12;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 1, 2, 3, 4, 5);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5);
}
}
if (xlevelKe == 33) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 6, 1, 6, 1, 6);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 6, 2, 6, 2, 6, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 3, 6, 3, 6, 3, 6, 3, 6);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 4, 6, 4, 6, 4, 6, 4, 6, 4);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 5, 6, 5, 6, 5, 6, 5, 6, 5, 6);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
}
} else if (xlevelKe == 34) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 6, 1, 6, 1, 6);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 6, 2, 6, 2, 6, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 3, 6, 3, 6, 3, 6, 3, 6);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 4, 6, 4, 6, 4, 6, 4, 6, 4);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 5, 6, 5, 6, 5, 6, 5, 6, 5, 6);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
}
} else if (xlevelKe == 35) {
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 6, 1, 6, 1, 6);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 6, 2, 6, 2, 6, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 3, 6, 3, 6, 3, 6, 3, 6);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 4, 6, 4, 6, 4, 6, 4, 6, 4);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 5, 6, 5, 6, 5, 6, 5, 6, 5, 6);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
}
} else if (xlevelKe == 36) {
if (levelEnemyPlus == 0) {
waveMax = 8;
} else if (levelEnemyPlus == 1) {
waveMax = 9;
} else if (levelEnemyPlus == 2) {
waveMax = 10;
} else if (levelEnemyPlus == 3) {
waveMax = 11;
} else if (levelEnemyPlus == 4) {
waveMax = 12;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 6, 1, 6, 1, 6);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 6, 2, 6, 2, 6, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 3, 6, 3, 6, 3, 6, 3, 6);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 4, 6, 4, 6, 4, 6, 4, 6, 4);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 5, 6, 5, 6, 5, 6, 5, 6, 5, 6);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 4, 5, 6, 4, 4, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6, 4, 5, 6);
}
}
if (xlevelKe == 37) {
maxDelayMusuh = 55;
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
}
} else if (xlevelKe == 38) {
maxDelayMusuh = 50;
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
}
} else if (xlevelKe == 39) {
maxDelayMusuh = 45;
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
}
} else if (xlevelKe == 40) {
maxDelayMusuh = 40;
if (levelEnemyPlus == 0) {
waveMax = 8;
} else if (levelEnemyPlus == 1) {
waveMax = 9;
} else if (levelEnemyPlus == 2) {
waveMax = 10;
} else if (levelEnemyPlus == 3) {
waveMax = 11;
} else if (levelEnemyPlus == 4) {
waveMax = 12;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
}
} else if (xlevelKe == 41) {
maxDelayMusuh = 35;
if (levelEnemyPlus == 0) {
waveMax = 9;
} else if (levelEnemyPlus == 1) {
waveMax = 10;
} else if (levelEnemyPlus == 2) {
waveMax = 11;
} else if (levelEnemyPlus == 3) {
waveMax = 12;
} else if (levelEnemyPlus == 4) {
waveMax = 13;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
} else if (waveKe == 13) {
keluarMusuh = new Array("", 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7);
}
}
awalDelayMusuh = maxDelayMusuh * 3;
xdelayMusuh = awalDelayMusuh;
kiniKeluarMusuh = 1;
maxKeluarMusuh = keluarMusuh.length;
selesaiWave = false;
}
function initWave() {
delayWave = 0;
maxWave = 500;
maxDelayMusuh = 100;
if (xlevelKe == 1) {
if (levelEnemyPlus == 0) {
waveMax = 3;
} else if (levelEnemyPlus == 1) {
waveMax = 4;
} else if (levelEnemyPlus == 2) {
waveMax = 5;
} else if (levelEnemyPlus == 3) {
waveMax = 6;
} else if (levelEnemyPlus == 4) {
waveMax = 7;
}
if (waveKe == 1) {
if (awalTutorial == true) {
keluarMusuh = new Array("", 1, 1, 1, 1);
} else {
keluarMusuh = new Array("", 1, 1, 1, 1, 1);
}
} else if (waveKe == 2) {
if (awalTutorial == true) {
keluarMusuh = new Array("", 1, 2, 1, 2, 1);
} else {
keluarMusuh = new Array("", 1, 2, 1, 2, 1, 2);
}
} else if (waveKe == 3) {
if (awalTutorial == true) {
keluarMusuh = new Array("", 1, 2, 1, 2, 1, 2);
} else {
keluarMusuh = new Array("", 1, 2, 1, 2, 1, 2, 1);
}
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 1, 2, 1, 2, 1, 2);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 2, 2, 2, 2, 2);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 2, 1, 2, 1, 2, 1, 2, 1);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 1, 1, 1, 2, 2, 2, 2, 2);
}
} else if (xlevelKe == 2) {
if (levelEnemyPlus == 0) {
waveMax = 4;
} else if (levelEnemyPlus == 1) {
waveMax = 5;
} else if (levelEnemyPlus == 2) {
waveMax = 6;
} else if (levelEnemyPlus == 3) {
waveMax = 7;
} else if (levelEnemyPlus == 4) {
waveMax = 8;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 1, 2, 1, 2, 1);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 2, 1, 2, 2, 1, 2, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
}
} else if (xlevelKe == 3) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 1, 2, 1, 2, 1);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 1, 2, 1, 2, 1, 2, 1, 2);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 1, 2, 1, 2, 1, 2, 1, 2, 1);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
}
} else if (xlevelKe == 4) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 1, 2, 1, 2, 1);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 2, 1, 2, 2, 1, 2, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
}
} else if (xlevelKe == 5) {
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
}
}
if (xlevelKe == 6) {
if (levelEnemyPlus == 0) {
waveMax = 3;
} else if (levelEnemyPlus == 1) {
waveMax = 4;
} else if (levelEnemyPlus == 2) {
waveMax = 5;
} else if (levelEnemyPlus == 3) {
waveMax = 6;
} else if (levelEnemyPlus == 4) {
waveMax = 7;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 3, 1, 3, 1, 3);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 3, 1, 3, 1, 3, 1);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 3, 1, 3, 1, 3, 1, 3, 1);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 1, 1, 1, 3, 3, 3, 3, 3);
}
} else if (xlevelKe == 7) {
if (levelEnemyPlus == 0) {
waveMax = 4;
} else if (levelEnemyPlus == 1) {
waveMax = 5;
} else if (levelEnemyPlus == 2) {
waveMax = 6;
} else if (levelEnemyPlus == 3) {
waveMax = 7;
} else if (levelEnemyPlus == 4) {
waveMax = 8;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 3, 1, 3, 3, 1, 3, 1);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
}
} else if (xlevelKe == 8) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 1, 3, 1, 3, 1);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 1, 3, 1, 1, 1, 3, 1);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 1, 3, 1, 3, 1, 3, 1, 3, 1);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
}
} else if (xlevelKe == 9) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 3, 3, 1, 3, 3, 1, 3, 3);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
}
} else if (xlevelKe == 10) {
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 3, 1, 3, 1, 3);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 3, 1, 3, 1, 3, 1, 3, 1);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 1, 3, 1, 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
}
}
if (xlevelKe == 11) {
if (levelEnemyPlus == 0) {
waveMax = 3;
} else if (levelEnemyPlus == 1) {
waveMax = 4;
} else if (levelEnemyPlus == 2) {
waveMax = 5;
} else if (levelEnemyPlus == 3) {
waveMax = 6;
} else if (levelEnemyPlus == 4) {
waveMax = 7;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3, 2);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3, 2, 3);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 2, 2, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3, 2, 3, 2);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 2, 2, 2, 2, 3, 3, 3, 3, 3);
}
} else if (xlevelKe == 12) {
if (levelEnemyPlus == 0) {
waveMax = 4;
} else if (levelEnemyPlus == 1) {
waveMax = 5;
} else if (levelEnemyPlus == 2) {
waveMax = 6;
} else if (levelEnemyPlus == 3) {
waveMax = 7;
} else if (levelEnemyPlus == 4) {
waveMax = 8;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 3, 2, 3, 3, 2, 3, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 3, 2, 3);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
}
} else if (xlevelKe == 13) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 2, 3, 2, 3, 2);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 2, 3, 2, 2, 2, 3, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 3, 2, 3);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 3, 2, 3, 2, 3, 2, 3, 2);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
}
} else if (xlevelKe == 14) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 3, 3, 2, 3, 3, 2, 3, 3);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 3, 2, 3);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
}
} else if (xlevelKe == 15) {
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3, 2, 3, 2);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3, 2, 3, 2, 3);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
}
}
if (xlevelKe == 16) {
if (levelEnemyPlus == 0) {
waveMax = 3;
} else if (levelEnemyPlus == 1) {
waveMax = 4;
} else if (levelEnemyPlus == 2) {
waveMax = 5;
} else if (levelEnemyPlus == 3) {
waveMax = 6;
} else if (levelEnemyPlus == 4) {
waveMax = 7;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 2, 3, 4);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 4, 2, 4, 2, 3);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 3, 2, 4, 2, 4, 2);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 2, 2, 3, 3, 3, 4);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 3, 2, 4, 2, 3, 4, 3);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 2, 2, 2, 2, 3, 3, 3, 4, 4);
}
} else if (xlevelKe == 17) {
if (levelEnemyPlus == 0) {
waveMax = 4;
} else if (levelEnemyPlus == 1) {
waveMax = 5;
} else if (levelEnemyPlus == 2) {
waveMax = 6;
} else if (levelEnemyPlus == 3) {
waveMax = 7;
} else if (levelEnemyPlus == 4) {
waveMax = 8;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 3, 2, 3, 4, 2, 4);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 4, 2, 4, 2);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 3, 2, 3, 2, 4, 2, 3, 4);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 3, 3, 3, 3, 4);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 4, 2, 3, 2, 4);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4);
}
} else if (xlevelKe == 18) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 2, 3, 4, 3, 4);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 2, 3, 2, 4, 2, 3, 4);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 3, 2, 3, 2, 4, 2, 4, 2, 4);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 3, 2, 4, 2, 3, 2, 3, 2);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 4, 2, 4, 2, 4);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 3, 2, 4, 2, 4, 2);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4);
}
} else if (xlevelKe == 19) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 3, 2, 3, 4, 4, 4);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 3, 3, 2, 3, 3, 3, 3, 4, 4);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 4, 4);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 3, 2, 4, 2, 4, 2, 4, 2, 4);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 2, 4, 4, 4, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 2, 3, 4, 2, 4, 3, 4, 3, 4, 3, 4);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 2, 4, 4, 4, 4, 4, 4);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4);
}
} else if (xlevelKe == 20) {
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 2, 4, 2, 4, 2, 4, 4, 4);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 2, 3, 2, 3, 2, 3, 2, 3, 4, 4);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 4, 3, 4, 3, 4, 3, 4, 3, 4, 4);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 3, 4, 3, 4, 2, 4, 2, 4, 3, 4, 4);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 2, 2, 3, 3, 3, 4, 4, 4, 3, 3, 3, 4, 4);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 2, 3, 2, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 3, 2, 3, 2, 3, 4, 3, 4, 3, 4, 3, 4, 4);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4);
}
}
if (xlevelKe == 21) {
if (levelEnemyPlus == 0) {
waveMax = 5;
} else if (levelEnemyPlus == 1) {
waveMax = 6;
} else if (levelEnemyPlus == 2) {
waveMax = 7;
} else if (levelEnemyPlus == 3) {
waveMax = 8;
} else if (levelEnemyPlus == 4) {
waveMax = 9;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 4, 1, 4, 1, 4);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
}
} else if (xlevelKe == 22) {
if (levelEnemyPlus == 0) {
waveMax = 6;
} else if (levelEnemyPlus == 1) {
waveMax = 7;
} else if (levelEnemyPlus == 2) {
waveMax = 8;
} else if (levelEnemyPlus == 3) {
waveMax = 9;
} else if (levelEnemyPlus == 4) {
waveMax = 10;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 4, 1, 4, 1, 4);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
}
} else if (xlevelKe == 23) {
if (levelEnemyPlus == 0) {
waveMax = 7;
} else if (levelEnemyPlus == 1) {
waveMax = 8;
} else if (levelEnemyPlus == 2) {
waveMax = 9;
} else if (levelEnemyPlus == 3) {
waveMax = 10;
} else if (levelEnemyPlus == 4) {
waveMax = 11;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 4, 1, 4, 1, 4);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
}
} else if (xlevelKe == 24) {
if (levelEnemyPlus == 0) {
waveMax = 8;
} else if (levelEnemyPlus == 1) {
waveMax = 9;
} else if (levelEnemyPlus == 2) {
waveMax = 10;
} else if (levelEnemyPlus == 3) {
waveMax = 11;
} else if (levelEnemyPlus == 4) {
waveMax = 12;
}
if (waveKe == 1) {
keluarMusuh = new Array("", 1, 4, 1, 4, 1, 4);
} else if (waveKe == 2) {
keluarMusuh = new Array("", 3, 1, 3, 1, 3, 1, 3);
} else if (waveKe == 3) {
keluarMusuh = new Array("", 1, 1, 1, 1, 1, 1, 1, 1);
} else if (waveKe == 4) {
keluarMusuh = new Array("", 2, 2, 2, 2, 2, 2, 2, 2, 2);
} else if (waveKe == 5) {
keluarMusuh = new Array("", 3, 3, 3, 3, 3, 3, 3, 3, 3, 3);
} else if (waveKe == 6) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
} else if (waveKe == 7) {
keluarMusuh = new Array("", 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4);
} else if (waveKe == 8) {
keluarMusuh = new Array("", 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4);
} else if (waveKe == 9) {
keluarMusuh = new Array("", 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4);
} else if (waveKe == 10) {
keluarMusuh = new Array("", 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4);
} else if (waveKe == 11) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
} else if (waveKe == 12) {
keluarMusuh = new Array("", 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4);
}
}
awalDelayMusuh = maxDelayMusuh * 3;
xdelayMusuh = awalDelayMusuh;
kiniKeluarMusuh = 1;
maxKeluarMusuh = keluarMusuh.length;
selesaiWave = false;
}
function buatBackground2() {
if (levelKe == 12) {
gubugDalam = false;
i = 1;
while (i <= 9) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 592;
gubug_mc._y = 470;
} else if (i == 2) {
gubug_mc._x = 419;
gubug_mc._y = 426;
} else if (i == 3) {
gubug_mc._x = 267;
gubug_mc._y = 461;
} else if (i == 4) {
gubug_mc._x = 177;
gubug_mc._y = 391;
} else if (i == 5) {
gubug_mc._x = 279;
gubug_mc._y = 307;
} else if (i == 6) {
gubug_mc._x = 101;
gubug_mc._y = 220;
} else if (i == 7) {
gubug_mc._x = 367;
gubug_mc._y = 186;
} else if (i == 8) {
gubug_mc._x = 499;
gubug_mc._y = 216;
} else if (i == 9) {
gubug_mc._x = 631;
gubug_mc._y = 207;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 24) {
pohon_mc = attachMovie("obyekKaktus", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 176;
pohon_mc._y = 180;
} else if (i == 2) {
pohon_mc._x = 227;
pohon_mc._y = 145;
} else if (i == 3) {
pohon_mc._x = 297;
pohon_mc._y = 166;
} else if (i == 4) {
pohon_mc._x = 369;
pohon_mc._y = 122;
} else if (i == 5) {
pohon_mc._x = 435;
pohon_mc._y = 197;
} else if (i == 6) {
pohon_mc._x = 566;
pohon_mc._y = 205;
} else if (i == 7) {
pohon_mc._x = 26;
pohon_mc._y = 279;
} else if (i == 8) {
pohon_mc._x = 0;
pohon_mc._y = 368;
} else if (i == 9) {
pohon_mc._x = 329;
pohon_mc._y = 427;
} else if (i == 10) {
pohon_mc._x = 481;
pohon_mc._y = 365;
} else if (i == 11) {
pohon_mc._x = 515;
pohon_mc._y = 445;
} else if (i == 12) {
pohon_mc._x = 625;
pohon_mc._y = 357;
} else if (i == 13) {
pohon_mc._x = 676;
pohon_mc._y = 441;
} else if (i == 14) {
pohon_mc._x = 728;
pohon_mc._y = 409;
} else if (i == 15) {
pohon_mc._x = 786;
pohon_mc._y = 371;
} else if (i == 16) {
pohon_mc._x = 770;
pohon_mc._y = 441;
} else if (i == 17) {
pohon_mc._x = 848;
pohon_mc._y = 434;
} else if (i == 18) {
pohon_mc._x = 49;
pohon_mc._y = 574;
} else if (i == 19) {
pohon_mc._x = 168;
pohon_mc._y = 619;
} else if (i == 20) {
pohon_mc._x = 386;
pohon_mc._y = 595;
} else if (i == 21) {
pohon_mc._x = 514;
pohon_mc._y = 614;
} else if (i == 22) {
pohon_mc._x = 644;
pohon_mc._y = 606;
} else if (i == 23) {
pohon_mc._x = 788;
pohon_mc._y = 606;
} else if (i == 24) {
pohon_mc._x = 796;
pohon_mc._y = 186;
}
pohon_mc.gotoAndStop(random(4) + 1);
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 13) {
gubugDalam = false;
i = 1;
while (i <= 9) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 674;
gubug_mc._y = 243;
} else if (i == 2) {
gubug_mc._x = 435;
gubug_mc._y = 249;
} else if (i == 3) {
gubug_mc._x = 676;
gubug_mc._y = 385;
} else if (i == 4) {
gubug_mc._x = 464;
gubug_mc._y = 454;
} else if (i == 5) {
gubug_mc._x = 350;
gubug_mc._y = 454;
} else if (i == 6) {
gubug_mc._x = 111;
gubug_mc._y = 416;
} else if (i == 7) {
gubug_mc._x = 333;
gubug_mc._y = 343;
} else if (i == 8) {
gubug_mc._x = 138;
gubug_mc._y = 279;
} else if (i == 9) {
gubug_mc._x = 333;
gubug_mc._y = 211;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
pohon_mc = attachMovie("obyekGunung", "obyek" + dalamObyek, dalamObyek);
pohon_mc._x = 422;
pohon_mc._y = 589;
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
} else if (levelKe == 14) {
gubugDalam = false;
i = 1;
while (i <= 8) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 111;
gubug_mc._y = 340;
} else if (i == 2) {
gubug_mc._x = 303;
gubug_mc._y = 246;
} else if (i == 3) {
gubug_mc._x = 329;
gubug_mc._y = 426;
} else if (i == 4) {
gubug_mc._x = 213;
gubug_mc._y = 502;
} else if (i == 5) {
gubug_mc._x = 744;
gubug_mc._y = 340;
} else if (i == 6) {
gubug_mc._x = 551;
gubug_mc._y = 246;
} else if (i == 7) {
gubug_mc._x = 532;
gubug_mc._y = 426;
} else if (i == 8) {
gubug_mc._x = 635;
gubug_mc._y = 502;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 8) {
pohon_mc = attachMovie("obyekCemara", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 8;
pohon_mc._y = 343;
} else if (i == 2) {
pohon_mc._x = 846;
pohon_mc._y = 343;
} else if (i == 3) {
pohon_mc._x = 429;
pohon_mc._y = 387;
} else if (i == 4) {
pohon_mc._x = 400;
pohon_mc._y = 468;
} else if (i == 5) {
pohon_mc._x = 463;
pohon_mc._y = 468;
} else if (i == 6) {
pohon_mc._x = 371;
pohon_mc._y = 549;
} else if (i == 7) {
pohon_mc._x = 432;
pohon_mc._y = 549;
} else if (i == 8) {
pohon_mc._x = 492;
pohon_mc._y = 549;
}
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 15) {
gubugDalam = false;
i = 1;
while (i <= 7) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 65;
gubug_mc._y = 161;
} else if (i == 2) {
gubug_mc._x = 65;
gubug_mc._y = 294;
} else if (i == 3) {
gubug_mc._x = 65;
gubug_mc._y = 432;
} else if (i == 4) {
gubug_mc._x = 65;
gubug_mc._y = 564;
} else if (i == 5) {
gubug_mc._x = 231;
gubug_mc._y = 368;
} else if (i == 6) {
gubug_mc._x = 371;
gubug_mc._y = 161;
} else if (i == 7) {
gubug_mc._x = 371;
gubug_mc._y = 565;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 12) {
pohon_mc = attachMovie("obyekBunga", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 839;
pohon_mc._y = 243;
} else if (i == 2) {
pohon_mc._x = 775;
pohon_mc._y = 243;
} else if (i == 3) {
pohon_mc._x = 703;
pohon_mc._y = 232;
} else if (i == 4) {
pohon_mc._x = 627;
pohon_mc._y = 223;
} else if (i == 5) {
pohon_mc._x = 557;
pohon_mc._y = 205;
} else if (i == 6) {
pohon_mc._x = 474;
pohon_mc._y = 186;
} else if (i == 7) {
pohon_mc._x = 835;
pohon_mc._y = 444;
} else if (i == 8) {
pohon_mc._x = 765;
pohon_mc._y = 453;
} else if (i == 9) {
pohon_mc._x = 691;
pohon_mc._y = 458;
} else if (i == 10) {
pohon_mc._x = 611;
pohon_mc._y = 468;
} else if (i == 11) {
pohon_mc._x = 534;
pohon_mc._y = 481;
} else if (i == 12) {
pohon_mc._x = 456;
pohon_mc._y = 509;
}
pohon_mc.gotoAndStop(random(4) + 1);
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 16) {
gubugDalam = false;
i = 1;
while (i <= 7) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 176;
gubug_mc._y = 241;
} else if (i == 2) {
gubug_mc._x = 296;
gubug_mc._y = 255;
} else if (i == 3) {
gubug_mc._x = 506;
gubug_mc._y = 255;
} else if (i == 4) {
gubug_mc._x = 632;
gubug_mc._y = 241;
} else if (i == 5) {
gubug_mc._x = 216;
gubug_mc._y = 354;
} else if (i == 6) {
gubug_mc._x = 403;
gubug_mc._y = 354;
} else if (i == 7) {
gubug_mc._x = 582;
gubug_mc._y = 354;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 10) {
pohon_mc = attachMovie("obyekKaktus", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 87;
pohon_mc._y = 115;
} else if (i == 2) {
pohon_mc._x = 717;
pohon_mc._y = 115;
} else if (i == 3) {
pohon_mc._x = 402;
pohon_mc._y = 291;
} else if (i == 4) {
pohon_mc._x = 49;
pohon_mc._y = 377;
} else if (i == 5) {
pohon_mc._x = 763;
pohon_mc._y = 373;
} else if (i == 6) {
pohon_mc._x = 184;
pohon_mc._y = 503;
} else if (i == 7) {
pohon_mc._x = 624;
pohon_mc._y = 503;
} else if (i == 8) {
pohon_mc._x = 408;
pohon_mc._y = 554;
} else if (i == 9) {
pohon_mc._x = 264;
pohon_mc._y = 635;
} else if (i == 10) {
pohon_mc._x = 541;
pohon_mc._y = 627;
}
pohon_mc.gotoAndStop(random(4) + 1);
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 17) {
gubugDalam = false;
i = 1;
while (i <= 9) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 593;
gubug_mc._y = 346;
} else if (i == 2) {
gubug_mc._x = 373;
gubug_mc._y = 346;
} else if (i == 3) {
gubug_mc._x = 698;
gubug_mc._y = 186;
} else if (i == 4) {
gubug_mc._x = 484;
gubug_mc._y = 186;
} else if (i == 5) {
gubug_mc._x = 265;
gubug_mc._y = 186;
} else if (i == 6) {
gubug_mc._x = 64;
gubug_mc._y = 186;
} else if (i == 7) {
gubug_mc._x = 64;
gubug_mc._y = 350;
} else if (i == 8) {
gubug_mc._x = 64;
gubug_mc._y = 511;
} else if (i == 9) {
gubug_mc._x = 483;
gubug_mc._y = 479;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
}
i = 1;
while (i <= 9) {
if (gubugDalam == true) {
background_mc["gubug_mc" + i].gotoAndStop(10);
} else {
_root["gubug_mc" + i].gotoAndStop(10);
}
i++;
}
i = 1;
while (i <= 9) {
if (gubugDalam == true) {
if (background_mc["gubug_mc" + i]._currentframe != 10) {
background_mc["gubug_mc" + i].onRelease = klikGubug;
} else {
background_mc["gubug_mc" + i].onRelease = buatBuilding;
}
background_mc["gubug_mc" + i].spell_mc.gotoAndStop(_root["spellGubug" + i]);
background_mc["gubug_mc" + i].pakaiGubug = 0;
background_mc["gubug_mc" + i].nomor = i;
if (background_mc["gubug_mc" + i]._currentframe <= 3) {
background_mc["gubug_mc" + i].maxHut = (background_mc["gubug_mc" + i].pakaiGubug + "/") + _root["maxHutCapacity" + background_mc["gubug_mc" + i]._currentframe];
} else if (background_mc["gubug_mc" + i]._currentframe >= 7) {
background_mc["gubug_mc" + i].maxHut = (background_mc["gubug_mc" + i].pakaiGubug + "/") + _root["maxCaveCapacity" + background_mc["gubug_mc" + i]._currentframe];
}
} else {
if (_root["gubug_mc" + i]._currentframe != 10) {
_root["gubug_mc" + i].onRelease = klikGubug;
} else {
_root["gubug_mc" + i].onRelease = buatBuilding;
}
_root["gubug_mc" + i].spell_mc.gotoAndStop(_root["spellGubug" + i]);
_root["gubug_mc" + i].pakaiGubug = 0;
_root["gubug_mc" + i].nomor = i;
if (_root["gubug_mc" + i]._currentframe <= 3) {
_root["gubug_mc" + i].maxHut = (_root["gubug_mc" + i].pakaiGubug + "/") + _root["maxHutCapacity" + _root["gubug_mc" + i]._currentframe];
} else if (_root["gubug_mc" + i]._currentframe >= 7) {
_root["gubug_mc" + i].maxHut = (_root["gubug_mc" + i].pakaiGubug + "/") + _root["maxCaveCapacity" + _root["gubug_mc" + i]._currentframe];
}
}
i++;
}
i = 1;
while (i <= 9) {
if (gubugDalam == true) {
if (background_mc["gubug_mc" + i]._x != undefined) {
tombolLain = attachMovie("tombolLain", "tombolLain" + i, dalamTombolLain);
if (background_mc["gubug_mc" + i]._currentframe == 10) {
tombolLain._visible = false;
}
if (levelKe >= 7) {
tombolLain._xscale = 75;
tombolLain._yscale = 75;
tombolLain._x = background_mc["gubug_mc" + i]._x + 40;
tombolLain._y = background_mc["gubug_mc" + i]._y - 75;
} else {
tombolLain._x = background_mc["gubug_mc" + i]._x + 50;
tombolLain._y = background_mc["gubug_mc" + i]._y - 90;
}
tombolLain.attackDefense.gotoAndStop(2);
tombolLain.posisiKe = i;
tombolLain.attackDefense._xscale = (tombolLain.attackDefense._yscale = 100);
tombolLain.attackDefense.huruf_mc._visible = false;
tombolLain.attackDefense.onRollOver = overUnit2;
tombolLain.attackDefense.onRollOut = outUnit2;
tombolLain.attackDefense.onRelease = setAttackDefense;
tombolLain.attackDefense.xinfo = "";
tombolLain.selectMagic._xscale = (tombolLain.selectMagic._yscale = 100);
tombolLain.selectMagic.onRollOver = overUnit;
tombolLain.selectMagic.onRollOut = outUnit;
tombolLain.selectMagic.onRelease = klikSelectMagic;
tombolLain.upgradeBuilding._xscale = (tombolLain.upgradeBuilding._yscale = 100);
tombolLain.upgradeBuilding.onRollOver = overUnit;
tombolLain.upgradeBuilding.onRollOut = outUnit;
tombolLain.upgradeBuilding.onRelease = klikUpgradeBuilding;
tombolLain.upgradeBuilding.sudahKlik = false;
tombolLain.upgradeBuilding._visible = false;
tombolLain.sellBuilding._xscale = (tombolLain.sellBuilding._yscale = 100);
tombolLain.sellBuilding.onRollOver = overUnit;
tombolLain.sellBuilding.onRollOut = outUnit;
tombolLain.sellBuilding.onRelease = klikSellBuilding;
dalamTombolLain++;
}
} else if (_root["gubug_mc" + i]._x != undefined) {
tombolLain = attachMovie("tombolLain", "tombolLain" + i, dalamTombolLain);
if (_root["gubug_mc" + i]._currentframe == 10) {
tombolLain._visible = false;
}
if (levelKe >= 7) {
tombolLain._xscale = 75;
tombolLain._yscale = 75;
tombolLain._x = _root["gubug_mc" + i]._x + 40;
tombolLain._y = _root["gubug_mc" + i]._y - 75;
} else {
tombolLain._x = _root["gubug_mc" + i]._x + 50;
tombolLain._y = _root["gubug_mc" + i]._y - 90;
}
tombolLain.attackDefense.gotoAndStop(2);
tombolLain.posisiKe = i;
tombolLain.attackDefense._xscale = (tombolLain.attackDefense._yscale = 100);
tombolLain.attackDefense.huruf_mc._visible = false;
tombolLain.attackDefense.onRollOver = overUnit2;
tombolLain.attackDefense.onRollOut = outUnit2;
tombolLain.attackDefense.onRelease = setAttackDefense;
tombolLain.attackDefense.xinfo = "";
tombolLain.selectMagic._xscale = (tombolLain.selectMagic._yscale = 100);
tombolLain.selectMagic.onRollOver = overUnit;
tombolLain.selectMagic.onRollOut = outUnit;
tombolLain.selectMagic.onRelease = klikSelectMagic;
tombolLain.upgradeBuilding._xscale = (tombolLain.upgradeBuilding._yscale = 100);
tombolLain.upgradeBuilding.onRollOver = overUnit;
tombolLain.upgradeBuilding.onRollOut = outUnit;
tombolLain.upgradeBuilding.onRelease = klikUpgradeBuilding;
tombolLain.upgradeBuilding.sudahKlik = false;
tombolLain.upgradeBuilding._visible = false;
tombolLain.sellBuilding._xscale = (tombolLain.sellBuilding._yscale = 100);
tombolLain.sellBuilding.onRollOver = overUnit;
tombolLain.sellBuilding.onRollOut = outUnit;
tombolLain.sellBuilding.onRelease = klikSellBuilding;
dalamTombolLain++;
}
i++;
}
}
function buatBackground() {
background_mc = attachMovie("background" + levelKe, "background_mc", dalamBackground);
background_mc._x = 0;
background_mc._y = 0;
i = 0;
while (i <= 30) {
background_mc["merah" + i]._alpha = 0;
background_mc["kuning" + i]._alpha = 0;
background_mc["hijau" + i]._alpha = 0;
i++;
}
if (levelKe == 2) {
panahKeluar = attachMovie("obyekLevel" + levelKe, "obyekLain" + dalamPanah, dalamPanah);
panahKeluar._x = 579;
panahKeluar._y = 623;
panahKeluar.onEnterFrame = enterEfek;
dalamPanah++;
} else if (levelKe == 5) {
panahKeluar = attachMovie("obyekLevel" + levelKe, "obyekLain" + dalamPanah, dalamPanah);
panahKeluar._x = 507;
panahKeluar._y = 313;
panahKeluar.onEnterFrame = enterEfek;
dalamPanah++;
}
monsterMuncul = attachMovie("monsterMuncul", "obyekLain" + dalamPanah, dalamMonsterMuncul);
if (levelKe == 1) {
monsterMuncul._x = 60;
monsterMuncul._y = 100;
} else if (levelKe == 2) {
monsterMuncul._x = 180;
monsterMuncul._y = 560;
} else if (levelKe == 3) {
monsterMuncul._x = 39;
monsterMuncul._y = 92;
} else if (levelKe == 4) {
monsterMuncul._x = 35;
monsterMuncul._y = 75;
} else if (levelKe == 5) {
monsterMuncul._x = 748;
monsterMuncul._y = 267;
} else if (levelKe == 6) {
monsterMuncul._x = 50;
monsterMuncul._y = 307;
} else if (levelKe == 7) {
monsterMuncul._x = 38;
monsterMuncul._y = 541;
} else if (levelKe == 8) {
monsterMuncul._x = 415;
monsterMuncul._y = 340;
} else if (levelKe == 9) {
monsterMuncul._x = 742;
monsterMuncul._y = 100;
} else if (levelKe == 10) {
monsterMuncul._x = 400;
monsterMuncul._y = 558;
} else if (levelKe == 11) {
monsterMuncul._x = 409;
monsterMuncul._y = 94;
} else if (levelKe == 12) {
monsterMuncul._x = 758;
monsterMuncul._y = 492;
} else if (levelKe == 13) {
monsterMuncul._x = 728;
monsterMuncul._y = 126;
} else if (levelKe == 14) {
monsterMuncul._x = 426;
monsterMuncul._y = 92;
} else if (levelKe == 15) {
monsterMuncul._x = 738;
monsterMuncul._y = 362;
} else if (levelKe == 16) {
monsterMuncul._x = 402;
monsterMuncul._y = 100;
} else if (levelKe == 17) {
monsterMuncul._x = 752;
monsterMuncul._y = 396;
}
monsterMuncul._visible = true;
monsterMuncul.onRelease = klikMonsterMuncul;
dalamPanah++;
if (levelKe <= 2) {
gubugDalam = true;
} else if (levelKe == 3) {
gubugDalam = false;
i = 1;
while (i <= 4) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 708;
gubug_mc._y = 213;
} else if (i == 2) {
gubug_mc._x = 142;
gubug_mc._y = 159;
} else if (i == 3) {
gubug_mc._x = 105;
gubug_mc._y = 515;
} else if (i == 4) {
gubug_mc._x = 644;
gubug_mc._y = 443;
}
gubug_mc._y = gubug_mc._y + 40;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 12) {
pohon_mc = attachMovie("pohon_mc3", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 625;
pohon_mc._y = 17;
} else if (i == 2) {
pohon_mc._x = 253;
pohon_mc._y = 129;
} else if (i == 3) {
pohon_mc._x = 57;
pohon_mc._y = 184;
} else if (i == 4) {
pohon_mc._x = 486;
pohon_mc._y = 286;
} else if (i == 5) {
pohon_mc._x = 291;
pohon_mc._y = 321;
} else if (i == 6) {
pohon_mc._x = 58;
pohon_mc._y = 439;
} else if (i == 7) {
pohon_mc._x = 401;
pohon_mc._y = 399;
} else if (i == 8) {
pohon_mc._x = 539;
pohon_mc._y = 412;
} else if (i == 9) {
pohon_mc._x = 804;
pohon_mc._y = 331;
} else if (i == 10) {
pohon_mc._x = 315;
pohon_mc._y = 551;
} else if (i == 11) {
pohon_mc._x = 508;
pohon_mc._y = 561;
} else if (i == 12) {
pohon_mc._x = 779;
pohon_mc._y = 131;
}
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc._y = pohon_mc._y + 50;
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 4) {
gubugDalam = false;
i = 1;
while (i <= 4) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 99;
gubug_mc._y = 366;
} else if (i == 2) {
gubug_mc._x = 562;
gubug_mc._y = 134;
} else if (i == 3) {
gubug_mc._x = 628;
gubug_mc._y = 289;
} else if (i == 4) {
gubug_mc._x = 621;
gubug_mc._y = 438;
}
gubug_mc._y = gubug_mc._y + 40;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 5) {
gubugDalam = false;
i = 1;
while (i <= 4) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 294;
gubug_mc._y = 495;
} else if (i == 2) {
gubug_mc._x = 238;
gubug_mc._y = 176;
} else if (i == 3) {
gubug_mc._x = 455;
gubug_mc._y = 273;
} else if (i == 4) {
gubug_mc._x = 563;
gubug_mc._y = 375;
}
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 10) {
pohon_mc = attachMovie("pohon_mc5", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 37;
pohon_mc._y = 186;
} else if (i == 2) {
pohon_mc._x = 177;
pohon_mc._y = 68;
} else if (i == 3) {
pohon_mc._x = 342;
pohon_mc._y = 41;
} else if (i == 4) {
pohon_mc._x = 747;
pohon_mc._y = 40;
} else if (i == 5) {
pohon_mc._x = 88;
pohon_mc._y = 387;
} else if (i == 6) {
pohon_mc._x = 96;
pohon_mc._y = 586;
} else if (i == 7) {
pohon_mc._x = 388;
pohon_mc._y = 590;
} else if (i == 8) {
pohon_mc._x = 746;
pohon_mc._y = 620;
} else if (i == 9) {
pohon_mc._x = 801;
pohon_mc._y = 426;
} else if (i == 10) {
pohon_mc._x = 747;
pohon_mc._y = 40;
}
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc._y = pohon_mc._y + 50;
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 6) {
gubugDalam = false;
i = 1;
while (i <= 3) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 2) {
gubug_mc._x = 362;
gubug_mc._y = 193;
} else if (i == 1) {
gubug_mc._x = 364;
gubug_mc._y = 543;
} else if (i == 3) {
gubug_mc._x = 539;
gubug_mc._y = 377;
}
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 5) {
pohon_mc = attachMovie("pohon6" + i, "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 131;
pohon_mc._y = 186;
} else if (i == 2) {
pohon_mc._x = 617;
pohon_mc._y = 6;
} else if (i == 3) {
pohon_mc._x = 128;
pohon_mc._y = 414;
} else if (i == 4) {
pohon_mc._x = 691;
pohon_mc._y = 562;
} else if (i == 5) {
pohon_mc._x = 722;
pohon_mc._y = 247;
}
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 7) {
gubugDalam = false;
i = 1;
while (i <= 9) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 147;
gubug_mc._y = 491;
} else if (i == 2) {
gubug_mc._x = 345;
gubug_mc._y = 491;
} else if (i == 3) {
gubug_mc._x = 508;
gubug_mc._y = 478;
} else if (i == 4) {
gubug_mc._x = 644;
gubug_mc._y = 424;
} else if (i == 5) {
gubug_mc._x = 250;
gubug_mc._y = 349;
} else if (i == 6) {
gubug_mc._x = 99;
gubug_mc._y = 339;
} else if (i == 7) {
gubug_mc._x = 314;
gubug_mc._y = 215;
} else if (i == 8) {
gubug_mc._x = 508;
gubug_mc._y = 211;
} else if (i == 9) {
gubug_mc._x = 694;
gubug_mc._y = 210;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 12) {
pohon_mc = attachMovie("pohon7", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 45;
pohon_mc._y = 47;
} else if (i == 2) {
pohon_mc._x = 0;
pohon_mc._y = 260;
} else if (i == 3) {
pohon_mc._x = 0;
pohon_mc._y = 158;
} else if (i == 4) {
pohon_mc._x = 784;
pohon_mc._y = 242;
} else if (i == 5) {
pohon_mc._x = 784;
pohon_mc._y = 242;
} else if (i == 6) {
pohon_mc._x = 135;
pohon_mc._y = 367;
} else if (i == 7) {
pohon_mc._x = 233;
pohon_mc._y = 445;
} else if (i == 8) {
pohon_mc._x = 338;
pohon_mc._y = 320;
} else if (i == 9) {
pohon_mc._x = 417;
pohon_mc._y = 379;
} else if (i == 10) {
pohon_mc._x = 485;
pohon_mc._y = 307;
} else if (i == 11) {
pohon_mc._x = 618;
pohon_mc._y = 326;
} else if (i == 12) {
pohon_mc._x = 772;
pohon_mc._y = 553;
}
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 8) {
gubugDalam = false;
i = 1;
while (i <= 3) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 418;
gubug_mc._y = 506;
} else if (i == 2) {
gubug_mc._x = 241;
gubug_mc._y = 344;
} else if (i == 3) {
gubug_mc._x = 419;
gubug_mc._y = 193;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 2) {
pohon_mc = attachMovie("obyek8" + i, "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 98;
pohon_mc._y = 281;
} else if (i == 2) {
pohon_mc._x = 728;
pohon_mc._y = 300;
}
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 9) {
gubugDalam = false;
i = 1;
while (i <= 9) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 120;
gubug_mc._y = 167;
} else if (i == 2) {
gubug_mc._x = 398;
gubug_mc._y = 232;
} else if (i == 3) {
gubug_mc._x = 637;
gubug_mc._y = 266;
} else if (i == 4) {
gubug_mc._x = 649;
gubug_mc._y = 512;
} else if (i == 5) {
gubug_mc._x = 519;
gubug_mc._y = 473;
} else if (i == 6) {
gubug_mc._x = 398;
gubug_mc._y = 440;
} else if (i == 7) {
gubug_mc._x = 221;
gubug_mc._y = 463;
} else if (i == 8) {
gubug_mc._x = 100;
gubug_mc._y = 328;
} else if (i == 9) {
gubug_mc._x = 325;
gubug_mc._y = 331;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 5) {
pohon_mc = attachMovie("obyekBunga", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 346;
pohon_mc._y = 110;
} else if (i == 2) {
pohon_mc._x = 161;
pohon_mc._y = 194;
} else if (i == 3) {
pohon_mc._x = 765;
pohon_mc._y = 142;
} else if (i == 4) {
pohon_mc._x = 769;
pohon_mc._y = 358;
} else if (i == 5) {
pohon_mc._x = 360;
pohon_mc._y = 545;
}
pohon_mc.gotoAndStop(random(4) + 1);
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 10) {
gubugDalam = false;
i = 1;
while (i <= 6) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 320;
gubug_mc._y = 446;
} else if (i == 2) {
gubug_mc._x = 479;
gubug_mc._y = 446;
} else if (i == 3) {
gubug_mc._x = 323;
gubug_mc._y = 216;
} else if (i == 4) {
gubug_mc._x = 476;
gubug_mc._y = 216;
} else if (i == 5) {
gubug_mc._x = 159;
gubug_mc._y = 324;
} else if (i == 6) {
gubug_mc._x = 668;
gubug_mc._y = 324;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 10) {
pohon_mc = attachMovie("obyekBunga", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 40;
pohon_mc._y = 158;
} else if (i == 2) {
pohon_mc._x = 404;
pohon_mc._y = 190;
} else if (i == 3) {
pohon_mc._x = 767;
pohon_mc._y = 178;
} else if (i == 4) {
pohon_mc._x = 262;
pohon_mc._y = 302;
} else if (i == 5) {
pohon_mc._x = 551;
pohon_mc._y = 307;
} else if (i == 6) {
pohon_mc._x = 40;
pohon_mc._y = 425;
} else if (i == 7) {
pohon_mc._x = 228;
pohon_mc._y = 517;
} else if (i == 8) {
pohon_mc._x = 408;
pohon_mc._y = 433;
} else if (i == 9) {
pohon_mc._x = 596;
pohon_mc._y = 517;
} else if (i == 10) {
pohon_mc._x = 768;
pohon_mc._y = 425;
}
pohon_mc.gotoAndStop(random(4) + 1);
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
} else if (levelKe == 11) {
gubugDalam = false;
i = 1;
while (i <= 8) {
gubug_mc = attachMovie("gubug_mc", "gubug_mc" + i, dalamObyek);
if (i == 1) {
gubug_mc._x = 240;
gubug_mc._y = 206;
} else if (i == 2) {
gubug_mc._x = 134;
gubug_mc._y = 338;
} else if (i == 3) {
gubug_mc._x = 254;
gubug_mc._y = 434;
} else if (i == 4) {
gubug_mc._x = 81;
gubug_mc._y = 536;
} else if (i == 5) {
gubug_mc._x = 606;
gubug_mc._y = 206;
} else if (i == 6) {
gubug_mc._x = 500;
gubug_mc._y = 338;
} else if (i == 7) {
gubug_mc._x = 620;
gubug_mc._y = 434;
} else if (i == 8) {
gubug_mc._x = 447;
gubug_mc._y = 536;
}
gubug_mc._xscale = 75;
gubug_mc._yscale = 75;
gubug_mc.swapDepths((1000 + gubug_mc._x) + (gubug_mc._y * 600));
gubug_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
i = 1;
while (i <= 12) {
pohon_mc = attachMovie("obyekKaktus", "obyek" + dalamObyek, dalamObyek);
if (i == 1) {
pohon_mc._x = 56;
pohon_mc._y = 141;
} else if (i == 2) {
pohon_mc._x = 339;
pohon_mc._y = 204;
} else if (i == 3) {
pohon_mc._x = 689;
pohon_mc._y = 141;
} else if (i == 4) {
pohon_mc._x = 11;
pohon_mc._y = 293;
} else if (i == 5) {
pohon_mc._x = 748;
pohon_mc._y = 258;
} else if (i == 6) {
pohon_mc._x = 0;
pohon_mc._y = 452;
} else if (i == 7) {
pohon_mc._x = 141;
pohon_mc._y = 493;
} else if (i == 8) {
pohon_mc._x = 504;
pohon_mc._y = 507;
} else if (i == 9) {
pohon_mc._x = 821;
pohon_mc._y = 385;
} else if (i == 10) {
pohon_mc._x = 324;
pohon_mc._y = 614;
} else if (i == 11) {
pohon_mc._x = 679;
pohon_mc._y = 598;
} else if (i == 12) {
pohon_mc._x = 793;
pohon_mc._y = 554;
}
pohon_mc.gotoAndStop(random(4) + 1);
pohon_mc.swapDepths((1000 + pohon_mc._x) + (pohon_mc._y * 600));
pohon_mc.onEnterFrame = enterPanahArah;
dalamObyek++;
i++;
}
}
}
function init() {
levelKe = pilihGubug;
xlevelKe = pilihLevel;
dalamBackground = 200;
dalamObyek = 100;
dalamMusuh = 400;
dalamJagoan = 1000;
dalamPanah = 700;
dalamHutUnit = 900000 /* 0x0DBBA0 */;
dalamMonsterMuncul = 870000 /* 0x0D4670 */;
dalamTombolLain = 880000 /* 0x0D6D80 */;
dalamSelectMagic = 950000 /* 0x0E7EF0 */;
dalamAnimDapat = 965000 /* 0x0EB988 */;
dalamSpell = 955000 /* 0x0E9278 */;
dalamTitikHijau = 890000 /* 0x0D9490 */;
dalamMagicSpell = 940000 /* 0x0E57E0 */;
dalamHasil = 970000 /* 0x0ECD10 */;
dalamMsgBox = 980000 /* 0x0EF420 */;
dalamTutorial = 971000 /* 0x0ED0F8 */;
dalamPause = 975000 /* 0x0EE098 */;
dalamUI = 700000 /* 0x0AAE60 */;
dalamText = 960000 /* 0x0EA600 */;
dalamEfek = 800000 /* 0x0C3500 */;
dalamEfek2 = 801000 /* 0x0C38E8 */;
dalamEfek3 = 850000 /* 0x0CF850 */;
delayMusuh = 0;
speedKini = 1;
if (xlevelKe <= 10) {
berkurangBase = 5;
} else if (xlevelKe <= 20) {
berkurangBase = 6;
} else if (xlevelKe <= 30) {
berkurangBase = 7;
} else if (xlevelKe <= 40) {
berkurangBase = 8;
} else if (xlevelKe <= 50) {
berkurangBase = 9;
} else if (xlevelKe <= 60) {
berkurangBase = 10;
} else if (xlevelKe <= 61) {
berkurangBase = 15;
}
if (levelBasePlus == 1) {
persentase = 25;
} else if (levelBasePlus == 2) {
persentase = 50;
} else if (levelBasePlus == 3) {
persentase = 75;
} else if (levelBasePlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
tambahanBase = berkurangBase * (persentase / 100);
berkurangBase = berkurangBase + tambahanBase;
berkurangBase = Math.ceil(berkurangBase);
berkurangBaseMax = berkurangBase;
tambahanGold = 50;
tambahanMana = 30;
tambahanCoin = 40;
if (levelTreasurePlus == 1) {
persentase = 50;
} else if (levelTreasurePlus == 2) {
persentase = 75;
} else if (levelTreasurePlus == 3) {
persentase = 100;
} else if (levelTreasurePlus == 4) {
persentase = 125;
} else {
persentase = 0;
}
xtambahanGold = tambahanGold * (persentase / 100);
xtambahanMana = tambahanMana * (persentase / 100);
xtambahanCoin = tambahanCoin * (persentase / 100);
tambahanGold = tambahanGold + xtambahanGold;
tambahanMana = tambahanMana + xtambahanMana;
tambahanCoin = tambahanCoin + xtambahanCoin;
tambahanGold = Math.ceil(tambahanGold);
tambahanMana = Math.ceil(tambahanMana);
tambahanCoin = Math.ceil(tambahanCoin);
sudahSelesai = false;
sedangPause = false;
posisiMenang = false;
spellGubug1 = 50;
spellGubug2 = 50;
spellGubug3 = 50;
spellGubug4 = 50;
spellGubug5 = 50;
spellGubug6 = 50;
spellGubug7 = 50;
spellGubug8 = 50;
spellGubug9 = 50;
hargaGoldUnit = new Array("", 10, 20, 30, 40, 50, 75, 100, 125, 200);
hargaManaUnit = new Array(0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50);
hargaGoldBuilding = new Array("", 500, 750, 1000, 1500, 2000, 3000, 1000, 1250);
hargaGoldBuilding2 = new Array("", 250, 500, 750, 500, 750, 1000, 500, 750);
if (levelSpellPlus == 1) {
persentase = 10;
} else if (levelSpellPlus == 2) {
persentase = 20;
} else if (levelSpellPlus == 3) {
persentase = 30;
} else if (levelSpellPlus == 4) {
persentase = 40;
} else {
persentase = 0;
}
i = 1;
while (i <= 10) {
penguranganManaUnit = hargaManaUnit[i] * (persentase / 100);
hargaManaUnit[i] = hargaManaUnit[i] - penguranganManaUnit;
hargaManaUnit[i] = Math.ceil(hargaManaUnit[i]);
i++;
}
i = 1;
while (i <= 12) {
_root["sudahPakaiSpell" + i] = false;
i++;
}
jumlahMusuh = 0;
jumlahMonster = 0;
waveKe = 1;
killMusuh = 0;
goldKe = 500 * levelKe;
goldKe = goldKe + 1500;
akhirWave = false;
if (xlevelKe >= 52) {
initWave4();
} else if (xlevelKe >= 42) {
initWave3();
} else if (xlevelKe >= 25) {
initWave2();
} else {
initWave();
}
maxHutCapacity1 = xmaxHutCapacity1;
maxHutCapacity2 = xmaxHutCapacity2;
maxHutCapacity3 = xmaxHutCapacity3;
towerDamage1 = xtowerDamage1;
towerDamage2 = xtowerDamage2;
towerDamage3 = xtowerDamage3;
maxCaveCapacity7 = xmaxCaveCapacity7;
maxCaveCapacity8 = xmaxCaveCapacity8;
if (levelHutPlus == 1) {
persentase = 20;
} else if (levelHutPlus == 2) {
persentase = 30;
} else if (levelHutPlus == 3) {
persentase = 40;
} else if (levelHutPlus == 4) {
persentase = 50;
} else {
persentase = 0;
}
maxHutCapacity1 = maxHutCapacity1 + (10 * (persentase / 100));
maxHutCapacity2 = maxHutCapacity2 + (20 * (persentase / 100));
maxHutCapacity3 = maxHutCapacity3 + (30 * (persentase / 100));
maxHutCapacity1 = Math.ceil(maxHutCapacity1);
maxHutCapacity2 = Math.ceil(maxHutCapacity2);
maxHutCapacity3 = Math.ceil(maxHutCapacity3);
if (levelCavePlus == 1) {
persentase = 25;
} else if (levelCavePlus == 2) {
persentase = 50;
} else if (levelCavePlus == 3) {
persentase = 75;
} else if (levelCavePlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
maxCaveCapacity7 = maxCaveCapacity7 + (10 * (persentase / 100));
maxCaveCapacity8 = maxCaveCapacity8 + (15 * (persentase / 100));
maxCaveCapacity7 = Math.ceil(maxCaveCapacity7);
maxCaveCapacity8 = Math.ceil(maxCaveCapacity8);
kiniAdaMusuh = 0;
kiniAdaJagoan = 0;
}
function initPeti() {
delayPeti = 0;
maxPeti = 50;
speedPeti = 1;
persenPeti = 0;
background_mc.bar_mc.gotoAndStop(1);
background_mc.peti_mc.gotoAndStop(1);
background_mc.bar_mc.bar._xscale = persenPeti;
}
function klikMonsterMuncul() {
monsterMuncul._visible = false;
if ((waveKe == 1) && (selesaiWave == false)) {
delayMusuh = xdelayMusuh;
} else {
delayWave = maxWave;
}
tambahanGold = 50;
tambahanMana = 30;
tambahanCoin = 40;
if (levelTreasurePlus == 1) {
persentase = 50;
} else if (levelTreasurePlus == 2) {
persentase = 75;
} else if (levelTreasurePlus == 3) {
persentase = 100;
} else if (levelTreasurePlus == 4) {
persentase = 125;
} else {
persentase = 0;
}
xtambahanGold = tambahanGold * (persentase / 100);
xtambahanMana = tambahanMana * (persentase / 100);
xtambahanCoin = tambahanCoin * (persentase / 100);
tambahanGold = tambahanGold + xtambahanGold;
tambahanMana = tambahanMana + xtambahanMana;
tambahanCoin = tambahanCoin + xtambahanCoin;
tambahanGold = Math.ceil(tambahanGold);
tambahanMana = Math.ceil(tambahanMana);
tambahanCoin = Math.ceil(tambahanCoin);
goldKe = goldKe + tambahanGold;
manaKe = manaKe + tambahanMana;
coinKe = coinKe + tambahanCoin;
if (adaTutorial == true) {
sudahTutorial2 = true;
awalTutorial = false;
adaTutorial = false;
sedangPause = false;
ui_mc.spell_btn.enabled = true;
ui_mc.bantuan_btn.enabled = true;
ui_mc.menu_btn.enabled = true;
gubug_mc1.enabled = true;
gubug_mc2.enabled = true;
gubug_mc3.enabled = true;
gubug_mc4.enabled = true;
gubug_mc5.enabled = true;
gubug_mc6.enabled = true;
gubug_mc7.enabled = true;
gubug_mc9.enabled = true;
ui_mc.build_btn.enabled = true;
_root.tombolLain8.selectMagic.enabled = true;
_root.tombolLain8.attackDefense.enabled = true;
_root.tombolLain8.sellBuilding.enabled = true;
removeMovieClip(frameBox_mc);
tutorial_mc.gotoAndStop(8);
}
}
function naikPeti() {
persenPeti = persenPeti + speedKini;
if (persenPeti >= 100) {
background_mc.bar_mc.gotoAndStop(2);
background_mc.peti_mc.gotoAndStop(2);
background_mc.peti_mc.onRelease = klikPeti;
}
}
function klikPeti() {
if ((sudahSelesai == false) && (sedangPause == false)) {
delete background_mc.peti_mc.onRelease;
initPeti();
goldKe = goldKe + tambahanGold;
manaKe = manaKe + tambahanMana;
coinKe = coinKe + tambahanCoin;
background_mc.peti_mc.gotoAndStop(3);
animDapat = attachMovie("animDapat", "animDapat", dalamAnimDapat);
animDapat._x = this._x;
animDapat._y = this._y;
animDapat.goldKe = tambahanGold;
animDapat.manaKe = tambahanMana;
animDapat.coinKe = tambahanCoin;
}
}
function buatUI() {
ui_mc = attachMovie("ui_mc", "ui_mc", dalamUI);
ui_mc._x = 400;
ui_mc._y = 25;
text_mc = attachMovie("text_mc", "text_mc", dalamText);
text_mc._x = 400;
text_mc._y = 25;
text_mc.xpesan = "";
adaPesan = false;
sedangDragBuild = false;
munculPesan = 75;
maxPesan = 75;
ui_mc.spell_btn.onRelease = function () {
magicSpell_mc = attachMovie("magicSpell_mc", "magicSpell_mc", dalamSpell);
magicSpell_mc._x = 400;
magicSpell_mc._y = 300;
i = 1;
while (i <= 12) {
if (_root["magicPunya" + i] == true) {
if (_root["sudahPakaiSpell" + i] == false) {
magicSpell_mc["spell" + i].gotoAndStop(1);
magicSpell_mc["spell" + i].onRelease = klikMagicSpell;
} else {
magicSpell_mc["spell" + i].gotoAndStop(2);
delete magicSpell_mc["spell" + i].onRelease;
}
} else {
magicSpell_mc["spell" + i].gotoAndStop(2);
delete magicSpell_mc["spell" + i].onRelease;
}
i++;
}
magicSpell_mc.cancel_btn.onRelease = function () {
removeMovieClip(magicSpell_mc);
};
};
ui_mc.build_btn.onRelease = function () {
build_mc = attachMovie("build_mc", "build_mc", dalamSpell);
build_mc._x = 400;
build_mc._y = 300;
i = 1;
while (i <= 3) {
build_mc["hut" + i].gotoAndStop(2);
build_mc["tower" + i].gotoAndStop(2);
build_mc["cave" + i].gotoAndStop(2);
i++;
}
i = 1;
while (i <= levelHut) {
build_mc["hut" + i].gotoAndStop(1);
build_mc["hut" + i].onRelease = klikBangunHut;
build_mc["hut" + i].onRollOver = overBangunHut;
build_mc["hut" + i].onRollOut = outBangunHut;
i++;
}
i = 1;
while (i <= levelTower) {
build_mc["tower" + i].gotoAndStop(1);
build_mc["tower" + i].onRelease = klikBangunTower;
build_mc["tower" + i].onRollOver = overBangunTower;
build_mc["tower" + i].onRollOut = outBangunTower;
i++;
}
i = 1;
while (i <= levelCave) {
build_mc["cave" + i].gotoAndStop(1);
build_mc["cave" + i].onRelease = klikBangunCave;
build_mc["cave" + i].onRollOver = overBangunCave;
build_mc["cave" + i].onRollOut = outBangunCave;
i++;
}
build_mc.cancel_btn.onRelease = function () {
removeMovieClip(frameBox_mc);
removeMovieClip(build_mc);
};
if (adaTutorial == true) {
tutorial_mc.gotoAndStop(2);
build_mc.cancel_btn.enabled = false;
}
};
ui_mc.bantuan_btn.onRelease = function () {
bantuan_mc = attachMovie("bantuan_mc", "bantuan_mc", dalamSpell);
bantuan_mc._x = 400;
bantuan_mc._y = 300;
i = 1;
while (i <= 15) {
if (_root["levelUnit" + i] == 0) {
bantuan_mc["unit" + i].gotoAndStop(2);
delete bantuan_mc["unit" + i].onRelease;
} else {
bantuan_mc["unit" + i].gotoAndStop(1);
bantuan_mc["unit" + i].onRelease = klikBantuan;
}
i++;
}
bantuan_mc.cancel_btn.onRelease = function () {
removeMovieClip(bantuan_mc);
};
};
ui_mc.menu_btn.onRelease = function () {
sedangPause = true;
i = 1000;
while (i <= 1030) {
_root["jagoan_mc" + i].anim.stop();
i++;
}
i = 400;
while (i <= 430) {
_root["musuh_mc" + i].anim.stop();
i++;
}
pause_mc = attachMovie("pause_mc", "pause_mc", dalamPause);
pause_mc._x = 400;
pause_mc._y = 300;
pause_mc.continue_btn.onRelease = function () {
i = 1000;
while (i <= 1030) {
_root["jagoan_mc" + i].anim.play();
i++;
}
i = 400;
while (i <= 430) {
_root["musuh_mc" + i].anim.play();
i++;
}
sedangPause = false;
removeMovieClip(pause_mc);
};
pause_mc.quit_btn.onRelease = function () {
clearSemua();
backMenu();
if (xposisiWorldMap == 1) {
gotoAndStop (268);
} else if (xposisiWorldMap == 2) {
gotoAndStop (269);
} else if (xposisiWorldMap == 3) {
gotoAndStop (270);
} else if (xposisiWorldMap == 4) {
gotoAndStop (271);
} else if (xposisiWorldMap == 5) {
gotoAndStop (272);
}
};
pause_mc.more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
};
if (speedKini == 1) {
ui_mc.speed_mc.gotoAndStop(1);
} else if (speedKini == 3) {
ui_mc.speed_mc.gotoAndStop(2);
} else if (speedKini == 5) {
ui_mc.speed_mc.gotoAndStop(3);
}
ui_mc.speed_mc.onRelease = function () {
if (speedKini == 1) {
speedKini = 3;
this.gotoAndStop(2);
} else if (speedKini == 3) {
speedKini = 5;
this.gotoAndStop(3);
} else if (speedKini == 5) {
speedKini = 1;
this.gotoAndStop(1);
}
};
if (volume1 != 0) {
ui_mc.sound_mc.gotoAndStop(1);
} else {
ui_mc.sound_mc.gotoAndStop(2);
}
ui_mc.sound_mc.onRelease = function () {
if (volume1 != 0) {
volume1 = 0;
volume2 = 0;
ui_mc.sound_mc.gotoAndStop(2);
} else {
volume1 = 50;
volume2 = 25;
ui_mc.sound_mc.gotoAndStop(1);
}
myMusic.setVolume(volume1);
mySound.setVolume(volume2);
};
ui_mc.more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
}
function overBangunHut() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = myStr.substr(myStr.length - 1, 1);
} else {
indi = myStr.substr(myStr.length - 2, 2);
}
namaUpgradeHut = new Array("", "Small Hut", "Medium Hut", "Large Hut");
frameBox_mc.gotoAndStop(1);
frameBox_mc = attachMovie("frameBox_mc", "frameBox_mc", dalamMsgBox);
frameBox_mc._x = -500;
frameBox_mc._y = -500;
frameBox_mc.namaMsg = ((((((namaUpgradeHut[indi] + "\nBuy Price: ") + hargaGoldBuilding[indi]) + " Gold") + "\nSell Price: ") + hargaGoldBuilding2[indi]) + " Gold") + "\nClick To Build";
frameBox_mc.onEnterFrame = enterMsgBox;
}
function outBangunHut() {
removeMovieClip(frameBox_mc);
}
function overBangunTower() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1)) + 3;
} else {
indi = Number(myStr.substr(myStr.length - 2, 2)) + 3;
}
namaUpgradeTower = new Array("", "Ice Fire Tower", "Acid Wind Tower", "Mega Spells Tower");
frameBox_mc = attachMovie("frameBox_mc", "frameBox_mc", dalamMsgBox);
frameBox_mc.gotoAndStop(1);
frameBox_mc._x = -500;
frameBox_mc._y = -500;
frameBox_mc.namaMsg = ((((((namaUpgradeTower[indi - 3] + "\nBuy Price: ") + hargaGoldBuilding[indi]) + " Gold") + "\nSell Price: ") + hargaGoldBuilding2[indi]) + " Gold") + "\nClick To Build";
frameBox_mc.onEnterFrame = enterMsgBox;
}
function outBangunTower() {
removeMovieClip(frameBox_mc);
}
function overBangunCave() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1)) + 6;
} else {
indi = Number(myStr.substr(myStr.length - 2, 2)) + 6;
}
namaUpgradeCave = new Array("", "Small Cave", "Large Cave");
frameBox_mc = attachMovie("frameBox_mc", "frameBox_mc", dalamMsgBox);
frameBox_mc.gotoAndStop(1);
frameBox_mc._x = -500;
frameBox_mc._y = -500;
frameBox_mc.namaMsg = ((((((namaUpgradeCave[indi - 6] + "\nBuy Price: ") + hargaGoldBuilding[indi]) + " Gold") + "\nSell Price: ") + hargaGoldBuilding2[indi]) + " Gold") + "\nClick To Build";
frameBox_mc.onEnterFrame = enterMsgBox;
}
function outBangunCave() {
removeMovieClip(frameBox_mc);
}
function enterMsgBox() {
if (((sudahSelesai == false) && (sedangPause == false)) || (adaTutorial == true)) {
if ((this._currentframe == 1) || (this._currentframe == 3)) {
if (_root._xmouse >= 590) {
this._x = (_root._xmouse - 65) - 50;
} else {
this._x = (_root._xmouse + 65) + 50;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 45;
} else {
this._y = _root._ymouse + 45;
}
} else if (this._currentframe == 2) {
if (_root._xmouse >= 590) {
this._x = (_root._xmouse - 15) - 50;
} else {
this._x = (_root._xmouse + 15) + 50;
}
if (_root._ymouse >= 500) {
this._y = _root._ymouse - 55;
} else {
this._y = _root._ymouse + 55;
}
}
}
}
function buatSilang() {
i = 1;
while (i <= 30) {
if (background_mc["hijau" + i]._x != undefined) {
titikHijau = attachMovie("titikHijau", "titikHijau" + i, dalamTitikHijau);
titikHijau._x = background_mc["hijau" + i]._x;
titikHijau._y = background_mc["hijau" + i]._y;
titikHijau._visible = false;
dalamTitikHijau++;
}
i++;
}
}
function klikBantuan() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = myStr.substr(myStr.length - 1, 1);
} else {
indi = myStr.substr(myStr.length - 2, 2);
}
pilihUnitBantuan = indi;
target_mc = attachMovie("jagoan" + pilihUnitBantuan, "target_mc", dalamSpell);
target_mc._x = _root._xmouse;
target_mc._y = _root._ymouse;
target_mc.onRelease = seranganBantuan;
startDrag (target_mc);
i = 1;
while (i <= 30) {
_root["titikHijau" + i]._visible = true;
_root["titikHijau" + i].gotoAndStop(2);
i++;
}
removeMovieClip(bantuan_mc);
}
function seranganBantuan() {
if (goldKe >= hargaGoldUnit[pilihUnitBantuan]) {
sudahPasang = false;
i = 1;
while (i <= 30) {
if (this.hitTest(background_mc["hijau" + i])) {
buatBantuan(pilihUnitBantuan, target_mc._x, target_mc._y);
i = 30;
sudahPasang = true;
}
i++;
}
if (sudahPasang == true) {
stopDrag();
i = 1;
while (i <= 30) {
_root["titikHijau" + i]._visible = false;
_root["titikHijau" + i].gotoAndStop(1);
i++;
}
removeMovieClip(this);
}
} else {
stopDrag();
i = 1;
while (i <= 30) {
_root["titikHijau" + i]._visible = false;
_root["titikHijau" + i].gotoAndStop(1);
i++;
}
removeMovieClip(this);
kirimPesan("Can't create this unit, not enough gold!");
}
}
function buatBantuan(indi, indi2, indi3) {
buatJagoan("", "", "", "", "bantuan", indi, indi2, indi3);
}
function klikBangunHut() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = myStr.substr(myStr.length - 1, 1);
} else {
indi = myStr.substr(myStr.length - 2, 2);
}
if (goldKe >= hargaGoldBuilding[indi]) {
hut_mc2 = attachMovie("gubugGeser", "gubugGeser", dalamSpell);
hut_mc2._x = _root._xmouse;
hut_mc2._y = _root._ymouse;
hut_mc2.gotoAndStop(indi);
jenisPilihBuild = indi;
sedangDragBuild = true;
startDrag (hut_mc2);
removeMovieClip(frameBox_mc);
removeMovieClip(build_mc);
} else {
kirimPesan("Can't build this hut, not enough gold!");
}
if (adaTutorial == true) {
gubug_mc1.enabled = false;
gubug_mc2.enabled = false;
gubug_mc3.enabled = false;
gubug_mc4.enabled = false;
gubug_mc5.enabled = false;
gubug_mc6.enabled = false;
gubug_mc7.enabled = false;
gubug_mc9.enabled = false;
tutorial_mc.gotoAndStop(3);
}
}
function klikBangunTower() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (goldKe >= hargaGoldBuilding[3 + indi]) {
hut_mc2 = attachMovie("gubugGeser", "gubugGeser", dalamSpell);
hut_mc2._x = _root._xmouse;
hut_mc2._y = _root._ymouse;
hut_mc2.gotoAndStop(3 + indi);
jenisPilihBuild = 3 + indi;
sedangDragBuild = true;
startDrag (hut_mc2);
removeMovieClip(frameBox_mc);
removeMovieClip(build_mc);
} else {
kirimPesan("Can't build this hut, not enough gold!");
}
}
function klikBangunCave() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (goldKe >= hargaGoldBuilding[6 + indi]) {
hut_mc2 = attachMovie("gubugGeser", "gubugGeser", dalamSpell);
hut_mc2._x = _root._xmouse;
hut_mc2._y = _root._ymouse;
hut_mc2.gotoAndStop(6 + indi);
jenisPilihBuild = 6 + indi;
sedangDragBuild = true;
startDrag (hut_mc2);
removeMovieClip(frameBox_mc);
removeMovieClip(build_mc);
} else {
kirimPesan("Can't build this building, not enough gold!");
}
}
function buatBuilding() {
if (sedangDragBuild == true) {
this.gotoAndStop(jenisPilihBuild);
if ((this._currentframe <= 3) || (this._currentframe >= 7)) {
this.onRelease = klikGubug;
adaTower = false;
_root["tombolLain" + this.nomor].gotoAndStop(1);
_root["tombolLain" + this.nomor].attackDefense._visible = true;
_root["tombolLain" + this.nomor].upgradeBuilding._visible = false;
_root["tombolLain" + this.nomor].selectMagic._visible = true;
} else {
adaTower = true;
_root["tombolLain" + this.nomor].gotoAndStop(2);
_root["tombolLain" + this.nomor].attackDefense._visible = false;
_root["tombolLain" + this.nomor].upgradeBuilding._visible = false;
_root["tombolLain" + this.nomor].selectMagic._visible = false;
}
_root["tombolLain" + this.nomor]._visible = true;
_root["tombolLain" + this.nomor].attackDefense.huruf_mc._visible = false;
totalBangunan++;
if (totalBangunan >= 20) {
_root.dapatMedal21 = true;
}
if (totalBangunan >= 100) {
_root.dapatMedal22 = true;
}
if (totalBangunan >= 180) {
_root.dapatMedal23 = true;
}
if (totalBangunan >= 260) {
_root.dapatMedal24 = true;
}
if (totalBangunan >= 340) {
_root.dapatMedal25 = true;
}
if (totalBangunan >= 420) {
_root.dapatMedal26 = true;
}
if (totalBangunan >= 500) {
_root.dapatMedal27 = true;
}
if (totalBangunan >= 580) {
_root.dapatMedal28 = true;
}
if (totalBangunan >= 620) {
_root.dapatMedal29 = true;
}
if (totalBangunan >= 700) {
_root.dapatMedal30 = true;
}
if (gubugDalam == true) {
backBangun();
goldKe = goldKe - hargaGoldBuilding[jenisPilihBuild];
background_mc["gubug_mc" + this.nomor].spell_mc.gotoAndStop(_root["spellGubug" + this.nomor]);
background_mc["gubug_mc" + this.nomor].pakaiGubug = 0;
background_mc["gubug_mc" + this.nomor].nomor = this.nomor;
if (jenisPilihBuild <= 3) {
background_mc["gubug_mc" + this.nomor].maxHut = (background_mc["gubug_mc" + this.nomor].pakaiGubug + "/") + _root["maxHutCapacity" + background_mc["gubug_mc" + this.nomor]._currentframe];
} else if (jenisPilihBuild >= 7) {
background_mc["gubug_mc" + this.nomor].maxHut = (background_mc["gubug_mc" + this.nomor].pakaiGubug + "/") + _root["maxCaveCapacity" + background_mc["gubug_mc" + this.nomor]._currentframe];
}
if (adaTower == true) {
if (background_mc["gubug_mc" + this.nomor]._currentframe == 4) {
background_mc["gubug_mc" + this.nomor].delayTembak = 0;
background_mc["gubug_mc" + this.nomor].maxTembak = 150;
background_mc["gubug_mc" + this.nomor].xrange = 200;
background_mc["gubug_mc" + this.nomor].delaySerang = 0.5;
background_mc["gubug_mc" + this.nomor].damage = towerDamage1;
} else if (background_mc["gubug_mc" + this.nomor]._currentframe == 5) {
background_mc["gubug_mc" + this.nomor].delayTembak = 0;
background_mc["gubug_mc" + this.nomor].maxTembak = 175;
background_mc["gubug_mc" + this.nomor].xrange = 250;
background_mc["gubug_mc" + this.nomor].delaySerang = 0.75;
background_mc["gubug_mc" + this.nomor].damage = towerDamage2;
} else if (background_mc["gubug_mc" + this.nomor]._currentframe == 6) {
background_mc["gubug_mc" + this.nomor].delayTembak = 0;
background_mc["gubug_mc" + this.nomor].maxTembak = 200;
background_mc["gubug_mc" + this.nomor].xrange = 300;
background_mc["gubug_mc" + this.nomor].delaySerang = 1;
background_mc["gubug_mc" + this.nomor].damage = towerDamage3;
}
background_mc["gubug_mc" + this.nomor].onEnterFrame = enterTower;
} else {
delete background_mc["gubug_mc" + this.nomor].onEnterFrame;
}
} else {
backBangun();
goldKe = goldKe - hargaGoldBuilding[jenisPilihBuild];
_root["gubug_mc" + this.nomor].spell_mc.gotoAndStop(_root["spellGubug" + this.nomor]);
_root["gubug_mc" + this.nomor].pakaiGubug = 0;
_root["gubug_mc" + this.nomor].nomor = this.nomor;
if (jenisPilihBuild <= 3) {
_root["gubug_mc" + this.nomor].maxHut = (_root["gubug_mc" + this.nomor].pakaiGubug + "/") + _root["maxHutCapacity" + _root["gubug_mc" + this.nomor]._currentframe];
} else if (jenisPilihBuild >= 7) {
_root["gubug_mc" + this.nomor].maxHut = (_root["gubug_mc" + this.nomor].pakaiGubug + "/") + _root["maxCaveCapacity" + _root["gubug_mc" + this.nomor]._currentframe];
}
if (adaTower == true) {
if (_root["gubug_mc" + this.nomor]._currentframe == 4) {
_root["gubug_mc" + this.nomor].delayTembak = 0;
_root["gubug_mc" + this.nomor].maxTembak = 150;
_root["gubug_mc" + this.nomor].xrange = 200;
_root["gubug_mc" + this.nomor].delaySerang = 0.5;
_root["gubug_mc" + this.nomor].damage = towerDamage1;
} else if (_root["gubug_mc" + this.nomor]._currentframe == 5) {
_root["gubug_mc" + this.nomor].delayTembak = 0;
_root["gubug_mc" + this.nomor].maxTembak = 175;
_root["gubug_mc" + this.nomor].xrange = 250;
_root["gubug_mc" + this.nomor].delaySerang = 0.75;
_root["gubug_mc" + this.nomor].damage = towerDamage2;
} else if (_root["gubug_mc" + this.nomor]._currentframe == 6) {
_root["gubug_mc" + this.nomor].delayTembak = 0;
_root["gubug_mc" + this.nomor].maxTembak = 200;
_root["gubug_mc" + this.nomor].xrange = 300;
_root["gubug_mc" + this.nomor].delaySerang = 1;
_root["gubug_mc" + this.nomor].damage = towerDamage3;
}
_root["gubug_mc" + this.nomor].onEnterFrame = enterTower;
} else {
delete _root["gubug_mc" + this.nomor].onEnterFrame;
}
}
sedangDragBuild = false;
removeMovieClip(hut_mc2);
if (adaTutorial == true) {
ui_mc.build_btn.enabled = false;
_root["tombolLain" + this.nomor].selectMagic.enabled = false;
_root["tombolLain" + this.nomor].attackDefense.enabled = false;
_root["tombolLain" + this.nomor].sellBuilding.enabled = false;
tutorial_mc.gotoAndStop(4);
}
} else if (adaTutorial == false) {
build_mc = attachMovie("build_mc", "build_mc", dalamSpell);
build_mc._x = 400;
build_mc._y = 300;
i = 1;
while (i <= 3) {
build_mc["hut" + i].gotoAndStop(2);
build_mc["tower" + i].gotoAndStop(2);
build_mc["cave" + i].gotoAndStop(2);
i++;
}
i = 1;
while (i <= levelHut) {
build_mc["hut" + i].gotoAndStop(1);
build_mc["hut" + i].onRelease = klikBangunHut;
build_mc["hut" + i].onRollOver = overBangunHut;
build_mc["hut" + i].onRollOut = outBangunHut;
i++;
}
i = 1;
while (i <= levelTower) {
build_mc["tower" + i].gotoAndStop(1);
build_mc["tower" + i].onRelease = klikBangunTower;
build_mc["tower" + i].onRollOver = overBangunTower;
build_mc["tower" + i].onRollOut = outBangunTower;
i++;
}
i = 1;
while (i <= levelCave) {
build_mc["cave" + i].gotoAndStop(1);
build_mc["cave" + i].onRelease = klikBangunCave;
build_mc["cave" + i].onRollOver = overBangunCave;
build_mc["cave" + i].onRollOut = outBangunCave;
i++;
}
build_mc.cancel_btn.onRelease = function () {
removeMovieClip(frameBox_mc);
removeMovieClip(build_mc);
};
}
}
function enterTower() {
this.swapDepths((500 + this._x) + (this._y * 600));
if ((sudahSelesai == false) && (sedangPause == false)) {
if ((this._currentframe >= 4) && (this._currentframe <= 6)) {
if (this.delayTembak >= this.maxTembak) {
this.delayTembak = 0;
this.wtarget = undefined;
i = 400;
while (i <= 430) {
if ((_root["musuh_mc" + i].nyawa != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
this.jarak = Math.sqrt(Math.pow(this._x - _root["musuh_mc" + i]._x, 2) + Math.pow(this._y - _root["musuh_mc" + i]._y, 2));
if (this.jarak <= this.xrange) {
this.wtarget = _root["musuh_mc" + i];
i = 430;
}
}
i++;
}
if (this.wtarget != undefined) {
this.tenaga1.play();
this.tenaga2.play();
this.tenaga3.play();
if (this._currentframe == 4) {
rand = random(2);
if (rand == 0) {
cekEfek(this.wtarget, "fire", "jagoan", this);
} else {
cekEfek(this.wtarget, "ice", "jagoan", this);
}
} else if (this._currentframe == 5) {
rand = random(2);
if (rand == 0) {
cekEfek(this.wtarget, "acid", "jagoan", this);
} else {
cekEfek(this.wtarget, "strom", "jagoan", this);
}
} else if (this._currentframe == 6) {
rand = random(2);
if (rand == 0) {
cekEfek(this.wtarget, "strom", "jagoan", this);
cekEfek(this.wtarget, "fire", "jagoan", this);
cekEfek(this.wtarget, "stone", "jagoan", this);
cekEfek(this.wtarget, "confuse", "jagoan", this);
} else {
cekEfek(this.wtarget, "wind", "jagoan", this);
cekEfek(this.wtarget, "acid", "jagoan", this);
cekEfek(this.wtarget, "thunder", "jagoan", this);
cekEfek(this.wtarget, "ice", "jagoan", this);
}
}
}
} else {
this.delayTembak = this.delayTembak + (speedKini * this.delaySerang);
}
}
}
}
function klikMagicSpell() {
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = myStr.substr(myStr.length - 1, 1);
} else {
indi = myStr.substr(myStr.length - 2, 2);
}
pilihMagicSpell = indi;
target_mc = attachMovie("target_mc", "target_mc", dalamSpell);
target_mc._x = _root._xmouse;
target_mc._y = _root._ymouse;
if (levelStrikePlus == 0) {
target_mc.onRelease = seranganMagicSpell;
startDrag (target_mc);
removeMovieClip(magicSpell_mc);
} else {
hitungMaju = 0;
targetSeranganX = new Array();
targetSeranganY = new Array();
startDrag (target_mc);
target_mc.onRelease = klikTarget;
}
}
function klikTarget() {
xtarget_mc = attachMovie("target_mc", "target_mc", (dalamSpell + 1) + hitungMaju);
xtarget_mc._x = target_mc._x;
xtarget_mc._y = target_mc._y;
targetSeranganX[hitungMaju] = xtarget_mc._x;
targetSeranganY[hitungMaju] = xtarget_mc._y;
hitungMaju++;
if (hitungMaju > levelStrikePlus) {
cekSeranganMendadak();
}
}
function cekSeranganMendadak() {
i = 0;
while (i <= hitungMaju) {
seranganMagicSpell(targetSeranganX[i], targetSeranganY[i]);
i++;
}
}
function seranganMagicSpell(indiX, indiY) {
if (indiX == undefined) {
indiX = target_mc._x;
}
if (indiY == undefined) {
indiY = target_mc._y;
}
damageUpgradeMagicSpell = new Array("", 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300);
if (pilihMagicSpell == 1) {
spell_mc = attachMovie("spell_mc1", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY + 25;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 7;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTurun;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 2) {
spell_mc = attachMovie("spell_mc2", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 3;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTurun;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 3) {
spell_mc = attachMovie("spell_mc3", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 3;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTurun;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 4) {
spell_mc = attachMovie("spell_mc4", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 3;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTurun;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 5) {
spell_mc = attachMovie("spell_mc5", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 3;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTurun;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 6) {
spell_mc = attachMovie("spell_mc6", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 5;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTurun;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 7) {
spell_mc = attachMovie("spell_mc7", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 5;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTurun;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 8) {
spell_mc = attachMovie("spell_mc8", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 15;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTurun;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 9) {
spell_mc = attachMovie("spell_mc9", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 3;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTerus;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 10) {
spell_mc = attachMovie("spell_mc10", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 10;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTerus;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 11) {
spell_mc = attachMovie("spell_mc11", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY + 50;
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 1;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTerus;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
} else if (pilihMagicSpell == 12) {
spell_mc = attachMovie("spell_mc12", "spell_mc" + dalamMagicSpell, dalamMagicSpell);
spell_mc._x = indiX;
spell_mc._y = indiY;
spell_mc.gotoAndStop(random(4) + 1);
spell_mc.jenis = "jagoan";
spell_mc.batasFrame = 12;
spell_mc.jenisSpell = pilihMagicSpell;
spell_mc.damage = damageUpgradeMagicSpell[pilihMagicSpell];
spell_mc.onEnterFrame = enterSpellTerus;
dalamMagicSpell++;
if (dalamMagicSpell >= 940100) {
dalamMagicSpell = 940000 /* 0x0E57E0 */;
}
}
_root["sudahPakaiSpell" + pilihMagicSpell] = true;
stopDrag();
removeMovieClip(target_mc);
}
function enterSpellTurun() {
this.swapDepths((1000 + this._x) + (this._y * 600));
if ((sudahSelesai == false) && (sedangPause == false)) {
if (this.jenis == "jagoan") {
zi = 400;
while (zi <= 430) {
if (this.hitTest(_root["musuh_mc" + zi])) {
if (this._currentframe == this.batasFrame) {
_root["musuh_mc" + zi].delayBarLife = 0;
if (this.jenisSpell == 4) {
cekEfek(_root["musuh_mc" + zi], "acid", "jagoan");
} else if (this.jenisSpell == 5) {
cekEfek(_root["musuh_mc" + zi], "fire2", "jagoan");
} else if (this.jenisSpell == 6) {
cekEfek(_root["musuh_mc" + zi], "ice3", "jagoan");
} else if (this.jenisSpell == 7) {
cekEfek(_root["musuh_mc" + zi], "acid", "jagoan");
} else if (this.jenisSpell == 8) {
cekEfek(_root["musuh_mc" + zi], "fire2", "jagoan");
}
if (_root["musuh_mc" + zi].protect == false) {
_root["musuh_mc" + zi].nyawa = _root["musuh_mc" + zi].nyawa - this.damage;
} else {
_root["musuh_mc" + zi].nyawa = _root["musuh_mc" + zi].nyawa - (this.damage / 3);
}
}
}
zi++;
}
} else if (this.jenis == "musuh") {
zi = 1000;
while (zi <= 1030) {
if (this.hitTest(_root["jagoan_mc" + zi])) {
if (this._currentframe == this.batasFrame) {
_root["jagoan_mc" + zi].delayBarLife = 0;
if (_root["jagoan_mc" + zi].protect == false) {
_root["jagoan_mc" + zi].nyawa = _root["jagoan_mc" + zi].nyawa - indi2.damage;
} else {
_root["jagoan_mc" + zi].nyawa = _root["jagoan_mc" + zi].nyawa - (indi2.damage / 3);
}
}
}
zi++;
}
}
}
}
function enterSpellTerus() {
this.swapDepths((1000 + this._x) + (this._y * 600));
if ((sudahSelesai == false) && (sedangPause == false)) {
if (this.jenis == "jagoan") {
zi = 400;
while (zi <= 430) {
if (this.hitTest(_root["musuh_mc" + zi])) {
if (this.anim._currentframe >= this.batasFrame) {
_root["musuh_mc" + zi].delayBarLife = 0;
if (_root["musuh_mc" + zi].protect == false) {
_root["musuh_mc" + zi].nyawa = _root["musuh_mc" + zi].nyawa - this.damage;
} else {
_root["musuh_mc" + zi].nyawa = _root["musuh_mc" + zi].nyawa - (this.damage / 3);
}
}
}
zi++;
}
if (this.jenisSpell == 12) {
if (this.anim._currentframe == this.batasFrame) {
cekEfek(this, "fire2", "jagoan");
cekEfek(this, "dust2");
cekEfek(this, "dust2");
cekEfek(this, "dust2");
}
}
} else if (this.jenis == "musuh") {
zi = 1000;
while (zi <= 1030) {
if (this.hitTest(_root["jagoan_mc" + zi])) {
if (this._currentframe >= this.batasFrame) {
_root["jagoan_mc" + zi].delayBarLife = 0;
if (_root["jagoan_mc" + zi].protect == false) {
_root["jagoan_mc" + zi].nyawa = _root["jagoan_mc" + zi].nyawa - indi2.damage;
} else {
_root["jagoan_mc" + zi].nyawa = _root["jagoan_mc" + zi].nyawa - (indi2.damage / 3);
}
}
}
zi++;
}
}
}
}
function klikUpgradeBuilding() {
myStr = new String(this._parent);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (gubugDalam == true) {
if (background_mc["gubug_mc" + indi]._currentframe <= 3) {
background_mc["gubug_mc" + indi].pakaiGubug = 0;
background_mc["gubug_mc" + indi].maxHut = (background_mc["gubug_mc" + indi].pakaiGubug + "/") + _root["maxHutCapacity" + background_mc["gubug_mc" + indi]._currentframe];
} else if (background_mc["gubug_mc" + indi]._currentframe >= 7) {
background_mc["gubug_mc" + indi].pakaiGubug = 0;
background_mc["gubug_mc" + indi].maxHut = (background_mc["gubug_mc" + indi].pakaiGubug + "/") + _root["maxCaveCapacity" + background_mc["gubug_mc" + indi]._currentframe];
}
} else if (_root["gubug_mc" + indi]._currentframe <= 3) {
_root["gubug_mc" + indi].pakaiGubug = 0;
_root["gubug_mc" + indi].maxHut = (_root["gubug_mc" + indi].pakaiGubug + "/") + _root["maxHutCapacity" + _root["gubug_mc" + indi]._currentframe];
} else if (_root["gubug_mc" + indi]._currentframe >= 7) {
_root["gubug_mc" + indi].pakaiGubug = 0;
_root["gubug_mc" + indi].maxHut = (_root["gubug_mc" + indi].pakaiGubug + "/") + _root["maxCaveCapacity" + _root["gubug_mc" + indi]._currentframe];
}
this.sudahKlik = true;
this._visible = false;
}
function klikSellBuilding() {
myStr = new String(this._parent);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (gubugDalam == true) {
goldKe = goldKe + hargaGoldBuilding2[background_mc["gubug_mc" + indi]._currentframe];
background_mc["gubug_mc" + indi].gotoAndStop(10);
background_mc["gubug_mc" + indi].onRelease = buatBuilding;
_root["tombolLain" + indi]._visible = false;
} else {
goldKe = goldKe + hargaGoldBuilding2[_root["gubug_mc" + indi]._currentframe];
_root["gubug_mc" + indi].gotoAndStop(10);
_root["gubug_mc" + indi].onRelease = buatBuilding;
_root["tombolLain" + indi]._visible = false;
}
this._parent.upgradeBuilding.sudahKlik = false;
removeMovieClip(hutUnit);
}
function klikSelectMagic() {
selectMagic = attachMovie("spellMagic", "selectMagic", dalamSelectMagic);
selectMagic._x = 400;
selectMagic._y = 300;
selectMagic.posisiKe = this._parent.posisiKe;
namaSpellMagic = new Array("", "USE FIRE SPELL FOR NEXT UNITS", "USE ICE SPELL FOR NEXT UNITS", "USE POISON SPELL FOR NEXT UNITS", "USE STONE SPELL FOR NEXT UNITS", "USE WIND SPELL FOR NEXT UNITS", "USE THUNDER SPELL FOR NEXT UNITS", "USE HEAL SPELL FOR NEXT UNITS", "USE STROM SPELL FOR NEXT UNITS", "USE PROTECT SPELL FOR NEXT UNITS", "USE CONFUSE SPELL FOR NEXT UNITS", "USE NO SPELL", "CLOSE");
i = 1;
while (i <= 12) {
if (i <= 10) {
if (_root["levelSpell" + i] == 0) {
selectMagic["spell" + i].gotoAndStop(i);
selectMagic["silang" + i]._visible = true;
delete selectMagic["spell" + i].onRelease;
} else {
selectMagic["spell" + i].gotoAndStop(i);
selectMagic["silang" + i]._visible = false;
selectMagic["spell" + i].onRollOver = overSpellMagic;
selectMagic["spell" + i].onRollOut = outSpellMagic;
selectMagic["spell" + i].onRelease = klikSpellMagic;
}
} else {
selectMagic["spell" + i].gotoAndStop(i);
selectMagic["silang" + i]._visible = false;
if (i == 11) {
selectMagic["spell" + i].gotoAndStop(50);
} else if (i == 12) {
selectMagic["spell" + i].gotoAndStop(55);
}
selectMagic["spell" + i].onRollOver = overSpellMagic;
selectMagic["spell" + i].onRollOut = outSpellMagic;
selectMagic["spell" + i].onRelease = klikSpellMagic;
}
i++;
}
}
function overSpellMagic() {
hutUnitOver = true;
this._xscale = (this._yscale = 105);
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = myStr.substr(myStr.length - 1, 1);
} else {
indi = myStr.substr(myStr.length - 2, 2);
}
frameBox_mc = attachMovie("frameBox_mc", "frameBox_mc", dalamMsgBox);
frameBox_mc.gotoAndStop(3);
frameBox_mc.namaMsg = namaSpellMagic[indi];
frameBox_mc._x = -500;
frameBox_mc._y = -500;
frameBox_mc.onEnterFrame = enterMsgBox;
}
function outSpellMagic() {
this._xscale = (this._yscale = 100);
removeMovieClip(frameBox_mc);
}
function klikSpellMagic() {
removeMovieClip(frameBox_mc);
pilihGubug = this._parent.posisiKe;
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = Number(myStr.substr(myStr.length - 1, 1));
} else {
indi = Number(myStr.substr(myStr.length - 2, 2));
}
if (indi == 12) {
removeMovieClip(this._parent);
} else if (indi == 11) {
_root["spellGubug" + pilihGubug] = 50;
removeMovieClip(this._parent);
} else {
_root["spellGubug" + pilihGubug] = indi;
removeMovieClip(this._parent);
}
}
function buatPanahArah() {
panahMasuk = attachMovie("panahMasuk" + levelKe, "panahMasuk", dalamPanah);
if (levelKe == 1) {
panahMasuk._x = 48;
panahMasuk._y = 207;
} else if (levelKe == 3) {
panahMasuk._x = 363;
panahMasuk._y = 164;
} else if (levelKe == 4) {
panahMasuk._x = 149;
panahMasuk._y = 119;
} else if (levelKe == 9) {
panahMasuk._x = 718;
panahMasuk._y = 183;
} else if (levelKe == 11) {
panahMasuk._x = 394;
panahMasuk._y = 128;
} else if (levelKe == 12) {
panahMasuk._x = 722;
panahMasuk._y = 570;
}
panahMasuk.onEnterFrame = enterEfek;
dalamPanah++;
panahKeluar = attachMovie("panahKeluar" + levelKe, "panahKeluar", dalamPanah);
if (levelKe == 1) {
panahKeluar._x = 546;
panahKeluar._y = 523;
} else if (levelKe == 2) {
panahKeluar._x = 595;
panahKeluar._y = 219;
} else if (levelKe == 3) {
panahKeluar._x = 773;
panahKeluar._y = 524;
} else if (levelKe == 5) {
panahKeluar._x = 750;
panahKeluar._y = 170;
}
panahKeluar.onEnterFrame = enterEfek;
dalamPanah++;
}
function enterPanahArah() {
this.swapDepths((1000 + this._x) + (this._y * 600));
}
function klikGubug() {
if (((sudahSelesai == false) && (sedangPause == false)) || (adaTutorial == true)) {
myStr = new String(this);
indiGubug = myStr.substr(myStr.length - 1, 1);
if (hutUnit.posisiKe == indiGubug) {
removeMovieClip(hutUnit);
} else {
hutUnit = attachMovie("hutUnit", "hutUnit", dalamHutUnit);
if (levelKe >= 7) {
hutUnit._xscale = 75;
hutUnit._yscale = 75;
}
hutUnit._x = this._x + 5;
hutUnit._y = this._y + 5;
if (this._currentframe <= 3) {
hutUnit.gotoAndStop(1);
} else if (this._currentframe >= 7) {
hutUnit.gotoAndStop(2);
}
hutUnit.posisiKe = indiGubug;
hutUnit.delayHutUnit = 0;
hutUnit.maxHutUnit = 150;
hutUnit.onEnterFrame = enterHutUnit;
if (this._currentframe <= 3) {
i = 1;
while (i <= 5) {
if (_root["levelUnit" + i] == 0) {
hutUnit["unit" + i].gotoAndStop(i);
hutUnit["silang" + i]._visible = true;
delete hutUnit["unit" + i].onRelease;
delete hutUnit["unit" + i].onRollOver;
delete hutUnit["unit" + i].onRollOut;
} else {
hutUnit["unit" + i].gotoAndStop(i);
hutUnit["silang" + i]._visible = false;
hutUnit["unit" + i].onRelease = klikUnit;
hutUnit["unit" + i].onRollOver = overUnit3;
hutUnit["unit" + i].onRollOut = (hutUnit["unit" + i].onReleaseOutside = outUnit3);
}
i++;
}
} else if (this._currentframe >= 7) {
i = 6;
while (i <= 9) {
if (_root["levelUnit" + i] == 0) {
hutUnit["unit" + i].gotoAndStop(i);
hutUnit["silang" + i]._visible = true;
delete hutUnit["unit" + i].onRelease;
delete hutUnit["unit" + i].onRollOver;
delete hutUnit["unit" + i].onRollOut;
} else {
hutUnit["unit" + i].gotoAndStop(i);
hutUnit["silang" + i]._visible = false;
hutUnit["unit" + i].onRelease = klikUnit;
hutUnit["unit" + i].onRollOver = overUnit3;
hutUnit["unit" + i].onRollOut = (hutUnit["unit" + i].onReleaseOutside = outUnit3);
}
i++;
}
}
}
}
}
function enterHutUnit() {
if ((sudahSelesai == false) && (sedangPause == false)) {
if (hutUnitOver == false) {
if (this.delayHutUnit >= this.maxHutUnit) {
removeMovieClip(hutUnit);
} else {
this.delayHutUnit++;
}
}
}
}
function overUnit() {
hutUnitOver = true;
this.gotoAndStop(2);
this._xscale = (this._yscale = 120);
}
function outUnit() {
hutUnitOver = false;
this.gotoAndStop(1);
this._xscale = (this._yscale = 100);
}
function overUnit2() {
hutUnitOver = true;
this.huruf_mc._visible = true;
if (this._currentframe == 1) {
this.huruf_mc.xinfo = "Forward";
} else if (this._currentframe == 2) {
this.huruf_mc.xinfo = "Stay";
} else if (this._currentframe == 3) {
this.huruf_mc.xinfo = "Backward";
}
this._xscale = (this._yscale = 120);
}
function outUnit2() {
hutUnitOver = false;
this.huruf_mc._visible = false;
this.huruf_mc.xinfo = "";
this._xscale = (this._yscale = 100);
}
function overUnit3() {
hutUnitOver = true;
this._xscale = (this._yscale = 120);
myStr = new String(this);
if (isNaN(myStr.substr(myStr.length - 2, 2))) {
indi = myStr.substr(myStr.length - 1, 1);
} else {
indi = myStr.substr(myStr.length - 2, 2);
}
frameBox_mc = attachMovie("frameBox_mc", "frameBox_mc", dalamMsgBox);
frameBox_mc.gotoAndStop(2);
if (levelKe >= 7) {
frameBox_mc._xscale = (frameBox_mc._yscale = 50);
} else {
frameBox_mc._xscale = (frameBox_mc._yscale = 75);
}
frameBox_mc._x = -500;
frameBox_mc._y = -500;
frameBox_mc.goldKe = hargaGoldUnit[indi];
pilihanSpell = _root["spellGubug" + indiGubug];
if (pilihanSpell == 50) {
pilihanSpell = 0;
}
frameBox_mc.manaKe = hargaManaUnit[pilihanSpell];
frameBox_mc.onEnterFrame = enterMsgBox;
}
function outUnit3() {
hutUnitOver = false;
this._xscale = (this._yscale = 100);
removeMovieClip(frameBox_mc);
}
function klikUnit() {
if (((sudahSelesai == false) && (sedangPause == false)) || (adaTutorial == true)) {
hutUnit.delayHutUnit = 0;
myStr = new String(this);
indiUnit = myStr.substr(myStr.length - 1, 1);
pilihanSpell = _root["spellGubug" + indiGubug];
if (pilihanSpell == 50) {
pilihanSpell = 0;
}
bisaBuatUnitGubug = true;
if (gubugDalam == true) {
if (background_mc["gubug_mc" + indiGubug]._currentframe <= 3) {
if (background_mc["gubug_mc" + indiGubug].pakaiGubug >= _root["maxHutCapacity" + background_mc["gubug_mc" + indiGubug]._currentframe]) {
bisaBuatUnitGubug = false;
}
} else if (background_mc["gubug_mc" + indiGubug]._currentframe >= 7) {
if (background_mc["gubug_mc" + indiGubug].pakaiGubug >= _root["maxCaveCapacity" + background_mc["gubug_mc" + indiGubug]._currentframe]) {
bisaBuatUnitGubug = false;
}
}
} else if (_root["gubug_mc" + indiGubug]._currentframe <= 3) {
if (_root["gubug_mc" + indiGubug].pakaiGubug >= _root["maxHutCapacity" + _root["gubug_mc" + indiGubug]._currentframe]) {
bisaBuatUnitGubug = false;
}
} else if (_root["gubug_mc" + indiGubug]._currentframe >= 7) {
if (_root["gubug_mc" + indiGubug].pakaiGubug >= _root["maxCaveCapacity" + _root["gubug_mc" + indiGubug]._currentframe]) {
bisaBuatUnitGubug = false;
}
}
if (bisaBuatUnitGubug == true) {
if (goldKe >= hargaGoldUnit[indiUnit]) {
if (manaKe >= hargaManaUnit[pilihanSpell]) {
totalTrainUnit++;
if (totalTrainUnit >= 20) {
_root.dapatMedal11 = true;
}
if (totalTrainUnit >= 40) {
_root.dapatMedal12 = true;
}
if (totalTrainUnit >= 80) {
_root.dapatMedal13 = true;
}
if (totalTrainUnit >= 160) {
_root.dapatMedal14 = true;
}
if (totalTrainUnit >= 320) {
_root.dapatMedal15 = true;
}
if (totalTrainUnit >= 640) {
_root.dapatMedal16 = true;
}
if (totalTrainUnit >= 1280) {
_root.dapatMedal17 = true;
}
if (totalTrainUnit >= 2560) {
_root.dapatMedal18 = true;
}
if (totalTrainUnit >= 5120) {
_root.dapatMedal19 = true;
}
if (totalTrainUnit >= 10240) {
_root.dapatMedal20 = true;
}
if (gubugDalam == true) {
if (levelKe == 1) {
if (indiGubug == 1) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 5, indiGubug, indiUnit);
}
} else if (levelKe == 2) {
if (indiGubug == 1) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
}
} else if (levelKe == 2) {
if (indiGubug == 1) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 5, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 7, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(background_mc["gubug_mc" + indiGubug], 8, indiGubug, indiUnit);
}
}
} else if (levelKe == 1) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 5, indiGubug, indiUnit);
}
} else if (levelKe == 2) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
}
} else if (levelKe == 3) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 5, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 7, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 8, indiGubug, indiUnit);
}
} else if (levelKe == 4) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 9, indiGubug, indiUnit);
}
} else if (levelKe == 5) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
}
} else if (levelKe == 6) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
}
} else if (levelKe == 7) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], 8, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], 9, indiGubug, indiUnit);
} else if (indiGubug == 7) {
buatJagoan(_root["gubug_mc" + indiGubug], 10, indiGubug, indiUnit);
} else if (indiGubug == 8) {
buatJagoan(_root["gubug_mc" + indiGubug], 7, indiGubug, indiUnit);
} else if (indiGubug == 9) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
}
} else if (levelKe == 8) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
}
} else if (levelKe == 9) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 14, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], 7, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], 8, indiGubug, indiUnit);
} else if (indiGubug == 7) {
buatJagoan(_root["gubug_mc" + indiGubug], 10, indiGubug, indiUnit);
} else if (indiGubug == 8) {
buatJagoan(_root["gubug_mc" + indiGubug], 11, indiGubug, indiUnit);
} else if (indiGubug == 9) {
buatJagoan(_root["gubug_mc" + indiGubug], 12, indiGubug, indiUnit);
}
} else if (levelKe == 10) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 5, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 5, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
}
} else if (levelKe == 11) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 7) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 8) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
}
} else if (levelKe == 12) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 7, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], 8, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], 9, indiGubug, indiUnit);
} else if (indiGubug == 7) {
buatJagoan(_root["gubug_mc" + indiGubug], 10, indiGubug, indiUnit);
} else if (indiGubug == 8) {
buatJagoan(_root["gubug_mc" + indiGubug], 11, indiGubug, indiUnit);
} else if (indiGubug == 9) {
buatJagoan(_root["gubug_mc" + indiGubug], 12, indiGubug, indiUnit);
}
} else if (levelKe == 13) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 5, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], 7, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], 8, indiGubug, indiUnit);
} else if (indiGubug == 7) {
buatJagoan(_root["gubug_mc" + indiGubug], 9, indiGubug, indiUnit);
} else if (indiGubug == 8) {
buatJagoan(_root["gubug_mc" + indiGubug], 10, indiGubug, indiUnit);
} else if (indiGubug == 9) {
buatJagoan(_root["gubug_mc" + indiGubug], 11, indiGubug, indiUnit);
}
} else if (levelKe == 14) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 9, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 10, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], 4, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
} else if (indiGubug == 7) {
buatJagoan(_root["gubug_mc" + indiGubug], 9, indiGubug, indiUnit);
} else if (indiGubug == 8) {
buatJagoan(_root["gubug_mc" + indiGubug], 10, indiGubug, indiUnit);
}
} else if (levelKe == 15) {
xrandPosisi = random(4) + 1;
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], xrandPosisi, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], xrandPosisi, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], xrandPosisi, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], xrandPosisi, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], xrandPosisi, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], xrandPosisi, indiGubug, indiUnit);
} else if (indiGubug == 7) {
buatJagoan(_root["gubug_mc" + indiGubug], xrandPosisi, indiGubug, indiUnit);
}
} else if (levelKe == 16) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 2, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], 8, indiGubug, indiUnit);
} else if (indiGubug == 7) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
} else if (indiGubug == 8) {
buatJagoan(_root["gubug_mc" + indiGubug], 7, indiGubug, indiUnit);
} else if (indiGubug == 9) {
buatJagoan(_root["gubug_mc" + indiGubug], 7, indiGubug, indiUnit);
}
} else if (levelKe == 17) {
if (indiGubug == 1) {
buatJagoan(_root["gubug_mc" + indiGubug], 1, indiGubug, indiUnit);
} else if (indiGubug == 2) {
buatJagoan(_root["gubug_mc" + indiGubug], 3, indiGubug, indiUnit);
} else if (indiGubug == 3) {
buatJagoan(_root["gubug_mc" + indiGubug], 6, indiGubug, indiUnit);
} else if (indiGubug == 4) {
buatJagoan(_root["gubug_mc" + indiGubug], 9, indiGubug, indiUnit);
} else if (indiGubug == 5) {
buatJagoan(_root["gubug_mc" + indiGubug], 10, indiGubug, indiUnit);
} else if (indiGubug == 6) {
buatJagoan(_root["gubug_mc" + indiGubug], 12, indiGubug, indiUnit);
} else if (indiGubug == 7) {
buatJagoan(_root["gubug_mc" + indiGubug], 13, indiGubug, indiUnit);
} else if (indiGubug == 8) {
buatJagoan(_root["gubug_mc" + indiGubug], 14, indiGubug, indiUnit);
} else if (indiGubug == 9) {
buatJagoan(_root["gubug_mc" + indiGubug], 16, indiGubug, indiUnit);
}
}
if (adaTutorial == true) {
if (sudahTekanReset == false) {
tutorial_mc.gotoAndStop(5);
}
}
} else {
kirimPesan("Can't create this unit, not enough mana!");
}
} else {
kirimPesan("Can't create this unit, not enough gold!");
}
} else {
if (_root["tombolLain" + indiGubug].upgradeBuilding.sudahKlik == false) {
if (_root["gubug_mc" + indiGubug]._currentframe >= 7) {
kirimPesan("Can't create this unit, maximum unit in this hut reached!");
} else {
kirimPesan("Can't create this unit, maximum unit in this hut reached!\nClick RESET on the hut to create more units");
}
} else {
kirimPesan("Can't create this unit, maximum unit in this hut reached!");
}
removeMovieClip(hutUnit);
removeMovieClip(frameBox_mc);
}
}
if (bisaBuatUnitGubug == true) {
if (adaTutorial == true) {
if (_root.gubug_mc8.pakaiGubug >= 10) {
tutorial_mc.gotoAndStop(6);
removeMovieClip(frameBox_mc);
removeMovieClip(hutUnit);
tutorial_mc.next_btn.onRelease = function () {
monsterMuncul._visible = true;
monsterMuncul.enabled = true;
tutorial_mc.gotoAndStop(7);
};
}
}
}
}
function setAttackDefense() {
if ((sudahSelesai == false) && (sedangPause == false)) {
indi = this._parent.posisiKe;
if (this._currentframe == 1) {
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i].tipeGubug == indi) {
_root["jagoan_mc" + i].menujuMaju = "";
_root["jagoan_mc" + i].menujuMundur = "";
if (_root["jagoan_mc" + i].posisiKini < _root["jagoan_mc" + i].posSekarang) {
if (_root["jagoan_mc" + i].tipeKini == "front") {
_root["jagoan_mc" + i].menujuMaju = true;
_root["jagoan_mc" + i].posisiKini++;
_root["jagoan_mc" + i].tipeKini = "stay";
if (_root["jagoan_mc" + i].posisiKini >= _root["jagoan_mc" + i].posSekarang) {
_root["jagoan_mc" + i].posisiKini = _root["jagoan_mc" + i].posSekarang;
}
}
} else if (_root["jagoan_mc" + i].posisiKini > _root["jagoan_mc" + i].posSekarang) {
if (_root["jagoan_mc" + i].tipeKini == "back") {
_root["jagoan_mc" + i].menujuMundur = true;
_root["jagoan_mc" + i].posisiKini--;
_root["jagoan_mc" + i].tipeKini = "stay";
if (_root["jagoan_mc" + i].posisiKini <= _root["jagoan_mc" + i].posSekarang) {
_root["jagoan_mc" + i].posisiKini = _root["jagoan_mc" + i].posSekarang;
}
}
} else {
_root["jagoan_mc" + i].tipeKini = "stay";
if (_root["jagoan_mc" + i].posisiKini <= _root["jagoan_mc" + i].posSekarang) {
_root["jagoan_mc" + i].posisiKini = _root["jagoan_mc" + i].posSekarang;
}
}
}
i++;
}
this.gotoAndStop(2);
this.huruf_mc.xinfo = "Stay";
} else if (this._currentframe == 2) {
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i].tipeGubug == indi) {
_root["jagoan_mc" + i].tipeKini = "back";
if (_root["jagoan_mc" + i].posisiKini < _root["jagoan_mc" + i].posSekarang) {
if (_root["jagoan_mc" + i].menujuMaju == "") {
_root["jagoan_mc" + i].posisiKini++;
if (_root["jagoan_mc" + i].posisiKini >= _root["jagoan_mc" + i].posMax) {
_root["jagoan_mc" + i].posisiKini = _root["jagoan_mc" + i].posMax;
}
}
} else if (_root["jagoan_mc" + i].menujuMaju == "") {
_root["jagoan_mc" + i].posisiKini++;
if (_root["jagoan_mc" + i].posisiKini >= _root["jagoan_mc" + i].posMax) {
_root["jagoan_mc" + i].posisiKini = _root["jagoan_mc" + i].posMax;
}
}
}
i++;
}
this.gotoAndStop(3);
this.huruf_mc.xinfo = "Backward";
} else if (this._currentframe == 3) {
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i].tipeGubug == indi) {
_root["jagoan_mc" + i].tipeKini = "front";
if (_root["jagoan_mc" + i].posisiKini > _root["jagoan_mc" + i].posSekarang) {
_root["jagoan_mc" + i].posisiKini--;
if (_root["jagoan_mc" + i].posisiKini <= _root["jagoan_mc" + i].posMin) {
_root["jagoan_mc" + i].posisiKini = _root["jagoan_mc" + i].posMin;
}
} else if (_root["jagoan_mc" + i].menujuMundur == "") {
_root["jagoan_mc" + i].posisiKini--;
if (_root["jagoan_mc" + i].posisiKini <= _root["jagoan_mc" + i].posMin) {
_root["jagoan_mc" + i].posisiKini = _root["jagoan_mc" + i].posMin;
}
}
}
i++;
}
this.gotoAndStop(1);
this.huruf_mc.xinfo = "Forward";
}
}
}
function buatJagoan(indi, indi2, indi3, indi4, indi5, indi6, indi7, indi8) {
xdalamJagoan = 0;
i = 1000;
while (i <= 1029) {
if (_root["jagoan_mc" + i].nyawa == undefined) {
xdalamJagoan = i;
i = 1029;
}
i++;
}
if (xdalamJagoan != 0) {
if (indi5 == "bantuan") {
jenisJagoan = indi6;
} else {
jenisJagoan = indi4;
}
if (levelKe == 16) {
if (indi3 == 1) {
randPos = 2;
} else if (indi3 == 2) {
randPos = 2;
} else if (indi3 == 3) {
randPos = 1;
} else if (indi3 == 4) {
randPos = 1;
} else if (indi3 == 5) {
randPos = 1;
} else if (indi3 == 6) {
randPos = random(2) + 1;
} else if (indi3 == 7) {
randPos = 2;
} else if (indi3 == 8) {
randPos = 1;
} else if (indi3 == 9) {
randPos = 2;
}
} else if (levelKe == 15) {
randPos = random(2) + 1;
} else if (levelKe == 14) {
if (indi3 <= 4) {
randPos = 2;
} else {
randPos = 1;
}
} else if (levelKe == 11) {
if (indi3 <= 4) {
randPos = 2;
} else {
randPos = 1;
}
} else if (levelKe == 10) {
if (indi3 == 1) {
randPos = 2;
} else if (indi3 == 2) {
randPos = 1;
} else if (indi3 == 3) {
randPos = 1;
} else if (indi3 == 4) {
randPos = 2;
} else if (indi3 == 5) {
randPos = 2;
} else if (indi3 == 6) {
randPos = 1;
}
} else if (levelKe == 8) {
if (indi3 == 1) {
randPos = 3;
} else if (indi3 == 2) {
randPos = 2;
} else if (indi3 == 3) {
randPos = 1;
}
} else if ((levelKe == 5) || (levelKe == 6)) {
if (indi3 == 1) {
randPos = 1;
} else if (indi3 == 2) {
randPos = 2;
} else if (indi3 == 3) {
randPos = 2;
} else if (indi3 == 4) {
randPos = 1;
}
} else {
randPos = random(3) + 1;
}
jumlahMonster++;
if (indi5 == "bantuan") {
goldKe = goldKe - hargaGoldUnit[pilihUnitBantuan];
} else {
goldKe = goldKe - hargaGoldUnit[indiUnit];
manaKe = manaKe - hargaManaUnit[pilihanSpell];
}
if (gubugDalam == true) {
background_mc["gubug_mc" + indi3].pakaiGubug++;
} else {
_root["gubug_mc" + indi3].pakaiGubug++;
}
jagoan = attachMovie("jagoan" + jenisJagoan, "jagoan_mc" + xdalamJagoan, xdalamJagoan);
jagoan.xdalamJagoan = xdalamJagoan;
if (levelKe >= 7) {
jagoan._xscale = 75;
jagoan._yscale = 75;
jagoan.awalScale = 75;
} else {
jagoan._xscale = 100;
jagoan._yscale = 100;
jagoan.awalScale = 100;
}
jagoan.jenisJagoan = jenisJagoan;
jagoan.life_mc._visible = false;
jagoan.posXLife = jagoan.life_mc._x;
jagoan.delayBarLife = 100;
jagoan.maxBarLife = 100;
if (indi5 == "bantuan") {
jagoan.unitBantuan = true;
jagoan._x = indi7;
jagoan._y = indi8;
} else {
jagoan.unitBantuan = false;
jagoan._x = (indi._x + random(10)) - 5;
jagoan._y = (indi._y + 10) + random(15);
}
jagoan.randPos = randPos;
jagoan.tipeGubug = indi3;
if (_root["tombolLain" + indi3].attackDefense._currentframe == 2) {
jagoan.tipeKini = "stay";
} else if (_root["tombolLain" + indi3].attackDefense._currentframe == 1) {
jagoan.tipeKini = "front";
} else {
jagoan.tipeKini = "back";
}
jagoan.posisiKini = indi2;
jagoan.posAwalan = indi2;
jagoan.posSekarang = indi2;
if (levelKe == 1) {
jagoan.posMin = 1;
jagoan.posMax = 5;
} else if (levelKe == 2) {
jagoan.posMin = 2;
jagoan.posMax = 5;
} else if (levelKe == 3) {
jagoan.posMin = 1;
jagoan.posMax = 8;
} else if (levelKe == 4) {
jagoan.posMin = 1;
jagoan.posMax = 9;
} else if (levelKe == 5) {
jagoan.posMin = 1;
jagoan.posMax = 3;
} else if (levelKe == 6) {
jagoan.posMin = 1;
jagoan.posMax = 2;
} else if (levelKe == 7) {
jagoan.posMin = 1;
jagoan.posMax = 12;
} else if (levelKe == 8) {
jagoan.posMin = 1;
jagoan.posMax = 3;
} else if (levelKe == 9) {
jagoan.posMin = 1;
jagoan.posMax = 14;
} else if (levelKe == 10) {
jagoan.posMin = 1;
jagoan.posMax = 6;
} else if (levelKe == 11) {
jagoan.posMin = 1;
jagoan.posMax = 4;
} else if (levelKe == 12) {
jagoan.posMin = 2;
jagoan.posMax = 15;
} else if (levelKe == 13) {
jagoan.posMin = 2;
jagoan.posMax = 11;
} else if (levelKe == 14) {
jagoan.posMin = 3;
jagoan.posMax = 10;
} else if (levelKe == 15) {
jagoan.posMin = 1;
jagoan.posMax = 4;
} else if (levelKe == 16) {
jagoan.posMin = 2;
jagoan.posMax = 9;
} else if (levelKe == 17) {
jagoan.posMin = 2;
jagoan.posMax = 16;
}
jagoan.randX = random(30) - 15;
jagoan.randY = random(30) - 15;
jagoan.randX2 = random(15) + 15;
jagoan.randY2 = random(15) + 15;
rand = random(2);
if (rand == 0) {
jagoan.randX2 = -jagoan.randX2;
}
xrand = random(2);
if (xrand == 0) {
jagoan.randY2 = -jagoan.randY2;
}
if (((((jenisJagoan == 4) || (jenisJagoan == 5)) || (jenisJagoan == 6)) || (jenisJagoan == 7)) || (jenisJagoan == 8)) {
jagoan.melee = false;
} else {
jagoan.melee = true;
}
jagoan.nyawa = 300 * _root["levelUnit" + jenisJagoan];
jagoan.damage = 50 * _root["levelUnit" + jenisJagoan];
jagoan.armor = 25 * _root["levelUnit" + jenisJagoan];
if (jenisJagoan == 1) {
jagoan.speed = 1.25;
} else if (jenisJagoan == 2) {
jagoan.speed = 1;
} else if (jenisJagoan == 3) {
jagoan.speed = 0.75;
} else if (jenisJagoan == 4) {
jagoan.speed = 0.5;
} else if (jenisJagoan == 5) {
jagoan.speed = 0.5;
} else if (jenisJagoan == 6) {
jagoan.speed = 1.5;
} else if (jenisJagoan == 7) {
jagoan.speed = 1.5;
} else if (jenisJagoan == 8) {
jagoan.speed = 1.5;
} else if (jenisJagoan == 9) {
jagoan.speed = 1;
}
if (jenisJagoan <= 5) {
jagoan.nyawa = jagoan.nyawa + (50 * jenisJagoan);
jagoan.damage = jagoan.damage + (30 * jenisJagoan);
jagoan.armor = jagoan.armor + (10 * jenisJagoan);
} else if (jenisJagoan == 9) {
jagoan.nyawa = jagoan.nyawa + (2000 * jenisJagoan);
jagoan.damage = jagoan.damage + (90 * jenisJagoan);
jagoan.armor = jagoan.armor + (25 * jenisJagoan);
} else if (jenisJagoan >= 6) {
jagoan.nyawa = jagoan.nyawa + (500 * jenisJagoan);
jagoan.damage = jagoan.damage + (60 * jenisJagoan);
jagoan.armor = jagoan.armor + (20 * jenisJagoan);
}
if (jenisJagoan >= 6) {
jagoan.antiConfuse = true;
} else {
jagoan.antiConfuse = false;
}
if (jenisJagoan >= 8) {
jagoan.antiAcid = true;
} else {
jagoan.antiAcid = false;
}
if (jenisJagoan >= 8) {
jagoan.antiBeku = true;
} else {
jagoan.antiBeku = false;
}
if (jenisJagoan <= 5) {
if (jagoan.melee == false) {
jagoan.damage = jagoan.damage * 0.75;
jagoan.nyawa = jagoan.nyawa * 0.5;
}
}
if (levelLifePlus == 1) {
persentase = 25;
} else if (levelLifePlus == 2) {
persentase = 50;
} else if (levelLifePlus == 3) {
persentase = 75;
} else if (levelLifePlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
tambahanLife = jagoan.nyawa * (persentase / 100);
jagoan.nyawa = jagoan.nyawa + tambahanLife;
if (levelDamagePlus == 1) {
persentase = 25;
} else if (levelDamagePlus == 2) {
persentase = 50;
} else if (levelDamagePlus == 3) {
persentase = 75;
} else if (levelDamagePlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
tambahanDamage = jagoan.damage * (persentase / 100);
jagoan.damage = jagoan.damage + tambahanDamage;
if (levelSpeedPlus == 1) {
persentase = 25;
} else if (levelSpeedPlus == 2) {
persentase = 50;
} else if (levelSpeedPlus == 3) {
persentase = 75;
} else if (levelSpeedPlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
tambahanSpeed = jagoan.speed * (persentase / 100);
jagoan.speed = jagoan.speed + tambahanSpeed;
if (levelArmorPlus == 1) {
persentase = 25;
} else if (levelArmorPlus == 2) {
persentase = 50;
} else if (levelArmorPlus == 3) {
persentase = 75;
} else if (levelArmorPlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
tambahanArmor = jagoan.armor * (persentase / 100);
jagoan.armor = jagoan.armor + tambahanArmor;
if (jagoan.melee == true) {
jagoan.range = 50;
jagoan.range2 = 100;
} else if (levelKe >= 7) {
jagoan.range = 150;
jagoan.range2 = 150;
} else {
jagoan.range = 200;
jagoan.range2 = 200;
}
if (jenisJagoan == 9) {
jagoan.range = jagoan.range * 1.25;
jagoan.range2 = jagoan.range2 * 1.25;
}
if (levelRangePlus == 1) {
persentase = 5;
} else if (levelRangePlus == 2) {
persentase = 10;
} else if (levelRangePlus == 3) {
persentase = 15;
} else if (levelRangePlus == 4) {
persentase = 20;
} else {
persentase = 0;
}
tambahanRange = jagoan.range * (persentase / 100);
jagoan.range = jagoan.range + tambahanRange;
tambahanRange2 = jagoan.range2 * (persentase / 100);
jagoan.range2 = jagoan.range2 + tambahanRange2;
jagoan.mana = 5;
jagoan.luck = 50;
if (levelLuckPlus == 1) {
persentase = 20;
} else if (levelLuckPlus == 2) {
persentase = 30;
} else if (levelLuckPlus == 3) {
persentase = 40;
} else if (levelLuckPlus == 4) {
persentase = 50;
} else {
persentase = 0;
}
jagoan.luck = jagoan.luck + persentase;
jagoan.delayEffect = 10;
if (levelCriticalPlus == 1) {
persentase = 20;
} else if (levelCriticalPlus == 2) {
persentase = 30;
} else if (levelCriticalPlus == 3) {
persentase = 40;
} else if (levelCriticalPlus == 4) {
persentase = 50;
} else {
persentase = 0;
}
berkurangCritical = jagoan.delayEffect * (persentase / 100);
jagoan.delayEffect = jagoan.delayEffect - berkurangCritical;
jagoan.delayEffect = Math.ceil(jagoan.delayEffect);
jagoan.maxEffect = jagoan.delayEffect;
if (_root["spellGubug" + indi3] == 50) {
jagoan.jenisEffect = "";
} else if (_root["spellGubug" + indi3] == 1) {
jagoan.jenisEffect = "fire";
} else if (_root["spellGubug" + indi3] == 2) {
jagoan.jenisEffect = "ice";
} else if (_root["spellGubug" + indi3] == 3) {
jagoan.jenisEffect = "acid";
} else if (_root["spellGubug" + indi3] == 4) {
jagoan.jenisEffect = "stone";
} else if (_root["spellGubug" + indi3] == 5) {
jagoan.jenisEffect = "wind";
} else if (_root["spellGubug" + indi3] == 6) {
jagoan.jenisEffect = "thunder";
} else if (_root["spellGubug" + indi3] == 7) {
jagoan.jenisEffect = "heal";
} else if (_root["spellGubug" + indi3] == 8) {
jagoan.jenisEffect = "strom";
} else if (_root["spellGubug" + indi3] == 9) {
jagoan.jenisEffect = "protect";
} else if (_root["spellGubug" + indi3] == 10) {
jagoan.jenisEffect = "confuse";
}
rand = random(3);
if (rand == 0) {
jagoan.speed = jagoan.speed + 0.25;
} else if (rand == 1) {
jagoan.speed = jagoan.speed + 0.45;
} else if (rand == 2) {
jagoan.speed = jagoan.speed + 0.65;
}
jagoan.speedMundur = 5;
jagoan.speed2 = jagoan.speed * 3;
if (jagoan.randPos == 1) {
jagoan.xtarget = background_mc["merah" + jagoan.posisiKini];
} else if (jagoan.randPos == 2) {
jagoan.xtarget = background_mc["kuning" + jagoan.posisiKini];
} else if (jagoan.randPos == 3) {
jagoan.xtarget = background_mc["hijau" + jagoan.posisiKini];
}
if (jagoan._x < jagoan.xtarget._x) {
jagoan._xscale = awalScale;
} else if (jagoan._x > jagoan.xtarget._x) {
jagoan._xscale = -awalScale;
}
jagoan.protect = false;
jagoan.delayRecovery = 0;
jagoan.maxRecovery = 10;
jagoan.maxNyawa = jagoan.nyawa;
jagoan.onEnterFrame = enterJagoan;
} else {
kirimPesan("Can't create this unit, maximum unit available reached!");
}
}
function enterJagoan() {
if (this.nyawa > 0) {
this.swapDepths((1000 + this._x) + (this._y * 600));
} else {
this.swapDepths(this.xdalamJagoan);
}
if (((sudahSelesai == false) && (sedangPause == false)) || (adaTutorial == true)) {
if (this.nyawa <= 0) {
this.life_mc._visible = false;
if (this._currentframe != 3) {
removeMovieClip(this.racunAcid);
removeMovieClip(this.esBeku);
removeMovieClip(this.bingungConfuse);
removeMovieClip(this.spellProtect);
if (jumlahMonster > 0) {
backMati();
jumlahMonster--;
}
cekEfek(this, "blood");
}
if (this._xscale > 0) {
if (this.speedMundur > 0) {
this._x = this._x - this.speedMundur;
this._rotation = this._rotation - (this.speedMundur * 4);
this.speedMundur = this.speedMundur - 0.5;
} else {
this.speedMundur = 0;
}
} else if (this._xscale < 0) {
if (this.speedMundur > 0) {
this._x = this._x + this.speedMundur;
this._rotation = this._rotation + (this.speedMundur * 4);
this.speedMundur = this.speedMundur - 0.5;
} else {
this.speedMundur = 0;
}
}
this.nyawa = 0;
this.swapDepths(this.xdalamMusuh);
this.gotoAndStop(3);
} else {
this._rotation = 0;
if (this.nyawa >= this.maxNyawa) {
this.nyawa = this.maxNyawa;
}
if (this.nyawa > 0) {
this.recovery = false;
if (this.tipeKini == "back") {
if (this.posisiKini == this.posMax) {
if (this._currentframe == 4) {
if (this.nyawa < this.maxNyawa) {
this.recovery = true;
} else {
this.delayBarLife = this.maxBarLife;
}
}
}
}
if (this.recovery == true) {
if (this.delayRecovery >= this.maxRecovery) {
if (this.nyawa > 0) {
this.delayRecovery = 0;
this.delayBarLife = 0;
this.nyawa = this.nyawa + 4;
if (levelRecoveryPlus == 1) {
persentase = 25;
} else if (levelRecoveryPlus == 2) {
persentase = 50;
} else if (levelRecoveryPlus == 3) {
persentase = 75;
} else if (levelRecoveryPlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
this.nyawa = this.nyawa + (4 * (persentase / 100));
if (this.nyawa >= this.maxNyawa) {
this.nyawa = this.maxNyawa;
this.delayBarLife = this.maxBarLife;
}
}
} else {
this.delayRecovery = this.delayRecovery + speedKini;
}
}
if (this.delayBarLife < this.maxBarLife) {
this.delayBarLife = this.delayBarLife + speedKini;
this.life_mc._visible = true;
} else {
this.delayBarLife = this.maxBarLife;
this.life_mc._visible = false;
}
this.life_mc.bar._xscale = (this.nyawa / this.maxNyawa) * 100;
if (this.life_mc.bar._xscale <= 0) {
this.life_mc.bar._xscale = 0;
} else if (this.life_mc.bar._xscale >= 100) {
this.life_mc.bar._xscale = 100;
}
if (this._xscale == 100) {
this.life_mc._xscale = 100;
this.life_mc._x = this.posXLife;
} else if (this._xscale == -100) {
this.life_mc._xscale = -100;
this.life_mc._x = this.posXLife + 45;
}
}
if (this.protect == true) {
this.spellProtect._x = this._x;
this.spellProtect._y = this._y + 2;
if ((this.lamaProtect >= this.maxProtect) || (this.nyawa <= 0)) {
removeMovieClip(this.spellProtect);
this.lamaProtect = 0;
this.protect = false;
this.spellProtect = undefined;
} else {
this.lamaProtect = this.lamaProtect + speedKini;
}
}
if (this.confuse == true) {
this.bingungConfuse._x = this._x;
this.bingungConfuse._y = this._y + 2;
if ((this.lamaConfuse >= this.maxConfuse) || (this.nyawa <= 0)) {
removeMovieClip(this.bingungConfuse);
this.lamaConfuse = 0;
this.confuse = false;
this.bingungConfuse = undefined;
} else {
this.lamaConfuse = this.lamaConfuse + speedKini;
}
}
if (this.beku == true) {
this.gotoAndStop(1);
this.anim.stop();
if ((this.lamaBeku >= this.maxBeku) || (this.nyawa <= 0)) {
removeMovieClip(this.esBeku);
this.lamaBeku = 0;
this.beku = false;
this.esBeku = undefined;
} else {
this.lamaBeku = this.lamaBeku + speedKini;
}
} else {
if (this.racun == true) {
this.delayBarLife = 0;
this.nyawa = this.nyawa - (speedKini * 2);
this.racunAcid._x = this._x;
this.racunAcid._y = this._y + 2;
if ((this.lamaRacun >= this.maxRacun) || (this.nyawa <= 0)) {
removeMovieClip(this.racunAcid);
this.lamaRacun = 0;
this.racun = false;
this.racunAcid = undefined;
} else {
this.lamaRacun = this.lamaRacun + speedKini;
}
}
if (this.confuse == true) {
if (this.wtarget == undefined) {
i = 1000;
while (i <= 1030) {
if (this != _root["jagoan_mc" + i]) {
if ((_root["jagoan_mc" + i].nyawa != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
this.jarak = Math.sqrt(Math.pow(this._x - _root["jagoan_mc" + i]._x, 2) + Math.pow(this._y - _root["jagoan_mc" + i]._y, 2));
if (this.jarak <= this.range2) {
this.wtarget = _root["jagoan_mc" + i];
i = 1030;
}
}
}
i++;
}
}
} else if (this.wtarget == undefined) {
i = 400;
while (i <= 430) {
if ((_root["musuh_mc" + i].nyawa != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
this.jarak = Math.sqrt(Math.pow(this._x - _root["musuh_mc" + i]._x, 2) + Math.pow(this._y - _root["musuh_mc" + i]._y, 2));
if (this.jarak <= this.range2) {
if ((((_root["musuh_mc" + i]._x >= 0) && (_root["musuh_mc" + i]._x <= 800)) && (_root["musuh_mc" + i]._y >= 50)) && (_root["musuh_mc" + i]._y <= 600)) {
this.wtarget = _root["musuh_mc" + i];
i = 430;
}
}
}
i++;
}
}
if (this.melee == false) {
if (this.wtarget != undefined) {
this.wjarak = Math.sqrt(Math.pow(this._x - this.wtarget._x, 2) + Math.pow(this._y - this.wtarget._y, 2));
if (this.wjarak > this.range2) {
this.wtarget = undefined;
}
}
}
if ((this.wtarget.nyawa <= 0) || (this.wtarget.nyawa == undefined)) {
if (this._currentframe == 2) {
this.gotoAndStop(4);
}
this.wtarget = undefined;
}
if (this.wtarget != undefined) {
deltaX = this._x - (this.wtarget._x + this.randX2);
deltaY = this._y - (this.wtarget._y + this.randY2);
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this.xjarak = Math.sqrt(Math.pow(this._x - this.wtarget._x, 2) + Math.pow(this._y - this.wtarget._y, 2));
if (this._x < this.wtarget._x) {
this._xscale = this.awalScale;
} else if (this._x > this.wtarget._x) {
this._xscale = -this.awalScale;
}
if (this.xjarak <= this.range) {
this.gotoAndStop(2);
} else if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > (this.speed2 * speedKini)) {
this.gotoAndStop(1);
this._y = this._y - ((this.speed2 * speedKini) * Math.cos(angle * (Math.PI/180)));
this._x = this._x + ((this.speed2 * speedKini) * Math.sin(angle * (Math.PI/180)));
}
if ((this.wtarget.nyawa <= 0) || (this.wtarget.nyawa == undefined)) {
this.wtarget = undefined;
}
if (this.tipeKini == "front") {
if (this.hitTest(this.xtarget)) {
this.posisiKini--;
if (this.posisiKini <= this.posMin) {
this.posisiKini = this.posMin;
}
if (this.randPos == 1) {
this.xtarget = background_mc["merah" + this.posisiKini];
} else if (this.randPos == 2) {
this.xtarget = background_mc["kuning" + this.posisiKini];
} else if (this.randPos == 3) {
this.xtarget = background_mc["hijau" + this.posisiKini];
}
}
} else if (this.tipeKini == "back") {
if (this.hitTest(this.xtarget)) {
this.posisiKini++;
if (this.posisiKini >= this.posMax) {
this.posisiKini = this.posMax;
}
if (this.randPos == 1) {
this.xtarget = background_mc["merah" + this.posisiKini];
} else if (this.randPos == 2) {
this.xtarget = background_mc["kuning" + this.posisiKini];
} else if (this.randPos == 3) {
this.xtarget = background_mc["hijau" + this.posisiKini];
}
}
}
} else if (this.unitBantuan == true) {
this.gotoAndStop(4);
} else if (this.unitBantuan == false) {
if (this.randPos == 1) {
this.xtarget = background_mc["merah" + this.posisiKini];
} else if (this.randPos == 2) {
this.xtarget = background_mc["kuning" + this.posisiKini];
} else if (this.randPos == 3) {
this.xtarget = background_mc["hijau" + this.posisiKini];
}
if (this.tipeKini == "front") {
if (this.posisiKini == this.posMin) {
deltaX = this._x - (this.xtarget._x + this.randX);
deltaY = this._y - (this.xtarget._y + this.randY);
this.adaRand = true;
} else {
deltaX = this._x - this.xtarget._x;
deltaY = this._y - this.xtarget._y;
this.adaRand = false;
}
} else if (this.tipeKini == "back") {
if (this.posisiKini == this.posMax) {
deltaX = this._x - (this.xtarget._x + this.randX);
deltaY = this._y - (this.xtarget._y + this.randY);
this.adaRand = true;
} else {
deltaX = this._x - this.xtarget._x;
deltaY = this._y - this.xtarget._y;
this.adaRand = false;
}
} else if (this.tipeKini == "stay") {
if (this.posisiKini == this.posAwalan) {
deltaX = this._x - (this.xtarget._x + this.randX);
deltaY = this._y - (this.xtarget._y + this.randY);
this.adaRand = true;
} else {
deltaX = this._x - this.xtarget._x;
deltaY = this._y - this.xtarget._y;
this.adaRand = false;
}
}
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > (this.speed * speedKini)) {
this.gotoAndStop(1);
this._y = this._y - ((this.speed * speedKini) * Math.cos(angle * (Math.PI/180)));
this._x = this._x + ((this.speed * speedKini) * Math.sin(angle * (Math.PI/180)));
} else {
if (this.adaRand == true) {
this._x = this.xtarget._x + this.randX;
this._y = this.xtarget._y + this.randY;
} else {
this._x = this.xtarget._x;
this._y = this.xtarget._y;
}
if (this.tipeKini == "front") {
this.posisiKini--;
if (this.posisiKini <= this.posMin) {
this.posisiKini = this.posMin;
}
} else if (this.tipeKini == "back") {
this.posisiKini++;
if (this.posisiKini >= this.posMax) {
this.posisiKini = this.posMax;
}
} else if (this.tipeKini == "stay") {
if (this.posisiKini < this.posSekarang) {
this.posisiKini++;
if (this.posisiKini >= this.posSekarang) {
this.posisiKini = this.posSekarang;
}
} else if (this.posisiKini > this.posSekarang) {
this.posisiKini--;
if (this.posisiKini <= this.posSekarang) {
this.posisiKini = this.posSekarang;
}
}
}
this.gotoAndStop(4);
}
if (this.adaRand == true) {
if (this._x == (this.xtarget._x + this.randX)) {
} else if (this._x < (this.xtarget._x + this.randX)) {
this._xscale = this.awalScale;
} else if (this._x > (this.xtarget._x + this.randX)) {
this._xscale = -this.awalScale;
}
} else if (this._x < this.xtarget._x) {
this._xscale = this.awalScale;
} else if (this._x > this.xtarget._x) {
this._xscale = -this.awalScale;
}
}
}
}
}
}
function serangJagoan(indi) {
if ((sudahSelesai == false) && (sedangPause == false)) {
if (indi.jenisJagoan == 1) {
backPukul();
} else if (indi.jenisJagoan == 2) {
backSword();
} else if (indi.jenisJagoan == 3) {
backSpear();
} else if (indi.jenisJagoan == 4) {
backPanahLempar();
} else if (indi.jenisJagoan == 5) {
backLempar();
} else if (indi.jenisJagoan == 6) {
backBird();
} else if (indi.jenisJagoan == 7) {
backBird();
} else if (indi.jenisJagoan == 8) {
backBird();
} else if (indi.jenisJagoan == 9) {
backTembak();
}
randSerang = random(100);
if (randSerang <= indi.luck) {
luckDamage = 1;
} else {
luckDamage = 0.5;
}
indi.wtarget.delayBarLife = 0;
if (indi.wtarget.protect == false) {
berkurangNyawa = (indi.damage * luckDamage) - indi.wtarget.armor;
if (berkurangNyawa <= 1) {
berkurangNyawa = 1;
}
indi.wtarget.nyawa = indi.wtarget.nyawa - berkurangNyawa;
} else {
berkurangNyawa = 0.5 * ((indi.damage * luckDamage) - indi.wtarget.armor);
if (berkurangNyawa <= 1) {
berkurangNyawa = 1;
}
indi.wtarget.nyawa = indi.wtarget.nyawa - berkurangNyawa;
}
if (indi.wtarget.nyawa <= 0) {
if (_root["levelUnit" + indi.jenisJagoan] >= 1) {
if (xlevelKe <= 20) {
_root["kiniExp" + indi.jenisJagoan] = _root["kiniExp" + indi.jenisJagoan] + 0.25;
} else if (xlevelKe <= 40) {
_root["kiniExp" + indi.jenisJagoan] = _root["kiniExp" + indi.jenisJagoan] + 0.5;
} else if (xlevelKe <= 60) {
_root["kiniExp" + indi.jenisJagoan] = _root["kiniExp" + indi.jenisJagoan] + 1;
}
if (levelExpPlus == 1) {
persentase = 100;
} else if (levelExpPlus == 2) {
persentase = 200;
} else if (levelExpPlus == 3) {
persentase = 300;
} else if (levelExpPlus == 4) {
persentase = 400;
} else {
persentase = 0;
}
if (xlevelKe <= 20) {
_root["kiniExp" + indi.jenisJagoan] = _root["kiniExp" + indi.jenisJagoan] + (0.25 * (persentase / 100));
} else if (xlevelKe <= 40) {
_root["kiniExp" + indi.jenisJagoan] = _root["kiniExp" + indi.jenisJagoan] + (0.5 * (persentase / 100));
} else if (xlevelKe <= 60) {
_root["kiniExp" + indi.jenisJagoan] = _root["kiniExp" + indi.jenisJagoan] + (1 * (persentase / 100));
}
if (_root["kiniExp" + indi.jenisJagoan] >= (_root["maxExp" + indi.jenisJagoan] * _root["levelUnit" + indi.jenisJagoan])) {
_root["kiniExp" + indi.jenisJagoan] = 0;
_root["levelUnit" + indi.jenisJagoan]++;
if (_root["levelUnit" + indi.jenisJagoan] >= 3) {
_root["levelUnit" + indi.jenisJagoan] = 3;
}
}
}
}
cekEfek(indi.wtarget, "hit");
rand = random(10);
if (rand == 0) {
cekEfek(indi.wtarget, "dust");
}
if (indi.delayEffect >= indi.maxEffect) {
indi.delayEffect = 0;
cekEfek(indi.wtarget, indi.jenisEffect, "jagoan", indi);
} else {
indi.delayEffect = indi.delayEffect + speedKini;
}
if (indi.jenisJagoan == 7) {
cekEfek(indi.wtarget, "fire", "jagoan", indi);
} else if (indi.jenisJagoan == 8) {
rand = random(4);
if (rand == 0) {
cekEfek(indi.wtarget, "fire", "jagoan", indi);
} else if (rand == 1) {
cekEfek(indi.wtarget, "ice", "jagoan", indi);
} else if (rand == 2) {
cekEfek(indi.wtarget, "acid", "jagoan", indi);
} else if (rand == 3) {
cekEfek(indi.wtarget, "wind", "jagoan", indi);
}
}
}
}
function buatMusuh() {
xdalamMusuh = 0;
i = 400;
while (i <= 430) {
if (_root["musuh_mc" + i]._x == undefined) {
xdalamMusuh = i;
i = 430;
}
i++;
}
if (xdalamMusuh != 0) {
if (kiniKeluarMusuh < maxKeluarMusuh) {
if (_root["musuh_mc" + xdalamMusuh]._x == undefined) {
jenisMusuh = keluarMusuh[kiniKeluarMusuh];
kiniKeluarMusuh++;
if (levelKe == 5) {
randPos = random(2) + 1;
} else if (levelKe == 6) {
randPos = random(2) + 1;
} else if (levelKe == 10) {
randPos = random(2) + 1;
} else if (levelKe == 11) {
randPos = random(2) + 1;
} else if (levelKe == 14) {
randPos = random(2) + 1;
} else if (levelKe == 15) {
randPos = random(2) + 1;
} else if (levelKe == 16) {
randPos = random(2) + 1;
} else {
randPos = random(3) + 1;
}
jumlahMusuh++;
musuh = attachMovie("musuh" + jenisMusuh, "musuh_mc" + xdalamMusuh, xdalamMusuh);
musuh.xdalamMusuh = xdalamMusuh;
if (levelKe >= 7) {
musuh._xscale = 75;
musuh._yscale = 75;
musuh.awalScale = 75;
} else {
musuh._xscale = 100;
musuh._yscale = 100;
musuh.awalScale = 100;
}
musuh.life_mc._visible = false;
musuh.posXLife = musuh.life_mc._x;
musuh.delayBarLife = 100;
musuh.maxBarLife = 100;
if (randPos == 1) {
musuh._x = background_mc.merah0._x;
musuh._y = background_mc.merah0._y;
} else if (randPos == 2) {
musuh._x = background_mc.kuning0._x;
musuh._y = background_mc.kuning0._y;
} else if (randPos == 3) {
musuh._x = background_mc.hijau0._x;
musuh._y = background_mc.hijau0._y;
}
musuh.randPos = randPos;
if (((jenisMusuh == 3) || (jenisMusuh == 5)) || (jenisMusuh == 8)) {
musuh.melee = false;
} else {
musuh.melee = true;
}
musuh.jenisMusuh = jenisMusuh;
musuh.nyawa = 150;
musuh.damage = 50;
musuh.armor = 25;
if (jenisMusuh == 1) {
musuh.speed = 1.25;
} else if (jenisMusuh == 2) {
musuh.speed = 0.75;
} else if (jenisMusuh == 3) {
musuh.speed = 0.5;
} else if (jenisMusuh == 4) {
musuh.speed = 1.5;
} else if (jenisMusuh == 5) {
musuh.speed = 0.5;
} else if (jenisMusuh == 6) {
musuh.speed = 1.75;
} else if (jenisMusuh == 7) {
musuh.speed = 0.75;
} else if (jenisMusuh == 8) {
musuh.speed = 1.75;
} else if (jenisMusuh == 9) {
musuh.speed = 1;
}
if (levelSlowPlus == 1) {
persentase = 10;
} else if (levelSlowPlus == 2) {
persentase = 20;
} else if (levelSlowPlus == 3) {
persentase = 30;
} else if (levelSlowPlus == 4) {
persentase = 40;
} else {
persentase = 0;
}
tambahanSlow = musuh.speed * (persentase / 100);
musuh.speed = musuh.speed - tambahanSlow;
if (xlevelKe >= 61) {
if (jenisMusuh == 9) {
musuh.nyawa = musuh.nyawa + ((10000 * jenisMusuh) * 6);
} else if (jenisMusuh >= 7) {
musuh.nyawa = musuh.nyawa + ((4000 * jenisMusuh) * 6);
} else if (jenisMusuh >= 6) {
musuh.nyawa = musuh.nyawa + ((2000 * jenisMusuh) * 6);
} else if (jenisMusuh >= 5) {
musuh.nyawa = musuh.nyawa + ((500 * jenisMusuh) * 6);
} else {
musuh.nyawa = musuh.nyawa + ((50 * jenisMusuh) * 6);
}
musuh.damage = musuh.damage + 1000;
musuh.speed = musuh.speed * 2.5;
} else if (xlevelKe >= 57) {
if (jenisMusuh == 9) {
musuh.nyawa = musuh.nyawa + ((10000 * jenisMusuh) * 5);
} else if (jenisMusuh >= 7) {
musuh.nyawa = musuh.nyawa + ((4000 * jenisMusuh) * 5);
} else if (jenisMusuh >= 6) {
musuh.nyawa = musuh.nyawa + ((2000 * jenisMusuh) * 5);
} else if (jenisMusuh >= 5) {
musuh.nyawa = musuh.nyawa + ((500 * jenisMusuh) * 5);
} else {
musuh.nyawa = musuh.nyawa + ((50 * jenisMusuh) * 5);
}
musuh.damage = musuh.damage + 400;
musuh.speed = musuh.speed * 2.5;
} else if (xlevelKe >= 47) {
if (jenisMusuh == 9) {
musuh.nyawa = musuh.nyawa + ((10000 * jenisMusuh) * 4);
} else if (jenisMusuh >= 7) {
musuh.nyawa = musuh.nyawa + ((4000 * jenisMusuh) * 4);
} else if (jenisMusuh >= 6) {
musuh.nyawa = musuh.nyawa + ((2000 * jenisMusuh) * 4);
} else if (jenisMusuh >= 5) {
musuh.nyawa = musuh.nyawa + ((500 * jenisMusuh) * 4);
} else {
musuh.nyawa = musuh.nyawa + ((50 * jenisMusuh) * 4);
}
musuh.damage = musuh.damage + 300;
musuh.speed = musuh.speed * 2;
} else if (xlevelKe >= 37) {
if (jenisMusuh == 9) {
musuh.nyawa = musuh.nyawa + ((10000 * jenisMusuh) * 3);
} else if (jenisMusuh >= 7) {
musuh.nyawa = musuh.nyawa + ((4000 * jenisMusuh) * 3);
} else if (jenisMusuh >= 6) {
musuh.nyawa = musuh.nyawa + ((2000 * jenisMusuh) * 3);
} else if (jenisMusuh >= 5) {
musuh.nyawa = musuh.nyawa + ((500 * jenisMusuh) * 2.5);
} else {
musuh.nyawa = musuh.nyawa + ((50 * jenisMusuh) * 2.5);
}
musuh.damage = musuh.damage + 100;
musuh.speed = musuh.speed * 1.5;
} else if (xlevelKe >= 21) {
if (jenisMusuh == 9) {
musuh.nyawa = musuh.nyawa + ((10000 * jenisMusuh) * 2);
} else if (jenisMusuh >= 7) {
musuh.nyawa = musuh.nyawa + ((4000 * jenisMusuh) * 2);
} else if (jenisMusuh >= 6) {
musuh.nyawa = musuh.nyawa + ((2000 * jenisMusuh) * 2);
} else if (jenisMusuh >= 5) {
musuh.nyawa = musuh.nyawa + ((500 * jenisMusuh) * 2);
} else {
musuh.nyawa = musuh.nyawa + ((50 * jenisMusuh) * 2);
}
musuh.damage = musuh.damage + 50;
} else if (jenisMusuh == 9) {
musuh.nyawa = musuh.nyawa + (10000 * jenisMusuh);
} else if (jenisMusuh >= 7) {
musuh.nyawa = musuh.nyawa + (4000 * jenisMusuh);
} else if (jenisMusuh >= 6) {
musuh.nyawa = musuh.nyawa + (2000 * jenisMusuh);
} else if (jenisMusuh >= 5) {
musuh.nyawa = musuh.nyawa + (500 * jenisMusuh);
} else {
musuh.nyawa = musuh.nyawa + (50 * jenisMusuh);
}
if (musuh.melee == true) {
musuh.nyawa = musuh.nyawa * 1.5;
} else if (musuh.melee == false) {
musuh.damage = musuh.damage * 1.5;
}
musuh.nyawa = musuh.nyawa * 2;
if (jenisMusuh == 9) {
musuh.boss = true;
} else {
musuh.boss = false;
}
if (jenisMusuh >= 6) {
musuh.antiConfuse = true;
} else {
musuh.antiConfuse = false;
}
if (((jenisMusuh == 5) || (jenisMusuh == 7)) || (jenisMusuh == 9)) {
musuh.antiAcid = true;
} else {
musuh.antiAcid = false;
}
if ((((jenisMusuh == 6) || (jenisMusuh == 7)) || (jenisMusuh == 8)) || (jenisMusuh == 9)) {
musuh.antiBeku = true;
} else {
musuh.antiBeku = false;
}
if (jenisMusuh == 9) {
musuh.damage = musuh.damage + (50 * jenisMusuh);
} else if (jenisMusuh == 3) {
musuh.damage = musuh.damage + (10 * jenisMusuh);
} else {
musuh.damage = musuh.damage + (20 * jenisMusuh);
}
if (jenisMusuh == 9) {
musuh.armor = musuh.armor + (15 * jenisMusuh);
} else {
musuh.armor = musuh.armor + (10 * jenisMusuh);
}
if (musuh.melee == true) {
musuh.range = 50;
musuh.range2 = 100;
} else {
musuh.range = 180;
musuh.range2 = 180;
}
musuh.mana = 5;
musuh.luck = 50;
musuh.delayEffect = 6;
musuh.maxEffect = 6;
if (jenisMusuh == 3) {
musuh.jenisEffect = "fire";
} else if (jenisMusuh == 4) {
musuh.jenisEffect = "ice";
} else if (jenisMusuh == 5) {
rand = random(2);
if (rand == 0) {
musuh.jenisEffect = "acid";
} else {
musuh.jenisEffect = "wind";
}
} else if (jenisMusuh == 6) {
musuh.jenisEffect = "heal";
} else if (jenisMusuh == 7) {
rand = random(2);
if (rand == 0) {
musuh.jenisEffect = "strom";
} else {
musuh.jenisEffect = "thunder";
}
} else if (jenisMusuh == 8) {
rand = random(2);
if (rand == 0) {
musuh.jenisEffect = "protect";
} else {
musuh.jenisEffect = "confuse";
}
} else {
musuh.jenisEffect = "";
}
musuh.esBeku = undefined;
rand = random(3);
if (rand == 0) {
musuh.speed = musuh.speed + 0.25;
} else if (rand == 1) {
musuh.speed = musuh.speed + 0.45;
} else if (rand == 2) {
musuh.speed = musuh.speed + 0.65;
}
musuh.speedMundur = 5;
musuh.speed2 = musuh.speed * 3;
musuh.randX = random(30) - 15;
musuh.randY = random(30) - 15;
if (levelKe == 1) {
musuh.posisiKini = 2;
musuh.posMax = 7;
} else if (levelKe == 2) {
musuh.posisiKini = 1;
musuh.posMax = 7;
} else if (levelKe == 3) {
musuh.posisiKini = 1;
musuh.posMax = 10;
} else if (levelKe == 4) {
musuh.posisiKini = 1;
musuh.posMax = 11;
} else if (levelKe == 5) {
musuh.posisiKini = 1;
musuh.posMax = 5;
} else if (levelKe == 6) {
musuh.posisiKini = 1;
musuh.posMax = 4;
} else if (levelKe == 7) {
musuh.posisiKini = 1;
musuh.posMax = 15;
} else if (levelKe == 8) {
musuh.posisiKini = 1;
musuh.posMax = 5;
} else if (levelKe == 9) {
musuh.posisiKini = 1;
musuh.posMax = 16;
} else if (levelKe == 10) {
musuh.posisiKini = 1;
musuh.posMax = 8;
} else if (levelKe == 11) {
musuh.posisiKini = 1;
musuh.posMax = 6;
} else if (levelKe == 12) {
musuh.posisiKini = 1;
musuh.posMax = 17;
} else if (levelKe == 13) {
musuh.posisiKini = 1;
musuh.posMax = 14;
} else if (levelKe == 14) {
musuh.posisiKini = 1;
musuh.posMax = 13;
} else if (levelKe == 15) {
musuh.posisiKini = 1;
musuh.posMax = 7;
} else if (levelKe == 16) {
musuh.posisiKini = 1;
musuh.posMax = 12;
} else if (levelKe == 17) {
musuh.posisiKini = 1;
musuh.posMax = 19;
}
musuh.protect = false;
musuh.maxNyawa = musuh.nyawa;
musuh.onEnterFrame = enterMusuh;
}
} else {
selesaiWave = true;
}
}
}
function enterMusuh() {
this.swapDepths((1000 + this._x) + (this._y * 600));
if ((sudahSelesai == false) && (sedangPause == false)) {
if (this.nyawa <= 0) {
this.life_mc._visible = false;
if (this._xscale > 0) {
if (this.speedMundur > 0) {
this._x = this._x - this.speedMundur;
this._rotation = this._rotation - (this.speedMundur * 4);
this.speedMundur = this.speedMundur - 0.5;
} else {
this.speedMundur = 0;
}
} else if (this._xscale < 0) {
if (this.speedMundur > 0) {
this._x = this._x + this.speedMundur;
this._rotation = this._rotation + (this.speedMundur * 4);
this.speedMundur = this.speedMundur - 0.5;
} else {
this.speedMundur = 0;
}
}
this.nyawa = 0;
if ((this._currentframe != 3) && (this.nyawa != undefined)) {
removeMovieClip(this.esBeku);
removeMovieClip(this.racunAcid);
removeMovieClip(this.bingungConfuse);
removeMovieClip(this.spellProtect);
if (this.jenisMusuh != undefined) {
if (xlevelKe >= 61) {
goldKe = goldKe + ((this.jenisMusuh * 30) * 1.2);
} else if (xlevelKe >= 50) {
goldKe = goldKe + ((this.jenisMusuh * 20) * 1.2);
} else if (xlevelKe >= 40) {
goldKe = goldKe + ((this.jenisMusuh * 10) * 1.2);
} else {
goldKe = goldKe + ((this.jenisMusuh * 5) * 1.2);
}
manaKe = manaKe + (this.jenisMusuh * 4.5);
}
if (levelMoneyPlus == 1) {
persentase = 25;
} else if (levelMoneyPlus == 2) {
persentase = 50;
} else if (levelMoneyPlus == 3) {
persentase = 75;
} else if (levelMoneyPlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
if (this.jenisMusuh != undefined) {
if (xlevelKe >= 61) {
goldKe = goldKe + (((this.jenisMusuh * 30) * (persentase / 100)) * 1.2);
} else if (xlevelKe >= 50) {
goldKe = goldKe + (((this.jenisMusuh * 20) * (persentase / 100)) * 1.2);
} else if (xlevelKe >= 40) {
goldKe = goldKe + (((this.jenisMusuh * 10) * (persentase / 100)) * 1.2);
} else {
goldKe = goldKe + (((this.jenisMusuh * 5) * (persentase / 100)) * 1.2);
}
}
goldKe = Math.ceil(goldKe);
if (levelManaPlus == 1) {
persentase = 25;
} else if (levelManaPlus == 2) {
persentase = 50;
} else if (levelManaPlus == 3) {
persentase = 75;
} else if (levelManaPlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
if (this.jenisMusuh != undefined) {
manaKe = manaKe + ((this.jenisMusuh * 4.5) * (persentase / 100));
}
manaKe = Math.ceil(manaKe);
killMusuh++;
if (jumlahMusuh > 0) {
backMati();
jumlahMusuh--;
totalKillEnemy++;
if (totalKillEnemy >= 400) {
_root.dapatMedal31 = true;
}
if (totalKillEnemy >= 1400) {
_root.dapatMedal32 = true;
}
if (totalKillEnemy >= 2400) {
_root.dapatMedal33 = true;
}
if (totalKillEnemy >= 3400) {
_root.dapatMedal34 = true;
}
if (totalKillEnemy >= 4400) {
_root.dapatMedal35 = true;
}
if (totalKillEnemy >= 5400) {
_root.dapatMedal36 = true;
}
if (totalKillEnemy >= 6400) {
_root.dapatMedal37 = true;
}
if (totalKillEnemy >= 7400) {
_root.dapatMedal38 = true;
}
if (totalKillEnemy >= 8400) {
_root.dapatMedal39 = true;
}
if (totalKillEnemy >= 9400) {
_root.dapatMedal40 = true;
}
}
if ((akhirWave == true) && (jumlahMusuh <= 0)) {
cekWin();
}
cekEfek(this, "blood");
}
this.gotoAndStop(3);
} else {
this._rotation = 0;
if (this.nyawa >= this.maxNyawa) {
this.nyawa = this.maxNyawa;
}
if (this.nyawa > 0) {
if (this.delayBarLife < this.maxBarLife) {
this.delayBarLife = this.delayBarLife + speedKini;
this.life_mc._visible = true;
} else {
this.delayBarLife = this.maxBarLife;
this.life_mc._visible = false;
}
this.life_mc.bar._xscale = (this.nyawa / this.maxNyawa) * 100;
if (this.life_mc.bar._xscale <= 0) {
this.life_mc.bar._xscale = 0;
} else if (this.life_mc.bar._xscale >= 100) {
this.life_mc.bar._xscale = 100;
}
if (this._xscale == 100) {
this.life_mc._xscale = 100;
this.life_mc._x = this.posXLife;
} else if (this._xscale == -100) {
this.life_mc._xscale = -100;
this.life_mc._x = this.posXLife + 45;
}
}
if (this.protect == true) {
this.spellProtect._x = this._x;
this.spellProtect._y = this._y + 2;
if ((this.lamaProtect >= this.maxProtect) || (this.nyawa <= 0)) {
removeMovieClip(this.spellProtect);
this.lamaProtect = 0;
this.protect = false;
this.spellProtect = undefined;
} else {
this.lamaProtect = this.lamaProtect + speedKini;
}
}
if (this.confuse == true) {
this.bingungConfuse._x = this._x;
this.bingungConfuse._y = this._y + 2;
if ((this.lamaConfuse >= this.maxConfuse) || (this.nyawa <= 0)) {
removeMovieClip(this.bingungConfuse);
this.lamaConfuse = 0;
this.confuse = false;
this.bingungConfuse = undefined;
} else {
this.lamaConfuse = this.lamaConfuse + speedKini;
}
if (this.boss == true) {
removeMovieClip(this.bingungConfuse);
this.lamaConfuse = 0;
this.confuse = false;
this.bingungConfuse = undefined;
}
}
if (this.beku == true) {
this.gotoAndStop(1);
this.anim.stop();
if ((this.lamaBeku >= this.maxBeku) || (this.nyawa <= 0)) {
removeMovieClip(this.esBeku);
this.lamaBeku = 0;
this.beku = false;
this.esBeku = undefined;
} else {
this.lamaBeku = this.lamaBeku + speedKini;
}
if (this.boss == true) {
removeMovieClip(this.esBeku);
this.lamaBeku = 0;
this.beku = false;
this.esBeku = undefined;
}
} else {
if (this.racun == true) {
this.delayBarLife = 0;
this.nyawa = this.nyawa - (speedKini * 5);
this.racunAcid._x = this._x;
this.racunAcid._y = this._y + 2;
if ((this.lamaRacun >= this.maxRacun) || (this.nyawa <= 0)) {
removeMovieClip(this.racunAcid);
this.lamaRacun = 0;
this.racun = false;
this.racunAcid = undefined;
} else {
this.lamaRacun = this.lamaRacun + speedKini;
}
if (this.boss == true) {
removeMovieClip(this.racunAcid);
this.lamaRacun = 0;
this.racun = false;
this.racunAcid = undefined;
}
}
if (this.confuse == true) {
if (this.wtarget == undefined) {
i = 400;
while (i <= 430) {
if ((_root["musuh_mc" + i].nyawa != undefined) && (_root["musuh_mc" + i].nyawa > 0)) {
if (this != _root["musuh_mc" + i]) {
this.jarak = Math.sqrt(Math.pow(this._x - _root["musuh_mc" + i]._x, 2) + Math.pow(this._y - _root["musuh_mc" + i]._y, 2));
if (this.jarak <= this.range2) {
this.wtarget = _root["musuh_mc" + i];
i = 430;
}
}
}
i++;
}
}
} else if (this.wtarget == undefined) {
i = 1000;
while (i <= 1030) {
if ((_root["jagoan_mc" + i].nyawa != undefined) && (_root["jagoan_mc" + i].nyawa > 0)) {
this.jarak = Math.sqrt(Math.pow(this._x - _root["jagoan_mc" + i]._x, 2) + Math.pow(this._y - _root["jagoan_mc" + i]._y, 2));
if (this.jarak <= this.range2) {
if ((((_root["jagoan_mc" + i]._x >= 0) && (_root["jagoan_mc" + i]._x <= 800)) && (_root["jagoan_mc" + i]._y >= 50)) && (_root["jagoan_mc" + i]._y <= 600)) {
this.wtarget = _root["jagoan_mc" + i];
i = 1030;
}
}
}
i++;
}
}
if (this.melee == false) {
if (this.wtarget != undefined) {
this.wjarak = Math.sqrt(Math.pow(this._x - this.wtarget._x, 2) + Math.pow(this._y - this.wtarget._y, 2));
if (this.wjarak > this.range2) {
this.wtarget = undefined;
}
}
}
if ((this.wtarget.nyawa <= 0) || (this.wtarget.nyawa == undefined)) {
if (this._currentframe == 2) {
this.gotoAndStop(4);
}
this.wtarget = undefined;
}
if (this.wtarget != undefined) {
deltaX = (this._x - this.wtarget._x) + this.randX;
deltaY = (this._y - this.wtarget._y) + this.randY;
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
this.xjarak = Math.sqrt(Math.pow(this._x - this.wtarget._x, 2) + Math.pow(this._y - this.wtarget._y, 2));
if (this._x < this.wtarget._x) {
this._xscale = this.awalScale;
} else if (this._x > this.wtarget._x) {
this._xscale = -this.awalScale;
}
if (this.xjarak <= this.range) {
this.gotoAndStop(2);
} else if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > (this.speed2 * speedKini)) {
this.gotoAndStop(1);
this._y = this._y - ((this.speed2 * speedKini) * Math.cos(angle * (Math.PI/180)));
this._x = this._x + ((this.speed2 * speedKini) * Math.sin(angle * (Math.PI/180)));
}
if ((this.wtarget.nyawa <= 0) || (this.wtarget.nyawa == undefined)) {
this.wtarget = undefined;
}
if (this.hitTest(this.xtarget)) {
this.posisiKini++;
if (this.posisiKini >= this.posMax) {
this.posisiKini = this.posMax;
}
if (this.randPos == 1) {
this.xtarget = background_mc["merah" + this.posisiKini];
} else if (this.randPos == 2) {
this.xtarget = background_mc["kuning" + this.posisiKini];
} else if (this.randPos == 3) {
this.xtarget = background_mc["hijau" + this.posisiKini];
}
}
} else {
if (this.randPos == 1) {
this.xtarget = background_mc["merah" + this.posisiKini];
} else if (this.randPos == 2) {
this.xtarget = background_mc["kuning" + this.posisiKini];
} else if (this.randPos == 3) {
this.xtarget = background_mc["hijau" + this.posisiKini];
}
deltaX = this._x - this.xtarget._x;
deltaY = this._y - this.xtarget._y;
if (this._x < this.xtarget._x) {
this._xscale = this.awalScale;
} else if (this._x > this.xtarget._x) {
this._xscale = -this.awalScale;
}
angle = (-Math.atan2(deltaX, deltaY)) / (Math.PI/180);
if (Math.sqrt((deltaX * deltaX) + (deltaY * deltaY)) > (this.speed * speedKini)) {
this.gotoAndStop(1);
this._y = this._y - ((this.speed * speedKini) * Math.cos(angle * (Math.PI/180)));
this._x = this._x + ((this.speed * speedKini) * Math.sin(angle * (Math.PI/180)));
} else {
this.posisiKini++;
if (this.posisiKini >= this.posMax) {
if (this._currentframe != 3) {
berkurangBase--;
if (berkurangBase <= 0) {
cekLose();
} else {
removeMovieClip(this.esBeku);
removeMovieClip(this.racunAcid);
removeMovieClip(this.bingungConfuse);
removeMovieClip(this.spellProtect);
if (this.jenisMusuh != undefined) {
if (xlevelKe >= 61) {
goldKe = goldKe + ((this.jenisMusuh * 30) * 1.2);
} else if (xlevelKe >= 50) {
goldKe = goldKe + ((this.jenisMusuh * 20) * 1.2);
} else if (xlevelKe >= 40) {
goldKe = goldKe + ((this.jenisMusuh * 10) * 1.2);
} else {
goldKe = goldKe + ((this.jenisMusuh * 5) * 1.2);
}
manaKe = manaKe + (this.jenisMusuh * 4.5);
}
if (levelMoneyPlus == 1) {
persentase = 25;
} else if (levelMoneyPlus == 2) {
persentase = 50;
} else if (levelMoneyPlus == 3) {
persentase = 75;
} else if (levelMoneyPlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
if (this.jenisMusuh != undefined) {
if (xlevelKe >= 61) {
goldKe = goldKe + (((this.jenisMusuh * 30) * (persentase / 100)) * 1.2);
} else if (xlevelKe >= 50) {
goldKe = goldKe + (((this.jenisMusuh * 20) * (persentase / 100)) * 1.2);
} else if (xlevelKe >= 40) {
goldKe = goldKe + (((this.jenisMusuh * 10) * (persentase / 100)) * 1.2);
} else {
goldKe = goldKe + (((this.jenisMusuh * 5) * (persentase / 100)) * 1.2);
}
}
goldKe = Math.ceil(goldKe);
if (levelManaPlus == 1) {
persentase = 25;
} else if (levelManaPlus == 2) {
persentase = 50;
} else if (levelManaPlus == 3) {
persentase = 75;
} else if (levelManaPlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
if (this.jenisMusuh != undefined) {
manaKe = manaKe + ((this.jenisMusuh * 4.5) * (persentase / 100));
}
manaKe = Math.ceil(manaKe);
killMusuh++;
if (jumlahMusuh > 0) {
backMati();
jumlahMusuh--;
}
if ((akhirWave == true) && (jumlahMusuh <= 0)) {
cekWin();
}
this.sudahSelesaiAkhir = true;
}
}
}
}
}
}
}
}
if (this.sudahSelesaiAkhir == true) {
delete this.onEnterFrame;
this.onEnterFrame = removeMusuh;
}
}
function removeMusuh() {
this.nyawa = 0;
this.swapDepths(this.xdalamMusuh);
delete this.onEnterFrame;
removeMovieClip(this);
}
function serangMusuh(indi) {
if ((sudahSelesai == false) && (sedangPause == false)) {
if (indi.jenisMusuh == 1) {
backSword();
} else if (indi.jenisMusuh == 2) {
backPukul();
} else if (indi.jenisMusuh == 3) {
backPanah();
} else if (indi.jenisMusuh == 4) {
backPanah();
} else if (indi.jenisMusuh == 5) {
backSpear();
} else if (indi.jenisMusuh == 6) {
backSword();
} else if (indi.jenisMusuh == 7) {
backPukul();
} else if (indi.jenisMusuh == 8) {
backLempar();
} else if (indi.jenisMusuh == 9) {
backTembak();
}
randSerang = random(100);
if (randSerang <= indi.luck) {
luckDamage = 2;
} else {
luckDamage = 1;
}
indi.wtarget.delayBarLife = 0;
if (indi.wtarget.protect == false) {
berkurangNyawa = (indi.damage * luckDamage) - indi.wtarget.armor;
if (berkurangNyawa <= 1) {
berkurangNyawa = 1;
}
indi.wtarget.nyawa = indi.wtarget.nyawa - berkurangNyawa;
} else {
berkurangNyawa = 0.5 * ((indi.damage * luckDamage) - indi.wtarget.armor);
if (berkurangNyawa <= 1) {
berkurangNyawa = 1;
}
indi.wtarget.nyawa = indi.wtarget.nyawa - berkurangNyawa;
}
cekEfek(indi.wtarget, "hit");
rand = random(10);
if (rand == 0) {
cekEfek(indi.wtarget, "dust");
}
if (indi.delayEffect >= indi.maxEffect) {
indi.delayEffect = 0;
cekEfek(indi.wtarget, indi.jenisEffect, "musuh", indi);
} else {
indi.delayEffect = indi.delayEffect + speedKini;
}
}
}
function cekEfek(indi, indi2, indi3, indi4) {
if (sudahSelesai == false) {
if (indi._x != undefined) {
if (indi2 == "hit") {
rand = random(2);
if (rand == 0) {
rand2 = random(2) + 1;
efek = attachMovie("efekHit" + rand2, "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi._x - 5) + random(10);
efek._y = (indi._y - 30) - random(10);
efek._xscale = (efek._yscale = 75 + random(50));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
rand = random(2);
if (rand == 0) {
efek.onEnterFrame = enterEfek2;
}
R = random(256);
G = random(256);
B = random(256);
colorHexString = (R.toString(16) + G.toString(16)) + B.toString(16);
colorHex = parseInt(colorHexString, 16);
myColor = new Color(efek);
myColor.setRGB(colorHex);
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
}
} else if (indi2 == "dust") {
rand2 = random(2) + 1;
efek = attachMovie("efekDebu" + rand2, "efek_mc" + dalamEfek, dalamEfek);
if (indi._x == undefined) {
efek._x = -500;
efek._y = -500;
} else {
efek._x = indi._x;
efek._y = indi._y;
}
efek._xscale = (efek._yscale = 75 + random(50));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.onEnterFrame = enterEfek2;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
} else if (indi2 == "dust2") {
rand2 = 1;
efek = attachMovie("efekDebu" + rand2, "efek_mc" + dalamEfek, dalamEfek);
if (indi._x == undefined) {
efek._x = -500;
efek._y = -500;
} else {
efek._x = indi._x;
efek._y = indi._y;
}
efek._xscale = (efek._yscale = 150 + random(50));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.onEnterFrame = enterEfek2;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
} else if (indi2 == "smoke") {
efek = attachMovie("efekAsap", "asap_mc" + dalamEfek3, dalamEfek3);
efek._x = (indi._x - 10) + random(20);
efek._y = indi._y - random(30);
efek._xscale = (efek._yscale = 75 + random(50));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.speedDebu = 3 + random(2);
efek._rotation = random(360);
rand = random(2);
if (rand == 0) {
myColor = new Color(efek);
myColor.setRGB(3355443);
}
efek.onEnterFrame = enterEfekDebu;
dalamEfek3++;
if (dalamEfek3 >= 850500) {
dalamEfek3 = 850000 /* 0x0CF850 */;
}
} else if (indi2 == "blood") {
if (indi.esBeku._x == undefined) {
efek = attachMovie("efekDarah", "efek_mc" + dalamEfek3, dalamEfek3);
efek._x = (indi._x + random(10)) - 5;
efek._y = (indi._y - 10) - random(5);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 75 + random(25));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
dalamEfek3++;
if (dalamEfek3 >= 850500) {
dalamEfek3 = 850000 /* 0x0CF850 */;
}
}
} else if (indi2 == "fire") {
bykApi = _root.levelSpell1;
if (bykApi == undefined) {
bykApi = 1;
}
i = 1;
while (i <= bykApi) {
efek = attachMovie("efekApi", "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi._x - 20) + random(40);
efek._y = (indi._y + 5) + random(15);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 50 + random(50));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.sudahEffect = false;
efek.onEnterFrame = enterEfekApi;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
i++;
}
} else if (indi2 == "fire2") {
bykApi = 1 + _root.levelSpell1;
if (bykApi == undefined) {
bykApi = 1;
}
i = 1;
while (i <= bykApi) {
efek = attachMovie("efekApi", "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi._x - 20) + random(40);
efek._y = (indi._y + 5) + random(15);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 50 + random(50));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.sudahEffect = false;
efek.onEnterFrame = enterEfek2;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
i++;
}
} else if (indi2 == "ice") {
bykEs = 1 + _root.levelSpell2;
if (bykEs == undefined) {
bykEs = 1;
}
i = 1;
while (i <= bykEs) {
efek = attachMovie("efekEs", "efek_mc" + dalamEfek, dalamEfek);
efek._visible = false;
efek._x = (indi._x - 25) + random(50);
efek._y = (indi._y - 30) + random(60);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 60 + random(60));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
cekHasilEffect(efek.jenisPunya, "ice", efek);
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
i++;
}
} else if (indi2 == "ice2") {
if (indi.esBeku._x == undefined) {
removeMovieClip(indi.esBeku);
efek = attachMovie("efekEs", "efek_mc" + dalamEfek2, dalamEfek2);
efek._x = indi._x + 6;
efek._y = indi._y + 6;
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 60 + random(10));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
indi.esBeku = efek;
efek.onEnterFrame = enterEfek2;
dalamEfek2++;
if (dalamEfek2 >= 801200) {
dalamEfek2 = 801000 /* 0x0C38E8 */;
}
}
} else if (indi2 == "ice3") {
bykEs = 1 + _root.levelSpell2;
if (bykEs == undefined) {
bykEs = 1;
}
i = 1;
while (i <= bykEs) {
efek = attachMovie("efekEs", "efek_mc" + dalamEfek, dalamEfek);
efek._visible = false;
efek._x = (indi._x - 25) + random(50);
efek._y = (indi._y - 30) + random(60);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 30 + random(30));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
cekHasilEffect(efek.jenisPunya, "ice3", efek);
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
i++;
}
} else if (indi2 == "acid") {
efek = attachMovie("efekRacun", "efek_mc" + dalamEfek, dalamEfek);
efek._visible = false;
efek._x = (indi._x - 10) + random(20);
efek._y = (indi._y + 5) + random(5);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 100 + random(50));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.sudahEffect = false;
cekHasilEffect(efek.jenisPunya, "acid", efek);
efek.onEnterFrame = enterEfekRacun;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
} else if (indi2 == "acid2") {
if (indi.racunAcid._x == undefined) {
removeMovieClip(indi.racunAcid);
efek = attachMovie("efekRacun2", "efek_mc" + dalamEfek2, dalamEfek2);
efek._x = indi._x;
efek._y = indi._y + 3;
efek._xscale = (efek._yscale = 65 + random(10));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
indi.racunAcid = efek;
efek.onEnterFrame = enterEfek2;
dalamEfek2++;
if (dalamEfek2 >= 801200) {
dalamEfek2 = 801000 /* 0x0C38E8 */;
}
}
} else if (indi2 == "stone") {
bykBatu = 2 + _root.levelSpell4;
if (bykBatu == undefined) {
bykBatu = 1;
}
i = 1;
while (i <= bykBatu) {
efek = attachMovie("efekBatu", "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi._x - 20) + random(40);
efek._y = (indi._y - 10) - random(15);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 50 + random(50));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.sudahEffect = false;
efek.onEnterFrame = enterEfekBatu;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
i++;
}
} else if (indi2 == "wind") {
bykAngin = 2 + _root.levelSpell5;
if (bykAngin == undefined) {
bykAngin = 1;
}
i = 1;
while (i <= bykAngin) {
efek = attachMovie("efekAngin", "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi._x - 20) + random(40);
efek._y = (indi._y + 10) + random(15);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 30 + random(30));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.sudahEffect = false;
efek.onEnterFrame = enterEfekAngin;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
i++;
}
} else if (indi2 == "thunder") {
efek = attachMovie("efekPetir", "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi._x - 10) + random(20);
efek._y = (indi._y + 5) + random(5);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 60 + random(60));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.targetMusuh = indi;
efek.sudahEffect = false;
efek.onEnterFrame = enterEfekPetir;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
} else if (indi2 == "heal") {
efek = attachMovie("efekHeal", "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi4._x + random(10)) - 5;
efek._y = (indi4._y + random(10)) - 5;
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 125 + random(25));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.targetMusuh = indi;
efek.sudahEffect = false;
efek.onEnterFrame = enterEfekHeal;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
} else if (indi2 == "strom") {
efek = attachMovie("efekStrom", "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi._x - 10) + random(20);
efek._y = (indi._y + 5) + random(5);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 75 + random(25));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.targetMusuh = indi;
efek.sudahEffect = false;
efek.onEnterFrame = enterEfekStrom;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
} else if (indi2 == "protect") {
efek = attachMovie("efekProtect", "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi4._x + random(10)) - 5;
efek._y = (indi4._y + random(10)) - 5;
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 125 + random(25));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.targetMusuh = indi;
efek.sudahEffect = false;
cekHasilEffectProtect(efek.jenisPunya, "protect", efek);
efek.onEnterFrame = enterEfekProtect;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
} else if (indi2 == "protect2") {
if (indi.spellProtect._x == undefined) {
removeMovieClip(indi.spellProtect);
efek = attachMovie("efekProtect2", "efek_mc" + dalamEfek2, dalamEfek2);
efek._x = indi._x;
efek._y = indi._y + 4;
efek._xscale = (efek._yscale = 50 + random(10));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
indi.spellProtect = efek;
efek.onEnterFrame = enterEfek2;
dalamEfek2++;
if (dalamEfek2 >= 801200) {
dalamEfek2 = 801000 /* 0x0C38E8 */;
}
}
} else if (indi2 == "confuse") {
efek = attachMovie("efekConfuse", "efek_mc" + dalamEfek, dalamEfek);
efek._x = (indi._x - 10) + random(20);
efek._y = (indi._y + 5) + random(5);
efek.gotoAndPlay(random(5) + 1);
efek._xscale = (efek._yscale = 75 + random(25));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
efek.jenisPunya = indi3;
efek.indi4 = indi4;
efek.targetMusuh = indi;
efek.sudahEffect = false;
cekHasilEffect(efek.jenisPunya, "confuse", efek);
efek.onEnterFrame = enterEfek2;
dalamEfek++;
if (dalamEfek >= 800500) {
dalamEfek = 800000 /* 0x0C3500 */;
}
} else if (indi2 == "confuse2") {
if (indi.bingungConfuse._x == undefined) {
removeMovieClip(indi.bingungConfuse);
efek = attachMovie("efekConfuse2", "efek_mc" + dalamEfek2, dalamEfek2);
efek._x = indi._x;
efek._y = indi._y + 5;
efek._xscale = (efek._yscale = 65 + random(10));
if (levelKe >= 7) {
efek._xscale = efek._xscale * 0.75;
efek._yscale = efek._yscale * 0.75;
}
indi.bingungConfuse = efek;
efek.onEnterFrame = enterEfek2;
dalamEfek2++;
if (dalamEfek2 >= 801200) {
dalamEfek2 = 801000 /* 0x0C38E8 */;
}
}
}
}
}
}
function enterEfek() {
this.swapDepths((1000 + this._x) + (this._y * 600));
}
function enterEfek2() {
}
function enterEfekDebu() {
if ((sudahSelesai == false) && (sedangPause == false)) {
this._y = this._y - (this.speedDebu * 3);
this._alpha = this._alpha - this.speedDebu;
if (this._alpha <= 0) {
removeMovieClip(this);
}
}
}
function enterEfekApi() {
if ((sudahSelesai == false) && (sedangPause == false)) {
if (this._currentframe >= 5) {
if (this.sudahEffect == false) {
this.sudahEffect = true;
cekBerkurangNyawa(this.jenisPunya, this.indi4, this, "fire");
}
}
}
}
function enterEfekAngin() {
if ((sudahSelesai == false) && (sedangPause == false)) {
if (this._currentframe >= 5) {
if (this.sudahEffect == false) {
this.sudahEffect = true;
cekBerkurangNyawa(this.jenisPunya, this.indi4, this, "wind");
cekBerkurangNyawa(this.jenisPunya, this.indi4, this, "wind");
}
} else {
cekEfek(this, "dust");
}
}
}
function enterEfekHeal() {
if ((sudahSelesai == false) && (sedangPause == false)) {
this.sudahEffect = true;
if (_root.levelSpell7 == 1) {
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
} else if (_root.levelSpell7 == 2) {
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
} else if (_root.levelSpell7 == 3) {
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
} else if (_root.levelSpell7 == 4) {
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
cekBertambahNyawa(this.jenisPunya, this.indi4, this);
}
}
}
function enterEfekProtect() {
}
function enterEfekPetir() {
if ((sudahSelesai == false) && (sedangPause == false)) {
if (this._currentframe >= 15) {
if (this.sudahEffect == false) {
this.sudahEffect = true;
cekBerkurangNyawa(this.jenisPunya, this.indi4, this, "thunder");
if (_root.levelSpell6 == 1) {
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
} else if (_root.levelSpell6 == 2) {
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
} else if (_root.levelSpell6 == 3) {
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
} else if (_root.levelSpell6 == 4) {
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "fire", this.jenisPunya, this.indi4);
}
}
}
}
this._x = targetMusuh._x;
this._y = targetMusuh._y;
}
function enterEfekBatu() {
if ((sudahSelesai == false) && (sedangPause == false)) {
if (this._currentframe >= 10) {
if (this.sudahEffect == false) {
this.sudahEffect = true;
cekBerkurangNyawa(this.jenisPunya, this.indi4, this);
cekBerkurangNyawa(this.jenisPunya, this.indi4, this);
cekBerkurangNyawa(this.jenisPunya, this.indi4, this);
cekBerkurangNyawa(this.jenisPunya, this.indi4, this);
cekEfek(this, "dust");
}
}
}
}
function enterEfekStrom() {
if ((sudahSelesai == false) && (sedangPause == false)) {
if (this._currentframe >= 5) {
if (this.sudahEffect == false) {
this.sudahEffect = true;
cekBerkurangNyawa(this.jenisPunya, this.indi4, this, "strom");
if (_root.levelSpell8 == 1) {
cekEfek(this.indi4.wtarget, "ice", this.jenisPunya, this.indi4);
} else if (_root.levelSpell8 == 2) {
cekEfek(this.indi4.wtarget, "ice", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "ice", this.jenisPunya, this.indi4);
} else if (_root.levelSpell8 == 3) {
cekEfek(this.indi4.wtarget, "ice", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "ice", this.jenisPunya, this.indi4);
cekBerkurangNyawa(this.jenisPunya, this.indi4, this, "ice");
} else if (_root.levelSpell8 == 4) {
cekEfek(this.indi4.wtarget, "ice", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "ice", this.jenisPunya, this.indi4);
cekEfek(this.indi4.wtarget, "ice", this.jenisPunya, this.indi4);
cekBerkurangNyawa(this.jenisPunya, this.indi4, this, "ice");
cekBerkurangNyawa(this.jenisPunya, this.indi4, this, "ice");
}
}
}
}
}
function cekHasilEffect(indi, indi2, indi3) {
if (indi == "jagoan") {
i = 400;
while (i <= 430) {
if (indi3.indi.hitTest(_root["musuh_mc" + i])) {
if (_root["musuh_mc" + i].nyawa > 0) {
if (indi2 == "ice") {
if (_root["musuh_mc" + i].antiBeku == false) {
_root["musuh_mc" + i].beku = true;
_root["musuh_mc" + i].lamaBeku = 0;
_root["musuh_mc" + i].maxBeku = 200 * (_root.levelSpell2 + 1);
cekEfek(_root["musuh_mc" + i], "ice2");
}
} else if (indi2 == "ice3") {
if (_root["musuh_mc" + i].antiBeku == false) {
_root["musuh_mc" + i].beku = true;
_root["musuh_mc" + i].lamaBeku = 0;
_root["musuh_mc" + i].maxBeku = 200 * (_root.levelSpell2 + 1);
cekEfek(_root["musuh_mc" + i], "ice2");
}
} else if (indi2 == "acid") {
if (_root["musuh_mc" + i].antiAcid == false) {
_root["musuh_mc" + i].racun = true;
_root["musuh_mc" + i].lamaRacun = 0;
_root["musuh_mc" + i].maxRacun = 250 * (_root.levelSpell3 + 1);
cekEfek(_root["musuh_mc" + i], "acid2");
}
} else if (indi2 == "confuse") {
if (_root["musuh_mc" + i].antiConfuse == false) {
_root["musuh_mc" + i].confuse = true;
_root["musuh_mc" + i].lamaConfuse = 0;
_root["musuh_mc" + i].maxConfuse = 250 * (_root.levelSpell10 + 1);
_root["musuh_mc" + i].wtarget = undefined;
cekEfek(_root["musuh_mc" + i], "confuse2");
}
}
}
}
i++;
}
} else if (indi == "musuh") {
i = 1000;
while (i <= 1030) {
if (indi3.indi.hitTest(_root["jagoan_mc" + i])) {
if (_root["jagoan_mc" + i].nyawa > 0) {
if (indi2 == "ice") {
if (_root["jagoan_mc" + i].antiBeku == false) {
_root["jagoan_mc" + i].beku = true;
_root["jagoan_mc" + i].lamaBeku = 0;
_root["jagoan_mc" + i].maxBeku = 200;
cekEfek(_root["jagoan_mc" + i], "ice2");
}
} else if (indi2 == "acid") {
if (_root["jagoan_mc" + i].antiAcid == false) {
_root["jagoan_mc" + i].racun = true;
_root["jagoan_mc" + i].lamaRacun = 0;
_root["jagoan_mc" + i].maxRacun = 500;
cekEfek(_root["jagoan_mc" + i], "acid2");
}
} else if (indi2 == "confuse") {
if (_root["jagoan_mc" + i].antiConfuse == false) {
_root["jagoan_mc" + i].confuse = true;
_root["jagoan_mc" + i].lamaConfuse = 0;
_root["jagoan_mc" + i].maxConfuse = 500;
_root["jagoan_mc" + i].wtarget = undefined;
cekEfek(_root["jagoan_mc" + i], "confuse2");
}
}
}
}
i++;
}
}
}
function cekHasilEffectProtect(indi, indi2, indi3) {
if (indi == "musuh") {
i = 400;
while (i <= 430) {
if (indi3.indi.hitTest(_root["musuh_mc" + i])) {
if (_root["musuh_mc" + i].nyawa > 0) {
if (indi2 == "protect") {
rand = random(2);
if (rand == 0) {
_root["musuh_mc" + i].protect = true;
_root["musuh_mc" + i].lamaProtect = 0;
_root["musuh_mc" + i].maxProtect = 200;
cekEfek(_root["musuh_mc" + i], "protect2");
}
}
}
}
i++;
}
} else if (indi == "jagoan") {
i = 1000;
while (i <= 1030) {
if (indi3.indi.hitTest(_root["jagoan_mc" + i])) {
if (_root["jagoan_mc" + i].nyawa > 0) {
if (indi2 == "protect") {
rand = random(2);
if (rand == 0) {
_root["jagoan_mc" + i].protect = true;
_root["jagoan_mc" + i].lamaProtect = 0;
_root["jagoan_mc" + i].maxProtect = 50 * _root.levelSpell9;
cekEfek(_root["jagoan_mc" + i], "protect2");
}
}
}
}
i++;
}
}
}
function cekBerkurangNyawa(indi, indi2, indi3, indi4) {
if (indi == "jagoan") {
i = 400;
while (i <= 430) {
if (indi3.indi.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].delayBarLife = 0;
if (_root["musuh_mc" + i].protect == false) {
if (indi4 == undefined) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - indi2.damage;
} else if (indi4 == "fire") {
if ((_root["musuh_mc" + i].jenisMusuh == 6) || (_root["musuh_mc" + i].jenisMusuh == 9)) {
if (_root["musuh_mc" + i].nyawa > 0) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (indi2.damage / 2);
if (_root["musuh_mc" + i].nyawa >= _root["musuh_mc" + i].maxNyawa) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].maxNyawa;
}
}
} else {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - indi2.damage;
}
} else if (indi4 == "ice") {
if ((_root["musuh_mc" + i].jenisMusuh == 4) || (_root["musuh_mc" + i].jenisMusuh == 7)) {
if (_root["musuh_mc" + i].nyawa > 0) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (indi2.damage / 2);
if (_root["musuh_mc" + i].nyawa >= _root["musuh_mc" + i].maxNyawa) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].maxNyawa;
}
}
} else {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - indi2.damage;
}
} else if (indi4 == "thunder") {
if ((_root["musuh_mc" + i].jenisMusuh == 5) || (_root["musuh_mc" + i].jenisMusuh == 8)) {
if (_root["musuh_mc" + i].nyawa > 0) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (indi2.damage / 2);
if (_root["musuh_mc" + i].nyawa >= _root["musuh_mc" + i].maxNyawa) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].maxNyawa;
}
}
} else {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - indi2.damage;
}
} else if (indi4 == "strom") {
if ((_root["musuh_mc" + i].jenisMusuh == 7) || (_root["musuh_mc" + i].jenisMusuh == 9)) {
if (_root["musuh_mc" + i].nyawa > 0) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (indi2.damage / 2);
if (_root["musuh_mc" + i].nyawa >= _root["musuh_mc" + i].maxNyawa) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].maxNyawa;
}
}
} else {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - indi2.damage;
}
} else if (indi4 == "wind") {
if ((_root["musuh_mc" + i].jenisMusuh == 6) || (_root["musuh_mc" + i].jenisMusuh == 8)) {
if (_root["musuh_mc" + i].nyawa > 0) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (indi2.damage / 2);
if (_root["musuh_mc" + i].nyawa >= _root["musuh_mc" + i].maxNyawa) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].maxNyawa;
}
}
} else {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - indi2.damage;
}
}
} else {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa - (indi2.damage / 3);
}
}
i++;
}
} else if (indi == "musuh") {
i = 1000;
while (i <= 1030) {
if (indi3.indi.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].delayBarLife = 0;
if (_root["jagoan_mc" + i].protect == false) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - indi2.damage;
} else {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa - (indi2.damage / 3);
}
}
i++;
}
}
}
function cekBertambahNyawa(indi, indi2, indi3) {
if (indi == "jagoan") {
i = 1000;
while (i <= 1030) {
if (indi3.indi.hitTest(_root["jagoan_mc" + i])) {
_root["jagoan_mc" + i].delayBarLife = 50;
if (_root["jagoan_mc" + i].nyawa > 0) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].nyawa + Math.ceil(indi2.damage / 50);
if (_root["jagoan_mc" + i].nyawa >= _root["jagoan_mc" + i].maxNyawa) {
_root["jagoan_mc" + i].nyawa = _root["jagoan_mc" + i].maxNyawa;
}
}
}
i++;
}
} else if (indi == "musuh") {
i = 400;
while (i <= 430) {
if (indi3.indi.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].delayBarLife = 50;
if (_root["musuh_mc" + i].nyawa > 0) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].nyawa + Math.ceil(indi2.damage / 50);
if (_root["musuh_mc" + i].nyawa >= _root["musuh_mc" + i].maxNyawa) {
_root["musuh_mc" + i].nyawa = _root["musuh_mc" + i].maxNyawa;
}
}
}
i++;
}
}
}
function clearSemua() {
clearInterval(idKalah);
clearInterval(idMenang);
delete _root.onEnterFrame;
removeMovieClip(ui_mc);
removeMovieClip(background_mc);
removeMovieClip(selectMagic);
removeMovieClip(panahMasuk);
removeMovieClip(panahKeluar);
removeMovieClip(hutUnit);
removeMovieClip(hasil_mc);
removeMovieClip(text_mc);
removeMovieClip(animDapat);
removeMovieClip(magicSpell_mc);
removeMovieClip(build_mc);
removeMovieClip(target_mc);
removeMovieClip(frameBox_mc);
removeMovieClip(pause_mc);
removeMovieClip(tutorial_mc);
removeMovieClip(gubugGeser);
i = 940000 /* 0x0E57E0 */;
while (i <= 940100) {
removeMovieClip(_root["spell_mc" + i]);
i++;
}
i = 700;
while (i <= dalamPanah) {
removeMovieClip(_root["obyekLain" + i]);
i++;
}
i = 1;
while (i <= 9) {
removeMovieClip(_root["gubug_mc" + i]);
i++;
}
i = 20;
while (i <= dalamObyek) {
removeMovieClip(_root["obyek" + i]);
i++;
}
i = 1;
while (i <= 9) {
removeMovieClip(_root["tombolLain" + i]);
i++;
}
i = 1000;
while (i <= 1030) {
removeMovieClip(_root["jagoan_mc" + i]);
i++;
}
i = 400;
while (i <= 430) {
removeMovieClip(_root["musuh_mc" + i]);
i++;
}
i = 850000 /* 0x0CF850 */;
while (i <= 850500) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
i = 850000 /* 0x0CF850 */;
while (i <= 850500) {
removeMovieClip(_root["asap_mc" + i]);
i++;
}
i = 801000 /* 0x0C38E8 */;
while (i <= 801200) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
i = 800000 /* 0x0C3500 */;
while (i <= 800500) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
}
function cekWin() {
if (sudahSelesai == false) {
kiniAdaMusuh = 0;
sudahSelesai = true;
idMenang = setInterval(cekMenang, 1000);
}
}
function cekMenang() {
clearInterval(idMenang);
i = 1;
while (i <= 15) {
_root["kiniExp" + i] = Math.ceil(_root["kiniExp" + i]);
i++;
}
if (_root["menangGubug" + xlevelKe] == true) {
xcoinKe = levelKe * 80;
xmanaKe = levelKe * 10;
} else {
xcoinKe = levelKe * 400;
xmanaKe = levelKe * 50;
}
xcoinKe = xcoinKe * 0.75;
xcoinKe = Math.ceil(xcoinKe);
hasil_mc = attachMovie("hasil_mc", "hasil_mc", dalamHasil);
hasil_mc._x = 400;
hasil_mc._y = 300;
hasil_mc.gotoAndStop(1);
hasil_mc.xcoinKe = xcoinKe;
hasil_mc.xmanaKe = xmanaKe;
if (berkurangBase == berkurangBaseMax) {
_root["dapatBintang" + xlevelKe] = 3;
} else if (berkurangBase >= (berkurangBaseMax / 1.5)) {
_root["dapatBintang" + xlevelKe] = 2;
} else {
_root["dapatBintang" + xlevelKe] = 1;
}
if (_root["dapatBintang" + xlevelKe] == 1) {
hasil_mc.bintang1.gotoAndStop(1);
hasil_mc.bintang2.gotoAndStop(2);
hasil_mc.bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + xlevelKe] == 2) {
hasil_mc.bintang1.gotoAndStop(1);
hasil_mc.bintang2.gotoAndStop(1);
hasil_mc.bintang3.gotoAndStop(2);
} else if (_root["dapatBintang" + xlevelKe] == 3) {
hasil_mc.bintang1.gotoAndStop(1);
hasil_mc.bintang2.gotoAndStop(1);
hasil_mc.bintang3.gotoAndStop(1);
}
hasil_mc.next_btn.onRelease = function () {
coinKe = coinKe + xcoinKe;
manaKe = manaKe + xmanaKe;
_root["menangGubug" + xlevelKe] = true;
if (xposisiWorldMap <= 4) {
_root["aktifGubug" + (xlevelKe + 1)] = true;
}
clearSemua();
posisiMenang = true;
if (_root.menangGubug61 == true) {
_root.menangGubug61 = false;
totalMenangLevel++;
if (totalMenangLevel >= 6) {
_root.dapatMedal1 = true;
}
if (totalMenangLevel >= 12) {
_root.dapatMedal2 = true;
}
if (totalMenangLevel >= 18) {
_root.dapatMedal3 = true;
}
if (totalMenangLevel >= 24) {
_root.dapatMedal4 = true;
}
if (totalMenangLevel >= 30) {
_root.dapatMedal5 = true;
}
if (totalMenangLevel >= 36) {
_root.dapatMedal6 = true;
}
if (totalMenangLevel >= 42) {
_root.dapatMedal7 = true;
}
if (totalMenangLevel >= 48) {
_root.dapatMedal8 = true;
}
if (totalMenangLevel >= 54) {
_root.dapatMedal9 = true;
}
if (totalMenangLevel >= 61) {
_root.dapatMedal10 = true;
}
simpanData();
gotoAndStop (281);
} else {
totalMenangLevel++;
if (totalMenangLevel >= 6) {
_root.dapatMedal1 = true;
}
if (totalMenangLevel >= 12) {
_root.dapatMedal2 = true;
}
if (totalMenangLevel >= 18) {
_root.dapatMedal3 = true;
}
if (totalMenangLevel >= 24) {
_root.dapatMedal4 = true;
}
if (totalMenangLevel >= 30) {
_root.dapatMedal5 = true;
}
if (totalMenangLevel >= 36) {
_root.dapatMedal6 = true;
}
if (totalMenangLevel >= 42) {
_root.dapatMedal7 = true;
}
if (totalMenangLevel >= 48) {
_root.dapatMedal8 = true;
}
if (totalMenangLevel >= 54) {
_root.dapatMedal9 = true;
}
if (totalMenangLevel >= 61) {
_root.dapatMedal10 = true;
}
simpanData();
backMenu();
if (xposisiWorldMap == 1) {
gotoAndStop (268);
} else if (xposisiWorldMap == 2) {
gotoAndStop (269);
} else if (xposisiWorldMap == 3) {
gotoAndStop (270);
} else if (xposisiWorldMap == 4) {
gotoAndStop (271);
} else if (xposisiWorldMap == 5) {
gotoAndStop (272);
}
}
};
hasil_mc.more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
}
function cekLose() {
if (sudahSelesai == false) {
sudahSelesai = true;
idKalah = setInterval(cekKalah, 1000);
}
}
function cekKalah() {
clearInterval(idKalah);
i = 1;
while (i <= 15) {
_root["kiniExp" + i] = Math.ceil(_root["kiniExp" + i]);
i++;
}
if (killMusuh >= 12) {
if (_root["menangGubug" + xlevelKe] == true) {
xcoinKe = levelKe * 40;
xmanaKe = levelKe * 5;
} else {
xcoinKe = levelKe * 120;
xmanaKe = levelKe * 20;
}
} else if (killMusuh >= 6) {
if (_root["menangGubug" + xlevelKe] == true) {
xcoinKe = levelKe * 20;
xmanaKe = levelKe * 2;
} else {
xcoinKe = levelKe * 40;
xmanaKe = levelKe * 5;
}
} else {
xcoinKe = 0;
xmanaKe = 0;
}
xcoinKe = xcoinKe * 0.75;
xcoinKe = Math.ceil(xcoinKe);
totalKalah++;
hasil_mc = attachMovie("hasil_mc", "hasil_mc", dalamHasil);
hasil_mc._x = 400;
hasil_mc._y = 300;
hasil_mc.gotoAndStop(2);
hasil_mc.xcoinKe = xcoinKe;
hasil_mc.xmanaKe = xmanaKe;
hasil_mc.xtotalKalah = "Total Defeat: " + totalKalah;
hasil_mc.next_btn.onRelease = function () {
coinKe = coinKe + xcoinKe;
manaKe = manaKe + xmanaKe;
clearSemua();
posisiMenang = true;
simpanData();
backMenu();
if (xposisiWorldMap == 1) {
gotoAndStop (268);
} else if (xposisiWorldMap == 2) {
gotoAndStop (269);
} else if (xposisiWorldMap == 3) {
gotoAndStop (270);
} else if (xposisiWorldMap == 4) {
gotoAndStop (271);
} else if (xposisiWorldMap == 5) {
gotoAndStop (272);
}
};
hasil_mc.more_btn.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
}
function kirimPesan(indi) {
adaPesan = true;
munculPesan = 0;
maxPesan = 75;
text_mc.xpesan = indi;
}
stop();
init();
buatBackground();
buatBackground2();
initPeti();
buatPanahArah();
buatUI();
buatSilang();
if (levelKe == 17) {
backMain3();
} else if ((((((((levelKe == 1) || (levelKe == 3)) || (levelKe == 5)) || (levelKe == 7)) || (levelKe == 9)) || (levelKe == 11)) || (levelKe == 13)) || (levelKe == 15)) {
backMain2();
} else {
backMain();
}
_root.onEnterFrame = function () {
kiniAdaMusuh = 0;
i = 400;
while (i <= 430) {
if (_root["musuh_mc" + i]._x != undefined) {
kiniAdaMusuh++;
}
i++;
}
kiniAdaJagoan = 0;
i = 1000;
while (i <= 1030) {
if (_root["jagoan_mc" + i]._x != undefined) {
kiniAdaJagoan++;
}
i++;
}
if ((sudahSelesai == false) && (sedangPause == false)) {
if (selesaiWave == true) {
if (waveKe >= waveMax) {
akhirWave = true;
} else {
monsterMuncul._visible = true;
if (delayWave >= maxWave) {
monsterMuncul._visible = false;
delayWave = 0;
waveKe++;
if (xlevelKe >= 52) {
initWave4();
} else if (xlevelKe >= 42) {
initWave3();
} else if (xlevelKe >= 25) {
initWave2();
} else {
initWave();
}
} else {
delayWave = delayWave + speedKini;
}
}
}
if (delayMusuh >= xdelayMusuh) {
if ((waveKe == 1) && (selesaiWave == false)) {
monsterMuncul._visible = false;
}
delayMusuh = 0;
buatMusuh();
xdelayMusuh = maxDelayMusuh;
masihAdaMusuh = false;
i = 400;
while (i <= 430) {
if (_root["musuh_mc" + i]._x != undefined) {
masihAdaMusuh = true;
}
i++;
}
if (masihAdaMusuh == false) {
jumlahMusuh = 0;
}
if ((akhirWave == true) && (jumlahMusuh <= 0)) {
cekWin();
}
} else {
delayMusuh = delayMusuh + speedKini;
}
if (delayPeti >= maxPeti) {
delayPeti = 0;
naikPeti();
} else {
delayPeti = delayPeti + (speedKini * speedPeti);
if (levelDelayPlus == 1) {
persentase = 25;
} else if (levelDelayPlus == 2) {
persentase = 50;
} else if (levelDelayPlus == 3) {
persentase = 75;
} else if (levelDelayPlus == 4) {
persentase = 100;
} else {
persentase = 0;
}
delayPeti = delayPeti + ((speedKini * speedPeti) * (persentase / 100));
}
background_mc.bar_mc.bar._xscale = persenPeti;
i = 1;
while (i <= 9) {
if (gubugDalam == true) {
background_mc["gubug_mc" + i].spell_mc.gotoAndStop(_root["spellGubug" + i]);
} else {
_root["gubug_mc" + i].spell_mc.gotoAndStop(_root["spellGubug" + i]);
}
i++;
}
}
if (goldKe <= 0) {
goldKe = 0;
}
if (manaKe <= 0) {
manaKe = 0;
}
if (coinKe <= 0) {
coinKe = 0;
}
if ((goldKe == undefined) || (isNaN(goldKe))) {
goldKe = 9999;
}
if ((manaKe == undefined) || (isNaN(manaKe))) {
manaKe = 9999;
}
if ((coinKe == undefined) || (isNaN(coinKe))) {
coinKe = 9999;
}
goldKe = Math.ceil(goldKe);
manaKe = Math.ceil(manaKe);
coinKe = Math.ceil(coinKe);
ui_mc.waveKe = (("Wave: " + waveKe) + "/") + waveMax;
if (xlevelKe == 61) {
ui_mc.levelKe = "Final Boss Level";
} else {
ui_mc.levelKe = ("Level: " + xlevelKe) + "/60";
}
ui_mc.baseKe = "Game Life: " + berkurangBase;
ui_mc.goldKe = "Gold: " + goldKe;
ui_mc.manaKe = "Mana: " + manaKe;
ui_mc.coinKe = "Coin: " + coinKe;
ui_mc.monsterKe = "Monster: " + kiniAdaJagoan;
ui_mc.enemyKe = "Enemy: " + kiniAdaMusuh;
if (adaPesan == true) {
munculPesan = munculPesan + speedKini;
if (munculPesan >= maxPesan) {
adaPesan = false;
text_mc.xpesan = "";
}
}
i = 1;
while (i <= 9) {
if (gubugDalam == true) {
if (background_mc["gubug_mc" + i]._currentframe <= 3) {
background_mc["gubug_mc" + i].maxHut = (background_mc["gubug_mc" + i].pakaiGubug + "/") + _root["maxHutCapacity" + background_mc["gubug_mc" + i]._currentframe];
} else if (background_mc["gubug_mc" + i]._currentframe >= 7) {
background_mc["gubug_mc" + i].maxHut = (background_mc["gubug_mc" + i].pakaiGubug + "/") + _root["maxCaveCapacity" + background_mc["gubug_mc" + i]._currentframe];
}
} else if (_root["gubug_mc" + i]._currentframe <= 3) {
_root["gubug_mc" + i].maxHut = (_root["gubug_mc" + i].pakaiGubug + "/") + _root["maxHutCapacity" + _root["gubug_mc" + i]._currentframe];
} else if (_root["gubug_mc" + i]._currentframe >= 7) {
_root["gubug_mc" + i].maxHut = (_root["gubug_mc" + i].pakaiGubug + "/") + _root["maxCaveCapacity" + _root["gubug_mc" + i]._currentframe];
}
i++;
}
if (gubugDalam == true) {
i = 1;
while (i <= 9) {
if (background_mc["gubug_mc" + i].pakaiGubug == _root["maxHutCapacity" + background_mc["gubug_mc" + i]._currentframe]) {
if (_root["tombolLain" + i].upgradeBuilding.sudahKlik == false) {
_root["tombolLain" + i].upgradeBuilding._visible = true;
} else {
_root["tombolLain" + i].upgradeBuilding._visible = false;
}
} else {
_root["tombolLain" + i].upgradeBuilding._visible = false;
}
i++;
}
} else {
i = 1;
while (i <= 9) {
if (_root["gubug_mc" + i].pakaiGubug == _root["maxHutCapacity" + _root["gubug_mc" + i]._currentframe]) {
if (_root["tombolLain" + i].upgradeBuilding.sudahKlik == false) {
_root["tombolLain" + i].upgradeBuilding._visible = true;
} else {
_root["tombolLain" + i].upgradeBuilding._visible = false;
}
} else {
_root["tombolLain" + i].upgradeBuilding._visible = false;
}
i++;
}
}
};
if (totalBuyUpgrades >= 50) {
_root.dapatMedal41 = true;
}
if (totalBuyUpgrades >= 60) {
_root.dapatMedal42 = true;
}
if (totalBuyUpgrades >= 70) {
_root.dapatMedal43 = true;
}
if (totalBuyUpgrades >= 80) {
_root.dapatMedal44 = true;
}
if (totalBuyUpgrades >= 90) {
_root.dapatMedal45 = true;
}
if (totalBuyUpgrades >= 100) {
_root.dapatMedal46 = true;
}
if (totalBuyUpgrades >= 110) {
_root.dapatMedal47 = true;
}
if (totalBuyUpgrades >= 120) {
_root.dapatMedal48 = true;
}
if (totalBuyUpgrades >= 130) {
_root.dapatMedal49 = true;
}
if (totalBuyUpgrades >= 140) {
_root.dapatMedal50 = true;
}
removeMovieClip(tutorial_mc);
adaTutorial = false;
if (awalTutorial == true) {
if (sudahTutorial2 == false) {
sedangPause = true;
ui_mc.spell_btn.enabled = false;
ui_mc.bantuan_btn.enabled = false;
ui_mc.menu_btn.enabled = false;
monsterMuncul.enabled = false;
tutorial_mc = attachMovie("tutorial_mc", "tutorial_mc", dalamTutorial);
tutorial_mc._x = 197;
tutorial_mc._y = 129;
tutorial_mc.gotoAndStop(1);
adaTutorial = true;
sudahTekanReset = false;
}
}
Frame 281
stop();
xtotalKalah = "Total Defeat: " + totalKalah;
next_btn.onRelease = function () {
gotoAndStop (266);
};
Symbol 8 MovieClip [titikHijau] Frame 1
stop();
Symbol 43 MovieClip Frame 1
this.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Symbol 61 MovieClip Frame 45
_parent.gotoAndStop(1);
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 3
_root.backBangun2();
Symbol 73 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 1
stop();
Symbol 105 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 132 MovieClip Frame 1
stop();
Symbol 135 MovieClip [gubug_mc] Frame 1
stop();
Symbol 142 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 1
stop();
Symbol 188 MovieClip Frame 1
stop();
Symbol 191 MovieClip Frame 1
stop();
Symbol 222 MovieClip Frame 12
_root.serangMusuh(_parent);
Symbol 223 MovieClip Frame 28
removeMovieClip(_parent);
Symbol 224 MovieClip [musuh1] Frame 1
stop();
Symbol 242 MovieClip Frame 13
_root.serangMusuh(_parent);
Symbol 243 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 244 MovieClip [musuh3] Frame 1
stop();
Symbol 264 MovieClip Frame 14
_root.serangMusuh(_parent);
Symbol 265 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 266 MovieClip [musuh2] Frame 1
stop();
Symbol 286 MovieClip Frame 13
_root.serangJagoan(_parent);
Symbol 287 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 289 MovieClip [jagoan1] Frame 1
stop();
Symbol 309 MovieClip Frame 13
_root.serangJagoan(_parent);
Symbol 310 MovieClip Frame 26
removeMovieClip(_parent);
Symbol 312 MovieClip [jagoan2] Frame 1
stop();
Symbol 332 MovieClip Frame 12
_root.serangJagoan(_parent);
Symbol 333 MovieClip Frame 26
removeMovieClip(_parent);
Symbol 335 MovieClip [jagoan3] Frame 1
stop();
Symbol 353 MovieClip Frame 12
_root.serangJagoan(_parent, "range");
Symbol 354 MovieClip Frame 26
removeMovieClip(_parent);
Symbol 356 MovieClip [jagoan4] Frame 1
stop();
Symbol 382 MovieClip Frame 8
_root.serangJagoan(_parent, "range");
Symbol 383 MovieClip Frame 26
removeMovieClip(_parent);
Symbol 385 MovieClip [jagoan5] Frame 1
stop();
Symbol 396 MovieClip [efekHit1] Frame 21
stop();
removeMovieClip(this);
Symbol 411 MovieClip [efekDebu1] Frame 27
stop();
removeMovieClip(this);
Symbol 430 MovieClip [efekApi] Frame 9
_root.cekEfek(this, "smoke");
Symbol 430 MovieClip [efekApi] Frame 20
stop();
removeMovieClip(this);
Symbol 440 MovieClip Frame 61
gotoAndPlay (10);
Symbol 477 MovieClip Frame 1
stop();
Symbol 498 MovieClip Frame 1
stop();
Symbol 499 MovieClip [hutUnit] Frame 1
stop();
Symbol 507 MovieClip Frame 1
stop();
Symbol 511 MovieClip Frame 1
stop();
Symbol 514 MovieClip Frame 1
stop();
Symbol 515 MovieClip [tombolLain] Frame 1
stop();
Symbol 536 MovieClip Frame 16
stop();
Symbol 553 MovieClip Frame 10
stop();
Symbol 554 MovieClip [efekHit2] Frame 10
stop();
removeMovieClip(this);
Symbol 571 MovieClip [efekDebu2] Frame 19
stop();
removeMovieClip(this);
Symbol 580 MovieClip Frame 4
_root.cekEfek(_parent, "smoke");
Symbol 580 MovieClip Frame 7
_root.cekEfek(_parent, "smoke");
Symbol 580 MovieClip Frame 10
_root.cekEfek(_parent, "smoke");
Symbol 581 MovieClip [spell_mc5] Frame 30
removeMovieClip(this);
Symbol 589 MovieClip [spell_mc9] Frame 60
removeMovieClip(this);
Symbol 600 MovieClip [spell_mc6] Frame 30
removeMovieClip(this);
Symbol 605 MovieClip Frame 5
_root.cekEfek(_parent, "blood");
Symbol 605 MovieClip Frame 9
_root.cekEfek(_parent, "blood");
Symbol 605 MovieClip Frame 13
_root.cekEfek(_parent, "blood");
Symbol 607 MovieClip [spell_mc3] Frame 30
removeMovieClip(this);
Symbol 623 MovieClip [spell_mc10] Frame 90
removeMovieClip(this);
Symbol 637 MovieClip [spell_mc7] Frame 30
removeMovieClip(this);
Symbol 654 MovieClip Frame 3
_root.cekEfek(_parent, "dust2");
Symbol 654 MovieClip Frame 5
_root.cekEfek(_parent, "dust2");
Symbol 654 MovieClip Frame 7
_root.cekEfek(_parent, "dust2");
Symbol 654 MovieClip Frame 9
_root.cekEfek(_parent, "dust2");
Symbol 654 MovieClip Frame 20
removeMovieClip(_parent);
Symbol 655 MovieClip [spell_mc2] Frame 20
stop();
Symbol 668 MovieClip Frame 5
_root.cekEfek(_parent, "dust2");
Symbol 668 MovieClip Frame 7
_root.cekEfek(_parent, "dust2");
Symbol 668 MovieClip Frame 9
_root.cekEfek(_parent, "dust2");
Symbol 668 MovieClip Frame 11
_root.cekEfek(_parent, "dust2");
Symbol 668 MovieClip Frame 20
stop();
Symbol 669 MovieClip [spell_mc1] Frame 20
removeMovieClip(this);
Symbol 686 MovieClip Frame 20
removeMovieClip(_parent);
Symbol 687 MovieClip [spell_mc4] Frame 20
stop();
Symbol 718 MovieClip Frame 55
stop();
Symbol 719 MovieClip [spell_mc8] Frame 55
removeMovieClip(this);
Symbol 772 MovieClip Frame 35
stop();
Symbol 773 MovieClip Frame 45
removeMovieClip(_parent);
Symbol 774 MovieClip Frame 45
removeMovieClip(_parent);
Symbol 775 MovieClip Frame 45
removeMovieClip(_parent);
Symbol 776 MovieClip Frame 45
removeMovieClip(_parent);
Symbol 777 MovieClip [spell_mc12] Frame 1
stop();
Symbol 788 MovieClip [spell_mc11] Frame 90
removeMovieClip(this);
Symbol 802 MovieClip [efekRacun] Frame 30
stop();
removeMovieClip(this);
Symbol 821 MovieClip [efekBatu] Frame 25
stop();
removeMovieClip(this);
Symbol 831 MovieClip [efekAngin] Frame 15
stop();
removeMovieClip(this);
Symbol 841 MovieClip [efekPetir] Frame 45
stop();
removeMovieClip(this);
Symbol 855 MovieClip [efekHeal] Frame 20
stop();
removeMovieClip(this);
Symbol 874 MovieClip [efekStrom] Frame 25
stop();
removeMovieClip(this);
Symbol 886 MovieClip [efekProtect] Frame 15
stop();
removeMovieClip(this);
Symbol 895 MovieClip [efekConfuse] Frame 24
stop();
removeMovieClip(this);
Symbol 920 MovieClip Frame 1
stop();
Symbol 926 MovieClip [hasil_mc] Frame 1
stop();
Symbol 945 MovieClip [animDapat] Frame 1
play();
Symbol 945 MovieClip [animDapat] Frame 100
removeMovieClip(this);
Symbol 949 MovieClip [target_mc] Frame 1
stop();
Symbol 954 MovieClip [spell10] Frame 1
stop();
Symbol 957 MovieClip [spell7] Frame 1
stop();
Symbol 960 MovieClip [spell8] Frame 1
stop();
Symbol 963 MovieClip [spell9] Frame 1
stop();
Symbol 966 MovieClip [spell11] Frame 1
stop();
Symbol 969 MovieClip [spell12] Frame 1
stop();
Symbol 972 MovieClip [spell1] Frame 1
stop();
Symbol 975 MovieClip [spell2] Frame 1
stop();
Symbol 978 MovieClip [spell3] Frame 1
stop();
Symbol 982 MovieClip [spell4] Frame 1
stop();
Symbol 985 MovieClip [spell5] Frame 1
stop();
Symbol 987 MovieClip [spell6] Frame 1
stop();
Symbol 991 MovieClip Frame 1
stop();
Symbol 992 MovieClip Frame 1
stop();
Symbol 993 MovieClip Frame 1
stop();
Symbol 995 MovieClip [gubugGeser] Frame 1
stop();
Symbol 1012 MovieClip Frame 16
_root.serangJagoan(_parent);
Symbol 1012 MovieClip Frame 19
_root.serangJagoan(_parent);
Symbol 1012 MovieClip Frame 22
_root.serangJagoan(_parent);
Symbol 1013 MovieClip Frame 26
removeMovieClip(_parent);
Symbol 1014 MovieClip [jagoan6] Frame 1
stop();
Symbol 1028 MovieClip Frame 16
_root.serangJagoan(_parent);
Symbol 1028 MovieClip Frame 19
_root.serangJagoan(_parent);
Symbol 1028 MovieClip Frame 22
_root.serangJagoan(_parent);
Symbol 1029 MovieClip Frame 28
removeMovieClip(_parent);
Symbol 1030 MovieClip [jagoan7] Frame 1
stop();
Symbol 1046 MovieClip Frame 16
_root.serangJagoan(_parent);
Symbol 1046 MovieClip Frame 19
_root.serangJagoan(_parent);
Symbol 1046 MovieClip Frame 22
_root.serangJagoan(_parent);
Symbol 1047 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 1048 MovieClip [jagoan8] Frame 1
stop();
Symbol 1066 MovieClip Frame 15
_root.serangJagoan(_parent);
Symbol 1067 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 1069 MovieClip [jagoan9] Frame 1
stop();
Symbol 1071 MovieClip Frame 1
stop();
Symbol 1073 MovieClip Frame 1
stop();
Symbol 1075 MovieClip Frame 1
stop();
Symbol 1077 MovieClip Frame 1
stop();
Symbol 1079 MovieClip Frame 1
stop();
Symbol 1080 MovieClip Frame 1
stop();
Symbol 1081 MovieClip Frame 1
stop();
Symbol 1082 MovieClip Frame 1
stop();
Symbol 1083 MovieClip Frame 1
stop();
Symbol 1104 MovieClip Frame 7
_root.serangMusuh(_parent);
Symbol 1105 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 1106 MovieClip [musuh4] Frame 1
stop();
Symbol 1137 MovieClip Frame 18
_root.serangMusuh(_parent);
Symbol 1138 MovieClip Frame 28
removeMovieClip(_parent);
Symbol 1139 MovieClip [musuh5] Frame 1
stop();
Symbol 1159 MovieClip Frame 12
_root.serangMusuh(_parent);
Symbol 1160 MovieClip Frame 28
removeMovieClip(_parent);
Symbol 1161 MovieClip [musuh6] Frame 1
stop();
Symbol 1186 MovieClip Frame 14
_root.serangMusuh(_parent);
Symbol 1187 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 1188 MovieClip [musuh7] Frame 1
stop();
Symbol 1214 MovieClip Frame 20
_root.serangMusuh(_parent);
Symbol 1215 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 1216 MovieClip [musuh8] Frame 1
stop();
Symbol 1219 MovieClip [animDapat2] Frame 1
play();
Symbol 1219 MovieClip [animDapat2] Frame 100
removeMovieClip(this);
Symbol 1311 MovieClip Frame 16
_root.serangMusuh(_parent);
Symbol 1311 MovieClip Frame 32
_root.serangMusuh(_parent);
Symbol 1311 MovieClip Frame 35
_root.serangMusuh(_parent);
Symbol 1311 MovieClip Frame 38
_root.serangMusuh(_parent);
Symbol 1312 MovieClip Frame 27
removeMovieClip(_parent);
Symbol 1313 MovieClip [musuh9] Frame 1
stop();
Symbol 1323 MovieClip [obyekBunga] Frame 1
stop();
Symbol 1330 MovieClip [obyekKaktus] Frame 1
stop();
Symbol 1340 MovieClip [frameBox_mc] Frame 1
stop();
Symbol 1347 MovieClip [pause_mc] Frame 1
stop();
Symbol 1365 MovieClip [tutorial_mc] Frame 1
stop();
Symbol 1410 MovieClip Frame 225
stop();
Symbol 1412 MovieClip Frame 1
this.onRelease = function () {
getURL ("http://armor.ag/MoreGames", "_blank");
};
Symbol 1423 MovieClip Frame 1
stop();
Symbol 1423 MovieClip Frame 30
_root.resetContinue();
Symbol 1437 MovieClip Frame 1
stop();
Symbol 1442 MovieClip Frame 1
stop();
Symbol 1446 MovieClip Frame 1
stop();
Symbol 1449 MovieClip Frame 1
stop();
Symbol 1485 MovieClip Frame 1
stop();
Symbol 1489 MovieClip Frame 1
stop();
Symbol 1496 MovieClip Frame 1
stop();
Symbol 1508 MovieClip Frame 1
stop();
Symbol 1511 MovieClip Frame 1
stop();
Symbol 1514 MovieClip Frame 1
stop();
Symbol 1517 MovieClip Frame 1
stop();
Symbol 1520 MovieClip Frame 1
stop();
Symbol 1523 MovieClip Frame 1
stop();
Symbol 1526 MovieClip Frame 1
stop();
Symbol 1529 MovieClip Frame 1
stop();
Symbol 1532 MovieClip Frame 1
stop();
Symbol 1535 MovieClip Frame 1
stop();
Symbol 1538 MovieClip Frame 1
stop();
Symbol 1541 MovieClip Frame 1
stop();
Symbol 1544 MovieClip Frame 1
stop();
Symbol 1547 MovieClip Frame 1
stop();
Symbol 1550 MovieClip Frame 1
stop();
Symbol 1553 MovieClip Frame 1
stop();
Symbol 1556 MovieClip Frame 1
stop();
Symbol 1559 MovieClip Frame 1
stop();
Symbol 1571 MovieClip Frame 1
stop();
Symbol 1574 MovieClip Frame 1
stop();
Symbol 1577 MovieClip Frame 1
stop();
Symbol 1580 MovieClip Frame 1
stop();
Symbol 1583 MovieClip Frame 1
stop();