Exemple #1
0
        public static void RemoveFromParty(Party party, Client client)
        {
            if (party != null)
            {
                //if (CanBeRemovedFromParty(party, client)) {
                int slot = party.GetMemberSlot(client.Player.CharID);

                party.Remove(client);
                client.Player.PartyID = null;
                client.Player.RemoveExpKitModule(Enums.ExpKitModules.Party);
                Messenger.PlayerMsg(client, "You have been removed from your party!", Text.Black);
                Messenger.SendLeftParty(party, slot);
                Messenger.PartyMsg(party, client.Player.Name + " has been removed from the party!", Text.BrightGreen);
                if (slot == 0 && party.IsLeaderInParty())
                {
                    Client client2 = party.GetLeader();
                    if (client2 != null)
                    {
                        Messenger.PartyMsg(party, client2.Player.Name + " is now the party leader!", Text.BrightGreen);
                    }
                }
                PerformPartyChecks(party);
                //} else {
                //    Messenger.PlayerMsg(client, "You can't be removed from your party here!", Text.Black);
                //}
            }
            else
            {
                Messenger.PlayerMsg(client, "You are not in a party!", Text.Black);
            }
        }
Exemple #2
0
        public static void RemoveFromParty(string clientID)
        {
            Party partyData = null;

            using (DatabaseConnection dbConnection = new DatabaseConnection(DatabaseID.Players)) {
                partyData = LoadCharacterParty(dbConnection.Database, clientID);
            }

            if (partyData != null)
            {
                partyData.Remove(clientID);

                PerformPartyChecks(partyData);
            }
        }
        public static void RemoveFromParty(Party party, Client client)
        {
            if (party != null) {
                //if (CanBeRemovedFromParty(party, client)) {
                    int slot = party.GetMemberSlot(client.Player.CharID);

                    party.Remove(client);
                    client.Player.PartyID = null;
                    client.Player.RemoveExpKitModule(Enums.ExpKitModules.Party);
                    Messenger.PlayerMsg(client, "You have been removed from your party!", Text.Black);
                    Messenger.SendLeftParty(party, slot);
                    Messenger.PartyMsg(party, client.Player.Name + " has been removed from the party!", Text.BrightGreen);
                    if (slot == 0 && party.IsLeaderInParty()) {
                        Client client2 = party.GetLeader();
                        if (client2 != null) {
                            Messenger.PartyMsg(party, client2.Player.Name + " is now the party leader!", Text.BrightGreen);
                        }
                    }
                    PerformPartyChecks(party);
                //} else {
                //    Messenger.PlayerMsg(client, "You can't be removed from your party here!", Text.Black);
                //}
            } else {
                Messenger.PlayerMsg(client, "You are not in a party!", Text.Black);
            }
        }