Core/Auras: Implemented SPELL_AURA_KEYBOUND_OVERRIDE
Port From (https://github.com/TrinityCore/TrinityCore/commit/b37333c1d935abe05c854c41bdf7ac6aff7f2882)
This commit is contained in:
@@ -413,7 +413,7 @@ namespace Framework.Constants
|
|||||||
OverrideSpellVisual = 403,
|
OverrideSpellVisual = 403,
|
||||||
OverrideAttackPowerBySpPct = 404,
|
OverrideAttackPowerBySpPct = 404,
|
||||||
ModRatingPct = 405,
|
ModRatingPct = 405,
|
||||||
KeyboundOverride = 406, // NYI
|
KeyboundOverride = 406,
|
||||||
ModFear2 = 407,
|
ModFear2 = 407,
|
||||||
SetActionButtonSpellCount = 408,
|
SetActionButtonSpellCount = 408,
|
||||||
CanTurnWhileFalling = 409,
|
CanTurnWhileFalling = 409,
|
||||||
|
|||||||
@@ -1190,6 +1190,10 @@ namespace Framework.Database
|
|||||||
"RtOperandType1, RtOperandType2, RtOperandType3, RtOperandType4, RtOperandType5, RtOperand1, RtOperand2, RtOperand3, RtOperand4, RtOperand5, " +
|
"RtOperandType1, RtOperandType2, RtOperandType3, RtOperandType4, RtOperandType5, RtOperand1, RtOperand2, RtOperand3, RtOperand4, RtOperand5, " +
|
||||||
"Logic1, Logic2, Logic3, Logic4, Logic5 FROM spell_item_enchantment_condition WHERE (`VerifiedBuild` > 0) = ?");
|
"Logic1, Logic2, Logic3, Logic4, Logic5 FROM spell_item_enchantment_condition WHERE (`VerifiedBuild` > 0) = ?");
|
||||||
|
|
||||||
|
// SpellKeyboundOverride.db2
|
||||||
|
PrepareStatement(HotfixStatements.SEL_SPELL_KEYBOUND_OVERRIDE, "SELECT ID, `Function`, Type, Data, Flags FROM spell_keybound_override" +
|
||||||
|
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||||
|
|
||||||
// SpellLabel.db2
|
// SpellLabel.db2
|
||||||
PrepareStatement(HotfixStatements.SEL_SPELL_LABEL, "SELECT ID, LabelID, SpellID FROM spell_label WHERE (`VerifiedBuild` > 0) = ?");
|
PrepareStatement(HotfixStatements.SEL_SPELL_LABEL, "SELECT ID, LabelID, SpellID FROM spell_label WHERE (`VerifiedBuild` > 0) = ?");
|
||||||
|
|
||||||
@@ -2102,6 +2106,8 @@ namespace Framework.Database
|
|||||||
|
|
||||||
SEL_SPELL_ITEM_ENCHANTMENT_CONDITION,
|
SEL_SPELL_ITEM_ENCHANTMENT_CONDITION,
|
||||||
|
|
||||||
|
SEL_SPELL_KEYBOUND_OVERRIDE,
|
||||||
|
|
||||||
SEL_SPELL_LABEL,
|
SEL_SPELL_LABEL,
|
||||||
|
|
||||||
SEL_SPELL_LEARN_SPELL,
|
SEL_SPELL_LEARN_SPELL,
|
||||||
|
|||||||
@@ -289,6 +289,7 @@ namespace Game.DataStorage
|
|||||||
SpellInterruptsStorage = ReadDB2<SpellInterruptsRecord>("SpellInterrupts.db2", HotfixStatements.SEL_SPELL_INTERRUPTS);
|
SpellInterruptsStorage = ReadDB2<SpellInterruptsRecord>("SpellInterrupts.db2", HotfixStatements.SEL_SPELL_INTERRUPTS);
|
||||||
SpellItemEnchantmentStorage = ReadDB2<SpellItemEnchantmentRecord>("SpellItemEnchantment.db2", HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT, HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT_LOCALE);
|
SpellItemEnchantmentStorage = ReadDB2<SpellItemEnchantmentRecord>("SpellItemEnchantment.db2", HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT, HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT_LOCALE);
|
||||||
SpellItemEnchantmentConditionStorage = ReadDB2<SpellItemEnchantmentConditionRecord>("SpellItemEnchantmentCondition.db2", HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT_CONDITION);
|
SpellItemEnchantmentConditionStorage = ReadDB2<SpellItemEnchantmentConditionRecord>("SpellItemEnchantmentCondition.db2", HotfixStatements.SEL_SPELL_ITEM_ENCHANTMENT_CONDITION);
|
||||||
|
SpellKeyboundOverrideStorage = ReadDB2<SpellKeyboundOverrideRecord>("SpellKeyboundOverride.db2", HotfixStatements.SEL_SPELL_KEYBOUND_OVERRIDE);
|
||||||
SpellLabelStorage = ReadDB2<SpellLabelRecord>("SpellLabel.db2", HotfixStatements.SEL_SPELL_LABEL);
|
SpellLabelStorage = ReadDB2<SpellLabelRecord>("SpellLabel.db2", HotfixStatements.SEL_SPELL_LABEL);
|
||||||
SpellLearnSpellStorage = ReadDB2<SpellLearnSpellRecord>("SpellLearnSpell.db2", HotfixStatements.SEL_SPELL_LEARN_SPELL);
|
SpellLearnSpellStorage = ReadDB2<SpellLearnSpellRecord>("SpellLearnSpell.db2", HotfixStatements.SEL_SPELL_LEARN_SPELL);
|
||||||
SpellLevelsStorage = ReadDB2<SpellLevelsRecord>("SpellLevels.db2", HotfixStatements.SEL_SPELL_LEVELS);
|
SpellLevelsStorage = ReadDB2<SpellLevelsRecord>("SpellLevels.db2", HotfixStatements.SEL_SPELL_LEVELS);
|
||||||
@@ -711,6 +712,7 @@ namespace Game.DataStorage
|
|||||||
public static DB6Storage<SpellInterruptsRecord> SpellInterruptsStorage;
|
public static DB6Storage<SpellInterruptsRecord> SpellInterruptsStorage;
|
||||||
public static DB6Storage<SpellItemEnchantmentRecord> SpellItemEnchantmentStorage;
|
public static DB6Storage<SpellItemEnchantmentRecord> SpellItemEnchantmentStorage;
|
||||||
public static DB6Storage<SpellItemEnchantmentConditionRecord> SpellItemEnchantmentConditionStorage;
|
public static DB6Storage<SpellItemEnchantmentConditionRecord> SpellItemEnchantmentConditionStorage;
|
||||||
|
public static DB6Storage<SpellKeyboundOverrideRecord> SpellKeyboundOverrideStorage;
|
||||||
public static DB6Storage<SpellLabelRecord> SpellLabelStorage;
|
public static DB6Storage<SpellLabelRecord> SpellLabelStorage;
|
||||||
public static DB6Storage<SpellLearnSpellRecord> SpellLearnSpellStorage;
|
public static DB6Storage<SpellLearnSpellRecord> SpellLearnSpellStorage;
|
||||||
public static DB6Storage<SpellLevelsRecord> SpellLevelsStorage;
|
public static DB6Storage<SpellLevelsRecord> SpellLevelsStorage;
|
||||||
|
|||||||
@@ -380,6 +380,15 @@ namespace Game.DataStorage
|
|||||||
public byte[] Logic = new byte[5];
|
public byte[] Logic = new byte[5];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public sealed class SpellKeyboundOverrideRecord
|
||||||
|
{
|
||||||
|
public uint Id;
|
||||||
|
public string Function;
|
||||||
|
public sbyte Type;
|
||||||
|
public uint Data;
|
||||||
|
public int Flags;
|
||||||
|
}
|
||||||
|
|
||||||
public sealed class SpellLabelRecord
|
public sealed class SpellLabelRecord
|
||||||
{
|
{
|
||||||
public uint Id;
|
public uint Id;
|
||||||
|
|||||||
@@ -701,5 +701,19 @@ namespace Game
|
|||||||
{
|
{
|
||||||
GetPlayer().SendSpellCategoryCooldowns();
|
GetPlayer().SendSpellCategoryCooldowns();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WorldPacketHandler(ClientOpcodes.KeyboundOverride, Processing = PacketProcessing.ThreadSafe)]
|
||||||
|
void HandleKeyboundOverride(KeyboundOverride keyboundOverride)
|
||||||
|
{
|
||||||
|
Player player = GetPlayer();
|
||||||
|
if (!player.HasAuraTypeWithMiscvalue(AuraType.KeyboundOverride, keyboundOverride.OverrideID))
|
||||||
|
return;
|
||||||
|
|
||||||
|
SpellKeyboundOverrideRecord spellKeyboundOverride = CliDB.SpellKeyboundOverrideStorage.LookupByKey(keyboundOverride.OverrideID);
|
||||||
|
if (spellKeyboundOverride == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
player.CastSpell(player, spellKeyboundOverride.Data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1159,6 +1159,18 @@ namespace Game.Networking.Packets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class KeyboundOverride : ClientPacket
|
||||||
|
{
|
||||||
|
public KeyboundOverride(WorldPacket packet) : base(packet) { }
|
||||||
|
|
||||||
|
public override void Read()
|
||||||
|
{
|
||||||
|
OverrideID = _worldPacket.ReadUInt16();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ushort OverrideID;
|
||||||
|
}
|
||||||
|
|
||||||
//Structs
|
//Structs
|
||||||
public struct SpellLogPowerData
|
public struct SpellLogPowerData
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user