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:
Find this:
Replace with:
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:
Under that, put:
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:
Under that, put:
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:
Find this:
Replace with:
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:
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:
$personalities = array('personality1', 'personality2', 'personality3');
shuffle($personalities);
foreach ($personalities as $personality) {
$adoptablepersonality = "$personality";
}
PHP:
$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));
PHP:
$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:
$personalities = array('personality1', 'personality2', 'personality3');
shuffle($personalities);
foreach ($personalities as $personality) {
$adoptablepersonality = "$personality";
}
PHP:
$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:
$personalities = array('personality1', 'personality2', 'personality3');
shuffle($personalities);
foreach ($personalities as $personality) {
$adoptablepersonality = "$personality";
}
PHP:
$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:
$personalities = array('personality1', 'personality2', 'personality3');
shuffle($personalities);
foreach ($personalities as $personality) {
$adoptablepersonality = "$personality";
}
PHP:
$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));
PHP:
$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: