Aura.Channel.World.Entities.Creature.Lock C# (CSharp) Метод

Lock() публичный Метод

Activates given Locks for creature.
Some locks are lifted automatically on Warp, SkillComplete, and SkillCancel. Only sending the locks when they actually changed can cause problems, e.g. if a lock is removed during a cutscene (skill running out) the unlock after the cutscene isn't sent. The client actually has counted locks, unlike us atm. Implementing those will fix the problem. TODO.
public Lock ( Locks locks, bool updateClient = false ) : Locks
locks Locks Locks to activate.
updateClient bool Sends CharacterLock to client if true.
Результат Locks
		public Locks Lock(Locks locks, bool updateClient = false)
		{
			var prev = this.Locks;
			this.Locks |= locks;

			if (updateClient /*&& prev != this.Locks*/)
				Send.CharacterLock(this, locks);

			return this.Locks;
		}

Usage Example

Пример #1
0
		/// <summary>
		/// Prepares skill.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			Send.SkillFlashEffect(creature);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			creature.Lock(Locks.Run);

			return true;
		}
All Usage Examples Of Aura.Channel.World.Entities.Creature::Lock