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


C# Player.getAppearance方法代码示例

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


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

示例1: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length == 0)
            {
                player.getPackets().sendMessage("[PlayerAsNpc command]: ::pnpc npcId");
                return;
            }

            int npcId = 0;
            if (!int.TryParse(arguments[0], out npcId))
            {
                player.getPackets().sendMessage("[PlayerAsNpc command]: ::pnpc npcId [npcId is not a number error]");
                return;
            }

            player.getAppearance().setNpcId(npcId);
            player.getUpdateFlags().setAppearanceUpdateRequired(true);
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:18,代码来源:PlayerAsNpc.cs

示例2: appendAppearanceUpdate

        private static void appendAppearanceUpdate(Player p, PacketBuilder updateBlock)
        {
            PacketBuilder playerProps = new PacketBuilder().setSize(Packet.Size.Bare);

            Appearance app = p.getAppearance();
            playerProps.addByte((byte) (app.getGender() & 0xFF));
            if((app.getGender() & 0x2) == 2) {
                playerProps.addByte((byte) 0);
                playerProps.addByte((byte) 0);
            }
            playerProps.addByte((byte) p.getPrayers().getPkIcon());
            playerProps.addByte((byte) p.getPrayers().getHeadIcon());
            if (!app.isInvisible()) {
                if(!app.isNpc()) {
                    for(int i = 0; i < 4; i++) {
                        if(p.getEquipment().getItemInSlot((ItemData.EQUIP)i) != -1) {
                            playerProps.addUShort(32768 + p.getEquipment().getSlot((ItemData.EQUIP)i).getDefinition().getEquipId());
                        } else {
                            playerProps.addByte((byte) 0);
                        }
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.CHEST) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.CHEST).getDefinition().getEquipId());
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.AMULET));
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.SHIELD) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.SHIELD).getDefinition().getEquipId());
                    } else {
                        playerProps.addByte((byte) 0);
                    }
                    Item chest = p.getEquipment().getSlot(ItemData.EQUIP.CHEST);
                    if (chest != null && chest.getDefinition() != null)
                    {
                        if(!ItemData.isFullBody(chest.getDefinition())) {
                            playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.WEAPON));
                        } else {
                            playerProps.addByte((byte) 0);
                        }
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.WEAPON));
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.LEGS) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.LEGS).getDefinition().getEquipId());
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.SHIELD));
                    }
                    Item hat = p.getEquipment().getSlot(ItemData.EQUIP.HAT);
                    if (hat != null && hat.getDefinition() != null)
                    {
                        if(!ItemData.isFullHat(hat.getDefinition()) && !ItemData.isFullMask(hat.getDefinition())) {
                            playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.HAT));
                        } else {
                            playerProps.addByte((byte) 0);
                        }
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.HAT));
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.HANDS) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.HANDS).getDefinition().getEquipId());
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.CHEST));
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.FEET) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.FEET).getDefinition().getEquipId());
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(6));
                    }
                    if (hat != null && hat.getDefinition() != null)
                    {
                        if(!ItemData.isFullMask(hat.getDefinition())) {
                            playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.CAPE));
                        } else {
                            playerProps.addByte((byte) 0);
                        }
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.CAPE));
                    }
                } else {
                    playerProps.addUShort(-1);
                    playerProps.addUShort(app.getNpcId());
                    playerProps.addByte((byte) 255);
                }
            } else {
                for (int i = 0; i < 12; i++) {
                    playerProps.addByte((byte) 0);
                }
            }
            foreach(int colour in app.getColoursArray()) {
                playerProps.addByte((byte) colour);
            }
            playerProps.addUShort(p.getEquipment().getStandWalkAnimation());
            playerProps.addLong(p.getLoginDetails().getLongName());
            playerProps.addByte((byte) p.getSkills().getCombatLevel());
            playerProps.addUShort(0);
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:PlayerUpdate.cs


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