Post by Serket on Jul 4, 2007 14:47:24 GMT -5
Just a little code that I made back then when I was really into coding for forums. I'm not reallly into it right now. I haven't done any coding since last year XD. But anyway, enjoy this code.
If you have any questions about admin editing the hp and atks. I don't know how to do that. You will have to request a code in another forum.
This code is meant for a basic RPG, not a complex one. Thank you for your time.
EDIT: I changed a four things in this code. Before, when you reached more than 1000 posts, the code would break. I fixed that. Sorry, I did not fix it sooner. Also, I have changed the "Gold" stat to "Experience" since you can easily put a money code which you can edit in your admin panel. I also changed the maximum level to 200, but you amy edit that if you wish.
EDIT EDIT: Now you can change the color of the healthbar easily. Also, I changed the version to v1.1 instead of 1.0 since I made some small changes. So anyone using the old code from other forums, switch to this please.
EDIT EDIT EDIT: I added my site link to the code.
Place This code in your Global Footers or specific boards
If you have any questions about admin editing the hp and atks. I don't know how to do that. You will have to request a code in another forum.
This code is meant for a basic RPG, not a complex one. Thank you for your time.
EDIT: I changed a four things in this code. Before, when you reached more than 1000 posts, the code would break. I fixed that. Sorry, I did not fix it sooner. Also, I have changed the "Gold" stat to "Experience" since you can easily put a money code which you can edit in your admin panel. I also changed the maximum level to 200, but you amy edit that if you wish.
EDIT EDIT: Now you can change the color of the healthbar easily. Also, I changed the version to v1.1 instead of 1.0 since I made some small changes. So anyone using the old code from other forums, switch to this please.
EDIT EDIT EDIT: I added my site link to the code.
Place This code in your Global Footers or specific boards
<script type="text/javascript">
//Dark Reign RPG v1.1
//Created By §erket
//http://www.freewebs.com/tabasanarts/main.html
//Keep this copyright intact at all times!
var TD=document.getElementsByTagName('td');
for(t=0;t <TD.length;t++){
if(TD[t].width=="20%" && TD[t].innerHTML.match(/Posts/i)){
var rpg=TD[t].innerHTML.split("Posts:")[1].split(/<br/i)[0].replace(/,/,"");
//EDIT BELOW
//HPbar Color
var HPcolor="00FF00"
//DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!
//Character Status
var Level = parseInt(rpg)/2;
var HPbar = parseInt(rpg)/4;
var Health = parseInt(rpg)*10;
var Strength = parseInt(rpg)*5;
var Defense = parseInt(rpg)*6;
var Magic = parseInt(rpg)*4;
var Exp = parseInt(rpg)*7;
//Maximum Numbers
if(Level > 200)
Level = 200;
if(Health > 4000)
Health = 4000;
if(Strength > 2000)
Strength = 2000;
if(Defense > 2400)
Defense = 2400;
if(Magic > 1600)
Magic = 1600;
TD[t].innerHTML+="<br><br><table border=0 cellspacing=1 cellpadding=2 width=100% class='bordercolor'><tr><td class='titlebg'><font size=-2><center><b>RPG Status</b></center></tr></td></table><table border=0 cellspacing=1 cellpadding=2 width=100%><tr><td></tr></td></table><table border=0 cellspacing=1 cellpadding=2 bgcolor=#000000 width=100% class='bordercolor'><tr><td class='windowbg'><font size=-2><b>Level:</b> "+Level+"</table><table border=0 cellspacing=1 cellpadding=2 width=100%><tr><td></tr></td></table><table border=0 cellspacing=1 cellpadding=2 bgcolor=#000000 width=100% class='bordercolor'><tr><td class='windowbg'><font size=-2><b>Health:</b><br><table style='border: solid 1px #000000' bgcolor='#aaaaaa' cellpadding='0' cellspacing='0' width='70' height='6'><tr><td width='"+HPbar+"%' bgcolor='#"+HPcolor+"'></td><td width='100%'></td></tr></table>"+Health+"/4000</table><table border=0 cellspacing=1 cellpadding=2 width=100%><tr><td></tr></td></table><table border=0 cellspacing=1 cellpadding=2 bgcolor=#000000 width=100% class='bordercolor'><tr><td class='windowbg'><font size=-2><b>Strength:</b> "+Strength+"/2000</table><table border=0 cellspacing=1 cellpadding=2 width=100%><tr><td></tr></td></table><table border=0 cellspacing=1 cellpadding=2 bgcolor=#000000 width=100% class='bordercolor'><tr><td class='windowbg'><font size=-2><b>Defense:</b> "+Defense+"/2400</table><table border=0 cellspacing=1 cellpadding=2 width=100%><tr><td></tr></td></table><table border=0 cellspacing=1 cellpadding=2 bgcolor=#000000 width=100% class='bordercolor'><tr><td class='windowbg'><font size=-2><b>Magic:</b> "+Magic+"/1600</table><table border=0 cellspacing=1 cellpadding=2 width=100%><tr><td></tr></td></table><table border=0 cellspacing=1 cellpadding=2 bgcolor=#000000 width=100% class='bordercolor'><tr><td class='windowbg'><font size=-2><b>Exp:</b> "+Exp+"</table>";
}}
</script>