当前位置: 首页>>代码示例>>C#>>正文


C# Player.teleport方法代码示例

本文整理汇总了C#中RunescapeServer.player.Player.teleport方法的典型用法代码示例。如果您正苦于以下问题:C# Player.teleport方法的具体用法?C# Player.teleport怎么用?C# Player.teleport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RunescapeServer.player.Player的用法示例。


在下文中一共展示了Player.teleport方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: exitTzhaar

	    public static void exitTzhaar(Player p) {
            AreaEvent exitTzhaarAreaEvent = new AreaEvent(p, 2479, 5175, 2481, 5175);
            exitTzhaarAreaEvent.setAction(() => {
		        p.teleport(new Location(2866, 9571, 0));
		    });
            Server.registerCoordinateEvent(exitTzhaarAreaEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:TzHaar.cs

示例2: enterTzhaar

	    public static void enterTzhaar(Player p) {
            AreaEvent enterTzhaarAreaEvent = new AreaEvent(p, 2866, 9570, 2866, 9572);
            enterTzhaarAreaEvent.setAction(() => {
		        p.teleport(new Location(2480, 5175, 0));
		    });
            Server.registerCoordinateEvent(enterTzhaarAreaEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:TzHaar.cs

示例3: execute

        public void execute(Player player, string[] arguments) {
            if (arguments.Length < 2)
            {
                player.getPackets().sendMessage("[Teleport command]: ::tele x y or even ::tele x y z");
                return;
            }
            int x,y,z = 0;
            if (!int.TryParse(arguments[0], out x) || !int.TryParse(arguments[1], out y))
            {
                player.getPackets().sendMessage("Bad x,y coordinate, teleporting home, You entered:[x=" + arguments[0] + ", y=" + arguments[1] + "]");
                player.teleport(Constants.HOME_SPAWN_LOCATION.randomSpawn());
                return;
            }
            if (arguments.Length >= 3)
                int.TryParse(arguments[2], out z);

            player.teleport(new Location(x, y, z));
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:18,代码来源:Teleport.cs

示例4: 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;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:37,代码来源:Barrows.cs

示例5: 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));
        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:17,代码来源:Height.cs

示例6: leverTeleport

	    public static void leverTeleport(Player p, int option) {
		    p.getPackets().closeInterfaces();
		    Location teleLocation = new Location(LEVER_COORDINATES[option][0], LEVER_COORDINATES[option][1], LEVER_COORDINATES[option][2]);
		    
            Event leverTeleportEvent = new Event(200);
            leverTeleportEvent.setAction(() => {
				leverTeleportEvent.stop();
				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);
                Event levelTeleportStartEvent = new Event(700);
                levelTeleportStartEvent.setAction(() => {
					levelTeleportStartEvent.stop();
					p.setLastAnimation(new Animation(8939, 0));
					p.setLastGraphics(new Graphics(1576, 0));
                    Event levelTeleportFinishEvent = new Event(1800);
                    levelTeleportFinishEvent.setAction(() => {
                        levelTeleportFinishEvent.stop();
						p.teleport(teleLocation);
						p.setLastAnimation(new Animation(8941, 0));
						p.setLastGraphics(new Graphics(1577, 0));
						Teleport.resetTeleport(p);
					});
                    Server.registerEvent(levelTeleportFinishEvent);
				});
                Server.registerEvent(levelTeleportStartEvent);
		    });
            Server.registerEvent(leverTeleportEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:38,代码来源:Wilderness.cs

示例7: enterCave

	    public static void enterCave(Player p) {
            AreaEvent enterCaveAreaEvent = new AreaEvent(p, 2438, 5168, 2439, 5168);
            enterCaveAreaEvent.setAction(() => {
				/*
				 * Fight cave is 20k squares from the original place, then another (200 * playerIndex) squares west.
				 */
				Location instanceLocation = new Location((20000 + 2413) + (200 * p.getIndex()), 20000 + 5116, 0);
				p.teleport(instanceLocation);
				p.setFightCave(new FightCaveSession(p));
				
                Event caveNpcEvent = new Event(600);
                caveNpcEvent.setAction(() => {
						caveNpcEvent.stop();
						p.getPackets().sendNPCHead(2617, 242, 1);
						p.getPackets().modifyText("TzHaar-Mej-Jal", 242, 3);
						p.getPackets().modifyText("You're on your own now, JalYt.", 242, 4);
						p.getPackets().modifyText("Pepare to fight for your life!", 242, 5);
						p.getPackets().animateInterface(9827, 242, 1);
						p.getPackets().sendChatboxInterface2(242);
				});
                Server.registerEvent(caveNpcEvent);
		    });
            Server.registerCoordinateEvent(enterCaveAreaEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:24,代码来源:FightCave.cs

示例8: travel

	    private static void travel(Player p, int index, bool returning) {
		    p.setTemporaryAttribute("unmovable", true);
		    p.getPackets().displayInterface(120);
		    if (returning) {
			    p.getPackets().sendMessage("You sail off back to Oo'glog..");
		    } else {
			    p.getPackets().sendMessage("You climb aboard Captain Bentley's boat and set sail to " + DESTINATION_NAMES[index] + ".");
		    }
            Event travelEvent = new Event(2000);
            int travelCounter = 0;
		    travelEvent.setAction(() => {
                if (travelCounter == 0)
                {
                    travelCounter++;
					travelEvent.setTick(600);
					if (returning) {
						p.teleport(new Location(2622, 2857, 0));
					} else {
						p.teleport(new Location(LOCATIONS[index][0], LOCATIONS[index][1], LOCATIONS[index][2]));
					}
				} else {
					travelEvent.stop();
					p.getPackets().sendOverlay(170);
					p.removeTemporaryAttribute("unmovable");
					p.getPackets().sendMessage(returning ? "The boat arrives back in Oo'glog." : DESTINATION_MESSAGES[index]);
					p.getPackets().closeInterfaces();
                    Event removeOverlayEvent = new Event(2000);
                    removeOverlayEvent.setAction(() => {
                        removeOverlayEvent.stop();
						p.getPackets().sendRemoveOverlay();
						if (index == 1) {
							p.removeTemporaryAttribute("snowInterface");
						}
					});
                    Server.registerEvent(removeOverlayEvent);
				}
		    });
            Server.registerEvent(travelEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:39,代码来源:BoatOptions.cs

示例9: 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);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:38,代码来源:Wilderness.cs

示例10: 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;
					    }
				    }
			    }
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:57,代码来源:FightPits.cs

示例11: teleportToWaitingRoom

	    public void teleportToWaitingRoom(Player p, bool removeFromList) {
		    int x = 2395 + misc.random(8);
		    int y = 5170 + misc.random(3);
		    if (x == 2399 && y == 5172) { // On viewing orb
			    x++; // Move to the side of it
		    }
		    p.teleport(new Location(x, y, 0));
		    resetVariables(p);
		    if (removeFromList) {
			    playersPlaying.Remove(p);
			    if (playersPlaying.Count >= 1) {
				    foreach(Player player in playersPlaying) {
					    displayFightPitsInterface(player);
				    }
			    }
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:17,代码来源:FightPits.cs

示例12: enterArena

	    public static void enterArena(Player p, int objectX, int objectY) {
            CoordinateEvent enterArenaCoordinateEvent = new CoordinateEvent(p, new Location(2809, 3193, 0));
            enterArenaCoordinateEvent.setAction(() => {
				if (!p.hasPaidAgilityArena()) {
					p.getPackets().sendMessage("You must pay Cap'n Izzy the entrance fee before you can enter the Agility Arena.");
					return;
				}
				p.setLastAnimation(new Animation(827));
                Event teleportArenaEvent = new Event(1000);
                teleportArenaEvent.setAction(() => {
					p.setPaidAgilityArena(false);
					p.teleport(new Location(2805, 9589, 3));
					teleportArenaEvent.stop();
				});
                Server.registerEvent(teleportArenaEvent);
		    });
            Server.registerCoordinateEvent(enterArenaCoordinateEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:18,代码来源:AgilityArena.cs

示例13: execute

 public void execute(Player player, string[] arguments)
 {
     player.teleport(new Location(player.getLocation().getX(), player.getLocation().getY() + 6400, 0));
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:4,代码来源:UnderGround.cs

示例14: 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);
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:18,代码来源:LaddersAndStairs.cs

示例15: exitArena

	    public static void exitArena(Player p, int objectX, int objectY) {
            CoordinateEvent exitArenaCoordinateEvent = new CoordinateEvent(p, new Location(2805, 9589, 3));
            exitArenaCoordinateEvent.setAction(() => {
				p.setLastAnimation(new Animation(828));
                Event exitArenaEvent = new Event(1000);
                exitArenaEvent.setAction(() => {
					p.teleport(new Location(2809, 3193, 0));
					exitArenaEvent.stop();
				});
                Server.registerEvent(exitArenaEvent);
		    });
            Server.registerCoordinateEvent(exitArenaCoordinateEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:13,代码来源:AgilityArena.cs


注:本文中的RunescapeServer.player.Player.teleport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。