Пример #1
0
        public ChrClassesEntry(int classId, int unk1, SpellCostPower displayPower, int petNameToken, [NotNull] LocalizedStringDBC <TStringType> name, [NotNull] LocalizedStringDBC <TStringType> femaleName, [NotNull] LocalizedStringDBC <TStringType> maleName, [NotNull] TStringType fileName, SpellFamilyName spellClassSet, CharacterClassEquipmentFlags flags, int cinematicSequenceId, int requiredExpansion)
        {
            if (classId <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(classId));
            }

            ClassId             = classId;
            Unk1                = unk1;
            DisplayPower        = displayPower;
            PetNameToken        = petNameToken;
            Name                = name ?? throw new ArgumentNullException(nameof(name));
            FemaleName          = femaleName ?? throw new ArgumentNullException(nameof(femaleName));
            MaleName            = maleName ?? throw new ArgumentNullException(nameof(maleName));
            FileName            = fileName ?? throw new ArgumentNullException(nameof(fileName));
            SpellClassSet       = spellClassSet;
            Flags               = flags;
            CinematicSequenceId = cinematicSequenceId;
            RequiredExpansion   = requiredExpansion;
        }
        // 239      3.3.0

        /// <inheritdoc />
        public SpellEntry(int spellId, uint category, uint dispel, SpellMechanic mechanic, SpellAtribute attributes, SpellAtributeEx attributesEx, SpellAtributeEx2 attributesEx2, SpellAtributeEx3 attributesEx3, SpellAtributeEx4 attributesEx4, SpellAtributeEx5 attributesEx5, SpellAtributeEx6 attributesEx6, SpellAtributeEx7 attributesEx7, ulong stances, ulong stancesNot, uint targets, CreatureTypeMask targetCreatureType, uint requiresSpellFocus, uint facingCasterFlags, AuraState casterAuraState, AuraState targetAuraState, AuraState casterAuraStateNot, AuraState targetAuraStateNot, uint casterAuraSpell, uint targetAuraSpell, uint excludeCasterAuraSpell, uint excludeTargetAuraSpell, uint castingTimeIndex, uint recoveryTime, uint categoryRecoveryTime, SpellInteruptFlags interruptFlags, SpellAuraInterruptFlags auraInterruptFlags, SpellChannelInterruptFlags channelInterruptFlags, ProcFlags procFlags, uint procChance, uint procCharges, uint maxLevel, uint baseLevel, uint spellLevel, uint durationIndex, SpellCostPower powerType, uint manaCost, uint manaCostPerlevel, uint manaPerSecond, uint manaPerSecondPerLevel, uint rangeIndex, float speed, uint modalNextSpell, uint stackAmount, RequiredReagentData reagentsRequired, ItemClassType equippedItemClass, int equippedItemSubClassMask, InventoryTypeMask equippedItemInventoryTypeMask, SpellEffectData spellEffectInformation, SpellVisualData spellVisual, uint spellIconId, uint activeIconId, uint spellPriority, LocalizedStringDBC <TStringType> spellName, LocalizedStringDBC <TStringType> rank, LocalizedStringDBC <TStringType> description, LocalizedStringDBC <TStringType> toolTip, uint manaCostPercentage, uint startRecoveryCategory, uint startRecoveryTime, uint maxTargetLevel, SpellFamilyName spellFamilyName, Flags96 <uint> spellFamilyFlags, uint maxAffectedTargets, SpellDamageClassType dmgClass, SpellPreventionType preventionType, uint stanceBarOrder, SpellEffectDataChunk <float> dmgMultiplier, uint minFactionId, uint minReputation, uint requiredAuraVision, SpellTotemDataChunk <uint> totemCategory, int areaGroupId, SpellSchoolMask schoolMask, uint runeCostId, uint spellMissileId, uint powerDisplayId, SpellEffectDataChunk <float> damageCoeficient, uint spellDescriptionVariableId, uint spellDifficultyId)
        {
            SpellId                = spellId;
            Category               = category;
            Dispel                 = dispel;
            Mechanic               = mechanic;
            Attributes             = attributes;
            AttributesEx           = attributesEx;
            AttributesEx2          = attributesEx2;
            AttributesEx3          = attributesEx3;
            AttributesEx4          = attributesEx4;
            AttributesEx5          = attributesEx5;
            AttributesEx6          = attributesEx6;
            AttributesEx7          = attributesEx7;
            Stances                = stances;
            StancesNot             = stancesNot;
            Targets                = targets;
            TargetCreatureType     = targetCreatureType;
            RequiresSpellFocus     = requiresSpellFocus;
            FacingCasterFlags      = facingCasterFlags;
            CasterAuraState        = casterAuraState;
            TargetAuraState        = targetAuraState;
            CasterAuraStateNot     = casterAuraStateNot;
            TargetAuraStateNot     = targetAuraStateNot;
            CasterAuraSpell        = casterAuraSpell;
            TargetAuraSpell        = targetAuraSpell;
            ExcludeCasterAuraSpell = excludeCasterAuraSpell;
            ExcludeTargetAuraSpell = excludeTargetAuraSpell;
            CastingTimeIndex       = castingTimeIndex;
            RecoveryTime           = recoveryTime;
            CategoryRecoveryTime   = categoryRecoveryTime;
            InterruptFlags         = interruptFlags;
            AuraInterruptFlags     = auraInterruptFlags;
            ChannelInterruptFlags  = channelInterruptFlags;
            ProcFlags              = procFlags;
            ProcChance             = procChance;
            ProcCharges            = procCharges;
            MaxLevel               = maxLevel;
            BaseLevel              = baseLevel;
            SpellLevel             = spellLevel;
            DurationIndex          = durationIndex;
            PowerType              = powerType;
            ManaCost               = manaCost;
            ManaCostPerlevel       = manaCostPerlevel;
            ManaPerSecond          = manaPerSecond;
            ManaPerSecondPerLevel  = manaPerSecondPerLevel;
            RangeIndex             = rangeIndex;
            Speed                         = speed;
            ModalNextSpell                = modalNextSpell;
            StackAmount                   = stackAmount;
            ReagentsRequired              = reagentsRequired;
            EquippedItemClass             = equippedItemClass;
            EquippedItemSubClassMask      = equippedItemSubClassMask;
            EquippedItemInventoryTypeMask = equippedItemInventoryTypeMask;
            SpellEffectInformation        = spellEffectInformation;
            SpellVisual                   = spellVisual;
            SpellIconID                   = spellIconId;
            ActiveIconID                  = activeIconId;
            SpellPriority                 = spellPriority;
            SpellName                     = spellName;
            Rank                       = rank;
            Description                = description;
            ToolTip                    = toolTip;
            ManaCostPercentage         = manaCostPercentage;
            StartRecoveryCategory      = startRecoveryCategory;
            StartRecoveryTime          = startRecoveryTime;
            MaxTargetLevel             = maxTargetLevel;
            SpellFamilyName            = spellFamilyName;
            SpellFamilyFlags           = spellFamilyFlags;
            MaxAffectedTargets         = maxAffectedTargets;
            DmgClass                   = dmgClass;
            PreventionType             = preventionType;
            StanceBarOrder             = stanceBarOrder;
            DmgMultiplier              = dmgMultiplier;
            MinFactionId               = minFactionId;
            MinReputation              = minReputation;
            RequiredAuraVision         = requiredAuraVision;
            TotemCategory              = totemCategory;
            AreaGroupId                = areaGroupId;
            SchoolMask                 = schoolMask;
            RuneCostID                 = runeCostId;
            SpellMissileID             = spellMissileId;
            PowerDisplayId             = powerDisplayId;
            DamageCoeficient           = damageCoeficient;
            SpellDescriptionVariableID = spellDescriptionVariableId;
            SpellDifficultyId          = spellDifficultyId;
        }
Пример #3
0
        public ProcInfo(TreeView familyTree, SpellFamilyName spellfamily)
        {
            Contract.Requires(familyTree != null);

            familyTree.Nodes.Clear();

            var spells = from spell in Dbc.Spell
                         where spell.Value.SpellFamilyName == spellfamily
                         join skillLineAbility in Dbc.SkillLineAbility on spell.Key equals skillLineAbility.Value.SpellId into temp1
                         from skill in temp1.DefaultIfEmpty()
                         join skl in Dbc.SkillLine on skill.Value.SkillId equals skl.Key into temp2
                         from skillLine in temp2.DefaultIfEmpty()
                         select new
                         {
                             spell,
                             skill.Value.SkillId,
                             skillLine.Value
                         };

            for (var flag = 0; flag < 96; flag++)
            {
                var mask = new uint[3];

                if (flag < 32)
                    mask[0] = 1U << flag;
                else if (flag < 64)
                    mask[1] = 1U << (flag - 32);
                else
                    mask[2] = 1U << (flag - 64);

                var node = new TreeNode
                               {
                                   Text = String.Format("0x{0:X8} {1:X8} {2:X8}", mask[2], mask[1], mask[0]),
                                   ImageKey = "family.ico"
                               };
                familyTree.Nodes.Add(node);
            }

            foreach (var spellEntry in spells)
            {
                var spell = spellEntry.spell.Value;
                var isSkill = spellEntry.SkillId != 0;

                var name = new StringBuilder();
                var toolTip = new StringBuilder();

                name.AppendFormat("{0} - {1} ", spell.ID, spell.SpellNameRank);

                toolTip.AppendFormatLine("Spell Name: {0}", spell.SpellNameRank);
                toolTip.AppendFormatLine("Description: {0}", spell.Description);
                toolTip.AppendFormatLine("ToolTip: {0}", spell.ToolTip);

                if (isSkill)
                {
                    name.AppendFormat("(Skill: ({0}) {1}) ", spellEntry.SkillId, spellEntry.Value.Name);

                    toolTip.AppendLine();
                    toolTip.AppendFormatLine("Skill Name: {0}", spellEntry.Value.Name);
                    toolTip.AppendFormatLine("Description: {0}", spellEntry.Value.Description);
                }

                name.AppendFormat("({0})", spell.SchoolMask.ToString().NormalizeString("MASK_"));

                foreach (TreeNode node in familyTree.Nodes)
                {
                    var mask = new uint[3];

                    if (node.Index < 32)
                        mask[0] = 1U << node.Index;
                    else if (node.Index < 64)
                        mask[1] = 1U << (node.Index - 32);
                    else
                        mask[2] = 1U << (node.Index - 64);

                    if ((!spell.SpellFamilyFlags.HasAnyFlagOnSameIndex(mask)))
                        continue;

                    var child = node.Nodes.Add(name.ToString());
                    child.Name = spell.ID.ToString(CultureInfo.InvariantCulture);
                    child.ImageKey = isSkill ? "plus.ico" : "munus.ico";
                    child.ForeColor = isSkill ? Color.Blue : Color.Red;
                    child.ToolTipText = toolTip.ToString();
                }
            }
        }