示例#1
0
        internal static bool IsSpellReady(string name)
        {
            name = name.Replace("()", "");
            if (!CooldownManager.Contains("GCD") && !CooldownManager.Contains(name))
            {
                string   LuaStatement = "eins, zwei, drei = isSpellReady('" + name + "')";
                string[] result       = Calls.GetText(LuaStatement, new string[] { "eins", "zwei", "drei" }, 20);
                if (result[0].Trim() == "0")
                {
                    return(true);
                }
                else
                {
                    if (result[0] != "" && result[1] != "")
                    {
                        double timeStamp = Convert.ToDouble(result[0].Replace(".", ""));
                        double secCd     = TimeSpan.FromSeconds(Convert.ToDouble(result[1].Replace(".", ","))).TotalMilliseconds;

                        if (result[2] == "1")
                        {
                            if (secCd == 1500)
                            {
                                CooldownManager.Add("GCD", timeStamp + secCd);
                            }
                            CooldownManager.Add(name, timeStamp + secCd);
                        }
                    }
                }
            }
            return(false);
        }