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


C# GamePlayer.GetCraftingSkillValue方法代码示例

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


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

示例1: GainCraftingSkillPoints

		/// <summary>
		/// Gain a point in the appropriate skills for a recipe and materials
		/// </summary>
		public override void GainCraftingSkillPoints(GamePlayer player, DBCraftedItem recipe, IList<DBCraftedXItem> rawMaterials)
		{
			if (Util.Chance(CalculateChanceToGainPoint(player, recipe)))
			{
                if (player.GetCraftingSkillValue(eCraftingSkill.MetalWorking) < subSkillCap)
                    player.GainCraftingSkill(eCraftingSkill.MetalWorking, 1);

				player.Out.SendUpdateCraftingSkills();
			}
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:13,代码来源:MetalWorking.cs

示例2: Interact

		public override bool Interact(GamePlayer player)
		{
			if(base.Interact(player))
			{
				/* Get primary crafting skill (if any) */
				int CraftSkill = 0;
				if (player.CraftingPrimarySkill != eCraftingSkill.NoCrafting)
					CraftSkill = player.GetCraftingSkillValue(player.CraftingPrimarySkill);

				/* Check if level and/or crafting skill let you have a lastname */
				if (player.Level < LastnameCommandHandler.LASTNAME_MIN_LEVEL && CraftSkill < LastnameCommandHandler.LASTNAME_MIN_CRAFTSKILL)
					SayTo(player, eChatLoc.CL_SystemWindow, LanguageMgr.GetTranslation(player.Client, "NameRegistrar.ReturnToMe", LastnameCommandHandler.LASTNAME_MIN_LEVEL));
				else
                    SayTo(player, eChatLoc.CL_SystemWindow, LanguageMgr.GetTranslation(player.Client, "NameRegistrar.LastName"));
                return true;
			}
			return false;
		}
开发者ID:boscorillium,项目名称:dol,代码行数:18,代码来源:NameRegistrar.cs

示例3: GetMaterialYield

		/// <summary>
		/// Return the material yield for this salvage.
		/// </summary>
		public static int GetMaterialYield(GamePlayer player, InventoryItem item, SalvageYield salvageYield, ItemTemplate rawMaterial)
		{
            int maxCount = 0;

			if (rawMaterial == null)
				return 0;

			if (ServerProperties.Properties.USE_NEW_SALVAGE)
			{
				maxCount = GetCountForSalvage(item, salvageYield, rawMaterial);
			}
			else
			{
				maxCount = (int)(item.Price * 0.45 / rawMaterial.Price); // crafted item return max 45% of the item value in material

				if (item.IsCrafted)
				{
					maxCount = (int)Math.Ceiling((double)maxCount / 2);
				}
			}

			int playerPercent = player.GetCraftingSkillValue(CraftingMgr.GetSecondaryCraftingSkillToWorkOnItem(item)) * 100 / CraftingMgr.GetItemCraftLevel(item);

			if (playerPercent > 100)
			{
				playerPercent = 100;
			}
			else if (playerPercent < 75)
			{
				playerPercent = 75;
			}

			int minCount = (int)(((maxCount - 1) / 25f) * playerPercent) - ((3 * maxCount) - 4); //75% => min = 1; 100% => min = maxCount;

			salvageYield.Count = Util.Random(minCount, maxCount);
			return salvageYield.Count;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:40,代码来源:Salvage.cs

示例4: IsAllowedToBeginWork

		/// <summary>
		/// Check if the player can begin to salvage an item
		/// </summary>
		/// <param name="player"></param>
		/// <param name="item"></param>
		/// <returns></returns>
		public static bool IsAllowedToBeginWork(GamePlayer player, InventoryItem item)
		{
			if (player.InCombat)
			{
				player.Out.SendMessage("You can't salvage while in combat.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return false;
			}

			if (item.IsNotLosingDur || item.IsIndestructible)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Salvage.BeginWork.NoSalvage", item.Name + ".  This item is indestructible"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return false;
			}

			// using negative numbers to indicate item cannot be salvaged
			if (item.SalvageYieldID < 0)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "Salvage.BeginWork.NoSalvage", item.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return false;
			}
			
			if(item.SlotPosition < (int)eInventorySlot.FirstBackpack || item.SlotPosition > (int)eInventorySlot.LastBackpack)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Salvage.IsAllowedToBeginWork.BackpackItems"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return false;
			}

			eCraftingSkill skill = CraftingMgr.GetSecondaryCraftingSkillToWorkOnItem(item);
			if(skill == eCraftingSkill.NoCrafting)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Salvage.BeginWork.NoSalvage", item.Name + ".  You do not have the required secondary skill"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return false;
			}

			if (player.IsCrafting)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Salvage.IsAllowedToBeginWork.EndCurrentAction"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return false;
			}

			if (player.GetCraftingSkillValue(skill) < (0.75 * CraftingMgr.GetItemCraftLevel(item)))
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Salvage.IsAllowedToBeginWork.NotEnoughSkill", item.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return false;
			}

			return true;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:54,代码来源:Salvage.cs

示例5: GetQuality

		/// <summary>
		/// Calculate crafted item quality
		/// </summary>
		private int GetQuality(GamePlayer player, DBCraftedItem item)
		{
			// 2% chance to get masterpiece, 1:6 chance to get 94-99%, if legendary or if grey con
			// otherwise moving the most load towards 94%, the higher the item con to the crafter skill
			//1.87 patch raises min quality to 96%

			// legendary
			if (player.GetCraftingSkillValue(m_eskill) >= 1000)
			{
				if (Util.Chance(2))
				{
					return 100;	// 2% chance for master piece
				}
				return 96 + Util.Random(3);
			}

			int delta = GetItemCon(player.GetCraftingSkillValue(m_eskill), item.CraftingLevel);
			if (delta < -2)
			{
				if (Util.Chance(2))
					return 100; // grey items get 2% chance to be master piece
				return 96 + Util.Random(3); // handle grey items like legendary
			}

			// this is a type of roulette selection, imagine a roulette wheel where all chances get different sized
			// fields where the ball can drop, the bigger the field, the bigger the chance
			// field size is modulated by item con and can be also 0

			// possible chance allocation scheme for yellow item
			// 99:
			// 98:
			// 97: o
			// 96: oo
			// where one 'o' marks 100 size, this example results in 10% chance for yellow items to be 97% quality

			delta = delta * 100;

			int[] chancePart = new int[4]; // index ranges from 96%(0) to 99%(5)
			int sum = 0;
			for (int i = 0; i < 4; i++)
			{
				chancePart[i] = Math.Max((4 - i) * 100 - delta, 0);	// 0 minimum
				sum += chancePart[i];
			}

			// selection
			int rand = Util.Random(sum);
			for (int i = 3; i >= 0; i--)
			{
				if (rand < chancePart[i])
					return 96 + i;
				rand -= chancePart[i];
			}

			// if something still not clear contact Thrydon/Blue

			return 96;
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:61,代码来源:AbstractCraftingSkill.cs

示例6: GetCraftingTime

		/// <summary>
		/// Calculate crafting time
		/// </summary>
		public virtual int GetCraftingTime(GamePlayer player, DBCraftedItem recipe, IList<DBCraftedXItem> rawMaterials)
		{
			double baseMultiplier = (recipe.CraftingLevel / 100) + 1;

			ushort materialsCount = 0;
			foreach (DBCraftedXItem material in rawMaterials)
			{
				materialsCount += (ushort)material.Count;
			}

			int craftingTime = (int)(baseMultiplier * materialsCount / 4);

			// Player does check for capital city bonus as well
			craftingTime = (int)(craftingTime / player.CraftingSpeed);

			//keep bonuses reduction in crafting time
			if (Keeps.KeepBonusMgr.RealmHasBonus(DOL.GS.Keeps.eKeepBonusType.Craft_Timers_5, (eRealm)player.Realm))
				craftingTime = (int)(craftingTime / 1.05);
			else if (Keeps.KeepBonusMgr.RealmHasBonus(DOL.GS.Keeps.eKeepBonusType.Craft_Timers_3, (eRealm)player.Realm))
				craftingTime = (int)(craftingTime / 1.03);

			int con = GetItemCon(player.GetCraftingSkillValue(m_eskill), recipe.CraftingLevel);
			double mod = 1.0;
			switch (con)
			{
				case -3:
					mod = 0.4;
					break;
				case -2:
					mod = 0.6;
					break;
				case -1:
					mod = 0.8;
					break;
				case 0:
					mod = 1.0;
					break;
				case 1:
					mod = 1.0;
					break;
				case 2:
					mod = 1.0;
					break;
				case 3:
					mod = 1.0;
					break;
			}

			craftingTime = (int)(craftingTime * mod);

			if (craftingTime < 1)
				craftingTime = 1;
			return craftingTime;
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:57,代码来源:AbstractCraftingSkill.cs

示例7: PreFireChecks

		public bool PreFireChecks(GamePlayer player, GameLiving obj)
		{
			if (obj == null)
				return false;
			if (player.Realm != obj.Realm)
				return false;

			if (player.Client.Account.PrivLevel > (int)ePrivLevel.Player)
				return true;

			if ((obj as GameLiving).InCombat)
			{
				DisplayMessage(player, "You can't repair object while it is under attack!");
				return false;
			}
            if (obj is GameKeepDoor)
            {
                GameKeepDoor doorcomponent = obj as GameKeepDoor;
                if (doorcomponent.Component.AbstractKeep.InCombat)
                {
                    DisplayMessage(player, "You can't repair the keep door while keep is under attack!");
                    return false;
                }
            }
			if (obj is IKeepItem)
			{
				if (obj.CurrentRegion.Time - obj.LastAttackedByEnemyTick <= 60 * 1000)
				{
					DisplayMessage(player, "You can't repair the keep component while it is under attack!");
					return false;
				}
			}

			if ((obj as GameLiving).HealthPercent == 100)
			{
				DisplayMessage(player, "The component is already at full health!");
				return false;
			}
			if (obj is GameKeepComponent)
			{
				GameKeepComponent component = obj as GameKeepComponent;
				if (component.IsRaized)
				{
					DisplayMessage(player, "You cannot repair a raized tower!");
					return false;
				}
			}

			if (player.IsCrafting)
			{
				DisplayMessage(player, "You must end your current action before you repair anything!");
				return false;
			}
			if (player.IsMoving)
			{
				DisplayMessage(player, "You can't repair while moving");
				return false;
			}

			if (!player.IsAlive)
			{
				DisplayMessage(player, "You can't repair while dead.");
				return false;
			}

			if (player.IsSitting)
			{
				DisplayMessage(player, "You can't repair while sitting.");
				return false;
			}

			if (player.InCombat)
			{
				DisplayMessage(player, "You can't repair while in combat.");
				return false;
			}

			if (!player.IsWithinRadius(obj, WorldMgr.INTERACT_DISTANCE))
			{
				DisplayMessage(player, "You are too far away to repair this component.");
				return false;
			}

			int repairamount = (GetTotalWoodForLevel(obj.Level) / 100) * 15;
			int playerswood = CalculatePlayersWood(player, 0);

			if (playerswood < repairamount)
			{
				DisplayMessage(player, "You need another " + (repairamount - playerswood) + " units of wood!");
				return false;
			}

			if (player.GetCraftingSkillValue(eCraftingSkill.WoodWorking) < 1)
			{
				DisplayMessage(player, "You need woodworking skill to repair.");
				return false;
			}

			player.Stealth(false);

//.........这里部分代码省略.........
开发者ID:mynew4,项目名称:DOLSharp,代码行数:101,代码来源:Repair.cs

示例8: CalculateChanceToOverchargeItem

		/// <summary>
        /// Get the sucess chance to overcharge the item
		/// </summary>
		/// <param name="player"></param>
		/// <param name="item"></param>
		/// <param name="maxBonusLevel"></param>
		/// <param name="bonusLevel"></param>
		/// <returns></returns>
		protected int CalculateChanceToOverchargeItem(GamePlayer player, InventoryItem item, int maxBonusLevel, int bonusLevel)
		{
            // Luhz Crafting Update:
            // Overcharge success rate is now dependent only on item quality, points overcharged, and spellcrafter skill.
            // This formula is taken from Kort's Spellcrafting Calculator, which appears to be correct (for 1.87). Much Thanks!
            if(bonusLevel - maxBonusLevel > 5) return 0;
            if(bonusLevel - maxBonusLevel < 0) return 100;

            try {
            int success = 34 + ItemQualOCModifiers[item.Quality - 94];
            success -= OCStartPercentages[bonusLevel-maxBonusLevel];
            int skillbonus = (player.GetCraftingSkillValue(eCraftingSkill.SpellCrafting) / 10);
            if (skillbonus > 100) 
                skillbonus = 100;
            success += skillbonus;
            int fudgefactor = (int)(100.0 * ((skillbonus / 100.0 - 1.0) * (OCStartPercentages[bonusLevel-maxBonusLevel] / 200.0)));
            success += fudgefactor;
            if (success > 100)
                success = 100;
            return success;
            }
            catch(Exception)
            {
                // Array access exception: someone is trying to imbue 100 < item.Quality < 94
                // Probably a GM or someone testing; I suppose we should just let them.
                return 100;
            }

            
		}
开发者ID:boscorillium,项目名称:dol,代码行数:38,代码来源:SpellCrafting.cs

示例9: CheckSecondCraftingSkillRequirement

		/// <summary>
		/// Check if the player has enough secondary crafting skill to build the item
		/// </summary>
		/// <param name="player"></param>
		/// <param name="recipe"></param>
		/// <returns></returns>
		public virtual bool CheckSecondCraftingSkillRequirement(GamePlayer player, DBCraftedItem recipe, ItemTemplate itemToCraft, IList<DBCraftedXItem> rawMaterials)
		{
			int minimumLevel = GetSecondaryCraftingSkillMinimumLevel(recipe, itemToCraft);

			if (minimumLevel <= 0)
				return true; // no requirement needed

			foreach (DBCraftedXItem material in rawMaterials)
			{
				ItemTemplate template = GameServer.Database.FindObjectByKey<ItemTemplate>(material.IngredientId_nb);

				if (template == null)
				{
					player.Out.SendMessage("Can't find a material (" + material.IngredientId_nb + ") needed for recipe.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
					log.Error("Cannot find raw material ItemTemplate: " + material.IngredientId_nb + ") needed for recipe: " + recipe.CraftedItemID);
					return false;
				}

				switch (template.Model)
				{
					case 522:	//"cloth square"
					case 537:	//"heavy thread"
						{
							if (player.GetCraftingSkillValue(eCraftingSkill.ClothWorking) < minimumLevel)
							{
								player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AbstractCraftingSkill.CheckSecondCraftingSkillRequirement.NoClothworkingSkill", minimumLevel, template.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
								return false;
							}
							break;
						}

					case 521:	//"leather square"
						{
							if (player.GetCraftingSkillValue(eCraftingSkill.LeatherCrafting) < minimumLevel)
							{
								player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AbstractCraftingSkill.CheckSecondCraftingSkillRequirement.NoLeathercraftingSkill", minimumLevel, template.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
								return false;
							}
							break;
						}

					case 519:	//"metal bars"
						{
							if (player.GetCraftingSkillValue(eCraftingSkill.MetalWorking) < minimumLevel)
							{
								player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AbstractCraftingSkill.CheckSecondCraftingSkillRequirement.NoMetalworkingSkill", minimumLevel, template.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
								return false;
							}
							break;
						}

					case 520:	//"wooden boards"
						{
							if (player.GetCraftingSkillValue(eCraftingSkill.WoodWorking) < minimumLevel)
							{
								player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AbstractCraftingSkill.CheckSecondCraftingSkillRequirement.NoWoodworkingSkill", minimumLevel, template.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
								return false;
							}
							break;
						}
				}
			}
			return true;
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:70,代码来源:AbstractCraftingSkill.cs

示例10: CalculateSuccessChances

		/// <summary>
		/// Calculate the chance of sucess
		/// </summary>
		protected static int CalculateSuccessChances(GamePlayer player, GameSiegeWeapon siegeWeapon)
		{
			player.GetCraftingSkillValue(eCraftingSkill.WoodWorking);
			int chancePercent = 90 - 50 / player.GetCraftingSkillValue(eCraftingSkill.WoodWorking);

			if (chancePercent > 100)
				chancePercent = 100;
			else if (chancePercent < 0)
				chancePercent = 0;
			return chancePercent;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:14,代码来源:Repair.cs

示例11: GenerateNPCItem

		/// <summary>
		/// Generate an Item random Named for NPC Drop
		/// </summary>
		/// <param name="player">Level of Generated Item</param>
		/// <returns>A Generated NPC Item</returns>
		public static ItemTemplate GenerateNPCItem(GamePlayer player)
		{
			int mediumCraftingLevel = player.GetCraftingSkillValue(player.CraftingPrimarySkill) + 20;
			int lowLevel = mediumCraftingLevel - 20;
			int highLevel = mediumCraftingLevel + 20;

			var craftitem = GameServer.Database.SelectObjects<DBCraftedItem>("`CraftingSkillType` = @CraftingSkillType AND `CraftingLevel` > @CraftingLevelLow AND `CraftingLevel` < @CraftingLevelHigh", new[] { new QueryParameter("@CraftingSkillType", (int)player.CraftingPrimarySkill), new QueryParameter("@CraftingLevelLow", lowLevel), new QueryParameter("@CraftingLevelHigh", highLevel) });
			int craftrnd = Util.Random(craftitem.Count);

			ItemTemplate template = GameServer.Database.FindObjectByKey<ItemTemplate>(craftitem[craftrnd].Id_nb);
			return template;
		}
开发者ID:dol-leodagan,项目名称:DOLSharp,代码行数:17,代码来源:CraftTask.cs

示例12: IsAllowedToBeginWork

		/// <summary>
		/// Check if the player own can enchant the item
		/// </summary>
		/// <param name="player"></param>
		/// <param name="siegeWeapon"></param>
		/// <param name="percentNeeded">min 50 max 100</param>
		/// <returns></returns>
		public static bool IsAllowedToBeginWork(GamePlayer player, GameSiegeWeapon siegeWeapon, int percentNeeded)
		{
			if (player.GetCraftingSkillValue(eCraftingSkill.WeaponCrafting) < 301)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Repair.IsAllowedToBeginWork.WeaponCrafter"), eChatType.CT_Say, eChatLoc.CL_SystemWindow);
				return false;
			}

			if (player.IsCrafting)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Repair.IsAllowedToBeginWork.EndCurrentAction"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return false;
			}

			if (siegeWeapon.Health >= siegeWeapon.MaxHealth)
			{
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Repair.IsAllowedToBeginWork.FullyRepaired", siegeWeapon.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
				return false;
			}
			return true;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:28,代码来源:Repair.cs

示例13: IsAllowedToCombine

		/// <summary>
		/// This function is called when player accept the combine
		/// </summary>
		/// <param name="player"></param>
		/// <param name="item"></param>
		public override bool IsAllowedToCombine(GamePlayer player, InventoryItem item)
		{
			if (!base.IsAllowedToCombine(player, item)) return false;

			if (((InventoryItem)player.TradeWindow.TradeItems[0]).Model == 525) // first ingredient to combine is Dust => echantement
			{
				if (item.Level < 15)
				{
					player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, 
						"SpellCrafting.IsAllowedToCombine.NoEnchanted"), eChatType.CT_System, 
						eChatLoc.CL_SystemWindow);

					return false;
				}

				lock (player.TradeWindow.Sync)
				{
					foreach (InventoryItem materialToCombine in player.TradeWindow.TradeItems)
					{
						if (materialToCombine.Model != 525)
						{
							player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, 
								"SpellCrafting.IsAllowedToCombine.FalseMaterial", 
								materialToCombine.Name), 
								eChatType.CT_System, eChatLoc.CL_SystemWindow);

							return false;
						}
					}
				}
			}
			else
			{
				ArrayList bonusToApply = new ArrayList(4);
				if (item.Bonus1Type != 0)
				{
					bonusToApply.Add(item.Bonus1Type);
					if (item.Bonus2Type != 0)
					{
						bonusToApply.Add(item.Bonus2Type);
						if (item.Bonus3Type != 0)
						{
							bonusToApply.Add(item.Bonus3Type);
							if (item.Bonus4Type != 0)
							{
								player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "SpellCrafting.IsAllowedToCombine.AlreadyImbued", item.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
								return false;
							}
						}
					}
				}

				lock (player.TradeWindow.Sync)
				{
					for (int i = 0; i < player.TradeWindow.ItemsCount; i++)
					{
						InventoryItem currentItem = (InventoryItem)player.TradeWindow.TradeItems[i];

						if (currentItem.Object_Type != (int)eObjectType.SpellcraftGem)
						{
							player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "SpellCrafting.IsAllowedToCombine.FalseItem"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
							return false;
						}

						if (bonusToApply.Contains(currentItem.Bonus1Type))
						{
							player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "SpellCrafting.IsAllowedToCombine.NoSameBonus"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
							return false;
						}

						if (bonusToApply.Count >= 4)
						{
							player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "SpellCrafting.IsAllowedToCombine.DifferentTypes", item.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
							return false;
						}

						bonusToApply.Add(currentItem.Bonus1Type);
					}
				}

				int bonusLevel = GetTotalImbuePoints(player, item);
				if (bonusLevel > player.GetCraftingSkillValue(eCraftingSkill.SpellCrafting) / 20)
				{
					player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "SpellCrafting.IsAllowedToCombine.NotEnoughSkill"), eChatType.CT_System, eChatLoc.CL_SystemWindow);
					return false;
				}

				if (bonusLevel - GetItemMaxImbuePoints(item) > 5)
				{
					player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "SpellCrafting.IsAllowedToCombine.NoMoreLevels", item.Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
					return false;
				}
			}

			return true;
//.........这里部分代码省略.........
开发者ID:boscorillium,项目名称:dol,代码行数:101,代码来源:SpellCrafting.cs

示例14: GainCraftingSkillPoints

		/// <summary>
		/// Gain a point in the appropriate skills for a recipe and materials
		/// </summary>
		public virtual void GainCraftingSkillPoints(GamePlayer player, DBCraftedItem recipe, IList<DBCraftedXItem> rawMaterials)
		{
			foreach (DBCraftedXItem material in rawMaterials)
			{
				ItemTemplate template = GameServer.Database.FindObjectByKey<ItemTemplate>(material.IngredientId_nb);

				if (template != null)
				{
					switch (template.Model)
					{
						case 522:	//"cloth square"
						case 537:	//"heavy thread"
							{
								if (player.GetCraftingSkillValue(eCraftingSkill.ClothWorking) < subSkillCap)
								{
									player.GainCraftingSkill(eCraftingSkill.ClothWorking, 1);
								}
								break;
							}

						case 521:	//"leather square"
							{
								if (player.GetCraftingSkillValue(eCraftingSkill.LeatherCrafting) < subSkillCap)
								{
									player.GainCraftingSkill(eCraftingSkill.LeatherCrafting, 1);
								}
								break;
							}

						case 519:	//"metal bars"
							{
								if (player.GetCraftingSkillValue(eCraftingSkill.MetalWorking) < subSkillCap)
								{
									player.GainCraftingSkill(eCraftingSkill.MetalWorking, 1);
								}
								break;
							}

						case 520:	//"wooden boards"
							{
								if (player.GetCraftingSkillValue(eCraftingSkill.WoodWorking) < subSkillCap)
								{
									player.GainCraftingSkill(eCraftingSkill.WoodWorking, 1);
								}
								break;
							}
					}
				}
			}

			player.Out.SendUpdateCraftingSkills();
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:55,代码来源:AbstractCraftingSkill.cs

示例15: ApplyMagicalDusts

		/// <summary>
		/// Apply all magical dust
		/// </summary>
		/// <param name="player"></param>
		/// <param name="item"></param>
		/// <returns></returns>
		private void ApplyMagicalDusts(GamePlayer player, InventoryItem item)
		{
			int spellCrafterLevel = player.GetCraftingSkillValue(eCraftingSkill.SpellCrafting);

			int bonusCap;
			if (spellCrafterLevel < 300 || item.Level < 15) bonusCap = 0;
			else if (spellCrafterLevel < 400 || item.Level < 20) bonusCap = 5;
			else if (spellCrafterLevel < 500 || item.Level < 25) bonusCap = 10;
			else if (spellCrafterLevel < 600 || item.Level < 30) bonusCap = 15;
			else if (spellCrafterLevel < 700 || item.Level < 35) bonusCap = 20;
			else if (spellCrafterLevel < 800 || item.Level < 40) bonusCap = 25;
			else if (spellCrafterLevel < 900 || item.Level < 45) bonusCap = 30;
			else bonusCap = 35;

			player.Inventory.BeginChanges();

			int bonusMod = item.Bonus;
			lock (player.TradeWindow.Sync)
			{
				foreach (InventoryItem gemme in player.TradeWindow.TradeItems)
				{
					switch (gemme.Name)
					{
						case "coppery imbued dust": bonusMod += 2; break;
						case "coppery enchanted dust": bonusMod += 4; break;
						case "coppery glowing dust": bonusMod += 6; break;
						case "coppery ensorcelled dust": bonusMod += 8; break;

						case "silvery imbued dust": bonusMod += 10; break;
						case "silvery enchanted dust": bonusMod += 12; break;
						case "silvery glowing dust": bonusMod += 14; break;
						case "silvery ensorcelled dust": bonusMod += 16; break;

						case "golden imbued dust": bonusMod += 18; break;
						case "golden enchanted dust": bonusMod += 20; break;
						case "golden glowing dust": bonusMod += 22; break;
						case "golden ensorcelled dust": bonusMod += 24; break;

						case "mithril imbued dust": bonusMod += 26; break;
						case "mithril enchanted dust": bonusMod += 28; break;
						case "mithril glowing dust": bonusMod += 30; break;
						case "mithril ensorcelled dust": bonusMod += 32; break;

						case "platinum imbued dust": bonusMod += 34; break;
						case "platinum enchanted dust": bonusMod += 36; break;
						case "platinum glowing dust": bonusMod += 38; break;
						case "platinum ensorcelled dust": bonusMod += 40; break;

					}
					player.Inventory.RemoveCountFromStack(gemme, 1);
					InventoryLogging.LogInventoryAction(player, "(craft)", eInventoryActionType.Craft, gemme.Template);
				}
			}

			item.Bonus = Math.Min(bonusMod, bonusCap);

			player.Inventory.CommitChanges();
		}
开发者ID:boscorillium,项目名称:dol,代码行数:64,代码来源:SpellCrafting.cs


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