From 4f06be912b601fd05053a42f869e52ab09fa0f0e Mon Sep 17 00:00:00 2001 From: w12x Date: Mon, 20 Oct 2008 13:41:05 -0500 Subject: [svn] Implement CREATURE_FLAG_EXTRA_TRIGGER. In GM mode, creatures flagged with this will be displayed with displayid_a, in non-gm mode with displayid_h. --HG-- branch : trunk --- src/game/Object.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/game/Object.cpp') diff --git a/src/game/Object.cpp b/src/game/Object.cpp index a64ef9fa744..500143bad4f 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -594,6 +594,20 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask { *data << (m_uint32Values[ index ] & ~UNIT_FLAG_NOT_SELECTABLE); } + // use modelid_a if not gm, _h if gm for CREATURE_FLAG_EXTRA_TRIGGER creatures + else if(index == UNIT_FIELD_DISPLAYID && GetTypeId() == TYPEID_UNIT) + { + const CreatureInfo* cinfo = ((Creature*)this)->GetCreatureInfo(); + if(cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER) + { + if(target->isGameMaster()) + *data << cinfo->DisplayID_A; + else + *data << cinfo->DisplayID_H; + } + else + *data << m_uint32Values[ index ]; + } // hide lootable animation for unallowed players else if(index == UNIT_DYNAMIC_FLAGS && GetTypeId() == TYPEID_UNIT) { -- cgit v1.2.3