private void InitHeader(Lineage root)
 {
     //if we're on the landing page don't do the animism info
     if (QueryHelper.SelectedLineageId == null)
         return;
     Page.Header.Title = MetaDataHelper.CreateTitle(root.Name, root.ParentLineageId.HasValue);
     Page.Header.Controls.Add(PageHelper.CreateDescriptionMetatag(root.FoundingText + root.Notes));
     Page.Header.Controls.Add(PageHelper.CreateKeywordsMetatag(root.Name, root.LineageGroupName));
 }
		private Int32 GetTypeMark(Lineage.UserCommand command)
		{
			switch (Type)
			{
				case Lineage.UserCommand.Loc: return 0x00;
				case Lineage.UserCommand.Unstuck: return 0x34;
				case Lineage.UserCommand.Mount: return 0x3d;
				case Lineage.UserCommand.Dismount: return 0x3e;
				case Lineage.UserCommand.Time: return 0x4d;
				case Lineage.UserCommand.PartyInfo: return 0x51;
				case Lineage.UserCommand.AttackList: return 0x58;
				case Lineage.UserCommand.EnemyList: return 0x59;
				case Lineage.UserCommand.WarList: return 0x5a;
				case Lineage.UserCommand.FriendList: return 0x60;
				case Lineage.UserCommand.ClanPenalty: return 0x64;
				default: throw new NotSupportedException();
			}
		}
Example #3
0
		public void QuestionReplyAsync(Lineage.Question question, Lineage.Answer answer)
		{
			GameServer.QuestionReply(question, answer);
		}
Example #4
0
		public void UseUserCommandAsync(Lineage.UserCommand command)
		{
			GameServer.UseUserCommand(command);
		}
Example #5
0
		public void UseSocialActionAsync(Lineage.SocialAction action)
		{
			GameServer.UseSocialAction(action);
		}
Example #6
0
		public void UseAction(Lineage.Action action, bool control = false, bool shift = false)
		{
			if (State == State.World) // ToDo and not is die
			{
				Network.Send(new Packet.Client.RequestActionUse()
				{
					Action = action,
					Control = control,
					Shift = shift
				});
			}
			else
				throw new Library.Exception.StateException();
		}
Example #7
0
		private void OnChatMessage(Lineage.Channel channel, string message, string name, Model.Creature author = null)
		{
			lock (Sync)
			{
				EventQueue.Enqueue(() =>
				{
					if (ChatMessage != null)
						ChatMessage(channel, message, name, author);
				});
				Wake(new Result.ChatMessage()
				{
					Channel = channel,
					Message = message,
					Name = name,
					Author = author,
				});
			}
		}
 private void OnAfterLineageBound(Lineage dataSource)
 {
     SetPanelMode(PanelModeEnum.LineageDisplay);
 }
		private void OnDie(Model.Creature creature, Lineage.ReturnPoint? points = null)
		{
			if (creature == Enemy)
			{
				State = StateType.NOTHING;
				var npc = Enemy as Model.Npc;
				if (npc != null && npc.IsSpoiled)
					Api.UseSkillAsync(Sweep, true);
			}
			else if (creature == Master)
			{
				Api.Cancel();
				Api.Logout();
			}
		}
Example #10
0
		public void SayAsync(string message, Lineage.Channel channel = Lineage.Channel.All)
		{
			GameServer.Say(message, channel);
		}
Example #11
0
 public void Add(DiscFileInfo Source, DiscFileInfo Destination, DiscFileInfo Base = null)
 {
     _queue[Destination] = new Lineage(Source, Base);
 }
Example #12
0
		public void Say(string message, string target, Lineage.Channel channel = Lineage.Channel.Tell) // Private message
		{
			if (State == State.World)
			{
				if (channel == Lineage.Channel.Tell)
					Network.Send(new Packet.Client.Say2()
					{
						Channel = channel,
						Message = message,
						Target = target
					});
				else if (channel == Lineage.Channel.Friend)
					Network.Send(new Packet.Client.RequestSendFriendMsg()
					{
						Name = target,
						Message = message
					});
				else
					throw new NotSupportedException();
			}
			else
				throw new Library.Exception.StateException();
		}
Example #13
0
		public void PartyInvite(string player, Lineage.PartyLoot loot)
		{
			if (State == State.World)
				Network.Send(new Packet.Client.RequestJoinParty()
				{
					Name = player,
					Loot = loot
				});
			else
				throw new Library.Exception.StateException();
		}
Example #14
0
		public void Say(string message, Lineage.Channel channel = Lineage.Channel.All) // Common message
		{
			if (State == State.World)
			{
				if (channel != Lineage.Channel.Tell)
				{
					Network.Send(new Packet.Client.Say2()
					{
						Channel = channel,
						Message = message
					});
				}
				else
					throw new NotSupportedException("Please use \"Say(name, target)\" method for private messages.");
			}
			else
				throw new Library.Exception.StateException();
		}
Example #15
0
		public void QuestionReply(Lineage.Question question, Lineage.Answer answer)
		{
			if (State == State.World)
				switch (question)
				{
					case Lineage.Question.JoinFriend:
						Network.Send(new Packet.Client.RequestAnswerFriendInvite()
						{
							Answer = answer
						});
						break;
					case Lineage.Question.JoinParty:
						Network.Send(new Packet.Client.RequestAnswerJoinParty()
						{
							Answer = answer
						});
						break;
					case Lineage.Question.JoinClan:
						Network.Send(new Packet.Client.RequestAnswerJoinPledge()
						{
							Answer = answer
						});
						break;
					case Lineage.Question.JoinAlly:
						Network.Send(new Packet.Client.RequestAnswerJoinAlly()
						{
							Answer = answer
						});
						break;
					case Lineage.Question.Resurrection:
						throw new NotSupportedException("C4 don't have ressurection question. Ressurect allowed only in party.");
						break;
				}
			else
				throw new Library.Exception.StateException();
		}
Example #16
0
		public void Return(Lineage.ReturnPoint point)
		{
			if (State == State.World) // Todo and player is died
				Network.Send(new Packet.Client.RequestReturnPoint()
				{
					Point = point
				});
			else
				throw new Library.Exception.StateException();
		}
Example #17
0
		public void UseUserCommand(Lineage.UserCommand action)
		{
			if (State == State.World)
				switch (action)
				{
					case Lineage.UserCommand.Loc:
					case Lineage.UserCommand.Unstuck:
					case Lineage.UserCommand.Mount:
					case Lineage.UserCommand.Dismount:
					case Lineage.UserCommand.Time:
					case Lineage.UserCommand.PartyInfo:
					case Lineage.UserCommand.AttackList:
					case Lineage.UserCommand.EnemyList:
					case Lineage.UserCommand.WarList:
					case Lineage.UserCommand.FriendList:
					case Lineage.UserCommand.ClanPenalty:
						Network.Send(new Packet.Client.RequestUserCommand()
						{
							Type = action
						});
						break;
					case Lineage.UserCommand.Sit:
					case Lineage.UserCommand.Stand:
						Network.Send(new Packet.Client.ChangeWaitType2()
						{
							State = action == Lineage.UserCommand.Sit ?
								Lineage.WaitType.Sit :
								Lineage.WaitType.Stand
						});
						break;
					case Lineage.UserCommand.Walk:
					case Lineage.UserCommand.Run:
						Network.Send(new Packet.Client.ChangeMoveType2()
						{
							State = action == Lineage.UserCommand.Walk ?
								Lineage.MoveType.Walk :
								Lineage.MoveType.Run
						});
						break;
					case Lineage.UserCommand.GmList:
						Network.Send(new Packet.Client.RequestGmList());
						break;
				}
			else
				throw new Library.Exception.StateException();
		}
Example #18
0
		public void UseSocialAction(Lineage.SocialAction action)
		{
			if (State == State.World)
				Network.Send(new Packet.Client.RequestSocialAction()
				{
					Type = action
				});
			else
				throw new Library.Exception.StateException();
		}
Example #19
0
 public LineageEventArgs(Lineage lineage)
 {
     Lineage = lineage;
 }
Example #20
0
		// Todo: OnCreatureInfo => Memory.AddNpc|AddPlayer
		
		private void OnChatMessage(Lineage.Channel channel, string message, string from, Model.Creature author)
		{
			// Todo: Speech
		}
 private void Create(Lineage parentLineage)
 {
     var newLin = Lineage.NewLineage(parentLineage.Id, parentLineage.StartYear);
     DataSource = newLin;
     LineageGroupComboBox.SelectedValue = DataSource.LineageGroupId.HasValue
                      ? (object)DataSource.LineageGroupId.Value
                      : null;
     SetPanelMode(PanelModeEnum.LineageEditing);
 }
Example #22
0
		private void OnDie(Model.Creature creature, Lineage.ReturnPoint? points = null)
		{
			lock (Sync)
			{
				EventQueue.Enqueue(() =>
				{
					if (Die != null)
						Die(creature, points);
				});
				Wake(new Result.Die()
				{
					Creature = creature,
					Points = points
				});
			}
		}
		private void OnQuestionAsked(Lineage.Question question, string name, string value = null)
		{
			if (Master != null && Master.Name == name)
				Api.QuestionReplyAsync(question, Lineage.Answer.Yes);
		}
Example #24
0
		private void OnQuestionAsked(Lineage.Question question, string name, string value = null)
		{
			lock (Sync)
			{
				EventQueue.Enqueue(() =>
				{
					if (QuestionAsked != null)
						QuestionAsked(question, name, value);
				});
				Wake(new Result.QuestionAsked()
				{
					Question = question,
					Name = name,
					Value = value,
				});
			}
		}
		private void OnChatMessage(Lineage.Channel channel, string message, string name, Model.Creature author = null)
		{
			Console.WriteLine(string.Format("[{0}] {1}: {2}", channel, name, message));

			if (message == "Serve!" && author is Model.Character)
			{
				Api.Target(Master = author as Model.Character);
				Api.UseSocialActionAsync(Lineage.SocialAction.Bow);
			}
			else if (message == "Leave!" && author == Master)
			{
				Master = null;
				Api.UseSocialActionAsync(Lineage.SocialAction.Dance);
			}
			else if (Master != null && Master.Name == name && message.Trim().EndsWith("!"))
				switch (message.Trim().TrimEnd('!').ToLower())
				{
					case "attack":
						Attack();
					break;
					case "return":
						Return();
					break;
					case "rest":
						Rest();
					break;
					case "quit":
						Api.Logout();
					break;
				}
		}
Example #26
0
		public bool AllowMutation(Lineage other) {
#if NO_MUTATION
			return false;
#endif
			return !_neverMutate && this == other;
		}