Aura.Channel.World.Inventory.CreatureInventory.OnEquip C# (CSharp) 메소드

OnEquip() 개인적인 메소드

Called when an item is equipped, or becomes "active". Calls and sets the appropriate events and stat bonuses. Does not update the client.
Before this is called, the references should be updated, so the subscribers see the character as he is *after* equipping the item. For example, to check the equipment for custom set bonuses. Afterwards the equip stats should be updated, so the client displays the changes. Both of these things aren't done inside this method, because there are cases where we have to equip/unequip multiple items, and we don't want to spam the client. You also have to take care of the visual equipment updates, for similar reasons.
private OnEquip ( Item item ) : void
item Item
리턴 void
		private void OnEquip(Item item)
		{
			// For *players* who went through ChannelLogin...
			if (_creature.IsPlayer && _creature.Client.State == ClientState.LoggedIn)
			{
				// Raise event
				ChannelServer.Instance.Events.OnPlayerEquipsItem(_creature, item);

				// Execute script
				var itemScript = ChannelServer.Instance.ScriptManager.ItemScripts.Get(item.Info.Id);
				if (itemScript != null)
					itemScript.OnEquip(_creature, item);
			}

			// Apply bonuses if item is in a main equip pocket,
			// i.e. no style, hair, face, or second weapon set.
			if (item.Info.Pocket.IsMainEquip(this.WeaponSet))
			{
				this.ApplyDefenseBonuses(item);
				this.ApplyUpgrades(item);
				this.ApplyUpgradeEffects(item);
				this.HandleWUUpgrades(item);
			}
		}