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


C# Entities.WorldObject類代碼示例

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


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

示例1: IsFriendly

		public static void IsFriendly(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			if (effectHandler.Cast.CasterObject.MayAttack(target))
			{
				failedReason = SpellFailedReason.TargetEnemy;
			}
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:7,代碼來源:DefaultTargetFilters.cs

示例2: Apply

		protected override void Apply(WorldObject target)
		{
			var chr = (Character)target;

			if (Effect.Spell.RequiredItemClass == ItemClass.Weapon && !chr.Skills.WeaponProficiency.HasAnyFlag(Effect.Spell.RequiredItemSubClassMask))
			{
				chr.Skills.WeaponProficiency |= Effect.Spell.RequiredItemSubClassMask;
				CharacterHandler.SendProficiency(chr, ItemClass.Weapon, chr.Skills.WeaponProficiency);
				
			}
			else if (Effect.Spell.RequiredItemClass == ItemClass.Armor && !chr.Skills.ArmorProficiency.HasAnyFlag(Effect.Spell.RequiredItemSubClassMask))
			{
				chr.Skills.ArmorProficiency |= Effect.Spell.RequiredItemSubClassMask;
				CharacterHandler.SendProficiency(chr, ItemClass.Armor, chr.Skills.ArmorProficiency);
			}

			if (Effect.Spell.Ability == null)
			{
				log.Warn("Spell {0} had Handler for Proficiency but Spell has no Skill associated with it.", Effect.Spell);
			}
			else if (!chr.Skills.Contains(Effect.Spell.Ability.Skill.Id))
			{
				chr.Skills.Add(Effect.Spell.Ability.Skill, false);
			}


		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:27,代碼來源:AddProficiencyHandler.cs

示例3: InitializeTarget

		public override SpellFailedReason InitializeTarget(WorldObject target)
		{
			//if (((Unit)target).Health >= ((Unit)target).MaxHealth) {
			//    return SpellFailedReason.AlreadyAtFullHealth;
			//}
			return SpellFailedReason.Ok;
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:7,代碼來源:HealMaxHealth.cs

示例4: Apply

 protected override void Apply(WorldObject target)
 {
     if (Effect.Spell.IsHearthStoneSpell && m_cast.CasterChar != null)
     {
         // teleport back home
         var pos = m_cast.CasterChar.BindLocation;
         target.AddMessage(() => ((Unit)target).TeleportTo(pos));
     }
     else
     {
         if (Effect.ImplicitTargetB == ImplicitSpellTargetType.BehindTargetLocation)
         {
             var unit = (Unit)target;
             if (unit != null)
             {
                 var o = unit.Orientation;
                 var newx = unit.Position.X - (unit.BoundingRadius + 0.5f) * (float)Math.Cos(o);
                 var newy = unit.Position.Y - (unit.BoundingRadius + 0.5f) * (float)Math.Sin(o);
                 var newpos = new Util.Graphics.Vector3(newx, newy, unit.Position.Z);
                 m_cast.CasterChar.TeleportTo(newpos, o);
             }
         }
         else
         {
             // teleport to given target location
             var map = m_cast.TargetMap;
             var pos = m_cast.TargetLoc;
             var ori = m_cast.TargetOrientation;
             target.AddMessage(() => ((Unit)target).TeleportTo(map, pos, ori));
         }
     }
 }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:32,代碼來源:TeleportUnits.cs

示例5: Apply

		protected override void Apply(WorldObject target)
		{
			var npc = (NPC)target;

			npc.ThreatCollection[(Unit)m_cast.Caster] += 
				((Unit)m_cast.Caster).GetGeneratedThreat(CalcEffectValue(), Effect.Spell.Schools[0], Effect);
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:7,代碼來源:ThreatHandler.cs

示例6: IsHostileOrHealable

		/// <summary>
		/// Duel target type
		/// </summary>
		/// <param name="targets"></param>
		/// <param name="target"></param>
		/// <param name="failedReason"></param>
		public static void IsHostileOrHealable(SpellEffectHandler effectHandler, WorldObject target, ref SpellFailedReason failedReason)
		{
			var caster = effectHandler.Cast.CasterObject;
			var spell = effectHandler.Cast.Spell;
			var isHarmful = spell.HasHarmfulEffects;
			var isHarmfulAndBeneficial = spell.HasHarmfulEffects == spell.HasBeneficialEffects;

			if (!isHarmfulAndBeneficial)
			{
				if (isHarmful != caster.MayAttack(target))
				{
					if (isHarmful)
					{
						failedReason = SpellFailedReason.TargetFriendly;
					}
					else
					{
						failedReason = SpellFailedReason.TargetEnemy;
					}
				}
				else if (isHarmful && !target.CanBeHarmed)
				{
					failedReason = SpellFailedReason.NotHere;
				}
			}
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:32,代碼來源:DefaultTargetFilters.cs

示例7: Apply

		protected override void Apply(WorldObject target)
		{
			Unit unit;
			if (target is Unit)
			{
				unit = (Unit) target;
			}
			else if (target is Corpse)
			{
				unit = ((Corpse)target).Owner;
				if (unit == null  || unit.IsAlive)
				{
					return;
				}
			}
			else
			{
				return;
			}

			unit.Health = CalcEffectValue();
			if (((Unit)target).PowerType == PowerType.Mana)
			{
				((Unit)target).Energize(Effect.MiscValue, m_cast.CasterUnit, Effect);
			}
		}
開發者ID:remixod,項目名稱:netServer,代碼行數:26,代碼來源:ResurrectFlat.cs

示例8: Apply

		protected override void Apply(WorldObject target)
		{
			var chr = target as Character;
			chr.TaxiNodes.Activate((uint)Effect.MiscValue);
			TaxiHandler.SendTaxiPathActivated(chr.Client);
			TaxiHandler.SendTaxiPathUpdate(chr.Client, Cast.CasterUnit.EntityId, true);
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:7,代碼來源:TeachFlightPath.cs

示例9: Apply

			protected override void Apply(WorldObject target)
			{
				if (!target.IsPlayer)
				{
					base.Apply(target);
				}
			}
開發者ID:remixod,項目名稱:netServer,代碼行數:7,代碼來源:MiscSpells.cs

示例10: GossipConversation

		/// <summary>
		/// Creates gossip conversation by its fields
		/// </summary>
		/// <param name="menu">starting menu</param>
		/// <param name="chr">character which started the conversation</param>
		/// <param name="speaker">respondent</param>
		public GossipConversation(GossipMenu menu, Character chr, WorldObject speaker, bool keepOpen)
		{
			CurrentMenu = menu;
			Character = chr;
			Speaker = speaker;
			StayOpen = keepOpen;
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:13,代碼來源:GossipConversation.cs

示例11: Apply

        protected override void Apply(WorldObject target)
        {
            var chr = target as Character;

            if (chr != null)
            {
                if (target.IsFriendlyWith(Cast.CasterChar))
                {
                    chr.Auras.RemoveFirstVisibleAura(aura => aura.Spell.HasHarmfulEffects);
                    if (Cast.Spell.Id == (int)SpellId.ClassSkillDispelMagicRank2)
                    {
                        chr.Auras.RemoveFirstVisibleAura(aura => aura.Spell.HasHarmfulEffects);
                    }
                    if (Cast.CasterChar.Spells.Contains(SpellId.GlyphOfDispelMagic) || Cast.CasterChar.Spells.Contains(SpellId.GlyphOfDispelMagic_2))
                    {
                        int amountToHeal = (chr.Health * 3) / 100;
                        chr.Target.Heal(amountToHeal, Cast.CasterChar, Effect);
                    }
                }
                else
                {
                    chr.Auras.RemoveFirstVisibleAura(aura => aura.Spell.HasBeneficialEffects);
                    if (Cast.Spell.Id == (int)SpellId.ClassSkillDispelMagicRank2)
                    {
                        chr.Auras.RemoveFirstVisibleAura(aura => aura.Spell.HasHarmfulEffects);
                    }
                }
            }
        }
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:29,代碼來源:PriestFixes.cs

示例12: Apply

		protected override void Apply(WorldObject target)
		{
			if (target.IsUsingSpell)
			{
				target.SpellCast.Cancel(SpellFailedReason.Interrupted);	
			}
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:7,代碼來源:InterruptCast.cs

示例13: CasterInfo

		public CasterInfo(WorldObject caster)
		{
			CasterId = caster.EntityId;
			Level = caster.CasterLevel;
			m_caster = caster;
			//Faction = caster.Faction;
			//ObjectType = caster.Type;
		}
開發者ID:pallmall,項目名稱:WCell,代碼行數:8,代碼來源:CasterInfo.cs

示例14: Apply

		protected override void Apply(WorldObject target)
		{
			var chr = target as Character;
			if (m_cast.CasterUnit != null && m_cast.CasterUnit is NPC)
			{
				chr.QuestLog.OnNPCInteraction((NPC)m_cast.CasterUnit);
			}
		}
開發者ID:remixod,項目名稱:netServer,代碼行數:8,代碼來源:KillCreditPersonal.cs

示例15: MatchesRequiredTargetType

		public bool MatchesRequiredTargetType(WorldObject obj)
		{
			if (RequiredTargetType == RequiredSpellTargetType.GameObject)
			{
				return obj is GameObject;
			}
			return obj is NPC && ((NPC) obj).IsAlive == (RequiredTargetType == RequiredSpellTargetType.NPCAlive);
		}
開發者ID:WCellFR,項目名稱:WCellFR,代碼行數:8,代碼來源:Spell.Overrides.cs


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