diff options
author | Kudlaty <none@none> | 2009-09-21 05:52:58 +0200 |
---|---|---|
committer | Kudlaty <none@none> | 2009-09-21 05:52:58 +0200 |
commit | 45e2f9c002f58e7dc01207ab88f6ffa052860611 (patch) | |
tree | d4acaa9a79090995ef91852719b47457c307a2e5 | |
parent | 96cbf2f75b55c14a549829d3848145bef0dcf836 (diff) |
* 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
-rw-r--r-- | src/game/ItemPrototype.h | 10 | ||||
-rw-r--r-- | src/game/ObjectMgr.cpp | 2 | ||||
-rw-r--r-- | src/game/Player.cpp | 10 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h index bb2da3be4de..f38e5cdc455 100644 --- a/src/game/ItemPrototype.h +++ b/src/game/ItemPrototype.h @@ -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 { diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index f44c9747ca1..d2011bd7e4e 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -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) { diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 0e7af6e9f83..24c1604fe06 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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) { |