Пример #1
0
        private static void EventSink_VirtueItemRequest(VirtueItemRequestEventArgs e)
        {
            if (e.Beholder != e.Beheld)
            {
                return;
            }

            e.Beholder.CloseGump(typeof(VirtueGump));

            if (e.Beholder.Kills >= 5)
            {
                e.Beholder.SendLocalizedMessage(1049609);                   // Murderers cannot invoke this virtue.
                return;
            }

            OnVirtueUsed callback = (OnVirtueUsed)m_Callbacks[e.GumpID];

            if (callback != null)
            {
                callback(e.Beholder);
            }
            else
            {
                e.Beholder.SendLocalizedMessage(1052066);                   // That virtue is not active yet.
            }
        }
Пример #2
0
 public static void InvokeVirtueItemRequest(VirtueItemRequestEventArgs e)
 {
     if (VirtueItemRequest != null)
     {
         VirtueItemRequest(e);
     }
 }
Пример #3
0
 public static void InvokeVirtueItemRequest(VirtueItemRequestEventArgs e)
 {
     if (EventSink.VirtueItemRequest != null)
     {
         EventSink.VirtueItemRequest.Invoke(e);
     }
 }
Пример #4
0
		private static void EventSink_VirtueItemRequest( VirtueItemRequestEventArgs e )
		{
			if ( e.Beholder != e.Beheld )
				return;

			e.Beholder.CloseGump( typeof( VirtueGump ) );

			if ( e.Beholder.Kills >= 5 )
			{
				e.Beholder.SendLocalizedMessage( 1049609 ); // Murderers cannot invoke this virtue.
				return;
			}

			OnVirtueUsed callback = (OnVirtueUsed)m_Callbacks[e.GumpID];

			if ( callback != null )
				callback( e.Beholder );
			else
				e.Beholder.SendLocalizedMessage( 1052066 ); // That virtue is not active yet.
		}
Пример #5
0
        private static void EventSink_VirtueItemRequest(VirtueItemRequestEventArgs e)
        {
            if (e.Beholder != e.Beheld)
            {
                return;
            }

            e.Beholder.CloseGump <VirtueGump>();

            if (e.Beholder.Kills >= 5)
            {
                e.Beholder.SendLocalizedMessage(1049609); // Murderers cannot invoke this virtue.
                return;
            }

            if (m_Callbacks.TryGetValue(e.GumpID, out OnVirtueUsed callback))
            {
                callback(e.Beholder);
            }
            else
            {
                e.Beholder.SendLocalizedMessage(1052066); // That virtue is not active yet.
            }
        }
Пример #6
0
 public static void InvokeVirtueItemRequest( VirtueItemRequestEventArgs e )
 {
     if ( VirtueItemRequest != null )
         VirtueItemRequest( e );
 }
Пример #7
0
 public static void InvokeVirtueItemRequest(VirtueItemRequestEventArgs e)
 {
     VirtueItemRequest?.Invoke(e);
 }
Пример #8
0
		public static void InvokeVirtueItemRequest(VirtueItemRequestEventArgs e)
		{
			if (VirtueItemRequest != null)
			{
				foreach (VirtueItemRequestEventHandler currentDelegate in VirtueItemRequest.GetInvocationList())
				{
					try
					{
						currentDelegate.Invoke(e);
					}
					catch (Exception ex)
					{
						// Log an exception
						EventSink.InvokeLogException(new LogExceptionEventArgs(ex));
					}
				}
			}
		}