Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  Aug 17th, 2017, 4:27pm


Board Hacks
Important News
Please read the notes posted with any codes carefully, as they will usually tell you where they need to go.
Welcome to the Conforums Hacks Board!

All codes here have been tested but we accept no responsibility if these codes do not work on your board, or have an adverse effect when used in combination with other codes.

This board is read only. Any queries or requests for codes should be made on the Coding Forum

Helpful sites
Google
Dynamic Drive

The Staff
Roger
Dave
GIzzy



« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Simple RPG Code  (Read 6230 times)
Garet
Conforums Elite
Senior Member


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 2073
xx Simple RPG Code
« Thread started on: Aug 19th, 2006, 04:04am »

Just a Simple RPG code..............
Includes features such as

  • Level
  • Class Name
  • Health Points
  • Mana Points
  • Attack Strength
  • Defence Strenth


Code submitted by Zando

These Attributes are worked out depending on a user's post count. Every 5 levels a user will gain a class Rank. The Class Ranks are

  • Peasent (lvl 0-4)
  • Page (lvl 5-9)
  • Squire (lvl 10-14)
  • Knight (lvl 15-19)
  • Lord (lvl 20-49)
  • Champion (lvl over 50)


    Put this following code in your Main Footers


    <script type="text/javascript">
    <!--

    /*
    Medievil Madness
    Coded By Zando
    http://eldesigns.conforums.com
    Do not repost or redistribute without permission
    */

    var num="50"; // NUMBER OF POSTS BEFORE LVL UP

    var td=document.getElementsByTagName("td")
    for(z=0;z<td.length;z++){
    if(td[z].width=="30%" && td[z].innerHTML.match(/Posts: (\d+)/)){
    var level=RegExp.$1;
    td[z].align="center";
    var lev=Math.floor(level/num)
    td[z].innerHTML+="<font size='1'>Level: "+lev+"<br></font>";
    if(lev<=5){
    td[z].innerHTML+="<font size='1'>Class: Peasent</font>";
    }
    if(lev<=9 && lev>5){
    td[z].innerHTML+="<font size='1'>Class: Page</font>";
    }
    if(lev>9 && lev<=14){
    td[z].innerHTML+="<font size='1'>Class: Squire</font>";
    }
    if(lev>14 && lev<=19){
    td[z].innerHTML+="<font size='1'>Class: Knight</font>";
    }
    if(lev>19 && lev<50){
    td[z].innerHTML+="<font size='1'>Class: Lord</font>";
    }
    if(lev>50){
    td[z].innerHTML+="<font size='1'>Class: Champion</font>";
    }
    td[z].innerHTML+="<font size='1'><br>HP: "+lev*6+"<br>MP: "+lev*5+"<br>ATK: "+Math.floor((lev*5*6)/3)+"<br>DEF: "+Math.floor((lev*5*6)/4)+"</font>";
    }}

    //-->
    </script>





    Put the following code in your Board Footers



    <script type="text/javascript">
    <!--

    /*
    Medievil Madness
    Coded By Zando
    http://eldesigns.conforums.com
    Do not repost or redistribute without permission
    */

    var num="50"; // NUMBER OF POSTS BEFORE LVL UP

    var td=document.getElementsByTagName("td")
    for(z=0;z<td.length;z++){
    if(td[z].width=="20%" && td[z].className.match(/windowbg|windowbg2/) && td[z].vAlign=="top" && td[z].innerHTML.match(/Posts: (\d+)/)){
    var level=RegExp.$1;
    td[z].align="center";
    var lev=Math.floor(level/num)
    td[z].innerHTML+="<font size='1'>Level: "+lev+"<br></font>";
    if(lev<=5){
    td[z].innerHTML+="<font size='1'>Class: Peasent</font>";
    }
    if(lev<=9 && lev>5){
    td[z].innerHTML+="<font size='1'>Class: Page</font>";
    }
    if(lev>9 && lev<=14){
    td[z].innerHTML+="<font size='1'>Class: Squire</font>";
    }
    if(lev>14 && lev<=19){
    td[z].innerHTML+="<font size='1'>Class: Knight</font>";
    }
    if(lev>19 && lev<50){
    td[z].innerHTML+="<font size='1'>Class: Lord</font>";
    }
    if(lev>50){
    td[z].innerHTML+="<font size='1'>Class: Champion</font>";
    }
    td[z].innerHTML+="<font size='1'><br>HP: "+lev*6+"<br>MP: "+lev*5+"<br>ATK: "+Math.floor((lev*5*6)/3)+"<br>DEF: "+Math.floor((lev*5*6)/4)+"</font>";
    }}

    //-->
    </script>




    Where it has the number 50, that is the number of posts require before someone levels up. So at the moment every 50 posts you will level up.

    Make sure you have the same number in both codes....

    Enjoy
  • « Last Edit: Aug 20th, 2006, 02:20am by Garet » User IP Logged

    Pages: 1  Notify Send Topic Print
    « Previous Topic | Next Topic »

    Back To Top
    Donate $6.99 for 50,000 Ad-Free Pageviews!

    | |

    This forum powered for FREE by Conforums ©
    Sign up for your own Free Message Board today!
    Terms of Service | Privacy Policy | Conforums Support | Parental Controls