function lootmoney(npc)
	if npc ~= nil and not string.find(npc:section(),"arena") and npc:character_community()~="arena_enemy" then
		local money = npc:money()
		if money ~= nil and money ~=0 then
				local deadmoney = money

                                local npc_rank
		npc_rank = ranks.get_obj_rank_name(npc)
		if npc_rank ~= nil then
			if npc_rank == "novice" and deadmoney >=400 then deadmoney=math.random(1,500)    
			elseif npc_rank == "experienced" and deadmoney >=500 then deadmoney=math.random(1,1000)  
			elseif npc_rank == "veteran" and deadmoney >=600 then deadmoney=math.random(1,1500) 
			elseif npc_rank == "master" and deadmoney >=700 then deadmoney=math.random(1,2000)  
                          end
						  end
				local news_texti = "\\n%c[255,255,0,0]Мёртвый сталкер: %c[default]"..npc:character_name().."\\n%c[255,255,0,0]Обнаружено денег: %c[default]"..game.translate_string(tostring(deadmoney).." руб.")
				db.actor:give_game_news(news_texti, "ui\\ui_iconsTotal", Frect():set(0,0,83,47), 1, 4000)
				db.actor:give_money(deadmoney)
				game_stats.money_quest_update(deadmoney) 
				npc:give_money(-money)
				game_stats.money_quest_update(-money)
			end
		end
	end
