diff --git a/truffenyi-commune-quest.lic b/truffenyi-commune-quest.lic index c9a14a4751..492c570a93 100644 --- a/truffenyi-commune-quest.lic +++ b/truffenyi-commune-quest.lic @@ -2,74 +2,254 @@ Documentation: https://elanthipedia.play.net/Lich_script_repository#truffenyi-commune-quest =end -custom_require.call(%w[common equipmanager]) +custom_require.call(%w[common common-items equipmanager]) -start = Time.now -echo 'This script does the actions for the truffenyi commune Cleric quest. It should be started after drinking the vial two times.' -EquipmentManager.new.empty_hands +class TruffenyiCommuneQuest + def initialize -while (line = get) - waitrt? - if line =~ /^Your vision fades and you suddenly see yourself working in front of a glowing forge/ - DRC.bput('pray Divyaush', 'In your') + arg_definitions = [ + [ + { name: 'step', options: %w[altar vial shrine], optional: fales, description: 'Which step to do?'} + ] + ] + args = parse_args(arg_definitions) + + if args.step == 'altar' + do_altar + elsif args.step == 'vial' + do_vial + elsif args.step == 'shrine' + do_shrine + end end - if line =~ /^Your vision fades and you see yourself toiling in a dusty field/ - DRC.bput('pray Berengaria', 'In your') - end - if line =~ /^Your vision fades and you see yourself huddled in front of a fire in an icy cavern/ - DRC.bput('pray Kuniyo', 'In your') - end - if line =~ /^Your vision fades and you see yourself surrounded by occupied cots/ - DRC.bput("pray Peri'el", 'In your') - end - if line =~ /^Your vision fades and you see yourself alone on a raft/ - DRC.bput('pray Lemicus', 'In your') - end - if line =~ /^Your vision fades and you see yourself as a young child sitting in the corner/ - DRC.bput('pray Albreda', 'In your') - end - if line =~ /^Your vision fades and you find yourself travelling the desert/ - DRC.bput('pray Murrula', 'In your') - end - if line =~ /^Your vision fades and you see yourself tired and sore after a long day of harvesting crops/ - DRC.bput('pray Rutilor', 'In your') - end - if line =~ /^Your vision fades and you see yourself sitting on a bar stool/ - DRC.bput('pray Saemaus', 'In your') - end - if line =~ /^Your vision fades and you see yourself walking through one of your grain fields/ - DRC.bput('pray Asketi', 'In your') - end - if line =~ /^Your vision fades and you see yourself sitting amongst a group gathered at an outdoor wedding/ - DRC.bput("pray Be'ort", 'In your') - end - if line =~ /^Your vision fades and you see yourself sitting on a grassy hilltop/ - DRC.bput('pray Dergati', 'In your') - end - if line =~ /^In your vision the waters pull away from the shore/ - DRC.bput('pray Drogor', 'In your') - end - if line =~ /^Your vision fades and you see yourself facing a crackling fire next to the shore/ - DRC.bput('pray Drogor', 'In your') - end - if line =~ /^Your vision fades and you see yourself seated in the front row of a concert hall/ - DRC.bput('pray Idon', 'In your') - end - if line =~ /^Your vision fades and you see yourself entertaining a neighboring farmer at your house/ - DRC.bput('pray Kerenhappuch', 'In your') - end - if line =~ /^Your vision fades and you see yourself battling a small peccary/ - DRC.bput('pray Trothfang', 'In your') - end - if line =~ /^Your vision fades and you see yourself standing in the snow peering into the window of a rival/ - DRC.bput('pray Zachriedek', 'In your') + + def do_altar + # Validate hometown set to crossing + if get_settings.hometown != 'Crossing' + DRC.message("*****\n*****\nDue to needing different favor orbs from any of the 39 aspects, your hometown should be set to Crossing before running this step.\n*****\n*****") + pause 10 + exit + end + + # Check for altar existance + if !DRCI.exists?('miniature altar') + echo "Could not find the miniature altar needed to start the quest. Are you sure you're on it?" + exit + end + + # get the altar hints, and split into two strings to cover possibilities of overlap of messaging + altar_look = DRC.bput('look my miniature altar',/A carving along the front of the miniature altar depicts.*/) + altar_look_first, altar_look_second = altar_look.split('. On the back, another ') + + # get the immortal aspects from the messaging + neutral_aspect_immortal = case altar_look_first + when /raven/i + 'kertigen' + when /unicorn/i + 'hodierna' + when /wolf/i + 'meraud' + when /panther/i + 'damaris' + when /boar/i + 'everild' + when /ox/i + 'truffenyi' + when /cobra/i + "Hav'roth" + when /dolphin/i + 'eluned' + when /ram/i + 'glythtide' + when /cat/i + 'tamsine' + when /wren/i + 'faenella' + when /lion/i + 'chadatru' + when /scorpion/i + "urrem'tier" + else + nil + end + + light_aspect_immortal = case altar_look_first + when /wrapped gift/i + 'divyaush' + when /sheath of grain/i + 'berengaria' + when /black staff/i + 'firulf' + when /batch of feathers/i + 'phelim' + when /a bundle of pelts/i + 'kuniyo' + when /toy bridge/i + 'alamhif' + when /Seashell/i + "peri'el" + when /lodestone/i + 'lemicus' + when /wedding ring/i + 'saemaus' + when /olive laurel/i + 'albreda' + when /silver flute/i + 'murrula' + when /intricate sword/i + 'rutilor' + when /scythe/i + 'eylhaar' + else + nil + end + + dark_aspect_immortal = case altar_look_second + when /an overloaded wagon travelling toward a wooden bridge. The supports look rotten and cracked/i + 'zachriedek' + when /a long row of dismembered bodies leading toward a broken altar/i + 'asketi' + when /a disheveled man weeping behind two women who are locked in combat/i + 'kerenhappuch' + when /a small desert village ravaged by a sand storm, the well in the center almost completely covered over/i + 'dergati' + when /a riotous party. Wine sloshes out of full cups held by people around the table, while other figures are slumped over in their chairs, dark pools around their feet/i + 'trothfang' + when /a tithe box sitting outside of a small chapel, the tail of a snake disappearing into the slot/i + 'huldah' + when /a scene of wilted crops interspersed with livestock lying supine a rough texture to the carving is noticeable above each animal/i + 'ushnish' + when /a simply dressed mage sleeping underneath an elm tree during a downpour. A spellbook sits open on a nearby picnic table/i + 'drogor' + when /a haggard looking Gnome lying on his side and clutching his knees in his arms. A crooked smile stretches across his face as he stares at a roach crawling in front of him/i + "be'ort" + when /the outskirts of a small village the trees skirting the border are fully engulfed in flames/i + 'harawep' + when /young woman walking away from an orphanage/i + 'idon' + when /a man walking down the aisle of a courtroom. On either side of the man, a group of figures raise their fists toward him, while a woman sits near the front of the group weeping/i + 'botolf' + when /a long beach after a horrific battle. A few figures seem to be crawling away from the tide/i + 'aldauth' + else + nil + end + + # validate that you have a immortal for each aspect + if neutral_aspect_immortal.nil? || light_aspect_immortal.nil? || dark_aspect_immortal.nil? + echo "Could not determine neutral aspect!" if neutral_aspect_immortal.nil? + echo "Could not determine light aspect!" if light_aspect_immortal.nil? + echo "Could not determine dark aspect!" if dark_aspect_immortal.nil? + echo "Bailing out!" + exit + else + echo "Neutral Aspect: #{neutral_aspect_immortal}" + echo "Light Aspect: #{light_aspect_immortal}" + echo "Dark Aspect: #{dark_aspect_immortal}" + end + + # fetch favor orbs and fill the altar + [neutral_aspect_immortal, light_aspect_immortal, dark_aspect_immortal].each do |immortal| + DRC.wait_for_script_to_complete('favor', [immortal]) + if !DRCI.get_item?("#{immortal} orb") + echo "Failed to get orb for aspect - #{immortal}." + echo "Bailing out!" + exit + end + DRC.bput("put my #{immortal} orb in my miniature altar",/You put your orb in the miniature altar/) + end + + if !DRCI.get_item?("miniature altar") + echo "Somehow you lost your altar!" + echo "Bailing out!" + exit + end + + DRC.bput('close my miniature altar', /You close/) + # TODO: Get strings for 'oops wrong immortal orbs' + Lich::Util.issue_command('pray my miniature altar', /You kneel down and pray to a miniature altar/, /The flames surrounding the object diminish slightly allowing you to/, usexml: false, timeout: 90) + + DRC.bput('stow murky vial', /You pick up/) + echo "Vial acquired - getting healed." + DRC.wait_for_script_to_complete('safe-room') end - if line =~ /^Your stomach grumbles and you realize that you're holding a/ - fput("drop #{checkright || checkleft}") if DRC.left_hand || DRC.right_hand + + def do_vial + start = Time.now + echo 'This script does the actions for the truffenyi commune Cleric quest. It should be started after drinking the vial two times.' + EquipmentManager.new.empty_hands + + while (line = get) + waitrt? + if line =~ /^Your vision fades and you suddenly see yourself working in front of a glowing forge/ + DRC.bput('pray Divyaush', 'In your') + end + if line =~ /^Your vision fades and you see yourself toiling in a dusty field/ + DRC.bput('pray Berengaria', 'In your') + end + if line =~ /^Your vision fades and you see yourself huddled in front of a fire in an icy cavern/ + DRC.bput('pray Kuniyo', 'In your') + end + if line =~ /^Your vision fades and you see yourself surrounded by occupied cots/ + DRC.bput("pray Peri'el", 'In your') + end + if line =~ /^Your vision fades and you see yourself alone on a raft/ + DRC.bput('pray Lemicus', 'In your') + end + if line =~ /^Your vision fades and you see yourself as a young child sitting in the corner/ + DRC.bput('pray Albreda', 'In your') + end + if line =~ /^Your vision fades and you find yourself travelling the desert/ + DRC.bput('pray Murrula', 'In your') + end + if line =~ /^Your vision fades and you see yourself tired and sore after a long day of harvesting crops/ + DRC.bput('pray Rutilor', 'In your') + end + if line =~ /^Your vision fades and you see yourself sitting on a bar stool/ + DRC.bput('pray Saemaus', 'In your') + end + if line =~ /^Your vision fades and you see yourself walking through one of your grain fields/ + DRC.bput('pray Asketi', 'In your') + end + if line =~ /^Your vision fades and you see yourself sitting amongst a group gathered at an outdoor wedding/ + DRC.bput("pray Be'ort", 'In your') + end + if line =~ /^Your vision fades and you see yourself sitting on a grassy hilltop/ + DRC.bput('pray Dergati', 'In your') + end + if line =~ /^In your vision the waters pull away from the shore/ + DRC.bput('pray Drogor', 'In your') + end + if line =~ /^Your vision fades and you see yourself facing a crackling fire next to the shore/ + DRC.bput('pray Drogor', 'In your') + end + if line =~ /^Your vision fades and you see yourself seated in the front row of a concert hall/ + DRC.bput('pray Idon', 'In your') + end + if line =~ /^Your vision fades and you see yourself entertaining a neighboring farmer at your house/ + DRC.bput('pray Kerenhappuch', 'In your') + end + if line =~ /^Your vision fades and you see yourself battling a small peccary/ + DRC.bput('pray Trothfang', 'In your') + end + if line =~ /^Your vision fades and you see yourself standing in the snow peering into the window of a rival/ + DRC.bput('pray Zachriedek', 'In your') + end + if line =~ /^Your stomach grumbles and you realize that you're holding a/ + fput("drop #{checkright || checkleft}") if DRC.left_hand || DRC.right_hand + end + next unless line =~ /you have my attention, though really you are never far from my sight/ + + finish = ((Time.now - start) / 60.0).round + echo("All done! This part of the quest took #{finish} minutes to complete.") + exit + end end - next unless line =~ /you have my attention, though really you are never far from my sight/ - finish = ((Time.now - start) / 60.0).round - echo("All done! This part of the quest took #{finish} minutes to complete.") - exit + def do_shrine + echo 'not supported yet' + end end + +TruffenyiCommuneQuest.new +