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

C# Entities.NPC类代码示例

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

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



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

示例1: RemoveMob

		public void RemoveMob(NPC npc)
		{
			if (m_Mobs.Remove(npc))
			{
				npc.Group = null;
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:7,代码来源:AIGroup.cs


示例2: SendBattlegroundWindow

        /// <summary>
        /// Sends the packet to show the battleground window
        /// </summary>
        /// <param name="client"></param>
        /// <param name="speaker"></param>
        /// <param name="character"></param>
        /// <returns></returns>
        public bool SendBattlegroundWindow(IRealmClient client, NPC speaker, Character character)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_BATTLEFIELD_LIST))
            {
                packet.WriteULong(speaker != null ? speaker.EntityId.Full : 0);
                packet.WriteUInt((uint)m_bgqueue.Template.BgID);
                packet.WriteByte(m_battlegroupId); //Battle group
				// TODO: Add sync'ing?
                //m_syncLock.EnterReadLock();
                try
                {
                    packet.WriteUInt(m_battlegrounds.Count); //Count

                    foreach (var bg in m_battlegrounds.Values)
                    {
                        packet.WriteUInt(bg.InstanceId);
                    }
                }
                finally
                {
                    //m_syncLock.ExitReadLock();
                }
                client.Send(packet);
                return true;
            }
        }
开发者ID:pallmall,项目名称:WCell,代码行数:33,代码来源:BattleRange.cs


示例3: RepairItem

		public static void RepairItem(IRealmClient client, NPC armorer, EntityId itemId, bool useGuildFunds)
		{
			var curChar = client.ActiveCharacter;

			uint totalCost = 0;
			if (itemId.Low != 0)
			{
				// Repairing an individual item.
				var item = GetItemByEntityId(curChar, itemId);
				if (item == null)
					return;
				if (!ArmorerCheatChecks(curChar, armorer, item))
					return;
				totalCost += RepairItem(curChar, armorer, item, useGuildFunds);
			}
			else
			{
				// Case Repair all
				if (!ArmorerCheatChecks(curChar, armorer))
					return;
				totalCost += RepairAllItems(curChar, armorer, useGuildFunds);
			}

			if (useGuildFunds)
			{
				/****************************
				 * TODO: record the funds usage in the guild log
				 ****************************/
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:30,代码来源:ArmorerMgr.cs


示例4: Apply

		protected internal override void Apply()
		{
			npc = (NPC)m_aura.Auras.Owner;
			if (caster != null && caster.IsInWorld)
			{
				npc.ThreatCollection.Taunter = caster;
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:8,代码来源:ModTaunt.cs


示例5: UnworthyInitiateActivated

		private static void UnworthyInitiateActivated(NPC npc)
		{
			npc.StandState = StandState.Kneeling;
			npc.AddMessage(
				() =>
					{
						var nearest = npc.GetNearbyNPC(NPCId.UnworthyInitiateAnchor, 7);
						if (nearest == null) return;
						nearest.SpellCast.Trigger(SpellId.ChainedPeasantChest, npc);
					});
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:11,代码来源:DKAcherusCorrections.cs


示例6: RepairAllItems

		private static uint RepairAllItems(Character curChar, NPC armorer, bool useGuildFunds)
		{
			uint totalCost = 0;

			// Repair all items in the Backpack and Bags
			curChar.Inventory.Iterate(false, invItem => {
				if (invItem.MaxDurability > 0)
					totalCost += RepairItem(curChar, armorer, invItem, useGuildFunds);
				return true;
			});
			return totalCost;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:12,代码来源:ArmorerMgr.cs


示例7: PrepareEncounter

		/// <summary>
		/// Prepare Svala and Artha's Mirror
		/// </summary>
		void PrepareEncounter(NPC svala)
		{
			m_svala = svala;

			m_arthasMirror = arthasMirrorEntry.Create(DifficultyIndex);
			m_arthasMirror.Orientation = 1.58825f;
			AddObject(m_arthasMirror, arthasPosition);

			// big bosses are idle
			m_arthasMirror.Brain.State = BrainState.Idle;
			svala.Brain.State = BrainState.Idle;
		}
开发者ID:Zerant,项目名称:WCell,代码行数:15,代码来源:UtgardePinnacle.cs


示例8: TestBrain

		public TestBrain(NPC owner) : base(owner)
		{
			var spawn = owner.SpawnPoint;
			if (spawn != null)
			{
				var spawnEntry = spawn.SpawnEntry;

				if (spawnEntry != null)
				{
					m_waypoints = spawnEntry.Waypoints;
				}
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:13,代码来源:TestBrain.cs


示例9: SendMirrorImageData

		public static void SendMirrorImageData(IRealmClient client, NPC mirrorimage)
		{
			var owner = mirrorimage.PlayerOwner;

			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_MIRRORIMAGE_DATA, 68))
			{
				packet.Write(mirrorimage.EntityId);
				packet.Write(owner.DisplayId);
				if (owner != null) //player
				{
					packet.Write((byte)owner.Race);
					packet.Write((byte)owner.Gender);
					packet.Write((byte)owner.Class);
					packet.Write(owner.Skin);
					packet.Write(owner.Facial);
					packet.Write(owner.HairStyle);
					packet.Write(owner.HairColor);
					packet.Write(owner.FacialHair);
					packet.Write(owner.GuildId);

					foreach(VisibleEquipmentSlot slot in Enum.GetValues(typeof(VisibleEquipmentSlot)))
					{
						var item = owner.Inventory.Equipment[(EquipmentSlot)slot];
						if (slot == VisibleEquipmentSlot.Head && ((owner.PlayerFlags & PlayerFlags.HideHelm) != 0))
						{
							packet.Write(0);
						}
						else if (slot == VisibleEquipmentSlot.Back && ((owner.PlayerFlags & PlayerFlags.HideCloak) != 0))
						{
							packet.Write(0);
						}
						else if (item != null)
						{
							packet.Write(item.Template.DisplayId);
						}
						else
							packet.Write(0);
					}
					
				}
				else //creature
				{
					for (int i = 0; i < 14; i++)
					{
						packet.Write(0);
					}

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


示例10: NPCSpellCollection

		public NPCSpellCollection(NPC owner)
			: base(owner, false)
		{
			m_byId = owner.Entry.Spells;
			m_readySpells = new List<Spell>();
			if (m_byId != null)
			{
				m_defaultSpells = true;
				foreach (var spell in m_byId.Values)
				{
					AddReadySpell(spell);
					OnNewSpell(spell);
				}
			}
			else
			{
				m_defaultSpells = false;
				m_byId = new Dictionary<uint, Spell>(5);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:20,代码来源:NPCSpellCollection.cs


示例11: VendorEntry

        public VendorEntry(NPC npc, List<VendorItemEntry> items)
        {
            NPC = npc;

            if (items != null)
            {
                foreach (var item in items)
                {
                    ItemsForSale.Add(new VendorItemEntry
                    {
                        BuyStackSize = item.BuyStackSize,
                        RemainingStockAmount = item.RemainingStockAmount,
                        ExtendedCostEntry = NPCMgr.ItemExtendedCostEntries[(int)item.ExtendedCostId],
                        StockAmount = item.StockAmount,
                        StockRefillDelay = item.StockRefillDelay,
                        Template = item.Template
                    });
                }
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:20,代码来源:VendorEntry.cs


示例12: GetSkeletonIndex

		/// <summary>
		/// Returns the index of the given skeleton for the skeleton arrays
		/// </summary>
		static int GetSkeletonIndex(NPC skel)
		{
			if (skel.SpawnPoint == null)
			{
				// unrelated Skeleton
				return -1;
			}

			for (var i = 0; i < PrinceSkeletonSpawnEntries.Length; i++)
			{
				var spawn = PrinceSkeletonSpawnEntries[i];
				if (spawn == skel.SpawnPoint.SpawnEntry)
				{
					return i;
				}
			}

			// unrelated Skeleton
			return -1;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:23,代码来源:UtgardeKeep.cs


示例13: OnBeforeAmbusherDeath

		private static bool OnBeforeAmbusherDeath(NPC ambusher)
		{
			if (ambusher.FirstAttacker is Character)
			{
				var killer = (Character)ambusher.FirstAttacker;
				if (!killer.QuestLog.HasActiveQuest(AmbusherQuest))
				{
					// quest isn't active
					return true;
				}

				// say something
				ambusher.Say("Oh kind sir, please don't kill me!");

				// discarded the idea of the backstabber:
				//ambusher.MoveBehindThenExecute(killer,
				//    attacker => attacker.SpellCast.Start(SpellId.ClassSkillBackstabRank1, false, killer));

				// cast some AoE spell (ignoring all restrictions)
				ambusher.SpellCast.Trigger(SpellId.ClassSkillFrostNovaRank6);

				// Is now friendly with everyone
				ambusher.FactionId = FactionId.Friendly;

				// more health than ever before (not necessary here)
				ambusher.BaseHealth = ambusher.Health = 100000;

				// won't do anything stupid anymore
				ambusher.Brain.DefaultState = BrainState.Idle;
				ambusher.Brain.EnterDefaultState();

				// never leave the killer alone: Approach again and again...
				ambusher.CallPeriodically(2000,
					obj => SeekForgiveness(ambusher, killer));

				return false; 		// return false to indicate that the guy didn't die
			}
			return true;			// die
		}
开发者ID:remixod,项目名称:netServer,代码行数:39,代码来源:AmbusherQuestSample.cs


示例14: OnMinionDied

		internal protected virtual void OnMinionDied(NPC minion)
		{
		}
开发者ID:ray2006,项目名称:WCell,代码行数:3,代码来源:Unit.cs


示例15: Enslave

		public void Enslave(NPC minion, int durationMillis)
		{
			//Enslave(minion, durationMillis != 0 ? DateTime.Now.AddMilliseconds(durationMillis) : (DateTime?)null);

			minion.Phase = Phase;
			minion.Master = this;

			var type = minion.Entry.Type;
			if (type != CreatureType.None && type != CreatureType.NotSpecified)
			{
				if (type == CreatureType.NonCombatPet)
				{
					minion.Brain.DefaultState = BrainState.Follow;
				}
				else if (type == CreatureType.Totem)
				{
					// can't move
					minion.Brain.DefaultState = BrainState.Roam;
				}
				else
				{
					minion.Brain.DefaultState = BrainState.Guard;
				}

				minion.Brain.EnterDefaultState();
			}

			if (durationMillis != 0)
			{
				// ReSharper disable PossibleLossOfFraction
				minion.RemainingDecayDelay = durationMillis / 1000;
				// ReSharper restore PossibleLossOfFraction
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:34,代码来源:Unit.cs


示例16: OnTalkWith

        /// <summary>
        /// Called when interacting with an NPC.
        /// </summary>
        public void OnTalkWith(NPC npc)
        {
            var reputationIndex = npc.Faction.ReputationIndex;
            
            // Does this faction even have a rep?
			if (reputationIndex < 0 || reputationIndex >= FactionReputationIndex.End) return;

            Reputation rep = GetOrCreate(reputationIndex);
            
            // Faction is now visible
            if (!rep.IsForcedInvisible)
            {
                rep.IsVisible = true;

                // Let the client know the Faction is visible
                FactionHandler.SendVisible(m_owner.Client, reputationIndex);
            }
        }
开发者ID:WCellFR,项目名称:WCellFR,代码行数:21,代码来源:ReputationCollection.cs


示例17: Obtain

		public static NPCSpellCollection Obtain(NPC npc)
		{
			var spells = NPCSpellCollectionPool.Obtain();
			spells.Initialize(npc);
			return spells;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:6,代码来源:NPCSpellCollection.cs


示例18: OggleflintAttackAction

		public OggleflintAttackAction(NPC oggleflint)
			: base(oggleflint)
		{
		}
开发者ID:Zerant,项目名称:WCell,代码行数:4,代码来源:RagefireChasm.cs


示例19: BazzalanAttackAction

		public BazzalanAttackAction(NPC bazzalan)
			: base(bazzalan)
		{
		}
开发者ID:Zerant,项目名称:WCell,代码行数:4,代码来源:RagefireChasm.cs


示例20: JergoshAttackAction

		public JergoshAttackAction(NPC jergosh)
			: base(jergosh)
		{
		}
开发者ID:Zerant,项目名称:WCell,代码行数:4,代码来源:RagefireChasm.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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