Beispiel #1
0
		private void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
		{
			try
			{
				if (mLoggedIn && e.Change == WorldChangeType.IdentReceived
						&& e.Changed.ObjectClass == ObjectClass.Portal)
				{
					if (mIdPrimaryTie == IdStep.Requested)
					{
						ProcessPortalTie(e.Changed, RouteStartType.PrimaryPortalTie);
						mIdPrimaryTie = IdStep.Idle;
					}
					if (mIdSecondaryTie == IdStep.Requested)
					{
						ProcessPortalTie(e.Changed, RouteStartType.SecondaryPortalTie);
						mIdSecondaryTie = IdStep.Idle;
					}
				}
			}
			catch (Exception ex) { Util.HandleException(ex); }
		}
Beispiel #2
0
		private void RecallTimeout_Tick(object sender, EventArgs e)
		{
			try
			{
				mRecallTimeout.Stop();
				mRecallingToBindstone = RecallStep.NotRecalling;
				mRecallingToLSBind = RecallStep.NotRecalling;
				mRecallingToLSTie = RecallStep.NotRecalling;
				mRecallingToPrimaryPortal = RecallStep.NotRecalling;
				mRecallingToSecondaryPortal = RecallStep.NotRecalling;

				mIdPrimaryTie = IdStep.Idle;
				mIdSecondaryTie = IdStep.Idle;
			}
			catch (Exception ex) { Util.HandleException(ex); }
		}
Beispiel #3
0
		private void RecallChatTextHandler(object sender, ChatTextInterceptEventArgs e)
		{
			try
			{
				if (chkAutoUpdateRecalls.Checked)
				{
					string text = e.Text.Trim();

					// Spell Casting
					if (e.Color == 7)
					{
						if (text == "You successfully link with the portal!" || text == "You successfully link with the lifestone!")
						{
							WorldObject spellTarget = Core.WorldFilter[mLastSpellTarget];
							if (spellTarget != null)
							{
								if (mLastSpellId == Spells.PrimaryPortalTie)
								{
									if (spellTarget.HasIdData)
									{
										ProcessPortalTie(spellTarget, RouteStartType.PrimaryPortalTie);
									}
									else
									{
										Host.Actions.RequestId(mLastSpellTarget);
										mIdPrimaryTie = IdStep.Requested;
										if (mRecallTimeout.Enabled)
											RecallTimeout_Tick(null, null);
										mRecallTimeout.Interval = 10000; // 10 seconds
										mRecallTimeout.Start();
									}
								}
								else if (mLastSpellId == Spells.SecondaryPortalTie)
								{
									if (spellTarget.HasIdData)
									{
										ProcessPortalTie(spellTarget, RouteStartType.SecondaryPortalTie);
									}
									else
									{
										Host.Actions.RequestId(mLastSpellTarget);
										mIdSecondaryTie = IdStep.Requested;
										if (mRecallTimeout.Enabled)
											RecallTimeout_Tick(null, null);
										mRecallTimeout.Interval = 10000; // 10 seconds
										mRecallTimeout.Start();
									}
								}
								else if (mLastSpellId == Spells.LifestoneTie)
								{
									UpdateStartLocation(spellTarget, RouteStartType.LifestoneTie);
								}
							}
						}
						else if (e.Text.StartsWith("You have attuned your spirit to this Lifestone."))
						{
							WorldObject lifestone = Core.WorldFilter[Host.Actions.CurrentSelection];
							Coordinates coords;
							RouteStart startLoc = GetStartLocationByType(RouteStartType.LifestoneBind);
							if (lifestone == null || lifestone.ObjectClass != ObjectClass.Lifestone)
							{
								coords = PlayerCoords;
							}
							else
							{
								coords = new Coordinates(lifestone.Coordinates(), 1);
							}
							if (startLoc.Coords != coords)
							{
								startLoc.Coords = coords;
								RefreshStartLocationListCoords();
								if (startLoc.Enabled)
									Util.Message(startLoc.Name + " start location set to " + startLoc.Coords);
							}
						}
					}

					// Recall Text
					else if (e.Color == 23)
					{
						string name = Core.CharacterFilter.Name;
						if (text == name + " is going to the Allegiance hometown.")
						{
							mRecallingToBindstone = RecallStep.RecallStarted;
							if (mRecallTimeout.Enabled)
								RecallTimeout_Tick(null, null);
							mRecallTimeout.Interval = 40000; // 40 seconds
							mRecallTimeout.Start();
						}
						else if (text == name + " is recalling to the lifestone.")
						{
							mRecallingToLSBind = RecallStep.RecallStarted;
							if (mRecallTimeout.Enabled)
								RecallTimeout_Tick(null, null);
							mRecallTimeout.Interval = 40000; // 40 seconds
							mRecallTimeout.Start();
						}
					}
				}
			}
			catch (Exception ex) { Util.HandleException(ex); }
		}