Please check out Federation II !

Member Discussions

terms



[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]


1. ROM - Guild System Wed Jun 9, 2004 [3:18 PM]
xael
Email not supplied
member since: Jun 3, 2004
Reply
Hey,

What we've decided to do on our MUD is to have a 'guild' system (NPC run) in which you are required to have certain pre-requisites to join. Upon joining you'll be presented with skills or spells, as well as facilities (healer, etc).

Now, what i'm trying to figure out, is the best way to code a 'pre-requisite' system in. Here's what i've got so far:

struct clan_type 
{ 
  long flags;                   /* flags for guild                      */ 
  char *name;                   /* name of guild                        */ 
  char *who_name;               /* name sent for 'who' command          */ 
....

  int req1;                     /* Requirement 1 [Gold]                 */ 
  int req2;                     /* Requirement 2 [Class]                */ 
  int req3;                     /* Requirement 3 [Alignment     ]       */ 
}; 



So, the idea would be that if req1 is set to anything other than 0, that's the gold requirement for the guild. If req3 is 0, there's no alignment requirement, whereas if it's 1 the requirement is good and if it's 2 the requirement is evil.

Here's my problem though - Classes can't really be number based. I mean, sure, I could make it so that 1 = warrior, 2 = cleric, etc.. But there must be a better/more efficient/easier way to do this..?

Also, if anyone has a better idea of the way requirements could be handled, that'd be greatly appreciated, too.

Cheers!
Xael


2. RE: ROM - Guild System Wed Jun 9, 2004 [5:04 PM]
KrayzieK
krayziek@mchsi.com
member since: Mar 10, 2004
In Reply To
Reply
In most ROM codes I've seen, classes are stored as integers anyway, so I guess I don't understand what you mean by classes can't be number based.

The system looks fine to me so far, other than the fact that instead of setting, "1" as a requirement is good, and "2" is evil, you should actually set the lowest and/or highest alignment values allowed.

Or if you really wanted to do it with 1's and 2's you could but you are going to have to parse somewhere the ACTUAL # value, so it would be just extra for nothing.

"
sh_int ch_class; /* avoid using C++ keywords as symbols */
"



3. RE: ROM - Guild System Fri Jun 11, 2004 [12:26 AM]
xael
Email not supplied
member since: Jun 3, 2004
In Reply To
Reply
Woops! Didn't notice classes work by numbers - awesome, works for me, eh? :D

Thanks,
x


4. RE: ROM - Guild System Fri Jun 11, 2004 [2:24 AM]
muir
Email not supplied
member since: Sep 14, 2003
In Reply To
Reply
>In most ROM codes I've seen, --
> -- /* avoid using C++ keywords as symbols */

Ehm.

.




[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]