import es

import wcs
from wcs import wcs

itemName = 'Off the Shell Boots'

wcs.Item(itemName).registerItem('enhancement', 200, "Thick Leather Boots. +50 armor", True)

def item_bought(ev):
    if ev['item'] == itemName:
        wcs.Command(ev['userid']).ArmorAdd(50)
        
def player_spawn(ev):
    count = wcs.Command(ev['userid']).GetItemCount(itemName)
    while count:
        wcs.Command(ev['userid']).ArmorAdd(50)
        count -= 1
        
def player_death(ev):
    wcs.Command(ev['userid']).RemoveItem(itemName)
