Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2012, 09:25 PM
!Alive !Alive is offline
Member
 
Join Date: Feb 2012
Posts: 39
Gender: Male
Credits: 1,813
!Alive is on a distinguished road
Default

XD Glad to.
Lets see to start I suppose I'l go over how the rarity thing actually works.
First you'll see
PHP Code:
$uncommon rand(1,50);   
    
$rare rand(1,100);   
    
$ultrarare rand(1,200); 
These variables set the likelihood of a certain rarity of adoptable appearing. Uncommon 1 in 50
Rare 1 in 100
Ultrarare 1 in 200
You can change the chances simply by the last(max) number of the rand function.

Moving on to the actual selecting of the adoptables. You will see this:
PHP Code:
 if ($uncommon==&& $onlyone==0){   
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }   
    else if (
$rare==&& $onlyone==0){   
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }       
    else if (
$ultrarare==1  && $onlyone==0){   
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }       
    else{   
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";   
    } 
First the if statement tests if something other than a common adoptable is to be shown. If it is than it pulls a random adoptable from the database with the corresponding rarity value.
Since the $onlyone variable is shown I'll go over what it does now. The reason for this variable is to check if a rarer adoptable(anything above common) is already selected to be shown. If one isn't chosen choose one if one is already chosen show a common one.

I think the last piece is the $clicked variable that only allows you to click on(adopt) an egg once. This works by setting $clicked to 0 when the page is loaded When the egg is clicked the canclick function runs checking the value of clicked. If it is 0 then the egg is adopted if it is a 1 the user can not adopt it.

I think I covered it. If you want/need more clarification fell free to ask. *is not confident I explained it really well* X3
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


All times are GMT -5. The time now is 07:50 AM.

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