Thread: Mys 1.3.x Stat/SKill System
View Single Post
  #85  
Old 01-13-2016, 06:40 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 149,726
Abronsyth is on a distinguished road
Default

Well, it's not coming up with an error now, but instead it's simply displaying a blank where the data should be displayed.
(.../view/levelupview.php):
PHP Code:
    public function click(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;                
        
$adopt $this->getField("adopt");
        
$reward $this->getField("reward")->getValue();
        
$document->setTitle("{$this->lang->gave} {$adopt->getName()} one {$this->lang->unit}");
        
        
$image $adopt->getImage("gui"); 
        
$image->setLineBreak(TRUE);        
        
$summary = new Division;
        
$summary->add($image);    
        
$summary->add (new Comment("<ul>
                                        <li><b>Name:</b> 
{$adopt->getName()}</li>
                                        <li><b>Owner:</b> <a href='/profile/view/
{$adopt->getOwner()}'>{$adopt->getOwner()}</a></li>
                                        <li><b>Birthday:</b> 
{$adopt->getBirthday()}</li>
                                        <li><b>Type:</b> 
{$adopt->getType()}</li>
                                        <li><b>Sex:</b> 
{$adopt->getGender()}</li>
                                        <li><b>LVL:</b> 
{$adopt->getCurrentLevel()}</li>
                                        <li><b>Total EXP:</b> 
{$adopt->getTotalClicks()}</li> 
                                        <li><b>Magic:</b> 
{$adopt->magic}</li>
                                    </ul>"
));
        
$summary->add(new Comment("{$this->lang->gave}{$adopt->getName()} one {$this->lang->unit}."));
        
$summary->add(new Comment($this->lang->encourage));
        
$summary->add(new Comment("<br> You have earned {$reward} {$mysidia->settings->cost} for leveling up this cat. "));
        
$summary->add(new Comment("You now have {$mysidia->user->getcash()} {$mysidia->settings->cost}"));
        
$document->add($summary);            
    } 
And, just to make things even more fun, I'm also having a funny issue with the item that raises the stat. For some reason instead of adding +1 to the stat, it sets the stat itself to 1. I'll play around with this, though, and see if I can get it to work by studying the other functions more.

Edit:
OK, I got the function to work by doing this;
PHP Code:
 function items_magic($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$magic $mysidia->db->select("owned_adoptables", array("magic"), "aid='{$adopt->aid}'");
  
$newmagic $magic $item->value;
  
$mysidia->db->update("owned_adoptables", array("magic" => $newmagic), "aid='{$adopt->aid}'and owner='{$item->owner}'");
  
$note "By using {$item->itemname}, the cat's magical skill has raised by {$item->value}! This cat now has {$newmagic} skill!<br>";
    
//Update item quantity...
  
$delitem $item->remove(); 
  return 
$note;

So at least I fixed that issue ^^
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 01-13-2016 at 06:49 AM.
Reply With Quote