Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
RPG Integration Hack /w Battle (BETA) Details »»
RPG Integration Hack /w Battle (BETA)
Version: 1.00, by Bitsys Bitsys is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 12-05-2002 Last Update: Never Installs: 278
Is in Beta Stage  
No support by the author.

RPG Integration Hack BETA by Bitsys
(vBulletin versions 2.2.6?, 2.2.7, 2.2.8, 2.2.9, and 2.3.0)

This hack combines several RPG hacks into one and adds a battle hack. The hacks included in this hack are:

In addition to re-releasing thse hacks, I have added features to all of them (or else there would be no point in re-releasing).
  • The RPG hacks are now all editable via the admin control panel.
  • The itemshop has been somewhat optimized and some fixes are included that reduce queries in showthread.php and itemshop.php . Also, Lesane's Store Hack has been integrated with the Itemshop. This can be toggled in the admin cp.

This means that the RPG hacks are database driven and have been partially integrated with the Itemshop. This was necessary in order to make a battle hack, which is also included.

Since most people are familiar with the RPG and Itemshop hacks, I will give a brief description of the Battle hack. If you want more information about either of the other two hacks, then refer to their original posts or download the .zip file and read the "readme.txt". If you are a visual learner, then you can scroll down to the second post in this thread, which contains the pictures of all of these hacks.


Battle Features:
  • The battle format is turn-based.
  • HP, AP, PP, and MA are automatically deducted based on what action a user takes, the damage dealt to an opponent, etc.
  • Opponents in battle can use spells, one-handed weapons, two-handed weapons, shields, potions, or their fists.
  • A battle is over when a combatant dies, retreats, or there is a draw. Battles can also be ended via the admin control panel.
  • A wager can be set on a battle. Whoever wins the battle recieves the amount of money as specified in the wager. Outside bets are not supported yet.
  • Battles can be either public or private, as determined by the admin control panel. If private, battles require a password and battles can not be browsed. If public, then any user can view any battle, but only the original combatants can fight.
  • The results of a battle can be posted into a designated "Battle" forum, as specified in the admin control panel.
  • Inactive battles can be pruned.

Getting started with the battle hack:
  • In order to get items to disply in the item shop, you must select which items go with which RPG Type in the "Edit Item Type" Menu of the admin cp.
  • In order to assign which weapon categories do what kind of damage in battle, you must go to the "Edit Category" link located in the "Edit Items" menu of the admin cp. Select a Battle type for the category and save changes.
  • In order to do damage to your opponent when in battle, you must assign the amount of damage each weapon does in the "Edit Items" menu of the admin cp. The default damage is set to 0. The same principle goes for armor, potions, spells, shields, etc.
Please refer to the screenshots or "readme.txt" for more information.


Why is this a BETA hack?

I have tested the installation of this hack on vBulletin versions 2.2.7, 2.2.8, 2.2.9, and 2.3.0. However, because of the scale of this hack, there is plenty of room for errors. Therefore I am making the following disclaimer while this hack is in the BETA stage:


WARNINGS:
  • Do not install this hack on a production board. Please keep this hack, while in the BETA stage, to a test board. The reason for not installing this on a production board is that I cannot provide upgrade instructions for going from one version of the beta hack to the next version of the beta hack. Also, this hack does not have an un-install script yet. So please remember, if you decide to install this on a production board, you are doing so at your own risk.
  • Do not apply this hack if you already have ANY of the included hacks installed. Please refer to the list at the top to see if you have any of the conflicting hacks installed. Since I am asking that you install this on a test board right now, this should not be a problem since you can re-install a fresh copy of vBulletin in under 5 minutes, as a test board of course.
  • There is currently no upgrade script for installing this over any of the included hacks. I will make one when this beta is completed.
  • If you choose to install the postbit features, then an additional query will be added to showthread.php. This query is a SELECT COUNT(*) query and adds around .001 seconds to the page generation. If you don't like the idea of adding an additional query to showthread.php, then you have the option of not installing that part of the hack. See the install file for more information.


Miscellaneous:

The beta of this hack is free. The full/final release will also be free.

All installation instructions and credits are included in the attachment. If you find a bug or have problems, feel free to post them here and I will try to fix them. Please read the included readme file if you have questions. If you can't find the answer, then post your question here and I will answer it.

All hacks included in this hack have been re-released with permission of their original creators.

Screenshots are in the second post of this thread.


Installation:

Installation instructions are included in the .zip file.


ACKK! I NEED HELP!!!

If you are having trouble and need some help, please refer to the help documentation included in the .zip file. It is located in the "extra" directory.

If you need help and you have already installed the hack, make sure you check the RPG Manual link in the admin cp. Also, make sure you read the FAQ included with the manual.

MY THREADS STOPPED DISPLAYING CORRECTLY!!!
See if you are experiencing one of the following symptoms:
  • All of my users are being labeled as "Guest" in the postbit template.
  • No posts are showing up.
  • None of the RPG variables will display in the postbit. The element/gender/class images are broken.
  • I get database errors when I go to showthread.php

If you are experiencing one or more of the above problems, then your showthread.php file was not edited correctly by the installer. This problem usually occurs on boards with other hacks installed that modify the queries in showthread.php. Please go to https://vborg.vbsupport.ru/showpost....postcount=2261 and follow the instructions there.


Add-ons:
The following add-ons are not included in the default installation. You must apply these add-ons after you have installed the hack successfully.

Member profile add-on
This add-on let's you display the user's RPG Stats in their member profile. See the .zip file for the add-on. It is located in the "Member Profile Add-on" directory.

Auto-update stats after posting
This add-on automatically updates the user's stats after they make a post, instead of having to click on the update stats button in the user cp. This add-on involves 2 file edits. The add-on is located at https://vborg.vbsupport.ru/showthrea...452#post356452

Donation Queue by Darkwaltz4
Moderate all Donations. See Who is Donating to Who. All Donations go through Admins or Mods. The add-on is located at https://vborg.vbsupport.ru/showthrea...652#post408652

Battle Background Midi System by Darkwaltz4
Full control over the music that plays during your battles! The add-on is located at https://vborg.vbsupport.ru/showthrea...530#post410530

Randomized First Turn Addon by Moreliator
"The following code gives the challenger a 33% chance to start the battle and the challenged person a 66% chance. Works quite well. I also included instructions on how to display "Determining..." on the battle.php browse page, that way people won't decline a challenge if they see they aren't going first. ". The add-on is located at https://vborg.vbsupport.ru/showthrea...614#post410614

Lock RPG Options at a Specified Level Addon by Moreliator
This addon allows you to lock all users' RPG options in their USER CP when they reach a certain level. This add-on is located at https://vborg.vbsupport.ru/showthrea...111#post411111

Personal Shop Items Have Battle Bonuses by Triade
The original personal shop, allows to have an item the don't do nothing in battle. With this add-on, you can build items with bonus in battle (the bonus is in the attack now). This add-on is located at https://vborg.vbsupport.ru/showthrea...328#post426328

Challengable Option by Darkwaltz4
Allows users to set themselves against recieving battle challenges. This add-on can be found at https://vborg.vbsupport.ru/showthrea...143#post411143


Contact Info:
Bitsys
Email: bitsys AT mail DOT com
PM me for a faster response. I prefer PMs.

~~~~~~~~~~~~
Update 09/04/03 @ 1:46pm
v0.68c

Battle debug messages were accidentally left on.
Minor shield bug was fixed in battlefight.php (Thanks Telchar).

Re-upload battleupdate.php and battlefight.php.

The new .zip file is located at the bottom of this post.


Finally, here is the .zip file (v0.68c):

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #1882  
Old 06-25-2003, 02:19 AM
lioncool1589 lioncool1589 is offline
 
Join Date: Feb 2003
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i checked 3 times already nothing wrong in battle.php
Reply With Quote
  #1883  
Old 06-25-2003, 06:50 PM
Darkwaltz4's Avatar
Darkwaltz4 Darkwaltz4 is offline
 
Join Date: Oct 2002
Location: Chicago
Posts: 1,538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

why dont you pm me your battle.php file and ill find whats wrong with it for you?
Reply With Quote
  #1884  
Old 06-26-2003, 07:56 AM
lioncool1589 lioncool1589 is offline
 
Join Date: Feb 2003
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Darkwaltz4 ur midi work fine now i fixed the problems thx for ur help
Reply With Quote
  #1885  
Old 06-26-2003, 04:17 PM
Darkwaltz4's Avatar
Darkwaltz4 Darkwaltz4 is offline
 
Join Date: Oct 2002
Location: Chicago
Posts: 1,538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

whoops, yeah thats the 'original' line of code :-p sorry, ill fix that in the file, thanks
Reply With Quote
  #1886  
Old 06-26-2003, 06:04 PM
Bitsys's Avatar
Bitsys Bitsys is offline
 
Join Date: Oct 2002
Posts: 444
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 11:29 AM Me! said this in Post #1909
I found a little bug, I set certain items to be exclusive to certain classes. For example I'm a priestess which is categorized under holy type. I also have paladin which is classified as Paladin.

Whenever I go into the item shop, instead of taking me to the holy class only weapons I am instead taken to the Paladins weapons, I can even purchase them.

It doesn't seem to recognize I'm not a paladin unless I go and click on some other category like Mage or something.
Thanks, will be fixed in the next version, I think. Quick fix:

In itemshop.php, find:

PHP Code:
$pos strpos($selitem[type], $itemtype);
                                        if(
$pos !== false || $catcheck[type] == 1) { 
And REPLACE with:
PHP Code:
if(in_array($itemtypeexplode(' '$selitem['type'])) || $catcheck[type] == 1) { 
Let me know if that works. If not, then I need to do something else
Reply With Quote
  #1887  
Old 06-27-2003, 01:35 AM
Bitsys's Avatar
Bitsys Bitsys is offline
 
Join Date: Oct 2002
Posts: 444
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 08:11 PM Me! said this in Post #1912
*dances around* Thanks I will try that now

Edit: Hmm nope that didn't seem to fix it :/
also Your welcome Darkwaltz ^^

What are the IDs for the Paladin and Holy types?
Reply With Quote
  #1888  
Old 06-27-2003, 05:55 AM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to allow users under level 10 or what ever you want get healed automatically after battle.

Reason I want this is all the new members strugle and give up. This would allow them to catch up to us elders.
Reply With Quote
  #1889  
Old 06-27-2003, 01:41 PM
Bitsys's Avatar
Bitsys Bitsys is offline
 
Join Date: Oct 2002
Posts: 444
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Yesterday at 10:32 PM Me! said this in Post #1914
Hmm Holy type is #4 while Paladin is #10
Are you still able to purchase the item?

Quote:
Today at 01:55 AM SmEdD said this in Post #1915
Is there a way to allow users under level 10 or what ever you want get healed automatically after battle.

Reason I want this is all the new members strugle and give up. This would allow them to catch up to us elders.
In heal.php, find:

PHP Code:
function healcheck($healcost$healmodifier) {
        if(
$healcost && $healmodifier != 0)
                return 
1;
        else
                return 
$healcost;
}
function 
healcost($selection 1$max 1$norm 1$modifier 1) {
        if (
$selection == 1) {
                return @
floor($max .25 $modifier);
        } elseif (
$selection == 2) {
                return @
floor($max .5 $modifier);
        } elseif (
$selection == 3) {
                return @
floor($max $modifier);
        } elseif (
$selection == 4) {
                return @
floor(($max $norm) * $modifier);
        }

And REPLACE with:

PHP Code:
function get_user_level()
{
    global 
$bbuserinfo;
    static 
$userlevel;
    
    if (!
$userlevel)
    {
        
$battleopt $DB_site->query_first("SELECT exprate FROM battle_options");
        
$userlevel getlevel($bbuserinfo['xp'], $battleopt['exprate']);
    }
    return 
$userlevel;
}
function 
healcheck($healcost$healmodifier) {
        if (
get_user_level() < 10)
        {
            return 
0;
        }
        if(
$healcost && $healmodifier != 0)
                return 
1;
        else
                return 
$healcost;
}
function 
healcost($selection 1$max 1$norm 1$modifier 1) {

        if (
get_user_level() < 10)
        {
            return 
0;
        }
        
        if (
$selection == 1) {
                return @
floor($max .25 $modifier);
        } elseif (
$selection == 2) {
                return @
floor($max .5 $modifier);
        } elseif (
$selection == 3) {
                return @
floor($max $modifier);
        } elseif (
$selection == 4) {
                return @
floor(($max $norm) * $modifier);
        }

This is not tested, but I think it will work.
Reply With Quote
  #1890  
Old 06-28-2003, 01:04 AM
lioncool1589 lioncool1589 is offline
 
Join Date: Feb 2003
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nvm i fixed
Reply With Quote
  #1891  
Old 06-28-2003, 03:35 AM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually I got it for it to do it right after the battle.

It's a crappy code but it works and no problems so far. I'm sure there is a easier way to do the code but oh well.

In battleupdate.php find:
PHP Code:
function endbattle($winnerid$loserid) {
        global 
$DB_site$bbuserinfo$battle$username$opponentname$battleaction;
        
$itemopt $DB_site->query_first("SELECT lesanestore FROM items_options");
        if(!
$itemopt[0]) {
                
$newmoney $DB_site->query_first("SELECT bankval FROM items_user WHERE userid='$winnerid'");
                
$newmoney $newmoney[bankval] + $battle[wager] * 2;
                
$DB_site->query("UPDATE items_user SET bankval='$newmoney' WHERE userid='$winnerid'");
        } else {
                
$newmoney $DB_site->query_first("SELECT storep FROM user WHERE userid='$winnerid'");
                
$newmoney $newmoney[0] + $battle[wager] * 2;
                
$DB_site->query("UPDATE user SET storep='$newmoney' WHERE userid='$winnerid'");
        }
        
$DB_site->query("UPDATE battle_stats SET wins=wins+1 WHERE userid='$winnerid'");
        
$DB_site->query("UPDATE battle_stats SET losses=losses+1 WHERE userid='$loserid'");
        
$totalwager $battle[wager] * 2;
        if(
$winnerid == $bbuserinfo[userid]) {
                
$battleaction .= "$username was awarded $$totalwager for winning the battle.";
        } else {
                
$battleaction .= "$opponentname was awarded $$totalwager for winning the battle.";
        } 
Add after:
PHP Code:
                $healuser $DB_site->query_first("SELECT * FROM user WHERE userid='$bbuserinfo[userid]'");
            
$level getlevel($healuser['xp'], $healuser['exprate'], 1);
            
$ep floor (100 * ($level floor ($level)));
            
$showlevel floor ($level 1);
        if(
$showlevel == 1){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        }
        if(
$showlevel == 2){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        }
        if(
$showlevel == 3){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        }
        if(
$showlevel == 4){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        }
        if(
$showlevel == 5){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        }
        if(
$showlevel == 6){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        }
        if(
$showlevel == 7){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        }
        if(
$showlevel == 8){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        }
        if(
$showlevel == 9){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        }
        if(
$showlevel == 10){
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'");
        } 
I'm gonna redo it like the other one looks in the battle update file
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:04 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05775 seconds
  • Memory Usage 2,402KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete