@program #4394 1 1000 d i $def notify ansi_notify $def notify_exclude ansi_notify_exclude $def rpsystem "$rpsystem" match $def rpsys #4183 $def HR "^blue^>^yellow^-------------------------------------------------------------- ------^blue^<^ ^" .tell lvar target lvar player $def XP player @ "XP" getstatfloat player @ "XPspend" getstatfloat - $include #2123 $include $lib/rp $include $lib/alynna $include $muf/rp/utils $include $muf/scrp/registry lvar number lvar cur lvar spam lvar caps : linetell (s --) (tell's a string as a list of lines.) 71 line_split begin swap 71 centre LINE " " strcat swap strcat LINE strcat .tell 1 - dup not until pop ; : skillshow ( -- ) " " target @ 13 left strcat OPENITEM player @ target @ skillcost dup not if pop "^yellow^MAX" then caps @ if pop player @ target @ getstatstr 2 right "/" strcat player @ "Caps/" target @ strcat getstatint 5 * intostr 2 right strcat else dup string? not if dup XP > if "^red^" swap else "^green^" swap then else "" swap then dup string? not if 2 fchop then 5 right strcat then strcat CLOSEITEM strcat 7 right strcat cur @ 1 + cur ! cur @ 3 = if 0 cur ! strcat strcat linetell then ; lvar yipI lvar tier lvar yips lvar yipj lvar yipd lvar yipn lvar prof lvar base : treetraveler ( -- ) 100 ; : talentcost2 ( d s s -- i ) var costmod yipS ! yipJ ! yipD ! ( d s - save these values, magery is dangerous ) yipD @ "special/" yipS @ strcat getstatint yipI ! ( get current special, save it ) yipI @ 1 + yipN ! ( Find out what the next possible value is, store it ) yipN @ 0 = if 0 exit then ( leave with 0 if there isnt any ) YipD @ "Special/" YipS @ strcat getstatint 1 + 25 > if 0.0 exit then 110.0 yipS @ "Talents/" swap strcat "/Profession" strcat rpsystem swap getpropstr prof ! player @ "Class" getstatstr dup if base ! else pop player @ "Professionlist" getstatstr dup " " instring dup not if pop dup strlen then strcut pop base ! base @ "" "," subst base ! then base @ strip base ! prof @ not if 50.0 + else prof @ base @ instring not if treetraveler then then player @ "Caps/" yipS @ strcat getstatint 8 * - player @ "Jobs/" base @ strcat getstatint prof @ base @ instring if tier ! else 2 / tier ! then costmod ! ( is the special a component? ) rpsystem str "Talents/" yipS @ "/shock" cat getprop if ( It's a spell! ) costmod @ 25 - costmod ! rpsystem str "Talents/" yipS @ "/element" cat getprop if ( It has elements! ) yipd @ "Special/Fire-Affinity" getstatint if ( I have Fire ) rpsystem str "Talents/" yipS @ "/element" cat getprop "Ice" instring if ( It has Ice, eep ) costmod @ yipd @ "Special/Fire-Affinity" getstatint + costmod ! then rpsystem str "Talents/" yipS @ "/element" cat getprop "Fire" instring if ( has Fire, yay ) costmod @ yipd @ "Special/Fire-Affinity" getstatint - costmod ! then then yipd @ "Special/Ice-Affinity" getstatint if ( I have Ice ) rpsystem str "Talents/" yipS @ "/element" cat getprop "Fire" instring if ( It has Fire, eep ) costmod @ yipd @ "Special/Ice-Affinity" getstatint + costmod ! then rpsystem str "Talents/" yipS @ "/element" cat getprop "Ice" instring if ( has Ice, yay ) costmod @ yipd @ "Special/Ice-Affinity" getstatint - costmod ! then then yipd @ "Special/air-Affinity" getstatint if ( I have air ) rpsystem str "Talents/" yipS @ "/element" cat getprop "Earth" instring if ( It has Earth, eep ) costmod @ yipd @ "Special/air-Affinity" getstatint + costmod ! then rpsystem str "Talents/" yipS @ "/element" cat getprop "air" instring if ( has air, yay ) costmod @ yipd @ "Special/air-Affinity" getstatint - costmod ! then then yipd @ "Special/Earth-Affinity" getstatint if ( I have Earth ) rpsystem str "Talents/" yipS @ "/element" cat getprop "Air" instring if ( It has Air, eep ) costmod @ yipd @ "Special/Earth-Affinity" getstatint + costmod ! then rpsystem str "Talents/" yipS @ "/element" cat getprop "Earth" instring if ( has Earth, yay ) costmod @ yipd @ "Special/Earth-Affinity" getstatint - costmod ! then then yipd @ "Special/White-Affinity" getstatint if ( I have White ) rpsystem str "Talents/" yipS @ "/element" cat getprop "Black" instring if ( It has Black, eep ) costmod @ yipd @ "Special/White-Affinity" getstatint + costmod ! then rpsystem str "Talents/" yipS @ "/element" cat getprop "White" instring if ( has White, yay ) costmod @ yipd @ "Special/White-Affinity" getstatint - costmod ! then then yipd @ "Special/Black-Affinity" getstatint if ( I have Black ) rpsystem str "Talents/" yipS @ "/element" cat getprop "White" instring if ( It has White, eep ) costmod @ yipd @ "Special/Black-Affinity" getstatint + costmod ! then rpsystem str "Talents/" yipS @ "/element" cat getprop "Black" instring if ( has Black, yay ) costmod @ yipd @ "Special/Black-Affinity" getstatint - costmod ! then then then then costmod @ ( check for other caps ) prof @ "mage" instring if player @ "Jobs/Mage" getstatint dup tier @ > if tier ! else pop then then prof @ "rogue" instring if player @ "Jobs/Rogue" getstatint dup tier @ > if tier ! else pop then then prof @ "mundane" instring if player @ "Jobs/Mundane" getstatint dup tier @ > if tier ! else pop then then prof @ "fighter" instring if player @ "Jobs/Fighter" getstatint dup tier @ > if tier ! else pop then then prof @ "acolyte" instring if player @ "Jobs/Acolyte" getstatint dup tier @ > if tier ! else pop then then prof @ "Monster" instring if player @ "Jobs/Monster" getstatint dup tier @ > if tier ! else pop then then ( end check ) player @ "Caps/" yipS @ strcat getstatint tier @ > if player @ "Caps/" yipS @ strcat getstatint tier ! else player @ "Caps/" yipS @ strcat getstatint tier @ < if 0 pop then then tier @ 5 > if 5 tier ! then yipN @ rpsystem str "Talents/" yipS @ "/Caps" cat getpropstr "/" tier @ eselect atoi > if pop 0 exit then YipI @ dup not if pop yipn @ 5.0 * * else sqrt 1.2 * * then 100.0 / rpsystem "cost/" YipS @ strcat getpropstr dup "." instring 1 = if "0" swap strcat then strtof dup not if pop rpsystem "cost/" YipS @ strcat getpropstr atoi then 1.0 + * 0.666 * .debug-off ; : talentshow ( -- ) player @ "Special/" target @ strcat getstatint player @ "Caps/" target @ strcat getstatint or spam @ or if " " target @ 25 left strcat OPENITEM player @ " " target @ talentcost2 caps @ if pop player @ target @ "special/" swap strcat getstatint intostr 2 right "/" strcat rpsystem str "Talents/" target @ "/Caps" cat getpropstr "/" tier @ eselect 2 right strcat else dup XP > if "^red^" swap else "^green^" swap then dup not if pop player @ target @ "special/" swap strcat getstatint 25 = if "^Yellow^ MAX " else "^Red^NO GO^ ^" then else 2 fchop 5 right then strcat then CLOSEITEM strcat strcat 7 right strcat cur @ 1 + cur ! cur @ 2 = if 0 cur ! strcat linetell then then ; lvar tiercost : tiershow ( -- ) str "Mage: " OPENITEM player @ "Class" getstatstr "Mage" smatch if player @ "Jobs/Mage" getstatint 10 * else player @ "Jobs/" player @ "Class" getstatstr strcat getstatint 2 / player @ "Jobs/Mage" getstatint 1 + < if "^red^No Go" else player @ "Jobs/Mage" getstatint dup not if pop 25 else 10 * then tiercost ! player @ "Class" getstatstr "Fighter" smatch if 3.0 then player @ "Class" getstatstr "{Mundane|Monster}" smatch if 2.5 then player @ "Class" getstatstr "{Acolyte|Rogue}" smatch if 2.0 then tiercost @ * then then dup string? not if 2 fchop then CLOSEITEM " " "Acolyte: " OPENITEM player @ "Class" getstatstr "Acolyte" smatch if player @ "Jobs/Acolyte" getstatint 10 * else player @ "Jobs/" player @ "Class" getstatstr strcat getstatint 2 / player @ "Jobs/Acolyte" getstatint 1 + < if "^red^No Go" else player @ "Jobs/Acolyte" getstatint dup not if pop 25 else 10 * then tiercost ! player @ "Class" getstatstr "Rogue" smatch if 3.0 then player @ "Class" getstatstr "{Mundane|Monster}" smatch if 2.5 then player @ "Class" getstatstr "{Mage|Fighter}" smatch if 2.0 then tiercost @ * then then dup string? not if 2 fchop then CLOSEITEM "Rogue: " OPENITEM player @ "Class" getstatstr "Rogue" smatch if player @ "Jobs/Rogue" getstatint 10 * else player @ "Jobs/" player @ "Class" getstatstr strcat getstatint 2 / player @ "Jobs/Rogue" getstatint 1 + < if "^red^No Go" else player @ "Jobs/Rogue" getstatint dup not if pop 25 else 10 * then tiercost ! player @ "Class" getstatstr "Acolyte" smatch if 3.0 then player @ "Class" getstatstr "{Mundane|Monster}" smatch if 2.5 then player @ "Class" getstatstr "{Mage|Fighter}" smatch if 2.0 then tiercost @ * then then dup string? not if 2 fchop then CLOSEITEM "Fighter: " OPENITEM player @ "Class" getstatstr "Fighter" smatch if player @ "Jobs/Fighter" getstatint 10 * else player @ "Jobs/" player @ "Class" getstatstr strcat getstatint 2 / player @ "Jobs/Fighter" getstatint 1 + < if "^red^No Go" else player @ "Jobs/Fighter" getstatint dup not if pop 25 else 10 * then tiercost ! player @ "Class" getstatstr "Mage" smatch if 3.0 then player @ "Class" getstatstr "{Mundane|Monster}" smatch if 2.5 then player @ "Class" getstatstr "{Acolyte|Rogue}" smatch if 2.0 then tiercost @ * then then dup string? not if 2 fchop then CLOSEITEM cat linetell str "Mundane: " OPENITEM player @ "Class" getstatstr "Mundane" smatch if player @ "Jobs/Mundane" getstatint 10 * else player @ "Jobs/" player @ "Class" getstatstr strcat getstatint 2 / player @ "Jobs/Mundane" getstatint 1 + < if "^red^No Go" else player @ "Jobs/Mundane" getstatint dup not if pop 25 else 10 * then tiercost ! player @ "Class" getstatstr "Monster" smatch if 3.0 else 2.5 then tiercost @ * then then dup string? not if 2 fchop then CLOSEITEM "Monster: " OPENITEM player @ "Class" getstatstr "Monster" smatch if player @ "Jobs/Monster" getstatint 10 * else player @ "Jobs/" player @ "Class" getstatstr strcat getstatint 2 / player @ "Jobs/Monster" getstatint 1 + < if "^red^No Go" else player @ "Jobs/Monster" getstatint dup not if pop 25 else 10 * then tiercost ! player @ "Class" getstatstr "Mundane" smatch if 3.0 else 2.5 then tiercost @ * then then dup string? not if 2 fchop then CLOSEITEM cat linetell ; : scanner ( -- ) 0 cur ! ( "Tiers" DIVIDER .tell .tell tiershow ) "Skills" DIVIDER .tell .tell str "" "Skill" "" RPUtils.nextItem target ! begin number @ 1 + number ! target @ 1 strcut swap toupper swap strcat target ! skillshow "Skill" target @ RPUtils.nextItem target ! target @ not until cur @ if cat linetell then 0 cur ! "Special Skills" DIVIDER .tell .tell "Special" "" RPUtils.nextItem target ! begin number @ 1 + number ! target @ 1 strcut swap toupper swap strcat target ! talentshow "Special" target @ RPUtils.nextItem target ! target @ not until cur @ if linetell then ; lvar profession : professionscan ( s -- ) dup profession ! DIVIDER .tell .tell "Special" "" RPUtils.nextItem target ! begin number @ 1 + number ! target @ 1 strcut swap toupper swap strcat target ! rpsystem "Talents/" target @ strcat "/profession" strcat getpropstr profession @ instring if " " target @ 25 left strcat OPENITEM player @ " " target @ talentcost2 caps @ if pop player @ target @ "special/" swap strcat getstatint intostr 2 right "/" strcat rpsystem str "Talents/" target @ "/Caps" cat getpropstr "/" tier @ eselect 2 right strcat else dup XP > if "^red^" swap else "^green^" swap then dup not if pop player @ target @ "special/" swap strcat getstatint 25 = if "^Yellow^ MAX " else "^Red^NO GO^ ^" then else 2 fchop 5 right then strcat then CLOSEITEM strcat strcat 7 right strcat cur @ 1 + cur ! cur @ 2 = if 0 cur ! strcat linetell then then "Special" target @ RPUtils.nextItem target ! target @ not until cur @ if linetell then FOOTER .tell ; : main ( s -- ) me @ player ! 0 spam ! 0 caps ! dup "#" instring if dup "spam" instring if 1 spam ! then dup "caps" instring if 1 caps ! then dup "profession" instring if dup "profession" instring 1 - strcut dup " " instring 1 - dup 1 < if pop dup strlen then strcut rot swap strcat swap dup "=" instring strcut swap pop professionscan exit then dup "#" instring 2 - dup 0 < if pop 0 then strcut pop then .debug-off dup not if me @ player ! else me @ mlevel 4 < if "You can't check others +xpsheet" .tell exit then .pmatch player ! then player @ ok? not if "Invalid target" .tell exit then HEADER .tell player @ name "'s XP Sheet" strcat DIVIDER .tell .tell scanner FOOTER .tell ; . c q