• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Entities.ObjectReference类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中WCell.RealmServer.Entities.ObjectReference的典型用法代码示例。如果您正苦于以下问题:C# ObjectReference类的具体用法?C# ObjectReference怎么用?C# ObjectReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectReference类属于WCell.RealmServer.Entities命名空间,在下文中一共展示了ObjectReference类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: CreateAuraEffectHandler

		internal AuraEffectHandler CreateAuraEffectHandler(ObjectReference caster,
			Unit target, ref SpellFailedReason failedReason, SpellCast triggeringCast)
		{
			var handler = AuraEffectHandlerCreator();

			if (triggeringCast != null &&
				triggeringCast.TriggerEffect != null &&
				triggeringCast.TriggerEffect.OverrideEffectValue)
			{
				if (Spell.Effects.Length > 1)
				{
					// it does not make sense to override multiple effects with a single effect...
					log.Warn("Spell {0} had overriding SpellEffect although the spell that was triggered had {2} (> 1) effects",
						Spell, Spell.Effects.Length);
				}
				handler.m_spellEffect = triggeringCast.TriggerEffect;
			}
			else
			{
				handler.m_spellEffect = this;
			}

			handler.BaseEffectValue = CalcEffectValue(caster);
			handler.CheckInitialize(triggeringCast, caster, target, ref failedReason);
			return handler;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:26,代码来源:SpellEffect.cs


示例17: CheckInitialize

		/// <summary>		
		/// Check whether this handler can be applied to the given target.
		/// m_aura, as well as some other fields are not set when this method gets called.
		/// </summary>
		protected internal virtual void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
		{
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:AuraEffectHandler.cs


示例18: GetAuraUID

		public AuraIndexId GetAuraUID(ObjectReference caster, WorldObject target)
		{
			return GetAuraUID(IsBeneficialFor(caster, target));
		}
开发者ID:Jeroz,项目名称:WCell,代码行数:4,代码来源:Spell.Aura.cs


示例19: WriteChanneledSpells

        public static void WriteChanneledSpells()
        {
            List<Spell> spells = new List<Spell>(1000);
            foreach (Spell spell in SpellHandler.ById)
            {
                if (spell == null)
                    continue;

                if (spell.IsChanneled)
                {
                    spells.Add(spell);
                }
            }

            using (var writer = new StreamWriter(ToolConfig.OutputDir + "ChanneledSpells.txt", false))
            {
                var caster = new ObjectReference();
                foreach (var spell in spells)
                {
                    writer.WriteLine("Spell: " + spell);
                    bool hasAmpl = false;
                    bool hasCustomScript = false;
                    foreach (SpellEffect effect in spell.Effects)
                    {
                        effect.DumpInfo(writer, "\t");
                        hasAmpl = hasAmpl || effect.Amplitude > 0;
                        hasCustomScript = hasCustomScript || effect.IsScripted;
                    }
                    if (spell.GetDuration(caster, null) < 1)
                    {
                        Console.WriteLine(spell);
                    }
                    writer.WriteLine();
                    writer.WriteLine();
                }
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:37,代码来源:SpellOutput.cs


示例20: ObtainPooledCast

		public static SpellCast ObtainPooledCast(ObjectReference caster, Map map, uint phase, ref Vector3 sourceLoc)
		{
			var cast = SpellCastPool.Obtain();
			cast.SetCaster(caster, map, phase, sourceLoc);
			return cast;
		}
开发者ID:primax,项目名称:WCell,代码行数:6,代码来源:SpellCast.cs



注:本文中的WCell.RealmServer.Entities.ObjectReference类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Entities.Unit类代码示例发布时间:2022-05-26
下一篇:
C# Entities.ObjectBase类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap