From 0b827b0c2aa78f96361a9f8db09d2dc645bcbdf0 Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Thu, 4 Jan 2018 11:40:46 -0500 Subject: [PATCH 01/12] Added a devour healing routine for necromancers to safe-room. This should help clean them up based on their threshold if they ended combat dinged up. This happens a bunch at lower circles. --- safe-room.lic | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/safe-room.lic b/safe-room.lic index 8c95100613..5883e5998e 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -40,6 +40,9 @@ class SafeRoom hometown = town_data[settings.hometown] wait_at_empath(hometown['npc_empath']['id']) fix_standing + else + devour_healing(settings) if settings.necromancer_healing['Devour'] + return end give_and_take(settings.safe_room_id, settings.safe_room_give, settings.safe_room_take) @@ -63,6 +66,26 @@ class SafeRoom score > @health_threshold end + def devour_healing(settings) + walk_to(settings.safe_room) + release_invisibility + devours = count_items_in_container('material', settings.thanatology['harvest_container']) + return unless devours > 0 + stow_hands + return if right_hand || left_hand + + while need_healing? && devours > 0 + while mana < 40 + echo('Waiting on mana...') + pause 10 + end + + bput('get my material', 'You get', 'You are already', 'I could not') unless right_hand + DRCA.cast_spell(settings.necromancer_healing['Devour'], settings) + devours -= 1 unless right_hand + end + end + def check_idle return unless Flags['idle'] From bb8c3eb895a0c5f7ebb06fa27fd14e3d88dee6db Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Thu, 4 Jan 2018 12:32:04 -0500 Subject: [PATCH 02/12] Added better skipping logic. --- safe-room.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/safe-room.lic b/safe-room.lic index 5883e5998e..c7452f85a3 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -41,7 +41,7 @@ class SafeRoom wait_at_empath(hometown['npc_empath']['id']) fix_standing else - devour_healing(settings) if settings.necromancer_healing['Devour'] + devour_healing(settings) if settings.necromancer_healing['Devour'] && need_healing? return end From e9dda757ea92cd43764a7c17d0d774ba6d0dbc4f Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Thu, 4 Jan 2018 13:32:19 -0500 Subject: [PATCH 03/12] Added a new setting for this, also removed the extra checking which I had previously added. Reconfigured some of the logic, and added the get to specify the bag which contains it. Also fixed the failure message in the bput. --- profiles/base.yaml | 1 + safe-room.lic | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/profiles/base.yaml b/profiles/base.yaml index 8c7ce49da8..8ca8b652c2 100644 --- a/profiles/base.yaml +++ b/profiles/base.yaml @@ -83,6 +83,7 @@ buff_nonspells: dance_actions_stealth: thanatology: necro_force_safe_room: false +necro_heal_with_material: false necromancer_healing: wound_level_threshold: 1 # 1 - 8 zombie: diff --git a/safe-room.lic b/safe-room.lic index c7452f85a3..e9467566ac 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -40,8 +40,8 @@ class SafeRoom hometown = town_data[settings.hometown] wait_at_empath(hometown['npc_empath']['id']) fix_standing - else - devour_healing(settings) if settings.necromancer_healing['Devour'] && need_healing? + else + devour_healing(settings) if necro_heal_with_material return end @@ -71,8 +71,9 @@ class SafeRoom release_invisibility devours = count_items_in_container('material', settings.thanatology['harvest_container']) return unless devours > 0 + stow_hands - return if right_hand || left_hand + return if right_hand while need_healing? && devours > 0 while mana < 40 @@ -80,7 +81,7 @@ class SafeRoom pause 10 end - bput('get my material', 'You get', 'You are already', 'I could not') unless right_hand + bput("get material in my #{settings.thanatology['harvest_container']}", 'You get', 'You are already', 'What were you') unless right_hand DRCA.cast_spell(settings.necromancer_healing['Devour'], settings) devours -= 1 unless right_hand end From 4aff013bd341c856426603a05fdfed16713f2ce6 Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Thu, 4 Jan 2018 13:33:53 -0500 Subject: [PATCH 04/12] Added a break for the failure message. --- safe-room.lic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/safe-room.lic b/safe-room.lic index e9467566ac..6be9d18026 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -81,7 +81,8 @@ class SafeRoom pause 10 end - bput("get material in my #{settings.thanatology['harvest_container']}", 'You get', 'You are already', 'What were you') unless right_hand + result = bput("get material in my #{settings.thanatology['harvest_container']}", 'You get', 'You are already', 'What were you') unless right_hand + break if result ~= 'What were you' DRCA.cast_spell(settings.necromancer_healing['Devour'], settings) devours -= 1 unless right_hand end From 255168d5fbb222bf7baf8aa5ebe166be769faac5 Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Thu, 4 Jan 2018 13:40:46 -0500 Subject: [PATCH 05/12] Changed the setting name, and updated some parameter checking. --- profiles/base.yaml | 2 +- safe-room.lic | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/profiles/base.yaml b/profiles/base.yaml index 8ca8b652c2..1a9fca67f7 100644 --- a/profiles/base.yaml +++ b/profiles/base.yaml @@ -83,7 +83,6 @@ buff_nonspells: dance_actions_stealth: thanatology: necro_force_safe_room: false -necro_heal_with_material: false necromancer_healing: wound_level_threshold: 1 # 1 - 8 zombie: @@ -161,6 +160,7 @@ safe_room_give: safe_room_tip_threshold: safe_room_tip_amount: safe_room_empath: +safe_room_necro_use_material: false diff --git a/safe-room.lic b/safe-room.lic index 6be9d18026..e7e452df66 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -40,8 +40,8 @@ class SafeRoom hometown = town_data[settings.hometown] wait_at_empath(hometown['npc_empath']['id']) fix_standing - else - devour_healing(settings) if necro_heal_with_material + elsif safe_room_necro_use_material + devour_healing(settings) return end @@ -67,6 +67,9 @@ class SafeRoom end def devour_healing(settings) + return unless settings.necromancer_healing['Devour'] + return unless settings.thanatology['harvest_container'] + walk_to(settings.safe_room) release_invisibility devours = count_items_in_container('material', settings.thanatology['harvest_container']) From 0d4172f9af8b158816e2d74d909daef886105188 Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Thu, 4 Jan 2018 13:47:45 -0500 Subject: [PATCH 06/12] Added a validate for the required settings. --- validate.lic | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/validate.lic b/validate.lic index 412fd63fd9..d192c2c362 100644 --- a/validate.lic +++ b/validate.lic @@ -355,6 +355,13 @@ class DRYamlValidator error("thanatology['ritual_type']: '#{settings.thanatology['ritual_type']}' is invalid, only [preserve, harvest, fetish, cut, dissect, consume, arise, and cycle] are supported at this time.") end + def assert_that_safe_room_necro_meets_requirements(settings) + return unless settings.safe_room_necro_use_material + return if settings.necromancer_healing['Devour'] && settings.thanatology['harvest_container'] + + error('Safe room necromancer healing requires the use of devour listed under necromancer_healing and a harvest_container listed under thanatology.') + end + def assert_that_cyclic_training_spells_are_defined(settings) return unless settings.cyclic_cycle_skills From 81fafaef7aae520dc12c8bd4e1e319e383625b92 Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Thu, 4 Jan 2018 13:53:41 -0500 Subject: [PATCH 07/12] Changed the name again, added it as a setting... --- profiles/base.yaml | 2 +- safe-room.lic | 2 +- validate.lic | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/profiles/base.yaml b/profiles/base.yaml index 1a9fca67f7..84e7aa3dcf 100644 --- a/profiles/base.yaml +++ b/profiles/base.yaml @@ -83,6 +83,7 @@ buff_nonspells: dance_actions_stealth: thanatology: necro_force_safe_room: false +necro_safe_room_use_material: false necromancer_healing: wound_level_threshold: 1 # 1 - 8 zombie: @@ -160,7 +161,6 @@ safe_room_give: safe_room_tip_threshold: safe_room_tip_amount: safe_room_empath: -safe_room_necro_use_material: false diff --git a/safe-room.lic b/safe-room.lic index e7e452df66..1aba4dacc3 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -40,7 +40,7 @@ class SafeRoom hometown = town_data[settings.hometown] wait_at_empath(hometown['npc_empath']['id']) fix_standing - elsif safe_room_necro_use_material + elsif settings.necro_safe_room_use_material devour_healing(settings) return end diff --git a/validate.lic b/validate.lic index d192c2c362..97feea2f8b 100644 --- a/validate.lic +++ b/validate.lic @@ -356,7 +356,7 @@ class DRYamlValidator end def assert_that_safe_room_necro_meets_requirements(settings) - return unless settings.safe_room_necro_use_material + return unless settings.necro_safe_room_use_material return if settings.necromancer_healing['Devour'] && settings.thanatology['harvest_container'] error('Safe room necromancer healing requires the use of devour listed under necromancer_healing and a harvest_container listed under thanatology.') From 3f2e607928bffa840303800e5a144d8f2642c4b0 Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Thu, 4 Jan 2018 15:25:54 -0500 Subject: [PATCH 08/12] Fixed check --- safe-room.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/safe-room.lic b/safe-room.lic index 1aba4dacc3..22a5cc0af6 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -85,7 +85,7 @@ class SafeRoom end result = bput("get material in my #{settings.thanatology['harvest_container']}", 'You get', 'You are already', 'What were you') unless right_hand - break if result ~= 'What were you' + break if result =~ 'What were you' DRCA.cast_spell(settings.necromancer_healing['Devour'], settings) devours -= 1 unless right_hand end From ede3a9ac90788116d2dee9fc686a2b8c1a00c216 Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Fri, 5 Jan 2018 17:49:16 -0500 Subject: [PATCH 09/12] Updating the logic to not skip give_and_take, and to store material if failed to devour. --- safe-room.lic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/safe-room.lic b/safe-room.lic index 22a5cc0af6..6c2a2a6c5d 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -42,7 +42,6 @@ class SafeRoom fix_standing elsif settings.necro_safe_room_use_material devour_healing(settings) - return end give_and_take(settings.safe_room_id, settings.safe_room_give, settings.safe_room_take) @@ -89,6 +88,8 @@ class SafeRoom DRCA.cast_spell(settings.necromancer_healing['Devour'], settings) devours -= 1 unless right_hand end + + bput("put my material in my #{settings.thanatology['harvest_container']}", 'You put', 'What were') if right_hand end def check_idle From 5f7dba95c71fd1cc24a306abd8957e1ab50eb999 Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Fri, 5 Jan 2018 18:34:31 -0500 Subject: [PATCH 10/12] Didn't like the name, changed it. --- profiles/base.yaml | 2 +- safe-room.lic | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/profiles/base.yaml b/profiles/base.yaml index 84e7aa3dcf..b54b4199dc 100644 --- a/profiles/base.yaml +++ b/profiles/base.yaml @@ -83,7 +83,7 @@ buff_nonspells: dance_actions_stealth: thanatology: necro_force_safe_room: false -necro_safe_room_use_material: false +necro_safe_room_use_devour: false necromancer_healing: wound_level_threshold: 1 # 1 - 8 zombie: diff --git a/safe-room.lic b/safe-room.lic index 6c2a2a6c5d..3a4de0cf9f 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -40,7 +40,7 @@ class SafeRoom hometown = town_data[settings.hometown] wait_at_empath(hometown['npc_empath']['id']) fix_standing - elsif settings.necro_safe_room_use_material + elsif settings.necro_safe_room_use_devour devour_healing(settings) end From 24f36a97eb183be649687b0bc1ee76550485ee9f Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Fri, 5 Jan 2018 21:21:14 -0500 Subject: [PATCH 11/12] Adding another validate for false storing but using devour to heal. Also changed to return using the .zero? function. --- safe-room.lic | 5 +++-- validate.lic | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/safe-room.lic b/safe-room.lic index 3a4de0cf9f..0d698f9efd 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -2,13 +2,14 @@ Documentation: https://elanthipedia.play.net/Lich_script_repository#safe-room =end -custom_require.call(%w[common common-healing common-money common-travel drinfomon events]) +custom_require.call(%w[common common-arcana common-healing common-money common-travel drinfomon events]) class SafeRoom include DRC include DRCH include DRCM include DRCT + include DRCA def initialize arg_definitions = [ @@ -72,7 +73,7 @@ class SafeRoom walk_to(settings.safe_room) release_invisibility devours = count_items_in_container('material', settings.thanatology['harvest_container']) - return unless devours > 0 + return if devours.zero? stow_hands return if right_hand diff --git a/validate.lic b/validate.lic index 97feea2f8b..5aaa0f714c 100644 --- a/validate.lic +++ b/validate.lic @@ -355,13 +355,20 @@ class DRYamlValidator error("thanatology['ritual_type']: '#{settings.thanatology['ritual_type']}' is invalid, only [preserve, harvest, fetish, cut, dissect, consume, arise, and cycle] are supported at this time.") end - def assert_that_safe_room_necro_meets_requirements(settings) + def assert_that_safe_room_necro_has_valid_container(settings) return unless settings.necro_safe_room_use_material return if settings.necromancer_healing['Devour'] && settings.thanatology['harvest_container'] error('Safe room necromancer healing requires the use of devour listed under necromancer_healing and a harvest_container listed under thanatology.') end + def assert_that_safe_room_necro_is_storing_material(settings) + return unless settings.necro_safe_room_use_material + return unless settings.necromancer_healing['Devour'] && settings.thanatology['store'] == false + + error('Safe room necromancer healing requires material on hand to use. You are not storing material and will eventually run out. This needs to be true to be fully functional, long term.') + end + def assert_that_cyclic_training_spells_are_defined(settings) return unless settings.cyclic_cycle_skills From 8c82808b900b8c8c7b3d0524561a8c90fb2dfb6e Mon Sep 17 00:00:00 2001 From: Jay Ryan Date: Fri, 5 Jan 2018 21:22:10 -0500 Subject: [PATCH 12/12] Forgot to remove the DRCA. call --- safe-room.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/safe-room.lic b/safe-room.lic index 0d698f9efd..1f1c008df1 100644 --- a/safe-room.lic +++ b/safe-room.lic @@ -86,7 +86,7 @@ class SafeRoom result = bput("get material in my #{settings.thanatology['harvest_container']}", 'You get', 'You are already', 'What were you') unless right_hand break if result =~ 'What were you' - DRCA.cast_spell(settings.necromancer_healing['Devour'], settings) + cast_spell(settings.necromancer_healing['Devour'], settings) devours -= 1 unless right_hand end