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


C# Player.getPackets方法代码示例

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


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

示例1: 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);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:27,代码来源:ProtectedItems.cs

示例2: 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:Krill156,项目名称:SharpEMU,代码行数:30,代码来源:SpawnObject.cs

示例3: 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));
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:17,代码来源:Height.cs

示例4: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length == 0)
            {
                player.getPackets().sendMessage("[Interface command]: ::inter interface_number");
                return;
            }

            int intreface = 0;
            if (!int.TryParse(arguments[0], out intreface))
            {
                player.getPackets().sendMessage("[Interface command]: ::inter interface_number");
                return;
            }

            player.getPackets().displayInterface(intreface);
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:17,代码来源:Interface.cs

示例5: 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());
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:8,代码来源:NPCInteract.cs

示例6: 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));
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:17,代码来源:Animation.cs

示例7: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length == 0)
            {
                player.getPackets().sendMessage("[PlayerAsNpc command]: ::pnpc npcId");
                return;
            }

            int npcId = 0;
            if (!int.TryParse(arguments[0], out npcId))
            {
                player.getPackets().sendMessage("[PlayerAsNpc command]: ::pnpc npcId [npcId is not a number error]");
                return;
            }

            player.getAppearance().setNpcId(npcId);
            player.getUpdateFlags().setAppearanceUpdateRequired(true);
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:18,代码来源:PlayerAsNpc.cs

示例8: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length < 2)
            {
                player.getPackets().sendMessage("[Teleport command]: ::tele x y or even ::tele x y z");
                return;
            }
            int x,y,z = 0;
            if (!int.TryParse(arguments[0], out x) || !int.TryParse(arguments[1], out y))
            {
                player.getPackets().sendMessage("Bad x,y coordinate, teleporting home, You entered:[x=" + arguments[0] + ", y=" + arguments[1] + "]");
                player.teleport(Constants.HOME_SPAWN_LOCATION);
                return;
            }
            if (arguments.Length >= 3)
                int.TryParse(arguments[2], out z);

            player.teleport(new Location(x, y, z));
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:19,代码来源:Teleport.cs

示例9: antiTeleportMessage

 public static void antiTeleportMessage(Player p)
 {
     p.getPackets().sendNPCHead(2617, 242, 1);
     p.getPackets().modifyText("TzHaar-Mej-Jal", 242, 3);
     p.getPackets().modifyText("I cannot allow you to teleport from the fight cave.", 242, 4);
     p.getPackets().modifyText("In Tzhaar, you either win, or die!", 242, 5);
     p.getPackets().animateInterface(9827, 242, 1);
     p.getPackets().sendChatboxInterface2(242);
     p.getPackets().sendMessage("You are unable to teleport from the fight cave.");
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:10,代码来源:FightCave.cs

示例10: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length > 0)
            {
                int shopIndex = 0;
                if (!int.TryParse(arguments[0], out shopIndex))
                {
                    player.getPackets().sendMessage("[OpenShop command]: ::shop shop_number or just ::shop to open first one.");
                    return;
                }

                Shop shop = Server.getShopManager().getShop(shopIndex);
                if (shop == null)
                {
                    player.getPackets().sendMessage("[OpenShop command]: shop #" + shopIndex + " doesn't exist on server");
                    return;
                }
                player.setShopSession(new ShopSession(player, shopIndex));
            }
            player.setShopSession(new ShopSession(player, 1));
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:21,代码来源:OpenShop.cs

示例11: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length == 0)
            {
                player.getPackets().sendMessage("[Info command]: ::info npcId (example ::info 1)");
                return;
            }

            int npcId = 0;

            if (!int.TryParse(arguments[0], out npcId))
            {
                player.getPackets().sendMessage("[Info command]: ::info npcId (example ::info 1)");
                return;
            }
            if (npcId < 0 || npcId > NpcData.getTotalNpcDefinitions())
                return;

            player.getPackets().sendMessage("ATT = " + (int)CombatFormula.getMeleeAttack(player) + " DEF = " + (int)CombatFormula.getMeleeDefence(player, player) + " SPEC = " + (int)CombatFormula.getMeleeAttack(player) * CombatFormula.getSpecialAttackBonus(player.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON)));
            player.getPackets().sendMessage("NPC ATT = " + (int)CombatFormula.getNPCMeleeAttack(new Npc(npcId)) + " NPC DEF = " + (int)CombatFormula.getNPCMeleeDefence(new Npc(npcId)));
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:21,代码来源:Info.cs

示例12: castCharge

 public static void castCharge(Player p)
 {
     p.removeTemporaryAttribute("autoCasting");
     if (p.getSkills().getCurLevel(Skills.SKILL.MAGIC) < 80) {
         p.getPackets().sendMessage("You need a Magic level of 80 to cast Charge.");
         return;
     }
     if (!hasRunes(p, CHARGE_RUNES, CHARGE_RUNE_AMOUNT)) {
         p.getPackets().sendMessage("You do not have enough runes to cast Charge.");
         return;
     }
     if (p.getTemporaryAttribute("godCharged") != null) {
         p.getPackets().sendMessage("You have already charged your god spells.");
         return;
     }
     if (hasGodCapeAndStaff(p)) {
         p.getPackets().sendMessage("You must wear a God cape and wield the matching staff to cast Charge.");
         return;
     }
     if (!deleteRunes(p, CHARGE_RUNES, CHARGE_RUNE_AMOUNT)) {
         return;
     }
     p.setTemporaryAttribute("godCharged", true);
     p.setLastGraphics(new Graphics(308, 800, 90));
     p.setLastAnimation(new Animation(811));
     p.getPackets().sendMessage("You feel charged with magical power..");
     int delay = 60000 + misc.random(120000); //60 seconds + possible 120 seconds so, 1 minute to 2 minutes.
     Event removeGodChargeEvent = new Event(delay);
     removeGodChargeEvent.setAction(() => {
         removeGodChargeEvent.stop();
         p.removeTemporaryAttribute("godCharged");
         p.getPackets().sendMessage("Your magical charge fades away.");
     });
     Server.registerEvent(removeGodChargeEvent);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:35,代码来源:MagicCombat.cs

示例13: enterCave

        public static void enterCave(Player p)
        {
            AreaEvent enterCaveAreaEvent = new AreaEvent(p, 2438, 5168, 2439, 5168);
            enterCaveAreaEvent.setAction(() => {
                /*
                 * Fight cave is 20k squares from the original place, then another (200 * playerIndex) squares west.
                 */
                Location instanceLocation = new Location((20000 + 2413) + (200 * p.getIndex()), 20000 + 5116, 0);
                p.teleport(instanceLocation);
                p.setFightCave(new FightCaveSession(p));

                Event caveNpcEvent = new Event(600);
                caveNpcEvent.setAction(() => {
                        caveNpcEvent.stop();
                        p.getPackets().sendNPCHead(2617, 242, 1);
                        p.getPackets().modifyText("TzHaar-Mej-Jal", 242, 3);
                        p.getPackets().modifyText("You're on your own now, JalYt.", 242, 4);
                        p.getPackets().modifyText("Pepare to fight for your life!", 242, 5);
                        p.getPackets().animateInterface(9827, 242, 1);
                        p.getPackets().sendChatboxInterface2(242);
                });
                Server.registerEvent(caveNpcEvent);
            });
            Server.registerCoordinateEvent(enterCaveAreaEvent);
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:25,代码来源:FightCave.cs

示例14: execute

        public void execute(Player player, string[] arguments)
        {
            if(arguments.Length == 0) {
                player.getPackets().sendMessage("[Yell command]: what are you expecting.. to yell blank message?");
                return;
            }

            string yellMsg = string.Join(" ", arguments);

            foreach(Player p in Server.getPlayerList()) {
                if (p != null) {
                    p.getPackets().sendMessage(player.getLoginDetails().getUsername() + ": " + yellMsg);
                }
            }
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:15,代码来源:Yell.cs

示例15: execute

        public void execute(Player player, string[] arguments)
        {
            if (arguments.Length < 2)
            {
                player.getPackets().sendMessage("[SetLevel command]: ::setLevel skillId level or ::setLevel skillName level");
                return;
            }

            int skillId = -1;
            int newLevel = 1;
            if (!int.TryParse(arguments[1], out newLevel)) {
                player.getPackets().sendMessage("[SetLevel command]: ::setLevel skillId level or ::setLevel skillName level");
                return;
            }

            if (newLevel > 99) newLevel = 99;

            if (!int.TryParse(arguments[0], out skillId))
            {
                //string based skills
                arguments[0] = arguments[0].ToUpper();

                if(!Enum.IsDefined(typeof(Skills.SKILL), arguments[0])) {
                    player.getPackets().sendMessage("[SetLevel command]: wrong.. try like ::setlevel attack 99 or ::setlevel 0 99");
                    return;
                }
                try
                {
                    Skills.SKILL skillName = (Skills.SKILL)Enum.Parse(typeof(Skills.SKILL), arguments[0], true);
                    player.getSkills().setXp(skillName, 0);
                    player.getSkills().setCurLevel(skillName, newLevel);
                    player.getSkills().addXp(skillName, Skills.getXpForLevel(newLevel));
                    player.getPackets().sendSkillLevel(skillName);
                } catch (ArgumentException) {
                    player.getPackets().sendMessage("[SetLevel command]: wrong.. try like ::setlevel attack 99 or ::setlevel 0 99");
                }
            } else {
                if(!Enum.IsDefined(typeof(Skills.SKILL), skillId)) {
                    player.getPackets().sendMessage("[SetLevel command]: wrong.. try like ::setlevel attack 99 or ::setlevel 0 99");
                    return;
                }
                Skills.SKILL skillName = (Skills.SKILL)skillId;
                player.getSkills().setXp(skillName, 0);
                player.getSkills().setCurLevel(skillName, newLevel);
                player.getSkills().addXp(skillName, Skills.getXpForLevel(newLevel));
                player.getPackets().sendSkillLevel(skillName);
            }
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:48,代码来源:SetLevel.cs


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