@program beastgrowth.muf 1 1000 d i $include $lib/rp $include $lib/alynna lvar param lvar source lvar target lvar modifiers lvar type lvar level lvar xpmod : sanchecks var aborted 0 aborted ! ( Check modifiers ) modifiers @ tolower source @ "lastmodifier" getstat tolower smatch not if str "^RED^ALERT!^NORMAL^: Modifier mismatch! Requested: " modifiers @ ", Created: " source @ "lastmodifier" getstat cat "Grow" pretty tellhere str "Terminate growth job? (Y/N)" cat "Grow" pretty tellhere read tolower "y*" smatch if 1 aborted ! then then ( Check type ) type @ tolower source @ "lasttype" getstat tolower smatch not if str "^RED^ALERT!^NORMAL^: Type mismatch! Requested: " type @ ", Created: " source @ "lasttype" getstat cat "Grow" pretty tellhere str "Terminate growth job? (Y/N)" cat "Grow" pretty tellhere read tolower "y*" smatch if 1 aborted ! then then ( Check level ) level @ toint source @ "lastlevel" getstat toint = not if str "^RED^ALERT!^NORMAL^: Level mismatch! Requested: " level @ ", Created: " source @ "lastlevel" getstat cat "Grow" pretty tellhere str "Terminate growth job? (Y/N)" cat "Grow" pretty tellhere read tolower "y*" smatch if 1 aborted ! then then aborted @ if str "Recycle: " source @ unparseobj cat "Grow" pretty tellhere source @ recycle "Aborted." "Grow" pretty tellhere then aborted @ ; : main var item var value var pcount param ! param @ "=" explode pcount ! ( Permission ) me @ mlevel 6 >= not if "Insufficient permissions. (W2 required)" "Grow" pretty tellme exit then ( Sanity ) pcount @ 5 = not if "+grow ====" "Grow" pretty tellme exit then ( Store ) target ! modifiers ! type ! level ! xpmod ! ( Targetcheck ) target @ resolve not if "Target not found." "Grow" pretty tellme exit else target @ resolve target ! then ( Inform ) str "For beast/non-monster " target @ unparseobj ", initiated by " me @ cat "Grow" pretty tellhere str "Growing to L" level @ " " modifiers @ " " type @ "..." cat "Grow" pretty tellhere ( Prepare for beast call ) prog "~obj" 0 setprop ( Make them beast ) str "Beast force: +beast " modifiers @ " " type @ "=" level @ cat "Grow" pretty tellhere target @ str "+beast " modifiers @ " " type @ "=" level @ cat force ( Wait for +beast to create the object ) str "Waiting for initial creation of beast..." cat "Grow" pretty tellhere begin 1 sleep prog "~obj" getprop if break then repeat ( Look it up ) prog "~obj" getprop source ! str source @ unparseobj " was found." cat "Grow" pretty tellhere ( Wait for +beast to finish making the sheet ) str "Waiting for " source @ unparseobj " to be finished..." cat "Grow" pretty tellhere begin 1 sleep source @ "professionlist" getstat if break then repeat str "Done with " source @ unparseobj "." cat "Grow" pretty tellhere ( L2 sanity checks ) sanchecks if exit then ( Typecheck - if not the same type, remove specials. ) target @ "professionlist" getstatstr tolower str "*" type @ "*" cat tolower smatch not if target @ "/@rp/special/" array_get_propvals foreach value ! item ! target @ "/@rp/special/" item @ strcat 0 setprop repeat "Different type, specials lost..." "Grow" pretty tellhere else "Same type, specials remain..." "Grow" pretty tellhere then ( Make me copy props ) str "Copy force: cp #" source @ int "=/@rp/,#" target @ int "=/@rp/" cat "Grow" pretty tellhere me @ str "cp #" source @ int "=/@rp/,#" target @ int "=/@rp/" cat force ( Adjust XP ) str "XP adjustment: " xpmod @ tofloat 2 fchop cat "Grow" pretty tellhere target @ "xpspent" getstat tofloat xpmod @ tofloat + target @ "xpspent" rot setstat ( Completed ) str "Recycle: " source @ unparseobj cat "Grow" pretty tellhere source @ recycle "Growth complete." "Grow" pretty tellhere ; . c q