本文整理汇总了C#中RunescapeServer.player.Player.getLocation方法的典型用法代码示例。如果您正苦于以下问题:C# Player.getLocation方法的具体用法?C# Player.getLocation怎么用?C# Player.getLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RunescapeServer.player.Player
的用法示例。
在下文中一共展示了Player.getLocation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: handlePacket
public void handlePacket(Player player, Packet packet) {
int size = packet.getLength();
if(packet.getPacketId() == PacketHandlers.PacketId.WALK_2) {
size -= 14;
}
player.getWalkingQueue().resetWalkingQueue();
int steps = (size - 5) / 2;
if (steps > WalkingQueue.MAX_WALKING_WAYPOINTS)
{
misc.WriteError("Warning: Walk command contains too many steps (" + steps + ") currently set to 50 [maybe need increase?]");
return;
}
player.getWalkingQueue().setIsRunning(packet.readByteA() == 1);
bool following = false;
if (!canWalk(player, packet, following))
{
player.getPackets().clearMapFlag();
player.getWalkingQueue().resetWalkingQueue();
return;
}
int firstX = packet.readUShort() - (player.getLocation().getRegionX() - 6) * 8;
int firstY = packet.readShortA() - (player.getLocation().getRegionY() - 6) * 8;
player.getWalkingQueue().addToWalkingQueue(firstX, firstY);
for (int i = 0; i < steps; i++) //all the waypoints.
player.getWalkingQueue().addToWalkingQueue((packet.readByteA() + firstX), (packet.readByteS() + firstY));
if (player.getTeleportTo() != null) //is teleporting?
player.getWalkingQueue().resetWalkingQueue();
if (player.getTemporaryAttribute("homeTeleporting") != null) {
player.removeTemporaryAttribute("homeTeleporting");
}
SkillHandler.resetAllSkills(player);
if (player.getTrade() != null)
player.getTrade().decline();
if (player.getDuel() != null) {
if (player.getDuel().getStatus() < 4)
player.getDuel().declineDuel();
else if (player.getDuel().getStatus() == 8)
player.getDuel().recieveWinnings(player);
}
if (player.getTarget() != null) {
if (!following && player.getTarget().getAttacker() != null && player.getTarget().getAttacker().Equals(player))
player.getTarget().setAttacker(null);
}
if (!following) {
player.getFollow().setFollowing(null);
player.setTarget(null);
player.removeTemporaryAttribute("autoCasting");
if (player.getEntityFocus() != 65535)
player.setEntityFocus(65535);
}
player.getPackets().closeInterfaces();
}
示例2: enterCrypt
/*
* The config to remove roofs is 1270
* The door is 6713
*
* Random door configs
* CONFIG = 452 0
CONFIG = 452 32
CONFIG = 452 96
CONFIG = 452 16480
CONFIG = 452 278624
CONFIG = 452 802912
CONFIG = 452 2900064
CONFIG = 452 2637920
CONFIG = 452 2638944
CONFIG = 452 2640992
CONFIG = 452 2645088
CONFIG = 452 2653280
CONFIG = 452 2649184
*/
public static bool enterCrypt(Player p) {
for (int i = 0; i < MOUND_COORDS.Length; i++) {
for (int j = 0; j < MOUND_COORDS[i].Length; j++) {
if (p.getLocation().inArea(MOUND_COORDS[i][0], MOUND_COORDS[i][1], MOUND_COORDS[i][2], MOUND_COORDS[i][3]) && p.getLocation().getZ() == 0)
{
p.teleport(new Location(STAIR_COORDS[i][0], STAIR_COORDS[i][1], 3));
if (p.getBarrowTunnel() == -1) {
p.setBarrowTunnel(misc.random(5));
}
return true;
}
}
}
return false;
}
示例3: execute
public void execute(Player player, string[] arguments)
{
player.getPackets().sendMessage("Spawning all possible objects please wait..");
for(int i = 0; i < 50000; i++)
player.getPackets().createObject(i, player.getLocation(), 0, 10);
player.getPackets().sendMessage("Dumping complete, now add dump to server.");
}
示例4: 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);
}
示例5: execute
public void execute(Player player, string[] arguments)
{
//TODO: Possible TODO.
//I guess this command is for testing where object should be placed to spawnedObjects.cfg / objectLocations.cfg?
//Err I don't like this command too much as the objects spawned are fake..
//gotta maybe add to WorldObjects, like SpawnNPC :S later.
if (arguments.Length < 2)
{
player.getPackets().sendMessage("[SpawnObject command]: ::obj objectId face");
return;
}
int objectId = 0;
int face = 0;
if(!int.TryParse(arguments[0], out objectId)) {
player.getPackets().sendMessage("[SpawnObject command]: objectId is not a number ::obj objectId face");
return;
}
if(!int.TryParse(arguments[1], out face)) {
player.getPackets().sendMessage("[SpawnObject command]: face is not a number ::obj objectId face");
return;
}
foreach(Player p in Server.getPlayerList()) {
p.getPackets().createObject(objectId, player.getLocation(), face, 10);
}
}
示例6: execute
public void execute(Player player, string[] arguments)
{
if (arguments.Length == 0)
{
player.getPackets().sendMessage("[Height command]: ::height 0 [0,1,2,3] are possible");
return;
}
int heightLevel = 0;
if (!int.TryParse(arguments[0], out heightLevel))
{
player.getPackets().sendMessage("[Height command]: ::height 0 [0,1,2,3] are possible");
return;
}
player.teleport(new Location(player.getLocation().getX(), player.getLocation().getY(), heightLevel));
}
示例7: 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);
}
示例8: DwarfCannon
public DwarfCannon(Player player)
{
p = player;
cannonLocation = p.getLocation();
fakeCannonLocation = new Location(cannonLocation.getX()+1, cannonLocation.getY()+1, cannonLocation.getY());
firing = false;
cannonballs = 0;
constructionStage = 0;
direction = 0;
setNpcsInArea();
newCannon();
}
示例9: execute
public void execute(Player player, string[] arguments) {
if (arguments.Length == 0)
{
/*
* Testing the newStillGraphics,
* it seems to do exactly what packet sent in mask appendGraphicsUpdate does
* only extra feature about it is you control how far in tiles you want it to appear
*/
for(byte i = 0; i < 255; i++)
player.getPackets().newStillGraphics(player.getLocation(), new Graphics(392, 0, 100), i);
return;
}
}
示例10: 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);
}
示例11: 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;
}
示例12: execute
public void execute(Player player, string[] arguments)
{
if (arguments.Length == 0)
{
player.getPackets().sendMessage("[SpawnNpc command]: ::npc npc_id");
return;
}
int npcId = 0;
if (!int.TryParse(arguments[0], out npcId))
{
player.getPackets().sendMessage("[SpawnNpc command]: ::npc npc_id");
return;
}
Npc npc = new Npc(npcId, player.getLocation());
npc.setMinimumCoords(new Location(player.getLocation().getX() - 5, player.getLocation().getY() - 5, player.getLocation().getZ()));
npc.setMaximumCoords(new Location(player.getLocation().getX() + 5, player.getLocation().getY() + 5, player.getLocation().getZ()));
Server.getNpcList().Add(npc);
}
示例13: 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);
}
示例14: execute
public void execute(Player player, string[] arguments)
{
player.teleport(new Location(player.getLocation().getX(), player.getLocation().getY() + 6400, 0));
}
示例15: tileAvailable
public bool tileAvailable(Player p)
{
Location l = p.getLocation();
int regionX = p.getUpdateFlags().getLastRegion().getRegionX();
int regionY = p.getUpdateFlags().getLastRegion().getRegionY();
int x = l.getX() - ((regionX - 6) * 8);
int y = l.getY() - ((regionY - 6) * 8);
return (regionData[l.getZ(), x, y]) == 0;
}