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-22-2012, 09:34 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 118,933
SilverDragonTears is on a distinguished road
Default

I do :) I'll give it a try and see how it works... do you want payment for this?
__________________

Check out SilvaTales
Reply With Quote
  #2  
Old 03-22-2012, 09:57 PM
!Alive !Alive is offline
Member
 
Join Date: Feb 2012
Posts: 39
Gender: Male
Credits: 1,856
!Alive is on a distinguished road
Default

Okay. XD I don't need anything.

For the code below you will need to create a new column in the (prefix)_adoptables table with the name of rarity and type int(11).
Rarity values(assign to the adoptables for their rarity)
common = 0
uncommon = 1
rare = 2
ultrarare = 3

more can be added but you would have to add more statments to the code.

Find (aaround line 25):
PHP Code:
$query "SELECT * FROM ".$prefix."adoptables";
    
$result runquery($query);
    
    
$article_content .= "<form name='form1' method='get' action='doadopt.php'>
    <h3>Available Adoptables</h3><table>"
;

    while(
$row mysql_fetch_array($result)) {
        
$aid=$row['id']; //The adoptable's ID
        
$type=$row['type'];
        
$description=$row['description'];
        
$eggimage=$row['eggimage'];

        
// Call a function to check if we have the proper privledge level to adopt this pet
        
if($promocode == ""){
            
$promocode "none";
        }

        
$canadopt canadopt($aid"showing"$promocode$row); // Feed an adoptable ID and showing, to show the adopt to guests...

        
if($canadopt == "yes"){
            
//If we can adopt the adoptable, show the image and adoption link...
            
$article_content .= "<tr>
            <td><input type='radio' name='id' id='id' value='
{$aid}' /></td>
            <td style='text-align: center'><img src='"
.$eggimage."' /></td>
            <td><strong>
{$type}</strong> - {$row['cost']} {$GLOBALS['settings']['cost']}.<br />{$description}</td></tr>";
        }
    } 
Replace with:
PHP Code:
    $uncommon rand(1,50);
    
$rare rand(1,100);
    
$ultrarare rand(1,200);

    if (
$uncommon==1){
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1";
    }
    else if (
$rare==1){
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1";
    }    
    else if (
$ultrarare==1){
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1";
    }    
    else{
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";
    }


    
$result runquery($query);
    
    
$article_content .= "<form name='form1' method='get' action='doadopt.php'>
    <h3>Available Adoptables</h3><table>"
;

    while(
$row mysql_fetch_array($result)) {
        
$aid=$row['id']; //The adoptable's ID
        
$type=$row['type'];
        
$description=$row['description'];
        
$eggimage=$row['eggimage'];

        
// Call a function to check if we have the proper privledge level to adopt this pet
        
if($promocode == ""){
            
$promocode "none";
        }

        
$canadopt canadopt($aid"showing"$promocode$row); // Feed an adoptable ID and showing, to show the adopt to guests...

        
if($canadopt == "yes"){
            
//If we can adopt the adoptable, show the image and adoption link...
            
$article_content .= "<tr>
            <td><input type='radio' name='id' id='id' value='
{$aid}' /></td>
            <td style='text-align: center'><img src='"
.$eggimage."' /></td>
            <td><strong>
{$type}</strong> - {$row['cost']} {$GLOBALS['settings']['cost']}.<br />{$description}</td></tr>";
        }
    } 
    

    if (
$uncommon==1){
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1";
    }
    else if (
$rare==1){
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1";
    }    
    else if (
$ultrarare==1){
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1";
    }    
    else{
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";
    }


    
$result runquery($query);


while(
$row mysql_fetch_array($result)) {
        
$aid=$row['id']; //The adoptable's ID
        
$type=$row['type'];
        
$description=$row['description'];
        
$eggimage=$row['eggimage'];

        
// Call a function to check if we have the proper privledge level to adopt this pet
        
if($promocode == ""){
            
$promocode "none";
        }

        
$canadopt canadopt($aid"showing"$promocode$row); // Feed an adoptable ID and showing, to show the adopt to guests...

        
if($canadopt == "yes"){
            
//If we can adopt the adoptable, show the image and adoption link...
            
$article_content .= "<tr>
            <td><input type='radio' name='id' id='id' value='
{$aid}' /></td>
            <td style='text-align: center'><img src='"
.$eggimage."' /></td>
            <td><strong>
{$type}</strong> - {$row['cost']} {$GLOBALS['settings']['cost']}.<br />{$description}</td></tr>";
        }
    }

if (
$uncommon==1){
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1";
    }
    else if (
$rare==1){
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1";
    }    
    else if (
$ultrarare==1){
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1";
    }    
    else{
    
$query "SELECT * FROM ".$prefix."adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";
    }


    
$result runquery($query);


while(
$row mysql_fetch_array($result)) {
        
$aid=$row['id']; //The adoptable's ID
        
$type=$row['type'];
        
$description=$row['description'];
        
$eggimage=$row['eggimage'];

        
// Call a function to check if we have the proper privledge level to adopt this pet
        
if($promocode == ""){
            
$promocode "none";
        }

        
$canadopt canadopt($aid"showing"$promocode$row); // Feed an adoptable ID and showing, to show the adopt to guests...

        
if($canadopt == "yes"){
            
//If we can adopt the adoptable, show the image and adoption link...
            
$article_content .= "<tr>
            <td><input type='radio' name='id' id='id' value='
{$aid}' /></td>
            <td style='text-align: center'><img src='"
.$eggimage."' /></td>
            <td><strong>
{$type}</strong> - {$row['cost']} {$GLOBALS['settings']['cost']}.<br />{$description}</td></tr>";
        }
    } 
Oh, and if you use the admin panel to add new adoptables you will want to be sure to add the value to the insert into query when creating.

That should do it. Let me know how it works for you or if you need help. :D
*is still learning this stuff myself*
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


All times are GMT -5. The time now is 10:30 AM.

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