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

C# Entities.Unit类代码示例

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

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



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

示例1: 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


示例2: 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


示例3: CalculateManaRegen

		/// <summary>
		/// Calculates the amount of power regeneration for the class at a specific level, Intellect and Spirit.
		/// Changed in 3.1, overrides for casters are redundant.
		/// </summary>
		public static int CalculateManaRegen(Unit unit)
		{
			// default mana generation
			// see: http://www.wowwiki.com/Mana_regeneration
			var regen = (int)((0.001f + unit.Spirit * (float)Math.Sqrt(unit.Intellect) * GameTables.GetBaseRegenForLevel(unit.Level)) * 0.6f + 0.9f);  // rounded up
			return regen * RegenRateFactor;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:11,代码来源:RegenerationFormulas.cs


示例4: Init

		/// <summary>
		/// Method is called before the Unit is actually in the World
		/// to initialize the set of Actions.
		/// </summary>
		/// <param name="owner"></param>
		public override void Init(Unit owner)
		{
			base.Init(owner);

			this[BrainState.Idle] = new AIIdleAction(owner);
			this[BrainState.Dead] = this[BrainState.Idle];

			this[BrainState.Evade] = new AIEvadeAction(owner);
			this[BrainState.Roam] = new AIRoamAction(owner)
			{
				Strategy = new AIWaypointMoveAction(owner, AIMovementType.ForwardThenBack, owner.Waypoints)
			};

			this[BrainState.Follow] = new AIFollowMasterAction(owner);
			this[BrainState.Guard] = new AIGuardMasterAction(owner);

			if (owner is NPC)
			{
				this[BrainState.Combat] = new AICombatAction((NPC)owner)
				{
					Strategy = new AIAttackAction((NPC)owner)
				};

				this[BrainState.FormationMove] = new AIFormationMoveAction((NPC)owner);
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:31,代码来源:DefaultAIActionCollection.cs


示例5: 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


示例6: 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


示例7: OnProc

		public override void OnProc(Unit triggerer, IUnitAction action)
		{
			if (action is IDamageAction)
			{
				var owner = Owner;
				var dmgAction = ((IDamageAction)action);

				var healSelfAmount = ((dmgAction.Damage * EffectValue) + 50) / 100;	// don't forget rounding
				var healPartyAmount = (healSelfAmount + 3) / 5; // don't forget rounding

				owner.Heal(healSelfAmount, owner, SpellEffect);
				if (owner is Character)
				{
					var chr = (Character)owner;
					var group = chr.Group;
					if (group != null)
					{
						// heal all group members in same context (ie same Map in current implementation)
						group.CallOnAllInSameContext(chr.ContextHandler, (member) =>
						{
							member.Heal(healPartyAmount, owner, SpellEffect);
						});
					}
				}
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:26,代码来源:PriestShadowFixes.cs


示例8: SpellCollection

		protected SpellCollection(Unit owner, bool initDictionary)
		{
			if (initDictionary)
				m_byId = new Dictionary<uint, Spell>(60);

			Owner = owner;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:7,代码来源:SpellCollection.cs


示例9: 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


示例10: AuraCollection

		public AuraCollection(Unit owner)
		{
			m_auras = new Dictionary<AuraIndexId, Aura>();
			m_AuraArray = Aura.EmptyArray;

			m_owner = owner;
		}
开发者ID:WCellFR,项目名称:WCellFR,代码行数:7,代码来源:AuraCollection.cs


示例11: CheckInitialize

		protected internal override void CheckInitialize(CasterInfo casterInfo, Unit target, ref SpellFailedReason failReason)
		{
			if (!(target is Character))
			{
				failReason = SpellFailedReason.TargetNotPlayer;
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:7,代码来源:TrackResources.cs


示例12: SendAllAuras

		public static void SendAllAuras(IPacketReceiver rcv, Unit owner)
		{
			using (var packet = CreateAllAuraPacket(owner))
			{
				rcv.Send(packet);
			}
		}
开发者ID:Skizot,项目名称:WCell,代码行数:7,代码来源:AuraHandler.cs


示例13: CheckInitialize

		protected internal override void CheckInitialize(CasterInfo casterInfo, Unit target, ref SpellFailedReason failReason)
		{
			if (target.MaxPower == 0 || target.PowerType != (PowerType)m_spellEffect.MiscValue)
			{
				failReason = SpellFailedReason.BadTargets;
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:7,代码来源:PeriodicManaLeech.cs


示例14: AIWaypointMoveAction

		public AIWaypointMoveAction(Unit owner, AIMovementType waypointSequence)
			: base(owner)
		{
			m_waypoints = new LinkedList<WaypointEntry>();

			_waypointSequence = waypointSequence;
		}
开发者ID:origins,项目名称:WCell,代码行数:7,代码来源:AIWaypointMoveAction.cs


示例15: AIWaypointMoveAction

		public AIWaypointMoveAction(Unit owner, AIMovementType wpMovementType)
			: base(owner)
		{
			m_waypoints = new LinkedList<WaypointEntry>();

			m_WPmovementType = wpMovementType;
		}
开发者ID:primax,项目名称:WCell,代码行数:7,代码来源:AIWaypointMoveAction.cs


示例16: Initialize

		public override void Initialize(ref SpellFailedReason failReason)
		{
			if (m_targets != null && m_targets.Count > 0)
			{
				firstTarget = (Unit)m_targets[0];
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:7,代码来源:SummonObject.cs


示例17: SendAllAuras

 public static void SendAllAuras(IPacketReceiver rcv, Unit owner)
 {
     if (!owner.IsAreaActive) return;
     using (var packet = CreateAllAuraPacket(owner))
     {
         rcv.Send(packet);
     }
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:8,代码来源:AuraHandler.cs


示例18: Follow

		/// <summary>
		/// 
		/// </summary>
		/// <param name="target"></param>
		/// <remarks>Requires Brain</remarks>
		public void Follow(Unit target)
		{
			if (CheckBrain())
			{
				Target = target;
				m_brain.CurrentAction = new AIFollowTargetAction(this);
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:13,代码来源:Unit.AI.cs


示例19: Aggro

		public void Aggro(Unit unit)
		{
			for (var i = 0; i < m_Mobs.Count; i++)
			{
				var mob = m_Mobs[i];
				mob.ThreatCollection.AddNew(unit);
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:8,代码来源:AIGroup.cs


示例20: CheckRequirements

 public bool CheckRequirements(Unit enchanter)
 {
     if (enchanter is Character)
     {
         return ((Character)enchanter).Skills.CheckSkill(RequiredSkillId, RequiredSkillAmount);
     }
     return true;
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:8,代码来源:ItemEnchantmentEntry.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Entities.WorldObject类代码示例发布时间:2022-05-26
下一篇:
C# Entities.ObjectReference类代码示例发布时间: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