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
  #31  
Old 05-03-2017, 05:47 AM
KatFennec's Avatar
KatFennec KatFennec is offline
Member
 
Join Date: Apr 2017
Posts: 57
Gender: Female
Credits: 9,580
KatFennec is on a distinguished road
Default

Quote:
Originally Posted by ffsharriet View Post
Can items be used to increase health or mood?
OK, so I'm trying to get this to work, and I would REALLY APPRECIATE if anyone in here could share whatever magic trick it takes to use an item to restore health. All I get is a white screen, every time.
__________________
Reply With Quote
  #32  
Old 05-03-2017, 10:37 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 133,856
Abronsyth is on a distinguished road
Default

Ok, I made my own health system so I cannot garauntee that this will work, but here is my item function for health increasing items:
PHP Code:
 function items_health($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$health $mysidia->db->select("owned_adoptables", array("health"), "aid ='{$adopt->aid}'")->fetchObject();
  
$addHealth $adopt->health $item->value;
      
//Check if the adoptable's health is already at maximum.    
  
if($adopt->health >= 100){
    
$note "Your pet is already fully healed! The {$item->itemname} was not used.";
  }
  
//Not at maximum, but don't go overboard!
  
elseif($addHealth 100){
    
$mysidia->db->update("owned_adoptables", array("health" => 100), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
    
$note "The {$item->itemname} fully healed your pet!";
    
$delitem $item->remove();
  }
  
//Not at maximum, won't go overboard. Proceed.
  
else{
    
$mysidia->db->update("owned_adoptables", array("health" => $addHealth), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
    
$note "The {$item->itemname} raised your pet's health by {$item->value}! Their health is now at {$addHealth}.";
    
$delitem $item->remove();
  }
  return 
$note;

(also need to edit classes/class_privateitem, and add the function in the database)
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #33  
Old 05-16-2017, 12:29 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 32,927
kristhasirah
Default

just want to point out that the progress bar dont work in all the browsers, specially old ones, to "fix" this you need to create a div like progress bar :
https://css-tricks.com/html5-progress-element/ <-- there you will find the "fix" for that =)
in short you just need to add the css codes to your style.css and call them with the div:
PHP Code:
<progress max='100' value='{$health}'>
    <
div class="progress-bar">
        <
span style='width: 80%;'>Progress80%</span>
    </
div>
</
progress
just replace the 80% with the {$health} or the status you created and you need to add max-width: 100px(or the max value of the status); to the .progress-bar > span {

you might need to remove 1 or 2px from the max-width... sometimes the filled bar gets out of the container by that.
Reply With Quote
  #34  
Old 07-19-2020, 11:05 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 64,645
Missy Master is an unknown quantity at this point
Default

Epic Mod.

Thanks to all who worked so hard on this. I have it installed, so far so good, will make goodies to bring mood and health up tonight or tomorrow!
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 01:39 PM.

Currently Active Users: 1120 (0 members and 1120 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 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636