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


C# Creature.Bless方法代码示例

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


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

示例1: Complete

		public void Complete(Creature creature, Skill skill, Packet packet)
		{
			var itemEntityId = packet.GetLong();
			var hwEntityId = packet.GetLong();

			var item = creature.Inventory.GetItemSafe(itemEntityId);
			var hw = creature.Inventory.GetItemSafe(hwEntityId);
			var isHolyWater = (hw.Info.Id == 63016); // There's only one item using this skill.

			// TODO: Check loading time

			if (item.IsBlessable && isHolyWater)
			{
				creature.Inventory.Decrement(hw, 1);
				creature.Bless(item);
			}
			else
				Log.Warning("Blessing.Complete: Invalid item or Holy Water.");

			Send.UseMotion(creature, 14, 0);
			Send.SkillComplete(creature, skill.Info.Id, itemEntityId, hwEntityId);
		}
开发者ID:aura-project,项目名称:aura,代码行数:22,代码来源:Blessing.cs

示例2: Complete

		public void Complete(Creature creature, Skill skill, Packet packet)
		{
			var str = packet.GetString();
			var dict = new MabiDictionary(str);

			var hwEntityId = dict.GetLong("ITEMID");
			if (hwEntityId == 0)
				goto L_End;

			var hw = creature.Inventory.GetItemSafe(hwEntityId);
			if (!hw.HasTag("/large_blessing_potion/"))
				goto L_End;

			// TODO: Check loading time

			var items = creature.Inventory.GetEquipment(a => a.IsBlessable);
			creature.Bless(items);
			creature.Inventory.Decrement(hw, 1);

		L_End:
			Send.UseMotion(creature, 14, 0);
			Send.SkillComplete(creature, skill.Info.Id, str);
		}
开发者ID:aura-project,项目名称:aura,代码行数:23,代码来源:BigBlessingWaterKit.cs

示例3: Touch

		/// <summary>
		/// Applies random fountain effect to creature.
		/// </summary>
		/// <param name="creature"></param>
		protected virtual void Touch(Creature creature)
		{
			var rnd = RandomProvider.Get();

			// All notices are unofficial

			switch (rnd.Next(15))
			{
				case 0: // Full Life
					{
						creature.FullLifeHeal();
						Send.Notice(creature, Localization.Get("Full Life"));
						break;
					}

				case 1: // 0 Injuries
					{
						creature.Injuries = 0;
						Send.StatUpdateDefault(creature);
						Send.Notice(creature, Localization.Get("No Injuries"));
						break;
					}

				case 2: // Full Stamina
					{
						creature.Stamina = creature.StaminaMax;
						Send.StatUpdateDefault(creature);
						Send.Notice(creature, Localization.Get("Full Stamina"));
						break;
					}

				case 3: // Full Mana
					{
						creature.Mana = creature.ManaMax;
						Send.StatUpdateDefault(creature);
						Send.Notice(creature, Localization.Get("Full Mana"));
						break;
					}

				case 4: // No Hunger
					{
						creature.Hunger = 0;
						Send.StatUpdateDefault(creature);
						Send.Notice(creature, Localization.Get("No Hunger"));
						break;
					}

				case 5: // Gold
					{
						creature.GiveItem(Item.CreateGold(rnd.Next(100, 200 + 1)));
						Send.Notice(creature, Localization.Get("Gold"));
						break;
					}

				case 6: // Exp
					{
						creature.GiveExp(1000);
						Send.Notice(creature, Localization.Get("Exp"));
						break;
					}

				case 7: // Bless All
					{
						var items = creature.Inventory.GetEquipment(a => a.IsBlessable);
						creature.Bless(items);
						Send.Notice(creature, Localization.Get("Blessed All"));
						break;
					}

				case 8: // Bless One
					{
						var equip = creature.Inventory.GetEquipment(a => !a.IsBlessed && a.IsBlessable);
						var count = equip.Count();

						if (count == 0)
							break;

						var item = equip.ElementAt(rnd.Next(count));
						creature.Bless(item);

						Send.Notice(creature, Localization.Get("Blessed {0}"), item.Data.Name);
						break;
					}

				case 9: // Repair One
					{
						var equip = creature.Inventory.GetEquipment(a => a.OptionInfo.Durability != a.OptionInfo.DurabilityMax);
						var count = equip.Count();

						if (count == 0)
							break;

						var item = equip.ElementAt(rnd.Next(count));
						item.OptionInfo.Durability = item.OptionInfo.DurabilityMax;
						Send.ItemDurabilityUpdate(creature, item);

//.........这里部分代码省略.........
开发者ID:aura-project,项目名称:aura,代码行数:101,代码来源:Fountain.cs


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