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)

Dribbles 02-19-2003 12:38 AM

I'm trying to figure out how much experience I should award users per post and for fights, etc ... just curious, when it says set how much experience a user needs before going up a level (choose number between 1-5) ... how exactly does it work? Is it the same number of experience to go up every level? (ie- level 1 -> level 2 = same amount needed as level 75 -> level 76) ... also, how much experience in points do the numbers 1 -> 5 relate to? thnx :)

Darkwaltz4 02-19-2003 01:56 AM

1) yep, it does update from what i can tell ;) excellent

also...rember this?

Quote:

Originally posted by Darkwaltz4
maybe i can do some addons? both the shields and pp would be cool....

now, do i lie? who doesnt think this is cool? (look at screnshots of my newest addon)

makes use of pp ^_^!!

it _works_!!! (required a little hunting here and there -_-)

adds no extra queries than before!

coming up:
potions that heal pp
heal pp in healing center

display summon picture in postbit (its own variable)..

some notes:
summons do more damage if you have less pp than all your pp!

2 pictures--all summons have the sparkly little gif, but bring up the main picture in special cases

(Shiva, used for my test summon, has had test stats applied for the itemshop info for purchasing. i would not sell it for 100 gil, it wouldnt cost 1000 pp, and it wouldnt do 50000 damage ;) )
healing and attack (or both) types (modeled after spells..)

and....if ur interested, maybe this could be integrated as well? or just an addon?

sheilds are next after pp business--

geniuscrew 02-19-2003 02:12 AM

Nice job DW! I like the bit where Shiva misses rofl

Dribbles 02-19-2003 04:56 AM

wow, how did your character get so many items :)

geniuscrew 02-19-2003 08:34 AM

Quote:

Originally posted by Dribbles
wow, how did your character get so many items :)
By splitting up the items into different categories ;~)

chrisz 02-19-2003 10:01 AM

Any idea when this addon will be out DarkWaltz

chrisz 02-19-2003 02:42 PM

Bitsys when I lvl up on my forum how come my HP doesnt rise???

geniuscrew 02-19-2003 02:48 PM

Have u updated your stats?

Darkwaltz4 02-19-2003 03:25 PM

my itemshop currently has 13 categories and 256 items. im gunna be adding a few more potions for pp, and a bunch of summons. the summon system is up and running on my board. if you are interested, tell me, and ill try to backtrack what i added -_-

when summons are added 'officially' to my shop, ill have ~290 items, and 14 categories. --im also making a 'dummy' type, merely so i can make a combinaion itemshop, for displaying all items at once, just for fun ^_^ (and i can link to it and ppl wont get too lost)

ill keep yaupdated, and speakin of updates, when the newer versions come out, the addon is yet another thing i have to update -_-

last night i got the healing center to heal pp ;) (quite easy actually, required a addon to battle_options), and began fixing potions to do pp as well

geniuscrew 02-19-2003 03:35 PM

Sounds cool! I would be very interested in seeing how you did it :P

Also just a question, do they "buy" the Shiva summon?

Vivi Ornitier 02-19-2003 05:13 PM

okay i'm just curious. I haven't installed this hack yet but ummm . . . u said it's not installable if you have any of the other hacks installed. I have like half of those hacks installed already, so is it just impossible for me to install the hack now? Even if i get rid of those hacks and start over again? Also i'm on 2.2.6, any confirmation that it works on it? Any clue when the final release comes?

Bitsys 02-19-2003 05:36 PM

Quote:

Originally posted by Dribbles
I'm trying to figure out how much experience I should award users per post and for fights, etc ... just curious, when it says set how much experience a user needs before going up a level (choose number between 1-5) ... how exactly does it work? Is it the same number of experience to go up every level? (ie- level 1 -> level 2 = same amount needed as level 75 -> level 76) ... also, how much experience in points do the numbers 1 -> 5 relate to? thnx :)
The level formula is logarithmic. Therefore, the higher your level, the more experience it takes to gain another level. If you want to see the actul code, then search for the getlevel function in admin/functions.php.

Quote:

Originally posted by Darkwaltz4
and....if ur interested, maybe this could be integrated as well? or just an addon?
The add-on sounds pretty cool. I can't guarantee that I'll integrate because I need to look at the source code first.

Quote:

Originally posted by chrisz
Bitsys when I lvl up on my forum how come my HP doesnt rise???
Like geniuscrew said, did you update your stats in the user cp?

Quote:

Originally posted by Vivi Ornitier
okay i'm just curious. I haven't installed this hack yet but ummm . . . u said it's not installable if you have any of the other hacks installed. I have like half of those hacks installed already, so is it just impossible for me to install the hack now? Even if i get rid of those hacks and start over again?
If you get rid of those hacks, then you should be fine installing this hack. The reason why you can't have both installed at the same time is because they use a lot of the same variables. Just make sure that all of the hacks are removed before installing this hack.
Quote:

Originally posted by Vivi Ornitier
Also i'm on 2.2.6, any confirmation that it works on it? Any clue when the final release comes?
There have been 2 or 3 people that have reported it working fine on version 2.2.6. I myself have not tested it on 2.2.6, but I don't think you will have any problems. No date for the final release yet. There is still one bug that I am looking in to.

h4x0rtje 02-19-2003 07:09 PM

Vivi Ornitier: It works for me fine on a fresh 2.2.6 no problems ! :)

Mystic Gohan 02-19-2003 07:39 PM

I like the Esper System add-on you have. I would like very much on my forum. As I am a Final Fantasy fan :p

Darkwaltz4 02-19-2003 07:48 PM

alright--i wanna fix up a few little things, and finish adding pp potions. then ill prolly pm you all the edited files bitsys

i think for shields, itll need a 'lastmove' column for the battle table, which would record the itemtype used last battle, and 0 if it was fists or something. then u could track if a shield was cast the last move, and to act differently upon it. i definately wanna incorporate that ^_^

Bitsys 02-19-2003 07:54 PM

Quote:

Originally posted by Darkwaltz4
i think for shields, itll need a 'lastmove' column for the battle table, which would record the itemtype used last battle, and 0 if it was fists or something. then u could track if a shield was cast the last move, and to act differently upon it. i definately wanna incorporate that ^_^
Just use the winstatus column. That column isn't used until someone wins, and since you can't attack after someone has won, then it should be free for you to use for the shield status.

Darkwaltz4 02-19-2003 07:57 PM

what exactly were the 'beta tests' done? u keep mentioning passed failed things, but i dont know what you tried *shrugs*

Dribbles 02-19-2003 08:52 PM

Are the weapons working for anyone in v.63? For some reason, it's not working for me still :( Maybe it could be the Lesane store hack?

Dribbles 02-19-2003 09:09 PM

Just checked ... When I add a new item, it's not showing up in itemshop.php either :(

Bitsys 02-19-2003 11:02 PM

Quote:

Originally posted by Darkwaltz4
what exactly were the 'beta tests' done? u keep mentioning passed failed things, but i dont know what you tried *shrugs*
Are you referring to the things that I have tried but didn't actually work out?

If so, then the major one was limit breaks. The original RPG Class Hack had limit breaks for different classes. You would get a new level break after getting a new level.

The way I saw it was that these limit breaks took a certain amount of PP to execute. So, if I wanted to use "Dragon Punch" in battle, then it might cost me 300 PP, etc. These limit breaks would each do a certain enhancement, like 200% extra damage, or skip a turn, or immobilize your enemy for a turn. Basically, they were special attacks that could affect the status of the battle in a unique way. Mind you, this was when the moderators calculated damage for a battle and subtracted the HP manually. The Mods also did the coin flipping and sometimes the narration.

When I originally set out to do the RPG hack, I was very intent on having PP and limit breaks. However, I looked at the code and it did not seem feasible for several reasons:
  • Each class had 5 limit breaks. Approx. 30 classes * 5 limit breaks = 150 different limit breaks, which is quite a few.
  • Each limit break would have to have one or more special pre-designed abilities that could affect the battle. They would also have to take away a set amount of PP.
  • There would have to be a system for gaining a level break. Would it just be that you automatically get it when you reach a certain level? Or should there be a training ground?
  • The database structure would have been very complicated. What happens when the admin deletes a class? Would the user lose the limit breaks associated with that class, and possibly lose all of that hard work in the training grounds?
Problems such as these caused me to push the limit breaks and PP off to the side. I tried to do part of the table structures, but gave up. I can see a way of doing it now, but it wouldn't stay true to the original Class Hack.

I am not saying that it is impossible, it would just be more difficult than a lot of the other parts of the hack. I don't think it would be as hard as the php/javascript code I put into member.php to automatically update the races/classes based on what you choose.

That is the main feature that I have tried and felt like it wasn't worth the time to implement. However, I am not discouraging you against pursuing this add-on or any other add-on. Just because I didn't feel like it was feasible, that doesn't mean you won't.

Most of the other things that I have tried and failed at were just incremental parts of the hack. Like, the original way I had battles set up was rather horrible. So I changed it and re-wrote the code. That version was pretty bad too. So I changed it again. This process went on and on until you see what it is now.



Quote:

Originally posted by Dribbles
Are the weapons working for anyone in v.63? For some reason, it's not working for me still Maybe it could be the Lesane store hack?
They work for me. I don't think it is Lesane's store hack, since that only affects the monetary system and itemshop. Check your PMs.

Quote:

Originally posted by Dribbles
Just checked ... When I add a new item, it's not showing up in itemshop.php either
Make sure you are assigning it an RPG Type in the Edit Item Types menu. Just click the checkboxes below the class types that you want to have access to that weapon.

chrisz 02-19-2003 11:38 PM

Ok everything works fine for me :)
I have it running on my forum now but the PP has no use until the Summons addon is out and how does the anger rise?

Darkwaltz4 02-20-2003 12:12 AM

lol--while fixing one thing, i break another ^_^
so im fixing that now -_-
pp healing is abled in the healing center--im surprised it wasnt set up in the first place :(

i also put up some little changes which u may or may not keep when i send u the files bitsys. like, itemshop turning off, and some display changes, lol
so...just be sure to check mosta it--if u havent already taken vb's advice, and gotten beyond compare2, its pretty useful ^_^

well...i unno about limit breaks O.o seems too not 'one-size-fits-all' which yeah, would require alot of db stuff....

but yeah, 4 big things im doing/done
summons
pp heal center
pp potions
shields

how long have u been workin on this hack?

Moreliator 02-20-2003 12:46 AM

The only problem I have occuring is in the RPG System Center (rpgcp.php)

Some users report that it is not displaying their stats.... all it has are a nuch of " 'S Stats" instead of the users name, and it doesn't display any of their character info. I had this happen to my account to, but all of a sudden it went away one time and never came back. Is tehre something with editing your character or having to buy an item that triggers the CP to display yuor characters pic and stats?

Bitsys 02-20-2003 01:28 AM

Quote:

Originally posted by Darkwaltz4
so...just be sure to check mosta it--if u havent already taken vb's advice, and gotten beyond compare2, its pretty useful ^_^
Heh, how do you think I made all of the upgrade files? I certainly couldn't have done it without Beyond Compare. ;)
Quote:

Originally posted by Darkwaltz4
how long have u been workin on this hack?
Since September 15th, 2002.

Quote:

Originally posted by Moreliator
The only problem I have occuring is in the RPG System Center (rpgcp.php)

Some users report that it is not displaying their stats.... all it has are a nuch of " 'S Stats" instead of the users name, and it doesn't display any of their character info. I had this happen to my account to, but all of a sudden it went away one time and never came back. Is tehre something with editing your character or having to buy an item that triggers the CP to display yuor characters pic and stats?

As far as I know, the only requirement is that you have to be logged in. However, I will look into this a little more to see if there is something else causing it.

chrisz 02-20-2003 02:25 AM

People anger is reset when you update stats I think that should be changed!

Bitsys 02-20-2003 02:39 AM

Quote:

Originally posted by chrisz
People anger is reset when you update stats I think that should be changed!
Changed to what?

The way I see it is that if you grow a level, then your mental state changes enough that it is similar to gaining a new perspective on things. With this new perspective, your anger is now restored to its original state since the rest of your body/mind has changed also.

Anyhow, if you don't want it to change then you can take the code out of member.php. To do this,

find in member.php:

PHP Code:

$DB_site->query("UPDATE user SET ap='$apmodifier' WHERE userid=$bbuserinfo[userid]"); 

and replace with:
PHP Code:

//$DB_site->query("UPDATE user SET ap='$apmodifier' WHERE userid=$bbuserinfo[userid]"); 

That will leave their AP alone when they update their stats.

chrisz 02-20-2003 02:41 AM

thnx and is there any way to make peoples stats update automaticly?
So they dont have to click update stats all the time??

Vivi Ornitier 02-20-2003 03:42 AM

omg this hack has soooo much more stuff than when i first saw it. Holy crap this is soo gangsta. GREAT JOB BITSYS!

chrisz 02-20-2003 11:57 AM

I have a problem with my itemshop:
Its regarding spells,
Have a look at the attack and heal options they are switched around.
http://ffsaiyans.xeko.net/forum/item...s=6&itemtype=0
Can you tell me how to fix it?
I cant find it anywhere in the templates to swap them back.

Bitsys 02-20-2003 12:21 PM

Quote:

Originally posted by chrisz
thnx and is there any way to make peoples stats update automaticly?
So they dont have to click update stats all the time??

It is possible. You have to put the update stats code from member.php into newreply.php and newthread.php.

Quote:

Originally posted by chrisz
I have a problem with my itemshop:
Its regarding spells,
Have a look at the attack and heal options they are switched around.
http://ffsaiyans.xeko.net/forum/item...s=6&itemtype=0
Can you tell me how to fix it?
I cant find it anywhere in the templates to swap them back.

Those columns are dynamic. They will only show up if the category needs them. To make it simpler for people who were upgrading, I chose to put the code for the columns inside the .php file, instead of in the template. I store the html for the columns inside a variable, and then the variable in the itemshop_tabletop template gets replaced with the appropriate code.

If you want to switch them around, then it will require some changes to itemshop.php. There are two parts that you need to change.

In itemshop.php, find:
PHP Code:

$levelcolumn '<td bgcolor="{ categorybackcolor}" width="5%" align="center"><normalfont color="{ categoryfontcolor}"><b>MA Cost</b></normalfont></td><td bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" width="5%" align="center"><normalfont color="{ categoryfontcolor}"><b>Heal</b></normalfont></td><td bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" width="5%" align="center"><normalfont color="{ categoryfontcolor}"><b>Attack</b></normalfont></td>'.$levelcolumn

(I added extra spaces in front of categorybackcolor and categoryfontcolor so that vb.org wouldn't replaces them.)

And switch the columns around to however you want them. Remember what and how you switched them.

Then, in itemshop.php, find:
PHP Code:

$levelcolumnmid '<td bgcolor="#1C5780" width="5%" align="center"><normalfont>'.$extrainfo[2].'</normalfont></td><td bgcolor="#1C5780" width="5%" align="center"><normalfont>'.iif($extrainfo[0], "Yes""No").'</normalfont></td><td bgcolor="#1C5780" width="5%" align="center"><normalfont>'.iif($extrainfo[1], "Yes""No").'</normalfont></td>'.$levelcolumnmid

And switch the variables around in the same way that you switch the other code.

Quote:

Originally posted by Vivi Ornitier
omg this hack has soooo much more stuff than when i first saw it. Holy crap this is soo gangsta. GREAT JOB BITSYS!
Thanks! :)

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 08:07 AM.

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.02587 seconds
  • Memory Usage 1,944KB
  • 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
  • (9)bbcode_php_printable
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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