Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-16-2011, 11:46 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: 327,417
Hall of Famer is on a distinguished road
Default Evolution System: Perfect for a Pokemon or Digimon site

Well this is my third custom script made for the adoptable engine. It is nowhere as useful as Arianna's gender and breeding system, but should be cool to use. The current script actually allows simple evolution through change of images, but it can cause serious problem since the type/species name of the adoptable isnt changed. My script solves this kind of problem, and it can be extended to multiple evolution stages and forms.


To begin with, you will need to insert the three following columns into Both the table adoptables and owned_adoptables through phpmyadmin. Failing to follow this step will cause fatal error on your adoptable site:

PHP Code:
'evolution'VARCHAR10 )', default Null 
'
evolutionlevel', INT( 11 )', default 0  
'evolutionform'VARCHAR40 )', default Null 
After you've completed this, open admin.php and find the following codes:

PHP Code:
<input type='submit' name='Submit' value='Create This Adoptable'
  </
p>
  <
p>&nbsp; </p>
</
form>"; 
Add above:

PHP Code:
<p>
  <
p><strong>Evolution Settings:</strong></p>
  <
p>This section allows you to set if you want to enable evolution for your adoptable. </p>
  <
p><strong>
    <
input name='evolution' type='checkbox' id='evolution' value='yes'>
    </
strong>Enable Evolution</p>
  <
p>Adoptable evolution Information:</p>
  <
p>This adoptable evolves at lv
    <
input name='evolutionlevel' type='text' id='evolutionlevel' size='6' maxlength='6'>
    <
br
  <
p>The evolution form is:
    <
input name='evolutionform' type='text' id='evolutionform' size='20' maxlength='20'>
    <
br
This should be good for admin control panel, you will now be able to define whether an adoptable can evolve. You may also decide its evolution level and evolution form through admincp.


Next, open nadopt.php and find the following lines:

PHP Code:
$alternates $_POST["alternates"];
$alternates secure($alternates);

$altoutlevel $_POST["altoutlevel"];
$altoutlevel secure($altoutlevel);

$altchance $_POST["altchance"];
$altchance secure($altchance); 
Add below:
PHP Code:
$evolution$_POST["evolution"];
$evolution secure($evolution);

$evolutionlevel$_POST["evolutionlevel"];
$evolutionlevel secure($evolutionlevel);

$evolutionform$_POST["evolutionform"];
$evolutionform secure($evolutionform); 
Find:

PHP Code:
mysql_query("INSERT INTO ".$prefix."adoptables VALUES ('', '$name', '$description','$eggimage','$cba','$promocode', '$freqcond', '$number','$datecond','$date','$adoptscond','$maxnumcond','$morethannum','$usergroupcond','$usergroups','$alternates','$altoutlevel','$altchance')"); 
Replace with:

PHP Code:
mysql_query("INSERT INTO ".$prefix."adoptables VALUES ('', '$name', '$description','$eggimage','$cba','$promocode', '$freqcond', '$number','$datecond','$date','$adoptscond','$maxnumcond','$morethannum','$usergroupcond','$usergroups','$alternates','$altoutlevel','$altchance','$evolution','$evolutionlevel','$evolutionform')"); 
This makes it possible for you to create an adoptable, or you will get an error when creating an adoptable from admincp.


You will also need to modify the doadopts.php a little bit, find the following codes below:

PHP Code:
$aid=@mysql_result($result,$i,"id"); //The adoptable's ID
$type=@mysql_result($result,$i,"type");
$description=@mysql_result($result,$i,"description");
$eggimage=@mysql_result($result,$i,"eggimage"); 
Add below:

PHP Code:
$evolution=@mysql_result($result,$i,"evolution");
$evolutionlevel=@mysql_result($result,$i,"evolutionlevel");
$evolutionform=@mysql_result($result,$i,"evolutionform"); 
After this is done, search for the line that contains sql query:

PHP Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','fortrade','no','$gender')"); 
Replace with this:

PHP Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','fortrade','no','$gender','$evolution','$evolutionlevel','$evolutionform')"); 
This is required for you to adopt a pet from adopt.php, failing to follow the step above will generate an error too, especially if you forget to update the sql query line.


Alright, we are approaching the very end of this script modification. Open your levelup.php, it is where the game is played. Find the following lines below:

PHP Code:
if($newclicks >= $requiredclicks and $requiredclicks != and $requiredclicks != ""){

    
// We need to level this adoptable up...

    
$query "UPDATE ".$prefix."owned_adoptables SET currentlevel='".$nextlevel."' WHERE aid='".$id."'";
    
mysql_query($query); 
Add below:

PHP Code:
// the script below examines if an adoptable can evolve or not and executes if the conditions are met
 
    
if($evolution == "yes" and $nextlevel >= $evolutionlevel){
       
$newtype $evolutionform;
       
$query "UPDATE ".$prefix."owned_adoptables SET type='".$newtype."' WHERE aid='".$id."'";
       
mysql_query($query);
       if(
$type == $name){
         
$query "UPDATE ".$prefix."owned_adoptables SET name='".$newtype."' WHERE aid='".$id."'";
         
mysql_query($query);
       }

       
//However, the evolution info is outdated, we will need to update it below:
       
$query "SELECT * FROM ".$prefix."adoptables WHERE type='$evolutionform'";
       
$result mysql_query($query);
       
$num mysql_numrows($result); 
       
       
//Loop out code
       
$i=0;
       while (
$i 1) {
 
       
$evolutionnew=@mysql_result($result,$i,"evolution");  
       
$evolutionnewlevel=@mysql_result($result,$i,"evolutionlevel");
       
$evolutionnewform=@mysql_result($result,$i,"evolutionform");
       
       
$i++;
       }

       
//Now it's time to update the evolution info to the next possible evolution
       
$query "UPDATE ".$prefix."owned_adoptables SET evolution='".$evolutionnew."' WHERE aid='".$id."'"
       
mysql_query($query);
       
$query "UPDATE ".$prefix."owned_adoptables SET evolutionlevel='".$evolutionnewlevel."' WHERE aid='".$id."'";      
       
mysql_query($query);
       
$query "UPDATE ".$prefix."owned_adoptables SET evolutionform='".$evolutionnewform."' WHERE aid='".$id."'";
       
mysql_query($query); 
     } 
What it does is to evolve an adoptable if its evolution form exists, and the pet has reached its default evolution level. The script will also check if the species name(type) and individual name(name) are identical, and the individual name will be updated to species name if the answer is yes. The evolution info will be updated too, if your adoptable has multiple evolution stages(the limit is 2 for pokemon and 5 for digimon).

Alright, we are done with this evolution system, surprised? Yes, its always possible to edit the adoptable script to whatever you want it to be, just a matter of time and efforts. I will post two screenshots of how it works later, and the corresponding script files are attached at the end of this post. Do not download and use them if you have a heavily modified adoptable site, it only works for new users who have just installed Mys/RA version 1.10. They are also incompatible with RA v1.00. You will have to manually create database columns even if you use the files.

Hall of Famer
Attached Files
File Type: php admin.php (79.3 KB, 5 views)
File Type: php nadopt.php (10.2 KB, 6 views)
File Type: php doadopt.php (7.6 KB, 5 views)
File Type: php levelup.php (12.0 KB, 6 views)
Reply With Quote
  #2  
Old 01-16-2011, 11:49 AM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 31,864
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

FIRST POST.

Nice, I have a feeling this mod will be VERY popular, even among non-pokemon/digimon sites.
Reply With Quote
  #3  
Old 01-16-2011, 11:54 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: 327,417
Hall of Famer is on a distinguished road
Default

Thank you so much Kaeliah, I try to make more useful scripts than before. I am sure there's still a way to improve this script, and I will see what I can do with it. I may be working on an egg stage system, in which the eggs do not appear in levels. Users may be able to create multiple stages of eggs and click them until a baby pet is born(at lv.1 of course). The way to hatch an egg may be quite different from leveling up an adoptable too.
Reply With Quote
  #4  
Old 01-16-2011, 12:05 PM
PokePets PokePets is offline
Premium Member
 
Join Date: Jun 2010
Posts: 228
Gender: Male
Credits: 19,066
PokePets
Default

Another AMAZING OMGNESS mod from you =D!
You're the best ;P

*using*
Reply With Quote
  #5  
Old 01-16-2011, 12:13 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: 327,417
Hall of Famer is on a distinguished road
Default

Thank you so much, Pokepet. Like I've stated before, this can even be extended to multiple evolution forms, nonlevel-based evolutions and even devolutions. Not everyone will find it useful though, since evolution is not required for many adoptable sites.
Reply With Quote
  #6  
Old 01-16-2011, 03:05 PM
RoconzaArt's Avatar
RoconzaArt RoconzaArt is offline
Member
 
Join Date: Jan 2011
Location: NJ Shore (and proud of it)
Posts: 479
Gender: Female
Credits: 45,234
RoconzaArt is an unknown quantity at this point
Default

It would be interesting to see this "multiple evolution forms" applied to a Digimon site since Digimon do a lot of multiple evolution forms. Then again if you did you like Digimon there would be a zillion evolution since digimon are not as limited in branching as pokemon.
Reply With Quote
  #7  
Old 01-16-2011, 03:29 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: 327,417
Hall of Famer is on a distinguished road
Default

Well a problem with multiple evolution form is how to define the path of evolution. Its rather easy for Wurmple, which simply evolves into two different species randomly. For Gloom, the different evolution stones will have to be specified, thus an itemshop is needed. For Eevee, it will be even a lot more complicated. For the case of Digimon, I'd strongly advise you to create a column called Evolution Group, since there are way too many branches of preevolution and evolution forms.
Reply With Quote
  #8  
Old 01-16-2011, 03:40 PM
RoconzaArt's Avatar
RoconzaArt RoconzaArt is offline
Member
 
Join Date: Jan 2011
Location: NJ Shore (and proud of it)
Posts: 479
Gender: Female
Credits: 45,234
RoconzaArt is an unknown quantity at this point
Default

That's what makes Digimon so tricky since there most be a ton of evolution combos and even branching in some cases. Too much for a novice like my self. I like the idea of item base evolution cause it could be useful for Digimon too. Such as having crests and Digimon items used. That would be a pretty cool Digimon site if you could pull it off.
Reply With Quote
  #9  
Old 01-22-2011, 09:40 PM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 32,501
fadillzzz is an unknown quantity at this point
Default

I wanted to install this, but what about all the adoptables that has already evolved using the old evolution system where it only change the image?
Reply With Quote
  #10  
Old 01-23-2011, 12:12 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: 327,417
Hall of Famer is on a distinguished road
Default

lol interesting question. I dont think this will cause any glitches, since the script checks if the adoptable's level is above or equal to its evolution level or not. It will still evolve and get a species name change even if it is way above evolution level. It will be quite funny though if you have a lv.50 Charmander(whose current image is Charizard) evolves into lv.51 Charmeleon.
__________________


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

Thread Tools
Display Modes

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
pokemon adoptables Ashe Art Gallery 2 09-19-2012 09:56 AM
The Pokémon Ranch - Online Pokémon Rpg Alaric Adoptables Buzz 3 05-23-2012 01:16 AM
pokemon mods (evolution) Nemesis Questions and Supports 3 05-11-2012 03:03 PM
evolution system for 1.2.x? sensacion Questions and Supports 2 07-06-2011 11:49 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 10:13 AM.

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