rpherbig / dr-scripts

A series of Lich 5 (https://github.com/elanthia-online/lich-5) scripts for use with DragonRealms (http://www.play.net/dr/). Donations are welcome (http://www.paypal.me/rcuhljr)!
GNU General Public License v2.0
53 stars 177 forks source link

base-shrines.yaml additions + pilgrimage.lic edit to GET badge if REMOVE badge fails (no rush) #6875

Closed Kaesken closed 2 months ago

Kaesken commented 2 months ago

I cannot remember how to do it but when anyone gets the chance, want to add to base-shrines? I went ahead and tested each location and they worked each time but may need further testing just in case.

---
# Location must match what the pilgrim's badge displays when you look at it
# https://elanthipedia.play.net/Pilgrim%27s_badge
shrines:
  Crossing:
  - location: The shrine of Tamsine's Rest
    start_room: 743
    path_in:
    - go shrine
    push: image
    path_out:
    - east
  - location: The shrine to Ushnish in the Crossing
    start_room: 19_242
    push: image
    path_out:
    - out
  - location: The shrine to Kertigen in the Crossing
    start_room: 900
    path_in:
    - go shrine
    push: statue
    path_out:
    - out
  - location: The Crossing Clerics' Guild chapel, devoted to Hodierna and Kertigen
    start_room: 5989
    push: altar
  - location: The Sundering Chapel of the Crossing High Temple
    start_room: 5748
    push: altar
  - location: Ve Aevan Gaenan, The High Altar
    start_room: 5762
    path_in:
    - go platform
    push: altar
    path_out:
    - south
  - location:  The altar to Albreda at Tiger Clan's church
    start_room: 6929
    push: altar
  - location: The shrine to Saemaus in the Handfaster's Glade
    start_room: 1050
    push: altar
  - location: The shrine to Glythtide in Arthe Dale
    start_room: 1067
    push: glythtide
  - location: Damaris' altar near Kaerna
    start_room: 1164
    path_in:
    - go shack
    - go hole
    - west
    - up
    - go path
    push: altar
    path_out:
    - go path
    - go stump
    - east
    - go hole
    - out
  - location: The altar at Misenseor Abbey
    start_room: 6138
    push: altar
  - location: The Rebirth Altar in the Resurrection Creche
    start_room: 5865
    push: altar
# Eluned's shrine commented out due to the need to wait for meditating then wait to not be a fish
#  - location: The Crystal Cavern of Eluned
#    start_room: 1192
#    path_in:
#    - meditate
#    push: statue
#    path_out:
#    - meditate
# Wildflower Meadow commented out due to perception check in order to get there.
#  - location: Wildflower Meadow, Before the Gods
#    start_room: 7306
#    push: boulder
  - location: Huldah's altar at Knife Clan
    start_room: 6217
    push: altar
  Leth Deriel:
  - location: The shrine at Hodierna's Solace
    start_room: 1938
    push: column
  - location: The altar at Kilth Aldiyaus
    start_room: 2047
    path_in:
    - go path
    - e
    push: altar
    path_out:
    - w
    - out
  - location: The blackfruit's altar in the Forest of Night
    start_room: 10049
    push: altar
  - location: The altar to Berengaria in the Gash
    start_room: 2258
    push: altar
  - location: A driftwood altar at River Clan
    start_room: 17058
    push: altar
  Therenborough:
  - location: Kuniyo's stone altar of the Forest's Path's End.
    start_room: 3330
    push: altar
  - location: The shrine of the Huntress in a dark thicket.
    start_room: 3326
    path_in:
    # Added because this is not mapped for Lich.
    - search
    - go forest trail
    push: statue
    path_out:
    - go forest trail
  - location: The altar in Ker'Leor, Zindalyi Lyba.
    start_room: 13_972
    push: altar
  - location: The Fornseted chapel.
    start_room: 14_436
    push: altar
  - location: A stone sliver in Siksraja.
    start_room: 3537
    path_in:
    - look in niche
    push: sliver
  - location: Therenborough's Village Chapel.
    start_room: 11_539
    push: altar
  - location: Chadatru's Chapel in Theren Keep
    start_room: 7067
    push: altar
  - location: The Temple of Ushnish.
    start_room: 13_644
    push: slab
  Throne City:
  - location: Hodierna's Gift Cathedral.
    start_room: 3049
    push: altar
  Riverhaven:
  - location: The shrine to Divyaush in the Riverhaven Temple
    start_room: 440
    push: altar
  - location: The shrine of Harawep in Riverhaven
    start_room: 438
    push: statue
  - location: The shrine of Urrem'tier, a forsaken testament
    start_room: 8545
    path_in:
    # Added because lich isn't set to use the beak.
    - climb vulture beak
    - down
    - down
    - north
    - north
    push: altar
    path_out:
    - south
    - south
    - up
    - up
    - jump swamp
  - location: The tongue-shaped altar of Aldauth in the Vulture's Maw, Kweld Gelvdael
    start_room: 10_860
    path_in:
    # Added because lich isn't set to use the beak.
    - climb vulture beak
    push: tongue
    path_out:
    - jump swamp
  - location: The Scorpion's Stinger.
    start_room: 10_860
    path_in:
    # Added because lich isn't set to use the beak.
    - climb vulture beak
    - down
    - down
    - north
    - north
    - north
    - climb jagged crevice
    - up
    - up
    push: spire
    path_out:
    - down
    - down
    - climb jagged crevice
    - southeast
    - southwest
    - south
    - up
    - up
    - jump swamp
  - location: Drogor's sacrificial altar by Faldesu River
    start_room: 473
    push: altar
  Rossman's Landing:
  - location: Berengaria's altar in Rossman's Landing church
    start_room: 7693
    push: altar
  Muspar'i:
  - location: The Ganen Eliza altar.
    start_room: 7610
    push: altar
  - location: The Temple of Hav'roth Muspar'i.
    start_room: 296
    push: altar
  - location: A battered altar construct in Muspar'i, Golden Heights.
    start_room: 7
    push: construct
# Took out because it requires going thru the shifting maze to get to.
#  - location: A basalt slab at Sand Clan.
#    start_room: 7519
#    push: slab
  Ratha:
  - location: The altar of the dark aspects in Ratha
    start_room: 4957
    push: altar
  - location: Hodierna's Sanctuary, Ratha
    start_room: 13002
    path_in:
    - go arch
    push: altar
    path_out:
    - go arch
  - location: Phelim's Temple, Ratha
    start_room: 5015
    push: altar
  - location: Urrem'tier's Scorpion, Ratha
    start_room: 11102
    push: statue
  - location: Faenella's Temple, Ratha
    start_room: 5006
    push: statue
  - location: Everild's Temple, Ratha
    start_room: 4992
    path_in:
    - go temple
    - go cave
    push: altar
    path_out:
    - out
    - out
  - location: Damaris' Temple, Ratha
    start_room: 4930
    path_in:
    - go temple
    push: altar
    path_out:
    - go door
  - location: The shrine to Glythtide, Ratha
    start_room: 4943
    path_in:
    - go door
    push: statue
    path_out:
    - out
  - location: Chadatru's Temple, Ratha
    start_room: 4949
    path_in:
    - go courtyard
    push: altar
    path_out:
    - out
  - location: Kertigen's Temple, Ratha
    start_room: 7469
    push: altar
  - location: Eluned's Temple, Ratha.
    start_room: 7489
    push: altar
  - location: The shrine to Phelim on Taisgath.
    start_room: 5016
    push: statue
  - location: Truffenyi's Fountain, Ratha
    start_room: 4991
    push: statue
  - location: Sshoi-sson Palace
    start_room: 7151
    push: altar
  - location: The Alamhif statue on Shh'o'kumu Terrace.
    start_room: 5092
    push: statue
  - location: The shrine to Berengaria on Reshalia.
    start_room: 5124
    push: altar
  Aesry:
  - location: The shrine of Drogor, Aesry Surlaenis'a.
    start_room: 12_479
    push: shrine
# Manual: https://elanthipedia.play.net/Pilgrim%27s_badge#Aesry_Surlaenis'a
#  - location: The main altar in Halasa Temple, Aesry Surlaenis'a
  Mer'Kresh:
  - location: The Clerics' Guild Chapel in Mer'Kresh.
    start_room: 11814
    push: altar
  - location: The living coral altar of the Carillon.
    start_room: 6654
    push: coral
  - location: The Clerics' Guild in Mer'Kresh.
    start_room: 11_814
    push: altar
  - location: The altar of Lost Hope
    start_room: 11_879
    push: altar
  Shard:
  - location: Kuniyo's altar in the Prairie Grove, Gilen Otso Steppes
    start_room: 6327
    push: altar
  - location: The chapel in Steelclaw clan
    start_room: 2888
    push: altar
  - location: An ebony altar in a secluded shrine on the Darkmist Moor.
    start_room: 2825
    path_in:
    - go small bridge
    - east
    - search
    - go dirt path
    - southeast
    - southeast
    - southeast
    - southwest
    - east
    - northeast
    - southeast
    - northeast
    push: altar
    path_out:
    - southwest
    - northwest
    - northeast
    - northwest
    - northeast
    - west
    - northeast
    - go path
    - west
    - go white bridge
  - location: The wedding chapel at Marachek's Oak
    start_room: 2943
    push: disk
  - location: The Shrine to the Dragon
    start_room: 10171
    push: altar
  - location: Berengaria's stone shrine
    start_room: 2867
    push: shrine
  - location: The rebirth altar in the Temple of Light
    start_room: 11381
    push: altar
  - location: The rebirth altar in the Temple of Darkness
    start_room: 8161
    push: altar
  - location: The Undershard temple
    start_room: 14487
    push: altar
    path_out:
    # Added because lich kept going the wrong way to get out.
    - south
    - south
    - west
    - west
    - west
    - west
    - north
    - north
    - northwest
    - northwest
    - north
    - north
    - west
    - west
    - up
    - northeast
    - northwest
    - go opening
    - southwest
    - up
    - up
  - location: A granite plinth at Shadow's Reach
    start_room: 11428
    push: plinth
  - location: Corik's Wall, Chantry
    start_room: 9729
    push: altar
  - location: Kerenhappuch's hot springs
    start_room: 14320
    push: altar
  - location: A purple osage heartwood altar at Horse Clan
    start_room: 6366
    push: altar
  Hibarnhvidar:
  - location: Traveler's Shrine, Hibarnhvidar
    start_room: 15867
    push: altar
  - location: Temple of the North Wind, Catacombs.
    start_room: 46809
    push: statue
  - location: Temple of the North Wind.
    start_room: 34398
    push: altar
  - location: A peregan tree altar at Boar Clan.
    start_room: 
    push: altar
  - location: The two-headed miracle in a black willow.
    start_room: 4229
    path_in:
    # Added because this room is not mapped for lich.
    - climb black willow
    push: skeleton
    path_out:
    - climb willow trunk
  - location: Clerics' Guild, Courtyard
    start_room: 4196
    push: statue
  - location: Albreda's Shrine, Hibarnhvidar
    start_room: 15872
    push: altar
  - location: The central altar of the Temple of Kertigen
    start_room: 3867
    push: altar
  - location: A peregan tree altar at Boar Clan
    start_room: 11756
    push: altar
  - location: Divyaush's slab in an abandoned mine
    start_room: 4397
    push: slab
  - location: The Road Beneath the Mountain.
    start_room: 3977
    push: statue
  - location: Chapel of Raven's Point.
    start_room: 4437
    push: altar
  Ain Ghazal:
  - location: The Green Glade of Ain Ghazal.
    start_room: 11630
    push: altar
  Fang Cove:
  - location: A hidden cave in Fang Cove.
    start_room: 8347
    push: boulder

I also noticed sometimes I accidentally stow my badge instead of wearing it (fairly sure that was a me issue, not a script issue) but if you're interested, I got that error included that when looking at the badge shows you have one but you're not wearing it, it'll grab it instead of stalling.

=begin
  Documentation: https://elanthipedia.play.net/Lich_script_repository#pilgrimage
=end

custom_require.call(%w[common common-items common-money common-travel])

class Pilgrimage
  def initialize
    @settings = get_settings
    hometown = @settings.hometown
    buy_badge(hometown)

    visited = visited_shrines
    unvisited = unvisited_shrines(visited, hometown)

    unvisited.each { |shrine| visit(shrine) }
  end

  def buy_badge(hometown)
    description = 'pilgrim\'s badge'
    return if DRCI.exists?(description)

    if DRStats.cleric?
      DRCM.ensure_copper_on_hand(37_500, @settings)
      room = get_data('town')[hometown]['theurgy_supplies']['id']
      DRCT.walk_to(room)
      move('go storeroom')
      DRC.bput("buy #{description}", 'You decide')
      DRC.bput("kiss my #{description}", 'making it your own', 'You kiss')
      DRC.bput("wear my #{description}", 'You put on')
      move('out')
    else
      echo '***YOU MUST BE A CLERIC TO BUY A PILGRIM\'S BADGE***'
      exit
    end
  end

  def visited_shrines
    fput('look my pilgrim badge')
    pause
    log = reget(100)
    start_index = log.rindex { |x| x =~ /You have/i } + 1

    log[start_index..-1]
  end

  def unvisited_shrines(visited, hometown)
    hometown_shrines = get_data('shrines')['shrines'][hometown]
    hometown_shrines.reject { |new_shrine| visited.any? { |badge_shrine| badge_shrine =~ /#{new_shrine['location']}/i } }
  end

  def visit(shrine)
    DRCT.walk_to(shrine['start_room'])
    shrine['path_in'].each { |dir| move(dir) }
    case DRC.bput('remove my pilgrim badge', 'You take off', 'Remove what?')
      when /Remove what?/
        DRC.bput('get my pilgrim badge', 'You get a pilgrim')
        DRC.bput("push #{shrine['push']} with my pilgrim badge", 'You press')
        DRC.bput('wear my pilgrim badge', 'You put on')
        shrine['path_out'].each { |dir| move(dir) }
      when /You take off/
        DRC.bput("push #{shrine['push']} with my pilgrim badge", 'You press')
        DRC.bput('wear my pilgrim badge', 'You put on')
        shrine['path_out'].each { |dir| move(dir) }
      end
  end
end

# Call this last to avoid the need for forward declarations
Pilgrimage.new
mikejcook commented 2 months ago

This is great. I copied these locally and tested against Hib and Fang Cove and my cleric added them to their badge. I also added a hometown override argument to pilgrimage locally so that I could send the cleric to the different cities. If no one else does this in the next couple days, I'll submit a PR with the shrine data and the updated script early next week.

Kaesken commented 2 months ago

This is great. I copied these locally and tested against Hib and Fang Cove and my cleric added them to their badge. I also added a hometown override argument to pilgrimage locally so that I could send the cleric to the different cities. If no one else does this in the next couple days, I'll submit a PR with the shrine data and the updated script early next week.

Awesome! I'm glad! :D And yeah, having to put each town under my hometown was the only thing I was like ugh, which towns were these again? xD Kinda wish there was a way to do a ,pilgrimage <town> option. But I would have zero clue how to do that. I tried adding this in PR but I guess I'm too dumb to figure it out. I know I used to know how to do it thanks to Mahtra but it's been so many years ago.

mikejcook commented 2 months ago

Yep! That's exactly how the script I modified works. Once I'm back at a computer, I'll get it submitted.

On Sat, Jul 27, 2024 at 4:09 PM Kaesken @.***> wrote:

This is great. I copied these locally and tested against Hib and Fang Cove and my cleric added them to their badge. I also added a hometown override argument to pilgrimage locally so that I could send the cleric to the different cities. If no one else does this in the next couple days, I'll submit a PR with the shrine data and the updated script early next week.

Awesome! I'm glad! :D And yeah, having to put each town under my hometown was the only thing I was like ugh, which towns were these again? xD Kinda wish there was a way to do a ,pilgrimage option. But I would have zero clue how to do that. I tried adding this in PR but I guess I'm too dumb to figure it out. I know I used to know how to do it thanks to Mahtra but it's been so many years ago.

— Reply to this email directly, view it on GitHub https://github.com/rpherbig/dr-scripts/issues/6875#issuecomment-2254242709, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5S2IN7ML3BBJAOUVJBOP3ZOP47NAVCNFSM6AAAAABLOY7APOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGI2DENZQHE . You are receiving this because you commented.Message ID: @.***>

Kaesken commented 2 months ago

Oh, noice!! I'm so excited to see it in action! :D