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


C# Player.getPrayers方法代码示例

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


在下文中一共展示了Player.getPrayers方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getMeleeAttack

 public static double getMeleeAttack(Player p)
 {
     int attBonus = getHighestAttBonus(p);
     int attLevel = p.getSkills().getCurLevel(Skills.SKILL.ATTACK);
     double power = (attLevel + attBonus) * 0.01365;
     double amount = 1.260;
     power *= (attLevel * (power * 0.12)) + (attBonus * amount) * (power * 0.009);
     if (p.getPrayers().getAttackPrayer() == 1) {
         power *= 1.05;
     } else if (p.getPrayers().getAttackPrayer() == 2) {
         power *= 1.10;
     } else if (p.getPrayers().getAttackPrayer() == 3 || p.getPrayers().getSuperPrayer() == 1) {
         power *= 1.15;
     } else if (p.getPrayers().getSuperPrayer() == 2) {
         power *= 1.20;
     }
     if (wearingMeleeVoid(p)) {
         power *= 1.10;
     }
     return power;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:21,代码来源:CombatFormula.cs

示例3: fightCaveAttacks

        public static void fightCaveAttacks(Npc npc, Player p)
        {
            if (npc.isDead() || npc.isDestroyed() || p.isDead() || p.isDestroyed() || p.isDead() || !Location.inFightCave(p.getLocation()) || p.getTeleportTo() != null) {
                return;
            }
            int damage = misc.random(npc.getMaxHit());
            int prayer = p.getPrayers().getHeadIcon();
            int hitDelay = npc.getHitDelay();
            int animation = npc.getAttackAnimation();
            switch(npc.getId()) {
                case 2734: // Tz-Kih (lvl 22)
                case 2735:
                    if (prayer == PrayerData.MELEE) {
                        damage = 0;
                    }
                    break;

                case 2739: // Tz-Xil (lvl 90)
                case 2740:
                    if (prayer == PrayerData.RANGE) {
                        damage = 0;
                    }
                    p.getPackets().sendProjectile(npc.getLocation(), p.getLocation(), 32, 1616, 50, 40, 34, 50, p);
                    break;

                case 2741: // Yt-MejKot (lvl 180)
                case 2742:
                    if (prayer == PrayerData.MELEE) {
                        damage = 0;
                    }
                    // TODO healing
                    break;

                case 2743: // Ket-Zek (lvl 360)
                case 2744:
                    if (!p.getLocation().withinDistance(npc.getLocation(), 2)) {
                        hitDelay = 1600;
                        animation = 9266;
                        npc.setLastGraphics(new Graphics(1622));
                        damage = misc.random(49);
                        if (prayer == PrayerData.MAGIC) {
                            damage = 0;
                        }
                        Event sendProjectileToNpc = new Event(300);
                        sendProjectileToNpc.setAction(() => {
                            sendProjectileToNpc.stop();
                            p.getPackets().sendProjectile(npc.getLocation(), p.getLocation(), 32, 1623, 50, 40, 34, 80, p);
                        });
                        Server.registerEvent(sendProjectileToNpc);
                    } else {
                        damage = misc.random(64);
                        if (prayer == PrayerData.MELEE) {
                            damage = 0;
                        }
                    }
                    break;

                case 2745: // TzTok Jad (lvl 702)
                    doJadAttacks(p, npc);
                    break;
            }
            if (npc.getId() == 2745){
                return;
            }
            if (animation != 65535) {
                npc.setLastAnimation(new Animation(animation));
            }
            p.setLastAttacked(Environment.TickCount);
            npc.setLastAttack(Environment.TickCount);
            p.setAttacker(npc);
            npc.resetCombatTurns();
            if (damage > p.getHp()) {
                damage = p.getHp();
            }
            int npcId = npc.getId();

            Event losePrayerFightingEvent = new Event(hitDelay);
            losePrayerFightingEvent.setAction(() => {
                losePrayerFightingEvent.stop();
                if (!Location.inFightCave(p.getLocation()) || p.getTeleportTo() != null) {
                    return;
                }
                if (npcId == 2734 || npcId == 2735) {
                    int prayerLevel = p.getSkills().getCurLevel(Skills.SKILL.PRAYER);
                    int newPrayerLevel = prayerLevel -= (damage + 1);
                    if (newPrayerLevel <= 0) {
                        newPrayerLevel = 0;
                    }
                    p.getSkills().setCurLevel(Skills.SKILL.PRAYER, newPrayerLevel);
                    p.getPackets().sendSkillLevel(Skills.SKILL.PRAYER);
                } else if (npcId == 2743 || npcId == 2744) {
                    if (misc.random(1) == 0) {
                        p.setLastGraphics(new Graphics(1624, 0));
                    }
                }
                if ((p.getCombatTurns() > 2 || p.getCombatTurns() < 0)) {
                    p.setLastAnimation(new Animation(p.getDefenceAnimation()));
                }
                p.hit(damage);
            });
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:FightCave.cs

示例4: doJadAttacks

        private static void doJadAttacks(Player p, Npc npc)
        {
            if (npc.getHp() <= (npc.getMaxHp() * 0.50)) {
                if (p.getFightCave() != null) {
                    if (!p.getFightCave().isHealersSpawned())
                    {
                        summonJadHealers(p, npc);
                        p.getFightCave().setHealersSpawned(true);
                    }
                }
            }
            npc.resetCombatTurns();
            npc.setEntityFocus(p.getClientIndex());
            switch(misc.random(1)) {
                case 0: // Range
                    npc.setLastAnimation(new Animation(9276));
                    npc.setLastGraphics(new Graphics(1625));
                    Event jadRangeAttackEvent = new Event(1600);
                    int jadRangeAttackStatus = 0;
                    jadRangeAttackEvent.setAction(() => {
                        int hit = 0;
                        int prayer = p.getPrayers().getHeadIcon();
                        if (jadRangeAttackStatus == 0)
                        {
                            jadRangeAttackStatus++;
                            jadRangeAttackEvent.setTick(1500);
                            p.setLastGraphics(new Graphics(451));
                            if (prayer == PrayerData.RANGE) {
                                hit = 0;
                            } else {
                                hit = misc.random(96);
                            }
                        } else {
                            if (prayer != PrayerData.RANGE) {
                                hit = misc.random(96);
                            }
                            jadRangeAttackEvent.stop();
                            p.setLastAttacked(Environment.TickCount);
                            npc.setLastAttack(Environment.TickCount);
                            p.setAttacker(npc);
                            if (hit > p.getHp()) {
                                hit = p.getHp();
                            }
                            if (!Location.inFightCave(p.getLocation()) || p.getTeleportTo() != null) {
                                return;
                            }
                            if ((p.getCombatTurns() > 2 || p.getCombatTurns() < 0)) {
                                p.setLastAnimation(new Animation(p.getDefenceAnimation()));
                            }
                            p.hit(hit);
                            Event animationEvent = new Event(100);
                            animationEvent.setAction(() => {
                                animationEvent.stop();
                                p.setLastGraphics(new Graphics(157, 0, 100));
                            });
                            Server.registerEvent(animationEvent);
                        }
                    });
                    Server.registerEvent(jadRangeAttackEvent);
                    break;

                case 1: // Magic
                    npc.setLastGraphics(new Graphics(1626));
                    Event jadMagicAttackEvent = new Event(300);
                    int jadMagicAttackStatus = 0;
                    jadMagicAttackEvent.setAction(() => {
                        int hit = 0;
                        int prayer = p.getPrayers().getHeadIcon();
                        npc.setLastAnimation(new Animation(9278));
                        if (jadMagicAttackStatus == 0)
                        {
                            jadMagicAttackStatus++;
                            jadMagicAttackEvent.setTick(1600);
                            p.getPackets().sendProjectile(npc.getLocation(), p.getLocation(), 32, 1627, 50, 40, 34, 90, p);
                        } else {
                            jadMagicAttackEvent.stop();
                            if (prayer == PrayerData.MAGIC) {
                                hit = 0;
                            } else {
                                hit = misc.random(96);
                            }
                            p.setLastAttacked(Environment.TickCount);
                            npc.setLastAttack(Environment.TickCount);
                            p.setAttacker(npc);
                            if (hit > p.getHp()) {
                                hit = p.getHp();
                            }
                            if (!Location.inFightCave(p.getLocation()) || p.getTeleportTo() != null) {
                                return;
                            }
                            if ((p.getCombatTurns() > 2 || p.getCombatTurns() < 0)) {
                                p.setLastAnimation(new Animation(p.getDefenceAnimation()));
                            }
                            p.hit(hit);
                            Event animationEvent = new Event(100);
                            animationEvent.setAction(() => {
                                animationEvent.stop();
                                p.setLastGraphics(new Graphics(157, 0, 100));
                            });
                            Server.registerEvent(animationEvent);
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:FightCave.cs

示例5: teleblockPlayer

 public static void teleblockPlayer(Player killer, Player target)
 {
     int teleblockDelay = 300000;
     if (target.getPrayers().getHeadIcon() == PrayerData.MAGIC) {
         teleblockDelay = 150000;
     }
     target.setTemporaryAttribute("teleblocked", true);
     target.setTeleblockTime(Environment.TickCount + teleblockDelay);
     Event removeTeleBlockEvent = new Event(teleblockDelay);
     removeTeleBlockEvent.setAction(() => {
         removeTeleBlockEvent.stop();
         if (target != null) {
             target.removeTemporaryAttribute("teleblocked");
             target.setTeleblockTime(0);
         }
     });
     Server.registerEvent(removeTeleBlockEvent);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:18,代码来源:MagicCombat.cs

示例6: appendAppearanceUpdate

        private static void appendAppearanceUpdate(Player p, PacketBuilder updateBlock)
        {
            PacketBuilder playerProps = new PacketBuilder().setSize(Packet.Size.Bare);

            Appearance app = p.getAppearance();
            playerProps.addByte((byte) (app.getGender() & 0xFF));
            if((app.getGender() & 0x2) == 2) {
                playerProps.addByte((byte) 0);
                playerProps.addByte((byte) 0);
            }
            playerProps.addByte((byte) p.getPrayers().getPkIcon());
            playerProps.addByte((byte) p.getPrayers().getHeadIcon());
            if (!app.isInvisible()) {
                if(!app.isNpc()) {
                    for(int i = 0; i < 4; i++) {
                        if(p.getEquipment().getItemInSlot((ItemData.EQUIP)i) != -1) {
                            playerProps.addUShort(32768 + p.getEquipment().getSlot((ItemData.EQUIP)i).getDefinition().getEquipId());
                        } else {
                            playerProps.addByte((byte) 0);
                        }
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.CHEST) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.CHEST).getDefinition().getEquipId());
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.AMULET));
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.SHIELD) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.SHIELD).getDefinition().getEquipId());
                    } else {
                        playerProps.addByte((byte) 0);
                    }
                    Item chest = p.getEquipment().getSlot(ItemData.EQUIP.CHEST);
                    if (chest != null && chest.getDefinition() != null)
                    {
                        if(!ItemData.isFullBody(chest.getDefinition())) {
                            playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.WEAPON));
                        } else {
                            playerProps.addByte((byte) 0);
                        }
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.WEAPON));
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.LEGS) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.LEGS).getDefinition().getEquipId());
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.SHIELD));
                    }
                    Item hat = p.getEquipment().getSlot(ItemData.EQUIP.HAT);
                    if (hat != null && hat.getDefinition() != null)
                    {
                        if(!ItemData.isFullHat(hat.getDefinition()) && !ItemData.isFullMask(hat.getDefinition())) {
                            playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.HAT));
                        } else {
                            playerProps.addByte((byte) 0);
                        }
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.HAT));
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.HANDS) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.HANDS).getDefinition().getEquipId());
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.CHEST));
                    }
                    if (p.getEquipment().getItemInSlot(ItemData.EQUIP.FEET) != -1)
                    {
                        playerProps.addUShort(32768 + p.getEquipment().getSlot(ItemData.EQUIP.FEET).getDefinition().getEquipId());
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(6));
                    }
                    if (hat != null && hat.getDefinition() != null)
                    {
                        if(!ItemData.isFullMask(hat.getDefinition())) {
                            playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.CAPE));
                        } else {
                            playerProps.addByte((byte) 0);
                        }
                    } else {
                        playerProps.addUShort(0x100 + app.getLook(ItemData.EQUIP.CAPE));
                    }
                } else {
                    playerProps.addUShort(-1);
                    playerProps.addUShort(app.getNpcId());
                    playerProps.addByte((byte) 255);
                }
            } else {
                for (int i = 0; i < 12; i++) {
                    playerProps.addByte((byte) 0);
                }
            }
            foreach(int colour in app.getColoursArray()) {
                playerProps.addByte((byte) colour);
            }
            playerProps.addUShort(p.getEquipment().getStandWalkAnimation());
            playerProps.addLong(p.getLoginDetails().getLongName());
            playerProps.addByte((byte) p.getSkills().getCombatLevel());
            playerProps.addUShort(0);
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:PlayerUpdate.cs

示例7: getMagicAttack

 private static double getMagicAttack(Player p)
 {
     int magicBonus = p.getEquipment().getBonus(Equipment.BONUS.MAGIC_ATTACK);
     double magicLevel = Convert.ToDouble(p.getSkills().getCurLevel(Skills.SKILL.MAGIC));
     double power = 1.800;
     double amount = 0.0205;
     if (magicBonus >= 80) { // equivalent of max mage w/ zerker+whip
         amount = 0.0500;
     } else if (magicBonus >= 90) { // equivalent of max mage w/whip or mystic + ancient staff
         amount = 0.0780;
     } else if (magicBonus >= 105) { // equivalent of max mage w/ ancient staff
         amount = 0.920;
     } else if (magicBonus >= 115) { // equivalent of max mage w/ wand or better
         amount = 0.1110;
     }
     power *= (magicBonus * amount) + (magicLevel *= 0.0120);
     int prayer = p.getPrayers().getMagicPrayer();
     if (prayer > 0) {
         if (prayer == 1) {
             power *= 1.05;
         } else if (prayer == 2) {
             power *= 1.10;
         } else if (prayer == 3) {
             power *= 1.15;
         }
     }
     return power;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:28,代码来源:CombatFormula.cs

示例8: getRangeMaxHit

 public static double getRangeMaxHit(Player p, int bow, int arrow)
 {
     double hit = 0;
     double a = p.getSkills().getCurLevel(Skills.SKILL.RANGE);
     double b = 1.00;
     double c = 0;
     int d = getRangeStrength(p);
     int prayer = p.getPrayers().getRangePrayer();
     if (prayer == 1) {
         b *= 1.05;
     } else if (prayer == 2) {
         b *= 1.10;
     } else if (prayer == 3) {
         b *= 1.15;
     }
     if (wearingRangeVoid(p)) {
         b *= 1.15;
     }
     c = (a * b);
     if (p.getAttackStyle().getStyle().Equals(AttackStyle.CombatStyle.RANGE_ACCURATE)) {
         c += 3.00;
     }
     hit = ((c + 8) * (d + 64) / 640);
     return Math.Floor(hit);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:25,代码来源:CombatFormula.cs

示例9: getPlayerMaxHit

        public static double getPlayerMaxHit(Player player, int strBonusIncrease)
        {
            AttackStyle.CombatSkill fightType = player.getAttackStyle().getSkill();
            double myCurStrength = (double)player.getSkills().getCurLevel(Skills.SKILL.STRENGTH);
            double myEquipStrengthBonus = (double)(player.getEquipment().getBonus(Equipment.BONUS.STRENGTH) + strBonusIncrease);
            double fightingStyle = 0;
            double powerMultiplier = 1;
            double dharokModifier = 1;
            double damageMultiplier = 1;
            int strPrayer = player.getPrayers().getStrengthPrayer();
            if (strPrayer == 1)
            {
                powerMultiplier += 0.05;
            }
            else if (strPrayer == 2)
            {
                powerMultiplier += 0.1;
            }
            else if (strPrayer == 3)
            {
                powerMultiplier += 0.15;
            }
            else if (player.getPrayers().getSuperPrayer() == 1)
            {
                powerMultiplier += 0.18;
            }
            else if (player.getPrayers().getSuperPrayer() == 2)
            {
                powerMultiplier += 0.23;
            }

            if (wearingMeleeVoid(player))
            {
                damageMultiplier += 0.1;
            }
            else if (wearingDharok(player) && misc.random(3) == 0)
            {
                dharokModifier = misc.random((int)((player.getSkills().getGreaterLevel(Skills.SKILL.HITPOINTS) - player.getSkills().getCurLevel(Skills.SKILL.HITPOINTS)) * 0.1));
            }
            if (fightType.Equals(AttackStyle.CombatSkill.AGGRESSIVE))
            {
                fightingStyle = 3;
            } else if (fightType.Equals(AttackStyle.CombatSkill.CONTROLLED))
            {
                fightingStyle = 1;
            }

            double cumulativeStrength = ((myCurStrength) * (powerMultiplier) + fightingStyle) * dharokModifier;
            double maxHit = ((13 + (cumulativeStrength) + (myEquipStrengthBonus / 8) + ((cumulativeStrength * myEquipStrengthBonus) / 64)) * damageMultiplier); // NEW MAX HIT FORMULA
            maxHit = maxHit / 10; //this is temporary because I haven't yet fully implemented the huge damage system.
            return maxHit;
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:52,代码来源:CombatFormula.cs


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