Exemple #1
0
        private void AuraModTypeName(int index)
        {
            SpellEffectEntry effect = spell.GetEffect(index);
            AuraType         aura   = (AuraType)effect.EffectApplyAuraName;
            int misc = effect.EffectMiscValue;

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

                return;
            }

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

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

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

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

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

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

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

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

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

            default:
                break;
            }
        }
Exemple #2
0
        private void AppendSpellEffectInfo()
        {
            rtb.AppendLine(_line);

            for (int EFFECT_INDEX = 0; EFFECT_INDEX < DBC.MAX_EFFECT_INDEX; EFFECT_INDEX++)
            {
                if (!spell.HasEffectAtIndex(EFFECT_INDEX))
                {
                    continue;
                }

                SpellEffectEntry effect = spell.GetEffect(EFFECT_INDEX);

                rtb.SetBold();
                if ((SpellEffects)effect.Effect == SpellEffects.SPELL_EFFECT_NONE)
                {
                    rtb.AppendFormatLine("Effect {0}:  NO EFFECT", EFFECT_INDEX);
                    rtb.AppendLine();
                    continue;
                }

                rtb.AppendFormatLine("Effect {0}: Id {1} ({2})", EFFECT_INDEX, effect.Effect, (SpellEffects)effect.Effect);
                rtb.SetDefaultStyle();
                rtb.AppendFormat("BasePoints = {0}", effect.EffectBasePoints);

                if (effect.EffectRealPointsPerLevel != 0)
                {
                    rtb.AppendFormat(" + Level * {0:F}", effect.EffectRealPointsPerLevel);
                }

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

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

                if (effect.DmgMultiplier != 1.0f)
                {
                    rtb.AppendFormat(" x {0:F}", effect.DmgMultiplier);
                }

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

                rtb.AppendFormatLine("Targets ({0}, {1}) ({2}, {3})",
                                     effect.EffectImplicitTargetA, effect.EffectImplicitTargetB,
                                     (Targets)effect.EffectImplicitTargetA, (Targets)effect.EffectImplicitTargetB);

                AuraModTypeName(EFFECT_INDEX);

                uint[] ClassMask = new uint[3];

                ClassMask = effect.EffectSpellClassMaskA;

                //switch (EFFECT_INDEX)
                //{
                //    case 0: ClassMask = spell.EffectSpellClassMaskA; break;
                //    case 1: ClassMask = spell.EffectSpellClassMaskB; break;
                //    case 2: ClassMask = spell.EffectSpellClassMaskC; break;
                //}

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

                    var query = from Spell in DBC.Spell.Values
                                where Spell.SpellClassOptions.Match(classOptions, ClassMask)
                                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)
                        {
                            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}", spell.GetRadius(EFFECT_INDEX));
                rtb.AppendFormatLineIfNotNull("{0}", spell.GetMaxRadius(EFFECT_INDEX));

                // append trigger spell
                uint trigger = spell.GetEffect(EFFECT_INDEX).EffectTriggerSpell;
                if (trigger != 0)
                {
                    if (DBC.Spell.ContainsKey(trigger))
                    {
                        SpellEntry triggerSpell = DBC.Spell[trigger];
                        rtb.SetStyle(Color.Blue, FontStyle.Bold);
                        rtb.AppendFormatLine("   Trigger spell ({0}) {1}. Chance = {2}", trigger, triggerSpell.SpellNameRank, spellAuraOptions.ProcChance);
                        rtb.AppendFormatLineIfNotNull("   Description: {0}", triggerSpell.Description);
                        rtb.AppendFormatLineIfNotNull("   ToolTip: {0}", triggerSpell.ToolTip);
                        rtb.SetDefaultStyle();
                        var triggerAuraOptions = triggerSpell.SpellAuraOptions;
                        if (triggerAuraOptions.ProcFlags != 0)
                        {
                            rtb.AppendFormatLine("Charges - {0}", triggerAuraOptions.ProcCharges);
                            rtb.AppendLine(_line);
                            rtb.AppendLine(triggerSpell.ProcInfo);
                            rtb.AppendLine(_line);
                        }
                    }
                    else
                    {
                        rtb.AppendFormatLine("Trigger spell ({0}) Not found, Chance = {1}", trigger, spellAuraOptions.ProcChance);
                    }
                }

                rtb.AppendFormatLineIfNotNull("EffectChainTarget = {0}", effect.EffectChainTarget);
                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.AppendLine();
            }
        }