Пример #1
0
 public string ToString(int namePadding)
 {
     return(String.Join(" ", new string[] {
         NAME.PadLeft(namePadding),
         TTL.ToString(),
         CLASS.ToString(),
         TypeString
     }));
 }
Пример #2
0
    private string itemeffect; //アイテムの説明、文字型

    //ItemSpecのコンストラクタ
    public ItemSpec(CLASS itemClass,
                    TYPE itemType,
                    float?numValue,
                    string charaValue,
                    string itemEffect)
    {
        itemclass  = itemClass.ToString();
        itemtype   = itemType.ToString();
        numvalue   = numValue;
        charavalue = charaValue;
        itemeffect = itemEffect;
    }
Пример #3
0
        static bool OnInitTrainer(LoginClient client, string input)
        {
            if (client.Account.AccessLvl < ACCESSLEVEL.GM)
            {
                Chat.System(client, "You do not have access to this command");
                return(true);
            }

            string[] split = input.Split(' ');
            if (split.Length < 2)
            {
                return(false);
            }


            DataObject[] obj = DataServer.Database.SelectObjects(typeof(DBVendor), "GUID='" + client.Character.Selected + "'");
            if (obj == null || obj.Length == 0)
            {
                Chat.System(client, "Vendor not found");
                return(true);
            }
            DBVendor vendor   = (DBVendor)obj[0];
            CLASS    tmpClass = CLASS.MAGE;

            try
            {
                tmpClass = (CLASS)Enum.Parse(typeof(CLASS), split[1].ToUpper());
            }
            catch (Exception) { Chat.System(client, "Invalid class"); return(false); }
            vendor.Class = (int)tmpClass;
            Chat.System(client, "Setting Trainer Class:" + vendor.Class);
            DataServer.Database.SaveObject(vendor);
            DataServer.Database.FillObjectRelations(vendor);
            string classstr = tmpClass.ToString();

            classstr = classstr.Substring(0, 1).ToUpper() + classstr.Substring(1).ToLower();
            string      chatcmd = "!title " + '\"' + classstr + " Trainer" + '\"';
            WorldPacket pkg     = new WorldPacket(WORLDMSG.CLIENT_MESSAGE);

            pkg.Write(client.Character.ObjectId);
            pkg.Write((int)CMSG.MESSAGECHAT);
            pkg.Write((int)0);
            pkg.Write((int)0);
            pkg.Write(chatcmd);
            client.SendWorldServer(pkg);
            return(true);
        }
Пример #4
0
        static string FixMacro(string line)
        {
            int pos = line.IndexOf("//");

            if (pos >= 0)
            {
                line = line.Substring(0, pos);
            }
            pos = line.IndexOf(";");
            if (pos >= 0)
            {
                line = line.Substring(0, pos);
            }
            line = line.Trim();
            if (line == "")
            {
                return("");
            }

            int    start = 0;
            string ret   = line;

            while (start < line.Length)
            {
                pos = line.IndexOf('#', start);
                if (pos < 0)
                {
                    break;
                }
                start = pos + 1;

                int cnt = 0;
                while (cnt < 40)
                {
                    if (pos + cnt >= line.Length)
                    {
                        break;
                    }
                    char ch = line[pos + cnt];
                    if (ch == '#' || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '_')
                    {
                        cnt++;
                    }
                    else
                    {
                        break;
                    }
                }
                string s = line.Substring(pos, cnt);
                if (s.StartsWith("#RACE_"))
                {
                    for (RACE t = RACE.HUMAN; t <= RACE.GOBLIN; t++)
                    {
                        if (s == "#RACE_" + t.ToString())
                        {
                            ret = ret.Replace(s, ((int)t).ToString());
                        }
                    }
                }
                else if (s.StartsWith("#CLASS_"))
                {
                    for (CLASS t = CLASS.WARRIOR; t <= CLASS.DRUID; t++)
                    {
                        if (s == "#CLASS_" + t.ToString())
                        {
                            ret = ret.Replace(s, ((int)t).ToString());
                        }
                    }
                }
                else
                {
                    ret = "";
                }
            }
            return(ret);
        }