[little correction] On Bylol32/BBim and EnmanuelProx CP

Elite Diviner
Joined
Oct 5, 2008
Messages
464
Reaction score
1
corrections in red!!!

to make rebirth work

Code:
      if ($act == 'reborn')
      {
         $id = $_GET["charid"];
         $matchrows = mysql_query("SELECT * FROM characters AS c INNER JOIN accounts AS a ON a.username = c.accountname WHERE c.id = $id AND a.username = '$user'");
         $checkrows = mysql_num_rows($matchrows);
         if ($checkrows != 0)
         {
            $id = $_GET["charid"];
            $query = mysql_query("SELECT * FROM characters WHERE id = $id");
            $get = mysql_fetch_array($query);
            $class = $get['class'];
            $lvl = $get['level'];
            $rebirths = $get['rebirths'];
[SIZE="4"][COLOR="Red"]add   ``$penya = $get['penya'];``  here!!![/COLOR][/SIZE]
            
            if (($lvl == 120) && ($class >= 24) && ($class <= 31) && ($rebirths < $maxrebirths) && ($penya >= $rebirthcost))
            {
               if ($class == 24) { mysql_query("UPDATE characters SET class = 6 WHERE id = $id"); }
               if ($class == 25) { mysql_query("UPDATE characters SET class = 7 WHERE id = $id"); }
               if ($class == 26) { mysql_query("UPDATE characters SET class = 8 WHERE id = $id"); }
               if ($class == 27) { mysql_query("UPDATE characters SET class = 9 WHERE id = $id"); }
               if ($class == 28) { mysql_query("UPDATE characters SET class = 10 WHERE id = $id"); }
               if ($class == 29) { mysql_query("UPDATE characters SET class = 11 WHERE id = $id"); }
               if ($class == 30) { mysql_query("UPDATE characters SET class = 12 WHERE id = $id"); }
               if ($class == 31) { mysql_query("UPDATE characters SET class = 13 WHERE id = $id"); }
               
               mysql_query("UPDATE characters SET level = 60 WHERE id = $id");
               mysql_query("UPDATE characters SET posWorldID = 1 WHERE id = $id");
               mysql_query("UPDATE characters SET posX = 6973 WHERE id = $id");
               mysql_query("UPDATE characters SET posY = 10 WHERE id = $id");
               mysql_query("UPDATE characters SET posZ = 3328 WHERE id = $id");
               mysql_query("UPDATE characters SET rebirths = rebirths + 1 WHERE id = $id");
			   mysql_query("UPDATE characters SET penya = $penya - $rebirthcost WHERE id = $id");
               
               if (mysql_affected_rows() != 0)
			   {
                  echo "<center><h3>Character has successfully been rebirth!</h3></center>";
               }
               else
               {
                  echo "<center><h3>An error has occured, please try again.</h3></center>";
               }
            }
            else
            {
               echo "<center><h3>Your character can not yet be rebirth. You must be level 120 HERO and get 20000000 of penya.</h3></center>";
            }
        }
    }
      if ($act == 'transy')
   {
         $id = $_GET["charid"];
          $matchrows = mysql_query("SELECT * FROM characters AS c INNER JOIN accounts AS a ON a.username = c.accountname WHERE c.id = $id AND a.username = '$user'");
          $checkrows = @mysql_num_rows($matchrows);
          if ($checkrows != 0)
          {
            $id = $_GET['charid'];
            $query = mysql_query("SELECT * FROM characters WHERE id = $id");
            $get = @mysql_fetch_array($query);
            $sex = $get['sex'];
            if ($sex == 1) 
            { 
            mysql_query("UPDATE characters SET sex = 0 WHERE id = $id"); 
            echo "<center><h3>Congratulations! Your character is now Male.</h3></center>";
            }
            if ($sex == 0) 
            { 
            mysql_query("UPDATE characters SET sex = 1 WHERE id = $id");
            echo "<center><h3>Congratulations! Your character is now Female.</h3></center>";
            }
            if (mysql_affected_rows() == 0)
            {
               echo "<center><h3>An error has occured, please try again.</h3></center>";
			}
		}


And now for the ultimate maker

Code:
	if ($act == 'ulti')
	{
			{
				$id = $_GET["charid"];
				$query = mysql_query("select * from characters AS c INNER JOIN accounts AS a ON a.username = c.accountname WHERE c.id = $id AND a.username = '$user'") or die(mysql_error());
				$checkrows = mysql_num_rows($query);
				if ($checkrows != 0)
				{
[COLOR="Red"]->[/COLOR]			$ccQuery = mysql_query("SELECT * FROM `inventory` WHERE `charid` = '$id' AND `refine`='10  [COLOR="red"]add  `` AND inventoryslot = 0`` here and just put the weapon in 1rst slot[/COLOR]'");
					$char = mysql_fetch_assoc($ccQuery);
					$itemid = $char['itemid'];
					$ultiid = NULL;
					
					//Guardian Ambidextrous Axe
					if($itemid == '22038')
					{
					$ultiid = '22383';
					}
					//Guardian Axe
					if($itemid == '22034')
					{
					$ultiid = '20378';
					}
					//Guardian Big Sword
					if($itemid == '22030')
					{
					$ultiid = '22373';
					}
					//Guardian Bow
					if($itemid == '22050')
					{
					$ultiid = '22398';
					}
					//Guardian Knuckle
					if($itemid == '22042')
					{
					$ultiid = '22388';
					}
					//Guardian Staff
					if($itemid == '22062')
					{
					$ultiid = '22413';
					}
					//Guardian Stick
					if($itemid == '22046')
					{
					$ultiid = '22393';
					}
					//Guardian Sword 
					if($itemid == '22026')
					{
					$ultiid = '22368';
					}
					//Guardian Wand
					if($itemid == '22058')
					{
					$ultiid = '22408';
					}
					//Guardian Yo-Yo
					if($itemid == '22054')
					{
					$ultiid = '22403';
					}
					
					//Historic Ambidextrous Axe
					if($itemid == '22039')
					{
					$ultiid = '22384';
					}
					//Historic Axe 
					if($itemid == '22035')
					{
					$ultiid = '22379';
					}
					//Historic Big Sword
					if($itemid == '22031')
					{
					$ultiid = '22374';
					}
					//Historic Bow
					if($itemid == '22051')
					{
					$ultiid = '22399';
					}
					//Historic Knuckle
					if($itemid == '22043')
					{
					$ultiid = '22389';
					}
					//Historic Staff
					if($itemid == '22063')
					{
					$ultiid = '22414';
					}
					//Historic Stick
					if($itemid == '22047')
					{
					$ultiid = '22394';
					}
					//Historic Sword
					if($itemid == '22027')
					{
					$ultiid = '22369';
					}
					//Historic Wand
					if($itemid == '22059')
					{
					$ultiid = '22409';
					}
					//Historic Yo-Yo
					if($itemid == '22055')
					{
					$ultiid = '22404';
					}
					
					//Angel Axe
					if($itemid == '22036')
					{
					$ultiid = '22380';
					}
					//Angel Big Sword
					if($itemid == '22032')
					{
					$ultiid = '22375';
					}
					//Angel Bow
					if($itemid == '22052')
					{
					$ultiid = '22400';
					}
					//Angel Glove
					if($itemid == '22044')
					{
					$ultiid = '22390';
					}
					//Angel Staff
					if($itemid == '22064')
					{
					$ultiid = '22415';
					}
					//Angel Stick
					if($itemid == '22048')
					{
					$ultiid = '22395';
					}
					//Angel Sword
					if($itemid == '22028')
					{
					$ultiid = '22370';
					}
					//Angel Wand
					if($itemid == '22060')
					{
					$ultiid = '22410';
					}
					//Angel Yo-Yo
					if($itemid == '22056')
					{
					$ultiid = '22405';
					}
					
					//Legendary Big Golden Axe
					if($itemid == '22041')
					{
					$ultiid = '22386';
					}
					//Legendary Golden Axe
					if($itemid == '22037')
					{
					$ultiid = '22381';
					}
					//Legendary Golden Big Sword
					if($itemid == '22033')
					{
					$ultiid = '22376';
					}
					//Legendary Golden Bow
					if($itemid == '22053')
					{
					$ultiid = '22401';
					}
					//Legendary Golden Gloves 
					if($itemid == '22045')
					{
					$ultiid = '22391';
					}
					//Legendary Golden Staff
					if($itemid == '22065')
					{
					$ultiid = '22416';
					}
					//Legendary Golden Stick
					if($itemid == '22049')
					{
					$ultiid = '22396';
					}
					//Legendary Golden Sword
					if($itemid == '22029')
					{
					$ultiid = '22371';
					}
					//Legendary Golden Wand
					if($itemid == '22061')
					{
					$ultiid = '22411';
					}
					//Legendary Golden Yo-Yo
					if($itemid == '22057')
					{
					$ultiid = '22406';
					}
					
					//Bloody Axe
					if($itemid == '22356')
					{
					$ultiid = '22382';
					}
					//Bloody Two-Handed Axe
					if($itemid == '22357')
					{
					$ultiid = '22375';
					}
					//Bloody Bow
					if($itemid == '22363')
					{
					$ultiid = '22402';
					}
					//Bloody Knuckle
					if($itemid == '22358')
					{
					$ultiid = '22392';
					}
					//Bloody Staff
					if($itemid == '22361')
					{
					$ultiid = '22417';
					}
					//Bloody Stick
					if($itemid == '22359')
					{
					$ultiid = '22397';
					}
					//Bloody Sword
					if($itemid == '22354')
					{
					$ultiid = '22372';
					}
					//Bloody Wand
					if($itemid == '22360')
					{
					$ultiid = '22412';
					}
					//Bloody Yo-Yo
					if($itemid == '22362')
					{
					$ultiid = '22407';
					}
					//Bloody Slayer
					if($itemid == '22355')
					{
					$ultiid = '22377';
					}
					if ($ultiid != NULL)
					{
					
						$sql = "UPDATE `inventory` SET `itemid` = '".$ultiid."',`refine` = '0' WHERE `itemid` = '".$itemid."' AND `charid` = '".$id."'";
						
					
						if(mysql_query($sql)){
						
							echo "<h3><center>Have fun with your new Ultimate Weapon!</center></h3>";
							
						}else{
						
						
							echo "Mistake";
						
						
						}	
					}
					else
					{
						echo "<h3><center>You don't have any green weapon +10 in your inventary!</center></h3>";
					}
				}
			}
			}
 
And now for the ultimate maker

Code:
	if ($act == 'ulti')
	{
			{
				$id = $_GET["charid"];
				$query = mysql_query("select * from characters AS c INNER JOIN accounts AS a ON a.username = c.accountname WHERE c.id = $id AND a.username = '$user'") or die(mysql_error());
				$checkrows = mysql_num_rows($query);
				if ($checkrows != 0)
				{
[COLOR="Red"]->[/COLOR]			$ccQuery = mysql_query("SELECT * FROM `inventory` WHERE `charid` = '$id' AND `refine`='10  [COLOR="red"]add  `` AND inventoryslot = 0`` here and just put the weapon in 1rst slot[/COLOR]'");
					$char = mysql_fetch_assoc($ccQuery);
					$itemid = $char['itemid'];
					$ultiid = NULL;
					
					//Guardian Ambidextrous Axe
					if($itemid == '22038')
					{
					$ultiid = '22383';
					}
					//Guardian Axe
					if($itemid == '22034')
					{
					$ultiid = '20378';
					}
					//Guardian Big Sword
					if($itemid == '22030')
					{
					$ultiid = '22373';
					}
					//Guardian Bow
					if($itemid == '22050')
					{
					$ultiid = '22398';
					}
					//Guardian Knuckle
					if($itemid == '22042')
					{
					$ultiid = '22388';
					}
					//Guardian Staff
					if($itemid == '22062')
					{
					$ultiid = '22413';
					}
					//Guardian Stick
					if($itemid == '22046')
					{
					$ultiid = '22393';
					}
					//Guardian Sword 
					if($itemid == '22026')
					{
					$ultiid = '22368';
					}
					//Guardian Wand
					if($itemid == '22058')
					{
					$ultiid = '22408';
					}
					//Guardian Yo-Yo
					if($itemid == '22054')
					{
					$ultiid = '22403';
					}
					
					//Historic Ambidextrous Axe
					if($itemid == '22039')
					{
					$ultiid = '22384';
					}
					//Historic Axe 
					if($itemid == '22035')
					{
					$ultiid = '22379';
					}
					//Historic Big Sword
					if($itemid == '22031')
					{
					$ultiid = '22374';
					}
					//Historic Bow
					if($itemid == '22051')
					{
					$ultiid = '22399';
					}
					//Historic Knuckle
					if($itemid == '22043')
					{
					$ultiid = '22389';
					}
					//Historic Staff
					if($itemid == '22063')
					{
					$ultiid = '22414';
					}
					//Historic Stick
					if($itemid == '22047')
					{
					$ultiid = '22394';
					}
					//Historic Sword
					if($itemid == '22027')
					{
					$ultiid = '22369';
					}
					//Historic Wand
					if($itemid == '22059')
					{
					$ultiid = '22409';
					}
					//Historic Yo-Yo
					if($itemid == '22055')
					{
					$ultiid = '22404';
					}
					
					//Angel Axe
					if($itemid == '22036')
					{
					$ultiid = '22380';
					}
					//Angel Big Sword
					if($itemid == '22032')
					{
					$ultiid = '22375';
					}
					//Angel Bow
					if($itemid == '22052')
					{
					$ultiid = '22400';
					}
					//Angel Glove
					if($itemid == '22044')
					{
					$ultiid = '22390';
					}
					//Angel Staff
					if($itemid == '22064')
					{
					$ultiid = '22415';
					}
					//Angel Stick
					if($itemid == '22048')
					{
					$ultiid = '22395';
					}
					//Angel Sword
					if($itemid == '22028')
					{
					$ultiid = '22370';
					}
					//Angel Wand
					if($itemid == '22060')
					{
					$ultiid = '22410';
					}
					//Angel Yo-Yo
					if($itemid == '22056')
					{
					$ultiid = '22405';
					}
					
					//Legendary Big Golden Axe
					if($itemid == '22041')
					{
					$ultiid = '22386';
					}
					//Legendary Golden Axe
					if($itemid == '22037')
					{
					$ultiid = '22381';
					}
					//Legendary Golden Big Sword
					if($itemid == '22033')
					{
					$ultiid = '22376';
					}
					//Legendary Golden Bow
					if($itemid == '22053')
					{
					$ultiid = '22401';
					}
					//Legendary Golden Gloves 
					if($itemid == '22045')
					{
					$ultiid = '22391';
					}
					//Legendary Golden Staff
					if($itemid == '22065')
					{
					$ultiid = '22416';
					}
					//Legendary Golden Stick
					if($itemid == '22049')
					{
					$ultiid = '22396';
					}
					//Legendary Golden Sword
					if($itemid == '22029')
					{
					$ultiid = '22371';
					}
					//Legendary Golden Wand
					if($itemid == '22061')
					{
					$ultiid = '22411';
					}
					//Legendary Golden Yo-Yo
					if($itemid == '22057')
					{
					$ultiid = '22406';
					}
					
					//Bloody Axe
					if($itemid == '22356')
					{
					$ultiid = '22382';
					}
					//Bloody Two-Handed Axe
					if($itemid == '22357')
					{
					$ultiid = '22375';
					}
					//Bloody Bow
					if($itemid == '22363')
					{
					$ultiid = '22402';
					}
					//Bloody Knuckle
					if($itemid == '22358')
					{
					$ultiid = '22392';
					}
					//Bloody Staff
					if($itemid == '22361')
					{
					$ultiid = '22417';
					}
					//Bloody Stick
					if($itemid == '22359')
					{
					$ultiid = '22397';
					}
					//Bloody Sword
					if($itemid == '22354')
					{
					$ultiid = '22372';
					}
					//Bloody Wand
					if($itemid == '22360')
					{
					$ultiid = '22412';
					}
					//Bloody Yo-Yo
					if($itemid == '22362')
					{
					$ultiid = '22407';
					}
					//Bloody Slayer
					if($itemid == '22355')
					{
					$ultiid = '22377';
					}
					if ($ultiid != NULL)
					{
					
						$sql = "UPDATE `inventory` SET `itemid` = '".$ultiid."',`refine` = '0' WHERE `itemid` = '".$itemid."' AND `charid` = '".$id."'";
						
					
						if(mysql_query($sql)){
						
							echo "<h3><center>Have fun with your new Ultimate Weapon!</center></h3>";
							
						}else{
						
						
							echo "Mistake";
						
						
						}	
					}
					else
					{
						echo "<h3><center>You don't have any green weapon +10 in your inventary!</center></h3>";
					}
				}
			}
			}

This change is wrong.
PHP:
[COLOR="Red"]->[/COLOR]			$ccQuery = mysql_query("SELECT * FROM `inventory` WHERE `charid` = '$id' AND `refine`='10  [COLOR="red"]add  `` AND inventoryslot = 0`` here and just put the weapon in 1rst slot[/COLOR]'");

So you select the inventory slot 0, and if there is not that item that item, go to do a error.

This is the correct
PHP:
$ccQuery = mysql_query("SELECT * FROM `inventory` WHERE `charid` = '$id' AND `refine`='10' ");

This will search the item, from the list, and then will replace. It's not need inventory slot, so willl search in all inventory
 
caja....it doesnt work if you dont tell it to go in the slot....i just say that you have no +10 green item....thats why i changed it
 
Caja, if you dont put inventory slot it will take just the first register, who knows which it will be? Slot 0, 1, 10,30?
You would need a loop to go into all registers, php wont do it for you lol
 
her my problem Notice: Undefined index: rebirths in C:\wamp\www\flyfortrouble\Change\changejob.php on line 1034

Notice: Undefined variable: penya in C:\wamp\www\flyfortrouble\Change\changejob.php on line 1036
Your character can not yet be rebirth. You must be level 120 HERO and get 20000000 of penya.
 
Back