//RPG hack v2.1 - SSDesigns Exclusive!
//This code was created for use on PB/HB/SL/CF boards. It should NOT be re-posted on any site without the express permission of the code owners. Any violation of this may result in your board being deleted.
//Created by Webworldx, Overlord - apartment.proboards19.com, Lans Tartare - ssdesigns.proboards17.com
//This header must stay with the code at all times. Thanks for supporting PB coders!

// Choose table border color
var color = "#111111"

// Choose font color
theColor="FF0000";

//Choose the Top Limit of the RPG hack
var TopLimit = "2000"

//The Images' URL
var HPImage="http://www.webpost.net/la/lans/exp.gif"
var STRImage="http://www.webpost.net/la/lans/str.gif"
var MAGImage="http://www.webpost.net/la/lans/mag.gif"
var DEFImage="http://www.webpost.net/la/lans/def.gif"

//Choose the weapons
var Weapon = new Array();
Weapon[0]="http://www.proboards8.com/boardimages/blank.gif"
Weapon[1]="http://www.webpost.net/lo/lotrringer/wooden.gif"
Weapon[2]="http://www.webpost.net/lo/lotrringer/bow.gif"
Weapon[3]="http://www.webpost.net/lo/lotrringer/spear.gif"
Weapon[4]="http://www.webpost.net/lo/lotrringer/steel.gif"

//Choose the spells
var Spells = new Array();
Spells[0]="http://www.webpost.net/lo/lotrringer/basicheal.gif"
Spells[1]="http://www.webpost.net/lo/lotrringer/repel.gif"
Spells[2]="http://www.webpost.net/lo/lotrringer/freeze.gif"
Spells[3]="http://www.webpost.net/lo/lotrringer/seismicwind.gif"
Spells[4]="http://www.webpost.net/lo/lotrringer/deathcurse.gif"

//Choose the armour
var Armour = new Array();
Armour[0]="http://www.webpost.net/lo/lotrringer/lightarmour.gif"
Armour[1]="http://www.webpost.net/lo/lotrringer/strongarmour.gif"
Armour[2]="http://www.webpost.net/lo/lotrringer/immunearmour.gif"

//Leave these ones alone
var BarWidth=TopLimit/80

for (i=0;i<Weapon.length;i++){
Weapon[i]="<img src='"+Weapon[i]+"' border=0>"
} 
for (i=0;i<Spells.length;i++){
Spells[i]="<img src='"+Spells[i]+"' border=0>"
} 
for (i=0;i<Armour.length;i++){
Armour[i]="<img src='"+Armour[i]+"' border=0>"
} 

if (location.href.indexOf("action=display") != -1){
var leftTD = document.getElementsByTagName('td');
for(a=0;a<leftTD.length;a++){
if (leftTD[a].width=="20%") {
if (leftTD[a].innerHTML.match("Author")) {
} else {
if (leftTD[a].innerHTML.match("Total Votes:")) {
} else {
var FindPostCount = leftTD[a].innerHTML
if (FindPostCount.match("Posts: ")) {
if (FindPostCount.match("Guest")) {
} else {
leftTD[a].innerHTML = leftTD[a].innerHTML.replace(/<BR><BR>/gi,"<BR>")
FindPostCount = FindPostCount.split("Posts: ")
FindPostCount = FindPostCount[1].split(/<BR>/gi)
var CheckHP = FindPostCount[0]
var HP = FindPostCount[0]

if (HP >= 10) {
STR = HP - 5;
MAG = parseInt(HP /2);
DEF = parseInt((2/3) *(HP - 10));
} else {
STR=0;
MAG=0;
DEF=0;
}
if (parseInt(HP) >= parseInt(TopLimit)) {
HP = TopLimit;
STR = TopLimit;
MAG = TopLimit;
DEF = TopLimit;
}

//Get User's Level
var LevelText
var UserLevel = 0
var LevelUp = new Array(300);
for(i=1; i<LevelUp.length; i++){
if (UserLevel==0) {
if (i==1) { LevelUp[i] = 1 } else {
LevelUp[i] = parseInt((i/5) * (i-1))
if (HP <= LevelUp[i]) { 
UserLevel=i
LevelText=UserLevel
}}}}
if (UserLevel==0) { LevelText="400" }
//End of User Level Script

var embedRPG = "<p align=left>"
embedRPG += "<table width=95% border=0><tr><td><b>HP: </b><td><table align=right width=80 style='border: 1px solid "+color+";'><tr><td><img src=" + HPImage + " width=" + HP/BarWidth + " height=8 alt=" + parseInt(HP) + "></td></tr></table></table>"
embedRPG += "<table width=95% border=0><tr><td><b>STR: </b><td><table align=right width=80 style='border: 1px solid "+color+";'><tr><td><img src=" + STRImage + " width=" + STR/BarWidth + " height=8 alt=" + STR + "></td></tr></table></table>"
embedRPG += "<table width=95% border=0><tr><td><b>MAG: </b><td><table align=right width=80 style='border: 1px solid "+color+";'><tr><td><img src=" + MAGImage + " width=" + MAG/BarWidth + " height=8 alt=" + MAG + "></td></tr></table></table>"
embedRPG += "<table width=95% border=0><tr><td><b>DEF: </b><td><table align=right width=80 style='border: 1px solid "+color+";'><tr><td><img src=" + DEFImage + " width=" + DEF/BarWidth + " height=8 alt=" + DEF + "></td></tr></table></table>"
embedRPG += "<table width=95% border=0><tr><td><b>Level: </b><font color=" + theColor + ">" + LevelText + "</font>";
if (Weapon[parseInt(HP/BarWidth)]==undefined){ Weapon[parseInt(HP/BarWidth)]=Weapon[Weapon.length-1]}
embedRPG += "<BR><b>Weapon: </b>" + Weapon[parseInt(HP/BarWidth)]
if (Spells[parseInt(HP/BarWidth)]==undefined){ Spells[parseInt(HP/BarWidth)]=Spells[Spells.length-1]}
embedRPG += "<BR><b>Spell: </b>" + Spells[parseInt(HP/BarWidth)]
var pickArmour
if (LevelText<=40) { pickArmour=1 }
if (LevelText<=20) { pickArmour=0 }
if (LevelText>=60) { pickArmour=2 }
embedRPG += "<BR><b>Armour Type: </b>" + Armour[pickArmour]
embedRPG += "<BR><BR><b>Posts: </b>" + CheckHP + "</p>"

leftTD[a].innerHTML=leftTD[a].innerHTML.replace('Posts: ' + CheckHP,embedRPG)
}}}}}}}
