quest clean_inventory begin
state start begin
when 9005.chat."Empty your inventory" begin
say_title(mob_name(npc.get_race()))
say("Inventory which you choose will be empty.")
say("Pay attention when you make your choice.")
say_reward("Choose the inventory which you want to empty.")
local s = select("Inventory - I","Inventory - II","Inventory - III","Inventory - IV","Remove all items","Cancel")
local value = {
[1] = {0, 44, "Inventory I"},
[2] = {45, 89, "Inventory II"},
[3] = {90, 134, "Inventory III"},
[4] = {135, 179, "Inventory IV"},
[5] = {0, 179, "All Inventory"}
}
if s <= 5 then
say("Do you really want to empty "..value[s][3].." ? ")
local choice = select("Yes","No")
if choice == 1 then
clean_inventory.EMPTY(value[s][1], value[s][2])
else
return
end
else
return
end
return
end
function EMPTY(a, b)
for i=a, b do
item.select_cell(i)
item.remove()
end
say("Done ! ")
return
end
end
end
J'ai apporté quelques modification, cela évite les répétitons de morceaux de code