metas/af/viridian_rise.af
Johan Lundberg 79ee9d853f
All checks were successful
/ test (push) Successful in 43s
add death check to run_away state
2026-09-02 22:16:34 +02:00

373 lines
No EOL
12 KiB
Text

~~
~~ viridian_rise.af
~~ Lean hunting loop for Viridian Rise, based on neftet.af with all economy/service
~~ states (Bella augment service, lum/seer cap, A'nekshay tokens, stipend, turn-in
~~ circuit, flower picking) stripped out except a simplified group recomp. All navs
~~ are external (recorded/saved in-game, loaded by name) -- nothing embedded here.
~~
~~ ============================================================
~~ Variables expected to be set externally (VTank Variables tab) before running:
~~ isLeader - 1 for leader, 0 for follower
~~ followTarget - leader character name (follower only)
~~ attackRange - attackdistance value, e.g. 0.0208333
~~ ============================================================
~~ External navs (recorded in-game, loaded by name):
~~ vr_circuit - main Viridian Rise hunting loop (leader) -- recorded, af/vr_circuit.af
~~ vr_run - retreat route to a safe rally point -- recorded, af/vr_run.af
~~ vr_getin - rally point through the portal back into the hunting area -- recorded, af/vr_getin.af
~~ vr_death_recall - cast "Viridian Rise Recall" then land somewhere safe -- STILL NEEDS RECORDING
~~ ah_recomp - shared hub restock run, same one neftet.af uses -- already committed, af/ah_recomp.af
~~ CONFIGURATION: Prismatic Taper threshold in Hunt matches neftet's recomp trigger -- adjust if needed
~~ ============================================================
STATE: {Default}
IF: Always
DO: DoAll
DoExpr {touchvar[deathCount]}
DoExpr {touchvar[deathClock]}
IF: All
Expr {getvar[isLeader]}
DO: DoAll
Chat {/vt opt set enablecombat true}
Chat {/vt opt set enablelooting true}
Chat {/vt opt set enablebuffing true}
Chat {/vt opt set enablenav true}
Chat {/vt opt set navpriorityboost false}
ChatExpr {\/vt opt set attackdistance +getvar[attackRange]}
Chat {/ub fellow create Viridian Rise Hunt}
DoExpr {setvar[pickFlowers, 1]}
DoExpr {setvar[pickupRange, 15]}
SetState {vr_runback}
IF: All
Expr {getvar[isLeader]==0}
DO: DoAll
Chat {/vt opt set enablecombat true}
Chat {/vt opt set enablelooting true}
Chat {/vt opt set enablebuffing true}
Chat {/vt opt set enablenav true}
Chat {/vt opt set navpriorityboost true}
ChatExpr {\/vt opt set attackdistance +getvar[attackRange]}
SetState {vr_runback}
STATE: {Hunt}
IF: Death
DO: DoAll
DoExpr {clearvar[deathCount]}
DoExpr {clearvar[deathClock]}
SetState {death}
IF: Always
DO: DoAll
Chat {/vt opt set IdlePeaceMode false}
Chat {/vt opt set enablebuffing true}
Chat {/vt opt set enablelooting true}
Chat {/vt opt set enablecombat true}
IF: All
Expr {getvar[isLeader]}
DO: DoAll
Chat {/vt opt set navpriorityboost false}
Chat {/vt nav load vr_circuit}
Chat {/fellowship #followviridianrise}
IF: All
Expr {getvar[isLeader]}
ChatMatch {cloud of dangerous gas!}
DO: CallState {vr_gas_dodge} {Hunt}
IF: All
Expr {getvar[isLeader]}
ChatMatch {cloud of poisonous gas!}
DO: CallState {vr_gas_dodge} {Hunt}
IF: All
Expr {getvar[isLeader]}
ChatMatch {the acidic mist!}
DO: CallState {vr_gas_dodge} {Hunt}
IF: Expr {vitae[]>12}
DO: Chat {/fellowship #tomuchviteaviridianrise}
IF: ChatMatch {^\[Fellowship\].*(say|says), \"#tomuchviteaviridianrise\"$}
DO: SetState {vitae_run}
IF: All
ChatCapture {^Your fellow (?<who>\w[\w ]*\w) has died!$} {}
Expr {getvar[capturegroup_who]==getvar[followTarget]}
Expr {getvar[isLeader]==0}
DO: DoAll
ChatExpr {\/f +getvar[followTarget]+` is dead. Run away!`}
SetState {run_away}
IF: ChatMatch {^.*has died!$}
DO: CallState {count_death} {Hunt}
IF: All
Expr {getvar[deathCount]==1}
Not Expr {getvar[deathClock]}
DO: DoAll
Chat {/f deathClock started}
DoExpr {setvar[deathClock,stopwatchcreate[]]}
DoExpr {stopwatchstart[getvar[deathClock]]}
IF: Expr {getvar[deathCount]>1}
DO: SetState {run_away}
IF: All
Expr {getvar[deathClock]}
Expr {stopwatchelapsedseconds[getvar[deathClock]]>60}
DO: DoAll
Chat {/f deathClock stopped}
DoExpr {clearvar[deathCount]}
DoExpr {clearvar[deathClock]}
IF: All
ItemCountLE 100 {Prismatic Taper}
NoMobsInDist 5
DO: DoAll
Chat {/fellowship #recompviridianrise}
SetState {recomp}
IF: ChatMatch {^\[Fellowship\].*(say|says), \"#recompviridianrise\"$}
DO: SetState {recomp}
IF: All
Expr {getvar[isLeader]==0}
Expr {wobjectfindnearestbynameandobjectclass[24, getvar[followTarget]]!=0}
DO: ChatExpr {\/ub follow +getvar[followTarget]}
IF: All
ChatMatch {^\[Fellowship\].*(say|says), \"#followviridianrise\"$}
Expr {getvar[isLeader]==0}
Expr {wobjectfindnearestbynameandobjectclass[24, getvar[followTarget]]!=0}
DO: ChatExpr {\/ub follow +getvar[followTarget]}
IF: All
Expr {getvar[isLeader]==0}
Expr {getfellowshipstatus[]==0}
Expr {wobjectfindnearestbynameandobjectclass[24, getvar[followTarget]]!=0}
SecsInStateGE 5
DO: DoAll
ChatExpr {\/t +getvar[followTarget]+`\, #recruitviridianrise`}
SetState {Hunt}
IF: All
Expr {getvar[isLeader]}
ChatCapture {(^(\[[A-z]+?\] |)You|.*\<Tell:IIDString:.+:(?<who>[^\<]*)\>.+\<\\Tell\>) .*, \"#recruitviridianrise\"$} {}
DO: DoAll
ChatExpr {\/ub fellow recruit +getvar[capturegroup_who]}
SetState {Hunt}
IF: All
Expr {getvar[isLeader]}
Expr {coordinatedistancewithz[getplayercoordinates[], wobjectgetphysicscoordinates[wobjectfindnearestbyobjectclass[8]]]<=getvar[pickupRange]}
Expr {wobjectgetname[wobjectfindnearestbyobjectclass[8]]==Amber Crystal}
Expr {getvar[pickFlowers]==1}
DO: SetState {picking_flowers}
IF: All
Expr {getvar[ammoType]==1}
Any
ItemCountLE 10 {Wrapped Bundle of Deadly Prismatic Arrowheads}
ItemCountLE 10 {Wrapped Bundle of Quarrelshafts}
NoMobsInDist 5
DO: DoAll
Chat {/fellowship Low on xbow ammo. Recomping.}
SetState {recomp_missile}
IF: All
Expr {getvar[ammoType]==2}
Any
ItemCountLE 10 {Wrapped Bundle of Deadly Prismatic Arrowheads}
ItemCountLE 10 {Wrapped Bundle of Arrowshafts}
NoMobsInDist 5
DO: DoAll
Chat {/fellowship Low on bow ammo. Recomping.}
SetState {recomp_missile}
IF: All
Expr {getvar[ammoType]==3}
Any
ItemCountLE 10 {Wrapped Bundle of Deadly Prismatic Arrowheads}
ItemCountLE 10 {Wrapped Bundle of Atlatl Dartshafts}
NoMobsInDist 5
DO: DoAll
Chat {/fellowship Low on bow ammo. Recomping.}
SetState {recomp_missile}
IF: All
MainSlotsLE 4
NoMobsInDist 5
DO: DoAll
Chat {/fellowship #recompviridianrise}
SetState {recomp}
IF: All
Expr {getvar[isLeader]}
DistToRteGE 100
DO: SetState {stuck}
IF: All
Expr {getvar[isLeader]==0}
ChatCapture {(?<who>\w[\w ]*\w) has left your Fellowship} {}
Expr {getvar[capturegroup_who]==getvar[followTarget]}
DO: DoAll
Chat {/ub fellow quit}
SetState {Default}
IF: Always
DO: SetWatchdog 10 600 {stuck}
STATE: {count_death}
IF: Always
DO: DoAll
Chat {/f I SAW DEATH!}
DoExpr {setvar[deathCount, getvar[deathCount]+1]}
Return
STATE: {run_away}
IF: Death
DO: DoAll
DoExpr {clearvar[deathCount]}
DoExpr {clearvar[deathClock]}
SetState {death}
IF: Always
DO: DoAll
Chat {/vt opt set enablelooting false}
Chat {/vt opt set enablecombat false}
Chat {/vt opt set navpriorityboost true}
DoExpr {clearvar[deathCount]}
DoExpr {clearvar[deathClock]}
SetState {vr_runback}
IF: ChatMatch {^\[Fellowship\].*(say|says), \"#tomuchviteaviridianrise\"$}
DO: SetState {vitae_run}
STATE: {vitae_run}
IF: Always
DO: DoAll
Chat {/vt opt set enablecombat false}
Chat {/vt opt set enablelooting false}
Chat {/vt opt set enablebuffing false}
Chat {/vt opt set enablenav true}
IF: Expr {getvar[isLeader]==1}
DO: SetState {vitae_run_leader}
IF: Expr {getvar[isLeader]==0}
DO: Chat {/vt nav load vr_vitae_run_follower}
IF: ChatMatch {^\[Fellowship\].*(say|says), \"#vitaerundoneviridianrise\"$}
DO: SetState {Default}
STATE: {vitae_run_leader}
IF: Always
DO: Chat {/vt nav load vr_vitae_run_leader}
IF: NavEmpty
DO: DoAll
Chat {/fellowship #vitaerundoneviridianrise}
SetState {Default}
STATE: {vr_gas_dodge}
IF: Always
DO: Chat {/vt opt set navpriorityboost true}
IF: SecsInStateGE 5
DO: DoAll
Chat {/vt opt set navpriorityboost false}
Return
IF: ChatMatch {^\[Fellowship\].*(say|says), \"#tomuchviteaviridianrise\"$}
DO: SetState {vitae_run}
STATE: {vr_runback}
IF: Death
DO: SetState {death}
IF: All
Expr {testvar[vrRunbackNavLoaded]}
NavEmpty
DO: DoAll
DoExpr {clearvar[vrRunbackNavLoaded]}
SetState {vr_portal}
IF: Always
DO: DoAll
DoExpr {setvar[vrRunbackNavLoaded, 1]}
Chat {/vt opt set enablecombat false}
Chat {/vt nav load vr_run}
Chat {/vt opt set enablenav true}
IF: Always
DO: SetWatchdog 10 120 {stuck}
IF: ChatMatch {^\[Fellowship\].*(say|says), \"#tomuchviteaviridianrise\"$}
DO: SetState {vitae_run}
STATE: {vr_portal}
IF: Death
DO: SetState {death}
IF: ExitPortal
DO: SetState {Hunt}
IF: SecsInStateGE 20
DO: SetState {vr_portal}
IF: Always
DO: DoAll
Chat {/vt opt set enablenav true}
Chat {/vt nav load vr_getin}
IF: ChatMatch {^\[Fellowship\].*(say|says), \"#tomuchviteaviridianrise\"$}
DO: SetState {vitae_run}
STATE: {recomp}
IF: Death
DO: SetState {death}
IF: All
Expr {testvar[vrRecompNavLoaded]}
NavEmpty
DO: DoAll
DoExpr {clearvar[vrRecompNavLoaded]}
SetState {stuck}
IF: Always
DO: DoAll
DoExpr {setvar[diamondMissing, 100 - getitemcountininventorybyname[`Diamond Scarab`]]}
DoExpr {ifthen[$diamondMissing < 0, `setvar[diamondMissing, 0]`]}
DoExpr {setvar[manaMissing, 100 - getitemcountininventorybyname[`Mana Scarab`]]}
DoExpr {ifthen[$manaMissing < 0, `setvar[manaMissing, 0]`]}
DoExpr {setvar[spiritMissing, 50 - getitemcountininventorybyname[`Encapsulated Spirit`]]}
DoExpr {ifthen[$spiritMissing < 0, `setvar[spiritMissing, 0]`]}
DoExpr {setvar[vrRecompNavLoaded, 1]}
Chat {/vt opt set enablecombat false}
Chat {/vt opt set enablebuffing false}
Chat {/vt nav load ah_vr_recomp}
Chat {/vt opt set enablenav true}
IF: ChatMatch {^\[Fellowship\].*(say|says), \"#tomuchviteaviridianrise\"$}
DO: SetState {vitae_run}
IF: Always
DO: SetWatchdog 3 300 {Default}
STATE: {picking_flowers}
IF: Expr {coordinatedistancewithz[getplayercoordinates[], wobjectgetphysicscoordinates[wobjectfindnearestbyobjectclass[8]]]<=getvar[pickupRange]+3}
DO: DoAll
DoExpr {setvar[ObjectClose, 1]}
EmbedNav nav2__pickup_nav {pickup.nav}
IF: All
Expr {getvar[ObjectClose]==1}
Expr {coordinatedistancewithz[getplayercoordinates[], wobjectgetphysicscoordinates[wobjectfindnearestbyobjectclass[8]]]>getvar[pickupRange]+4}
DO: DoAll
DoExpr {setvar[ObjectClose, 0]}
SetState {Hunt}
IF: Death
DO: SetState {death}
IF: Always
DO: SetWatchdog 5 120 {stuck}
STATE: {recomp_missile}
IF: Death
DO: SetState {death}
IF: Always
DO: DoAll
Chat {/vt opt set enablecombat false}
Chat {/vt opt set enablebuffing false}
Chat {/vt nav load recomp_laurana}
IF: Always
DO: SetWatchdog 3 300 {stuck}
IF: NavEmpty
DO: SetState {stuck}
STATE: {death}
IF: ExitPortal
DO: DoAll
Chat {/vt opt set enablebuffing false}
Chat {/vt opt set enablenav true}
Chat {/vt opt set enablelooting false}
Chat {/vt opt set enablecombat false}
IF: All
Expr {testvar[vrDeathNavLoaded]}
NavEmpty
DO: DoAll
DoExpr {clearvar[vrDeathNavLoaded]}
SetState {vr_runback}
IF: Always
DO: DoAll
DoExpr {setvar[vrDeathNavLoaded, 1]}
Chat {/vt nav load vr_death_recall}
IF: Expr {vitae[]>12}
DO: Chat {/fellowship #tomuchviteaviridianrise}
IF: ChatMatch {^\[Fellowship\].*(say|says), \"#tomuchviteaviridianrise\"$}
DO: SetState {vitae_run}
IF: Always
DO: SetWatchdog 5 60 {stuck}
STATE: {stuck}
IF: Always
DO: DoAll
SetState {Default}
NAV: nav2__pickup_nav circular ~~ {
cht 6.85679616481066 -19.8018191655477 2.08332513769468E-05 {/vt mexec actiontryuseitem[wobjectfindnearestbyobjectclass[8]]}
pau 6.85679616481066 -19.8018191655477 2.08332513769468E-05 10000
~~ }