import es

import wcs
from wcs import wcs

wcs.Item('Heavy Boots of Armor').registerItem('enhancement', 2000, "Add Thick Heavy Armor. +200 armor 3/4 speed", True)

def item_bought(ev):
    userid = ev['userid']
    if ev['item'] == 'Heavy Boots of Armor':
        command = wcs.Command(userid)
        command.Speed(command['MaxSpeed'] * 0.75)
        command.ArmorAdd(200)
        
def player_spawn(ev):
    command = wcs.Command(ev['userid'])
    count   = command.GetItemCount('Heavy Boots of Armor')
    while count:
        command.Speed(command['MaxSpeed'] * 0.75)
        command.ArmorAdd(200)
        
def player_death(ev):
    wcs.Command(ev['userid']).RemoveItem('Heavy Boots of Armor')
