import es

import wcs
from wcs import wcs

wcs.Item('Boots of Speed').registerItem('enhancement', 4000, 'Gain a small speed boost.', True)

def item_bought(ev):
    userid = ev['userid']
    if ev['item'] == 'Boots of Speed':
        wcs.Command(userid).SpeedAdd(.1)

def player_spawn(ev):
    count = wcs.Command(ev['userid']).GetItemCount('Boots of Speed')
    while count:
        count -= 1
        wcs.Command(ev['userid']).SpeedAdd(.1)
			
def player_death(ev):
    wcs.Command(ev['userid']).RemoveItem('Boots of Speed')
