Esempio n. 1
0
        private void BrowseOutputPath(object sender, RoutedEventArgs e)
        {
            string path = Utils.BrowseFolder();

            if (path != null)
            {
                out_pathBox.Text = path;
                console.Append("Output path: " + path, ColorCode.MSG);
            }
        }
Esempio n. 2
0
        private void AuraModTypeName(int index)
        {
            AuraType aura = (AuraType)spell.EffectApplyAuraName[index];
            int      misc = spell.EffectMiscValue[index];

            if (spell.EffectApplyAuraName[index] == 0)
            {
                rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", spell.EffectMiscValue[index]);
                rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", spell.EffectMiscValueB[index]);
                rtb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", spell.EffectAmplitude[index]);

                return;
            }

            rtb.AppendFormat("Aura Id {0:D} ({0})", aura);
            rtb.AppendFormat(", value = {0}", spell.EffectBasePoints[index] + 1);
            rtb.AppendFormat(", misc = {0} (", misc);

            switch (aura)
            {
            case AuraType.SPELL_AURA_MOD_STAT:
                rtb.Append((UnitMods)misc);
                break;

            case AuraType.SPELL_AURA_MOD_RATING:
                rtb.Append((CombatRating)misc);
                break;

            case AuraType.SPELL_AURA_ADD_FLAT_MODIFIER:
            case AuraType.SPELL_AURA_ADD_PCT_MODIFIER:
                rtb.Append((SpellModOp)misc);
                break;

            // todo: more case
            default:
                rtb.Append(misc);
                break;
            }

            rtb.AppendFormat("), miscB = {0}", spell.EffectMiscValueB[index]);
            rtb.AppendFormatLine(", periodic = {0}", spell.EffectAmplitude[index]);

            switch (aura)
            {
            default:
                break;
            }
        }
 public static RichTextBox AppendLine(this RichTextBox box, string text, Color color)
 {
     box.Append(text, color);
     box.AppendText(Environment.NewLine);
     box.SelectionColor = box.ForeColor;
     return(box);
 }
Esempio n. 4
0
        private void ViewSpellInfo()
        {
            _rtb.Clear();
            _rtb.SetBold();
            _rtb.AppendFormatLine("ID - {0} {1}{2}", _spell.ID, _spell.SpellNameRank, _spell.ScalingText);
            _rtb.SetDefaultStyle();

            _rtb.AppendFormatLine(_line);

            _rtb.AppendLine(_spell.Description);
            _rtb.AppendFormatLineIfNotNull("ToolTip: {0}", _spell.ToolTip);
            _rtb.AppendFormatLineIfNotNull("Modal Next Spell: {0}", _spell.ModalNextSpell);
            if (_spell.Description != string.Empty && _spell.ToolTip != string.Empty && _spell.ModalNextSpell != 0)
            {
                _rtb.AppendFormatLine(_line);
            }

            _rtb.AppendFormatLine("Category = {0}, SpellIconID = {1}, activeIconID = {2}, SpellVisual = ({3},{4})",
                                  _spell.Category, _spell.SpellIconID, _spell.ActiveIconID, _spell.SpellVisual[0], _spell.SpellVisual[1]);

            _rtb.AppendFormatLine("Family {0}, flag [0] 0x{1:X8} [1] 0x{2:X8} [2] 0x{3:X8} [3] 0x{4:X8}",
                                  (SpellFamilyNames)_spell.SpellFamilyName, _spell.SpellFamilyFlags[0], _spell.SpellFamilyFlags[1], _spell.SpellFamilyFlags[2], _spell.SpellFamilyFlags[3]);

            _rtb.AppendLine();

            _rtb.AppendFormatLine("SpellSchoolMask = {0} ({1})", _spell.SchoolMask, _spell.School);
            _rtb.AppendFormatLine("DamageClass = {0} ({1})", _spell.DmgClass, (SpellDmgClass)_spell.DmgClass);
            _rtb.AppendFormatLine("PreventionType = {0} ({1})", _spell.PreventionType, (SpellPreventionType)_spell.PreventionType);

            if (_spell.Attributes != 0 || _spell.AttributesEx != 0 || _spell.AttributesEx2 != 0 || _spell.AttributesEx3 != 0 || _spell.AttributesEx4 != 0 ||
                _spell.AttributesEx5 != 0 || _spell.AttributesEx6 != 0 || _spell.AttributesEx7 != 0 || _spell.AttributesEx8 != 0)
            {
                _rtb.AppendLine(_line);
            }

            if (_spell.Attributes != 0)
            {
                _rtb.AppendFormatLine("Attributes: 0x{0:X8} ({1})", _spell.Attributes, (SpellAtribute)_spell.Attributes);
            }
            if (_spell.AttributesEx != 0)
            {
                _rtb.AppendFormatLine("AttributesEx1: 0x{0:X8} ({1})", _spell.AttributesEx, (SpellAtributeEx)_spell.AttributesEx);
            }
            if (_spell.AttributesEx2 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx2: 0x{0:X8} ({1})", _spell.AttributesEx2, (SpellAtributeEx2)_spell.AttributesEx2);
            }
            if (_spell.AttributesEx3 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx3: 0x{0:X8} ({1})", _spell.AttributesEx3, (SpellAtributeEx3)_spell.AttributesEx3);
            }
            if (_spell.AttributesEx4 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx4: 0x{0:X8} ({1})", _spell.AttributesEx4, (SpellAtributeEx4)_spell.AttributesEx4);
            }
            if (_spell.AttributesEx5 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx5: 0x{0:X8} ({1})", _spell.AttributesEx5, (SpellAtributeEx5)_spell.AttributesEx5);
            }
            if (_spell.AttributesEx6 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx6: 0x{0:X8} ({1})", _spell.AttributesEx6, (SpellAtributeEx6)_spell.AttributesEx6);
            }
            if (_spell.AttributesEx7 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx7: 0x{0:X8} ({1})", _spell.AttributesEx7, (SpellAtributeEx7)_spell.AttributesEx7);
            }
            if (_spell.AttributesEx8 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx8: 0x{0:X8} ({1})", _spell.AttributesEx8, (SpellAtributeEx8)_spell.AttributesEx8);
            }
            if (_spell.AttributesEx9 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx9: 0x{0:X8} ({1})", _spell.AttributesEx9, (SpellAtributeEx9)_spell.AttributesEx9);
            }
            if (_spell.AttributesEx10 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx10: 0x{0:X8} ({1})", _spell.AttributesEx10, (SpellAtributeEx10)_spell.AttributesEx10);
            }
            if (_spell.AttributesEx11 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx11: 0x{0:X8} ({1})", _spell.AttributesEx11, (SpellAtributeEx11)_spell.AttributesEx11);
            }
            if (_spell.AttributesEx12 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx12: 0x{0:X8} ({1})", _spell.AttributesEx12, (SpellAtributeEx12)_spell.AttributesEx12);
            }
            if (_spell.AttributesEx13 != 0)
            {
                _rtb.AppendFormatLine("AttributesEx13: 0x{0:X8} ({1})", _spell.AttributesEx13, (SpellAtributeEx13)_spell.AttributesEx13);
            }

            _rtb.AppendLine(_line);

            if (_spell.Targets != 0)
            {
                _rtb.AppendFormatLine("Targets Mask = 0x{0:X8} ({1})", _spell.Targets, (SpellCastTargetFlags)_spell.Targets);
            }

            if (_spell.TargetCreatureType != 0)
            {
                _rtb.AppendFormatLine("Creature Type Mask = 0x{0:X8} ({1})",
                                      _spell.TargetCreatureType, (CreatureTypeMask)_spell.TargetCreatureType);
            }

            if (_spell.Stances != 0)
            {
                _rtb.AppendFormatLine("Stances: {0}", (ShapeshiftFormMask)_spell.Stances);
            }

            if (_spell.StancesNot != 0)
            {
                _rtb.AppendFormatLine("Stances Not: {0}", (ShapeshiftFormMask)_spell.StancesNot);
            }

            AppendSkillLine();

            // reagents
            {
                var printedHeader = false;
                for (var i = 0; i < _spell.Reagent.Length; ++i)
                {
                    if (_spell.Reagent[i] == 0)
                    {
                        continue;
                    }

                    if (!printedHeader)
                    {
                        _rtb.AppendLine();
                        _rtb.Append("Reagents:");
                        printedHeader = true;
                    }

                    _rtb.AppendFormat("  {0} x{1}", _spell.Reagent[i], _spell.ReagentCount[i]);
                }

                if (printedHeader)
                {
                    _rtb.AppendLine();
                }
            }

            _rtb.AppendFormatLine("Spell Level = {0}, base {1}, max {2}, maxTarget {3}",
                                  _spell.SpellLevel, _spell.BaseLevel, _spell.MaxLevel, _spell.MaxTargetLevel);

            if (_spell.EquippedItemClass != 0)
            {
                _rtb.AppendFormatLine("EquippedItemClass = {0} ({1})", _spell.EquippedItemClass, (ItemClass)_spell.EquippedItemClass);

                if (_spell.EquippedItemSubClassMask != 0)
                {
                    switch ((ItemClass)_spell.EquippedItemClass)
                    {
                    case ItemClass.WEAPON:
                        _rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})",
                                              _spell.EquippedItemSubClassMask, (ItemSubClassWeaponMask)_spell.EquippedItemSubClassMask);
                        break;

                    case ItemClass.ARMOR:
                        _rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})",
                                              _spell.EquippedItemSubClassMask, (ItemSubClassArmorMask)_spell.EquippedItemSubClassMask);
                        break;

                    case ItemClass.MISC:
                        _rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})",
                                              _spell.EquippedItemSubClassMask, (ItemSubClassMiscMask)_spell.EquippedItemSubClassMask);
                        break;
                    }
                }

                if (_spell.EquippedItemInventoryTypeMask != 0)
                {
                    _rtb.AppendFormatLine("    InventoryType mask = 0x{0:X8} ({1})",
                                          _spell.EquippedItemInventoryTypeMask, (InventoryTypeMask)_spell.EquippedItemInventoryTypeMask);
                }
            }

            _rtb.AppendLine();
            _rtb.AppendFormatLine("Category = {0}", _spell.Category);
            _rtb.AppendFormatLine("DispelType = {0} ({1})", _spell.Dispel, (DispelType)_spell.Dispel);
            _rtb.AppendFormatLine("Mechanic = {0} ({1})", _spell.Mechanic, (Mechanics)_spell.Mechanic);

            _rtb.AppendLine(_spell.Range);

            _rtb.AppendFormatLineIfNotNull("Speed {0:F}", _spell.Speed);
            _rtb.AppendFormatLineIfNotNull("Stackable up to {0}", _spell.StackAmount);

            _rtb.AppendLine(_spell.CastTime);

            if (_spell.RecoveryTime != 0 || _spell.CategoryRecoveryTime != 0 || _spell.StartRecoveryCategory != 0)
            {
                _rtb.AppendFormatLine("RecoveryTime: {0} ms, CategoryRecoveryTime: {1} ms", _spell.RecoveryTime, _spell.CategoryRecoveryTime);
                _rtb.AppendFormatLine("StartRecoveryCategory = {0}, StartRecoveryTime = {1:F} ms", _spell.StartRecoveryCategory, _spell.StartRecoveryTime);
            }

            _rtb.AppendLine(_spell.Duration);

            if (_spell.ManaCost != 0 || _spell.ManaCostPercentage != 0)
            {
                _rtb.AppendFormat("Power {0}, Cost {1}",
                                  (Powers)_spell.PowerType, _spell.ManaCost == 0 ? _spell.ManaCostPercentage + " %" : _spell.ManaCost.ToString());
                _rtb.AppendFormatIfNotNull(" + lvl * {0}", _spell.ManaCostPerlevel);
                _rtb.AppendFormatIfNotNull(" + {0} Per Second", _spell.ManaPerSecond);
                _rtb.AppendLine();
            }

            _rtb.AppendFormatLine("Interrupt Flags: 0x{0:X8}, AuraIF 0x{1:X8}, ChannelIF 0x{2:X8}",
                                  _spell.InterruptFlags, _spell.AuraInterruptFlags, _spell.ChannelInterruptFlags);

            if (_spell.CasterAuraState != 0)
            {
                _rtb.AppendFormatLine("CasterAuraState = {0} ({1})", _spell.CasterAuraState, (AuraState)_spell.CasterAuraState);
            }

            if (_spell.TargetAuraState != 0)
            {
                _rtb.AppendFormatLine("TargetAuraState = {0} ({1})", _spell.TargetAuraState, (AuraState)_spell.TargetAuraState);
            }

            if (_spell.CasterAuraStateNot != 0)
            {
                _rtb.AppendFormatLine("CasterAuraStateNot = {0} ({1})", _spell.CasterAuraStateNot, (AuraState)_spell.CasterAuraStateNot);
            }

            if (_spell.TargetAuraStateNot != 0)
            {
                _rtb.AppendFormatLine("TargetAuraStateNot = {0} ({1})", _spell.TargetAuraStateNot, (AuraState)_spell.TargetAuraStateNot);
            }

            if (_spell.MaxAffectedTargets != 0)
            {
                _rtb.AppendFormatLine("MaxAffectedTargets = {0}", _spell.MaxAffectedTargets);
            }

            AppendSpellAura();

            AppendAreaInfo();

            _rtb.AppendFormatLineIfNotNull("Requires Spell Focus {0}", _spell.RequiresSpellFocus);

            if (_spell.ProcFlags != 0)
            {
                _rtb.SetBold();
                _rtb.AppendFormatLine("Proc flag 0x{0:X8}, chance = {1}, charges - {2}",
                                      _spell.ProcFlags, _spell.ProcChance, _spell.ProcCharges);
                _rtb.SetDefaultStyle();
                _rtb.AppendFormatLine(_line);
                _rtb.AppendText(_spell.ProcInfo);
            }
            else
            {
                _rtb.AppendFormatLine("Chance = {0}, charges - {1}", _spell.ProcChance, _spell.ProcCharges);
            }

            AppendSpellEffectInfo();
            AppendItemInfo();
            AppendDifficultyInfo();

            AppendSpellVisualInfo();
        }
Esempio n. 5
0
        private void AuraModTypeName(int index)
        {
            SpellEffectEntry effect = spell.GetEffect(index);
            AuraType         aura   = (AuraType)effect.EffectApplyAuraName;
            int misc = effect.EffectMiscValue;

            if (effect.EffectApplyAuraName == 0)
            {
                rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", effect.EffectMiscValue);
                rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", effect.EffectMiscValueB);
                rtb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", effect.EffectAmplitude);

                return;
            }

            rtb.AppendFormat("Aura Id {0:D} ({0})", aura);
            rtb.AppendFormat(", value = {0}", effect.EffectBasePoints);
            rtb.AppendFormat(", misc = {0} (", misc);

            switch (aura)
            {
            case AuraType.SPELL_AURA_MOD_STAT:
                rtb.Append((UnitMods)misc);
                break;

            case AuraType.SPELL_AURA_MOD_RATING:
                rtb.Append((CombatRating)misc);
                break;

            case AuraType.SPELL_AURA_ADD_FLAT_MODIFIER:
            case AuraType.SPELL_AURA_ADD_PCT_MODIFIER:
                rtb.Append((SpellModOp)misc);
                break;

            // todo: more case
            default:
                rtb.Append(misc);
                break;
            }

            rtb.AppendFormat("), miscB = {0}", effect.EffectMiscValueB);
            rtb.AppendFormatLine(", periodic = {0}", effect.EffectAmplitude);

            switch (aura)
            {
            case AuraType.SPELL_AURA_OVERRIDE_SPELLS:
                if (!DBC.OverrideSpellData.ContainsKey((uint)misc))
                {
                    rtb.SetStyle(Color.Red, FontStyle.Bold);
                    rtb.AppendFormatLine("Cannot find key {0} in OverrideSpellData.dbc", (uint)misc);
                }
                else
                {
                    rtb.AppendLine();
                    rtb.SetStyle(Color.DarkRed, FontStyle.Bold);
                    rtb.AppendLine("Overriding Spells:");
                    OverrideSpellDataEntry Override = DBC.OverrideSpellData[(uint)misc];
                    for (int i = 0; i < 10; ++i)
                    {
                        if (Override.Spells[i] == 0)
                        {
                            continue;
                        }

                        rtb.SetStyle(Color.DarkBlue, FontStyle.Regular);
                        rtb.AppendFormatLine("\t - #{0} ({1}) {2}", i + 1, Override.Spells[i],
                                             DBC.Spell.ContainsKey(Override.Spells[i]) ? DBC.Spell[Override.Spells[i]].SpellName : "?????");
                    }
                    rtb.AppendLine();
                }
                break;

            case AuraType.SPELL_AURA_SCREEN_EFFECT:
                rtb.SetStyle(Color.DarkBlue, FontStyle.Bold);
                rtb.AppendFormatLine("ScreenEffect: {0}",
                                     DBC.ScreenEffect.ContainsKey((uint)misc) ? DBC.ScreenEffect[(uint)misc].Name : "?????");
                break;

            default:
                break;
            }
        }
Esempio n. 6
0
        private void ViewSpellInfo()
        {
            try
            {
                _rtb.Clear();
                _rtb.SetBold();
                _rtb.AppendFormatLine("ID - {0} {1}{2}", _spell.ID, _spell.SpellNameRank, _spell.ScalingText);
                _rtb.SetDefaultStyle();

                _rtb.AppendFormatLine(_line);

                _rtb.AppendLine(_spell.Description);
                _rtb.AppendFormatLineIfNotNull("ToolTip: {0}", _spell.ToolTip);
                _rtb.AppendFormatLineIfNotNull("Modal Next Spell: {0}", _spell.ModalNextSpell);
                if (_spell.Description != string.Empty && _spell.ToolTip != string.Empty && _spell.ModalNextSpell != 0)
                {
                    _rtb.AppendFormatLine(_line);
                }

                bool addline = false;
                if (DBC.DBC.SpellTriggerStore.ContainsKey(_spell.ID))
                {
                    foreach (uint procSpellId in DBC.DBC.SpellTriggerStore[_spell.ID])
                    {
                        string procname = "Spell Not Found";
                        if (DBC.DBC.Spell.ContainsKey(procSpellId))
                        {
                            procname = DBC.DBC.Spell[procSpellId].SpellName;
                        }
                        _rtb.SetStyle(Color.Blue, FontStyle.Bold);

                        _rtb.AppendFormatLine("Triggred by spell: ({0}) {1}", procSpellId, procname);
                        _rtb.SetDefaultStyle();
                        addline = true;
                    }
                }
                if (addline)
                {
                    _rtb.AppendFormatLine(_line);
                }

                _rtb.AppendFormatLine("Category = {0}, SpellIconID = {1}, activeIconID = {2}, SpellVisual = ({3},{4})",
                                      _spell.Category, _spell.SpellIconID, _spell.ActiveIconID, _spell.SpellVisual[0], _spell.SpellVisual[1]);

                _rtb.AppendFormatLine("Family {0}, flag [0] 0x{1:X8} [1] 0x{2:X8} [2] 0x{3:X8}",
                                      (SpellFamilyNames)_spell.SpellFamilyName, _spell.SpellFamilyFlags[0], _spell.SpellFamilyFlags[1], _spell.SpellFamilyFlags[2]);

                _rtb.AppendLine();

                _rtb.AppendFormatLine("SpellSchoolMask = {0} ({1})", _spell.SchoolMask, _spell.School);
                _rtb.AppendFormatLine("DamageClass = {0} ({1})", _spell.DmgClass, (SpellDmgClass)_spell.DmgClass);
                _rtb.AppendFormatLine("PreventionType = {0} ({1})", _spell.PreventionType, (SpellPreventionType)_spell.PreventionType);

                if (_spell.Attributes != 0 || _spell.AttributesEx != 0 || _spell.AttributesEx2 != 0 || _spell.AttributesEx3 != 0 || _spell.AttributesEx4 != 0 ||
                    _spell.AttributesEx5 != 0 || _spell.AttributesEx6 != 0 || _spell.AttributesEx7 != 0 || _spell.AttributesEx8 != 0)
                {
                    _rtb.AppendLine(_line);
                }

                if (_spell.Attributes != 0)
                {
                    _rtb.AppendFormatLine("Attributes: 0x{0:X8} ({1})", _spell.Attributes, (SpellAtribute)_spell.Attributes);
                }
                if (_spell.AttributesEx != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx1: 0x{0:X8} ({1})", _spell.AttributesEx, (SpellAtributeEx)_spell.AttributesEx);
                }
                if (_spell.AttributesEx2 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx2: 0x{0:X8} ({1})", _spell.AttributesEx2, (SpellAtributeEx2)_spell.AttributesEx2);
                }
                if (_spell.AttributesEx3 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx3: 0x{0:X8} ({1})", _spell.AttributesEx3, (SpellAtributeEx3)_spell.AttributesEx3);
                }
                if (_spell.AttributesEx4 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx4: 0x{0:X8} ({1})", _spell.AttributesEx4, (SpellAtributeEx4)_spell.AttributesEx4);
                }
                if (_spell.AttributesEx5 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx5: 0x{0:X8} ({1})", _spell.AttributesEx5, (SpellAtributeEx5)_spell.AttributesEx5);
                }
                if (_spell.AttributesEx6 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx6: 0x{0:X8} ({1})", _spell.AttributesEx6, (SpellAtributeEx6)_spell.AttributesEx6);
                }
                if (_spell.AttributesEx7 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx7: 0x{0:X8} ({1})", _spell.AttributesEx7, (SpellAtributeEx7)_spell.AttributesEx7);
                }
                if (_spell.AttributesEx8 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx8: 0x{0:X8} ({1})", _spell.AttributesEx8, (SpellAtributeEx8)_spell.AttributesEx8);
                }
                if (_spell.AttributesEx9 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx9: 0x{0:X8} ({1})", _spell.AttributesEx9, (SpellAtributeEx9)_spell.AttributesEx9);
                }
                if (_spell.AttributesEx10 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx10: 0x{0:X8} ({1})", _spell.AttributesEx10, (SpellAtributeEx10)_spell.AttributesEx10);
                }
                if (_spell.AttributesEx11 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx11: 0x{0:X8} ({1})", _spell.AttributesEx11, (SpellAtributeEx11)_spell.AttributesEx11);
                }
                if (_spell.AttributesEx12 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx12: 0x{0:X8} ({1})", _spell.AttributesEx12, (SpellAtributeEx12)_spell.AttributesEx12);
                }
                if (_spell.AttributesEx13 != 0)
                {
                    _rtb.AppendFormatLine("AttributesEx13: 0x{0:X8} ({1})", _spell.AttributesEx13, (SpellAtributeEx13)_spell.AttributesEx13);
                }

                _rtb.AppendLine(_line);

                if (_spell.SpellTargetRestrictionsList != null)
                {
                    foreach (var TargetRestriction in _spell.SpellTargetRestrictionsList)
                    {
                        if (TargetRestriction.Targets != 0)
                        {
                            _rtb.AppendFormatLine("Targets Mask = 0x{0:X8} ({1})", TargetRestriction.Targets, (SpellCastTargetFlags)TargetRestriction.Targets);
                        }

                        if (TargetRestriction.TargetCreatureType != 0)
                        {
                            _rtb.AppendFormatLine("Creature Type Mask = 0x{0:X8} ({1})",
                                                  TargetRestriction.TargetCreatureType, (CreatureTypeMask)TargetRestriction.TargetCreatureType);
                        }

                        if (TargetRestriction.MaxAffectedTargets != 0)
                        {
                            _rtb.AppendFormatLine("MaxAffectedTargets: {0}", TargetRestriction.MaxAffectedTargets);
                        }
                    }
                }

                if (_spell.Stances != 0)
                {
                    _rtb.AppendFormatLine("Stances: {0}", (ShapeshiftFormMask)_spell.Stances);
                }

                if (_spell.StancesNot != 0)
                {
                    _rtb.AppendFormatLine("Stances Not: {0}", (ShapeshiftFormMask)_spell.StancesNot);
                }

                AppendSkillLine();

                // reagents
                {
                    var printedHeader = false;
                    for (var i = 0; i < _spell.Reagent.Length; ++i)
                    {
                        if (_spell.Reagent[i] == 0)
                        {
                            continue;
                        }

                        if (!printedHeader)
                        {
                            _rtb.AppendLine();
                            _rtb.Append("Reagents:");
                            printedHeader = true;
                        }

                        _rtb.AppendFormat("  {0} x{1}", _spell.Reagent[i], _spell.ReagentCount[i]);
                    }

                    if (printedHeader)
                    {
                        _rtb.AppendLine();
                    }
                }

                _rtb.AppendFormatLine("Spell Level = {0}, base {1}, max {2}",
                                      _spell.SpellLevel, _spell.BaseLevel, _spell.MaxLevel);

                if (_spell.EquippedItemClass != 0)
                {
                    _rtb.AppendFormatLine("EquippedItemClass = {0} ({1})", _spell.EquippedItemClass, (ItemClass)_spell.EquippedItemClass);

                    if (_spell.EquippedItemSubClassMask != 0)
                    {
                        switch ((ItemClass)_spell.EquippedItemClass)
                        {
                        case ItemClass.WEAPON:
                            _rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})",
                                                  _spell.EquippedItemSubClassMask, (ItemSubClassWeaponMask)_spell.EquippedItemSubClassMask);
                            break;

                        case ItemClass.ARMOR:
                            _rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})",
                                                  _spell.EquippedItemSubClassMask, (ItemSubClassArmorMask)_spell.EquippedItemSubClassMask);
                            break;

                        case ItemClass.MISC:
                            _rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})",
                                                  _spell.EquippedItemSubClassMask, (ItemSubClassMiscMask)_spell.EquippedItemSubClassMask);
                            break;
                        }
                    }

                    if (_spell.EquippedItemInventoryTypeMask != 0)
                    {
                        _rtb.AppendFormatLine("    InventoryType mask = 0x{0:X8} ({1})",
                                              _spell.EquippedItemInventoryTypeMask, (InventoryTypeMask)_spell.EquippedItemInventoryTypeMask);
                    }
                }

                _rtb.AppendLine();
                _rtb.AppendFormatLine("Category = {0}", _spell.Category);
                _rtb.AppendFormatLine("DispelType = {0} ({1})", _spell.Dispel, (DispelType)_spell.Dispel);
                _rtb.AppendFormatLine("Mechanic = {0} ({1})", _spell.Mechanic, (Mechanics)_spell.Mechanic);

                _rtb.AppendLine(_spell.Range);

                _rtb.AppendFormatLineIfNotNull("Speed {0:F}", _spell.Speed);
                _rtb.AppendFormatLineIfNotNull("Stackable up to {0}", _spell.StackAmount);

                _rtb.AppendLine(_spell.CastTime);

                if (_spell.RecoveryTime != 0 || _spell.CategoryRecoveryTime != 0 || _spell.StartRecoveryCategory != 0)
                {
                    _rtb.AppendFormatLine("RecoveryTime: {0} ms, CategoryRecoveryTime: {1} ms", _spell.RecoveryTime, _spell.CategoryRecoveryTime);
                    _rtb.AppendFormatLine("StartRecoveryCategory = {0}, StartRecoveryTime = {1:F} ms", _spell.StartRecoveryCategory, _spell.StartRecoveryTime);
                }

                _rtb.AppendLine(_spell.Duration);

                if (_spell.RuneCost != null)
                {
                    _rtb.AppendFormatLine("Rune Cost: {0}, {1}, {2}, {3}, Power Gain: {4}", _spell.RuneCost.RuneCost[0], _spell.RuneCost.RuneCost[1], _spell.RuneCost.RuneCost[2], _spell.RuneCost.UnkMop, _spell.RuneCost.RunicPowerGain);
                }

                if (_spell.SpellPowerList != null)
                {
                    foreach (var spellPower in _spell.SpellPowerList)
                    {
                        if (spellPower.ManaCost != 0 || spellPower.ManaCostPercentage != 0 || spellPower.PowerType != 0 ||
                            spellPower.ManaCostPerlevel != 0 || spellPower.ManaPerSecond != 0)
                        {
                            _rtb.AppendFormat("Power {0}, Cost {1}",
                                              (Powers)spellPower.PowerType, spellPower.ManaCost == 0 ? spellPower.ManaCostPercentage + " %" : spellPower.ManaCost.ToString());
                            _rtb.AppendFormatIfNotNull(" + lvl * {0}", spellPower.ManaCostPerlevel);
                            _rtb.AppendFormatIfNotNull(" + {0} Per Second", spellPower.ManaPerSecond);

                            if (spellPower.RequiredAura > 0)
                            {
                                _rtb.AppendFormat(" if aura {0}", spellPower.RequiredAura);
                                if (DBC.DBC.Spell.ContainsKey(spellPower.RequiredAura))
                                {
                                    _rtb.AppendFormat(" ({0})", DBC.DBC.Spell[spellPower.RequiredAura].SpellName);
                                }
                            }
                            if (spellPower.Difficulty > 0)
                            {
                                _rtb.AppendFormat(" if {0}", (Difficulty)spellPower.Difficulty);
                            }

                            _rtb.AppendLine();
                        }
                    }
                }

                _rtb.AppendFormatLine("Interrupt Flags: 0x{0:X8}, AuraIF 0x{1:X8}, ChannelIF 0x{2:X8}",
                                      _spell.InterruptFlags, _spell.AuraInterruptFlags, _spell.ChannelInterruptFlags);

                if (_spell.CasterAuraState != 0)
                {
                    _rtb.AppendFormatLine("CasterAuraState = {0} ({1})", _spell.CasterAuraState, (AuraState)_spell.CasterAuraState);
                }

                if (_spell.TargetAuraState != 0)
                {
                    _rtb.AppendFormatLine("TargetAuraState = {0} ({1})", _spell.TargetAuraState, (AuraState)_spell.TargetAuraState);
                }

                if (_spell.CasterAuraStateNot != 0)
                {
                    _rtb.AppendFormatLine("CasterAuraStateNot = {0} ({1})", _spell.CasterAuraStateNot, (AuraState)_spell.CasterAuraStateNot);
                }

                if (_spell.TargetAuraStateNot != 0)
                {
                    _rtb.AppendFormatLine("TargetAuraStateNot = {0} ({1})", _spell.TargetAuraStateNot, (AuraState)_spell.TargetAuraStateNot);
                }

                AppendSpellAura();

                AppendAreaInfo();

                _rtb.AppendFormatLineIfNotNull("Requires Spell Focus {0}", _spell.RequiresSpellFocus);

                if (_spell.ProcFlags != 0)
                {
                    _rtb.SetBold();
                    _rtb.AppendFormatLine("Proc flag 0x{0:X8}, chance = {1}, charges - {2}",
                                          _spell.ProcFlags, _spell.ProcChance, _spell.ProcCharges);
                    _rtb.SetDefaultStyle();
                    _rtb.AppendFormatLine(_line);
                    _rtb.AppendText(_spell.ProcInfo);
                }
                else
                {
                    _rtb.AppendFormatLine("Chance = {0}, charges - {1}", _spell.ProcChance, _spell.ProcCharges);
                }

                AppendSpellEffectInfo();
                AppendItemInfo();
                AppendDifficultyInfo();

                AppendSpellVisualInfo();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Esempio n. 7
0
        private void ViewSpellInfo()
        {
            rtb.Clear();
            rtb.SetBold();
            rtb.AppendFormatLine("ID - {0} {1}", spell.ID, spell.SpellNameRank);
            rtb.SetDefaultStyle();

            rtb.AppendFormatLine(_line);
            rtb.AppendFormatLineIfNotNull("Description: {0}", spell.Description);
            rtb.AppendFormatLineIfNotNull("ToolTip: {0}", spell.ToolTip);
            rtb.AppendFormatLineIfNotNull("Modal Next Spell: {0}", spell.ModalNextSpell);
            if (spell.Description != string.Empty && spell.ToolTip != string.Empty && spell.ModalNextSpell != 0)
            {
                rtb.AppendFormatLine(_line);
            }

            rtb.AppendFormatLine("Category = {0}, SpellIconID = {1}, activeIconID = {2}, SpellVisual = ({3},{4})",
                                 spell.Category, spell.SpellIconID, spell.ActiveIconID, spell.SpellVisual[0], spell.SpellVisual[1]);

            rtb.AppendFormatLine("Family {0}, flag 0x{1:X8} {2:X8} {3:X8}",
                                 (SpellFamilyNames)spell.SpellFamilyName, spell.SpellFamilyFlags[2], spell.SpellFamilyFlags[1], spell.SpellFamilyFlags[0]);

            rtb.AppendLine();

            rtb.AppendFormatLine("SpellSchoolMask = {0} ({1})", spell.SchoolMask, spell.School);
            rtb.AppendFormatLine("DamageClass = {0} ({1})", spell.DmgClass, (SpellDmgClass)spell.DmgClass);
            rtb.AppendFormatLine("PreventionType = {0} ({1})", spell.PreventionType, (SpellPreventionType)spell.PreventionType);

            if (spell.Attributes != 0 || spell.AttributesEx != 0 || spell.AttributesEx2 != 0 || spell.AttributesEx3 != 0 ||
                spell.AttributesEx4 != 0 || spell.AttributesEx5 != 0 || spell.AttributesEx6 != 0 || spell.AttributesEx7 != 0)
            {
                rtb.AppendLine(_line);
            }

            rtb.AppendFormatLineIfNotNull("Attributes   : 0x{0:X8} ({1})", spell.Attributes, (SpellAtribute)spell.Attributes);
            rtb.AppendFormatLineIfNotNull("AttributesEx1: 0x{0:X8} ({1})", spell.AttributesEx, (SpellAtributeEx)spell.AttributesEx);
            rtb.AppendFormatLineIfNotNull("AttributesEx2: 0x{0:X8} ({1})", spell.AttributesEx2, (SpellAtributeEx2)spell.AttributesEx2);
            rtb.AppendFormatLineIfNotNull("AttributesEx3: 0x{0:X8} ({1})", spell.AttributesEx3, (SpellAtributeEx3)spell.AttributesEx3);
            rtb.AppendFormatLineIfNotNull("AttributesEx4: 0x{0:X8} ({1})", spell.AttributesEx4, (SpellAtributeEx4)spell.AttributesEx4);
            rtb.AppendFormatLineIfNotNull("AttributesEx5: 0x{0:X8} ({1})", spell.AttributesEx5, (SpellAtributeEx5)spell.AttributesEx5);
            rtb.AppendFormatLineIfNotNull("AttributesEx6: 0x{0:X8} ({1})", spell.AttributesEx6, (SpellAtributeEx6)spell.AttributesEx6);
            rtb.AppendFormatLineIfNotNull("AttributesEx7: 0x{0:X8} ({1})", spell.AttributesEx7, (SpellAtributeEx7)spell.AttributesEx7);

            rtb.AppendLine(_line);


            rtb.AppendFormatLineIfNotNull("Targets Mask = 0x{0:X8} ({1})", spell.Targets, (SpellCastTargetFlags)spell.Targets);
            rtb.AppendFormatLineIfNotNull("Creature Type Mask = 0x{0:X8} ({1})", spell.TargetCreatureType, (CreatureTypeMask)spell.TargetCreatureType);

            if (spell.Stances != 0)
            {
                rtb.AppendFormatLine("Stances: {0}", (ShapeshiftFormMask)spell.Stances);
            }

            if (spell.StancesNot != 0)
            {
                rtb.AppendFormatLine("Stances Not: {0}", (ShapeshiftFormMask)spell.StancesNot);
            }

            AppendSkillLine();

            // reagents
            {
                bool printedHeader = false;
                for (int i = 0; i < spell.Reagent.Length; ++i)
                {
                    if (spell.Reagent[i] == 0)
                    {
                        continue;
                    }

                    if (!printedHeader)
                    {
                        rtb.AppendLine();
                        rtb.Append("Reagents:");
                        printedHeader = true;
                    }

                    rtb.AppendFormat("  {0}x{1}", spell.Reagent[i], spell.ReagentCount[i]);
                }

                if (printedHeader)
                {
                    rtb.AppendLine();
                }
            }

            rtb.AppendFormatLine("Spell Level = {0}, base {1}, max {2}, maxTarget {3}",
                                 spell.SpellLevel, spell.BaseLevel, spell.MaxLevel, spell.MaxTargetLevel);

            if (spell.EquippedItemClass != -1)
            {
                rtb.AppendFormatLine("EquippedItemClass = {0} ({1})", spell.EquippedItemClass, (ItemClass)spell.EquippedItemClass);

                if (spell.EquippedItemSubClassMask != 0)
                {
                    switch ((ItemClass)spell.EquippedItemClass)
                    {
                    case ItemClass.WEAPON:
                        rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})",
                                             spell.EquippedItemSubClassMask, (ItemSubClassWeaponMask)spell.EquippedItemSubClassMask);
                        break;

                    case ItemClass.ARMOR:
                        rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})",
                                             spell.EquippedItemSubClassMask, (ItemSubClassArmorMask)spell.EquippedItemSubClassMask);
                        break;

                    case ItemClass.MISC:
                        rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})",
                                             spell.EquippedItemSubClassMask, (ItemSubClassMiscMask)spell.EquippedItemSubClassMask);
                        break;
                    }
                }

                if (spell.EquippedItemInventoryTypeMask != 0)
                {
                    rtb.AppendFormatLine("    InventoryType mask = 0x{0:X8} ({1})",
                                         spell.EquippedItemInventoryTypeMask, (InventoryTypeMask)spell.EquippedItemInventoryTypeMask);
                }
            }

            rtb.AppendLine();
            rtb.AppendFormatLine("Category = {0}", spell.Category);
            rtb.AppendFormatLine("DispelType = {0} ({1})", spell.Dispel, (DispelType)spell.Dispel);
            rtb.AppendFormatLine("Mechanic = {0} ({1})", spell.Mechanic, (Mechanics)spell.Mechanic);

            rtb.AppendLine(spell.Range);

            rtb.AppendFormatLineIfNotNull("Speed {0:F}", spell.Speed);
            rtb.AppendFormatLineIfNotNull("Stackable up to {0}", spell.StackAmount);

            rtb.AppendLine(spell.CastTime);

            rtb.AppendLine(spell.SpellDifficulty);

            if (spell.RecoveryTime != 0 || spell.CategoryRecoveryTime != 0 || spell.StartRecoveryCategory != 0)
            {
                rtb.AppendFormatLine("RecoveryTime: {0} ms, CategoryRecoveryTime: {1} ms", spell.RecoveryTime, spell.CategoryRecoveryTime);
                rtb.AppendFormatLine("StartRecoveryCategory = {0}, StartRecoveryTime = {1:F} ms", spell.StartRecoveryCategory, spell.StartRecoveryTime);
            }

            rtb.AppendLine(spell.Duration);

            if (spell.ManaCost != 0 || spell.ManaCostPercentage != 0)
            {
                rtb.AppendFormat("Power {0}, Cost {1}",
                                 (Powers)spell.PowerType, spell.ManaCost == 0 ? spell.ManaCostPercentage.ToString() + " %" : spell.ManaCost.ToString());
                rtb.AppendFormatIfNotNull(" + lvl * {0}", spell.ManaCostPerlevel);
                rtb.AppendFormatIfNotNull(" + {0} Per Second", spell.ManaPerSecond);
                rtb.AppendFormatIfNotNull(" + lvl * {0}", spell.ManaPerSecondPerLevel);
                rtb.AppendLine();
            }


            if (spell.RuneCostID != 0 && DBC.SpellRuneCostTable.ContainsKey(spell.RuneCostID))
            {
                SpellRuneCostEntry R = DBC.SpellRuneCostTable[spell.RuneCostID];

                bool append = true;
                for (uint i = 0; i < R.RuneCost.Length; i++)
                {
                    if (R.RuneCost[i] != 0)
                    {
                        if (append)
                        {
                            rtb.AppendLine(_line);
                            rtb.Append("Rune cost: ");
                        }
                        rtb.AppendFormat("{0}x{1} ", (RuneType)i, R.RuneCost[i]);
                        append = false;
                    }
                }

                if (!append)
                {
                    rtb.AppendLine();
                }

                rtb.AppendFormatLineIfNotNull("Rune power gain ={0}", R.runePowerGain);
                if (!append)
                {
                    rtb.AppendLine(_line);
                }
            }

            rtb.AppendFormatLine("Interrupt Flags: 0x{0:X8}({1}), AuraIF 0x{2:X8}({3}), ChannelIF 0x{4:X8}({5})",
                                 spell.InterruptFlags, ((SpellInterruptFlags)spell.InterruptFlags).ToString().Replace("SPELL_INTERRUPT_FLAG_", ""),
                                 spell.AuraInterruptFlags, ((SpellChannelInterruptFlags)spell.AuraInterruptFlags).ToString().Replace("CHANNEL_FLAG_", ""),
                                 spell.ChannelInterruptFlags, ((SpellAuraInterruptFlags)spell.ChannelInterruptFlags).ToString().Replace("AURA_INTERRUPT_FLAG_", ""));

            if (spell.CasterAuraState != 0)
            {
                rtb.AppendFormatLine("CasterAuraState = {0} ({1})", spell.CasterAuraState, (AuraState)spell.CasterAuraState);
            }

            if (spell.TargetAuraState != 0)
            {
                rtb.AppendFormatLine("TargetAuraState = {0} ({1})", spell.TargetAuraState, (AuraState)spell.TargetAuraState);
            }

            if (spell.CasterAuraStateNot != 0)
            {
                rtb.AppendFormatLine("CasterAuraStateNot = {0} ({1})", spell.CasterAuraStateNot, (AuraState)spell.CasterAuraStateNot);
            }

            if (spell.TargetAuraStateNot != 0)
            {
                rtb.AppendFormatLine("TargetAuraStateNot = {0} ({1})", spell.TargetAuraStateNot, (AuraState)spell.TargetAuraStateNot);
            }

            AppendSpellAura();

            AppendAreaInfo();

            rtb.AppendFormatLineIfNotNull("Requires Spell Focus {0}", spell.RequiresSpellFocus);

            if (spell.ProcFlags != 0)
            {
                rtb.SetBold();
                rtb.AppendFormatLine("Proc flag 0x{0:X8}, chance = {1}, charges - {2}",
                                     spell.ProcFlags, spell.ProcChance, spell.ProcCharges);
                rtb.SetDefaultStyle();
                rtb.AppendFormatLine(_line);
                rtb.AppendText(spell.ProcInfo);
            }
            else
            {
                rtb.AppendFormatLine("Chance = {0}, charges - {1}", spell.ProcChance, spell.ProcCharges);
            }

            AppendSpellEffectInfo();
            AppendItemInfo();
        }
Esempio n. 8
0
        private static void AuraModTypeName(RichTextBox rtb, SpellEffectEntry effect)
        {
            var aura = (AuraType)effect.EffectAura;
            var misc = effect.EffectMiscValues[0];

            if (effect.EffectAura == 0)
            {
                rtb.AppendFormatLineIfNotNull("EffectMiscValueA = {0}", effect.EffectMiscValues[0]);
                rtb.AppendFormatLineIfNotNull("EffectMiscValueB = {0}", effect.EffectMiscValues[1]);
                rtb.AppendFormatLineIfNotNull("EffectAmplitude = {0}", effect.EffectAmplitude);

                return;
            }

            rtb.AppendFormat("Aura Id {0:D} ({0})", aura);
            rtb.AppendFormat(", value = {0}", effect.EffectBasePoints);
            rtb.AppendFormat(", misc = {0} (", misc);

            switch (aura)
            {
            case AuraType.SPELL_AURA_MOD_STAT:
                rtb.Append((UnitMods)misc);
                break;

            case AuraType.SPELL_AURA_MOD_RATING:
            case AuraType.SPELL_AURA_MOD_RATING_PCT:
                rtb.Append((CombatRating)misc);
                break;

            case AuraType.SPELL_AURA_ADD_FLAT_MODIFIER:
            case AuraType.SPELL_AURA_ADD_PCT_MODIFIER:
                rtb.Append((SpellModOp)misc);
                break;

            // TODO: more case
            default:
                rtb.Append(misc);
                break;
            }

            rtb.AppendFormat("), miscB = {0}", effect.EffectMiscValues[1]);
            rtb.AppendFormatLine(", amplitude = {0}, periodic = {1}", effect.EffectAmplitude, effect.EffectAuraPeriod);

            switch (aura)
            {
            case AuraType.SPELL_AURA_OVERRIDE_SPELLS:
                if (!DBC.DBC.OverrideSpellData.ContainsKey(misc))
                {
                    rtb.SetStyle(Color.Red, FontStyle.Bold);
                    rtb.AppendFormatLine("Cannot find key {0} in OverrideSpellData.dbc", (uint)misc);
                }
                else
                {
                    rtb.AppendLine();
                    rtb.SetStyle(Color.DarkRed, FontStyle.Bold);
                    var @override = DBC.DBC.OverrideSpellData[misc];
                    for (var i = 0; i < 10; ++i)
                    {
                        if (@override.Spells[i] == 0)
                        {
                            continue;
                        }

                        rtb.SetStyle(Color.DarkBlue, FontStyle.Regular);
                        rtb.AppendFormatLine("\t - #{0} ({1}) {2}", i + 1, @override.Spells[i],
                                             DBC.DBC.SpellInfoStore.ContainsKey((int)@override.Spells[i]) ? DBC.DBC.SpellInfoStore[(int)@override.Spells[i]].Name : "?????");
                    }
                    rtb.AppendLine();
                }
                break;

            case AuraType.SPELL_AURA_SCREEN_EFFECT:
                rtb.SetStyle(Color.DarkBlue, FontStyle.Bold);
                rtb.AppendFormatLine("ScreenEffect: {0}",
                                     DBC.DBC.ScreenEffect.ContainsKey(misc) ? DBC.DBC.ScreenEffect[misc].Name : "?????");
                break;
            }
        }
Esempio n. 9
0
        public void Write(RichTextBox rtb)
        {
            rtb.Clear();

            rtb.SetBold();
            rtb.AppendFormatLine("ID - {0} {1}{2}",
                                 ID, Name, Scaling != null ? $" (Level {DBC.DBC.SelectedLevel})" : string.Empty);
            rtb.SetDefaultStyle();

            rtb.AppendFormatLine(Separator);

            rtb.AppendLine(Description);
            rtb.AppendFormatLineIfNotNull("ToolTip: {0}", Tooltip);
            if (DescriptionVariables != null)
            {
                rtb.AppendLine("Description variables:");
                rtb.AppendLine(DescriptionVariables.Variables);
            }

            rtb.AppendFormatLineIfNotNull("Modal Next Spell: {0}", ModalNextSpell);
            if (!string.IsNullOrEmpty(Spell.Description) && !string.IsNullOrEmpty(Spell.AuraDescription) && ModalNextSpell != 0)
            {
                rtb.AppendFormatLine(Separator);
            }

            #region Triggered by ...
            var addline = false;
            if (DBC.DBC.SpellTriggerStore.ContainsKey(Spell.ID))
            {
                foreach (var procSpellId in DBC.DBC.SpellTriggerStore[Spell.ID])
                {
                    var procname = "Spell Not Found";
                    if (DBC.DBC.Spell.ContainsKey(procSpellId))
                    {
                        procname = DBC.DBC.Spell[procSpellId].Name;
                    }
                    rtb.SetStyle(Color.Blue, FontStyle.Bold);

                    rtb.AppendFormatLine("Triggered by spell: ({0}) {1}", procSpellId, procname);
                    rtb.SetDefaultStyle();
                    addline = true;
                }
            }
            if (addline)
            {
                rtb.AppendFormatLine(Separator);
            }
            #endregion

            rtb.AppendFormatLine($"Category = { Category }, IconFileDataID = { IconFileDataID }, ActiveIconFileDataID = { ActiveIconFileDataID }, SpellVisualID = { SpellVisualID }");

            rtb.AppendFormatLine("Family {0} ({1}), flag [0] 0x{2:X8} [1] 0x{3:X8} [2] 0x{4:X8} [3] 0x{5:X8}",
                                 (SpellFamilyNames)SpellFamilyName, SpellFamilyName,
                                 SpellFamilyFlags[0], SpellFamilyFlags[1], SpellFamilyFlags[2], SpellFamilyFlags[3]);

            #region Modified by ...
            foreach (var eff in
                     from s in DBC.DBC.SpellInfoStore.Values
                     where s.SpellFamilyName == SpellFamilyName
                     from eff in s.Effects
                     where eff != null && ((eff.EffectSpellClassMask[0] & SpellFamilyFlags[0]) != 0 ||
                                           (eff.EffectSpellClassMask[1] & SpellFamilyFlags[1]) != 0 ||
                                           (eff.EffectSpellClassMask[2] & SpellFamilyFlags[2]) != 0 ||
                                           (eff.EffectSpellClassMask[3] & SpellFamilyFlags[3]) != 0)
                     select eff)
            {
                rtb.SetStyle(Color.Blue, FontStyle.Bold);
                rtb.AppendFormatLine("Modified by {0} ({1})",
                                     DBC.DBC.SpellInfoStore[eff.SpellID].Spell.Name, eff.SpellID);
            }
            #endregion

            rtb.AppendLine();

            rtb.AppendFormatLine("SpellSchoolMask = {0} ({1})", (SpellSchoolMask)SchoolMask, SchoolMask);
            rtb.AppendFormatLine("DamageClass = {0} ({1})", DamageClass, (SpellDmgClass)DamageClass);
            rtb.AppendFormatLine("PreventionType = {0} ({1})", PreventionType, (SpellPreventionType)PreventionType);

            #region Attributes
            if (Misc != null && !Misc.Attributes.All(a => a == 0))
            {
                rtb.AppendLine(Separator);
            }

            if (Attributes != 0)
            {
                rtb.AppendFormatLine("Attributes: 0x{0:X8} ({1})", Attributes, (SpellAtribute)Attributes);
            }
            if (AttributesEx != 0)
            {
                rtb.AppendFormatLine("AttributesEx1: 0x{0:X8} ({1})", AttributesEx, (SpellAtributeEx)AttributesEx);
            }
            if (AttributesEx2 != 0)
            {
                rtb.AppendFormatLine("AttributesEx2: 0x{0:X8} ({1})", AttributesEx2, (SpellAtributeEx2)AttributesEx2);
            }
            if (AttributesEx3 != 0)
            {
                rtb.AppendFormatLine("AttributesEx3: 0x{0:X8} ({1})", AttributesEx3, (SpellAtributeEx3)AttributesEx3);
            }
            if (AttributesEx4 != 0)
            {
                rtb.AppendFormatLine("AttributesEx4: 0x{0:X8} ({1})", AttributesEx4, (SpellAtributeEx4)AttributesEx4);
            }
            if (AttributesEx5 != 0)
            {
                rtb.AppendFormatLine("AttributesEx5: 0x{0:X8} ({1})", AttributesEx5, (SpellAtributeEx5)AttributesEx5);
            }
            if (AttributesEx6 != 0)
            {
                rtb.AppendFormatLine("AttributesEx6: 0x{0:X8} ({1})", AttributesEx6, (SpellAtributeEx6)AttributesEx6);
            }
            if (AttributesEx7 != 0)
            {
                rtb.AppendFormatLine("AttributesEx7: 0x{0:X8} ({1})", AttributesEx7, (SpellAtributeEx7)AttributesEx7);
            }
            if (AttributesEx8 != 0)
            {
                rtb.AppendFormatLine("AttributesEx8: 0x{0:X8} ({1})", AttributesEx8, (SpellAtributeEx8)AttributesEx8);
            }
            if (AttributesEx9 != 0)
            {
                rtb.AppendFormatLine("AttributesEx9: 0x{0:X8} ({1})", AttributesEx9, (SpellAtributeEx9)AttributesEx9);
            }
            if (AttributesEx10 != 0)
            {
                rtb.AppendFormatLine("AttributesEx10: 0x{0:X8} ({1})", AttributesEx10, (SpellAtributeEx10)AttributesEx10);
            }
            if (AttributesEx11 != 0)
            {
                rtb.AppendFormatLine("AttributesEx11: 0x{0:X8} ({1})", AttributesEx11, (SpellAtributeEx11)AttributesEx11);
            }
            if (AttributesEx12 != 0)
            {
                rtb.AppendFormatLine("AttributesEx12: 0x{0:X8} ({1})", AttributesEx12, (SpellAtributeEx12)AttributesEx12);
            }
            if (AttributesEx13 != 0)
            {
                rtb.AppendFormatLine("AttributesEx13: 0x{0:X8} ({1})", AttributesEx13, (SpellAtributeEx13)AttributesEx13);
            }

            rtb.AppendLine(Separator);
            #endregion

            if (TargetRestrictions != null)
            {
                foreach (var targetRestriction in TargetRestrictions)
                {
                    if (targetRestriction.Targets != 0)
                    {
                        rtb.AppendFormatLine("Targets Mask = 0x{0:X8} ({1})", targetRestriction.Targets, (SpellCastTargetFlags)targetRestriction.Targets);
                    }

                    if (targetRestriction.TargetCreatureType != 0)
                    {
                        rtb.AppendFormatLine("Creature Type Mask = 0x{0:X8} ({1})",
                                             targetRestriction.TargetCreatureType, (CreatureTypeMask)targetRestriction.TargetCreatureType);
                    }

                    if (targetRestriction.MaxAffectedTargets != 0)
                    {
                        rtb.AppendFormatLine("MaxAffectedTargets: {0}", targetRestriction.MaxAffectedTargets);
                    }
                }
            }

            if (Stances != 0)
            {
                rtb.AppendFormatLine("Stances: {0}", (ShapeshiftFormMask)Stances);
            }

            if (StancesNot != 0)
            {
                rtb.AppendFormatLine("Stances Not: {0}", (ShapeshiftFormMask)StancesNot);
            }

            // Skills
            {
                var query = DBC.DBC.SkillLineAbility.Where(skl => skl.Value.SpellID == Spell.ID).ToArray();
                if (query.Length != 0)
                {
                    var skill = query.First().Value;
                    var line  = DBC.DBC.SkillLine[skill.SkillLine];

                    rtb.AppendFormatLine(@"Skill (Id {0}) ""{1}""", skill.SkillLine, line.DisplayName);
                    rtb.AppendFormat("    MinSkillLineRank {0}", skill.MinSkillLineRank);

                    rtb.AppendFormat(", SupercedesSpell = {0}, MinMaxValue ({1}, {2})", skill.SupercedesSpell,
                                     skill.TrivialSkillLineRankLow, skill.TrivialSkillLineRankHigh);
                    rtb.AppendFormat(", NumSkillups ({0})", skill.NumSkillUps);
                }
            }

            // SpellReagents
            {
                var printedHeader = false;
                for (var i = 0; Reagents != null && i < Reagents.ReagentCount.Length; ++i)
                {
                    if (Reagents.ReagentCount[i] == 0 || Reagents.Reagent[i] == 0)
                    {
                        continue;
                    }

                    if (!printedHeader)
                    {
                        rtb.AppendLine();
                        rtb.Append("Reagents:");
                        printedHeader = true;
                    }

                    rtb.AppendFormat("  {0} x{1}", Reagents.Reagent[i], Reagents.ReagentCount[i]);
                }

                if (printedHeader)
                {
                    rtb.AppendLine();
                }
            }

            // SpellReagentsCurrency
            {
                var printedHeader = false;
                foreach (var reagentsCurrency in ReagentsCurrency)
                {
                    if (!printedHeader)
                    {
                        rtb.AppendLine();
                        rtb.Append("ReagentsCurrency:");
                        printedHeader = true;
                    }

                    rtb.AppendFormat("  {0} x{1}", reagentsCurrency.CurrencyTypeID, reagentsCurrency.CurrencyCount);
                }

                if (printedHeader)
                {
                    rtb.AppendLine();
                }
            }

            rtb.AppendFormatLine("Spell Level = {0}, base {1}, max {2}, max usable {3}",
                                 SpellLevel, BaseLevel, MaxLevel, MaxUsableLevel);

            if (EquippedItemClass != 0)
            {
                rtb.AppendFormatLine("EquippedItemClass = {0} ({1})", EquippedItemClass, (ItemClass)EquippedItemClass);

                if (EquippedItemSubClassMask != 0)
                {
                    switch ((ItemClass)EquippedItemClass)
                    {
                    case ItemClass.WEAPON:
                        rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})", EquippedItemSubClassMask, (ItemSubClassWeaponMask)EquippedItemSubClassMask);
                        break;

                    case ItemClass.ARMOR:
                        rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})", EquippedItemSubClassMask, (ItemSubClassArmorMask)EquippedItemSubClassMask);
                        break;

                    case ItemClass.MISC:
                        rtb.AppendFormatLine("    SubClass mask 0x{0:X8} ({1})", EquippedItemSubClassMask, (ItemSubClassMiscMask)EquippedItemSubClassMask);
                        break;
                    }
                }

                if (EquippedItemInventoryTypeMask != 0)
                {
                    rtb.AppendFormatLine("    InventoryType mask = 0x{0:X8} ({1})", EquippedItemInventoryTypeMask, (InventoryTypeMask)EquippedItemInventoryTypeMask);
                }
            }

            rtb.AppendLine();
            rtb.AppendFormatLine("Category = {0}", Category);
            rtb.AppendFormatLine("DispelType = {0} ({1})", Dispel, (DispelType)Dispel);
            rtb.AppendFormatLine("Mechanic = {0} ({1})", Mechanic, (Mechanics)Mechanic);

            if (Range != null)
            {
                rtb.AppendFormatLine("SpellRange: (Id {0}) \"{1}\":", RangeIndex, Range.DisplayName);
                rtb.AppendFormatLine("    MinRangeNegative = {0}, MinRangePositive = {1}", Range.MinRange[0], Range.MinRange[1]);
                rtb.AppendFormatLine("    MaxRangeNegative = {0}, MaxRangePositive = {1}", Range.MaxRange[0], Range.MaxRange[1]);
            }

            if (Misc != null)
            {
                rtb.AppendFormatLineIfNotNull("Speed {0:F}", Speed);
            }

            rtb.AppendFormatLineIfNotNull("Stackable up to {0}", CumulativeAura);

            if (CastingTimeIndex != 0)
            {
                var castTimeEntry = DBC.DBC.SpellCastTimes[CastingTimeIndex];

                var level = DBC.DBC.SelectedLevel;
                if (Scaling != null && level > Scaling.MaxScalingLevel)
                {
                    level = Scaling.MaxScalingLevel;
                }

                if (((SpellAtributeEx13)AttributesEx13).HasFlag(SpellAtributeEx13.SPELL_ATTR13_UNK17))
                {
                    level *= 5;
                }

                if (Scaling != null && level > Scaling.MaxScalingLevel)
                {
                    level = Scaling.MaxScalingLevel;
                }

                if (Levels != null && Levels.BaseLevel != 0)
                {
                    level -= Levels.BaseLevel;
                }

                if (Scaling != null && level < Scaling.MinScalingLevel)
                {
                    level = Scaling.MinScalingLevel;
                }

                var castTime = castTimeEntry.CastTime + castTimeEntry.CastTimePerLevel * level;
                if (castTime < castTimeEntry.MinCastTime)
                {
                    castTime = castTimeEntry.MinCastTime;
                }

                rtb.AppendFormatLine("Cast Time: (ID {0}): {1}", CastingTimeIndex, castTime);
            }

            if (RecoveryTime != 0 || CategoryRecoveryTime != 0 || StartRecoveryCategory != 0)
            {
                rtb.AppendFormatLine("RecoveryTime: {0} ms, CategoryRecoveryTime: {1} ms", RecoveryTime, CategoryRecoveryTime);
                rtb.AppendFormatLine("StartRecoveryCategory = {0}, StartRecoveryTime = {1:F} ms", StartRecoveryCategory, StartRecoveryTime);
            }

            if (DurationEntry != null)
            {
                rtb.AppendFormatLine("Duration {0}, {1}, {2}", Duration, DurationPerLevel, MaxDuration);
            }

            if (Interrupts != null)
            {
                rtb.AppendFormatLine("Interrupt Flags: 0x{0:X8} ({1})", Interrupts.InterruptFlags, (SpellInterruptFlags)Interrupts.InterruptFlags);
                rtb.AppendFormatLine("AuraInterrupt Flags: 0x{0:X8} ({1}), 0x{2:X8} ({3})", Interrupts.AuraInterruptFlags[0], (SpellAuraInterruptFlags)Interrupts.AuraInterruptFlags[0], Interrupts.AuraInterruptFlags[1], (SpellAuraInterruptFlags)Interrupts.AuraInterruptFlags[1]);
                rtb.AppendFormatLine("ChannelInterrupt Flags: 0x{0:X8} ({1}), 0x{2:X8} ({3})", Interrupts.ChannelInterruptFlags[0], (SpellChannelInterruptFlags)Interrupts.ChannelInterruptFlags[0], Interrupts.ChannelInterruptFlags[1], (SpellChannelInterruptFlags)Interrupts.ChannelInterruptFlags[1]);
            }

            if (CasterAuraState != 0)
            {
                rtb.AppendFormatLine("CasterAuraState = {0} ({1})", CasterAuraState, (AuraState)CasterAuraState);
            }

            if (TargetAuraState != 0)
            {
                rtb.AppendFormatLine("TargetAuraState = {0} ({1})", TargetAuraState, (AuraState)TargetAuraState);
            }

            if (CasterAuraStateNot != 0)
            {
                rtb.AppendFormatLine("CasterAuraStateNot = {0} ({1})", CasterAuraStateNot, (AuraState)CasterAuraStateNot);
            }

            if (TargetAuraStateNot != 0)
            {
                rtb.AppendFormatLine("TargetAuraStateNot = {0} ({1})", TargetAuraStateNot, (AuraState)TargetAuraStateNot);
            }

            if (CasterAuraSpell != 0)
            {
                if (DBC.DBC.SpellInfoStore.ContainsKey(CasterAuraSpell))
                {
                    rtb.AppendFormatLine("  Caster Aura Spell ({0}) {1}", CasterAuraSpell, DBC.DBC.SpellInfoStore[CasterAuraSpell].Spell.Name);
                }
                else
                {
                    rtb.AppendFormatLine("  Caster Aura Spell ({0}) ?????", CasterAuraSpell);
                }
            }

            if (TargetAuraSpell != 0)
            {
                if (DBC.DBC.SpellInfoStore.ContainsKey(TargetAuraSpell))
                {
                    rtb.AppendFormatLine("  Target Aura Spell ({0}) {1}", TargetAuraSpell, DBC.DBC.SpellInfoStore[TargetAuraSpell].Spell.Name);
                }
                else
                {
                    rtb.AppendFormatLine("  Target Aura Spell ({0}) ?????", TargetAuraSpell);
                }
            }

            if (ExcludeCasterAuraSpell != 0)
            {
                if (DBC.DBC.SpellInfoStore.ContainsKey(ExcludeCasterAuraSpell))
                {
                    rtb.AppendFormatLine("  Ex Caster Aura Spell ({0}) {1}", ExcludeCasterAuraSpell, DBC.DBC.SpellInfoStore[ExcludeCasterAuraSpell].Spell.Name);
                }
                else
                {
                    rtb.AppendFormatLine("  Ex Caster Aura Spell ({0}) ?????", ExcludeCasterAuraSpell);
                }
            }

            if (ExcludeTargetAuraSpell != 0)
            {
                if (DBC.DBC.SpellInfoStore.ContainsKey(ExcludeTargetAuraSpell))
                {
                    rtb.AppendFormatLine("  Ex Target Aura Spell ({0}) {1}", ExcludeTargetAuraSpell, DBC.DBC.SpellInfoStore[ExcludeTargetAuraSpell].Spell.Name);
                }
                else
                {
                    rtb.AppendFormatLine("  Ex Target Aura Spell ({0}) ?????", ExcludeTargetAuraSpell);
                }
            }

            if (RequiredAreasId > 0)
            {
                var areas = DBC.DBC.AreaGroupMember.Values.Where(ag => ag.AreaGroupId == RequiredAreasId).ToList();
                if (areas.Count == 0)
                {
                    rtb.AppendFormatLine("Cannot find area group id {0} in AreaGroupMember.db2!", RequiredAreasId);
                }
                else
                {
                    rtb.AppendLine();
                    rtb.SetBold();
                    rtb.AppendLine("Allowed areas:");
                    foreach (var areaGroupMember in areas)
                    {
                        var areaId = areaGroupMember.AreaId;
                        if (!DBC.DBC.AreaTable.ContainsKey(areaId))
                        {
                            continue;
                        }

                        var areaEntry = DBC.DBC.AreaTable[areaId];
                        rtb.AppendFormatLine("{0} - {1} (Map: {2})", areaId, areaEntry.AreaName, areaEntry.MapID);
                    }

                    rtb.AppendLine();
                }
            }

            rtb.AppendFormatLineIfNotNull("Requires Spell Focus {0}", RequiresSpellFocus);

            if (Math.Abs(BaseProcRate) > 1.0E-5f)
            {
                rtb.SetBold();
                rtb.AppendFormatLine("PPM flag 0x{0:X2} BaseRate {1}", ProcsPerMinuteFlags, BaseProcRate);
                rtb.SetDefaultStyle();
            }

            if (ProcFlags != 0)
            {
                rtb.SetBold();
                rtb.AppendFormatLine("Proc flag 0x{0:X8}, chance: {1}%, charges: {2}, cooldown: {3}",
                                     ProcFlags, ProcChance, ProcCharges, ProcCooldown);
                rtb.SetDefaultStyle();
                rtb.AppendFormatLine(Separator);
                rtb.AppendText(ProcInfo);
            }
            else
            {
                rtb.AppendFormatLine("Chance = {0}, charges - {1}", ProcChance, ProcCharges);
            }

            rtb.AppendLine(Separator);
            foreach (var effect in Effects)
            {
                AppendEffectInfo(rtb, effect);
            }

            AppendItemInfo(rtb);

            AppendSpellVisualInfo();
        }
Esempio n. 10
0
 public static void WriteBlankLine(this RichTextBox rtb, int lineCount = 1)
 => rtb.Append(Colors.Transparent, L.f.Repeat(lineCount));
Esempio n. 11
0
 public static void WriteCol1of2(this RichTextBox rtb, Color color, string text, int colWidth = MAX_COL1_of2)
 => rtb.Append(color, text.AlignLeft(colWidth, COL_SEPARATOR));
Esempio n. 12
0
 public static void WriteLine(this RichTextBox rtb, Color color, string text)
 => rtb.Append(color, text + L.f);
Esempio n. 13
0
 public static void AppendLine(this RichTextBox box, string text, Color color)
 {
     box.Append(text + Environment.NewLine, color);
 }