Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: XxXGenesisXxX on October 11, 2012, 06:26:44 am

Title: [SOLVED] [QUESTION] Attributes
Post by: XxXGenesisXxX on October 11, 2012, 06:26:44 am
When doing the attributes you edit the enumerations, if you want 2 out of the same column for example:

Code: [Select]
SPELL_ATTR0_ABILITY                          = 0x10, //  4
+
SPELL_ATTR0_PASSIVE                          = 0x40, //  6

You would add them together for 0x50. But what if it needs to carry on? For example:

Code: [Select]
SPELL_ATTR0_PASSIVE                          = 0x40, //  6
+
SPELL_ATTR0_HIDDEN_CLIENTSIDE                = 0x80, //  7

This would equal 0x120... That's the exact same as:

Code: [Select]
SPELL_ATTR0_HIDE_IN_COMBAT_LOG               = 0x100, //  8
+
SPELL_ATTR0_TRADESPELL                       = 0x20, //  5

So how would I get the 0x40 and the 0x80 together? Is that when letters get involved?
Title: Re: [QUESTION] Attributes
Post by: schlumpf on October 11, 2012, 10:41:39 am
First of all, you don't add them, second of all, you're adding them wrong and third, these are hexadecimal numbers, which should be taught at school in year five.

You're supposed to bitwise-or-ing them.

Code: [Select]
0x40 == 0100 0000 |
0x80 == 1000 0000 =
1100 0000 == 0xC0
Title: Re: [SOLVED] [QUESTION] Attributes
Post by: XxXGenesisXxX on October 11, 2012, 11:27:43 am
Ahhk, Thank schlumpf.

Marked as solved.