Example #1
0
 private void SetEnchantMask()
 {
     EnchantmentMask = 0;
     foreach (var kvp in Enchantments.Where(e => e.Value.Count > 0))
     {
         EnchantmentMask |= kvp.Key;
     }
 }
Example #2
0
 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;
 }
Example #3
0
 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;
 }
Example #4
0
 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;
 }
Example #5
0
 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;
 }
Example #6
0
 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;
 }
Example #7
0
        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;
        }
Example #8
0
        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;
        }
Example #9
0
        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;
        }
Example #10
0
        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;
        }
Example #11
0
        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;
        }
Example #12
0
        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;
        }
Example #13
0
        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;
            }
        }
Example #14
0
 private static IEnumerable <BiotaPropertiesEnchantmentRegistry> GetEntries(ICollection <BiotaPropertiesEnchantmentRegistry> registry, EnchantmentMask enchantmentMask)
 {
     return(registry.Where(e => ((EnchantmentMask)e.EnchantmentCategory).HasFlag(enchantmentMask)));
 }