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, walks to the healing room and runshealmebefore continuing. -
Pre-cast healing spells (optional ADC) -- casts the
plant_healwaggle_set (e.g. Heal, Blood Staunching). - 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 -- recasts if needed.
- At least one of Heal or Regenerate is active -- rebuffs if needed.
-
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.
- Not bleeding (
- Walk to healing room -- returns to heal yourself.
-
Run
healme-- executes the healme script (always runs, even if at limit). -
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, or plant disappeared.
- Repeat.
- Must be an Empath with the Embrace of the Vela'Tohr spell.
- The
healmescript must be configured and working. - A valid
planthealwaggle_set must be defined containing an Embrace of the Vela'Tohr spell entry (see Waggle Sets).
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
use_adc: 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 return to for healme. 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. 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. |
use_adc |
Boolean | false |
If true, pre-casts the plant_heal waggle_set before each cycle. |
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).
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.
A waggle_set containing your healing spells to pre-cast before hugging the plant. Typically includes Heal and/or Regenerate, and optionally Blood Staunching.
When this waggle_set is defined, the script also ensures at least one of Heal or
Regenerate is active before every hug. If both have expired mid-cycle, the script
automatically rebuffs via buff plant_heal.
waggle_sets:
plant_heal:
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 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_hug_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_adc |
use_adc |
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 |
Uses hometown NPC empath room, safe_room for healing, no ADC, 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 charmplantheal_settings:
hug_count: 5
plant_room: 1234
healing_room: 5678
use_adc: true
empathy_threshold: 30
waggle_sets:
plant_heal:
Heal:
abbrev: HEAL
mana: 15
Blood Staunching:
abbrev: BS
mana: 10
plantheal:
Embrace of the Vela'Tohr:
mana: 20
recast: 60For 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_hug_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: true
plant_total_hug_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:
use_adc: true
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
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--> walk_to(healingroom) -> healme -> (loop back)
| |
| no
| |
| v
| [use_adc?] --yes--> buff plant_heal
| |
| v
| walk_to(plantroom)
| |
| v
| hug_plant_once (one hug per cycle)
| |
| v
| walk_to(healingroom)
| |
| v
| healme (always runs after hugging)
| |
| 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 (recast EV if not active)
6. ensure_healing_spells (rebuff plant_heal 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
|
| "use_adc is true but waggle_set 'plant_heal' is not defined" | ADC enabled without the required waggle_set | Define a plant_heal waggle_set or disable use_adc
|
| 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) | Script auto-recovers by re-resolving the plant noun from DRRoom.room_objs and continuing |
| "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 |
| "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, or plant disappeared | Check the logs above this message 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) |