Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-27-2009, 04:57 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 18,106
BMR777 is on a distinguished road
Default RE: level up to 100!

Sorry about the delay, sometimes you've got to be a little patient though. I check these forums daily though as I am a full time college student I'm not on until afternoon time. :)

Anyway, to the issue at hand, the file levelup.php handles the actual calculation of how to do a level up for a creature. If you want to see the code, it starts after this line:

PHP Code:
//Begin the level up procedure 
The level up procedure is similar, but not identical for both registered users and guests.

Here's the actual code that does the level up for logged in users:

PHP Code:
$query "SELECT * FROM owned_adoptables WHERE uid = '$id'";
            
$result = @mysql_query($query);
            
$num = @mysql_numrows($result);

            
//Loop out code
            
$i=0;
            while (
$i 1) {

            
$name=@mysql_result($result,$i,"name");
            
$imageurl=@mysql_result($result,$i,"imageurl");
            
$currentlevel=@mysql_result($result,$i,"currentlevel");
            
$totalclicks=@mysql_result($result,$i,"totalclicks");
            
$type=@mysql_result($result,$i,"type");

            
$i++;
            }

            
$plus1 $totalclicks 1;
            
mysql_query("UPDATE owned_adoptables SET totalclicks='".$plus1."' WHERE uid='".$id."'");    

            
//Check and see if we need a level up...
            
$levelup checklevel($totalclicks);
            if(
$levelup $currentlevel){
            
//The creature needs to level up
            //Check if we are at max level

            
$query "SELECT * FROM adoptable_rankimages WHERE name = '$type'";
            
$result = @mysql_query($query);
            
$num = @mysql_numrows($result);

            
//Loop out code
            
$i=0;
            while (
$i 1) {

            
$l1i=@mysql_result($result,$i,"l1i");
            
$l2i=@mysql_result($result,$i,"l2i");
            
$l3i=@mysql_result($result,$i,"l3i");
            
$l4i=@mysql_result($result,$i,"l4i");
            
$l5i=@mysql_result($result,$i,"l5i");    
            
$l6i=@mysql_result($result,$i,"l6i");
            
$l7i=@mysql_result($result,$i,"l7i");
            
$l8i=@mysql_result($result,$i,"l8i");
        

            
$i++;
            }
            
            
$mymax 8;
            if(
$l1i == "" || l1i == NULL){
            
$mymax 0;
            
$img $l1i;
            }    
            else if(
$l2i == "" || l2i == NULL){
            
$mymax 1;
            
$img $l2i;
            }
            else if(
$l3i == "" || l3i == NULL){
            
$mymax 2;
            
$img $l3i;
            }
            else if(
$l4i == "" || l4i == NULL){
            
$mymax 3;
            
$img $l4i;
            }
            else if(
$l5i == "" || l5i == NULL){
            
$mymax 4;
            
$img $l5i;
            }
            else if(
$l6i == "" || l6i == NULL){
            
$mymax 5;
            
$img $l6i;
            }
            else if(
$l7i == "" || l7i == NULL){
            
$mymax 6;
            
$img $l7i;
            }
            else if(
$l8i == "" || l8i == NULL){
            
$mymax 7;
            
$img $l8i;
            }


            if(
$currentlevel $mymax){
            
//Not at max level, rank them up
    
            
if($levelup == "1" and $mymax >= $levelup){
            
$img $l1i;
            }        
            if(
$levelup == "2" and $mymax >= $levelup){
            
$img $l2i;
            }
            if(
$levelup == "3" and $mymax >= $levelup){
            
$img $l3i;
            }
            if(
$levelup == "4" and $mymax >= $levelup){
            
$img $l4i;
            }
            if(
$levelup == "5" and $mymax >= $levelup){
            
$img $l5i;
            }
            if(
$levelup == "6" and $mymax >= $levelup){
            
$img $l6i;
            }
            if(
$levelup == "7" and $mymax >= $levelup){
            
$img $l7i;
            }
            if(
$levelup == "8" and $mymax >= $levelup){
            
$img $l8i;
            }

            
mysql_query("UPDATE owned_adoptables SET currentlevel='".$levelup."' WHERE uid='".$id."'");
            
mysql_query("UPDATE owned_adoptables SET imageurl='".$img."' WHERE uid='".$id."'");
            
$flag 1;
            
$currentlevel $levelup;
            }


            } 
The number of levels is hard-coded into the script. I am assuming though you want to be able to have 100 separate images for a creature? That would be possible by editing the level up code, the database table structure and the levelup.php file to accommodate more images, but having that many images there could be sloppy and tedious.

BMR777
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
Max level? kristhasirah Questions and Supports 2 09-14-2011 01:41 PM
Max level? RipJawWolfFang Questions and Supports 1 04-17-2009 09:13 AM
max level trainerluke Questions and Supports 11 04-16-2009 01:09 AM
Max Level (v2) LilPixie Questions and Supports 4 02-17-2009 08:15 PM
Max level? LilPixie Questions and Supports 2 02-15-2009 08:41 PM


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

Currently Active Users: 3761 (0 members and 3761 guests)
Threads: 4,081, Posts: 32,032, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636