Re: Mob question

From: Skylar (skylar@ifconfig.intserv.com)
Date: 04/26/96


On Sat, 27 Apr 1996, Fionn Colvin wrote:

> Hi all,
>        Has anyone added skills to E-Type mobs? If so, would you mind 
> sharing how you went about it?

First off, have you made it so mobs have a place to store skills?

If not, you'll need to do some fiddling in db.c... This is how my
db.c is changed... I'm running a hybrid of pl3 to pl11 though, so 
things might not be exact. 

In the parse_mobile() function you can replace:
mob_proto[i].player_specials = &dummy_mob;
with:
CREATE((mob_proto + i)->player_specials, struct player_special_data, 1);

Then, in read_mobile, add: 
*mob->player_specials = *mob_proto[i].player_specials;

Now in free_char(), where it calls free(ch->player_specials) You want
to make a check if (!IS_NPC(ch)) first, so that you don't free the
prototype's skills.

Okay, now you've got a slot to store skills for mobs, the espec is pretty
simple. I just finished this myself, so its not streamlined and could
probably use some sanity checking, but it works fine for me... :)

In interpret_espec(), I defined some new variabled, namely
arg1, arg2 as char arrays, and skill and percent as ints...

make a new case at the bottem...

CASE("Skill") {
  two_arguments(value, arg1, arg2);
  skill = atoi(arg1);
  percent = ati(arg2);
  SET_SKILL(mob_proto + i, skill, percent);
}


I know, that could be more efficient, and I could do with some sanity
checking on the ints,, but I just added this recently to see if it would 
even work, and havnt gotten around to polishing it up yet.

In the E mobs, just add Skill: <skillnumber> <howmuch> and they
have skills...

example:

Skill: 134 50

Would give them kick at 50% ... hum, maybe kick issnt 134 in the stock
spells.h ?  I can't remember if I renumbered the skills or not... oh
well, you get the idea.


-Sky



This archive was generated by hypermail 2b30 : 12/18/00 PST