private void SetEnchantMask() { EnchantmentMask = 0; foreach (var kvp in Enchantments.Where(e => e.Value.Count > 0)) { EnchantmentMask |= kvp.Key; } }
public Enchantment(WorldObject target, SpellBase spellBase, double duration, ushort layer, uint?enchantmentMask, float?statMod = null) { Target = target; SpellBase = spellBase; Layer = layer; Duration = duration; EnchantmentMask = (EnchantmentMask)(enchantmentMask ?? 0); StatMod = statMod; }
public Enchantment(WorldObject target, uint casterGuid, SpellBase spellBase, double duration, ushort layer, EnchantmentMask enchantmentMask, float?statMod = null) { Target = target; CasterGuid = casterGuid; Spell = new Spell(spellBase.MetaSpellId); Layer = layer; Duration = duration; EnchantmentMask = enchantmentMask; StatMod = statMod; }
public Enchantment(WorldObject target, uint spellId, double duration, ushort layer, uint?enchantmentMask, float?statMod = null) { Target = target; SpellBase = DatManager.PortalDat.SpellTable.Spells[spellId]; Spell = DatabaseManager.World.GetCachedSpell(spellId); Layer = layer; Duration = duration; EnchantmentMask = (EnchantmentMask)(enchantmentMask ?? 0); StatMod = statMod ?? Spell.StatModVal; }
public Enchantment(WorldObject target, BiotaPropertiesEnchantmentRegistry entry) { Target = target; CasterGuid = new ACE.Entity.ObjectGuid(entry.CasterObjectId); Spell = new Spell((uint)entry.SpellId); Layer = entry.LayerId; StartTime = entry.StartTime; Duration = entry.Duration; EnchantmentMask = (EnchantmentMask)entry.EnchantmentCategory; StatMod = entry.StatModValue; }
public Enchantment(WorldObject target, BiotaPropertiesEnchantmentRegistry entry) { Target = target; SpellBase = DatManager.PortalDat.SpellTable.Spells[(uint)entry.SpellId]; Spell = DatabaseManager.World.GetCachedSpell((uint)entry.SpellId); Layer = entry.LayerId; StartTime = entry.StartTime; Duration = entry.Duration; EnchantmentMask = (EnchantmentMask)entry.EnchantmentCategory; StatMod = entry.StatModValue; }
public Enchantment(WorldObject target, SpellBase spellBase, ushort layer, EnchantmentMask enchantmentMask, float?statModVal = null) { // should be able to replace this with cooldown constructor Init(new Spell(spellBase.MetaSpellId)); Layer = layer; CasterGuid = target.Guid.Full; StatModValue = statModVal ?? 35.0f; Target = target; EnchantmentMask = enchantmentMask; }
public Enchantment(WorldObject target, uint casterGuid, uint spellId, ushort layer, EnchantmentMask enchantmentMask, float?statModVal = null) { // 2 references left, can this use BiotaPropertiesEnchantment? Init(new Spell(spellId)); Layer = layer; CasterGuid = casterGuid; StatModValue = statModVal ?? Spell.StatModVal; Target = target; EnchantmentMask = enchantmentMask; }
public Enchantment(WorldObject target, ACE.Entity.ObjectGuid?casterGuid, SpellBase spellBase, double duration, ushort layer, EnchantmentMask enchantmentMask, float?statMod = null) { Target = target; if (casterGuid == null) { CasterGuid = ACE.Entity.ObjectGuid.Invalid; } else { CasterGuid = (ACE.Entity.ObjectGuid)casterGuid; } Spell = new Spell(spellBase.MetaSpellId); Layer = layer; Duration = duration; EnchantmentMask = enchantmentMask; StatMod = statMod; }
public Enchantment(WorldObject target, ACE.Entity.ObjectGuid?casterGuid, SpellBase spellBase, double duration, ushort layer, uint?enchantmentMask, float?statMod = null) { Target = target; if (casterGuid == null) { CasterGuid = ACE.Entity.ObjectGuid.Invalid; } else { CasterGuid = (ACE.Entity.ObjectGuid)casterGuid; } SpellBase = spellBase; Layer = layer; Duration = duration; EnchantmentMask = (EnchantmentMask)(enchantmentMask ?? 0); StatMod = statMod; }
public Enchantment(WorldObject target, BiotaPropertiesEnchantmentRegistry entry) { if (entry.SpellCategory == EnchantmentManager.SpellCategory_Cooldown) { InitCooldown(target, entry); return; } Init(new Spell((uint)entry.SpellId)); Layer = entry.LayerId; StartTime = entry.StartTime; Duration = entry.Duration; // item spells can have -1, overriding the spell duration CasterGuid = entry.CasterObjectId; StatModValue = entry.StatModValue; Target = target; EnchantmentMask = (EnchantmentMask)entry.EnchantmentCategory; }
public Enchantment(WorldObject target, ACE.Entity.ObjectGuid?casterGuid, uint spellId, double duration, ushort layer, uint?enchantmentMask, float?statMod = null) { Target = target; if (casterGuid == null) { CasterGuid = ACE.Entity.ObjectGuid.Invalid; } else { CasterGuid = (ACE.Entity.ObjectGuid)casterGuid; } SpellBase = DatManager.PortalDat.SpellTable.Spells[spellId]; Spell = DatabaseManager.World.GetCachedSpell(spellId); Layer = layer; Duration = duration; EnchantmentMask = (EnchantmentMask)(enchantmentMask ?? 0); StatMod = statMod ?? Spell.StatModVal; }
private void SetEnchantMask() { EnchantmentMask = 0; if (LifeSpells != null && LifeSpells.Count > 0) { EnchantmentMask |= EnchantmentMask.LifeSpells; } if (CreatureSpells != null && CreatureSpells.Count > 0) { EnchantmentMask |= EnchantmentMask.CreatureSpells; } if (Cooldowns != null && Cooldowns.Count > 0) { EnchantmentMask |= EnchantmentMask.Cooldown; } if (Vitae != null) { EnchantmentMask |= EnchantmentMask.Vitae; } }
private static IEnumerable <BiotaPropertiesEnchantmentRegistry> GetEntries(ICollection <BiotaPropertiesEnchantmentRegistry> registry, EnchantmentMask enchantmentMask) { return(registry.Where(e => ((EnchantmentMask)e.EnchantmentCategory).HasFlag(enchantmentMask))); }