Exemple #1
0
        public virtual void AwardRankTrophy(PlayerMobile pm, int rank)
        {
            switch (rank)
            {
                case 0:
                {
                    pm.SendMessage(54, "You took first place in the {0}.", Name);
                    pm.PublicOverheadMessage(MessageType.Label, 54, true, "FIRST PLACE!");

                    BankBox bank = pm.FindBank(Map.Expansion);

                    if (bank != null)
                    {
                        bank.DropItem(
                            new BattlesTrophy(Name + " - First Place", TrophyType.First)
                            {
                                Owner = pm
                            });

                        pm.SendMessage(54, "A trophy has been placed in your bankbox.");
                    }
                }
                    break;
                case 1:
                {
                    pm.SendMessage(54, "You took second place in the {0}.", Name);
                    pm.PublicOverheadMessage(MessageType.Label, 54, true, "SECOND PLACE!");

                    BankBox bank = pm.FindBank(Map.Expansion);

                    if (bank != null)
                    {
                        bank.DropItem(
                            new BattlesTrophy(Name + " - Second Place", TrophyType.Second)
                            {
                                Owner = pm
                            });

                        pm.SendMessage(54, "A trophy has been placed in your bankbox.");
                    }
                }
                    break;
                case 2:
                {
                    pm.SendMessage(54, "You took third place in the {0}.", Name);
                    pm.PublicOverheadMessage(MessageType.Label, 54, true, "THIRD PLACE!");

                    BankBox bank = pm.FindBank(Map.Expansion);

                    if (bank != null)
                    {
                        bank.DropItem(
                            new BattlesTrophy(Name + " - Third Place", TrophyType.Third)
                            {
                                Owner = pm
                            });

                        pm.SendMessage(54, "A trophy has been placed in your bankbox.");
                    }
                }
                    break;
            }
        }
		// Checks the conditions stored in the stone against the playermobile
		// passed it and reports publicly + with stone hue

		public void CheckConditions(PlayerMobile pm)
		{
			ArrayList FailurePoints = new ArrayList();
			RuleValidator rv = new RuleValidator( this );

			rv.Validate(pm, ref FailurePoints);

			if(FailurePoints.Count > 0)
			{
				// Tell them what + why
				pm.PublicOverheadMessage( Network.MessageType.Regular, 0, false, string.Format("You failed the test for {0} reason{1} :", FailurePoints.Count, FailurePoints.Count!=1 ? "s" : "") );

				foreach (string strFailure in FailurePoints)
					pm.PublicOverheadMessage( Network.MessageType.Regular, 0, false, strFailure );

				// Hue the rune invalid
				((AddonComponent) Components[0]).Hue = 137;
				new RehueTimer( pm, this ).Start();
			}
			else
			{
				pm.PublicOverheadMessage( Network.MessageType.Regular, 0, false, "You've passed the test!" );

				// Hue the rune valid
				((AddonComponent) Components[0]).Hue = 1000;
				new RehueTimer( pm, this ).Start();
			}
		}
Exemple #3
0
 private static bool HasCustomRace(PlayerMobile pm)
 {
     if (pm.HasCustomRace)
     {
         pm.PublicOverheadMessage(MessageType.Emote, 0x3b2, true, "I'm already a different race!");
         return true;
     }
     return false;
 }