Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
Bing, AhrefsBot, Google

Members: 0
Guests: 34
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SmaugFUSS » Is there an updated multi cla...
Forum Rules | Mark all | Recent Posts

Is there an updated multi class system for smaugfuss?
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2 next >>
Post is unread #1 Feb 23, 2021 6:49 am   Last edited Feb 23, 2021 9:41 am by Zedethar
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
Hey guys,

So far I've gotten pretty far into the mud, everything is pretty stable after a few bug fixes.
Ive looked for remort or multi class system to add but found only one on this site under lost prophecy files. Is this the best for multi class system or is there a more updated one around?

Thanks

Post is unread #2 Feb 23, 2021 5:38 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
lots of bases have remorts or multiclass systems that you can find on here and even other sites. If you don't use the base you can at least get an idea for how to set up which ever one you would like to use.

Post is unread #3 Feb 24, 2021 1:19 am   
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
I found the remort system by xerxes which sounds like it upgrades your base class into an advanced one? Sounds cool. It might be something to try.

Also found the multiclass system from lost prophecy which allows additional classes which is what I remember back in the day. I think multiclass night be easier to install.. might even try both eventually.

If anyone has tried either of these and found issues or got feedback please let me know!

Thanks guys

Post is unread #4 Feb 25, 2021 9:24 am   Last edited Feb 25, 2021 9:25 am by Zedethar
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
Hey everyone,

As I am trying to add an old multiclass code from Lost Prophecy files. To the 1.9.3 smaug mud.h file I notice that I cannot find the exact location of the first changes.

It states:
in mud.h

to char_data below

sh_int class;
add
sh_int dualclass;

Add to your defines:
#define IS_DUAL(ch) ((ch)->dualclass > -1)

change IS_VAMPIRE

#define IS_VAMPIRE(ch) (!IS_NPC(ch) \
&& ((ch)->class==CLASS_VAMPIRE \
|| (ch)->dualclass==CLASS_VAMPIRE))

Add the following prototypes in:

bool DUAL_SKILL args((CHAR_DATA *ch, int sn));
int dual_adept args((CHAR_DATA *ch, int sn));
int find_skill_level args((CHAR_DATA *ch, int sn));
int hp_max args((CHAR_DATA *ch));
int hp_min args((CHAR_DATA *ch));
bool use_mana args((CHAR_DATA *ch));


When I look in mud.h I do not see a reference that looks like:

sh_int class;
under a char_data field. Is it possible to still add
multiclass to the new version or am I not seeing where the proper field is?

If anyone has attempted this recently and can give info it would help me greatly.

-------
Could this be referring to the this section of mud.h

struct char_data
{
CHAR_DATA *next;
CHAR_DATA *prev;
CHAR_DATA *next_in_room;
CHAR_DATA *prev_in_room;
CHAR_DATA *master;
CHAR_DATA *leader;
FIGHT_DATA *fighting;
CHAR_DATA *reply;
CHAR_DATA *retell;
CHAR_DATA *switched;
CHAR_DATA *mount;
HHF_DATA *hunting;
HHF_DATA *fearing;
HHF_DATA *hating;
VARIABLE_DATA *variables;
SPEC_FUN *spec_fun;
const char *spec_funname;
MPROG_ACT_LIST *mpact;
int mpactnum;
unsigned short mpscriptpos;
MOB_INDEX_DATA *pIndexData;
DESCRIPTOR_DATA *desc;
AFFECT_DATA *first_affect;
AFFECT_DATA *last_affect;
NOTE_DATA *pnote;
NOTE_DATA *comments;
OBJ_DATA *first_carrying;
OBJ_DATA *last_carrying;
ROOM_INDEX_DATA *in_room;
ROOM_INDEX_DATA *was_in_room;
PC_DATA *pcdata;
DO_FUN *last_cmd;
DO_FUN *prev_cmd; /* mapping */
void *dest_buf; /* This one is to assign to differen things */
const char *alloc_ptr; /* Must str_dup and free this one */
void *spare_ptr;
int tempnum;
EDITOR_DATA *editor;
TIMER *first_timer;
TIMER *last_timer;
CHAR_MORPH *morph;
const char *name;
const char *short_descr;
const char *long_descr;
const char *description;
short num_fighting;
short substate;
short sex;
short Class;
short race;
short level;
short trust;
int played;
time_t logon;
time_t save_time;
short timer;
short wait;
short hit;
short max_hit;
short mana;
short max_mana;
short move;
short max_move;
short practice;
short numattacks;
int gold;
int exp;
EXT_BV act;
EXT_BV affected_by;
EXT_BV no_affected_by;
int carry_weight;
int carry_number;
int xflags;
int no_immune;
int no_resistant;
int no_susceptible;
int immune;
int resistant;
int susceptible;
EXT_BV attacks;
EXT_BV defenses;
int speaks;
int speaking;
short saving_poison_death;
short saving_wand;
short saving_para_petri;
short saving_breath;
short saving_spell_staff;
short alignment;
short barenumdie;
short baresizedie;
short mobthac0;
short hitroll;
short damroll;
short hitplus;
short damplus;
short position;
short defposition;
short style;
short height;
short weight;
short armor;
short wimpy;
int deaf;
short perm_str;
short perm_int;
short perm_wis;
short perm_dex;
short perm_con;
short perm_cha;
short perm_lck;
short mod_str;
short mod_int;
short mod_wis;
short mod_dex;
short mod_con;
short mod_cha;
short mod_lck;
short mental_state; /* simplified */
short emotional_state; /* simplified */
int retran;
int regoto;
short mobinvis; /* Mobinvis level SB */
short colors[MAX_COLORS];
int home_vnum; /* hotboot tracker */
int resetvnum;
int resetnum;
bool loadedself; /* Used to see if mpmloaded self, if so skip changing the reset for it currently */



---
If anyone has any information on this please let me know.

Thanks
[Go to top] top

Post is unread #5 Feb 25, 2021 5:19 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
yeah that is the char_data struct you are looking for in mud.h. You may feel free to look into the multiclass code in the LoP codebase as well, but there is no snippet for it lol.

Post is unread #6 Feb 26, 2021 8:59 pm   Last edited Feb 26, 2021 9:00 pm by Zedethar
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
Another step that doesn't look like it exists in 1.9.3 act_info.c

inside act_info.c inside do_practice find:


change

if ( ch->level < skill_table[sn]->skill_level[ch->class]
|| (!IS_IMMORTAL(ch) && skill_table[sn]->skill_level[ch->class] == 0) )
continue;

into:

if (( ch->level < skill_table[sn]->skill_level[ch->class]
&& !DUAL_SKILL(ch, sn) )
|| (!IS_IMMORTAL(ch) && skill_table[sn]->skill_level[ch->class] == 0
&& !DUAL_SKILL(ch, sn) ) )
continue;

---- I've been unable to find the mentioned line, I know
they are wrapped sentence i'll unwrap if i can just find what they are saying lol. My act_info.c looks like:


void do_practice( CHAR_DATA* ch, const char* argument)
{
CHAR_DATA *mob;
char buf[MAX_STRING_LENGTH];
int sn;

if( IS_NPC( ch ) )
return;

for( mob = ch->in_room->first_person; mob; mob = mob->next_in_room )
if( IS_NPC( mob ) && xIS_SET( mob->act, ACT_PRACTICE ) )
break;

if( argument[0] == '\0' )
{
int col;
short lasttype, cnt;
bool is_ok;

col = cnt = 0;
lasttype = SKILL_SPELL;
set_pager_color( AT_MAGIC, ch );

for( sn = 0; sn < num_skills; ++sn )
{
const SKILLTYPE *skill;
int normalSn;

// the first num_sorted_skills are sorted by type, so we don't want
// to index into skill_table -- that is sorted alphabetically -- so
// we need to do the following dance to check if we are in the
// sorted section or the unsorted section.
if( sn < num_sorted_skills )
{
skill = skill_table_bytype[sn];

// we are looping over the skills sorted by type.
// So, we need to get the normal sn as well.
normalSn = skill_lookup( skill->name );
}
else
{
skill = skill_table[sn];
normalSn = sn;
}

if( !skill || !skill->name || skill->name[0] == '\0' )
continue;

if ( strcmp( skill_table[sn]->name, "reserved" ) == 0 && ( IS_IMMORTAL( ch ) || DUAL_SKILL(ch, sn) ) )
{
if( col % 3 != 0 )
send_to_pager( "\r\n", ch );
set_pager_color( AT_MAGIC, ch );
send_to_pager_color( " ----------------------------------[&CSpells&B]----------------------------------\r\n",
ch );
col = 0;
}

if( skill->type != lasttype )
{
if( !cnt )
send_to_pager( " (none)\r\n", ch );
else if( col % 3 != 0 )
send_to_pager( "\r\n", ch );
set_pager_color( AT_MAGIC, ch );
pager_printf_color( ch,
" ----------------------------------&C%ss&B----------------------------------\r\n",
skill_tname[skill->type] );
col = cnt = 0;
}
lasttype = skill->type;

if( !IS_IMMORTAL( ch )
&& ( skill->guild != CLASS_NONE && ( !IS_GUILDED( ch ) || ( ch->pcdata->clan->Class != skill->guild ) ) ) )
continue;

The next half mentions mobs...

Post is unread #7 Feb 27, 2021 8:17 am   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
well just past what you posted you have this
         /**
         * mob will only display practice skills it can train a player in (up to its own level in rank)  
         * (e.g. A level 10 NPC trainer mob will display the skills and spells a character can train
         * up to level 10) 
         **/
         if( mob )  
         {
            if( skill->skill_level[ch->Class] > mob->level && skill->race_level[ch->race] > mob->level )
               continue;
         }
        
         is_ok = FALSE;

         if( ch->level >= skill->skill_level[ch->Class] )
            is_ok = TRUE;
         if( ch->level >= skill->race_level[ch->race] )
            is_ok = TRUE;

         if( !is_ok )
            continue;
          

         if( ch->pcdata->learned[sn] <= 0 && SPELL_FLAG( skill, SF_SECRETSKILL ) )
            continue;

         ++cnt;
         set_pager_color( AT_MAGIC, ch );
         pager_printf( ch, "%20.20s", skill->name );
         if( ch->pcdata->learned[normalSn] > 0 )
            set_pager_color( AT_SCORE, ch );
         pager_printf( ch, " %3d%% ", ch->pcdata->learned[normalSn] );
         if( ++col % 3 == 0 )
            send_to_pager( "\r\n", ch );
      }

this is the part in there where you probably want to add in for duel class
         if( ch->level >= skill->skill_level[ch->Class] )
            is_ok = TRUE;
         if( ch->level >= skill->race_level[ch->race] )
            is_ok = TRUE;

         if( !is_ok )
            continue;

You can just try adding that line as it says above those if you want and it should work fine. Notice though that you can change the skill_table[sn]->skill_level[ch->class] with skill->skill_level[ch->Class] the c in class needs to be C and you can replace the skill_table[sn] with skill

Post is unread #8 Feb 27, 2021 9:23 am   Last edited Feb 27, 2021 9:23 am by Zedethar
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
Thank you for explaining this further for me sir, I will be able to do this hopefully :)
At first I was pretty confused as the changes are making it much harder to see where things are located.

Thanks again

Post is unread #9 Feb 27, 2021 9:27 am   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
No problem. You'll get the hang of some of the changes needed the longer you are at this. Most snippets were put out a long time ago and the code has seen plenty of changes since then. The compilers are completely different as well and most of us don't stay up to date on all the different things and changes lol.

Post is unread #10 Feb 28, 2021 9:34 pm   Last edited Feb 28, 2021 10:26 pm by Zedethar
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
I am trying to see if I added this to the proper prototypes sections? Instructions say:

#define IS_VAMPIRE(ch) (!IS_NPC(ch) \
&& ((ch)->class==CLASS_VAMPIRE \
|| (ch)->dualclass==CLASS_VAMPIRE))

Add the following prototypes in:

bool DUAL_SKILL args((CHAR_DATA *ch, int sn));
int dual_adept args((CHAR_DATA *ch, int sn));
int find_skill_level args((CHAR_DATA *ch, int sn));
int hp_max args((CHAR_DATA *ch));
int hp_min args((CHAR_DATA *ch));
bool use_mana args((CHAR_DATA *ch));

But there is numerous places to put these? Any ideas where these exact prototypes go? At the bottom of mud.h there are several columns saying act.c, skills.c, build.c with their prototypes under it and so on.
I assume under the skills.c prototype section?

Also I am currently trying to get past updates to Magic.c and it is being relentless lol

magic.c: In function ‘int bsearch_skill_exact(const char*, int, int)’:
magic.c:259:8: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’
259 | if (!str_cmp(name, skill_table[sn]->name)
| ^
magic.c:260:8: error: ‘ch’ was not declared in this scope
260 | && (ch->pcdata->learned[sn] > 0
| ^~
magic.c:264:7: error: expected primary-expression before ‘if’
264 | if( first >= top )
| ^~
magic.c:263:14: error: expected ‘)’ before ‘if’
263 | return sn;
| ^

Post is unread #11 Mar 1, 2021 7:19 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
yeah anywhere in the stuff for skills.c prototype section should be fine. You would have to post the whole bsearch_skill_exact function

Post is unread #12 Mar 1, 2021 8:41 pm   Last edited Mar 1, 2021 8:42 pm by Zedethar
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
Instructions for changes:

In magic.c
inside ch_bsearch_skill_prefix
change:

if ( LOWER(name[0]) == LOWER(skill_table[sn]->name[0]) && !str_prefix(name, skill_table[sn]->name)
&& ch->pcdata->learned[sn] > 0
&& ch->level >= skill_table[sn]->skill_level[ch->class] )
return sn;
into:

if ( LOWER(name[0]) == LOWER(skill_table[sn]->name[0]) && !str_prefix(name, skill_table[sn]->name)
&& ch->pcdata->learned[sn] > 0
&& (ch->level >= skill_table[sn]->skill_level[ch->class]
|| DUAL_SKILL(ch, sn) ) )
return sn;

inside ch_bsearch_skill_exact
change:

if (!str_cmp(name, skill_table[sn]->name)
&& ch->pcdata->learned[sn] > 0
&& ch->level >= skill_table[sn]->skill_level[ch->class] )
return sn;
into:


if (!str_cmp(name, skill_table[sn]->name)
&& (ch->pcdata->learned[sn] > 0
&& (ch->level >= skill_table[sn]->skill_level[ch->class]
|| DUAL_SKILL(ch, sn) ) )
return sn;

in do_cast
change:

if ( ( sn = find_spell( ch, arg1, TRUE ) ) < 0
|| ( !IS_NPC(ch) && ch->level < skill_table[sn]->skill_level[ch->class] ) )
{
send_to_char( "You can't do that.\n\r", ch );
return;
}
into:
if ( ( sn = find_spell( ch, arg1, TRUE ) ) < 0
|| ( !IS_NPC(ch) && ch->level < skill_table[sn]->skill_level[ch->class]
&& !DUAL_SKILL(ch, sn) ) )
{
send_to_char( "&BYou can't do that.\n\r", ch );
return;
}

----------------------
My Magic.c file:

static int bsearch_skill_prefix( const char *name, int first, int top )
{
int sn;

for( ;; )
{
sn = ( first + top ) >> 1;
if( !IS_VALID_SN( sn ) )
return -1;
if ( LOWER(name[0]) == LOWER(skill_table[sn]->name[0]) && !str_prefix(name, skill_table[sn]->name) && (ch->pcdata->learned[sn] > 0 && (ch->level >= skill_table[sn]->skill_level[ch->Class] || DUAL_SKILL(ch, sn) ) )
return sn;
if( first >= top )
return -1;
if( strcasecmp( name, skill_table[sn]->name ) < 1 )
top = sn - 1;
else
first = sn + 1;
}
}

/*
* Perform a binary search on a section of the skill table -Thoric
* Each different section of the skill table is sorted alphabetically
*
* Check for exact matches only.
*
* Made static by dchaley 2007-06-22. Nobody has any business calling the
* binary search directly; they should only use the skill_lookup or
* find_* functions. (A practical reason is that a bsearch call will
* prevent you from finding skills in the interval used for skills created
* after MUD boot.)
*/
static int bsearch_skill_exact( const char *name, int first, int top )
{
int sn;

for( ;; )
{
sn = ( first + top ) >> 1;

if( !IS_VALID_SN( sn ) )
return -1;
if (!str_cmp(name, skill_table[sn]->name)
&& (ch->pcdata->learned[sn] > 0
&& (ch->level >= skill_table[sn]->skill_level[ch->Class]
|| DUAL_SKILL(ch, sn) ) )
return sn;
if( first >= top )
return -1;
if( strcasecmp( name, skill_table[sn]->name ) < 1 )
top = sn - 1;
else
first = sn + 1;
}



Post is unread #13 Mar 2, 2021 7:41 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
yeah that stuff isn't going to work there since it has no clue what "ch" goes to. You might have to put that back to normal and then add in some changes to ch_slookup in magic.c

Post is unread #14 Mar 10, 2021 10:27 pm   
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
I am still stuck on this ch define error when trying to compile the Lost Prophecy multiclass code into my mud. :(

if ( LOWER(name[0]) == LOWER(skill_table[sn]->name[0]) && !str_prefix(name, skill_table[sn]->name) && ch->pcdata->learned[sn] > 0 && (ch->level >= skill_table[sn]->skill_level[ch->Class]
|| DUAL_SKILL(ch, sn) ) ) )
return sn;


No idea how to define this CH

If anyone knows of a newer multiclass system I can try to add that might be easier can you let me know? I need a multiclass system for my mud before I attempt to get further into building. Even a dual class
is fine where they can only be 2 classes total.
I believe the Lost Prophecy multiclass file is so old some of the lines are obsolete or is not able to compile right..

thanks all!

Post is unread #15 Mar 11, 2021 4:53 am   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
lol well you can skip that line and if it works all is good. if it doesn't work then you will have to go back into ch_slookup and make changes or make a change to both those adding so it can know what ch is while also handling without ch like it currently does and update all calls to the functions to include ch if there is one.

Post is unread #16 Mar 12, 2021 12:59 am   Last edited Mar 12, 2021 1:04 am by Zedethar
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
Thanks for the help rem 🙂, I got past the errors in magic.c only to find more in another section. I am going to try to find an update multiclass code or find someone who can make one since this is so outdated.

If anyone can make a multiclass code or help me please PM me and we can collaborate on some things. I am an experienced builder and have experience creating new classes and skills. I will share my creations with you for helping. All my areas are 100 rooms minimum and have nice room descriptions and mobprogs. I plan on making 10 at least.

Thanks

Post is unread #17 Mar 12, 2021 12:53 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,685
JoinedJan 1, 2002

 
Just FYI, I got the emails from the multiple errors your post was throwing. It's got something to do with the emoji you were trying to insert. I have no idea what the problem is yet, but the database on this site is ancient and probably needs some kind of settings to be updated somewhere.

I'm kind of surprised an issue like this hasn't cropped up before now since those kinds of emojis are pretty common across the internet.

Post is unread #18 Mar 12, 2021 8:53 pm   
Go to the top of the page
Go to the bottom of the page

Zedethar
Fledgling
GroupMembers
Posts38
JoinedFeb 21, 2021

 
I can tell you exactly what the error is, using emojis from a android phone does not work. I had to remove 1 smiley face just to make a post lol. Hope this helps!

Post is unread #19 Mar 12, 2021 9:08 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,685
JoinedJan 1, 2002

 
Yep, it was definitely the emoji because I reinserted it via the back end and it crashed itself immediately.

The reason for it is not totally unexpected though. This software is old, and I mean really old. A lot of it still reeks of the original Mercuryboard definitions for the database tables. That includes the fact that the original tables weren't even utf-8 compatible and only got to that point because I kicked and dragged it there myself for QSFP. These newer emojis exist beyond the standard utf-8 space and require utf8mb4 support instead. None of the tables in our database can use that yet even though the underlying MariaDB install is set to use it by default. So it's gonna take some ugly hacking to get it fixed, but at least it should be fixable.

Post is unread #20 Mar 13, 2021 8:16 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,685
JoinedJan 1, 2002

 
Should be fixed now, and the intended emoji restored to the post.

Pages:<< prev 1, 2 next >>