本文整理匯總了C#中RS2.Server.player.Player.setFaceLocation方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.setFaceLocation方法的具體用法?C# Player.setFaceLocation怎麽用?C# Player.setFaceLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類RS2.Server.player.Player
的用法示例。
在下文中一共展示了Player.setFaceLocation方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: interactWithAubury
public static void interactWithAubury(Player p, Npc n, int option)
{
p.setEntityFocus(n.getClientIndex());
AreaEvent interactWithAuburyAreaEvent = new AreaEvent(p, n.getLocation().getX() - 1, n.getLocation().getY() - 1, n.getLocation().getX() + 1, n.getLocation().getY() + 1);
interactWithAuburyAreaEvent.setAction(() =>
{
n.setFaceLocation(p.getLocation());
p.setFaceLocation(n.getLocation());
p.setEntityFocus(65535);
switch (option)
{
case 1: // talk to
break;
case 2: // trade
p.setShopSession(new ShopSession(p, 3));
break;
case 3: // teleport
RuneCraft.teleportToEssMine(p, n);
break;
}
});
Server.registerCoordinateEvent(interactWithAuburyAreaEvent);
}
示例2: crossDitch
public static void crossDitch(Player p, int x, int y)
{
if (p.getTemporaryAttribute("unmovable") != null)
{
return;
}
AreaEvent crossDitchAreaEvent = new AreaEvent(p, x, y - 1, x, y + 2);
crossDitchAreaEvent.setAction(() =>
{
p.getPackets().closeInterfaces();
p.getWalkingQueue().resetWalkingQueue();
p.setTemporaryAttribute("unmovable", true);
int newY = p.getLocation().getY() >= 3523 ? p.getLocation().getY() - 3 : p.getLocation().getY() + 3;
int dir = newY == 3 ? 0 : 4;
Location faceLocation = new Location(p.getLocation().getX(), dir == 3 ? 3523 : 3520, 0);
p.setFaceLocation(faceLocation);
Event crossDitchMoveEvent = new Event(500);
crossDitchMoveEvent.setAction(() =>
{
crossDitchMoveEvent.stop();
p.setLastAnimation(new Animation(6132));
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));
ForceMovement movement = new ForceMovement(lX, lY, lX, newY, 33, 60, dir);
p.setForceMovement(movement);
p.setFaceLocation(new Location(x, y, 0));
Event crossDitchTeleportEvent = new Event(1250);
crossDitchTeleportEvent.setAction(() =>
{
crossDitchTeleportEvent.stop();
int playerY = p.getLocation().getY();
int nY = playerY >= 3523 ? 3520 : 3523;
p.teleport(new Location(p.getLocation().getX(), nY, 0));
p.removeTemporaryAttribute("unmovable");
});
Server.registerEvent(crossDitchTeleportEvent);
});
Server.registerEvent(crossDitchMoveEvent);
});
Server.registerCoordinateEvent(crossDitchAreaEvent);
}
示例3: interactWithAliMorissaae
public static void interactWithAliMorissaae(Player p, Npc n)
{
p.setEntityFocus(n.getClientIndex());
AreaEvent interactWithAliMorissaaeAreaEvent = new AreaEvent(p, n.getLocation().getX() - 1, n.getLocation().getY() - 1, n.getLocation().getX() + 1, n.getLocation().getY() + 1);
interactWithAliMorissaaeAreaEvent.setAction(() =>
{
n.setFaceLocation(p.getLocation());
p.setFaceLocation(n.getLocation());
p.setEntityFocus(65535);
showAliDialogue(p, 205);
});
Server.registerCoordinateEvent(interactWithAliMorissaaeAreaEvent);
}
示例4: interactWithBoatNPC
public static bool interactWithBoatNPC(Player p, Npc n)
{
int id = n.getId();
if (id != 4540 && id != 1304 && id != 2436 && id != 3781 && id != 1361 && id != 4962)
{
return false;
}
p.setEntityFocus(n.getClientIndex());
AreaEvent interactWithBoatNPCAreaEvent = new AreaEvent(p, n.getLocation().getX() - 1, n.getLocation().getY() - 1, n.getLocation().getX() + 1, n.getLocation().getY() + 1);
interactWithBoatNPCAreaEvent.setAction(() =>
{
n.setFaceLocation(p.getLocation());
p.setFaceLocation(n.getLocation());
p.setEntityFocus(65535);
switch (n.getId())
{
case 4540: // Home boat
showBentleyDialogue(p, 240);
break;
case 1304: // Canifis sailor
showCanifisSailorDialogue(p, 280);
break;
case 2436: // Waterbirth isle
showJarvaldDialogue(p, 300);
break;
case 3781: // Pest control squire
showSquireDialogue(p, 340);
break;
case 1361: // Warrior guild
showArnorDialogue(p, 370);
break;
case 4962: // fremmenik shore
showCaptainBarnabyDialogue(p, 410);
break;
}
});
Server.registerCoordinateEvent(interactWithBoatNPCAreaEvent);
return true;
}
示例5: interactTzhaarNPC
public static bool interactTzhaarNPC(Player p, Npc n, int option)
{
if (n.getId() != 2622 && n.getId() != 2620 && n.getId() != 2623 && n.getId() != 2619 && n.getId() != 2617 && n.getId() != 2618)
{
return false;
}
p.setEntityFocus(n.getClientIndex());
int npcX = n.getLocation().getX();
int npcY = n.getLocation().getY();
AreaEvent interactTzhaarNpcAreaEvent = new AreaEvent(p, npcX - 1, npcY - 1, npcX + 1, npcY + 1);
interactTzhaarNpcAreaEvent.setAction(() =>
{
p.setFaceLocation(n.getLocation());
p.setEntityFocus(65535);
switch (n.getId())
{
case 2619: // Bankers
if (option == 1)
{ // Talk
}
else if (option == 2)
{ // Bank
p.getBank().openBank();
}
else if (option == 3)
{ // Collect
}
break;
//TODO tzhaar stores
case 2622: // Ore shop
if (option == 1)
{ // Speak
}
else if (option == 2)
{ // Trade
p.setShopSession(new ShopSession(p, 3));
}
break;
}
});
Server.registerCoordinateEvent(interactTzhaarNpcAreaEvent);
return true;
}
示例6: talkToBob
public static void talkToBob(Player p, Npc npc, int item, int option)
{
p.setEntityFocus(npc.getClientIndex());
AreaEvent talkToBobAreaEvent = new AreaEvent(p, npc.getLocation().getX() - 1, npc.getLocation().getY() - 1, npc.getLocation().getX() + 1, npc.getLocation().getY() + 1);
talkToBobAreaEvent.setAction(() =>
{
npc.setFaceLocation(p.getLocation());
p.setFaceLocation(npc.getLocation());
p.setEntityFocus(65535);
if (option == 0)
{ // use item on bob
if (item > 0)
{
p.setTemporaryAttribute("bobsAxesBarrowItem", item);
showBobDialogue(p, 101);
}
}
else if (option == 1)
{ // talk
showBobDialogue(p, 107);
}
else if (option == 2)
{ // trade
p.setShopSession(new ShopSession(p, 4));
}
});
Server.registerCoordinateEvent(talkToBobAreaEvent);
}
示例7: handleThirdClickObject
private void handleThirdClickObject(Player player, Packet packet)
{
short id = packet.readLEShortA();
int y = packet.readLEShortA();
int x = packet.readLEShort();
if (player.getTemporaryAttribute("unmovable") != null)
{
return;
}
if (x < 1000 || id < 0 || y < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
{
return;
}
SkillHandler.resetAllSkills(player);
player.getPackets().closeInterfaces();
player.setFaceLocation(new Location(x, y, player.getLocation().getZ()));
Console.WriteLine("Third object click = " + id + " " + x + " " + y);
if (LaddersAndStairs.useObject(player, id, new Location(x, y, player.getLocation().getZ()), 3))
{
return;
}
switch (id)
{
case 28089: // GE desk
Server.getGrandExchange().clickDesk(player, x, y, 3);
break;
}
}
示例8: slashWeb
public static void slashWeb(Player p, ushort webId, Location webLocation)
{
AreaEvent slashWebAreaEvent = new AreaEvent(p, webLocation.getX() - 1, webLocation.getY() - 1, webLocation.getX() + 1, webLocation.getY() + 1);
slashWebAreaEvent.setAction(() =>
{
long lastSlash = 0;
p.setFaceLocation(webLocation);
if (p.getTemporaryAttribute("lastWebSlash") != null)
{
lastSlash = (int)p.getTemporaryAttribute("lastWebSlash");
}
if (Environment.TickCount - lastSlash <= 800)
{
return;
}
if (Server.getGlobalObjects().originalObjectExists(webId, webLocation))
{
p.setLastAnimation(new Animation(p.getAttackAnimation()));
p.setTemporaryAttribute("lastWebSlash", Environment.TickCount);
Event attemptCutWebEvent = new Event(500);
attemptCutWebEvent.setAction(() =>
{
attemptCutWebEvent.stop();
bool webExists = Server.getGlobalObjects().originalObjectExists(webId, webLocation);
Server.getGlobalObjects().lowerHealth(webId, webLocation);
if (Server.getGlobalObjects().originalObjectExists(webId, webLocation))
{
p.getPackets().sendMessage("You fail to cut through the web.");
}
else
{
if (webExists)
{ // This means we slashed it, if !webExists, someone else slashed it in the last 500ms
p.getPackets().sendMessage("You slash through the web!");
}
}
});
Server.registerEvent(attemptCutWebEvent);
}
});
Server.registerCoordinateEvent(slashWebAreaEvent);
}
示例9: handleSecondClickObject
private void handleSecondClickObject(Player player, Packet packet)
{
int objectY = packet.readLEShortA();
int objectX = packet.readLEShort();
ushort objectId = packet.readUShort();
Console.WriteLine("Second object click = " + objectId + " " + objectX + " " + objectY);
if (player.getTemporaryAttribute("unmovable") != null)
{
return;
}
if (objectX < 1000 || objectY < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
{
return;
}
SkillHandler.resetAllSkills(player);
player.getPackets().closeInterfaces();
player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
if (Thieving.wantToThieveStall(player, objectId, objectX, objectY))
{
return;
}
else if (Farming.interactWithPatch(player, objectId, objectX, objectY, -1))
{
return;
}
else if (LaddersAndStairs.useObject(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 2))
{
return;
}
switch (objectId)
{
case 28089: // GE desk
Server.getGrandExchange().clickDesk(player, objectX, objectY, 2);
break;
case 25824: // Spinning wheel (Seers)
case 36970: // Spinning wheel (Lumbridge
Spinning.displaySpinningInterface(player);
break;
case 6: // Dwarf multicannon
DwarfCannon cannon = player.getCannon();
Location l = new Location(objectX, objectY, player.getLocation().getZ());
if (cannon == null || (cannon != null & !l.Equals(cannon.getLocation())))
{
player.getPackets().sendMessage("This isn't your cannon!");
break;
}
cannon.pickupCannon();
break;
case 11666: // Falador furnace
case 36956: // Lumbridge furnace
Smelting.displaySmeltOptions(player);
break;
case 11959: // Tin rocks
case 11958:
case 11957:
case 11933:
case 11934:
case 11935:
case 31077:
case 31078:
case 31079:
Mining.prospectRock(player, objectX, objectY, "tin");
break;
case 11960: // Copper rocks
case 11961:
case 11962:
case 11936:
case 11937:
case 11938:
case 31080:
case 31081:
case 31082:
Mining.prospectRock(player, objectX, objectY, "copper");
break;
case 15504: // Clay rocks
case 15503:
case 15505:
case 11189:
case 11190:
case 11191:
case 31062:
case 31063:
case 31064:
case 32429:
case 32430:
case 32431:
Mining.prospectRock(player, objectX, objectY, "clay");
break;
case 11948: // Silver rocks
case 11949:
case 11950:
case 11165:
case 11186:
//.........這裏部分代碼省略.........
示例10: handleFirstClickObject
private void handleFirstClickObject(Player player, Packet packet)
{
int objectX = packet.readLEShort();
ushort objectId = (ushort)packet.readShortA();
int objectY = packet.readUShort();
if (objectX < 1000 || objectY < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
{
return;
}
SkillHandler.resetAllSkills(player);
player.getPackets().closeInterfaces();
Console.WriteLine("First object click = " + objectId + " " + objectX + " " + objectY);
if (RuneCraft.wantToRunecraft(player, objectId, objectX, objectY))
{
return;
}
else if (RuneCraft.enterRift(player, objectId, objectX, objectY))
{
return;
}
else if (RuneCraft.enterViaTiara(player, objectId, objectX, objectY))
{
player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
return;
}
else if (RuneCraft.leaveAltar(player, objectId, objectX, objectY))
{
return;
}
else if (Barrows.leaveCrypt(player, objectId, objectX, objectY))
{
return;
}
else if (Barrows.tryOpenCoffin(player, objectId))
{
return;
}
else if (Barrows.openTunnelDoor(player, objectId, objectX, objectY))
{
return;
}
else if (Thieving.wantToThieveChest(player, objectId, objectX, objectY))
{
return;
}
else if (Agility.doAgility(player, objectId, objectX, objectY))
{
return;
}
else if (Farming.interactWithPatch(player, objectId, objectX, objectY, -1))
{
return;
}
else if (Server.getGlobalObjects().getDoors().useDoor(player, objectId, objectX, objectY, player.getLocation().getZ()))
{
return;
}
else if (LaddersAndStairs.useObject(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 1))
{
return;
}
else if (WildernessObelisks.useWildernessObelisk(player, objectId, new Location(objectX, objectY, player.getLocation().getZ())))
{
return;
}
if (player.getTemporaryAttribute("unmovable") != null)
{
return;
}
player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
switch (objectId)
{
case 2492: // essence mine portals
RuneCraft.leaveEssMine(player, new Location(objectX, objectY, player.getLocation().getZ()));
break;
case 5959:
case 5960:
Wilderness.handleLever(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()));
break;
case 733: // Wilderness web
Wilderness.slashWeb(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()));
break;
case 28089: // GE desk
Server.getGrandExchange().clickDesk(player, objectX, objectY, 1);
break;
case 9359: // Tzhaar main exit
TzHaar.exitTzhaar(player);
break;
case 31284: // Tzhaar entrance
TzHaar.enterTzhaar(player);
break;
case 9357: // Fight cave exit
FightCave.exitCave(player, objectX, objectY);
break;
//.........這裏部分代碼省略.........
示例11: tagPillar
public static void tagPillar(Player p, int pillarIndex)
{
AreaEvent tagPillarAreaEvent = new AreaEvent(p, AGILITY_ARENA_PILLARS[pillarIndex][1] - 1, AGILITY_ARENA_PILLARS[pillarIndex][2] - 1, AGILITY_ARENA_PILLARS[pillarIndex][1] + 1, AGILITY_ARENA_PILLARS[pillarIndex][2] + 1);
tagPillarAreaEvent.setAction(() =>
{
if (p.getLocation().getZ() == 3)
{
p.setFaceLocation(new Location(AGILITY_ARENA_PILLARS[pillarIndex][1], AGILITY_ARENA_PILLARS[pillarIndex][2], 3));
if (pillarIndex != currentPillar)
{
p.getPackets().sendMessage("You can only get a ticket when the flashing arrow is above the pillar!");
return;
}
if (p.isTaggedLastAgilityPillar())
{
p.getPackets().sendMessage("You have already tagged this pillar, wait until the arrow moves again.");
return;
}
int currentStatus = p.getAgilityArenaStatus();
if (currentStatus == 0)
{
p.getPackets().sendConfig(309, 4);
p.getPackets().sendMessage("You get tickets by tagging more than one pillar in a row. Tag the next pillar!");
}
else
{
p.getInventory().addItem(2996);
p.getPackets().sendMessage("You recieve an Agility Arena ticket!");
}
p.setAgilityArenaStatus(currentStatus == 0 ? 1 : 1);
p.setTaggedLastAgilityPillar(true);
}
});
Server.registerCoordinateEvent(tagPillarAreaEvent);
}
示例12: handleItemOnObject
private void handleItemOnObject(Player player, Packet packet)
{
int objectX = packet.readShortA();
int item = packet.readUShort();
int objectY = packet.readLEShort();
int slot = packet.readUShort();
int interfaceId = packet.readLEShort();
int child = packet.readUShort();
int objectId = packet.readShortA();
if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
{
return;
}
Console.WriteLine("Item on object = " + objectId + " " + objectX + " " + objectY);
SkillHandler.resetAllSkills(player);
player.getPackets().closeInterfaces();
player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
if (player.getInventory().getItemInSlot(slot) == item)
{
if (Crafting.wantsToCraftOnObject(player, player.getInventory().getItemInSlot(slot), objectId))
{
return;
}
else if (Farming.interactWithPatch(player, objectId, objectX, objectY, player.getInventory().getItemInSlot(slot)))
{
return;
}
else if (WarriorGuild.useAnimator(player, player.getInventory().getItemInSlot(slot), objectId, objectX, objectY))
{
return;
}
if (player.getInventory().getItemInSlot(slot) == 7936)
{
if (RuneCraft.wantToRunecraft(player, objectId, objectX, objectY))
{
return;
}
if (RuneCraft.useTalisman(player, objectId, objectX, objectY))
{
return;
}
}
switch (objectId)
{
case 6: // Cannon:
DwarfCannon cannon = player.getCannon();
Location l = new Location(objectX, objectY, player.getLocation().getZ());
if (cannon == null || (cannon != null & !l.withinDistance(cannon.getLocation(), 2)))
{
player.getPackets().sendMessage("This isn't your cannon!");
break;
}
cannon.loadCannon();
break;
case 36781: // Lumbridge fountain.
case 24214: // Fountain in east Varrock.
case 24265: // Varrock main fountain.
case 11661: // Falador waterpump.
case 11759: // Falador south fountain.
case 879: // Camelot fountains.
case 29529: // Sink.
case 874: // Sink.
if (FillVial.fillingVial(player, new Location(objectX, objectY, player.getLocation().getZ())) && player.getInventory().getItemInSlot(slot) == 229)
{
break;
}
break;
case 2728: // Range in Catherby
if (Cooking.isCooking(player, player.getInventory().getItemInSlot(slot), false, -1, -1))
{
break;
}
break;
case 2732: // Fire
if (Cooking.isCooking(player, player.getInventory().getItemInSlot(slot), true, objectX, objectY))
{
break;
}
break;
case 36956: // Lumbridge furnace
case 11666: // Falador furnace
if (Smelting.wantToSmelt(player, player.getInventory().getItemInSlot(slot)))
{
break;
}
else if (Crafting.wantsToCraftOnObject(player, player.getInventory().getItemInSlot(slot), objectId))
{
break;
}
break;
case 2783: // Anvil
if (Smithing.wantToSmithOnAnvil(player, player.getInventory().getItemInSlot(slot), new Location(objectX, objectY, player.getLocation().getZ())))
{
break;
}
//.........這裏部分代碼省略.........
示例13: teleport
public static void teleport(Player p, LoadedLaddersAndStairs.HeightObject obj)
{
p.getWalkingQueue().resetWalkingQueue();
p.setTemporaryAttribute("unmovable", true);
p.setFaceLocation(obj.getLocation());
if (obj.getAnimation() != -1)
{
p.setLastAnimation(new Animation(obj.getAnimation()));
}
Event teleportEvent = new Event(obj.getAnimation() != -1 ? obj.getTeleDelay() : 500);
teleportEvent.setAction(() =>
{
teleportEvent.stop();
p.teleport(obj.getTeleLocation());
p.removeTemporaryAttribute("unmovable");
});
Server.registerEvent(teleportEvent);
}
示例14: useLever
public static void useLever(Player p, int id, Location leverLocation)
{
if (p.getTemporaryAttribute("teleporting") != null)
{
return;
}
foreach (LoadedLaddersAndStairs.Lever lever in LoadedLaddersAndStairs.levers)
{
if (lever.getId() == id)
{
if (lever.getLeverLocation().Equals(leverLocation))
{
LoadedLaddersAndStairs.Lever l = lever;
//TODO when in use it cant be used (in use = lever is facing down)
CoordinateEvent useLeverCoordinateEvent = new CoordinateEvent(p, l.getLeverLocation());
useLeverCoordinateEvent.setAction(() =>
{
p.setFaceLocation(l.getFaceLocation());
if (p.getTemporaryAttribute("teleblocked") != null)
{
p.getPackets().sendMessage("A magical force prevents you from teleporting!");
return;
}
else if ((p.getTemporaryAttribute("teleporting") != null))
{
return;
}
p.setLastAnimation(new Animation(2140));
p.getPackets().closeInterfaces();
p.setTemporaryAttribute("teleporting", true);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
SkillHandler.resetAllSkills(p);
l.setInUse(true);
Event useLeverEvent = new Event(700);
useLeverEvent.setAction(() =>
{
useLeverEvent.stop();
p.setLastAnimation(new Animation(8939, 0));
p.setLastGraphics(new Graphics(1576, 0));
l.setInUse(false);
Event setLeverTeleportEvent = new Event(1800);
setLeverTeleportEvent.setAction(() =>
{
setLeverTeleportEvent.stop();
p.teleport(l.getTeleLocation());
p.setLastAnimation(new Animation(8941, 0));
p.setLastGraphics(new Graphics(1577, 0));
Teleport.resetTeleport(p);
});
Server.registerEvent(setLeverTeleportEvent);
});
Server.registerEvent(useLeverEvent);
});
Server.registerCoordinateEvent(useLeverCoordinateEvent);
break;
}
}
}
}
示例15: talkToWarriorGuildNPC
public static bool talkToWarriorGuildNPC(Player p, Npc n, int slot)
{
if (n.getId() != 4289)
{
return false;
}
p.setEntityFocus(n.getClientIndex());
int npcX = n.getLocation().getX();
int npcY = n.getLocation().getY();
AreaEvent talkToWarriorGuildNPCAreaEvent = new AreaEvent(p, npcX - 1, npcY - 1, npcX + 1, npcY + 1);
talkToWarriorGuildNPCAreaEvent.setAction(() =>
{
p.setFaceLocation(n.getLocation());
p.setEntityFocus(65535);
switch (n.getId())
{
case 4289: // Kamfreena
Dialogue.doDialogue(p, 77);
break;
}
});
Server.registerCoordinateEvent(talkToWarriorGuildNPCAreaEvent);
return true;
}