本文整理匯總了C#中RS2.Server.player.Player.getPackets方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.getPackets方法的具體用法?C# Player.getPackets怎麽用?C# Player.getPackets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類RS2.Server.player.Player
的用法示例。
在下文中一共展示了Player.getPackets方法的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);
}
}
示例2: 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.");
}
示例3: displayItemsInterface
public static void displayItemsInterface(Player p)
{
int amountToKeep = p.isSkulled() ? 0 : 3;
if (p.getPrayers().isProtectItem())
{
amountToKeep = p.isSkulled() ? 1 : 4;
}
int item1 = getProtectedItem1(p)[0];
int item2 = getProtectedItem2(p)[0];
int item3 = getProtectedItem3(p)[0];
int item4 = amountToKeep == 4 ? getProtectedItem4(p)[0] : -1;
if (amountToKeep == 1)
{
item2 = 65535;
item3 = 65535;
item3 = item1;
}
if (amountToKeep == 0)
{
item1 = 65535;
item2 = 65535;
item3 = 65535;
item4 = 65535;
}
object[] opts = new object[] { 17598720, 20221838, "You're marked with a <col=ff3333>skull<col=ff981f>.", 0, 1, item4, item1, item2, item3, /* Items to keep */ amountToKeep /* Items to keep */, 0 };
p.getPackets().displayInterface(102);
p.getPackets().sendClientScript2(204, 118, opts, "iiooooiisii");
p.getPackets().setRightClickOptions(1278, (102 * 65536) + 21, 0, 40);
p.getPackets().setRightClickOptions(1278, (102 * 65536) + 18, 0, 4);
}
示例4: execute
public void execute(Player player, string[] arguments)
{
if (arguments.Length == 0)
{
player.getPackets().sendMessage("[Switch magic command]: ::switch type (example ::switch 1)");
return;
}
int type = 0;
if (!int.TryParse(arguments[0], out type))
{
player.getPackets().sendMessage("[Switch magic command]: ::switch type (example ::switch 1)");
return;
}
switch (type)
{
case 3:
player.setMagicType(3);
player.getPackets().sendTab(player.isHd() ? 99 : 89, 430);
break;
case 2:
player.setMagicType(2);
player.getPackets().sendTab(player.isHd() ? 99 : 89, 193);
break;
case 1:
player.setMagicType(1);
player.getPackets().sendTab(player.isHd() ? 99 : 89, 192);
break;
}
}
示例5: displayFightPitsInterface
public void displayFightPitsInterface(Player p)
{
if (p.getTemporaryAttribute("cantDoAnything") != null)
{
return;
}
p.getPackets().sendConfig(560, playersPlaying.Count - 1);
p.getPackets().modifyText("Current champion: " + getLastWinnerName(), 373, 0);
p.getPackets().sendOverlay(373);
}
示例6: displayWildernessLeverOptions
public static void displayWildernessLeverOptions(Player p, int leverIndex)
{
int dialogueIndex = 140 + leverIndex;
p.setTemporaryAttribute("dialogue", dialogueIndex);
string option1 = leverIndex == 0 ? "Edgeville" : "Home";
p.getPackets().modifyText(option1, 230, 2);
p.getPackets().modifyText("Mage bank", 230, 3);
p.getPackets().modifyText("Nowhere", 230, 4);
p.getPackets().sendChatboxInterface2(230);
}
示例7: execute
public void execute(Player player, string[] arguments)
{
if (arguments.Length == 0)
{
player.getPackets().sendMessage("[Reload Ladders & Stairs XML File]: This command is only for server developers.");
player.getPackets().sendMessage("Reloading... [Could crash server if populated, as all ladders get erased]");
LaddersAndStairs.load();
player.getPackets().sendMessage("Reloaded.");
}
}
示例8: openInterface
public static void openInterface(Player p)
{
p.getPackets().displayInterface(771);
p.getPackets().sendPlayerHead(771, 79);
p.getPackets().animateInterface(9804, 771, 79);
p.getPackets().sendConfig(1262, p.getAppearance().getGender() == 2 ? 1 : 8);
p.getAppearance().setTemporaryAppearance(new Appearance());
p.getAppearance().getTemporaryAppearance().setColoursArray(p.getAppearance().getColoursArray());
p.getAppearance().getTemporaryAppearance().setLookArray(p.getAppearance().getLookArray());
p.getAppearance().getTemporaryAppearance().setGender(p.getAppearance().getGender());
p.removeTemporaryAttribute("hairToggle");
}
示例9: handleExamineObject
private void handleExamineObject(Player player, Packet packet)
{
ushort id = (ushort)packet.readLEShortA();
if (player.getTemporaryAttribute("unmovable") != null)
{
return;
}
SkillHandler.resetAllSkills(player);
player.getPackets().closeInterfaces();
player.getPackets().sendMessage("[Id: " + id + "] " + ObjectData.forId(id).getExamine());
}
示例10: dialogue
public static bool dialogue(Player p, Npc npc, bool rightClickPay)
{
if ((npc.getId() != 1055 && npc.getId() != 437) || (rightClickPay && npc.getId() != 437))
{
return false;
}
p.setEntityFocus(npc.getClientIndex());
AreaEvent dialogueAreaEvent = new AreaEvent(p, npc.getLocation().getX() - 1, npc.getLocation().getY() - 1, npc.getLocation().getX() + 1, npc.getLocation().getY() + 1);
dialogueAreaEvent.setAction(() =>
{
npc.setFaceLocation(p.getLocation());
int status = npc.getId() == 1055 ? 43 : 1;
if (rightClickPay)
{
if (!p.getInventory().hasItemAmount(995, AGILITY_ARENA_PRICE))
{
p.getPackets().sendMessage("You don't have enough money to pay the entrance fee.");
return;
}
status = 29;
}
doDialogue(p, status);
});
Server.registerCoordinateEvent(dialogueAreaEvent);
return true;
}
示例11: refreshDoorsForPlayer
public void refreshDoorsForPlayer(Player p)
{
foreach (Door door in doors)
{
if (door.getDoorLocation().withinDistance(p.getLocation(), 60))
{
int id = door.isDoorOpen() ? door.getOpenDoorId() : door.getClosedDoorId();
Location loc = door.isDoorOpen() ? door.getOpenDoorLocation() : door.getClosedDoorLocation();
int direction = door.isDoorOpen() ? door.getOpenDirection() : door.getClosedDirection();
Location loc1 = door.isDoorOpen() ? door.getClosedDoorLocation() : door.getOpenDoorLocation();
int direction1 = door.isDoorOpen() ? door.getClosedDirection() : door.getOpenDirection();
p.getPackets().removeObject(loc1, direction1, 0);
p.getPackets().createObject(id, loc, direction, 0);
}
}
}
示例12: execute
public void execute(Player player, string[] arguments)
{
if (arguments.Length == 0)
{
player.getPackets().sendMessage("[Animation command]: ::emote emote_number");
return;
}
int animation = 0;
if (!int.TryParse(arguments[0], out animation))
{
player.getPackets().sendMessage("[Animation command]: ::emote emote_number");
return;
}
player.setLastAnimation(new model.Animation(animation));
}
示例13: execute
public void execute(Player player, string[] arguments)
{
if (arguments.Length == 0)
{
player.getPackets().sendMessage("[Animation command]: ::t emote_number");
return;
}
int animation = 0;
if (!int.TryParse(arguments[0], out animation))
{
player.getPackets().sendMessage("[Animation command]: ::emote emote_number");
return;
}
//1179 flash + skill icon , 1230 = make box
player.getPackets().playSoundEffect(animation, 1, 0);
}
示例14: execute
public void execute(Player player, string[] arguments)
{
if (arguments.Length == 0)
{
player.getPackets().sendMessage("[Height command]: ::height 0 [0,1,2,3] are possible");
return;
}
int heightLevel = 0;
if (!int.TryParse(arguments[0], out heightLevel))
{
player.getPackets().sendMessage("[Height command]: ::height 0 [0,1,2,3] are possible");
return;
}
player.teleport(new Location(player.getLocation().getX(), player.getLocation().getY(), heightLevel));
}
示例15: handleExamineNPC
private void handleExamineNPC(Player player, Packet packet)
{
int npcId = packet.readUShort();
if (npcId < 0 || npcId > NpcData.getTotalNpcDefinitions() || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
return;
player.getPackets().sendMessage(NpcData.forId(npcId).getExamine());
}