Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Заменил лютый пипец
Browse files Browse the repository at this point in the history
  • Loading branch information
dsh2dsh committed Dec 17, 2015
1 parent f426770 commit e396c46
Showing 1 changed file with 6 additions and 56 deletions.
62 changes: 6 additions & 56 deletions gamedata/scripts/buusty_dialog.script
@@ -1,63 +1,13 @@
-- -*- mode: lua; coding: windows-1251-dos -*- -- -*- mode: lua; coding: windows-1251-dos -*-
local math_random = math.random



function item_much( itm, need_namber )
local items_count=0 return sak.have_item_namber( itm, need_namber )
local itemin=nil

function item_much(itm,need_namber)
local actor=db.actor
items_count=0
itemin=itm
actor:iterate_inventory(cheking_item,actor)
if items_count>=need_namber then
return true
else
return false
end
end
function cheking_item(actor,item)
local items=item:section()
if items==itemin then
items_count=items_count+1
end
end
function create_items(npc,section,number)
for i=1,number do
alife():create(section,
npc:position(),
npc:level_vertex_id(),
npc:game_vertex_id(),
npc:id())
end
end

local reloc_params={}
local stalk

function out_item_much(itm_section,need_number)
reloc_params.itm_section=itm_section
reloc_params.itm_cnt=need_number
reloc_params.itm_cnt_found=0
db.actor:iterate_inventory(checkout_items_count,db.actor)
reloc_params.itm_cnt_found=0
if reloc_params.itm_cnt_found<=reloc_params.itm_cnt then
db.actor:iterate_inventory(out_items_count,db.actor)
end
news_manager.relocate_item(db.actor, "out", itm_section)
reloc_params={}
end

function checkout_items_count(actor,item)
if item.section and item:section()==reloc_params.itm_section then
reloc_params.itm_cnt_found = reloc_params.itm_cnt_found + 1
end
end end
function out_items_count(actor,item) function create_items( npc, section, number )
if item.section and item:section()==reloc_params.itm_section and reloc_params.itm_cnt_found<reloc_params.itm_cnt then return sak.create_items( npc, section, number )
amk.remove_item_from_inventory(item, actor)
reloc_params.itm_cnt_found = reloc_params.itm_cnt_found + 1
end end
function out_item_much( itm_section, need_number )
return.sak.out_item_namber( itm_section, need_number )
end end




Expand Down

0 comments on commit e396c46

Please sign in to comment.