<commit_before>--ds_330_weisse_flasche_neu.lua
--Druidensystem in Arbeit
--Temporre Einzelwirkungen
--Falk
require("base.common")
require("druid.base.alchemy")

module("druid.item.id_330_white_bottle",package.seeall); --, package.seeall(druid.base.alchemy))

-- UPDATE common SET com_script='druid.item.id_330_white_bottle' WHERE com_itemid = 330;

function DrinkPotion(User,SourceItem)
User:inform("beginng drinkPotion")
-- Grundwerte, Listen einlesen:
-- Sprachverstndnis (man kann eine Zeitlang fremde Sprachen verstehen/lesen)
	if firsttime == nil then
		ListCodecs = {}
		ListLanguages  = {}
		ListSkillGroup = {}
		ListSkillID = {}
		firsttime = 1
	end
	ListCodecs={45942235,62483256,65554555,15751754,82897532,63296636,93538334}
	ListLanguages={"human language","dwarf language","elf language","lizard language","orc language","halfling language","fairy language","gnome language","goblin language","ancient language"}
	ListSkillID = {1,2,3,4,5,6,10}
	ListSkillGroup={1,1,1,1,1,1,1}

    potionData = tonumber(SourceItem:getData("potionData")); 
    User:inform("potionData bestimmt: "..potionData)
  for i=1,table.getn(ListCodecs) do
    User:inform("nach for")
	if potionData == ListCodecs[i] then

      find, myEffect = User.effects:find(330);
      if not find then

      	oldSkill = User:getSkill(ListLanguages[i])
        end
      	if oldSkill == nil then
      	   oldSkill = 0
      	end

      	newSkill = 100

        myEffect=LongTimeEffect(330,1);

--      SkillName sichern
        myEffect:addValue( "skillID",ListSkillID[i] )

--      Alten Wert sichern
        myEffect:addValue( "oldSkill",oldSkill )

--      Neuen Wert sichern
        myEffect:addValue( "newSkill",newSkill )

--      SkillGroup sichern
        myEffect:addValue( "skillGroup",ListSkillGroup[i])

--      Laufzeit nach Quality berechnen
        myEffect:addValue("counterWhite",10)

 		-- cooldown 	
		myEffect:addValue("cooldownWhite",15)	
			
			--Character:inform(ListCodecs[i].." / "..ListLanguages[i].." / "..oldSkill)
      	User:increaseSkill(ListSkillGroup[i],ListLanguages[i],newSkill)
 			--Character:inform(ListCodecs[i].." / "..ListLanguages[i].." / "..Character:getSkill(ListLanguages[i]))

--      Verwandlung ausfhren
        world:gfx(5,User.pos)

--      Effekt an Char binden
        User.effects:addEffect(myEffect);
        User:inform("ende drinPotion, effekt hinzufgen")
	  
    end
  end
    
end

function UseItem(User,SourceItem,TargetItem,Counter,Param,ltstate)
-- if not milk then	  
  if base.common.GetFrontItemID(User) == 1008 then -- infront of a cauldron?
	   local cauldron = base.common.GetFrontItem( User );
	
	   if (cauldron:getData("cauldronData") ~= "") then 
	      base.common.InformNLS( User,
					"In dem Kessel befindet sich bereits etwas. Du kannst nichts mehr hinzutun.",
					"There is already something in the cauldron. You cannot add something else to it."<commit_msg>debugging<commit_after>--ds_330_weisse_flasche_neu.lua
--Druidensystem in Arbeit
--Temporre Einzelwirkungen
--Falk
require("base.common")
require("druid.base.alchemy")

module("druid.item.id_330_white_bottle",package.seeall); --, package.seeall(druid.base.alchemy))

-- UPDATE common SET com_script='druid.item.id_330_white_bottle' WHERE com_itemid = 330;

function DrinkPotion(User,SourceItem)
User:inform("beginng drinkPotion")
-- Grundwerte, Listen einlesen:
-- Sprachverstndnis (man kann eine Zeitlang fremde Sprachen verstehen/lesen)
	if firsttime == nil then
		ListCodecs = {}
		ListLanguages  = {}
		ListSkillGroup = {}
		ListSkillID = {}
		firsttime = 1
	end
	ListCodecs={45942235,62483256,65554555,15751754,82897532,63296636,93538334}
	ListLanguages={"human language","dwarf language","elf language","lizard language","orc language","halfling language","fairy language","gnome language","goblin language","ancient language"}
	ListSkillID = {1,2,3,4,5,6,10}
	ListSkillGroup={1,1,1,1,1,1,1}

    potionData = tonumber(SourceItem:getData("potionData")); 
    User:inform("potionData bestimmt: "..potionData)
  for i=1,table.getn(ListCodecs) do
    User:inform("nach for")
	if potionData == ListCodecs[i] then

      find, myEffect = User.effects:find(330);
      if not find then

      	oldSkill = User:getSkill(ListLanguages[i])
        end
      	if oldSkill == nil then
      	   oldSkill = 0
      	end

      	newSkill = 100

        myEffect=LongTimeEffect(330,1);

--      SkillName sichern
        myEffect:addValue( "skillID",ListSkillID[i] )

--      Alten Wert sichern
        myEffect:addValue( "oldSkill",oldSkill )

--      Neuen Wert sichern
        myEffect:addValue( "newSkill",newSkill )

--      SkillGroup sichern
        myEffect:addValue( "skillGroup",ListSkillGroup[i])

--      Laufzeit nach Quality berechnen
        myEffect:addValue("counterWhite",10)

 		-- cooldown 	
		myEffect:addValue("cooldownWhite",15)	
			
			--Character:inform(ListCodecs[i].." / "..ListLanguages[i].." / "..oldSkill)
      	User:increaseSkill(ListSkillGroup[i],ListLanguages[i],newSkill)
 			--Character:inform(ListCodecs[i].." / "..ListLanguages[i].." / "..Character:getSkill(ListLanguages[i]))

--      Verwandlung ausfhren
        world:gfx(5,User.pos)

--      Effekt an Char binden
        User.effects:addEffect(myEffect);
        User:inform("ende drinPotion, effekt hinzufgen")
	  
    end
  end
    
end

function UseItem(User,SourceItem,TargetItem,Counter,Param,ltstate)
-- if not milk then	  
  User:increaseSkill(skillGroup,skillName,(-(newSkill-oldSkill)))
  User:inform("Elfensprachskill am Anfang weg")
  if base.common.GetFrontItemID(User) == 1008 then -- infront of a cauldron?
	   local cauldron = base.common.GetFrontItem( User );
	
	   if (cauldron:getData("cauldronData") ~= "") then 
	      base.common.InformNLS( User,
					"In dem Kessel befindet sich bereits etwas. Du kannst nichts mehr hinzutun.",
					"There is already something in the cauldron. You cannot add something else to it."
{'fraction_non_alphanumeric': 0.12870619946091644, 'fraction_numerical': 0.03537735849056604, 'mean_word_length': 3.8111831442463533, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6418976', 'n_tokens_mistral': 2319, 'n_tokens_neox': 2140, 'n_words': 384}