Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2011, 02:00 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 487,024
Hall of Famer is on a distinguished road
Default Hall of Famer's Evolution Mod v1.2

Well its been a long time since the old evolution script for Mys v1.1 was designed. I eventually decided to make a new one, which has its codes completely rewritten compared to the old program. I've included an installer in order to make you guys/gals lives easier, it is also more flexible for admins to manage evolution lines through ACP.

So what are the differences between Evolution Mod v1.2 and the old script released for Mys v1.1:
1. The entire script is redesigned, with much more advanced PHP codes that I'd hardly recommend to absolute beginners. Of course, it optimizes site performance to a certain extent. Installation becomes much easier for Evolution system, as it was indeed a pain back in the old days.
2. The new script introduces a concept called Evolution Line, it can be rather useful for long series evolution line and multi-evolution outcome branches in future. Also adoptables can have a certain percentage of chance to evolve or not even when their evolution conditions are all met. Apparently the admins decide the difficulty for evolution to occur.
3. The old script inserts many columns into table prefix.adoptables and prefix.owned_adoptables, which causes fatal errors while upgrading Mys and incompatibility issues with other scripts. Evolution Mod v1.2, on the other hand, creates a new table and does not interfere with any existing tables. Incompatibility with other Mods should not be a problem this time.
4. The new script introduces different approaches of evolution system, compared to merely level-based evolution. The trade-based evolution will be made available soon, and item-based evolution will also become possible once Mys v1.3.0 is released to public. There is even possibility for Trade - Item evolution integration, and time-based evolution if you dont mind using Cronjobs.
5. Powerful Admin Control Panel for Evolution system. Admins can create, edit and delete an evolution line at will, the product itself can be turned off and on(simply enable/disable the plugin through ACP or PHPmyadmin). I've also provided a section called FAQs for users to read as manual, they should pretty much explain what you can do with Evolution Mod V1.2.


Alright, let us begin. First of all you need to add the following three functions to your inc/functions.php file. They can be placed anywhere, and Id recommend the very end of your script file:

PHP Code:
function pluginenabled($plug) {
$query "SELECT * FROM {$GLOBALS['prefix']}acp_hooks WHERE pluginname='{$plug}'";
$result mysql_query($query);
$row mysql_fetch_array($result);
  switch(
$row['pluginstatus']){
  case 
"1":
  
$plugin "enabled";
  break;
  default:
  
$plugin "disabled";
  }
return 
$plugin;  
}

function 
checkevolution($adopt$level$item$trade$gender){

$query "SELECT * FROM {$GLOBALS['prefix']}adoptables_evolution WHERE preevoform='{$adopt}'";
$result runquery($query);
$row mysql_fetch_array($result);
$randnum mt_rand(0,99);
switch(
$row['evotype']){
  case 
"level":
  
$canevolve = ($level >= $row['requiredlevel'] and $row['evochance'] > $randnum)?yes:no;
  break;
  case 
"item":
  
$canevolve = ($item == $row['requireditem'] and $row['evochance'] > $randnum)?yes:no;
  break;
  case 
"trade":
  
$canevolve = ($trade == "true" and $row['evochance'] > $randnum)?yes:no;
  break;
  default:
  
$canevolve "no";
}

// Check the gender restriction setting
if($row['requiredgender'] != "no" and $row['requiredgender'] != $gender){
$canevolve "no";
}
return 
$canevolve;

}

function 
execevolution($id$adopt){
$result runquery("SELECT * FROM {$GLOBALS['prefix']}adoptables_evolution WHERE preevoform='{$adopt}'");
$row mysql_fetch_array($result);
$result2 runquery("SELECT * FROM {$GLOBALS['prefix']}owned_adoptables WHERE aid='{$id}'");
$row2 mysql_fetch_array($result2);
// Update adoptables type to the evolution form
if($row2['type'] == $row2['name']){
runquery("UPDATE {$GLOBALS['prefix']}owned_adoptables SET name='{$row['postevoform']}' WHERE aid = '{$id}'");
}
runquery("UPDATE {$GLOBALS['prefix']}owned_adoptables SET type='{$row['postevoform']}' WHERE aid = '{$id}'");
$message "Congratulations! Your {$adopt} has successfully evolved into {$row['postevoform']}.";
return 
$message;
}
?> 
The next thing to do is to modify the level increment engine a little bit. Find the following line in your levelup.php:

PHP Code:
    runquery("UPDATE {$prefix}owned_adoptables SET currentlevel='{$nextlevel}' WHERE aid='{$id}'"); 
Add below:
PHP Code:
      if(pluginenabled("Evolution Mod v1.2 by Hall of Famer") == "enabled"){
        
$item "";
        
$trade "false";
        switch(
checkevolution($owned_adoptable['type'], $nextlevel$item$trade ,$owned_adoptable['gender'])){
          case 
"yes":
          
// Evolution Checkpoint passed, the process shall begin!
          
$message execevolution($owned_adoptable['aid'],$owned_adoptable['type']);
          
$evolution "true";
          break;
          default:
          
$message "evolution does not occur...";
          
$evolution "false";        
        }                  
      } 
This should pretty much do the job already. If you want to notice your users of their adoptables evolution, you may add this line to levelup.php too. Place it somewhere around line 150-160:

PHP Code:
    if($evolution == "true"){
    
$article_content $article_content "<div align='center'><br />Congratulations! Your adoptable {$owned_adoptable['name']} has evolved.</div>";
    } 
For those of you interested in Trade based Evolution system, simply copy/paste the following codes below to your redeem.php at around line 225:

PHP Code:
        // Trade Evolution Script Here:
        
if(pluginenabled("Evolution Mod v1.2 by Hall of Famer") == "enabled"){
        
$item "";
        
$trade "true";
        
$result5 runquery("SELECT * FROM {$prefix}owned_adoptables WHERE aid = '{$row['adoptabledesired']}'");
        
$adoptdesired mysql_fetch_array($result5);
        switch(
checkevolution($adoptdesired['type'], $adoptdesired['currentlevel'], $item$trade $adoptdesired['gender'])){
          case 
"yes":
          
// Evolution Checkpoint passed, the process shall begin!
          
$message execevolution($adoptdesired['aid'],$adoptdesired['type']);
          
$evolution "true";
          break;
          default:
          
$message "evolution does not occur...";
          
$evolution "false";        
        }                  
      } 
Similarly, the user can be notified of his/her adoptables evolution by adding the following lines to near the bottom of redeem.php:

PHP Code:
        if($evolution == "true"){
        
$article_content $article_content "<div align='center'><br />Congratulations! Your adoptable {$adoptdesired['name']} has evolved.</div>";
        } 
So we are done with script modification already, isnt it easy this time? Well you will still need to download the following two script files I've uploaded, and make sure to run install_evolution.php script so the new table prefix.adoptables_evolution will be added into your database. Now have fun everyone, I am a bit tired already since its 2AM...

Hall of Famer
Attached Files
File Type: php admin_evolution.php (12.4 KB, 25 views)
File Type: php install_evolution.php (1.2 KB, 22 views)
File Type: php levelup.php (6.4 KB, 11 views)
File Type: php redeem.php (14.6 KB, 18 views)
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #2  
Old 09-11-2011, 08:44 PM
sensacion sensacion is offline
Member
 
Join Date: Mar 2010
Posts: 24
Credits: 3,766
sensacion
Cool

This is exellent! I came a long time waiting thanks
Reply With Quote
  #3  
Old 09-11-2011, 08:53 PM
Nemesis's Avatar
Nemesis Nemesis is offline
Member
 
Join Date: Mar 2011
Location: Ohio, United States
Posts: 641
Gender: Male
Credits: 57,122
Nemesis is on a distinguished road
Default

will use too thanks.
__________________
https://gemnode.com
Free Hosting for Mysidia Adopt Sites
Just join our forum and request your free hosting account
Reply With Quote
  #4  
Old 09-11-2011, 10:17 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 487,024
Hall of Famer is on a distinguished road
Default

Thanks for the support, guys. I remember the old Evolution script was used by many users, it seems that most members here nowadays do not build pokemon sites anymore so they may not find it quite useful. Still, the idea of evolution can work out for any types of adoptables sites.

I removed functions.php from attachment since it is not compatible with Mys v1.2.4. I will reupload a new file later this week.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #5  
Old 12-27-2011, 05:03 AM
PokePets PokePets is offline
Premium Member
 
Join Date: Jun 2010
Posts: 228
Gender: Male
Credits: 22,445
PokePets
Default

I installed, but this;
Required Adoptables Gender:(Enter f or m if only female or male adoptables can evolve)

What do I have to insert when both gender can evolve? I can't leave it empty, I get an error.
It works when I insert no, that's okay then?

Last edited by PokePets; 12-27-2011 at 05:22 AM.
Reply With Quote
  #6  
Old 12-27-2011, 07:41 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 487,024
Hall of Famer is on a distinguished road
Default

Yes, you are supposed to enter 'no' for the fields do not apply.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #7  
Old 02-28-2012, 11:47 AM
Kesstryl's Avatar
Kesstryl Kesstryl is offline
Member
 
Join Date: Feb 2012
Posts: 125
Gender: Female
Credits: 21,340
Kesstryl is on a distinguished road
Default

Quote:
Originally Posted by Hall of Famer View Post
Thanks for the support, guys. I remember the old Evolution script was used by many users, it seems that most members here nowadays do not build pokemon sites anymore so they may not find it quite useful. Still, the idea of evolution can work out for any types of adoptables sites.
Are you kidding me? This is amazing!
Reply With Quote
  #8  
Old 02-28-2012, 12:23 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 487,024
Hall of Famer is on a distinguished road
Default

Thank you so much for saying that. I actually have a new version of the Evolution Mod for Mys v1.3.x, I plan to make it public a few days after the official release of Mys v1.3.0. The new version includes integration with item/itemshop, I may revise the old procedural codes into OOP if I have time. Right now there's no need to release a Mod for Mys v1.3.x since you cant use it on Mys v1.2.x sites.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #9  
Old 07-07-2012, 11:37 AM
quirkii's Avatar
quirkii quirkii is offline
Member
 
Join Date: Jul 2012
Posts: 11
Gender: Female
Credits: 4,843
quirkii is on a distinguished road
Default

Not sure if this is the right place to ask, but is item based evolution completed now with Mys V1.3.1? Or is it not ready yet as of now?:o (if it is I'm sorry I missed the thread><;) I'm planning on giving an online friend a promo item that will trigger a special stage for an adoptable, it's for her birthday.

If this function is not available as of now then I was thinking of a way to work around it; such as to set the amount of clicks required to an incredibly high number so that it can't be reached on a short term basis without the use of an item; or set an alternate image to have a really low probability (such as 1/5000) so that it usually can't be reached without the use of an item. Not sure if these methods will be safe or have any negative effects on a long term basis though:o (if there's anyone who can enlighten me, please do;w;)
Reply With Quote
  #10  
Old 07-08-2012, 03:48 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 487,024
Hall of Famer is on a distinguished road
Default

Well this script is not compatible with Mys v1.3.x yet. I plan to release a new version of the evolution script someday, probably in August.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply


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
^_^ Happy Birthday Hall Of Famer ^_^ Alaric Other Chat 10 05-23-2012 12:35 AM
Hall of Famer's HP system Hall of Famer Mys v1.1.x Mods 13 04-25-2012 08:08 AM
Hall of Famer's Gender Ratio Mod v1.2 Hall of Famer Mys v1.2.x Mods 45 04-02-2012 01:42 PM
New interview with Hall of Famer! cpvr Other Chat 6 03-08-2011 11:51 PM
Hall of Famer's gender ratio system Hall of Famer Mys v1.1.x Mods 34 01-25-2011 02:19 AM


All times are GMT -5. The time now is 04:58 AM.

Currently Active Users: 764 (0 members and 764 guests)
Threads: 4,081, Posts: 32,029, 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