Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: Эта возможность может быть недоступна в некоторых браузерах.
Приветствуем на сайте, Гость! Обязательно ознакомьтесь с условиями и правилами Публичной оферты Проекта NetZONA.org: https://netzona.org/help/public-offer/
Приветствуем на сайте, Гость! Обязательно ознакомьтесь с условиями и правилами использования Ваших файлов cookie на Проекте NetZONA.org: https://netzona.org/help/cookies/
Приветствуем на сайте, Гость! Обязательно ознакомьтесь с Политикой конфиденциальности Проекта NetZONA.org: https://netzona.org/pages/privacy-policy/
Ответы на основные вопросы: https://netzona.org/threads/populjarnye-voprosy-i-otvety-na-nix.6122/
Приветствуем на сайте, Гость! Приобрести (купить) Информационную услугу (в том числе группу "Проверенный") на Проекте NetZONA.org: https://netzona.org/account/upgrades
local QUEST = {} -- Переменная
QUEST.uniqueID = "honeya" -- Уникальный идентификатор квеста
QUEST.name = "Honeya Hideout's Problem" - Название квеста
QUEST.desc = "Get %s of %s for Honeya Hideout." -- Описание квеста
QUEST.quickRewards = { -- Награда за выполнение квеста.
currency = 100,
items = {
{ uid = "kolb", amount = 1, data = {} },
}
}
QUEST.randomItem = { -- Случайный предмет, который необходимо принести[/B]
{ uid = "kolb", min = 1, max = 1 },
}
function QUEST:GenerateData( player ) -- Генерация (не стоит изменять)
local tbl = {}
for i = 0, 0 do
local idat = table.Random( self.randomItem )
tbl[ idat.uid ] = math.random( idat.min, idat.max )
print( 'inserted '.. idat.uid )
end
return tbl
end
function QUEST:CanComplete( player, data ) -- Проверка на выполнение квеста
for uid, num in pairs( data ) do
if !player:getChar():getInv():hasItem( uid ) then
print( Format( "lack of %s of %s", num, uid ) )
return false
end
end
return true
end
function QUEST:RemoveQuestItem( player, data ) -- Удаление предмета из инвенторя (не стоит изменять)
for uid, num in pairs( data ) do
player:getChar():getInv():remove(player:getChar():getInv():hasItem( uid ):getID(), false, false)
end
end
function QUEST:PostReward( player, data ) -- Функция, вызываемая после сдачи квеста
print( 'PostReward')
return true
end
PLUGIN:RegisterQuest( QUEST.uniqueID, QUEST )
["quest_honeya"] = { -- quest_honeya - уникальный идентификатор квеста.
sv = function( client, data )
if client:HasQuest( "honeya" ) then
-- questPLUGIN = from the "quests" plugin.
local pqst_dat = client:GetQuest( "honeya" ) -- get player quest data
if client:CanCompleteQuest( "honeya", pqst_dat ) then -- If see player can complete quest
client:GiveQuestReward( "honeya", pqst_dat ) -- Give quest reward
client:RemoveQuest( "honeya" ) -- and remove player quest.
data.done = true -- send client data.done. It will generate you're done text.
else
data.done = false
end
else
-- set quest and get quest.
data.gotquest = true -- Just got a quest!
local d_qst = questPLUGIN:GetQuest( "honeya" )
client:AddQuest( "honeya", d_qst:GenerateData( client ) ) -- Give a quest that has uniqueid 'honeya' and generates random data for quest.
-- Quest data generating function is in sh_quests.lua file.
end
return data -- MUST RETURN DATA
end,
cl = function( client, panel, data )
if data.gotquest then
local d_qst = questPLUGIN:GetQuest( "honeya" )
local pqst_dat = LocalPlayer():GetQuest( "honeya" ) -- get player quest data
panel:AddChat( data.name, "Can you get some items for me?" )
for k, v in pairs( pqst_dat ) do
panel:AddCustomText( Format( d_qst.desc, unpack( { v, nut.item.list[k].name } ) ), "nut_ChatFont" )
end
panel.talking = false -- Get quest and end the converstaion.
return
end
if data.done then
panel:AddChat( data.name, "Okay I'll give you some moeney!")
else
panel:AddChat( data.name, "You don't have enough items to return your quest.")
end
panel.talking = false
end,
},
Я сделал все как вы написали, вставил в NPC !quest_fort, после этого я нажал на диолог с NPC но нечего не произошло, помогите пожалуйста Neon.Для создания полноценного квеста мы будем редактировать 2 файла.
Рассмотрим структуру квеста quest_honeya структуру:
quests/sh_quests.lua
Код:local QUEST = {} -- Переменная QUEST.uniqueID = "honeya" -- Уникальный идентификатор квеста QUEST.name = "Honeya Hideout's Problem" - Название квеста QUEST.desc = "Get %s of %s for Honeya Hideout." -- Описание квеста QUEST.quickRewards = { -- Награда за выполнение квеста. currency = 100, items = { { uid = "kolb", amount = 1, data = {} }, } } QUEST.randomItem = { -- Случайный предмет, который необходимо принести[/B] { uid = "kolb", min = 1, max = 1 }, } function QUEST:GenerateData( player ) -- Генерация (не стоит изменять) local tbl = {} for i = 0, 0 do local idat = table.Random( self.randomItem ) tbl[ idat.uid ] = math.random( idat.min, idat.max ) print( 'inserted '.. idat.uid ) end return tbl end function QUEST:CanComplete( player, data ) -- Проверка на выполнение квеста for uid, num in pairs( data ) do if !player:getChar():getInv():hasItem( uid ) then print( Format( "lack of %s of %s", num, uid ) ) return false end end return true end function QUEST:RemoveQuestItem( player, data ) -- Удаление предмета из инвенторя (не стоит изменять) for uid, num in pairs( data ) do player:getChar():getInv():remove(player:getChar():getInv():hasItem( uid ):getID(), false, false) end end function QUEST:PostReward( player, data ) -- Функция, вызываемая после сдачи квеста print( 'PostReward') return true end PLUGIN:RegisterQuest( QUEST.uniqueID, QUEST )
talknpc/derma/sh_advhandler.lua
Код:["quest_honeya"] = { -- quest_honeya - уникальный идентификатор квеста. sv = function( client, data ) if client:HasQuest( "honeya" ) then -- questPLUGIN = from the "quests" plugin. local pqst_dat = client:GetQuest( "honeya" ) -- get player quest data if client:CanCompleteQuest( "honeya", pqst_dat ) then -- If see player can complete quest client:GiveQuestReward( "honeya", pqst_dat ) -- Give quest reward client:RemoveQuest( "honeya" ) -- and remove player quest. data.done = true -- send client data.done. It will generate you're done text. else data.done = false end else -- set quest and get quest. data.gotquest = true -- Just got a quest! local d_qst = questPLUGIN:GetQuest( "honeya" ) client:AddQuest( "honeya", d_qst:GenerateData( client ) ) -- Give a quest that has uniqueid 'honeya' and generates random data for quest. -- Quest data generating function is in sh_quests.lua file. end return data -- MUST RETURN DATA end, cl = function( client, panel, data ) if data.gotquest then local d_qst = questPLUGIN:GetQuest( "honeya" ) local pqst_dat = LocalPlayer():GetQuest( "honeya" ) -- get player quest data panel:AddChat( data.name, "Can you get some items for me?" ) for k, v in pairs( pqst_dat ) do panel:AddCustomText( Format( d_qst.desc, unpack( { v, nut.item.list[k].name } ) ), "nut_ChatFont" ) end panel.talking = false -- Get quest and end the converstaion. return end if data.done then panel:AddChat( data.name, "Okay I'll give you some moeney!") else panel:AddChat( data.name, "You don't have enough items to return your quest.") end panel.talking = false end, },
Добавление квеста:
Чтобы добавить квест, необходимо в редакторе диалогов (При вызове Е открывается слева) добавить новую строку (Add line) в нижнем поле (диалоги игрока), и установить ID диалога !quest_honeya
ID диалога указывается в файле talknpc/derma/sh_advhandler.lua в строке ["quest_honeya"]
Проверь верность введенных данных. Тебе необходимо уметь работать в Lua, чтобы сделать квесты.Я сделал все как вы написали, вставил в NPC !quest_fort, после этого я нажал на диолог с NPC но нечего не произошло, помогите пожалуйста Neon.
Вот скриншоты Lua кода Квеста.Посмотреть вложение 293 Посмотреть вложение 294Проверь верность введенных данных. Тебе необходимо уметь работать в Lua, чтобы сделать квесты.
Большое Спасибо Neon Теперь все работаетНа первом скрине лишний оставил код (строка 10) - Название квеста
На втором скрине в коде стоит лишний символ (строка 31) -
local PLUGIN = PLUGIN
nut.plugin = nut.plugin or {}
nut.plugin.list = nut.plugin.list or {}
--PrintTable(nut.plugin.list.quests)
local questPLUGIN = nut.plugin.list.quests--nut.plugins.list( "quests" )
if not questPLUGIN then
print( 'quest_honeya example will not work properly without "quest" plugin.' )
end
/*---------------------------------------------------------
This is advanced handler for dialogue plugin.
You can make some quest like things with this.
But I recommends you don't care about this handler
If you don't know how to code.
I will not answer any question about how to use this plugin.
Unless you have any clue about this dialogue handler.
--------------------------------------------------------*/
-- You can call SpecialCall with !.
-- example. when a player call dialouge that has uid "!quest_recieve_test" then it will call SpecialCall["quest_receive_test"].
PLUGIN.SpecialCall =
{
["quest_honeya"] = { -- QUEST EXAMPLE.
sv = function( client, data )
if client:HasQuest( "honeya" ) then
-- questPLUGIN = from the "quests" plugin.
local pqst_dat = client:GetQuest( "honeya" ) -- get player quest data
if client:CanCompleteQuest( "honeya", pqst_dat ) then -- If see player can complete quest
client:GiveQuestReward( "honeya", pqst_dat ) -- Give quest reward
client:RemoveQuest( "honeya" ) -- and remove player quest.
data.done = true -- send client data.done. It will generate you're done text.
else
data.done = false
end
else
-- set quest and get quest.
data.gotquest = true -- Just got a quest!
local d_qst = questPLUGIN:GetQuest( "honeya" )
client:AddQuest( "honeya", d_qst:GenerateData( client ) ) -- Give a quest that has uniqueid 'honeya' and generates random data for quest.
-- Quest data generating function is in sh_quests.lua file.
end
return data -- MUST RETURN DATA
end,
cl = function( client, panel, data )
if data.gotquest then
local d_qst = questPLUGIN:GetQuest( "honeya" )
local pqst_dat = LocalPlayer():GetQuest( "honeya" ) -- get player quest data
panel:AddChat( data.name, "Can you get some items for me?" )
for k, v in pairs( pqst_dat ) do
panel:AddCustomText( Format( d_qst.desc, unpack( { v, nut.item.list[k].name } ) ), "nut_ChatFont" )
end
panel.talking = false -- Get quest and end the converstaion.
return
end
if data.done then
panel:AddChat( data.name, "Okay I'll give you some moeney!")
else
panel:AddChat( data.name, "You don't have enough items to return your quest.")
end
panel.talking = false
end,
},
["quest_art"] = {
sv = function( client, data )
if client:HasQuest( "art" ) then
-- questPLUGIN = from the "quests" plugin.
local pqst_dat = client:GetQuest( "art" ) -- get player quest data
if client:CanCompleteQuest( "art", pqst_dat ) then -- If see player can complete quest
client:GiveQuestReward( "art", pqst_dat ) -- Give quest reward
client:RemoveQuest( "art" ) -- and remove player quest.
data.done = true -- send client data.done. It will generate you're done text.
else
data.done = false
end
else
-- set quest and get quest.
data.gotquest = true -- Just got a quest!
local d_qst = questPLUGIN:GetQuest( "art" )
client:AddQuest( "art", d_qst:GenerateData( client ) ) -- Give a quest that has uniqueid 'honeya' and generates random data for quest.
-- Quest data generating function is in sh_quests.lua file.
end
return data -- MUST RETURN DATA
end,
cl = function( client, panel, data )
if data.gotquest then
local d_qst = questPLUGIN:GetQuest( "art" )
local pqst_dat = LocalPlayer():GetQuest( "art" )
panel:AddChat( data.name, "Есть один заказ:" )
for k, v in pairs( pqst_dat ) do
panel:AddCustomText( Format( d_qst.desc, unpack( { v, nut.item.list[k].name } ) ), "nut_ChatFont" )
end
panel.talking = false -- Get quest and end the converstaion.
return
end
if data.done then
panel:AddChat( data.name, "Ну, спасибо! Выручил! Держи оплату.")
else
panel:AddChat( data.name, "Как-то я не заметил, что у тебя есть нужный артефакт. Я же говорил:")
local d_qst = questPLUGIN:GetQuest( "art" )
local pqst_dat = LocalPlayer():GetQuest( "art" )
for k, v in pairs( pqst_dat ) do
panel:AddCustomText( Format( d_qst.desc, unpack( { v, nut.item.list[k].name } ) ), "nut_ChatFont" )
end
end
panel.talking = false
end,
},
["test2"] = {
sv = function( client, data )
return data -- MUST RETURN DATA
end,
cl = function( client, panel, data )
panel.talking = false -- Ends the current conversation and allows player to talk about other topics.
end,
},
["test"] = {
sv = function( client, data )
client:EmitSound( "items/smallmedkit1.wav" )
client:SetHealth( 100 )
return data -- MUST RETURN DATA
end,
cl = function( client, panel, data )
panel:AddChat( data.name, "By the name of Black Tea! You're healed!" )
panel.talking = false -- Ends the current conversation and allows player to talk about other topics.
end,
},
}
-- Handler.
if SERVER then
netstream.Hook( "nut_DialogueMessage", function( client, data )
if string.Left( data.request, 1 ) == "!" then
data.request = string.sub( data.request, 2 )
if PLUGIN.SpecialCall[ data.request ] then
data = PLUGIN.SpecialCall[ data.request ].sv( client, data )
netstream.Start( client, "nut_DialoguePingpong", data )
else
print( Format( "%s( %s ) tried to call invalid dialouge request( %s ) from %s.", client:Name(), client:Nick(), data.request, data.name ) )
print( "Please check PLUGIN.SpecialCall or NPC's dialouge unique id." )
client:EmitSound( "HL1/fvox/hev_general_fail.wav" )
end
end
end)
else
netstream.Hook( "nut_DialoguePingpong", function( data )
if IsValid( nut.gui.dialogue ) then
if PLUGIN.SpecialCall[ data.request ] then
PLUGIN.SpecialCall[ data.request ].cl( client, nut.gui.dialogue, data )
end
end
end)
end
local PLUGIN = PLUGIN
---------------------------------
--- BUYER QUEST
--- COLLECT ONE ARTIFACT FOR SOMEONE
--- THE ITEM HAS TO BE COLLECTED WILL BE RANDOMIZED IN randomItem.
local QUEST = {}
QUEST.uniqueID = "art"
QUEST.name = "Заказ от важной шишки"
QUEST.desc = "Достань мне %s артефакт %s для важного клиента, плачу 2.5 тысячи. Только быстрее." -- If you don't know how it's working, Just check in sh_advhandler.lua in dialogue.
QUEST.quickRewards = {
currency = 2500,
items = {}
}
QUEST.randomItem = { --
{ uid = "battery", min = 1, max = 1 },
{ uid = "eye", min = 1, max = 1 },
{ uid = "jellyfish", min = 1, max = 1 },
{ uid = "meatchunk", min = 1, max = 1 },
}
function QUEST:GenerateData( player )
local tbl = {}
for i = 0, 0 do
local idat = table.Random( self.randomItem )
tbl[ idat.uid ] = math.random( idat.min, idat.max )
end
return tbl
end
function QUEST:CanComplete( player, data )
for uid, num in pairs( data ) do
if !player:getChar():getInv():hasItem( uid ) then
return false
end
end
return true
end
function QUEST:RemoveQuestItem( player, data )
for uid, num in pairs( data ) do
player:getChar():getInv():remove(player:getChar():getInv():hasItem( uid ):getID(), false, false)
end
end
function QUEST:PostReward( player, data )
return true
end
PLUGIN:RegisterQuest( QUEST.uniqueID, QUEST )
---------------------------------
--- HOENYA HIDEOUT QUEST
--- COLELCT ONE ITEM FOR SOMEONE
--- THE ITEM HAS TO BE COLLECTED WILL BE RANDOMIZED IN randomItem.
local QUEST = {}
QUEST.uniqueID = "honeya"
QUEST.name = "Honeya Hideout's Problem"
QUEST.desc = "Get %s of %s for Honeya Hideout." -- If you don't know how it's working, Just check in sh_advhandler.lua in dialogue.
QUEST.quickRewards = {
currency = 100,
items = {
{ uid = "kolb", amount = 1, data = {} },
}
}
QUEST.randomItem = { --
{ uid = "kolb", min = 1, max = 1 },
}
function QUEST:GenerateData( player )
local tbl = {}
for i = 0, 0 do
local idat = table.Random( self.randomItem )
tbl[ idat.uid ] = math.random( idat.min, idat.max )
print( 'inserted '.. idat.uid )
end
return tbl
end
function QUEST:CanComplete( player, data )
for uid, num in pairs( data ) do
if !player:getChar():getInv():hasItem( uid ) then
print( Format( "lack of %s of %s", num, uid ) )
return false
end
end
return true
end
function QUEST:RemoveQuestItem( player, data )
for uid, num in pairs( data ) do
player:getChar():getInv():remove(player:getChar():getInv():hasItem( uid ):getID(), false, false)
end
end
function QUEST:PostReward( player, data )
print( 'PostReward')
return true
end
PLUGIN:RegisterQuest( QUEST.uniqueID, QUEST )
А это я дебил, в контенте сервера нету этих артефактов, вот ему это и не нравится.Neon, можете объяснить причину этой ошибки . Используется данный квест art, никакие изменения не вносились.
[ERROR] gamemodes/nutscript/plugins/talknpc/derma/sh_advhandler.lua:92: attempt to index a nil value
1. cl - gamemodes/nutscript/plugins/talknpc/derma/sh_advhandler.lua:92
2. unknown - gamemodes/nutscript/plugins/talknpc/derma/sh_advhandler.lua:152
3. func - gamemodes/nutscript/gamemode/core/libs/thirdparty/sh_netstream2.lua:155
4. unknown - lua/includes/extensions/net.lua:32Код:local PLUGIN = PLUGIN nut.plugin = nut.plugin or {} nut.plugin.list = nut.plugin.list or {} --PrintTable(nut.plugin.list.quests) local questPLUGIN = nut.plugin.list.quests--nut.plugins.list( "quests" ) if not questPLUGIN then print( 'quest_honeya example will not work properly without "quest" plugin.' ) end /*--------------------------------------------------------- This is advanced handler for dialogue plugin. You can make some quest like things with this. But I recommends you don't care about this handler If you don't know how to code. I will not answer any question about how to use this plugin. Unless you have any clue about this dialogue handler. --------------------------------------------------------*/ -- You can call SpecialCall with !. -- example. when a player call dialouge that has uid "!quest_recieve_test" then it will call SpecialCall["quest_receive_test"]. PLUGIN.SpecialCall = { ["quest_honeya"] = { -- QUEST EXAMPLE. sv = function( client, data ) if client:HasQuest( "honeya" ) then -- questPLUGIN = from the "quests" plugin. local pqst_dat = client:GetQuest( "honeya" ) -- get player quest data if client:CanCompleteQuest( "honeya", pqst_dat ) then -- If see player can complete quest client:GiveQuestReward( "honeya", pqst_dat ) -- Give quest reward client:RemoveQuest( "honeya" ) -- and remove player quest. data.done = true -- send client data.done. It will generate you're done text. else data.done = false end else -- set quest and get quest. data.gotquest = true -- Just got a quest! local d_qst = questPLUGIN:GetQuest( "honeya" ) client:AddQuest( "honeya", d_qst:GenerateData( client ) ) -- Give a quest that has uniqueid 'honeya' and generates random data for quest. -- Quest data generating function is in sh_quests.lua file. end return data -- MUST RETURN DATA end, cl = function( client, panel, data ) if data.gotquest then local d_qst = questPLUGIN:GetQuest( "honeya" ) local pqst_dat = LocalPlayer():GetQuest( "honeya" ) -- get player quest data panel:AddChat( data.name, "Can you get some items for me?" ) for k, v in pairs( pqst_dat ) do panel:AddCustomText( Format( d_qst.desc, unpack( { v, nut.item.list[k].name } ) ), "nut_ChatFont" ) end panel.talking = false -- Get quest and end the converstaion. return end if data.done then panel:AddChat( data.name, "Okay I'll give you some moeney!") else panel:AddChat( data.name, "You don't have enough items to return your quest.") end panel.talking = false end, }, ["quest_art"] = { sv = function( client, data ) if client:HasQuest( "art" ) then -- questPLUGIN = from the "quests" plugin. local pqst_dat = client:GetQuest( "art" ) -- get player quest data if client:CanCompleteQuest( "art", pqst_dat ) then -- If see player can complete quest client:GiveQuestReward( "art", pqst_dat ) -- Give quest reward client:RemoveQuest( "art" ) -- and remove player quest. data.done = true -- send client data.done. It will generate you're done text. else data.done = false end else -- set quest and get quest. data.gotquest = true -- Just got a quest! local d_qst = questPLUGIN:GetQuest( "art" ) client:AddQuest( "art", d_qst:GenerateData( client ) ) -- Give a quest that has uniqueid 'honeya' and generates random data for quest. -- Quest data generating function is in sh_quests.lua file. end return data -- MUST RETURN DATA end, cl = function( client, panel, data ) if data.gotquest then local d_qst = questPLUGIN:GetQuest( "art" ) local pqst_dat = LocalPlayer():GetQuest( "art" ) panel:AddChat( data.name, "Есть один заказ:" ) for k, v in pairs( pqst_dat ) do panel:AddCustomText( Format( d_qst.desc, unpack( { v, nut.item.list[k].name } ) ), "nut_ChatFont" ) end panel.talking = false -- Get quest and end the converstaion. return end if data.done then panel:AddChat( data.name, "Ну, спасибо! Выручил! Держи оплату.") else panel:AddChat( data.name, "Как-то я не заметил, что у тебя есть нужный артефакт. Я же говорил:") local d_qst = questPLUGIN:GetQuest( "art" ) local pqst_dat = LocalPlayer():GetQuest( "art" ) for k, v in pairs( pqst_dat ) do panel:AddCustomText( Format( d_qst.desc, unpack( { v, nut.item.list[k].name } ) ), "nut_ChatFont" ) end end panel.talking = false end, }, ["test2"] = { sv = function( client, data ) return data -- MUST RETURN DATA end, cl = function( client, panel, data ) panel.talking = false -- Ends the current conversation and allows player to talk about other topics. end, }, ["test"] = { sv = function( client, data ) client:EmitSound( "items/smallmedkit1.wav" ) client:SetHealth( 100 ) return data -- MUST RETURN DATA end, cl = function( client, panel, data ) panel:AddChat( data.name, "By the name of Black Tea! You're healed!" ) panel.talking = false -- Ends the current conversation and allows player to talk about other topics. end, }, } -- Handler. if SERVER then netstream.Hook( "nut_DialogueMessage", function( client, data ) if string.Left( data.request, 1 ) == "!" then data.request = string.sub( data.request, 2 ) if PLUGIN.SpecialCall[ data.request ] then data = PLUGIN.SpecialCall[ data.request ].sv( client, data ) netstream.Start( client, "nut_DialoguePingpong", data ) else print( Format( "%s( %s ) tried to call invalid dialouge request( %s ) from %s.", client:Name(), client:Nick(), data.request, data.name ) ) print( "Please check PLUGIN.SpecialCall or NPC's dialouge unique id." ) client:EmitSound( "HL1/fvox/hev_general_fail.wav" ) end end end) else netstream.Hook( "nut_DialoguePingpong", function( data ) if IsValid( nut.gui.dialogue ) then if PLUGIN.SpecialCall[ data.request ] then PLUGIN.SpecialCall[ data.request ].cl( client, nut.gui.dialogue, data ) end end end) end
Заранее спасибо.Код:local PLUGIN = PLUGIN --------------------------------- --- BUYER QUEST --- COLLECT ONE ARTIFACT FOR SOMEONE --- THE ITEM HAS TO BE COLLECTED WILL BE RANDOMIZED IN randomItem. local QUEST = {} QUEST.uniqueID = "art" QUEST.name = "Заказ от важной шишки" QUEST.desc = "Достань мне %s артефакт %s для важного клиента, плачу 2.5 тысячи. Только быстрее." -- If you don't know how it's working, Just check in sh_advhandler.lua in dialogue. QUEST.quickRewards = { currency = 2500, items = {} } QUEST.randomItem = { -- { uid = "battery", min = 1, max = 1 }, { uid = "eye", min = 1, max = 1 }, { uid = "jellyfish", min = 1, max = 1 }, { uid = "meatchunk", min = 1, max = 1 }, } function QUEST:GenerateData( player ) local tbl = {} for i = 0, 0 do local idat = table.Random( self.randomItem ) tbl[ idat.uid ] = math.random( idat.min, idat.max ) end return tbl end function QUEST:CanComplete( player, data ) for uid, num in pairs( data ) do if !player:getChar():getInv():hasItem( uid ) then return false end end return true end function QUEST:RemoveQuestItem( player, data ) for uid, num in pairs( data ) do player:getChar():getInv():remove(player:getChar():getInv():hasItem( uid ):getID(), false, false) end end function QUEST:PostReward( player, data ) return true end PLUGIN:RegisterQuest( QUEST.uniqueID, QUEST ) --------------------------------- --- HOENYA HIDEOUT QUEST --- COLELCT ONE ITEM FOR SOMEONE --- THE ITEM HAS TO BE COLLECTED WILL BE RANDOMIZED IN randomItem. local QUEST = {} QUEST.uniqueID = "honeya" QUEST.name = "Honeya Hideout's Problem" QUEST.desc = "Get %s of %s for Honeya Hideout." -- If you don't know how it's working, Just check in sh_advhandler.lua in dialogue. QUEST.quickRewards = { currency = 100, items = { { uid = "kolb", amount = 1, data = {} }, } } QUEST.randomItem = { -- { uid = "kolb", min = 1, max = 1 }, } function QUEST:GenerateData( player ) local tbl = {} for i = 0, 0 do local idat = table.Random( self.randomItem ) tbl[ idat.uid ] = math.random( idat.min, idat.max ) print( 'inserted '.. idat.uid ) end return tbl end function QUEST:CanComplete( player, data ) for uid, num in pairs( data ) do if !player:getChar():getInv():hasItem( uid ) then print( Format( "lack of %s of %s", num, uid ) ) return false end end return true end function QUEST:RemoveQuestItem( player, data ) for uid, num in pairs( data ) do player:getChar():getInv():remove(player:getChar():getInv():hasItem( uid ):getID(), false, false) end end function QUEST:PostReward( player, data ) print( 'PostReward') return true end PLUGIN:RegisterQuest( QUEST.uniqueID, QUEST )
По этому поводу не беспокойся.А это я дебил, в контенте сервера нету этих артефактов, вот ему это и не нравится.
PS а как удалять свои сообщения, чтобы спама не было