当前位置: 首页>>代码示例>>C#>>正文


C# GameNPC.SwitchWeapon方法代码示例

本文整理汇总了C#中GameNPC.SwitchWeapon方法的典型用法代码示例。如果您正苦于以下问题:C# GameNPC.SwitchWeapon方法的具体用法?C# GameNPC.SwitchWeapon怎么用?C# GameNPC.SwitchWeapon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameNPC的用法示例。


在下文中一共展示了GameNPC.SwitchWeapon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Ydenia Philpott", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                ydeniaPhilpott = new GameNPC();
                ydeniaPhilpott.Model = 6;
                ydeniaPhilpott.Name = "Ydenia Philpott";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + ydeniaPhilpott.Name + ", creating him ...");
                ydeniaPhilpott.GuildName = "Part of " + questTitle + " Quest";
                ydeniaPhilpott.Realm = eRealm.Albion;
                ydeniaPhilpott.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 227);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 80);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 54);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 51);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 52);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 53);
                ydeniaPhilpott.Inventory = template.CloseTemplate();
                ydeniaPhilpott.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                ydeniaPhilpott.Size = 51;
                ydeniaPhilpott.Level = 40;
                ydeniaPhilpott.X = 559315;
                ydeniaPhilpott.Y = 510705;
                ydeniaPhilpott.Z = 2488;
                ydeniaPhilpott.Heading = 3993;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    ydeniaPhilpott.SaveIntoDatabase();

                ydeniaPhilpott.AddToWorld();
            }
            else
                ydeniaPhilpott = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Elvar Tambor", eRealm.Albion);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Elvar Tambor, creating him ...");
                elvarTambor = new GameNPC();
                elvarTambor.Model = 9;
                elvarTambor.Name = "Elvar Tambor";
                elvarTambor.GuildName = "Part of " + questTitle + " Quest";
                elvarTambor.Realm = eRealm.Albion;
                elvarTambor.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 3);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 159, 67);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 160, 63);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 156, 67);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 157, 63);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 158, 67);
                elvarTambor.Inventory = template.CloseTemplate();
                elvarTambor.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                elvarTambor.Size = 50;
                elvarTambor.Level = 15;
                elvarTambor.X = 574711;
                elvarTambor.Y = 529887;
                elvarTambor.Z = 2896;
                elvarTambor.Heading = 2366;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    elvarTambor.SaveIntoDatabase();
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:YdeniasCrush.cs

示例2: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Godeleva Dowden", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                godelevaDowden = new GameNPC();
                godelevaDowden.Model = 7;
                godelevaDowden.Name = "Godeleva Dowden";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + godelevaDowden.Name + ", creating him ...");
                godelevaDowden.GuildName = "Part of " + questTitle + " Quest";
                godelevaDowden.Realm = eRealm.Albion;
                godelevaDowden.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 138);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 135);
                godelevaDowden.Inventory = template.CloseTemplate();
                godelevaDowden.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                godelevaDowden.Size = 48;
                godelevaDowden.Level = 40;
                godelevaDowden.X = 559528;
                godelevaDowden.Y = 510953;
                godelevaDowden.Z = 2488;
                godelevaDowden.Heading = 1217;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    godelevaDowden.SaveIntoDatabase();

                godelevaDowden.AddToWorld();
            }
            else
                godelevaDowden = npcs[0];

            #endregion

            #region defineItems

            // item db check
            woodenBucket = GameServer.Database.FindObjectByKey<ItemTemplate>("wooden_bucket");
            if (woodenBucket == null)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Wooden Bucket, creating it ...");
                woodenBucket = new ItemTemplate();
                woodenBucket.Name = "Wooden Bucket";
                woodenBucket.Level = 1;
                woodenBucket.Weight = 10;
                woodenBucket.Model = 1610;

                woodenBucket.Object_Type = (int)eObjectType.GenericItem;
                woodenBucket.Id_nb = "wooden_bucket";
                woodenBucket.Price = 0;
                woodenBucket.IsPickable = false;
                woodenBucket.IsDropable = false;

                woodenBucket.Quality = 100;
                woodenBucket.Condition = 1000;
                woodenBucket.MaxCondition = 1000;
                woodenBucket.Durability = 1000;
                woodenBucket.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(woodenBucket);
            }

            // item db check
            fullWoodenBucket = GameServer.Database.FindObjectByKey<ItemTemplate>("full_wooden_bucket");
            if (fullWoodenBucket == null)
//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DAoC,代码行数:101,代码来源:GodelevasNeed.cs

示例3: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Blercyn", eRealm.Hibernia);

            /* Whops, if the npcs array length is 0 then no npc exists in
             * this users Mob Database, so we simply create one ;-)
             * else we take the existing one. And if more than one exist, we take
             * the first ...
             */
            if (npcs.Length == 0)
            {
                Blercyn = new GameNPC();
                Blercyn.Model = 700;
                Blercyn.Name = "Blercyn";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Blercyn.Name + ", creating him ...");
                //Blercyn.GuildName = "Part of " + questTitle + " Quest";
                Blercyn.Realm = eRealm.Hibernia;
                Blercyn.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
                Blercyn.Inventory = template.CloseTemplate();
                Blercyn.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Blercyn.Size = 50;
                Blercyn.Level = 50;
                Blercyn.X = 348614;
                Blercyn.Y = 492141;
                Blercyn.Z = 5199;
                Blercyn.Heading = 1539;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    Blercyn.SaveIntoDatabase();

                Blercyn.AddToWorld();
            }
            else
                Blercyn = npcs[0];

            //Pompin The Crier
            npcs = WorldMgr.GetNPCsByName("Epona", eRealm.Hibernia);
            if (npcs.Length == 0)
            {
                Epona = new GameNPC();
                Epona.Model = 10;
                Epona.Name = "Epona";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Epona.Name + ", creating him ...");
                //Blercyn.GuildName = "Part of " + questTitle + " Quest";
                Epona.Realm = eRealm.Hibernia;
                Epona.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58);
                Epona.Inventory = template.CloseTemplate();
                Epona.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Epona.Size = 50;
                Epona.Level = 50;
                Epona.X = 347606;
                Epona.Y = 490658;
                Epona.Z = 5227;
                Epona.Heading = 1342;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    Epona.SaveIntoDatabase();

                Epona.AddToWorld();
            }
            else
                Epona = npcs[0];

            #endregion defineNPCS

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Blercyn, GameLivingEvent.Interact, new DOLEventHandler(TalkToBlercyn));
            GameEventMgr.AddHandler(Blercyn, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToBlercyn));

            GameEventMgr.AddHandler(Epona, GameLivingEvent.Interact, new DOLEventHandler(TalkToEpona));
            GameEventMgr.AddHandler(Epona, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToEpona));

            Blercyn.AddQuestToGive(typeof(SearchForKnowledge));
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:SearchForKnowledge.cs

示例4: GetMasterFrederick

        public static GameNPC GetMasterFrederick()
        {
            GameNPC[] npcs = WorldMgr.GetNPCsByName("Master Frederick", eRealm.Albion);

            GameNPC masterFrederick = null;

            if (npcs.Length == 0)
            {
                masterFrederick = new GameNPC();
                masterFrederick.Model = 32;
                masterFrederick.Name = "Master Frederick";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + masterFrederick.Name + ", creating him ...");
                masterFrederick.GuildName = "Part of Frederick Quests";
                masterFrederick.Realm = eRealm.Albion;
                masterFrederick.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 41);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 42);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.Cloak, 91);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 4);
                masterFrederick.Inventory = template.CloseTemplate();
                masterFrederick.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.TORSO, 41, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.LEG, 42, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.BOOT, 40, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.CLOAK, 91, 0, 0, 0);
            //				masterFrederick.AddNPCEquipment((byte) eVisibleItems.RIGHT_HAND, 4, 0, 0, 0);

                masterFrederick.Size = 50;
                masterFrederick.Level = 50;
                masterFrederick.X = 567969;
                masterFrederick.Y = 509880;
                masterFrederick.Z = 2861;
                masterFrederick.Heading = 65;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                masterFrederick.SetOwnBrain(brain);

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    masterFrederick.SaveIntoDatabase();

                masterFrederick.AddToWorld();
            }
            else
                masterFrederick = npcs[0];

            return masterFrederick;
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:57,代码来源:BaseFrederickQuest.cs

示例5: CreateDunwynClone

        protected void CreateDunwynClone()
        {
            GameNpcInventoryTemplate template;
            if (dunwynClone == null)
            {
                dunwynClone = new GameNPC();
                dunwynClone.Name = "Master Dunwyn";
                dunwynClone.Model = 9;
                dunwynClone.GuildName = "Part of " + questTitle + " Quest";
                dunwynClone.Realm = eRealm.Albion;
                dunwynClone.CurrentRegionID = 1;
                dunwynClone.Size = 50;
                dunwynClone.Level = 14;

                dunwynClone.X = GameLocation.ConvertLocalXToGlobalX(8602, 0) + Util.Random(-150, 150);
                dunwynClone.Y = GameLocation.ConvertLocalYToGlobalY(47193, 0) + Util.Random(-150, 150);
                dunwynClone.Z = 2409;
                dunwynClone.Heading = 342;

                template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 798);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 19);
                dunwynClone.Inventory = template.CloseTemplate();
                dunwynClone.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				dunwynClone.AddNPCEquipment((byte) eEquipmentItems.TORSO, 798, 0, 0, 0);
            //				dunwynClone.AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 19, 0, 0, 0);

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                dunwynClone.SetOwnBrain(brain);

                dunwynClone.AddToWorld();

                GameEventMgr.AddHandler(dunwynClone, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterDunwyn));
                GameEventMgr.AddHandler(dunwynClone, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterDunwyn));
            }
            else
            {
                dunwynClone.MoveTo(1, 567604, 509619, 2813, 3292);
            }

            foreach (GamePlayer visPlayer in dunwynClone.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                visPlayer.Out.SendEmoteAnimation(dunwynClone, eEmote.Bind);
            }

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i] = new GameNPC();

                recruits[i].Name = "Recruit";

                recruits[i].GuildName = "Part of " + questTitle + " Quest";
                recruits[i].Realm = eRealm.Albion;
                recruits[i].CurrentRegionID = 1;

                recruits[i].Size = 50;
                recruits[i].Level = 6;
                recruits[i].X = GameLocation.ConvertLocalXToGlobalX(8602, 0) + Util.Random(-150, 150);
                recruits[i].Y = GameLocation.ConvertLocalYToGlobalY(47193, 0) + Util.Random(-150, 150);

                recruits[i].Z = 2409;
                recruits[i].Heading = 187;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                recruits[i].SetOwnBrain(brain);

            }

            recruits[0].Name = "Recruit Armsman McTavish";
            recruits[0].Model = 40;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 69);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
            recruits[0].Inventory = template.CloseTemplate();
            recruits[0].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 69, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TORSO, 46, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.LEGS, 47, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.FEET, 50, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.ARMS, 48, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.HAND, 49, 0, 0, 0);

            recruits[1].Name = "Recruit Paladin Andral";
            recruits[1].Model = 41;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 6);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 41);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 42);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 45);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 43);
//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DOLSharp,代码行数:101,代码来源:Culmination.cs

示例6: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Sir Jerem", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                sirJerem = new GameNPC();
                sirJerem.Model = 254;
                sirJerem.Name = "Sir Jerem";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + sirJerem.Name + ", creating him ...");
                sirJerem.GuildName = "Part of " + questTitle + " Quest";
                sirJerem.Realm = eRealm.Albion;
                sirJerem.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 68, 21);
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 64);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 27);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 158);
                sirJerem.Inventory = template.CloseTemplate();
                sirJerem.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                sirJerem.Size = 51;
                sirJerem.Level = 38;
                sirJerem.X = 573815;
                sirJerem.Y = 530850;
                sirJerem.Z = 2933;
                sirJerem.Heading = 2685;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    sirJerem.SaveIntoDatabase();

                sirJerem.AddToWorld();
            }
            else
                sirJerem = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Squire Galune", eRealm.Albion);
            if (npcs.Length == 0)
            {
                squireGalune = new GameNPC();
                squireGalune.Model = 254;
                squireGalune.Name = "Squire Galune";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + squireGalune.Name + ", creating him ...");
                squireGalune.GuildName = "Part of " + questTitle + " Quest";
                squireGalune.Realm = eRealm.Albion;
                squireGalune.CurrentRegionID = 21;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 320);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 137);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 138);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 134);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 135);
                squireGalune.Inventory = template.CloseTemplate();
                squireGalune.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                squireGalune.Size = 45;
                squireGalune.Level = 8;
                squireGalune.X = 33219;
                squireGalune.Y = 31931;
                squireGalune.Z = 16240;
                squireGalune.Heading = 477;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    squireGalune.SaveIntoDatabase();
//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DOLSharp,代码行数:101,代码来源:ShakenSquire.cs

示例7: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName(questGiverName, eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                questGiver = new GameNPC();
                questGiver.Model = 386;
                questGiver.Name = questGiverName;
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + questGiver.Name + ", creating her ...");
                questGiver.Realm = eRealm.Hibernia;
                questGiver.CurrentRegionID = 27;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 813, 0);		//Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 814, 0);			//Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 810, 0);		//Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 678, 0);				//Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 811, 0);			//Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 812, 0);			//Slot 28
                questGiver.Inventory = template.CloseTemplate();
                questGiver.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questGiver.Size = 50;
                questGiver.Level = 70;
                questGiver.X = 357695;
                questGiver.Y = 363457;
                questGiver.Z = 5340;
                questGiver.Heading = 3117;

                if (SAVE_INTO_DATABASE)
                    questGiver.SaveIntoDatabase();

                questGiver.AddToWorld();
            }
            else
                questGiver = npcs[0];

            npcs = WorldMgr.GetNPCsByName(questTargetName, eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                questTarget = new GameNPC();
                questTarget.Model = 350;
                questTarget.Name = questTargetName;
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + questTarget.Name + ", creating him ...");
                questTarget.Realm = eRealm.Hibernia;
                questTarget.CurrentRegionID = 27;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 391, 0);		//Slot 22
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 392, 0);			//Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 667, 0);		//Slot 25
                template.AddNPCEquipment(eInventorySlot.Cloak, 678, 0);				//Slot 26
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 389, 0);			//Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 390, 0);			//Slot 28
                questTarget.Inventory = template.CloseTemplate();
                questTarget.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                questTarget.Size = 50;
                questTarget.Level = 65;
                questTarget.X = 356932;
                questTarget.Y = 363575;
                questTarget.Z = 5248;
                questTarget.Heading = 2912;

                if (SAVE_INTO_DATABASE)
                    questTarget.SaveIntoDatabase();

                questTarget.AddToWorld();
            }
            else
                questTarget = npcs[0];

            #endregion defineNPCS

            #region defineAreas

            targetArea = WorldMgr.GetRegion(targetLocation.RegionID).AddArea(new Area.Circle("", targetLocation.X, targetLocation.Y, targetLocation.Z, 200));

            #endregion defineAreas

            #region defineBehaviours

            QuestBuilder builder = QuestMgr.getBuilder(typeof(MovementAndInteraction));
            QuestBehaviour a = null;
            string message1 = "Welcome to " + zoneName + ", <Class>. Here you will learn the basic skills needed to defend yourself as you explore our realm and grow in power and wisdom. Now, without further delay, let's get you started on your [training].";
            string message2 = "If you exit through the doors behind me, you will enter the courtyard. In the courtyard, you will find Master Gethin, who will be your training instructor. Go now and speak to Master Gethin.";

            a = builder.CreateBehaviour(questGiver, -1);
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:MovementAndInteraction.cs

示例8: Notify

        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.IsDoingQuest(typeof (RevengeTheOtherWhiteMeat)) == null)
                return;

            if (e == GameLivingEvent.EnemyKilled)
            {
                if(Step == 2)
                {
                    EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs) args;
                    if (gArgs.Target.Name == "Wilbur")
                    {
                        player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You've succeeded in killing Wilbur. In the \ndistance you hear the angry voice of \na pig herder. Make your escape!");
                        Step = 3;

                        player.GainExperience(GameLiving.eXPSource.Quest, player.ExperienceForNextLevel / 25, true);

                        GameNPC pigHerderWyatt = new GameNPC();
                        pigHerderWyatt.Model = 39;
                        pigHerderWyatt.Name = "Pig Herder Wyatt";
                        pigHerderWyatt.Realm = eRealm.Albion;
                        pigHerderWyatt.CurrentRegionID = 1;

                        GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                        template.AddNPCEquipment(eInventorySlot.FeetArmor, 143);
                        template.AddNPCEquipment(eInventorySlot.TorsoArmor, 1005);
                        pigHerderWyatt.Inventory = template.CloseTemplate();
                        pigHerderWyatt.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                        pigHerderWyatt.Size = 54;
                        pigHerderWyatt.Level = 33;
                        pigHerderWyatt.X = wilburSpawnLocation.X - 1000;
                        pigHerderWyatt.Y = wilburSpawnLocation.Y + 1500;
                        pigHerderWyatt.Z = wilburSpawnLocation.Z;
                        pigHerderWyatt.Heading = 2548;
                        pigHerderWyatt.AddToWorld();

                        GameEventMgr.AddHandler(pigHerderWyatt, GameNPCEvent.ArriveAtTarget, new DOLEventHandler(OnCloseToDeadWilbur));
                        pigHerderWyatt.WalkTo(gArgs.Target.X - 90, gArgs.Target.Y + 90, gArgs.Target.Z, 200);

                        return;
                    }
                }
            }
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:47,代码来源:RevengeTheOtherWhiteMeat.cs

示例9: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Andrew Wyatt", eRealm.Albion);

            /* Whops, if the npcs array length is 0 then no npc exists in
                * this users Mob Database, so we simply create one ;-)
                * else we take the existing one. And if more than one exist, we take
                * the first ...
                */
            if (npcs.Length == 0)
            {
                andrewWyatt = new GameNPC();
                andrewWyatt.Model = 80;
                andrewWyatt.Name = "Andrew Wyatt";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + andrewWyatt.Name + ", creating him ...");
                andrewWyatt.GuildName = "Part of " + questTitle + " Quest";
                andrewWyatt.Realm = eRealm.Albion;
                andrewWyatt.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 80);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 54);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 51);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 52);
                andrewWyatt.Inventory = template.CloseTemplate();
                andrewWyatt.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                andrewWyatt.Size = 48;
                andrewWyatt.Level = 30;
                andrewWyatt.X = 559590;
                andrewWyatt.Y = 511039;
                andrewWyatt.Z = 2488;
                andrewWyatt.Heading = 1524;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                if (SAVE_INTO_DATABASE)
                    andrewWyatt.SaveIntoDatabase();

                andrewWyatt.AddToWorld();
            }
            else
                andrewWyatt = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Geor Nadren", eRealm.Albion);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Geor Nadren, creating him ...");
                georNadren = new GameNPC();
                georNadren.Model = 9;
                georNadren.Name = "Geor Nadren";
                georNadren.GuildName = "Part of " + questTitle + " Quest";
                georNadren.Realm = eRealm.Albion;
                georNadren.CurrentRegionID = 10;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 39);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 40);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 36);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 37);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 38);
                georNadren.Inventory = template.CloseTemplate();
                georNadren.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                georNadren.Size = 51;
                georNadren.Level = 8;
                georNadren.X = 37355;
                georNadren.Y = 30943;
                georNadren.Z = 8002;
                georNadren.Heading = 3231;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    georNadren.SaveIntoDatabase();

                georNadren.AddToWorld();
            }
            else
//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DAoC,代码行数:101,代码来源:AndrewsSkins.cs

示例10: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");
            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Farmer Asma", eRealm.Albion);
            if (npcs.Length == 0)
            {
                farmerAsma = new GameNPC();
                farmerAsma.Model = 82;
                farmerAsma.Name = "Farmer Asma";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + farmerAsma.Name + ", creating him ...");
                farmerAsma.GuildName = "Part of " + questTitle + " Quest";
                farmerAsma.Realm = eRealm.Albion;
                farmerAsma.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 31);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 32);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 33);
                farmerAsma.Inventory = template.CloseTemplate();
                farmerAsma.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                farmerAsma.Size = 50;
                farmerAsma.Level = 35;
                farmerAsma.X = 563939;
                farmerAsma.Y = 509234;
                farmerAsma.Z = 2744 ;
                farmerAsma.Heading = 21;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    farmerAsma.SaveIntoDatabase();

                farmerAsma.AddToWorld();
            }
            else
                farmerAsma = npcs[0];

            #endregion

            #region defineItems

            // item db check
            farmerAsmasMap = GameServer.Database.FindObjectByKey<ItemTemplate>("farmer_asma_map");
            if (farmerAsmasMap == null)
            {
                farmerAsmasMap = new ItemTemplate();
                farmerAsmasMap.Name = "Farmer Asma's Map";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find "+farmerAsmasMap.Name+", creating it ...");
                farmerAsmasMap.Level = 0;
                farmerAsmasMap.Weight = 1;
                farmerAsmasMap.Model = 499;

                farmerAsmasMap.Object_Type = (int) eObjectType.GenericItem;
                farmerAsmasMap.Id_nb = "farmer_asma_map";
                farmerAsmasMap.Price = 0;
                farmerAsmasMap.IsPickable = false;
                farmerAsmasMap.IsDropable = false;

                farmerAsmasMap.Quality = 100;
                farmerAsmasMap.Condition = 1000;
                farmerAsmasMap.MaxCondition = 1000;
                farmerAsmasMap.Durability = 1000;
                farmerAsmasMap.MaxDurability = 1000;

                //You don't have to store the created item in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database

                    GameServer.Database.AddObject(farmerAsmasMap);
            }

            #endregion

            firstFieldArea = WorldMgr.GetRegion(firstField.RegionID).AddArea(new Area.Circle("First Vacant Field", firstField.X, firstField.Y, 0, 1450));
            firstFieldArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterFirstFieldArea));

            secondFieldArea = WorldMgr.GetRegion(secondField.RegionID).AddArea(new Area.Circle("Second Vacant Field", secondField.X, secondField.Y, 0, 1100));
            secondFieldArea.RegisterPlayerEnter(new DOLEventHandler(PlayerEnterSecondFieldArea));

            thirdFieldArea = WorldMgr.GetRegion(thirdField.RegionID).AddArea(new Area.Circle("Third Vacant Field", thirdField.X, thirdField.Y, 0, 1100));
//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DAoC,代码行数:101,代码来源:GreenerPastures.cs

示例11: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Josson", eRealm.Hibernia);

            if (npcs.Length == 0)
            {
                Josson = new GameNPC();
                Josson.Model = 382;
                Josson.Name = "Josson";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Josson.Name + ", creating him ...");
                //k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                //Josson.GuildName = "Part of " + questTitle + " Quest";
                Josson.Realm = eRealm.Hibernia;
                Josson.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 386);   //Slot 22
                template.AddNPCEquipment(eInventorySlot.HeadArmor, 835);    //Slot 21
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 387);     //Slot 23
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 383);    //Slot 25
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 384);    //Slot 27
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 385);    //Slot 28
                Josson.Inventory = template.CloseTemplate();
                Josson.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Josson.Size = 48;
                Josson.Level = 50;
                Josson.X = 346627;
                Josson.Y = 491453;
                Josson.Z = 5247;
                Josson.Heading = 2946;

                if (SAVE_INTO_DATABASE)
                    Josson.SaveIntoDatabase();

                Josson.AddToWorld();
            }
            else
                Josson = npcs[0];

            #endregion

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Josson, GameLivingEvent.Interact, new DOLEventHandler(TalkToJosson));
            GameEventMgr.AddHandler(Josson, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToJosson));

            Josson.AddQuestToGive(typeof(MagicalBacklash));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:61,代码来源:MagicalBacklash.cs

示例12: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            /* First thing we do in here is to search for the NPCs inside
            * the world who comes from the certain Realm. If we find a the players,
            * this means we don't have to create a new one.
            *
            * NOTE: You can do anything you want in this method, you don't have
            * to search for NPC's ... you could create a custom item, place it
            * on the ground and if a player picks it up, he will get the quest!
            * Just examples, do anything you like and feel comfortable with :)
            */

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Madissair", eRealm.Albion);
            if (npcs.Length == 0)
            {
                madissair = new GameNPC();
                madissair.Model = 1105;
                madissair.Name = "Madissair";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + madissair.Name + ", creating him ...");
                madissair.GuildName = "Part of " + questTitle + " Quest";
                madissair.Realm = eRealm.Albion;
                madissair.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon,8);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 133);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 31);
                template.AddNPCEquipment(eInventorySlot.Cloak, 96);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 32);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 33);
                madissair.Inventory = template.CloseTemplate();
                madissair.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                madissair.Size = 50;
                madissair.Level = 30;
                madissair.X = 561064;
                madissair.Y = 512291;
                madissair.Z = 2407;
                madissair.Heading = 721;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    madissair.SaveIntoDatabase();

                madissair.AddToWorld();
            }
            else
                madissair = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Eileen Morton", eRealm.Albion);
            if (npcs.Length == 0)
            {
                eileenMorton = new GameNPC();
                eileenMorton.Model = 5;
                eileenMorton.Name = "Eileen Morton";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + eileenMorton.Name + ", creating him ...");
                eileenMorton.GuildName = "Part of " + questTitle + " Quest";
                eileenMorton.Realm = eRealm.Albion;
                eileenMorton.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 227);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 137);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 51);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 135);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 136);
                eileenMorton.Inventory = template.CloseTemplate();
                eileenMorton.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                eileenMorton.Size = 52;
                eileenMorton.Level = 21;
                eileenMorton.X = 559495;
                eileenMorton.Y = 510743;
                eileenMorton.Z = 2496;
                eileenMorton.Heading = 716;

                //You don't have to store the created mob in the db if you don't want,
                //it will be recreated each time it is not found, just comment the following
                //line if you rather not modify your database
                if (SAVE_INTO_DATABASE)
                    eileenMorton.SaveIntoDatabase();

                eileenMorton.AddToWorld();
            }
            else
                eileenMorton = npcs[0];

            npcs = WorldMgr.GetNPCsByName("Scribe Veral", eRealm.Albion);
            if (npcs.Length == 0)
//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DOLSharp,代码行数:101,代码来源:HalfOgreAllMan.cs

示例13: CreateDunwynClone

        protected void CreateDunwynClone()
        {
            if (dunwynClone == null)
            {
                dunwynClone = new GameNPC();
                dunwynClone.Name = dunwyn.Name;
                dunwynClone.Model = dunwyn.Model;
                dunwynClone.GuildName = dunwyn.GuildName;
                dunwynClone.Realm = dunwyn.Realm;
                dunwynClone.CurrentRegionID = 1;
                dunwynClone.Size = dunwyn.Size;
                dunwynClone.Level = 15; // to make the figthing against fairy sorceress a bit more dramatic :)

                dunwynClone.X = 567604 + Util.Random(-150, 150);
                dunwynClone.Y = 509619 + Util.Random(-150, 150);
                dunwynClone.Z = 2813;
                dunwynClone.Heading = 3292;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 798);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 19);
                dunwynClone.Inventory = template.CloseTemplate();
                dunwynClone.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				dunwynClone.AddNPCEquipment((byte) eEquipmentItems.TORSO, 798, 0, 0, 0);
            //				dunwynClone.AddNPCEquipment((byte) eEquipmentItems.RIGHT_HAND, 19, 0, 0, 0);

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                dunwynClone.SetOwnBrain(brain);

                dunwynClone.AddToWorld();

                GameEventMgr.AddHandler(dunwynClone, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterDunwynClone));

                foreach (GamePlayer visPlayer in dunwynClone.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    visPlayer.Out.SendEmoteAnimation(dunwynClone, eEmote.Bind);
                }
            }
            else
            {
                TeleportTo(dunwynClone, dunwynClone, locationDunwynClone);
            }
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:46,代码来源:BeginningOfWar.cs

示例14: ScriptLoaded

        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_QUESTS)
                return;
            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initializing ...");

            #region defineNPCS

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Rheda", eRealm.Albion);

            if (npcs.Length == 0)
            {
                Rheda = new GameNPC();
                Rheda.Model = 6;
                Rheda.Name = "Rheda";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Rheda.Name + ", creating him ...");
                //k109: My preference, no guildname for quest NPCs.  Uncomment if you like that...
                //Rheda.GuildName = "Part of " + questTitle + " Quest";
                Rheda.Realm = eRealm.Albion;
                Rheda.CurrentRegionID = 1;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 80);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 54);
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 51);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 52);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 53);
                Rheda.Inventory = template.CloseTemplate();
                Rheda.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

                Rheda.Size = 52;
                Rheda.Level = 25;
                Rheda.X = 559712;
                Rheda.Y = 513513;
                Rheda.Z = 2428;
                Rheda.Heading = 3822;

                if (SAVE_INTO_DATABASE)
                    Rheda.SaveIntoDatabase();

                Rheda.AddToWorld();
            }
            else
                Rheda = npcs[0];

            #endregion

            GameEventMgr.AddHandler(GamePlayerEvent.AcceptQuest, new DOLEventHandler(SubscribeQuest));
            GameEventMgr.AddHandler(GamePlayerEvent.DeclineQuest, new DOLEventHandler(SubscribeQuest));

            GameEventMgr.AddHandler(Rheda, GameLivingEvent.Interact, new DOLEventHandler(TalkToRheda));
            GameEventMgr.AddHandler(Rheda, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToRheda));

            Rheda.AddQuestToGive(typeof(RecruitingNothingButTrouble));

            if (log.IsInfoEnabled)
                log.Info("Quest \"" + questTitle + "\" initialized");
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:60,代码来源:RecruitingNothingButTrouble.cs

示例15: CreateBriediClone

        protected void CreateBriediClone()
        {
            GameNpcInventoryTemplate template;
            if (briediClone == null)
            {
                briediClone = new GameNPC();
                briediClone.Model = 157;
                briediClone.Name = "Master Briedi";
                briediClone.GuildName = "Part of " + questTitle + " Quest";
                briediClone.Realm = eRealm.Midgard;
                briediClone.CurrentRegionID = 100;

                briediClone.Size = 50;
                briediClone.Level = 45;
                briediClone.X = GameLocation.ConvertLocalXToGlobalX(45394, 100);
                briediClone.Y = GameLocation.ConvertLocalYToGlobalY(39768, 100);
                briediClone.Z = 4709;
                briediClone.Heading = 107;

                template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 348);
                template.AddNPCEquipment(eInventorySlot.LegsArmor, 349);
                template.AddNPCEquipment(eInventorySlot.ArmsArmor, 350);
                template.AddNPCEquipment(eInventorySlot.HandsArmor, 351);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 352);
                template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 640);
                briediClone.Inventory = template.CloseTemplate();
                briediClone.SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.TORSO, 348, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.LEGS, 349, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.ARMS, 350, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.HAND, 351, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.FEET, 352, 0, 0, 0);
                //				briediClone.AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 640, 0, 0, 0);

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                briediClone.SetOwnBrain(brain);

                briediClone.AddToWorld();

                GameEventMgr.AddHandler(briediClone, GameLivingEvent.Interact, new DOLEventHandler(TalkToMasterBriedi));
                GameEventMgr.AddHandler(briediClone, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToMasterBriedi));
            }
            else
            {
                briediClone.MoveTo(100, GameLocation.ConvertLocalXToGlobalX(45394, 100), GameLocation.ConvertLocalYToGlobalY(39768, 100), 4709, 107);
            }

            foreach (GamePlayer visPlayer in briediClone.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                visPlayer.Out.SendEmoteAnimation(briediClone, eEmote.Bind);
            }

            for (int i = 0; i < recruits.Length; i++)
            {
                recruits[i] = new GameNPC();

                recruits[i].Name = "Recruit";

                recruits[i].GuildName = "Part of " + questTitle + " Quest";
                recruits[i].Realm = eRealm.Midgard;
                recruits[i].CurrentRegionID = briediClone.CurrentRegionID;

                recruits[i].Size = 50;
                recruits[i].Level = 6;
                recruits[i].X = briediClone.X + Util.Random(-150, 150);
                recruits[i].Y = briediClone.Y + Util.Random(-150, 150);

                recruits[i].Z = briediClone.Z;
                recruits[i].Heading = 187;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                recruits[i].SetOwnBrain(brain);
            }

            recruits[0].Name = "Recruit Hietan";
            recruits[0].Model = 189;
            template = new GameNpcInventoryTemplate();
            template.AddNPCEquipment(eInventorySlot.TwoHandWeapon, 69);
            template.AddNPCEquipment(eInventorySlot.TorsoArmor, 46);
            template.AddNPCEquipment(eInventorySlot.LegsArmor, 47);
            template.AddNPCEquipment(eInventorySlot.FeetArmor, 50);
            template.AddNPCEquipment(eInventorySlot.ArmsArmor, 48);
            template.AddNPCEquipment(eInventorySlot.HandsArmor, 49);
            recruits[0].Inventory = template.CloseTemplate();
            recruits[0].SwitchWeapon(GameLiving.eActiveWeaponSlot.TwoHanded);

            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TWO_HANDED, 69, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.TORSO, 46, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.LEGS, 47, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.FEET, 50, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.ARMS, 48, 0, 0, 0);
            //			recruits[0].AddNPCEquipment((byte) eEquipmentItems.HAND, 49, 0, 0, 0);

            recruits[1].Name = "Recruit Iduki";
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:Culmination.cs


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