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


C# GameNPC.GetPlayersInRadius方法代码示例

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


在下文中一共展示了GameNPC.GetPlayersInRadius方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: CreateBriediClone

        protected void CreateBriediClone()
        {
            if (briediClone == null)
            {
                briediClone = new GameNPC();
                briediClone.Name = briedi.Name;
                briediClone.Model = briedi.Model;
                briediClone.GuildName = briedi.GuildName;
                briediClone.Realm = briedi.Realm;
                briediClone.CurrentRegionID = locationBriediClone.RegionID;
                briediClone.Size = briedi.Size;
                briediClone.Level = 15; // to make the figthing against fairy sorceress a bit more dramatic :)

                briediClone.X = locationBriediClone.X + Util.Random(-150, 150);
                briediClone.Y = locationBriediClone.X + Util.Random(-150, 150);
                briediClone.Z = locationBriediClone.Y;
                briediClone.Heading = locationBriediClone.Heading;

                GameNpcInventoryTemplate 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(TalkToMasterBriediClone));

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


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