SetState() public method

Sets prop's state and broadcasts update.
public SetState ( string state ) : void
state string
return void
Esempio n. 1
0
File: Chest.cs Progetto: 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);
		}