<commit_before>--[[
Illarion Server

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
details.

You should have received a copy of the GNU Affero General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>. 
]]
local common = require("base.common")

local M = {}

-- INSERT INTO scheduledscripts VALUES('scheduled.gaia', 10, 10, 'plantdrop');

local RarePlantByGround = {}
local NormalPlantByGround = {}


local gt = common.GroundType

-- normal herbs; collectable with sickle
AddPlant(144, {gt.rocks},false)                         -- virgins weed
AddPlant(137, {gt.sand},false)                          -- flamegoblet blossom
AddPlant(135, {gt.grass},false)                         -- yellow weed
AddPlant(148, {gt.forest},false)                        -- firnis blossom
AddPlant(763, {gt.dirt},false)                          -- mash flower
AddPlant(767, {gt.water},false)                          -- water blossom
AddPlant(140, {gt.forest},false)                        -- donf blade
AddPlant(156, {gt.sand},false)                          -- steppe fern
AddPlant(153, {gt.grass},false)                         -- foot leaf
AddPlant(752, {gt.rock},false)                         -- mandrake
AddPlant(147, {gt.forest},false)                       -- blackberry
AddPlant(142, {gt.sand},false)                         -- sandberry
AddPlant(143, {gt.grass},false)                         -- red elder
AddPlant(136, {gt.dirt},false)                          -- anger berry
AddPlant(134, {gt.grass},false)                         -- fourleafed oneberry
AddPlant(155, {gt.water},false)                         -- sibanac leaf
AddPlant(151, {gt.forest},false)                        -- strawberry
AddPlant(141, {gt.rocks},false)                         -- black thistle
AddPlant(145, {gt.grass},false)                         -- heath flower
AddPlant(151, {gt.forest},false)                        -- strawberry
AddPlant(141, {gt.rocks},false)                         -- black thistle
AddPlant(133, {gt.grass},false)                         -- sun herb
AddPlant(753, {gt.grass,gt.forest},false)              -- blue bird's berry
AddPlant(159, {gt.forest},false)						-- toadstool
AddPlant(160, {gt.forest},false)						-- red head
AddPlant(161, {gt.grass},false)						-- herder's mushroom
AddPlant(162, {gt.grass},false)						-- birth mushroom
AddPlant(163, {gt.forest},false)						-- champignon

-- rar herbs; not collectable with sickle
AddPlant(138, {gt.dirt},true)                        -- night angels blossom
AddPlant(146, {gt.sand},true)                        -- deser sky capsule
AddPlant(152, {gt.forest},true)                      -- life root
AddPlant(754, {gt.grass},true)                          -- oneleaved fourberry
AddPlant(755, {gt.rocks},true)                        -- fire root
AddPlant(756, {gt.grass},true)                       -- pious berry
AddPlant(757, {gt.forest},true)                        -- tybalt star
AddPlant(758, {gt.rocks},true)                        -- heart blood
AddPlant(760, {gt.snow},true)                        -- ice leaf
AddPlant(761, {gt.grass},true)                        -- rain weed
AddPlant(762, {gt.rocks},true)                        -- gold crack herb
AddPlant(764, {gt.forest},true)                        -- dark moos
AddPlant(765, {gt.forest},true)                        -- day tream
AddPlant(766, {gt.forest},true)                        -- con blossom
AddPlant(768, {gt.forest},true)                        -- wolverine fern
AddPlant(769, {gt.sand},true)                         -- desert berry


function AddPlant(ItemID, Grounds, rare)
    if rare then
        for i=1, #Grounds do
            if RarePlantByGround[Grounds[i]] == nil then
				RarePlantByGround[Grounds[i]] = {}
			end
            table.insert(RarePlantByGround[Grounds[i]], ItemID);
		end
    else
        for i=1, #Grounds do
			if NormalPlantByGround[Grounds[i]] == nil then
				NormalPlantByGround[Grounds[i]] = {}
			end
            table.insert(NormalPlantByGround[Grounds[i]], ItemID);
		end
    end
end

function M.plantdrop()
    if ( RarePlantByGround==nil ) then
        Init();
    end

	local herbCounter = 0 -- for testing
	local normal = 0; local cool = 0
	for i=1,35 do -- normal plants
	   PutPlantOnField(false)
	end
    
	for i=1,5 do -- rare plants
	   PutPlantOnField(true)
	end
end

function PutPlantOnField(rare)<commit_msg>Put functions into a proper order<commit_after>--[[
Illarion Server

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
details.

You should have received a copy of the GNU Affero General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>. 
]]
local common = require("base.common")

local M = {}

-- INSERT INTO scheduledscripts VALUES('scheduled.gaia', 10, 10, 'plantdrop');

local RarePlantByGround = {}
local NormalPlantByGround = {}

function AddPlant(ItemID, Grounds, rare)
    if rare then
        for i=1, #Grounds do
            if RarePlantByGround[Grounds[i]] == nil then
				RarePlantByGround[Grounds[i]] = {}
			end
            table.insert(RarePlantByGround[Grounds[i]], ItemID);
		end
    else
        for i=1, #Grounds do
			if NormalPlantByGround[Grounds[i]] == nil then
				NormalPlantByGround[Grounds[i]] = {}
			end
            table.insert(NormalPlantByGround[Grounds[i]], ItemID);
		end
    end
end

local gt = common.GroundType

-- normal herbs; collectable with sickle
AddPlant(144, {gt.rocks},false)                         -- virgins weed
AddPlant(137, {gt.sand},false)                          -- flamegoblet blossom
AddPlant(135, {gt.grass},false)                         -- yellow weed
AddPlant(148, {gt.forest},false)                        -- firnis blossom
AddPlant(763, {gt.dirt},false)                          -- mash flower
AddPlant(767, {gt.water},false)                          -- water blossom
AddPlant(140, {gt.forest},false)                        -- donf blade
AddPlant(156, {gt.sand},false)                          -- steppe fern
AddPlant(153, {gt.grass},false)                         -- foot leaf
AddPlant(752, {gt.rock},false)                         -- mandrake
AddPlant(147, {gt.forest},false)                       -- blackberry
AddPlant(142, {gt.sand},false)                         -- sandberry
AddPlant(143, {gt.grass},false)                         -- red elder
AddPlant(136, {gt.dirt},false)                          -- anger berry
AddPlant(134, {gt.grass},false)                         -- fourleafed oneberry
AddPlant(155, {gt.water},false)                         -- sibanac leaf
AddPlant(151, {gt.forest},false)                        -- strawberry
AddPlant(141, {gt.rocks},false)                         -- black thistle
AddPlant(145, {gt.grass},false)                         -- heath flower
AddPlant(151, {gt.forest},false)                        -- strawberry
AddPlant(141, {gt.rocks},false)                         -- black thistle
AddPlant(133, {gt.grass},false)                         -- sun herb
AddPlant(753, {gt.grass,gt.forest},false)              -- blue bird's berry
AddPlant(159, {gt.forest},false)						-- toadstool
AddPlant(160, {gt.forest},false)						-- red head
AddPlant(161, {gt.grass},false)						-- herder's mushroom
AddPlant(162, {gt.grass},false)						-- birth mushroom
AddPlant(163, {gt.forest},false)						-- champignon

-- rar herbs; not collectable with sickle
AddPlant(138, {gt.dirt},true)                        -- night angels blossom
AddPlant(146, {gt.sand},true)                        -- deser sky capsule
AddPlant(152, {gt.forest},true)                      -- life root
AddPlant(754, {gt.grass},true)                          -- oneleaved fourberry
AddPlant(755, {gt.rocks},true)                        -- fire root
AddPlant(756, {gt.grass},true)                       -- pious berry
AddPlant(757, {gt.forest},true)                        -- tybalt star
AddPlant(758, {gt.rocks},true)                        -- heart blood
AddPlant(760, {gt.snow},true)                        -- ice leaf
AddPlant(761, {gt.grass},true)                        -- rain weed
AddPlant(762, {gt.rocks},true)                        -- gold crack herb
AddPlant(764, {gt.forest},true)                        -- dark moos
AddPlant(765, {gt.forest},true)                        -- day tream
AddPlant(766, {gt.forest},true)                        -- con blossom
AddPlant(768, {gt.forest},true)                        -- wolverine fern
AddPlant(769, {gt.sand},true)                         -- desert berry

function M.plantdrop()
    if ( RarePlantByGround==nil ) then
        Init();
    end

	local herbCounter = 0 -- for testing
	local normal = 0; local cool = 0
	for i=1,35 do -- normal plants
	   PutPlantOnField(false)
	end
    
	for i=1,5 do -- rare plants
	   PutPlantOnField(true)
	end
end

function PutPlantOnField(rare)
{'fraction_non_alphanumeric': 0.11381443298969073, 'fraction_numerical': 0.030309278350515462, 'mean_word_length': 1.8769276393831553, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7276125', 'n_tokens_mistral': 3310, 'n_tokens_neox': 2838, 'n_words': 762}