Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Google, Sogou, Yandex

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
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

sorressean
Fledgling
GroupMembers
Posts8
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?
Thanks,
       
Post is unread #2 Jan 11, 2013, 1:51 pm
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
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

sorressean
Fledgling
GroupMembers
Posts8
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 >>