Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-29-2014, 12:55 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,797
Hwona is on a distinguished road
Default Stat/Skill System(Tested with V.1.3.3)

Please pardon my poor explanation skills, but here's a quick guide to creating random-generated stats for adoptables. Please save back ups before beginning as this works perfectly for my site but I don't know what may happen with yours. Hence, please don't unleash your anger on me if there is anything amiss. :3

This first post shall cover assigning stats to created adoptables.

1. Go to PHPMyAdmin->your site's database->prefix_owned_adoptables
Once there, there should be a "structure" tab at the top of the screen - click that and then scroll to the bottom of the page until you find:

Press go. Then you'll come to a page that looks like this:

There, set the values to match those in the example and press "save".

2. In the "adopt.php" file, there should be something like this from lines 29 to 32:
PHP Code:
            $name = (!$mysidia->input->post("name"))?$adopt->getType():$mysidia->input->post("name");
            
$alts $adopt->getAltStatus();
            
$code $adopt->getCode();
            
$gender $adopt->getGender(); 
Below that, add:
$statname = rand(minimum value,maximum value);
Then find this on lines 33 to 34:
PHP Code:
            $mysidia->db->insert("owned_adoptables", array("aid" => NULL"type" => $adopt->getType(), "name" => $name"owner" => $mysidia->user->username"currentlevel" => 0"totalclicks" => 0"code" => $code
                                                        
"imageurl" => NULL"usealternates" => $alts"tradestatus" => 'fortrade'"isfrozen" => 'no'"gender" => $gender"lastbred" => 0)); 
Replace that with (See what was changed?):
PHP Code:
            $mysidia->db->insert("owned_adoptables", array("aid" => NULL"type" => $adopt->getType(), "name" => $name"statname" => $statname"owner" => $mysidia->user->username"currentlevel" => 0"totalclicks" => 0"code" => $code
                                                        
"imageurl" => NULL"usealternates" => $alts"tradestatus" => 'fortrade'"isfrozen" => 'no'"gender" => $gender"lastbred" => 0)); 
3. Go to the "breeding.php" file and find this on line 52:
PHP Code:
 $offspringID $mysidia->db->select("owned_adoptables", array("aid"), "1 ORDER BY aid DESC LIMIT 1")->fetchColumn() - $num 1
Below that, add:
$statname = rand(minimum value,maximum value) ;
and
PHP Code:
$mysidia->db->update("owned_adoptables",array("statname" => $statname),"aid = $offspringID"); 
3. Go to the "shop.php" file. You should find this line on line 73:
elseif($mysidia->input->post("shoptype") == "adoptshop"){
Put this under that:
$statname = rand(minimum value,maximum value) ;
And put this under that:
PHP Code:
$mysidia->db->update("owned_adoptables",array("statname" => $statname),"aid = $offspringID"); 
4. Go to your "class_promocode.php" file in your "classes" folder. Find this piece of code:
PHP Code:
 $mysidia->db->insert("owned_adoptables", array("aid" => NULL"type" => $this->reward"name" => $this->reward"owner" => $this->user"currentlevel" => 0"totalclicks" => 0"code" => $code
                                                           
"imageurl" => NULL"usealternates" => 'no'"tradestatus" => 'fortrade'"isfrozen" => 'no'"gender" => $genders[$rand], "lastbred" => 0)); 
Replace it with:
$statname = rand(minimum value,maximum value) ;
Put this under that:
PHP Code:
 $mysidia->db->insert("owned_adoptables", array("aid" => NULL"type" => $this->reward"name" => $this->reward"owner" => $this->user"currentlevel" => 0"totalclicks" => 0"code" => $code
                                                           
"imageurl" => NULL"usealternates" => 'no'"tradestatus" => 'fortrade'"isfrozen" => 'no'"gender" => $genders[$rand], "lastbred" => 0"statname" => $statname)); 
5. Now, read carefully! IF there are existing adoptables on the site, go back to the "adopt.php" file. I couldn't figure out how to give adoptables that were created prior to the addition of the modification their own unique values, but I decided to set the existing adoptables' values to half of the maximum initial value. Right below the edits just made to that file, add:
$mysidia->db->update("owned_adoptables",array("statname" => "value"),"") ;
Once that is done, save all changes to the file but don't close it. After that, go to your site and create a quick free adoptable. Adopt that adoptable once. This will update all adoptables in the database to have the set stat.
Go back to the "adopt.php" file and delete what you just added or right-click and select "undo".

Tada! Please contact me or post in the thread if you have any questions! This includes adding extra stats. The next section shall cover how to display those stats on an adoptable's levelup page.
__________________

Last edited by Hwona; 07-02-2014 at 02:49 PM.
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trade System Kyttias Questions and Supports 4 05-29-2016 12:29 AM
Making v.1.3.3 Stat Mod Compatible with V.1.3.4 Hwona Questions and Supports 0 07-08-2014 01:37 PM
Stat Inheritance Mod * thanks to Wallie! * Missy Master Mys v1.3.x Mods 0 06-30-2014 02:23 PM
Anyone Want to Have a Stat System Hwona Feedback and Suggestions 12 06-30-2014 09:30 AM
Basic Stat System Hedgen Questions and Supports 3 03-10-2013 02:47 PM


All times are GMT -5. The time now is 12:14 PM.

Currently Active Users: 270 (0 members and 270 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636