Welcome to the Builder Academy

Question Question on killing other players

More
06 Nov 2025 02:01 #10946 by gbcs
I am testing a small mud that I made using some stock TBAmud worlds. This is for my sons friends to play as none of them had played a MUD. As the website that they used to log into the MUD does not support the same color codes that are in the TBAmud worlds, I removed all the color codes. I was making changes to a room that explains about using color and I want to instead explain about not killing other players or shop keepers. I decide to test this. To my surprise, I was allowed to hit another player. I did not continue to hit the player but I believe from looking at the code that I could kill the player. I then tried a spell and summons on a player and those actions were rejected. I look at the config.c file file and PK_allowed is set to NO.

So my question. What is the intent or the reason to allow a player to try to kill another player with PK_allowed set to NO? Why is it not rejected the same as the spell and other actions are rejected.

Graham

Please Log in or Create an account to join the conversation.

More
06 Nov 2025 22:41 #10947 by thomas
Good question. Were you the implementor? Immortals are not subject to the same limitations as mortals (though you can toggle those limits back on with the nohassle command).

Also, colors can be set to default off by changing these lines: github.com/tbamud/tbamud/blob/f6339b495e...src/db.c#L3584-L3585

Please Log in or Create an account to join the conversation.

More
07 Nov 2025 01:06 #10948 by gbcs
Thomas, Thanks for the reply.

I made three separate logins. The first was the implementor and then two mortals. One of the mortal hit the other mortal and this was allowed.

World 234.wld (Newbie school) has color directly in the room description. For example room 23402 has "Typing @RLOOK@n either ...".

Graham

Please Log in or Create an account to join the conversation.

More
07 Nov 2025 17:58 - 07 Nov 2025 17:59 #10949 by thomas
First - the color: having color toggled _off_ means the colors are stripped before being sent to the player.

Second. This is so embarassing. Apparently a piece of code from the old Cruel World MUD still survives here. At the time we allowed players to player kill, but flagged them when it happened. I think this needs to be fixed. First off - for your case, just add this check to do_hit:
Code:
ACMD(do_hit) {   char arg[MAX_INPUT_LENGTH];   struct char_data *vict; one_argument(argument, arg);   if (!*arg)     send_to_char(ch, "Hit who?\r\n");   else if (!(vict = get_char_vis(ch, arg, NULL, FIND_CHAR_ROOM)))     send_to_char(ch, "That player is not here.\r\n");   else if (vict == ch) {     send_to_char(ch, "You hit yourself...OUCH!.\r\n");     act("$n hits $mself, and says OUCH!", FALSE, ch, 0, vict, TO_ROOM);   } else if (AFF_FLAGGED(ch, AFF_CHARM) && (ch->master == vict))     act("$N is just such a good friend, you simply can't hit $M.", FALSE, ch, 0, vict, TO_CHAR); +  else if (!CONFIG_PK_ALLOWED && !IS_NPC(vict) && !IS_NPC(ch)) +    send_to_char(ch, "No player killing here, please!\r\n");   else {     if (!CONFIG_PK_ALLOWED && !IS_NPC(vict) && !IS_NPC(ch) )       check_killer(ch, vict);     if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) {       if (GET_DEX(ch) > GET_DEX(vict) || (GET_DEX(ch) == GET_DEX(vict) && rand_number(1, 2) == 1))  /* if faster */         hit(ch, vict, TYPE_UNDEFINED);  /* first */       else hit(vict, ch, TYPE_UNDEFINED);  /* or the victim is first */         WAIT_STATE(ch, PULSE_VIOLENCE + 2);     } else       send_to_char(ch, "You're fighting the best you can!\r\n");   } }
github.com/tbamud/tbamud/issues/157 tracks the actual fix
Last edit: 07 Nov 2025 17:59 by thomas.

Please Log in or Create an account to join the conversation.

More
08 Nov 2025 01:26 #10950 by gbcs
Thomas,

Thanks the information on how the color option works.

And a big thanks for the patch. I tested it and it works. Hope the final fix does not take to much of your time. Glad you worked out the issue so quickly.

Graham

Please Log in or Create an account to join the conversation.

Time to create page: 0.427 seconds