@verb #12:"@addhelp-db @rmhelp-db" any none none rxdo #55 @program #12:"@addhelp-db @rmhelp-db" any none none "Copied from Quadir (#9780):@addhelp-db Dec 21 19:29:20 1999" "This verb was made by Quadir (#9780)" {a, b} = {verb[2..4] == "add", valid(caller_perms())} if (b ? !caller_perms():controls(this) | caller != this) return b ? raise(E_PERM) | player:tell(E_PERM) elseif (!valid(dobj = player:match_object(dobjstr, dobj))) return b ? E_INVARG | $cmd_utils:object_match_failed(dobj, dobjstr) elseif (!b && a && !dobj:isa($help_db) && !$cmd_utils:yes_or_no(`dobj:title() ! ANY => tostr(dobj.name, " [Borked Title]")', " (", dobj, ") is not a child of the generic help database (#86), are you sure you want to continue?")) return endif title = tostr(`dobj:title() ! ANY => tostr(dobj.name, " [Borked Title]")', " (", dobj, ")") help_db = this.help_db help_db = `{{help_db}, 0, 0, help_db}[typeof(help_db)] ! E_RANGE => {}' if (a && dobj in help_db) return b ? 2 | player:tell(title, " is already one of your help databases.") elseif (!a && !(dobj in help_db)) return b ? 2 | player:tell(title, " is not one of your current help databases.") elseif (a) b || player:tell(title, " has been added to your list of help databases.") help_db = setadd(help_db, dobj) else b || player:tell(title, " has been removed from your list of help databases.") help_db = setremove(help_db, dobj) endif for x in (`player:ancestors() ! ANY => {}') if (x:has_property("help_db")) adb = x.help_db adb = `{{adb}, 0, 0, adb}[typeof(help_db)] ! E_RANGE => {}' for z in (adb) if (z in help_db) help_db = setremove(help_db, z) b || player:tell(`z:title() ! ANY => tostr(z.name, " [Borked Title]")', " (", z, ") has been removed from your help database listing, as it was defined on your ancestor ", `x:title() ! ANY => tostr(x.name, " [Borked Title]")', " (", x, ").") b || (dobj == z && player:tell("There is no need to try and add it again, its automatically used.")) endif $cmd_utils:suspend_if_needed(0) endfor endif $cmd_utils:suspend_if_needed(0) endfor oldhelp_db = help_db help_db = $func_utils:filter("return valid(args[1]);", help_db) if (b && oldhelp_db != help_db) player:tell("An invalid number was detected in your help database listing, and has been removed.") endif ok = 1 for x in (b ? {} | help_db) if (!x:isa($help_db) && x != dobj) ok = 0 endif $cmd_utils:suspend_if_needed(0) endfor b || ok || player:tell("Warning: One of your help databases is not a child of the generic help database, you may encounter problems because of this.") if (length(help_db) == 0) help_db = 0 elseif (length(help_db) == 1) help_db = help_db[1] endif this.help_db = help_db return 1 "This verb previously owned by manta (#7165), and chowned to $slacker upon dewizarding (Sat Aug 17 14:50:04 2002 MDT)." "Last modified by MadHatter (#8371) on Thu Aug 29 15:27:42 2002 MDT." .