Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2017, 06:38 AM
Fox Fox is offline
Member
 
Join Date: Oct 2016
Location: Australia
Posts: 34
Gender: Female
Credits: 8,183
Fox is on a distinguished road
Default

Creating an Adopt Shop for this Currency!

Follow the steps in Abronsyth's adoptable shop with conditions - clickity click

Now, there are a heap of steps for this one, and it took me quite some tinkering to figure this out.

We'll start with find the class_member.php file in classes.

Find this:
PHP Code:
 public function getcash(){
      return 
$this->money;
  }
  
  public function 
changecash($amount){     
      
$mysidia Registry::get("mysidia");
      if(!
is_numeric($amount)) throw new Exception('Cannot change user money by a non-numeric value!');
      
      
$this->money += $amount;    
      if(
$this->money >= 0){ 
         
$mysidia->db->update("users", array("money" => $this->money), "username = '{$this->username}'");
         return 
TRUE;              
      }
      else throw new 
InvalidActionException("It seems that {$this->username} cannot afford this transaction.");
  } 
And add after it:
PHP Code:
public function getgems(){
      return 
$this->premiumcurrency;
  }
  
  public function 
changegems($amount){     
      
$mysidia Registry::get("mysidia");
      if(!
is_numeric($amount)) throw new Exception('Cannot change user gems by a non-numeric value!');
      
      
$this->premiumcurrency += $amount;    
      if(
$this->premiumcurrency >= 0){ 
         
$mysidia->db->update("users", array("premiumcurrency" => $this->premiumcurrency), "username = '{$this->username}'");
         return 
TRUE;              
      }
      else throw new 
InvalidActionException("It seems that {$this->username} cannot afford this transaction.");
  } 
I used 'gems' as that's what my premium currency is. Change to whatever you like, just don't use cash.

Now let's jump to class_adoptable.php

Find:
PHP Code:
class Adoptable extends Model{

   protected 
$id;
    protected 
$type;
    protected 
$class;
    protected 
$description;
    protected 
$eggimage;
    protected 
$whenisavail;
    protected 
$alternates;
    protected 
$altoutlevel;
    protected 
$altchance;
    protected 
$shop;
    protected 
$cost;  
    protected 
$genderratio;
    protected 
$conditions;
    protected 
$levels
And add beneath protected cost:
PHP Code:
protected $premiumcost
Then find:
PHP Code:
public function getCost(){
        return 
$this->cost;
    } 
and add this below it:
PHP Code:
public function getPremiumCost(){
        return 
$this->premiumcost;
    } 
Continue to next post.

Last edited by Fox; 06-01-2017 at 06:53 AM.
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 09:33 PM.

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