Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: Krang Stonehoof on August 25, 2014, 10:08:46 pm
-
Greetings,
I have a question,
As you all probably saw on the retail, there are so many creatures that cannot be selected but yet you can get your mouse over them and see their names, and also interact with right-click. Can I get that working on 3.3.5? If yes, how?
Thanks.
-
It's a UNIT_FIELD_FLAG.
-
Where are these flags handled?
-
Where are these flags handled?
It's an attribute within the creature object.
Attributes of interest:
Bytes0 - I don't know
Bytes1 - Sitting, standing, 'dead', lying down, etc
Bytes2 - Weapon sheathe - main weapon out, second weapon out, both out, ranged out, etc
Bytes3 - Run state, swimming, flying, etc...
UInt32 Value - Many different flags such as unselectable, unattackable, player, etc.
UInt64 Value - I don't know, GUID?
In the server-side Lua API I can call this code:
obj:SetUInt32Value(0x0006 + 0x0003, 0x1) -- untargetable
That's using the true exact values though, which is hacky. In C++ You should use the enum provided. So in pseudocode:
pUnit->SetUInt32Value(UNIT_FIELD_FLAG_UNSELECTABLE, 1);
These values are also stored in the database for persistent creatures: http://collab.kpsn.org/display/tc/creature (http://collab.kpsn.org/display/tc/creature" onclick="window.open(this.href);return false;)
-
A bit off topic but is it possible to make an unselectable Player? or unattackable? I mean with this flag.
-
A bit off topic but is it possible to make an unselectable Player? or unattackable? I mean with this flag.
The same flags can be applied but may have odd results.
-
Thank you.