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


C# Spells.SpellCast類代碼示例

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


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

示例1: DynamicObject

		public DynamicObject(SpellCast cast, float radius)
			: this(cast.CasterUnit,
			cast.Spell.SpellId, radius,
			cast.Caster.Region,
			cast.TargetLoc)
		{
		}
開發者ID:pallmall,項目名稱:WCell,代碼行數:7,代碼來源:DynamicObject.cs

示例2: Summon

		public virtual NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
		{
			var caster = cast.CasterUnit;
			var duration = cast.Spell.GetDuration(cast.CasterReference);

			NPC minion;
			if (caster != null)
			{
				minion = caster.SpawnMinion(entry, ref targetLoc, duration);
			}
			else
			{
				minion = entry.Create(cast.TargetMap.DifficultyIndex);

				minion.Position = targetLoc;
				minion.Brain.IsRunning = true;
				minion.Phase = cast.Phase;
				cast.Map.AddObject(minion);
			}

			if (caster is Character)
			{
				minion.Level = caster.Level;
			}
			minion.Summoner = caster;
			minion.Creator = cast.CasterReference.EntityId;

			return minion;
		}
開發者ID:Jeroz,項目名稱:WCell,代碼行數:29,代碼來源:SpellSummons.cs

示例3: NotifyCasted

 internal void NotifyCasted(SpellCast cast)
 {
     var evt = Casted;
     if (evt != null)
     {
         evt(cast);
     }
 }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:8,代碼來源:Spell.Events.cs

示例4: Summon

		public virtual NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
		{
			var caster = cast.CasterUnit;
			var pet = caster.SpawnMinion(entry, ref targetLoc, cast.Spell.GetDuration(caster.CasterInfo));
			pet.Summoner = caster;
			pet.Creator = caster.EntityId;
			return pet;
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:8,代碼來源:SpellSummonHandlers.cs

示例5: NotifyCancelled

		internal void NotifyCancelled(SpellCast cast, SpellFailedReason reason)
		{
			var evt = Cancelling;
			if (evt != null)
			{
				evt(cast, reason);
			}
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:8,代碼來源:Spell.Events.cs

示例6: OnDebuff

		/// <summary>
		/// Called when this Unit got the given debuff by the given SpellCast
		/// </summary>
		/// <param name="cast"></param>
		internal void OnDebuff(SpellCast cast, Aura debuff)
		{
			// force combat mode
			IsInCombat = true;

			var evt = Debuff;
			if (evt != null)
			{
				evt(this, cast, debuff);
			}
		}
開發者ID:pallmall,項目名稱:WCell,代碼行數:15,代碼來源:UnitEvents.cs

示例7: Summon

		public override NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
		{
			var caster = cast.CasterUnit;
			if (caster is Character)
			{
				return ((Character)caster).SpawnPet(entry, ref targetLoc, cast.Spell.GetDuration(caster.SharedReference));
			}
			else
			{
				return base.Summon(cast, ref targetLoc, entry);
			}
		}
開發者ID:MeaNone,項目名稱:WCell,代碼行數:12,代碼來源:SpellSummons.cs

示例8: NotifyCasting

		/// <summary>
		/// Triggers the Casting event
		/// </summary>
		internal SpellFailedReason NotifyCasting(SpellCast cast)
		{
			var evt = Casting;
			if (evt != null)
			{
				var err = evt(cast);
				if (err != SpellFailedReason.Ok)
				{
					cast.Cancel(err);
					return err;
				}
			}
			return SpellFailedReason.Ok;
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:17,代碼來源:Spell.Events.cs

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

示例10: SendSpellMiss

 /// <summary>
 /// Correct 3.0.9
 /// </summary>
 public static void SendSpellMiss(SpellCast cast, bool display, ICollection<MissedTarget> missedTargets)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLLOGMISS, 34))
     {
         packet.Write(cast.Spell.Id);
         packet.Write(cast.CasterReference.EntityId);
         packet.Write(display);// TODO: test this value. Its a bool that seems to determine whether to display this packet in the combat log
         packet.Write(missedTargets.Count);
         foreach (var miss in missedTargets)
         {
             packet.Write(miss.Target.EntityId);
             packet.Write((byte)miss.Reason);
         }
         cast.SendPacketToArea(packet);
     }
 }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:19,代碼來源:CombatLogHandler.cs

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

示例12: PrepareAI

		/// <summary>
		/// Find valid targets for AI cast during preparation
		/// </summary>
		SpellFailedReason PrepareAI(SpellCast cast)
		{
			var caster = cast.CasterUnit;
			cast.SourceLoc = caster.Position;

			if (caster.Target != null)
			{
				caster.SpellCast.TargetLoc = caster.Target.Position;
			}


			// TODO: Init handlers
			//var targets = FindValidTargetsForCaster(caster);
			//if (targets == null)
			//{
			//    return SpellFailedReason.NoValidTargets;
			//}

			return SpellFailedReason.NoValidTargets;
		}
開發者ID:MeaNone,項目名稱:WCell,代碼行數:23,代碼來源:SpellCast.AI.cs

示例13: FerociousBiteHandler

		public FerociousBiteHandler(SpellCast cast, SpellEffect effect)
			: base(cast, effect)
		{
		}
開發者ID:primax,項目名稱:WCell,代碼行數:4,代碼來源:DruidFeralCombatFixes.cs

示例14: SendSpellFailedOther

		internal static void SendSpellFailedOther(SpellCast spellCast, SpellFailedReason reason)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELL_FAILED_OTHER, 15))
			{
				spellCast.Caster.EntityId.WritePacked(packet);
				packet.Write(spellCast.Id);
				packet.Write(spellCast.Spell.Id);
				packet.Write((byte)reason);

				spellCast.Caster.SendPacketToArea(packet);
			}
		}
開發者ID:pallmall,項目名稱:WCell,代碼行數:12,代碼來源:SpellHandler.cs

示例15: ReadinessHandler

 public ReadinessHandler(SpellCast cast, SpellEffect effect)
     : base(cast, effect)
 {
 }
開發者ID:MeaNone,項目名稱:WCell,代碼行數:4,代碼來源:HunterMarkmanshipFixes.cs


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