F
E 0 0 A
for ( ; ; )
{
letter = fread_letter( fp );
if (letter == 'F')
{
char *word;
long vector;
word = fread_word(fp);
vector = fread_flag(fp);
if (!str_prefix(word,"act"))
REMOVE_BIT(pMobIndex->act,vector);
else if (!str_prefix(word,"aff"))
REMOVE_BIT(pMobIndex->affected_by,vector);
else if (!str_prefix(word,"2af"))
REMOVE_BIT(pMobIndex->affected2_by, vector);
else if (!str_prefix(word,"off"))
REMOVE_BIT(pMobIndex->off_flags,vector);
else if (!str_prefix(word,"imm"))
REMOVE_BIT(pMobIndex->imm_flags,vector);
else if (!str_prefix(word,"res"))
REMOVE_BIT(pMobIndex->res_flags,vector);
else if (!str_prefix(word,"vul"))
REMOVE_BIT(pMobIndex->vuln_flags,vector);
else if (!str_prefix(word,"for"))
REMOVE_BIT(pMobIndex->form,vector);
else if (!str_prefix(word,"par"))
REMOVE_BIT(pMobIndex->parts,vector);
else{
bug("Flag remove: flag not found.",0);
exit(1);
}
}else if(letter == 'E')
pMobIndex->affected2_by = fread_flag(fp) | race_table[pMobIndex->race].aff2;
else
{
ungetc(letter,fp);
break;
}
}
}else if(letter == 'E')
pMobIndex->affected2_by = fread_flag(fp);
#921
oldstyle hera~
Hera~
Hera is here.
~
Hera, the wife of Zeus is here. She smiles at you as you enter and invites you
to rest and sit for a while.
~
human~
ABCQ BDFHNT 1000 0
59 0 50d10+9000 59d9+100 6d8+26 none
-29 -29 -29 -3
EIKU 0 0 0
stand stand female 5000
0 0 medium 0
E A
F
E 0 0 A
for ( ; ; )
{
letter = fread_letter( fp );
if (letter == 'F')
{
char *word;
long vector;
word = fread_word(fp);
vector = fread_flag(fp);
if (!str_prefix(word,"act"))
REMOVE_BIT(pMobIndex->act,vector);
else if (!str_prefix(word,"aff"))
REMOVE_BIT(pMobIndex->affected_by,vector);
else if (!str_prefix(word,"2af"))
REMOVE_BIT(pMobIndex->affected2_by, vector);
else if (!str_prefix(word,"off"))
REMOVE_BIT(pMobIndex->off_flags,vector);
else if (!str_prefix(word,"imm"))
REMOVE_BIT(pMobIndex->imm_flags,vector);
else if (!str_prefix(word,"res"))
REMOVE_BIT(pMobIndex->res_flags,vector);
else if (!str_prefix(word,"vul"))
REMOVE_BIT(pMobIndex->vuln_flags,vector);
else if (!str_prefix(word,"for"))
REMOVE_BIT(pMobIndex->form,vector);
else if (!str_prefix(word,"par"))
REMOVE_BIT(pMobIndex->parts,vector);
else{
bug("Flag remove: flag not found.",0);
exit(1);
}
}else if(letter == 'E')
pMobIndex->affected2_by = fread_flag(fp) | race_table[pMobIndex->race].aff2;
else
{
ungetc(letter,fp);
break;
}
}
}else if(letter == 'E')
pMobIndex->affected2_by = fread_flag(fp);
#921
oldstyle hera~
Hera~
Hera is here.
~
Hera, the wife of Zeus is here. She smiles at you as you enter and invites you
to rest and sit for a while.
~
human~
ABCQ BDFHNT 1000 0
59 0 50d10+9000 59d9+100 6d8+26 none
-29 -29 -29 -3
EIKU 0 0 0
stand stand female 5000
0 0 medium 0
E A
#1295
testifa~
mr testifa S~
Mr testifa stands here looking about the arena L
~
Mr Testifa is a tall proud human. He stands approximately six and a half
feet tall and looks to be a warrior of some kind. Long taunt muscular frame
a broad chest. His face is wind-blown and scarred.
~
human~
AB H 100 0
30 20 10d61+416 30d10+100 5d6+15 punch
-9 -9 -9 0
CFI I KL H
stand stand male 2000
AV ABCD medium unknown
E A /*here*/
F for HM
F par EFGHIJK
#0
CHAR_DATA *create_mobile (MOB_INDEX_DATA * pMobIndex)
{
CHAR_DATA *mob;
int i;
AFFECT_DATA af;
mobile_count++;
if (pMobIndex == NULL)
{
bug ("Create_mobile: NULL pMobIndex.", 0);
exit (1);
}
mob = new_char ();
mob->pIndexData = pMobIndex;
mob->name = str_dup (pMobIndex->player_name); /* OLC */
mob->short_descr = str_dup (pMobIndex->short_descr); /* OLC */
mob->long_descr = str_dup (pMobIndex->long_descr); /* OLC */
mob->description = str_dup (pMobIndex->description); /* OLC */
mob->id = get_mob_id ();
mob->spec_fun = pMobIndex->spec_fun;
mob->prompt = NULL;
mob->mprog_target = NULL;
if (pMobIndex->wealth == 0)
{
mob->silver = 0;
mob->gold = 0;
}
else
{
long wealth;
wealth =
number_range (pMobIndex->wealth / 2, 3 * pMobIndex->wealth / 2);
mob->gold = number_range (wealth / 200, wealth / 100);
mob->silver = wealth - (mob->gold * 100);
}
if (pMobIndex->new_format)
/* load in new style */
{
/* read from prototype */
mob->group = pMobIndex->group;
mob->act = pMobIndex->act;
mob->comm = COMM_NOCHANNELS | COMM_NOSHOUT | COMM_NOTELL;
mob->affected_by = pMobIndex->affected_by;
mob->affected2_by = pMobIndex->affected2_by; /*aff2 line added here******/
mob->alignment = pMobIndex->alignment;
mob->level = pMobIndex->level;
mob->hitroll = pMobIndex->hitroll;
mob->damroll = pMobIndex->damage[DICE_BONUS];
mob->max_hit = dice (pMobIndex->hit[DICE_NUMBER],
pMobIndex->hit[DICE_TYPE])
+ pMobIndex->hit[DICE_BONUS];
mob->hit = mob->max_hit;
mob->max_mana = dice (pMobIndex->mana[DICE_NUMBER],
pMobIndex->mana[DICE_TYPE])
+ pMobIndex->mana[DICE_BONUS];
mob->mana = mob->max_mana;
mob->damage[DICE_NUMBER] = pMobIndex->damage[DICE_NUMBER];
mob->damage[DICE_TYPE] = pMobIndex->damage[DICE_TYPE];
mob->dam_type = pMobIndex->dam_type;
if (mob->dam_type == 0)
switch (number_range (1, 3))
{
case (1):
mob->dam_type = 3;
break; /* slash */
case (2):
mob->dam_type = 7;
break; /* pound */
case (3):
mob->dam_type = 11;
break; /* pierce */
}
for (i = 0; i < 4; i++)
mob->armor[i] = pMobIndex->ac[i];
mob->off_flags = pMobIndex->off_flags;
mob->imm_flags = pMobIndex->imm_flags;
mob->res_flags = pMobIndex->res_flags;
mob->vuln_flags = pMobIndex->vuln_flags;
mob->start_pos = pMobIndex->start_pos;
mob->default_pos = pMobIndex->default_pos;
mob->sex = pMobIndex->sex;
if (mob->sex == 3) /* random sex */
mob->sex = number_range (1, 2);
mob->race = pMobIndex->race;
mob->form = pMobIndex->form;
mob->parts = pMobIndex->parts;
mob->size = pMobIndex->size;
mob->material = str_dup (pMobIndex->material);
/* computed on the spot */
for (i = 0; i < MAX_STATS; i++)
mob->perm_stat[i] = UMIN (25, 11 + mob->level / 4);
if (IS_SET (mob->act, ACT_WARRIOR))
{
mob->perm_stat[STAT_STR] += 3;
mob->perm_stat[STAT_INT] -= 1;
mob->perm_stat[STAT_CON] += 2;
}
if (IS_SET (mob->act, ACT_THIEF))
{
mob->perm_stat[STAT_DEX] += 3;
mob->perm_stat[STAT_INT] += 1;
mob->perm_stat[STAT_WIS] -= 1;
}
if (IS_SET (mob->act, ACT_CLERIC))
{
mob->perm_stat[STAT_WIS] += 3;
mob->perm_stat[STAT_DEX] -= 1;
mob->perm_stat[STAT_STR] += 1;
}
if (IS_SET (mob->act, ACT_MAGE))
{
mob->perm_stat[STAT_INT] += 3;
mob->perm_stat[STAT_STR] -= 1;
mob->perm_stat[STAT_DEX] += 1;
}
if (IS_SET (mob->off_flags, OFF_FAST))
mob->perm_stat[STAT_DEX] += 2;
mob->perm_stat[STAT_STR] += mob->size - SIZE_MEDIUM;
mob->perm_stat[STAT_CON] += (mob->size - SIZE_MEDIUM) / 2;
/* let's get some spell action */
if (IS_AFFECTED (mob, AFF_SANCTUARY))
{
af.where = TO_AFFECTS;
af.type = skill_lookup ("sanctuary");
af.level = mob->level;
af.duration = -1;
af.location = APPLY_NONE;
af.modifier = 0;
af.bitvector = AFF_SANCTUARY;
affect_to_char (mob, &af);
}
if (IS_AFFECTED (mob, AFF_HASTE))
{
af.where = TO_AFFECTS;
af.type = skill_lookup ("haste");
af.level = mob->level;
af.duration = -1;
af.location = APPLY_DEX;
af.modifier = 1 + (mob->level >= 18) + (mob->level >= 25) +
(mob->level >= 32);
af.bitvector = AFF_HASTE;
affect_to_char (mob, &af);
}
if (IS_AFFECTED (mob, AFF_PROTECT_EVIL))
{
af.where = TO_AFFECTS;
af.type = skill_lookup ("protection evil");
af.level = mob->level;
af.duration = -1;
af.location = APPLY_SAVES;
af.modifier = -1;
af.bitvector = AFF_PROTECT_EVIL;
affect_to_char (mob, &af);
}
if (IS_AFFECTED (mob, AFF_PROTECT_GOOD))
{
af.where = TO_AFFECTS;
af.type = skill_lookup ("protection good");
af.level = mob->level;
af.duration = -1;
af.location = APPLY_SAVES;
af.modifier = -1;
af.bitvector = AFF_PROTECT_GOOD;
affect_to_char (mob, &af);
}
}
else
{ /* read in old format and convert */
mob->act = pMobIndex->act;
mob->affected_by = pMobIndex->affected_by;
mob->affected2_by = pMobIndex->affected2_by; /*aff2 line added here******/
mob->alignment = pMobIndex->alignment;
mob->level = pMobIndex->level;
mob->hitroll = pMobIndex->hitroll;
mob->damroll = 0;
mob->max_hit =
mob->level * 8 + number_range (mob->level * mob->level / 4,
mob->level * mob->level);
mob->max_hit *= .9;
mob->hit = mob->max_hit;
mob->max_mana = 100 + dice (mob->level, 10);
mob->mana = mob->max_mana;
switch (number_range (1, 3))
{
case (1):
mob->dam_type = 3;
break; /* slash */
case (2):
mob->dam_type = 7;
break; /* pound */
case (3):
mob->dam_type = 11;
break; /* pierce */
}
for (i = 0; i < 3; i++)
mob->armor[i] = interpolate (mob->level, 100, -100);
mob->armor[3] = interpolate (mob->level, 100, 0);
mob->race = pMobIndex->race;
mob->off_flags = pMobIndex->off_flags;
mob->imm_flags = pMobIndex->imm_flags;
mob->res_flags = pMobIndex->res_flags;
mob->vuln_flags = pMobIndex->vuln_flags;
mob->start_pos = pMobIndex->start_pos;
mob->default_pos = pMobIndex->default_pos;
mob->sex = pMobIndex->sex;
mob->form = pMobIndex->form;
mob->parts = pMobIndex->parts;
mob->size = SIZE_MEDIUM;
mob->material = "";
for (i = 0; i < MAX_STATS; i++)
mob->perm_stat[i] = 11 + mob->level / 4;
}
mob->position = mob->start_pos;
/* link the mob to the world list */
mob->next = char_list;
char_list = mob;
pMobIndex->count++;
return mob;
}
if (victim->affected_by)
{
sprintf (buf, "Affected by %s\n\r",
affect_bit_name (victim->affected_by));
send_to_char (buf, ch);
}
if (victim->affected2_by)
{
sprintf (buf, "Also affected by %s\n\r",
affect2_bit_name (victim->affected2_by));
send_to_char (buf, ch);
}
if (IS_AFFECTED (victim, AFF_SANCTUARY))
strcat (buf, "(White Aura) ");
if (!IS_NPC (victim) && IS_SET (victim->act, PLR_KILLER))
strcat (buf, "(KILLER) ");
if (!IS_NPC (victim) && IS_SET (victim->act, PLR_THIEF))
strcat (buf, "(THIEF) ");
if (IS_AFFECTED2 (victim, AFF_CAMOFLAGUE))
strcat (buf, "(Camo'd) ");
if (victim->position == victim->start_pos
&& victim->long_descr[0] != '\0')
{
strcat (buf, victim->long_descr);
send_to_char (buf, ch);
return;
}
/* RT ASCII conversions – used so we can have letters in this file */
#define A 1
#define B 2
#define C 4
#define D 8
#define E 16
#define F 32
#define G 64
#define H 128
#define I 256
#define J 512
#define K 1024
#define L 2048
#define M 4096
#define N 8192
#define O 16384
#define P 32768
#define Q 65536
#define R 131072
#define S 262144
#define T 524288
#define U 1048576
#define V 2097152
#define W 4194304
#define X 8388608
#define Y 16777216
#define Z 33554432
#define aa 67108864 /* doubled due to conflicts */
#define bb 134217728
#define cc 268435456
#define dd 536870912
#define ee 1073741824
#define ff ((uint64_t)1 << 31)
#define gg ((uint64_t)1 << 32)
#define hh ((uint64_t)1 << 33)
/*
* Bits for 'affected_by'.
* Used in #MOBILES.
*/
#define AFF_BLIND (A)
#define AFF_INVISIBLE (B)
#define AFF_DETECT_EVIL (C)
#define AFF_DETECT_INVIS (D)
#define AFF_DETECT_MAGIC (E)
#define AFF_DETECT_HIDDEN (F)
#define AFF_DETECT_GOOD (G)
#define AFF_SANCTUARY (H)
#define AFF_FAERIE_FIRE (I)
#define AFF_INFRARED (J)
#define AFF_CURSE (K)
#define AFF_UNUSED_FLAG (L) /* unused */
#define AFF_POISON (M)
#define AFF_PROTECT_EVIL (N)
#define AFF_PROTECT_GOOD (O)
#define AFF_SNEAK (P)
#define AFF_HIDE (Q)
#define AFF_SLEEP (R)
#define AFF_CHARM (S)
#define AFF_FLYING (T)
#define AFF_PASS_DOOR (U)
#define AFF_HASTE (V)
#define AFF_CALM (W)
#define AFF_PLAGUE (X)
#define AFF_WEAKEN (Y)
#define AFF_DARK_VISION (Z)
#define AFF_BERSERK (aa)
#define AFF_SWIM (bb)
#define AFF_REGENERATION (cc)
#define AFF_SLOW (dd)
#define AFF_CAMOUFLAGE (ee)
#define AFF_FOCUS (ff)
#define AFF_CREEP (gg)
#define AFF_LOOKING_GLASS (hh)
#define ff ((uint64_t)1 << 31)
#define gg ((uint64_t)1 << 32)
#define hh ((uint64_t)1 << 33)
#define hh ( 1 << 33 ) //left shift 1, 33 spots
void main()
{ int value; //A 32 bit integer.
SET_BIT(value, hh); //set the 33rd bit
return;
}
#define hh (1 << 33 )
void main()
{ uint64_t value;
SET_BIT(value, hh)
return;
}
/*
* Prototype for a mob.
* This is the in-memory version of #MOBILES.
*/
struct mob_index_data
{
MOB_INDEX_DATA * next;
SPEC_FUN * spec_fun;
SHOP_DATA * pShop;
MPROG_LIST * mprogs;
AREA_DATA * area; /* OLC */
sh_int vnum;
sh_int group;
bool new_format;
sh_int count;
sh_int killed;
char * player_name;
char * short_descr;
char * long_descr;
char * description;
long act;
long affected_by;
uint64_t affected_by;
To add AFFECTS2 effects to a mob or object I have to manually edit the area file containing the target object and make it something like:
and because in merc.h I have:
Then AFF_CAMOFLAGUE would be added to the mob/obj?