vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   RPG Integration Hack /w Battle (BETA) (https://vborg.vbsupport.ru/showthread.php?t=46417)

chrisz 02-20-2003 12:25 PM

thnx bitsys now where do I put this code in the newreply and newthread?
And how do I take the update stats out of the profile?
EDIT: Works great thnx :)

Bitsys 02-20-2003 12:35 PM

Quote:

Originally posted by chrisz
thnx bitsys now where do I put this code in the newreply and newthread?
Between
PHP Code:

// End Itemshop code by Mewtwo and Battle Code by Bitsys 

and
PHP Code:

// send email to moderators 

in both files.

chrisz 02-20-2003 12:36 PM

and the update stats bit?

Bitsys 02-20-2003 12:45 PM

Update stats automatically Add-On

In newreply.php and newthread.php, between
PHP Code:

// End Itemshop code by Mewtwo and Battle Code by Bitsys 

and
PHP Code:

// send email to moderators 

in both files, place the following code:

PHP Code:

//begin auto-update stats add-on for the RPG Integration Hack by Bitsys
$userinbattle $DB_site->query_first("SELECT inbattle FROM user WHERE userid='$bbuserinfo[userid]'");
    if (
$userinbattle[inbattle] == 0) {
      
//$debugmessage .= "You must be out of a battle in order to update your stats.  Please exit or complete battle $userinbattle[inbattle] and try again.";
      //exit;
      
$userstats $DB_site->query_first("SELECT hp, maxhp, element, ma, maxma, pp, maxpp, ap, posts, xp FROM user WHERE userid='$bbuserinfo[userid]'");
      
$hp $userstats[hp];
      
$maxhp $userstats[maxhp];
      
$ele $userstats[element];
      
$ma $userstats[ma];
      
$maxma $userstats[maxma];
      
$pp $userstats[pp];
      
$maxpp $userstats[maxpp];
      
$ap $userstats[ap];
      
$posts $userstats[posts];
      
$debugmessage .=  "HP: $hp | MaxHP: $maxhp | Element: $ele | MA: $ma | MaxMA: $maxma | PP: $pp | MaxPP: $maxpp | AP: $ap | Posts: $posts<br>\n";
      
$jointime = (time() - $bbuserinfo[joindate]) / 86400;
      if (
$jointime 1) {
        
$postsperday "$posts";
      } else {
        
$postsperday sprintf("%.2f",($posts $jointime));
      }
      
$debugmessage .=  "Jointime: $jointime<br>\n";
      
$battleopt $DB_site->query_first("SELECT * FROM battle_options");
        
$level getlevel($userstats[xp], $battleopt[exprate], 1);
        
$ep floor (100 * ($level floor ($level)));
        
$showlevel floor ($level 1);
      
$debugmessage .=  "Level: $level | Showlevel: $showlevel<br>\n";
      
$hpmulti =round ($postsperday 41);
      if (
$hpmulti 7.5)
        
$hpmulti 3;
      if (
$hpmulti 2.5)
        
$hpmulti 1.5;
      if (
$hpmulti 1)
        
$hpmulti 1;
      
$debugmessage .=  "HPMulti: $hpmulti<br>\n";
      
$element $DB_site->query_first("SELECT * FROM rpg_element WHERE elementid='$ele'");
      
$hpmodifier $element[hp];
      
$mamodifier $element[ma];
      
$ppmodifier $element[pp];
      
$apmodifier $element[ap];
      
$debugmessage .=  "HPmodifier: $hpmodifier | MAmodifier:  $mamodifier | PPmodifier: $ppmodifier | APmodifier: $apmodifier<br>\n";
      
$elename $element[name];
      
$maxhpupdate = ( $level $battleopt[hpmodifier] * $hpmulti) + $hpmodifier;
      
$maxhpupdatefloor ($maxhpupdate);
      
$maxmaupdate $mamodifier + ($jointime $level $battleopt[mamodifier]) / 5;
      
$maxmaupdate floor ($maxmaupdate);
      
$maxppupdate $ppmodifier + ($jointime $level $battleopt[ppmodifier]) / 3;
      
$maxppupdate floor ($maxppupdate);
      If (
$maxhpupdate 0)
        
$maxhpupdate 0;
      If (
$maxmaupdate 0)
        
$maxmaupdate 0;
      If (
$maxppupdate 0)
        
$maxppupdate 0;
      If (
$apmodifier 0)
        
$apmodifier 0;
      If (
$maxhp != && $maxhpupdate != 0)
        
$newhp $hp * ($maxhpupdate $maxhp);
      else
        
$newhp $maxhpupdate;
      If (
$maxma != && $maxmaupdate != 0)
        
$newma $ma * ($maxmaupdate $maxma);
      else
        
$newma $maxmaupdate;
      If (
$maxpp != && $maxppupdate != 0)
        
$newpp $pp * ($maxppupdate $maxpp);
      else
        
$newpp $maxppupdate;
      
$debugmessage .=  "MaxHPupdate: $maxhpupdate | MaxMAupdate: $maxmaupdate | MaxPPupdate: $maxppupdate<br>\n";
      
$debugmessage .=  "NewHP: $newhp | NewMA: $newma | NewPP: $newpp<br>\n";
      
$DB_site->query("UPDATE user SET maxhp='$maxhpupdate', hp='$newhp', maxma='$maxmaupdate', ma='$newma', maxpp='$maxppupdate', pp='$newpp' WHERE userid='$bbuserinfo[userid]'");

      
$debugmessage .=  "Stats Updated.";
    } else {
      
$debugmessage .=  "You are in Battle.";
    }
    
//end auto-update stats add-on for the RPG Integration Hack by Bitsys 

Note that if you have modified the update stats code before, then you will have to modify it again in both of these files. Also, this code will NOT update the user's AP (anger percentage). It will remain the same.

chrisz 02-20-2003 12:52 PM

Your a genious it worked :D
Thnx for all your hard work keep it up :)
I am sure lots of people will use this :)

PSI|Dr-X 02-20-2003 02:15 PM

(The 61 page)

Lol if there is comming an hack of the month then it's surely you Bytsis :)

The Hack of The Century :)

Dribbles 02-20-2003 03:10 PM

Will the Update stats automatically Add-On use up a lot more resources?

Bitsys 02-20-2003 03:33 PM

Quote:

Originally posted by Dribbles
Will the Update stats automatically Add-On use up a lot more resources?
It adds 5 extra queries every time someone replies to a thread, or makes a new thread. That is why I didn't include it in the default release.

If I get the time, I will reduce the queries and re-post the code.

Dribbles 02-20-2003 03:46 PM

I assume 5 extra queries is a lot? I don't need it anyway then ... I'll just have my members do it the hard way (for them not me) hehehe

Vivi Ornitier 02-20-2003 04:26 PM

I have a question,

Which currency will we have to use for the this battle hack? Is it compatible with the lesane's store currency or do we have to use something like shinra's points system? Personaly both are alright but i'm usin store currency for the store which is a big thing and the shinra's points for Itemshop only. So which currency will the battle hack use?


All times are GMT. The time now is 07:36 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02875 seconds
  • Memory Usage 1,800KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete