Welcome, Guest. Please Login or Register.
May 05, 2024, 02:17:16 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  rpg mod « previous next »
Pages: [1] Reply Ignore Print
Author Topic: rpg mod  (Read 5516 times)
Valconeye
Full Member
***
Posts: 190


rpg mod
« on: September 10, 2003, 03:35:02 PM »
Reply with quote

I found this is the german section and i think we should fix it up a bit.

rpg boardmod file
<id>
RPG Mod
</id>

<version>
1.8
</version>

<mod info>
Dieses Mod ist eine einfache Umsetzung von McGuire's RPG MOD v1.2.
Nach der Installation kannst Du eine der beiden beiliegenden RBG.php Dateien nutzen, ganz nach Deinem Wunsch.
Auch später kannst du jederzeit die Dateien wieder austauschen.
</mod info>

<author>
Floris BarthelHorseman ([email protected])
</author>

<homepage>
http://www.Emulation-Inc.com (Floris)http://www.Horsemens.info (Horseman)
</homepage>

<edit file>
english.lng
</edit file>

<search for>
$locale = 'en_US';
</search for>

<add after>
$txt['rgb'] = 'RGB Mod Enable';
</add after>

<edit file>
Sources/Display.php
</edit file>

<search for>
         if ($userprofile[$mname]['hideEmail'] != '1' || $settings[7] == 'Administrator' || $allow_hide_email != '1')
            $profileButtons[] = "<a href=\"mailto:$memail\">$img[email_sm]</a>";

         if ($username != 'Guest')
            $profileButtons[] = '<a href="' . $cgi . ';action=imsend;to=' . $mname . '">'. $img['message_sm_' . ($userisonline > 0 ? 'on' : 'off')] . '</a>';
</search for>

<add after>
if($muserID != "-1" && $modSettings['enable_rpg'] == 1) {
        include_once("$sourcedir/RPG.php");
        print(getStats($userprofile[$mname]['posts']));
}
</add after>

<edit file>
Sources/InstantMessage.php
</edit file>

<search for>
function IMIndex ()
{
   global $username, $txt, $img, $yytitle, $imagesdir, $action, $mbname, $scripturl, $db_prefix;
   global $menusep, $color, $ID_MEMBER, $settings, $modSettings, $orderBy, $sort, $sc;
</search for>

<add after>
   global $sourcedir;
</add after>

<search for>
         if ($modSettings['titlesEnable'] != '0' && $userprofile[$musername]['usertitle'] != '')
            $title = $userprofile[$musername]['usertitle'] . '<br />';
</search for>

<add after>
EOT;
if($modSettings['enable_rpg'] == 1) {
        include_once("$sourcedir/RPG.php");
        print(getStats($userprofile[$musername]['posts']));
}
print <<<EOT
</add after>

<search for>
   global $username, $txt, $img, $yytitle, $imagesdir, $action, $mbname, $scripturl, $db_prefix;
</search for>

<add after>
   global $sourcedir;
</add after>

<search for>
         $postinfo = $txt[26] . ': ' . $userprofile[$musername]['posts'];
</search for>

<add after>
EOT;
if($modSettings['enable_rpg'] == 1) {
   include_once("$sourcedir/RPG.php");
   print(getStats($userprofile[$musername]['posts']));
}
</add after>

<edit file>
Sources/Profile.php
</edit file>

<search for>
function ViewProfile ()
{
</search for>

<add after>
   global $sourcedir,$modSettings;
</add after>

<search for>
               </table>
            </td>
            <td bgcolor="' . $color['windowbg'] . '" class="windowbg" valign="middle" align="center" width="150">
               ' . $pic . '<br /><br />
               <font size="2">' . $memsettings[12] . '</font>
</search for>

<add after>
EOT;
if($modSettings['enable_rpg'] == 1) {
   include_once("$sourcedir/RPG.php");
   print(getStats($memsettings[6]));
}
print <<<EOT
</add after>

<edit file>
Sources/ModSettings.php
</edit file>

<search for>
   $enableTrackStatsChecked = ($modSettings['trackStats'] == '1' ? ' checked="checked"' : '');
   $enableHitStatsChecked = ($modSettings['hitStats'] == '1' ? ' checked="checked"' : '');
</search for>

<add after>
   $enableRPG = ($modSettings['enable_rpg'] == '1' ? ' checked' : '');
</add after>

<search for>
                        <td class="windowbg2" bgcolor="' . $color['windowbg2'] . '"><input type="checkbox" name="censorWholeWordChecked" value="1"' . $censorWholeWordChecked . ' /></td>
</search for>

<add after>
                     </tr>
<tr>
   <td class="windowbg2" bgcolor="$color[windowbg2]" colspan=2><HR size="1" width="100%" class="windowbg3"></td>
 </tr><tr>
   <td class="windowbg2" bgcolor="$color[windowbg2]"><font size="2">$txt[rgb]</font></td>
   <td class="windowbg2" bgcolor="$color[windowbg2]"><input type=checkbox name="enable_rpg" $enableRPG></td>
 </tr>
</add after>

<search for>
   $onoffArray['quickreplyChecked'] = 'QuickReply';
</search for>

<add after>
   $onoffArray['enable_rpg'] = 'enable_rpg';
</add after>


RPG.php in Sources
<?php
// RPG MOD version 1.8 by Dexter Rivers
// Based McGuire's original RPG mod

function getStats($posts)
        {
        
$reg_date = (time() - $posts[regdate]) / 86400;
        if (
$reg_date 1$postsperday $posts[userposts];
        else 
$postsperday $posts[userposts] / $reg_date;

        global 
$imagesdir;
        
// Calculate HP, Level, and EXP based on on # of posts
        // Calculate MP based on registration date and # of posts
        
$level pow(log10($posts), 3);
        
$ep floor (100 * ($level floor ($level)));
        
$showlevel floor ($level 1);
        
$hpmulti round ($grudge 61);
        if (
$hpmulti 1.5) { $hpmulti 1.5; }
        if (
$hpmulti 1) { $hpmulti 1; }
        
$grudge = ($level 1) / 10;
        
$maxhp $level 17;
        
$hp floor ($posts floor ($hpmulti));
        if (
$hp >= $maxhp) { $hp $maxhp; }
        if (
$hp 1) {   $hp 1; }
        
$hp floor ($hp);
        
$maxhp floor ($maxhp);
        if (
$maxhp <= 0) { $zhp 1; }
                else { 
$zhp $maxhp; }
        
$hpf floor (100 * ($hp $zhp)) - 1;
        
$maxmp = ($reg_date $level) / 1000;
        
$mp $posts 3;
        if (
$mp >= $maxmp) { $mp $maxmp; }
        
$maxmp floor ($maxmp);
        
$mp floor ($mp);
        if (
$maxmp <= 0) { $zmp 1; }
                else { 
$zmp $maxmp; }
        
$mpf floor (100 * ($mp $zmp)) - 1;
        
$str $posts $mp;
          
$abi $posts 2.5;
        
$luck $posts 3;
        
$sta $posts 2;
        
$spd $showlevel 2;
        
$def $showlevel $maxhp;
        if(
$posts == 0)
                {
                
$showlevel 1;
                
$hp 1;
                
$zhp 1;
                
$mp 1;
                
$maxmp 1;
                
$ep 0;
                
$str 1;
                    
$abi 1;
                  
$luck 1;
                   
$sta 1;
                   
$spd 1;
                    
$def 3;
                }
        if(
$posts == 1)
                {
                
$showlevel 1;
                
$hp 1;
                
$zhp 1;
                
$mp 1;
                
$maxmp 1;
                
$ep 5;
                
$str 1;
                    
$abi 1;
                  
$luck 1;
                   
$sta 1;
                   
$spd 1;
                    
$def 3;
                }
        if(
$posts == 2)
                {
                
$showlevel 1;
                
$hp 1;
                
$zhp 1;
                
$mp 1;
                
$maxmp 1;
                
$ep 9;
                
$str 1;
                    
$abi 1;
                  
$luck 1;
                   
$sta 1;
                   
$spd 1;
                    
$def 3;
                }
        if(
$posts == 3)
                {
                
$showlevel 1;
                
$hp 1;
                
$zhp 1;
                
$mp 1;
                
$maxmp 1;
                
$ep 17;
                
$str 1;
                    
$abi 1;
                  
$luck 1;
                   
$sta 1;
                   
$spd 1;
                    
$def 3;
                }
        
// After 3 posts, everything should be over 1.
         // Return html to display in description
        
return("
        <br><b>Level: " 
$showlevel "</b><br>
        HP: " 
$hp " / " $zhp ."
        <table width=\"100\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">
        <tr>
        <td bgcolor=\"#9999FF\"><img src=\"" 
$imagesdir "/bhg.gif\" width=\"" $hpf "%\" height=\"9\"><img src=\"" $imagesdir "/bhb.gif\" width=\"1\" height=\"9\"></td>
        </tr>
        </table>

        MP: " 
$mp ." / " $maxmp "
        <table width=\"100\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">
        <tr>
        <td bgcolor=\"#9999FF\"><img src=\"" 
$imagesdir "/bmg.gif\" width=\"" $mpf "%\" height=\"9\"><img src=\"" $imagesdir "/bmb.gif\" width=\"1\" height=\"9\"></td>
        </tr>
        </table>

        Exp: " 
$ep "%
        <table width=\"100\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#000000\">
        <tr>
        <td bgcolor=\"#9999FF\"><img src=\"" 
$imagesdir "/bxg.gif\" width=\"" $ep "%\" height=\"9\"><img src=\"" $imagesdir "/bxb.gif\" width=\"1\" height=\"9\"></td>
        </tr>
        </table>
        <br><b>Kraft: " 
$str "</b><br>
        <b>Verteidigung: " 
$def "</b><br>
        <b>Fähigkeiten: " 
$abi "</b><br>
        <b>Ausdauer: " 
$sta "</b><br>
        <b>Geschwindigkeit: " 
$spd "</b><br>
        <b>Glück: " 
$luck "</b><br>
        "
);
        }

?>
Logged
Valconeye
Full Member
***
Posts: 190


Re:rpg mod
« Reply #1 on: September 10, 2003, 03:35:28 PM »
Reply with quote

rpg db file
<?php
/*****************************************************************************/
/* dbmod.php                                                                  */
/*****************************************************************************/
/* YaBB: Yet another Bulletin Board                                          */
/* Open-Source Project started by Zef Hemel ([email protected])                 */
/* Software Version: YaBB SE                                                 */
/* ========================================================================= */
/* Software Distributed by:    http://www.yabb.info                          */
/* Support, News, Updates at:  http://www.yabb.info/community                */
/*                             http://yabb.xnull.com/community               */
/* ========================================================================= */
/* Copyright (c) 2001-2002 Lewis Media - All Rights Reserved                 */
/* Software by: The YaBB Development Team                                    */
/*****************************************************************************/
/* This program is free software; you can redistribute it and/or modify it   */
/* under the terms of the GNU General Public License as published by the     */
/* Free Software Foundation; either version 2 of the License, or (at your    */
/* option) any later version.                                                */
/*                                                                           */
/* This program is distributed in the hope that it will be useful, but       */
/* WITHOUT ANY WARRANTY; without even the implied warranty of                */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General */
/* Public License for more details.                                          */
/*                                                                           */
/* The GNU GPL can be found in gpl.txt in this directory                     */
/*****************************************************************************/
?>

<html>
<head>
   <title>YaBB SE DataBase Editor</title>
<style>
<!--
body {
   font-family : Verdana;
   font-size : 10pt;
}
td {
   font-size : 10pt;
}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<center><table border=0 cellspacing=1 cellpadding=4 bgcolor="#000000" width=90%>
<tr>
   <th bgcolor="#34699E"><font color="#FFFFFF">YaBB SE DB Editor</font></th>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<?

include_once ("Settings.php");
$error=0;
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name);

/* ### DB QUERIES START ### */

$result1 = mysql_query("INSERT INTO {$db_prefix}settings VALUES ('enable_rpg', '1');");
if(!$result1){
   echo "<font color=red>Error updating the DB. SQL Error: ".mysql_error()."</font><BR>";
   $error++;}
else
echo "<font color=green>Data inserted!</font><BR>";

/* ### DB QUERIES END ### */

echo "</td></tr></table>";
if($error==0)
echo "<P>Upgrade of SQL was successfull.";
elseif ($error==1)
echo "<P>There was <B>1</B> error when upgrading your SQL.";
elseif ($error>1)
echo "<P>There were <B>$error</B> errors when upgrading your SQL.";
?>
Logged
The Hypr One
Noobie
*
Posts: 30


I caught the Magic Llama!!!

Re:rpg mod
« Reply #2 on: September 13, 2003, 06:13:15 AM »
Reply with quote

Heh, I'm glad someone else is bringing some attention to this subject  :D. And yes, I am trying to translate and fix that mod up as well. Problem is that I have limited knowledge in PHP. :(
Logged
irbrian
Sr. Member
****
Posts: 489


I create. Therefore I am.

brian@inverse-reality.com WWW
Re:rpg mod
« Reply #3 on: September 14, 2003, 03:33:44 PM »
Reply with quote

Well, I don't know German, but the mod itself appears to be modifying the english.lng file... perhaps I'll hang onto the code and see if I can find some time to port it to SMF when its released.

Unfortunately for any hardcore YaBBers out there, I don't have much interest in developing mods for software that's on its deathbed... and unfortunately for SMFers, I can't guarantee a thing.
Logged

Imparting great wisdom daily to those who will mistake my words as such.
Burns 182
Noobie
*
Posts: 1


I'm a llama!

Re:rpg mod
« Reply #4 on: October 12, 2003, 07:22:25 PM »
Reply with quote

Somebody could annex the RPG MOD, is that I am wanting it and I do not find for download.
Logged
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:rpg mod
« Reply #5 on: November 04, 2003, 07:38:59 PM »
Reply with quote

My work in progress:

Board Thread
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
gideon
Noobie
*
Posts: 3


:P

ICQ - 62806678aerkins@hotmail.com
Re:rpg mod
« Reply #6 on: November 18, 2003, 02:25:28 PM »
Reply with quote

email me :) ive been looking for something like this - was gonna write my own mod but since you're already there ;)

Logged

the darkest paths are those untrodden.
Spark_of_Ice
Noobie
*
Posts: 32


I'm a llama!

Re:rpg mod
« Reply #7 on: December 09, 2003, 02:59:04 AM »
Reply with quote

Quote from: The Hypr One on September 13, 2003, 06:13:15 AM
Heh, I'm glad someone else is bringing some attention to this subject  :D. And yes, I am trying to translate and fix that mod up as well. Problem is that I have limited knowledge in PHP. :(
Hehe, sup hypr?

I'm not PHP expert, but that file certainly looks dead. lol.
Logged
ss3jhstealth
Noobie
*
Posts: 8


I'm a llama!

Re:rpg mod
« Reply #8 on: December 11, 2003, 12:21:10 AM »
Reply with quote

Quote from: Spark_of_Ice on December 09, 2003, 02:59:04 AM
Quote from: The Hypr One on September 13, 2003, 06:13:15 AM
Heh, I'm glad someone else is bringing some attention to this subject  :D. And yes, I am trying to translate and fix that mod up as well. Problem is that I have limited knowledge in PHP. :(
Hehe, sup hypr?

I'm not PHP expert, but that file certainly looks dead. lol.


Hehe, sup Sparky?

lol yea its Stealth lol.

im gonna review this too now
Logged
Spark_of_Ice
Noobie
*
Posts: 32


I'm a llama!

Re:rpg mod
« Reply #9 on: December 11, 2003, 05:58:44 PM »
Reply with quote

I guess we're all going in different branches?  Not sticking together posting our work..having other people correct us?  Well all the best ;D
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  rpg mod « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.017 seconds with 19 queries.