Aura.Channel.World.Entities.Prop.SetState C# (CSharp) Method

SetState() public method

Sets prop's state and broadcasts update.
public SetState ( string state ) : void
state string
return void
		public void SetState(string state)
		{
			this.State = state;
			this.UpdateCollisions();
			if (this.Region != Region.Limbo)
				Send.PropUpdate(this);
		}

Usage Example

コード例 #1
0
ファイル: Chest.cs プロジェクト: Vinna/aura
		protected override void DefaultBehavior(Creature creature, Prop prop)
		{
			// Make sure the chest was still closed when it was clicked.
			// No security violation because it could be caused by lag.
			if (prop.State == "open")
				return;

			// Check key
			var key = creature.Inventory.GetItem(a => a.Info.Id == 70028 && a.MetaData1.GetString("prop_to_unlock") == this.LockName);
			if (key == null)
			{
				Send.Notice(creature, Localization.Get("There is no matching key."));
				return;
			}

			// Remove key
			creature.Inventory.Remove(key);

			// Open and drop
			prop.SetState("open");
			this.DropItems(creature);
		}