示例#1
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();
        }
示例#2
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}", classOptions.ModalNextSpell);
            if (spell.Description != string.Empty && spell.ToolTip != string.Empty && classOptions.ModalNextSpell != 0)
            {
                rtb.AppendFormatLine(_line);
            }

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

            if (classOptions.SpellFamilyFlags != null)
            {
                rtb.AppendFormatLine("Family {0}, flag 0x{1:X8} {2:X8} {3:X8}",
                                     (SpellFamilyNames)classOptions.SpellFamilyName, classOptions.SpellFamilyFlags[2], classOptions.SpellFamilyFlags[1], classOptions.SpellFamilyFlags[0]);
            }
            else
            {
                rtb.AppendFormatLine("Family {0}, flag 0x{1:X8} {2:X8} {3:X8}",
                                     (SpellFamilyNames)classOptions.SpellFamilyName, 0, 0, 0);
            }

            rtb.AppendLine();

            rtb.AppendFormatLine("SpellSchoolMask = {0} ({1})", spell.SchoolMask, spell.School);
            rtb.AppendFormatLine("DamageClass = {0} ({1})", spellCategories.DmgClass, (SpellDmgClass)spellCategories.DmgClass);
            rtb.AppendFormatLine("PreventionType = {0} ({1})", spellCategories.PreventionType, (SpellPreventionType)spellCategories.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);
            }

            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);
            }

            rtb.AppendLine(_line);

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

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

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

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

            AppendSkillLine();

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

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

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

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

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

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

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

            rtb.AppendLine(spell.Range);

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

            rtb.AppendLine(spell.CastTime);

            rtb.AppendLine(spell.SpellDifficulty);

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

            rtb.AppendLine(spell.Duration);

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

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

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

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

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

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

            AppendSpellAura();

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

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

            AppendSpellEffectInfo();
            AppendItemInfo();
        }
示例#3
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);
            }
        }
示例#4
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();
        }
示例#5
0
        private void AppendSpellEffectInfo(RichTextBox sb, SpellEntry spell)
        {
            sb.AppendLine("=================================================");

            for (int i = 0; i < 3; i++)
            {
                sb.SetBold();
                if ((SpellEffects)spell.Effect[i] == SpellEffects.NO_SPELL_EFFECT)
                {
                    sb.AppendFormatLine("Effect {0}:  NO EFFECT", i);
                    return;
                }

                sb.AppendFormatLine("Effect {0}: Id {1} ({2})", i, spell.Effect[i], (SpellEffects)spell.Effect[i]);
                sb.SetDefaultStyle();
                sb.AppendFormat("BasePoints = {0}", spell.EffectBasePoints[i] + 1);
                if (spell.EffectRealPointsPerLevel[i] != 0)
                {
                    sb.AppendFormat(" + Level * {0:F}", spell.EffectRealPointsPerLevel[i]);
                }

                // WTF ? 1 = spell.EffectBaseDice[i]
                if (1 < spell.EffectDieSides[i])
                {
                    if (spell.EffectRealPointsPerLevel[i] != 0)
                    {
                        sb.AppendFormat(" to {0} + lvl * {1:F}",
                                        spell.EffectBasePoints[i] + 1 + spell.EffectDieSides[i], spell.EffectRealPointsPerLevel[i]);
                    }
                    else
                    {
                        sb.AppendFormat(" to {0}", spell.EffectBasePoints[i] + 1 + spell.EffectDieSides[i]);
                    }
                }

                sb.AppendFormatIfNotNull(" + combo * {0:F}", spell.EffectPointsPerComboPoint[i]);

                if (spell.DmgMultiplier[i] != 1.0f)
                {
                    sb.AppendFormat(" x {0:F}", spell.DmgMultiplier[i]);
                }

                sb.AppendFormatIfNotNull("  Multiple = {0:F}", spell.EffectMultipleValue[i]);
                sb.AppendLine();

                sb.AppendFormatLine("Targets ({0}, {1}) ({2}, {3})",
                                    spell.EffectImplicitTargetA[i], spell.EffectImplicitTargetB[i],
                                    (Targets)spell.EffectImplicitTargetA[i], (Targets)spell.EffectImplicitTargetB[i]);

                sb.AppendText(AuraModTypeName(spell, i));

                uint[] ClassMask = new uint[3];

                switch (i)
                {
                case 0: ClassMask[0] = spell.EffectSpellClassMaskA[i]; break;

                case 1: ClassMask[1] = spell.EffectSpellClassMaskB[i]; break;

                case 2: ClassMask[2] = spell.EffectSpellClassMaskC[i]; break;
                }

                if (ClassMask[0] != 0 || ClassMask[1] != 0 || ClassMask[2] != 0)
                {
                    sb.AppendFormatLine("SpellClassMask = {0:X8} {1:X8} {2:X8}", ClassMask[2], ClassMask[1], ClassMask[0]);

                    var query = from Spell in DBC.Spell.Values
                                where Spell.SpellFamilyName == spell.SpellFamilyName &&
                                ((Spell.SpellFamilyFlags1 & ClassMask[0]) != 0 ||
                                 (Spell.SpellFamilyFlags2 & ClassMask[1]) != 0 ||
                                 (Spell.SpellFamilyFlags3 & ClassMask[2]) != 0)
                                join sk in DBC.SkillLineAbility on Spell.ID equals sk.Value.SpellId into temp
                                from Skill in temp.DefaultIfEmpty()
                                select new
                    {
                        SpellID   = Spell.ID,
                        SpellName = Spell.SpellNameRank,
                        SkillId   = Skill.Value.SkillId
                    };

                    foreach (var row in query)
                    {
                        if (row.SkillId > 0)
                        {
                            sb.SelectionColor = Color.Blue;
                            sb.AppendFormatLine("\t+ {0} - {1}", row.SpellID, row.SpellName);
                        }
                        else
                        {
                            sb.SelectionColor = Color.Red;
                            sb.AppendFormatLine("\t- {0} - {1}", row.SpellID, row.SpellName);
                        }
                        sb.SelectionColor = Color.Black;
                    }
                }

                sb.AppendFormatLineIfNotNull("{0}", spell.GetRadius(i));

                // append trigger spell
                var tsId = spell.EffectTriggerSpell[i];
                if (tsId != 0)
                {
                    if (DBC.Spell.ContainsKey(tsId))
                    {
                        SpellEntry trigger = DBC.Spell[tsId];
                        sb.SetStyle(Color.Blue, FontStyle.Bold);
                        sb.AppendFormatLine("   Trigger spell ({0}) {1}. Chance = {2}", tsId, trigger.SpellNameRank, spell.ProcChance);
                        sb.SetStyle(FontStyle.Italic);
                        sb.AppendFormatLineIfNotNull("   Description: {0}", trigger.Description);
                        sb.SetStyle(FontStyle.Italic);
                        sb.AppendFormatLineIfNotNull("   ToolTip: {0}", trigger.ToolTip);
                        sb.SetDefaultStyle();
                        if (trigger.ProcFlags != 0)
                        {
                            sb.AppendFormatLine("Charges - {0}", trigger.ProcCharges);
                            sb.AppendLine("=================================================");
                            sb.AppendLine(trigger.ProcInfo);
                            sb.AppendLine("=================================================");
                        }
                    }
                    else
                    {
                        sb.AppendFormatLine("Trigger spell ({0}) Not found, Chance = {1}", tsId, spell.ProcChance);
                    }
                }

                sb.AppendFormatLineIfNotNull("EffectChainTarget = {0}", spell.EffectChainTarget[i]);
                sb.AppendFormatLineIfNotNull("EffectItemType = {0}", spell.EffectItemType[i]);

                if ((Mechanics)spell.EffectMechanic[i] != Mechanics.MECHANIC_NONE)
                {
                    sb.AppendFormatLine("Effect Mechanic = {0} ({1})", spell.EffectMechanic[i], (Mechanics)spell.EffectMechanic[i]);
                }

                sb.AppendLine();
            }
        }
示例#6
0
        private void AppendEffectInfo(RichTextBox rtb, SpellEffectEntry effect)
        {
            rtb.SetBold();
            rtb.AppendFormatLine($"Effect { effect.EffectIndex }: Id { effect.Effect } ({ (SpellEffects)effect.Effect })");
            rtb.SetBold();
            rtb.AppendFormatLine($"Difficulty: Id { effect.DifficultyID } ({ (Difficulty)effect.DifficultyID })");
            rtb.SetDefaultStyle();

            var value = 0.0f;

            if (effect.SpellEffectScalingEntry != null &&
                Math.Abs(effect.SpellEffectScalingEntry.Coefficient) > 1.0E-5f &&
                Scaling != null &&
                Scaling.ScalingClass != 0)
            {
                var level = (int)(DBC.DBC.SelectedLevel - 1);
                if ((AttributesEx11 & (uint)SpellAtributeEx11.SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL) == 0)
                {
                    if ((AttributesEx10 & (uint)SpellAtributeEx10.SPELL_ATTR10_USE_SPELL_BASE_LEVEL_FOR_SCALING) != 0)
                    {
                        level = BaseLevel;
                    }
                }
                else
                {
                    level = (int)DBC.DBC.SelectedItemLevel;
                }

                if (Scaling.MaxScalingLevel != 0 && Scaling.MaxScalingLevel < level)
                {
                    level = (int)Scaling.MaxScalingLevel;
                }

                if (level < 1)
                {
                    level = 1;
                }

                if (Scaling.ScalingClass != 0)
                {
                    if (Scaling.ScalesFromItemLevel == 0)
                    {
                        if ((AttributesEx11 & (uint)SpellAtributeEx11.SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL) == 0)
                        {
                            var gtScaling = GameTable <GtSpellScalingEntry> .GetRecord(level);

                            Debug.Assert(gtScaling != null);
                            value = gtScaling.GetColumnForClass(Scaling.ScalingClass);
                        }
                        else if (DBC.DBC.RandPropPoints.ContainsKey(level))
                        {
                            var randPropPoints = DBC.DBC.RandPropPoints[level];
                            value = randPropPoints.Superior[0];
                        }
                    }
                    else
                    {
                        if (DBC.DBC.RandPropPoints.ContainsKey(Scaling.ScalesFromItemLevel))
                        {
                            var randPropPoints = DBC.DBC.RandPropPoints[Scaling.ScalesFromItemLevel];
                            value = randPropPoints.Superior[0];
                        }
                    }

                    // if (level < Scaling.CastTimeMaxLevel && Scaling.CastTimeMax != 0)
                    //     value *= (float)(Scaling.CastTimeMin + (level - 1) * (Scaling.CastTimeMax - Scaling.CastTimeMin) / (Scaling.CastTimeMaxLevel - 1)) / (Scaling.CastTimeMax);

                    // if (level < Scaling.NerfMaxLevel)
                    //     value *= ((((1.0f - Scaling.NerfFactor) * (level - 1)) / (Scaling.NerfMaxLevel - 1)) + Scaling.NerfFactor);
                }

                value *= effect.SpellEffectScalingEntry.Coefficient;
                if (Math.Abs(value) > 1.0E-5f && value < 1.0f)
                {
                    value = 1.0f;
                }

                if (Math.Abs(effect.SpellEffectScalingEntry.Variance) > 1.0E-5f)
                {
                    var delta = Math.Abs(value * effect.SpellEffectScalingEntry.Variance * 0.5f);
                    rtb.AppendFormat("BasePoints = {0:F} to {1:F}", value - delta, value + delta);
                }
                else
                {
                    rtb.AppendFormat("BasePoints = {0:F}", value);
                }

                if (Math.Abs(effect.SpellEffectScalingEntry.ResourceCoefficient) > 1.0E-5f)
                {
                    rtb.AppendFormatIfNotNull(" + combo * {0:F}", effect.SpellEffectScalingEntry.ResourceCoefficient * value);
                }
            }
            else
            {
                rtb.AppendFormat("BasePoints = {0}", effect.EffectBasePoints + (effect.EffectDieSides == 0 ? 0 : 1));

                if (Math.Abs(effect.EffectRealPointsPerLevel) > 1.0E-5f)
                {
                    rtb.AppendFormat(" + Level * {0:F}", effect.EffectRealPointsPerLevel);
                }

                if (effect.EffectDieSides > 1)
                {
                    if (Math.Abs(effect.EffectRealPointsPerLevel) > 1.0E-5f)
                    {
                        rtb.AppendFormat(" to {0} + lvl * {1:F}",
                                         effect.EffectBasePoints + effect.EffectDieSides, effect.EffectRealPointsPerLevel);
                    }
                    else
                    {
                        rtb.AppendFormat(" to {0}", effect.EffectBasePoints + effect.EffectDieSides);
                    }
                }

                rtb.AppendFormatIfNotNull(" + resource * {0:F}", effect.EffectPointsPerResource);
            }

            if (effect.EffectBonusCoefficient > 1.0E-5f)
            {
                rtb.AppendFormat(" + spellPower * {0}", effect.EffectBonusCoefficient);
            }

            if (effect.BonusCoefficientFromAP > 1.0E-5)
            {
                rtb.AppendFormat(" + AP * {0}", effect.BonusCoefficientFromAP);
            }

            // if (Math.Abs(effect.DamageMultiplier - 1.0f) > 1.0E-5f)
            //     rtb.AppendFormat(" x {0:F}", effect.DamageMultiplier);

            // rtb.AppendFormatIfNotNull("  Multiple = {0:F}", effect.ValueMultiplier);
            rtb.AppendLine();

            rtb.AppendFormatLine("Targets ({0}, {1}) ({2}, {3})",
                                 effect.ImplicitTarget[0], effect.ImplicitTarget[1],
                                 (Targets)effect.ImplicitTarget[0], (Targets)effect.ImplicitTarget[1]);

            AuraModTypeName(rtb, effect);

            var classMask = effect.EffectSpellClassMask;

            if (classMask[0] != 0 || classMask[1] != 0 || classMask[2] != 0 || classMask[3] != 0)
            {
                rtb.AppendFormatLine("SpellClassMask = {0:X8} {1:X8} {2:X8} {3:X8}", classMask[0], classMask[1], classMask[2], classMask[3]);

                var query = from spell in DBC.DBC.SpellInfoStore.Values
                            where spell.SpellFamilyName == SpellFamilyName && spell.SpellFamilyFlags.ContainsElement(classMask)
                            join sk in DBC.DBC.SkillLineAbility.Values on spell.ID equals sk.SpellID into temp
                            from skill in temp.DefaultIfEmpty(new SkillLineAbilityEntry())
                            select new
                {
                    SpellID   = spell.Spell.ID,
                    SpellName = spell.Spell.Name,
                    SkillId   = skill.SkillLine
                };

                foreach (var row in query)
                {
                    if (row.SkillId > 0)
                    {
                        rtb.SelectionColor = Color.Blue;
                        rtb.AppendFormatLine("\t+ {0} - {1}", row.SpellID, row.SpellName);
                    }
                    else
                    {
                        rtb.SelectionColor = Color.Red;
                        rtb.AppendFormatLine("\t- {0} - {1}", row.SpellID, row.SpellName);
                    }
                    rtb.SelectionColor = Color.Black;
                }
            }

            rtb.AppendFormatLineIfNotNull("{0}", effect.Radius);
            rtb.AppendFormatLineIfNotNull("{0}", effect.MaxRadius);

            // append trigger spell
            var trigger = effect.EffectTriggerSpell;

            if (trigger != 0)
            {
                if (DBC.DBC.SpellInfoStore.ContainsKey((int)trigger))
                {
                    var triggerSpell = DBC.DBC.SpellInfoStore[(int)trigger];
                    rtb.SetStyle(Color.Blue, FontStyle.Bold);
                    rtb.AppendFormatLine("   Trigger spell ({0}) {1}. Chance = {2}", trigger, triggerSpell.Spell.Name, ProcChance);
                    rtb.AppendFormatLineIfNotNull("   Description: {0}", triggerSpell.Spell.Description);
                    rtb.AppendFormatLineIfNotNull("   ToolTip: {0}", triggerSpell.Spell.AuraDescription);
                    rtb.SetDefaultStyle();
                    if (triggerSpell.ProcFlags != 0)
                    {
                        rtb.AppendFormatLine("Charges - {0}", triggerSpell.ProcCharges);
                        rtb.AppendLine(Separator);
                        rtb.AppendLine(triggerSpell.ProcInfo);
                        rtb.AppendLine(Separator);
                    }
                }
                else
                {
                    rtb.AppendFormatLine("Trigger spell ({0}) Not found, Chance = {1}", trigger, ProcChance);
                }
            }

            rtb.AppendFormatLineIfNotNull("EffectChainTargets = {0}", effect.EffectChainTargets);
            rtb.AppendFormatLineIfNotNull("EffectItemType = {0}", effect.EffectItemType);

            if ((Mechanics)effect.EffectMechanic != Mechanics.MECHANIC_NONE)
            {
                rtb.AppendFormatLine("Effect Mechanic = {0} ({1})", effect.EffectMechanic, (Mechanics)effect.EffectMechanic);
            }

            rtb.AppendFormatLineIfNotNull("Attributes {0:X8} ({0})", effect.EffectAttributes);
            rtb.AppendLine();
        }