Plantheal - elanthia-online/dr-scripts GitHub Wiki
Empathy training script for DragonRealms. Automates the Embrace of the Vela'Tohr (EV) plant healing loop to train the Empathy skill.
The script runs a simple cycle: hug once, heal, repeat until either hug_count total
hugs or empathy_threshold mindstate is reached (whichever comes first).
Each cycle:
-
Check exit conditions -- exits if
hug_counttotal hugs reached ORempathy_thresholdmindstate reached (unlessheal_past_mlis true). Ifcast_roomis set, casts a community EV for others before exiting. -
Wound score check -- verifies
DRCH.check_health['score']is 0 (no existing wounds). If wounds are detected, heals (see Healing Strategy) before continuing. -
Walk to plant room -- your EV plant location.
-
Hug plant once -- transfers wounds via
hug. Before hugging, the script runs a pre-hug check that verifies:- Not bleeding (
bleeding?) -- if bleeding, stops and proceeds to heal. - Total hugs < hug_count -- stops if hug limit reached.
- Empathy mindstate < threshold -- stops if threshold reached.
- Wound score is 0 -- if wounds detected, heals to full first.
- EV is active -- casts it if not.
- At least one of Heal or Regenerate is active -- rebuffs via
buff planthealif needed (Heal + Adaptive Curing strategy only). -
Plant noun is re-resolved from
DRRoom.room_objs-- ensures the correct noun is used even if the plant morphology changed (e.g. another empath's briar merged into a thicket). If the plant disappears entirely, stops.
If the hug reports no empathic bond, or the plant "appreciates the sentiment", the script releases and recasts EV and tries the hug again (up to 3 tries).
- Not bleeding (
-
Heal -- always runs after the hug, even if at a limit (see Healing Strategy).
-
Zero-hug check -- if the hug didn't succeed, exits with a context-specific message:
- No plant found -- EV recast failed or plant_room is misconfigured.
- Plant fully healed -- plant has no wounds to transfer; cast a new EV.
- Stopped early -- bleeding, hug_count, threshold, plant disappeared, a stale plant noun ("Hug what?"), or the hug retries ran out. The state at the time is printed just before this message.
-
Repeat.
The script picks how to heal you at startup, from the spells you know:
| You know | Strategy | How it heals |
|---|---|---|
| Heal and Adaptive Curing | Passive (waggle) | Keeps Heal or Regenerate active by running buff plantheal, then waits where you are for your wounds to clear, checking every 5 seconds. If you are still wounded after 2 minutes, it walks to healing_room and runs healme as a fallback. Your plantheal waggle_set must contain a Heal or Regenerate entry. |
| Anything else | healme |
Walks to healing_room and runs the healme script. Warns at startup if you don't know Heal Wounds or Heal Scars, since healme relies on them. |
The startup message says which one it chose.
- Must be an Empath with the Embrace of the Vela'Tohr spell.
- A valid
planthealwaggle_set must be defined containing an Embrace of the Vela'Tohr spell entry (see Waggle Sets). If you know Heal and Adaptive Curing, it must also contain a Heal or Regenerate entry. - Unless you know Heal and Adaptive Curing, the
healmescript must be configured and working. (It is also the fallback for the passive strategy.)
All settings nest under plantheal_settings: in your YAML profile.
plantheal_settings:
hug_count: 3
plant_room: null
healing_room: null
prep_room: null
cast_room: null
empathy_threshold: 24
heal_past_ml: false
ev_cast_mana: 600
ev_extra_wait: 15
focus_container: null| Setting | Type | Default | Description |
|---|---|---|---|
hug_count |
Integer | 3 |
Total hugs before exiting (across all cycles). Script stops when this many hugs complete OR threshold is reached. |
plant_room |
Integer | hometown NPC empath | Room ID where your EV plant is. If unset, uses your hometown's NPC empath room (respects force_healer_town). |
healing_room |
Integer | safe_room |
Room ID to go to for healme (the healme strategy, or the passive strategy's fallback). Falls back to your safe_room setting. |
prep_room |
Integer | (same as plant_room) | Room to prepare EV in, if different from plant_room. Useful for Dokt's or rooms where you can't prep spells. When set, EV is always cast manually (the buff script cannot switch rooms). |
cast_room |
Integer | (disabled) | Room to cast a community EV for others when exiting because hug_count or empathy_threshold was reached. Not done on the other exits, so never with heal_past_ml: true. If unset/0, this step is skipped. |
empathy_threshold |
Integer | 24 |
Empathy mindstate at which to stop cycling. Script stops when threshold is reached OR hug_count hugs complete. |
heal_past_ml |
Boolean | false |
If true, cycles until the plant is fully healed (ignores both hug_count and empathy_threshold). Use this when you want to completely heal the plant in one sitting regardless of skill gains. |
ev_cast_mana |
Integer | 600 |
Mana to use when casting community EV in cast_room. |
ev_extra_wait |
Integer | 15 |
Extra seconds to wait after roundtime before casting EV. Accounts for ritual prep time. |
focus_container |
String | (empty) | Container to get/stow the ritual focus from (e.g. "backpack"). Only needed when the focus is not worn, tied, or sheathed. No waggle_set equivalent. |
The script has three operating modes controlled by heal_past_ml:
| Mode | Settings | Behavior |
|---|---|---|
| Threshold-limited | heal_past_ml: false |
Stops at FIRST of: hug_count hugs OR empathy_threshold reached. Use for controlled skill training. |
| Count-limited |
heal_past_ml: false, empathy_threshold: 34
|
Set threshold to mind lock (34) to effectively use only hug_count as the limit. |
| Full heal | heal_past_ml: true |
Cycles until the plant is fully healed ("has no need of healing"). Ignores both hug_count and empathy_threshold. Use when you want to completely heal the plant in one sitting. |
The plantheal waggle_set is required and must contain an Embrace of the Vela'Tohr
spell entry. The script validates this at startup and exits with an informative error if
the waggle_set is missing or doesn't contain the expected spell key.
All spell data -- mana, focus item, and focus handling mode (worn/tied/sheathed) -- is
drawn from this entry. Fields not explicitly defined are filled by dependency from
base-spells.yaml, so a minimal entry only needs the spell name as the key.
If no prep_room is set, the script delegates EV casting to the buff script via
this waggle_set. If prep_room is set, the script casts EV manually (the buff
script has no concept of prepping in one room and casting in another).
If you know Heal and Adaptive Curing, this waggle_set must also contain a
Heal or Regenerate entry: the script runs buff plantheal to keep one of them
active and heals you passively instead of running healme (see
Healing Strategy). Blood Staunching can go here too.
waggle_sets:
plantheal:
Embrace of the Vela'Tohr:
mana: 20
recast: 60
ritual: true
focus: emerald charm
worn_focus: false
tied_focus: false
sheathed_focus: false
prep_time: 30
# ...Minimal entry (dependency fills basic spell data from base-spells.yaml, but focus must be configured):
waggle_sets:
plantheal:
Embrace of the Vela'Tohr:
mana: 800
worn_focus: true
focus: emerald charm
recast: 15Focus handling: Focus options (focus, worn_focus, tied_focus, sheathed_focus)
are not inherited from base-spells.yaml -- only basic spell data like abbrev and
ritual are inherited via dependency. You must explicitly configure your focus item and
storage method in your waggle_set. DRCA handles focus retrieval/stowing automatically via
find_focus/invoke/stow_focus, supporting all storage modes equally.
Focus handling modes (must be explicitly configured):
| Waggle Field | Effect |
|---|---|
focus |
The ritual focus item name (e.g. emerald charm). Required for ritual spells. Invoke command is auto-generated as invoke my <focus>. |
worn_focus: true |
Focus is worn -- uses remove/wear. |
tied_focus: <target> |
Focus is tied to something -- uses untie from/tie to. Value is the tie target (e.g. belt). |
sheathed_focus: true |
Focus is sheathed -- uses wield/sheathe. |
| (none set) | Focus is stowed -- uses get my/stow. If focus_container is set, uses get from/stow in. |
Focus modes are mutually exclusive. Precedence: worn > tied > sheathed > focus_container > generic get.
Older versions pre-cast a separate plant_heal waggle_set when use_adc: true. Both
are gone: put Heal or Regenerate (and Blood Staunching, if you like) in the plantheal
waggle_set instead. A leftover plant_heal waggle_set or use_adc setting is ignored.
waggle_sets:
plantheal:
Embrace of the Vela'Tohr:
mana: 20
recast: 60
focus: emerald charm
Heal:
abbrev: HEAL
mana: 15
# ...
Blood Staunching:
abbrev: BS
mana: 10
# ...The script chooses between two EV casting strategies:
| Condition | Strategy | How It Works |
|---|---|---|
No prep_room set |
Buff delegation | Runs buff plantheal which handles the full spell lifecycle via DRCA.cast_spell / DRCA.ritual. Simple and clean. |
prep_room is set |
Manual casting | Walks to prep_room, calls DRCA.prepare?('EV', mana), handles ritual focus (get/invoke/stow), walks back to plant room, calls cast. Mana is read from the plantheal waggle_set. |
Manual casting is necessary because DRCA.ritual() (used internally by buff) performs
prepare -> focus -> invoke -> wait -> cast all in the current room. There is no
room-switching support in the waggle_set infrastructure.
If a manual cast backfires, the script prepares and casts again, up to 3 attempts in all, then gives up with "EV backfired 3 times -- giving up."
If you have settings from older versions of plantheal.lic, they
will be automatically migrated with a deprecation warning. The new plantheal_settings
hash takes priority if both are defined.
| Legacy Setting | Maps To |
|---|---|
plant_total_touch_count |
hug_count |
plant_custom_room |
plant_room |
plant_drop_room |
plant_room |
plant_healing_room |
healing_room |
plant_prep_room |
prep_room |
plant_heal_past_ML |
heal_past_ml |
plant_empathy_threshold |
empathy_threshold |
cast_room |
cast_room |
ritual_ev_mana |
ev_cast_mana |
ritual_ev_extra_wait |
ev_extra_wait |
ritual_focus_container |
focus_container |
plant_adc (and use_adc) are no longer read; see plant_heal.
Uses hometown NPC empath room, safe_room for healing, no community cast. Focus must be explicitly configured (not inherited from base-spells).
plantheal_settings:
hug_count: 3
waggle_sets:
plantheal:
Embrace of the Vela'Tohr:
mana: 20
recast: 60
focus: emerald charmFor an Empath who knows Heal and Adaptive Curing: heals passively in place, with
healme in healing_room only as a fallback.
plantheal_settings:
hug_count: 5
plant_room: 1234
healing_room: 5678
empathy_threshold: 30
waggle_sets:
plantheal:
Embrace of the Vela'Tohr:
mana: 20
recast: 60
focus: emerald charm
Heal:
abbrev: HEAL
mana: 15
Blood Staunching:
abbrev: BS
mana: 10For when you need to prep EV in a different room (e.g. Dokt's).
plantheal_settings:
hug_count: 3
plant_room: 1234
healing_room: 5678
prep_room: 9999
cast_room: 4444
ev_cast_mana: 600
ev_extra_wait: 15
heal_past_ml: true
focus_container: backpack
waggle_sets:
plantheal:
Embrace of the Vela'Tohr:
mana: 20
recast: 60waggle_sets:
plantheal:
Embrace of the Vela'Tohr:
mana: 20
recast: 60
focus: armband
worn_focus: trueIf you previously used the flat settings from plantheal.lic:
# OLD -- still works but will show deprecation warnings:
plant_drop_room: 1234
plant_healing_room: 5678
plant_prep_room: 9999
plant_total_touch_count: 3
plant_empathy_threshold: 24
plant_heal_past_ML: false
cast_room: 4444
ritual_focus_container: "backpack"
ritual_ev_mana: 600
ritual_ev_extra_wait: 15
# NEW -- migrate to this:
plantheal_settings:
plant_room: 1234
healing_room: 5678
prep_room: 9999
hug_count: 3
empathy_threshold: 24
heal_past_ml: false
cast_room: 4444
ev_cast_mana: 600
ev_extra_wait: 15
focus_container: backpack
waggle_sets:
plantheal:
Embrace of the Vela'Tohr:
mana: 20
recast: 60
focus: emerald charmIf you previously used the flat settings from the original custom plantheal.lic:
# OLD -- still works but will show deprecation warnings
# (plant_adc is no longer read; see Healing Strategy):
plant_adc: true
plant_total_touch_count: 3
plant_custom_room: 1234
plant_healing_room: 5678
plant_prep_room: 9999
plant_heal_past_ML: false
plant_empathy_threshold: 24
# NEW -- migrate to this:
plantheal_settings:
hug_count: 3
plant_room: 1234
healing_room: 5678
prep_room: 9999
heal_past_ml: false
empathy_threshold: 24
waggle_sets:
plantheal:
Embrace of the Vela'Tohr:
mana: 20
recast: 60
focus: emerald charmstart
|
v
validate plantheal waggle_set (must have "Embrace of the Vela'Tohr" entry)
|
v
pick healing strategy: Heal + Adaptive Curing known? --yes--> passive (needs Heal/Regenerate in plantheal)
| --no---> healme
v
stow_hands
|
v
+---> check_exit_conditions:
| - [total_hugs >= hug_count?] --yes--> cast_for_others? --> exit
| - [empathy >= threshold?] --yes--> cast_for_others? --> exit
| |
| (both no, unless heal_past_ml is true)
| |
| v
| [wound score > 0?] --yes--> heal -> (loop back)
| |
| no
| |
| v
| walk_to(plantroom)
| |
| v
| hug_plant_once (one hug per cycle; recast EV and retry, up to 3 tries,
| | on "no empathic bond" or "appreciates the sentiment")
| v
| heal (always runs after hugging):
| passive -> buff plantheal if no Heal/Regenerate, wait up to 120s,
| then walk_to(healingroom) -> healme if still wounded
| healme -> walk_to(healingroom) -> healme
| |
| v
| [hug succeeded?] --no--> context-specific exit message:
| | :no_plant -> "No plant found in room after EV recast."
| | :fully_healed -> "Plant fully healed -- no wounds to transfer."
| | :stopped_early-> "Stopped before hugging (see logs)."
| | --> exit
| |
| yes
| |
+-------+ (loop back to check_exit_conditions)
pre_hug_check (runs before hug, returns noun or false):
1. bleeding? -> if yes, stop and go heal
2. total_hugs >= hug_count? -> if yes (and heal_past_ml=false), stop
3. empathy >= threshold? -> if yes (and heal_past_ml=false), stop
4. heal_between_hugs if wound score > 0
5. ensure_ev (cast EV if not active)
6. ensure_healing_spells (passive strategy: buff plantheal if neither Heal nor Regenerate active)
7. resolve plant noun from DRRoom.room_objs -> if no plant, stop
Script exits when FIRST of:
- total_hugs reaches hug_count
- empathy mindstate reaches threshold
| Problem | Cause | Fix |
|---|---|---|
| "Must be an Empath" on start | Not playing an Empath character | Script is Empath-only |
| "Can't resolve plant room" | No plant_room set and hometown data missing |
Set plantheal_settings.plant_room explicitly |
| "waggle_set 'plantheal' is required" | No plantheal waggle_set defined |
Define a plantheal waggle_set with an Embrace of the Vela'Tohr entry |
| "must contain an 'Embrace of the Vela'Tohr' spell entry" | Waggle_set exists but has wrong spell key | Ensure the spell key is exactly Embrace of the Vela'Tohr
|
| "You know Heal+AC but neither Heal nor Regenerate is in your plantheal waggle_set!" | You know Heal and Adaptive Curing, so the script heals passively, but has no spell to keep up | Add a Heal or Regenerate entry to the plantheal waggle_set |
| "WARNING: You don't know Heal Wounds (HW)!" / "...Heal Scars (HS)!" | The healme strategy is in use and you lack a spell healme relies on |
Learn the spell, or learn Heal and Adaptive Curing for the passive strategy |
| "Still wounded after 120s of passive healing" | Heal/Regenerate didn't clear your wounds in 2 minutes | The script falls back to healme in healing_room; make sure that works |
| "EV backfired 3 times -- giving up." | Manual EV cast (with prep_room) backfired on every attempt |
Check your mana and focus settings |
| "Max hug retries reached" | EV was recast 3 times and the hug still failed | Check that the plant in plant_room is yours, or cast EV manually |
| EV not casting properly | Focus item misconfigured | Check focus / worn_focus / tied_focus / sheathed_focus in your plantheal waggle_set |
| Plant not found after EV cast | EV expired or was released between rooms | Increase ev_extra_wait or reduce travel distance |
| "Hug what?" during cycle | Plant noun changed (e.g. briar merged into thicket) between the pre-hug check and the hug | The pre-hug check re-resolves the noun from DRRoom.room_objs before every hug, so this is rare. If it still happens, the script recasts EV if it's due, heals, and stops with "Stopped before hugging"; run it again |
| "appreciates the sentiment" during hug | You hugged a plant that isn't your EV bond (another empath's plant or EV expired) | Script auto-recovers by releasing and recasting EV, then hugging again (up to 3 tries) |
| "No plant found in room after EV recast" | EV recast failed or plant_room is wrong |
Check your plant_room setting, cast EV manually, or increase ev_extra_wait
|
| "Plant fully healed -- no wounds to transfer" | Plant has no wounds | Normal exit -- cast a new EV or wait for the plant to accumulate wounds |
| "Stopped before hugging" | Bleeding, hug_count reached, threshold reached, plant disappeared, "Hug what?", or hug retries ran out | Check the pre_hug_check state: line and the messages above it for the specific reason |
| "Total hug count reached" |
hug_count hugs completed |
Normal exit -- script completed the configured number of hugs |
| "Deprecated setting" warnings | Using old flat YAML keys | Migrate to plantheal_settings hash (see examples above) |