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 07-02-2014, 05:11 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,807
Hwona is on a distinguished road
Default Personality System

Please save back ups before using this modification!

How to make a random-generating personality system


1. Go to the "owned_adoptables" table in your database(PHPMyadmin). Click the "structure" tab at the top of the page. When it brings you to the next page, scroll down until you see this:

Press "Go".
You'll be brought to this:

Set the values to match the example above and press "Save".

2. Go to the "adopt.php" file and find this:
$gender = $adopt->getGender();
Under that, put:
PHP Code:
 $personalities = array('personality1''personality2''personality3');
           
shuffle($personalities);
foreach (
$personalities as $personality) {
    
$adoptablepersonality "$personality";

Find this:
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 with:
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'"personality" => $adoptablepersonality"gender" => $gender"lastbred" => 0)); 
3. Go to the "breeding.php" file and find this:
$offspringID = $mysidia->db->select("owned_adoptables", array("aid"), "1 ORDER BY aid DESC LIMIT 1")->fetchColumn() - $num + 1;
Under that, put:
PHP Code:
 $personalities = array('personality1''personality2''personality3');
           
shuffle($personalities);
foreach (
$personalities as $personality) {
    
$adoptablepersonality "$personality";

Under that, put:
PHP Code:
 $mysidia->db->update("owned_adoptables",array("personality" => $adoptablepersonality),"aid = $offspringID"); 
4. Go to the "shop.php" file and find this:
$adoptid = $mysidia->db->select("owned_adoptables", array("aid"), "1 ORDER BY aid DESC LIMIT 1")->fetchColumn() - $num + 1;
Under that, add:
PHP Code:
 $personalities = array('personality1''personality2''personality3');
           
shuffle($personalities);
foreach (
$personalities as $personality) {
    
$adoptablepersonality "$personality";

Under that, put:
PHP Code:
$mysidia->db->update("owned_adoptables",array("personality" => $adoptablepersonality),"aid = $adoptid"); 
5. Go to your "class_promocode.php" file(in the "classes" folder) and find this(in the "execute" function):
switch($this->type){
case "Adopt":
Below that, add:
PHP Code:
$personalities = array('personality1''personality2''personality3');
           
shuffle($personalities);
foreach (
$personalities as $personality) {
    
$adoptablepersonality "$personality";

Find this:
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 with:
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"personality" => $adoptablepersonality, )); 
6. Go back to the "adopt.php" file.
Under this:
Add:
$mysidia->db->update("owned_adoptables",array("personality" =>"personality4"),"aid = $adoptid");
Go to your site's ACP and create a free adopt-page adopt. Adopt that pet once. Delete the adopted pet and the species. Then, go back to the "adopt.php" file and delete the code you just added


Done!
If you want to display the personality on the levelup page:
__________________

Last edited by Hwona; 07-02-2014 at 05:25 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
Pets with Personality? Kyttias Suggestions and Feature Requests 24 07-04-2014 03:03 PM
Anyone Want to Have a Stat System Hwona Feedback and Suggestions 12 06-30-2014 09:30 AM
Abandon system bokkun Mys v1.1.x Mods 30 11-16-2010 10:19 PM
Trade System? SieghartZeke Questions and Supports 1 12-28-2009 07:06 AM
Evolution system? Hall of Famer Questions and Supports 10 11-05-2009 05:54 PM


All times are GMT -5. The time now is 03:25 PM.

Currently Active Users: 9280 (0 members and 9280 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