JTP,
I went ahead and updated the skill in multiple areas. For starters, it does not return (end) when encountering something non-tauntable such as a hidden player, etc. It goes onto the next target to find them. Second, I added in a player counter that begins at 0, and counts the player or mobile attempting the skill. If an Immortal or higher PC is in room, it takes off a number from the count so they are not calculated into the count. If the number is less than or equal to 1, it displays a message for the PC or NPC being the only one in the room. If it's higher than 1, it displays normal messages as it succeeds or fails.
Note: I set this skill up intentionally to display each individual success or fail to the player. This is so a player knows whether or not he was successful in who he hit or didnt hit with the taunt skill. You could take this one step further and display individual names to a player if they miss, but on my mud that would not be good. Primarily because I have multiple invisibility systems in the game and beginning combat does not necessarily break that invisibility depending upon a variety of factors. IE: I don't want my morts using Taunt to find the names of hidden enemies which they must explore the zone to discover. If you wish to remove multiple instances of success/fail, just remove the taunt success lines from the code, "Your taunt is successful," and remove the failure lines. Then put a catchall/one time phrase at the end of the code, right above the very last bracket or something (I think?).
PS. Good catch on that no display issue. I didn't catch that when I tested it. Thanks for helping me to improve my own mud! Gotta admit man, a Taunt/Aggro pull type skill is pretty awesome in a mud environment. I also have other skills for tank types such as Group_Retreat, and a Hamstring type skill which prevents enemies from fleeing. The Hamstring skill is a little more complex because I have it set to roll a chance to break free at the end of each combat round. I have no clue how to actually do that on TBAMud because my fight.c code is pretty much entirely re-written from TBAMud's code to allow for a TON of fight mechanic changes/additions. To put that in perspective, TBA's is 31kb and mine is 121kb. Even so, I'm sure you could figure that out with some tinkering, and the code for Act.Offensive.c on Hamstring is fairly straight forward.
Code:
ACMD(do_taunt)
{
struct char_data *tmp_ch, *next_tmp_ch;
int percent, prob, player_counter = 0;
act("$n roars ferociously!", FALSE, ch, 0, 0, TO_ROOM);
for (tmp_ch = world[IN_ROOM(ch)].people; tmp_ch; tmp_ch = next_tmp_ch) {
(next_tmp_ch = tmp_ch->next_in_room);
player_counter++;
/*
* The skips: 1: the caster
* 2: immortals
* 3: if no pk on this mud, skips over all players
* 4: pets (charmed NPCs)
*/
if (tmp_ch == ch) {
continue;
}
if (!IS_NPC(tmp_ch) && GET_LEVEL(tmp_ch) >= LVL_IMMORT) {
player_counter -= 1;
continue;
}
if (IS_NPC(ch) && IS_NPC(tmp_ch)) {
continue;
}
if (!GET_TOT_SKILL(ch, SKILL_TAUNT)) {
send_to_char(ch, "%s", NOPROFICIENCY);
return;
}
if (AFF_FLAGGED(ch, AFF_SILENCE)) {
send_to_char(ch, "You cannot taunt an enemy while silenced!\r\n");
return;
}
if ((PC_VS_PC_NOT_ALLOWED(ch, tmp_ch)) || (NPC_VS_NPC_NOT_ALLOWED(ch, tmp_ch))) {
send_to_char(ch, "You cannot taunt another player.\r\n");
continue;
}
if (AFF_FLAGGED(tmp_ch, AFF_HIDE)) {
send_to_char(ch, "Your enemy remains hidden in the shadows.\r\n");
continue;
}
if (AFF_FLAGGED(tmp_ch, AFF_CHARM)) {
send_to_char(ch, "The charmie ignores your taunt!\r\n");
continue;
}
if ((AFF_FLAGGED(tmp_ch, AFF_RAGE)) || (AFF_FLAGGED(tmp_ch, AFF_BERSERK)) || (AFF_FLAGGED(tmp_ch, AFF_FURY))) {
send_to_char(ch, "Your taunt goes unnoticed against your enraged foe!\r\n");
continue;
}
if (AFF_FLAGGED(tmp_ch, AFF_REFLECT_DAMAGE)) {
send_to_char(ch, "Your taunt is no match for your enemies hatred!\r\n");
continue;
}
if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_PEACEFUL)) {
send_to_char(ch, "%s", PEACE_ROOM_WARNING);
return;
}
percent = (rand_number(1, 80) + GET_TOT_INT(tmp_ch)) ; /* 101% is a complete failure */
prob = ((GET_TOT_SKILL(ch, SKILL_TAUNT) - 25) + GET_TOT_STR(ch));
if (percent > prob) {
send_to_char(ch, "Your taunt goes unnoticed.\r\n");
/* act("$n looks more foolish than ever!", FALSE, ch, 0, 0, TO_NOTVICT); */
act("$n's taunt fails to provoke you", FALSE, ch, 0, 0, TO_VICT);
set_fighting(ch, tmp_ch);
GET_WAIT_STATE(ch) = 2 * PULSE_VIOLENCE;
return;
}
send_to_char(ch, "Your taunt is successful...\r\n");
/* act("$n roars ferociously!", FALSE, ch, 0, 0, TO_NOTVICT); */
act("$n's taunt provokes you to anger!", FALSE, ch, 0, 0, TO_VICT);
if (FIGHTING(tmp_ch))
stop_fighting(tmp_ch);
set_fighting(ch, tmp_ch);
set_fighting(tmp_ch, ch);
if (percent < SG_MIN)
skill_gain(ch, SKILL_TAUNT);
GET_WAIT_STATE(ch) = 3 * PULSE_VIOLENCE;
}
if (player_counter <= 1) {
send_to_char(ch, "There is no one here except for you...\r\n");
}
}