Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > RPG Integration Hack
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Bug or install error? Details »»
Bug or install error?
Version: , by Cyricx Cyricx is offline
Developer Last Online: Dec 2011 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-16-2005 Last Update: Never Installs: 0
 
No support by the author.

I've got a problem that I think is a bug due to everything else going perfect for the install.

Basically, if you make like certain armor or weapons usable by only one class type.

Someone can edit their character to that class, buy those items and then change their class to whatever else they want and they will still keep the items.

For example, if you made a plate armor that only warriors could use and mages could only use robes.

The mage player could edit their character to a warrior, buy the plate armor and then edit their character back to a mage and they'd keep the plate armor on :dead:

I haven't seen anything about this posted except for one person that hinted at having found a major bug but hasn't seen a thread about it.

Thinking this is the one he was referring too...

Any ideas on how to fix it?

Show Your Support

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

Comments
  #12  
Old 02-26-2005, 03:28 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Armor (please note the difference between Armor and Shield type) are currently not being prohibited, yes.
The fix is hassle to test, so I didn't, but you feel free to test it for me.

File: battleupdate.php
Find (BOTH instances of):
PHP Code:
                    rpgrace
Add BELOW:
PHP Code:
                    rpgtype
Find:
PHP Code:
                    $defense $DB_site->query_first("SELECT damage FROM " TABLE_PREFIX "rpg_items WHERE itemid='$opparmor[id]'");
                    if (
$defense['damage'] > 0
                    {
                        
$armor $armor $defense['damage'];
                    } 
Replace with:
PHP Code:
                    $defense $DB_site->query_first("SELECT damage, type FROM " TABLE_PREFIX "rpg_items WHERE itemid='$opparmor[id]'");
                    if (
$defense['damage'] > 0
                    {
                        
$opparmortype explode(' '$defense['type']);
                        if (
in_array($opponent['rpgtype'], $opparmortype))
                        {
                            
$armor $armor $defense['damage'];
                        }
                    } 
IMPORTANT: To test this fix, do the following BEFORE doing the above:
  1. Set $battledebug to 1 in battleupdate.php
  2. Make yourself have armor your not supposed to have
  3. Let both combatants have weapons they ARE supposed to have
  4. Let your opponent attack you (thus having your illegal armor reduce the damage
  5. Note down the second last Debug Variable under Damage Done
  6. Apply the fix
  7. Upload the file
  8. Let your opponent attack you (thus in theory having the armor not count)
  9. Compare the second last Debug Variable under Damage Done to the value you saw before
If the fix worked, the Armor should have no effect.

PS: I will add an error message like the "your weapon is for a different class" in v3.

Thanks for helping me make this hack better


//peace
Reply With Quote
  #13  
Old 02-28-2005, 04:59 PM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope, didn't do the trick, didn't get an error or anything, but the debugs stayed the same.

Before the fix -

Debug Variables:
Anger ($anger): 1
Hit Chance ($hitchance): 0.49279003035213
Random Number ($randnum): 35
Regular Attack Bonus ($regattbonus): 6.0456592223288
Regular Defense Minus ($regdefminus): 3.145988105131
Damage Done ($damagedone): -1 == [floor((28 + 6.0456592223288) * 0.5 * 1 + 0 - 14 - 3.145988105131)]
Random Mad ($randmad): 10

After the fix -
Debug Variables:
Anger ($anger): 1
Hit Chance ($hitchance): 0.49279003035213
Random Number ($randnum): 22
Regular Attack Bonus ($regattbonus): 6.0456592223288
Regular Defense Minus ($regdefminus): 3.145988105131
Damage Done ($damagedone): -1 == [floor((28 + 6.0456592223288) * 0.5 * 1 + 0 - 14 - 3.145988105131)]
Random Mad ($randmad): 8
Reply With Quote
  #14  
Old 02-28-2005, 07:36 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Goddamit!
Ok guess I have tomorrow's work cut out for me then
I'll either edit this post or make a new reply
because Im gonna fuggen do this even if it's the last thing I do!
Reply With Quote
  #15  
Old 03-01-2005, 01:12 AM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hehe, I'll happily test out anything you need bro

I can add in hacks like crazy, but when it comes to writting arrays and explode and all that my mind fragments into a trillion pieces
Reply With Quote
  #16  
Old 03-01-2005, 03:17 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I can say that the fix works.
I just applied it, and here's the results:

BEFORE the fix:
Damage Done ($damagedone): 166 == [floor((82 + 839.48094618951) * 1 * 1 + 0 - 0 - 756.75105588525)]


AFTER the fix:
Damage Done ($damagedone): 109 == [floor((82 + 839.48094618951) * 1 * 1 + 0 - 54 - 756.75105588525)]

And 54 IS indeed the buff value I set the Armor I tested it with to be.
Reply With Quote
  #17  
Old 03-01-2005, 04:13 PM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll double check my values on test. See if I can find out what I did wrong incase someone else repeats my mistake.
Reply With Quote
Reply


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

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

Forum Jump


All times are GMT. The time now is 02:09 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.04105 seconds
  • Memory Usage 2,279KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

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

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