+---------------------------------------------------------------+ | Created By Adam Donofrio aka. Bilbo (adamdonofrio@homtail.com)| | Use: This code prevents players from pkilling AFK players | | and it keeps AFK players from moving and pkilling. | | Note: lines marked with a '-' mean stock code (reference) | | lines marked with a '+' mean new code (add it) | | pay special attention to the '+'s. Some are easy to | | miss. | | tested with 3.0bpl12. when you see /* this varies*/ make sure| | that it is compatible with your code | +---------------------------------------------------------------+ in fight.c ----------- - /* peaceful rooms */ - if (ch != victim && ROOM_FLAGGED(ch->in_room, ROOM_PEACEFUL)) { - send_to_char("This room just has such a peaceful, easy feeling...\r\n", ch); - return; - } + /* no pkilling AFK ppl*/ + if (PRF_FLAGGED (victim, PLR_AFK)){ /*this varies*/ + send_to_char("How cheap! Can't you see the AFK flag?!? You make me sick!\r\n", ch); + SET_BIT(PLR_FLAGS(ch), PLR_KILLER); + return; + } in act.movement.c ----------------- -int perform_move(struct char_data *ch, int dir, int need_specials_check) -{ - int was_in; - struct follow_type *k, *next; + struct char_file_u tmp_store; - if (ch == NULL || dir < 0 || dir >= NUM_OF_DIRS) - return 0; - else if (!EXIT(ch, dir) || EXIT(ch, dir)->to_room == NOWHERE) - send_to_char("Alas, you cannot go that way...\r\n", ch); + /* prevents players from using AFK as proection*/ + else if (PRF_FLAGGED(ch, PLR_AFK)) /* this varies */ + send_to_char("Try removing your AFK flag first", ch); in act.offensive.c ------------------ -ACMD(do_hit) -{ - struct char_data *vict; + struct char_file_u tmp_store; - one_argument(argument, arg); - if (!*arg) - send_to_char("Hit who?\r\n", ch); - else if (!(vict = get_char_room_vis(ch, arg))) - send_to_char("They don't seem to be here.\r\n", ch); else if (vict == ch) { - send_to_char("You hit yourself...OUCH!.\r\n", ch); - act("$n hits $mself, and says OUCH!", FALSE, ch, 0, vict, TO_ROOM); - } else if (IS_AFFECTED(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 (PRF_FLAGGED(ch, PLR_AFK)){ /* this varies*/ + send_to_char("Try removing your AFK flag first", ch); + SET_BIT(PLR_FLAGS(ch), PLR_KILLER); + }