Exemple #1
0
        public SpellEffectInfo(SpellInfo _spellInfo, uint effIndex, SpellEffectEntry _effect)
        {
            SpellScalingEntry scaling = DBCStorage.SpellScalingStorage.LookupByKey(_spellInfo.SpellScalingId);

            spellInfo           = _spellInfo;
            _effIndex           = _effect != null ? _effect.EffectIndex : effIndex;
            Effect              = _effect.Effect;
            ApplyAuraName       = _effect.EffectApplyAuraName;
            Amplitude           = _effect.EffectAmplitude;
            DieSides            = _effect.EffectDieSides;
            RealPointsPerLevel  = _effect.EffectRealPointsPerLevel;
            BasePoints          = _effect.EffectBasePoints;
            PointsPerComboPoint = _effect.EffectPointsPerComboPoint;
            ValueMultiplier     = _effect.EffectValueMultiplier;
            DamageMultiplier    = _effect.EffectDamageMultiplier;
            BonusMultiplier     = _effect.EffectBonusMultiplier;
            MiscValue           = _effect.EffectMiscValue;
            MiscValueB          = _effect.EffectMiscValueB;
            //Mechanic = Mechanics(_effect ? _effect.EffectMechanic : 0);
            //TargetA = SpellImplicitTargetInfo(_effect ? _effect.EffectImplicitTargetA : 0);
            //TargetB = SpellImplicitTargetInfo(_effect ? _effect.EffectImplicitTargetB : 0);
            RadiusEntry    = DBCStorage.SpellRadiusStorage.LookupByKey(_effect.EffectRadiusIndex);
            ChainTarget    = _effect.EffectChainTarget;
            ItemType       = _effect.EffectItemType;
            TriggerSpell   = _effect.EffectTriggerSpell;
            SpellClassMask = new flag96(_effect.EffectSpellClassMask);
            //ImplicitTargetConditions = null;
            //ScalingMultiplier = scaling != null ? scaling.Multiplier[_effIndex] : 0.0f;
            //DeltaScalingMultiplier = scaling != null ? scaling.RandomMultiplier[_effIndex] : 0.0f;
            //ComboScalingMultiplier = scaling != null ? scaling.OtherMultiplier[_effIndex] : 0.0f;
        }
Exemple #2
0
        public SpellInfo(SpellEntry spellEntry, SpellEffectEntry[] effects)
        {
            Id = spellEntry.Id;

            SpellMisc misc = spellEntry.Misc;

            if (misc != null)
            {
                Attributes     = (SpellAttr0)misc.Attributes;
                AttributesEx   = (SpellAttr1)misc.AttributesEx;
                AttributesEx2  = (SpellAttr2)misc.AttributesEx2;
                AttributesEx3  = (SpellAttr3)misc.AttributesEx3;
                AttributesEx4  = (SpellAttr4)misc.AttributesEx4;
                AttributesEx5  = (SpellAttr5)misc.AttributesEx5;
                AttributesEx6  = (SpellAttr6)misc.AttributesEx6;
                AttributesEx7  = (SpellAttr7)misc.AttributesEx7;
                AttributesEx8  = (SpellAttr8)misc.AttributesEx8;
                AttributesEx9  = (SpellAttr9)misc.AttributesEx9;
                AttributesEx10 = (SpellAttr10)misc.AttributesEx10;
                Speed          = spellEntry.Misc.Speed;
                for (var i = 0; i < 2; ++i)
                {
                    SpellVisual[i] = misc.SpellVisual[i];
                }

                CastTimeEntry = DBCStorage.SpellCastTimesStorage.LookupByKey(misc.CastingTimeIndex);
                DurationEntry = DBCStorage.SpellDurationStorage.LookupByKey(misc.DurationIndex);
                //PowerType = (Powers)misc.PowerType;
                RangeEntry = DBCStorage.SpellRangeStorage.LookupByKey(misc.RangeIndex);

                SpellIconID  = misc.SpellIconID;
                ActiveIconID = misc.ActiveIconID;
                SchoolMask   = misc.SchoolMask;
            }
            AttributesCu = 0;

            SpellName = spellEntry.Name;
            Rank      = spellEntry.Rank;

            RuneCostID = spellEntry.RuneCostID;
            //SpellDifficultyId = spellEntry.SpellDifficultyId;
            SpellScalingId             = spellEntry.SpellScalingId;
            SpellAuraOptionsId         = spellEntry.SpellAuraOptionsId;
            SpellAuraRestrictionsId    = spellEntry.SpellAuraRestrictionsId;
            SpellCastingRequirementsId = spellEntry.SpellCastingRequirementsId;
            SpellCategoriesId          = spellEntry.SpellCategoriesId;
            SpellClassOptionsId        = spellEntry.SpellClassOptionsId;
            SpellCooldownsId           = spellEntry.SpellCooldownsId;
            SpellEquippedItemsId       = spellEntry.SpellEquippedItemsId;
            SpellInterruptsId          = spellEntry.SpellInterruptsId;
            SpellLevelsId             = spellEntry.SpellLevelsId;
            SpellPowerId              = spellEntry.SpellPowerId;
            SpellReagentsId           = spellEntry.SpellReagentsId;
            SpellShapeshiftId         = spellEntry.SpellShapeshiftId;
            SpellTargetRestrictionsId = spellEntry.SpellTargetRestrictionsId;
            SpellTotemsId             = spellEntry.SpellTotemsId;

            // SpellDifficultyEntry
            if (effects != null)
            {
                for (uint i = 0; i < effects.Length; i++)
                {
                    if (effects[i] == null)
                    {
                        continue;
                    }
                    Effects[i] = new SpellEffectInfo(this, i, effects[i]);
                }
            }

            // SpellScalingEntry
            SpellScalingEntry _scaling = DBCStorage.SpellScalingStorage.LookupByKey(SpellScalingId);

            if (_scaling != null)
            {
                CastTimeMin      = _scaling.CastTimeMin;
                CastTimeMax      = _scaling.CastTimeMax;
                CastTimeMaxLevel = _scaling.CastTimeMaxLevel;
                ScalingClass     = _scaling.ScalingClass;
                //CoefBase = _scaling.CoefBase;
                //CoefLevelBase = _scaling.CoefLevelBase;
            }

            // SpellAuraOptionsEntry
            SpellAuraOptionsEntry _options = DBCStorage.SpellAuraOptionsStorage.LookupByKey(SpellAuraOptionsId);

            if (_options != null)
            {
                ProcFlags   = _options.procFlags;
                ProcChance  = _options.procChance;
                ProcCharges = _options.procCharges;
                StackAmount = _options.StackAmount;
            }

            // SpellAuraRestrictionsEntry
            SpellAuraRestrictionsEntry _aura = DBCStorage.SpellAuraRestrictionsStorage.LookupByKey(SpellAuraRestrictionsId);

            if (_aura != null)
            {
                CasterAuraState        = _aura.CasterAuraState;
                TargetAuraState        = _aura.TargetAuraState;
                CasterAuraStateNot     = _aura.CasterAuraStateNot;
                TargetAuraStateNot     = _aura.TargetAuraStateNot;
                CasterAuraSpell        = _aura.casterAuraSpell;
                TargetAuraSpell        = _aura.targetAuraSpell;
                ExcludeCasterAuraSpell = _aura.excludeCasterAuraSpell;
                ExcludeTargetAuraSpell = _aura.excludeTargetAuraSpell;
            }

            // SpellCastingRequirementsEntry
            SpellCastingRequirementsEntry _castreq = DBCStorage.SpellCastingRequirementsStorage.LookupByKey(SpellCastingRequirementsId);

            if (_castreq != null)
            {
                RequiresSpellFocus = _castreq.RequiresSpellFocus;
                FacingCasterFlags  = _castreq.FacingCasterFlags;
                AreaGroupId        = _castreq.AreaGroupId != 0 ? _castreq.AreaGroupId : -1;
            }

            // SpellCategoriesEntry
            SpellCategoriesEntry _categorie = DBCStorage.SpellCategoriesStorage.LookupByKey(SpellCategoriesId);

            if (_categorie != null)
            {
                Category = _categorie.Category;
                Dispel   = _categorie.Dispel;
                Mechanic = _categorie.Mechanic;
                StartRecoveryCategory = _categorie.StartRecoveryCategory;
                DmgClass       = (SpellDmgClass)_categorie.DmgClass;
                PreventionType = _categorie.PreventionType;
            }

            // SpellClassOptionsEntry
            SpellClassOptionsEntry _class = DBCStorage.SpellClassOptionsStorage.LookupByKey(SpellClassOptionsId);

            if (_class != null)
            {
                SpellFamilyName  = _class.SpellFamilyName;
                SpellFamilyFlags = new flag96(_class.SpellFamilyFlags);
            }

            // SpellCooldownsEntry
            SpellCooldownsEntry _cooldowns = DBCStorage.SpellCooldownsStorage.LookupByKey(SpellCooldownsId);

            if (_cooldowns != null)
            {
                RecoveryTime         = _cooldowns.RecoveryTime;
                CategoryRecoveryTime = _cooldowns.CategoryRecoveryTime;
                StartRecoveryTime    = _cooldowns.StartRecoveryTime;
            }

            // SpellEquippedItemsEntry
            SpellEquippedItemsEntry _equipped = DBCStorage.SpellEquippedItemsStorage.LookupByKey(SpellEquippedItemsId);

            if (_equipped != null)
            {
                EquippedItemClass             = _equipped.EquippedItemClass;
                EquippedItemSubClassMask      = _equipped.EquippedItemSubClassMask;
                EquippedItemInventoryTypeMask = _equipped.EquippedItemInventoryTypeMask;
            }
            else
            {
                EquippedItemClass             = -1;
                EquippedItemSubClassMask      = -1;
                EquippedItemInventoryTypeMask = -1;
            }

            // SpellInterruptsEntry
            SpellInterruptsEntry _interrupt = DBCStorage.SpellInterruptsEntryStorage.LookupByKey(SpellInterruptsId);

            if (_interrupt != null)
            {
                InterruptFlags        = _interrupt.InterruptFlags;
                AuraInterruptFlags    = _interrupt.AuraInterruptFlags;
                ChannelInterruptFlags = _interrupt.ChannelInterruptFlags;
            }

            // SpellLevelsEntry
            SpellLevelsEntry _levels = DBCStorage.SpellLevelsStorage.LookupByKey(SpellLevelsId);

            if (_levels != null)
            {
                MaxLevel   = _levels.maxLevel;
                BaseLevel  = _levels.baseLevel;
                SpellLevel = _levels.spellLevel;
            }

            // SpellPowerEntry
            SpellPowerEntry _power = DBCStorage.SpellPowerStorage.LookupByKey(SpellPowerId);

            if (_power != null)
            {
                ManaCost           = _power.manaCost;
                ManaCostPerlevel   = _power.manaCostPerlevel;
                ManaCostPercentage = _power.ManaCostPercentage;
                ManaPerSecond      = _power.manaPerSecond;
            }

            // SpellReagentsEntry
            SpellReagentsEntry _reagents = DBCStorage.SpellReagentsStorage.LookupByKey(SpellReagentsId);

            for (var i = 0; i < SharedConst.MaxSpellReagents; ++i)
            {
                Reagent[i]      = _reagents != null ? _reagents.Reagent[i] : 0;
                ReagentCount[i] = _reagents != null ? _reagents.ReagentCount[i] : 0;
            }

            // SpellShapeshiftEntry
            SpellShapeshiftEntry _shapeshift = DBCStorage.SpellShapeshiftStorage.LookupByKey(SpellShapeshiftId);

            if (_shapeshift != null)
            {
                Stances    = _shapeshift.Stances;
                StancesNot = _shapeshift.StancesNot;
            }

            // SpellTargetRestrictionsEntry
            SpellTargetRestrictionsEntry _target = DBCStorage.SpellTargetRestrictionsStorage.LookupByKey(SpellTargetRestrictionsId);

            if (_target != null)
            {
                Targets            = _target.Targets;
                TargetCreatureType = _target.TargetCreatureType;
                MaxAffectedTargets = _target.MaxAffectedTargets;
            }

            // SpellTotemsEntry
            SpellTotemsEntry _totem = DBCStorage.SpellTotemsStorage.LookupByKey(SpellTotemsId);

            for (var i = 0; i < 2; ++i)
            {
                TotemCategory[i] = _totem != null ? _totem.TotemCategory[i] : 0;
                Totem[i]         = _totem != null ? _totem.Totem[i] : 0;
            }

            //ExplicitTargetMask = _GetExplicitTargetMask();
            ChainEntry = null;
        }