This commit is contained in:
lifestorm
2024-08-04 23:12:27 +03:00
parent 8064ba84d8
commit 9c918c46e5
7081 changed files with 2173485 additions and 14 deletions

View File

@@ -0,0 +1,103 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Skill Book"
ITEM.model = Model("models/props_c17/BriefCase001a.mdl")
ITEM.description = "Uhh thats the skill book thing yeah."
ITEM.functions.Read = {
name = "Czytaj",
tip = "unequipTip",
icon = "icon16/tick.png",
OnRun = function(item)
if (item.player) then
local skill = ix.skill:Find(item.skillCat)
local character = item.player:GetCharacter()
local isAddingSkills = true
if item.player:GetCharacter():GetTotalSkillLevel() >= 121 then
item.player:NotifyLocalized("Osiągnąłeś limit umiejętności!")
end
if (item.vol) then
if ix.books:ValidateReading(item.skillCat, item.vol, character) then
item.player:SetNetVar("staticAction", "Obecnie coś czyta...")
item.player:Freeze(true)
item.player.isReading = true
ix.books:ProceedReading(item.skillCat, item.vol, character, item)
end
end
if not isAddingSkills then
item.player:NotifyLocalized("Wygląda na to, że informacje z książki są dla mnie bezużyteczne.")
end
return false
end
end,
OnCanRun = function(item)
local client = item.player
local skill = ix.skill:Find(item.skillCat)
if not item.skillCat or not item.vol then return item.player:NotifyLocalized("Wygląda na to, że coś jest nie tak z książką.") end
end
}
ITEM.functions.UnRead = {
name = "Przestań czytać",
tip = "unequipTip",
icon = "icon16/delete.png",
OnRun = function(item)
if (item.player) then
if (item.player.isReading) then
item.player:SetNetVar("staticAction", nil)
item.player:Freeze(false)
item.player.isReading = nil
else
return false, item.player:NotifyLocalized("Niczego nie czytam.")
end
return false
end
end
}
function ITEM:GetExtendedInfo()
local extendedInfo = {}
if (self.vol) then
if self.vol == 1 then
extendedInfo[#extendedInfo + 1] = "\nVolume: " .. self.vol .. "st"
elseif self.vol == 2 then
extendedInfo[#extendedInfo + 1] = "\nVolume: " .. self.vol .. "nd"
elseif self.vol == 3 then
extendedInfo[#extendedInfo + 1] = "\nVolume: " .. self.vol .. "rd"
else
extendedInfo[#extendedInfo + 1] = "\nVolume: " .. self.vol .. "th"
end
local reading = LocalPlayer():GetCharacter():GetReading()
local remainingPages -- With this we avoid the --190 pages left
if reading[self.skillCat][self.vol]["readed"] then
remainingPages = 0
else
remainingPages = reading[self.skillCat][self.vol]["pages"]
end
extendedInfo[#extendedInfo + 1] = "\nTa książka obejmuje następujące umiejętności: " .. self.skillCat
extendedInfo[#extendedInfo + 1] = "\nDodaje PIĘĆ punktów umiejętności za każdy tom przeczytany w kolejności chronologicznej."
extendedInfo[#extendedInfo + 1] = "\nPozostałe strony: " .. remainingPages
if reading[self.skillCat][self.vol]["readed"] then
extendedInfo[#extendedInfo + 1] = "\nPRZECZYTAŁEŚ JUŻ TĘ KSIĄŻKĘ."
else
extendedInfo[#extendedInfo + 1] = "\nNIE CZYTAŁEŚ TEJ KSIĄŻKI."
end
end
return table.concat(extendedInfo, "")
end
function ITEM:GetColorAppendix()
if self.vol then
return {["green"] = self:GetExtendedInfo()}
end
end

View File

@@ -0,0 +1,19 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Kulinaria i Gotowanie - Część 1"
ITEM.description = "Zaskakująco dobrze zachowana książka kucharska z przepisami kulinarnymi."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skillCat = "cooking"
ITEM.vol = 1
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,19 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Kulinaria i Gotowanie - Część 2"
ITEM.description = "Naprawdę dobrze zachowana książka, która zawiera niezliczone przepisy kulinarne."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skillCat = "cooking"
ITEM.vol = 2
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,19 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Kulinaria i Gotowanie - Część 3"
ITEM.description = "Naprawdę dobrze zachowana książka, która zawiera niezliczone przepisy kulinarne."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skillCat = "cooking"
ITEM.vol = 3
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,19 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Kulinaria i Gotowanie - Część 4"
ITEM.description = "Naprawdę dobrze zachowana książka, która zawiera niezliczone przepisy kulinarne."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skillCat = "cooking"
ITEM.vol = 4
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,19 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Kulinaria i Gotowanie - Część 5"
ITEM.description = "Naprawdę dobrze zachowana książka, która zawiera niezliczone przepisy kulinarne."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skillCat = "cooking"
ITEM.vol = 5
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Nauka Tesli - część 1"
ITEM.description = "Dobrze zachowana egzoteryczna książka. Przeznaczona dla największych entuzjastów nauki, jest wypełniona formułami, gadżetami i urządzeniami o różnych kształtach i rozmiarach. Zaprawdę wspaniałe!\nTo wydanie w szczególnie opowiada o podstawach aerodynamiki i rakiet. Niezbędne dla każdego mężczyzny."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.skin = 2
ITEM.width = 1
ITEM.height = 1
ITEM.skillCat = "crafting"
ITEM.vol = 1
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Nauka Tesli - część 2"
ITEM.description = "Dobrze zachowana egzoteryczna książka. Przeznaczona dla największych entuzjastów nauki, jest wypełniona formułami, gadżetami i urządzeniami o różnych kształtach i rozmiarach. Zaprawdę wspaniałe!\nTo wydanie szczególnie opowiada o przyszłości sztuki wojennej, która niestety nie nastąpi w najbliższym czasie..."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 3
ITEM.skillCat = "crafting"
ITEM.vol = 2
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Nauka Tesli - część 3"
ITEM.description = "Dobrze zachowana egzoteryczna książka. Przeznaczona dla największych entuzjastów nauki, jest wypełniona formułami, gadżetami i urządzeniami o różnych kształtach i rozmiarach. Zaprawdę wspaniałe!\nTo wydanie opowiada o ostatnich wynalazkach militarnych stosowanych w Starym Świecie, już dawno zapomnianych..."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 4
ITEM.skillCat = "crafting"
ITEM.vol = 3
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Nauka Tesli - część 4"
ITEM.description = "Dobrze zachowana egzoteryczna książka. Przeznaczona dla największych entuzjastów nauki, jest wypełniona formułami, gadżetami i urządzeniami o różnych kształtach i rozmiarach. Zaprawdę wspaniałe!\nTo wydanie w szczególe omawia właściwości jonizującego promieniowania Gamma, ewidentnie strata czasu..."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 5
ITEM.skillCat = "crafting"
ITEM.vol = 4
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Nauka Tesli - część 5"
ITEM.description = "Dobrze zachowana egzoteryczna książka. Przeznaczona dla największych entuzjastów nauki, jest wypełniona formułami, gadżetami i urządzeniami o różnych kształtach i rozmiarach. Zaprawdę wspaniałe!\nTo wydanie mówi konkretnie o Plazmie. Czym właściwie jest Plazma?"
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 1
ITEM.skillCat = "crafting"
ITEM.vol = 5
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,20 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Bronie i Pociski - część 1"
ITEM.description = "„Słynny” magazyn westernowy. Rozgrzewa serce każdego miłośnika broni. Składa się z pięciu oryginalnych wydań i kilku spin-offów. Wszystkie opowiadają o Broniach i Pociskach oraz o tym, jak z nich strzelać!"
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skillCat = "guns"
ITEM.skin = 3
ITEM.vol = 1
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,20 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Bronie i Pociski - część 2"
ITEM.description = "„Słynny” magazyn westernowy. Rozgrzewa serce każdego miłośnika broni. Składa się z pięciu oryginalnych wydań i kilku spin-offów. Wszystkie opowiadają o Broniach i Pociskach oraz o tym, jak z nich strzelać!"
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 2
ITEM.skillCat = "guns"
ITEM.vol = 2
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Bronie i Pociski - część 3"
ITEM.description = "„Słynny” magazyn westernowy. Rozgrzewa serce każdego miłośnika broni. Składa się z pięciu oryginalnych wydań i kilku spin-offów. Wszystkie opowiadają o Broniach i Pociskach oraz o tym, jak z nich strzelać!"
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 1
ITEM.skillCat = "guns"
ITEM.vol = 3
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Bronie i Pociski - część 4"
ITEM.description = "„Słynny” magazyn westernowy. Rozgrzewa serce każdego miłośnika broni. Składa się z pięciu oryginalnych wydań i kilku spin-offów. Wszystkie opowiadają o Broniach i Pociskach oraz o tym, jak z nich strzelać!"
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 4
ITEM.skillCat = "guns"
ITEM.vol = 4
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Bronie i Pociski - część 5"
ITEM.description = "„Słynny” magazyn westernowy. Rozgrzewa serce każdego miłośnika broni. Składa się z pięciu oryginalnych wydań i kilku spin-offów. Wszystkie opowiadają o Broniach i Pociskach oraz o tym, jak z nich strzelać!"
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 6
ITEM.skillCat = "guns"
ITEM.vol = 5
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Chirurgiczna Podróż - część 1"
ITEM.description = "Dawno już zapomniane czasopismo. Pokazuje cuda współczesnej nauki - a raczej jak wyglądały... Mimo to, nie jest całkowicie bezużyteczne, być może można się z tego czegoś nauczyć..."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.skin = 1
ITEM.height = 1
ITEM.skillCat = "medicine"
ITEM.vol = 1
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Chirurgiczna Podróż - część 2."
ITEM.description = "Dawno już zapomniane czasopismo. Pokazuje cuda współczesnej nauki - a raczej jak wyglądały... Mimo to, nie jest całkowicie bezużyteczne, być może można się z tego czegoś nauczyć..."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 6
ITEM.skillCat = "medicine"
ITEM.vol = 2
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Chirurgiczna Podróż - część 3"
ITEM.description = "Dawno już zapomniane czasopismo. Pokazuje cuda współczesnej nauki - a raczej jak wyglądały... Mimo to, nie jest całkowicie bezużyteczne, być może można się z tego czegoś nauczyć..."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 5
ITEM.skillCat = "medicine"
ITEM.vol = 3
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,21 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Chirurgiczna Podróż - część 4"
ITEM.description = "Dawno już zapomniane czasopismo. Pokazuje cuda współczesnej nauki - a raczej jak wyglądały... Mimo to, nie jest całkowicie bezużyteczne, być może można się z tego czegoś nauczyć..."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skin = 7
ITEM.skillCat = "medicine"
ITEM.vol = 4
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,20 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ITEM.name = "Chirurgiczna Podróż - część 5"
ITEM.description = "Dawno już zapomniane czasopismo. Pokazuje cuda współczesnej nauki - a raczej jak wyglądały... Mimo to, nie jest całkowicie bezużyteczne, być może można się z tego czegoś nauczyć..."
ITEM.category = "Skill Books"
ITEM.model = "models/willardnetworks/misc/book.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.skillCat = "medicine"
ITEM.vol = 5
ITEM.outlineColor = Color(255, 0, 0, 100)

View File

@@ -0,0 +1,107 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
PLUGIN.name = "Skill books"
PLUGIN.author = "Naast"
PLUGIN.description = "Adds the book thing into WN, yeah."
ix.books = ix.books or {}
ix.char.RegisterVar("reading", {
field = "reading",
fieldType = ix.type.text,
default = {
["medicine"] = {
[1] = {readed = false, pages = 60},
[2] = {readed = false, pages = 50},
[3] = {readed = false, pages = 75},
[4] = {readed = false, pages = 45},
[5] = {readed = false, pages = 70}
},
["crafting"] = {
[1] = {readed = false, pages = 45},
[2] = {readed = false, pages = 60},
[3] = {readed = false, pages = 64},
[4] = {readed = false, pages = 67},
[5] = {readed = false, pages = 150}
},
["cooking"] = {
[1] = {readed = false, pages = 20},
[2] = {readed = false, pages = 50},
[3] = {readed = false, pages = 100},
[4] = {readed = false, pages = 80},
[5] = {readed = false, pages = 90}
},
["contraband"] = {
[1] = {readed = false, pages = 120},
[2] = {readed = false, pages = 120},
[3] = {readed = false, pages = 120},
[4] = {readed = false, pages = 120},
[5] = {readed = false, pages = 120}
},
["guns"] = {
[1] = {readed = false, pages = 100},
[2] = {readed = false, pages = 45},
[3] = {readed = false, pages = 60},
[4] = {readed = false, pages = 35},
[5] = {readed = false, pages = 24}
}
},
bNoDisplay = true
})
function ix.books:ValidateReading(skill, vol, character)
local readTbl = character:GetReading()
if not readTbl[skill] then return false, character:GetPlayer():NotifyLocalized("Nie ma umiejętności dla tego przewodnika.") end
if readTbl[skill][vol].readed then return false, character:GetPlayer():NotifyLocalized("Już przeczytałem tę książkę.") end
if not readTbl[skill][vol].readed then
local curVol = vol
local lastVol = vol - 1
if lastVol != 0 then
for k, v in ipairs(readTbl[skill]) do
if k < curVol and not v.readed then
return false, character:GetPlayer():NotifyLocalized("Nic nie rozumiem... Muszę przeczytać poprzedni tom.")
end
if k > curVol then
break
end
end
end
end
if readTbl then
return true
end
end
function ix.books:ProceedReading(skill, vol, character, item)
local skillVar = ix.skill:Find(skill)
local readTbl = character:GetReading()
local uniqueID = "CheckIfStillReading_" .. character:GetPlayer():SteamID64()
character:GetPlayer():SetAction("Czytasz książkę.", readTbl[skill][vol]["pages"], function()
readTbl[skill][vol].readed = true
character:SetReading(readTbl)
character:AddSkillLevel(skillVar.uniqueID, 5)
character:GetPlayer():Freeze(false)
character:GetPlayer():SetNetVar("staticAction", nil)
character:GetPlayer().isReading = nil
timer.Remove(uniqueID)
item:Remove()
end)
timer.Create(uniqueID, 1, 0, function()
if (IsValid(character:GetPlayer()) and character:GetPlayer().isReading) then
readTbl[skill][vol]["pages"] = readTbl[skill][vol]["pages"] - 1
character:SetReading(readTbl)
else
timer.Remove(uniqueID)
character:GetPlayer():Freeze(false)
character:GetPlayer():SetAction(false)
end
end)
end