Warning: preg_replace_callback(): Requires argument 2, '$func['entity_fix']('\2')', to be a valid callback in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
Jewelry & Tattoo Monster Bugs
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 21, 2019, 10:10:14 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Jewelry & Tattoo Monster Bugs  (Read 2826 times)
0 Members and 1 Guest are viewing this topic.
Enhas
Militia
**
Offline Offline

Posts: 18


View Profile
« on: December 19, 2011, 11:08:56 AM »

I've been digging through the code and have discovered that this module has never worked as intended, especially if you have all five jewelry pieces.

The problem is this:

Code:
if ($count == $session['user']['dragonkills'] || $count == 10){
$monhp = round($session['user']['maxhitpoints']+10)-$hpl;
$monatk = $session['user']['attack'] * 1.1;
$mondef = $session['user']['defense'] * 1.1;
}else{
$monhp = round($session['user']['maxhitpoints']+40)-$hpl;
$monatk = round($session['user']['attack']) * 1.2;
$mondef = round($session['user']['defense']) * 1.2;
}

The problem is that you can only get five jewelry pieces and not ten, so the first case is never used even though it should be, making jewelry basically completely useless.  With all five pieces (and a huge load of gems you'd have to spend to get them), the second case is still used which means its attack and defense aren't reduced at all, and it'll still have a lot of hitpoints.  Yes, all you get from spending hundreds of gems is having the Gorgon's hitpoints reduced by a mere 20 compared to your own (with the default setting of -12 hp per jewel)!  I've started playing again on the Classic Server (as Shwill), but after discovering this I'm likely to never buy any jewelry at all.

I think $count above was supposed to have been 5 and not 10.  If it was, then with five jewelry pieces the Gorgon would have its health reduced by 50 compared to your own, as well as 10% less attack and defense.  I've always wondered why the Gorgon never seems to get any easier compared to the Cerberus (Tattoo Monster), and this is why.  All that needs to be done is change one 10 to a 5.
« Last Edit: December 19, 2011, 12:27:23 PM by Enhas » Logged
Minato
Codemeister
****
Offline Offline

Posts: 271


Script not working? Just beat it!


View Profile WWW
« Reply #1 on: December 19, 2011, 11:16:21 AM »

If you are so sure the code should be edited (Not saying it needs it), in the future edit the file and attach it to the index post to this thread for others to use if they so choose.
« Last Edit: December 19, 2011, 12:14:47 PM by Minato » Logged

Enhas
Militia
**
Offline Offline

Posts: 18


View Profile
« Reply #2 on: December 19, 2011, 11:22:02 AM »

Okay then.  The file above is for 1.12, but for other versions all that needs to be changed is that one 10 to a 5.
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1752


View Profile
« Reply #3 on: December 19, 2011, 12:01:22 PM »

You're missing out the lines of code right above.

Code:
<?php
$count 
0;
if (
is_module_active("jeweler"))
$count get_module_pref("totalheld","jeweler");

if (
$session['user']['dragonkills'] <= get_module_setting("dk"))
$count+=get_module_setting("grace");

$hpl get_module_setting("hploss")*$count;

$count is 0
$count then becomes something between 0 - 5
$count then increases by a certain amount if condition is met.

Therefore $count can be more than just 5.

I don't understand why 10 though, just a lucky number? Maybe change that IF statement to:
Code:
if( $count > 4 )

I did notice a bug however. line 15.
Code:
"grac"=>"Add how many jewelry pieces as a 'grace' for low DK players?,int|2",

"grac" should be "grace".  Missing the letter 'e'.

Smiley
Logged

Check My Modules for the latest versions.
Enhas
Militia
**
Offline Offline

Posts: 18


View Profile
« Reply #4 on: December 19, 2011, 12:18:35 PM »

Ah, that's another bug.  All this time low DK players weren't getting the grace bonuses.  Thanks for spotting that!

Oh, and I didn't 'miss out' on those lines of code.  The problem is that you can not ever get ten jewelry pieces, so count in the if statement should not be 10.  I changed it to be >=5.

Both bugs are fixed and the module has been re-uploaded above.  I also fixed a small bug with the Tattoo Monster where its level wasn't being modified (also uploaded above):

Changed:

Code:
"creaturelevel"=>$session['user']['level']+1,

to:

Code:
"creaturelevel"=>$badguylevel,

This makes it so the checks to decrease its level by 1 if your level is low enough actually work now.
« Last Edit: December 19, 2011, 12:32:35 PM by Enhas » Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1752


View Profile
« Reply #5 on: December 19, 2011, 12:36:29 PM »

I didn't mean you missed them, just that you didn't take them into account.

No you can't get more than 5 pieces, but $count can still be more than 5 (yes even become 10) if the condition is met.
Logged

Check My Modules for the latest versions.
Enhas
Militia
**
Offline Offline

Posts: 18


View Profile
« Reply #6 on: December 19, 2011, 12:45:14 PM »

Yeah, but only through the grace setting, which is meant to give fake pieces to low DK players to help them (and not many, only 2 by default).  And up until now, that setting hasn't even worked because of that typo.

My point is that if you somehow have all five pieces (which you'd only have after getting many, many gems and likely also have many DKs as well), the Gorgon should become easier (not just 20 hp below you).  There's no point in buying all the jewelry otherwise.  $count is definitely a bug here.

The only way you could get a count 10 or above is if the grace setting is set to 10+ (which would only help until you pass the DK limit), or if the grace setting is set to 5-9.  That way, you'd still have to buy 1-5 of the jewelry, but again it'd only be useful until you pass the DK limit and it's basically impossible to get enough gems to do so in that time.  And once you pass the DK limit, you're at a disadvantage and there's no way to get your count back up to 10+.  This is why I changed it to be >=5, so you're actually rewarded for getting all the jewelry like I'm sure you were intended to be.

Hope you understood that. Sad
« Last Edit: December 19, 2011, 12:53:15 PM by Enhas » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
73 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search