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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-21-2011, 04:42 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 37,705
fadillzzz is an unknown quantity at this point
Default X Days before evolution

This mod will prevent the evolution of adoptables until they've passed certain days.

Make a backup of your files before proceeding
1. Create new column in the owned_adoptables


Field name: timeevolve
Type: int
Length: 11
Null: No
Default: 0


2. Update the INSERT query in the doadopt.php & doadoptab.php

Open doadopt.php & doadoptab.php and find the INSERT query
It usually looks like this (Yours will probably a little longer)
PHP Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', 'Telur Misterius','$loggedinname','0','0', '$code', '','$alts','fortrade','no')"); 
Add ,'$timeevolve' into the query so it will now look like this
PHP Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('',  '$type', 'Telur Misterius','$loggedinname','0','0', '$code',  '','$alts','fortrade','no','$timeevolve')"); 
And before the insert query add this
PHP Code:
$timeevolve time(); 
3. Open your levelup.php

Go to the first loop out code and find
PHP Code:
    $aid=@mysql_result($result,$i,"aid");
    
$type=@mysql_result($result,$i,"type"); 
    
$name=@mysql_result($result,$i,"name");
    
$totalclicks=@mysql_result($result,$i,"totalclicks");
    
$currentlevel=@mysql_result($result,$i,"currentlevel"); 
    
$usealternates=@mysql_result($result,$i,"usealternates");
    
$isfrozen=@mysql_result($result,$i,"isfrozen");
    
$owner=@mysql_result($result,$i,"owner"); 
Add below

PHP Code:
    $timeevolve=@mysql_result($result,$i,"timeevolve"); 
So now your loop out code should look something like this

PHP Code:
    $i=0;
    while (
$i 1) {
        
$aid=@mysql_result($result,$i,"aid");
        
$type=@mysql_result($result,$i,"type"); 
        
$name=@mysql_result($result,$i,"name");
        
$totalclicks=@mysql_result($result,$i,"totalclicks");
        
$currentlevel=@mysql_result($result,$i,"currentlevel"); 
        
$usealternates=@mysql_result($result,$i,"usealternates");
        
$isfrozen=@mysql_result($result,$i,"isfrozen");
        
$owner=@mysql_result($result,$i,"owner");
        
$timeevolve=@mysql_result($result,$i,"timeevolve");
        
$i++;
    } 
Just below the loop out code, add

PHP Code:
    if($timeevolve == 0){
        
$newtime time();
        
mysql_query("UPDATE ".prefix."owned_adoptables SET timeevolve = '$newtime' WHERE aid='$id'");
    } 
Now find this code

PHP Code:
    $requiredclicks=@mysql_result($result,$i,"requiredclicks");  // The number of clicks required for the next level 
Add above
PHP Code:
    $primaryimage=@mysql_result($result,$i,"primaryimage"); 
Add below (below $requiredclicks .... )
NOTE: From this code below, change the $evolveif variable to your liking.
(E.g: To wait 3 days before evolution, change it to time() - 3 * 24 * 60 * 60)

PHP Code:
    $query "SELECT * FROM ".$prefix."levels WHERE adoptiename='$type' and thisislevel='$currentlevel'";
    
$result mysql_query($query);
    
$num mysql_num_rows($result);
    
//Loop out code
    
$i=0;
    while (
$i 1) {
        
$oldprimaryimage=@mysql_result($result,$i,"primaryimage");
        
$i++;
    }
    
$evolveif time() - 24 60 60// (From right) 60 represent seconds, 60 represent minutes, 24 represent hours, 1 represent days
        
if($oldprimaryimage != $primaryimage){
            if(
$timeevolve $evolveif){

                
// Check if the number of clicks we have now is greater than or equal to the required clicks to level up...

                
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);

                    
// Now we check if we are enabling alternate images...
    
                    
$parentid converttypetoparentid($type); // Get the ID of the parent type adoptable
                    
$altstatus getaltstatus($parentid$id$nextlevel); // Check if we are using alternate images or not...

                    
if($altstatus == "yes"){

                        
// We are enabling alternate images for this adoptable...

                        
$query "UPDATE ".$prefix."owned_adoptables SET usealternates='yes' WHERE aid='".$id."'";
                        
mysql_query($query);


                    }

                    
// Now we can see if the adoptable's owner gets a reward...
                    // The reward function will take care of sending out any reward that exists...

                    
$rewardstatus reward($id$type$nextlevel$owner);
                    
mysql_query("UPDATE ".$prefix."owned_adoptables SET timeevolve = ".time()."  WHERE aid='".$id."'");
                }
            }

        } 
Find this

PHP Code:
    // End the if statement if we are leveling the adoptable up 
Add a closing curly bracket below that

PHP Code:
    
I've tested this and so far I've gotten any problems but in case this mod messed up your site, or it's not working at all, report it to me.

Last edited by fadillzzz; 02-22-2011 at 05:18 AM.
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
evolution system for 1.2.x? sensacion Questions and Supports 2 07-06-2011 12:49 PM
Days Instead of Clicks alonaria Suggestions and Feature Requests 7 06-25-2011 06:27 AM
waiting for premium for 5 days Amerfira Questions and Supports 10 10-01-2010 04:10 AM
Evolution through time? Hall of Famer Questions and Supports 6 03-01-2010 12:42 AM
Evolution system? Hall of Famer Questions and Supports 10 11-05-2009 06:54 PM


All times are GMT -5. The time now is 09:17 AM.

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