Thread: Mys 1.3.x Stat/SKill System
View Single Post
  #3  
Old 06-29-2014, 12:57 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 50,288
Hwona is on a distinguished road
Default Creating Items to Raise Stats

This post will explain how to create items to raise an adoptable's stats.


1. Go to the “item_functions” table in your database. Once there, click the “insert” tab at the top of the page. You should arrive at a page like this:

Fill out the values to match those in the example and then press “Go”.

2.Go to the “functions_items.php” file in the “functions” folder. Add this item function to the list:
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}!"$delitem $item->remove(); return $note; } 
3. Go to your “class_privateitem.php” file in the “classes’ folder. See all that case-break stuff? Add this to the list:
PHP Code:
case "Statname":
            
$message items_Statname($this$owned_adoptable);
            break; 
4. Go to your ACP and create a “Statname” item. Make your you allow it to be consumed!

Tada! The next post shall cover the award system!
__________________

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