On Tue, 26 Mar 1996, Mac wrote:
> Thanx all for the replies to the autoeq patch.
> Now I am trying to load newbies with eq. The following is code I have
> edited from Class.c. This code compiles fine, but it has a nice problem
> that when I run it dumps the core. If I run it again, it works fine
> though. Go figure. This code was originally used in a 2.2 mud so mabye
> I am doing it wrong.
This code will dump the core if you run the mud in mini-mud mode.
I suggest that you place a check in for mini-mud before you call
the obj_to_char function, Or place the #.obj files in your index.mini
and everthing should work fine.
> /* Some initializations for characters, including initial skills */
> void do_start(struct char_data * ch)
> {
>
> int eqlist[] = {3102, /* this is a list of the vnum's of the items */
> 3102, /* that you want to give to the players */
> 3010, /* it must end with a zero */
> 3010,
> 10,
> 3043,
> 3076,
> 3081,
> 5428,
> 0};
>
> int z,weapon; /* variables needed for newbie eq */
>
>
> void advance_level(struct char_data * ch);
>
> GET_LEVEL(ch) = 1;
> GET_EXP(ch) = 1;
>
> set_title(ch, NULL);
> roll_real_abils(ch);
> ch->points.max_hit = 10;
>
> weapon = 0;
>
> switch (GET_CLASS(ch)) {
>
> case CLASS_MAGIC_USER:
> weapon = 7211;
> break;
>
> case CLASS_CLERIC:
> weapon = 7211;
> break;
>
> case CLASS_THIEF:
> weapon = 7211;
> SET_SKILL(ch, SKILL_SNEAK, 10);
> SET_SKILL(ch, SKILL_HIDE, 5);
> SET_SKILL(ch, SKILL_STEAL, 15);
> SET_SKILL(ch, SKILL_BACKSTAB, 10);
> SET_SKILL(ch, SKILL_PICK_LOCK, 10);
> SET_SKILL(ch, SKILL_TRACK, 10);
> break;
>
> case CLASS_WARRIOR:
> weapon = 7211;
> break;
> }
>
> advance_level(ch);
>
> GET_HIT(ch) = GET_MAX_HIT(ch);
> GET_MANA(ch) = GET_MAX_MANA(ch);
> GET_MOVE(ch) = GET_MAX_MOVE(ch);
>
> GET_COND(ch, THIRST) = 24;
> GET_COND(ch, FULL) = 24;
> GET_COND(ch, DRUNK) = 0;
>
> ch->player.time.played = 0;
> ch->player.time.logon = time(0);
>
> /* used to give newbies gold if you want */
> GET_GOLD(ch) = 5000;
>
> z = -1;
> /* give the objs to the character */
> while (eqlist[++z])
> obj_to_char(read_object(real_object(eqlist[z]),REAL),ch);
>
>
> /* Give the weapon to the character */
> if (weapon != 0)
> obj_to_char(read_object(real_object(weapon),REAL),ch);
>
>
> }
This archive was generated by hypermail 2b30 : 12/07/00 PST