Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.3.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=42)
-   -   Mys v1.3.4 Simple NPC Battle (http://www.mysidiaadoptables.com/forum/showthread.php?t=5143)

Silver_Brick 02-04-2017 09:28 AM

I'm not sure if I did something wrong when I changed the price of training but I absentmindedly pressed the button for training while I testing and noticed my money was in the negative.

need help with this

Abronsyth 02-04-2017 12:20 PM

Quote:

Originally Posted by Corsair (Post 35432)
I'm not sure if I did something wrong when I changed the price of training but I absentmindedly pressed the button for training while I testing and noticed my money was in the negative.

Quote:

Originally Posted by lotus (Post 35433)
@Corsair
Try adding this to see if it'll help (make sure to define $traincost):
PHP Code:

if($mysidia->user->money $traincost) {
   
$document->add(new Comment(" You don't have enough money to train your companion!"));
  return;



This issue came up and lotus shared the solution :)

Silver_Brick 02-13-2017 09:54 AM

ok :smile: and would you like to work with me an make a battling system where two user can battle online ??

Abronsyth 02-13-2017 02:20 PM

Sorry, that is quite beyond my capabilities!

Fox 05-24-2017 07:21 PM

What would you suggest to limit the amount of training?
Say, you can only train any pet up to 5 times (regardless of stat) so you don't end up with a billion highly trained pets? It forces you to breed and train for better stats?

Abronsyth 06-17-2017 10:24 AM

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...
http://orig01.deviantart.net/862c/f/...re-dbd0s8e.jpg

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!

Missy Master 07-19-2020 08:26 PM

For what its worth, going back in all this time later, this brilliant Mod just needs all the attributes (sense, etc) changed to public instead of private.

I am much more php savvy a few years in -- and found it easy to get it working just fine!

Highly recommend this awesome and fun Mod!


Thanks again for it!


All times are GMT -5. The time now is 10:29 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.