Core/Items: Updated item gem colors

Port From (https://github.com/TrinityCore/TrinityCore/commit/d938fea455ece3a4236eead2e4d9d0b33d58c404)
This commit is contained in:
Hondacrx
2025-08-11 21:43:06 -04:00
parent 0fe016c3dd
commit 896f1077c2
3 changed files with 66 additions and 47 deletions
+41 -32
View File
@@ -47,7 +47,7 @@ namespace Framework.Constants
SocketColor.Blue,
SocketColor.Hydraulic,
SocketColor.Cogwheel,
SocketColor.Prismatic,
SocketColor.Red | SocketColor.Yellow | SocketColor.Blue,
SocketColor.RelicIron,
SocketColor.RelicBlood,
SocketColor.RelicShadow,
@@ -62,10 +62,14 @@ namespace Framework.Constants
SocketColor.PunchcardRed,
SocketColor.PunchcardYellow,
SocketColor.PunchcardBlue,
SocketColor.Domination,
SocketColor.DominationBlood | SocketColor.DominationFrost | SocketColor.DominationUnholy,
SocketColor.Cypher,
SocketColor.Tinker,
SocketColor.Primordial
SocketColor.Primordial,
SocketColor.Fragrance,
SocketColor.SingingThunder,
SocketColor.SingingSea,
SocketColor.SingingWind
};
public static ItemModifier[] AppearanceModifierSlotBySpec =
@@ -206,31 +210,36 @@ namespace Framework.Constants
public enum SocketColor
{
Meta = 0x00001,
Red = 0x00002,
Yellow = 0x00004,
Blue = 0x00008,
Hydraulic = 0x00010, // Not Used
Cogwheel = 0x00020,
Prismatic = 0x0000e,
RelicIron = 0x00040,
RelicBlood = 0x00080,
RelicShadow = 0x00100,
RelicFel = 0x00200,
RelicArcane = 0x00400,
RelicFrost = 0x00800,
RelicFire = 0x01000,
RelicWater = 0x02000,
RelicLife = 0x04000,
RelicWind = 0x08000,
RelicHoly = 0x10000,
PunchcardRed = 0x20000,
PunchcardYellow = 0x40000,
PunchcardBlue = 0x80000,
Domination = 0x100000,
Cypher = 0x200000,
Tinker = 0x400000,
Primordial = 0x800000,
Meta = 0X01,
Red = 0X02,
Yellow = 0X04,
Blue = 0X08,
Hydraulic = 0X10,
Cogwheel = 0X20,
RelicIron = 0X40,
RelicBlood = 0X80,
RelicShadow = 0X100,
RelicFel = 0X200,
RelicArcane = 0X400,
RelicFrost = 0X800,
RelicFire = 0X1000,
RelicWater = 0X2000,
RelicLife = 0X4000,
RelicWind = 0X8000,
RelicHoly = 0X10000,
PunchcardRed = 0X20000,
PunchcardYellow = 0X40000,
PunchcardBlue = 0X80000,
DominationBlood = 0X100000,
DominationFrost = 0X200000,
DominationUnholy = 0X400000,
Cypher = 0X800000,
Tinker = 0x01000000,
Primordial = 0x02000000,
Fragrance = 0x04000000,
SingingThunder = 0x08000000,
SingingSea = 0x10000000,
SingingWind = 0x20000000,
Standard = (Red | Yellow | Blue)
}
@@ -1082,10 +1091,10 @@ namespace Framework.Constants
Unk8 = 0x2000, // ?
Unk9 = 0x4000, // ?
Unk10 = 0x8000, // ?
Unk11 = 0x00010000, // ?
Unk12 = 0x00020000, // ?
Unk13 = 0x00040000, // ?
Child = 0x00080000,
Unk11 = 0X0010000, // ?
Unk12 = 0X0020000, // ?
Unk13 = 0X0040000, // ?
Child = 0X0080000,
Unk15 = 0x00100000, // ?
NewItem = 0x00200000, // Item glows in inventory
AzeriteEmpoweredItemViewed = 0x00400000, // Won't play azerite powers animation when viewing it
+4 -4
View File
@@ -2675,7 +2675,7 @@ namespace Game.Entities
Cypher.Assert(index < ItemConst.MaxStats);
return _bonusData.ItemStatType[index];
}
public SocketColor GetSocketColor(uint index)
public uint GetSocketColor(uint index)
{
Cypher.Assert(index < ItemConst.MaxGemSockets);
return _bonusData.socketColor[index];
@@ -2881,7 +2881,7 @@ namespace Game.Entities
for (uint i = 0; i < ItemConst.MaxGemSockets; ++i)
{
socketColor[i] = proto.GetSocketColor(i);
socketColor[i] = (uint)proto.GetSocketColor(i);
GemItemLevelBonus[i] = 0;
GemRelicType[i] = -1;
GemRelicRankBonus[i] = 0;
@@ -2980,7 +2980,7 @@ namespace Game.Entities
{
if (socketColor[i] == 0)
{
socketColor[i] = (SocketColor)values[1];
socketColor[i] = (uint)values[1];
--socketCount;
}
}
@@ -3061,7 +3061,7 @@ namespace Game.Entities
public int[] ItemStatType = new int[ItemConst.MaxStats];
public int[] StatPercentEditor = new int[ItemConst.MaxStats];
public float[] ItemStatSocketCostMultiplier = new float[ItemConst.MaxStats];
public SocketColor[] socketColor = new SocketColor[ItemConst.MaxGemSockets];
public uint[] socketColor = new uint[ItemConst.MaxGemSockets];
public ItemBondingType Bonding;
public uint AppearanceModID;
public float RepairCostMultiplier;
+16 -6
View File
@@ -818,8 +818,11 @@ namespace Game
if (gemProperties[i] == null)
continue;
SocketColor acceptableGemTypeMask = ItemConst.SocketColorToGemTypeMask[(int)itemTarget.GetSocketColor(i)];
// tried to put gem in socket where no socket exists (take care about prismatic sockets)
if (itemTarget.GetSocketColor(i) == 0)
switch (itemTarget.GetSocketColor(i))
{
case 0:
{
// no prismatic socket
if (itemTarget.GetEnchantmentId(EnchantmentSlot.Prismatic) == 0)
@@ -827,16 +830,23 @@ namespace Game
if (i != firstPrismatic)
return;
acceptableGemTypeMask = SocketColor.Red | SocketColor.Yellow | SocketColor.Blue;
break;
}
case 2:
case 3:
case 4:
// red, blue and yellow sockets accept any red/blue/yellow gem
acceptableGemTypeMask = SocketColor.Red | SocketColor.Yellow | SocketColor.Blue;
break;
default:
break;
}
// Gem must match socket color
if (ItemConst.SocketColorToGemTypeMask[(int)itemTarget.GetSocketColor(i)] != gemProperties[i].Type)
{
// unless its red, blue, yellow or prismatic
if (!ItemConst.SocketColorToGemTypeMask[(int)itemTarget.GetSocketColor(i)].HasAnyFlag(SocketColor.Prismatic) || !gemProperties[i].Type.HasAnyFlag(SocketColor.Prismatic))
if ((acceptableGemTypeMask & gemProperties[i].Type) == 0)
return;
}
}
// check unique-equipped conditions
for (int i = 0; i < ItemConst.MaxGemSockets; ++i)