function HealingCenter(){ curMoney = GrabRPGSetting('Money',RPGData, '0') Inventory = GrabRPGSetting('Healing', RPGData, '') // Display Healing Inventory Content = "
Items de curación actuales
" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" if(Inventory != ''){ Inventory = explode("|", Inventory); for(i=0;i" inStat += "" inStat += "" inStat += "
ImagenNombreDescripciónVenderUsar
"+itemStat[1]+"
" Img = ""+TheItem[1]+"" Content += "" Content += ""+Img+"" Content += ""+TheItem[1]+"" Content += ""+TheItem[2]+inStat+"" Content += "Vender por: "+ parseInt(TheItem[3]/3) + " de "+MoneyName Content += "
Vender" Content += "Usar el Item" Content += "" } } else { Content += "" Content += "Actualmente no tienes items curativos." Content += "" } Content += "" Content += "Cantidad de "+MoneyName+": "+curMoney+"" Content += "" Content += "

" // Display Healing Center Content += "
Centro de Curación
" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" Content += "" itemsAvail = 0 for(i=0;i" inStat += "" inStat += "" inStat += "
ImagenNombreDescripciónComprar
"+itemStat[1]+"
" Img = ""+TheItem[1]+"" Content += "" Content += ""+Img+"" Content += ""+TheItem[1]+"" Content += ""+TheItem[2]+inStat+"" Content += "Costo: "+TheItem[3] + " de tu "+MoneyName if(TheItem[3] > curMoney){ Content += "
No tienes suficiente "+MoneyName } else { Content += "
Comprar" } Content += "" Content += "" } if(itemsAvail == 0){ Content += "" Content += "Lo sentimos pero actualmente no hay items curativos disponibles, por favor checa luego." Content += "" } else { Content += "" Content += "Total de items curativos disponibles: "+itemsAvail+"" Content += "" } Content += "" BuildRPGDisplay("Centro de Curación", Content); } function CheckHeal(ID){ if(!Healing[ID]){ alert('Item curativo incorrecto') return false; } Item = Healing[ID] curMoney = GrabRPGSetting('Money',RPGData, 0) Inventory = GrabRPGSetting('Healing', RPGData, '') // Enough Money? if(curMoney < Item[3]){ alert('Lo sentimos pero no tienes suficiente '+MoneyName+' para comprar este item curativo.') return false; } // Already Bought? if(Inventory != ''){ Inven = explode("|", Inventory) Own = 0 for(i=0;i 0){ alert('Lo sentimos pero ya habias comprado este item curativo antes.') return false; } } return true } function BuyHeal(ID){ if(CheckHeal(ID) == true){ // Uhm, buy, yay! newMoney = parseInt(curMoney - Item[3]) NewData = RPGData NewData = SwapRPGSetting('Money', NewData, newMoney) if(Inventory == ''){ Inventory = ID } else { Inventory = Inventory+"|"+ID } NewData = SwapRPGSetting('Healing', NewData, Inventory) ReBuildData(NewData) } } function CheckSellHeal(ID){ if(!Healing[ID]){ alert('Invalid Healing Requested') return false; } Item = Healing[ID] curMoney = GrabRPGSetting('Money',RPGData, 0) Inventory = GrabRPGSetting('Healing', RPGData, '') // Already Bought? if(Inventory != ''){ Inven = explode("|", Inventory) Own = 0 for(i=0;i HPM){ newHP = HPM } newMP = parseInt(MP)+parseInt(Item[4][1]) if(newMP > MPM){ newMP = MPM } NewData = RPGData NewData = SwapRPGSetting('HP', NewData, newHP) NewData = SwapRPGSetting('MP', NewData, newMP) // Remove Healing Item Inventory = explode("|", Inventory) newInv = new Array() for(i=0;i