Thread: Mys 1.3.4 Simple NPC Battle
View Single Post
  #36  
Old 06-17-2017, 10:24 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,545
Abronsyth is on a distinguished road
Default

I would add a new column to the owned_adoptables table in phpMyAdmin and call it something like "timestrained," with the default set to 0. Then each time that pet is trained add +1 to that column...then just include an if/else statement to exclude any pets that have been trained 5 times. So...something like...


Add this under the list of defined variables for training:
PHP Code:
$trained $favpet->timestrained
$total $trained 1
And then at the end of each training type (before the break;):
PHP Code:
$mysidia->db->update("owned_adoptables", array("timestrained" => $total), "aid='{$profile->getFavpetID()}'"); 
Before the if($favpet->currentlevel = 3) add this;
PHP Code:
if($favpet->timestrained 5){ 
$document->add(new Comment("This pet has maxed out its allowed training sessions! It can no longer be trained."FALSE));
}
else{...} 
With the {...} containing all of the training stuff.

Let me know if that makes sense/works out!
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote