Beispiel #1
0
        public void GiveReward(Character character)
        {
            // Wrong gender
            if (character.Gender != Gender && Gender != GenderType.Neutral)
                return;

            if (character.FactionGroup == FactionGroup.Alliance && AllianceTitle != 0)
            {
                character.SetTitle(AllianceTitle,false);
            }
            else if (character.FactionGroup == FactionGroup.Horde && HordeTitle != 0)
            {
                character.SetTitle(HordeTitle, false);
            }

            if (Item != 0)
            {
				var mailMessage = new MailMessage(Subjects.Localize(character.Locale), Bodies.Localize(character.Locale))
            	                  	{
            	                  		ReceiverId = character.EntityId.Low,
            	                  		DeliveryTime = DateTime.Now,
            	                  		SendTime = DateTime.Now,
            	                  		ExpireTime = DateTime.Now.AddMonths(1),
            	                  		MessageStationary = MailStationary.Normal
            	                  	};
            	mailMessage.AddItem(Item);
            	MailMgr.SendMail(mailMessage);
            }
        }