From bdf878cc0d25986012d4e34c0fe050c974c62a15 Mon Sep 17 00:00:00 2001 From: Lernos Date: Sat, 20 Nov 2021 21:19:45 +0300 Subject: [PATCH 01/10] add cheat_add_potion_buff command A simple utility command that allows to add most useful potion buffs without copying or painfully retyping their long ids. I made that because, while cheat_add_buff accepts search by name, it always applies the LAST buff it finds by name, and a lot of potion buffs have _DEPRECATED versions that get applied instead. It doesn't contain ALL potion buffs, only the ones I use the most (and would love to use in combat, but can't due to how the game works), but it's painfully easy to add new ones now. The code itself was copied from cheat_teleport_to, so I have no idea if it's needlessly excessive - a bit rusty with lua. --- Source/Scripts/cheat_core_buffs.lua | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Source/Scripts/cheat_core_buffs.lua b/Source/Scripts/cheat_core_buffs.lua index 61ee023..d2574c0 100644 --- a/Source/Scripts/cheat_core_buffs.lua +++ b/Source/Scripts/cheat_core_buffs.lua @@ -98,6 +98,38 @@ function cheat:cheat_add_buff(line) return false end +-- ============================================================================ +-- cheat_add_potion_buff +-- ============================================================================ +System.AddCCommand('cheat_add_potion_buff', 'cheat:add_potion_buff(%line)', "Usage: cheat_add_potion_buff id:number\n$8Adds a potion buff to the player. Supported buffs:\n$8 1. Nighthawk\n$8 2. Aqua Vitalis\n$8 3. Buck's Blood\n$8 4. Marigold potion\n$8 5. Lazarus potion\n$8 6. Hair o' the Dog potion") +function cheat:add_potion_buff(line) + local args = string.gsub(tostring(line), "id:", "") + local checkteste = "error" + + local ids = {} + ids["1"] = "id:fa2ad41e-5701-4fe7-8630-5cee49eb304f" + ids["2"] = "id:27c2fd6a-9b87-4d1f-b434-44f5ec3fa426" + ids["3"] = "id:122c0e62-747e-4bb3-9650-1a14d0420b08" + ids["4"] = "id:8503216a-a34c-49f0-aefa-54d4502046f9" + ids["5"] = "id:7690a860-a843-4609-8a67-9868b87b32b5" + ids["6"] = "id:3f915710-1ccf-41a0-bc7f-67c8cc1a8e7b" + + if ids[args] ~= nil then + cheat:cheat_add_buff(ids[args]) + else + for k,v in pairs(ids) do + if string.find(k, args) then + checkteste = v + end + end + if checkteste ~= "error" then + cheat:cheat_add_buff(checkteste) + else + cheat:logError("Invalid Buff - See list of supported potion buffs: 'cheat_add_potion_buff ?'") + end + end +end + -- ============================================================================ -- cheat_remove_buff -- ============================================================================ From 498756086d73fb73a3e768172bc871c9720c1ae1 Mon Sep 17 00:00:00 2001 From: Lernos Date: Sat, 20 Nov 2021 21:20:18 +0300 Subject: [PATCH 02/10] add cheat_add_potion_buff --- Source/Docs/commands.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Docs/commands.txt b/Source/Docs/commands.txt index d198a61..8abeb0d 100644 --- a/Source/Docs/commands.txt +++ b/Source/Docs/commands.txt @@ -1,6 +1,7 @@ cheat_add_all_items cheat_add_all_perks cheat_add_buff +cheat_add_potion_buff cheat_add_buff_heal cheat_add_buff_immortal cheat_add_buff_invisible From 37ceb276918031b7631349cf9ed931bb32dd0a92 Mon Sep 17 00:00:00 2001 From: Lernos Date: Sun, 21 Nov 2021 01:47:02 +0300 Subject: [PATCH 03/10] add cheat_tp_to_npc --- Source/Scripts/cheat_core_player.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Source/Scripts/cheat_core_player.lua b/Source/Scripts/cheat_core_player.lua index afb3c22..91f1833 100644 --- a/Source/Scripts/cheat_core_player.lua +++ b/Source/Scripts/cheat_core_player.lua @@ -105,6 +105,32 @@ function cheat:teleport_to(line) end end +-- ============================================================================ +-- cheat_tp_to_npc +-- ============================================================================ +cheat.cheat_tp_to_npc_args = { + token=function(args,name,showHelp) return cheat:argsGetRequired(args, name, showHelp, "All or part of a the NPC's name.") end +} +cheat:createCommand("cheat_tp_to_npc", "cheat:cheat_tp_to_npc(%line)", cheat.cheat_tp_to_npc_args, + "Finds an NPC or list of NPCs and teleports to the last of them.\n$8This only works if the NPC has been loaded into the world.", + "Teleport to Father Godwin", "cheat_tp_to_npc token:godwin") +function cheat:cheat_tp_to_npc(line) + local args = cheat:argsProcess(line, cheat.cheat_find_npc_args) + local token, tokenErr = cheat:argsGet(args, 'token', nil) + if not tokenErr then + cheat:cheat_find_npc(line) + local npcs = cheat:find_npc(token) + if npcs and #npcs > 0 then + local nx = npcs[#npcs]:GetWorldPos().x + local ny = npcs[#npcs]:GetWorldPos().y + local nz = npcs[#npcs]:GetWorldPos().z + cheat:teleport("x:" .. nx .. " y:" .. ny .. " z:" .. nz) + else + cheat:logError("NPC [%s] not found.", token) + end + end +end + -- ============================================================================ -- cheat_set_state -- ============================================================================ From a212c6bebee251a2881263af122c64a6844ded74 Mon Sep 17 00:00:00 2001 From: Lernos Date: Sun, 21 Nov 2021 01:47:36 +0300 Subject: [PATCH 04/10] add cheat_tp_to_npc --- Source/Docs/commands.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Docs/commands.txt b/Source/Docs/commands.txt index 8abeb0d..055f0ce 100644 --- a/Source/Docs/commands.txt +++ b/Source/Docs/commands.txt @@ -15,6 +15,7 @@ cheat_find_buffs cheat_find_horses cheat_find_items cheat_find_npc +cheat_tp_to_npc cheat_find_perks cheat_find_skills cheat_get_time From 563528a07f02201666cd3f4b483ba7b5bc3503ba Mon Sep 17 00:00:00 2001 From: Lernos Date: Tue, 23 Nov 2021 22:20:45 +0300 Subject: [PATCH 05/10] improve cheat_tp_to_npc Added num argument to choose from list, changed token to id, argsProcess actually processes this cheat's args and not cheat_find_npc's --- Source/Scripts/cheat_core_player.lua | 33 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Source/Scripts/cheat_core_player.lua b/Source/Scripts/cheat_core_player.lua index 91f1833..1a01a4b 100644 --- a/Source/Scripts/cheat_core_player.lua +++ b/Source/Scripts/cheat_core_player.lua @@ -109,24 +109,33 @@ end -- cheat_tp_to_npc -- ============================================================================ cheat.cheat_tp_to_npc_args = { - token=function(args,name,showHelp) return cheat:argsGetRequired(args, name, showHelp, "All or part of a the NPC's name.") end + id=function(args,name,showHelp) return cheat:argsGetRequired(args, name, showHelp, "All or part of the NPC's name.") end, + num=function(args,name,showHelp) return cheat:argsGetOptionalNumber(args, name, 0, showHelp, "Optional: The NPC's number in the list if there's more than one.\n$8Keep it greater than 0.") end } cheat:createCommand("cheat_tp_to_npc", "cheat:cheat_tp_to_npc(%line)", cheat.cheat_tp_to_npc_args, - "Finds an NPC or list of NPCs and teleports to the last of them.\n$8This only works if the NPC has been loaded into the world.", - "Teleport to Father Godwin", "cheat_tp_to_npc token:godwin") + "Finds an NPC or list of NPCs and teleports to any of them.\n$8This only works if the NPC has been loaded into the world.\n$8Defaults to last NPC in the list if no num argument received.", + "Teleport to Father Godwin", "cheat_tp_to_npc id:godwin") function cheat:cheat_tp_to_npc(line) - local args = cheat:argsProcess(line, cheat.cheat_find_npc_args) - local token, tokenErr = cheat:argsGet(args, 'token', nil) - if not tokenErr then - cheat:cheat_find_npc(line) - local npcs = cheat:find_npc(token) + local args = cheat:argsProcess(line, cheat.cheat_tp_to_npc_args) + local id, idErr = cheat:argsGet(args, 'id', nil) + local num, numErr = cheat:argsGet(args, 'num', 0) + if not idErr and not numErr then + cheat:cheat_find_npc("token:" .. id) + local npcs = cheat:find_npc(id) + if num == nil or num <= 0 then + num = #npcs + end + if num > #npcs then + cheat:logError("Sorry, this number is greater than the amount of found NPCS.") + return + end if npcs and #npcs > 0 then - local nx = npcs[#npcs]:GetWorldPos().x - local ny = npcs[#npcs]:GetWorldPos().y - local nz = npcs[#npcs]:GetWorldPos().z + local nx = npcs[num]:GetWorldPos().x + local ny = npcs[num]:GetWorldPos().y + local nz = npcs[num]:GetWorldPos().z cheat:teleport("x:" .. nx .. " y:" .. ny .. " z:" .. nz) else - cheat:logError("NPC [%s] not found.", token) + cheat:logError("NPC [%s] not found.", id) end end end From 5e204528c3e4c5c2c0abb104852ddb022f527f9d Mon Sep 17 00:00:00 2001 From: Lernos Date: Wed, 24 Nov 2021 02:49:54 +0300 Subject: [PATCH 06/10] fixed alphabetic order lol --- Source/Docs/commands.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Docs/commands.txt b/Source/Docs/commands.txt index 055f0ce..efc6e14 100644 --- a/Source/Docs/commands.txt +++ b/Source/Docs/commands.txt @@ -1,21 +1,21 @@ cheat_add_all_items cheat_add_all_perks cheat_add_buff -cheat_add_potion_buff cheat_add_buff_heal cheat_add_buff_immortal cheat_add_buff_invisible cheat_add_item cheat_add_money cheat_add_perk +cheat_add_potion_buff cheat_add_stat_xp +cheat_charm cheat_damage_all_items cheat_eval cheat_find_buffs cheat_find_horses cheat_find_items cheat_find_npc -cheat_tp_to_npc cheat_find_perks cheat_find_skills cheat_get_time @@ -62,5 +62,6 @@ cheat_teleport_horse cheat_teleport_npc_to_loc cheat_teleport_npc_to_player cheat_teleport_to +cheat_tp_to_npc cheat_unlock_recipes cheat_wash_dirt_and_blood From fd082e79e2e78fc48f229d210dc049b6e0045a2e Mon Sep 17 00:00:00 2001 From: Lernos Date: Wed, 24 Nov 2021 02:50:22 +0300 Subject: [PATCH 07/10] added cheat_charm --- Source/Scripts/cheat_core_player.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/Scripts/cheat_core_player.lua b/Source/Scripts/cheat_core_player.lua index 1a01a4b..840906a 100644 --- a/Source/Scripts/cheat_core_player.lua +++ b/Source/Scripts/cheat_core_player.lua @@ -308,6 +308,19 @@ function cheat:cheat_wash_dirt_and_blood() cheat:logInfo("All Clean!") end +-- ============================================================================ +-- cheat_charm +-- ============================================================================ +cheat:createCommand("cheat_charm", "cheat:charm()", nil, + "Automates your morning routine of bath-haircut-sex for maximum Charisma bonus.\n$8Washes all dirt and blood and applies Fresh Cut and Smitten buffs.", + "Wash yourself and add Charisma buffs", "cheat_charm") +function cheat:cheat_charm() + cheat:cheat_wash_dirt_and_blood() + cheat:cheat_add_buff("id:fresh_cut") + cheat:cheat_add_buff("id:alpha_male_in_love") + cheat:logInfo("All Clean and dandy!") +end + -- cheat_unlock_recipes -- ============================================================================ cheat:createCommand("cheat_unlock_recipes", "cheat:cheat_unlock_recipes()", nil, From 8e75ecfe879862a4fb35fa9dcc649b3350a7117a Mon Sep 17 00:00:00 2001 From: Lernos Date: Wed, 24 Nov 2021 03:05:43 +0300 Subject: [PATCH 08/10] fixed missed word --- Source/Scripts/cheat_core_player.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Scripts/cheat_core_player.lua b/Source/Scripts/cheat_core_player.lua index 840906a..92328a6 100644 --- a/Source/Scripts/cheat_core_player.lua +++ b/Source/Scripts/cheat_core_player.lua @@ -311,7 +311,7 @@ end -- ============================================================================ -- cheat_charm -- ============================================================================ -cheat:createCommand("cheat_charm", "cheat:charm()", nil, +cheat:createCommand("cheat_charm", "cheat:cheat_charm()", nil, "Automates your morning routine of bath-haircut-sex for maximum Charisma bonus.\n$8Washes all dirt and blood and applies Fresh Cut and Smitten buffs.", "Wash yourself and add Charisma buffs", "cheat_charm") function cheat:cheat_charm() From dd4a9e41ec2fa36fb32566889d434111a2bfa585 Mon Sep 17 00:00:00 2001 From: Lernos Date: Wed, 24 Nov 2021 18:21:50 +0300 Subject: [PATCH 09/10] modified original invisibility buff to make everything 0 --- Source/Libs/Tables/rpg/buff__JoewAlabel_Cheat.xml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Source/Libs/Tables/rpg/buff__JoewAlabel_Cheat.xml diff --git a/Source/Libs/Tables/rpg/buff__JoewAlabel_Cheat.xml b/Source/Libs/Tables/rpg/buff__JoewAlabel_Cheat.xml new file mode 100644 index 0000000..e669705 --- /dev/null +++ b/Source/Libs/Tables/rpg/buff__JoewAlabel_Cheat.xml @@ -0,0 +1,9 @@ + + + + + + + +
+
From ef8485cbf5989c05649682c53830cea61b0b339f Mon Sep 17 00:00:00 2001 From: Lernos Date: Wed, 24 Nov 2021 18:22:42 +0300 Subject: [PATCH 10/10] improved cheat_add_buff_invisible --- Source/Scripts/cheat_core_buffs.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Scripts/cheat_core_buffs.lua b/Source/Scripts/cheat_core_buffs.lua index d2574c0..5a38bd0 100644 --- a/Source/Scripts/cheat_core_buffs.lua +++ b/Source/Scripts/cheat_core_buffs.lua @@ -229,11 +229,10 @@ end -- cheat_add_buff_invisible -- ============================================================================ cheat:createCommand("cheat_add_buff_invisible", "cheat:cheat_add_buff_invisible()", nil, - "Adds invisible buff to player. For now this just sets conspicuousness to zero.\n$8Use cheat_remove_buff_invisible to remove this.", + "Adds invisible buff to player. Should set visibility, conspicuousness and noise to zero.\n$8Use cheat_remove_buff_invisible to remove this.", "Add invisible buff to player", "cheat_add_buff_invisible") function cheat:cheat_add_buff_invisible() - cheat:cheat_add_buff("id:cf787871-d151-43b7-a7c9-39acac116f0f") -- vib=-10,con=-10 - cheat:cheat_add_buff("id:07db9dfd-0e0c-4cbe-bf8a-10aaa1add262") -- ors=-1 + cheat:cheat_add_buff("id:cf787871-d151-43b7-a7c9-39acac116f0f") -- tweaked using patched table files cheat:logInfo("Invisibility buff added.") return true end @@ -246,7 +245,6 @@ cheat:createCommand("cheat_remove_buff_invisible", "cheat:cheat_remove_buff_invi "Remove invisible buff from player", "cheat_remove_buff_invisible") function cheat:cheat_remove_buff_invisible() cheat:cheat_remove_buff("id:cf787871-d151-43b7-a7c9-39acac116f0f") - cheat:cheat_remove_buff("id:07db9dfd-0e0c-4cbe-bf8a-10aaa1add262") cheat:logInfo("Invisibility buff removed.") return true end