Re: [CODE][NEWBIE]Auto calc for mobs/items random summonedmobs?

From: Peter Ajamian (pajamian@cheapsam.com)
Date: 12/17/99


John Bowman wrote:
>
>         Our builder thought of an idea that I have no idea even where to start
> coding (again):
>
>         Can it be made that a builder does not enter any kind of really specific
> information when generating
> items, mobs, etc.  Meaning that when Joe Builder goes to create a lvl 35 mob
> he can't set it to 1 hp for his
> friends to come along and gain a bunch of levels or get a lot of cash.  How
> would it be made so that the mud
> generates that kind of information automatically depending on lvl of mob,
> type of creature, etc ?

Yes, it can be done (I've done it), however, it is not an easy task and
unfortunately I didn't document what I did too well, so the chances of
my being able to lead you through the process are relatively slim,
however, I will give you this as a (really generalized) starting
point...

look in medit.c, the function medit_parse is very much like the nanny
function in act.informative.c, it parses input based on what OLC state
the player is in.  This function is the basic key to the entire medit
menu system, look through it and see how it changes different mob
attributes.  Any range limits would go in there somewhere.  Also look at
the function medit_setup_new, this is where the default attributes are
set for when a new mob is created.  You will have to do a lot of
research to find out how the various different attributes affect each
other (building.doc is a good starting point), and also plan on doing a
good deal of experimentation to see what attributes work for what.  Also
keep in mind that the mob's attributes may be altered by the use of
added armor or weapons.

following are a few formulas that I came up with (which I feel are
pretty accurate) for determining a good default value of several
attributes based on a mob's level...

L = Level

Hit Points in xdy+z format
HP = Ld6+(10 + 9L)

Exp = (L(1000 + L))

Thac0 is actually 20-HitRoll
HitRoll = (20L)/LVL_IMMORT

Gold (depends entirely on your own economic system).

>         Also, we want to have a class that can summon a certain type of creature
> with nearly random stats.
>
> i.e.  A lvl 2 summoner would cast:  c 'summon' elemental   and a lvl 1-10
> elemental would pop up and even
> maybe a random type elemental but if 2 summoners of the same level were to
> stand side by side and cast
> this spell the mobs would almost never be exactly the same stats type etc
> but the level of the creature
> summoned would be within a certain range dependant on the casters level  can
> mobs be generated on the
> fly in such a case

Absolutely, when you use medit to write a mob, a prototype is created
which contains all the information you entered for it, then when that
mob is loaded a mob object is created for it based on the attributes
defined in its prototype.  All you have to do is create the necessary
summon spells and have them load in the appropriate mob, then modify
some of its attributes (such as level) using a random factor (see the
random(), number(), and dice() functions) and set the mob to follow the
summoner.

Regards, Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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