* Add two flags for items with no stack limit

* Added proper checking of faction based on seller for items with RequiredReputaionFaction=0
* This will allow 100% proper WDB data to be used
Thx to Malcrom and Brian

--HG--
branch : trunk
This commit is contained in:
Kudlaty
2009-09-21 05:52:58 +02:00
parent 96cbf2f75b
commit 45e2f9c002
3 changed files with 18 additions and 4 deletions
+9 -1
View File
@@ -116,6 +116,8 @@ enum ITEM_FLAGS
ITEM_FLAGS_USEABLE_IN_ARENA = 0x00200000,
ITEM_FLAGS_THROWABLE = 0x00400000, // not used in game for check trow possibility, only for item in game tooltip
ITEM_FLAGS_SPECIALUSE = 0x00800000, // last used flag in 2.3.0
ITEM_FLAGS_NO_STACK_LIMIT = 0x00FFFFFF, // items which not have stack limit
ITEM_FLAGS_NO_STACK_LIMIT2 = 0x07FFFFFF, // We aren't sure exactly why they need two yet
ITEM_FLAGS_BOA = 0x08000000, // bind on account (set in template for items that can binded in like way)
ITEM_FLAGS_TRIGGERED_CAST = 0x10000000, // used by enchanting scrolls made with vellum
ITEM_FLAGS_MILLABLE = 0x20000000
@@ -602,7 +604,13 @@ struct ItemPrototype
return false;
}
uint32 GetMaxStackSize() const { return Stackable > 0 ? uint32(Stackable) : uint32(0x7FFFFFFF-1); }
uint32 GetMaxStackSize() const
{
if (Flags & ITEM_FLAGS_NO_STACK_LIMIT || Flags & ITEM_FLAGS_NO_STACK_LIMIT2)
return uint32(0x7FFFFFFF-1);
else
return Stackable > 0 ? uint32(Stackable) : uint32(0x7FFFFFFF-1);
}
float getDPS() const
{
-2
View File
@@ -2073,8 +2073,6 @@ void ObjectMgr::LoadItemPrototypes()
if(proto->RequiredReputationRank == MIN_REPUTATION_RANK)
sLog.outErrorDb("Item (Entry: %u) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.",i);
}
else if(proto->RequiredReputationRank > MIN_REPUTATION_RANK)
sLog.outErrorDb("Item (Entry: %u) has RequiredReputationFaction ==0 but RequiredReputationRank > 0, rank setting is useless.",i);
if(proto->MaxCount < -1)
{
+9 -1
View File
@@ -18211,11 +18211,19 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
}
}
if (uint32(GetReputationRank(pProto->RequiredReputationFaction)) < pProto->RequiredReputationRank)
if (pProto->RequiredReputationFaction && (uint32(GetReputationRank(pProto->RequiredReputationFaction)) < pProto->RequiredReputationRank))
{
SendBuyError( BUY_ERR_REPUTATION_REQUIRE, pCreature, item, 0);
return false;
}
else if (!pProto->RequiredReputationFaction && pProto->RequiredReputationRank > 0)
{
if (uint32(GetReputationRank(pCreature->getFaction())) < pProto->RequiredReputationRank)
{
SendBuyError( BUY_ERR_REPUTATION_REQUIRE, pCreature, item, 0);
return false;
}
}
if (crItem->ExtendedCost)
{