Beispiel #1
0
		public static void CreateTeleportNPC(NPCId id, Vector3 location, MapId mapId, uint phase = WorldObject.DefaultPhase)
		{
			var spawn = new NPCSpawnEntry(id, mapId, location);
			spawn.FinalizeDataHolder();

			spawn.Spawned += npc =>
			{
				npc.Invulnerable++;
				npc.GossipMenu = WorldLocationMgr.CreateTeleMenu();
			};
		}
Beispiel #2
0
        public static void CreateTeleportNPC(NPCId id, Vector3 location, MapId mapId, uint phase = WorldObject.DefaultPhase)
        {
            var spawn = new NPCSpawnEntry(id, mapId, location);

            spawn.FinalizeDataHolder();

            spawn.Spawned += npc =>
            {
                npc.Invulnerable++;
                npc.GossipMenu = WorldLocationMgr.CreateTeleMenu();
            };
        }
Beispiel #3
0
		private static void SetupPrinceKeleseth()
		{
			princeKelesethEntry = NPCMgr.GetEntry(NPCId.PrinceKeleseth);
			princeKelesethEntry.BrainCreator = princeKeleseth => new PrinceKelesethBrain(princeKeleseth);

			PrinceSkeletonEntry = NPCMgr.GetEntry(NPCId.VrykulSkeleton);

			// add spell to prince
			PrinceSkeletonEntry.AddSpell(SpellId.Decrepify);
			SpellHandler.Apply(spell => { spell.CooldownTime = 5000; }, SpellId.Decrepify);

			var princeSpawnEntry = princeKelesethEntry.SpawnEntries[0];
			var poolTemplate = princeSpawnEntry.PoolTemplate;

			// do not let Skeletons decay
			PrinceSkeletonEntry.DefaultDecayDelayMillis = 0;

			// add skeleton spawn entries to pool
			for (var i = 0; i < PrinceSkeletonCount; i++)
			{
				var skelSpawnEntry = new NPCSpawnEntry(PrinceSkeletonEntry.NPCId, MapId.UtgardeKeep, PrinceSkeletonPositions[i])
				{
					AutoSpawns = false,						// must not respawn automatically when dead
					IsDead = true,							// spawn dead
					PoolId = poolTemplate.PoolId			// share Prince' pool
				};
				skelSpawnEntry.FinalizeDataHolder();		// adds to PoolTemplate automatically

				PrinceSkeletonSpawnEntries[i] = skelSpawnEntry;
			}

			// give the prince his AttackAction
			princeKelesethEntry.Activated += prince =>
			{
				var instance = prince.Map as UtgardeKeep;
				if (instance == null || prince.SpawnPoint == null) return;

				((BaseBrain)prince.Brain).DefaultCombatAction.Strategy = new PrinceKelesethAttackAction(prince);

				instance.SpawnDeadPrinceSkeletons(prince);
			};

			// prince deleted
			princeKelesethEntry.Deleted += prince =>
			{
				var instance = prince.Map as UtgardeKeep;
				if (instance == null) return;

				// add this "if", in case a GM spawns more than one prince
				if (instance.PrinceKeleseth == prince)
				{
					// unset PrinceKeleseth object
					instance.PrinceKeleseth = null;
				}
			};

			// prince dies
			princeKelesethEntry.Died += prince =>
			{
				var instance = prince.Map as UtgardeKeep;
				if (instance == null) return;

				// kill all skeletons
				instance.KillPrinceSkeletons();
			};

			// update Skeleton if it dies/lives or gets deleted
			PrinceSkeletonEntry.Activated += UpdateSkeleton;
			PrinceSkeletonEntry.Died += UpdateSkeleton;
			PrinceSkeletonEntry.Deleted += UpdateSkeleton;

			princeKelesethEntry.AddSpell(SpellId.ShadowBolt_73);
			SpellHandler.Apply(spell => { spell.CooldownTime = 10000; },
				SpellId.ShadowBolt_73);

			//Heroic
			//princeKelesethEntry.AddSpell(SpellId.ShadowBolt_99);
			//SpellHandler.Apply(spell => { spell.CooldownTime = 5000; },
			//    SpellId.ShadowBolt_73);

			//princeKelesethEntry.AddSpell(SpellId.FrostTomb_3);

			//princeKelesethEntry.AddSpell(SpellId.FrostTomb_3);

			//princeKelesethEntry.AddSpell(SpellId.FrostTombSummon);

			//princeKelesethEntry.AddSpell(SpellId.Decrepify);

			//princeKelesethEntry.AddSpell(SpellId.ScourgeResurrection);

		}
Beispiel #4
0
        private static void SetupPrinceKeleseth()
        {
            princeKelesethEntry = NPCMgr.GetEntry(NPCId.PrinceKeleseth);
            princeKelesethEntry.BrainCreator = princeKeleseth => new PrinceKelesethBrain(princeKeleseth);

            PrinceSkeletonEntry = NPCMgr.GetEntry(NPCId.VrykulSkeleton);

            // add spell to prince
            PrinceSkeletonEntry.AddSpell(SpellId.Decrepify);
            SpellHandler.Apply(spell => { spell.CooldownTime = 5000; }, SpellId.Decrepify);

            var princeSpawnEntry = princeKelesethEntry.SpawnEntries[0];
            var poolTemplate     = princeSpawnEntry.PoolTemplate;

            // do not let Skeletons decay
            PrinceSkeletonEntry.DefaultDecayDelayMillis = 0;

            // add skeleton spawn entries to pool
            for (var i = 0; i < PrinceSkeletonCount; i++)
            {
                var skelSpawnEntry = new NPCSpawnEntry(PrinceSkeletonEntry.NPCId, MapId.UtgardeKeep, PrinceSkeletonPositions[i])
                {
                    AutoSpawns = false,                                         // must not respawn automatically when dead
                    IsDead     = true,                                          // spawn dead
                    PoolId     = poolTemplate.PoolId                            // share Prince' pool
                };
                skelSpawnEntry.FinalizeDataHolder();                            // adds to PoolTemplate automatically

                PrinceSkeletonSpawnEntries[i] = skelSpawnEntry;
            }

            // give the prince his AttackAction
            princeKelesethEntry.Activated += prince =>
            {
                var instance = prince.Map as UtgardeKeep;
                if (instance == null || prince.SpawnPoint == null)
                {
                    return;
                }

                ((BaseBrain)prince.Brain).DefaultCombatAction.Strategy = new PrinceKelesethAttackAction(prince);

                instance.SpawnDeadPrinceSkeletons(prince);
            };

            // prince deleted
            princeKelesethEntry.Deleted += prince =>
            {
                var instance = prince.Map as UtgardeKeep;
                if (instance == null)
                {
                    return;
                }

                // add this "if", in case a GM spawns more than one prince
                if (instance.PrinceKeleseth == prince)
                {
                    // unset PrinceKeleseth object
                    instance.PrinceKeleseth = null;
                }
            };

            // prince dies
            princeKelesethEntry.Died += prince =>
            {
                var instance = prince.Map as UtgardeKeep;
                if (instance == null)
                {
                    return;
                }

                // kill all skeletons
                instance.KillPrinceSkeletons();
            };

            // update Skeleton if it dies/lives or gets deleted
            PrinceSkeletonEntry.Activated += UpdateSkeleton;
            PrinceSkeletonEntry.Died      += UpdateSkeleton;
            PrinceSkeletonEntry.Deleted   += UpdateSkeleton;

            princeKelesethEntry.AddSpell(SpellId.ShadowBolt_73);
            SpellHandler.Apply(spell => { spell.CooldownTime = 10000; },
                               SpellId.ShadowBolt_73);

            //Heroic
            //princeKelesethEntry.AddSpell(SpellId.ShadowBolt_99);
            //SpellHandler.Apply(spell => { spell.CooldownTime = 5000; },
            //    SpellId.ShadowBolt_73);

            //princeKelesethEntry.AddSpell(SpellId.FrostTomb_3);

            //princeKelesethEntry.AddSpell(SpellId.FrostTomb_3);

            //princeKelesethEntry.AddSpell(SpellId.FrostTombSummon);

            //princeKelesethEntry.AddSpell(SpellId.Decrepify);

            //princeKelesethEntry.AddSpell(SpellId.ScourgeResurrection);
        }