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 02-20-2017, 01:48 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 162,741
Abronsyth is on a distinguished road
Default

I didn't test it, but I think this ought to work?
PHP Code:
<?php 

class ExploretestView extends View
     
    public function 
index(){ 
        
$mysidia Registry::get("mysidia"); 
        
$document $this->document
            
$document->setTitle("Explore Test");   
        
$today date('d'); 
if (
$mysidia->user->lastday != $today) {   
        
$mysidia->db->update("users", array("exploretimes" => (0)), "username = '{$mysidia->user->username}'");  
       
$mysidia->user->exploretimes 0;           
    }   

        
$mysidia->db->update("users", array("lastday" => $today), "username = '{$mysidia->user->username}'"); 
        
$mysidia->db->update("users", array("exploretimes" => ($mysidia->user->exploretimes 1)), "username = '{$mysidia->user->username}'");   
        if (
$mysidia->user->exploretimes <= 100) {   
            
$random rand(1,10000); 

            if(
$random && $random 25){
                
$adoptIMG $mysidia->db->select("adoptables", array("eggimage"), "id = '84'")->fetchColumn(); 
                
$document->add(new Comment("<center><img src='{$adoptIMG}' alt='{$species} IMG' /><br> Oh look! You found a {$species}! Grab it before it flies away!.</center>"FALSE)); 
                
$this->pickupPet("{$species}");
            } 
            elseif(
$random >= 26 && $random <= 50){ 
                
$amount rand(50,20000); 
                
$mysidia->user->changecash($amount);  
                
$document->add(new Comment("<center>Oh look! You found $amount tyleans!</center>"FALSE));  
            } 
            if(
$random >= 51 && $random <= 99){ 
                
$item "Bottled Honey"
                
$qty rand(1,5); 
                
$newitem = new StockItem($item); 
                
$newitem->append($qty$mysidia->user->username);   
                
$itemIMG $mysidia->db->select("items", array("imageurl"), "id = '44'")->fetchColumn(); 
                
$document->add(new Comment("<center><img src='$itemIMG' alt='$item IMG' /><br>Oh look! You found a <b>$item</b>!</center>"FALSE)); 
            }   
            if(
$random >= 100 && $random <= 149){ 
                
$document->add(new Comment("<center>Okay, so you didn't get any items, but the totem spirits give you a hug!</center>"FALSE)); 
            }   
            if(
$random >= 150 && $random <= 179){ 
                
$document->add(new Comment("<center>You know what you should do? Keep looking! There's good stuff out there.</center>"FALSE)); 
            } 
            if(
$random >= 180 && $random <= 199){ 
                
$adoptIMG $mysidia->db->select("adoptables", array("eggimage"), "id = '157'")->fetchColumn(); 
                
$document->add(new Comment("<center><img src='$adoptIMG' alt='$species IMG' /><br> Oh look! You found a $species! Grab it while you can!</center>"FALSE)); 
                
$this->pickupPet("{$species}");
            } 
            if(
$random >= 200 && $random <= 249){ 
                
$document->add(new Comment("<center>Man, this place sure is quiet! Well, until you showed up. Haha, I'm kidding! Keep searching!</center>"FALSE)); 
                }   
            if(
$random >= 250 && $random <= 299){ 
                
$item "Black Rose"
                
$qty rand(1,5); 
                
$newitem = new StockItem($item); 
                
$newitem->append($qty$mysidia->user->username);   
                
$itemIMG $mysidia->db->select("items", array("imageurl"), "id = '15'")->fetchColumn(); 
                
$document->add(new Comment("<center><img src='$itemIMG' alt='$item IMG' /><br>Oh look! You found a <b>$item</b>!</center>"FALSE)); 
            } 
            if(
$random >= 300 && $random <= 9999){ 
$document->add(new Comment("<center>You didn't find anything. Look on the bright side! Things can only get better from here, right? <br><br><a href='/exploretheruins'>Explore Again</a></center>"FALSE)); 
            
$document->add(new Comment("<br><center>You have explored <b>{$mysidia->user->exploretimes} out of 100</b> total explores today. If the number of explores is greater than 100, you won't get any reward from exploring.</center></br><br><br><img src='http://i.imgur.com/SQkjh80.png' />"FALSE)); 
            }    
            elseif(
$random == 10000){ 
                
$item "Cereus Unicorn Figurine"
                
$qty rand(1,5); 
                
$newitem = new StockItem($item); 
                
$newitem->append($qty$mysidia->user->username);   
                
$itemIMG $mysidia->db->select("items", array("imageurl"), "id = '32'")->fetchColumn(); 
                
$document->add(new Comment("<center><img src='$itemIMG' alt='$item IMG' /><br>Oh look! You found a <b>$item</b>! Whoa, those are so rare! Keep it!</center>"FALSE)); 
            } 
            else{ 
            
$document->add(new Comment("<br><center>You have explored <b>{$mysidia->user->exploretimes} out of 100</b> total explores today. If the number of explores is greater than 100, you won't get any reward from exploring.</center></br>"FALSE)); 
            
$document->add(new Comment(" <br><center><a href='/exploretheruins'>Explore Again</a></center>"FALSE)); 
            
$document->add(new Comment(" <br><center><a href='/pages/view/exploremystfell'>Return To The Main Map</a></center>"FALSE)); 
            
$document->add(new Comment("<br><center><img src='http://i.imgur.com/SQkjh80.png'></center>"FALSE)); 
        } 
            } 
else{ 
            
$document->add(new Comment("<br><center>You have explored <b>{$mysidia->user->exploretimes} out of 100</b> total explores today. If the number of explores is greater than 100, you won't get any reward from exploring.</center></br>"FALSE)); 
            
$document->add(new Comment(" <br><center><a href='/exploretheruins'>Explore Again</a></center>"FALSE)); 
            
$document->add(new Comment(" <br><center><a href='/pages/view/exploremystfell'>Return To The Main Map</a></center>"FALSE)); 
            
$document->add(new Comment("<br><center><img src='http://i.imgur.com/SQkjh80.png'></center>"FALSE)); 
        } 
         

    } 
    
//This function generates the form
    
public function pickupPet($species){
        
$document $this->document;
        
$document->add(new Comment("
            <form id='pickup_pet' action='Exploretest' name='pickup_pet' method='post' role='form'>
            <input id='pet_found' name='pet_found' type='hidden' value='
{$species}'>
            <button id='acquire' value='species' name='acquire' type='submit'>
            <center>Claim the pet?</center>
            </button>
            </form>
            "
FALSE)); 
        return;
    } 
    
    
// This function is called in the function that only works if there's post data
    
public function givePet($species){
        
$mysidia Registry::get("mysidia");
        
$newadopt = new StockAdopt($species);
        
$newadopt->append($mysidia->user->username);
        return;
    }  


?>
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #2  
Old 02-20-2017, 09:16 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 26,401
NobodysHero is on a distinguished road
Default

Abronsyth, thanks for putting it together, but that didn't work. T_T It sends me to the home screen and no pet is awarded.
__________________

Venture Into The Mist
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 09:50 PM.

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