-
Notifications
You must be signed in to change notification settings - Fork 178
/
commune.lic
145 lines (123 loc) · 5.75 KB
/
commune.lic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#commune
=end
custom_require.call(%w[common common-items common-theurgy])
class Commune
def initialize
if !DRStats.cleric?
DRC.message('Silly rabbit, communes are for clerics.')
exit
end
settings = get_settings
@bag = settings.crafting_container
@bag_items = settings.crafting_items_in_container
@theurgy_supply_container = settings.theurgy_supply_container
@water_holder = settings.water_holder
@flint_lighter = settings.flint_lighter
@immortal_aspect = settings.immortal_aspect
@self = checkname.to_s
arg_definitions = [
[
{ name: 'Tamsine', regex: /^ta.*/i, variable: true, description: 'Increase TM vs. undead.' }
], [
{ name: 'Eluned', regex: /^e.*/i, variable: true, description: 'Create holy water.' }
], [
{ name: 'Athletics', regex: /^ath.*/i, variable: true, description: 'Use jalbreth balm to boost athletics.' },
{ name: 'debug', regex: /debug/, optional: true, description: 'Forces debugging output on' }
], [
{ name: 'Kertigen', regex: /^k.*/i, variable: true, description: 'Bless weapon or person.' },
{ name: 'target', regex: /\w/i, optional: true, description: 'Target weapon or person. Defaults to self.' }
], [
{ name: 'Hodierna', regex: /^h.*/i, variable: true, description: 'Staunch bleeding.' }
], [
{ name: 'Meraud', regex: /^m.*/i, variable: true, description: 'Increase mana in room.' }
], [
{ name: 'Truffenyi', regex: /^tr.*/i, variable: true, description: 'Get or return favor orb for you. Get favor orb for others (kneeling). Proper offering required in right hand.' },
{ name: 'target', regex: /\w/i, optional: true, description: 'Target person. Defaults to self.' }
], [
{ name: 'Carve', regex: /^carve/i, variable: true, description: 'Carve a prayer bead. Must have block or be able to forage a limb.' }
]
]
args = parse_args(arg_definitions)
@debug = args.debug
if @debug
echo "commune-debug:\n" +
"- args: #{args.to_yaml}"
end
if args.Tamsine
commune_tamsine
elsif args.Eluned
commune_eluned
elsif args.Athletics
commune_eluned_athletics
elsif args.Kertigen
commune_kertigen(args.target)
elsif args.Hodierna
commune_hodierna
elsif args.Meraud
commune_meraud
elsif args.Truffenyi
commune_truffenyi(args.target)
elsif args.Carve
create_bead
end
end
def create_bead(_bead_type = 'meraud')
DRC.message("
#####################################################
### Bead Carving has been moved to carve-bead.lic ###
#####################################################")
end
def commune_tamsine
return unless DRCTH.has_holy_water?(@theurgy_supply_container, @water_holder)
DRCTH.sprinkle_holy_water(@theurgy_supply_container, @water_holder, @self)
DRC.bput('commune tamsine', 'You feel warmth spread throughout your body', DRCTH::COMMUNE_ERRORS, DRCTH::DEVOTION_LEVELS)
end
def commune_eluned
DRCTH.empty_cleric_hands(@theurgy_supply_container)
return unless DRC.forage?('dirt')
DRCI.get_item_safe(@water_holder, @theurgy_supply_container)
DRC.bput('commune eluned', 'You grind some dirt in your fist', DRCTH::COMMUNE_ERRORS, DRCTH::DEVOTION_LEVELS)
DRCI.put_away_item?(@water_holder, @theurgy_supply_container)
DRCI.dispose_trash('dirt') if DRCI.in_hands?('dirt')
end
def commune_eluned_athletics
echo "commune-debug: starting Eluned's second commune" if @debug
return unless DRCTH.has_jalbreth_balm?(@theurgy_supply_container)
DRCTH.apply_jalbreth_balm(@theurgy_supply_container, @self)
DRC.bput('commune', '.*')
end
def commune_kertigen(target)
return unless DRCTH.has_holy_oil?(@theurgy_supply_container)
target ||= @self
DRCTH.sprinkle_holy_oil(@theurgy_supply_container, target)
DRC.bput('commune kertigen', 'The thick smell of ozone fills your nostrils', 'You whisper a prayer over', 'covered in a fine white powder that wipes off easily', 'crackles and sizzles for a moment', 'Perhaps it is already blessed', DRCTH::COMMUNE_ERRORS, DRCTH::DEVOTION_LEVELS)
end
def commune_hodierna
return unless DRCTH.has_holy_water?(@theurgy_supply_container, @water_holder)
return unless DRCTH.has_holy_oil?(@theurgy_supply_container)
DRCTH.sprinkle_holy_water(@theurgy_supply_container, @water_holder, @self)
DRCTH.sprinkle_holy_oil(@theurgy_supply_container, @self)
DRC.bput('commune hodierna', 'Your skin tingles and you feel a fiery pain', 'Your body tingles for a moment, but there are no injuries', DRCTH::COMMUNE_ERRORS, DRCTH::DEVOTION_LEVELS)
end
def commune_meraud
return unless DRCTH.has_holy_water?(@theurgy_supply_container, @water_holder)
return unless DRCTH.has_incense?(@theurgy_supply_container)
DRCTH.wave_incense?(@theurgy_supply_container, @flint_lighter, @self)
DRCTH.sprinkle_holy_water(@theurgy_supply_container, @water_holder, @self)
DRC.bput('commune meraud', 'For a split second you embrace existence without substance', DRCTH::COMMUNE_ERRORS, DRCTH::DEVOTION_LEVELS)
end
def commune_truffenyi(target)
target ||= @self
case DRC.bput("commune truffenyi #{target}", 'The power of Truffenyi has answered your prayer', 'You must be holding your favor offering or orb in your right hand', DRCTH::COMMUNE_ERRORS, DRCTH::DEVOTION_LEVELS)
when 'The power of Truffenyi has answerd your prayer'
return true
when 'You must be holding your favor offering or orb in your right hand'
DRC.message('You must be holding a proper offering or favor orb in your right hand')
return false
else
return false
end
end
end
Commune.new