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)

lioncool1589 06-25-2003 02:19 AM

i checked 3 times already nothing wrong in battle.php

Darkwaltz4 06-25-2003 06:50 PM

why dont you pm me your battle.php file and ill find whats wrong with it for you?

lioncool1589 06-26-2003 07:56 AM

Darkwaltz4 ur midi work fine now i fixed the problems thx for ur help

Darkwaltz4 06-26-2003 04:17 PM

whoops, yeah thats the 'original' line of code :-p sorry, ill fix that in the file, thanks ;)

Bitsys 06-26-2003 06:04 PM

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 :)

Bitsys 06-27-2003 01:35 AM

Quote:

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

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


What are the IDs for the Paladin and Holy types?

SmEdD 06-27-2003 05:55 AM

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.

Bitsys 06-27-2003 01:41 PM

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.

lioncool1589 06-28-2003 01:04 AM

nvm i fixed

SmEdD 06-28-2003 03:35 AM

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

Darkwaltz4 06-28-2003 06:53 AM

why not just

PHP Code:

if($showlevel >=and $showlevel <= 10){ 
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'"); 
        } 


kaotic 06-28-2003 07:00 AM

So...

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 >=and $showlevel <= 10){ 
                
$DB_site->query("UPDATE user SET hp=maxhp WHERE userid='$bbuserinfo[userid]'"); 
        } 

...would automatically heal users that are level 10 (and under) after a battle ends?

SmEdD 06-28-2003 04:23 PM

I'm still a n00b to php but thanks.

And yes it would kaotic

SmEdD 06-28-2003 04:57 PM

Actually better yet a admin area on to set the level.

This is not tested but it should work. And I am working on the healing center to so if they some how are hurt before battle they may heal up there to.

Also you edit it in the Edit Options under battle

kaotic 06-28-2003 05:51 PM

Another add-on. :D Thanks. I'll test it out now.

Question: Is there an easy way to remove the forced confirmation at the end of battles? Sometimes when a member loses, he or she likes to ignore the ending confirmation to upset or agitate the winner.

Bitsys 06-28-2003 10:02 PM

Quote:

Today at 01:51 PM kaotic said this in Post #1924
Another add-on. :D Thanks. I'll test it out now.

Question: Is there an easy way to remove the forced confirmation at the end of battles? Sometimes when a member loses, he or she likes to ignore the ending confirmation to upset or agitate the winner.


The winner should be able to join another battle as long as they have confirmed the end of the last one, regardless of the confirmation of the other combatants.

kaotic 06-28-2003 10:25 PM

Strange. One of them was telling me that he couldn't join another battle because it was invalid. I just assumed it was because of his opponent not confirming.

Bitsys 06-28-2003 11:32 PM

Quote:

Today at 06:25 PM kaotic said this in Post #1926
Strange. One of them was telling me that he couldn't join another battle because it was invalid. I just assumed it was because of his opponent not confirming.

If he tries to join another battle after completing a previous one and gets the "You are already in battle." message, then that is not supposed to happen. However, the invalid battle message is displayed when a battle has not started or already ended. So, I am not sure what to make of it.

PixelFx 06-29-2003 06:09 AM

anyone thought much of what it would take to make a PvM / PvT(player versions monster / tom bot) systems for the battle system?

Maybe use a version of the tom bot AI as a monster AI or other :P just some throughts, I can also help with monster art other.

I'm also working on a items shop addon, it's coming along nice :)

chrisz 06-29-2003 08:32 AM

When using fists can you miss?
And can you make the damage dealt vary?

Bitsys 06-29-2003 05:24 PM

Quote:

Today at 04:32 AM chrisz said this in Post #1929
When using fists can you miss?
And can you make the damage dealt vary?

Yes, you can miss and do damage to yourself. The damage should vary by +-25%. This may not be noticeable if your damage is below 10 though.

SmEdD 06-29-2003 08:08 PM

Umm problem with password logins. If there is no pass on the game it won't login. Donno why tho I can look into it if you want.

chrisz 06-29-2003 09:38 PM

How can I make it fists act as weapons.
I have a forum that does not use weapons just hand to hand combat.
Is this possible?

Bitsys 06-29-2003 10:40 PM

Quote:

Today at 04:08 PM SmEdD said this in Post #1931
Umm problem with password logins. If there is no pass on the game it won't login. Donno why tho I can look into it if you want.
Thanks, I think this will be fixed in the next version.

Quote:

Today at 05:38 PM chrisz said this in Post #1932
How can I make it fists act as weapons.
I have a forum that does not use weapons just hand to hand combat.
Is this possible?


Could you explain a little more about what you want to do? I am not sure I completely understand.

chrisz 06-30-2003 02:51 AM

Well make it so when you hit armour it still does damage instead of hurting yourself.
Or if not just how do I edit the damage (where) and where I edit the % you hit.

SmEdD 06-30-2003 05:02 AM

Quote:

Yesterday at 11:51 PM chrisz said this in Post #1934
Well make it so when you hit armour it still does damage instead of hurting yourself.
Or if not just how do I edit the damage (where) and where I edit the % you hit.


Look in the admin options and raise the buff number.

chrisz 06-30-2003 05:40 AM

For punching duh.
I am not that stupid.

SmEdD 06-30-2003 03:36 PM

Alright you should maybe read it again. Attack/Defence. Try reading ++++ before acting gay to people who try to help you.

Darkwaltz4 07-01-2003 06:06 AM

Quote:

06-29-03 at 06:40 PM Bitsys said this in Post #1933
Thanks, I think this will be fixed in the next version.

hmm, that reminds me, i fixed that myself too :-p first i made the password fields type="password" and then i rewrote the pass checking thing to reject any games without a password....not sure why it was doin it *shrugs*

chrisz 07-01-2003 06:52 AM

Hey ED, soz bout that my bro typed it.
I checked it and its not what i mean.
Thanks anyways.

Bitsys 07-01-2003 02:02 PM

Quote:

06-29-03 at 10:51 PM chrisz said this in Post #1934
Well make it so when you hit armour it still does damage instead of hurting yourself.
Or if not just how do I edit the damage (where) and where I edit the % you hit.


At the top of battleupdate.php, you will see:
PHP Code:

// formula for calculating the amount of damage done by fists
function cal_fists($level) {
        return 
floor(log10($level) * 30 rand(-(int)($level .15), (int)($level .15))) + 1;


You can change that formula to adjust the amount of damage done by fists.

There is a 50% chance that you will hurt yourself if the opponent is wearing armor.


I am out of town for 10 days starting tomorrow. If you have any questions or problems, post them here and someone will probably be able to help you. If not, I will do my best to answer questions when I get back.

See you when I get back :)

Ciufs 07-01-2003 05:47 PM

Hi all... i want to try to dev this hack in D&D version... with its rules

anyone want help me?

PS: sorry for my bad english

Airs 07-01-2003 07:28 PM

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

Darkwaltz4 07-02-2003 05:55 AM

umm...well i posted an attempted fix which i never tried, but supposedly it didnt work, as for the 'default' view in the itemshop, you can do two things:

first, set all links to the itemshop as itemshop.php?itemtype=$bbuserinfo[rpgtype]

and then first find the TYPE ID of your generic items that you have, and then find in itemshop.php (i dont have the file but i know it is in there)

something like $itemtype = 0;

it should be in the code which checks if itemtype is set...change the 0 to the generic type id.

i myself did a added a new rpg type to which NO classes were applied to, and called it 'Certain Type'

then i applied all the items to show up in this type....so basically, i now had an itemshop which had all the items in it to view, a combination itemshop, for everyone to see :-p and then it would say in the purchase area, 'You must be a Certain Type to purchase' catch my drift? well that type happened to have an id of 5, which i applied to itemshop.php, and now....even if you are not registered, you will see my combination itemshop :-p check it out::

http://forums.ffgon.com/itemshop.php

chrisz 07-02-2003 06:09 AM

I dont get the formula can someone explain >_<"

kaotic 07-02-2003 08:53 PM

Wow... so what exactly did you do to put up the 'specific type' warning when purchasing an item? Or is that private information? :p

Mijae 07-03-2003 02:46 AM

HUGE Money bug:

Quote:

Alright, after thorough testing with ****** you'll notice our bank accounts are extremely high? why? We/I found the bug. I wouldn't have been on the right track if it weren't for him.

Basically when you challenge a person for a battle you can bet all the money you have.

Then you go back and cancel the battle. At this point the BANK account will add the account money on hand for some reason. This happens to both players. Doubling the amount on hand for the original battler. And adding the equiv to the opponent. And there ya go.
Anyone want to release a quick fix? My members are having way too much fun with this :P

Darkwaltz4 07-03-2003 06:50 AM

Quote:

Yesterday at 04:53 PM kaotic said this in Post #1948
Wow... so what exactly did you do to put up the 'specific type' warning when purchasing an item? Or is that private information? :p

i just said what i did :-p i created a type to which i put no classes on, and called it 'Certain Type' mainly so that i could create a nice illusion. if ur in a 'wrong' itemshop, it would normally give you this (say you were a magician type and was in the warrior itemshop): You need to be a Warrior Type to purchase

see? so if i wanted a combo intemshop, then i needed something which nobody could *be*, and i could have it display for EVERYONE that a certain type was needed :-p i cant think of a better way to explain it...

lol, you alone shoul dbe able to experience my tinkering firsthand :-p

kaotic 07-03-2003 11:53 AM

Ohh, my bad. I didn't understand it at first, I suppose. I'll work with it now. :)

Spark 07-03-2003 05:55 PM

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?


All times are GMT. The time now is 11:02 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.02949 seconds
  • Memory Usage 1,923KB
  • 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
  • (14)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