@program itemfinder.muf 1 1000 d i $include $lib/rp $include $lib/rps $include $lib/rps2 $include $lib/alynna $include $muf/cron lvar param $def LOWTIER-ARRAY "$pokedex" match "/itemfinder/lowtier" getprop "" "{" subst "" "}" subst "|" explode_array $def MIDTIER-ARRAY { LOWTIER-ARRAY array_vals pop "$pokedex" match "/itemfinder/midtier" getprop "" "{" subst "" "}" subst "|" explode_array array_vals pop } array_make $def HIGHTIER-ARRAY { LOWTIER-ARRAY array_vals pop MIDTIER-ARRAY array_vals pop "$pokedex" match "/itemfinder/hightier" getprop "" "{" subst "" "}" subst "|" explode_array array_vals pop } array_make : itemfinder me @ "k/Itemfinder" getstat if me @ "item" getstat not if me @ location "item" getstat if "The itemfinder detects an item here!" "Itemfinder" pretty tellme then then then ; : itemsearch var item me @ player? if me @ "item" getstat not if str me @ " starts searching around the area for hidden items.." cat "Search" pretty tellme me @ location "item" getstat dup item ! string? if str me @ " finds a " item @ " here!" cat "Search" pretty tellme me @ "m/" item @ strcat over over getstat 1 + setstat me @ location "item" 0 setstat me @ "item" 1 setstat else "You don't find a thing." "Search" pretty tellme exit then else str "You can't find anything (try again in " prog "lastitem" getstat 86400 + systime - timex ")" cat "Search" pretty tellme exit then else str "You can't find anything (Cause you're a puppet!)" cat "Search" pretty tellme exit then ; : spawnrats var itemlist var target var lowtier var midtier var hightier var item var lnum ( save time, use variables ) lowtier-array lowtier ! midtier-array midtier ! hightier-array hightier ! { } array_make itemlist ! 1 dbtop int 1 - 1 for dbref target ! target @ character? if target @ "item" 0 setstat then target @ room? if target @ "item" over over 0 setprop 0 setstat random 100 % 5 < if 0 item ! random 100 % 1 + case 80 > when hightier @ array_random item ! end 50 > when midtier @ array_random item ! end default lowtier @ array_random item ! end endcase item @ if target @ "item" item @ setstat { itemlist @ array_vals pop item @ } array_make itemlist ! ( #21 str "wc #DEBUG itemfinder " item @ " at " target @ unparseobj cat force ) then then then repeat #21 str "gear Itemfinder refresh - " itemlist @ array_count " items Out There: " itemlist @ array_commas cat force random dbtop int % tostr "0000" swap strcat dup strlen 4 - strcut swap pop prog "lucky" rot setstat #21 str "gear PokeLottery - Todays lucky number is: " prog "lucky" getstat cat force prog "lastitem" systime setstat ; : main param ! command @ "Queued Event." smatch if param @ "Arrive" smatch if itemfinder exit then param @ "MUFCron" smatch if spawnrats exit then then command @ "+search" smatch if itemsearch exit then ; . c q