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


C# Player.getWalkingQueue方法代码示例

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


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

示例1: createdAnimatedArmour

	    protected static void createdAnimatedArmour(Player p, int index) {
		    if (p.getTemporaryAttribute("warriorGuildAnimator") == null) {
			    return;
		    }
		    p.setLastAnimation(new Animation(827));
		    p.setTemporaryAttribute("unmovable", true);
		    for (int i = 0; i < ARMOUR_SETS[index].Length; i++) {
			    p.getInventory().deleteItem(ARMOUR_SETS[index][i]);
		    }
		    p.getPackets().sendChatboxInterface(211);
		    p.getPackets().modifyText("You place the armour onto the platform where it", 211, 1);
		    p.getPackets().modifyText("dissapears...", 211, 2);
		    int animatorIndex = (int) p.getTemporaryAttribute("warriorGuildAnimator");
            Event createAnimatedArmourEvent = new Event(1500);
            int createAnimatedArmourCounter = 0;
            Npc npc = null;
            createAnimatedArmourEvent.setAction(() => {
                if (createAnimatedArmourCounter == 0)
                {
					p.getPackets().sendChatboxInterface(211);
					p.getPackets().modifyText("The animator hums, something appears to be working.", 211, 1);
					p.getPackets().modifyText("You stand back.", 211, 2);
					createAnimatedArmourEvent.setTick(500);
                }
                else if (createAnimatedArmourCounter == 1)
                {
					p.getWalkingQueue().forceWalk(0, + 3);
					createAnimatedArmourEvent.setTick(2000);
                }
                else if (createAnimatedArmourCounter == 2)
                {
					createAnimatedArmourEvent.setTick(500);
					Location minCoords = new Location(2849, 3534, 0);
					Location maxCoords = new Location(2861, 3545, 0);
					npc = new Npc(ANIMATED_ARMOUR[index]);
					npc.setMinimumCoords(minCoords);
					npc.setMaximumCoords(maxCoords);
					npc.setLocation(new Location(ANIMATOR_LOCATIONS[animatorIndex][0], ANIMATOR_LOCATIONS[animatorIndex][1], 0));
					npc.setWalkType(WalkType.STATIC);
					npc.setForceText("I'm ALIVE!");
					npc.setLastAnimation(new Animation(4166));
					npc.setEntityFocus(p.getClientIndex());
					npc.setOwner(p);
					npc.setTarget(p);
					p.getPackets().setArrowOnEntity(1, npc.getClientIndex());
					Server.getNpcList().Add(npc);
				} else {
					p.setEntityFocus(npc.getClientIndex());
					p.getPackets().softCloseInterfaces();
					createAnimatedArmourEvent.stop();
					p.removeTemporaryAttribute("unmovable");
					npc.getFollow().setFollowing(p);
				}
                createAnimatedArmourCounter++;
		    });
            Server.registerEvent(createAnimatedArmourEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:57,代码来源:WarriorGuild.cs

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

示例3: 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

示例4: 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

示例5: useDoor

	    public void useDoor(Player p, int doorId) {
		    bool running =  p.getWalkingQueue().isRunToggled();
		    if (doorId == 9369) { // main entrance
			    int y = p.getLocation().getY() >= 5177 ? 5177 : 5175;
                CoordinateEvent mainEntranceCoordinateEvent = new CoordinateEvent(p, new Location(2399, y, 0));
                mainEntranceCoordinateEvent.setAction(() => {
					p.getWalkingQueue().setRunToggled(false);
                    p.getWalkingQueue().resetWalkingQueue();
					p.getPackets().clearMapFlag();
					p.setTemporaryAttribute("unmovable", true);
					p.getWalkingQueue().forceWalk(0, y == 5177 ? -2 : +2);
                    Event useMainDoorEvent = new Event(1000);
                    useMainDoorEvent.setAction(() => {
                        useMainDoorEvent.stop();
						p.removeTemporaryAttribute("unmovable");
						p.getWalkingQueue().setRunToggled(running);
					});
                    Server.registerEvent(useMainDoorEvent);
			    });
                Server.registerCoordinateEvent(mainEntranceCoordinateEvent);
            }
            else if (doorId == 9368)
            { // game door
                int y = p.getLocation().getY() >= 5169 ? 5169 : 5167;
                CoordinateEvent gameDoorCoordinateEvent = new CoordinateEvent(p, new Location(2399, y, 0));
                gameDoorCoordinateEvent.setAction(() =>
                {
                    if (playersPlaying.Count == 1)
                    {
                        sendNPCMessage(p, "Here is some TokKul, as a reward.");
                        p.getInventory().addItemOrGround(6529, tokkulReward);
                    }
                    removePlayingPlayer(p);
                    p.getWalkingQueue().setRunToggled(false);
                    p.getWalkingQueue().resetWalkingQueue();
                    p.getPackets().clearMapFlag();
                    if (y == 5167)
                    {
                        p.getWalkingQueue().forceWalk(0, +2);
                    }
                    else
                    {
                        p.getPackets().sendMessage("You are unable to bypass the hot barrier.");
                        return;
                    }
                    p.setTemporaryAttribute("unmovable", true);
                    Event gameDoorEvent = new Event(1000);
                    gameDoorEvent.setAction(() =>
                    {
                        gameDoorEvent.stop();
                        p.removeTemporaryAttribute("unmovable");
                        p.getWalkingQueue().setRunToggled(running);
                        p.getPackets().sendMessage("You leave the fight pit.");
                        resetVariables(p);
                    });
                    Server.registerEvent(gameDoorEvent);
                });
                Server.registerCoordinateEvent(gameDoorCoordinateEvent);
            }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:60,代码来源:FightPits.cs

示例6: openTunnelDoor

	    public static bool openTunnelDoor(Player player, int doorId, int x, int y) {
		    if (doorId < 6716 || (doorId > 6731 && doorId < 6735) || doorId > 6750) {
			    return false;
		    }
		    int index = getDoorIndex(doorId, x, y);
		    int index2 = getOtherDoor(x, y); // index of the door next to the one you clicked.
		    if (index == -1 || index2 == -1) {
			    return false;
		    }
            bool betweenDoors = player.getTemporaryAttribute("betweenDoors") != null;
            Location clickedDoor = new Location(DOOR_LOCATION[index][0], DOOR_LOCATION[index][1], 0);
            Location otherDoor = new Location(DOOR_LOCATION[index2][0], DOOR_LOCATION[index2][1], 0);
            int openDoorId = DOOR_OPEN_DIRECTION[index][0];
            int openDoorId2 = DOOR_OPEN_DIRECTION[index2][0];
            int openDirection = DOOR_OPEN_DIRECTION[index][2];
		    int newX = openDirection == 1 ? x+1 : openDirection == 2 ? x : openDirection == 3 ? x-1 : openDirection == 4 ? x : x;
		    int newY = openDirection == 1 ? y : openDirection == 2 ? y+1 : openDirection == 3 ? y : openDirection == 4 ? y-1 : y;
            int newX2 = openDirection == 1 ? DOOR_LOCATION[index2][0] + 1 : openDirection == 2 ? DOOR_LOCATION[index2][0] : openDirection == 3 ? DOOR_LOCATION[index2][0] - 1 : openDirection == 4 ? DOOR_LOCATION[index2][0] : DOOR_LOCATION[index2][0];
            int newY2 = openDirection == 1 ? DOOR_LOCATION[index2][1] : openDirection == 2 ? DOOR_LOCATION[index2][1] + 1 : openDirection == 3 ? DOOR_LOCATION[index2][1] : openDirection == 4 ? DOOR_LOCATION[index2][1] - 1 : DOOR_LOCATION[index2][1];
            int[] doorStandCoordinates = getDoorCoordinates(player, index, index2, betweenDoors);
            int[] walkDirections = getWalkDirections(player, index, index2, betweenDoors);
            player.setFaceLocation(clickedDoor);
            AreaEvent doorsWalkAreaEvent = new AreaEvent(player, doorStandCoordinates[0], doorStandCoordinates[1], doorStandCoordinates[2] + 1, doorStandCoordinates[3] + 1);
            doorsWalkAreaEvent.setAction(() => {
                player.setTemporaryAttribute("unmovable", true);

                Event forceWalkDoorEvent = new Event(800);
                forceWalkDoorEvent.setAction(() => {
                    player.getWalkingQueue().resetWalkingQueue();
					foreach(Player p in Server.getPlayerList()) { //change door for all logged in players? uhh what?
						p.getPackets().removeObject(clickedDoor, openDoorId == 6713 ? 4 : 3, 0);
						p.getPackets().removeObject(otherDoor, openDoorId2 == 6732 ? 3 : 4, 0);
                        p.getPackets().createObject(openDoorId, new Location(newX, newY, 0), DOOR_OPEN_DIRECTION[index][1], 0);
                        p.getPackets().createObject(openDoorId2, new Location(newX2, newY2, 0), DOOR_OPEN_DIRECTION[index2][1], 0);
					}
                    player.getWalkingQueue().forceWalk(walkDirections[0], walkDirections[1]);
					forceWalkDoorEvent.stop();
				});
                Server.registerEvent(forceWalkDoorEvent);
                Event betweenDoorsEvent = new Event(betweenDoors ? 2200 : 1900);
                betweenDoorsEvent.setAction(() => {
					int face = openDirection == 3 ? 0 : openDirection == 4 ? 3 : openDirection == 2 ? 1 : 2;
					foreach(Player p in Server.getPlayerList()) {
						p.getPackets().removeObject(new Location(newX, newY, 0), openDoorId == 6713 ? 4 : 3, 0);
						p.getPackets().removeObject(new Location(newX2, newY2, 0), openDoorId2 == 6732 ? 3 : 4, 0);
						p.getPackets().createObject(DOORS[index], clickedDoor, face, 0);
						p.getPackets().createObject(DOORS[index2], otherDoor, face, 0);
					}
                    player.removeTemporaryAttribute("unmovable");
					if (!betweenDoors) {
                        player.getPackets().sendConfig(1270, 1);
                        player.setTemporaryAttribute("betweenDoors", true);
					} else {
                        player.getPackets().sendConfig(1270, 0);
                        player.removeTemporaryAttribute("betweenDoors");
					}
					betweenDoorsEvent.stop();
				});
                Server.registerEvent(betweenDoorsEvent);
		    });
            Server.registerCoordinateEvent(doorsWalkAreaEvent);
		    return true;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:63,代码来源:Barrows.cs

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

示例8: teleport

	    public static bool teleport(Player p, int opt, JewellerySlot js) {
		    if (js == null) {
			    return false;
		    }
		    if (js.index == -1 || js.index > 3 || opt > 6) {
			    return false;
		    }
		    if (!canTeleport(p, js)) {
			    p.getPackets().closeInterfaces();
			    return true;
		    }
		    if ((js.index == 2 && opt == 4) || (js.index != 2 && opt == 6)) {
			    p.getPackets().sendMessage("You stay where you are.");
			    p.getPackets().closeInterfaces();
			    return true;
		    }
		    opt -= 2; // Used to get the 'index' from the button id.
		    p.setLastGraphics(new Graphics(1684));
		    p.setLastAnimation(new Animation(9603));
		    p.getWalkingQueue().resetWalkingQueue();
		    p.getPackets().clearMapFlag();
		    p.setTemporaryAttribute("teleporting", true);
		    p.setTemporaryAttribute("unmovable", true);
		    p.removeTemporaryAttribute("autoCasting");
		    p.removeTemporaryAttribute("lootedBarrowChest");
		    p.setTarget(null);
		    changeJewellery(p, js);
		    int option = opt;
		    p.getPackets().closeInterfaces();
            Event teleportEvent = new Event(2000);
            teleportEvent.setAction(() => {
                teleportEvent.stop();
                p.teleport(new Location(TELEPORT_COORDINATES[js.index][option][0], TELEPORT_COORDINATES[js.index][option][1], 0));
				    p.setLastAnimation(new Animation(65535));
				    Teleport.resetTeleport(p);
				    p.removeTemporaryAttribute("unmovable");
		    });
            Server.registerEvent(teleportEvent);
		    return true;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:40,代码来源:JewelleryTeleport.cs

示例9: handleActionButton


//.........这里部分代码省略.........
					    case 13: // Water wave.
                            MagicData.setAutoCastSpell(player, 13, 48, false);
						    break;
						
					    case 14: // Earth wave.
                            MagicData.setAutoCastSpell(player, 14, 52, false);
						    break;
						
					    case 15: // Fire wave.
                            MagicData.setAutoCastSpell(player, 15, 55, false);
						    break;
						
					    case 16: // Cancel.
                            MagicData.cancelAutoCast(player, false);
						    break;
				    }
				    break;
		
			    case 182: // Logout tab.
				    player.getPackets().logout();
				    break;
			
			    case 261: // Settings tab.
				    switch(buttonId) {
					    case 16: // Display settings.
						    player.getPackets().displayInterface(742);
						    break;
						
					    case 18: // Audio settings.
						    player.getPackets().displayInterface(743);
						    break;
		
					    case 3: // Run toggle.
						    if(!player.getWalkingQueue().isRunToggled()) {
							    player.getWalkingQueue().setRunToggled(true);
							    player.getPackets().sendConfig(173, 1);
						    } else {
							    player.getWalkingQueue().setRunToggled(false);
							    player.getPackets().sendConfig(173, 0);
						    }
						    break;
						
					    case 4: // Chat effect toggle.
						    if(!player.isChatEffectsEnabled()) {
							    player.setChatEffectsEnabled(true);
							    player.getPackets().sendConfig(171, 0);
						    } else {
							    player.setChatEffectsEnabled(false);
							    player.getPackets().sendConfig(171, 1);
						    }
						    break;
						
					    case 5: // Split private chat toggle.
						    if(!player.isPrivateChatSplit()) {
							    player.setPrivateChatSplit(true);
							    player.getPackets().sendConfig(287, 1);
						    } else {
							    player.setPrivateChatSplit(false);
							    player.getPackets().sendConfig(287, 0);
						    }
						    break;
						
					    case 7: // Accept aid toggle.
						    if(!player.isAcceptAidEnabled()) {
							    player.setAcceptAidEnabled(true);
							    player.getPackets().sendConfig(427, 1);
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:67,代码来源:ActionButton.cs

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

示例11: 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

示例12: handleAttackPlayer

	    private void handleAttackPlayer(Player player, Packet packet) {
		    int index = packet.readLEShortA();
		    if(index < 0 || index >= Constants.MAX_PLAYERS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    Player p2 = Server.getPlayerList()[index];
		    if (p2 == null)
			    return;

		    player.setFaceLocation(p2.getLocation());
		    player.getPackets().closeInterfaces();
		    if (Location.atDuelArena(player.getLocation())) {
			    if(player.getDuel() != null) {
				    if (player.getDuel().getStatus() < 4) {
					    player.getDuel().declineDuel();
					    return;
				    } else if (player.getDuel().getStatus() == 5 && player.getDuel().getPlayer2().Equals(p2)) {
					    player.getPackets().sendMessage("The duel has not yet started!");
					    return;
				    } else if ((player.getDuel().getStatus() == 5 || player.getDuel().getStatus() == 6) && !player.getDuel().getPlayer2().Equals(p2)) {
					    return;
				    } else if (player.getDuel().getStatus() == 6) {
					    Combat.newAttack(player, p2);
					    return;
				    }
			    }
			    if (!player.getLocation().withinDistance(p2.getLocation(), 1)) {
				    int x = p2.getLocation().getX();
				    int y = p2.getLocation().getY();
                    AreaEvent attackAreaEvent = new AreaEvent(player, x-1, y-1, x+1, y+1);
				    attackAreaEvent.setAction(() => {
                        player.getWalkingQueue().resetWalkingQueue();
						player.getPackets().clearMapFlag();
						if (p2.getGESession() != null || (p2.getDuel() != null && !p2.getDuel().getPlayer2().Equals(player)) || p2.getTrade() != null || p2.getShopSession() != null || p2.getBank().isBanking()) {
                            player.getPackets().sendMessage("That player is busy at the moment.");
							return;
						}
						if (p2.wantsToDuel(player)) {
							p2.setFaceLocation(player.getLocation());
							player.getPackets().closeInterfaces();
							p2.getPackets().closeInterfaces();
							player.setDuelSession(new DuelSession(player, p2));
							p2.setDuelSession(new DuelSession(p2, player));
							return;
						}
						player.setFaceLocation(p2.getLocation());
						p2.getPackets().sendMessage(player.getLoginDetails().getUsername() + ":duelstake:");
						player.getPackets().sendMessage("Sending duel request...");
						player.newDuelRequest(p2);
				    });
                    Server.registerCoordinateEvent(attackAreaEvent);
				    return;
			    }
			    if (p2.getGESession() != null || (p2.getDuel() != null && !p2.getDuel().getPlayer2().Equals(player)) || p2.getTrade() != null || p2.getShopSession() != null || p2.getBank().isBanking()) {
				    player.getPackets().sendMessage("That player is busy at the moment.");
				    return;
			    }
			    if (p2.wantsToDuel(player)) {
				    player.getPackets().closeInterfaces();
				    p2.getPackets().closeInterfaces();
				    p2.setFaceLocation(player.getLocation());
				    player.setDuelSession(new DuelSession(player, p2));
				    p2.setDuelSession(new DuelSession(p2, player));
				    return;
			    }
			    player.newDuelRequest(p2);
			    p2.getPackets().sendMessage(player.getLoginDetails().getUsername() + ":duelstake:");
			    player.getPackets().sendMessage("Sending duel request...");
			    return;
		    }
		    Combat.newAttack(player, p2);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:73,代码来源:PlayerInteract.cs

示例13: handleTradePlayer

	    private void handleTradePlayer(Player player, Packet packet) {
		    int index = packet.readLEShortA();
		    if(index < 0 || index >= Constants.MAX_PLAYERS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    Player p2 = Server.getPlayerList()[index];
		    if (p2 == null) {
			    return;
		    }
		    player.setFaceLocation(p2.getLocation());
		    if(player.getTrade() != null) {
			    player.getTrade().decline();
			    return;
		    }
		    player.getPackets().closeInterfaces();
		    if (!player.getLocation().withinDistance(p2.getLocation(), 1)) {
			    int x = p2.getLocation().getX();
			    int y = p2.getLocation().getY();
                AreaEvent tradePlayerAreaEvent = new AreaEvent(player, x-1, y-1, x+1, y+1);
                tradePlayerAreaEvent.setAction(() => {
                    player.getWalkingQueue().resetWalkingQueue();
                    player.getPackets().clearMapFlag();
				    if (p2.getGESession() != null || p2.getTrade() != null || p2.getDuel() != null || p2.getShopSession() != null || p2.getBank().isBanking()) {
                        player.getPackets().sendMessage("That player is busy at the moment.");
					    return;
				    }
				    if (p2.wantsToTrade(player)) {
                        player.getPackets().closeInterfaces();
                        p2.getPackets().closeInterfaces();
					    p2.setFaceLocation(player.getLocation());
					    player.setTrade(new TradeSession(player, p2));
					    p2.setTrade(new TradeSession(p2, player));
					    return;
				    }
				    player.setFaceLocation(p2.getLocation());
                    p2.getPackets().sendMessage(player.getLoginDetails().getUsername() + ":tradereq:");
                    player.getPackets().sendMessage("Sending trade offer...");
				    player.newTradeRequest(p2);
			    });
                Server.registerCoordinateEvent(tradePlayerAreaEvent);
			    return;
		    }
		    if (p2.getGESession() != null || p2.getTrade() != null || p2.getDuel() != null || p2.getShopSession() != null || p2.getBank().isBanking()) {
			    player.getPackets().sendMessage("That player is busy at the moment.");
			    return;
		    }
		    if (p2.wantsToTrade(player)) {
                player.getPackets().closeInterfaces();
                p2.getPackets().closeInterfaces();
			    p2.setFaceLocation(player.getLocation());
			    player.setTrade(new TradeSession(player, p2));
			    p2.setTrade(new TradeSession(p2, player));
			    return;
		    }
		    player.newTradeRequest(p2);
            p2.getPackets().sendMessage(player.getLoginDetails().getUsername() + ":tradereq:");
            player.getPackets().sendMessage("Sending trade offer...");
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:59,代码来源:PlayerInteract.cs


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