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)

Darkwaltz4 07-04-2003 06:30 AM

lol, the variables arent defined in the index.php page :-p

ff8_bomb 07-04-2003 01:14 PM

Ive installed this hack and everything seems to be working correctly but Im having one small little error. In my profile, where people are supposed to set their stats, the race, gender, biography, ect. forms appear once at the top, and once at the bottom. The only one that works though is the one at the bottom. How do I get rid of the one on the top?

PixelFx 07-04-2003 03:18 PM

ff8_bomb

its a cosmetic hack for your profile, you have to go into the template for your profile, having brain fart, as to which one, and edit it. there are two sections you delete in the top one that removes the top rpg name, and some double code that has the rpg info at the top of the profile.

I'm going to reinstall it again soon, when I do I'll post a link for the changed code... in the mean time I have a weapons and armor art upgrade I'm working on..

Bitsys,

how stable ya think the next release of the battle system will be?

any new addons or just lots of bug fixes? :)

Brandon 07-04-2003 04:15 PM

For some reason, my users' stats arent showing up at all. It keeps saying their at 0 HP and everything else, but mine works fine. Why is that?

DSP-The Don 07-04-2003 08:42 PM

I have a problem with the Battle.php. Whenever I try to create a battle, it won't remember the battle password I specified. For an example, my private message I get is:

Quote:

The Wolf has challenged you in a battle. It is battle number 8 and is called donvswolf. There is 0 gil at stake in this battle. Your battle password is . To go to your battle click here
the battle was a test battle. I tried the $key to $key1 and in the battle_newbattle: key to key1 but it's still not working. I know this is password related because you need a password to get on the battle (which I too wonder why you even need a password). Please help!

I'm running vB 2.3.0
The hack is installed on a production board because I'm part psycho. :confused:

Darkwaltz4 07-05-2003 12:05 AM

eh, sorry...but just what exactly were you looking to put up on index.php? the latest battle? i myself am getting sick of editing my index.php, there are 118 queries on it ^_^

Kurayami 07-05-2003 03:59 PM

*Raises hand*
I would be very interested in adding this to my front page as well... sort of a news ticker type-thing that displays the last five battles--with the appropriate character images for each character, names, battle name, and a link to the battle.
T'would be very spiffy indeed. :)

ff8_bomb 07-05-2003 04:41 PM

Quote:

Yesterday at 05:18 PM PixelFx said this in Post #1957
ff8_bomb

its a cosmetic hack for your profile, you have to go into the template for your profile, having brain fart, as to which one, and edit it. there are two sections you delete in the top one that removes the top rpg name, and some double code that has the rpg info at the top of the profile.

I'm going to reinstall it again soon, when I do I'll post a link for the changed code... in the mean time I have a weapons and armor art upgrade I'm working on..

Bitsys,

how stable ya think the next release of the battle system will be?

any new addons or just lots of bug fixes? :)


More explination please...

PixelFx 07-05-2003 06:15 PM

FF8 Bomb, other with this problem...

This will fix the dual fields problem in your edit profile. Please read the attached text file.

Let me know if you have any other problems. You should have a full install of the battle system on your forum before adding this.

If you have other changes to your "modifyprofile" make sure you make note of it.

As Always make backups of your forum database before installing anything.

ff8_bomb 07-05-2003 11:45 PM

Quote:

Yesterday at 08:15 PM PixelFx said this in Post #1965
FF8 Bomb, other with this problem...

This will fix the dual fields problem in your edit profile. Please read the attached text file.

Let me know if you have any other problems. You should have a full install of the battle system on your forum before adding this.

Thanks alot but I fixed it about five minutes before you posted this.. I found it in a different post quite a ways back. Thanks anyway.

Mijae 07-06-2003 05:43 PM

118 queries on forum home? You are killing the server! My server starts to die at 100!

chad 07-06-2003 09:47 PM

thank you great hack
/me hits install.

kaotic 07-08-2003 01:24 AM

Here's a couple of things I'm curious about...

-Would a Item Trading or PvM feature be possible to create?
-What is the query used to purchase an item?

Help would be appreciated. :)

Edit:
Another question. :) Item categories (with exception of the top one) are automatically collapsed if you are "Generic Type". If you are another RPG type, the rows are automatically expanded. How would I go about having them collapsed to begin with, rather than expanded?

TRStealth 07-09-2003 03:41 AM

Anyone know / think this hack is stable enough for a production environment?

Also, does this come with a clan system?

kaotic 07-09-2003 03:51 AM

Several large message boards already utilize this hack. I would say it's good enough for a production board.

And there is somewhat of a clan system. They're called "Alignments" in this case. I believe the default alignments are "Good" and "Evil" but you can set the clan name as an option. If you have a clan called "RPGers" add a new alignment called "RPGers" and anyone will be able to choose to be Good, Evil, or RPGers. :)

PixelFx 07-09-2003 05:07 AM

I'm personally waiting to see how stable the next update is and to help with any bugs, but I think it's getting close to production server level.

Depends on how well you know php/mysql/html editing your self, to fix anything that still might be buggy.

TRStealth 07-09-2003 06:43 AM

Quote:

Today at 05:51 AM kaotic said this in Post #1969
Several large message boards already utilize this hack. I would say it's good enough for a production board.

And there is somewhat of a clan system. They're called "Alignments" in this case. I believe the default alignments are "Good" and "Evil" but you can set the clan name as an option. If you have a clan called "RPGers" add a new alignment called "RPGers" and anyone will be able to choose to be Good, Evil, or RPGers. :)


Alright, thanks for the help guys. So these alignments can only be created by admins? Might work... I take it there's also a money system.

DSP-The Don 07-09-2003 10:16 AM

I got the password problem solved by doing that key to key1 variable change. I did install it on a production board because my friends thought the hack kicked ass. After testing out the battle system (which went with no problem!), my friends all want to battle each other (I had to ban one of my friends for spamming the forums though. I even gave him a second chance to repent).

Great work on a great hack :D

TRStealth 07-09-2003 04:23 PM

Alright, I've installed it on my boards and everything seems to be running smoothly. Had a small problem with the battle though, it said I didn't have a weapon....

kaotic 07-09-2003 04:37 PM

You have to go to "Edit Item Type" (or something simliar) via your Admin CP, and check each item to fit your type. The default type = Generic.

TRStealth 07-10-2003 05:03 AM

They are all checked, and still can't use weapons or items, still says I don't have them.

Darkwaltz4 07-11-2003 06:20 AM

lol, yes i would say its okay enough for a large active forum^_^ ffgon is pretty huge, and its been working fine...although ive had to tweak some thigs here and there, and im not sure what good any updates would do me unless there were official addons applied or something, lol. it is finally stable on mine :-p

Moreliator 07-11-2003 08:32 PM

Been working fine for a month on my boards... 10,000+ members and over 1500 battles so far.

Sure, there are SOME glitches, but we've been able to work through them all, and nothing has been serious enough to jeopardize the boards.

Jagang 07-11-2003 09:32 PM

I have a little problem with the hack--nothing major, but a weird occurance.

Several of my older members, the mods, have less hitpoints than members of quite a lower level. Our site is, so far, still in the beta testing phase, and fairly new, so noone is very high level yet, but it appears to be a trend that will continue and get far, far worse as the levels do go up. Our main programmers are not available for a good period of time because of IRL issues to go into the codes and find out, so I came here to ask the source.

After the stats are updated, it looks like this for certain users, names will not be used. Most of the mods are about the same level and HP count, and from extrapolating with other mods and members who have been around since the begginning as opposed to new members, it appears that the trend carries through. The mods are all using superior classes, and the race, elements, weaponry, etc of the two example users are all the same.

Level 44 Mod
1582 HP

Level 35 Member
1880 HP

Darkwaltz4 07-12-2003 04:31 AM

its based on posts per day and how long youve been registered O.o which in my opinion, screws up amounts far too much, so i rewrote it to be more linear

Bitsys 07-12-2003 08:10 PM

Quote:

07-01-03 at 03:28 PM Airs said this in Post #1943
Not sure if this has been asked already but figured id give it a shot. Is it possible to add more stats or change the current ones? also is it possible to add a unique character or a person lets say a admin has one and another admin has a diffrent one etc. and normal players cant choose it if this was posted already sorry ><.

What do you mean by unique character? A unique class? Or a unique race? Or what?

You can add more stats, but only through code edits and database changes. There is no way to add stats through the admin cp.

Quote:

07-02-03 at 02:09 AM chrisz said this in Post #1946
I dont get the formula can someone explain >_<"
The formula:
PHP Code:

function cal_fists($level) {
        return 
floor(log10($level) * 30 rand(-(int)($level .15), (int)($level .15))) + 1;


floor() is a function that rounds the result down to the nearest whole number.

log10() is a function that does log base 10 to the passed variable.

rand() is a function that generates a random number between the two passed variables.

* is the multiplication symbol

So, here is how it works with a level of 15:

$damage = log10(15) * 30 + rand(-15 * .15, 15 * .15) + 1

$damage = 1.176 * 30 + rand(-2.25, 2.25) + 1

(Assume the rand() function returns 1.8)

$damage = 35.2827 + 1.8 + 1

$damage = 28.0827

(round down to the nearest whole number)

$damage = 28


Quote:

07-02-03 at 10:46 PM v0id said this in Post #1948
HUGE Money bug:



Anyone want to release a quick fix? My members are having way too much fun with this :P


I just re-wrote the entire money check code in battle.php. I think I fixed all the bugs it had.

If you want to try the code I just wrote, do the following:

In battle.php, find:

Code:

// Check to see if the combatants have the specified wager
                if($wager > 0) {
                        $itemopt = $DB_site->query_first("SELECT lesanestore FROM items_options");
                        if(!$itemopt[0]) {
                                $usermoney = $DB_site->query_first("SELECT bankval FROM items_user WHERE userid='$bbuserinfo[userid]'");
                                $oppmoney = $DB_site->query_first("SELECT bankval FROM items_user WHERE userid='$opponent[userid]'");
                                If ($wager > $usermoney[0]) {
                                        $itemoptions = $DB_site->query_first("SELECT pointfield FROM items_options");
                                        $ownerpocketmoney = $DB_site->query_first("SELECT $itemoptions[0] FROM userfield WHERE userid='$bbuserinfo[userid]'");
                                        if($wager > $ownerpocketmoney[0]) {
                                                $message = "You do not have $wager gil to wager.";
                                                eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                                exit;
                                        } elseif($wager > $oppmoney[0]) {
                                                $opppocketmoney = $DB_site->query_first("SELECT $itemoptions[0] FROM userfield WHERE userid='$bbuserinfo[userid]'");
                                                if($wager > $opppocketmoney[0]) {
                                                        $message = "Your opponent does not have $wager gil to wager.";
                                                        eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                                        exit;
                                                } else {
                                                        $usernewmoney = $ownerpocketmoney[0] - $wager;
                                                        $oppnewmoney = $opppocketmoney[0] - $wager;
                                                        $DB_site->query("UPDATE items_user SET bankval='$usernewmoney' WHERE userid='$bbuserinfo[userid]'");
                                                        $DB_site->query("UPDATE userfield SET $itemoptions[0]='$oppnewmoney' WHERE userid='$opponent[userid]'");
                                                }
                                        } else {
                                                $usernewmoney = $ownerpocketmoney[0] - $wager;
                                                $oppnewmoney = $oppmoney[0] - $wager;
                                                $DB_site->query("UPDATE userfield SET $itemoptions[0]='$usernewmoney' WHERE userid='$bbuserinfo[userid]'");
                                                $DB_site->query("UPDATE items_user SET bankval='$oppnewmoney' WHERE userid='$opponent[userid]'");
                       
                                        }
                                } elseif($wager > $oppmoney[0]) {
                                        $itemoptions = $DB_site->query_first("SELECT pointfield FROM items_options");
                                        $opppocketmoney = $DB_site->query_first("SELECT $itemoptions[0] FROM userfield WHERE userid='$opponent[userid]'");
                                        if($wager > $opppocketmoney[0]) {
                                                $message = "Your opponent does not have $wager gil to wager.";
                                                eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                                exit;
                                        } else {
                                                $usernewmoney = $usermoney[0] - $wager;
                                                $oppnewmoney = $opppocketmoney[0] - $wager;
                                                $DB_site->query("UPDATE items_user SET bankval='$usernewmoney' WHERE userid='$bbuserinfo[userid]'");
                                                $DB_site->query("UPDATE userfield SET $itemoptions[0]='$oppnewmoney' WHERE userid='$opponent[userid]'");
                                        }
                                } else {
                                        $usernewmoney = $usermoney[0] - $wager;
                                        $oppnewmoney = $oppmoney[0] - $wager;
                                        $DB_site->query("UPDATE items_user SET bankval='$usernewmoney' WHERE userid='$bbuserinfo[userid]'");
                                        $DB_site->query("UPDATE items_user SET bankval='$oppnewmoney' WHERE userid='$opponent[userid]'");
                                }
                        } else {
                                $usermoney = $DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
                                $oppmoney = $DB_site->query_first("SELECT storep FROM user WHERE userid='$opponent[userid]'");
                                if($wager > $usermoney[0]) {
                                        $message = "You do not have $wager gil to wager.";
                                        eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                        exit;
                                } elseif($wager > $oppmoney[0]) {
                                        $message = "Your opponent does not have $wager gil to wager.";
                                        eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                        exit;
                                } else {
                                        $DB_site->query("UPDATE user SET storep=storep-$wager WHERE userid='$bbuserinfo[userid]'");
                                        $DB_site->query("UPDATE user SET storep=storep-$wager WHERE userid='$opponent[userid]'");
                                }
                        }
                }

and change it to:
Code:

if($wager > 0)
                {
                    $itemoptions = $DB_site->query_first("SELECT pointfield, lesanestore FROM items_options");
                   
                    // Are we using lesane's store points?
                    if (!$itemopt[1])
                    {
                        $usermoney = $DB_site->query_first("SELECT items_user.bankval, userfield.$itemoptions[0] FROM items_user, userfield WHERE items_user.userid='$bbuserinfo[userid]' AND userfield.userid='$bbuserinfo[userid]'");
                        $usermoney['total'] = $usermoney[0] + $usermoney[1];
                        $oppmoney =  $DB_site->query_first("SELECT items_user.bankval, userfield.$itemoptions[0] FROM items_user, userfield WHERE items_user.userid='$opponent[userid]' AND userfield.userid='$opponent[userid]'");
                        $oppmoney['total'] = $oppmoney[0] + $oppmoney[1];
                   
                        // Does the user have enough money to wager?
                        if($usermoney['total'] < $wager)
                        {
                            $message = "You do not have $wager to wager.";
                            eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                            exit;
                        }
                        // Does the opponent have enough money to wager?
                        if($oppmoney['total'] < $wager)
                        {
                            $message = "Your opponent does not have $wager to wager.";
                            eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                            exit;
                        }
                   
                        // If we have gotten this far, then both people have enough money to wager
                        if ($usermoney[1] < $wager)
                        {
                            // The user has to take some money from their bank account
                            // but first, we need to clean their pocket cash
                            $DB_site->query("UPDATE userfield SET $itemoptions[0] = 0 WHERE userid = $bbuserinfo[userid]");

                            // Now, adjust the bank account
                            $DB_site->query("
                                UPDATE items_user
                                SET bankval = bankval - ".($wager - $usermoney[1])  // (wager - $usermoney[1]) is the same as (wager - user's cash)
                                ." WHERE userid=$bbuserinfo[userid]
                            ");
                        }
                        else
                        {
                            // The user has enough cash to pay for the wager
                            $DB_site->query("UPDATE userfield SET $itemoptions[0] = $itemoptions[0] - $wager WHERE userid = '$bbuserinfo[userid]'");
                        }
                       
                        if ($oppmoney[1] < $wager)
                        {
                            // The opponent has to take some money from their bank account
                            // but first, we need to clean their pocket cash
                            $DB_site->query("UPDATE userfield SET $itemoptions[0] = 0 WHERE userid = $opponent[userid]");

                            // Now, adjust the bank account
                            $DB_site->query("
                                UPDATE items_user
                                SET bankval = bankval - ".($wager - $oppmoney[1])  // (wager - $oppmoney[1]) is the same as (wager - opponent's cash)
                                ." WHERE userid=$opponent[userid]
                            ");
                        }
                        else
                        {
                            // The opponent has enough cash to pay for the wager
                            $DB_site->query("UPDATE userfield SET $itemoptions[0] = $itemoptions[0] - $wager WHERE userid = '$opponent[userid]'");
                        }
                    }
                    else
                    {
                        // Yes, we are using Lesane's Store Points
                        $usermoney = $DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
                        $oppomoney = $DB_site->query_first("SELECT storep FROM user WHERE userid='$opponent[userid]'");

                        // Does the user have enough money to wager?
                        if($usermoney[0] < $wager)
                        {
                            $message = "You do not have $wager to wager.";
                            eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                            exit;
                        }
                        // Does the opponent have enough money to wager?
                        if($oppmoney[0] < $wager)
                        {
                            $message = "Your opponent does not have $wager to wager.";
                            eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                            exit;
                        }
                       
                        // If we have gotten this far, then both people have enough money to wager
                        // so update the user table
                        $DB_site->query("UPDATE user SET storep = storep - $wager WHERE userid=$bbuserinfo[userid] OR userid=$opponent[userid]");
                    }
                }
                /*
                // Check to see if the combatants have the specified wager
                if($wager > 0) {
                        $itemopt = $DB_site->query_first("SELECT lesanestore FROM items_options");
                        if(!$itemopt[0]) {
                                $usermoney = $DB_site->query_first("SELECT bankval FROM items_user WHERE userid='$bbuserinfo[userid]'");
                                $oppmoney = $DB_site->query_first("SELECT bankval FROM items_user WHERE userid='$opponent[userid]'");
                                If ($wager > $usermoney[0]) {
                                        $itemoptions = $DB_site->query_first("SELECT pointfield FROM items_options");
                                        $ownerpocketmoney = $DB_site->query_first("SELECT $itemoptions[0] FROM userfield WHERE userid='$bbuserinfo[userid]'");
                                        if($wager > $ownerpocketmoney[0]) {
                                                $message = "You do not have $wager gil to wager.";
                                                eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                                exit;
                                        } elseif($wager > $oppmoney[0]) {
                                                $opppocketmoney = $DB_site->query_first("SELECT $itemoptions[0] FROM userfield WHERE userid='$bbuserinfo[userid]'");
                                                if($wager > $opppocketmoney[0]) {
                                                        $message = "Your opponent does not have $wager gil to wager.";
                                                        eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                                        exit;
                                                } else {
                                                        $usernewmoney = $ownerpocketmoney[0] - $wager;
                                                        $oppnewmoney = $opppocketmoney[0] - $wager;
                                                        $DB_site->query("UPDATE items_user SET bankval='$usernewmoney' WHERE userid='$bbuserinfo[userid]'");
                                                        $DB_site->query("UPDATE userfield SET $itemoptions[0]='$oppnewmoney' WHERE userid='$opponent[userid]'");
                                                }
                                        } else {
                                                $usernewmoney = $ownerpocketmoney[0] - $wager;
                                                $oppnewmoney = $oppmoney[0] - $wager;
                                                $DB_site->query("UPDATE userfield SET $itemoptions[0]='$usernewmoney' WHERE userid='$bbuserinfo[userid]'");
                                                $DB_site->query("UPDATE items_user SET bankval='$oppnewmoney' WHERE userid='$opponent[userid]'");
                       
                                        }
                                } elseif($wager > $oppmoney[0]) {
                                        $itemoptions = $DB_site->query_first("SELECT pointfield FROM items_options");
                                        $opppocketmoney = $DB_site->query_first("SELECT $itemoptions[0] FROM userfield WHERE userid='$opponent[userid]'");
                                        if($wager > $opppocketmoney[0]) {
                                                $message = "Your opponent does not have $wager gil to wager.";
                                                eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                                exit;
                                        } else {
                                                $usernewmoney = $usermoney[0] - $wager;
                                                $oppnewmoney = $opppocketmoney[0] - $wager;
                                                $DB_site->query("UPDATE items_user SET bankval='$usernewmoney' WHERE userid='$bbuserinfo[userid]'");
                                                $DB_site->query("UPDATE userfield SET $itemoptions[0]='$oppnewmoney' WHERE userid='$opponent[userid]'");
                                        }
                                } else {
                                        $usernewmoney = $usermoney[0] - $wager;
                                        $oppnewmoney = $oppmoney[0] - $wager;
                                        $DB_site->query("UPDATE items_user SET bankval='$usernewmoney' WHERE userid='$bbuserinfo[userid]'");
                                        $DB_site->query("UPDATE items_user SET bankval='$oppnewmoney' WHERE userid='$opponent[userid]'");
                                }
                        } else {
                                $usermoney = $DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
                                $oppmoney = $DB_site->query_first("SELECT storep FROM user WHERE userid='$opponent[userid]'");
                                if($wager > $usermoney[0]) {
                                        $message = "You do not have $wager gil to wager.";
                                        eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                        exit;
                                } elseif($wager > $oppmoney[0]) {
                                        $message = "Your opponent does not have $wager gil to wager.";
                                        eval("dooutput(\"".gettemplate('battle_userinbattle')."\");");
                                        exit;
                                } else {
                                        $DB_site->query("UPDATE user SET storep=storep-$wager WHERE userid='$bbuserinfo[userid]'");
                                        $DB_site->query("UPDATE user SET storep=storep-$wager WHERE userid='$opponent[userid]'");
                                }
                        }
                }
                */

Quote:

07-03-03 at 01:55 PM Spark said this in Post #1951
hm here is a bad bug

I was challenged by a user
I was in trouble so i cancel the battle
The user , has lost his wager...and i win the wager...without a fight, only the challenge PM.

What?s that?


Try the code fix I did above and wait for the next update. I changed some of the code for this.

Quote:

07-04-03 at 02:01 AM Me! said this in Post #1952
I am wondering if it's possible to show this on the index page of my forum, something like "Guy VS Joe"

However when I place the code in the forum index template nothing shows. This is what I tried:

Code:

$row[owner]
<normalfont>$row[opponent]</normalfont>



That would require a custom hack.

Quote:

07-04-03 at 12:15 PM BrandonC said this in Post #1956
For some reason, my users' stats arent showing up at all. It keeps saying their at 0 HP and everything else, but mine works fine. Why is that?

Have the user's updated their stats in their profile? Does this happen to everyone but you? Have you tried running DB Fix?

Quote:

07-07-03 at 09:24 PM kaotic said this in Post #1967
Here's a couple of things I'm curious about...

-Would a Item Trading or PvM feature be possible to create?

It wouldn't be easy. I have thought about it before.

Quote:

07-07-03 at 09:24 PM kaotic said this in Post #1967

-What is the query used to purchase an item?

You will need to study the 'BUY' code in itemshop.php in order to understand the queries involved. Look for
PHP Code:

// ###################### buy ####################### 

in itemshop.php

Quote:

07-07-03 at 09:24 PM kaotic said this in Post #1967

Help would be appreciated. :)

Edit:
Another question. :) Item categories (with exception of the top one) are automatically collapsed if you are "Generic Type". If you are another RPG type, the rows are automatically expanded. How would I go about having them collapsed to begin with, rather than expanded?


In itemshop.php, find:
PHP Code:

if($options['onofforder']==1) { 

and above it, add:
PHP Code:

$expandall 1

I think that will work.

Quote:

07-09-03 at 12:23 PM t0ucan said this in Post #1973
Alright, I've installed it on my boards and everything seems to be running smoothly. Had a small problem with the battle though, it said I didn't have a weapon....
From the first post:
Quote:

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.
Quote:

Yesterday at 05:32 PM Jagang said this in Post #1978
I have a little problem with the hack--nothing major, but a weird occurance.

Several of my older members, the mods, have less hitpoints than members of quite a lower level. Our site is, so far, still in the beta testing phase, and fairly new, so noone is very high level yet, but it appears to be a trend that will continue and get far, far worse as the levels do go up. Our main programmers are not available for a good period of time because of IRL issues to go into the codes and find out, so I came here to ask the source.

After the stats are updated, it looks like this for certain users, names will not be used. Most of the mods are about the same level and HP count, and from extrapolating with other mods and members who have been around since the begginning as opposed to new members, it appears that the trend carries through. The mods are all using superior classes, and the race, elements, weaponry, etc of the two example users are all the same.

Level 44 Mod
1582 HP

Level 35 Member
1880 HP

You can try to do the following:

In the Auto-Update Stats add-on (newthread.php, newpost.php), and member.php, find:
PHP Code:

$maxhpupdate = ( $level $extrastats[hpmodifier] * $hpmulti) + $hpmodifier

and REPLACE it with:
PHP Code:

$maxhpupdate = ( $level $extrastats[hpmodifier]) + $hpmodifier

Please note that this will reduce some users' HP, but it should remain constant after that initial decrease. If you want to do the same for MA and PP, then let me know.

kaotic 07-12-2003 11:32 PM

Welcome back. Thanks for the tip, but adding
Quote:

$expandall = 1;
before

Quote:

if($options['onofforder']==1) {
Didn't work. I'll tinker with it a bit more, though.

Airs 07-12-2003 11:43 PM

Quote:

Yesterday at 10:10 PM Bitsys said this in Post #1980
What do you mean by unique character? A unique class? Or a unique race? Or what?

You can add more stats, but only through code edits and database changes. There is no way to add stats through the admin cp.




A unique class, and as for the stats thing *sorry to bother but im really sorta learning php still* can you like tell me what files are necesarry to edit to make it happen?

Thnx for the answer and wb :)

mjp1111 07-13-2003 05:02 AM

I keep getting this emailed to me - I think it is due to using spells or potions -

Invalid SQL: SELECT items_user.item5,items_user.itid5,items.type,items .extra FROM items_user
LEFT JOIN items ON items.itemid=items_user.itid5
WHERE userid='10'
mysql error: Unknown column 'items_user.item5' in 'field list'

mysql error number: 1054

Bitsys 07-14-2003 02:54 PM

Quote:

07-12-03 at 07:32 PM kaotic said this in Post #1981
Welcome back. Thanks for the tip, but adding

before


Didn't work. I'll tinker with it a bit more, though.

Darn, I was hoping that would work. I will check in to it some more.

Quote:

07-12-03 at 07:43 PM Airs said this in Post #1982



A unique class, and as for the stats thing *sorry to bother but im really sorta learning php still* can you like tell me what files are necesarry to edit to make it happen?

Thnx for the answer and wb :) [/B]
A unique class can be given to any mod or admin by setting its visibility to 0 in the Edit Classes Menu. Unfortunately, you can't give a single class to a single person.

In order to add a new stat, you would have to change quite a few files. Off the top of my head, they would be member.php, rpgcp.php, battlefight.php, battleupdate.php, newthread.php, newpost.php, heal.php. Some of those are optional though, depending on what you want the stat to do. You would also have to change all the templates where the stats are displayed.

Adding an additional stat is not an easy feat.

Quote:

Yesterday at 01:02 AM mjp1111 said this in Post #1983
I keep getting this emailed to me - I think it is due to using spells or potions -

Invalid SQL: SELECT items_user.item5,items_user.itid5,items.type,items .extra FROM items_user
LEFT JOIN items ON items.itemid=items_user.itid5
WHERE userid='10'
mysql error: Unknown column 'items_user.item5' in 'field list'

mysql error number: 1054

At any time did you switch an item category from personal to public or vice versa? Do you recall any changes you made to the item categories before this happened? An easy solution would be to add those columns back to the items_user table, but I would rather figure out why this happened.

mjp1111 07-15-2003 07:55 AM

quote:
Yesterday at 01:02 AM mjp1111 said this in Post #1983
I keep getting this emailed to me - I think it is due to using spells or potions -

Invalid SQL: SELECT items_user.item5,items_user.itid5,items.type,items .extra FROM items_user
LEFT JOIN items ON items.itemid=items_user.itid5
WHERE userid='10'
mysql error: Unknown column 'items_user.item5' in 'field list'

mysql error number: 1054

At any time did you switch an item category from personal to public or vice versa? Do you recall any changes you made to the item categories before this happened? An easy solution would be to add those columns back to the items_user table, but I would rather figure out why this happened.

I don't think I switched categories. The only new categories were shops created by users.

I changed the battle type - I have narrowed it down - it is the Spells that don't work. I changed the items to Potions and it worked fine, but whenever I select Spells, everything just dies.

mjp1111 07-15-2003 11:44 AM

This thing is also bugging me - battles are working fine apart from the spells thing as per last post, I've updated stats repeatedly, but postbit info shows up as -

RPG name: N/A
Level: 2 Alignment:
Race: HP: /206 Alive
Not in battle.
Check Stats :---

i.e. RPG name, X/206 HP and :--- all refuse to show up - any ideas?

Bitsys 07-15-2003 12:22 PM

Quote:

Today at 03:55 AM mjp1111 said this in Post #1985
quote:
Yesterday at 01:02 AM mjp1111 said this in Post #1983
I keep getting this emailed to me - I think it is due to using spells or potions -

Invalid SQL: SELECT items_user.item5,items_user.itid5,items.type,items .extra FROM items_user
LEFT JOIN items ON items.itemid=items_user.itid5
WHERE userid='10'
mysql error: Unknown column 'items_user.item5' in 'field list'

mysql error number: 1054



At any time did you switch an item category from personal to public or vice versa? Do you recall any changes you made to the item categories before this happened? An easy solution would be to add those columns back to the items_user table, but I would rather figure out why this happened.



I don't think I switched categories. The only new categories were shops created by users.

I changed the battle type - I have narrowed it down - it is the Spells that don't work. I changed the items to Potions and it worked fine, but whenever I select Spells, everything just dies.

What file is that database error coming from? Also, do you have a link to your forums so that I can see the IDs of the item categories?

What happens when you change the spell category to something other than spells? Does the error still occur?

Wait, before answering those questions, try the following:

In battlefight.php, find:
PHP Code:

$itemcats $DB_site->query("SELECT id, battletype FROM items_cats ORDER BY battletype"); 

and REPLACE it with:
PHP Code:

$itemcats $DB_site->query("SELECT id, battletype FROM items_cats WHERE type = 0 ORDER BY battletype"); 

Let me know if that doesn't work.

Quote:

Today at 07:44 AM mjp1111 said this in Post #1986
This thing is also bugging me - battles are working fine apart from the spells thing as per last post, I've updated stats repeatedly, but postbit info shows up as -

RPG name: N/A
Level: 2 Alignment:
Race: HP: /206 Alive
Not in battle.
Check Stats :---

i.e. RPG name, X/206 HP and :--- all refuse to show up - any ideas?

I think the edits to showthread.php did not properly execute. Give me your showthread.php and I will fix it. Also, try running DB Fix.

mjp1111 07-15-2003 12:52 PM

That fixed the spells!

<edited to comply with forum rules>

mjp1111 07-15-2003 12:53 PM

DBFix didn't fix it.

Bitsys 07-15-2003 01:36 PM

Quote:

Today at 08:53 AM mjp1111 said this in Post #1989
DBFix didn't fix it.

In showthread.php, find:
PHP Code:

$totalcats $DB_site->query_first("SELECT COUNT(*) FROM items_cats WHERE type='0'");
$posts=$DB_site->query("
SELECT
post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,"
.iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
attachment.attachmentid,attachment.filename,attachment.visible AS attachmentvisible,attachment.counter
"
.iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM post, battle_options, items_options
"
.iif($forum[allowicons],'LEFT JOIN icon ON icon.iconid=post.iconid','')."
LEFT JOIN user ON user.userid=post.userid
LEFT JOIN userfield ON userfield.userid=user.userid
LEFT JOIN items_user ON items_user.userid=user.userid
LEFT JOIN battle_stats ON battle_stats.userid=user.userid
LEFT JOIN rpg_classf ON rpg_classf.id=user.rpgclass
LEFT JOIN rpg_classm ON rpg_classm.id=user.rpgclass
LEFT JOIN rpg_element ON rpg_element.elementid=user.element
LEFT JOIN rpg_race ON rpg_race.raceid=user.rpgrace AND rpg_race.alignmentid=user.alignment
"
.iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid"
,"")."
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE 
$postids
ORDER BY dateline 
$postorder
"
); 

and REPLACE with:
PHP Code:

$totalcats $DB_site->query_first("SELECT COUNT(*) FROM items_cats WHERE type='0'");
$posts=$DB_site->query("
SELECT
post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,"
.iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
attachment.attachmentid,attachment.filename,attachment.visible AS attachmentvisible,attachment.counter,
user.ma AS uma,user.hp AS uhp,user.pp AS upp,user.ap AS uap,items_options.pointfield,items_options.lesanestore,battle_options.namefield,battle_options.exprate,battle_options.privacy AS battleprivacy,items_user.*,battle_stats.*,rpg_race.name AS rpgracename,rpg_race.alignment AS rpgalignmentname,rpg_classf.name AS fclassname,
rpg_classf.folder AS fclassfolder,rpg_classm.name AS mclassname,rpg_classm.folder AS mclassfolder,rpg_element.name AS elename
"
.iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
FROM post, battle_options, items_options
"
.iif($forum[allowicons],'LEFT JOIN icon ON icon.iconid=post.iconid','')."
LEFT JOIN user ON user.userid=post.userid
LEFT JOIN userfield ON userfield.userid=user.userid
LEFT JOIN items_user ON items_user.userid=user.userid
LEFT JOIN battle_stats ON battle_stats.userid=user.userid
LEFT JOIN rpg_classf ON rpg_classf.id=user.rpgclass
LEFT JOIN rpg_classm ON rpg_classm.id=user.rpgclass
LEFT JOIN rpg_element ON rpg_element.elementid=user.element
LEFT JOIN rpg_race ON rpg_race.raceid=user.rpgrace AND rpg_race.alignmentid=user.alignment
"
.iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid"
,"")."
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE 
$postids
ORDER BY dateline 
$postorder
"
); 

Also, it is against the rules to post the contents of a vbulletin file. When I said "send it to me", I meant send it in a PM.

mjp1111 07-15-2003 01:51 PM

OK - sorry - I'll edit my post and remove it.

Thanks too - very much appreciated.

mjp1111 07-15-2003 01:57 PM

Drat - it didn't do anything.

Bitsys 07-15-2003 02:02 PM

Quote:

Today at 09:57 AM mjp1111 said this in Post #1992
Drat - it didn't do anything.
Got a link to your forums so that I can see?

mjp1111 07-15-2003 02:10 PM

Sure - forum is at http://www.ffx2.com/vbulletin/ or jump straight to a post here http://www.ffx2.com/vbulletin/showth...hp?threadid=28


All times are GMT. The time now is 04:00 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.04287 seconds
  • Memory Usage 2,065KB
  • 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
  • (3)bbcode_code_printable
  • (10)bbcode_php_printable
  • (26)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