NPC classes

Posted by Toy on Fri 31 May 2002 03:12 PM — 7 posts, 29,261 views.

#0
OK, I've changed the MAX_NPC_CLASS in mud.h to 100, and I've edited the NPC_CLASSES in const.c, and I even edited the MAX_NPC_CLASS section of build.c. It works fine, execpt for one small thing: I can get the proper names of the class up to class #25. Lemme show you:

char * const npc_class [MAX_NPC_CLASS] =
{
"mage", "cleric", "thief", "warrior", "vampire", "druid", "ranger",
"paladin", "necromancer", "anti-paladin", "guard", "shopkeeper", "animal",
"god", "civilian", "sailor", "immortal", "prince", "teacher",
"baker", "butcher", "blacksmith", "mayor", "king", "queen", "monster",
"undead", "princess", "gypsy", "soldier",
};

It read class 25/monster, but it reads class 26/unknown. Am I forgetting to edit something somewhere so it reads the remainder of the classes?
-Alexander
Australia Forum Administrator #1
In act_info.c I see these lines:


IS_NPC(victim)?victim->class<MAX_NPC_CLASS&&victim->class>=0?
npc_class[victim->class] : "unknown":victim->class<MAX_PC_CLASS&&
class_table[victim->class]->who_name&&
class_table[victim->class]->who_name[0] != '\0'?
class_table[victim->class]->who_name:"unknown");



It seems to display "unknown" based on MAX_PC_CLASS, not MAX_NPC_CLASS. Sounds like a bug, anyway I would try changing that.
#2
Thanks for setting me in the right direction Nick. I also found there were simpliar lines in Act_Wiz.c. Now I ran into another problem. I made the max races 1000, and like I did with MAX_NPC_CLASS, I changed everything in the right spots. But, if I set a mob's race number to 92 I get this message in a never-ending stream:

[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.

Any clue what this is all about?

-Alexander
#3
ERRRR.... ok, never mind. My highest race is only 91.. that's probably what's causing the continually looping bug message... Thanks anyways. :)

Alexander, the not-so knowledged but is working his way to smartness and greatness alike.
#4
Hmmm... I'm having some small problems with this change. I changed the NPC races and everything compiled cleanly, but when I log on the MUD and change the race of a mob I get this:

Build: Anavel: mset sec race 2
Log: [*****] BUG: Str_cmp: null bstr.
Log: [*****] BUG: Str_cmp: null bstr.

It still changes the race of the mob, but I'm wondering whats causing this.


Const.c:

char * const npc_race [MAX_NPC_RACE] =
{
"human", "spirit", "half-demon", "demon", "vampire", "r5", "r6",
"r7", "r8", "ape", "baboon", "bat", "bear", "cat", "dog", "dragon",
"goblin", "golem", "rat", "shadow", "shapeshifter", "wolf",
"zombie", "mammal", "fish", "insect", "animal", "monster"
};

Mud.h:

#define MAX_RACE 20
#define MAX_NPC_RACE 30
Amended on Sun 26 Sep 2004 06:51 PM by USER007
Canada #5
Well, I beleive that it because you have 28 race names declared in that array, you need to either add 2 more names, or decrease your declaration from 30 to 28.
#6
Well seems it was that, I left it at 30 cause I was thinking of adding more races, but seems I'll just have to change both of those files. Thanks.