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


C# Player.getEquipment方法代码示例

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


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

示例1: getProtectedItem1

	    public static int[] getProtectedItem1(Player p) {
		    int[] protectedItem = new int[2];
		    protectedItem[0] = -1;

            foreach (Item item in p.getInventory().getItems()) {
                if(item.getItemId() == -1) continue;
                int price = item.getDefinition().getPrice().getMaximumPrice();
                if ((price > ItemData.forId(protectedItem[0]).getPrice().getMaximumPrice()))
                {
                    protectedItem[0] = item.getItemId();
				    protectedItem[1] = INVENTORY;
			    }
		    }

            foreach(Item item in p.getEquipment().getEquipment()) {
                if (item.getItemId() == -1) continue;
                int price = item.getDefinition().getPrice().getMaximumPrice();
                if (price > ItemData.forId(protectedItem[0]).getPrice().getMaximumPrice())
                {
                    protectedItem[0] = item.getItemId();
				    protectedItem[1] = EQUIPMENT;
			    }
            }
		    return protectedItem;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:25,代码来源:ProtectedItems.cs

示例2: getPlayerMaxHit

        public static double getPlayerMaxHit(Player player, int strBonusIncrease)
        {
            AttackStyle.CombatSkill fightType = player.getAttackStyle().getSkill();
            double myCurStrength = player.getSkills().getCurLevel(Skills.SKILL.STRENGTH);
            double myEquipStrengthBonus = (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))
            {
                dharokModifier = (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;
            //Can't change this. For huge damage it's a visual effect, not real maxHit!
            double maxHit = ((13 + (cumulativeStrength) + (myEquipStrengthBonus / 8) + ((cumulativeStrength * myEquipStrengthBonus) / 64)) * damageMultiplier) / 10; // NEW MAX HIT FORMULA
            return maxHit;
        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:51,代码来源:CombatFormula.cs

示例3: 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:slapglif,项目名称:runescape-server-csharp,代码行数:21,代码来源:Info.cs

示例4: 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:slapglif,项目名称:runescape-server-csharp,代码行数:7,代码来源:CombatFormula.cs

示例5: getHighestAttackBonus

        private static int getHighestAttackBonus(Player p)
        {
            /* TODO:
             * Pretty stupid to figure out highest attack bonus
             * You won't know what kind of Attack bonus Crush/Slash etc. is used for what.
             */

		    int bonus = 0;
		    for (int i = 0; i < 3; i++) {
			    if (p.getEquipment().getBonus(i) > bonus) {
				    bonus = p.getEquipment().getBonus(i);
			    }
		    }
		    return bonus;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:15,代码来源:CombatFormula.cs

示例6: refreshGlobalObjects

	    public void refreshGlobalObjects(Player p) {
		    foreach(WorldObject o in objects) {
			    if (o != null && (o.isFire() || o.getOwner() == null || o.getOwner() == p) || o.isSpawnedObject() || o.shouldDeleteObject()) {
				    if (o.getLocation().withinDistance(p.getLocation(), 60)) {
					    if (o.shouldDeleteObject()) {
						    p.getPackets().removeObject(o.getLocation(), o.getFace(), o.getType());
					    } else if (!o.isFire()) {
						    p.getPackets().createObject(o.isSecondForm() ? o.getSecondaryId() : o.getOriginalId(), o.getLocation(), o.getFace(), o.getType());
					    } else {
						    p.getPackets().createObject(o.getOriginalId(), o.getLocation(), o.getFace(), o.getType());
					    }
				    }
			    }
		    }
		    doors.refreshDoorsForPlayer(p);
		    if (RuneCraft.wearingTiara(p)) {
			    RuneCraft.toggleRuin(p, p.getEquipment().getItemInSlot(0), true);
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:19,代码来源:WorldObjectManager.cs

示例7: handleActionButton


//.........这里部分代码省略.........
						    player.getBank().setCurrentTab(8);
						    break;
						
					    case 25: // eighth bank tab
						    player.getBank().setCurrentTab(9);
						    break;
				    }
				    break;
				
			    case 626: // Stake duel confirmation interface.
				    if (buttonId == 53) {
					    if (player.getDuel() != null) {
						    player.getDuel().acceptDuel();
						    break;
					    }
				    }
				    break;
				
			    case 631: // Stake duel first interface.
				    if (player.getDuel() != null) {
					    if (buttonId == 103) {
						    player.getDuel().removeItem(buttonId2, 1);
						    break;
					    } else {
						    player.getDuel().toggleDuelRules(buttonId);
						    break;
					    }
				    }
				    break;
				
			    case 387: // Equipment tab. 
				    switch(buttonId) {
					    case 55: // Character display.
						    player.getEquipment().displayEquipmentScreen();
						    break;
						
					    case 52: // Items kept on death.
						    ProtectedItems.displayItemsInterface(player);
						    break;
				    }
				    break;
				
			    case 274: // Quest tab.
				    switch(buttonId) {
					    case 3: // Achievment diary toggle.
						    player.getPackets().sendTab(85, 259);
						    player.setAchievementDiaryTab(true);
						    break;
				    }
				    break;
				
			    case 259: // Achievment diary tab.
				    switch(buttonId) {
					    case 8: // Quest tab toggle.
						    player.getPackets().sendTab(85, 274);
						    player.setAchievementDiaryTab(false);
						    break;
				    }
				    break;
				
			    case 620: // Shop interface.
				    if (player.getShopSession() == null) {
					    return;
				    }
				    switch(buttonId) {
					    case 26: // Player stock tab.
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:67,代码来源:ActionButton.cs

示例8: cancelAutoCast

 public static void cancelAutoCast(Player p, bool cancelCast)
 {
     if (cancelCast) {
         p.getEquipment().setWeapon();
         //p.getPackets().sendConfig(43, 0);
         resetSpellIcon(p);
         p.removeTemporaryAttribute("autoCastSpell");
         p.removeTemporaryAttribute("autoCastAncients");
         p.getPackets().showChildInterface(90, 83, true);
         p.getPackets().modifyText("Spell", 90, 11);
         return;
     }
     if (p.getTemporaryAttribute("autoCastSpell") != null) {
         setAutoCastSpell(p, (int)p.getTemporaryAttribute("autoCastSpell2"), (int)p.getTemporaryAttribute("autoCastSpell"), (bool)(p.getTemporaryAttribute("autoCastAncients") != null ? true : false));
     } else {
         //p.getPackets().sendConfig(43, 0);
         resetSpellIcon(p);
         p.getEquipment().setWeapon();
         p.getPackets().showChildInterface(90, 83, true);
         p.getPackets().modifyText("Spell", 90, 11);
         p.removeTemporaryAttribute("autoCastSpell");
         p.removeTemporaryAttribute("autoCastAncients");
         p.removeTemporaryAttribute("autoCastSpell2");
     }
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:25,代码来源:MagicData.cs

示例9: configureSelectSpellInterface

 public static void configureSelectSpellInterface(Player p)
 {
     p.removeTemporaryAttribute("autoCasting");
     if (p.getMagicType() == 1) {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4170)
         { // Slayer staff.
             p.getPackets().sendTab(83, 310);
             return;
         }
         else if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 8841)
         { // Void knight mace.
             p.getPackets().sendTab(83, 406);
             return;
         } else {
             p.getPackets().sendTab(83, 319);
         }
     } else if (p.getMagicType() == 2) {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4675)
         { // Ancient staff.
             p.getPackets().sendTab(83, 388);
         } else {
             p.getPackets().sendMessage("You cannot autocast Ancient Magic with this staff.");
         }
     }
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:25,代码来源:MagicData.cs

示例10: getProtectedItem4

	    public static int[] getProtectedItem4(Player p) {
		    int[] protectedItem = new int[2];
		    protectedItem[0] = -1;
		    int[] protectedItem1 = getProtectedItem1(p);
		    int[] protectedItem2 = getProtectedItem2(p);
		    int[] protectedItem3 = getProtectedItem3(p);
		    bool save;

            foreach (Item item in p.getInventory().getItems())
            {
                if (item.getItemId() == -1) continue;
                int amt = item.getItemAmount();
                int price = item.getDefinition().getPrice().getMaximumPrice();
                if (price > ItemData.forId(protectedItem[0]).getPrice().getMaximumPrice())
                {
				    save = true;
                    if (protectedItem1[0] == item.getItemId() && protectedItem1[1] == INVENTORY)
                    {
					    if (amt < 2) {
						    save = false;
					    }
				    }
                    if (protectedItem2[0] == item.getItemId() && protectedItem2[1] == INVENTORY)
                    {
					    if (amt < 2) {
						    save = false;
					    }
				    }
                    if (protectedItem3[0] == item.getItemId() && protectedItem3[1] == INVENTORY)
                    {
					    if (amt < 2) {
						    save = false;
					    }
				    }
				    if (amt == 2) {
					    int[][] array = {protectedItem1, protectedItem2, protectedItem3};
					    int k = 0;
					    for (int j = 0; j < array.Length; j++) {
                            if (array[j][0] == item.getItemId() && array[j][1] == INVENTORY)
                            {
							    k++;
						    }
					    }
					    if (k >= 2) {
						    save = false;
					    }
				    }
				    if (protectedItem1[1] == INVENTORY && protectedItem2[1] == INVENTORY && protectedItem3[1] == INVENTORY) {
                        if (protectedItem1[0] == item.getItemId() && protectedItem2[0] == item.getItemId() && protectedItem3[0] == item.getItemId())
                        {
						    if (amt < 4) {
							    save = false;
						    }
					    }
				    }
				    if (save) {
                        protectedItem[0] = item.getItemId();
					    protectedItem[1] = INVENTORY;
				    }
			    }
		    }

            foreach (Item item in p.getEquipment().getEquipment())
            {
                if (item.getItemId() == -1) continue;
                int price = item.getDefinition().getPrice().getMaximumPrice();
                int amt = item.getItemAmount();
                if (price > ItemData.forId(protectedItem[0]).getPrice().getMaximumPrice())
                {
				    save = true;
                    if (protectedItem1[0] == item.getItemId() && protectedItem1[1] == EQUIPMENT)
                    {
					    if (amt < 2) {
						    save = false;
					    }
				    }
                    if (protectedItem2[0] == item.getItemId() && protectedItem2[1] == EQUIPMENT)
                    {
					    if (amt < 2) {
						    save = false;
					    }
				    }
                    if (protectedItem3[0] == item.getItemId() && protectedItem3[1] == EQUIPMENT)
                    {
					    if (amt < 2) {
						    save = false;
					    }
				    }
				    if (amt == 2) {
					    int[][] array = {protectedItem1, protectedItem2, protectedItem3};
					    int k = 0;
					    for (int j = 0; j < array.Length; j++) {
                            if (array[j][0] == item.getItemId() && array[j][1] == EQUIPMENT)
                            {
							    k++;
						    }
					    }
					    if (k >= 2) {
						    save = false;
					    }
//.........这里部分代码省略.........
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:101,代码来源:ProtectedItems.cs

示例11: changeJewellery

	    protected static void changeJewellery(Player p, JewellerySlot js) {
		    bool gloryAmulet = js.index < 2;
		    bool newItem = true;
		    string s = js.index == 2 ? "Ring of Dueling" : js.index == 3 ?  "Games necklace" : "Amulet of Glory";
		    for (int i = 0; i < JEWELLERY[js.index].Length; i++) {
			    int charges = i;
			    if (!js.wearing) {
				    Item item = p.getInventory().getSlot(js.slot);
				    if (item.getItemId() == JEWELLERY[js.index][i]) {
					    if (gloryAmulet) {
						    charges--;
					    }
					    string t = charges > 1 ? " charges" : " charge";
					    if (charges > 0) {
						    p.getPackets().sendMessage("The " + s + " now has " + charges + t + " .");
					    } else if (gloryAmulet && charges == 0) {
                            p.getPackets().sendMessage("The Amulet of Glory has run out of charges.");
					    } else if (!gloryAmulet && charges <= 1) {
						    newItem = false;
                            p.getPackets().sendMessage("The " + s + " crumbles to dust.");
						    p.getInventory().deleteItem(item.getItemId(), js.slot, 1);
					    }
					    if (newItem) {
						    item.setItemId(JEWELLERY[js.index][i - 1]);
                            p.getPackets().refreshInventory();
					    }
					    break;
				    }
			    } else {
				    Item item = p.getEquipment().getSlot((ItemData.EQUIP)js.slot);
				    if (item.getItemId() == JEWELLERY[js.index][i]) {
					    if (gloryAmulet) {
						    charges--;
					    }
					    string t = charges > 1 ? " charges" : " charge";
					    if (charges > 0) {
                            p.getPackets().sendMessage("The " + s + " now has " + charges + t + " .");
					    } else if (gloryAmulet && charges == 0) {
                            p.getPackets().sendMessage("The Amulet of Glory has run out of charges.");
					    } else if (!gloryAmulet && charges <= 1) {
						    newItem = false;
                            p.getPackets().sendMessage("The " + s + " crumbles to dust.");
						    item.setItemId(-1);
						    item.setItemAmount(0);
					    }
					    if (newItem) {
						    item.setItemId(JEWELLERY[js.index][i - 1]);
					    }
                        p.getPackets().refreshEquipment();
					    break;
				    }
			    }
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:54,代码来源:JewelleryTeleport.cs

示例12: getRangeDefence

        public static double getRangeDefence(Player p)
        {
            int rangedDefenceBonus = p.getEquipment().getBonus(Equipment.BONUS.RANGED_DEFENCE);
            double defenceLevel = p.getSkills().getCurLevel(Skills.SKILL.DEFENCE);
            AttackStyle.CombatSkill fightType = p.getAttackStyle().getSkill();
            if (fightType.Equals(AttackStyle.CombatSkill.DEFENSIVE))
                defenceLevel *= 1.10; //%10 increase.

            if(p.getPrayers().isPrayerActive(PrayerData.Prayer.THICK_SKIN))
                defenceLevel *= 1.05; //5% increase.
            else if (p.getPrayers().isPrayerActive(PrayerData.Prayer.ROCK_SKIN))
                defenceLevel *= 1.10; //10% increase.
            else if (p.getPrayers().isPrayerActive(PrayerData.Prayer.STEEL_SKIN))
                defenceLevel *= 1.15; //15% increase.
            else if (p.getPrayers().isPrayerActive(PrayerData.Prayer.SMITE))
                defenceLevel *= 1.20; //20% increase.
            else if (p.getPrayers().isPrayerActive(PrayerData.Prayer.CHIVALRY))
                defenceLevel *= 1.25; //25% increase.

            double rangeDefence = (defenceLevel * rangedDefenceBonus) / 200;
            return rangeDefence;

        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:23,代码来源:CombatFormula.cs

示例13: getRangeWeaponArrowStrength


//.........这里部分代码省略.........
			    new int[] { 
			    31, // addy arrow
			    100, // addy bolt
			    10, // addy dart
			    28, // addy jav
			    14, // addy knife
			    23, // addy thrownaxe
			    12, // barbed bolts
			    75, // black bolts
			    6, // black dart
			    8, // black knife
			    28, // blurite bolt
			    55, // bolt rack
			    49, // bone bolts
			    100, // broad tipped bolts
			    7, // bronze arrow
			    10, // bronze bolts
			    1, // bronze dart
			    6, // bronze jav
			    3, // bronze knife
			    5, // bronze thrownaxe
			    70, // full crystal bow
			    145, // corrupt morr jav
			    117, // corrupt morr thrownaxe
			    105, // diamond bolt
			    60, // dragon arrow
			    117, // dragon bolts
			    20, // dragon dart
			    85, // emerald bolts
			    16, // guam tar
			    49, // harralander tar
			    16, // ice arrows
			    10, // iron arrows
			    46, // iron bolts
			    3, // iron dart
			    10, // iron javelin
			    4, // iron knife
			    7, // iron thrownaxe
			    28, // kebbit bolts
			    38, // long kebbit bolts
			    22, // mith arrow
			    82, // mith bolts
			    7, // mithril dart
			    18, // mithril javelin
			    10, // mith knife
			    16, // mith thrownaxe
			    145, // morrigans javelin
			    117, // morrigans thrownaxe
			    22, // ogre arrow
			    120, // onyx bolts
			    48, // pearl bolts
			    15, // red chinchompa
			    103, // ruby bolts
			    49, // rune arrow
			    14, // rune dart
			    42, // rune javelin
			    24, // rune knife
			    36, // rune thrownaxe
			    115, // rune bolts
			    83, // sapphire bolts
			    36, // silver bolts
			    16, // steel arrow
			    64, // steel bolts
			    4, // steel dart
			    12, // steel javelin
			    7, // steel knife
			    11, // steel thrownaxe
			    31, // tarromin tar
			    49, // obsidian ring
			    66, // topaz bolts
			    7, // training arrows
			    10, // opal bolts
			    10, // opal bolts (e)
			    28, // jade bolts
			    28, // jade bolts (e)
			    46, // pearl bolts(e)
			    64, // topaz bolts (e)
			    82, // emerald bolts (e)
			    82, // sapphire bolts (e)
			    100, // ruby bolts (e)
			    100, // diamond bolts (e)
			    117, // dragon bolts (e)
			    115, // onyx bolts (e)
			    }
		    };
		    for (int i = 0; i < items[1].Length; i++) {
                if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == items[0][i])
                {
				    return items[1][i];
			    }
		    }
            for (int i = 0; i < items[1].Length; i++)
            {
                if (p.getEquipment().getItemInSlot(ItemData.EQUIP.ARROWS) == items[0][i])
                {
				    return items[1][i];
			    }
		    }
		    return 0;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:101,代码来源:CombatFormula.cs

示例14: getRangeMaxHit

	    public static double getRangeMaxHit(Player p, int bow, int arrow) {
            /*
            int a = p.getEquipment().getBonus(Equipment.BONUS.CRUSH_ATTACK);
            int b = p.getEquipment().getBonus(Equipment.BONUS.CRUSH_DEFENCE);
            int c = p.getEquipment().getBonus(Equipment.BONUS.MAGIC_ATTACK);
            int d = p.getEquipment().getBonus(Equipment.BONUS.MAGIC_DEFENCE);
            int e = p.getEquipment().getBonus(Equipment.BONUS.PRAYER);
            int f = p.getEquipment().getBonus(Equipment.BONUS.RANGED_ATTACK);
            int g = p.getEquipment().getBonus(Equipment.BONUS.RANGED_DEFENCE);
            int h = p.getEquipment().getBonus(Equipment.BONUS.SLASH_ATTACK);
            int i = p.getEquipment().getBonus(Equipment.BONUS.SLASH_DEFENCE);
            int j = p.getEquipment().getBonus(Equipment.BONUS.STAB_ATTACK);
            int k = p.getEquipment().getBonus(Equipment.BONUS.STAB_DEFENCE);
            int l = p.getEquipment().getBonus(Equipment.BONUS.STRENGTH);
            int m = p.getEquipment().getBonus(Equipment.BONUS.SUMMONING);
            */

            double rangeLevel = p.getSkills().getCurLevel(Skills.SKILL.RANGE);
            //TODO: use rangeAttackBonus in the formula somehow!.
            double rangeAttackBonus = p.getEquipment().getBonus(Equipment.BONUS.RANGED_ATTACK);
		    double rangeAttackMultipler = 1.00;
		    double rangeAttack = 0;
            int rangedWeaponArrowStrength = getRangeWeaponArrowStrength(p);
		    int rangePrayer = p.getPrayers().getRangePrayer();

            if (rangePrayer == 1)
                rangeAttackMultipler *= 1.05; //5% increase
            else if (rangePrayer == 2)
                rangeAttackMultipler *= 1.10; //10% increase
            else if (rangePrayer == 3)
                rangeAttackMultipler *= 1.15; //15% increase

		    if (wearingRangeVoid(p)) {
                rangeAttackMultipler *= 1.15; //15% increase
		    }
            rangeAttack = (rangeLevel * rangeAttackMultipler);
		    if (p.getAttackStyle().getStyle().Equals(AttackStyle.CombatStyle.RANGE_ACCURATE)) {
                rangeAttack += 3.00;
		    }
            double rangeMaxHit = ((rangeAttack + 8) * (rangedWeaponArrowStrength + 64) / 640);
            return rangeMaxHit;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:42,代码来源:CombatFormula.cs

示例15: getMagicAttack

	    private static double getMagicAttack(Player p) {
            int magicAttackBonus = 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 (magicAttackBonus >= 80)  // equivalent of max mage w/ zerker+whip
			    amount = 0.0500;
            else if (magicAttackBonus >= 90) // equivalent of max mage w/whip or mystic + ancient staff
			    amount = 0.0780;
            else if (magicAttackBonus >= 105) // equivalent of max mage w/ ancient staff
			    amount = 0.920;
            else if (magicAttackBonus >= 115) // equivalent of max mage w/ wand or better
			    amount = 0.1110;
            power *= (magicAttackBonus * amount) + (magicLevel *= 0.0120);
		    int magicPrayer = p.getPrayers().getMagicPrayer();
            if (magicPrayer > 0)
            {
                if (magicPrayer == 1)
				    power *= 1.05; //5% increase
                else if (magicPrayer == 2)
				    power *= 1.10; //10% increase
                else if (magicPrayer == 3)
				    power *= 1.15; //15% increase
		    }
		    return power;
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:26,代码来源:CombatFormula.cs


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