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 JoinParty(Party party, Client client)
        {
            PacketHitList hitlist = null;

            PacketHitList.MethodStart(ref hitlist);

            if (party != null)
            {
                Client leader = party.GetLeader();
                if (Combat.MoveProcessor.IsInAreaRange(1, client.Player.X, client.Player.Y, leader.Player.X, leader.Player.Y))
                {
                    if (party.AddToParty(client))
                    {
                        client.Player.PartyID = party.PartyID;
                        client.Player.AddExpKitModule(new AvailableExpKitModule(Enums.ExpKitModules.Party, true));
                        hitlist.AddPacket(client, PacketBuilder.CreateChatMsg("You have joined the party!", Text.BrightGreen));
                        //PartyMember member = party.FindMember(client.Player.CharID);
                        int slot = party.GetMemberSlot(client.Player.CharID);
                        //Messenger.SendPartyMemberData(client, member, slot);
                        foreach (Client i in party.GetOnlineMemberClients())
                        {
                            if (i.IsPlaying() && i != client)
                            {
                                //PartyMember teamMember = party.Members.FindMember(i.Player.CharID);
                                //int teamMemberSlot = party.Members.GetMemberSlot(i.Player.CharID);
                                //Messenger.SendPartyMemberData(client, teamMember, teamMemberSlot);
                                //Messenger.SendPartyMemberData(i, member, slot);
                                hitlist.AddPacket(i, PacketBuilder.CreateChatMsg(client.Player.Name + " has joined the party!", Text.BrightGreen));
                            }
                            PacketBuilder.AppendPartyMemberData(i, hitlist, slot);
                        }
                    }
                    else
                    {
                        hitlist.AddPacket(client, PacketBuilder.CreateChatMsg("You couldn't join the party!", Text.BrightRed));
                    }
                }
                else
                {
                    Messenger.PlayerMsg(client, "You need to stand next to the leader to join the party!", Text.BrightRed);
                }
            }

            PacketHitList.MethodEnded(ref hitlist);
        }
        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);
            }
        }
        public static void JoinParty(Party party, Client client)
        {
            PacketHitList hitlist = null;
            PacketHitList.MethodStart(ref hitlist);

            if (party != null) {
                Client leader = party.GetLeader();
                if (Combat.MoveProcessor.IsInAreaRange(1, client.Player.X, client.Player.Y, leader.Player.X, leader.Player.Y)) {
                    if (party.AddToParty(client)) {
                        client.Player.PartyID = party.PartyID;
                        client.Player.AddExpKitModule(new AvailableExpKitModule(Enums.ExpKitModules.Party, true));
                        hitlist.AddPacket(client, PacketBuilder.CreateChatMsg("You have joined the party!", Text.BrightGreen));
                        //PartyMember member = party.FindMember(client.Player.CharID);
                        int slot = party.GetMemberSlot(client.Player.CharID);
                        //Messenger.SendPartyMemberData(client, member, slot);
                        foreach (Client i in party.GetOnlineMemberClients()) {
                            if (i.IsPlaying() && i != client) {
                                //PartyMember teamMember = party.Members.FindMember(i.Player.CharID);
                                //int teamMemberSlot = party.Members.GetMemberSlot(i.Player.CharID);
                                //Messenger.SendPartyMemberData(client, teamMember, teamMemberSlot);
                                //Messenger.SendPartyMemberData(i, member, slot);
                                hitlist.AddPacket(i, PacketBuilder.CreateChatMsg(client.Player.Name + " has joined the party!", Text.BrightGreen));
                            }
                            PacketBuilder.AppendPartyMemberData(i, hitlist, slot);
                        }
                    } else {
                        hitlist.AddPacket(client, PacketBuilder.CreateChatMsg("You couldn't join the party!", Text.BrightRed));
                    }
                } else {
                    Messenger.PlayerMsg(client, "You need to stand next to the leader to join the party!", Text.BrightRed);
                }
            }

            PacketHitList.MethodEnded(ref hitlist);
        }