예제 #1
0
파일: Song.cs 프로젝트: elmairy/aura
        /// <summary>
        /// Called when completing (training).
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="skill"></param>
        /// <param name="quality"></param>
        protected override void AfterPlay(Creature creature, Skill skill, PlayingQuality quality)
        {
            // All ranks above F have the same 3 first conditions.
            if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.R1)
            {
                if (quality >= PlayingQuality.Bad)
                {
                    skill.Train(1);                     // Use the skill successfully.
                }
                if (quality == PlayingQuality.Good)
                {
                    skill.Train(2);                     // Give an excellent vocal performance.
                }
                if (quality == PlayingQuality.VeryGood)
                {
                    skill.Train(3);                     // Give a heavenly performance.
                }
                // Very bad training possible till E.
                if (skill.Info.Rank <= SkillRank.RE && quality == PlayingQuality.VeryBad)
                {
                    skill.Train(4);                     // Fail at using the skill.
                }
            }

            // TODO: "Use the skill to grow crops faster."
            // TODO: "Grant a buff to a party member."
        }
예제 #2
0
 /// <summary>
 /// Called when starting playing (training).
 /// </summary>
 /// <param name="creature"></param>
 /// <param name="skill"></param>
 /// <param name="quality"></param>
 protected virtual void OnPlay(Creature creature, Skill skill, PlayingQuality quality)
 {
     if (skill.Info.Rank == SkillRank.Novice)
     {
         skill.Train(1);                 // Try the skill.
     }
 }
예제 #3
0
        /// <summary>
        /// Broadcasts Effect in range of creature.
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="instrument"></param>
        /// <param name="quality"></param>
        /// <param name="compressedMML"></param>
        /// <param name="rndScore"></param>
        public static void PlayEffect(Creature creature, InstrumentType instrument, PlayingQuality quality, string compressedMML, int rndScore)
        {
            var packet = new Packet(Op.Effect, creature.EntityId);

            packet.PutInt(E.PlayMusic);
            packet.PutByte(compressedMML != null);             // has scroll
            if (compressedMML != null)
            {
                packet.PutString(compressedMML);
            }
            else
            {
                packet.PutInt(rndScore);
            }
            packet.PutInt(0);
            packet.PutShort(0);
            packet.PutInt(14113);             // ?
            packet.PutByte((byte)quality);
            packet.PutByte((byte)instrument);
            packet.PutByte(0);
            packet.PutByte(0);
            packet.PutByte(1);             // loops

            // Singing?
            //packet.PutByte(0);
            //packet.PutByte(1);

            creature.Region.Broadcast(packet, creature);
        }
예제 #4
0
        /// <summary>
        /// Called when completing (training).
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="skill"></param>
        /// <param name="quality"></param>
        protected virtual void AfterPlay(Creature creature, Skill skill, PlayingQuality quality)
        {
            // Success unless total failure, condition 2 for Novice.
            if (skill.Info.Rank == SkillRank.Novice && quality != PlayingQuality.VeryBad)
            {
                skill.Train(2);                 // Use the skill successfully.
            }
            // All ranks above F have the same 2 first conditions.
            if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.R1)
            {
                if (quality >= PlayingQuality.Bad)
                {
                    skill.Train(1);                     // Use the skill successfully.
                }
                if (quality == PlayingQuality.VeryGood)
                {
                    skill.Train(2);                     // Get a very good result.
                }
            }

            // Training by failing is possible between F and 6.
            if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.R6 && quality == PlayingQuality.Bad)
            {
                skill.Train(3);                 // Fail at using the skill.
            }
            // Training by failing badly is possible at F and E.
            if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.RE && quality == PlayingQuality.VeryBad)
            {
                skill.Train(4);                 // Get a horrible result.
            }
            // TODO: "Use the skill successfully to grow crops faster."
            // TODO: "Use a music buff skill."
        }
예제 #5
0
파일: Song.cs 프로젝트: elmairy/aura
        /// <summary>
        /// Called when starting playing (training).
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="skill"></param>
        /// <param name="quality"></param>
        protected override void OnPlay(Creature creature, Skill skill, PlayingQuality quality)
        {
            Send.Effect(creature, 356, (byte)1);

            if (skill.Info.Rank == SkillRank.Novice)
            {
                skill.Train(1);                 // Use the skill.
            }
        }
예제 #6
0
        /// <summary>
        /// Returns a random result message for the given quality.
        /// </summary>
        /// <remarks>
        /// Reference: http://wiki.mabinogiworld.com/view/Playing_Instrument
        /// </remarks>
        /// <param name="quality"></param>
        /// <returns></returns>
        protected virtual string GetRandomQualityMessage(PlayingQuality quality)
        {
            string[] msgs = null;
            switch (quality)
            {
            case PlayingQuality.VeryGood:
                msgs = new string[] {
                    Localization.Get("Your song came from the heavens!"),
                    Localization.Get("That was a perfect song"),
                };
                break;

            case PlayingQuality.Good:
                msgs = new string[] {
                    Localization.Get("You gave a great performance"),
                    Localization.Get("The performance was quite alright"),
                    Localization.Get("Not a bad performance"),
                    Localization.Get("I'm slowly gaining confidence in playing instruments."),
                };
                break;

            case PlayingQuality.Bad:
                msgs = new string[] {
                    Localization.Get("Lots of mistakes, although most didn't notice"),
                    Localization.Get("An embarrassing performance"),
                    Localization.Get("The song is still too difficult for me."),
                    Localization.Get("You'll need to practice hard to master this song."),
                };
                break;

            case PlayingQuality.VeryBad:
                msgs = new string[] {
                    Localization.Get("A disastrous performance"),
                    Localization.Get("That was a total mess..."),
                    Localization.Get("That was a difficult song for me to play."),
                };
                break;
            }

            if (msgs == null || msgs.Length < 1)
            {
                return("...");
            }

            return(msgs[RandomProvider.Get().Next(0, msgs.Length)].Trim());
        }
예제 #7
0
파일: Song.cs 프로젝트: anjhony6778/aura
        /// <summary>
        /// Returns random success message.
        /// </summary>
        /// <remarks>
        /// Reference: http://wiki.mabinogiworld.com/view/Song
        /// </remarks>
        /// <param name="quality"></param>
        /// <returns></returns>
        protected override string GetRandomQualityMessage(PlayingQuality quality)
        {
            string[] msgs = null;
            switch (quality)
            {
            case PlayingQuality.VeryGood:
                msgs = new string[] {
                    Localization.Get("Your song was heavenly."),
                    Localization.Get("That was a perfect song."),
                };
                break;

            case PlayingQuality.Good:
                msgs = new string[] {
                    Localization.Get("You did a fine job."),
                    Localization.Get("That really boosted your confidence."),
                    Localization.Get("You gave a great performance."),
                };
                break;

            case PlayingQuality.Bad:
            case PlayingQuality.VeryBad:
                msgs = new string[] {
                    Localization.Get("This song was too difficult for you to sing."),
                    Localization.Get("That was too difficult for you to sing."),
                    Localization.Get("This song is still difficult for you to sing"),
                    Localization.Get("You need to work harder to sing this song."),
                    Localization.Get("That was horrible."),
                    Localization.Get("Not only was the song you chose horrible, but you also sang it terribly."),
                    Localization.Get("You should apologize for that performance."),
                    Localization.Get("That was an easy song and you still butchered it."),
                    Localization.Get("Did anyone notice how much you messed up?"),
                    Localization.Get("You should feel ashamed of your performance."),
                    Localization.Get("You sang it well, but you won't improve if you keep singing such easy songs."),
                };
                break;
            }

            if (msgs == null || msgs.Length < 1)
            {
                return("...");
            }

            return(msgs[RandomProvider.Get().Next(0, msgs.Length)].Trim());
        }
예제 #8
0
        /// <summary>
        /// Returns a random result message for the given quality.
        /// </summary>
        /// <param name="quality"></param>
        /// <returns></returns>
        protected virtual string GetRandomQualityMessage(PlayingQuality quality)
        {
            string[] msgs = null;
            switch (quality)
            {
            case PlayingQuality.VeryGood:
                msgs = new string[] {
                    Localization.Get("It seemed as if the God of Music had descended"),
                    Localization.Get("A perfect performance"),
                };
                break;

            case PlayingQuality.Good:
                msgs = new string[] {
                    Localization.Get("The performance was quite alright"),
                    Localization.Get("Not a bad performance"),
                    Localization.Get("I'm slowly gaining confidence in playing instruments."),
                };
                break;

            case PlayingQuality.Bad:
                msgs = new string[] {
                    Localization.Get("Lots of mistakes, although most didn't notice"),
                    Localization.Get("An embarrassing performance"),
                    Localization.Get("The song is still too difficult for me."),
                    Localization.Get("I need more practice to play this song well."),
                };
                break;

            case PlayingQuality.VeryBad:
                msgs = new string[] {
                    Localization.Get("A disastrous performance"),
                    Localization.Get("That was a total mess..."),
                    Localization.Get("That was a difficult song for me to play."),
                };
                break;
            }

            if (msgs == null || msgs.Length < 1)
            {
                return("...");
            }

            return(msgs[RandomProvider.Get().Next(0, msgs.Length)].Trim());
        }
예제 #9
0
        /// <summary>
        /// Called when completing (training).
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="skill"></param>
        /// <param name="quality"></param>
        protected override void AfterPlay(Creature creature, Skill skill, PlayingQuality quality)
        {
            // All ranks above F have the same 3 first conditions.
            if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.R1)
            {
                if (quality >= PlayingQuality.Bad)
                    skill.Train(1); // Use the skill successfully.

                if (quality == PlayingQuality.Good)
                    skill.Train(2); // Give an excellent vocal performance.

                if (quality == PlayingQuality.VeryGood)
                    skill.Train(3); // Give a heavenly performance.

                // Very bad training possible till E.
                if (skill.Info.Rank <= SkillRank.RE && quality == PlayingQuality.VeryBad)
                    skill.Train(4); // Fail at using the skill.
            }

            // TODO: "Use the skill to grow crops faster."
            // TODO: "Grant a buff to a party member."
        }
예제 #10
0
파일: Song.cs 프로젝트: elmairy/aura
        /// <summary>
        /// Returns random success message.
        /// </summary>
        /// <param name="quality"></param>
        /// <returns></returns>
        protected override string GetRandomQualityMessage(PlayingQuality quality)
        {
            string[] msgs = null;
            switch (quality)
            {
            case PlayingQuality.VeryGood:
                msgs = new string[] {
                    Localization.Get("It seemed as if the God of Music had descended"),
                    Localization.Get("A perfect performance"),
                };
                break;

            case PlayingQuality.Good:
                msgs = new string[] {
                    Localization.Get("The performance was quite alright"),
                    Localization.Get("Not a bad performance"),
                    Localization.Get("I'm slowly gaining confidence in playing instruments."),
                };
                break;

            case PlayingQuality.Bad:
            case PlayingQuality.VeryBad:
                msgs = new string[] {
                    Localization.Get("A disastrous performance"),
                    Localization.Get("That was a total mess..."),
                    Localization.Get("That was a difficult song for me to play."),
                };
                break;
            }

            if (msgs == null || msgs.Length < 1)
            {
                return("...");
            }

            return(msgs[RandomProvider.Get().Next(0, msgs.Length)].Trim());
        }
예제 #11
0
        /// <summary>
        /// Broadcasts Effect in range of creature.
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="instrument"></param>
        /// <param name="quality"></param>
        /// <param name="compressedMML"></param>
        /// <param name="rndScore"></param>
        public static void PlayEffect(Creature creature, InstrumentType instrument, PlayingQuality quality, string compressedMML, int rndScore)
        {
            var packet = new Packet(Op.Effect, creature.EntityId);
            packet.PutInt(E.PlayMusic);
            packet.PutByte(compressedMML != null); // has scroll
            if (compressedMML != null)
                packet.PutString(compressedMML);
            else
                packet.PutInt(rndScore);
            packet.PutInt(0);
            packet.PutShort(0);
            packet.PutInt(14113); // ?
            packet.PutByte((byte)quality);
            packet.PutByte((byte)instrument);
            packet.PutByte(0);
            packet.PutByte(0);
            packet.PutByte(1); // loops

            // Singing?
            //packet.PutByte(0);
            //packet.PutByte(1);

            creature.Region.Broadcast(packet, creature);
        }
예제 #12
0
파일: Song.cs 프로젝트: tkiapril/aura
		/// <summary>
		/// Returns random success message.
		/// </summary>
		/// <remarks>
		/// Reference: http://wiki.mabinogiworld.com/view/Song
		/// </remarks>
		/// <param name="quality"></param>
		/// <returns></returns>
		protected override string GetRandomQualityMessage(PlayingQuality quality)
		{
			string[] msgs = null;
			switch (quality)
			{
				case PlayingQuality.VeryGood:
					msgs = new string[] {
						Localization.Get("Your song was heavenly."),
						Localization.Get("That was a perfect song."),
					};
					break;
				case PlayingQuality.Good:
					msgs = new string[] {
						Localization.Get("You did a fine job."),
						Localization.Get("That really boosted your confidence."),
						Localization.Get("You gave a great performance."),
					};
					break;
				case PlayingQuality.Bad:
				case PlayingQuality.VeryBad:
					msgs = new string[] {
						Localization.Get("This song was too difficult for you to sing."),
						Localization.Get("That was too difficult for you to sing."),
						Localization.Get("This song is still difficult for you to sing"),
						Localization.Get("You need to work harder to sing this song."),
						Localization.Get("That was horrible."),
						Localization.Get("Not only was the song you chose horrible, but you also sang it terribly."),
						Localization.Get("You should apologize for that performance."),
						Localization.Get("That was an easy song and you still butchered it."),
						Localization.Get("Did anyone notice how much you messed up?"),
						Localization.Get("You should feel ashamed of your performance."),
						Localization.Get("You sang it well, but you won't improve if you keep singing such easy songs."),
					};
					break;
			}

			if (msgs == null || msgs.Length < 1)
				return "...";

			return msgs[RandomProvider.Get().Next(0, msgs.Length)].Trim();
		}
예제 #13
0
파일: Song.cs 프로젝트: xKamuna/aura
		/// <summary>
		/// Returns random success message.
		/// </summary>
		/// <param name="quality"></param>
		/// <returns></returns>
		protected override string GetRandomQualityMessage(PlayingQuality quality)
		{
			string[] msgs = null;
			switch (quality)
			{
				case PlayingQuality.VeryGood:
					msgs = new string[] {
						Localization.Get("It seemed as if the God of Music had descended"),
						Localization.Get("A perfect performance"),
					};
					break;
				case PlayingQuality.Good:
					msgs = new string[] {
						Localization.Get("The performance was quite alright"),
						Localization.Get("Not a bad performance"),
						Localization.Get("I'm slowly gaining confidence in playing instruments."),
					};
					break;
				case PlayingQuality.Bad:
				case PlayingQuality.VeryBad:
					msgs = new string[] {
						Localization.Get("A disastrous performance"),
						Localization.Get("That was a total mess..."),
						Localization.Get("That was a difficult song for me to play."),
					};
					break;
			}

			if (msgs == null || msgs.Length < 1)
				return "...";

			return msgs[RandomProvider.Get().Next(0, msgs.Length)].Trim();
		}
예제 #14
0
 /// <summary>
 /// Playing instrument effect (sound and motion) for creature,
 /// based on the given score id (client:score.xml).
 /// </summary>
 /// <param name="creature"></param>
 /// <param name="instrument"></param>
 /// <param name="quality"></param>
 /// <param name="score"></param>
 /// <returns></returns>
 public static MabiPacket PlayEffect(MabiCreature creature, InstrumentType instrument, PlayingQuality quality, uint score)
 {
     var p = new MabiPacket(Op.Effect, creature.Id);
     p.PutInt(Effect.PlayMusic);
     p.PutByte(false);
     p.PutInt(score);
     p.PutInt(0);
     p.PutShort(0);
     p.PutInt(14113);
     p.PutByte((byte)quality);
     p.PutByte((byte)instrument);
     p.PutByte(0);
     p.PutByte(0);
     p.PutByte(1);
     return p;
 }
예제 #15
0
 /// <summary>
 /// Playing instrument effect (sound and motion) for creature,
 /// based on the given MML code.
 /// </summary>
 /// <param name="creature"></param>
 /// <param name="instrument"></param>
 /// <param name="quality"></param>
 /// <param name="compressedMML"></param>
 /// <returns></returns>
 public static MabiPacket PlayEffect(MabiCreature creature, InstrumentType instrument, PlayingQuality quality, string compressedMML)
 {
     var p = new MabiPacket(Op.Effect, creature.Id);
     p.PutInt(Effect.PlayMusic);
     p.PutByte(true); // has scroll
     p.PutString(compressedMML);
     p.PutInt(0);
     p.PutShort(0);
     p.PutInt(14113); // ?
     p.PutByte((byte)quality);
     p.PutByte((byte)instrument);
     p.PutByte(0);
     p.PutByte(0);
     p.PutByte(1); // loops
     return p;
 }
예제 #16
0
		/// <summary>
		/// Called when completing (training).
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="quality"></param>
		protected virtual void AfterPlay(Creature creature, Skill skill, PlayingQuality quality)
		{
			// Success unless total failure, condition 2 for Novice.
			if (skill.Info.Rank == SkillRank.Novice && quality != PlayingQuality.VeryBad)
				skill.Train(2); // Use the skill successfully.

			// All ranks above F have the same 2 first conditions.
			if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.R1)
			{
				if (quality >= PlayingQuality.Bad)
					skill.Train(1); // Use the skill successfully.

				if (quality == PlayingQuality.VeryGood)
					skill.Train(2); // Get a very good result.
			}

			// Training by failing is possible between F and 6.
			if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.R6 && quality == PlayingQuality.Bad)
				skill.Train(3); // Fail at using the skill.

			// Training by failing badly is possible at F and E.
			if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.RE && quality == PlayingQuality.VeryBad)
				skill.Train(4); // Get a horrible result.

			// TODO: "Use the skill successfully to grow crops faster."
			// TODO: "Use a music buff skill."
		}
예제 #17
0
		/// <summary>
		/// Called when starting playing (training).
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="quality"></param>
		protected virtual void OnPlay(Creature creature, Skill skill, PlayingQuality quality)
		{
			if (skill.Info.Rank == SkillRank.Novice)
				skill.Train(1); // Try the skill.
		}
예제 #18
0
		/// <summary>
		/// Returns a random result message for the given quality.
		/// </summary>
		/// <param name="quality"></param>
		/// <returns></returns>
		protected virtual string GetRandomQualityMessage(PlayingQuality quality)
		{
			string[] msgs = null;
			switch (quality)
			{
				case PlayingQuality.VeryGood:
					msgs = new string[] {
						Localization.Get("It seemed as if the God of Music had descended"),
						Localization.Get("A perfect performance"),
					};
					break;
				case PlayingQuality.Good:
					msgs = new string[] {
						Localization.Get("The performance was quite alright"),
						Localization.Get("Not a bad performance"),
						Localization.Get("I'm slowly gaining confidence in playing instruments."),
					};
					break;
				case PlayingQuality.Bad:
					msgs = new string[] {
						Localization.Get("Lots of mistakes, although most didn't notice"),
						Localization.Get("An embarrassing performance"),
						Localization.Get("The song is still too difficult for me."),
						Localization.Get("I need more practice to play this song well."),
					};
					break;
				case PlayingQuality.VeryBad:
					msgs = new string[] {
						Localization.Get("A disastrous performance"),
						Localization.Get("That was a total mess..."),
						Localization.Get("That was a difficult song for me to play."),
					};
					break;
			}

			if (msgs == null || msgs.Length < 1)
				return "...";

			return msgs[RandomProvider.Get().Next(0, msgs.Length)].Trim();
		}
예제 #19
0
		/// <summary>
		/// Returns a random result message for the given quality.
		/// </summary>
		/// <remarks>
		/// Reference: http://wiki.mabinogiworld.com/view/Playing_Instrument
		/// </remarks>
		/// <param name="quality"></param>
		/// <returns></returns>
		protected virtual string GetRandomQualityMessage(PlayingQuality quality)
		{
			string[] msgs = null;
			switch (quality)
			{
				case PlayingQuality.VeryGood:
					msgs = new string[] {
						Localization.Get("Your song came from the heavens!"),
						Localization.Get("That was a perfect song"),
					};
					break;
				case PlayingQuality.Good:
					msgs = new string[] {
						Localization.Get("You gave a great performance"),
						Localization.Get("The performance was quite alright"),
						Localization.Get("Not a bad performance"),
						Localization.Get("I'm slowly gaining confidence in playing instruments."),
					};
					break;
				case PlayingQuality.Bad:
					msgs = new string[] {
						Localization.Get("Lots of mistakes, although most didn't notice"),
						Localization.Get("An embarrassing performance"),
						Localization.Get("The song is still too difficult for me."),
						Localization.Get("You'll need to practice hard to master this song."),
					};
					break;
				case PlayingQuality.VeryBad:
					msgs = new string[] {
						Localization.Get("A disastrous performance"),
						Localization.Get("That was a total mess..."),
						Localization.Get("That was a difficult song for me to play."),
					};
					break;
			}

			if (msgs == null || msgs.Length < 1)
				return "...";

			return msgs[RandomProvider.Get().Next(0, msgs.Length)].Trim();
		}
예제 #20
0
파일: Song.cs 프로젝트: tkiapril/aura
		/// <summary>
		/// Called when starting playing (training).
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="quality"></param>
		protected override void OnPlay(Creature creature, Skill skill, PlayingQuality quality)
		{
			Send.Effect(creature, 356, (byte)1);

			if (skill.Info.Rank == SkillRank.Novice)
				skill.Train(1); // Use the skill.
		}
예제 #21
0
        /// <summary>
        /// Returns a random result message for the given quality.
        /// </summary>
        /// <param name="quality"></param>
        /// <returns></returns>
        private string GetRandomComplete(PlayingQuality quality)
        {
            string[] msgs = null;
            switch (quality)
            {
                // Messages are stored in one line per quality, seperated by semicolons.
                case PlayingQuality.VeryGood: msgs = Localization.Get("skills.quality_verygood").Split(';'); break;
                case PlayingQuality.Good: msgs = Localization.Get("skills.quality_good").Split(';'); break;
                case PlayingQuality.Bad: msgs = Localization.Get("skills.quality_bad").Split(';'); break;
                case PlayingQuality.VeryBad: msgs = Localization.Get("skills.quality_verybad").Split(';'); break;
            }

            if (msgs.Length < 1)
                return "...";

            return msgs[RandomProvider.Get().Next(0, msgs.Length)].Trim();
        }