Esempio n. 1
0
        public static void CreateCreatureGroup(NPC npc1, NPC npc2, int initialSize)
        {
            CharacterGroup group = new CharacterGroup(GroupType.NPC, npc1.UniqueID, npc2.UniqueID)
            {
                initialSize = initialSize
            };

            group.groupNPCList.Add(npc1);
            group.groupNPCList.Add(npc2);
            npc1.Group = group;
            npc2.Group = group;
            if (npc1.IsSpellUser || npc2.IsSpellUser)
            {
                group.groupMemberWarmedSpells = new List <Tuple <int, int> >();
            }
        }
Esempio n. 2
0
        public static void CreatePlayerGroup(int groupLeaderID, int firstMemberID) // creates a group of players
        {
            CharacterGroup group = new CharacterGroup(GroupType.Player, groupLeaderID, firstMemberID);

            group.SendGroupMessage("You have formed a group.");
            PC pc = PC.GetOnline(groupLeaderID);

            if (pc != null)
            {
                pc.Group = group;
            }
            pc = PC.GetOnline(firstMemberID);
            if (pc != null)
            {
                pc.Group = group;
            }
        }
Esempio n. 3
0
        public static bool AcceptPlayerGroupInvite(Character ch, int groupLeaderID)
        {
            CharacterGroup group = GetPlayerGroupByGroupLeaderID(groupLeaderID);

            if (group != null)
            {
                if (group.GroupMemberIDList.Count >= MAX_GROUP_SIZE)
                {
                    ch.WriteToDisplay("The group is full.");
                    return(true);
                }
                else
                {
                    group.GroupMemberIDList.Add(ch.UniqueID);
                    group.SendGroupMessage(ch.Name + " has joined the group.", ch.UniqueID);
                    ch.Group = group;
                    ch.WriteToDisplay("You have joined the group.");
                    return(true);
                }
            }
            return(false);
        }