Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-03-2016, 05:07 AM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 49,637
tahbikat is on a distinguished road
Default Item function to turn an adopt into another species?

Just wondering if anyone's done this yet? I'm going to be looking into it in the coming days.

Essentially, you'd use a consumable item that would change one species into a completely different species that you've set for that item. This item can only work for species you've enabled it to work on. It would only be changing the adopt's "type" column.
Reply With Quote
  #2  
Old 02-03-2016, 11:55 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,400
Abronsyth is on a distinguished road
Default

Shouldn't be too difficult, to be honest. I'd imagine something like this in functions_items.php...just replace where I have "speciesA" and "speciesAname".

PHP Code:
function items_speciesA($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$mysidia->db->update("owned_adoptables", array("type" => 'speciesAname'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
  
$note "The item has been successfully used on your adoptable, it is now a {$adopt->type}!<br>";
  
//Update item quantity...
  
$delitem $item->remove(); 
  return 
$note;

Then going off of what Kyttias did for the gender mod, just go into your items_functions table, copy level1 function, change ID to latest ID, change the item name to be the exact of where I put "speciesA". Then inside of class/class_privateitem.php;
PHP Code:
case "Species A":
            
$message items_speciesA($this$owned_adoptable);
            break; 
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 02-03-2016 at 12:00 PM.
Reply With Quote
  #3  
Old 02-03-2016, 02:50 PM
tahbikat's Avatar
tahbikat tahbikat is offline
Member
 
Join Date: Feb 2014
Location: Louisiana
Posts: 408
Gender: Female
Credits: 49,637
tahbikat is on a distinguished road
Default

Thank you so much Abron. <3 I'll let you know how it works once I'm able to test it!
Reply With Quote
  #4  
Old 02-03-2016, 06:07 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,400
Abronsyth is on a distinguished road
Default

Sure thing, I hope it works for you!
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #5  
Old 05-30-2016, 01:02 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 18,721
NobodysHero is on a distinguished road
Default

Thanks for this!!! Works brilliantly! Is there any chance this could be made into a random opportunity to make it into any pet? Like, random pet change? >.>
Reply With Quote
  #6  
Old 05-31-2016, 08:21 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 113,400
Abronsyth is on a distinguished road
Default

You could do some things to manually add pets, use a rand function to assign each pet as a number. You'll just have to manually add in all of the pet types that you want to be possible from it. I haven't tested it, but I think it'd be something like this. Then just change "speciesA" (etc) to a specific pet type (make sure it is word for word, case and all). Should work, I think, but as I said I haven't tested it, so use at your own risk.
PHP Code:
function items_albino($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$random rand(1,9); 
                    if(
$random >= && $random <= 3){
                    
$newtype = ('speciesA');
                    }
                    elseif(
$random >= && $random <= 6){
                    
$newtype = ('speciesB');
                    }
                    elseif(
$random >= && $random <= 9){
                    
$newtype = ('speciesC');
                    }
  
$mysidia->db->update("owned_adoptables", array("type" => '{$newtype}'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
  
$note "The {$item->itemname} has been successfully used on your pet, it is now an {$adopt->type}!<br>";
  
//Update item quantity...
  
$delitem $item->remove(); 
  return 
$note;

You could make this challenging for your users by making more common pets have greater probability and less common pets have a lower probability :)
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 05-31-2016 at 08:24 AM.
Reply With Quote
  #7  
Old 05-31-2016, 10:33 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 18,721
NobodysHero is on a distinguished road
Default

THANK YOU THANK YOU THANK YOU!!!!

I did have to tweak it a little bit and I'm really surprised I got it working. x.x I'm horrible with PHP (Inexperienced and dyslexic), but for those who want this for their site, this is the code that worked for me. Don't forget to replace my pet types with your own!

PHP Code:
function items_random($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$random rand(1,9); 
                    if(
$random >= && $random <= 3){
                    
$newtype = ('Chestnut Unicorn');
                    }
                    elseif(
$random >= && $random <= 6){
                    
$newtype = ('Sienna Kirin');
                    }
                    elseif(
$random >= && $random <= 9){
                    
$newtype = ('Piebald Kirin');
                    }
  
$mysidia->db->update("owned_adoptables", array("type" => $newtype), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
  
$note "The {$item->itemname} has been successfully used on your pet, it is now an {$newtype}!<br>";
  
//Update item quantity...
  
$delitem $item->remove(); 
  return 
$note;

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 06:28 AM.

Currently Active Users: 9763 (0 members and 9763 guests)
Threads: 4,080, Posts: 32,024, 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