-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloot_function.php
63 lines (61 loc) · 1.94 KB
/
loot_function.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
function get_loot($table, $loot)
{
$entry=$_GET['entry'];
if ($entry != "")
{
if($loot != "other" AND $loot != "data1")
{
$query_loot=mysql_query("SELECT $loot FROM creature_template WHERE entry=$entry");
while($row_loot=mysql_fetch_array($query_loot))
{
$loot_id=$row_loot['$loot'];
}
}
if($loot == "data1")
{
$query_loot=mysql_query("SELECT data1 FROM gameobject_template WHERE entry=$entry");
while($row_loot=mysql_fetch_array($query_loot))
{
$loot_id=$row_loot['data1'];
}
}
if($loot_id==0)
{
$loot_id=$entry;
}
$count=0;
$query=mysql_query("SELECT * FROM $table WHERE entry=$loot_id ORDER BY item");
while ($row=mysql_fetch_array($query))
{
$count++;
if ($loot_id == "")
{
$loot_id="";
$row="";
}
$items_names=mysql_query("SELECT name FROM item_template WHERE entry IN (SELECT item FROM $table WHERE entry=$loot_id AND item={$row['item']})");
$item_name="";
while($row_items=mysql_fetch_array($items_names))
{
if($row['mincountOrRef'] >= 0)
{
$item_name=$row_items['name'];
}
}
?>
<tr id="<?php echo $count; ?>" OnClick="remove_target(); document.getElementById('<?php echo $count; ?>').className='target'; get_values(<?php echo $loot_id.",".htmlspecialchars($row['item']).",".htmlspecialchars($row['ChanceOrQuestChance']).",".htmlspecialchars($row['groupid']).",".htmlspecialchars($row['mincountOrRef']).",".htmlspecialchars($row['maxcount']).",".htmlspecialchars($row['lootmode']); ?>);">
<td ><?php echo $loot_id; ?></td>
<td ><?php echo htmlspecialchars($row['item']); ?></td>
<td ><?php echo htmlspecialchars($row['ChanceOrQuestChance']); ?></td>
<td ><?php echo htmlspecialchars($row['lootmode']); ?></td>
<td ><?php echo htmlspecialchars($row['groupid']); ?></td>
<td ><?php echo htmlspecialchars($row['mincountOrRef']); ?></td>
<td ><?php echo htmlspecialchars($row['maxcount']); ?></td>
<td ><?php echo $item_name; ?></td>
</tr>
<?php
}
}
}
?>