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


C# GameNPC.SetOwnBrain方法代码示例

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


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

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

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

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

示例4: ScriptLoaded


//.........这里部分代码省略.........
                    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();

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

            foreach (GameNPC npc in squireGalune.GetNPCsInRadius(400))
            {
                if (npc.Name == "small spider")
                {
                    smallSpider = npc;
                    break;
                }
            }

            if (smallSpider == null)
            {
                smallSpider = new GameNPC();
                smallSpider.Model = 72;
                smallSpider.Name = "small spider";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + smallSpider.Name + ", creating him ...");
                smallSpider.GuildName = "Part of " + questTitle + " Quest";
                smallSpider.Realm = eRealm.None;
                smallSpider.CurrentRegionID = 21;
                smallSpider.Size = 17;
                smallSpider.Level = 5;
                smallSpider.X = 33158;
                smallSpider.Y = 31973;
                smallSpider.Z = 16240;

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

                smallSpider.Heading = 2605;
                smallSpider.MaxSpeedBase = 0;

                //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)
                    smallSpider.SaveIntoDatabase();

                smallSpider.AddToWorld();
            }

            #endregion

            /* Now we add some hooks to the npc we found.
            * Actually, we want to know when a player interacts with him.
            * So, we hook the right-click (interact) and the whisper method
            * of npc and set the callback method to the "TalkToXXX"
            * method. This means, the "TalkToXXX" method is called whenever
            * a player right clicks on him or when he whispers to him.
            */

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

            GameEventMgr.AddHandler(sirJerem, GameLivingEvent.Interact, new DOLEventHandler(TalkToSirJerem));
            GameEventMgr.AddHandler(sirJerem, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSirJerem));

            GameEventMgr.AddHandler(squireGalune, GameLivingEvent.Interact, new DOLEventHandler(TalkToSquireGalune));
            GameEventMgr.AddHandler(squireGalune, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToSquireGalune));

            /* Now we bring to Ydenia the possibility to give this quest to players */
            sirJerem.AddQuestToGive(typeof (ShakenSquire));

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

示例5: CreateMorgana

        protected virtual void CreateMorgana()
        {
            if (Morgana == null)
            {
                Morgana = new GameNPC();
                Morgana.Model = 283;
                Morgana.Name = "Morgana";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + Morgana.Name + " , creating it ...");
                Morgana.GuildName = "";
                Morgana.Realm = eRealm.None;
                Morgana.CurrentRegionID = 1;
                Morgana.Size = 51;
                Morgana.Level = 90;
                Morgana.X = 306056;
                Morgana.Y = 670106;
                Morgana.Z = 3095;
                Morgana.Heading = 3261;

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

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 98, 43);
                template.AddNPCEquipment(eInventorySlot.FeetArmor, 133, 61);
                Morgana.Inventory = template.CloseTemplate();

            //				Morgana.AddNPCEquipment((byte) eVisibleItems.TORSO, 98, 43, 0, 0);
            //				Morgana.AddNPCEquipment((byte) eVisibleItems.BOOT, 133, 61, 0, 0);
            }

            Morgana.AddToWorld();
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:35,代码来源:Academy50.cs

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

示例7: Notify

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

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

            if (e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                if (Step == 1)
                {
                    if (gArgs.Target.Name == "river sprite")
                    {
                        if (Util.Chance(25))
                        {
                            if (sephucoth == null)
                            {
                                sephucoth = new GameNPC();
                                sephucoth.Model = 136;
                                sephucoth.Name = "Sephucoth";
                                sephucoth.Realm = eRealm.None;
                                sephucoth.CurrentRegionID = 1;

                                sephucoth.Size = 55;
                                sephucoth.Level = 7;
                                sephucoth.X = 560836;
                                sephucoth.Y = 527260;
                                sephucoth.Z = 2082;
                                sephucoth.Heading = 1480;

                                StandardMobBrain brain = new StandardMobBrain();  // set a brain witch find a lot mob friend to attack the player
                                sephucoth.SetOwnBrain(brain);					  // so this mob must be abble to cast

                                sephucoth.RespawnInterval = 0; // don't respawn when killed

                                sephucoth.AddToWorld();
                            }
                        }
                    }
                    else if (gArgs.Target.Name == "Sephucoth")
                    {
                        GiveItem(gArgs.Target, player, sephucothsHeart);
                        if (sephucoth != null) { sephucoth = null; }

                        Step = 2;
                    }
                }
                else if (Step == 3)
                {
                    if (gArgs.Target.Name == "large skeleton")
                    {
                        if (Util.Chance(50))
                        {
                            GiveItem(gArgs.Target, player, polishedBone);
                            Step = 4;
                        }
                    }
                }
            }
            else if (e == GamePlayerEvent.GiveItem)
            {
                GiveItemEventArgs gArgs = (GiveItemEventArgs)args;
                if (gArgs.Target.Name == eowylnAstos.Name)
                {
                    if (gArgs.Item.Id_nb == sephucothsHeart.Id_nb && Step == 2)
                    {
                        RemoveItem(eowylnAstos, m_questPlayer, sephucothsHeart);

                        eowylnAstos.TurnTo(m_questPlayer);
                        eowylnAstos.SayTo(m_questPlayer, "You have done well traveler! I will still require one final object to complete the pendant. Seek out a large skeleton and bring from it a piece of polished bone! Return this to me and I shall finish your pendant.");
                        Step = 3;
                    }
                    else if (gArgs.Item.Id_nb == polishedBone.Id_nb && Step == 4)
                    {
                        RemoveItem(eowylnAstos, m_questPlayer, polishedBone);

                        eowylnAstos.TurnTo(m_questPlayer);
                        eowylnAstos.SayTo(m_questPlayer, "Eowyln draws two items before her. Gathering her strength, she shouts.");

                        new RegionTimer(eowylnAstos, new RegionTimerCallback(BuildNecklace), 5000);
                    }
                }
            }
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:85,代码来源:HeartOfSephucoth.cs

示例8: 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;

            npcs = WorldMgr.GetNPCsByName("Torold Sterkkriger", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(151).IsDisabled)
                {
                    ToroldSterkkriger = new DOL.GS.GameNPC();
                    ToroldSterkkriger.Model = 522;
                    ToroldSterkkriger.Name = "Torold Sterkkriger";
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find " + ToroldSterkkriger.Name + ", creating ...");
                    ToroldSterkkriger.GuildName = "Part of " + questTitle + " Quest";
                    ToroldSterkkriger.Realm = eRealm.Midgard;
                    ToroldSterkkriger.CurrentRegionID = 151;
                    ToroldSterkkriger.Size = 50;
                    ToroldSterkkriger.Level = 55;
                    ToroldSterkkriger.MaxSpeedBase = 191;
                    ToroldSterkkriger.Faction = FactionMgr.GetFactionByID(0);
                    ToroldSterkkriger.X = 287623;
                    ToroldSterkkriger.Y = 355226;
                    ToroldSterkkriger.Z = 3488;
                    ToroldSterkkriger.Heading = 3788;
                    ToroldSterkkriger.RespawnInterval = -1;
                    ToroldSterkkriger.BodyType = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    ToroldSterkkriger.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)
                        ToroldSterkkriger.SaveIntoDatabase();

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

            npcs = WorldMgr.GetNPCsByName("Jorund Bruttstein", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(151).IsDisabled)
                {
                    JorundBruttstein = new DOL.GS.GameNPC();
                    JorundBruttstein.Model = 513;
                    JorundBruttstein.Name = "Jorund Bruttstein";
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find " + JorundBruttstein.Name + ", creating ...");
                    JorundBruttstein.GuildName = "Part of " + questTitle + " Quest";
                    JorundBruttstein.Realm = eRealm.Midgard;
                    JorundBruttstein.CurrentRegionID = 151;
                    JorundBruttstein.Size = 52;
                    JorundBruttstein.Level = 50;
                    JorundBruttstein.MaxSpeedBase = 191;
                    JorundBruttstein.Faction = FactionMgr.GetFactionByID(0);
                    JorundBruttstein.X = 287884;
                    JorundBruttstein.Y = 356307;
                    JorundBruttstein.Z = 3488;
                    JorundBruttstein.Heading = 3163;
                    JorundBruttstein.RespawnInterval = -1;
                    JorundBruttstein.BodyType = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    JorundBruttstein.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)
                        JorundBruttstein.SaveIntoDatabase();

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

            #endregion defineNPCs

            #region defineItems
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:Trial_of_Strength.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 ...");

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepNognar"), (eRealm)2);

            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(100).IsDisabled)
                {
                BarkeepNognar = new DOL.GS.GameMerchant();
                    BarkeepNognar.Model = 212;
                BarkeepNognar.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepNognar");
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + BarkeepNognar.Name + ", creating ...");
                BarkeepNognar.GuildName = "Part of " + questTitle + " Quest";
                BarkeepNognar.Realm = eRealm.Midgard;
                BarkeepNognar.CurrentRegionID = 100;
                BarkeepNognar.Size = 58;
                BarkeepNognar.Level = 15;
                BarkeepNognar.MaxSpeedBase = 191;
                BarkeepNognar.Faction = FactionMgr.GetFactionByID(0);
                BarkeepNognar.X = 805429;
                BarkeepNognar.Y = 726478;
                BarkeepNognar.Z = 4717;
                BarkeepNognar.Heading = 4073;
                BarkeepNognar.RespawnInterval = -1;
                BarkeepNognar.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                BarkeepNognar.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)
                    BarkeepNognar.SaveIntoDatabase();

                BarkeepNognar.AddToWorld();

                }
            }
            else
            {
                BarkeepNognar = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepPrugar"), (eRealm)2);

            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(101).IsDisabled)
                {
                BarkeepPrugar = new DOL.GS.GameMerchant();
                    BarkeepPrugar.Model = 213;
                BarkeepPrugar.Name = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.NPCBarkeepPrugar");
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + BarkeepPrugar.Name + ", creating ...");
                BarkeepPrugar.GuildName = "Part of " + questTitle + " Quest";
                BarkeepPrugar.Realm = eRealm.Midgard;
                BarkeepPrugar.CurrentRegionID = 101;
                BarkeepPrugar.Size = 60;
                BarkeepPrugar.Level = 15;
                BarkeepPrugar.MaxSpeedBase = 191;
                BarkeepPrugar.Faction = FactionMgr.GetFactionByID(0);
                BarkeepPrugar.X = 33230;
                BarkeepPrugar.Y = 34802;
                BarkeepPrugar.Z = 8027;
                BarkeepPrugar.Heading = 1194;
                BarkeepPrugar.RespawnInterval = -1;
                BarkeepPrugar.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                BarkeepPrugar.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)
                    BarkeepPrugar.SaveIntoDatabase();

                BarkeepPrugar.AddToWorld();

                }
            }
            else
            {
                BarkeepPrugar = npcs[0];
            }

//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DAoC,代码行数:101,代码来源:The_Birthday_Gift.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 ...");

            #region defineNPCs

            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Audun", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(101).IsDisabled)
                {
                    Audun = new DOL.GS.GameNPC();
                    Audun.Model = 232;
                    Audun.Name = "Audun";
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find " + Audun.Name + ", creating ...");
                    Audun.GuildName = "Part of " + questTitle + " Quest";
                    Audun.Realm = eRealm.Midgard;
                    Audun.CurrentRegionID = 101;
                    Audun.Size = 48;
                    Audun.Level = 49;
                    Audun.MaxSpeedBase = 191;
                    Audun.Faction = FactionMgr.GetFactionByID(0);
                    Audun.X = 33283;
                    Audun.Y = 35305;
                    Audun.Z = 8027;
                    Audun.Heading = 1763;
                    Audun.RespawnInterval = -1;
                    Audun.BodyType = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    Audun.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)
                        Audun.SaveIntoDatabase();

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

            npcs = WorldMgr.GetNPCsByName("Guard Olja", (eRealm)2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(229).IsDisabled)
                {
                    GuardOlja = new DOL.GS.GameNPC();
                    GuardOlja.Model = 180;
                    GuardOlja.Name = "Guard Olja";
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find " + GuardOlja.Name + ", creating ...");
                    GuardOlja.GuildName = "Part of " + questTitle + " Quest";
                    GuardOlja.Realm = eRealm.Midgard;
                    GuardOlja.CurrentRegionID = 229;
                    GuardOlja.Size = 50;
                    GuardOlja.Level = 50;
                    GuardOlja.MaxSpeedBase = 191;
                    GuardOlja.Faction = FactionMgr.GetFactionByID(0);
                    GuardOlja.X = 47994;
                    GuardOlja.Y = 37341;
                    GuardOlja.Z = 21812;
                    GuardOlja.Heading = 204;
                    GuardOlja.RespawnInterval = -1;
                    GuardOlja.BodyType = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    GuardOlja.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)
                        GuardOlja.SaveIntoDatabase();

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

            #endregion defineNPCs

            #region defineItems
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:Mead_Run.cs

示例11: CreateFairy

        protected virtual void CreateFairy()
        {
            ireFairy = new GameNPC();
            ireFairy.Model = 603;
            ireFairy.Name = "Ire Fairy";
            ireFairy.GuildName = "Part of " + questTitle + " Quest";
            ireFairy.Realm = eRealm.None;
            ireFairy.CurrentRegionID = 1;
            ireFairy.Size = 50;
            ireFairy.Level = 4;
            ireFairy.X = GameLocation.ConvertLocalXToGlobalX(12336, 0) + Util.Random(-150, 150);
            ireFairy.Y = GameLocation.ConvertLocalYToGlobalY(22623, 0) + Util.Random(-150, 150);
            ireFairy.Z = 2405;
            ireFairy.Heading = 226;

            StandardMobBrain brain = new StandardMobBrain();
            brain.AggroLevel = 20;
            brain.AggroRange = 200;
            ireFairy.SetOwnBrain(brain);

            ireFairy.AddToWorld();
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:22,代码来源:Nuisances.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 ...");

            #region defineNPCs
            GameNPC[] npcs;

            npcs = WorldMgr.GetNPCsByName("Dwarven Guard Rinda",(eRealm) 2);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(100).IsDisabled)
                {
                DwarvenGuardRinda = new DOL.GS.GameNPC();
                    DwarvenGuardRinda.Model = 238;
                DwarvenGuardRinda.Name = "Dwarven Guard Rinda";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + DwarvenGuardRinda.Name + ", creating ...");
                DwarvenGuardRinda.GuildName = "Part of " + questTitle + " Quest";
                DwarvenGuardRinda.Realm = eRealm.Midgard;
                DwarvenGuardRinda.CurrentRegionID = 100;
                DwarvenGuardRinda.Size = 53;
                DwarvenGuardRinda.Level = 41;
                DwarvenGuardRinda.MaxSpeedBase = 191;
                DwarvenGuardRinda.Faction = FactionMgr.GetFactionByID(0);
                DwarvenGuardRinda.X = 805496;
                DwarvenGuardRinda.Y = 701215;
                DwarvenGuardRinda.Z = 4960;
                DwarvenGuardRinda.Heading = 1570;
                DwarvenGuardRinda.RespawnInterval = -1;
                DwarvenGuardRinda.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                DwarvenGuardRinda.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)
                    DwarvenGuardRinda.SaveIntoDatabase();

                DwarvenGuardRinda.AddToWorld();

                }
            }
            else
            {
                DwarvenGuardRinda = npcs[0];
            }

            npcs = WorldMgr.GetNPCsByName("hobgoblin snake-finder",(eRealm) 0);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(100).IsDisabled)
                {
                hobgoblinsnakefinder = new DOL.GS.GameNPC();
                    hobgoblinsnakefinder.Model = 251;
                hobgoblinsnakefinder.Name = "hobgoblin snake-finder";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + hobgoblinsnakefinder.Name + ", creating ...");
                hobgoblinsnakefinder.GuildName = "Part of " + questTitle + " Quest";
                hobgoblinsnakefinder.Realm = eRealm.None;
                hobgoblinsnakefinder.CurrentRegionID = 100;
                hobgoblinsnakefinder.Size = 37;
                hobgoblinsnakefinder.Level = 1;
                hobgoblinsnakefinder.MaxSpeedBase = 191;
                hobgoblinsnakefinder.Faction = FactionMgr.GetFactionByID(0);
                hobgoblinsnakefinder.X = 803189;
                hobgoblinsnakefinder.Y = 695157;
                hobgoblinsnakefinder.Z = 4926;
                hobgoblinsnakefinder.Heading = 125;
                hobgoblinsnakefinder.RespawnInterval = -1;
                hobgoblinsnakefinder.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 500;
                hobgoblinsnakefinder.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)
                    hobgoblinsnakefinder.SaveIntoDatabase();

                hobgoblinsnakefinder.AddToWorld();

                }
            }
            else
            {
                hobgoblinsnakefinder = npcs[0];
            }

            #endregion

//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DOLSharp,代码行数:101,代码来源:Rindas_Lost_Key.cs

示例13: 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;

            npcs = WorldMgr.GetNPCsByName("Guard Alakyrr", (eRealm)1);
            if (npcs.Length == 0)
            {
                if (!WorldMgr.GetRegion(63).IsDisabled)
                {
                    GuardAlakyrr = new DOL.GS.GameNPC();
                    GuardAlakyrr.Model = 748;
                    GuardAlakyrr.Name = "Guard Alakyrr";
                    if (log.IsWarnEnabled)
                        log.Warn("Could not find " + GuardAlakyrr.Name + ", creating ...");
                    GuardAlakyrr.GuildName = "Part of " + questTitle + " Quest";
                    GuardAlakyrr.Realm = eRealm.Albion;
                    GuardAlakyrr.CurrentRegionID = 63;
                    GuardAlakyrr.Size = 50;
                    GuardAlakyrr.Level = 30;
                    GuardAlakyrr.MaxSpeedBase = 191;
                    GuardAlakyrr.Faction = FactionMgr.GetFactionByID(0);
                    GuardAlakyrr.X = 28707;
                    GuardAlakyrr.Y = 20147;
                    GuardAlakyrr.Z = 16760;
                    GuardAlakyrr.Heading = 4016;
                    GuardAlakyrr.RespawnInterval = -1;
                    GuardAlakyrr.BodyType = 0;

                    StandardMobBrain brain = new StandardMobBrain();
                    brain.AggroLevel = 0;
                    brain.AggroRange = 500;
                    GuardAlakyrr.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)
                        GuardAlakyrr.SaveIntoDatabase();

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

            #endregion defineNPCs

            #region defineItems

            enchanterdtenebrousflask = GameServer.Database.FindObjectByKey<ItemTemplate>("enchanterdtenebrousflask");
            if (enchanterdtenebrousflask == null)
            {
                enchanterdtenebrousflask = new ItemTemplate();
                enchanterdtenebrousflask.Name = "Enchanted Tenebrous Flask";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + enchanterdtenebrousflask.Name + ", creating it ...");
                enchanterdtenebrousflask.Level = 1;
                enchanterdtenebrousflask.Weight = 1;
                enchanterdtenebrousflask.Model = 490;
                enchanterdtenebrousflask.Object_Type = 0;
                enchanterdtenebrousflask.Item_Type = -1;
                enchanterdtenebrousflask.Id_nb = "enchanterdtenebrousflask";
                enchanterdtenebrousflask.Hand = 0;
                enchanterdtenebrousflask.Price = 0;
                enchanterdtenebrousflask.IsPickable = true;
                enchanterdtenebrousflask.IsDropable = false;
                enchanterdtenebrousflask.IsTradable = true;
                enchanterdtenebrousflask.CanDropAsLoot = true;
                enchanterdtenebrousflask.Color = 0;
                enchanterdtenebrousflask.Bonus = 0; // default bonus
                enchanterdtenebrousflask.Bonus1 = 0;
                enchanterdtenebrousflask.Bonus1Type = (int)0;
                enchanterdtenebrousflask.Bonus2 = 0;
                enchanterdtenebrousflask.Bonus2Type = (int)0;
                enchanterdtenebrousflask.Bonus3 = 0;
                enchanterdtenebrousflask.Bonus3Type = (int)0;
                enchanterdtenebrousflask.Bonus4 = 0;
                enchanterdtenebrousflask.Bonus4Type = (int)0;
                enchanterdtenebrousflask.Bonus5 = 0;
                enchanterdtenebrousflask.Bonus5Type = (int)0;
                enchanterdtenebrousflask.Bonus6 = 0;
                enchanterdtenebrousflask.Bonus6Type = (int)0;
                enchanterdtenebrousflask.Bonus7 = 0;
                enchanterdtenebrousflask.Bonus7Type = (int)0;
                enchanterdtenebrousflask.Bonus8 = 0;
                enchanterdtenebrousflask.Bonus8Type = (int)0;
                enchanterdtenebrousflask.Bonus9 = 0;
                enchanterdtenebrousflask.Bonus9Type = (int)0;
                enchanterdtenebrousflask.Bonus10 = 0;
                enchanterdtenebrousflask.Bonus10Type = (int)0;
                enchanterdtenebrousflask.ExtraBonus = 0;
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:101,代码来源:Aiding_Guard_Alakyrr.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 ...");
            /* 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

            masterFrederick = GetMasterFrederick();

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

                dunwyn.Size = 50;
                dunwyn.Level = 20;
                dunwyn.X = 465383;
                dunwyn.Y = 634773;
                dunwyn.Z = 1840;
                dunwyn.Heading = 187;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 798);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 19);
                dunwyn.Inventory = template.CloseTemplate();

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

                //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)
                    dunwyn.SaveIntoDatabase();

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

            npcs = WorldMgr.GetNPCsByName("Princess Obera", eRealm.None);
            if (npcs.Length == 0)
            {
                if (log.IsWarnEnabled)
                    log.Warn("Could not find Princess Obera, creating ...");
                princessObera = new GameNPC();

                princessObera.Name = "Princess Obera";
                princessObera.X = 579289;
                princessObera.Y = 508200;
                princessObera.Z = 2779;
                princessObera.Heading = 347;
                princessObera.Model = 603;
                princessObera.GuildName = "Part of " + questTitle + " Quest";
                princessObera.Realm = eRealm.None;
                princessObera.CurrentRegionID = 1;
                princessObera.Size = 49;
                princessObera.Level = 3;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 80;
                brain.AggroRange = 1000;
                princessObera.SetOwnBrain(brain);

                if (SAVE_INTO_DATABASE)
                    princessObera.SaveIntoDatabase();
                princessObera.AddToWorld();
            }
            else
            {
                princessObera = (GameNPC) npcs[0];
            }

            int counter = 0;
            foreach (GameNPC npc in princessObera.GetNPCsInRadius(500))
            {
                if (npc.Name == "ire fairy sorceress")
                {
                    fairySorceress[counter] = (GameNPC) npc;
                    counter++;
                }
                if (counter == fairySorceress.Length)
//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DAoC,代码行数:101,代码来源:BeginningOfWar.cs

示例15: GetAddrir

        public static GameNPC GetAddrir()
        {
            GameNPC[] npcs = WorldMgr.GetNPCsByName("Addrir", eRealm.Hibernia);

            GameNPC addrir = null;

            if (npcs.Length == 0)
            {
                addrir = new GameNPC();
                addrir.Model = 335;
                addrir.Name = "Addrir";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + addrir.Name + ", creating him ...");
                addrir.GuildName = "Part of Addrir Quests";
                addrir.Realm = eRealm.Hibernia;
                addrir.CurrentRegionID = 200;

                GameNpcInventoryTemplate template = new GameNpcInventoryTemplate();
                template.AddNPCEquipment(eInventorySlot.TorsoArmor, 58, 35);
                template.AddNPCEquipment(eInventorySlot.Cloak, 57, 32);
                template.AddNPCEquipment(eInventorySlot.RightHandWeapon, 1173);
                addrir.Inventory = template.CloseTemplate();
                addrir.SwitchWeapon(GameLiving.eActiveWeaponSlot.Standard);

            //				addrir.AddNPCEquipment((byte) eVisibleItems.TORSO, 58, 35, 0, 0);
            //				addrir.AddNPCEquipment((byte) eVisibleItems.CLOAK, 57, 32, 0, 0);
            //				addrir.AddNPCEquipment((byte) eVisibleItems.RIGHT_HAND, 1173, 0, 0, 0);

                addrir.Size = 50;
                addrir.Level = 50;
                addrir.X = GameLocation.ConvertLocalXToGlobalX(26955, 200);
                addrir.Y = GameLocation.ConvertLocalYToGlobalY(7789, 200);
                addrir.Z = 5196;
                addrir.Heading = 22;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                addrir.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)
                    addrir.SaveIntoDatabase();

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

            return addrir;
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:53,代码来源:BaseAddrirQuest.cs


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