Exemplo n.º 1
0
        public static void Steal(Mobile m, DialogNPC npc)
        {
            if (m.Backpack != null)
            {
                Gold g = m.Backpack.FindItemByType(typeof(Gold), true) as Gold;

                if (g != null)
                {
                    if (g.Amount > 200)
                    {
                        g.Amount -= 200;
                    }
                    else
                    {
                        g.Delete();
                    }

                    npc.SayTo(m, "You notice {0} steal some gold from you and laugh...", npc.Name);
                }
                else
                {
                    npc.SayTo(m, "*spits on your empty pockets*");
                }
            }
        }
Exemplo n.º 2
0
        public static void GiveLittle(Mobile m, DialogNPC npc)
        {
            if (m.Backpack != null)
            {
                Gold g = m.Backpack.FindItemByType(typeof(Gold), true) as Gold;

                if (g != null)
                {
                    if (g.Amount == 1)
                    {
                        g.Delete();
                    }
                    else
                    {
                        g.Amount -= 1;
                    }

                    npc.SayTo(m, "Thank ye, thank ye, M'lord");
                    npc.SayTo(m, "*bows*");
                }
                else
                {
                    npc.SayTo(m, "*spits on your empty pockets*");
                }
            }
        }
Exemplo n.º 3
0
        /**
         * Iniciar conversa.
         */
        public static void iniciarConversa(Mobile m, DialogNPC npc)
        {
            Jogador jogador = (Jogador)m;

            //jogaro já tem classe
            if(!jogador.getSistemaClasse().getClasse().idClasse().Equals(classe.Aldeao)) {
                npc.SayTo(jogador, "O seu caminho já foi escolhido. Não tenho nada para você no momento.");
            }
            else if(jogador.getSistemaAventura().completouAventura(IDAventura.cartaRecomendacao) &&
               jogador.getSistemaClasse().getClasse().idClasse().Equals(classe.Aldeao) &&
               m.Backpack.FindItemByType(typeof( CartaRecomendacaoItem ), true) == null) {

                npc.SayTo(jogador, "Tome mais cuidado com suas coisas. Aqui esta outra carta de recomendação.");
                CartaRecomendacaoItem cartaRec = new CartaRecomendacaoItem(jogador);
                jogador.AddToBackpack(cartaRec);
            }
            else if(jogador.getSistemaAventura().pegouAventura(IDAventura.cartaRecomendacao)) {
                //pedir o favor
                npc.RunSpeechGump( "7933cac2-3294-4cd9-98f6-7427a57b6ec2", jogador );
            }
            else {
                //falar para andar pela cidade a procura de um treinamento
                npc.RunSpeechGump( "92066456-80f4-43f6-a5f0-2510d894894b", jogador );
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Validates the types using for invoking functions
        /// </summary>
        public void ValidateTypes()
        {
            if (m_InvokeType == null || m_InvokeFunction == null)
            {
                m_Invoke = false;
                return;
            }

            m_Type = DialogNPC.FindType(m_InvokeType);
            if (m_Type == null)
            {
                m_Invoke = false;
                return;
            }

            m_Method = m_Type.GetMethod(m_InvokeFunction);

            if (m_Method == null || !m_Method.IsStatic)
            {
                m_Type   = null;
                m_Method = null;

                m_Invoke = false;
            }
        }
Exemplo n.º 5
0
        /**
         * Jogar entrando na academia de guerreiros.
         */
        public static void alistarAcademia(Mobile m, DialogNPC npc)
        {
            Jogador jogador = (Jogador)m;

            CartaRecomendacaoItem cartaRec = m.Backpack.FindItemByType(typeof( CartaRecomendacaoItem ), true) as CartaRecomendacaoItem;

            //fala sobre a carta
            if(cartaRec == null) {
                //falando sobre a carta
                npc.RunSpeechGump( "a7a1b0d8-563a-435d-b834-f60ccb43a770", m );
            }
            else if(cartaRec.Name.Equals("Carta de recomendação para " + m.Name)){

                cartaRec.Delete();

                if(jogador.getSistemaClasse().getClasse().idClasse().Equals(classe.Aldeao)) {
                    jogador.setClasse = classe.Escudeiro;

                    //boas vindas a academia
                    npc.RunSpeechGump( "da033fe2-c8a4-4f84-aab0-509485dfd495", m );
                }
                else {
                    npc.SayTo(jogador, "Você já escolheu o seu caminho.");
                }
            }
            else {
                npc.Say("Esta carta de recomendação não é para você.");
            }
        }
Exemplo n.º 6
0
 public static void TakeMoney(Mobile m, DialogNPC npc)
 {
     if (!Server.Mobiles.Banker.Withdraw(m, 500))
     {
         npc.SayTo(m, "Trying to cheat me of 500 gold huh? DIE!");
         m.Kill();
     }
 }
		public static void TakeMoney( Mobile m, DialogNPC npc )
		{
			if ( !Server.Mobiles.Banker.Withdraw( m, 500 ) )
			{
				npc.SayTo( m, "Trying to cheat me of 500 gold huh? DIE!" );
				m.Kill();
			}
		}
Exemplo n.º 8
0
 /// <summary>
 /// Performs the invoke specified by this method
 /// </summary>
 /// <param name="m">The mobile using the NPC</param>
 /// <param name="npc">The NPC object</param>
 public void PerformInvoke(Mobile m, DialogNPC npc)
 {
     try
     {
         m_Method.Invoke(null, new object[] { m, npc });
     }
     catch {}
 }
Exemplo n.º 9
0
        /// <summary>
        /// Verifies if the types for the player backpack and
        /// </summary>
        public void ValidateTypes()
        {
            Type t = null;

            // Item in backpack
            if (m_ReactToItemInBackpack && m_TypeBackpack != null)
            {
                t = ScriptCompiler.FindTypeByName(m_TypeBackpack, true);

                if (t == null)
                {
                    t = ScriptCompiler.FindTypeByFullName(m_TypeBackpack, true);
                }

                m_ItemType = t;

                if (t == null)                   // If the item doesn't exist, don't bother checking
                {
                    m_ReactToItemInBackpack = false;
                }
            }

            // Item given
            if (m_ReactToItemGiven && m_TypeGiven != null)
            {
                t = ScriptCompiler.FindTypeByName(m_TypeGiven, true);

                if (t == null)
                {
                    t = ScriptCompiler.FindTypeByFullName(m_TypeGiven, true);
                }

                m_ItemGivenType = t;

                if (t == null)
                {
                    m_ReactToItemGiven = false;
                }
            }

            // Function
            if (m_TriggerFunction)
            {
                t = DialogNPC.FindType(m_FunctionType);
                if (t == null)
                {
                    m_TriggerFunction = false;
                    return;
                }

                m_Method = t.GetMethod(m_FunctionName, new Type[] { typeof(DialogNPC), typeof(Mobile) });

                if (m_Method == null)
                {
                    m_TriggerFunction = false;
                }
            }
        }
Exemplo n.º 10
0
		public static bool CanReceiveRose( Mobile m, DialogNPC npc )
		{
			if ( ! m.Female )
			{
				npc.SayTo( m, "What do you want from? I don't like your kind!" );
				return false;
			}

			return ! m_Received.Contains( m );
		}
Exemplo n.º 11
0
        public static bool CanReceiveRose(Mobile m, DialogNPC npc)
        {
            if (!m.Female)
            {
                npc.SayTo(m, "What do you want from? I don't like your kind!");
                return(false);
            }

            return(!m_Received.Contains(m));
        }
Exemplo n.º 12
0
		public ConversationGump( Dialog dialog, DialogSpeech speech, ArrayList choices, DialogNPC npc, Mobile m ) : base( 100, 50 )
		{
			m_NPC = npc;
			m_Choices = choices;
			m_Dialog = dialog;
			m_Speech = speech;

			m.CloseGump( typeof( ConversationGump ) );

			MakeGump();
		}
Exemplo n.º 13
0
        public ConversationGump(Dialog dialog, DialogSpeech speech, ArrayList choices, DialogNPC npc, Mobile m) : base(100, 50)
        {
            m_NPC     = npc;
            m_Choices = choices;
            m_Dialog  = dialog;
            m_Speech  = speech;

            m.CloseGump(typeof(ConversationGump));

            MakeGump();
        }
		private FileSelectionGump( DialogNPC npc, Mobile m, string[] files, int page ) : base( 50, 50 )
		{
			m.CloseGump( typeof( FileSelectionGump ) );
			m_Files = files;
			m_Page = page;
			m_NPC = npc;

			if ( m_Files == null )
				m_Files = new string[ 0 ];

			MakeGump();
		}
Exemplo n.º 15
0
        /**
         * Concluir quest da carta de recomendação
         */
        public static void concluirQuestCartaRecomendacao(Mobile m, DialogNPC npc)
        {
            Jogador jogador = (Jogador)m;

            if(jogador.getSistemaAventura().pegouAventura(IDAventura.cartaRecomendacao)) {

                jogador.getSistemaAventura().finalizarAventura(IDAventura.cartaRecomendacao);

                CartaRecomendacaoItem cartaRec = new CartaRecomendacaoItem(jogador);
                jogador.AddToBackpack(cartaRec);
            }
        }
Exemplo n.º 16
0
        private FileSelectionGump(DialogNPC npc, Mobile m, string[] files, int page) : base(50, 50)
        {
            m.CloseGump(typeof(FileSelectionGump));
            m_Files = files;
            m_Page  = page;
            m_NPC   = npc;

            if (m_Files == null)
            {
                m_Files = new string[0];
            }

            MakeGump();
        }
Exemplo n.º 17
0
        /// <summary>
        /// Performs a custom trigger verification
        /// </summary>
        /// <param name="npc"></param>
        /// <param name="m"></param>
        /// <returns></returns>
        public bool DoFunctionTrigger(DialogNPC npc, Mobile m)
        {
            if (!m_TriggerFunction)
            {
                return(true);
            }

            try
            {
                bool result = (bool)m_Method.Invoke(null, new object[] { m, npc });
                return(result);
            }
            catch {}

            return(false);
        }
Exemplo n.º 18
0
        public static void GiveGilwiremarRewardTo(Mobile m, DialogNPC npc)
        {
            Item reward = new Server.Items.Gold(500);
            //rose.Hue = 37;
            //rose.Name = "Casanova's Rose";

            if (m.AddToBackpack(reward))
            {
                npc.SayTo(m, "Thank you.");
                m_Received.Add(m);
            }
            else
            {
                npc.SayTo(m, "I wish I could grant you a reward, but I don't think you could carry its weight...");
            }
        }
Exemplo n.º 19
0
		public static void GiveRoseTo( Mobile m, DialogNPC npc )
		{
			Item rose = new Server.Items.PottedPlant1();
			rose.Hue = 37;
			rose.Name = "Casanova's Rose";

			if ( m.AddToBackpack( rose ) )
			{
				npc.SayTo( m, "Thank you my dear... take this rose as a sign of my love for you..." );
				m_Received.Add( m );
			}
			else
			{
				npc.SayTo( m, "I wish I could grant you with a rose, but I don't think you could carry its weight..." );
			}
		}
Exemplo n.º 20
0
        public static void GiveRoseTo(Mobile m, DialogNPC npc)
        {
            Item rose = new Server.Items.PottedPlant1();

            rose.Hue  = 37;
            rose.Name = "Casanova's Rose";

            if (m.AddToBackpack(rose))
            {
                npc.SayTo(m, "Thank you my dear... take this rose as a sign of my love for you...");
                m_Received.Add(m);
            }
            else
            {
                npc.SayTo(m, "I wish I could grant you with a rose, but I don't think you could carry its weight...");
            }
        }
Exemplo n.º 21
0
        public static void GiveGilwiremarRewardTo(Mobile m, DialogNPC npc)
        {
            Item reward = new Server.Items.Gold(500);

            //rose.Hue = 37;
            //rose.Name = "Casanova's Rose";

            if (m.AddToBackpack(reward))
            {
                npc.SayTo(m, "Thank you.");
                m_Received.Add(m);
            }
            else
            {
                npc.SayTo(m, "I wish I could grant you a reward, but I don't think you could carry its weight...");
            }
        }
Exemplo n.º 22
0
		public static void GiveAll( Mobile m, DialogNPC npc )
		{
			if ( m.Backpack != null )
			{
				Gold g = m.Backpack.FindItemByType( typeof( Gold ), true ) as Gold;

				if ( g != null )
				{
					g.Delete();

					npc.SayTo( m, "Thank ye, thank ye, M'lord" );
					npc.SayTo( m, "*bows*" );
				}
				else
				{
					npc.SayTo( m, "*spits on your empty pockets*" );
				}
			}
		}
Exemplo n.º 23
0
        /**
         * Jogar pedindo para se alistar na academia de guerreiros.
         */
        public static void queroMeAlistar(Mobile m, DialogNPC npc)
        {
            Jogador jogador = (Jogador)m;
            CartaRecomendacaoItem cartaRec = m.Backpack.FindItemByType(typeof( CartaRecomendacaoItem ), true) as CartaRecomendacaoItem;

            //fala sobre a carta
            if(cartaRec == null) {

                if(!jogador.getSistemaAventura().pegouAventura(IDAventura.cartaRecomendacao)) {
                    jogador.getSistemaAventura().iniciarAventura(IDAventura.cartaRecomendacao);
                }

                //falando sobre a carta
                npc.RunSpeechGump( "a7a1b0d8-563a-435d-b834-f60ccb43a770", m );
            }
            else {
                //confirmação de alistamento
                npc.RunSpeechGump( "8e544309-53ef-419e-811b-24ecfb426a37", m );
            }
        }
Exemplo n.º 24
0
		public static void Steal( Mobile m, DialogNPC npc )
		{
			if ( m.Backpack != null )
			{
				Gold g = m.Backpack.FindItemByType( typeof( Gold ), true ) as Gold;

				if ( g != null )
				{
					if ( g.Amount > 200 )
						g.Amount -= 200;
					else
						g.Delete();

					npc.SayTo( m, "You notice {0} steal some gold from you and laugh...", npc.Name );
				}
				else
				{
					npc.SayTo( m, "*spits on your empty pockets*" );
				}
			}
		}
Exemplo n.º 25
0
 public FileSelectionGump(DialogNPC npc, Mobile m) : this(npc, m, DialogNPC.ConfigurationFiles, 0)
 {
 }
		public FileSelectionGump( DialogNPC npc, Mobile m ) : this( npc, m, DialogNPC.ConfigurationFiles, 0 )
		{
		}
Exemplo n.º 27
0
 public static void GoBritain(Mobile m, DialogNPC npc)
 {
     m.Location = new Point3D(1422, 1697, 0);
 }
Exemplo n.º 28
0
		public static void GoTrinsic( Mobile m, DialogNPC npc )
		{
			m.Location = new Point3D( 1820, 2822, 0 );
		}
Exemplo n.º 29
0
		/// <summary>
		/// Performs the invoke specified by this method
		/// </summary>
		/// <param name="m">The mobile using the NPC</param>
		/// <param name="npc">The NPC object</param>
		public void PerformInvoke( Mobile m, DialogNPC npc )
		{
			try
			{
				m_Method.Invoke( null, new object[] { m, npc } );
			}
			catch {}
		}
Exemplo n.º 30
0
		public static void GoBritain( Mobile m, DialogNPC npc )
		{

			m.Location = new Point3D( 1422, 1697, 0 );
		}
Exemplo n.º 31
0
 public static void GoTrinsic(Mobile m, DialogNPC npc)
 {
     m.Location = new Point3D(1820, 2822, 0);
 }
Exemplo n.º 32
0
		/// <summary>
		/// Performs a custom trigger verification
		/// </summary>
		/// <param name="npc"></param>
		/// <param name="m"></param>
		/// <returns></returns>
		public bool DoFunctionTrigger( DialogNPC npc, Mobile m )
		{
			if ( ! m_TriggerFunction )
				return true;

			try
			{
				bool result = (bool) m_Method.Invoke( null, new object[] { m, npc } );
				return result;
			}
			catch {}

			return false;
		}