function BuildMusic(url){ mBuild = "" mBuild += "" mBuild += "<bgsound src='"+url+"'>" mBuild += "" return mBuild } function BattleGround_Fight(){ InBattle = GrabRPGSetting('InBattle', RPGData, '') TheBackground = GrabRPGSetting('BattleBackground', RPGData, '') TheOpponent = BattleBot[InBattle] // Gather Data Required Name = GrabRPGSetting('Name', RPGData, 'No Name') rAvatar = GrabRPGSetting('Avatar', RPGData, '') HP = GrabRPGSetting('HP', RPGData, 0) HPM = GrabRPGSetting('HPM', RPGData, 0) MP = GrabRPGSetting('MP', RPGData, 0) MPM = GrabRPGSetting('MPM', RPGData, 0) STR = GrabRPGSetting('STR', RPGData, 0) DEF = GrabRPGSetting('DEF', RPGData, 0) Level = GrabRPGSetting('Level', RPGData, 1) EXP = GrabRPGSetting('EXP', RPGData, 0) Element = GrabRPGSetting('Element', RPGData, '') rHealing = GrabRPGSetting('Healing', RPGData, '') BMusic = GrabRPGSetting('BattleMusic', RPGData, '') Equip = GrabRPGSetting('Equip', RPGData, '') Upgrades = GrabRPGSetting('Upgrades', RPGData, '') YourSpells = GrabRPGSetting('Spells', RPGData, '') YourClass = GrabRPGSetting('Class', RPGData, '') if(Equip != ''){ // Item Equipped - Increase Stats ItmStat = Items[Equip][6] HP = parseInt(HP) + parseInt(ItmStat[0]) HPM = parseInt(HPM) + parseInt(ItmStat[0]) MP = parseInt(MP) + parseInt(ItmStat[1]) MPM = parseInt(MPM) + parseInt(ItmStat[1]) STR = parseInt(STR) + parseInt(ItmStat[2]) DEF = parseInt(DEF) + parseInt(ItmStat[3]) // Equipped Item - Upgraded? if(Upgrades != ''){ Upgrades = explode("|", Upgrades) for(u=0;u"+TheHeal[1]+" - Click para Usar!!!" } } else { HealingShow += "Sin items curativos" } if(Element != ''){ ElmStat = Elements[Element][2] Element = "
"+Elements[Element][1]+"
" // Stats Increase HP = parseInt(HP) + parseInt(ElmStat[0]) HPM = parseInt(HPM) + parseInt(ElmStat[0]) MP = parseInt(MP) + parseInt(ElmStat[1]) MPM = parseInt(MPM) + parseInt(ElmStat[1]) STR = parseInt(STR) + parseInt(ElmStat[2]) DEF = parseInt(DEF) + parseInt(ElmStat[3]) } else { Element = "
Sin Elemento
" } if(BMusic != ''){ BMusic = BuildMusic(BattleMusic[BMusic][0]) } if(rAvatar != ''){ rAvatar = ""+Name+"" } else { rAvatar = "Sin Avatar" } if(TheBackground !=''){ TheBackground = ' background="'+BattleBackground[TheBackground][0]+'"' } else { TheBackground = ' class="row1"' } // Build Available Spells SpellDisplay = "" if(YourSpells != ""){ YourSpells = explode("|",YourSpells) for(s=0;sUsar Hechizo: "+SpellProp[0]+" | MP Cost: "+AlternOpt[3]+"" } } } } if(SpellDisplay != ""){ SpellDisplay = ""+SpellDisplay+"

" } Content = "
Campo de Batalla
" Content += BMusic Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "
Tu batalla actual
" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "
" OpStat = TheOpponent[3] // Call Stats For Bars iStat = OutputGrads([HP, HPM, MP, MPM, STR, DEF]); // -- BEGIN PLAYER CELL Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "
"+Name+"
" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "
" Content += "
HP: "+HP+"/"+HPM+"" Content += "" Content += "
" Content += "" Content += "
" Content += "
" Content += "
MP: "+MP+"/"+MPM+"" Content += "" Content += "
" Content += "" Content += "
" Content += "
" Content += "
STR: "+STR+"" Content += "" Content += "
" Content += "" Content += "
" Content += "
" Content += "
DEF: "+DEF+"" Content += "" Content += "
" Content += "" Content += "
" Content += "
" Content += "
Level: "+Level Content += "
EXP: "+EXP+"%" Content += "
"+rAvatar+"
"+SpellDisplay+"Atacar | Defender" Content += "
" Content += "
ATB:
" Content += "
" Content += "
" Content += Element Content += "
" Content += "
"+HealingShow+"
" Content += "" Content += "
" Content += "
" // -- END PLAYER CELL Content += "
" // Call Stats For Bars oStat = OutputGrads([OpStat[0], OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); // -- BEGIN CPU CELL Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "
"+TheOpponent[1]+"
" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "
" Content += "
HP: "+OpStat[0]+"/"+OpStat[0]+"" Content += "" Content += "
" Content += "" Content += "
" Content += "
" Content += "
MP: "+OpStat[1]+"/"+OpStat[1]+"" Content += "" Content += "
" Content += "" Content += "
" Content += "
" Content += "
STR: "+OpStat[2]+"" Content += "" Content += "
" Content += "" Content += "
" Content += "
" Content += "
DEF: "+OpStat[3]+"" Content += "" Content += "
" Content += "" Content += "
" Content += "
" Content += "
Level: "+TheOpponent[2] Content += "
"+TheOpponent[1]+"
" Content += "
" Content += "
ATB:
" Content += "
" Content += "
" Content += "
" // -- END CPU CELL Content += "
Informe de la batalla
" BuildRPGDisplay("Campo de Batalla", Content); InitiateBattle() } function InsertBatLog(msg){ nRow = document.getElementById('batLog').insertRow(3) nCell = nRow.insertCell(-1) nCell.className = 'row3' nCell.innerHTML = msg } function IncreaseATB(amount,type){ document.getElementById(type+'_atb').width = amount if(type == "cpu" && amount == 100){ CPUAttack() } } function ATBBattle(){ PlayerIncrease = Math.floor(Math.random()*20) CPUIncrease = Math.floor(Math.random()*20) PlayerIncrease = parseInt(document.getElementById('player_atb').width) + parseInt(PlayerIncrease) if(PlayerIncrease > 100){ PlayerIncrease = 100 } CPUIncrease = parseInt(document.getElementById('cpu_atb').width) + parseInt(CPUIncrease) if(CPUIncrease > 100){ CPUIncrease = 100 } IncreaseATB(PlayerIncrease,'player') IncreaseATB(CPUIncrease,'cpu') setTimeout("DoATBBattle()", 700) } // ---------------------------------------------------- // BATTLE FUNCTIONS FOR ATB (ACTIVE TIME BATTLE) SYSTEM // ---------------------------------------------------- function CPUAttack(){ cSTR = OpStat[2] pDEF = DEF DMG = Math.floor(Math.random()*cSTR) tDEF = Math.floor(Math.random()*pDEF) DMG = parseInt(DMG - tDEF) if(DMG < 1){ DMG = 0 } PlayerHP = document.getElementById('player_hp').innerHTML PlayerHP = parseInt(PlayerHP - DMG) if(PlayerHP < 1){ PlayerHP = 0 document.getElementById('player_atb').width = 0 } document.getElementById('player_hp').innerHTML = PlayerHP // Change HP Width iStat = OutputGrads([PlayerHP, HPM, MP, MPM, STR, DEF]); document.getElementById('player_hp_bar').width = iStat[0] // Battle Log - What's Happening Eh? if(DMG == 0){ InsertBatLog(""+TheOpponent[1]+" a atacado a "+Name+", pero su defensa es tan buena que no se ve afectado por el ataque") } else if(PlayerHP == 0){ InsertBatLog(""+TheOpponent[1]+" ha derrotado a "+Name+"") LoseBattle() } else if(DMG >= (parseInt(HP/100)*20)){ InsertBatLog(""+TheOpponent[1]+" a atacado a "+Name+" con un golpe critico, bajando su HP hasta "+PlayerHP) } else { InsertBatLog(""+TheOpponent[1]+" a atacado a "+Name+" bajando su HP hasta "+PlayerHP) } IncreaseATB(0,'cpu') } function Attack(){ if(document.getElementById('player_atb').width == 100){ cSTR = STR pDEF = OpStat[3] DMG = Math.floor(Math.random()*cSTR) tDEF = Math.floor(Math.random()*pDEF) DMG = parseInt(DMG - tDEF) if(DMG < 1){ DMG = 0 } CPUHP = document.getElementById('cpu_hp').innerHTML CPUHP = parseInt(CPUHP - DMG) if(CPUHP < 1){ CPUHP = 0 document.getElementById('cpu_atb').width = 0 } document.getElementById('cpu_hp').innerHTML = CPUHP // Call Stats For Bars oStat = OutputGrads([CPUHP, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] // Battle Log - What's Happening Eh? if(DMG == 0){ InsertBatLog(""+Name+" a atacado a "+TheOpponent[1]+", pero su defensa es demasiado buena como para verse afectado...") } else if(CPUHP == 0){ InsertBatLog(""+Name+" ha derrotado a "+TheOpponent[1]+"") WinBattle() } else if(DMG >= (parseInt(OpStat[0]/100)*20)){ InsertBatLog(""+Name+" a atacado a "+TheOpponent[1]+" con un golpe critico bajando su HP hasta "+CPUHP) } else { InsertBatLog(""+Name+" a atacado a "+TheOpponent[1]+" bajando su HP hasta "+CPUHP) } IncreaseATB(0,'player') } } function Guard(){ if(document.getElementById('player_atb').width == 100){ pDEF = DEF HEAL = Math.floor(Math.random()*(pDEF/2)) NHP = parseInt(document.getElementById('player_hp').innerHTML) + parseInt(HEAL) if(NHP > HPM){ NHP = HPM } document.getElementById('player_hp').innerHTML = NHP // Change HP Width iStat = OutputGrads([NHP, HPM, MP, MPM, STR, DEF]); document.getElementById('player_hp_bar').width = iStat[0] InsertBatLog(""+Name+" en defensa, regresando su HP a "+NHP) IncreaseATB(0,'player') } } // ---------------------------------------------------- // BATTLE FUNCTIONS FOR ATB (ACTIVE TIME BATTLE) SYSTEM // ---------------------------------------------------- function DoATBBattle(){ if(document.getElementById('player_hp').innerHTML != 0 && document.getElementById('cpu_hp').innerHTML != 0){ ATBBattle() } } function InitiateBattle(){ DoATBBattle() } function EndBattle(php,pmp,pwins,plose,pexp,plevel,pskill,pmoney){ RPGData = SwapRPGSetting('HP', RPGData, php) RPGData = SwapRPGSetting('MP', RPGData, pmp) RPGData = SwapRPGSetting('Wins', RPGData, pwins) RPGData = SwapRPGSetting('Lose', RPGData, plose) RPGData = SwapRPGSetting('EXP', RPGData, pexp) RPGData = SwapRPGSetting('Level', RPGData, plevel) RPGData = SwapRPGSetting('SkillPoints', RPGData, pskill) RPGData = SwapRPGSetting('Money', RPGData, pmoney) RPGData = SwapRPGSetting('InBattle', RPGData, '') ReBuildData(RPGData) } function WinBattle(){ if(document.getElementById('cpu_hp').innerHTML == 0){ getHP = document.getElementById('player_hp').innerHTML getMP = document.getElementById('player_mp').innerHTML getWins = parseInt(GrabRPGSetting('Wins', RPGData, 0)) + parseInt(1) getLose = GrabRPGSetting('Lose', RPGData, 0) getEXP = parseInt(GrabRPGSetting('EXP', RPGData, 0)) + parseInt(Math.floor(Math.random()*30)) if(getEXP > 99){ getEXP = 0 getLevel = parseInt(GrabRPGSetting('Level', RPGData, 1)) + parseInt(1) getSkill = parseInt(GrabRPGSetting('SkillPoints', RPGData, 0)) + parseInt(SkillPointAward) } else { getLevel = GrabRPGSetting('Level', RPGData, 1) getSkill = GrabRPGSetting('SkillPoints', RPGData, 0) } getMoney = parseInt(GrabRPGSetting('Money', RPGData, 0)) + parseInt(Math.floor(Math.random()*(40*TheOpponent[2]))) alert('Felicidades!!!\nLe ganaste a '+TheOpponent[1]+', ahora tienes '+getMoney+' de '+MoneyName) EndBattle(getHP,getMP,getWins,getLose,getEXP,getLevel,getSkill, getMoney) } } function LoseBattle(){ if(document.getElementById('player_hp').innerHTML == 0){ getHP = document.getElementById('player_hp').innerHTML getMP = document.getElementById('player_mp').innerHTML getWins = GrabRPGSetting('Wins', RPGData, 0) getLose = parseInt(GrabRPGSetting('Lose', RPGData, 0)) + parseInt(1) getEXP = GrabRPGSetting('EXP', RPGData, 0) getLevel = GrabRPGSetting('Level', RPGData, 1) getSkill = GrabRPGSetting('SkillPoints', RPGData, 0) getMoney = GrabRPGSetting('Money', RPGData, 0) alert('Lo sentimos,\npero '+TheOpponent[1]+' te ha derrotado en batalla.') EndBattle(getHP,getMP,getWins,getLose,getEXP,getLevel,getSkill, getMoney) } } function CheckUseHeal(ID){ if(document.getElementById('player_atb').width != 100){ return false } if(!Healing[ID]){ alert('Invalid Healing Requested') return false; } Itemh = Healing[ID] Inventoryh = GrabRPGSetting('Healing', RPGData, '') // Already Bought? if(Inventoryh != ''){ Invenh = explode("|", Inventoryh) Own = 0 for(i=0;i HPM){ newHP = HPM } newMP = parseInt(MP)+parseInt(Itemh[4][1]) if(newMP > MPM){ newMP = MPM } NewData = RPGData // Remove Healing Item Inventoryh = explode("|", Inventoryh) newInv = new Array() for(i=0;i"+Name+" a usado un item curativo, regresando su HP a "+newHP) document.getElementById('player_atb').width = 0 } } } function BattleGround(){ InBattle = GrabRPGSetting('InBattle', RPGData, '') if(InBattle == ''){ // Display Battle Ground Content = "
Opciones de batalla (CPU)
" Content += "" Content += "" Content += "" Content += "" Content += "" // Build Opponent Select opSelect = "" // Build Battle Music Select musicSelect = "" // Build Battle Field Background Select backgroundSelect = "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" // -- SCAN OPPONENT Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" // -- SCAN OPPONENT Content += "" Content += "" Content += "" Content += "
DatosOpciones
Selecciona tu oponente"+opSelect+" (Checar su Status)
Musica de fondo"+musicSelect+"
Imagen de fondo"+backgroundSelect+"
" Content += "" BuildRPGDisplay("Campo de Batallas", Content); } else { BattleGround_Fight() } } function searchMem(){ document.getElementById('searchBut').disabled = true document.getElementById('searchBut').value = 'Searching...' window.frames['frameSearch'].location.href = url + '?act=Members&name_box=contains&name=' + document.getElementById('memsearch').value } function doWhat(){ if(window.frames['frameSearch'].location.href.match("Members")){ showSearchResults() } else if(window.frames['frameSearch'].location.href.match("showuser")){ verifyBattleMem() } else if(window.frames['frameSearch'].location.href.match("Msg&CODE=01")){ InviSent() } } function doCreateMemBattle(){ Too = document.getElementById('user_choose').options[document.getElementById('user_choose').options.selectedIndex].value + "&CODE=Scan" if(CheckMake()){ document.getElementById('donateButton').disabled = true document.getElementById('donateButton').value = 'Validando batalla...' window.frames['frameSearch'].location.href = Too } } function verifyBattleMem(){ Page = window.frames['frameSearch'].document.body if(Page.innerHTML.match("Lo sentimos pero no se a podido encontrar al forista")){ alert("Verification Failed, Please Re-Try") document.getElementById('donateButton').disabled = false document.getElementById('donateButton').value = 'Battle This Member' } else { bPlayer = window.frames['frameSearch'].Data if(window.frames['frameSearch'].HP < 1){ alert("Este forista esta actualmente muerto") location.href = location.href } else if(GrabRPGSetting('InBattle', bPlayer, '') != ""){ alert("Este forista esta actualmente en batalla") location.href = location.href } else { User = document.getElementById('user_choose').options[document.getElementById('user_choose').options.selectedIndex].innerHTML if(document.getElementById('userlinks').getElementsByTagName('a')[0].href.match(/showuser=(\d+)/)){ YourID = RegExp.$1 } PMSend = "http://s15.invisionfree.com/HitokiriRPG/index.php?act=Msg&CODE=04&MODE=01&entered_name="+User+"&msg_title=Battle Request&Post=[BattleWith:"+YourID+"][BattleName:"+document.getElementById('userlinks').getElementsByTagName('a')[0].innerHTML+"]" window.frames['frameSearch'].location.href = PMSend } } } function verifyDonation(){ Page = window.frames['frameSearch'].document.body if(Page.innerHTML.match("Lo sentimos pero no se a podido encontrar al forista")){ alert("Donación fallida, por favor vuelve a intentarlo") document.getElementById('donateButton').disabled = false document.getElementById('donateButton').value = 'Donate' } else { User = document.getElementById('user_choose').options[document.getElementById('user_choose').options.selectedIndex].innerHTML PMSend = "http://s15.invisionfree.com/HitokiriRPG/index.php?act=Msg&CODE=04&MODE=01&entered_name="+User+"&msg_title=Has perdido dinero! xD&Post=[Donation:"+Amount+"]" window.frames['frameSearch'].location.href = PMSend } } function InviSent(){ alert("La invitacion para la batalla a sido mandada") if(document.getElementById('user_choose').options[document.getElementById('user_choose').options.selectedIndex].value.match(/showuser=(\d+)/)){ bUser = RegExp.$1 } RPGData = SwapRPGSetting('InBattle', RPGData, 'Player_'+bUser) RPGData = SwapRPGSetting('BPlayer', RPGData, 'P1') RPGData = SwapRPGSetting('BVeri', RPGData, 'No') ReBuildData(RPGData) } function showSearchResults(){ if(window.frames['frameSearch'].location.href.match("Members")){ Page = window.frames['frameSearch'].document UserFound = [] Div = Page.getElementsByTagName('div') for(d=0;d 0){ UserChoose = "" for(u=0;u"+UserFound[u][1]+"" } UserChoose = "" document.getElementById('searchShow').cells[0].innerHTML = "Selecciona tu oponente:" document.getElementById('searchShow').cells[1].innerHTML = UserChoose document.getElementById('compileButton').innerHTML = "" document.getElementById('donateTXT').innerHTML = "Seleccionar al forista para la batalla" } else { alert("Tu busqueda ha regresado 0 resultados") document.getElementById('searchBut').disabled = false document.getElementById('searchBut').value = 'Find Member' } } } function ScanOpponent(){ Opponent = document.getElementById('opponent') Opponent = Opponent.options[Opponent.options.selectedIndex].value if(Opponent = BattleBot[Opponent]){ Stat = Opponent[3] document.getElementById('op_name').innerHTML = Opponent[1] document.getElementById('op_avatar').innerHTML = ""+Opponent[1]+"" document.getElementById('op_hp').innerHTML = Stat[0] document.getElementById('op_mp').innerHTML = Stat[1] document.getElementById('op_str').innerHTML = Stat[2] document.getElementById('op_def').innerHTML = Stat[3] document.getElementById('op_level').innerHTML = Opponent[2] document.getElementById('op_scan').style.display = '' } } function HideScan(){ document.getElementById('op_scan').style.display = 'none' } function CheckMake(){ if(GrabRPGSetting('HP', RPGData, '') == 0){ alert('Estas actualmente muerto(a), por favor recuperate en el Centro de Recuperación') return false } if(GrabRPGSetting('InBattle', RPGData, '') != ''){ alert('Ya estas en una batalla.') return false } // Battle Info SelOp = document.getElementById('opponent') SelOp = SelOp.options[SelOp.options.selectedIndex].value if(!BattleBot[SelOp]){ alert('Opciones de batalla incorrectas') return false } Music = document.getElementById('b_music') Music = Music.options[Music.options.selectedIndex].value if(!BattleMusic[Music] && Music != ''){ alert('Musica de fondo seleccionada incorrecta') return false } BBackground = document.getElementById('b_background') BBackground = BBackground.options[BBackground.options.selectedIndex].value if(!BattleBackground[BBackground] && BBackground != ''){ alert('Imagen de fondo seleccionada incorrecta') return false } return true } function MakeBattle(){ if(CheckMake()==true){ // LETS BATTLE BITCH! NewData = RPGData NewData = SwapRPGSetting('InBattle', NewData, SelOp) NewData = SwapRPGSetting('BattleMusic', NewData, Music) NewData = SwapRPGSetting('BattleBackground', NewData, BBackground) ReBuildData(NewData) } } function UseSpell(TheSpell){ if(document.getElementById('player_atb').width == 100){ // We own the spell where trying to cast? Own = 0 for(s=0;s 0 ){ // What Spell Is It? if(TheSpell == "ATBKnockDown"){ ATBKnock = (30 + (5 * (ThisLevel - 1))) ATBKnock = ((document.getElementById('cpu_atb').width / 100) * ATBKnock) ATBKnock = (document.getElementById('cpu_atb').width - ATBKnock) if(ATBKnock < 1){ ATBKnock = 0 } // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_atb').width = ATBKnock nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] IncreaseATB(0,'player') } else { alert("No tienes suficiente MP") } } else if(TheSpell == "Drain"){ Drain = (4 + (1 * (ThisLevel - 1))) Drain = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * Drain) CPUNew = (document.getElementById('cpu_hp').innerHTML - Drain) if(CPUNew < 1){ CPUNew = 1 } nHP = (document.getElementById('player_hp').innerHTML + Drain) if(nHP > HPM){ nHP = HPM } // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew document.getElementById('player_hp').innerHTML = nHP nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP + HP Width iStat = OutputGrads([nHP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] document.getElementById('player_hp_bar').width = iStat[0] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a usado el Drain en "+TheOpponent[1]+" obteniendo "+Drain+" de HP") IncreaseATB(0,'player') } else { alert("No tienes suficiente MP") } } else if(TheSpell == "FireBall"){ Damage = Math.round(Math.random() * 40) DMGINCR = ((Damage / 100) * (8 * (ThisLevel - 1))) Damage = parseInt(Damage + DMGINCR) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a usado la Bola de Fuego en "+TheOpponent[1]+" bajando su HP hasta "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } } else if(TheSpell == "MoonLight"){ Revive = parseInt((document.getElementById('player_hp').innerHTML / 100) * (9 + (2 * (ThisLevel - 1)))) nHP = (document.getElementById('player_hp').innerHTML + Revive) if(nHP > HPM){ nHP = HPM } // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('player_hp').innerHTML = nHP nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP iStat = OutputGrads([nHP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] document.getElementById('player_hp_bar').width = iStat[0] InsertBatLog(""+Name+" a usado la Luz de la Luna y recupero su HP hasta "+nHP) IncreaseATB(0,'player') } else { alert("No tienes suficiente MP") } // --------------------------------------- // QUAKE SPELL // --------------------------------------- } else if(TheSpell == "Quake"){ DEFTake = parseInt(((OpStat[3] / 100) * (2 + (1 * (ThisLevel - 1))))) nDEF = parseInt(OpStat[3] - DEFTake) if(nDEF < 1){ nDEF = 0 } // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] OpStat[3] = nDEF oStat = OutputGrads([OpStat[0], OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_def_bar').width = iStat[3] document.getElementById('cpu_def').innerHTML = nDEF InsertBatLog(""+Name+" a usado Terremotobajando la DEF de su oponente a "+nDEF) IncreaseATB(0,'player') } else { alert("No tienes suficiente MP") } // --------------------------------------- // QUAKE SPELL // --------------------------------------- // --------------------------------------- // MANA LEECH SPELL // --------------------------------------- } else if(TheSpell == "ManaLeech"){ Leech = parseInt((OpStat[1] / 100) * (20 + (2 * (ThisLevel - 1)))) nOMP = parseInt(OpStat[1] - Leech) nPMP = parseInt(document.getElementById('player_mp').innerHTML) + parseInt(Leech) if(nOMP < 1){ nOMP = 0 } if(nPMP > MPM){ nPMP = MPM } // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ nMP = (nPMP - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] OpStat[1] = nOMP oStat = OutputGrads([OpStat[0], OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_mp_bar').width = iStat[1] document.getElementById('cpu_mp').innerHTML = nOMP InsertBatLog(""+Name+" a usado la Absorción de Mana tomando "+Leech+" MP de el") IncreaseATB(0,'player') } else { alert("No tienes suficiente MP") } // --------------------------------------- // MANA LEECH SPELL // --------------------------------------- // --------------------------------------- // HASTE SPELL // --------------------------------------- } else if(TheSpell == "Haste"){ DEFINCR = parseInt(((document.getElementById('player_def').innerHTML) / 100) * (2 + (1 * (ThisLevel - 1)))) nDEF = parseInt(document.getElementById('player_def').innerHTML) + parseInt(DEFINCR) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP iStat = OutputGrads([HP, HPM, nMP, MPM, STR, nDEF]); document.getElementById('player_mp_bar').width = iStat[1] document.getElementById('player_def_bar').width = iStat[3] document.getElementById('player_def').innerHTML = nDEF InsertBatLog(""+Name+" a usado Haste subiendo su DEf hasta "+nDEF) IncreaseATB(0,'player') } else { alert("No tienes suficiente MP") } // --------------------------------------- // HASTE SPELL // --------------------------------------- // --------------------------------------- // DEATH DIMENSION SPELL // --------------------------------------- } else if(TheSpell == "DeathDimension"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 33) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a usado la Dimension de la Muerte en "+TheOpponent[1]+" bajando su HP hasta "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // DEATH DIMENSION SPELL // --------------------------------------- // --------------------------------------- // IRON FIST SPELL // --------------------------------------- } else if(TheSpell == "IronFist"){ STRINCR = parseInt(((document.getElementById('player_str').innerHTML) / 100) * (2 + (1 * (ThisLevel - 1)))) nSTR = parseInt(document.getElementById('player_str').innerHTML) + parseInt(STRINCR) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP iStat = OutputGrads([HP, HPM, nMP, MPM, nSTR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] document.getElementById('player_str_bar').width = iStat[2] document.getElementById('player_str').innerHTML = nSTR InsertBatLog(""+Name+" a usado Puño de Hierro subiendo su STR hasta "+nSTR) IncreaseATB(0,'player') } else { alert("No tienes suficiente MP") } // --------------------------------------- // IRON FIST SPELL // --------------------------------------- // --------------------------------------- // FLORA // --------------------------------------- } else if(TheSpell == "Flora"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 30) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a usado a Flora bajando el HP de "+TheOpponent[1]+" hasta "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // FLORA // --------------------------------------- // --------------------------------------- // ATALANTA // --------------------------------------- } else if(TheSpell == "Atalanta"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 30) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a usado a Atalanta bajando el HP de "+TheOpponent[1]+" hasta "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // ATALANTA // --------------------------------------- // --------------------------------------- // MAGAERA // --------------------------------------- } else if(TheSpell == "Megaera"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 30) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a usado a Megaera bajando el HP de "+TheOpponent[1]+" hasta "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // MEGAERA // --------------------------------------- // --------------------------------------- // COATLICUE // --------------------------------------- } else if(TheSpell == "Coatlicue"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 40) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a invocado a Coatlicue bajando el HP de "+TheOpponent[1]+" hasta "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // COATLICUE // --------------------------------------- // --------------------------------------- // PROCNE // --------------------------------------- } else if(TheSpell == "Procne"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 40) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a llamado a Procne usandolo en contra de "+TheOpponent[1]+" bajando su HP a "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // PROCNE // --------------------------------------- // --------------------------------------- // IRIS // --------------------------------------- } else if(TheSpell == "Iris"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 50) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a llamado a Iris usandolo en contra de "+TheOpponent[1]+" bajando su HP a "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // IRIS // --------------------------------------- // --------------------------------------- // JUDGMENT // --------------------------------------- } else if(TheSpell == "Judgment"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 60) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a invocado a Judgment para que pelee en contra de "+TheOpponent[1]+" bajando su HP a "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // JUDGMENT // --------------------------------------- // --------------------------------------- // ECLIPSE // --------------------------------------- } else if(TheSpell == "Eclipse"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 60) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a invocado a Eclipse para que pelee en contra de "+TheOpponent[1]+" bajando su HP a "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // ECLIPSE // --------------------------------------- // --------------------------------------- // CATASTROPHE // --------------------------------------- } else if(TheSpell == "Catastrophe"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * 80) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" se prepara para invocar a Catastrophe dibujando un pentagrama en el aire...
Catastrophe aparece usando su poder contra "+TheOpponent[1]+" bajando su HP hasta "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // CATASTROPHE // --------------------------------------- // --------------------------------------- // FREEZE SPELL // --------------------------------------- } else if(TheSpell == "Freeze"){ Damage = parseInt((document.getElementById('cpu_hp').innerHTML / 100) * (13 + (3 * (ThisLevel - 1)))) CPUNew = (document.getElementById('cpu_hp').innerHTML - Damage) // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('cpu_hp').innerHTML = CPUNew nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] oStat = OutputGrads([CPUNew, OpStat[0], OpStat[1], OpStat[1], OpStat[2], OpStat[3]]); document.getElementById('cpu_hp_bar').width = oStat[0] InsertBatLog(""+Name+" a usado Escarcha en "+TheOpponent[1]+" bajando su HP hasta "+CPUNew) IncreaseATB(0,'player') if(CPUNew < 1){ WinBattle() } } else { alert("No tienes suficiente MP") } // --------------------------------------- // FREEZE SPELL // --------------------------------------- } } } else if(TheSpell == "ATBBoost"){ // We own the spell where trying to cast? Own = 0 for(s=0;s 0){ BoostAmount = (30 + (5 * (ThisLevel - 1))) BoostAmount = ((document.getElementById('player_atb').width / 100) * BoostAmount) BoostAmount = (document.getElementById('player_atb').width + BoostAmount) if(BoostAmount > 100){ BoostAmount = 100 } // Required MP? if(document.getElementById('player_mp').innerHTML > parseInt(AlternOpt[3])){ document.getElementById('player_atb').width = BoostAmount nMP = (document.getElementById('player_mp').innerHTML - parseInt(AlternOpt[3])) document.getElementById('player_mp').innerHTML = nMP // Change MP Width iStat = OutputGrads([HP, HPM, nMP, MPM, STR, DEF]); document.getElementById('player_mp_bar').width = iStat[1] } else { alert("No tienes suficiente MP") } } } } BattleGround()