private void AppendSkillLine(RichTextBox sb, uint entry) { var query = from skillLineAbility in DBC.SkillLineAbility join skillLine in DBC.SkillLine on skillLineAbility.Value.SkillId equals skillLine.Key where skillLineAbility.Value.SpellId == entry select new { skillLineAbility, skillLine }; if (query.Count() == 0) { return; } var skill = query.First().skillLineAbility.Value; var line = query.First().skillLine.Value; sb.AppendFormatLine("Skill (Id {0}) \"{1}\"", skill.SkillId, line.Name); sb.AppendFormat(" ReqSkillValue {0}", skill.Req_skill_value); sb.AppendFormat(", Forward Spell = {0}, MinMaxValue ({1}, {2})", skill.Forward_spellid, skill.Min_value, skill.Max_value); sb.AppendFormat(", CharacterPoints ({0}, {1})", skill.CharacterPoints[0], skill.CharacterPoints[1]); }
public static void AppendFormatIfNotNull(this RichTextBox builder, string format, float arg) { if (arg != 0.0f) { builder.AppendFormat(format, arg); } }
public static void AppendFormatIfNotNull(this RichTextBox builder, string format, object arg) { if (arg.ToInt32() != 0) { builder.AppendFormat(format, arg); } }
public static void AppendFormatIfNotNull(this RichTextBox builder, string format, float arg) { if (Math.Abs(arg) > 1.0E-5f) { builder.AppendFormat(format, arg); } }
public static void AppendFormatIfNotNull(this RichTextBox builder, string format, string arg) { if (arg != String.Empty) { builder.AppendFormat(format, arg); } }
public static void AppendFormatLineIfNotNull(this RichTextBox builder, string format, uint arg, object s) { if (arg != 0) { builder.AppendFormat(format + Environment.NewLine, arg, s); } }
public static void AppendFormatIfNotNull(this RichTextBox builder, string format, string arg) { Contract.Requires(format != null); if (arg != String.Empty) { builder.AppendFormat(format, arg); } }
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(); }
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(); }
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); } }
public void ViewVehicleInfo() { _rtb.Clear(); _rtb.SetBold(); _rtb.AppendFormatLine("Vehicle ID: {0}", _vehicle.Id); _rtb.AppendFormatLine("Locomotion Type: {0}", _vehicle.LocomotionType); _rtb.AppendFormatLine("Seat Indicator Type: {0}", _vehicle.SeatIndicatorType); _rtb.AppendFormatLine("Power Type: {0}", _vehicle.PowerType); _rtb.AppendFormatLine("Turn Speed: {0}", _vehicle.TurnSpeed); _rtb.AppendFormatLine("Pitch Speed: {0}", _vehicle.PitchSpeed); _rtb.AppendFormatLine("Pitch Min: {0}", _vehicle.PitchMin); _rtb.AppendFormatLine("Pitch Max: {0}", _vehicle.PitchMax); _rtb.AppendFormatLine("Pitch Offset: {0}", _vehicle.PitchOffset); _rtb.AppendFormatLine("Mouselook Offset Pitch: {0}", _vehicle.MouseLookOffsetPitch); _rtb.AppendFormatLine("Camera Fade Distance Scalar Min: {0}", _vehicle.CameraFadeDistScalarMin); _rtb.AppendFormatLine("Camera Fade Distance Scalar Max: {0}", _vehicle.CameraFadeDistScalarMax); _rtb.AppendFormatLine("Camera Yaw Offset: {0}", _vehicle.CameraYawOffset); _rtb.AppendFormatLine("Facing Limit Right: {0}", _vehicle.FacingLimitRight); _rtb.AppendFormatLine("Facing Limit Left: {0}", _vehicle.FacingLimitLeft); _rtb.AppendFormatLine("Missle Target Turn Lingering: {0}", _vehicle.MissleTargetTurnLingering); _rtb.AppendFormatLine("Missle Target Pitch Lingering: {0}", _vehicle.MissleTargetPitchLingering); _rtb.AppendFormatLine("Missle Target Mouse Lingering: {0}", _vehicle.MissleTargetMouseLingering); _rtb.AppendFormatLine("Missle Target End Opacity: {0}", _vehicle.MissleTargetEndOpacity); _rtb.AppendFormatLine("Missle Target Arc Speed: {0}", _vehicle.MissleTargetArcSpeed); _rtb.AppendFormatLine("Missle Target Arc Repeat: {0}", _vehicle.MissleTargetArcRepeat); _rtb.AppendFormatLine("Missle Target Arc Width: {0}", _vehicle.MissleTargetArcWidth); _rtb.AppendFormatLine("Missle Target Impact Radius 1: {0}", _vehicle.MissleTargetImpactRadius[0]); _rtb.AppendFormatLine("Missle Target Impact Radius 2: {0}", _vehicle.MissleTargetImpactRadius[1]); _rtb.AppendFormatLine("Missle Target Impact Texture Radius: {0}", _vehicle.MissleTargetImpactTexRadius); _rtb.AppendFormatLine("Missle Target Arc Texture: {0}", _vehicle.MissleTargetArcTexture); _rtb.AppendFormatLine("Missle Target Impact Model 1: {0}", _vehicle.MissleTargetImpactModel1); _rtb.AppendFormatLine("Missle Target Impact Model 2: {0}", _vehicle.MissleTargetImpactModel2); _rtb.AppendFormatLine("Unk1: {0}", _vehicle.Unk1); _rtb.AppendFormatLine("Unk2: {0}", _vehicle.Unk2); _rtb.AppendLine(); _rtb.SetBold(); _rtb.AppendFormatLine("Has VehiceFlags:"); _rtb.SetDefaultStyle(); for (var i = 0; i < 32; ++i) { if ((_vehicle.Flags & (1 << i)) != 0L) { _rtb.AppendFormatLine("{0}", (VehicleFlags)(1 << i)); } } _rtb.AppendLine(); _rtb.SetBold(); _rtb.AppendFormatLine("Used by the following creatures:"); _rtb.SetDefaultStyle(); foreach (var c in SQL.CreatureTemplate.Where(x => x.Value.VehicleId == _vehicle.Id).Select(creature => creature.Value)) { _rtb.AppendFormatLine("{0} - {1}", c.Id, c.Name); _rtb.SetDefaultStyle(); if (((NPCFlags)c.NPCFlag).HasFlag(NPCFlags.Spellclick)) { _rtb.AppendLine(" Has spellclick NPC flag"); } List <int> spellClickSpells; if (SQL.SpellClick.TryGetValue(c.Id, out spellClickSpells)) { foreach (var spell in spellClickSpells) { _rtb.AppendFormatLine(" Has spellclick spell {0}", spell); } } var vehicleSeats = new LinkedList <VehicleSeatEntry>(); foreach (var s in Seats) { vehicleSeats.AddLast(s.Seat); } List <VehicleTemplateAccessory> accessories; if (SQL.Accessories.TryGetValue(c.Id, out accessories)) { foreach (var accessory in accessories) { _rtb.AppendFormatLine(" Has accessory entry {0} on seat {1}", accessory.AccessoryEntry, accessory.SeatId); CreatureTemplate template; if (!SQL.CreatureTemplate.TryGetValue((int)accessory.AccessoryEntry, out template)) { continue; } if (template.VehicleId == 0) { continue; } _rtb.AppendFormatLine(" Accessory is a vehicle."); var val = vehicleSeats.Find( Seats.Find(x => x.Seat.Id == _vehicle.SeatId[accessory.SeatId]).Seat ); VehicleEntry vehicle; if (!DBC.Vehicle.TryGetValue(template.VehicleId, out vehicle)) { continue; } foreach (var vs in vehicle.SeatId) { VehicleSeatEntry vsE; if (DBC.VehicleSeat.TryGetValue(vs, out vsE)) { if (vsE.Flags.HasFlag(VehicleSeatFlags.CanControl)) { vehicleSeats.AddAfter(val, vsE); } } } vehicleSeats.Remove(val); } _rtb.AppendLine(); _rtb.SetBold(); _rtb.AppendFormatLine("The following seats can be cycled trough by the player (recursive cycling included)"); foreach (var vs in vehicleSeats) { _rtb.AppendFormat("{0}->", vs.Id); } _rtb.SetDefaultStyle(); _rtb.AppendLine(); } _rtb.AppendFormatLineIfNotNull(" AIName: \"{0}\"", c.AIName); _rtb.AppendFormatLineIfNotNull(" ScriptName: \"{0}\"", c.ScriptName); _rtb.AppendLine(); _rtb.SetDefaultStyle(); } }
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(); }
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(); } }
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; } }
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(); }
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(); }