public bool Buff(AIOPartyMember unit, AIOSpell spell, uint reagent = 0)
 {
     return(Buff(new List <AIOPartyMember>()
     {
         unit
     }, spell, reagent));
 }
Exemplo n.º 2
0
        public static void DoRaidUpdate()
        {
            string raidString = Lua.LuaDoString <string>
                                    (@$ "raidCount = GetNumRaidMembers()
                    result = raidCount
                    for i = 1 , raidCount do
                        name, _, subgroup = GetRaidRosterInfo(i);
                        result = result .. '|' .. name .. ':' .. subgroup
                    end
                    return result");

            _raidGroups.Clear();
            if (raidString == "0")
            {
                return;
            }

            string[] players = raidString.Split('|');
            foreach (var playerString in players)
            {
                if (playerString.Contains(":"))
                {
                    string[] parts = playerString.Split(':');
                    if (parts.Length == 2)
                    {
                        string name = parts[0];
                        string stringSubgroupNumber = parts[1];

                        if (int.TryParse(parts[1], out int subGroupNumber))
                        {
                            AIOPartyMember player = _groupAndRaid.Find(m => (m.Name == name) && m.IsValid);
                            if (player != null)
                            {
                                if (_raidGroups.TryGetValue(subGroupNumber, out var subgroup))
                                {
                                    subgroup.Add(player);
                                }
                                else
                                {
                                    _raidGroups[subGroupNumber] = new List <AIOPartyMember>()
                                    {
                                        player
                                    };
                                }
                            }
                        }
                        else
                        {
                            Logger.LogError($"{name} - {subGroupNumber}, not a valid group number");
                        }
                    }
                }
            }
        }