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


C# player.Player类代码示例

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


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

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

示例2: Equipment

 public Equipment(Player player)
 {
     for (int i = 0; i < slots.Length; i++) {
         slots[i] = new Item(-1, 0);
     }
     this.player = player;
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:Equipment.cs

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

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

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

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

示例7: ShopSession

 public ShopSession(Player p, int id)
 {
     this.player = p;
     this.shopId = id;
     this.shop = Server.getShopManager().getShop(id);
     openShop();
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:ShopSession.cs

示例8: useAnimator

	    public static bool useAnimator(Player p, int itemId, int objectId, int objectX, int objectY) {
		    if (objectId != ANIMATOR_ID) {
			    return false;
		    }
		    int animatorIndex = -1;
		    for (int i = 0; i < ANIMATOR_LOCATIONS.Length; i++) {
			    if (objectX == ANIMATOR_LOCATIONS[i][0] && objectY == ANIMATOR_LOCATIONS[i][1]) {
				    animatorIndex = i;
				    break;
			    }
		    }
		    if (animatorIndex == -1) {
			    return false;
		    }
		    p.setTemporaryAttribute("warriorGuildAnimator", animatorIndex);
            CoordinateEvent createAnimatedArmorCoordinateEvent = new CoordinateEvent(p, new Location(ANIMATOR_LOCATIONS[animatorIndex][0], (ANIMATOR_LOCATIONS[animatorIndex][1] + 1), 0));
            createAnimatedArmorCoordinateEvent.setAction(() => {
				int armourIndex = hasArmour(p, itemId);
				if (armourIndex != -1) {
					createdAnimatedArmour(p, armourIndex);
				}
		    });
            Server.registerCoordinateEvent(createAnimatedArmorCoordinateEvent);
		    return true;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:25,代码来源:WarriorGuild.cs

示例9: execute

        	public void execute(Player player, string[] arguments) {
                if (arguments.Length == 0)
                {
                    player.getPackets().sendMessage("[Pickup command]: ::item itemId amount or just ::item itemId");
                    return;
                }

                int itemId = 0;
                if (!int.TryParse(arguments[0], out itemId))
                    itemId = 0;
                int amount = 0;
                if(arguments.Length >= 2 && !int.TryParse(arguments[1], out amount))
                    amount = 0;
		        if (!player.inCombat()) {
                    if (amount > 1 && !ItemData.forId(itemId).isNoted() && !ItemData.forId(itemId).isStackable())
                    {
					    for (int i = 0; i < amount; i++) {
                            if (!player.getInventory().addItem(itemId))
                            {
							    break;
						    }
					    }
                    } else if(amount == 0) {
                        player.getInventory().addItem(itemId);
				    } else {
                        player.getInventory().addItem(itemId, amount);
				    }
		        }
	        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:29,代码来源:Pickup.cs

示例10: useDoor

	    public bool useDoor(Player p, int doorId, int doorX, int doorY, int doorHeight) {
		    Location doorLocation = new Location(doorX, doorY, doorHeight);
		    foreach(Door door in doors) {
			    int id = door.isDoorOpen() ? door.getOpenDoorId() : door.getClosedDoorId();
			    if (id == doorId) {
				    if (door.getDoorLocation().Equals(doorLocation)) {
					    if (door.isDoorOpen() && (Environment.TickCount - door.getLastChangeTime() <= PLAYER_CHANGE_DELAY)) {
						    // door was opened in the last PLAYER_CHANGE_DELAY ms..cant be instantly closed
						    return true;
					    } else if (!door.isClosable() && door.isDoorOpen()) {
						    // door cannot be closed by a player
						    return true;
					    }
					    Door d = door;
                        AreaEvent useDoorAreaEvent = new AreaEvent(p, doorLocation.getX() - 1, doorLocation.getY() - 1, doorLocation.getX() + 1, doorLocation.getY() + 1);
                        useDoorAreaEvent.setAction(() => {
							changeDoor(p, d);
					    });
                        Server.registerCoordinateEvent(useDoorAreaEvent);
					    return true;
				    }
			    }
		    }
		    return false;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:25,代码来源:DoorControl.cs

示例11: showCanifisSailorDialogue

	    public static void showCanifisSailorDialogue(Player p, int status) {
		    int newStatus = -1;
		    p.getPackets().softCloseInterfaces();
		    if (p.getTemporaryAttribute("unmovable") != null) {
			    return;
		    }
		    switch(status) {
			    case 280:
				    p.getPackets().sendPlayerHead(64, 2);
				    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
				    p.getPackets().modifyText("Could you take me back to Oo'glog please?", 64, 4);
				    p.getPackets().animateInterface(9827, 64, 2);
				    p.getPackets().sendChatboxInterface2(64);
				    newStatus = 281;
				    break;
				
			    case 281:
				    p.getPackets().sendNPCHead(1304, 241, 2);
				    p.getPackets().modifyText("Sailor", 241, 3);
				    p.getPackets().modifyText("As you wish, i'll fetch the boat.", 241, 4);
				    p.getPackets().animateInterface(9827, 241, 2);
				    p.getPackets().sendChatboxInterface2(241);
				    newStatus = 282;
				    break;
				
			    case 282:
				    travel(p, 0, true);
				    break;
		    }
		    if (newStatus != -1) {
			    p.setTemporaryAttribute("dialogue", newStatus);
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:33,代码来源:BoatOptions.cs

示例12: Inventory

 public Inventory(Player p)
 {
     this.p = p;
     for (int i = 0; i < slots.Length; i++) {
         slots[i] = new Item(-1, 0);
     }
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:Inventory.cs

示例13: Bank

	    public Bank(Player player) {
            for (int i = 0; i < MAX_BANK_SLOTS; i++)
            {
			    bank[i] = new Item(-1, 0);
		    }
            this.player = player;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:Bank.cs

示例14: handlePacket

	    public void handlePacket(Player player,  Packet packet) {
		    switch(packet.getPacketId()) {
                case PacketHandlers.PacketId.NPC_FIRST_CLICK:
				    handleFirstClickNPC(player, packet);
				    break;

                case PacketHandlers.PacketId.NPC_SECOND_CLICK:
				    handleSecondClickNPC(player, packet);
				    break;

                case PacketHandlers.PacketId.NPC_THIRD_CLICK:
				    handleThirdClickNPC(player, packet);
				    break;

                case PacketHandlers.PacketId.NPC_FOURTH_CLICK:
				    handleFourthClickNPC(player, packet);
				    return;

                case PacketHandlers.PacketId.NPC_FIFTH_CLICK:
				    handleFifthClickNPC(player, packet);
				    break;

                case PacketHandlers.PacketId.NPC_EXAMINE:
                    handleExamineNPC(player, packet);
                    break;

                case PacketHandlers.PacketId.MAGIC_ON_NPC:
				    handleMagicOnNPC(player, packet);
				    break;

                case PacketHandlers.PacketId.ITEM_ON_NPC:
				    handleItemOnNPC(player, packet);
				    break;
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:35,代码来源:NPCInteract.cs

示例15: TradeSession

 public TradeSession(Player player, Player player2)
 {
     this.player = player;
     this.player2 = player2;
     openTrade();
     player.getTradeRequests().Clear();
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:TradeSession.cs


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