Thread: Mys 1.3.3 Personality System
View Single Post
  #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,810
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