Beispiel #1
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                var spells = SpellGetCommand.RetrieveSpells(trigger);
                var target = trigger.Args.Target;

                if (target == null)
                {
                    return;
                }

                if (spells.Length > 0)
                {
                    foreach (var spell in spells)
                    {
                        if (trigger.Args.Target.HasSpells)
                        {
                            if (spell.Talent != null)
                            {
                                // talent
                                target.Talents.Remove(spell.Talent.Id);
                            }
                            else
                            {
                                // normal spell
                                target.Spells.Remove(spell);
                            }
                            trigger.Reply(RealmLangKey.CmdSpellRemoveResponse, spell);
                        }
                    }
                }
                else
                {
                    trigger.Reply(RealmLangKey.CmdSpellRemoveError);
                }
            }
Beispiel #2
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                Spell[] spellArray = SpellGetCommand.RetrieveSpells(trigger);
                Unit    target     = trigger.Args.Target;

                if (target == null)
                {
                    return;
                }
                if (spellArray.Length > 0)
                {
                    foreach (Spell spell in spellArray)
                    {
                        if (trigger.Args.Target.HasSpells)
                        {
                            if (spell.Talent != null)
                            {
                                target.Talents.Remove(spell.Talent.Id);
                            }
                            else
                            {
                                target.Spells.Remove(spell);
                            }
                            trigger.Reply(RealmLangKey.CmdSpellRemoveResponse, (object)spell);
                        }
                    }
                }
                else
                {
                    trigger.Reply(RealmLangKey.CmdSpellRemoveError);
                }
            }
Beispiel #3
0
 public override object Eval(CmdTrigger <RealmServerCmdArgs> trigger)
 {
     Spell[] spellArray = SpellGetCommand.RetrieveSpells(trigger);
     if (spellArray.Length == 0)
     {
         return((object)null);
     }
     if (spellArray.Length <= 1)
     {
         return((object)spellArray[0]);
     }
     return((object)spellArray);
 }
Beispiel #4
0
 public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
 {
     Spell[] spellArray = SpellGetCommand.RetrieveSpells(trigger);
     if (spellArray.Length == 0)
     {
         trigger.Reply(RealmLangKey.CmdSpellNotExists);
     }
     else
     {
         foreach (Spell spell in spellArray)
         {
             trigger.Args.Target.Auras.CreateSelf(spell, false);
         }
         trigger.Reply("Added {0} Auras.", (object)spellArray.Length);
     }
 }
Beispiel #5
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                // add list of spells
                var spells = SpellGetCommand.RetrieveSpells(trigger);

                if (spells.Length == 0)
                {
                    trigger.Reply(RealmLangKey.CmdSpellNotExists);
                }
                else
                {
                    foreach (var spell in spells)
                    {
                        trigger.Args.Target.Auras.CreateSelf(spell);
                    }
                    trigger.Reply("Added {0} Auras.", spells.Length);
                }
            }
Beispiel #6
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                Spell[] spellArray = SpellGetCommand.RetrieveSpells(trigger);
                Unit    target     = trigger.Args.Target;

                if (target == null)
                {
                    return;
                }
                if (spellArray.Length > 0)
                {
                    foreach (Spell spell in spellArray)
                    {
                        target.SpellCast.TriggerSelf(spell);
                        trigger.Reply(RealmLangKey.CmdSpellTriggerResponse, (object)spell);
                    }
                }
                else
                {
                    trigger.Reply(RealmLangKey.CmdSpellTriggerError);
                }
            }
Beispiel #7
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                var spells = SpellGetCommand.RetrieveSpells(trigger);
                var target = trigger.Args.Target;

                if (target == null)
                {
                    return;
                }

                if (spells.Length > 0)
                {
                    foreach (var spell in spells)
                    {
                        target.SpellCast.TriggerSelf(spell);
                        trigger.Reply(RealmLangKey.CmdSpellTriggerResponse, spell);
                    }
                }
                else
                {
                    trigger.Reply(RealmLangKey.CmdSpellTriggerError);
                }
            }
Beispiel #8
0
 public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
 {
     Spell[] spellArray = SpellGetCommand.RetrieveSpells(trigger);
     trigger.Reply(spellArray.ToString());
 }
Beispiel #9
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                var mod    = trigger.Text.NextModifiers();
                var target = trigger.Args.Target;

                if (target == null)
                {
                    return;
                }

                if (mod.Length > 0 && !(mod.Length == 1 && mod.Contains("r")))
                {
                    if (mod.Contains("c"))
                    {
                        // add all class abilities
                        ClassId clss;
                        if (trigger.Text.HasNext)
                        {
                            clss = trigger.Text.NextEnum(ClassId.End);
                            if (clss == ClassId.End)
                            {
                                trigger.Reply(RealmLangKey.InvalidClass);
                                return;
                            }
                        }
                        else
                        {
                            clss = target.Class;
                        }

                        var count = 0;
                        var lines = SpellLines.GetLines(clss);
                        foreach (var line in lines)
                        {
                            if (line.HighestRank.Talent == null)
                            {
                                AddSpell(target, line.HighestRank, mod.Contains("r"));
                                count++;
                            }
                        }
                        if (count > 0)
                        {
                            trigger.Reply(RealmLangKey.CmdSpellAddResponseSpells, count);
                        }
                    }

                    if (mod.Contains("t"))
                    {
                        // add all talents
                        int count = 0;
                        var lines = SpellLines.GetLines(target.Class);
                        foreach (var line in lines)
                        {
                            if (line.HighestRank.Talent != null)
                            {
                                AddSpell(target, line.HighestRank, mod.Contains("r"));
                                count++;
                            }
                        }
                        trigger.Reply(RealmLangKey.CmdSpellAddResponseTalents, count);
                    }
                }
                else
                {
                    // add list of spells
                    var spells = SpellGetCommand.RetrieveSpells(trigger);
                    if (spells.Length == 0)
                    {
                        trigger.Reply(RealmLangKey.CmdSpellNotExists);
                    }
                    else
                    {
                        foreach (var spell in spells)
                        {
                            AddSpell(target, spell, mod.Contains("r"));
                            trigger.Reply(RealmLangKey.CmdSpellAddResponseSpell, spell);
                        }
                    }
                }
            }
Beispiel #10
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                string str    = trigger.Text.NextModifiers();
                Unit   target = trigger.Args.Target;

                if (target == null)
                {
                    return;
                }
                if (str.Length > 0 && (str.Length != 1 || !str.Contains("r")))
                {
                    if (str.Contains("c"))
                    {
                        ClassId clss;
                        if (trigger.Text.HasNext)
                        {
                            clss = trigger.Text.NextEnum(ClassId.End);
                            if (clss == ClassId.End)
                            {
                                trigger.Reply(RealmLangKey.InvalidClass);
                                return;
                            }
                        }
                        else
                        {
                            clss = target.Class;
                        }

                        int num = 0;
                        foreach (SpellLine line in SpellLines.GetLines(clss))
                        {
                            if (line.HighestRank.Talent == null)
                            {
                                AddSpell(target, line.HighestRank, str.Contains("r"));
                                ++num;
                            }
                        }

                        if (num > 0)
                        {
                            trigger.Reply(RealmLangKey.CmdSpellAddResponseSpells, (object)num);
                        }
                    }

                    if (!str.Contains("t"))
                    {
                        return;
                    }
                    int num1 = 0;
                    foreach (SpellLine line in SpellLines.GetLines(target.Class))
                    {
                        if (line.HighestRank.Talent != null)
                        {
                            AddSpell(target, line.HighestRank, str.Contains("r"));
                            ++num1;
                        }
                    }

                    trigger.Reply(RealmLangKey.CmdSpellAddResponseTalents, (object)num1);
                }
                else
                {
                    Spell[] spellArray = SpellGetCommand.RetrieveSpells(trigger);
                    if (spellArray.Length == 0)
                    {
                        trigger.Reply(RealmLangKey.CmdSpellNotExists);
                    }
                    else
                    {
                        foreach (Spell spell in spellArray)
                        {
                            AddSpell(target, spell, str.Contains("r"));
                            trigger.Reply(RealmLangKey.CmdSpellAddResponseSpell, (object)spell);
                        }
                    }
                }
            }