本文整理汇总了C#中Packet.readLEShortA方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.readLEShortA方法的具体用法?C# Packet.readLEShortA怎么用?C# Packet.readLEShortA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.readLEShortA方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: handlePickupItem
private void handlePickupItem(Player player, Packet packet)
{
int x = packet.readLEShort();
int id = packet.readUShort();
int y = packet.readLEShortA();
Location l = new Location(x, y, player.getLocation().getZ());
SkillHandler.resetAllSkills(player);
if (x < 1000 || y < 1000 | id < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
return;
}
player.getPackets().closeInterfaces();
if(player.getLocation().Equals(l)) {
Server.getGroundItems().pickupItem(player, id, player.getLocation());
return;
}
CoordinateEvent pickupItemCoordinateEvent = new CoordinateEvent(player, l);
pickupItemCoordinateEvent.setAction(() => {
Server.getGroundItems().pickupItem(player, id, player.getLocation());
});
Server.registerCoordinateEvent(pickupItemCoordinateEvent);
}
示例2: handleRightClickOne
private void handleRightClickOne(Player player, Packet packet)
{
int childId = packet.readLEShort();
int interfaceId = packet.readLEShort();
int item = packet.readLEShortA();
int slot = packet.readLEShortA();
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 (interfaceId == 149 && childId == 0) {
if (Herblore.emptyPotion(player, player.getInventory().getItemInSlot(slot), slot)) {
return;
} else if (JewelleryTeleport.useJewellery(player, player.getInventory().getItemInSlot(slot), slot, false)) {
return;
}
}
}
}
示例3: handleItemOnGroundItem
private void handleItemOnGroundItem(Player player, Packet packet)
{
int objectX = packet.readLEShortA();
int itemSlot = packet.readLEShort();
int itemIdInInventory = packet.readLEShort();
int itemIdOnGround = packet.readLEShort();
int objectY = packet.readLEShortA();
int interfaceId = packet.readLEShort();
int child = packet.readUShort();
if (itemSlot > 28 || itemSlot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
return;
if (Firemaking.isFiremaking(player, itemIdInInventory, itemIdOnGround, itemSlot, -1))
return;
else
player.getPackets().sendMessage("Nothing interesting happens.");
}
示例4: handleItemOnItem
private void handleItemOnItem(Player player, Packet packet)
{
int itemSlot = packet.readUShort();
int unused = packet.readInt();
int withSlot = packet.readLEShort();
int unused2 = packet.readInt();
int itemUsed = packet.readLEShortA();
int usedWith = packet.readLEShortA();
if (itemSlot > 28 || itemSlot < 0 || withSlot > 28 || withSlot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
return;
}
SkillHandler.resetAllSkills(player);
player.getPackets().closeInterfaces();
if (player.getInventory().getSlot(itemSlot).getItemId() == itemUsed && player.getInventory().getSlot(withSlot).getItemId() == usedWith) {
if (Fletching.isFletching(player, itemUsed, usedWith)) {
return;
} else if (Herblore.doingHerblore(player, itemUsed, usedWith)) {
return;
} else if (Herblore.mixDoses(player, itemUsed, usedWith, itemSlot, withSlot)) {
return;
} else if (Crafting.wantsToCraft(player, itemUsed, usedWith)) {
return;
} else if (Firemaking.isFiremaking(player, itemUsed, usedWith, itemSlot, withSlot)) {
return;
} else if (Farming.plantSapling(player, itemUsed, usedWith)) {
return;
} else {
player.getPackets().sendMessage("Nothing interesting happens.");
}
}
}
示例5: 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;
}
}
}
示例6: handleExamineItem
private void handleExamineItem(Player player, Packet packet)
{
int item = packet.readLEShortA();
if (item < 0 || item > Constants.MAX_ITEMS) {
return;
}
string examine = ItemData.forId(item).getExamine();
player.getPackets().sendMessage(examine);
}
示例7: handleFirstClickNPC
private void handleFirstClickNPC(Player player, Packet packet)
{
int npcIndex = packet.readLEShortA();
if (npcIndex < 0 || npcIndex > Constants.MAX_NPCS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
return;
}
SkillHandler.resetAllSkills(player);
Npc npc = Server.getNpcList()[npcIndex];
if (npc == null || npc.isDestroyed()) {
return;
}
Combat.newAttack(player, npc);
}
示例8: handleMagicOnNPC
private void handleMagicOnNPC(Player player, Packet packet)
{
int childId = packet.readLEShort();
int interfaceId = packet.readLEShort();
int junk = packet.readShortA();
int npcIndex = packet.readLEShortA();
if (npcIndex < 0 || npcIndex > Constants.MAX_NPCS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
return;
}
Npc npc = Server.getNpcList()[npcIndex];
if (npc == null || npc.isDestroyed()) {
return;
}
SkillHandler.resetAllSkills(player);
player.setTarget(npc);
MagicCombat.newMagicAttack(player, npc, childId, interfaceId == 193);
Console.WriteLine(childId);
}
示例9: handleItemOnNPC
private void handleItemOnNPC(Player player, Packet packet)
{
int interfaceId = packet.readInt();
int slot = packet.readLEShort();
int npcIndex = packet.readLEShort();
int item = packet.readLEShortA();
if (npcIndex < 0 || npcIndex > Constants.MAX_NPCS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
return;
}
Npc npc = Server.getNpcList()[npcIndex];
if (npc == null || npc.isDestroyed()) {
return;
}
SkillHandler.resetAllSkills(player);
player.getPackets().closeInterfaces();
Console.WriteLine("Item on NPC " + npc.getId());
if (player.getInventory().getItemInSlot(slot) == item) {
switch(npc.getId()) {
case 519: // Bob
BrokenBarrows.talkToBob(player, npc, player.getInventory().getItemInSlot(slot), 0);
break;
}
}
}