Core/Items: Fixed disenchanting

This commit is contained in:
Shauren
2012-08-16 16:36:23 +02:00
parent c27dfa224d
commit 69469d5295
4 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -1288,7 +1288,7 @@ struct ItemDisenchantLootEntry
{
uint32 Id;
uint32 ItemClass;
int32 Unk;
int32 ItemSubClass;
uint32 ItemQuality;
uint32 MinItemLevel;
uint32 MaxItemLevel;
+3 -5
View File
@@ -1319,9 +1319,8 @@ bool Item::HasStats() const
}
// used by mail items, transmog cost, stationeryinfo and others
uint32 Item::GetSellPrice(bool& normalSellPrice) const
uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice)
{
ItemTemplate const* proto = GetTemplate();
normalSellPrice = true;
if (proto->Flags2 & ITEM_FLAGS_EXTRA_HAS_NORMAL_PRICE)
@@ -1444,9 +1443,8 @@ uint32 Item::GetSellPrice(bool& normalSellPrice) const
}
}
uint32 Item::GetSpecialPrice(uint32 minimumPrice) const
uint32 Item::GetSpecialPrice(ItemTemplate const* proto, uint32 minimumPrice /*= 10000*/)
{
ItemTemplate const* proto = GetTemplate();
uint32 cost = 0;
if (proto->Flags2 & ITEM_FLAGS_EXTRA_HAS_NORMAL_PRICE)
@@ -1454,7 +1452,7 @@ uint32 Item::GetSpecialPrice(uint32 minimumPrice) const
else
{
bool normalPrice;
cost = GetSellPrice(normalPrice);
cost = Item::GetSellPrice(proto, normalPrice);
if (!normalPrice)
{
+3 -2
View File
@@ -349,7 +349,8 @@ class Item : public Object
bool CanBeTransmogrified() const;
bool CanTransmogrify() const;
static bool CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* transmogrifier);
uint32 GetSpecialPrice(uint32 minimumPrice = 10000) const;
static uint32 GetSpecialPrice(ItemTemplate const* proto, uint32 minimumPrice = 10000);
uint32 GetSpecialPrice(uint32 minimumPrice = 10000) const { return Item::GetSpecialPrice(GetTemplate(), minimumPrice); }
uint32 GetVisibleEntry() const
{
@@ -358,7 +359,7 @@ class Item : public Object
return GetEntry();
}
uint32 GetSellPrice(bool& success) const;
static uint32 GetSellPrice(ItemTemplate const* proto, bool& success);
int32 GetReforgableStat(ItemModType statType) const;
+7 -6
View File
@@ -2213,7 +2213,9 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill,
if ((itemTemplate.Flags & (ITEM_PROTO_FLAG_CONJURED | ITEM_PROTO_FLAG_UNK6)) ||
itemTemplate.Bonding == BIND_QUEST_ITEM || itemTemplate.Area || itemTemplate.Map ||
itemTemplate.Stackable > 1 ||
!(itemTemplate.SellPrice || sItemCurrencyCostStore.LookupEntry(itemTemplate.ItemId)))
itemTemplate.Quality < ITEM_QUALITY_UNCOMMON || itemTemplate.Quality > ITEM_QUALITY_EPIC ||
!(itemTemplate.Class == ITEM_CLASS_ARMOR || itemTemplate.Class == ITEM_CLASS_WEAPON) ||
!(Item::GetSpecialPrice(&itemTemplate) || sItemCurrencyCostStore.LookupEntry(itemTemplate.ItemId)))
return;
for (uint32 i = 0; i < sItemDisenchantLootStore.GetNumRows(); ++i)
@@ -2227,15 +2229,14 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill,
disenchant->MinItemLevel <= itemTemplate.ItemLevel &&
disenchant->MaxItemLevel >= itemTemplate.ItemLevel)
{
// extra check for epics in range 90 - 99
if (disenchant->MinItemLevel < 90)
if (disenchant->Id == 60 || disenchant->Id == 61) // epic item disenchant ilvl range 66-99 (classic)
{
if (itemTemplate.RequiredLevel > 60 || itemTemplate.RequiredSkillRank > 300)
continue;
continue; // skip to epic item disenchant ilvl range 90-199 (TBC)
}
else
else if (disenchant->Id == 66 || disenchant->Id == 67) // epic item disenchant ilvl range 90-199 (TBC)
{
if (itemTemplate.RequiredLevel <= 60 || itemTemplate.RequiredSkillRank <= 300)
if (itemTemplate.RequiredLevel <= 60 || (itemTemplate.RequiredSkill && itemTemplate.RequiredSkillRank <= 300))
continue;
}