gunnapong 14 Report post Posted July 20, 2022 I want to know the code, let's say that killing a level 1-20 monster gives 500 gold, a level 20-40 monster gives 1000 gold, and the higher the level, the higher. You only get more money. Help me. Thank you. Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted July 21, 2022 Hello @gunnapong, Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
gunnapong 14 Report post Posted July 24, 2022 On 7/21/2022 at 11:26 PM, V3ct0r said: Hello @gunnapong, Why the exp is not up, I have to quit the game and re-enter the level up. @V3ct0r Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted July 26, 2022 Hello, @gunnapong! This script should work fine: -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Gold amount local money = 0 -- Check the monster level if (level < 21) then money = 1000 -- 1,000 g elseif (level < 41) then money = 2000 -- 2,000 g end -- Add gold if (money > 0) then -- Give gold role = TurnToCha(role) local tmp = GetChaAttr(role, ATTR_GD) SetChaAttr(role, ATTR_GD, tmp + money) -- Show a message SystemNotice( role, string.format( "You killed (%s) and got (%d) gold!", GetChaDefaultName(monster), money ) ) end end 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
gunnapong 14 Report post Posted July 27, 2022 On 7/26/2022 at 7:17 PM, V3ct0r said: Hello, @gunnapong! This script should work fine: -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Gold amount local money = 0 -- Check the monster level if (level < 21) then money = 1000 -- 1,000 g elseif (level < 41) then money = 2000 -- 2,000 g end -- Add gold if (money > 0) then -- Give gold role = TurnToCha(role) local tmp = GetChaAttr(role, ATTR_GD) SetChaAttr(role, ATTR_GD, tmp + money) -- Show a message SystemNotice( role, string.format( "You killed (%s) and got (%d) gold!", GetChaDefaultName(monster), money ) ) end end It's working very well, I'd like to ask more. If I use a VIP card to make money*2 times how should i write @V3ct0r Quote Share this post Link to post Share on other sites
Saeed 26 Report post Posted July 27, 2022 (edited) 1 hour ago, gunnapong said: It's working very well, I'd like to ask more. If I use a VIP card to make money*2 times how should i write @V3ct0r If the condition is just having the VIP card in the player bag then it would look like this. -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Gold amount local money = 0 -- Check the monster level if (level < 21) then money = 1000 -- 1,000 g elseif (level < 41) then money = 2000 -- 2,000 g end -- Add gold if (money > 0) then -- Has VIP Card local VIP_Card_ID = 0001 local Has_VIP_Card = CheckBagItem(role,VIP_Card_ID) local VIP_Card_text = "" if Has_VIP_Card > 0 then VIP_Card_text = " VIP Card bonus applied!" money = money * 2 end -- Give gold role = TurnToCha(role) local tmp = GetChaAttr(role, ATTR_GD) SetChaAttr(role, ATTR_GD, tmp + money) -- Show a message SystemNotice( role, string.format( "You killed (%s) and got (%d) gold!"..VIP_Card_text, GetChaDefaultName(monster), money ) ) end end Edited July 27, 2022 by Saeed Quote Share this post Link to post Share on other sites
Saeed 26 Report post Posted July 27, 2022 And if you want it to delete the VIP Card each time you would change it to if Has_VIP_Card > 0 then VIP_Card_text = " VIP Card bonus applied!" money = money * 2 DelBagItem(role,VIP_Card_ID,1) end Quote Share this post Link to post Share on other sites
gunnapong 14 Report post Posted July 29, 2022 On 7/28/2022 at 5:34 AM, Saeed said: If the condition is just having the VIP card in the player bag then it would look like this. -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Gold amount local money = 0 -- Check the monster level if (level < 21) then money = 1000 -- 1,000 g elseif (level < 41) then money = 2000 -- 2,000 g end -- Add gold if (money > 0) then -- Has VIP Card local VIP_Card_ID = 0001 local Has_VIP_Card = CheckBagItem(role,VIP_Card_ID) local VIP_Card_text = "" if Has_VIP_Card > 0 then VIP_Card_text = " VIP Card bonus applied!" money = money * 2 end -- Give gold role = TurnToCha(role) local tmp = GetChaAttr(role, ATTR_GD) SetChaAttr(role, ATTR_GD, tmp + money) -- Show a message SystemNotice( role, string.format( "You killed (%s) and got (%d) gold!"..VIP_Card_text, GetChaDefaultName(monster), money ) ) end end it works fine But I need a way to use the VIP card for 1 day, after 1 day, the money*2 will be gone. Quote Share this post Link to post Share on other sites
Saeed 26 Report post Posted July 29, 2022 1 hour ago, gunnapong said: it works fine But I need a way to use the VIP card for 1 day, after 1 day, the money*2 will be gone. that would have to be a whole another script to configure VIP cards to disappear after 1 day so the bonus will be gone Quote Share this post Link to post Share on other sites
gunnapong 14 Report post Posted July 29, 2022 28 minutes ago, Saeed said: that would have to be a whole another script to configure VIP cards to disappear after 1 day so the bonus will be gone Do you know how to write? Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted August 15, 2022 On 7/29/2022 at 5:31 AM, gunnapong said: it works fine But I need a way to use the VIP card for 1 day, after 1 day, the money*2 will be gone. You can check that player have certain item in the bag (CheckBagItem()) or have VIP effect (GetChaStateLv()). Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites