コード例 #1
0
        void Core_CommandLineText(object sender, Decal.Adapter.ChatParserInterceptEventArgs e)
        {
            try
            {
                if (e.Text == "/vtmon")
                {
                    e.Eat = true;

                    Decal.Adapter.Wrappers.WorldObject sel = Core.WorldFilter[Host.Actions.CurrentSelection];
                    if (sel == null)
                    {
                        Chat("Select a monster first."); return;
                    }
                    if (sel.ObjectClass != Decal.Adapter.Wrappers.ObjectClass.Monster)
                    {
                        Chat("Select a monster first."); return;
                    }

                    //Fetch the info about the monster.
                    VT_eDamageElement[] autodamages = VirindiTank_FreeConnector.FGameInfo_QueryAutoDamageElementList(sel.Name);
                    if (autodamages == null)
                    {
                        autodamages = new VT_eDamageElement[0];
                    }

                    VT_eDamageElement monsterlistvalue = VirindiTank_FreeConnector.FMonsterList_QueryFinalDamageType(sel.Id);

                    Chat("Monster \"" + sel.Name + "\" will be attacked using " + monsterlistvalue.ToString());

                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < autodamages.Length; ++i)
                    {
                        sb.Append(autodamages[i].ToString());
                        if (i < autodamages.Length - 1)
                        {
                            sb.Append(", ");
                        }
                    }

                    Chat("Auto damage list: " + sb.ToString());
                }
            }
            catch (Exception ex)
            {
                Chat(ex.ToString());
            }
        }