Core/Creatures: Move immunities to separate table and implemented setting immunties to dispel, spell effects, aura types, aoe and chain targeting
Port From (https://github.com/TrinityCore/TrinityCore/commit/f70a5817e1c07891185d716611d45f50b1c73b78)
This commit is contained in:
@@ -45,6 +45,8 @@ namespace System.Collections
|
||||
_version = 0;
|
||||
}
|
||||
|
||||
public BitSet(ulong value) : this(new uint[] { (uint)(value & (ulong)uint.MaxValue), (uint)(value >> 32) }) { }
|
||||
|
||||
public BitSet(BitSet bits)
|
||||
{
|
||||
if (bits == null)
|
||||
|
||||
@@ -260,6 +260,7 @@ namespace Framework.Constants
|
||||
Enrage = 9,
|
||||
ZGTicket = 10,
|
||||
OldUnused = 11,
|
||||
Max,
|
||||
|
||||
AllMask = ((1 << Magic) | (1 << Curse) | (1 << Disease) | (1 << Poison))
|
||||
}
|
||||
@@ -1783,7 +1784,7 @@ namespace Framework.Constants
|
||||
IgnoreCasterAndTargetRestrictions = 0x10000000, /*Nyi*/ // Ignore Caster & Target Restrictions
|
||||
IgnoreCasterModifiers = 0x20000000, // Ignore Caster Modifiers
|
||||
DoNotDisplayRange = 0x40000000, // Do Not Display Range (Client Only)
|
||||
NotOnAoeImmune = 0x80000000 /*Nyi, No Aoe Immunity Implementation*/ // Not On Aoe Immune
|
||||
NotOnAoeImmune = 0x80000000 // Not On Aoe Immune
|
||||
}
|
||||
public enum SpellAttr4 : uint
|
||||
{
|
||||
@@ -2981,4 +2982,10 @@ namespace Framework.Constants
|
||||
TargetAndBeacon = 2,
|
||||
TargetParty = 3,
|
||||
}
|
||||
|
||||
public enum WorldObjectSpellAreaTargetSearchReason
|
||||
{
|
||||
Area,
|
||||
Chain
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Framework.Database
|
||||
PrepareStatement(WorldStatements.SEL_CREATURE_ADDON_BY_GUID, "SELECT guid FROM creature_addon WHERE guid = ?");
|
||||
PrepareStatement(WorldStatements.DEL_CREATURE, "DELETE FROM creature WHERE guid = ?");
|
||||
PrepareStatement(WorldStatements.SEL_COMMANDS, "SELECT name, help FROM command");
|
||||
PrepareStatement(WorldStatements.SEL_CREATURE_TEMPLATE, "SELECT entry, KillCredit1, KillCredit2, name, femaleName, subname, TitleAlt, IconName, RequiredExpansion, VignetteID, faction, npcflag, speed_walk, speed_run, scale, Classification, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, unit_flags3, family, trainer_class, type, VehicleId, AIName, MovementType, ctm.Ground, ctm.Swim, ctm.Flight, ctm.Rooted, ctm.Chase, ctm.Random, ctm.InteractionPauseTimer, ExperienceModifier, RacialLeader, movementId, WidgetSetID, WidgetSetUnitConditionID, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, flags_extra, ScriptName, StringId FROM creature_template ct LEFT JOIN creature_template_movement ctm ON ct.entry = ctm.CreatureId WHERE entry = ? OR 1 = ?");
|
||||
PrepareStatement(WorldStatements.SEL_CREATURE_TEMPLATE, "SELECT entry, KillCredit1, KillCredit2, name, femaleName, subname, TitleAlt, IconName, RequiredExpansion, VignetteID, faction, npcflag, speed_walk, speed_run, scale, Classification, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, unit_flags3, family, trainer_class, type, VehicleId, AIName, MovementType, ctm.Ground, ctm.Swim, ctm.Flight, ctm.Rooted, ctm.Chase, ctm.Random, ctm.InteractionPauseTimer, ExperienceModifier, RacialLeader, movementId, WidgetSetID, WidgetSetUnitConditionID, RegenHealth, CreatureImmunitiesId, flags_extra, ScriptName, StringId FROM creature_template ct LEFT JOIN creature_template_movement ctm ON ct.entry = ctm.CreatureId WHERE entry = ? OR 1 = ?");
|
||||
PrepareStatement(WorldStatements.SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?");
|
||||
PrepareStatement(WorldStatements.SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_");
|
||||
PrepareStatement(WorldStatements.SEL_CREATURE_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM creature WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_");
|
||||
|
||||
@@ -186,6 +186,13 @@ namespace System.Collections.Generic
|
||||
return blockValues;
|
||||
}
|
||||
|
||||
public static uint ToUInt(this BitSet array)
|
||||
{
|
||||
uint[] blockValues = new uint[array.Length / 32 + 1];
|
||||
array.CopyTo(blockValues, 0);
|
||||
return blockValues[0];
|
||||
}
|
||||
|
||||
public static void Clear(this Array array)
|
||||
{
|
||||
Array.Clear(array, 0, array.Length);
|
||||
|
||||
Reference in New Issue
Block a user