本文整理匯總了C#中RS2.Server.player.Player.getCannon方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.getCannon方法的具體用法?C# Player.getCannon怎麽用?C# Player.getCannon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類RS2.Server.player.Player
的用法示例。
在下文中一共展示了Player.getCannon方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: handleFirstClickObject
//.........這裏部分代碼省略.........
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!");
break;
}
cannon.fireCannon();
break;
case 7: //Cannon base only
case 8: //Cannon stand
case 9: //Cannon barrels
DwarfCannon cannonPickup = player.getCannon();
Location cannonLocation = new Location(objectX, objectY, player.getLocation().getZ());
if (cannonPickup == null || (cannonPickup != null & !cannonLocation.withinDistance(cannonPickup.getLocation(), 2)))
{
player.getPackets().sendMessage("This isn't your cannon!");
break;
}
cannonPickup.pickupCannon();
break;
case 11601: // Clay oven
player.getPackets().modifyText("Please use the item on the oven.", 210, 1);
player.getPackets().sendChatboxInterface(210);
break;
case 10284: // Barrows chest
Barrows.openChest(player);
break;
case 4483: // Castle wars bank chest.
示例2: 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;
}
//.........這裏部分代碼省略.........
示例3: 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:
//.........這裏部分代碼省略.........
示例4: 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;
}
}
}