All pastes #938914 Raw Edit

Unbenannt

public text v1 · immutable
·published 2008-03-11 22:52 UTC
rendered paste body
<br><br><center>
<fieldset style="width: 450px;">
	<legend style="color: #ffc700;"><b>LootTester</b></legend>

  <?@session_start();
  include("include/sql.inc.php");
  mysql_select_db($mangosdb,$mangosdaten);

  mysql_connect($db_server, $db_user, $db_pass);
  mysql_select_db($db_name);


  $itemid  = $_POST[itemid];
  $count = $_POST[count];

  function getCreatureName($id)
   {
    $creature_template = mysql_fetch_array( mysql_query("SELECT `name` FROM `creature_template` WHERE `entry`='$id'") );
    return $creature_template['name'];
   }
   
  function getItemName($id)
   {
    $item_template = mysql_fetch_array( mysql_query("SELECT `name` FROM `item_template` WHERE `entry`='$id'") );
    return $item_template['name'];
   }

  function isQuestItem($id)
   {
    $item_template = mysql_fetch_array( mysql_query("SELECT `class`,`bonding` FROM `item_template` WHERE `entry`='$id'") );
    if ($item_template['class'] == 12 && $item_template['bonding'] == 4)
      return true;
      else 
      return false;
   }

  if(is_numeric($itemid) && is_numeric($count)) 
  {
    if (!(isQuestItem($itemid)))
      $result = mysql_query("SELECT `entry`,`item`,round(ChanceOrRef,2) FROM `creature_loot_template` WHERE `item`='$itemid' and `ChanceOrRef`>'0' order by ChanceorRef DESC Limit $count;") OR die(mysql_error());
    else
      $result = mysql_query("SELECT `entry`,`item`,round(QuestChanceOrGroup,2) FROM `creature_loot_template` WHERE `item`='$itemid' order by QuestChanceOrGroup DESC Limit $count;") OR die(mysql_error());
      
    if(mysql_num_rows($result)>0)
    {
      echo "Dropchancen für <b><a href=\"http://www.wowhead.com/?item=$itemid\"> ".getItemName($itemid)."</a></b><br><br>";
      if (isQuestitem($itemid))
      {
        echo "<u>Es handelt sich um ein Questitem</u><br><br>";
      }
      
      echo "<table>";
      echo "<tr><th>Kreatur</th><th>Chance</th></tr>";
      
      while($row = mysql_fetch_array($result))
      {
        $creature = $row[0];
        $chance = $row[2];
        if ($chance>0)
          {
            echo "<tr><td><a href=\"http://www.wowhead.com/?npc=$creature\">".getCreatureName($creature)."</a></td><td>$chance %</td></tr>";
          }
      }
      echo "</table>";
    }
    else
    {
      echo "Das Item wird von keiner Kreatur/keinem Gameobject in unserer Welt gedroppt.";
    }
  }
  elseif (isset($itemid) && isset($count))
  {
    echo "Ungültige Eingabe.";
  }
  ?>
  <form action="loottester.php" method="POST">
    <table border=0>
      <tr>
        <td>ID: <input type="text" name="itemid" maxlength="6" value="<?=$itemid?>"></td>
        <td>Anzahl:
          <SELECT NAME="count">
          <?
          $countanzahl = array("10","25","50","100","150","200","250");
          foreach($countanzahl as $count)
            {?>
            <OPTION VALUE="<?=$count?>" <?if($_POST[count]==$count){echo"SELECTED";}?>><?=$count?></OPTION>
          <?}
          ?>
          </SELECT>
        </td>
      </tr>
      <tr>
        <td colspan=2 align=center><br><input type="submit" name="submit" value="Dropchancen zeigen"></td>
      </tr>
    </table>
</form>
</fieldset>
<br><br>
Mit diesem Feature kannst du testen ob ein Item, das du suchst überhaupt gedroppt wird und dir für den Fall, dass es gedroppt wird anzeigen lassen welche Mobs die höchste Wahrscheinlichkeit haben dein gesuchtes Item zu droppen.<br><br>Items mit Dropchancen unter 0.01% werden aufgrund von Rundungen eventuell nicht angezeigt, diese Items gezielt zu suchen dürfte aber ohnehin ein sinnloses Unterfangen sein ;)
</center>