當前位置: 首頁>>代碼示例>>C#>>正文


C# Entities.ObjectReference類代碼示例

本文整理匯總了C#中WCell.RealmServer.Entities.ObjectReference的典型用法代碼示例。如果您正苦於以下問題:C# ObjectReference類的具體用法?C# ObjectReference怎麽用?C# ObjectReference使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ObjectReference類屬於WCell.RealmServer.Entities命名空間,在下文中一共展示了ObjectReference類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CheckInitialize

 protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
 {
     if (!(target is Character))
     {
         failReason = SpellFailedReason.TargetNotPlayer;
     }
 }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:7,代碼來源:TrackCreatures.cs

示例2: CheckInitialize

		protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
		{
			Caster = casterReference.Object as Unit;
			if (Caster == null || Caster is Vehicle)
			{
				log.Warn("Invalid SpellCaster \"{0}\" for Spell: {1}", Caster, SpellEffect.Spell);
				failReason = SpellFailedReason.Error;
				return;
			}

			Vehicle = target as Vehicle;
			if (Vehicle == null)
			{
				failReason = SpellFailedReason.BadTargets;
			}
			else
			{
				Seat = Vehicle.GetSeatFor(Caster);
				if (Seat == null)
				{
					// must never happen since Vehicle is unclickable when full
					failReason = SpellFailedReason.BadTargets;
				}
			}
		}
開發者ID:remixod,項目名稱:netServer,代碼行數:25,代碼來源:VehicleAuraHandler.cs

示例3: CheckInitialize

 protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterRef, Unit target, ref SpellFailedReason failReason)
 {
     var caster = creatingCast.CasterReference.Object as Unit;
     if (caster == null)
     {
         failReason = SpellFailedReason.BadTargets;
     }
     else
     {
         if (caster.Charm != null)
         {
             failReason = SpellFailedReason.AlreadyHaveCharm;
         }
         else if (target.HasMaster)
         {
             failReason = SpellFailedReason.CantDoThatRightNow;
         }
         else if (caster.HasMaster)
         {
             failReason = SpellFailedReason.Possessed;
         }
         else if (caster is Character)
         {
             if (((Character)caster).ActivePet != null)
             {
                 failReason = SpellFailedReason.AlreadyHaveSummon;
             }
         }
     }
 }
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:30,代碼來源:ModPossessAuraHandler.cs

示例4: CheckInitialize

		protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
		{
			if (target.MaxPower == 0 || target.PowerType != (PowerType)m_spellEffect.MiscValue)
			{
				failReason = SpellFailedReason.BadTargets;
			}
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:7,代碼來源:PeriodicManaLeech.cs

示例5: CheckInitialize

        protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterRef, Unit target, ref SpellFailedReason failReason)
        {
            if (!(target is NPC))
            {
                failReason = SpellFailedReason.BadTargets;
            }

            if (casterRef != null && casterRef.Object is Unit)
            {
                var caster = (Unit)casterRef.Object;
                //if (target.Target == caster)
                //{
                //    failReason = SpellFailedReason.NoValidTargets;
                //}
                //else
                {
                    var spell = m_aura.Spell;
                    var hasSingleFriendTarget = spell.HasBeneficialEffects && !spell.IsAreaSpell && spell.HasTargets;
                    if (hasSingleFriendTarget && caster.Target != null && caster.IsFriendlyWith(caster.Target))
                    {
                        // taunting a friend, means we want to taunt his attackers
                        // needed for Righteous defense, amongst others
                        if (target.Target != caster.Target)
                        {
                            failReason = SpellFailedReason.NoValidTargets;
                        }
                    }
                }
            }
        }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:30,代碼來源:ModTaunt.cs

示例6: CheckInitialize

		protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
		{
			if (m_spellEffect.TriggerSpell == null)
			{
				failReason = SpellFailedReason.Error;
				log.Warn("Tried to cast Spell \"{0}\" which has invalid TriggerSpellId {1}", m_spellEffect.Spell, m_spellEffect.TriggerSpellId);
			}
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:8,代碼來源:TriggerDelayedEffectHandler.cs

示例7: CheckInitialize

		protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
		{
			if (target.Class != ClassId.Hunter)
			{
				failReason = SpellFailedReason.BadTargets;
				return;
			}
		}
開發者ID:remixod,項目名稱:netServer,代碼行數:8,代碼來源:CallStabledPetHandler.cs

示例8: CheckInitialize

 protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
 {
     if (!(target is Character)) return;
     var chr = (Character)target;
     if (chr.Class != ClassId.Hunter)
     {
         failReason = SpellFailedReason.BadTargets;
     }
 }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:9,代碼來源:ModPetTalentPoints.cs

示例9: CheckInitialize

 protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
 {
     if (target is Character)
     {
         var chr = (Character)target;
         if (!chr.CanFly)
         {
             failReason = SpellFailedReason.NotHere;
         }
     }
 }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:11,代碼來源:Fly.cs

示例10: CheckInitialize

        /// <summary>
        /// Ensure that the constraints are correct for the Flag aura to be applied
        /// </summary>
        protected override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
        {
			if (!(target is Character))
			{
				failReason = SpellFailedReason.BadTargets;
			}
			else
			{
				Instance = target.Region as WarsongGulch;
				if (Instance == null)
				{
					failReason = SpellFailedReason.IncorrectArea;
				}
			}
        }
開發者ID:NVN,項目名稱:WCell,代碼行數:18,代碼來源:WarsongFlagsHandler.cs

示例11: CheckInitialize

		protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
		{
			form = (ShapeshiftForm)SpellEffect.MiscValue;
			if (target.ShapeshiftForm == form)
			{
				// stances can't be undone:
				if (form != ShapeshiftForm.BattleStance &&
					form != ShapeshiftForm.BerserkerStance &&
					form != ShapeshiftForm.DefensiveStance)
				{
					target.Auras.RemoveWhere(aura => aura.Spell.Id == m_aura.Spell.Id);
					failReason = SpellFailedReason.DontReport;
				}
			}
		}
開發者ID:NVN,項目名稱:WCell,代碼行數:15,代碼來源:ShapeshiftHandler.cs

示例12: CheckInitialize

			protected override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
			{
				if (target is Character)
				{
					var chr = (Character)target;
					var ap = target.TotalMeleeAP;
					var sp = chr.GetDamageDoneMod(DamageSchool.Holy);
					if (ap > sp)
					{
						totalBonus = ap;
					}
					else
					{
						totalBonus = sp;
					}
				}
			}
開發者ID:remixod,項目名稱:netServer,代碼行數:17,代碼來源:PlayerSpells.cs

示例13: CheckInitialize

		protected internal override void CheckInitialize(SpellCast creatingCast, ObjectReference casterRef, Unit target, ref SpellFailedReason failReason)
		{
			var caster = creatingCast.CasterReference.Object as Unit;
			if (caster == null)
			{
				failReason = SpellFailedReason.BadTargets;
			}
			else
			{
				if (!(target is NPC))
				{
					LogManager.GetCurrentClassLogger().Warn("{0} tried to Charm {1} which is not an NPC, but Player charming is not yet supported.", caster, target);
					failReason = SpellFailedReason.BadTargets;
				}
				if (caster.Charm != null)
				{
					failReason = SpellFailedReason.AlreadyHaveCharm;
				}
				else if (target.HasMaster)
				{
					failReason = SpellFailedReason.CantBeCharmed;
				}
				//else if (caster.Level < EffectValue)
				//{
				//    failReason = SpellFailedReason.Highlevel;
				//}
				else if (caster.HasMaster)
				{
					failReason = SpellFailedReason.Charmed;
				}
				else if (caster is Character)
				{
					if (((Character)caster).ActivePet != null)
					{
						failReason = SpellFailedReason.AlreadyHaveSummon;
					}
				}
			}
		}
開發者ID:Jeroz,項目名稱:WCell,代碼行數:39,代碼來源:CharmAuraHandler.cs

示例14: GetRadius

		public float GetRadius(ObjectReference caster)
		{
			var radius = Radius;
			var chr = caster.UnitMaster;
			if (chr != null)
			{
				radius = chr.Auras.GetModifiedFloat(SpellModifierType.Radius, Spell, radius);
			}
			if (radius < 5)
			{
				return 5;
			}
			return radius;
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:14,代碼來源:SpellEffect.cs

示例15: CalcEffectValue

		public int CalcEffectValue(ObjectReference casterReference)
		{
			var caster = casterReference.UnitMaster;
			if (caster != null)
			{
				return CalcEffectValue(caster);
			}
			else
			{
				return CalcEffectValue(casterReference.Level, 0, false);
			}
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:12,代碼來源:SpellEffect.cs


注:本文中的WCell.RealmServer.Entities.ObjectReference類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。