Beispiel #1
0
        /// <summary>
        /// Broadcasts PartySetActiveQuest in party.
        /// </summary>
        /// <param name="party"></param>
        /// <param name="uniqueQuestId"></param>
        public static void PartySetActiveQuest(Party party, long uniqueQuestId)
        {
            var packet = new Packet(Op.PartySetActiveQuest, 0);
            packet.PutLong(uniqueQuestId);

            party.Broadcast(packet, true);
        }
Beispiel #2
0
		/// <summary>
		/// Broadcasts QuestUpdate in party.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="quest"></param>
		public static void QuestUpdate(Party party, Quest quest)
		{
			var packet = new Packet(Op.QuestUpdate, 0);
			packet.AddQuestUpdate(quest);

			party.Broadcast(packet, true);
		}
Beispiel #3
0
		/// <summary>
		/// Response to the party creation request, sends the client the relevant party data.
		/// </summary>
		/// <remarks>
		/// I feel like I'm the MSDN with that summary.
		/// </remarks>
		/// <param name="creature"></param>
		/// <param name="party">Set null for negative response.</param>
		public static void CreatePartyR(Creature creature, Party party)
		{
			var packet = new Packet(Op.PartyCreateR, creature.EntityId);

			packet.PutByte(party != null);
			if (party != null)
				packet.AddParty(party);

			creature.Client.Send(packet);
		}
Beispiel #4
0
		/// <summary>
		/// Adds party member data to the referenced packet.
		/// </summary>
		/// <param name="party"></param>
		/// <param name="packet"></param>
		public static void AddPartyMembers(this Packet packet, Party party)
		{
			var members = party.GetMembers();

			for (int i = members.Length - 1; i >= 0; i--)
			{
				packet.AddPartyMember(members[i]);

				if (i == 0)
				{
					packet.PutInt(3);
					packet.PutLong(0);
				}
				else
				{
					packet.PutInt(1);
					packet.PutLong(0);
				}
			}
			packet.PutByte(0);
		}
Beispiel #5
0
		/// <summary>
		/// Constructs the party info packet, because this is used in a number of packets.
		/// </summary>
		/// <param name="party"></param>
		/// <param name="packet"></param>
		public static void AddParty(this Packet packet, Party party)
		{
			packet.PutLong(party.Id);
			packet.PutString(party.Name);
			packet.PutLong(party.Leader.EntityId);

			packet.PutByte(party.IsOpen);
			packet.PutInt((int)party.Finish);
			packet.PutInt((int)party.ExpRule);

			packet.PutLong(0); // Quest id?

			packet.PutInt(party.MaxSize);
			packet.PutInt((int)party.Type);

			packet.PutString(party.DungeonLevel);
			packet.PutString(party.Info);

			packet.PutInt(party.MemberCount);

			packet.AddPartyMembers(party);
		}
Beispiel #6
0
		/// <summary>
		/// Adds party member data to the referenced packet.
		/// </summary>
		/// <param name="party"></param>
		/// <param name="packet"></param>
		public static void AddPartyMembers(this Packet packet, Party party)
		{
			var members = party.GetMembers();

			for (int i = members.Length - 1; i >= 0; i--)
			{
				packet.AddPartyMember(members[i]);

				packet.PutInt(i == 0 ? 3 : 1);

				// [200200, NA242 (2016-12-15)]
				{
					packet.PutByte(0);
					packet.PutShort(128);
					packet.PutInt(0);
					packet.PutInt(0);
					packet.PutInt(0);
				}

				packet.PutLong(0);
			}
			packet.PutByte(0);
		}
Beispiel #7
0
		/// <summary>
		/// Creates new party with creature as leader.
		/// </summary>
		/// <param name="creature"></param>
		public static Party Create(Creature creature, PartyType type, string name, string dungeonLevel, string info, string password, int maxSize)
		{
			var party = new Party();

			party.Id = ChannelServer.Instance.PartyManager.GetNextPartyId();

			party._members.Add(creature);
			party._occupiedSlots.Add(1, creature);
			party.Leader = creature;
			party.SetSettings(type, name, dungeonLevel, info, password, maxSize);

			creature.PartyPosition = 1;

			ChannelServer.Instance.Events.MinutesTimeTick += party.OnMinutesTimeTick;

			return party;
		}
Beispiel #8
0
		/// <summary>
		/// Updates clients on new party EXP distribution settings.
		/// </summary>
		/// <param name="party"></param>
		public static void PartyExpUpdate(Party party)
		{
			var packet = new Packet(Op.PartyExpUpdate, 0);

			packet.PutInt((int)party.ExpRule);

			party.Broadcast(packet, true);
		}
Beispiel #9
0
		/// <summary>
		/// Closes the party's Member Wanted window.
		/// </summary>
		/// <param name="party"></param>
		public static void PartyWantedClosed(Party party)
		{
			var packet = new Packet(Op.PartyWantedClosed, 0);

			party.Broadcast(packet, true);
		}
Beispiel #10
0
		/// <summary>
		/// Informs all members of a change in leadership.
		/// </summary>
		/// <param name="party"></param>
		public static void PartyChangeLeader(Party party)
		{
			var packet = new Packet(Op.PartyChangeLeaderUpdate, 0);

			packet.PutLong(party.Leader.EntityId);

			party.Broadcast(packet, true);
		}
Beispiel #11
0
		/// <summary>
		/// Updates members on changes to the party settings
		/// </summary>
		/// <remarks>
		/// Apparently they only get to know about name changes?
		/// </remarks>
		/// <param name="party"></param>
		public static void PartySettingUpdate(Party party)
		{
			var packet = new Packet(Op.PartySettingUpdate, 0);

			packet.PutString(party.Name);

			party.Broadcast(packet, true);
		}
Beispiel #12
0
		/// <summary>
		/// Updates remaining party members of a member who has left the party.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="party"></param>
		public static void PartyLeaveUpdate(Creature creature, Party party)
		{
			var packet = new Packet(Op.PartyLeaveUpdate, 0);

			packet.PutLong(creature.EntityId);

			party.Broadcast(packet, true);
		}
Beispiel #13
0
		/// <summary>
		/// I THINK this one is for actually updating the UI element of the party (with leader controls).
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="party"></param>
		public static void PartyWindowUpdate(Creature creature, Party party)
		{
			var packet = new Packet(Op.PartyWindowUpdate, 0);

			packet.PutLong(creature.EntityId);

			// TODO: Find out what these actually mean.
			packet.PutByte(1);
			packet.PutByte(1);
			packet.PutByte(0);
			packet.PutByte(0);

			party.Broadcast(packet, true);
		}
Beispiel #14
0
		/// <summary>
		/// Updates the party title with new information, such as a change in the total party members,
		/// name, type, etc.
		/// </summary>
		/// <param name="party"></param>
		public static void PartyMemberWantedRefresh(Party party)
		{
			var packet = new Packet(Op.PartyWantedUpdate, party.Leader.EntityId);

			packet.PutByte(party.IsOpen);
			packet.PutString(party.ToString());

			party.Leader.Region.Broadcast(packet, party.Leader);
		}
Beispiel #15
0
		/// <summary>
		/// Creates new dummy party for creature.
		/// </summary>
		/// <param name="creature"></param>
		public static Party CreateDummy(Creature creature)
		{
			var party = new Party();

			party._members.Add(creature);
			party._occupiedSlots.Add(1, creature);
			party.Leader = creature;

			creature.PartyPosition = 1;

			return party;
		}
Beispiel #16
0
		/// <summary>
		/// Broadcasts Chat on entire server, with a blue Party Chat,
		/// consisting of information about the party.
		/// </summary>
		/// <param name="party"></param>
		public static void PartyAdChat(Party party)
		{
			var packet = new Packet(Op.Chat, MabiId.Broadcast);
			packet.PutByte(0);
			packet.PutString("<PARTY>");
			packet.PutString("[Wanted] {0}: [{1}/{2}] - {3}", party.Leader.Name, party.Name, party.DungeonLevel, party.Info);
			packet.PutByte(1);
			packet.PutInt(-1);
			packet.PutInt(0);
			packet.PutByte(2);

			ChannelServer.Instance.World.Broadcast(packet);
		}
Beispiel #17
0
		/// <summary>
		/// Sends new finish rule setting to all clients in the party
		/// </summary>
		/// <param name="party"></param>
		public static void PartyFinishUpdate(Party party)
		{
			var packet = new Packet(Op.PartyFinishUpdate, 0);

			packet.PutInt((int)party.Finish);

			party.Broadcast(packet, true);
		}