from toee import *
from utilities import *
from InventoryRespawn import *

def san_dialog( attachee, triggerer ):
	triggerer.begin_dialog( attachee, 1 )
	return SKIP_DEFAULT

def san_first_heartbeat(attachee, triggerer):
	game.timevent_add(respawn, (attachee), 86400000 ) #86400000ms is 24 hours
	game.new_sid = 0
	return RUN_DEFAULT

def respawn(attachee):
	for box in game.obj_list_vicinity( attachee.location, OLC_CONTAINER ): 
		if box.name == 1001 and box.obj_get_int(obj_f_container_inventory_source) == 5:
			RespawnInventory(box)
			game.timevent_add(respawn, (attachee), 86400000 ) #86400000ms is 24 hours
	return
