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


C# Player.getCannon方法代码示例

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


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

示例1: handleItemOnObject

	    private void handleItemOnObject(Player player, Packet packet) {
		    int objectX = packet.readShortA();
		    int item = packet.readUShort();
		    int objectY = packet.readLEShort();
		    int slot = packet.readUShort();
		    int interfaceId = packet.readLEShort();
		    int child = packet.readUShort();
		    int objectId = packet.readShortA();
		    if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    Console.WriteLine("Item on object = " + objectId + " " + objectX + " " + objectY);
		    SkillHandler.resetAllSkills(player);
		    player.getPackets().closeInterfaces();
		    player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
		    if (player.getInventory().getItemInSlot(slot) == item) {
			    if (Crafting.wantsToCraftOnObject(player, player.getInventory().getItemInSlot(slot), objectId)) {
				    return;
			    } else if (Farming.interactWithPatch(player, objectId, objectX, objectY, player.getInventory().getItemInSlot(slot))) {
				    return;
			    } else if (WarriorGuild.useAnimator(player, player.getInventory().getItemInSlot(slot), objectId, objectX, objectY)) {
				    return;
			    }
			    if (player.getInventory().getItemInSlot(slot) == 7936) {
				    if (RuneCraft.wantToRunecraft(player, objectId, objectX, objectY)) {
					    return;
				    }
				    if (RuneCraft.useTalisman(player, objectId, objectX, objectY)) {
					    return;
				    }
			    }
			    switch(objectId) {
				    case 6: // Cannon:
					    DwarfCannon cannon = player.getCannon();
					    Location l = new Location(objectX, objectY, player.getLocation().getZ());
					    if (cannon == null || (cannon != null & !l.withinDistance(cannon.getLocation(), 2))) {
						    player.getPackets().sendMessage("This isn't your cannon!");
						    break;
					    }
					    cannon.loadCannon();
					    break;
					
				    case 36781: // Lumbridge fountain.
				    case 24214:	// Fountain in east Varrock.
				    case 24265:	// Varrock main fountain.
				    case 11661:	// Falador waterpump.
				    case 11759:	// Falador south fountain.
				    case 879:	// Camelot fountains.
				    case 29529:	// Sink.
				    case 874:	// Sink.
					    if (FillVial.fillingVial(player, new Location(objectX, objectY, player.getLocation().getZ())) && player.getInventory().getItemInSlot(slot) == 229) {
						    break;
					    }
					    break;
					
				    case 2728: // Range in Catherby
					    if (Cooking.isCooking(player, player.getInventory().getItemInSlot(slot), false, -1, -1)) {
						    break;	
					    }
					    break;
					
				    case 2732: // Fire
					    if (Cooking.isCooking(player, player.getInventory().getItemInSlot(slot), true, objectX, objectY)) {
						    break;	
					    }
					    break;
					
				    case 36956: // Lumbridge furnace
				    case 11666: // Falador furnace
					    if (Smelting.wantToSmelt(player, player.getInventory().getItemInSlot(slot))) {
						    break;
					    } else if (Crafting.wantsToCraftOnObject(player, player.getInventory().getItemInSlot(slot), objectId)) {
						    break;
					    }
					    break;
					
				    case 2783: // Anvil
					    if (Smithing.wantToSmithOnAnvil(player, player.getInventory().getItemInSlot(slot), new Location(objectX, objectY, player.getLocation().getZ()))) {
						    break;
					    }
					    break;
					
				    default:
					    player.getPackets().sendMessage("Nothing interesting happens.");
					    break;
			    }
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:88,代码来源:ItemInteract.cs

示例2: handleFirstClickObject

	    private void handleFirstClickObject(Player player, Packet packet) {
		    int objectX = packet.readLEShort();
            ushort objectId = (ushort)packet.readShortA();
		    int objectY = packet.readUShort();
		    if (objectX < 1000 || objectY < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    player.getPackets().closeInterfaces();
		    Console.WriteLine("First object click = " + objectId + " " + objectX + " " + objectY);
		    if (RuneCraft.wantToRunecraft(player, objectId, objectX, objectY)) {
			    return;
		    } else if (RuneCraft.enterRift(player, objectId, objectX, objectY)) {
			    return;
		    } else if (RuneCraft.enterViaTiara(player, objectId, objectX, objectY)) {
			    player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
			    return;
		    } else if (RuneCraft.leaveAltar(player, objectId, objectX, objectY)) {
			    return;
		    } else if (Barrows.leaveCrypt(player, objectId, objectX, objectY)) {
			    return;
		    } else if (Barrows.tryOpenCoffin(player, objectId)) {
			    return;
		    } else if (Barrows.openTunnelDoor(player, objectId, objectX, objectY)) {
			    return;
		    } else if (Thieving.wantToThieveChest(player, objectId, objectX, objectY)) {
			    return;
		    } else if (Agility.doAgility(player, objectId, objectX, objectY)) {
			    return;
		    } else if (Farming.interactWithPatch(player, objectId, objectX, objectY, -1)) {
			    return;
		    } else if (Server.getGlobalObjects().getDoors().useDoor(player, objectId, objectX, objectY, player.getLocation().getZ())) {
			    return;
		    } else if (LaddersAndStairs.useObject(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 1)) {
			    return;
		    } else if (WildernessObelisks.useWildernessObelisk(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()))) {
			    return;
		    }
		    if (player.getTemporaryAttribute("unmovable") != null) {
			    return;
		    }
		    player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
		    switch(objectId) {
			    case 2492: // essence mine portals
				    RuneCraft.leaveEssMine(player, new Location(objectX, objectY, player.getLocation().getZ()));
				    break;
		
			    case 5959:
			    case 5960:
				    Wilderness.handleLever(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()));
				    break;
			
			    case 733: // Wilderness web
				    Wilderness.slashWeb(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()));
				    break;
			
			    case 28089: // GE desk
				    Server.getGrandExchange().clickDesk(player, objectX, objectY, 1);
				    break;
		
			    case 9359: // Tzhaar main exit
				    TzHaar.exitTzhaar(player);
				    break;
				
			    case 31284: // Tzhaar entrance
				    TzHaar.enterTzhaar(player);
				    break;
		
			    case 9357: // Fight cave exit
				    FightCave.exitCave(player, objectX, objectY);
				    break;
				
			    case 9356: // Fight cave entrance
				    FightCave.enterCave(player);
				    break;
		
			    case 9391: // Tzhaar fight pits viewing orb
				    Server.getMinigames().getFightPits().useOrb(player, -1);
				    break;
		
			    case 9369: // Tzhaar pits main entrance
			    case 9368: // Tzhaar pits game door
				    Server.getMinigames().getFightPits().useDoor(player, objectId);
				    break;
			
			    case 3617: // Agility arena ladder
				    AgilityArena.enterArena(player, objectX, objectY);
				    break;
				
			    case 3618:
				    if (Location.atAgilityArena(player.getLocation())) {
					    AgilityArena.exitArena(player, objectX, objectY);
				    }
				    break;

                case 6: // Dwarf multicannon
				    DwarfCannon cannon = player.getCannon();
				    Location l = new Location(objectX, objectY, player.getLocation().getZ());
                    if (cannon == null || (cannon != null & !l.withinDistance(cannon.getLocation(), 2))) {
					    player.getPackets().sendMessage("This isn't your cannon!");
//.........这里部分代码省略.........
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:101,代码来源:ObjectInteract.cs

示例3: handleInvenClickItem

	    private void handleInvenClickItem(Player player, Packet packet) {
		    int slot = packet.readLEShortA();
		    int item = packet.readShortA();
		    int childId = packet.readLEShort();
		    int interfaceId = packet.readLEShort();
		    if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    if (player.getInventory().getItemInSlot(slot) == item) {
			    player.getPackets().closeInterfaces();
			    if (Consumables.isEating(player, player.getInventory().getItemInSlot(slot), slot))
				    return;
			    else if (Herblore.idHerb(player, player.getInventory().getItemInSlot(slot)))
				    return;
			    else if (RuneCraft.fillPouch(player, (RuneCraftData.POUCHES)player.getInventory().getItemInSlot(slot)))
				    return;
			    else if (Prayer.wantToBury(player,  player.getInventory().getItemInSlot(slot), slot))
				    return;
			    else if (Teleport.useTeletab(player, player.getInventory().getItemInSlot(slot), slot))
				    return;
			    else if (FarmingAmulet.showOptions(player, player.getInventory().getItemInSlot(slot)))
				    return;

			    switch(item) {
				    case 4155: // Slayer gem
					    Slayer.doDialogue(player, 1051);
					    break;
					
				    case 6: // Dwarf multicannon
					    if (player.getCannon() != null) {
						    player.getPackets().sendMessage("You already have a cannon set up!");
						    break;
					    }
					    player.setCannon(new DwarfCannon(player));
					    break;
			
				    case 5073: // Nest with seeds.
				    case 5074: // Nest with jewellery.
					    Woodcutting.randomNestItem(player, item);
					    break;
					
				    case 952: // Spade
					    player.setLastAnimation(new Animation(830));
					    if (Barrows.enterCrypt(player)) {
						    player.getPackets().sendMessage("You've broken into a crypt!");
						    break;
					    }
					    player.getPackets().sendMessage("You find nothing.");
					    break;
			    }
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:53,代码来源:ItemInteract.cs

示例4: handleSecondClickObject

	    private void handleSecondClickObject(Player player, Packet packet) {
		    int objectY = packet.readLEShortA();
		    int objectX = packet.readLEShort();
		    ushort objectId = packet.readUShort();
		    Console.WriteLine("Second object click = " + objectId + " " + objectX + " " + objectY);
		    if (player.getTemporaryAttribute("unmovable") != null) {
			    return;
		    }
		    if (objectX < 1000 || objectY < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    player.getPackets().closeInterfaces();
		    player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
		    if (Thieving.wantToThieveStall(player, objectId, objectX, objectY)) {
			    return;
		    } else if (Farming.interactWithPatch(player, objectId, objectX, objectY, -1)) {
			    return;
		    } else if (LaddersAndStairs.useObject(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 2)) {
			    return;
		    }
		    switch(objectId) {
			    case 28089: // GE desk
				    Server.getGrandExchange().clickDesk(player, objectX, objectY, 2);
				    break;
			
			    case 25824: // Spinning wheel (Seers)
			    case 36970: // Spinning wheel (Lumbridge
				    Spinning.displaySpinningInterface(player);
				    break;

                case 6: // Dwarf multicannon
				    DwarfCannon cannon = player.getCannon();
				    Location l = new Location(objectX, objectY, player.getLocation().getZ());
				    if (cannon == null || (cannon != null & !l.Equals(cannon.getLocation()))) {
					    player.getPackets().sendMessage("This isn't your cannon!");
					    break;
				    }
				    cannon.pickupCannon();
				    break;
			
			    case 11666: // Falador furnace
			    case 36956: // Lumbridge furnace
				    Smelting.displaySmeltOptions(player);
				    break;
			
			    case 11959: // Tin rocks
			    case 11958:
			    case 11957:
			    case 11933:
			    case 11934:
			    case 11935:
			    case 31077:
			    case 31078:
			    case 31079:
				    Mining.prospectRock(player, objectX, objectY, "tin");
				    break;
				
			    case 11960: // Copper rocks
			    case 11961:
			    case 11962:
			    case 11936:
			    case 11937:
			    case 11938:
			    case 31080:
			    case 31081:
			    case 31082:
				    Mining.prospectRock(player, objectX, objectY, "copper");
				    break;
				
			    case 15504: // Clay rocks
			    case 15503:
			    case 15505:
			    case 11189:
			    case 11190:
			    case 11191:
			    case 31062:
			    case 31063:
			    case 31064:
			    case 32429:
			    case 32430:
			    case 32431:
				    Mining.prospectRock(player, objectX, objectY, "clay");
				    break;
				
			    case 11948: // Silver rocks
			    case 11949:
			    case 11950:
			    case 11165:
			    case 11186:
			    case 11187:
			    case 11188:
			    case 31074:
			    case 31075:
			    case 31076:
			    case 32444:
			    case 32445:
			    case 32446:
			    case 15579:
			    case 15580:
//.........这里部分代码省略.........
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:101,代码来源:ObjectInteract.cs


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