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


C# GameData.Identity类代码示例

本文整理汇总了C#中SmokeLounge.AOtomation.Messaging.GameData.Identity的典型用法代码示例。如果您正苦于以下问题:C# Identity类的具体用法?C# Identity怎么用?C# Identity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Identity类属于SmokeLounge.AOtomation.Messaging.GameData命名空间,在下文中一共展示了Identity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteCommand

 public override void ExecuteCommand(ICharacter character, Identity target, string[] args)
 {
     Vendor v = Pool.Instance.GetObject<Vendor>(character.Playfield.Identity, target);
     if (v != null)
     {
         int pfid = character.Playfield.Identity.Instance;
         StatelData sd =
             PlayfieldLoader.PFData[pfid].Statels.FirstOrDefault(x => x.Identity.Equals(v.OriginalIdentity));
         if (sd != null)
         {
             int instance = (((sd.Identity.Instance) >> 16) & 0xff
                             | (character.Playfield.Identity.Instance << 16));
             DBVendor dbv = new DBVendor();
             dbv.Id = instance;
             dbv.Playfield = pfid;
             dbv.X = sd.X;
             dbv.Y = sd.Y;
             dbv.Z = sd.Z;
             dbv.HeadingX = sd.HeadingX;
             dbv.HeadingY = sd.HeadingY;
             dbv.HeadingZ = sd.HeadingZ;
             dbv.HeadingW = sd.HeadingW;
             dbv.Name = "New shop, please fill me";
             dbv.TemplateId = sd.TemplateId;
             dbv.Hash = "";
             VendorDao.Instance.Delete(dbv.Id);
             VendorDao.Instance.Add(dbv, dontUseId: false);
         }
     }
 }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:30,代码来源:MakeShop.cs

示例2: Vendor

        public Vendor(Identity parent, Identity id, string templateHash)
            : base(parent, id)
        {
            DBVendorTemplate vendorTemplate =
                VendorTemplateDao.Instance.GetWhere(new { Hash = templateHash }).FirstOrDefault();
            if (vendorTemplate == null)
            {
                LogUtil.Debug(
                    DebugInfoDetail.Shopping,
                    "Could not find a hash entry for this shop, pls check vendors table.");
            }

            this.Stats = new SimpleStatList();
            // Fallback on Advy adv. crystals shop
            this.Template = ItemLoader.ItemList[vendorTemplate != null ? vendorTemplate.ItemTemplate : 46522];
            foreach (KeyValuePair<int, int> s in this.Template.Stats)
            {
                this.Stats[s.Key].Value = s.Value;
            }
            this.BaseInventory = new VendorInventory(this);
            if (vendorTemplate != null)
            {
                this.TemplateHash = vendorTemplate.Hash;
                this.Name = vendorTemplate.Name;

                this.BaseInventory.Read();
            }
        }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:28,代码来源:Vendor.cs

示例3: TemporaryBag

 public TemporaryBag(Identity parent, Identity id, Identity shopper, Identity vendor, int vendorSlots = 255)
     : base(parent, id)
 {
     this.Shopper = shopper;
     this.Vendor = vendor;
     this.charactersBag = new OutgoingTradeInventoryPage(id, vendorSlots);
     this.vendorsBag = new KnuBotTradeInventoryPage(id);
 }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:8,代码来源:TemporaryBag.cs

示例4: PlayerViewModel

        public PlayerViewModel(Guid id, Identity remoteId, string name)
        {
            Contract.Requires<ArgumentException>(string.IsNullOrWhiteSpace(name) == false);

            this.id = id;
            this.remoteId = remoteId;
            this.name = name;
        }
开发者ID:gordonc64,项目名称:AO-Workbench,代码行数:8,代码来源:PlayerViewModel.cs

示例5: KnuBotItemGiver

        public KnuBotItemGiver(Identity identity)
            : base(identity)
        {
            this.InitializeItemSets();

            KnuBotDialogTree rootNode = new KnuBotDialogTree(
                "0",
                this.Condition0,
                new[]
                {
                    this.CAS(this.DialogGM0, "self"), this.CAS(this.TransferToRKArmorSet, "RKArmorSet"),
                    this.CAS(this.TransferToSLArmorSet, "SLArmorSet"), this.CAS(this.GoodBye, "self")
                });
            this.SetRootNode(rootNode);

            KnuBotDialogTree lastNode =
                rootNode.AddNode(
                    new KnuBotDialogTree(
                        "RKArmorSet",
                        this.Condition01,
                        new[]
                        {
                            this.CAS(this.DialogShowRKArmorSets, "self"),
                            this.CAS(this.ChooseQlFromSet, "QLChoiceRKArmorSet"), this.CAS(this.BackToRoot, "root")
                        }));

            lastNode.AddNode(
                new KnuBotDialogTree(
                    "QLChoiceRKArmorSet",
                    this.QLCondition,
                    new[]
                    {
                        this.CAS(this.ShowQLs, "self"), this.CAS(this.GiveItemSet, "root"),
                        this.CAS(this.BackToRoot, "parent")
                    }));

            lastNode =
                rootNode.AddNode(
                    new KnuBotDialogTree(
                        "SLArmorSet",
                        this.ConditionSL,
                        new[]
                        {
                            this.CAS(this.DialogShowSLArmorSets, "self"),
                            this.CAS(this.ChooseQlFromSet, "QLChoiceSLArmorSet"), this.CAS(this.BackToRoot, "root")
                        }));

            lastNode.AddNode(
                new KnuBotDialogTree(
                    "QLChoiceSLArmorSet",
                    this.QLCondition,
                    new[]
                    {
                        this.CAS(this.ShowQLs, "self"), this.CAS(this.GiveItemSet, "root"),
                        this.CAS(this.BackToRoot, "parent")
                    }));
        }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:57,代码来源:KnuBotItemGiver.cs

示例6: PooledObject

 /// <summary>
 /// </summary>
 /// <param name="pooledIn">
 /// </param>
 /// <param name="parent">
 /// </param>
 /// <param name="id">
 /// </param>
 public PooledObject(Identity parent, Identity id)
 {
     this.Identity = id;
     this.Parent = parent;
     Pool.Instance.AddObject(parent, this);
     LogUtil.Debug(
         DebugInfoDetail.Pool,
         "Created new object " + id.ToString(true) + " of " + parent.ToString(true));
 }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:17,代码来源:PooledObject.cs

示例7: ExecuteCommand

        /// <summary>
        /// </summary>
        /// <param name="character">
        /// </param>
        /// <param name="target">
        /// </param>
        /// <param name="args">
        /// </param>
        public override void ExecuteCommand(ICharacter character, Identity target, string[] args)
        {
            IInstancedEntity targetEntity = null;

            // Fall back to self it no target is selected
            if ((targetEntity = character.Playfield.FindByIdentity(target)) == null)
            {
                targetEntity = character;
            }

            IItemContainer container = targetEntity as IItemContainer;

            // Does this entity have a BaseInventory?
            if (container != null)
            {
                int lowId;
                int highId;
                int ql;
                if (!int.TryParse(args[1], out lowId))
                {
                    character.Playfield.Publish(ChatText.CreateIM(character, "LowId is no number"));
                    return;
                }

                if (!int.TryParse(args[2], out ql))
                {
                    character.Playfield.Publish(ChatText.CreateIM(character, "QualityLevel is no number"));
                    return;
                }

                // Determine low and high id depending on ql
                lowId = ItemLoader.ItemList[lowId].GetLowId(ql);
                highId = ItemLoader.ItemList[lowId].GetHighId(ql);

                Item item = new Item(ql, lowId, highId);
                if (ItemLoader.ItemList[lowId].IsStackable())
                {
                    item.MultipleCount = ItemLoader.ItemList[lowId].getItemAttribute(212);
                }

                InventoryError err = container.BaseInventory.TryAdd(item);
                if (err != InventoryError.OK)
                {
                    character.Playfield.Publish(
                        ChatText.CreateIM(character, "Could not add to inventory. (" + err + ")"));
                }

                if (targetEntity as Character != null)
                {
                    AddTemplate.Send((targetEntity as Character).Client, item);
                }
            }
            else
            {
                character.Playfield.Publish(ChatText.CreateIM(character, "Target has no Inventory."));
            }
        }
开发者ID:kittin,项目名称:CellAO-NightPredator,代码行数:65,代码来源:ChatCommandGiveItem.cs

示例8: ExecuteCommand

        public override void ExecuteCommand(ICharacter character, Identity target, string[] args)
        {
            if ((character.Stats[StatIds.externaldoorinstance].Value == 0)
                || (character.Stats[StatIds.externalplayfieldinstance].Value == 0))
            {
                ChatTextMessageHandler.Default.Create(character, "Please enter a proxyfied playfield first.");
            }

            Coordinate tempCoordinate = character.Coordinates();
            PlayfieldData pfData = PlayfieldLoader.PFData[character.Playfield.Identity.Instance];
            StatelData o = null;
            foreach (StatelData s in pfData.Statels)
            {
                if (o == null)
                {
                    o = s;
                }
                else
                {
                    if (Coordinate.Distance2D(tempCoordinate, s.Coord())
                        < Coordinate.Distance2D(tempCoordinate, o.Coord()))
                    {
                        o = s;
                    }
                }
            }
            if (o == null)
            {

                ChatTextMessageHandler.Default.Create(
                    character,
                    "No statel on this playfield... Very odd, where exactly are you???");

            }
            else
            {
                DBTeleport tel = new DBTeleport();
                tel.playfield = character.Stats[StatIds.externalplayfieldinstance].Value;
                tel.statelType = 0xc748; // Door only for now
                tel.statelInstance = character.Stats[StatIds.externaldoorinstance].BaseValue;
                tel.destinationPlayfield = o.PlayfieldId;
                tel.destinationType = (int)o.Identity.Type;
                tel.destinationInstance = BitConverter.ToUInt32(BitConverter.GetBytes(o.Identity.Instance), 0);

                var temp = TeleportDao.Instance.GetWhere(new { tel.playfield, tel.statelType, tel.statelInstance });
                foreach (var t in temp)
                {
                    TeleportDao.Instance.Delete(t.Id);
                }
                TeleportDao.Instance.Add(tel);
                character.Playfield.Publish(
            ChatTextMessageHandler.Default.CreateIM(character, "Proxy saved"));

            }
        }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:55,代码来源:SaveProxy.cs

示例9: StaticDynel

 public StaticDynel(Identity parent, Identity id, ItemTemplate template)
     : base(parent, id)
 {
     this.Template = template;
     this.Events = this.Template.Events;
     this.Actions = this.Template.Actions;
     foreach (KeyValuePair<int, int> s in this.Template.Stats)
     {
         this.Stats.Add(s.Key, s.Value);
     }
 }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:11,代码来源:StaticDynel.cs

示例10: InstantiateMobSpawn

        public static ICharacter InstantiateMobSpawn(
            DBMobSpawn mob,
            DBMobSpawnStat[] stats,
            IController npccontroller,
            IPlayfield playfield)
        {
            if (playfield != null)
            {
                Identity mobId = new Identity() { Type = IdentityType.CanbeAffected, Instance = mob.Id };
                if (Pool.Instance.GetObject(playfield.Identity, mobId) != null)
                {
                    throw new Exception("Object " + mobId.ToString(true) + " already exists!!");
                }
                Character cmob = new Character(playfield.Identity, mobId, npccontroller);
                cmob.Read();
                cmob.Playfield = playfield;
                cmob.Coordinates(new Coordinate() { x = mob.X, y = mob.Y, z = mob.Z });
                cmob.RawHeading = new Quaternion(mob.HeadingX, mob.HeadingY, mob.HeadingZ, mob.HeadingW);
                cmob.Name = mob.Name;
                cmob.FirstName = "";
                cmob.LastName = "";
                foreach (DBMobSpawnStat stat in stats)
                {
                    cmob.Stats.SetBaseValueWithoutTriggering(stat.Stat, (uint)stat.Value);
                }

                cmob.Stats.SetBaseValueWithoutTriggering((int)StatIds.visualprofession, cmob.Stats[StatIds.profession].BaseValue);
                // initiate affected stats calculation
                int temp = cmob.Stats[StatIds.level].Value;
                temp = cmob.Stats[StatIds.agility].Value;
                temp = cmob.Stats[StatIds.headmesh].Value;
                cmob.MeshLayer.AddMesh(0, cmob.Stats[StatIds.headmesh].Value, 0, 4);
                cmob.SocialMeshLayer.AddMesh(0, cmob.Stats[StatIds.headmesh].Value, 0, 4);
                List<MobSpawnWaypoint> waypoints =
                    MessagePackZip.DeserializeData<MobSpawnWaypoint>(mob.Waypoints.ToArray());
                foreach (MobSpawnWaypoint wp in waypoints)
                {
                    Waypoint mobwp = new Waypoint();
                    mobwp.Position.x = wp.X;
                    mobwp.Position.y = wp.Y;
                    mobwp.Position.z = wp.Z;
                    mobwp.Running = wp.WalkMode == 1;
                    cmob.Waypoints.Add(mobwp);
                }
                npccontroller.Character = cmob;
                if (cmob.Waypoints.Count > 2)
                {
                    cmob.Controller.State = CharacterState.Patrolling;
                }
                cmob.DoNotDoTimers = false;
                return cmob;
            }
            return null;
        }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:54,代码来源:NonPlayerCharacterHandler.cs

示例11: ExecuteCommand

        /// <summary>
        /// </summary>
        /// <param name="character">
        /// </param>
        /// <param name="target">
        /// </param>
        /// <param name="args">
        /// </param>
        public override void ExecuteCommand(ICharacter character, Identity target, string[] args)
        {
            Dictionary<Identity, string> list = ((Playfield)character.Playfield).ListAvailablePlayfields();
            var messList = new List<MessageBody>();
            foreach (KeyValuePair<Identity, string> pf in list)
            {
                messList.Add(ChatText.Create(character, pf.Key.Instance.ToString().PadLeft(8) + ": " + pf.Value));
            }

            character.Playfield.Publish(Bulk.CreateIM(character.Client, messList.ToArray()));
        }
开发者ID:kittin,项目名称:CellAO-NightPredator,代码行数:19,代码来源:PlayfieldList.cs

示例12: ExecuteCommand

        public override void ExecuteCommand(ICharacter character, Identity target, string[] args)
        {
            Vector3 position = new Vector3();
            position.X = character.Coordinates().x;
            position.Y = character.Coordinates().y;
            position.Z = character.Coordinates().z;
            byte type = byte.Parse(args[1]);
            /*if (type == 2)
            {
                // Set temperature
                WeatherControlMessageHandler.Default.Send(
                    character,
                    byte.Parse(args[1]),
                    (byte)(sbyte.Parse(args[2])),
                    byte.Parse(args[3]),
                    byte.Parse(args[4]),
                    byte.Parse(args[5]),
                    byte.Parse(args[6]),
                    byte.Parse(args[7]),
                    byte.Parse(args[8]));
            }
            else*/
            {
                int ambientColor = Convert.ToInt32(args[13], 16);
                int fogColor = Convert.ToInt32(args[14], 16);

                WeatherEntry newWeather = new WeatherEntry();
                newWeather.AmbientColor = ambientColor;
                newWeather.FogColor = fogColor;
                newWeather.Position = position;
                newWeather.FadeIn = short.Parse(args[1]);
                newWeather.Duration = int.Parse(args[2]);
                newWeather.FadeOut = short.Parse(args[3]);
                newWeather.Range = Single.Parse(args[4]);
                newWeather.WeatherType = (WeatherType)byte.Parse(args[5]);
                newWeather.Intensity = byte.Parse(args[6]);
                newWeather.Wind = byte.Parse(args[7]);
                newWeather.Clouds = byte.Parse(args[8]);
                newWeather.Thunderstrikes = byte.Parse(args[9]);
                newWeather.Tremors = byte.Parse(args[10]);
                newWeather.ThunderstrikePercentage = byte.Parse(args[11]);
                newWeather.TremorPercentage = byte.Parse(args[12]);
                newWeather.ZBufferVisibility = byte.Parse(args[15]);
                newWeather.Playfield = character.Playfield.Identity;

                WeatherSettings.Instance.Add(newWeather);

                WeatherControlMessageHandler.Default.Send(character, newWeather);
            }
        }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:50,代码来源:Weather.cs

示例13: Dynel

        /// <summary>
        /// </summary>
        /// <param name="pooledIn">
        /// </param>
        /// <param name="id">
        /// </param>
        public Dynel(Pool pooledIn, Identity id)
            : base(pooledIn, id)
        {
            this.Starting = true;
            this.DoNotDoTimers = true;

            this.Stats = new Stats(this.Identity);
            this.InitializeStats();

            this.BaseInventory = new UnitInventory(this);

            this.DoNotDoTimers = false;
            this.Starting = false;
        }
开发者ID:kittin,项目名称:CellAO-NightPredator,代码行数:20,代码来源:Dynel.cs

示例14: ExecuteCommand

        /// <summary>
        /// </summary>
        /// <param name="character">
        /// </param>
        /// <param name="target">
        /// </param>
        /// <param name="args">
        /// </param>
        public override void ExecuteCommand(ICharacter character, Identity target, string[] args)
        {
            List<StatelData> sd = PlayfieldLoader.PFData[character.Playfield.Identity.Instance].Statels;
            var messList = new List<MessageBody>();
            foreach (StatelData s in sd)
            {
                messList.Add(
                    ChatText.Create(
                        character,
                        ((int)s.StatelIdentity.Type).ToString("X8") + ":" + s.StatelIdentity.Instance.ToString("X8")));
            }

            character.Playfield.Publish(Bulk.CreateIM(character.Client, messList.ToArray()));
        }
开发者ID:kittin,项目名称:CellAO-NightPredator,代码行数:22,代码来源:ListStatels.cs

示例15: Create

 /// <summary>
 /// </summary>
 /// <param name="character">
 /// </param>
 /// <param name="destination">
 /// </param>
 /// <param name="heading">
 /// </param>
 /// <param name="playfield">
 /// </param>
 /// <returns>
 /// </returns>
 public static N3TeleportMessage Create(
     ICharacter character, 
     Coordinate destination, 
     IQuaternion heading, 
     Identity playfield)
 {
     return new N3TeleportMessage()
            {
                Identity = character.Identity,
                Destination =
                    new Vector3()
                    {
                        X = destination.x,
                        Y = destination.y,
                        Z = destination.z
                    },
                Heading =
                    new Quaternion()
                    {
                        X = heading.xf,
                        Y = heading.yf,
                        Z = heading.zf,
                        W = heading.wf
                    },
                Unknown1 = 0x61,
                Playfield =
                    new Identity()
                    {
                        Type = IdentityType.Playfield1,
                        Instance = playfield.Instance
                    },
                ChangePlayfield =
                    ((playfield.Instance != character.Playfield.Identity.Instance)
                     || (playfield.Type != character.Playfield.Identity.Type))
                        ? new Identity
                          {
                              Type = IdentityType.Playfield2,
                              Instance = playfield.Instance
                          }
                        : Identity.None,
                Playfield2 =
                    new Identity
                    {
                        Type = IdentityType.Playfield3,
                        Instance = playfield.Instance
                    },
            };
 }
开发者ID:kittin,项目名称:CellAO-NightPredator,代码行数:60,代码来源:Teleport.cs


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