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


C# NPCs.NPCEntry類代碼示例

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


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

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

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

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

示例4: SetupGrizzly

		static void SetupGrizzly()
		{
			// default settings
			GrizzlyBear = new NPCEntry
			{
				Id = BearId,
				DefaultName = "Sample Grizzly",
				EntryFlags = NPCEntryFlags.Tamable,
				Type = CreatureType.Humanoid,
				DisplayIds = new[] { 21635u },
				Scale = 1,
				MinLevel = 73,
				MaxLevel = 74,
				HordeFactionId = FactionTemplateId.Monster_2,
				MinHealth = 100000,
				MaxHealth = 500000,
				AttackPower = 314,
				AttackTime = 1500,
				MinDamage = 250,
				MaxDamage = 360,
				WalkSpeed = 2.5f,
				RunSpeed = 8f,
				FlySpeed = 14f,

				MinMana = 2000
			};

			GrizzlyBear.SetResistance(DamageSchool.Physical, 7600);

			// AOE damage spell
			GrizzlyBear.AddSpell(SpellId.ConeOfFire);

			// A spell with a freeze debuff
			GrizzlyBear.AddSpell(SpellId.Chilled);

			// Sample gossip menu
			GossipMgr.AddText(sampleGossipTextId, new GossipText
			{
				Probability = 1,
				TextMale = "Sample Gossip Menu",
				TextFemale = "Take a good look"
			});
			GrizzlyBear.DefaultGossip = CreateSampleGossipMenu();

			GrizzlyBear.FinalizeDataHolder();

			//NPCMgr.AddEntry(BearId, GrizzlyBear);
		}
開發者ID:MeaNone,項目名稱:WCell,代碼行數:48,代碼來源:MixedSamples.cs

示例5: CanSummon

		public virtual bool CanSummon(SpellCast cast, NPCEntry entry)
		{
			return true;
		}
開發者ID:MeaNone,項目名稱:WCell,代碼行數:4,代碼來源:SpellSummons.cs

示例6: SetupNPC

        protected internal virtual void SetupNPC(NPCEntry entry, NPCSpawnPoint spawnPoint)
        {
            NPCSpawnEntry spawnEntry;
            if (spawnPoint != null)
            {
                // Spawn-specific information
                spawnEntry = spawnPoint.SpawnEntry;
                m_spawnPoint = spawnPoint;
                Phase = spawnEntry.Phase;
                m_orientation = spawnEntry.Orientation;

                if (spawnEntry.DisplayIdOverride != 0)
                {
                    DisplayId = spawnEntry.DisplayIdOverride;
                }
            }
            else
            {
                Phase = 1;
                spawnEntry = entry.FirstSpawnEntry;
            }

            GenerateId(entry.Id);

            SetEntry(entry);
        }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:26,代碼來源:NPC.cs

示例7: SpawnMinion

 public override NPC SpawnMinion(NPCEntry entry, ref Vector3 position, int durationMillis)
 {
     var minion = base.SpawnMinion(entry, ref position, durationMillis);
     if (Group == null)
     {
         Group = new AIGroup(this);
     }
     Group.Add(minion);
     return minion;
 }
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:10,代碼來源:NPC.cs

示例8: SetEntry

        public void SetEntry(NPCEntry entry)
        {
            Entry = entry;

            if (m_spawnPoint == null || m_spawnPoint.SpawnEntry.DisplayIdOverride == 0)
            {
                if (entry.ModelInfos.Length > 0)
                {
                    Model = entry.ModelInfos.GetRandom();
                }
            }
            NativeDisplayId = DisplayId;

            if (m_brain == null)
            {
                // new brain
                m_brain = m_entry.BrainCreator(this);
                m_brain.IsRunning = true;
            }

            if (m_Movement == null)
            {
                m_Movement = new Movement(this);
            }

            // misc stuff
            Name = m_entry.DefaultName;
            NPCFlags = entry.NPCFlags;
            UnitFlags = entry.UnitFlags;
            DynamicFlags = entry.DynamicFlags;
            Class = entry.ClassId;
            Race = entry.RaceId;
            YieldsXpOrHonor = entry.GeneratesXp;
            SheathType = SheathType.Melee;

            // decide which faction
            if (m_spawnPoint != null)
            {
                var map = m_spawnPoint.Map;
                if (map != null)
                {
                    Faction = DefaultFaction;
                }
            }
            if (Faction == null)
            {
                Faction = entry.RandomFaction;
            }

            // speeds
            m_runSpeed = entry.RunSpeed;
            m_swimSpeed = entry.RunSpeed;
            m_swimBackSpeed = entry.RunSpeed;
            m_walkSpeed = entry.WalkSpeed;
            m_walkBackSpeed = entry.WalkSpeed;
            m_flightSpeed = entry.FlySpeed;
            m_flightBackSpeed = entry.FlySpeed;

            Array.Copy(entry.Resistances, m_baseResistances, m_baseResistances.Length);

            MainWeapon = m_entry.CreateMainHandWeapon();
            RangedWeapon = m_entry.CreateRangedWeapon();
            OffHandWeapon = entry.CreateOffhandWeapon();

            // Set model after Scale
            Model = m_entry.GetRandomModel();

            GossipMenu = entry.DefaultGossip; // set gossip menu

            // TODO: Init stats
            //for (int i = 0; i < 5; i++)
            //{
            //    m_baseStats[i] = statVal;
            //}
            PowerType = PowerType.Mana;
            SetBaseStat(StatType.Strength, 1, false);
            SetBaseStat(StatType.Agility, 1, false);
            SetBaseStat(StatType.Intellect, 1, false);
            SetBaseStat(StatType.Stamina, 1, false);
            SetBaseStat(StatType.Spirit, 1, false);

            // health + power
            var health = entry.GetRandomHealth();
            SetInt32(UnitFields.MAXHEALTH, health);
            SetInt32(UnitFields.BASE_HEALTH, health);

            if (m_entry.IsDead || m_spawnPoint == null || !m_spawnPoint.SpawnEntry.IsDead)
            {
                SetInt32(UnitFields.HEALTH, health);
            }
            else if (m_entry.Regenerates)
            {
                Regenerates = true;
                HealthRegenPerTickNoCombat = Math.Max(m_entry.MaxHealth / 10, 1);
            }

            var mana = entry.GetRandomMana();
            if (mana == 0)
            {
                SetInt32(UnitFields.MAXPOWER1, 1);
//.........這裏部分代碼省略.........
開發者ID:ebakkedahl,項目名稱:WCell,代碼行數:101,代碼來源:NPC.cs

示例9: InitNPCs

		public static void InitNPCs()
		{
			LadySarevessEntry = NPCMgr.GetEntry(NPCId.LadySarevess);
			LadySarevessEntry.Activated += LadySarevess =>
			{
				((BaseBrain)LadySarevess.Brain).DefaultCombatAction.Strategy = new SarevessAttackAction(LadySarevess);
			};

			GelihastEntry = NPCMgr.GetEntry(NPCId.Gelihast);
			GelihastEntry.Activated += Gelihast =>
			{
				((BaseBrain)Gelihast.Brain).DefaultCombatAction.Strategy = new GelihastAttackAction(Gelihast);
			};

			LorgusJettEntry = NPCMgr.GetEntry(NPCId.LorgusJett);
			LorgusJettEntry.Activated += LorgusJett =>
			{
				((BaseBrain)LorgusJett.Brain).DefaultCombatAction.Strategy = new LorgusJettAttackAction(LorgusJett);
			};

			LordKelrisEntry = NPCMgr.GetEntry(NPCId.TwilightLordKelris);
			LordKelrisEntry.Activated += LordKelris =>
			{
				((BaseBrain)LordKelris.Brain).DefaultCombatAction.Strategy = new LordKelrisAttackAction(LordKelris);
			};

			AkuMaiEntry = NPCMgr.GetEntry(NPCId.AkuMai);
			AkuMaiEntry.Activated += AkuMai =>
			{
				((BaseBrain)AkuMai.Brain).DefaultCombatAction.Strategy = new AkuMaiAttackAction(AkuMai);
			};
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:32,代碼來源:BlackfathomDeeps.cs

示例10: InitNPCs

		public static void InitNPCs()
		{
			// KamDeepfury
			kamdeepfuryEntry = NPCMgr.GetEntry(NPCId.KamDeepfury);
			kamdeepfuryEntry.Activated += kamdeepfury =>
			{
				((BaseBrain)kamdeepfury.Brain).DefaultCombatAction.Strategy = new KamdeepfuryAttackAction(kamdeepfury);
			};

			// Hamhock
			hamhockEntry = NPCMgr.GetEntry(NPCId.Hamhock);
			hamhockEntry.Activated += hamhock =>
			{
				((BaseBrain)hamhock.Brain).DefaultCombatAction.Strategy = new HamhockAttackAction(hamhock);
			};

			// Bazil
			bazilThreddEntry = NPCMgr.GetEntry(NPCId.BazilThredd);
			bazilThreddEntry.Activated += bazilthredd =>
			{
				((BaseBrain)bazilthredd.Brain).DefaultCombatAction.Strategy = new BazilThreddAttackAction(bazilthredd);
			};

			// Dextren
			dextrenEntry = NPCMgr.GetEntry(NPCId.DextrenWard);
			dextrenEntry.Activated += dextren =>
			{
				((BaseBrain)dextren.Brain).DefaultCombatAction.Strategy = new DextrenAttackAction(dextren);
			};

			// Defias Inmate
			inmateEntry = NPCMgr.GetEntry(NPCId.DefiasInmate);
			inmateEntry.Activated += inmate =>
			{
				((BaseBrain)inmate.Brain).DefaultCombatAction.Strategy = new InmateAttackAction(inmate);
			};

			// Defias Insurgent
			insurgentEntry = NPCMgr.GetEntry(NPCId.DefiasInsurgent);
			insurgentEntry.Activated += insurgent =>
			{
				((BaseBrain)insurgent.Brain).DefaultCombatAction.Strategy = new InsurgentAttackAction(insurgent);
			};

			// Defias Prisoner
			prisonerEntry = NPCMgr.GetEntry(NPCId.DefiasPrisoner);
			prisonerEntry.Activated += prisoner =>
			{
				((BaseBrain)prisoner.Brain).DefaultCombatAction.Strategy = new PrisonerAttackAction(prisoner);
			};

			// Defias Convict
			convictEntry = NPCMgr.GetEntry(NPCId.DefiasConvict);
			convictEntry.Activated += convict =>
			{
				((BaseBrain)convict.Brain).DefaultCombatAction.Strategy = new ConvictAttackAction(convict);
			};
		}
開發者ID:zhangyang,項目名稱:WCell,代碼行數:58,代碼來源:TheStockades.cs

示例11: InitNPCs

 public static void InitNPCs()
 {
     MarrowgarEntry = NPCMgr.GetEntry(NPCId.LordMarrowgar);
     MarrowgarEntry.BrainCreator = marrowgar => new MarrowgarBrain(marrowgar);
     MarrowgarEntry.Activated += marrowgar =>
     {
         ((BaseBrain)marrowgar.Brain).DefaultCombatAction.Strategy = new MarrowgarAIAttackAction(marrowgar);
     };
 }
開發者ID:NVN,項目名稱:WCell,代碼行數:9,代碼來源:IcecrownCitadel.cs

示例12: InitNPCs

        public static void InitNPCs()
        {
            //Pandemonius
            pandemoniusEntry = NPCMgr.GetEntry(NPCId.Pandemonius);
            pandemoniusEntry.BrainCreator = pandemonius => new PandemoniusBrain(pandemonius);
            pandemoniusEntry.AddSpells(pandemoniusSpells);

			SpellHandler.Apply(spell => spell.AISettings.SetCooldown(15000, 25000), SpellId.VoidBlast);
			SpellHandler.Apply(spell => spell.CooldownTime = 20000, SpellId.DarkShell);
        }
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:10,代碼來源:AuchindounManaTombs.cs

示例13: Initialize

		public override void Initialize(ref SpellFailedReason failReason)
		{
			var id = (NPCId)Effect.MiscValue;
			entry = NPCMgr.GetEntry(id);
			if (entry == null)
			{
				LogManager.GetCurrentClassLogger().Warn("The NPC for Summon-Spell {0} does not exist: {1} (Are NPCs loaded?)", Effect.Spell, id);
				failReason = SpellFailedReason.Error;
				return;
			}
		}
開發者ID:NVN,項目名稱:WCell,代碼行數:11,代碼來源:Summon.cs

示例14: InitNPCs

		public static void InitNPCs()
		{
//          Oggleflint
			oggleflintEntry = NPCMgr.GetEntry(NPCId.Oggleflint);
			oggleflintEntry.AddSpell(SpellId.Cleave);            
			oggleflintEntry.Activated += oggleflint =>
			{
				var brain = (BaseBrain)oggleflint.Brain;
				var combatAction = (AICombatAction)brain.Actions[BrainState.Combat];
				combatAction.Strategy = new OggleflintAttackAction(oggleflint);
                oggleflint.AddProcHandler(cleave);
			};

//          Taragaman the Hungerer
			taragamanEntry = NPCMgr.GetEntry(NPCId.TaragamanTheHungerer);
//          taragamanEntry.AddSpell(SpellId.Uppercut);  //Not working properly
			taragamanEntry.AddSpell(SpellId.FireNova);
			taragamanEntry.Activated += taragaman =>
			{
				var brain = (BaseBrain)taragaman.Brain;
				var combatAction = (AICombatAction)brain.Actions[BrainState.Combat];
				combatAction.Strategy = new TaragamanAttackAction(taragaman);
//              taragaman.AddProcHandler(uppercut);  //Currently not working
                taragaman.AddProcHandler(firenova); 
            };

//          Jergosh the Invoker
			jergoshEntry = NPCMgr.GetEntry(NPCId.JergoshTheInvoker);
			jergoshEntry.AddSpell(SpellId.CurseOfWeakness);
			jergoshEntry.AddSpell(SpellId.Immolate);
			jergoshEntry.Activated += jergosh =>
			{
				var brain = (BaseBrain)jergosh.Brain;
				var combatAction = (AICombatAction)brain.Actions[BrainState.Combat];
				combatAction.Strategy = new JergoshAttackAction(jergosh);
                jergosh.AddProcHandler(weakness);
                jergosh.AddProcHandler(immolate);
			};

//          Bazzalan
			bazzalanEntry = NPCMgr.GetEntry(NPCId.Bazzalan);
			bazzalanEntry.AddSpell(SpellId.Poison);
			bazzalanEntry.AddSpell(SpellId.SinisterStrike);
			bazzalanEntry.Activated += bazzalan =>
			{
				var brain = (BaseBrain)bazzalan.Brain;
				var combatAction = (AICombatAction)brain.Actions[BrainState.Combat];
				combatAction.Strategy = new BazzalanAttackAction(bazzalan);
                bazzalan.AddProcHandler(poison);
                bazzalan.AddProcHandler(sstrike);
			};
		}
開發者ID:Zerant,項目名稱:WCell,代碼行數:52,代碼來源:RagefireChasm.cs

示例15: InitNPCs

        public static void InitNPCs()
        {
            // (!)Rethilgore
            rethilgoreEntry = NPCMgr.GetEntry(3914);
            rethilgoreEntry.AddSpell((SpellId)7295);		// add Rethilgore Spell
            rethilgoreEntry.BrainCreator = rethilgore => new RethilgoreBrain(rethilgore);

            // Rethilgore spell has a cooldown of about 30s
            SpellHandler.Apply(spell => { spell.CooldownTime = 30000; }, (SpellId)7295);


            // (!)Baron Silverlaine
            baronsilverlaineEntry = NPCMgr.GetEntry(3887);
            baronsilverlaineEntry.AddSpell((SpellId)7068);

            SpellHandler.Apply(spell => { spell.CooldownTime = 15000; }, (SpellId)7068);


            // (!)Commander Springvale
            commanderspringvaleEntry = NPCMgr.GetEntry(4278);
            commanderspringvaleEntry.AddSpell((SpellId)5588);
            commanderspringvaleEntry.AddSpell((SpellId)31713);

            SpellHandler.Apply(spell => { spell.CooldownTime = 60000; }, (SpellId)5588);
            SpellHandler.Apply(spell => { spell.CooldownTime = 45000; }, (SpellId)31713);


            // (!)Odo the Blindwatcher
            blindwatcherEntry = NPCMgr.GetEntry(4279);
            blindwatcherEntry.AddSpell((SpellId)7484);

            SpellHandler.Apply(spell => { spell.CooldownTime = 60000; }, (SpellId)7484);


            // (!)Fenrus the Devourer
            fenrusEntry = NPCMgr.GetEntry(4274);
            fenrusEntry.AddSpell((SpellId)7125);
            fenrusEntry.BrainCreator = fenrus => new FenrusBrain(fenrus);

            SpellHandler.Apply(spell => { spell.CooldownTime = 60000; }, (SpellId)7125);


            // (!)Archmage Arugal
            arugalEntry = NPCMgr.GetEntry(4275);
            arugalEntry.AddSpell((SpellId)7803);
            arugalEntry.AddSpell((SpellId)7588);

            SpellHandler.Apply(spell => { spell.CooldownTime = 25000; }, (SpellId)7803);
            SpellHandler.Apply(spell => { spell.CooldownTime = 40000; }, (SpellId)7588);
        }
開發者ID:pallmall,項目名稱:WCell,代碼行數:50,代碼來源:ShadowfangKeep.cs


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