Re: Remort system with room for expansion

From: Clark Kent (chewie@T-LINK.NET)
Date: 03/10/98


For anyone that's interested, to make a remort system is pretty easy if you
know how to code it, mine goes something like how I outlined it (of corse
there's alot more restrictions and stuff in mine though, and this code here
is only made for dual class.)

This would either go in act.wizard.c, or as I did it, and also included it
in the Makefile, I made mine multi.c

ACMD(do_multi)
   struct char_data *victim = 0;


  if (victim->player.classes => 1 ) {
      send_to_char("Victim is already double classed!\n\r", ch);    // This
is pretty
                                                                    // self
explanitory
      return;
   }
   if (*arg == NULL) {
      send_to_char("Invalid syntax -- multi <char> <class>", ch);    // So
is this
      return;
   }
   if (*arg != '(the letter you use for choosing the class' &&
       *arg != 'another letter for another class') {
              send_to_char("Invalid class -- Valid are (the letters of the
classes you can
                            choose from)\n\r", ch);
      return;
   }

 GET_DUAL_CLASS(victim) = GET_CLASS(victim); // This assigns the current
class a person
                                             // has to a variable you must
define in structs.h

   victim->player.classes++;  // This assigns classes + 1 to classes so it
keeps track
                              //of how many times a person has multied. In
this case
                              //when they do this the 1st time it's 0

   if (*arg == 'c') // If they type multi c
      GET_CLASS(victim) = CLASS_CLERIC; // Then make Cleric their new class

   GET_LEVEL(victim) = 1; // Send them back to level one as multied
   GET_EXP(victim) = 0; // Make their experience 0 so they can start
levling again
   set_title(victim, NULL); // Change their title to fit their new level.

   send_to_char("Player's class changed.\n\r", ch); // Tell the character
they have multied

}

   For the rest of the coding, you'll have to declare classes in structs.h
as a saved variable in the player file (which will make your current player
file corrupt), and you will probably want to also declare a GET_DUAL_CLASS
in structs.h like GET_CLASS is, and do dual_abbrevs like class_abbrevs and
race_abbrevs in class.c. In db.c you also need to make sure the variable
classes gets saved in the player file so that if you have something like

if (ch->player.classes == 1) {
     Multi classes in do_who
}

The number assigned to classes will be saved, otherwise the number of
multies in the variable classes would stay as 0.
   I myself am working on this code still since I didn't like the way it
was originally coded, and had to change ALOT of stuff for things like class
guilds. I have that and the class spells and skills working fine now, but
in the guild when you type practice, if you're in a clerics guild, I'd like
it to display only cleric practices, and if you're in a thiefs guild, I'd
like it to display only thief skills, and the same for the rest. I can't
seem to think of an easy way of coding it withought some heavy revamping in
spec_procs.c for the guilds. If anyone has any ideas on how to do what I
mention above, please e-mail me, and give me some help. I do well with
ideas, so if you have one, please mail it on the discussion list. Thanx

Hope this is useful to some of you.

P.S. Most of the defineing in structs.h, and utils.h for saving and stuff
is all the same as the defineing for class and race.

http://inda.mud.dynip.com


     +------------------------------------------------------------+
     | 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