Exemplo n.º 1
0
        private void PopulatePassive()
        {
            explicitTargetType = SpellExplicitTargetType.Caster;
            damageClass        = SpellDamageClass.None;
            spellDispel        = SpellDispelType.None;
            mechanic           = SpellMechanics.None;

            explicitCastTargets = SpellCastTargetFlags.UnitAlly;
            schoolMask          = 0;
            preventionType      = 0;
            attributes          = SpellAttributes.Passive;
            attributesExtra     = SpellExtraAttributes.DoesNotTriggerGcd | SpellExtraAttributes.IgnoreGcd | SpellExtraAttributes.NotStealable;
            attributesCustom    = SpellCustomAttributes.CastWithoutAnimation;

            targetEntityTypeMask  = EnityTypeMask.Unit;
            rangedFlags           = SpellRangeFlags.Default;
            interruptFlags        = 0;
            castIgnoringMechanics = 0;

            cooldownTime         = 0;
            categoryCooldownTime = 0;
            globalCooldownTime   = 0;
            castTime             = 0;
            minCastTime          = 0;

            minRangeHostile = 0;
            minRangeFriend  = 0;
            maxRangeHostile = 0;
            maxRangeFriend  = 0;
            speed           = 0;
        }
Exemplo n.º 2
0
        public bool HasMechanics(SpellMechanics mechanics)
        {
            foreach (AuraEffectInfo auraEffectInfo in auraEffects)
            {
                if (auraEffectInfo.Mechanics == mechanics)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 3
0
            internal void RemoveAurasWithEffectMechanics(AuraEffectType auraEffectType, SpellMechanics mechanics)
            {
                IReadOnlyList <AuraEffect> auraEffects = GetAuraEffects(auraEffectType);

                if (auraEffects == null)
                {
                    return;
                }

                var auraEffectsToRemove = ListPoolContainer <AuraEffect> .Take();

                for (int i = 0; i < auraEffects.Count; i++)
                {
                    if (auraEffects[i].EffectInfo.Mechanics == mechanics)
                    {
                        auraEffectsToRemove.Add(auraEffects[i]);
                    }
                }

                foreach (AuraEffect auraEffectToRemove in auraEffectsToRemove)
                {
                    if (!auraEffectToRemove.Aura.IsRemoved)
                    {
                        auraEffectToRemove.Aura.Remove(AuraRemoveMode.Spell);
                    }
                }

                ListPoolContainer <AuraEffect> .Return(auraEffectsToRemove);
            }
Exemplo n.º 4
0
        public static SpellMechanicsFlags AsFlag(this SpellMechanics mechanics)
        {
            switch (mechanics)
            {
            case SpellMechanics.None:
                return(0);

            case SpellMechanics.Charm:
                return(SpellMechanicsFlags.Charm);

            case SpellMechanics.Disoriented:
                return(SpellMechanicsFlags.Disoriented);

            case SpellMechanics.Disarm:
                return(SpellMechanicsFlags.Disarm);

            case SpellMechanics.Distract:
                return(SpellMechanicsFlags.Distract);

            case SpellMechanics.Fear:
                return(SpellMechanicsFlags.Fear);

            case SpellMechanics.Grip:
                return(SpellMechanicsFlags.Grip);

            case SpellMechanics.Root:
                return(SpellMechanicsFlags.Root);

            case SpellMechanics.SlowAttack:
                return(SpellMechanicsFlags.SlowAttack);

            case SpellMechanics.Silence:
                return(SpellMechanicsFlags.Silence);

            case SpellMechanics.Sleep:
                return(SpellMechanicsFlags.Sleep);

            case SpellMechanics.Snare:
                return(SpellMechanicsFlags.Snare);

            case SpellMechanics.Stun:
                return(SpellMechanicsFlags.Stun);

            case SpellMechanics.Freeze:
                return(SpellMechanicsFlags.Freeze);

            case SpellMechanics.Knockout:
                return(SpellMechanicsFlags.Knockout);

            case SpellMechanics.Bleed:
                return(SpellMechanicsFlags.Bleed);

            case SpellMechanics.Bandage:
                return(SpellMechanicsFlags.Bandage);

            case SpellMechanics.Polymorph:
                return(SpellMechanicsFlags.Polymorph);

            case SpellMechanics.Banish:
                return(SpellMechanicsFlags.Banish);

            case SpellMechanics.Shield:
                return(SpellMechanicsFlags.Shield);

            case SpellMechanics.Shackle:
                return(SpellMechanicsFlags.Shackle);

            case SpellMechanics.Mount:
                return(SpellMechanicsFlags.Mount);

            case SpellMechanics.Infected:
                return(SpellMechanicsFlags.Infected);

            case SpellMechanics.Horror:
                return(SpellMechanicsFlags.Horror);

            case SpellMechanics.Invulnerability:
                return(SpellMechanicsFlags.Invulnerability);

            case SpellMechanics.Interrupt:
                return(SpellMechanicsFlags.Interrupt);

            case SpellMechanics.Daze:
                return(SpellMechanicsFlags.Daze);

            case SpellMechanics.ImmuneShield:
                return(SpellMechanicsFlags.ImmuneShield);

            case SpellMechanics.Sapped:
                return(SpellMechanicsFlags.Sapped);

            case SpellMechanics.Enraged:
                return(SpellMechanicsFlags.Enraged);

            case SpellMechanics.Wounded:
                return(SpellMechanicsFlags.Wounded);

            default:
                throw new ArgumentOutOfRangeException(nameof(mechanics), mechanics, null);
            }
        }