Thread: Mys 1.3.x Stat/SKill System
View Single Post
  #6  
Old 06-29-2014, 09:40 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,664
Hwona is on a distinguished road
Default Award System

Allowing pets to earn "awards" through training.


1. Go to PHPMyAdmin->your site's database->prefix_owned_adoptables
Once there, there should be a "structure" tab at the top of the screen - click that and then scroll to the bottom of the page until you find:

Press go. Then you'll come to a page that looks like this:

Set the values to match the example shown above and press "save".

2. Remember the item function we made earlier in the "functions_items.php" file? Go there and replace that part of the code with this:
PHP Code:
 function items_statname($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$newstatname $adopt->statname $item->value;
  
$mysidia->db->update("owned_adoptables", array("statname" => $newstatname), "aid='{$adopt->aid}'and owner='{$item->owner}'");
  
$note "By using {$item->itemname}, the adoptable's statname raised by {$item->value}!<br>";
  
$note2 "By using {$item->itemname}, the adoptable's statname raised by {$item->value}! It now has 1 statname medal!<br>";
    if(
$newstatname >= 150) {
  
$mysidia->db->update("owned_adoptables", array("statnamemedalstatus" => 'yes'), "aid='{$adopt->aid}'and owner='{$item->owner}'");
  
$delitem $item->remove(); 
  return 
$note2;
  }
  else{
   
$delitem $item->remove(); 
  return 
$note;
  }
  } 
3. Go to your "class_ownedadoptable.php" file. Add this to the "protected" list:
protected $statnamemedalstatus;
Add this to the list of functions:
public function getAdoptObedienceMedalStatus(){
return $this->obediencemedalstatus;
}

4. Go to "levelup.php" and find this piece of code:
$adoptablestatname = $this->adopt->getAdoptstatname();
Under that, put:
$statnamemedalstatus = $this->adopt->getAdoptStatNameMedalStatus();
PHP Code:
$message $message .= "
<div id='stats'>
Statname: 
{$adoptablestatname}
</div><br>
We're sorry, but you cannot add clicks to this adoptable at this time because its owner has chosen to freeze it.  Frozen adoptables do not accept new clicks and do not level up.  Thanks anyway for the click though, but the owner of this adoptable wants to keep this adoptable young so it will not be counted."
;
            
$document->setTitle($mysidia->lang->frozen_title);
            
$document->addLangvar($message); 
Right after:
<div id='stats'>
Statname: {$adoptablestatname}
</div><br>
Add:
<div id ='trainingawards'><img src='{$mysidia->path->getAbsolute()}picuploads/awards/statnamemedalstatus{$statnamemedalstatus}.png'></div>

5. Awards Folder(Zipped)
to your picuploads folder and unzip it.
Here are some Photoshop bases you can color if you want to swap out the images provided in the folder:
Trophy Base
Ribbon Base
Medal Base
If you need non-photshop bases, please tell me.



That's done! Now, you may have noticed that the levelup page might not look as visually-appealing as you want it to be. The next post will take care of that.
__________________

Last edited by Hwona; 07-01-2014 at 05:52 PM.
Reply With Quote