Екстендет.))
Код:
Index: include/functions.php
===================================================================
--- include/functions.php (revision 39)
+++ include/functions.php (working copy)
@@ -976,6 +976,14 @@
return "Unknown item - $item_id";
}
+function getItemFlags2($item_id)
+{
+ global $dDB, $config;
+ $item = $dDB->selectCell("-- CACHE: 1h
+ SELECT `Flags2` FROM `item_template` WHERE `entry` = ?d", $item_id);
+ return $item;
+}
+
function getItemBonusText($i, $amount)
{
global $iBonus;
Index: include/item_table.php
===================================================================
--- include/item_table.php (revision 39)
+++ include/item_table.php (working copy)
@@ -62,7 +62,14 @@
define('ITEM_FLAGS_BOA', 0x08000000); // bind on account
define('ITEM_FLAGS_ENCHANTER_SCROLL',0x10000000);
define('ITEM_FLAGS_MILLABLE', 0x20000000);
+define('ITEM_FLAGS_BOP_TRADEABLE', 0x80000000);
+// Флаги поля ITEM_FIELD_FLAGS2
+define('ITEM_FLAGS2_HORDE_ONLY', 0x00000001);
+define('ITEM_FLAGS2_ALLIANCE_ONLY', 0x00000002);
+define('ITEM_FLAGS2_EXT_COST_REQUIRES_GOLD', 0x00000004);
+define('ITEM_FLAGS2_NEED_ROLL_DISABLED', 0x00000100);
+
// Флаги BAG_FAMILY_MASK
define('BAG_FAMILY_MASK_ARROWS', 0x00000001);
define('BAG_FAMILY_MASK_BULLETS', 0x00000002);
Index: include/report_generator.php
===================================================================
--- include/report_generator.php (revision 39)
+++ include/report_generator.php (working copy)
@@ -462,7 +462,7 @@
echo "<TR>";
if ($loot['mincountOrRef'] > 0)
{
- if ($item = GetItem($loot['item'],"`entry`, `Quality`, `name`, `displayid`"))
+ if ($item = getItem($loot['item'],"`entry`, `Quality`, `name`, `displayid`"))
{
echo '<TD class=i_ico>';r_itemIcon($item);echo '</TD>';
echo '<TD class=left>';r_itemName($item);echo '</TD>';
@@ -545,19 +545,14 @@
// Vendor
function r_vendorCost($data)
{
+ $flags2 = getItemFlags2($data['entry']);
if ($data['ExtendedCost']>0)
{
- if ($cost = getExtendCost(abs($data['ExtendedCost'])))
- r_excostCost($cost);
+ $cost = getExtendCost($data['ExtendedCost']);
+ if ($flags2&ITEM_FLAGS2_EXT_COST_REQUIRES_GOLD)
+ echo money($data['BuyPrice']).''.r_excostCost($cost);
else
- echo 'Ex cost '.abs($data['ExtendedCost']);
- }
- if ($data['ExtendedCost']<0)
- {
- if ($cost = getExtendCost(abs($data['ExtendedCost'])))
r_excostCost($cost);
- else
- echo 'Ex cost '.money($data['BuyPrice']).''.abs($data['ExtendedCost']);
}
else
echo money($data['BuyPrice']);