DB/SpellItemEnchantmentCondition: Difference between revisions

From wowdev
Jump to navigation Jump to search
(New page: ==Header Info== Records....................11 Fields.....................31 Record Size................64 String Block Size...........1 ==Structure== '''Column Field Type Notes''...)
 
mNo edit summary
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Header Info==
Records....................11
Fields.....................31
Record Size................64
String Block Size...........1


{{Template:Sandbox/VersionRange|min_expansionlevel=2}}
==Structure==
==Structure==
'''Column Field Type Notes'''  
'''Column Field Type Notes'''  
  1 ID Integer Referenced from [[SpellItemEnchantment.dbc]]   
  1 ID Integer Referenced from [[SpellItemEnchantment.dbc]]   
  2 gemColor_1 Byte
  2 gemColor[5] Byte
3 gemColor_2 Byte
  7 LT_Operand[5] Integer
4 gemColor_3 Byte
  12 comparator[5] Byte
5 gemColor_4 Byte
  17 compareColor[5] Byte
6 gemColor_5 Byte
  22 value[5] Integer
  7 Unknown_1 Integer
  27 Logic[5] Byte
8 Unknown_2 Integer
 
9 Unknown_3 Integer
  struct SpellItemEnchantmentConditionEntry // sizeof(0x48)
10 Unknown_4 Integer
  {
11 Unknown_5 Integer
    m_ID; // +0x0, size 0x4, type 0
  12 comparator_1 Byte
    m_lt_operandType; // +0x4, size 0x5, type 0
13 comparator_2 Byte
    m_lt_operand; // +0xC, size 0x14, type 0
14 comparator_3 Byte
    m_operator; // +0x20, size 0x5, type 0
15 comparator_4 Byte
    m_rt_operandType; // +0x25, size 0x5, type 0
16 comparator_5 Byte
    m_rt_operand; // +0x2C, size 0x14, type 0
  17 compareColor_1 Byte
    m_logic; // +0x40, size 0x5, type 0
  18 compareColor_2 Byte
  };
  19 compareColor_3 Byte
20 compareColor_4 Byte
21 compareColor_5 Byte
  22 value_1 Integer
  23 value_2 Integer
24 value_3 Integer
25 value_4 Integer
26 value_5 Integer
27 Unknown_1 Byte
28 Unknown_2 Byte
29 Unknown_3 Byte
30 Unknown_4 Byte
  31 Unknown_5 Byte or Boolean?


==How It Works==
==How It Works==
Line 103: Line 86:
  ENCHANT_CONDITION_REQUIRES = "Requires\32";
  ENCHANT_CONDITION_REQUIRES = "Requires\32";


Retrieved from "http://www.sourcepeek.com/wiki/SpellItemEnchantmentCondition.dbc"
==4.3.4.15595==
struct SpellItemEnchantmentConditionEntry {
    uint32_t m_ID;
    uint8 m_lt_operandType[3];
    uint8 m_lt_op_padding[5];
    uint32 m_lt_operand[5];
    uint8 m_operator[3];
    uint8 m_op_padding[2];
    uint8 m_rt_operandType[3];
    uint16 m_rt_op_padding[2];
    uint32 m_rt_operand[3];
    uint32 m_rt_padding[4];
};
==6.0.1.18179==
struct SpellItemEnchantmentConditionRec {
  uint32_t m_ID;
  uint8_t m_lt_operandType[5];
  uint8_t padding_0[3];
  uint32_t m_lt_operand[5];
  uint8_t m_operator[5];
  uint8_t m_rt_operandType[5];
  uint8_t padding_1[2];
  uint32_t m_rt_operand[5];
  uint8_t m_logic[5];
  uint8_t padding_2[3];
};
[[Category:DBC]]
[[Category:DBC_WotLK]]
[[Category:DBC_WoD]][[Category:6.0.1.18179]]

Latest revision as of 12:56, 11 January 2017

≥ BC

Structure

Column	Field 		Type 		Notes 
1 	ID 		Integer 	Referenced from SpellItemEnchantment.dbc  
2 	gemColor[5] 	Byte 		
7 	LT_Operand[5] 	Integer 	
12 	comparator[5] 	Byte 	
17 	compareColor[5] 	Byte 	
22 	value[5] 	Integer 	
27 	Logic[5] 	Byte
struct SpellItemEnchantmentConditionEntry // sizeof(0x48)
{
   m_ID; // +0x0, size 0x4, type 0
   m_lt_operandType; // +0x4, size 0x5, type 0
   m_lt_operand; // +0xC, size 0x14, type 0
   m_operator; // +0x20, size 0x5, type 0
   m_rt_operandType; // +0x25, size 0x5, type 0
   m_rt_operand; // +0x2C, size 0x14, type 0
   m_logic; // +0x40, size 0x5, type 0 
};

How It Works

I think the last unknown, represents a boolean if the conditions should be and'ed or or'ed together (it's only set for entries with more than one condition).

The "comparator" field seems to determine how to compare the values, what I've noticed so far, from what's available in the DBC file at the moment:

  • 2: Seems to be <
    • Used in Compare as: Requires more [compareColor] gems than [gemColor] gems.
  • 3: Seems to be >
    • Used in Compare as: Requires more [gemColor] gems than [compareColor] gems.
    • Used in Value as: Requires at least [value + 1] [gemColor] gems.
  • 5: Seems to be >=
    • Used in Value as: Requires at least [value] [gemColor] gems.

Type: Value

Example: 
Swift Skyfire Diamond
+24 Attack Power and Minor Run Speed Increase
Requires at least 2 Yellow gems
Requires at least 1 Red gem

Matching DBC entry (id 31):

gemColor:     {3, 2, 0, 0, 0}
unknownValue: {0, 0, 0, 0, 0}
comparator:   {5, 5, 0, 0, 0}
compareColor: {0, 0, 0, 0, 0}
value:        {2, 1, 0, 0, 0}
unknown:      {1, 0, 0, 0, 0}
  • Requires at least (2) (Gem Type 3 = Yellow) gems
  • Requires at least (1) (Gem Type 2 = Red) gems

Type: Compare

Example: 
Bracing Earthstorm Diamond
+26 Healing Spells & 2% Reduced Threat
Requires more Yellow gems than Blue gems
Requires more Red gems than Blue gems

Matching DBC entry (id 34):

gemColor:     {3, 2, 0, 0, 0}
unknownValue: {0, 0, 0, 0, 0}
comparator:   {3, 3, 0, 0, 0}
compareColor: {4, 4, 0, 0, 0}
value:        {0, 0, 0, 0, 0}
unknown:      {1, 0, 0, 0, 0}
  • Requires more (Gem Type 3 = Yellow) gems than (Gem Type 4 = Blue) gems
  • Requires more (Gem Type 2 = Red) gems than (Gem Type 4 = Blue) gems

GlobalStrings.lua constants

ENCHANT_CONDITION_AND = " and\32";
ENCHANT_CONDITION_EQUAL_COMPARE = "an equal number of %s and %s gems";
ENCHANT_CONDITION_EQUAL_VALUE = "exactly %d %s gem";
ENCHANT_CONDITION_EQUAL_VALUE_P1 = "exactly %d %s gems";
ENCHANT_CONDITION_LESS_VALUE = "less than %d %s gem";
ENCHANT_CONDITION_LESS_VALUE_P1 = "less than %d %s gems";
ENCHANT_CONDITION_MORE_COMPARE = "more %s gems than %s gems";
ENCHANT_CONDITION_MORE_EQUAL_COMPARE = "at least as many %s gems as %s gems";
ENCHANT_CONDITION_MORE_VALUE = "at least %d %s gem";
ENCHANT_CONDITION_MORE_VALUE_P1 = "at least %d %s gems";
ENCHANT_CONDITION_NOT_EQUAL_COMPARE = "a different number of %s and %s gems";
ENCHANT_CONDITION_NOT_EQUAL_VALUE = "any number but %d %s gem";
ENCHANT_CONDITION_NOT_EQUAL_VALUE_P1 = "any number but %d %s gems";
ENCHANT_CONDITION_REQUIRES = "Requires\32";

4.3.4.15595

struct SpellItemEnchantmentConditionEntry {
   uint32_t m_ID;
   uint8 m_lt_operandType[3];
   uint8 m_lt_op_padding[5];
   uint32 m_lt_operand[5];
   uint8 m_operator[3];
   uint8 m_op_padding[2];
   uint8 m_rt_operandType[3];
   uint16 m_rt_op_padding[2];
   uint32 m_rt_operand[3];
   uint32 m_rt_padding[4];
};

6.0.1.18179

struct SpellItemEnchantmentConditionRec {
  uint32_t m_ID;
  uint8_t m_lt_operandType[5];
  uint8_t padding_0[3];
  uint32_t m_lt_operand[5];
  uint8_t m_operator[5];
  uint8_t m_rt_operandType[5];
  uint8_t padding_1[2];
  uint32_t m_rt_operand[5];
  uint8_t m_logic[5];
  uint8_t padding_2[3];
};