<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/>.
]]
-- Long Time Effect Script - Character Regeneration
-- by Nitram

local common = require("base.common")
local factions = require("base.factions")
local M = {}

local crossPosition = {}

--Where are the cross NPCS?

crossPosition[0]= position(690,324,0);       -- Wilderland
crossPosition[1]= position(102,562,0);       -- Cadomyr
crossPosition[2]= position(918,775,0);       -- Runewick
crossPosition[3]= position(345,266,0);       -- Galmair

local TimeFactor = 1; -- Time between two effect calls in seconds. All effects scale with this number. Attention: If you change this number, also change it in server.standardfighting
local EffectID = 2;

local getLimit
local leadToCross
local showRespawnDialog
local leaveSavely
local no_regeneration
local ChangeAttrib
local getWounds

function M.addEffect( Effect, Character)

    -- It is needed to add at least value to make sure the effect does not get deleted right after the first call
    Effect:addValue("10",0);

end;

function M.callEffect( Effect, Char ) -- Effect called

if Char:idleTime() < 300 then -- Absolutely no regeneration effect if the player is afk for more than five minutes

    -----------------------READ VALUES------------------------------------
    local Hitpoints   = Char:increaseAttrib("hitpoints",0);   -- Hitpoints einlesen    ( 0 - 10000 )
    local Manapoints  = Char:increaseAttrib("mana",0);        -- Manapoints einlesen   ( 0 - 10000 )
    local Foodvalue   = Char:increaseAttrib("foodlevel",0);   -- Foodvalue einlesen    ( 0 - 60000 )
    local Poisonvalue = Char:getPoisonValue();                -- Poisonvalue einlesen  ( 0 - 10000 )

    local Const        = Char:increaseAttrib("constitution",0) -- Konstitution einlesen ( 0 - 20 )
    local Essence      = Char:increaseAttrib("essence",0)      -- Essenze einlesen      ( 0 - 20 )
    local Willpower    = Char:increaseAttrib("willpower",0)    -- Willenskraft einlesen ( 0 - 20 )<commit_msg>Test change<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/>.
]]
-- Long Time Effect Script - Character Regeneration
-- by Nitram

local common = require("base.common")
local factions = require("base.factions")
local M = {}

local crossPosition = {}

--Where are the cross NPCS?

crossPosition[0]= position(690,324,0);       -- Wilderland
crossPosition[1]= position(102,562,0);       -- Cadomyr
crossPosition[2]= position(918,775,0);       -- Runewick
crossPosition[3]= position(345,266,0);       -- Galmair

local TimeFactor = 1; -- Time between two effect calls in seconds. All effects scale with this number. Attention: If you change this number, also change it in server.standardfighting
local EffectID = 2;

local getLimit
local leadToCross
local showRespawnDialog
local leaveSavely
local no_regeneration
local ChangeAttrib
local getWounds

function M.addEffect( Effect, Character)

    -- It is needed to add at least value to make sure the effect does not get deleted right after the first call
    Effect:addValue("10",0);

end;

function M.callEffect( Effect, Char ) -- Effect called

Char:inform("Test")

if Char:idleTime() < 300 then -- Absolutely no regeneration effect if the player is afk for more than five minutes

    -----------------------READ VALUES------------------------------------
    local Hitpoints   = Char:increaseAttrib("hitpoints",0);   -- Hitpoints einlesen    ( 0 - 10000 )
    local Manapoints  = Char:increaseAttrib("mana",0);        -- Manapoints einlesen   ( 0 - 10000 )
    local Foodvalue   = Char:increaseAttrib("foodlevel",0);   -- Foodvalue einlesen    ( 0 - 60000 )
    local Poisonvalue = Char:getPoisonValue();                -- Poisonvalue einlesen  ( 0 - 10000 )

    local Const        = Char:increaseAttrib("constitution",0) -- Konstitution einlesen ( 0 - 20 )
    local Essence      = Char:increaseAttrib("essence",0)      -- Essenze einlesen      ( 0 - 20 )
    local Willpower    = Char:increaseAttrib("willpower",0)    -- Willenskraft einlesen ( 0 - 20 )
{'fraction_non_alphanumeric': 0.1076276046645001, 'fraction_numerical': 0.030586885872682087, 'mean_word_length': 3.2261712439418417, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5062790', 'n_tokens_mistral': 1573, 'n_tokens_neox': 1439, 'n_words': 576}