GetRadius() public method

public GetRadius ( int index ) : string
index int
return string
Beispiel #1
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();
            }
        }
Beispiel #2
0
        private void AppendSpellEffectInfo()
        {
            rtb.AppendLine(_line);

            for (int EFFECT_INDEX = 0; EFFECT_INDEX < DBC.MAX_EFFECT_INDEX; EFFECT_INDEX++)
            {
                rtb.SetBold();
                if ((SpellEffects)spell.Effect[EFFECT_INDEX] == SpellEffects.NO_SPELL_EFFECT)
                {
                    rtb.AppendFormatLine("Effect {0}:  NO EFFECT", EFFECT_INDEX);
                    rtb.AppendLine();
                    continue;
                }

                rtb.AppendFormatLine("Effect {0}: Id {1} ({2})", EFFECT_INDEX, spell.Effect[EFFECT_INDEX], (SpellEffects)spell.Effect[EFFECT_INDEX]);
                rtb.SetDefaultStyle();
                rtb.AppendFormat("BasePoints = {0}", spell.EffectBasePoints[EFFECT_INDEX] + spell.EffectBaseDice[EFFECT_INDEX]);

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

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

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

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

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

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

                AuraModTypeName(EFFECT_INDEX);

                //uint[] ClassMask = new uint[3];

                //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.SpellFamilyName == spell.SpellFamilyName && Spell.SpellFamilyFlags.ContainsElement(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));

                // append trigger spell
                uint trigger = spell.EffectTriggerSpell[EFFECT_INDEX];
                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, spell.ProcChance);
                        rtb.AppendFormatLineIfNotNull("   Description: {0}", triggerSpell.Description);
                        rtb.AppendFormatLineIfNotNull("   ToolTip: {0}", triggerSpell.ToolTip);
                        rtb.SetDefaultStyle();
                        if (triggerSpell.ProcFlags != 0)
                        {
                            rtb.AppendFormatLine("Charges - {0}", triggerSpell.ProcCharges);
                            rtb.AppendLine(_line);
                            rtb.AppendLine(triggerSpell.ProcInfo);
                            rtb.AppendLine(_line);
                        }
                    }
                    else
                    {
                        rtb.AppendFormatLine("Trigger spell ({0}) Not found, Chance = {1}", trigger, spell.ProcChance);
                    }
                }

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

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

                rtb.AppendLine();
            }
        }