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

C# Spells.Spell类代码示例

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

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



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

示例1: InitSneedSpells

		public static void InitSneedSpells()
		{
			disarm = SpellHandler.Get(SpellId.Disarm_2);  //disarm
			disarm.AISettings.SetCooldown(10000);
			disarm.OverrideAITargetDefinitions(DefaultTargetAdders.AddAreaSource,		// random hostile nearby character
											   DefaultTargetEvaluators.RandomEvaluator,
											   DefaultTargetFilters.IsPlayer, DefaultTargetFilters.IsHostile);


			SpellHandler.Apply(spell => spell.CooldownTime = 20000, SpellId.MoltenMetal);
			SpellHandler.Apply(spell => spell.CooldownTime = 25000, SpellId.MeltOre);


			// Rhakzor's slam has a cooldown of about 12s
			SpellHandler.Apply(spell => { spell.AISettings.SetCooldown(10000, 14000); }, SpellId.RhahkZorSlam);


			SpellHandler.Apply(spell => spell.CooldownTime = 10000, SpellId.SmiteSlam);

			// remember the Spells for later use
			terrify = SpellHandler.Get(SpellId.Terrify);
			terrify.AISettings.SetCooldown(21000);
			terrify.OverrideAITargetDefinitions(DefaultTargetAdders.AddAreaSource,		// random hostile nearby character
											   DefaultTargetEvaluators.RandomEvaluator,
											   DefaultTargetFilters.IsPlayer, DefaultTargetFilters.IsHostile);

			distractingPain = SpellHandler.Get(SpellId.DistractingPain);
			distractingPain.AISettings.SetCooldown(12000);
			distractingPain.OverrideAITargetDefinitions(DefaultTargetAdders.AddAreaSource,		// random hostile nearby character
											   DefaultTargetEvaluators.RandomEvaluator,
											   DefaultTargetFilters.IsPlayer, DefaultTargetFilters.IsHostile);

			ejectSneed = SpellHandler.Get(SpellId.EjectSneed);
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:34,代码来源:Deadmines.cs


示例2: DumpSpell

 public static void DumpSpell(TextWriter writer, Spell spell)
 {
     spell.Dump(writer, "\t");
     writer.WriteLine();
     writer.WriteLine("#################################################################");
     writer.WriteLine();
 }
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:SpellOutput.cs


示例3: InitMarrowgar

 static void InitMarrowgar()
 {
     BoneSlice = SpellHandler.Get(SpellId.BoneSlice);
     BoneStorm = SpellHandler.Get(SpellId.BoneStorm);
     ColdFlame = SpellHandler.Get(SpellId.Coldflame_3);
     ColdFlameBone = SpellHandler.Get(SpellId.Coldflame_13);
     boneLength = urand.Next(20, 30);
 }
开发者ID:NVN,项目名称:WCell,代码行数:8,代码来源:IcecrownCitadel.cs


示例4: InitMarrowgar

 public static void InitMarrowgar()
 {
     BoneSlice = SpellHandler.Get(SpellId.BoneSlice);
     BoneStorm = SpellHandler.Get(SpellId.BoneStorm);
     ColdFlame = SpellHandler.Get(SpellId.Coldflame_3);
     ColdFlameBone = SpellHandler.Get(SpellId.Coldflame_13);
     boneLength = Utility.Random(20, 30);
 }
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:IcecrownCitadel.cs


示例5: CheckDebuffResist

		/// <summary>
		/// Checks whether the given target resisted the debuff, represented through the given spell
		/// </summary>
		public static CastMissReason CheckDebuffResist(Unit target, Spell spell, int casterLevel, bool hostile)
		{
			var missReason = CastMissReason.None;
			if (hostile && target.CheckDebuffResist(casterLevel, target.GetLeastResistantSchool(spell)))
			{
				missReason = CastMissReason.Resist;
			}
			return missReason;
		}
开发者ID:enjoii,项目名称:WCell,代码行数:12,代码来源:SpellCast.Aura.cs


示例6: AddSpell

		internal void AddSpell(Spell spell)
		{
			if (spell == null)
			{
				throw new ArgumentNullException("spell");
			}
			Spells.Add(spell);
			spell.Line = this;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:9,代码来源:SpellLine.cs


示例7: AISpellCastAction

        public AISpellCastAction(Unit owner, Spell spell)
            : base(owner)
        {
            m_spell = spell;

            //if (m_target != null)
            //{
            //    m_range = new SimpleRange(m_spell.Range.Min, m_spell.Range.Max);
            //}
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:10,代码来源:AISpellCastAction.cs


示例8: Init

		public static void Init(TestContext testContext)
		{
			chr = Setup.AllianceCharacterPool.Create();
			client = chr.FakeClient;
			disenchantSpell = SpellHandler.Get(SpellId.DisenchantPT);
			disenchantSpell.CastDelay = 0;	// we don't want to wait

			ItemMgr.LoadAll();
			//LootMgr.LoadAll();
			ContentMgr.Load<ItemLootItemEntry>();
		}
开发者ID:NVN,项目名称:WCell,代码行数:11,代码来源:DisenchantingTest.cs


示例9: SpellCastAction

		public SpellCastAction(IBrain owner, Unit target, Spell spell) : base(owner)
		{
			m_ownerBrain = owner;
			m_target = target;
			m_spell = spell;

			if (m_target != null)
				m_range = new AIRange(m_spell.Range.Min, m_spell.Range.Max);

			IsPrimary = true;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:11,代码来源:SpellCastAction.cs


示例10: Trigger

		//internal static readonly ObjectPool<List<AuraApplicationInfo>> AuraAppListPool = ObjectPoolMgr.CreatePool(() => new List<AuraApplicationInfo>());

		public static void Trigger(WorldObject caster, SpellEffect triggerEffect, Spell spell)
		{
			var cast = SpellCastPool.Obtain();
			cast.Caster = caster;
			cast.m_triggerEffect = triggerEffect;

			caster.ExecuteInContext(() =>
			{
				cast.Start(spell, true);
				cast.Dispose();
			});
		}
开发者ID:pallmall,项目名称:WCell,代码行数:14,代码来源:SpellCast.cs


示例11: Trigger

		public static void Trigger(WorldObject caster, Spell spell, ref Vector3 targetLoc, WorldObject selected, Item casterItem)
		{
			var cast = ObtainPooledCast(caster);
			cast.TargetLoc = targetLoc;
			cast.Selected = selected;
			cast.CasterItem = casterItem;

			cast.ExecuteInContext(() =>
			{
				cast.Start(spell, true);
				//cast.Dispose();
			});
		}
开发者ID:primax,项目名称:WCell,代码行数:13,代码来源:SpellCast.cs


示例12: CheckImmune

		/// <summary>
		/// Returns whether the spell can be casted (true) or if immunity of the target prevents it (false)
		/// </summary>
		public static bool CheckImmune(Unit target, Spell spell, bool hostile)
		{
			if (spell.Mechanic != SpellMechanic.None &&
						hostile == spell.Mechanic.IsNegative() &&
						((spell.Mechanic == SpellMechanic.Invulnerable_2 || spell.Mechanic == SpellMechanic.Invulnerable) &&
						!spell.Attributes.HasFlag(SpellAttributes.UnaffectedByInvulnerability) &&
						(target.IsImmune(SpellMechanic.Invulnerable_2) || target.IsImmune(SpellMechanic.Invulnerable))) ||
						(target.IsImmune(spell.Mechanic) || target.IsImmune(spell.DispelType)))
			{
				return false;
			}
			return true;
		}
开发者ID:enjoii,项目名称:WCell,代码行数:16,代码来源:SpellCast.Perform.cs


示例13: SpellLine

		public SpellLine(SpellLineId id, params Spell[] spells)
		{
			LineId = id;
			AuraUID =  (uint)id;
			Spells = new List<Spell>();
			if (spells.Length > 0)
			{
				m_firstSpell = spells[0];

				for (var i = 0; i < spells.Length; i++)
				{
					var spell = spells[i];
					AddSpell(spell);
				}
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:16,代码来源:SpellLine.cs


示例14: DisplayPath

		private static void DisplayPath(Spell spell, WorldObject caster, WorldObject target, ref Vector3 to)
		{
			if (!(caster is Character)) return;
			if (!NPCMgr.Loaded)
			{
				NPCMgr.LoadAllLater();
				caster.Say("Loading NPCs...");
				return;
			}


			var from = caster.Position;
			from.Z += 5;
			to.Z += 5;
			caster.Map.Terrain.FindPath(new PathQuery(from, ref to, caster, OnFoundPath));
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:16,代码来源:DebugSpells.cs


示例15: WSGFaction

#pragma warning restore 0649

		#endregion

		protected WSGFaction(WarsongGulch instance,
			SpellId flagSpell,
			SpellId flagDropSpell,
			SpellId flagDropDebuff,
			SpellId flagCarrierDebuffSpellId,
			GOEntryId flagStand,
			GOEntryId flagDropId)
		{
			Instance = instance;
			_flagSpell = SpellHandler.Get(flagSpell);
			_flagDropSpell = SpellHandler.Get(flagDropSpell);
			_flagDropDebuff = SpellHandler.Get(flagDropDebuff);
			_flagCarrierDebuffSpell = SpellHandler.Get(flagCarrierDebuffSpellId);
			FlagStandEntry = GOMgr.GetEntry(flagStand);
			DroppedFlagEntry = GOMgr.GetEntry(flagDropId);

			_flagRespawn = WarsongGulch.FlagRespawnTime;
			Score = 0;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:23,代码来源:WSGFaction.cs


示例16: IsImmune

		/// <summary>
		/// Returns whether the given target is immune to the given spell
		/// </summary>
		public static bool IsImmune(Unit target, Spell spell, bool hostile)
		{
			if (
						hostile &&
						spell.Mechanic.IsNegative() &&
						!spell.Attributes.HasFlag(SpellAttributes.UnaffectedByInvulnerability) &&
						(spell.Mechanic == SpellMechanic.Invulnerable_2 || spell.Mechanic == SpellMechanic.Invulnerable) &&
						(
							// immune against spell
							target.IsInvulnerable ||
							target.IsImmune(SpellMechanic.Invulnerable_2) ||
							target.IsImmune(SpellMechanic.Invulnerable) ||
							target.IsImmune(spell.Mechanic) ||
							target.IsImmune(spell.DispelType)
						)
				)
			{
				return true;
			}
			return false;
		}
开发者ID:primax,项目名称:WCell,代码行数:24,代码来源:SpellCast.Perform.cs


示例17: ApplyAura

        public static void ApplyAura(TestCharacter chr, Spell spell)
        {
            Assert.IsTrue(spell.IsAura || spell.IsAreaAura, "Spell {0} is not an Aura", spell);

            chr.EnsureInWorld();

            chr.ShapeshiftForm = ShapeshiftForm.Normal;
            chr.Auras.Clear();

            Assert.AreEqual(0, chr.Auras.Count);

            // important: Execute this in the Map's thread
            chr.Map.AddMessageAndWait(new Message(() => {
                chr.SpellCast.TriggerSelf(spell);

                var failure =
                    chr.FakeClient.DequeueSMSG(RealmServerOpCode.SMSG_SPELL_FAILURE);

                Assert.IsNull(failure,
                              failure != null
                                ? "Spell failed: " + failure["FailReason"].Value
                                : "");

                Assert.AreEqual(1, chr.Auras.Count, "Aura was not added.");
                var aura = chr.Auras[spell, !spell.HasHarmfulEffects];

                Assert.IsNotNull(aura);

                Assert.AreEqual(spell.GetDuration(chr.SharedReference, chr), (uint)aura.Duration);
                Assert.AreNotEqual(0, spell.GetDuration(chr.SharedReference, chr));
                Asser.GreaterOrEqual(spell.GetDuration(chr.SharedReference, chr), (uint)aura.TimeLeft);

                aura.Cancel();

                Assert.IsNull(chr.Auras[spell, !spell.HasHarmfulEffects]);
                Assert.AreEqual(0, chr.Auras.Count);
            }));
        }
开发者ID:KroneckerX,项目名称:WCell,代码行数:38,代码来源:CastingTest.cs


示例18: SendTotemCreated

        public static bool SendTotemCreated(IPacketReceiver client, Spell totemSpell, EntityId totemEntityId)
        {
            var chr = client as Character;
            if (chr == null)
                return false;

            var effect = totemSpell.GetEffect(SpellEffectType.Summon);
            if (effect == null)
                return false;

            var slot = effect.SummonEntry.Slot - 1;

            using(var packet = new RealmPacketOut(RealmServerOpCode.SMSG_TOTEM_CREATED))
            {
                packet.Write(slot);
                packet.Write(totemEntityId);
                packet.Write(totemSpell.GetDuration(chr.SharedReference));
                packet.Write(totemSpell.Id);

                client.Send(packet);
            }
            return true;
        }
开发者ID:KroneckerX,项目名称:WCell,代码行数:23,代码来源:TotemHandler.cs


示例19: ConsumePower

		/// <summary>
		/// Tries to consume the given amount of Power, also considers modifiers to Power-cost.
		/// </summary>
		public bool ConsumePower(DamageSchool type, Spell spell, int neededPower)
		{
			neededPower = GetPowerCost(type, spell, neededPower);

			if (Power >= neededPower)
			{
				Power -= neededPower;
				return true;
			}

			return false;
		}
开发者ID:ray2006,项目名称:WCell,代码行数:15,代码来源:Unit.cs


示例20: GetPowerCost

		/// <summary>
		/// Returns the modified power-cost needed to cast a Spell of the given DamageSchool 
		/// and the given base amount of power required
		/// </summary>
		public virtual int GetPowerCost(DamageSchool school, Spell spell, int cost)
		{
			int modifier = PowerCostModifier;
			if (m_schoolPowerCostMods != null)
			{
				modifier += m_schoolPowerCostMods[(int)school];
			}

			cost += modifier;

			cost = (int)(Math.Round(PowerCostMultiplier) * cost);
			return cost;
		}
开发者ID:ray2006,项目名称:WCell,代码行数:17,代码来源:Unit.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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