DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • April 20, 2018, 11:08:29 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Poll
Question: What do you think?
Excellent - 9 (90%)
Good - 1 (10%)
Average - 0 (0%)
Bad - 0 (0%)
Poor - 0 (0%)
Total Voters: 9

Pages: [1] 2   Go Down
  Print  
Author Topic: Pet Shop v4.0.1 (Modified)  (Read 11361 times)
0 Members and 1 Guest are viewing this topic.
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1744


View Profile
« on: May 04, 2009, 08:06:14 PM »

Pet Shop v4.0.1

This is a heavily modified version of the module 'petshop v3.81 by Eth. It also uses modified code from the module 'wildpets' v2.1 by Eth, and contains the pets from the modules 'wildpets' and 'extrapets' v1.2 by Eth.

Changes:
  • I've separated the module into smaller files.
  • I've made use of allprefs to store the player's pet data. The player's pet data can be easily edited with the allprefs editor.
  • Fixed bugs and improved the code.
  • Added a breed age limit setting. Once a pet reaches this there's a chance of death.
  • Added a shop owner's name and changeable breed category settings.
  • If you find a wild pet in the forest/travelling and already have a pet, you can swap.
  • Pets that can attack can have their buffs renewed with a 'pet checkup'. Just like feeding your mount. A setting sets how many checkups per day a pet can get.
  • A forest/travelling event can have your pet find something which it will then go on to swallow. When this happens, any buff it had will no longer work and a checkup is required.
  • The editor is revamped.
  • The link to install the 'contained' pets will appear if in the editor you view an empty category.
  • Made some changes to the 'pets' table structure, renamed some columns, added a few and dropped one.

Update:
10/05/09 - v4.0.1
+ Improvements to update code and elsewhere.
+ New page to show list of players with pets. Admin link in player's bio to pet editor.
+ Fixed a bug that tried to take money from you for a gift. Thanks Aura. Smiley

A clean install should be fine.

To update from 'petshop' v3.81, just simply upload the new files to the server, and the update should happen automatically once it's detected that the files are different.

However....

Before installing, please backup your 'pets' table!

If you wish to see it in action, then check out my sig. Feel free to send a petition asking for a demonstration pet. Smiley

Feedback, bugs, questions welcomed. Smiley

Zip file attached.
« Last Edit: August 04, 2009, 04:23:11 PM by Afkamm » Logged

Check My Modules for the latest versions.
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1744


View Profile
« Reply #1 on: May 10, 2009, 08:54:33 AM »

New version now available. Give it a try and tell me what you think. Smiley

kaizerDRAGON, found a bug in "modules/petshop/run/case_finalbuy.php", a missing comma. Fixed and uploaded under the same version. v4.0.1
« Last Edit: May 12, 2009, 04:14:09 PM by Afkamm » Logged

Check My Modules for the latest versions.
jerry
Captain of the Guard
***
Offline Offline

Posts: 159



View Profile
« Reply #2 on: August 24, 2009, 05:43:08 AM »

Small Change that'd be useful (for my server, it is)

modules/petshop/run/case_viewpets.php
Find: addnav("View Pets");
Code:
addnav('View Pets');
if( !empty($count_cats) )
{
foreach( $categories as $key => $value )
{
$sql = "SELECT petid from `pets` WHERE petcat = '$key' AND ( petrace = '{$session['user']['race']}' OR petrace = 'All' ) AND petdk <= '{$session['user']['dragonkills']}'";
$result = db_query($sql);
$count = db_num_rows($result);
if ($count > 0){
addnav(array('%s',$value),'runmodule.php?module=petshop&op=viewpets&cat='.$key);
}
}
}

This will only display the category if the cat contains the requirements set when a pet has been created. Race + Dk. otherwise, like i had.... over 15 categories, half of the cats were blank for players since they didn't meet the DK/Race requirement for all the pets in some cat. So they had to annoyingly click trough all many cats.
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1744


View Profile
« Reply #3 on: August 24, 2009, 06:11:36 AM »

Maybe it would be better to add a DK and Race column to the table so they can see all pets, even ones that they can't have?
Logged

Check My Modules for the latest versions.
jerry
Captain of the Guard
***
Offline Offline

Posts: 159



View Profile
« Reply #4 on: August 24, 2009, 06:18:58 AM »

yes, actually that would be better ^^ also, instead of not displaying the nav, what we can do is

addnav("Pet Name","");
then the player will know they can't have that pet because of X reason.
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1744


View Profile
« Reply #5 on: August 24, 2009, 06:28:19 AM »

Should a player be able to gift a pet even though they themselves don't met the requirements to buy it?

I think so, might add that in. Smiley

The reason it is the way it is at the moment was because I thought it best to have new pets appear to them as they progressed through the game. But maybe seeing pets they can't yet have will encourage the player to work for them more?

Or I could make it more like the stables. Show all the pets in a book, but only make available the pets that the player can actually have at that moment in time?
« Last Edit: August 24, 2009, 06:39:57 AM by Afkamm » Logged

Check My Modules for the latest versions.
jerry
Captain of the Guard
***
Offline Offline

Posts: 159



View Profile
« Reply #6 on: August 24, 2009, 06:48:53 AM »

The reason i switched to this module from stables (completely blocked on my server) is its much easier to add + more user friendly. Making it more like the stables would make this module useless Wink

Could we perhaps add a extra 10% to the price if a player wants to gift? That's what i've modded Cheesy since we have cheaters here too. Making alts >.>

15 cats
143 pets Wink
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1744


View Profile
« Reply #7 on: August 24, 2009, 07:07:29 AM »

The buff section when editing a mount is more advanced then with the pets. When I was making the changes I still wanted pets to be secondary to mounts and therefore "not as powerful".

The next version has code that allows your pet to emote for role playing purposes. Smiley
Logged

Check My Modules for the latest versions.
sephy mccaw
Member

Offline Offline

Posts: 3


View Profile
« Reply #8 on: June 30, 2011, 02:49:02 AM »

I have found a problem with this module.

When trying to gift a pet and the user has more then the dk requirment, it still says the user fails to meet that requirment.

Any help appreciated
Sephy McCaw
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1744


View Profile
« Reply #9 on: June 30, 2011, 02:00:03 PM »

Does the pet have a race requirement?
Logged

Check My Modules for the latest versions.
sephy mccaw
Member

Offline Offline

Posts: 3


View Profile
« Reply #10 on: July 01, 2011, 03:46:44 AM »

Nope, the pets are available to all races on the server, have tried setting it to no race and to seperate ones, they all say that the user failed the DK requirment even with pets that require 0 DKs to gift
Logged
RaynDarren
Mod God
*****
Offline Offline

Posts: 732


View Profile WWW
« Reply #11 on: January 03, 2012, 02:14:33 AM »

Forgive me for bringing up an old topic, but, 3 things....

1. I LOVE this new version!! GREAT job Marc!
2. It would be great to have a setting to allow a catagory to not be available for purchase by the general public.
3. Did the gift thing ever get fixed?

Thanks!
~Rayn
Logged

MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1744


View Profile
« Reply #12 on: January 03, 2012, 03:44:02 AM »

My sincerest apologies. I had fixed the gifting a pet bug back in April 2010, but because I was in the middle of making changes to the module, changes I never got around to finishing, the new version was never uploaded. Sad

To fix the bug.

Code:
#
#-----[ OPEN ]-----
#
root/modules/petshop/run/case_giftpet.php

#
#-----[ FIND ]-----
#
# Line: 77
$dkreq = translate_inline('DK Requirement');

#
#-----[ REPLACE WITH ]
#
$dkrequire = translate_inline('DK Requirement');

#
#-----[ FIND ]-----
#
# Line: 83
<td align=\"center\">$dkreq</td>

#
#-----[ REPLACE WITH ]
#
<td align=\"center\">$dkrequire</td>

#
#-----[ SAVE ]-----
#

The only other bug that was fixed had to to do with the 'clues' module.
Code:
#
#-----[ OPEN ]-----
#
root/modules/petshop/run/case_.php

#
#-----[ FIND ]-----
#
if( httpget('loc') == 'village' )
{

#
#-----[ AFTER, ADD ]
#
httpset('op','entershop',TRUE); // For clues module.

#
#-----[ SAVE ]-----
#

I'll need to check over the version I was working on to fix/finish parts before I can upload it.

Rayn, thanks for the compliment. :-) There is a fixed category called storage which is where you can move pets when you don't want them to be purchased and or for testing the pets. Only superusers with the developer flag can see this category. :-)
Logged

Check My Modules for the latest versions.
RaynDarren
Mod God
*****
Offline Offline

Posts: 732


View Profile WWW
« Reply #13 on: January 03, 2012, 04:23:22 AM »

Ah wonderful! Thanks soooo much!
« Last Edit: January 04, 2012, 10:14:53 PM by RaynDarren » Logged

RaynDarren
Mod God
*****
Offline Offline

Posts: 732


View Profile WWW
« Reply #14 on: January 04, 2012, 10:19:57 PM »

Forgive the double post, but I found a bug and wanted it to be noticed.... and I have a question Smiley

First the bug:
The (editor) display table is not showing the "Attacks" field correctly. No matter what it is set to it still shows 'No'.

Now the question:
I'd love to have the default (when entering the editor) be a listing of all the pets. 

lines 229-231:
{   // Failsafe.
            addnav('Display Common',$from.'&op2=view&cat=0');
         }
What would I change the cat= to?

Thanks!
~Rayn
Logged

Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

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