From 671fd4176a2000b5dd8cdb5b009bc13046dc9bc1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 12 Mar 2012 18:07:34 +0100 Subject: Core/GameObjects: Chests will now remain locked for players who left the group if loot from that boss is stored in it (note: this is just an implementation of locking the chest, they still need to be linked to a boss - not yet implemented) --- src/server/game/Entities/Object/Object.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/server/game/Entities/Object') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 56ddd14dc3a..d8ee305230e 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -486,6 +486,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* } updateMask->SetBit(GAMEOBJECT_DYNAMIC); updateMask->SetBit(GAMEOBJECT_BYTES_1); + + if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST && ToGameObject()->GetGOInfo()->chest.groupLootRules && + ToGameObject()->HasLootRecipient()) + updateMask->SetBit(GAMEOBJECT_FLAGS); } else if (isType(TYPEMASK_UNIT)) { @@ -709,6 +713,15 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* *data << uint16(-1); } } + else if (index == GAMEOBJECT_FLAGS) + { + uint32 flags = m_uint32Values[index]; + if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST) + if (ToGameObject()->GetGOInfo()->chest.groupLootRules && !ToGameObject()->IsLootAllowedFor(target)) + flags |= GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE; + + *data << flags; + } else *data << m_uint32Values[index]; // other cases } -- cgit v1.2.3