Guest User

Untitled

a guest
May 20th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.72 KB | None | 0 0
  1. <?php include "config/sitedb.php" ?>
  2.  
  3. <?php
  4.  
  5.  
  6. $connect = mysql_connect($host,$user,$pass) or die(mysql_error());
  7. mysql_select_db($db, $connect);
  8.  
  9. if(isset($_GET['armor_type']) && isset($_GET['armor'])) {
  10.     $armor_type = mysql_real_escape_string($_GET['armor_type']);
  11.     $armor = mysql_real_escape_string($_GET['armor']);
  12.      
  13.     $sql = "SELECT * FROM armor WHERE name = '$armor'";
  14.     $res = mysql_query($sql) or die(mysql_error());
  15.     $details = mysql_fetch_assoc($res);
  16.  
  17.         $sql2 = "SELECT * FROM droplist WHERE item_name = '$armor' ORDER by chance DESC";
  18.         $res2 = mysql_query($sql2) or die(mysql_error());
  19.         $details2 = mysql_fetch_assoc($res2);
  20.  
  21.         $query = ("SELECT item_name FROM character_items WHERE item_name = '$armor'");
  22.  
  23.         $link = mysql_query($query);
  24.         $i=0;
  25.  
  26.          while ($row=mysql_fetch_row($link))
  27.          {
  28.          $i++;
  29.          }  
  30.  
  31.         $query2 = ("SELECT item_name FROM character_warehouse WHERE item_name = '$armor'");
  32.  
  33.         $link2 = mysql_query($query2);
  34.          while ($row=mysql_fetch_row($link2))
  35.          {
  36.          $i++;
  37.          }  
  38.  
  39.         $query3 = ("SELECT item_name FROM character_elf_warehouse WHERE item_name = '$armor'");
  40.  
  41.         $link3 = mysql_query($query3);
  42.          while ($row=mysql_fetch_row($link3))
  43.          {
  44.          $i++;
  45.          }  
  46.  
  47.         $query4 = ("SELECT item_name FROM clan_warehouse WHERE item_name = '$armor'");
  48.  
  49.         $link4 = mysql_query($query4);
  50.          while ($row=mysql_fetch_row($link4))
  51.          {
  52.          $i++;
  53.          }  
  54.  
  55.     echo "<center><font face=\"verdana\" size=\"4\" color=\"#00ccff\">".$details['name']."</font></center>";
  56.         echo "<br>";
  57.     echo "<table align=\"center\" cellpadding=\"2\" cellspacing=\"2\" border=\"2\">";
  58.         echo "<th width=\"82\" height=\"82\"><center><img width=\"77\" height=\"77\" src=\"scripts/acm/inv_gfx/".$details['invgfx'].".png\"/></center></hd>";
  59.         echo "</table>";
  60.         echo "<br>";
  61.         echo "<center><font face=\"verdana\" color=\"red\">Server Count: (".$i.")</font></center>";
  62.         echo "<br>";
  63.         echo "<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
  64.  
  65.  
  66.        if ($details['use_royal'] == "1")
  67.            $royal = " Royal ";
  68.        if ($details['use_knight'] == "1")
  69.            $knight = " Knight ";
  70.        if ($details['use_elf'] == "1")
  71.            $elf = " Elf ";
  72.        if ($details['use_mage'] == "1")
  73.            $mage = " Mage ";
  74.        if ($details['use_darkelf'] == "1")
  75.            $de = " Dark Elf ";
  76.        if ($details['use_dragonknight'] == "1")
  77.            $dk = " Dragonknight ";
  78.        if ($details['use_illusionist'] == "1")
  79.            $illusionist = " Illusionist ";
  80.  
  81.  
  82.         echo "<tr><td width=\"50\"><font color=\"green\">Usable: </font></td><td width=\"180\"><font color=\"#00ccff\">".$royal.$knight.$elf.$mage.$de.$dk.$illusionist."</font></td></tr>";
  83.         echo "</table>";
  84.         echo "<br>";
  85.         echo "<table align=\"center\" cellpadding=\"2\" cellspacing=\"2\" border=\"2\">";
  86.         echo "<tr><td width=\"180\"><font color=\"orange\">Armor Class</font></td><td width=\"180\"><font color=\"black\">".$details['ac']."</font></td></tr>";
  87.         echo "<tr><td width=\"180\"><font color=\"orange\">Safe</font></td><td width=\"180\"><font color=\"black\">".$details['safenchant']."</font></td></tr>";
  88.         echo "<tr><td width=\"180\"><font color=\"orange\">Sockets</font></td><td width=\"180\"><font color=\"black\">".$details['maxrunes']."</font></td></tr>";
  89.     echo "<tr><td width=\"180\"><font color=\"orange\">Type</font></td><td width=\"180\"><font color=\"black\">".$armor_type."</font></td></tr>";
  90.     echo "<tr><td width=\"180\"><font color=\"orange\">Material</font></td><td width=\"180\"><font color=\"black\">".$details['material']."</font></td></tr>";
  91.     echo "<tr><td width=\"180\"><font color=\"orange\">Weight</font></td><td width=\"180\"><font color=\"black\">".$details['weight']."</font></td></tr>";
  92.         echo "<tr><td width=\"180\"><font color=\"orange\">Required Level</font></td><td width=\"180\"><font color=\"black\">".$details['min_lvl']."</font></td></tr>";
  93.         echo "<tr><td width=\"180\"><font color=\"orange\">Required PvP Level</font></td><td width=\"180\"><font color=\"black\">".$details['minpvplevel']."</font></td></tr>";
  94.     echo "<tr><td width=\"180\"><font color=\"orange\">Bow Hit</font></td><td width=\"180\"><font color=\"black\">".$details['bow_hit_modifier']."</font></td></tr>";
  95.     echo "<tr><td width=\"180\"><font color=\"orange\">Bow Damage</font></td><td width=\"180\"><font color=\"black\">".$details['bow_dmg_modifier']."</font></td></tr>";
  96.         echo "<tr><td width=\"180\"><font color=\"orange\">Weapon Hit</font></td><td width=\"180\"><font color=\"black\">".$details['hit_modifier']."</font></td></tr>";
  97.         echo "<tr><td width=\"180\"><font color=\"orange\">Weapon Damage</font></td><td width=\"180\"><font color=\"black\">".$details['dmg_modifier']."</font></td></tr>";
  98.  
  99.  echo "<tr><td width=\"180\"><font color=\"orange\">Damage Reduction</font></td><td width=\"180\"><font color=\"black\">".$details['damage_reduction']."</font></td></tr>";
  100.  echo "<tr><td width=\"180\"><font color=\"orange\">Weight Reduction</font></td><td width=\"180\"><font color=\"black\">".$details['weight_reduction']."</font></td></tr>";
  101.  
  102.  
  103.         echo "<tr><td width=\"180\"><font color=\"orange\">Magic Defense</font></td><td width=\"180\"><font color=\"black\">".$details['m_def']."</font></td></tr>";
  104.  echo "<tr><td width=\"180\"><font color=\"orange\">Fire Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['defense_fire']."</font></td></tr>";
  105.  echo "<tr><td width=\"180\"><font color=\"orange\">Water Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['defense_water']."</font></td></tr>";
  106.  echo "<tr><td width=\"180\"><font color=\"orange\">Wind Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['defense_wind']."</font></td></tr>";
  107.  echo "<tr><td width=\"180\"><font color=\"orange\">Earth Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['defense_earth']."</font></td></tr>";
  108. echo "<tr><td width=\"180\"><font color=\"orange\">Stun Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['regist_stun']."</font></td></tr>";
  109. echo "<tr><td width=\"180\"><font color=\"orange\">Stone Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['regist_stone']."</font></td></tr>";
  110. echo "<tr><td width=\"180\"><font color=\"orange\">Sleep Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['regist_sleep']."</font></td></tr>";
  111. echo "<tr><td width=\"180\"><font color=\"orange\">Freeze Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['regist_freeze']."</font></td></tr>";
  112. echo "<tr><td width=\"180\"><font color=\"orange\">Sustain Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['regist_sustain']."</font></td></tr>";
  113. echo "<tr><td width=\"180\"><font color=\"orange\">Blind Resistance</font></td><td width=\"180\"><font color=\"black\">".$details['regist_blind']."</font></td></tr>";
  114.         echo "<tr><td width=\"180\"><font color=\"orange\">STR</font></td><td width=\"180\"><font color=\"black\">".$details['add_str']."</font></td> </tr>";
  115.         echo "<tr><td width=\"180\"><font color=\"orange\">INT</font></td><td width=\"180\"><font color=\"black\">".$details['add_int']."</font></td> </tr>";
  116.         echo "<tr><td width=\"180\"><font color=\"orange\">DEX</font></td><td width=\"180\"><font color=\"black\">".$details['add_dex']."</font></td> </tr>";
  117.         echo "<tr><td width=\"180\"><font color=\"orange\">CON</font></td><td width=\"180\"><font color=\"black\">".$details['add_con']."</font></td> </tr>";
  118.         echo "<tr><td width=\"180\"><font color=\"orange\">WIS</font></td><td width=\"180\"><font color=\"black\">".$details['add_wis']."</font></td> </tr>";
  119.         echo "<tr><td width=\"180\"><font color=\"orange\">CHA</font></td><td width=\"180\"><font color=\"black\">".$details['add_cha']."</font></td> </tr>";
  120.  
  121.        echo "<tr><td width=\"180\"><font color=\"orange\">Spellpower</font></td><td width=\"180\"><font color=\"black\">".$details['add_sp']."</font></td> </tr>";
  122.        
  123. echo "<tr><td width=\"180\"><font color=\"orange\">HP</font></td><td width=\"180\"><font color=\"black\">".$details['add_hp']."</font></td> </tr>";
  124.         echo "<tr><td width=\"180\"><font color=\"orange\">HPR</font></td><td width=\"180\"><font color=\"black\">".$details['add_hpr']."</font></td> </tr>";
  125.         echo "<tr><td width=\"180\"><font color=\"orange\">MP</font></td><td width=\"180\"><font color=\"black\">".$details['add_mp']."</font></td> </tr>";
  126.         echo "<tr><td width=\"180\"><font color=\"orange\">MPR</font></td><td width=\"180\"><font color=\"black\">".$details['add_mpr']."</font></td> </tr>";  
  127.        
  128.         if ($details['hpdrain'] == "1")
  129.            $hpdrain = "Y";
  130.         else
  131.            $hpdrain = "N";
  132.  
  133.         if ($details['mpdrain'] == "1")
  134.            $mpdrain = "Y";
  135.         else
  136.            $mpdrain = "N";
  137.  
  138.        if ($details['canbedmg'] == "1")
  139.            $breakable = "Y";
  140.         else
  141.            $breakable = "N";
  142.  
  143.         if ($details['trade'] == "1")
  144.            $tradeable = "Y";
  145.         else
  146.            $tradeable = "N";
  147.  
  148.        if ($details['cant_delete'] == "0")
  149.            $deleteable = "Y";
  150.         else
  151.            $deleteable = "N";
  152.  
  153.  
  154.         if ($details['haste_item'] == "1")
  155.            $haste = "Y";
  156.         else
  157.            $haste = "N";
  158.            
  159.         echo "<tr><td width=\"180\"><font color=\"orange\">Haste Item</font></td><td width=\"180\"><font color=\"black\">".$haste."</font></td> </tr>";
  160.         echo "<tr><td width=\"180\"><font color=\"orange\">HP Drain</font></td><td width=\"180\"><font color=\"black\">".$hpdrain."</font></td> </tr>";    
  161.         echo "<tr><td width=\"180\"><font color=\"orange\">MP Drain</font></td><td width=\"180\"><font color=\"black\">".$mpdrain."</font></td> </tr>";    
  162.         echo "<tr><td width=\"180\"><font color=\"orange\">Breakable</font></td><td width=\"180\"><font color=\"black\">".$breakable."</font></td> </tr>";
  163.         echo "<tr><td width=\"180\"><font color=\"orange\">Tradable</font></td><td width=\"180\"><font color=\"black\">".$tradeable."</font></td> </tr>";
  164.         echo "<tr><td width=\"180\"><font color=\"orange\">Deleteable</font></td><td width=\"180\"><font color=\"black\">".$deleteable."</font></td> </tr>";
  165.  
  166.  
  167.  
  168.         echo "</table>";
  169.         echo "<br>";
  170.         echo "<center><font color=\"#00ccff\">Dropped By:</font></center>";
  171.         echo "<br>";
  172.         echo "<table align=\"center\" cellpadding=\"2\" cellspacing=\"2\" border=\"2\">";
  173.         echo "<tr><td width=\"250\"><center><font color=\"red\">Monster Name</font></center><td width=\"75\"><center><font color=\"black\">Minimum</font></center></td><td width=\"75\"><center><font color=\"black\">Maximum</font></center></td><td width=\"75\"><center><font color=\"black\">Chance</font></center></td></tr>";
  174.         while($row=mysql_fetch_assoc($res2)) {
  175.               $chance = $row['chance'] / 10000;
  176.     echo "<tr><td width=\"250\"><center><font color=\"green\">".$row['mob_name']."</font></center></td><td width=\"75\"><center><font color=\"orange\">".$row['min']."</font></center></td><td width=\"75\"><center><font color=\"orange\">".$row['max']."</font></center></td><td width=\"75\"><center><font color=\"red\">".$chance."%</font></center></td></tr>";
  177.            $row;
  178.     }
  179.      
  180.     echo "</table>";
  181.  
  182.         echo "<br>";
  183.     echo "<a href=\"armors.php?armor_type=".$armor_type."\">Go Back...</a>";
  184.         echo "<br>";
  185. } elseif(isset($_GET['armor_type'])) {
  186.     $armor_type = mysql_real_escape_string($_GET['armor_type']);
  187.     $sql = "SELECT * FROM armor WHERE type='$armor_type' GROUP BY name";
  188.     $res = mysql_query($sql) or die(mysql_error());
  189.  
  190.     echo "<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"2\">";
  191.     echo "<tr><th>Name</th></tr>";
  192.     while($row=mysql_fetch_assoc($res)) {
  193.         echo "<tr><th width=\"300\" height=\"22\"><a href=\"?armor_type=".$armor_type."&armor=".$row['name']."\">".$row['name']."</a></th></tr>";
  194.     }
  195.     echo "</table>";
  196.     echo "<a href=\"armors.php\">Go Back...</a>";
  197. } else { //If the user didn't click on any armor type
  198.     $sql = "SELECT * FROM armor GROUP BY type";
  199.     $res = mysql_query($sql) or die(mysql_error());
  200.    
  201.     echo "<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"2\">";
  202.     echo "<tr><th>Choose a Armor type</th></tr>";
  203.     while($row=mysql_fetch_assoc($res)) {
  204.         echo "<tr><th width=\"300\" height=\"22\"><a href=\"?armor_type=".$row['type']."\">".$row['type']."</a></th></tr>";
  205.     }
  206.     echo "</table>";
  207.         echo "<a href=\"truedatabase.php\">Go Back...</a>";
  208. }
  209. mysql_close();
  210. ?>
Add Comment
Please, Sign In to add comment