Author Topic: Better(?) newbie handling  (Read 1538 times)

Offline Raudhrskal

  • BFF
  • ***
  • Posts: 214
  • The MUD community needs YOUR help!
    • View Profile
Better(?) newbie handling
« on: December 20, 2007, 04:11:40 am »
In response to discussion at http://lpmuds.net/forum/index.php?topic=546.0

In FAQ, Cratylus recommends setting MAX_NEWBIE_LEVEL to 0 for disabling the newbies'
bonuses. This renders newbiep() sefun and some tools (like -n option to people)
useless. Better would be to have separately configured newbie options, while
allowing the MAX_NEWBIE_LEVEL to stay > 0.

I'd hacked the following. (Yes, I know, the keywords are poorly chosen...
just can't invite anything better ;( )

Stock DS 2.6

Code: [Select]
--- secure/save/backup/config.1197038311        2007-12-07 15:38:32.000000000 +0100
+++ secure/include/config.h     2007-12-18 00:08:36.000000000 +0100
@@ -32,6 +32,11 @@
 #define SUPPORTED_CLIENTS       ({ "amcp", "amcp/1.1" })
 #define HOUR_LENGTH              1200
 #define DAY_LENGTH               20
+#define NEWBIE_CLEARVISION       0
+#define NEWBIE_POLYGLOT          0
+#define NEWBIE_NO_MONEY_DROP     0
+#define NEWBIE_SKILL_PROTECT     1
+#define NEWBIE_NO_HEAVY_WEAPONS  1
 #define MAX_NEWBIE_LEVEL         3
 #define AUTOSAVE_TIME            450
 #define MORTAL_POSITIONS         ({ "player", "high mortal", "ambassador" })
Code: [Select]
--- secure/cmds/admins/mudconfig.c~     2007-11-06 02:18:00.000000000 +0100
+++ secure/cmds/admins/mudconfig.c      2007-12-18 00:07:43.000000000 +0100
@@ -15,12 +15,14 @@
 string array restrict_tokens = ({ "restrict","unrestrict" });
 string array nonmodals = ({ "liveupgrade", "prompt","status","email","websource",
   "debugger", "access", "pinging", "pinginterval" });
-string array antimodals = ({ "imc2" });
+string array antimodals = ({ "imc2" /*rwd(*/, "nooballweapons", "noobcashdrop" /*rwd)*/ });
 string array modals = antimodals + ({ "catchtell","matchcommand", "matchobject", "autowiz", "locked",
   "localtime", "justenglish", "justhumans", "encumbrance", "pk", "compat", "exitsbare", "nmexits",
-  "retain", "defaultparse", "disablereboot", "loglocal", "logremote" });
+  "retain", "defaultparse", "disablereboot", "loglocal", "logremote"
+  /*rwd(*/, "noobskillprot", "noobvision", "nooblangs" /*rwd)*/ });
 string array inet_services = ({ "oob", "hftp", "ftp", "http", "rcp", "inet" });

+
 static int NotImplemented(string which);
 varargs static int TestFun(string which, string arg);
 varargs static int ModIntermud(string which, string arg);
@@ -448,6 +450,13 @@
     case "loglocal" : which = "LOG_LOCAL_CHANS";break;
     case "logremote" : which = "LOG_REMOTE_CHANS";break;
     case "imc2" : which = "DISABLE_IMC2";break;
+      //rwd(
+      case "noobvision" : which = "NEWBIE_CLEARVISION";break;
+      case "nooblangs" : which = "NEWBIE_POLYGLOT";break;
+      case "noobcashdrop" : which = "NEWBIE_NO_MONEY_DROP";break;
+      case "noobskillprot" : which = "NEWBIE_SKILL_PROTECT";break;
+      case "nooballweapons" : which = "NEWBIE_NO_HEAVY_WEAPONS";break;
+      //rwd)
     default : break;
     }
     foreach(string element in config){
@@ -465,6 +474,10 @@
     }
     CompleteConfig();
     if(which == "DEFAULT_PARSING" || which == "ENABLE_ENCUMBRANCE" ||
+       //rwd(
+       which == "NEWBIE_CLEARVISION" || which == "NEWBIE_POLYGLOT" ||
+       which == "NEWBIE_SKILL_PROTECT" ||
+       //rwd)
       which == "BARE_EXITS" || which == "COMMAND_MATCHING"){
         reload(LIB_CREATOR,1,1);
         write("This configuration will take effect for each user the next time they log in.");
@@ -493,7 +506,27 @@
         else IMC2_D->remove();
         reload(CHAT_D);
     }
-
+    //rwd(
+    if(which == "NEWBIE_NO_MONEY_DROP")
+       {
+           if(file_exists("/verbs/items/give.c"))
+               reload("/verbs/items/give.c");
+           if(file_exists("/verbs/items/drop.c"))
+               reload("/verbs/items/drop.c");
+           if(file_exists("/verbs/items/put.c"))
+               reload("/verbs/items/put.c");
+           reload("/daemon/verbs.c");
+           return 1;
+       }
+    if(which == "NEWBIE_NO_HEAVY_WEAPONS")
+       {
+           reload("/lib/comp/weapon.c");
+           write("This configuration will take effect for weapons not yet loaded. "
+                 "To ensure all weapons pick up the new configuration, either reboot "
+                 "the mud, or type: \"reload every weapon\".");
+           return 1;
+       }
+    //rwd)
     return 1;
 }

@@ -720,6 +753,13 @@
       "\nmudconfig matchcommand [ yes | no ]"
       "\nmudconfig matchobject [ yes | no ]"
       "\nmudconfig exitsbare [ yes | no ]"
+      //rwd(
+      "\nmudconfig noobvision [ yes | no ]"
+      "\nmudconfig nooblangs [ yes | no ]"
+      "\nmudconfig noobcashdrop [ yes | no ]"
+      "\nmudconfig noobskillprot [ yes | no ]"
+      "\nmudconfig nooballweapons [ yes | no ]"
+      //rwd)
       "\nmudconfig nmexits [ yes | no ] (This togggles where default exits are displayed)"
       "\nmudconfig localtime [ yes | no ]"
       "\nmudconfig offset <offset from gmt in seconds>"
Code: [Select]
--- lib/player.c~       2007-11-08 20:46:56.000000000 +0100
+++ lib/player.c        2007-12-17 23:45:14.000000000 +0100
@@ -200,7 +200,7 @@
         if( !random(4) ) {
             continue;
         }
-        if( newbiep(this_object()) ) {
+        if( NEWBIE_SKILL_PROTECT && newbiep(this_object()) ) {
             x = 2;
         }
         else {
@@ -800,7 +800,7 @@
 }

 varargs mixed GetEffectiveVision(mixed location, int raw_score) {
-    if( newbiep(this_object()) ) return VISION_CLEAR;
+    if( NEWBIE_CLEARVISION && newbiep(this_object()) ) return VISION_CLEAR;
     else if(raw_score && location) return living::GetEffectiveVision(location,raw_score);
     else if(location) return living::GetEffectiveVision(location);
     else return living::GetEffectiveVision();
@@ -818,7 +818,7 @@
 }

 int GetLanguageLevel(string lang) {
-    if( newbiep() ) return 100;
+    if( NEWBIE_POLYGLOT && newbiep() ) return 100;
     else return living::GetLanguageLevel(lang);
 }

Code: [Select]
--- lib/comp/weapon.c~  2007-11-08 20:46:56.000000000 +0100
+++ lib/comp/weapon.c   2007-12-17 22:55:11.000000000 +0100
@@ -111,7 +111,7 @@
     if( Hands > sizeof(who->GetWieldingLimbs()) ) {
         return "#You do not have enough limbs for that weapon!";
     }
-    if( newbiep(who) && GetClass() > 30 ) {
+    if( NEWBIE_NO_HEAVY_WEAPONS && newbiep(who) && GetClass() > 30 ) {
         return "You are not skilled enough to wield this weapon.";
     }
     return 1;
Code: [Select]
--- lib/talk.c~ 2007-10-31 06:15:42.000000000 +0100
+++ lib/talk.c 2007-12-17 22:25:59.000000000 +0100
@@ -106,7 +106,7 @@
     if(riders && sizeof(riders))
         riders->eventHearTalk(who, target, cls, verb, (msg ||0), (lang ||0));
 
-    if( lang && !newbiep() && !GetPolyglot() ) msg = translate(msg, GetLanguageLevel(lang));
+    if( lang && ( !NEWBIE_POLYGLOT || !newbiep() ) && !GetPolyglot() ) msg = translate(msg, GetLanguageLevel(lang));
     switch(cls) {
     case TALK_PRIVATE:
         if( target != this_object() ) return 0;
Code: [Select]
--- verbs/items/give.c~ 2007-12-05 21:42:18.000000000 +0100
+++ verbs/items/give.c  2007-12-17 22:59:02.000000000 +0100
@@ -63,7 +63,7 @@
     if( amt < 1 ) return "What sort of amount is that?";
     if( amt > (int)this_player()->GetCurrency(lower_case(curr)) )
         return "You don't have that much " + curr + ".";
-    if(this_player()->GetLevel() < 4) return "Newbies can't give money.";
+    if(NEWBIE_NO_MONEY_DROP && newbiep(this_player())) return "Newbies can't give money.";
     return this_player()->CanManipulate();
 }

Code: [Select]
--- verbs/items/drop.c~ 2007-12-05 21:42:18.000000000 +0100
+++ verbs/items/drop.c  2007-12-17 22:59:32.000000000 +0100
@@ -47,7 +47,7 @@
     if( (amt = to_int(num)) < 1 ) return "You cannot do that!";
     if( (int)this_player()->GetCurrency(curr) < amt )
         return "You don't have that much " + curr + ".";
-    if(this_player()->GetLevel() < 4) return "Newbies can't drop money.";
+    if(NEWBIE_NO_MONEY_DROP && newbiep(this_player())) return "Newbies can't drop money.";
     return this_player()->CanManipulate();
 }

Code: [Select]
--- verbs/items/put.c~  2007-12-05 21:42:18.000000000 +0100
+++ verbs/items/put.c   2007-12-17 23:00:27.000000000 +0100
@@ -68,10 +68,7 @@
     if( (amt = to_int(num)) < 1 ) return "You cannot do that!";
     if( (int)this_player()->GetCurrency(curr) < amt )
         return "You don't have that much " + curr + ".";
-    if(this_player()->GetLevel() < 4) {
-        write("Newbies cannot drop money.");
-        return "Newbies can't drop money.";
-    }
+    if(NEWBIE_NO_MONEY_DROP && newbiep(this_player()))  return "Newbies can't drop money.";
     if(wrd == "on" || wrd == "onto"){
         if(container && !inherits( LIB_SURFACE, container ) ) return "#That isn't a load-bearing surface.";
     }

All newbie bonuses I've found are now easily customizable, and I still have people -n working ;)

One more question: Should I send less verbose messages afterwards?

Wesolych Swiat / Merry Christmas,
'Skal
I think, therefore i may be wrong.
Please note that if you met a Raudhrskal in a place that's not related to muds, it wasn't me. *sigh*... back when I started there was zero hits on google for that name...