16
General SMFShop Discussion / Re: SMFPets is Finally Here (0.1 out)
« on: March 24, 2007, 01:54:01 pm »
is it normal for the use skill area to disappear?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
ok, first the two files, one restores used akill points rather than wait until the next day...the max ap (skill oints) raises the maximum number of skill points your pet can have.
<?php
if (!class_exists(pet_Siamese_pet)) { //Make sure name matches php file
class pet_Siamese_pet extends petTemplate { //Make sure name matches php file
function load_breed() {
$this->breed = 'Siamese Cat'; //The name of the breed(Use _ instead of whitespace or else Baby Jesus will cry)
$this->breed_desc = 'This is a Siamese Cat'; //The description of the breed.
$this->price = 2000; //The price to purchase one of these pets
$this->breed_img = 'siamese.gif'; //The img file of the breed
$this->skills_cnt = 4; //The number of skills the pet can use
//Sample skill. For each addtional skill, increase the index by one.(So your next skill would be $this->skill[1])
$this->skill[0] = new skill; //Required for making new skills.
$this->skill[0]->name = "Purr"; //Name of skill
$this->skill[0]->level_learn = 1; //Level the pet learns the skill
$this->skill[0]->level_max = 2; //Level the pet masters the skill
$this->skill[0]->cost = 1; //Cost, in skill points, of the skill.
$this->skill[1] = new skill;
$this->skill[1]->name = "Use Litter Box";
$this->skill[1]->level_learn = 2;
$this->skill[1]->level_max = 4;
$this->skill[1]->cost = 3;
$this->skill[2] = new skill;
$this->skill[2]->name = "Tree Climb";
$this->skill[2]->level_learn = 5;
$this->skill[2]->level_max = 10;
$this->skill[2]->cost = 8;
$this->skill[3] = new skill;
$this->skill[3]->name = "Premier Cat Show Worthy";
$this->skill[3]->level_learn = 10;
$this->skill[3]->level_max = 20;
$this->skill[3]->cost = 20;
}
//Sample skill function. A different function is needed for each skill. Skill function should be named "use_skill_i" where i is that skills index.
//Code these skills like you would code the action part of items. Currently input cannot be given into skills. Sorry.
function use_skill_0() {
global $db_prefix, $ID_MEMBER;
return "{$this->name} has learned to Purr!";
}
function use_skill_1() {
global $db_prefix, $ID_MEMBER;
$value = mt_rand(30,600);
$result = db_query("UPDATE {$db_prefix}members SET money = money + {$value} WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return ($this->name . 'learned to use the litter box and "materialized"' . formatMoney($value) / ' tokens for you!');
}
function use_skill_2() {
global $db_prefix, $ID_MEMBER;
$value = mt_rand(80,1600);
$result = db_query("UPDATE {$db_prefix}members SET money = money + {$value} WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return "{$this->name} climbs a near-by tree and drops down ".formatMoney($value)." tokens!";
}
function use_skill_3() {
global $db_prefix, $ID_MEMBER;
$value = mt_rand(200,4000);
$result = db_query("UPDATE {$db_prefix}members SET money = money + {$value} WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return "{$this->name} place in a Premier Cat Show and earned you ".formatMoney($value)." tokens!";
}
}
}
?>
function use_skill_2() {
global $db_prefix, $ID_MEMBER;
$value = mt_rand(1,5);
$result = db_query("UPDATE {$db_prefix}members SET maxap = maxap + {$value} WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return "{$this->name} climbs a near-by tree and drops down ".$value." to your skill points!";
}
<div class="signature">', $message['member']['signature'], '</div>';
//BEGIN SMFShop Profile Images Item 0.1 Beta
global $db_prefix, $boardurl;
$result_flag = db_query("SELECT shop_Flag
FROM {$db_prefix}members
WHERE ID_MEMBER = {$message['member']['id']}
LIMIT 1", __FILE__, __LINE__);
$row_flag = mysql_fetch_assoc($result_flag);
// Is there a flag set?
if ($row_flag['shop_Flag'] !== '')
{
// Output the text at the start
echo '
<hr width="100%" size="1" class="hrcolor" />';
echo 'Icons: <br />' ;
// Get the flags into an array
$flags = explode(',', $row_flag['shop_Flag']);
// Loop through the array
foreach ($flags as $flag)
{
// Is the flag real (not a blank string)?
if ($flag != '')
echo '<img src="', $boardurl, '/Sources/shop/flag_images/', $flag, '"> ';
}
// Insert a line break
echo '<br />';
}
//END SMFShop Icon Item
What do you mean by "not working"?
If its something like, you send the mail, but it doesnt arrive, are you using Hotmail? For some reason, Hotmail likes to delete emails from some servers. Still havent looked into how to get around this.