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


C# Player.getEquipment方法代码示例

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


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

示例1: getProtectedItem1

 public static int[] getProtectedItem1(Player p)
 {
     int[] protectedItem = new int[2];
     protectedItem[0] = -1;
     for (int i = 0; i < 28; i++) {
         if(p.getInventory().getSlot(i).itemId == -1) continue;
         int price = p.getInventory().getSlot(i).getDefinition().getPrice().getMaximumPrice();
         if ((price > ItemData.forId(protectedItem[0]).getPrice().getMaximumPrice()))
         {
             protectedItem[0] = p.getInventory().getSlot(i).getItemId();
             protectedItem[1] = INVENTORY;
         }
     }
     foreach (ItemData.EQUIP equip in Enum.GetValues(typeof(ItemData.EQUIP))) {
         if (equip == ItemData.EQUIP.NOTHING) continue;
         if (p.getEquipment().getSlot(equip).itemId == -1) continue;
         int price = p.getEquipment().getSlot(equip).getDefinition().getPrice().getMaximumPrice();
         if (price > ItemData.forId(protectedItem[0]).getPrice().getMaximumPrice())
         {
             protectedItem[0] = p.getEquipment().getSlot(equip).getItemId();
             protectedItem[1] = EQUIPMENT;
         }
     }
     return protectedItem;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:25,代码来源:ProtectedItems.cs

示例2: 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

示例3: wearingAhrim

 public static bool wearingAhrim(Player p)
 {
     return p.getEquipment().getItemInSlot(ItemData.EQUIP.LEGS) == 4714 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4710 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.CHEST) == 4712 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.HAT) == 4708;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:7,代码来源:CombatFormula.cs

示例4: getStandAnim

 public static int getStandAnim(Player p)
 {
     int id = p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON);
     string weapon = ItemData.forId(id).getName();
     if (weapon.Contains("Dharok"))
     {
         return 2065;
     }
     if (weapon.Contains("flail"))
     {
         return 2061;
     }
     if (weapon.Contains("Karil"))
     {
         return 2074;
     }
     if (weapon.Contains("Tzhaar-ket-om"))
     {
         return 0x811;
     }
     if (weapon.Equals("Saradomin staff") || weapon.Equals("Guthix staff") || weapon.Equals("Zamorak staff"))
     {
         return 0x328;
     }
     if (weapon.Contains("Guthan") || weapon.EndsWith("spear") || weapon.EndsWith("halberd") || weapon.Contains("Staff") || weapon.Contains("staff") || weapon.Contains("wand") || weapon.Contains("Dragon longsword") || weapon.Equals("Void knight mace"))
     {
         return 809;
     }
     if (weapon.Contains("2h") || weapon.EndsWith("godsword") || weapon.Equals("Saradomin sword"))
     {
         return 7047;
     }
     if (weapon.Equals("Abyssal whip"))
     {
         return 10080;
     }
     if (weapon.Contains("Granite maul"))
     {
         return 1662;
     }
     return 808;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:42,代码来源:Animations.cs

示例5: getDefenceAnimation

        public static int getDefenceAnimation(Player p)
        {
            int weaponId = p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON);
            int shield = p.getEquipment().getItemInSlot(ItemData.EQUIP.SHIELD);
            ItemData.Item weaponDef = p.getEquipment().getSlot(ItemData.EQUIP.WEAPON).getDefinition();
            if (weaponDef == null) return 404;
            string weapon = weaponDef.getName();

            if (shield != -1)
            {
                ItemData.Item shieldDef = p.getEquipment().getSlot(ItemData.EQUIP.SHIELD).getDefinition();
                if (shieldDef == null) return 1156;
                string shieldName = shieldDef.getName();
                if (shield >= 8844 && shield <= 8850)
                { // Defenders
                    return 4177;
                }
                if (shieldName.Contains("book") || shieldName.Contains("Book"))
                {
                    return 404;
                }
                return 1156;
            }
            if (weaponId <= 0)
            {
                return 424;
            }
            if (weapon.Contains("xil-ul"))
            {
                return 425;
            }
            if (weapon.EndsWith("whip"))
            {
                return 1659;
            }
            if (weapon.Contains("Granite maul"))
            {
                return 1666;
            }
            if (weapon.Contains("Dharok") || weapon.Contains("flail"))
            {
                return 2063;
            }
            if (weapon.Contains("shortbow") || weapon.Contains("longbow") || weapon.Contains("Karil") || weapon.Contains("Crystal") || weapon.Contains("Dark bow"))
            {
                return 425;
            }
            if (weapon.Contains("2h") || weapon.Contains("godsword") || weapon.Contains("Saradomin sword"))
            {
                return 7050;
            }
            if (weapon.Contains("staff") || weapon.Contains("Staff") || weapon.Contains("halberd")
                || weapon.Contains("warspear") || weapon.Contains("spear"))
            {
                return 420;
            }
            if (weapon.Contains("claws"))
            {
                return 4177;
            }
            if (weapon.Contains("wand") || weapon.Contains("longsword") || weapon.EndsWith("_sword")
                || weapon.Contains("battleaxe") || weapon.Contains("mace") || weapon.Contains("scimitar")
                || weapon.Contains("axe") || weapon.Contains("warhammer") || weapon.Contains("dagger"))
            {
                return 397;
            }
            return 404;
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:68,代码来源:Animations.cs

示例6: handleOperateItem

 private void handleOperateItem(Player player, Packet packet)
 {
     int item = packet.readShortA();
     int slot = packet.readLEShort();
     int interfaceId = packet.readLEShort();
     int childId = packet.readLEShort();
     if (slot < 0 || slot > 13 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
         return;
     }
     ItemData.EQUIP equipSlot = (ItemData.EQUIP)slot;
     if (player.getEquipment().getItemInSlot(equipSlot) == item)
     {
         SkillHandler.resetAllSkills(player);
         player.getPackets().closeInterfaces();
         if (JewelleryTeleport.useJewellery(player, player.getEquipment().getItemInSlot(equipSlot), slot, true))
         {
             return;
         } else
             if (equipSlot == ItemData.EQUIP.CAPE && Skillcape.emote(player))
             {
             return;
         }
         player.getPackets().sendMessage("This item isn't operable.");
     }
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:25,代码来源:ItemInteract.cs

示例7: canCastSpell

 private static bool canCastSpell(Player p, Entity target, int i, bool fakeNPC)
 {
     // fakeNPC is used to keep location when autocasting.
     if (fakeNPC) {
         return !p.isDead();
     }
     if (target.isDead() || p.isDead() || target.isDestroyed() || p.isDestroyed()) {
         return false;
     }
     if (target is Npc) {
         if (((Npc) target).getHp() <= 0) {
             return false;
         }
         if (i == 47) {
             p.getPackets().sendMessage("You cannot cast Teleblock upon an NPC.");
             return false;
         }
     }
     if ((target is Player) && (p is Player)) {
         if (Location.inFightPits(target.getLocation()) && Location.inFightPits(target.getLocation()))
         {
             if (!Server.getMinigames().getFightPits().hasGameStarted()) {
                 return false;
             }
             return true;
         }
         if (p.getDuel() != null) {
             if (((Player)target).getDuel() != null) {
                 if (p.getDuel().getPlayer2().Equals(((Player) target)) && ((Player) target).getDuel().getPlayer2().Equals(p)) {
                     if (p.getDuel().ruleEnabled(DuelSession.RULE.NO_MAGIC)) {
                         p.getPackets().sendMessage("Magical combat has been disabled in this duel!");
                         return false;
                     }
                     if (p.getDuel().getStatus() == 6 && ((Player) target).getDuel().getStatus() == 6) {
                         return true;
                     }
                 }
             }
             p.getPackets().sendMessage("That isn't your opponent.");
             return false;
         }
         if (i == 47) {
             if (((Player)target).getTemporaryAttribute("teleblocked") != null) {
                 p.getPackets().sendMessage("That player already has a teleportation block upon them.");
                 return false;
             }
         }
         if (!Location.inWilderness(target.getLocation())) {
             p.getPackets().sendMessage("That player isn't in the wilderness.");
             return false;
         }
         if (!Location.inWilderness(p.getLocation()))
         {
             p.getPackets().sendMessage("You aren't in the wilderness.");
             return false;
         }
         int killerWildLevel = p.getLocation().wildernessLevel();
         int targetWildLevel = ((Player)target).getLocation().wildernessLevel();
         int killerCombatLevel = p.getSkills().getCombatLevel();
         int targetCombatLevel = ((Player)target).getSkills().getCombatLevel();
         int highest = killerCombatLevel > targetCombatLevel ? killerCombatLevel : targetCombatLevel;
         int lowest = highest == killerCombatLevel ? targetCombatLevel : killerCombatLevel;
         int difference = (highest - lowest);
         if (difference > killerWildLevel || difference > targetWildLevel) {
             ((Player) p).getPackets().sendMessage("You must move deeper into the wilderness to attack that player.");
             return false;
         }
     }
     if (!Location.inMultiCombat(target.getLocation())) {
         if (p.getAttacker() != null && !p.getAttacker().Equals(target)) {
             p.getPackets().sendMessage("You are already in combat!");
             return false;
         }
         if (target.getAttacker() != null && !target.getAttacker().Equals(p)) {
             string type = target is Player ? "player" : "npc";
             p.getPackets().sendMessage("That " + type + " is already in combat.");
             return false;
         }
     }
     if (p.getSkills().getCurLevel(Skills.SKILL.MAGIC) < SPELL_LEVEL[i]) {
         p.getPackets().sendMessage("You need a Magic level of " + SPELL_LEVEL[i] + " to cast that spell.");
         return false;
     }
     if (!hasRunes(p, RUNES[i], RUNE_AMOUNTS[i])) {
         p.getPackets().sendMessage("You do not have enough runes to cast that spell.");
         return false;
     }
     if (NEEDS_STAFF[i]) {
         if ((i != 38 && p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) != STAFF[i]) || (i == 38 && p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) != 8841 && p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) != STAFF[i]))
         {
             p.getPackets().sendMessage("You need to wield " + STAFF_NAME[i] + " to cast this spell.");
             return false;
         }
     }
     if (i == 37) {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.CAPE) != 2412)
         {
             p.getPackets().sendMessage("You need to wear the Cape of Saradomin to be able to cast Saradomin Strike.");
             return false;
         }
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:MagicCombat.cs

示例8: getProtectedItem2

 public static int[] getProtectedItem2(Player p)
 {
     int[] protectedItem = new int[2];
     protectedItem[0] = -1;
     int[] protectedItem1 = getProtectedItem1(p);
     bool save;
     for (int i = 0; i < 28; i++) {
         if (p.getInventory().getSlot(i).itemId == -1) continue;
         int amt = p.getInventory().getItemAmount(p.getInventory().getItemInSlot(i));
         int price = p.getInventory().getSlot(i).getDefinition().getPrice().getMaximumPrice();
         if (price > ItemData.forId(protectedItem[0]).getPrice().getMaximumPrice())
         {
             save = true;
             if (protectedItem1[1] == INVENTORY) {
                 if (protectedItem1[0] == p.getInventory().getItemInSlot(i)) {
                     if (amt < 2) {
                         save = false;
                     }
                 }
             }
             if (save) {
                 protectedItem[0] = p.getInventory().getSlot(i).getItemId();
                 protectedItem[1] = INVENTORY;
             }
         }
     }
        foreach (ItemData.EQUIP equip in Enum.GetValues(typeof(ItemData.EQUIP))) {
        if (equip == ItemData.EQUIP.NOTHING) continue;
        if (p.getEquipment().getSlot(equip).itemId == -1) continue;
        int price = p.getEquipment().getSlot(equip).getDefinition().getPrice().getMaximumPrice();
        int amt = p.getEquipment().getAmountInSlot(equip);
         if (price > ItemData.forId(protectedItem[0]).getPrice().getMaximumPrice())
         {
             save = true;
             if (protectedItem1[1] == EQUIPMENT) {
                 if (protectedItem1[0] == p.getEquipment().getItemInSlot(equip))
                 {
                     if (amt < 2) {
                         save = false;
                     }
                 }
             }
             if (save) {
                 protectedItem[0] = p.getEquipment().getSlot(equip).getItemId();
                 protectedItem[1] = EQUIPMENT;
             }
         }
     }
     return protectedItem;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:50,代码来源:ProtectedItems.cs

示例9: getHighestDefBonus

 private static int getHighestDefBonus(Player p)
 {
     int bonus = 0;
     for (int i = 5; i < 8; i++) {
         if (p.getEquipment().getBonus(i) > bonus)
         {
             bonus = p.getEquipment().getBonus(i);
         }
     }
     return bonus;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:11,代码来源:CombatFormula.cs

示例10: wearingVerac

 public static bool wearingVerac(Player p)
 {
     return p.getEquipment().getItemInSlot(ItemData.EQUIP.LEGS) == 4759 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4755 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.CHEST) == 4757 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.HAT) == 4753;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:7,代码来源:CombatFormula.cs

示例11: wearingTorag

 public static bool wearingTorag(Player p)
 {
     return p.getEquipment().getItemInSlot(ItemData.EQUIP.LEGS) == 4751 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4747 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.CHEST) == 4749 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.HAT) == 4745;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:7,代码来源:CombatFormula.cs

示例12: wearingMeleeVoid

 public static bool wearingMeleeVoid(Player p)
 {
     return p.getEquipment().getItemInSlot(ItemData.EQUIP.LEGS) == 8840 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.CHEST) == 8839 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.HAT) == 11665 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.HANDS) == 8842;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:7,代码来源:CombatFormula.cs

示例13: wearingKaril

 public static bool wearingKaril(Player p)
 {
     return p.getEquipment().getItemInSlot(ItemData.EQUIP.LEGS) == 4738 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4734 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.CHEST) == 4736 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.HAT) == 4732;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:7,代码来源:CombatFormula.cs

示例14: wearingGuthan

 public static bool wearingGuthan(Player p)
 {
     return p.getEquipment().getItemInSlot(ItemData.EQUIP.LEGS) == 4730 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4726 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.CHEST) == 4728 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.HAT) == 4724;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:7,代码来源:CombatFormula.cs

示例15: wearingDharok

 public static bool wearingDharok(Player p)
 {
     return p.getEquipment().getItemInSlot(ItemData.EQUIP.LEGS) == 4722 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4718 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.CHEST) == 4720 &&
     p.getEquipment().getItemInSlot(ItemData.EQUIP.HAT) == 4716;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:7,代码来源:CombatFormula.cs


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