Skip to content

Commit

Permalink
Bivouac598 Parser Updates (#186)
Browse files Browse the repository at this point in the history
- Feign Death Failure Alert - Triggers for ANY fallen to the ground message. Would be cool to distinguish player's name from others.

- Additional Item Drop Alert - When the player drops an item intentionally,
rather than overflowing inventory.

- 10 second default zone pop delay

- Auto-set Respawn Timer Bug Fix
> I encountered the same bug someone posted about on the P99 forum: https://www.project1999.com/forums/showpost.php?p=3515521&postcount=13
> It occured when a character that had never been seen logging in or zoning gained experience with the auto-timer enabled. Added an "unavailable" zone to the config rather than adding a conditional that would so rarely be met.

---------

Authored-by: bivouac598 <bivouac598@gmail.com>
  • Loading branch information
mgeitz authored Mar 26, 2023
1 parent c5121ce commit b70d9c4
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 18 deletions.
18 changes: 9 additions & 9 deletions eqa/eqalert.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,15 @@ def main():
+ state.server,
)
)
sound_q.put(
eqa_struct.sound(
"speak",
"Character changed to "
+ state.char
+ " on "
+ state.server,
)
)
# sound_q.put(
# eqa_struct.sound(
# "speak",
# "Character changed to "
# + state.char
# + " on "
# + state.server,
# )
# )
display_q.put(
eqa_struct.display(
eqa_settings.eqa_time(), "draw", "redraw", "null"
Expand Down
6 changes: 5 additions & 1 deletion eqa/lib/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def process(
timer_seconds = configs.zones.config["zones"][str(state.zone)][
"timer"
]
timer_seconds = str(int(timer_seconds)-10)
if (int(timer_seconds) < 0):
timer_seconds = "0"
timer_q.put(
eqa_struct.timer(
(
Expand All @@ -191,7 +194,8 @@ def process(
),
"timer",
str(timer_seconds),
"Pop " + str(state.zone),
# "Pop " + str(state.zone),
"Repop in ten",
)
)
## Consider Evaluation
Expand Down
43 changes: 41 additions & 2 deletions eqa/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2673,6 +2673,10 @@ def build_config(base_path):
"Western Wastes": {
"raid_mode": "true",
"timer": "0"
},
"unavailable": {
"raid_mode": "false",
"timer": "0"
}
},
"version": "%s"
Expand All @@ -2682,6 +2686,11 @@ def build_config(base_path):
new_line_combat_config = """
{
"line": {
"combat_ranger_drake": {
"alert": {},
"reaction": "solo",
"sound": "ranger drake"
},
"combat_no_target": {
"alert": {},
"reaction": "solo",
Expand Down Expand Up @@ -2950,6 +2959,11 @@ def build_config(base_path):
"reaction": "solo",
"sound": "gate collapse"
},
"spells_gate_npc_casting": {
"alert": {},
"reaction": "solo",
"sound": "mob gating"
},
"spells_heal_other": {
"alert": {},
"reaction": "false",
Expand Down Expand Up @@ -3100,6 +3114,11 @@ def build_config(base_path):
"reaction": "solo",
"sound": "too powerful"
},
"spells_charm_worn_off": {
"alert": {},
"reaction": "solo",
"sound": "true"
}
"spells_worn_off": {
"alert": {},
"reaction": "solo",
Expand Down Expand Up @@ -3543,6 +3562,16 @@ def build_config(base_path):
"reaction": "false",
"sound": "false"
},
"spell_berserker_spirit_you_off": {
"alert": {},
"reaction": "solo",
"sound": "berserker spirit dropped"
},
"spell_berserker_spirit_you_on": {
"alert": {},
"reaction": "false",
"sound": "false"
},
"spell_berserker_strength_other_on": {
"alert": {},
"reaction": "false",
Expand Down Expand Up @@ -6901,7 +6930,7 @@ def build_config(base_path):
"spell_line_brd_strands_fade_you_off": {
"alert": {},
"reaction": "solo",
"sound": "bard strands dropped"
"sound": "lyssas solidarity of vision dropped"
},
"spell_line_brd_tuyen_other_on": {
"alert": {},
Expand Down Expand Up @@ -8551,7 +8580,7 @@ def build_config(base_path):
"spell_lyssas_veracious_concord_you_off": {
"alert": {},
"reaction": "solo",
"sound": "lyssas solidarity of vision dropped"
"sound": "see invis dropped"
},
"spell_lyssas_veracious_concord_you_on": {
"alert": {},
Expand Down Expand Up @@ -9288,6 +9317,11 @@ def build_config(base_path):
"reaction": "false",
"sound": "false"
},
"spell_rain_of_molten_lava_you_on": {
"alert": {},
"reaction": "raid",
"sound": "rain of molten lava"
},
"spell_rapture_other_on": {
"alert": {},
"reaction": "false",
Expand Down Expand Up @@ -12077,6 +12111,11 @@ def build_config(base_path):
"reaction": "false",
"sound": "false"
},
"feign_failure": {
"alert": {},
"reaction": "solo",
"sound": "true"
},
"gm_reset_ability": {
"alert": {},
"reaction": "solo",
Expand Down
48 changes: 42 additions & 6 deletions eqa/lib/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ def check_melee(line):
try:
# Melee Combat
if (
re.fullmatch(r"^A (shimmer|glimmering) drake (kicks|tries to kick).*\.$",
line,
)
is not None
):
return "combat_ranger_drake"
elif (
re.fullmatch(
r"^[a-zA-Z`\s]+ (mauls|hits|crushes|slashes|pierces|bashes|backstabs|bites|kicks|claws|gores|punches|strikes|slices) (you|YOU) for \d+ point(s|) of damage\.$",
line,
Expand Down Expand Up @@ -486,7 +493,9 @@ def check_spell(line):
return "spells_memorize_already"
elif re.fullmatch(r"^You forget .+\.", line) is not None:
return "spells_forget"
elif re.fullmatch(r"^Your [a-zA-Z\s]+ spell has worn off\.$", line) is not None:
elif re.fullmatch(r"^Your charm spell has worn off\.$", line) is not None:
return "spells_charm_worn_off"
elif re.fullmatch(r"^Your [a-zA-Z`\'\s]+ spell has worn off\.$", line) is not None:
return "spells_worn_off"
elif (
re.fullmatch(
Expand Down Expand Up @@ -534,6 +543,11 @@ def check_spell(line):
is not None
):
return "spells_gate_collapse"
elif (
re.fullmatch(r"^[\w\s\'`]+ begins to cast the gate spell\.$", line)
is not None
):
return "spells_gate_npc_casting"
elif (
re.fullmatch(r"^You feel yourself starting to appear\.$", line) is not None
):
Expand Down Expand Up @@ -605,7 +619,7 @@ def check_received_chat(line):
return "tell_npc_bank_closed"
elif (
re.fullmatch(
r"^[a-zA-Z\s`]+ tells you, \'(That\'ll be|I\'ll give you) .+ (for the|per) .+\.\'$",
r"^[a-zA-Z\s`]+ tells you, \'(That\'ll be|I\'ll give you) .+ (for the|per) .+\'$",
line,
)
is not None
Expand Down Expand Up @@ -1065,7 +1079,7 @@ def check_system_messages(line):
return "you_cannot_reach"
elif (
re.fullmatch(
r"^Your faction standing with \w+ (?:could not possibly get any|got) (?:better|worse)\.$",
r"^Your faction standing with [\w`\']+ (?:could not possibly get any|got) (?:better|worse)\.$",
line,
)
is not None
Expand Down Expand Up @@ -1149,6 +1163,8 @@ def check_system_messages(line):
is not None
):
return "autofollow_advice"
elif re.fullmatch(r"^\w+ has fallen to the ground\.", line) is not None:
return "feign_failure"
elif (
re.fullmatch(
r"^You (?:have moved and are no longer hidden\!\!|are no longer hidden\.)$",
Expand Down Expand Up @@ -1251,6 +1267,14 @@ def check_system_messages(line):
is not None
):
return "item_dropped"
elif (
re.fullmatch(
r"^You just dropped your .+\.",
line,
)
is not None
):
return "item_dropped"
elif re.fullmatch(r"^Talking to yourself again\?$", line) is not None:
return "tell_yourself"
elif (
Expand Down Expand Up @@ -3998,6 +4022,11 @@ def check_spell_specific(line):
return "spell_bedlam_you_on"
elif re.fullmatch(r"^Your bedlam fades\.$", line) is not None:
return "spell_bedlam_you_off"
elif (
re.fullmatch(r"^Your spirit screams with berserker strength\.$", line)
is not None
):
return "spell_berserker_spirit_you_on"
elif (
re.fullmatch(r"^Your muscles bulge with berserker strength\.$", line)
is not None
Expand Down Expand Up @@ -4743,7 +4772,7 @@ def check_spell_specific(line):
is not None
):
return "spell_selos_song_of_travel_you_on"
elif re.fullmatch(r"^Your image fades.$", line) is not None:
elif re.fullmatch(r"^Your image fades\.$", line) is not None:
return "spell_shade_you_on"
elif re.fullmatch(r"^Your image fades into shadow\.$", line) is not None:
return "spell_shadow_you_on"
Expand Down Expand Up @@ -5090,6 +5119,8 @@ def check_spell_specific(line):
# return "spell_ros_fiery_sundering_you_off"
# return "spell_shield_of_flame_you_off"
# return "spell_shield_of_lava_you_off"
elif re.fullmatch(r"^The berserker spirit fades\.", line) is not None:
return "spell_berserker_spirit_you_off"
elif re.fullmatch(r"^The maelstrom dissipates\.$", line) is not None:
return "spell_barrier_of_force_you_off"
elif re.fullmatch(r"^The aura fades\.$", line) is not None:
Expand Down Expand Up @@ -6204,6 +6235,7 @@ def check_spell_specific(line):
# return "spell_berserker_madness_ii_other_on"
# return "spell_berserker_madness_iii_other_on"
# return "spell_berserker_madness_iv_other_on"
# return "spell_berserker_spirit_other_on"
elif (
re.fullmatch(
r"^[a-zA-Z`\s]+\'s muscles bulge with berserker strength\.$", line
Expand Down Expand Up @@ -7256,7 +7288,7 @@ def check_spell_specific(line):
is not None
):
return "spell_draught_of_jiva_other_on"
elif re.fullmatch(r"^[a-zA-Z`\s]+ yawns\.$", line) is not None:
elif re.fullmatch(r"^[\w\s`\']+ (?<!opens (his|her|its) mouth wide and )yawns\.$", line) is not None:
return "spell_line_slow_other_on"
# return "spell_drowsy_other_on"
# return "spell_tagars_insects_other_on"
Expand Down Expand Up @@ -7433,7 +7465,7 @@ def check_spell_specific(line):
return "spell_eye_of_confusion_other_on"
elif re.fullmatch(r"^[a-zA-Z`\s]+\'s eyes glow green\.$", line) is not None:
return "spell_eyes_of_the_cat_other_on"
elif re.fullmatch(r"^[a-zA-Z`\s]+ fades\.$", line) is not None:
elif re.fullmatch(r"^[a-zA-Z`]+ fades\.$", line) is not None:
return "spell_fade_other_on"
elif (
re.fullmatch(r"^[a-zA-Z`\s]+ screams in poisoned agony\.$", line)
Expand Down Expand Up @@ -8547,6 +8579,10 @@ def check_spell_specific(line):
is not None
):
return "spell_rage_of_zek_other_on"
elif (
re.fullmatch(r"^Lava sears your skin\. You have taken [0-9]+ points of damage\.$", line) is not None
):
return "spell_rain_of_molten_lava_you_on"
elif (
re.fullmatch(r"^[a-zA-Z`\s]+ swoons in raptured bliss\.$", line) is not None
):
Expand Down

0 comments on commit b70d9c4

Please sign in to comment.