Racic's Charge Snippet contact: evernightmud@excite.com Based on the old charge by, Rantic REQUIREMENTS You must have installed Genichiro's awesome weapon types snippet which I do highly recommend. Otherwise you can modify this code to the old style lance v_num requirement on your own. LICENSE Permission to use and distribute this code is granted provided the header in the source file is retained and unaltered, and the distribution package contains all the original files unmodified. If you modify this code and use/distribute modified versions you must give credit to the original author(s). (Racic & Rantic) DESCRIPTION Basicaly a heavy attack skill, this lets players "charge" into their enemy, when mounted and wielding a lance. If their opponent is mounted they can dismount them with this skill! INSTALLATION INSTRUCTIONS pre-install: Install Genichiro's weapon type snippet if you have not. 1) Add a DECLARE_DO_FUN for "do_charge" in mud.h, near the other DECLARE_DO_FUN declarations. 2) Add an "extern sh_int gsn_charge;" declaration in mud.h, near the other gsn declarations. 3) Add an entry for "do_charge" in the "skill_function" function in tables.c 4) Add an entry for "do_charge" in the "skill_name" function in tables.c . 6) Add an "sh_int gsn_charge;" declaration in db.c 7) Add an "ASSIGN_GSN(gsn_charge, "charge");" line in the boot_db function, near the other ASSIGN_GSNs (these three steps commonly known as "adding the gsn"). db.c 8) Add the code, preferably to skills.c. 9) Compile, reboot, and get into the mud. 10) Using the "sset" command, create the "charge" skill, and set its code to "do_charge" (the spell name must be exactly "charge", unless you also change the ASSIGN_GSN line of step 7). Should be careful to set it right (type skill, minpos standing, target offensive), because you can have trouble with "charged beacon", and you should also set the dammsg you want for it. 15) You need to set a weapon to weapontype lance "W_LANCE". You do this following the instructions in Genichiro's snippet. 16) You'll need another reboot before it works, because of the gsn. And you're done. Warning: In SMAUG 1.4, there is a social called "charge". You should remove this social if you want to install charge. This snippet brought to you by: Evernight Mud & Racic Sept. 2000 the code: void do_charge( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; CHAR_DATA *victim; OBJ_DATA *obj; int percent; one_argument( argument, arg ); /* EVERNIGHT Charge by Racic Sept.00 based on old Rantic Charge */ if ( IS_SET(ch->in_room->room_flags, ROOM_SAFE) ) { send_to_char_color( "&BA godly force prevents you.\n\r", ch); return; } if ( IS_AFFECTED(ch, AFF_BLIND) ) { send_to_char( "You can't see anything fool.\n\r", ch); return; } if ( IS_NPC(ch) && IS_AFFECTED( ch, AFF_CHARM ) ) { send_to_char( "You can't do that right now.\n\r", ch ); return; } if ( ( victim = who_fighting( ch) ) ) { send_to_char( "You're in too close of quarters to charge!\n\r",ch); return; } if ( arg[0] == '\0' ) { send_to_char( "Charge at whom?\n\r", ch ); return; } if ( ( victim = get_char_room( ch, arg ) ) == NULL ) { send_to_char( "They aren't here.\n\r", ch ); return; } if ( victim == ch ) { send_to_char( "How can you charge at yourself?\n\r", ch ); return; } if ( ( obj = get_eq_char( ch, WEAR_WIELD ) ) == NULL || ( ( obj->value[4] != W_LANCE)) ) { send_to_char( "You need to wield a lance.\n\r", ch ); return; } if ( !ch->mount ) { send_to_char( "You can't charge without a mount.\n\r", ch ); return; } percent = number_percent( ) - (get_curr_lck(ch) - 14) + (get_curr_lck(victim) - 13); WAIT_STATE( victim, 4 * PULSE_VIOLENCE ); victim->position = POS_SITTING; check_attacker( ch, victim ); WAIT_STATE( ch, skill_table[gsn_charge]->beats ); if (( victim->mount ) && ( !IS_AWAKE(victim) || IS_NPC(ch) || percent < ch->pcdata->learned[gsn_charge] )) { act( AT_SKILL, "With a powerful charge, $n knocks you from your mount", ch, NULL, victim, TO_VICT); act( AT_SKILL, "$N is thrown from $s mount when you land your lance!", ch, NULL, victim, TO_CHAR); act( AT_SKILL, "$n strikes $N with $s lance throwing $N from $s mount", ch, NULL, victim, TO_NOTVICT); xREMOVE_BIT( victim->mount->act, ACT_MOUNTED ); victim->mount = NULL; WAIT_STATE( ch, 2 * PULSE_VIOLENCE ); WAIT_STATE( victim, 2 * PULSE_VIOLENCE ); victim->position = POS_RESTING; global_retcode = damage( ch, victim,number_range( (get_curr_str(ch) * 5), (get_curr_con(ch) * 5 ) ) ,gsn_charge); if ( global_retcode == rVICT_DIED ) { act( AT_BLOOD, "Your lance wickedly thrusts into your victim and nearly tears them in two", ch, NULL, NULL, TO_CHAR ); } if ( global_retcode != rCHAR_DIED && global_retcode != rBOTH_DIED ) { learn_from_success( ch, gsn_charge ); adjust_favor( ch, 10, 1 ); check_illegal_pk( ch, victim ); } return; } if ( !IS_AWAKE(victim) || IS_NPC(ch) || percent < ch->pcdata->learned[gsn_charge] ) { act( AT_SKILL, "Apon your mount you wildly charge at $N, thrusting your lance into $S body!", ch, NULL, victim, TO_CHAR ); act( AT_SKILL, "Apon $s mount $n charges wildly at you, thrusting $s lance into your body!", ch, NULL, victim, TO_VICT ); act( AT_SKILL, "Apon $s mount $n wildly charges at $N, thrusting the lance into $S body!", ch, NULL, victim, TO_NOTVICT ); global_retcode = damage( ch, victim,number_range( (get_curr_str(ch) * 5) , (get_curr_con(ch) * 5 ) ) ,gsn_charge); if ( global_retcode == rVICT_DIED ) { act( AT_BLOOD, "Your lance wickedly thrusts into your victim and nearly tears them in two", ch, NULL, NULL, TO_CHAR ); } if ( global_retcode != rCHAR_DIED && global_retcode != rBOTH_DIED ) { learn_from_success( ch, gsn_charge ); adjust_favor( ch, 10, 1 ); check_illegal_pk( ch, victim ); } } else { learn_from_failure( ch, gsn_charge ); global_retcode = damage( ch, victim, 0, gsn_charge ); act( AT_SKILL, "Apon your mount you wildly charge at $N, but $E dodges out of the way!", ch, NULL, victim, TO_CHAR ); act( AT_SKILL, "Apon $s mount $n wildly charges at you, but you quickly dodge out of $s way.", ch, NULL, victim, TO_VICT ); act( AT_SKILL, "Apon $s mount $n wildly charges at $N, but $E dodges out of the way!", ch, NULL, victim, TO_NOTVICT ); } return; }