Welcome to the Builder Academy

Question Taunt skill

More
01 Mar 2019 21:34 #8338 by JTP
Taunt skill was created by JTP
Hey

Is there anyone who has taunt skills, and wanna share some for inspiration ?

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

More
09 May 2019 18:55 - 09 May 2019 19:01 #8391 by Sapphire
Replied by Sapphire on topic Taunt skill
There are a lot of additional components to any skill which must be added throughout your code, as you likely know. With that being said, here is what I created on my mud for a Fighter/Warrior type skill which I call, "Taunt." It pulls aggro, and causes enemies which are not fighting into battle against the user of the skill. I am confident 100% this will not directly translate to your mud, but it should be easily convertible. The way this is set up, it can be used on mobiles with the taunt skill to break up the flow of combat when morts attack them. It can also be used by morts to draw aggro and protect group members when a tank type role uses it. On my mud, it hits who it's supposed to hit in all instances, and I truly love having this on one of my tank classes.

Please give credit where it is due if you use, that's all I ask :)
Code:
ACMD(do_taunt) { struct char_data *tmp_ch, *next_tmp_ch; int percent, prob; 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); /* * This skips: 1: the user * 2: immortals * 3: if no pk on this mud, skips over all players * 4: pets (charmed NPCs) * 5: Non-charmed NPCs dont hit other non-charmed NPCs */ if (tmp_ch == ch) { continue; } if (!IS_NPC(tmp_ch) && GET_LEVEL(tmp_ch) >= LVL_IMMORT) { continue; } if (IS_NPC(ch) && IS_NPC(tmp_ch)) { continue; } if ((PC_VS_PC_NOT_ALLOWED(ch, tmp_ch)) || (NPC_VS_NPC_NOT_ALLOWED(ch, tmp_ch))) { continue; } if (!GET_TOT_SKILL(ch, SKILL_TAUNT)) { send_to_char(ch, "%s", NOPROFICIENCY); return; } if (AFF_FLAGGED(tmp_ch, AFF_HIDE)) { send_to_char(ch, "Your enemy remains hidden in the shadows.\r\n"); return; } if (AFF_FLAGGED(ch, AFF_SILENCE)) { send_to_char(ch, "You cannot taunt an enemy while silenced!\r\n"); return; } if (AFF_FLAGGED(tmp_ch, AFF_CHARM)) { send_to_char(ch, "The charmie ignores your taunt!\r\n"); return; } 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"); return; } if (AFF_FLAGGED(tmp_ch, AFF_REFLECT_DAMAGE)) { send_to_char(ch, "Your taunt is no match for your enemies hatred!\r\n"); return; } 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'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'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; } }
Last edit: 09 May 2019 19:01 by Sapphire. Reason: syntax correction

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

More
09 May 2019 20:30 - 09 May 2019 21:00 #8392 by JTP
Replied by JTP on topic Taunt skill
Hi

It was actually not bad getting to work. I will test it some more.

One small thing i noticed is, when typing taunt but there is noone. You dont get a message.
So user have no idea if its a bug or working as it should.


And you get the succes message as many times as there are targets.

So If 3 mobs, you get succes message 3 times.

If you Update. Please post and i Will test further
Last edit: 09 May 2019 21:00 by JTP.

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

More
10 May 2019 04:01 - 10 May 2019 04:11 #8393 by Sapphire
Replied by Sapphire on topic Taunt skill
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"); } }
Last edit: 10 May 2019 04:11 by Sapphire.

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

Time to create page: 0.173 seconds