本文整理匯總了C#中RS2.Server.player.Player.getLocation方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.getLocation方法的具體用法?C# Player.getLocation怎麽用?C# Player.getLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類RS2.Server.player.Player
的用法示例。
在下文中一共展示了Player.getLocation方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: getCryptIndex
public static int getCryptIndex(Player p)
{
if (p.getLocation().inArea(3567, 9701, 3580, 9711))
{
return VERAC;
}
else if (p.getLocation().inArea(3548, 9709, 3561, 9721))
{
return DHAROK;
}
else if (p.getLocation().inArea(3549, 9691, 3562, 9706))
{
return AHRIM;
}
else if (p.getLocation().inArea(3532, 9698, 3546, 9710))
{
return GUTHAN;
}
else if (p.getLocation().inArea(3544, 9677, 3559, 9689))
{
return KARIL;
}
else if (p.getLocation().inArea(3563, 9680, 3577, 9694))
{
return TORAG;
}
return -1;
}
示例2: dialogue
public static bool dialogue(Player p, Npc npc, bool rightClickPay)
{
if ((npc.getId() != 1055 && npc.getId() != 437) || (rightClickPay && npc.getId() != 437))
{
return false;
}
p.setEntityFocus(npc.getClientIndex());
AreaEvent dialogueAreaEvent = new AreaEvent(p, npc.getLocation().getX() - 1, npc.getLocation().getY() - 1, npc.getLocation().getX() + 1, npc.getLocation().getY() + 1);
dialogueAreaEvent.setAction(() =>
{
npc.setFaceLocation(p.getLocation());
int status = npc.getId() == 1055 ? 43 : 1;
if (rightClickPay)
{
if (!p.getInventory().hasItemAmount(995, AGILITY_ARENA_PRICE))
{
p.getPackets().sendMessage("You don't have enough money to pay the entrance fee.");
return;
}
status = 29;
}
doDialogue(p, status);
});
Server.registerCoordinateEvent(dialogueAreaEvent);
return true;
}
示例3: 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);
}
}
示例4: 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.");
}
示例5: 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);
}
示例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: 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;
}
示例8: betweenDoors
public static bool betweenDoors(Player p)
{
for (int i = 0; i < DB.Length; i++)
{
if (p.getLocation().inArea(DB[i][0], DB[i][1], DB[i][2], DB[i][3]))
{
return true;
}
}
return false;
}
示例9: 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();
}
示例10: 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);
}
示例11: 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;
}
}
示例12: refreshDoorsForPlayer
public void refreshDoorsForPlayer(Player p)
{
foreach (Door door in doors)
{
if (door.getDoorLocation().withinDistance(p.getLocation(), 60))
{
int id = door.isDoorOpen() ? door.getOpenDoorId() : door.getClosedDoorId();
Location loc = door.isDoorOpen() ? door.getOpenDoorLocation() : door.getClosedDoorLocation();
int direction = door.isDoorOpen() ? door.getOpenDirection() : door.getClosedDirection();
Location loc1 = door.isDoorOpen() ? door.getClosedDoorLocation() : door.getOpenDoorLocation();
int direction1 = door.isDoorOpen() ? door.getClosedDirection() : door.getOpenDirection();
p.getPackets().removeObject(loc1, direction1, 0);
p.getPackets().createObject(id, loc, direction, 0);
}
}
}
示例13: 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);
}
示例14: 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;
}
示例15: 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);
}