本文整理匯總了C#中RS2.Server.player.Player.getAppearance方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.getAppearance方法的具體用法?C# Player.getAppearance怎麽用?C# Player.getAppearance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類RS2.Server.player.Player
的用法示例。
在下文中一共展示了Player.getAppearance方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: openInterface
public static void openInterface(Player p)
{
p.getPackets().displayInterface(771);
p.getPackets().sendPlayerHead(771, 79);
p.getPackets().animateInterface(9804, 771, 79);
p.getPackets().sendConfig(1262, p.getAppearance().getGender() == 2 ? 1 : 8);
p.getAppearance().setTemporaryAppearance(new Appearance());
p.getAppearance().getTemporaryAppearance().setColoursArray(p.getAppearance().getColoursArray());
p.getAppearance().getTemporaryAppearance().setLookArray(p.getAppearance().getLookArray());
p.getAppearance().getTemporaryAppearance().setGender(p.getAppearance().getGender());
p.removeTemporaryAttribute("hairToggle");
}
示例2: sortButton
public static void sortButton(Player p, int button)
{
Appearance temp = p.getAppearance().getTemporaryAppearance();
if (button == 362)
{
p.setAppearance(p.getAppearance().getTemporaryAppearance());
p.getPackets().closeInterfaces();
return;
}
if ((button == 52 && temp.getGender() == 1) || (button == 49 && temp.getGender() == 0))
{
p.getPackets().sendConfig(1262, temp.getGender() == 0 ? 1 : 8);
temp.setGender(temp.getGender() == 0 ? 1 : 0);
return;
}
if (button == 93)
{
temp.setLook(0, getHairStyle(p, false));
return;
}
if (button == 93)
{
temp.setLook(0, getHairStyle(p, true));
return;
}
if (button >= 151 && button <= 158)
{
temp.setColour(4, getSkinColour(p, button));
return;
}
if (button >= 189 && button <= 217)
{
temp.setColour(2, getTorsoColour(p, button));
return;
}
}
示例3: 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);
}
示例4: getHairStyle
private static int getHairStyle(Player p, bool decrease)
{
int oldHair = p.getAppearance().getLook(0);
int newHair = oldHair;
if (p.getTemporaryAttribute("hairToggle") == null)
{
p.setTemporaryAttribute("hairToggle", 0);
return 0;
}
newHair = (int)p.getTemporaryAttribute("hairToggle");
newHair = decrease ? -1 : +1;
if (newHair == 11)
{
newHair = 186;//
}
else if (newHair == 12)
{
newHair = 188;//
}
else if (newHair == 13)
{
newHair = 190;//
}
else if (newHair == 14)
{
newHair = 192;//
}
else if (newHair == 15)
{
newHair = 194;//
}
else if (newHair == 16)
{
newHair = 196; //
}
else if (newHair == 17)
{
//17 to 25 dump from rs
}
p.setTemporaryAttribute("hairToggle", newHair);
return newHair;
}
示例5: 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));
}
//.........這裏部分代碼省略.........
示例6: doObstacle
public static void doObstacle(Player p, int index)
{
if (p.getTemporaryAttribute("unmovable") != null)
{
return;
}
switch (index)
{
case 0: // 3 planks, northern (east side)
case 1: // 3 planks, middle (east side)
case 2: // 3 planks, southern (east side)
case 3: // 3 planks, northern (west side)
case 4: // 3 planks, middle (west side)
case 5: // 3 planks, southern (west side)
int logXCoord = index <= 2 ? (int)AGILITY_ARENA_OBJECTS[index][1] + 1 : (int)AGILITY_ARENA_OBJECTS[index][1] - 1;
int logDirectionX = index <= 2 ? -7 : +7;
CoordinateEvent plankObstaclesCoordinateEvent = new CoordinateEvent(p, new Location(logXCoord, (int)AGILITY_ARENA_OBJECTS[index][2], 3));
plankObstaclesCoordinateEvent.setAction(() =>
{
bool running = p.getWalkingQueue().isRunToggled();
p.getWalkingQueue().setRunToggled(false);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
p.setTemporaryAttribute("unmovable", true);
p.getAppearance().setWalkAnimation(155);
p.getUpdateFlags().setAppearanceUpdateRequired(true);
p.getWalkingQueue().forceWalk(logDirectionX, 0);
Event plankObstaclesEvent = new Event(4300);
plankObstaclesEvent.setAction(() =>
{
plankObstaclesEvent.stop();
p.removeTemporaryAttribute("unmovable");
p.getAppearance().setWalkAnimation(-1);
p.getUpdateFlags().setAppearanceUpdateRequired(true);
p.getSkills().addXp(Skills.SKILL.AGILITY, (double)AGILITY_ARENA_OBJECTS[index][3]);
p.getWalkingQueue().setRunToggled(running);
});
Server.registerEvent(plankObstaclesEvent);
});
Server.registerCoordinateEvent(plankObstaclesCoordinateEvent);
break;
case 6: //Handholds obstacle east of planks.
case 7: //Handholds obstacle west of planks.
int handHoldsDirectionX = 1;
int handHoldsDirectionY = 1;
if (index == 6)
{
handHoldsDirectionX = -1;
handHoldsDirectionY = +1;
}
else if (index == 7)
{
handHoldsDirectionX = +1;
handHoldsDirectionY = -1;
}
CoordinateEvent handholdsObstacleCoordinateEvent = new CoordinateEvent(p, new Location((int)AGILITY_ARENA_OBJECTS[index][1], (int)AGILITY_ARENA_OBJECTS[index][2], 3));
handholdsObstacleCoordinateEvent.setAction(() =>
{
bool running = p.getWalkingQueue().isRunToggled();
p.getWalkingQueue().setRunToggled(false);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
p.setTemporaryAttribute("unmovable", true);
p.setLastAnimation(new Animation(1121));
p.setFaceLocation(new Location(p.getLocation().getX(), p.getLocation().getY() + handHoldsDirectionY, 3));
Event handholdsObstaclesEvent = new Event(700);
int handholdsObstaclesCounter = 0;
handholdsObstaclesEvent.setAction(() =>
{
p.setLastAnimation(new Animation(1122));
int regionX = p.getUpdateFlags().getLastRegion().getRegionX();
int regionY = p.getUpdateFlags().getLastRegion().getRegionY();
int lX = (p.getLocation().getX() - ((regionX - 6) * 8));
int lY = (p.getLocation().getY() - ((regionY - 6) * 8));
p.setForceMovement(new ForceMovement(lX, lY, lX + handHoldsDirectionX, lY, 0, 5, 0));
if (handholdsObstaclesCounter++ >= 7)
{
p.setLastAnimation(new Animation(65535));
handholdsObstaclesEvent.stop();
p.removeTemporaryAttribute("unmovable");
p.getSkills().addXp(Skills.SKILL.AGILITY, (double)AGILITY_ARENA_OBJECTS[index][3]);
p.getWalkingQueue().setRunToggled(running);
return;
}
Event teleportEvent = new Event(500);
teleportEvent.setAction(() =>
{
teleportEvent.stop();
p.teleport(new Location(p.getLocation().getX() + handHoldsDirectionX, p.getLocation().getY(), 3));
});
Server.registerEvent(teleportEvent);
});
Server.registerEvent(handholdsObstaclesEvent);
});
Server.registerCoordinateEvent(handholdsObstacleCoordinateEvent);
break;
}
}
示例7: resetVariables
private void resetVariables(Player p)
{
p.setSkullCycles(0);
p.getSpecialAttack().resetSpecial();
p.setLastkiller(null);
p.setDead(false);
p.setEntityFocus(65535);
p.setPoisonAmount(0);
p.clearKillersHits();
p.setLastVengeanceTime(0);
p.setVengeance(false);
p.removeTemporaryAttribute("willDie");
p.setFrozen(false);
p.removeTemporaryAttribute("unmovable");
p.setAntifireCycles(0);
p.setSuperAntipoisonCycles(0);
p.setTeleblockTime(0);
p.removeTemporaryAttribute("teleblocked");
p.setTarget(null);
p.setAttacker(null);
foreach (Skills.SKILL skill in Enum.GetValues(typeof(Skills.SKILL)))
p.getSkills().setCurLevel(skill, p.getSkills().getMaxLevel(skill));
p.getPackets().sendSkillLevels();
Prayer.deactivateAllPrayers(p);
if (p.getTemporaryAttribute("cantDoAnything") != null)
{
p.getAppearance().setInvisible(false);
p.getUpdateFlags().setAppearanceUpdateRequired(true);
p.removeTemporaryAttribute("cantDoAnything");
p.removeTemporaryAttribute("unmovable");
teleportToWaitingRoom(p, false);
p.getPackets().closeInterfaces();
p.getPackets().setMinimapStatus(0);
p.getPackets().clearMapFlag();
}
}
示例8: useOrb
public void useOrb(Player p, int button)
{
if (p.getTemporaryAttribute("teleporting") != null)
{
return;
}
if (button == -1)
{
AreaEvent useOrbAreaEvent = new AreaEvent(p, 2398, 5171, 2400, 5173);
useOrbAreaEvent.setAction(() =>
{
p.getPackets().displayInventoryInterface(374);
p.getAppearance().setInvisible(true);
p.getUpdateFlags().setAppearanceUpdateRequired(true);
p.setTemporaryAttribute("cantDoAnything", true);
p.setTemporaryAttribute("unmovable", true);
p.getPackets().setMinimapStatus(2);
Event useOrbEvent = new Event(500);
useOrbEvent.setAction(() =>
{
useOrbEvent.stop();
int random = Misc.random(4);
p.teleport(new Location(ORB_COORDINATES[1][random], ORB_COORDINATES[2][random], 0));
});
Server.registerEvent(useOrbEvent);
});
Server.registerCoordinateEvent(useOrbAreaEvent);
}
else
{
if (p.getTemporaryAttribute("cantDoAnything") != null)
{
if (button == 5)
{
Event useOrbTwoEvent = new Event(500);
useOrbTwoEvent.setAction(() =>
{
useOrbTwoEvent.stop();
p.getAppearance().setInvisible(false);
p.getUpdateFlags().setAppearanceUpdateRequired(true);
p.removeTemporaryAttribute("cantDoAnything");
p.removeTemporaryAttribute("unmovable");
teleportToWaitingRoom(p, false);
p.getPackets().closeInterfaces();
p.getPackets().setMinimapStatus(0);
p.getPackets().clearMapFlag();
});
Server.registerEvent(useOrbTwoEvent);
return;
}
for (int i = 0; i < ORB_COORDINATES[0].Length; i++)
{
if (button == ORB_COORDINATES[0][i])
{
int j = i;
p.setTemporaryAttribute("teleporting", true);
Event teleportToOrbEvent = new Event(500);
teleportToOrbEvent.setAction(() =>
{
teleportToOrbEvent.stop();
p.teleport(new Location(ORB_COORDINATES[1][j], ORB_COORDINATES[2][j], 0));
Teleport.resetTeleport(p);
});
Server.registerEvent(teleportToOrbEvent);
return;
}
}
}
}
}
示例9: getTorsoColour
private static int getTorsoColour(Player p, int button)
{
int[] buttons = { 189, 190, 191, 192, 193, 194, 195, 196 };
int[] colours = { 10, 1, 2, 3, 4, 5, 6, 7 };
for (int i = 0; i < buttons.Length; i++)
{
if (button == buttons[i])
{
return colours[i];
}
}
return p.getAppearance().getColour(2);
}
示例10: getSkinColour
private static int getSkinColour(Player p, int button)
{
int[] buttons = { 151, 152, 153, 154, 155, 156, 157, 158 };
int[] skins = { 10, 1, 2, 3, 4, 5, 6, 7 };
for (int i = 0; i < buttons.Length; i++)
{
if (button == buttons[i])
{
return skins[i];
}
}
return p.getAppearance().getColour(4);
}