int lvl = 0; lvl = (GET_LEVEL(ch) - GET_LEVEL(victim)); if ((lvl > 5 || lvl < -5) && (!IS_NPC(victim) && !IS_NPC(ch)) && /* remove this comment : I can't remember if the little | will work ehre */ (!PLR_FLAGGED(victim, PLR_KILLER | PLR_THIEF))) { /* remove this comment : if not, do this... */ (!PLR_FLAGGED(victim, PLR_KILLER)) && (!PLR_FLAGGED(victim, PLR_THIEF))) { /* remove this comment : end comment modifications */ send_to_char("Try killing someone closer to your level.\r\n", ch); return; } I think you've located probably the best location for the code, but I still wonder. If this code needs to be modularized, it would probably be better like this. /* Checks various flags and levels to make sure that it is OK for the * * character to attack the victim. If this is used, all checks for * * whether battle should be initialized or not should be run through * * here. */ int is_ok_to_attack(struct char_data *ch, struct char_data *victim) { int lvl = 0; /* this is probably a little messed up. basically a check to make * * sure you don't try to run through some imaginary people. */ if (!ch || !victim || ch == NULL || victim == NULL) return FALSE; lvl = GET_LEVEL(ch) - GET_LEVEL(victim); /* avoid these checks if the victim is a thief or killer... * * mobs can attack anyone, and people can attack any mob... * * clan checks may be a good idea also... */ if (PLR_FLAGGED(victim, PLR_KILLER) || PLR_FLAGGED(victim, PLR_THIEF) || (IS_NPC(ch) || IS_NPC(victim))) return FALSE; /* the level check */ if (lvl < -5) { /* victim is bigger */ send_to_char("Your mother couldn't afford your funeral costs!\r\n", ch); return FALSE; } else if (lvl > 5) { send_to_char("Picking on the smaller ones, eh? Bully!\r\n", ch); return FALSE; } else if ((GET_SEX(ch) == SEX_MALE) && (GET_SEX(victim) == SEX_FEMALE) && is_wearing(victim, BIKINI)) { send_to_char("You can't help but drool instead.\r\n", ch); return FALSE; } return TRUE; } Anyway, all of this is just a way to modularize code you have to use in multiple places. If just a check in damage() is ok, then run with that. If not, there's a snippet for you above. (You may want to remove that last check! :) -B. At 04:56 PM 7/18/98 -0600, you wrote: >ok so after testing the new pkill limit i noticed that thiefs flagged >players cant be killed by a higher or lower within 5 levels i will look >into that but it works in everyother way. >Scorn > > > +------------------------------------------------------------+ > | Ensure that you have read the CircleMUD Mailing List FAQ: | > | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | > +------------------------------------------------------------+ +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST