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


C# GamePlayer.RefreshSpecDependantSkills方法代码示例

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


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

示例1: PromotePlayer

		/// <summary>
		/// Called to promote a player
		/// </summary>
		/// <param name="player">the player to promote</param>
		/// <param name="classid">the new classid</param>
		/// <param name="messageToPlayer">the message for the player</param>
		/// <param name="gifts">Array of inventory items as promotion gifts</param>
		/// <returns>true if successfull</returns>
		public bool PromotePlayer(GamePlayer player, int classid, string messageToPlayer, InventoryItem[] gifts)
		{

			if (player == null) return false;

			ICharacterClass oldClass = player.CharacterClass;

			// Player was promoted
			if (player.SetCharacterClass(classid))
			{
				player.RemoveAllStyles();
				player.RemoveAllAbilities();
				player.RemoveAllSpellLines();

				if (messageToPlayer != "")
					player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameTrainer.PromotePlayer.Says", this.Name, messageToPlayer), eChatType.CT_System, eChatLoc.CL_PopupWindow);
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameTrainer.PromotePlayer.Upgraded", player.CharacterClass.Name), eChatType.CT_Important, eChatLoc.CL_SystemWindow);

				player.CharacterClass.OnLevelUp(player, player.Level);
				player.RefreshSpecDependantSkills(true);
				player.StartPowerRegeneration();
				player.Out.SendUpdatePlayerSkills();
				player.Out.SendUpdatePlayer();
				// drop any non usable item
				CheckAbilityToUseItem(player);

				// Initiate equipment
				if (gifts != null && gifts.Length > 0)
				{
					for (int i = 0; i < gifts.Length; i++)
					{
						player.ReceiveItem(this, gifts[i]);
					}
				}

				// after gifts
				player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameTrainer.PromotePlayer.Accepted", player.CharacterClass.Profession), eChatType.CT_Important, eChatLoc.CL_SystemWindow);

				Notify(GameTrainerEvent.PlayerPromoted, this, new PlayerPromotedEventArgs(player, oldClass));

				player.SaveIntoDatabase();
				return true;
			}
			return false;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:53,代码来源:GameTrainer.cs

示例2: CallbackRespecMasterLevel

        protected virtual void CallbackRespecMasterLevel(GamePlayer player, byte response)
        {
            // test item
            InventoryItem item = player.TempProperties.getProperty<InventoryItem>("ML_MERCHANT_RESPEC_GIVEN_PROPERTY", null);

            if (response != 0x00 && item != null && player.Inventory.RemoveItem(item))
            {
                player.MLLine = (byte)((player.MLLine + 1) % 2);
                player.RefreshSpecDependantSkills(true);
                player.Out.SendUpdatePlayerSkills();
                player.Out.SendUpdatePlayer();
            }
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:13,代码来源:MasterLevelsMerchant.cs

示例3: RespecDialogResponse

		protected void RespecDialogResponse(GamePlayer player, byte response)
		{

			if (response != 0x01) return; //declined

			int specPoints = 0;
			int realmSpecPoints = 0;

			if (player.TempProperties.getProperty(ALL_RESPEC, false))
			{
				specPoints = player.RespecAll();
				player.TempProperties.removeProperty(ALL_RESPEC);
			}
			if (player.TempProperties.getProperty(DOL_RESPEC, false))
			{
				specPoints = player.RespecDOL();
				player.TempProperties.removeProperty(DOL_RESPEC);
			}
			if (player.TempProperties.getProperty(RA_RESPEC, false))
			{
				realmSpecPoints = player.RespecRealm();
				player.TempProperties.removeProperty(RA_RESPEC);
			}
			if (player.TempProperties.getProperty<object>(LINE_RESPEC, null) != null)
			{
				Specialization specLine = (Specialization)player.TempProperties.getProperty<object>(LINE_RESPEC, null);
				specPoints = player.RespecSingle(specLine);
				player.TempProperties.removeProperty(LINE_RESPEC);
			}
			if (player.TempProperties.getProperty(BUY_RESPEC, false))
			{
				player.TempProperties.removeProperty(BUY_RESPEC);
				if (player.RespecCost >= 0 && player.RemoveMoney(player.RespecCost * 10000))
				{
                    InventoryLogging.LogInventoryAction(player, "(respec)", eInventoryActionType.Merchant, player.RespecCost * 10000);
					player.RespecAmountSingleSkill++;
					player.RespecBought++;
					DisplayMessage(player, "You bought a single line respec!");
				}
				player.Out.SendUpdateMoney();
			}			
			// Assign full points returned
			if (specPoints > 0)
			{
				player.SkillSpecialtyPoints += specPoints;
				player.RemoveAllStyles(); // Kill styles
				player.UpdateSpellLineLevels(false);
				DisplayMessage(player, "You regain " + specPoints + " specialization points!");
			}
			if (realmSpecPoints > 0)
			{
				player.RealmSpecialtyPoints += realmSpecPoints;
				DisplayMessage(player, "You regain " + realmSpecPoints + " realm specialization points!");
			}
			player.RefreshSpecDependantSkills(false);
			// Notify Player of points
			player.Out.SendUpdatePlayerSkills();
			player.Out.SendUpdatePoints();
			player.Out.SendUpdatePlayer();
			player.SendTrainerWindow();
			player.SaveIntoDatabase();
		}
开发者ID:boscorillium,项目名称:dol,代码行数:62,代码来源:respec.cs

示例4: CallbackPathMasterLevel

        protected virtual void CallbackPathMasterLevel(GamePlayer player, byte response)
        {
            int index = player.TempProperties.getProperty<int>("ML_MERCHANT_PATH_CHOSEN_PROPERTY", -1);

            if (response != 0x00 && index != -1 && player.MLGranted && player.MLLevel == 0)
            {
                player.MLLine = (byte)index;
                player.MLLevel = 1;
                player.RefreshSpecDependantSkills(true);
                player.Out.SendUpdatePlayerSkills();
                player.Out.SendUpdatePlayer();
            }
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:13,代码来源:MasterLevelsMerchant.cs


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