User Name:


Forgot your password?
Vote for Us!
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex, Bing

Members: 0
Guests: 16
Newest Member
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » classes and player perks
Forum Rules | Mark all | Recent Posts

classes and player perks
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jan 8, 2013, 8:49 am
Go to the top of the page
Go to the bottom of the page

JoinedAug 2, 2010

hello all:
I have a quick question: I'm trying to make my mud a multiclass system where you can level each class as you go. I added a levels array in the pcdata struct which has an element per class, and I left the class field in so that a player can choose a primary class. I'm also ripping out a ton of classes (ranger, druid, etc); mainly by removing them from the class.lst file and removing their defines as well as code dependant on them. I'm curious if this is the way to go? Any suggestions for pulling this off?

Finally, I'd like to add "perks," which is kind of a skill-based tree. For example, health might have 5 different perks that can be raised up to x amount of points and requires say health1 before health2 can be raised, etc. Any ideas how I might go about storing these both on players and mobs, as well as constructing the tree? maybe a define per perk, then a big table or something to set these up?
Post is unread #2 Jan 11, 2013, 1:51 pm
Go to the top of the page
Go to the bottom of the page

JoinedMar 8, 2005

Don't use arrays.

If you use arrays, EVERY TIME you want to add a new class in the future, you'll have to muck with things. Since you're stuck with C/C++, I'd suggest using the existing linked list system and allocating a structure for class-specific stuff. LInked lists are easier to work with than trying to mess with realloc() when you need to adjust arrays.

struct s_perks;
struct s_class_stuff;

typedef struct s_perks {
  struct s_perks *prev,
  struct s_perks *next,
  char *name,
  // stuff about what the perks do in here
} perks;

typedef struct s_class_stuff {
  struct s_class_stuff *prev,
  struct s_class_stuff *next,
  char *name,
  int level,
  char *prerequisites, // a space-delimited string of classes you must have to join this class.
  char *forbidden, // a space-delimited string of classes you cannot belong to, to join this class.
  struct perks *perks // linked list of perks provided by this class
} class_stuff;

Probably syntax errors and such, as I hate C code these days.
Post is unread #3 Jan 12, 2013, 2:51 pm
Go to the top of the page
Go to the bottom of the page

JoinedAug 2, 2010

awesome, thanks. I can make a sort of tree for the perks and then have requirements and all that set up. I think each player could get an id and a level for each perk they have, I'm just not sure how I'd save those to the player's file.

Yes, I too am not a huge fan of C, but I've been bouncing around trying to find something I liked. LPC for me has been kind of dead since the biggest base is DS and I don't want to be ripping things out--I'd love it if I could find a base that I could just go to town with. I've also worked on my own in c++, but writing a mud engine from scratch is not at all easy. It's not bad, but it has a long ways to go.
Pages:<< prev 1 next >>