You are looking at a material called candle
The candle material reacts to the light and blow commands. When lit, it will light the location, but shorten over time until health is gone. The rate of shortening depends on the worth of a single candle. If you create 10 candles worth 100 then light the candles , each candle is worth 10 pennies and will shorten by 1 health every 1 out of 10 ticks until it burns out. The total worth is reduced by the worth of 1 at that time. If you create some candles , the singular class becomes 'candl'. This material detects and fixes it to 'candle' when lit. If there are more than 1 candles (using the more command), then each time it burns out, qty will be reduced and health will go back to healthmax.
Code
if target of light then candleignite; if target of blow then candleblowout; ##candleignite: $qty = $actor's qty; $oneworth = $actor's worth; divide $oneworth by $qty; add 1 to $oneworth; $chance = random $oneworth; if $chance > 0 then candleignite1 else candlefizzle; ##candlefizzle: print "Unfortunately, [$actor]'s wick won't burn."; $material = $actor's material; swap $material take _light_; set $actor's material to $material; ##candleignite1: if $actor's class == candl then fixsingular; if $actor's qty > 1 then candleignite2 else candleignite3; $material = $actor's material; swap $material add _light_; set $actor's material to $material; set $actor's pose to 'burning'; relook $loc; ##candleignite2: print "One of [$actor] begins to burn."; ##candleignite3: print "[$actor] begins to burn."; ##tickloc:runsub candleburning; ##candleburning: if $actor's material like _light_ then candleburning2; ##candleburning2: $qty = $actor's qty; $oneworth = $actor's worth; divide $oneworth by $qty; add 1 to $oneworth; // it must always be > 0; runsub "candlereduce/$oneworth"; ##candlereduce: $health = $actor's health; if $health < 1 then candleburnout else candleshort; ##candleshort: if $qty > 1 then candleshort1 else candleshort2; take 1 from $health; set $actor's health to $health; ##candleshort1: print "One of [$actor] seems a little shorter..."; ##candleshort2: print "[$actor] seems a little shorter..."; ##candleburnout: $material = $actor's material; swap $material take _light_; set $actor's material to $material; set $actor's pose to 'burned out'; if $qty < 2 then candleburnout2 else candleburnout3; take 1 from $qty; $worth = $actor's worth; take $oneworth from $worth; add 1 to $worth; // since $oneworth was inflated by a penny; set $actor's qty to $qty; set $actor's worth to $worth; $healthmax = $actor's healthmax; set $actor's health to $healthmax; ##candleburnout2: print "[$actor] melts away and burns out."; delete $actor to 0 internals $loc; set $actor's loc to 0; relook $loc; ##candleburnout3: print "One of [$actor] melts away and burns out."; relook $loc; ##candleblowout: $material = $actor's material; swap $material take _light_; set $actor's material to $material; set $actor's pose to ''; print "[$actor] is blown out"; relook $loc; ##fixsingular: set $actor's class to candle;