Jump to content

Search the Community

Showing results for tags 'Lua'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Russian Section
    • Новости и объявления
    • Пиратия: Документация
    • Пиратия: Релизы
    • Пиратия: Разработка
    • Пиратия: Web
    • Пиратия: Помощь
    • Совместные проекты / набор команды
    • Доска объявлений
    • Программирование
    • Оффтопик
    • Корзина
  • English Section
    • News & Announcements
    • Guides
    • Releases
    • Development
    • Web
    • Questions & Help
    • Shared Projects / Team search
    • Paid services & Requests
    • Programming
    • Offtopic
    • Recycle bin
  • Portuguese Section
    • Dúvidas & Ajuda
  • Spanish Section
    • Preguntas y Ayuda
  • Servers
    • Russian servers
    • English servers

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 20 results

  1. [Mod] GMNotice() function The mod adds the GMNotice() function to the GameServer.exe LUA scripts, which allows you to send messages to players in the GM chat channel (ALT + P): GMNotice("Hello PKOdev.NET! This is a GM message.") Requirements Installed mod loading system for server and client (PKOdev.NET mod loader) version 1.1 or above. Modification information Name: pkodev.mod.gmnotice; Version: 1.0; Author: V3ct0r; Type: for server (GameServer.exe and GroupServer.exe); Supported executable .exe files: GAMESERVER_136, GAMESERVER_138 and GROUPSERVER_138. Installation 1) Place the mod DLL file "pkodev.mod.gmnotice.server.<VERSION>.dll" for your version of GameServer.exe into the folder "GameServer\mods"; 2) Place the mod DLL file "pkodev.mod.gmnotice.group.<VERSION>.dll" for your version of GroupServer.exe into the folder "GroupServer\mods". Download 1) Actual mod binaries (.dll); 2) The source code of the mod for Visual Studio 2022 Community (C++). If you encounter any problem, bug or have any questions, then feel free to write in this thread.
  2. Description: I've modified the lua scripts from @V3ct0r's Contract System Mod to be a bit more customizable. With this script you don't need to give player contracts directly via NPC since they can now be random map drops (given directly to their inventory). Download: GitHub It's hosted on GitHub to prevent loss of the script and potentially fix issues in the future if I feel like it. Installation: Just load the file in your server! If you have a mod/extension folder, you can go ahead and call it from there. Obviously you need V3ctor's Contract System Mod. This script can work on sources, but you will need to modify client source to show the item hints properly. Not hard to do, but I won't be providing anything related to that here! Like I said, just load the file, I won't help with that, sorry! The script is a stand-alone, no other functions are needed (hopefully). The only function neeeded is already hooked. Usage Details: As stated on V3ctor's original thread, create a new item within your ItemInfo. The item's ID must match what is defined in ContractSys.Conf.ItemID. ContractSys.Conf.ItemID = XXXXX The item's type must match ContractSys.Conf.ItemType. ContractSys.Conf.ItemType = 99 The item's function must be the following: ItemUse_ContractSys The system must be enabled by setting ContractSys.Conf.Enabled to true. ContractSys.Conf.Enabled = true If you want contract to be given randomly by killing monsters, then this variable ContractSys.Conf.World.Enabled must be set to true. ContractSys.Conf.World.Enabled = true In reality, this must be always set to true since there's no other option to get contracts from, they were not implemented! Adjust the maximum of active contracts a player can have at a single time. ContractSys.Conf.Limit Add your map to the allowed list, set it to true and adjust the probability to your needs. The probability is from 0 to 100. ContractSys.Conf.Maps['<MAP_NAME>'] = {Allow = true, Probability = 10} I have some examples in there for Forsaken City, Dark Swamp and Demonic World. You can follow those as guidance. Add some monsters that spawn in your map, along with their probability, minimum and maximum quantities. ContractSys.Monsters['<MAP_NAME>'] = { {Allow = true, ID = <MONSTER_ID>, Min = <MIN_QTY>, Max = <MAX_QTY>, Rate = <MONSTER_RATE>}, } <MAP_NAME>: This is your map's name like "abandonedcity". <MONSTER_ID>: The monster's ID that spawns in that map. <MIN_QTY> / <MAX_QTY>: The minimum and maximum quantity that the player can be tasked to killed. <MONSTER_RATE>: The rate as a number that is used to add weight to the item. This number will be added with the other rates from the monsters in this map's monster list, the lower the number compared to others, the lower probability this monster will appear in a contract. I have some examples in there from Forsaken City, Dark Swamp and Demonic World. Add some rewards to be given when completing contracts obtained from your map. ContractSys.Rewards.Maps['<MAP_NAME>'] = { {Allow = true, Gold = <GOLD_AMOUNT>, ID = <ITEM_ID>, Min = <MIN_QTY>, Max = <MAX_QTY>, Quality = <ITEM_QUALITY>, Rate = <REWARD_RATE>}, {Allow = true, Gold = <GOLD_AMOUNT>, ID = <ITEM_ID>, Min = <MIN_QTY>, Max = <MAX_QTY>, Quality = <ITEM_QUALITY>, Rate = <REWARD_RATE>}, {Allow = true, Gold = <GOLD_AMOUNT>, ID = <ITEM_ID>, Min = <MIN_QTY>, Max = <MAX_QTY>, Quality = <ITEM_QUALITY>, Rate = <REWARD_RATE>}, {Allow = true, Gold = <GOLD_AMOUNT>, ID = <ITEM_ID>, Min = <MIN_QTY>, Max = <MAX_QTY>, Quality = <ITEM_QUALITY>, Rate = <REWARD_RATE>}, } <MAP_NAME>: Your maps' name, such as "abandonedcity". <GOLD_AMOUNT>: The amount of gold to be given (if none, just set to zero). <ITEM_ID>: The item's ID to be given. <MIN_QTY> / <MAX_QTY>: The minimum and maximum quantity that can be given from the previous item. <ITEM_QUALITY>: The quality of the item (mostly used for gems). <REWARD_RATE>: The rate as a number that is used to add weight to the reward. This number will be added with the other rates from the items in this map's reward list, the lower the number compared to others, the lower probability this reward will appear in a contract. Now, if you want a monster to have specific reward, you can also add that. This will override other reward tables. ContractSys.Rewards.Specific[<MONSTER_ID>] = { {Allow = true, Gold = <GOLD_AMOUNT>, ID = <ITEM_ID>, Min = <MIN_QTY>, Max = <MAX_QTY>, Quality = <ITEM_QUALITY>, Rate = <REWARD_RATE>}, {Allow = true, Gold = <GOLD_AMOUNT>, ID = <ITEM_ID>, Min = <MIN_QTY>, Max = <MAX_QTY>, Quality = <ITEM_QUALITY>, Rate = <REWARD_RATE>}, {Allow = true, Gold = <GOLD_AMOUNT>, ID = <ITEM_ID>, Min = <MIN_QTY>, Max = <MAX_QTY>, Quality = <ITEM_QUALITY>, Rate = <REWARD_RATE>}, {Allow = true, Gold = <GOLD_AMOUNT>, ID = <ITEM_ID>, Min = <MIN_QTY>, Max = <MAX_QTY>, Quality = <ITEM_QUALITY>, Rate = <REWARD_RATE>}, } <MONSTER_ID>: The monster's ID that will have specific rewards. <GOLD_AMOUNT>: The amount of gold to be given (if none, just set to zero). <ITEM_ID>: The item's ID to be given. <MIN_QTY> / <MAX_QTY>: The minimum and maximum quantity that can be given from the previous item. <ITEM_QUALITY>: The quality of the item (mostly used for gems). <REWARD_RATE>: The rate as a number that is used to add weight to the reward. This number will be added with the other rates from the items in this map's reward list, the lower the number compared to others, the lower probability this reward will appear in a contract. Script Logic: Player defeats a monster. System will look if the map where the player is located is defined. If defined, then it will grab a monster from that list. If not defined, it will grab a monster from the generic list. It will set the monster to the contract and a random amount between the minimum and maximum quantity available. Player must defeat the quantity of the monster set within the contract. Upon completion, player must double click the contract to finish. System will look if the monster has a specific reward and choose one from there. If no specific reward is set for that monster, then it will iterate through all the maps defined to see if the monster is defined within there. If a defined monster is found, then it will grab a reward from that map's list. If no reward has been chosen, then it will grab a reward from the generic list. The gold (if any) and item (if any) will be given to player. The quantity will be random from the minimum and maximum set.
  3. [Мод] Функция GMNotice() Мод добавляет в LUA-скрипты GameServer.exe функцию GMNotice(), которая позволяет отправлять сообщения игрокам в канал GM-чата (ALT + P): GMNotice("Hello PKOdev.NET! This is a GM message.") Требования Установленный Загрузчик модов для сервера и клиента (PKOdev.NET mod loader) версии не ниже 1.1. Информация о моде Название: pkodev.mod.gmnotice; Версия: 1.0; Автор: V3ct0r; Тип: для сервера (GameServer.exe и GroupServer.exe); Поддерживаемые исполняемые .exe файлы: GAMESERVER_136, GAMESERVER_138 и GROUPSERVER_138. Установка 1) Поместите файл DLL-библиотеки мода "pkodev.mod.gmnotice.server.<VERSION>.dll" для Вашей версии GameServer.exe в папку "GameServer\mods"; 2) Поместите файл DLL-библиотеки мода "pkodev.mod.gmnotice.group.<VERSION>.dll" для Вашей версии GroupServer.exe в папку "GroupServer\mods". Скачать 1) Бинарные файлы мода (.dll); 2) Исходный код мода для Visual Studio 2022 Community (C++). Если Вы столкнулись с какой-либо проблемой, багом или у Вас возникли вопросы, то пишите в данной теме.
  4. Hello community of pkoDev! I have come today today in order sell services and files. Lets get straight to the point. Scripting Services I offer a very limited variety of scripting services, let me make it clear, "service". I will not join a team to open a server. Here is a small list of things I can do, please do take note it's only Lua. Modify existing functions/system in order to make it easier for your use; that includes being able to add, modify and remove things easier than adding a new function per thing as it's currently on many functions by default. Simple Functions Fairy System Ticket System Upgrade System Create scripts for maps, can be simple or complex, depends on how hard it's for me to actually create it. It can be instanced or not. Rush Capture The Flag Anomaly Tower Create custom quests for killing monsters and players within certain maps and being certain class. In case you don't know how to use my guide. Create custom scripts. Contract System (modified from V3ctor's Contract System Mod). Fix general errors or make small things for you. Price may vary depending on what you want. Server Files I'm selling custom server files, they're based on v138. GitHub Description: Features - Server Owner GitHub Description: Features - Player Notes: They're based off of PKO 1.38. They make use of V3ctor's Mod System. Extra: They contain Contract System, however, the script was completed re-written and is now more customizable and allows the contracts to be random drops for general maps or specific maps and allow for rewards from general monsters, map specific monsters or bosses. It refers to this. They contain: Server Files. Client Files. Databases (+ SQL Queries). Executables (+ IGS). Also includes Anomaly Tower. Price (negotiable): One-Time Sale. Support. Will provide updates for any custom lua script only. Updates will be via GitHub so things can be transparent and you can see what the changes were. No support provided for exes (server or client). Contact Information: Discord: Angelix#2836 pkoDev: Private Message Mostly like to answer through Discord and more frequently.
  5. [Скрипт] Система промокодов Данный скрипт реализует простую систему промокодов. Игроки могут использовать промокоды для получения предметов. Промокоды вводятся в канал местного чата через косую черту, например: /agjtjSfsaAS34 Промокод можно использовать только один раз. Для хранения промокодов используется текстовый файл. Требования Для работы скрипта требуется GameServer.exe с поддержкой функции HandleChat() - обработчик сообщений в местный чат. Установка скрипта 1) Создайте файл с названием "pkodev.promo.lua" в следующей директории GameServer: GameServer\resource\script\calculate\mods 2) Запишите в файл следующий код: -- Print a log print("Loading pkodev.promo.lua") -- Check that HandleChat function exists if (HandleChat == nil) then -- Write a log print("pkodev.promo.lua: Warning, the HandleChat() function is not exist!") -- Do not load the script return end -- Promocodes system promo = promo or { } -- Name of the file with promocodes promo.file = "promocodes.dat" -- List with promocodes promo.list = {} -- Save data to file promo.save = function(path) -- Open the file local file, msg = io.open(path, "w") -- Check that file is open if (file == nil) then -- Write a log LG("pkodev.mod.promo", string.format("Can't save the list with promocodes to the file '%s': '%s'!", path, msg)) return false end -- Write data for key, value in promo.list do -- Write a line local ret = file:write(string.format("{%s, %d, %d}\n", value.code, value.id, value.count)) -- Check that line is written if (ret == false) then -- Write a log LG("pkodev.mod.promo", string.format("Can't write the data to the file '%s'!", path)) return false end end -- Flush the data file:flush() -- Close the file file:close() -- Write a log LG("pkodev.mod.promo", string.format("The list with promocodes has been successfully saved to the file '%s'!", path)) return true end -- Load data from file promo.load = function(path) -- Remove old promocodes for k in pairs (promo.list) do promo.list[k] = nil end -- Open the file local file, msg = io.open(path, "r") -- Check that file is open if (file == nil) then -- Write a log LG("pkodev.mod.promo", string.format("Can't load the list with promocodes from the file '%s': '%s'!", path, msg)) return false end -- Read file line by line for line in file:lines() do -- Extract data from the line local ret, _, code_, id_, count_ = string.find(line, "^{([A-Za-z0-9]+)%s*,%s*([0-9]+)%s*,%s*([0-9]+)}$") -- Check that string matches the pattern if (ret ~= nil) then -- Add data to the list table.insert( promo.list, { code = code_, id = id_, count = count_, } ) end end -- Close the file file:close() -- Write a log LG("pkodev.mod.promo", string.format("%d promocodes have been succsessfully loaded from file '%s'!", table.getn(promo.list), path)) return true end -- Handle chat function hook promo.hadle_chat__original = HandleChat HandleChat = function(role, msg) -- Check that message has the '/' symbol if ( string.sub(msg, 1, 1) == "/" ) then -- Get promocode local ret, _, code_ = string.find(msg, "^/([A-Za-z0-9]+)%s*$") -- Check that promocode is found if (ret ~= nil) then -- Search the promocode in the list for key, value in pairs(promo.list) do -- Compare promocodes if (value.code == code_) then -- Write a message BickerNotice(role, string.format("You entered the promocode '%s': %s x %d!", value.code, GetItemName(value.id), value.count) ) -- Give an item GiveItem(role, 0, value.id, value.count, 0) -- Write a log LG("pkodev.mod.promo", string.format("Player '%s' entered a promocode '%s' and received '%s' x %d!", GetChaDefaultName(role), value.code, GetItemName(value.id), value.count) ) -- Remove the promocode from the list promo.list[key] = nil -- Save the list to the file promo.save(promo.file) -- Synchronize the promocodes list local packet = GetPacket() WriteCmd(packet, 4015) WriteDword(packet, GetRoleID(role)) WriteString(packet, string.format("promo.list[%d]=nil", key)) SendPacket(role, packet) -- Do not call the original function HandleChat() return 0 end end end end -- Call the original function HandleChat() return promo.hadle_chat__original(role, msg) end promo.load(promo.file) 3) Подключите файл "pkodev.promo.lua" в начале файла "SkillEffect.lua" (\GameServer\resource\script\calculate) после включения файла "functions.lua": dofile(GetResPath("script\\calculate\\mods\\pkodev.promo.lua")) 4) В корневой директории GameServer.exe создайте файл "promocodes.dat" и запишите в него список промокодов в следующем формате: {<Промокод>, <ID предмета>, <Количество предметов>} Например: {agjtjSfsaAS34, 1849, 45} {kgjKKKsnggklsaa, 885, 1} {0004121aAf, 1848, 10} Использование скрипта 1) Чтобы задействовать промокод, игрок должен ввести его в канал местного чата, например: /agjtjSfsaAS34 В результате игрок получит Кекс х 45. 2) Логи использования промокодов можно найти в файле: GameServer\LOG\log\pkodev.mod.promo.txt Что можно улучшить 1) В качестве награды можно также выдавать золото, бафы и другие бонусы; 2) Список промокодов можно хранить в базе данных, например, с применением библиотеки LuaSQL; 3) Можно сделать промокоды многоразовыми, но один игрок может использовать промокод только раз.
  6. [Script] Promo code system This script implements a simple promo code system. Players can use promo codes to get items. Promo codes are entered into the local chat channel through a slash, for example: /agjtjSfsaAS34 The promo code can only be used once. A text file is used to store promo codes. Requirements The script requires GameServer.exe with the HandleChat() function support - local chat messages handler. Installing the script 1) Create a file named "pkodev.promo.lua" in the folder "GameServer\resource\script\calculate\mods" with the following contents: -- Print a log print("Loading pkodev.promo.lua") -- Check that HandleChat function exists if (HandleChat == nil) then -- Write a log print("pkodev.promo.lua: Warning, the HandleChat() function is not exist!") -- Do not load the script return end -- Promocodes system promo = promo or { } -- Name of the file with promocodes promo.file = "promocodes.dat" -- List with promocodes promo.list = {} -- Save data to file promo.save = function(path) -- Open the file local file, msg = io.open(path, "w") -- Check that file is open if (file == nil) then -- Write a log LG("pkodev.mod.promo", string.format("Can't save the list with promocodes to the file '%s': '%s'!", path, msg)) return false end -- Write data for key, value in promo.list do -- Write a line local ret = file:write(string.format("{%s, %d, %d}\n", value.code, value.id, value.count)) -- Check that line is written if (ret == false) then -- Write a log LG("pkodev.mod.promo", string.format("Can't write the data to the file '%s'!", path)) return false end end -- Flush the data file:flush() -- Close the file file:close() -- Write a log LG("pkodev.mod.promo", string.format("The list with promocodes has been successfully saved to the file '%s'!", path)) return true end -- Load data from file promo.load = function(path) -- Remove old promocodes for k in pairs (promo.list) do promo.list[k] = nil end -- Open the file local file, msg = io.open(path, "r") -- Check that file is open if (file == nil) then -- Write a log LG("pkodev.mod.promo", string.format("Can't load the list with promocodes from the file '%s': '%s'!", path, msg)) return false end -- Read file line by line for line in file:lines() do -- Extract data from the line local ret, _, code_, id_, count_ = string.find(line, "^{([A-Za-z0-9]+)%s*,%s*([0-9]+)%s*,%s*([0-9]+)}$") -- Check that string matches the pattern if (ret ~= nil) then -- Add data to the list table.insert( promo.list, { code = code_, id = id_, count = count_, } ) end end -- Close the file file:close() -- Write a log LG("pkodev.mod.promo", string.format("%d promocodes have been succsessfully loaded from file '%s'!", table.getn(promo.list), path)) return true end -- Handle chat function hook promo.hadle_chat__original = HandleChat HandleChat = function(role, msg) -- Check that message has the '/' symbol if ( string.sub(msg, 1, 1) == "/" ) then -- Get promocode local ret, _, code_ = string.find(msg, "^/([A-Za-z0-9]+)%s*$") -- Check that promocode is found if (ret ~= nil) then -- Search the promocode in the list for key, value in pairs(promo.list) do -- Compare promocodes if (value.code == code_) then -- Write a message BickerNotice(role, string.format("You entered the promocode '%s': %s x %d!", value.code, GetItemName(value.id), value.count) ) -- Give an item GiveItem(role, 0, value.id, value.count, 0) -- Write a log LG("pkodev.mod.promo", string.format("Player '%s' entered a promocode '%s' and received '%s' x %d!", GetChaDefaultName(role), value.code, GetItemName(value.id), value.count) ) -- Remove the promocode from the list promo.list[key] = nil -- Save the list to the file promo.save(promo.file) -- Synchronize the promocodes list local packet = GetPacket() WriteCmd(packet, 4015) WriteDword(packet, GetRoleID(role)) WriteString(packet, string.format("promo.list[%d]=nil", key)) SendPacket(role, packet) -- Do not call the original function HandleChat() return 0 end end end end -- Call the original function HandleChat() return promo.hadle_chat__original(role, msg) end promo.load(promo.file) 2) Include it in the file "SkillEffect.lua" (\GameServer\resource\script\calculate) after "functions.lua" inclusion: dofile(GetResPath("script\\calculate\\mods\\pkodev.promo.lua")) 3) In the root directory of the GameServer create a file named "promocodes.dat" and write the list of promocodes in the following format: {<Promocode>, <Item ID>, <Item number>} Example: {agjtjSfsaAS34, 1849, 45} {kgjKKKsnggklsaa, 885, 1} {0004121aAf, 1848, 10} Using the script 1) To use a promocode, player should enter it in the local chat: /agjtjSfsaAS34 The player will get Cake x 45. 2) All logs regarding promo codes usage can be found in the file: GameServer\LOG\log\pkodev.mod.promo.txt What can be improved 1) As a reward, you can also give gold, buffs and other bonuses; 2) The list of promotional codes can be stored in the database, for example, using the LuaSQL library; 3) You can make promotional codes reusable, but one player can use the promotional code only once.
  7. [Fix] Bug fix for TransformCha() function (character transformation) Hello friends! I think many people know about the bug associated with the TransformCha() function, when using it, the character's hat disappears. In this thread I will show you how to fix this bug. Thanks to @Де-Компанье for the solution! 1) Open GameServer.exe with the character transformation function (TransformCha()) in any HEX editor. For example, in HxD. 2) Find the sequence of bytes: 05 98 00 00 00 89 45 EC 8B 45 FC 05 32 6E 00 00 8B 5D F8 89 18 8B 45 FC 83 C0 58 8B 5D F8 89 18 6A 00 3) Replace these bytes with the following ones: 05 98 00 00 00 89 45 EC 8B 45 FC 50 05 32 6E 00 00 8B 5D F8 66 89 18 58 83 C0 58 8B 5D F8 89 18 6A 00 4) Save the changes. Now, when transforming character, the hat will not disappear.
  8. [Script] Quest requires 'X' hours after the start Hello! In this thread I am posting an example of script that will allow you to check the condition when the player completes the quest: 'X' time has to pass after starting the quest to complete it. Usage MisResultCondition(MissionTimeExpired, <quest_id>, <time_in_seconds_to_wait>) Installation Add the following code to the file 'vairable.lua': -- Table with the time of taking quests by characters if (quest_table_guard == nil) then quest_table_guard = true quest_table = { } end Add to the file 'functions.lua': -- Quest added event AddMission__Original = AddMission AddMission = function(role, id, param) -- Call original AddMission function local ret = AddMission__Original(role, id, param) -- Check the result if ( ret == LUA_TRUE ) then -- Add the quest to the table quest_table[id] = quest_table[id] or {} -- Remember the time when the character took the quest quest_table[id][ GetRoleID(role) ] = os.time() end -- Return original result return ret end -- Check that some time expired since character taken the quest function MissionTimeExpired(role, id, t) -- Check that quest exists in the table if ( quest_table[id] == nil ) then -- Quest not found return LUA_TRUE end -- Get character ID local cha_id = GetRoleID(role) -- Check that the character has the quest if ( quest_table[id][cha_id] == nil ) then -- Character doesn't have the quest ?! return LUA_TRUE end -- Calculte time delta local delta = ( os.time() - quest_table[id][cha_id] ) -- Check that t seconds expired since quest started if ( delta >= t ) then -- Remove character from table quest_table[id][cha_id] = nil -- Condition is completed return LUA_TRUE end -- Condition is not completed return LUA_FALSE end And finally register the new function in the file 'MissionSdk.lua' ('ConditionsTest' function): . . . elseif conditions[i].func == MissionTimeExpired then local ret = MissionTimeExpired( character, conditions[i].p1, conditions[i].p2 ) if ret ~= LUA_TRUE then PRINT( "ConditionsTest: MissionTimeExpired = false" ) return LUA_FALSE end . . . That's all! Note: 1) All data about the time of taking quests by characters will be lost when the server is restarted. You need to come up with a mechanism for saving the table 'quest_table' to a file or database if this is critical for your application; 2) NPCs that give and accept a quest with this condition must be within the same GameServer instance.
  9. Scheduled player reward system With the help of this system, it is possible to give out to all players on the server at a certain time the reward (gift) specified in the schedule: all players who are currently online will receive an item. How to install 1) Create a file named "pkodev.gift.lua" in folder "GameServer\resource\script\calculate\mods"; 2) Put the following code to the file: -------------------------------------------------------------- -- Gift system script -- -- Author: V3ct0r from PKODev.NET -- Version: 1.0 (11/08/2021) -- -- How to install the system: -- 1) Put this file to '\GameServer\resource\script\calculate\mods' folder -- 2) Put the following line at the beginning of 'mlist.lua' file: -- dofile(GetResPath("script\\calculate\\mods\\pkodev.gift.lua")) -- 3) Done! -- -- Interface: -- 1) Add a gift to queue: -- local gift_id = giftmod:addGift(item_id, number, hour, minute, second, month, day, year) -- 2) Remove a gift from queue -- local success = giftmod:removeGift(gift_id) -- Where 'success' can be 'true' or 'false' -- 3) Get gift number in queue -- local number = giftmod:getGiftNumber() -- 4) Print a list of queued gifts in GameServer window: -- giftmod:printGifts() -- -- These commands also can be used with &lua_all GM-command, for example: -- &lua_all giftmod:addGift(item_id, number, hour, minute, second, month, day, year) -- Note: After GameServer.exe restart gifts. which were added using GM-command, will be removed -------------------------------------------------------------- -- Update guard if (PKODEV_GIFT_GUARD ~= nil) then -- Exit the script return end -- Define update guard PKODEV_GIFT_GUARD = true -- Print a log print("Loading pkodev.gift.lua") -- Class Gift Gift = {} -- Make a Gift function Gift:new(id, item_id, count, gift_time) -- Private fields local private = { id = id or -1, item_id = item_id or -1, count = count or 0, gift_time = gift_time or 0, is_given = false } -- Public fields local public = { } -- Get an gift ID function public:getId() return private.id end -- Get an item id function public:getItemId() return private.item_id end -- Get an item count function public:getItemCount() return private.count end -- Get a time at which to give the gift function public:getTime() return private.gift_time end setmetatable(public, self) self.__index = self; return public end -- Class GiftSystem GiftSystem = {} -- Make a Gift system function GiftSystem:new() -- Private fields local private = { -- List of gifts to give gifts = { }, -- List of active players players = { }, -- Timer function timer_func = nil, -- List of hooks hooks = { } } -- Public fields local public = { } -- Player entered a map event function private:on_player_entered_map(role, mapdesc, map) -- Check that map exists in the list if ( private.hooks[map] ~= nil ) then -- Check that enter function is hooked if ( private.hooks[map].enter ~= nil ) then -- Call original function private.hooks[map].enter(role, mapdesc) end end -- Add player to the list private.players[ GetRoleID(role) ] = role end -- Player leaved a map event function private:on_player_leaved_map(role, map) -- Check that map exists in the list if ( private.hooks[map] ~= nil ) then -- Check that leave function is hooked if ( private.hooks[map].leave ~= nil ) then -- Call original function private.hooks[map].leave(role) end end -- Remove player from the list private.players[ GetRoleID(role) ] = nil end -- Timer event function private:on_timer_event(map) -- Check that timer function is hooked if ( private.timer_func ~= nil ) then -- Call original function private.timer_func(map) end -- Get current system time local t = os.time() -- Update gifts for i = table.getn(private.gifts), 1, -1 do -- Get a gift local gift = private.gifts[i] -- Check that it's time to give out the gift if ( t >= gift:getTime() ) then -- Give the gift to players for cha_id, role in pairs(private.players) do GiveItem(role, 0, gift:getItemId(), gift:getItemCount(), 4) end -- Remove the gift from the list table.remove(private.gifts, i) end end end -- Set hooks function private:setHook() -- Search for 'after_enter_', 'before_leave_' and timer functions for key, value in pairs(_G) do -- Get a global item name in lower case local name = string.lower(key) -- Player entered a map if ( string.find(name, "after_enter_") == 1 ) then -- Get map name local map = string.sub(name, string.len("after_enter_") + 1) -- Add map to the list private.hooks[map] = private.hooks[map] or {} -- Associate original enter function address with map name private.hooks[map].enter = value -- Set the hook _G[key] = function(role, mapdesc) private:on_player_entered_map(role, mapdesc, map) end end -- Player leaved a map if ( string.find(name, "before_leave_") == 1 ) then -- Get map name local map = string.sub(name, string.len("before_leave_") + 1) -- Add map to the list private.hooks[map] = private.hooks[map] or {} -- Associate original leave function address with map name private.hooks[map].leave = value -- Set the hook _G[key] = function(role) private:on_player_leaved_map(role, map) end end -- Timer if ( private.timer_func == nil ) then -- Search for timer function if ( string.find(name, "map_copy_run_") == 1 ) then -- Number of underscore characters local n = 0 -- Count the number of underscore characters string.gsub(name, ".", function(c) if ( c == '_' ) then n = n + 1 end end) -- Number of underscore characters should be equal to 3 if (n == 3) then -- Set timer function private.timer_func = value -- Set the hook _G[key] = function(map) private:on_timer_event(map) end end end end end -- Check that timer hook is enabled if ( private.timer_func == nil ) then print("pkodev.gift: Warning, suitable timer function is not found!") end end -- Add a gift to the list function public:addGift(item_id, count, h, m, s, mon, day, year) -- Check item ID if ( string.lower(GetItemName(item_id)) == "unknown" ) then -- Do not add a gift return -1 end -- Check item count if (count <= 0) then -- Do not add a gift return -1 end -- Get item timestamp local gift_timestamp = os.time{ month = mon, day = day, year = year, hour = h, min = m, sec = s } -- Check that item time is not expired if ( gift_timestamp <= os.time() ) then -- Do not add a gift return -1 end -- Get an ID for new gift local gift_id = public:getGiftNumber() -- Create a gift local gift = Gift:new(gift_id, item_id, count, gift_timestamp) -- Add a gift to the list table.insert(private.gifts, gift) -- Return gift ID return gift_id end -- Remove a gift by ID function public:removeGift(gift_id) -- Find a gift in the list for index, gift in pairs(private.gifts) do -- Check gift ID if ( gift_id == gift:getId() ) then -- Remove the gift from the list table.remove(private.gifts, index) -- Gift removed return true end end -- Gift not found return false end -- Get gift number function public:getGiftNumber() return table.getn(private.gifts) end -- Print a list of gifts function public:printGifts() -- Get gift number local n = public:getGiftNumber() -- Check that there are gifts in the list if (n > 0) then -- Print all gifts for index, gift in pairs(private.gifts) do -- Get time data local temp = os.date("*t", gift:getTime()) -- Print a gift print( string.format( "pkodev.gift: %d) [Gift ID: %d] - %s x %d at %02d:%02d:%02d %02d/%02d/%02d", index, gift:getId(), GetItemName(gift:getItemId()), gift:getItemCount(), temp.hour, temp.min, temp.sec, temp.month, temp.day, temp.year ) ) end else -- No gifts print("There are no active gifts!") end end -- Enable the necessary hooks for the gift system to work private:setHook() setmetatable(public, self) self.__index = self; return public end -- Create an instance of the gift system giftmod = GiftSystem:new() -- Add gifts to the queue giftmod:addGift(863, 1, 16, 6, 30, 11, 9, 2022) -- 'Gem of Rage' x 1 at 16:06:30 11/09/2022 giftmod:addGift(684, 1, 16, 7, 25, 11, 15, 2022) -- 'New Sheepskin Scroll' x 1 at 16:07:25 15/09/2022 giftmod:addGift(1849, 99, 12, 7, 0, 11, 18, 2022) -- 'Cake' x 99 at 12:07:00 18/09/2022 -- Print queued gifts giftmod:printGifts() 3) Open file "GameServer\resource\script\monster\mlist.lua" and put at the beginning the line: 4) Start GameServer.exe. You should see in it's console window the following lines: pkodev.gift: 1) [Gift ID: 0] - Gem of Rage x 1 at 16:06:30 11/09/2022 pkodev.gift: 2) [Gift ID: 1] - New Sheepskin Scroll x 1 at 16:07:25 11/15/2022 pkodev.gift: 3) [Gift ID: 2] - Cake x 99 at 12:07:00 11/18/2022 5) Configure the system at your discretion (see the "How to use" section below); 6) The installation process is complete. How to use 1) You can define a queue of gifts at the end of "pkodev.gift.lua" file using giftmod:addGift() command: local gift_id = giftmod:addGift(item_id, number, hour, minute, second, month, day, year) Also you can add a gift to the queue using GM-command*: &lua_all giftmod:addGift(item_id, number, hour, minute, second, month, day, year) *Note: After GameServer.exe restart gifts. which were added using GM-command, will be removed. 2) You can remove pending gifts from the queue using giftmod:removeGift() command: local success = giftmod:removeGift(gift_id) -- Where 'success' can be 'true' or 'false' Where variable gift_id is ID of pending gift which was returned from giftmod:addGift() command. 3) You can get an amount of pending gifts using giftmod:getGiftNumber() command: local number = giftmod:getGiftNumber() 4) Finally, you can display pending gifts in the GameServer.exe window: giftmod:printGifts() That's all! Download the script of the system (3 KB)
  10. Система награды игроков по расписанию С помощью данной системы можно выдавать всем игрокам на сервере в определенное время награду, указанную в расписании: все игроки, которые в данное время будут онлайн, получат предмет. Как установить 1) Создайте файл с названием "pkodev.gift.lua" в директории "GameServer\resource\script\calculate\mods"; 2) Поместите в файл следующий код: -------------------------------------------------------------- -- Gift system script -- -- Author: V3ct0r from PKODev.NET -- Version: 1.0 (11/08/2021) -- -- How to install the system: -- 1) Put this file to '\GameServer\resource\script\calculate\mods' folder -- 2) Put the following line at the beginning of 'mlist.lua' file: -- dofile(GetResPath("script\\calculate\\mods\\pkodev.gift.lua")) -- 3) Done! -- -- Interface: -- 1) Add a gift to queue: -- local gift_id = giftmod:addGift(item_id, number, hour, minute, second, month, day, year) -- 2) Remove a gift from queue -- local success = giftmod:removeGift(gift_id) -- Where 'success' can be 'true' or 'false' -- 3) Get gift number in queue -- local number = giftmod:getGiftNumber() -- 4) Print a list of queued gifts in GameServer window: -- giftmod:printGifts() -- -- These commands also can be used with &lua_all GM-command, for example: -- &lua_all giftmod:addGift(item_id, number, hour, minute, second, month, day, year) -- Note: After GameServer.exe restart gifts. which were added using GM-command, will be removed -------------------------------------------------------------- -- Update guard if (PKODEV_GIFT_GUARD ~= nil) then -- Exit the script return end -- Define update guard PKODEV_GIFT_GUARD = true -- Print a log print("Loading pkodev.gift.lua") -- Class Gift Gift = {} -- Make a Gift function Gift:new(id, item_id, count, gift_time) -- Private fields local private = { id = id or -1, item_id = item_id or -1, count = count or 0, gift_time = gift_time or 0, is_given = false } -- Public fields local public = { } -- Get an gift ID function public:getId() return private.id end -- Get an item id function public:getItemId() return private.item_id end -- Get an item count function public:getItemCount() return private.count end -- Get a time at which to give the gift function public:getTime() return private.gift_time end setmetatable(public, self) self.__index = self; return public end -- Class GiftSystem GiftSystem = {} -- Make a Gift system function GiftSystem:new() -- Private fields local private = { -- List of gifts to give gifts = { }, -- List of active players players = { }, -- Timer function timer_func = nil, -- List of hooks hooks = { } } -- Public fields local public = { } -- Player entered a map event function private:on_player_entered_map(role, mapdesc, map) -- Check that map exists in the list if ( private.hooks[map] ~= nil ) then -- Check that enter function is hooked if ( private.hooks[map].enter ~= nil ) then -- Call original function private.hooks[map].enter(role, mapdesc) end end -- Add player to the list private.players[ GetRoleID(role) ] = role end -- Player leaved a map event function private:on_player_leaved_map(role, map) -- Check that map exists in the list if ( private.hooks[map] ~= nil ) then -- Check that leave function is hooked if ( private.hooks[map].leave ~= nil ) then -- Call original function private.hooks[map].leave(role) end end -- Remove player from the list private.players[ GetRoleID(role) ] = nil end -- Timer event function private:on_timer_event(map) -- Check that timer function is hooked if ( private.timer_func ~= nil ) then -- Call original function private.timer_func(map) end -- Get current system time local t = os.time() -- Update gifts for i = table.getn(private.gifts), 1, -1 do -- Get a gift local gift = private.gifts[i] -- Check that it's time to give out the gift if ( t >= gift:getTime() ) then -- Give the gift to players for cha_id, role in pairs(private.players) do GiveItem(role, 0, gift:getItemId(), gift:getItemCount(), 4) end -- Remove the gift from the list table.remove(private.gifts, i) end end end -- Set hooks function private:setHook() -- Search for 'after_enter_', 'before_leave_' and timer functions for key, value in pairs(_G) do -- Get a global item name in lower case local name = string.lower(key) -- Player entered a map if ( string.find(name, "after_enter_") == 1 ) then -- Get map name local map = string.sub(name, string.len("after_enter_") + 1) -- Add map to the list private.hooks[map] = private.hooks[map] or {} -- Associate original enter function address with map name private.hooks[map].enter = value -- Set the hook _G[key] = function(role, mapdesc) private:on_player_entered_map(role, mapdesc, map) end end -- Player leaved a map if ( string.find(name, "before_leave_") == 1 ) then -- Get map name local map = string.sub(name, string.len("before_leave_") + 1) -- Add map to the list private.hooks[map] = private.hooks[map] or {} -- Associate original leave function address with map name private.hooks[map].leave = value -- Set the hook _G[key] = function(role) private:on_player_leaved_map(role, map) end end -- Timer if ( private.timer_func == nil ) then -- Search for timer function if ( string.find(name, "map_copy_run_") == 1 ) then -- Number of underscore characters local n = 0 -- Count the number of underscore characters string.gsub(name, ".", function(c) if ( c == '_' ) then n = n + 1 end end) -- Number of underscore characters should be equal to 3 if (n == 3) then -- Set timer function private.timer_func = value -- Set the hook _G[key] = function(map) private:on_timer_event(map) end end end end end -- Check that timer hook is enabled if ( private.timer_func == nil ) then print("pkodev.gift: Warning, suitable timer function is not found!") end end -- Add a gift to the list function public:addGift(item_id, count, h, m, s, mon, day, year) -- Check item ID if ( string.lower(GetItemName(item_id)) == "unknown" ) then -- Do not add a gift return -1 end -- Check item count if (count <= 0) then -- Do not add a gift return -1 end -- Get item timestamp local gift_timestamp = os.time{ month = mon, day = day, year = year, hour = h, min = m, sec = s } -- Check that item time is not expired if ( gift_timestamp <= os.time() ) then -- Do not add a gift return -1 end -- Get an ID for new gift local gift_id = public:getGiftNumber() -- Create a gift local gift = Gift:new(gift_id, item_id, count, gift_timestamp) -- Add a gift to the list table.insert(private.gifts, gift) -- Return gift ID return gift_id end -- Remove a gift by ID function public:removeGift(gift_id) -- Find a gift in the list for index, gift in pairs(private.gifts) do -- Check gift ID if ( gift_id == gift:getId() ) then -- Remove the gift from the list table.remove(private.gifts, index) -- Gift removed return true end end -- Gift not found return false end -- Get gift number function public:getGiftNumber() return table.getn(private.gifts) end -- Print a list of gifts function public:printGifts() -- Get gift number local n = public:getGiftNumber() -- Check that there are gifts in the list if (n > 0) then -- Print all gifts for index, gift in pairs(private.gifts) do -- Get time data local temp = os.date("*t", gift:getTime()) -- Print a gift print( string.format( "pkodev.gift: %d) [Gift ID: %d] - %s x %d at %02d:%02d:%02d %02d/%02d/%02d", index, gift:getId(), GetItemName(gift:getItemId()), gift:getItemCount(), temp.hour, temp.min, temp.sec, temp.month, temp.day, temp.year ) ) end else -- No gifts print("There are no active gifts!") end end -- Enable the necessary hooks for the gift system to work private:setHook() setmetatable(public, self) self.__index = self; return public end -- Create an instance of the gift system giftmod = GiftSystem:new() -- Add gifts to the queue giftmod:addGift(863, 1, 16, 6, 30, 11, 9, 2022) -- 'Gem of Rage' x 1 at 16:06:30 11/09/2022 giftmod:addGift(684, 1, 16, 7, 25, 11, 15, 2022) -- 'New Sheepskin Scroll' x 1 at 16:07:25 15/09/2022 giftmod:addGift(1849, 99, 12, 7, 0, 11, 18, 2022) -- 'Cake' x 99 at 12:07:00 18/09/2022 -- Print queued gifts giftmod:printGifts() 3) Откройте файл "GameServer\resource\script\monster\mlist.lua" и в самом начале запишите строку: dofile(GetResPath("script\\calculate\\mods\\pkodev.gift.lua")) 4) Запустите GameServer.exe. В окне консоли Вы должны увидеть следующий вывод: pkodev.gift: 1) [Gift ID: 0] - Gem of Rage x 1 at 16:06:30 11/09/2022 pkodev.gift: 2) [Gift ID: 1] - New Sheepskin Scroll x 1 at 16:07:25 11/15/2022 pkodev.gift: 3) [Gift ID: 2] - Cake x 99 at 12:07:00 11/18/2022 5) Настройте систему по Вашему усмотрению (см. раздел "Как использовать" далее); 6) Процесс установки системы завершен. Как использовать 1) Вы можете определить расписание выдачи наград в конце файла "pkodev.gift.lua" используя команду giftmod:addGift(): local gift_id = giftmod:addGift(ID_предмета, количество, час, минута, секунда, месяц, день, год) Также Вы можете добавить награду в очередь используя GM-команду*: &lua_all giftmod:addGift(ID_предмета, количество, час, минута, секунда, месяц, день, год) *Примечание: После перезапуска GameServer.exe, все награды, которые были добавлены с помощью GM-команды, удалятся. 2) Вы можете удалить награду из расписания с помощью команды "giftmod:removeGift()": local success = giftmod:removeGift(gift_id) -- Где 'success' может быть 'true' или 'false' Где переменная gift_id - это ID награды, которая ранее была добавлена в очередь командой giftmod:addGift(). 3) Вы можете получить число наград в очереди с помощью команды giftmod:getGiftNumber(): local number = giftmod:getGiftNumber() 4) Наконец, Вы можете отобразить очередь наград в окне консоли GameServer.exe: giftmod:printGifts() Это все! Скачать скрипт системы (3 Кб)
  11. Script link Credits to @Sultan for being an inspiration =) note: It has items from 2.4, feel free to remove them if you are planning to use it on older versions
  12. Hello guys! I don't know if you already know me but I am Satan, i was staff of these games that u may played before: Lost Paradise Online, Pirate War Online, Eclipse Online and Pirate Island Online. I'm also an old member of this great community. I'm here to show you some of my work for the game and if you are interested in any of them or anything you want to do (Lua Scripting), feel free to contact me. Completed Addons: Lone Tower Instance Improved Guild System + Guild Bank (NPC BuyPage) Plant the Bomb Sandy Beach Dungeon Maze Information NPC Pirate Island Online Server Files: This server files was developed by a request a customer ask me for, i was one of the staff members and got total permission and agreement of the owner of the features which was made for it. The Server Files includes: Clean Databases for SQL 2008; Query for Databases Server Files exes and cfgs; Custom Server Launcher; LuaSQL.dll; Custom Bin Compiler; FilterServer v2.2; XeroShop (IGS); SQL Password Generator; Client Files; Common Features: Very organizated archives and scripts; Dream City PK In-game Shop - IGS; LuaSQL.dll; OfflineStall(); AfterEnterGame(role); server_timer(); player_timer(); GetGameServerName(); GetChaTempBagItem() + Belt, Handguard and Bracelets for temporary bag; GetPlayerByID; SafeBuyGuild(); SafeSaleGuild(); SetLock(role); GetItemQuantity(role, slot); SQL Injection[]; WPE/RPE Protection[]; Ping Fix[]; Colored Nicknames with necklaces; Player Level display near their name; In-game Database; GM Tools, using userdata and &Lua command; Functionally Antidupe; Cached common .txt files as like: CharacterInfo, ItemInfo, StoneInfo, MapInfo, SkillInfo, Skilleff; There's a link which contais a PDF file with more features and information and a Youtube channel with some videos about the game: Pirate Island Online - Overview Pirate Island Online - Youtube Channel There are lot more that i didn't mention in that file cause it will take what? almost whole day to write and i forget most things i made before also, omg ... Price: $70. Other completed requests: Massive Wipeout Furnace of Immortality - Scroll to store apparel effectiveness Fairy Fusion Mod Ring Fusion Mod + Custom Glow PK Mode System In-game Database: finditem, dropinfo, mobinfo BOSS Summon Event Blessed Chest Event Automated Drop Event Special Apparel NPC Admiral Cloak + Enchant + Glows Horoscope Sign + Visual Effect + Boost Shadow Walk Skill BOSS Dungeon Balanced PK Map: Doesn't matter equipment, gem, pet Custom Map Damage: Melee and hit chance VIP System: Attribute bonuses, visual effect, rewards once being VIP, npc with FAQ and VIP Status Payment Method: Paypal Other brazilian payment method . Contacts: PKOdev -> @Satan Discord -> Eviles#2759 Skype -> satansyn6 Facebook -> https://www.facebook.com/valdineyeviles Gmail -> [email protected] Thank for your time , Satan !
  13. Hello Guys ! I'm trying to create a function which will display portal information such as: open every x, portal duration, map information, but i get stuck on returning if a portal/map is opened or not. Actually i'm using Split() to retrieve data from an array similiar to ctrl.lua SetMapEntryTime. Any idea on what i should do to checking if portal/map opened or not and opening intervals if possible? eg on what i'm doing: -- Array for timing configuration. EntryMaps.Conf['garner2'] = {"2006/10/18/11/0", "0/1/0", "0/0/30", "0/0/45"} -- Sample of Split, to return values from array. local Table = EntryMaps.Conf[mapName][1] local Value = Split(''..Table..'', '/') Some preview of the NPC using the scripts: https://gyazo.com/def32c0f24f78ce13906f5c5b6fcd166 Thanks!
  14. We need someone who knows how to do his job properly specially when it comes on fixing bugs and doing new features. What we need? - Can finish tasks on time - Can work with pressure - With proper coding/scripting ethics - Trustworthy What you will do? - Fix the errors appeared on our lua_err - Make sure no such errors will appear again to sustain our server stability - New features that can apply for our future updates We are willing to pay every service we will ask you to do, but what we need the most are those who can finish the tasks quickly. Leave a comment down below or just dm me thank you.
  15. I am not a complete beginnier , i'm not completely unaware how programming works. However as the most here know there is an impossibly large chasm between a rough understanding and a level of understanding which enables to actually do things. So my question isn't only about "what languages should i learn". I know it's C++ / Lua / SQL / HTML / PHP , maybe python for ancillary tool creation. My question is in the specific : in what parts of those languages i should focus on? My main issue with programming has been mainly one : i'm bored by the the basics but overwhelmed by the complexity after those basics. Any suggestion/learning resource is welcome , thank you for you time.
  16. Hello and good day everyone, This is Ishcurry of DW Pirates and our talented dev team is looking for a LUA Developer. Someone with the right attitude and will share the same vision as us. Please send me a message in [email protected] Digital Warfare Intl'
  17. Locking and Unlocking inventory. to lock the inventory: function LockKitbag(cha) local packet = GetPacket() WriteCmd(packet, 553) WriteByte(packet, 1) SendPacket(cha, packet) end to unlock the inventory: function UnlockKitbag(cha) local packet = GetPacket() WriteCmd(packet, 553) WriteByte(packet, 0) SendPacket(cha, packet) end Usage: LockKitbag(role) UnlockKitbag(role) @GustavoHMA @DangThao
  18. heloo 1- i wanna know how to make game.exe for edit game 2- how to convert CharacterAction.tx to txt file? or how to open it ? 3- i saw some servers some people make auto click by game axe with bug apps make no stun effect how can fix this or how can make that? thx
  19. Hi friends, what you guys think about sharing a creation of an documentation for the PKO Server API, so we can make progress faster creating new resources...
  20. Полезные материалы по языку Lua В данной теме Вы можете найти полезные материалы, которые Вам помогут в изучении, освоении и применении языка Lua. Данный язык применяется в качестве скриптового языка для сервера и клиента нашей игры. — Википедия Официальная документация (на английском языке); Справочное руководство по языку Lua 5.1; Статья на habrahabr.ru "Lua за 15 минут"; Сайт, посвященный языку Lua. Если Вы знаете интересные статьи, то не стесняйтесь выкладывать их в комментариях.
×
×
  • Create New...