Ejemplo n.º 1
0
 /// <summary>
 /// Creates a raid group from an existing party group.
 /// TODO: This looks wrong
 /// </summary>
 /// <param name="group">the group to convert</param>
 public RaidGroup(Group group)
     : this(group.Leader.Character)
 {
     foreach (var member in group)
     {
         if (member != m_firstMember)
         {
             AddMember(member.Character, false);
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// TODO: Checking for level requirements
        /// </summary>
        /// <param name="group"></param>
        public Battlegroup(Group group)
        {
            m_characters = new List<Character>(5);

            group.SyncRoot.EnterReadLock();
			try
			{
				foreach (var chr in group.GetCharacters())
				{
					if (chr != null)
					{
						m_characters.Add(chr);
						//BattlegroundHandler.SendAddedToQueue(chr.Client);
					}
				}
			}
			finally
			{
				group.SyncRoot.ExitReadLock();
			}
        }
Ejemplo n.º 3
0
 public void Add(Group group)
 {
     Battlegroup bg = new Battlegroup(group, this);
     Add(bg);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Adds all initial Looters of nearby Characters who may loot this Loot.
        /// When all of the initial Looters gave up the Loot, the Loot becomes free for all.
        /// </summary>
        public void Initialize(Character chr, IList<LooterEntry> looters, MapId mapid)
        {
            Looters = looters;
            if (IsGroupLoot)
            {
                var groupMember = chr.GroupMember;
                if (groupMember != null)
                {
                    Group = groupMember.Group;
                    Method = Group.LootMethod;
                    Threshold = Group.LootThreshold;

                    var decision = Method == LootMethod.MasterLoot ? LootDecision.Master : LootDecision.Rolling;

                    IList<LooterEntry> nearbyLooters = null;

                    // TODO: masterlooter
                    foreach (var item in Items)
                    {
                        if (item.Template.Flags.HasFlag(ItemFlags.MultiLoot) ||
                            item.Template.Quality >= Threshold)
                        {
                            if (UsesRoundRobin)
                            {
                                nearbyLooters = new List<LooterEntry>();
                                Group.GetNearbyLooters(Lootable, chr, nearbyLooters);
                            }
                            else
                            {
                                nearbyLooters = Looters;
                            }
                        }

                        if (item.Template.Flags.HasFlag(ItemFlags.MultiLoot))
                        {
                            item.AddMultiLooters(nearbyLooters);
                        }
                        else if (item.Template.Quality >= Threshold)
                        {
                            item.Decision = decision;
                            if (decision == LootDecision.Rolling)
                            {
                                item.RollProgress = new LootRollProgress(this, item, nearbyLooters);
                                LootHandler.SendStartRoll(this, item, nearbyLooters, mapid);
                            }
                        }
                    }
                    return;
                }
            }
            Method = LootMethod.FreeForAll;
        }