import es
import random

import wcs
from wcs import wcs

itemName = 'Flaming Glove Of Warmth'

wcs.Item(itemName).registerItem('special', 5500, "15% chance to burn a victim for 2 seconds", True)

def player_hurt(ev):
    if ev['attacker'] != '0' and ev['es_userteam'] != ev['es_attackerteam']:
        count = wcs.Command(ev['userid']).GetItemCount(itemName)
        if count:
            if random.randint(1, 100) <= 15:
                wcs.Command(ev['userid']).Burn(2)
                
def player_death(ev):
    wcs.Command(ev['userid']).RemoveItem(itemName)
