本文整理汇总了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);
}
示例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);
//.........这里部分代码省略.........