Hrm. I haven't contributed anything of value in a long time, so here...
(it wouldn't let me attach and send, so it's a kinda long one)
A while back I was going to start a mud, but scrapped the whole lot soon
after
attempting a few major overhauls at once. I had put in some autosetting of
mobiles, which worked decently well. Since then I decided to tackle the job
from
the start again, this time I am working with more success. I decided to rip
the old autosetting out of the code I used to have and apply it to the new
mud,
and here is my product.
(Designed for Rom2.4b6 w/ OLC2.01)
As per this code...
I realize things like hitr=arg2 is redundant, I leave them there in case
either I or someone else wishes to create an algorythm to accompany it. I'm
also sure the whole thing could be prettied up more, but you should have
seen the
original code (even the author gave warning it was bad). This function isn't
really all that big, as it is a compilation of 4 seperate functions. For the
'auto impossible', you'll wanna change the the way flags are set, elsewise
your compiler will probably not like it (unless you have the same system
installed). The tail_chain() stuff was for bug squashing. The inclusion of
math.h is for fabs, to fuzz-i-fy the ac values, since you can't do
number_range
on negatives, so use (0-(number_range(fabs(int_a),fabs(int_b)))) to use
number_range on negatives. As per the rest of it, I pretty much like how it
turned out, but I'm more than happy to accept consructive critisim, minor
flames,
even major flames so long as they don't invlove funny &^#$&^%#&# symbols
(I'm an
adult, and know several sailors, trust me, they DO know words and phrases
worse
than the usual F... word, so it won't bother me)
<snippet>
OLC AutoMob: Originally by 'Blade of - E -'
ReVamped by Drylar Levre the CloudReader
The original author required mention in a helpfile available to all,
I require the same (just make a helpfile called snippets and give credit
to everyone from whom you have aquired a snippet, which isn't hard to
do, and makes snippet writers happier *(good thing!)).
Usage:
auto [easy / normal / hard / tank] [level]
auto [impossible]
Description:
It makes mob creation that much easier! Spiffy new command to increase
builder productivity and allow more brain power to go toward creativity.
Cleaned out, updated, feature enhanced, and prettier than the old version.
Change algorythms to fit your mud, as well as max's and flag setting.
In olc.c:
{"copy", NULL, ed_olded, medit_copy},
+ {"autoset", (void *) &xMob, ed_olded, medit_autoset},
{"commands", NULL, ed_olded, show_commands},
In olc.h:
DECLARE_OLC_FUN (medit_show);
+DECLARE_OLC_FUN (medit_autoset);
DECLARE_OLC_FUN (medit_group);
In olc_act.c:
//at the top add this line
#include <math.h>
//before or after MEDIT (medit_group){ . . . }, add this function
MEDIT( medit_autoset )
{
MOB_INDEX_DATA *pMob;
char arg1[MIL], arg2a[MIL], buff[MSL]=
"Syntax: auto [easy/normal/tank/hard] [level]\n\r auto
[impossible]\n\r";
int damd[3]={0,0,0}, hitd[3]={0,0,0}, ac[2]={0,0}, hitr=0, dice=0,
size=0, bonus=0, arg2=0;
EDIT_MOB( ch, pMob );
argument = first_arg (argument, arg1, TRUE);
argument = first_arg (argument, arg2a, TRUE);
/*auto [easy/normal/tank/hard] [level]*/
if(IS_NULL(arg1) || (!is_number(arg2a)))
{
stc (buff, ch);
tail_chain();
return FALSE;
}
arg2=atoi(arg2a);
if((LOWER (arg1[0] != "i")) && (arg2 > 250 || arg2 < 1))
{
stc("Level must be between 1 and 250 for mobiles.",ch);
tail_chain();
return FALSE;
}
switch (LOWER (arg1[0]))
{
case 'e':
/*officially declare what values*/
sprintf(buff,"Easy");
/*calculate easy ac values*/
ac[1] = 99 - (arg2 * 6.37) - ((arg2/10)^2);
ac[2] = 99 - (arg2 * 4.27) - ((arg2/10)^2);
/*calculate easy damage values*/
dice = arg2/3;
if (dice < 1) dice = 1;
dice++;
size = (.87 + arg2/dice);
if (size < 2) size = 2;
bonus = (7.5 + arg2/1.5);
damd[1]=dice;
damd[2]=size;
damd[3]=bonus;
/*calculate hitroll value*/
hitr = arg2;
/*calculate easy hitdice and manadice values*/
dice = (arg2 + .5) * 2 + .2;
if (dice < 1) dice = 1;
size = arg2/3;
if (size < 2) size = 2;
bonus = (arg2/59 + 1) * ((arg2 * 9) + (arg2/11)) +1;
hitd[1]=dice;
hitd[2]=size;
hitd[3]=bonus;
break;
case 'n':
/*officially declare what values*/
sprintf(buff,"Normal");
/*calculate normal ac values*/
ac[1] = 95 - (arg2 * 6.67) - ((arg2/10)^2);
ac[2] = 95 - (arg2 * 4.57) - ((arg2/10)^2);
/*calculate normal damage values*/
dice = arg2/3;
if (dice < 1) dice = 1;
size = (.87 + arg2/dice);
if (size < 2) size = 2;
bonus = (5.5 + arg2/2);
damd[1]=dice;
damd[2]=size;
damd[3]=bonus;
/*calculate hitroll value*/
hitr=arg2;
/*calculate normal hitdice and manadice values*/
dice = (arg2 + .5) * 2 + .2;
if (dice < 1) dice = 1;
size = arg2/3;
if (size < 2) size = 2;
bonus = (arg2/53 + 1) * ((arg2 * 10) + (arg2/10)) +1;
hitd[1]=dice;
hitd[2]=size;
hitd[3]=bonus;
break;
case 't':
/*officially declare what values*/
sprintf(buff,"Tank");
/*calculate insane ac values*/
ac[1] = 80 - (arg2 * 9.05) - ((arg2/10)^2);
ac[2] = 80 - (arg2 * 7.02) - ((arg2/10)^2);
/*calculate easy damage values*/
dice = arg2;
size = (.87 + arg2) * .95;
bonus = (2.5 + arg2/2.1);
damd[1]=dice;
damd[2]=size;
damd[3]=bonus;
/*calculate easy hitroll value*/
hitr=arg2;
/*calculate hard hitdice and manadice values*/
dice = (arg2 + .6) * 2.05 + .5;
if (dice < 1) dice = 1;
size = arg2/3;
if (size < 2) size = 2;
size++;
bonus = (arg2/53 + 1) * ((arg2 * 10) + (arg2/10)) +1;
hitd[1]=dice;
hitd[2]=size;
hitd[3]=bonus;
break;
case 'h':
/*officially declare what values*/
sprintf(buff,"Hard");
/*calculate hard ac values*/
ac[1] = 88 - (arg2 * 7.05) - ((arg2/10)^2);
ac[2] = 88 - (arg2 * 5.02) - ((arg2/10)^2);
/*calculate hard damage values*/
dice = arg2;
size = (.87 + arg2) * .95;
bonus = (2.5 + arg2/2.1);
damd[1]=dice;
damd[2]=size;
damd[3]=bonus;
/*calculate hitroll value*/
hitr=arg2;
/*calculate hard hitdice and manadice values*/
dice = (arg2 + .6) * 2.05 + .5;
if (dice < 1) dice = 1;
size = arg2/3;
if (size < 2) size = 2;
size++;
bonus = (arg2/53 + 1) * ((arg2 * 10) + (arg2/10)) +1;
hitd[1]=dice;
hitd[2]=size;
hitd[3]=bonus;
break;
case 'i':
/* Auto Impossible */
pMob->level = 250;
pMob->hitroll = 1000;
pMob->hit[DICE_NUMBER] = 1;
pMob->hit[DICE_TYPE] = 1;
pMob->hit[DICE_BONUS] = 10000;
pMob->mana[DICE_NUMBER] = 1;
pMob->mana[DICE_TYPE] = 1;
pMob->mana[DICE_BONUS] = 10000;
pMob->damage[DICE_NUMBER] = 1;
pMob->damage[DICE_TYPE] = 1;
pMob->damage[DICE_BONUS] = 1100;
pMob->ac[AC_PIERCE] = -500;
pMob->ac[AC_BASH] = -500;
pMob->ac[AC_SLASH] = -500;
pMob->ac[AC_EXOTIC] = -500;
STR_ZERO_STR( pMob->res_flags, RES_FLAGS);
STR_ZERO_STR( pMob->vuln_flags, VULN_FLAGS);
SET_BIT( pMob->off_flags, OFF_FAST);
SET_BIT( pMob->imm_flags, IMM_MAGIC);
SET_BIT( pMob->imm_flags, IMM_WEAPON);
SET_BIT( pMob->imm_flags, IMM_SUMMON);
SET_BIT( pMob->imm_flags, IMM_CHARM);
stc ("Auto Impossible Set.", ch);
tail_chain();
return TRUE;
break;
default:
stc (buff, ch);
tail_chain();
return FALSE;
break;
}
/*i'm fuzzing out the hp/mana numbers generated by 2%, damroll by 4%,
hitroll by 10%*/
pMob->level = arg2;
pMob->hitroll = number_range
((hitr-(hitr/10)),(hitr+(hitr/10)));
pMob->hit[DICE_NUMBER] = number_range
((hitd[1]-(hitd[1]/50)),(hitd[1]+(hitd[1]/50)));
pMob->hit[DICE_TYPE] = number_range
((hitd[2]-(hitd[2]/50)),(hitd[2]+(hitd[2]/50)));
pMob->hit[DICE_BONUS] = number_range
((hitd[3]-(hitd[3]/50)),(hitd[3]+(hitd[3]/50)));
pMob->mana[DICE_NUMBER] = number_range
((hitd[1]-(hitd[1]/50)),(hitd[1]+(hitd[1]/50)));
pMob->mana[DICE_TYPE] = number_range
((hitd[2]-(hitd[2]/50)),(hitd[2]+(hitd[2]/50)));
pMob->mana[DICE_BONUS] = number_range
((hitd[3]-(hitd[3]/50)),(hitd[3]+(hitd[3]/50)));
pMob->damage[DICE_NUMBER] = number_range
((damd[1]-(damd[1]/25)),(damd[1]+(damd[1]/25)));
pMob->damage[DICE_TYPE] = number_range
((damd[2]-(damd[2]/25)),(damd[2]+(damd[2]/25)));
pMob->damage[DICE_BONUS] = number_range
((damd[3]-(damd[3]/25)),(damd[3]+(damd[3]/25)));
/* for ac values, i fuzz out what it gives by 5%, and acE is 10% less
than acP/acB/acS */
pMob->ac[AC_PIERCE] = (0 - (number_range
(fabs(ac[1]-(ac[1]/20)),fabs(ac[1]+(ac[1]/20)))));
pMob->ac[AC_BASH] = (0 - (number_range
(fabs(ac[1]-(ac[1]/20)),fabs(ac[1]+(ac[1]/20)))));
pMob->ac[AC_SLASH] = (0 - (number_range
(fabs(ac[1]-(ac[1]/20)),fabs(ac[1]+(ac[1]/20)))));
pMob->ac[AC_EXOTIC] = (fabs(ac[1]/10) - (number_range
(fabs(ac[1]-(ac[1]/20)),fabs(ac[1]+(ac[1]/20)))));
ptc(ch,"Auto %s Set: Level %d.\n\r",buff,arg2);
stc( "Please check for accuracy.\n\r", ch);
tail_chain();
return TRUE;
}
</snippet>
Drylar Levre the CloudReader
(The validity of this is shaky, but found in a few seperate places):
Upon some research, I discovered F.U.C.K. originally came from signs that
were hung outside windows in Great Britian. At the time (a king or two
past),
couples were required to get 'permission from the king to have sexual
intercrouse',
and so, couples, after recieving the permit or whatnot, would post a sign
outside
their homes that read FUCK which is an acronym for 'Fornicating Under
Consent of
the King'