Server.BuffInfo.AddBuff C# (CSharp) 메소드

AddBuff() 공개 정적인 메소드

public static AddBuff ( Server.Mobile m, BuffInfo b ) : void
m Server.Mobile
b BuffInfo
리턴 void
		public static void AddBuff( Mobile m, BuffInfo b )
		{
			PlayerMobile pm = m as PlayerMobile;

			if( pm != null )
				pm.AddBuff( b );
		}

Usage Example

예제 #1
0
파일: Honor.cs 프로젝트: UODOC/MyShard
        private static void Honor(PlayerMobile source, Mobile target)
        {
            IHonorTarget  honorTarget = target as IHonorTarget;
            GuardedRegion reg         = (GuardedRegion)source.Region.GetRegion(typeof(GuardedRegion));
            Map           map         = source.Map;

            if (honorTarget == null)
            {
                return;
            }

            if (honorTarget.ReceivedHonorContext != null)
            {
                if (honorTarget.ReceivedHonorContext.Source == source)
                {
                    return;
                }

                if (honorTarget.ReceivedHonorContext.CheckDistance())
                {
                    source.SendLocalizedMessage(1063233); // Somebody else is honoring this opponent
                    return;
                }
            }

            if (target.Hits < target.HitsMax)
            {
                source.SendLocalizedMessage(1063166); // You cannot honor this monster because it is too damaged.
                return;
            }

            BaseCreature cret = target as BaseCreature;

            if (target.Body.IsHuman && (cret == null || (!cret.AlwaysAttackable && !cret.AlwaysMurderer)))
            {
                if (reg == null || reg.IsDisabled())
                {
                    //Allow honor on blue if Out of guardzone
                }
                else if (map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0)
                {
                    //Allow honor on blue if in Fel
                }
                else
                {
                    source.SendLocalizedMessage(1001018); // You cannot perform negative acts
                    return;                               //cannot honor in trammel town on blue
                }
            }

            if (Core.ML && target is PlayerMobile)
            {
                source.SendLocalizedMessage(1075614); // You cannot honor other players.
                return;
            }

            if (source.SentHonorContext != null)
            {
                source.SentHonorContext.Cancel();
            }

            new HonorContext(source, target);

            source.Direction = source.GetDirectionTo(target);

            if (!source.Mounted)
            {
                source.Animate(32, 5, 1, true, true, 0);
            }

            BuffInfo.AddBuff(source, new BuffInfo(BuffIcon.Honored, 1075649, 1153815, String.Format("{0}", target.Name)));
            BuffInfo.AddBuff(source, new BuffInfo(BuffIcon.Perfection, 1153786, 1151394, String.Format("0\t{0}", target.Name)));
        }
All Usage Examples Of Server.BuffInfo::AddBuff