request:multiclass snippet

  • dracmas
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 7 months ago #5563 by dracmas
request:multiclass snippet was created by dracmas
Was hoping someone could update the old snippet from circle to tbamud. I've tried multiple times and my c just isn't up to snuff to do it.

What I have in mind though is manual leveling where you go to a mob trainer to advance each level. No pressie because I know everyone has a busy schedule. I'm just hopeful someone has some free time that they wouldn't mind doing a snippet. I know other code bases have it but it's not as much a blank slate as tbamud is or as up to date.

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #5564 by WhiskyTest
Replied by WhiskyTest on topic request:multiclass snippet
I wouldn't mind taking a stab at this, but I can't find the old snippet you mentioned.. any chance you could post a link?

If not we can start from scratch

Please Log in or Create an account to join the conversation.

  • dracmas
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 7 months ago #5565 by dracmas
Replied by dracmas on topic request:multiclass snippet
It's in this directory on circlemud.org
www.circlemud.org/pub/CircleMUD/contrib/snippets/players/

Few different versions of multi-class on there, not picky of which one, just something that will work.
Multiclass.tar.gz ends up just being the whole src directory of a circlemud modded for multiclass but no snippet shown in that one.

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #5566 by WhiskyTest
Replied by WhiskyTest on topic request:multiclass snippet

File Attachment:

File Name: multiclass.zip
File Size:33 KB



Cool, I skimmed over those old patches but they are clunky.
I didn't look through the src directory one because that is .. well.. a whole src directory ;)

So here is a simple implementation that you can use as a basis to work from, it is a .diff file compared to a fresh download of 3.66
Please note that this is a draft and hasn't been tested more than a few minutes, but hopefully the concepts will help you flesh it out further!

What it does:
Allows PC characters to have levels in each class, each adding up to give their total 'real' level.

Overview:
I've change the 'level' variable in the player structure to be an array which will now hold the level of each class in the MUD.
Eg: int level[NUM_CLASSES];
Expanding the array out would look something like this:
level [0, 1, 2, 3]
Magic User, Cleric, Thief, Warrior

This just uses the natural values of CLASS_xxx

This means the GET_LEVEL(ch) definition has to change, it becomes GET_LEVEL(ch, i) - where 'i' is the class eg: CLASS_MAGIC_USER

(Gaining XP no longer automatically levels you up - this has just been commented out.)

But we want a way to find out the characters total level. For this I re-used the GET_REAL_LEVEL(ch) definition.
Now, this may or may not be a good idea - but you can always rewrite your own definition and leave the original alone if you prefer :) Basically it will add up a characters levels for each class and return that value. The original one checked if the character was switched but I could not for the life of me get that to work..

For simplicity I just made mobs use CLASS_WARRIOR, this can be expanded on but requires reworking medit.c and db.c and then updating all existing mob files. A bit long winded for a proof of concept, but certainly do-able.

So, the bulk of the .diff file is just finding all those instances of GET_LEVEL(ch) and changing them to GET_REAL_LEVEL(ch)

The pfile is saved and loaded differently, it adds the four class levels into the Levl: line. This will not break existing pfiles and will simply update when they are next saved.

I added a quick update to do_score which will show you each of your levels, broken down by class.

Other things to do would include altering the 'do_who' list if you wanted to show all of a players class levels, updating the advance or set wizcommands. And adding in a way to level up! :D

Hopefully that covers everything and is clear enough to work with, or at least gets your creative juices flowing!
Attachments:
The following user(s) said Thank You: dracmas

Please Log in or Create an account to join the conversation.

  • dracmas
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
2 years 7 months ago #5570 by dracmas
Replied by dracmas on topic request:multiclass snippet
Will look this over when I get home. Thanks for putting effort into this to help me get going. Just wish work was over so I could get started on it now lmao

Please Log in or Create an account to join the conversation.

Time to create page: 1.375 seconds