22 Mar, 2009, boblinski wrote in the 21st comment:
Votes: 0
Cool.. so let me get this straight…

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:

E 0 0 A


and because in merc.h I have:
/*
* Bits for 'affected2_by'.
* Used in #MOBILES.
*/
#define AFF_CAMOFLAGUE (A)

Then AFF_CAMOFLAGUE would be added to the mob/obj?
22 Mar, 2009, David Haley wrote in the 22nd comment:
Votes: 0
Random note because I'm tired of seeing misspellings around the effect (not 'affect') system :evil: It's spelled camouflage. (Just like 'rogue' is spelled, well, 'rogue', not 'rouge'…) (I can't speak to your question because I don't know what exactly ROM does here.)
22 Mar, 2009, Sharmair wrote in the 23rd comment:
Votes: 0
The area file would have the F too, so it would have the two lines:
F
E 0 0 A

This effect would add the affected2_by flag to a character wearing the object (and remove
the flag when the object is removed). This syntax only works in the object section of the
area file (not the mob section).

If you want a mob to pop with an affected2_by flag, you will have to extend the area file
format to handle that too (again, I am assuming your snippet does not do this). Most of
the stock ROM area file format for the mob section is quite rigid and would require changes
to the loading code to handle both existing area files and your new format that I would
rather not get into right now (this is yet another reason I think the extended bitvector
system is a better approach). There is one flexible place in the mob section though. In
stock, this section currently only handles removing bits for a number of flag sets that the
race might set that you don't want on the mob, and uses the tag prefix of F. This section
is at the end of the mob info if it exists at all. This code is from the end of load_mobiles()
in db2.c with changes to take a new E tagged option for affected2_by and also adding in
race aff2 and adding to the remove bit section:
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;
}
}

This assumes you have an affected2_by type member in the race data called aff2 and you
want to auto set mobs with that. If you don't have the race data or you don't want to auto
set mobs with it, you can remove the 2af option from the remove flag part and have the E
option just be:
}else if(letter == 'E')
pMobIndex->affected2_by = fread_flag(fp);

If you do have the race data, any E options should come before any F sections though.
As an example of the format, here is Hera, mob 921 from the stock olympus.are with your
flag added at the end:
#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

As far as you having to manually edit the area files, if you are using stock ROM, yes. If
you are using a base code with OLC added, or you have added OLC yourself, then you
will also have to add support for editing and writing the new affected2_by related things
in the OLC and can use that to edit instead of manually editing.
23 Mar, 2009, boblinski wrote in the 24th comment:
Votes: 0
I'm using the QuickMud- ROM.. so I do most of my editing online on the actual mud..

How can I add capability to use "aff2 <flag>" in MEDITand OEDIT?
26 Mar, 2009, boblinski wrote in the 25th comment:
Votes: 0
Simply posting to get it back to the top of the pile :blues:

Any help with the previous question?
26 Mar, 2009, Davion wrote in the 26th comment:
Votes: 0
Look at the way it's done with aff, and just copy/paste but of course, changing all references of aff, to aff2. Should all be in olc_act.c

edit:
Definitely in olc_act.c. Look at medit_affect. Looks like oedit uses oedit_addapply which is dynamic. Assuming you'v added to the apply_types[] table, it should already have the ability to modify affect2.
14 Apr, 2009, boblinski wrote in the 27th comment:
Votes: 0
Sharmair said:
The area file would have the F too, so it would have the two lines:
F
E 0 0 A

This effect would add the affected2_by flag to a character wearing the object (and remove
the flag when the object is removed). This syntax only works in the object section of the
area file (not the mob section).

If you want a mob to pop with an affected2_by flag, you will have to extend the area file
format to handle that too (again, I am assuming your snippet does not do this). Most of
the stock ROM area file format for the mob section is quite rigid and would require changes
to the loading code to handle both existing area files and your new format that I would
rather not get into right now (this is yet another reason I think the extended bitvector
system is a better approach). There is one flexible place in the mob section though. In
stock, this section currently only handles removing bits for a number of flag sets that the
race might set that you don't want on the mob, and uses the tag prefix of F. This section
is at the end of the mob info if it exists at all. This code is from the end of load_mobiles()
in db2.c with changes to take a new E tagged option for affected2_by and also adding in
race aff2 and adding to the remove bit section:
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;
}
}

This assumes you have an affected2_by type member in the race data called aff2 and you
want to auto set mobs with that. If you don't have the race data or you don't want to auto
set mobs with it, you can remove the 2af option from the remove flag part and have the E
option just be:
}else if(letter == 'E')
pMobIndex->affected2_by = fread_flag(fp);

If you do have the race data, any E options should come before any F sections though.
As an example of the format, here is Hera, mob 921 from the stock olympus.are with your
flag added at the end:
#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

As far as you having to manually edit the area files, if you are using stock ROM, yes. If
you are using a base code with OLC added, or you have added OLC yourself, then you
will also have to add support for editing and writing the new affected2_by related things
in the OLC and can use that to edit instead of manually editing.

(firstly, I've been moving house and had trouble getting my internet back.. hence my lack of questions :biggrin:)

Anywho, I'm trying to add the ability to have "E A" added in the mob part of my area… I added that part you showed me from load_mobiles()…

And I've editted one of my mobs to have "E A" in it like so:
#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


However when I start my mud, the mobile is not affected by camo…->

Quote
Name: testifa
Vnum: 1295 Format: new Race: human Group: 0 Sex: male Room: 1295
Count: 1 Killed: 0
Str: 18(18) Int: 18(18) Wis: 18(18) Dex: 18(18) Con: 18(18)
Hp: 687/687 Mana: 239/239 Move: 100/100 Practices: 0
Lv: 30 Class: mobile Align: 100 Gold: 19 Silver: 490 Exp: 0
Armor: pierce: -120 bash: -120 slash: -120 magic: -30
Hit: 22 Dam: 18 Saves: 0 Size: medium Position: standing Wimpy: 0
Damage: 5d6 Message: punch
Fighting: (none)
Carry number: 1 Carry weight: 5
Act: npc sentinel
Comm: no_shout no_tell no_channels
Offense: bash dodge kick
Immune: cold
Resist: acid poison
Vulnerable: summon fire negative
Form: poison magical instant_rot other animal undead construct mist mammal
Parts: head arms legs heart
Affected by sanctuary
Master: (none) Leader: (none) Pet: (none)
Short description: mr testifa S
Long description: Mr testifa stands here looking about the arena L
Mobile has special procedure spec_patrolman.
Spell: 'sanctuary' modifies none by 0 for -1 hours with bits sanctuary, level 30.


Any ideas?
14 Apr, 2009, Sharmair wrote in the 28th comment:
Votes: 0
Ok, doing a quick scan of the thread here to refresh what has been covered, I see in post 3
Skol covered adding affected2_by to the mob index data (though I still think flags should
be unsigned int). The code I gave for supporting the area mob load should set the index
affected2_by, but you will have to make sure the code that creates a mob transfers the
data into the instance of the mob (the CHAR_DATA) in create_mobile() in db.c. Also, make
sure the stat command is actually displaying the affected2_by data so you can see it
(though, if you have already been setting characters you probably do have this).
14 Apr, 2009, boblinski wrote in the 29th comment:
Votes: 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;
}


I've added those two lines to the the create_mobile() part of the code.. is that right? It compiles alright, but doesn't seem to be working still…
14 Apr, 2009, Skol wrote in the 30th comment:
Votes: 0
The old format section of that will NOT have an affected2_by in the pMobIndex.

in :/* read in old format and convert */
This won't be a problem as it will come in as 0 and not aff2 by anything etc.
So remove that line. Other than that it looks right.
15 Apr, 2009, boblinski wrote in the 31st comment:
Votes: 0
Alright, I removed affect2_by part from the 'old format section'…

However the affects are still not showing when I stat the mob or when I look at them [should see (camo) beside there name] or even when I 'switch' into the mob and type 'affects'.
15 Apr, 2009, Sharmair wrote in the 32nd comment:
Votes: 0
boblinski said:
Alright, I removed affect2_by part from the 'old format section'…

However the affects are still not showing when I stat the mob or when I look at them [should see (camo) beside there name] or even when I 'switch' into the mob and type 'affects'.

I would not expect the affects command to show it, as it is not a skill/spell effect, but an intrinsic
property of the mob.

To check the other places it should show the affected2_by data, show us the parts of the stat
command and (I think it is) show_char_to_char_0 function that displays the affected2_by
data.
15 Apr, 2009, boblinski wrote in the 33rd comment:
Votes: 0
This is what I have in act_wiz.c under do_mstat():
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);
}



This is act_info.c under void show_char_to_char_0():
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;
}


Is this what you wanted to see? If not, let me know.
17 Apr, 2009, boblinski wrote in the 34th comment:
Votes: 0
Okay, I was just wondering… instead of adding affect2 to my code, can I just do this in merc.h:

/* 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)


And then simply have more affects defined rather then having to have affect2 defines…
/*
* 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)


Can anyone give me the pro's and con's of this method?
17 Apr, 2009, Davion wrote in the 35th comment:
Votes: 0
#define ff    ((uint64_t)1 << 31)
#define gg ((uint64_t)1 << 32)
#define hh ((uint64_t)1 << 33)


This is technically wrong. There's really no reason for you to cast a literal constant (unless comparing it with a variable of different size and signedness, also probably not the best idea). The problem here isn't the constants (dd, ee, A, B, C, etc) it's the variable that 'contains' them. When you think of your standard 32bit integer, think of it instead of one integer, as 32 bits (or something like a 32-node array). So an example

#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;
}

Here, you have your 32bit int defined, and you're trying to shift 33bits left on something that ends at 32. And this is where your problem lies. If you want 64 bits, then you'd, of course, have to use a 64bit integer. So, to correct this

#define hh (1 << 33 )
void main()
{ uint64_t value;
SET_BIT(value, hh)
return;
}
17 Apr, 2009, boblinski wrote in the 36th comment:
Votes: 0
Alright, so will the idea I had not possibly work?
17 Apr, 2009, Davion wrote in the 37th comment:
Votes: 0
No. It wont work unless variables like ch->affected_by, ch->affected_by2 are uint64_t.
18 Apr, 2009, boblinski wrote in the 38th comment:
Votes: 0
And by that you mean… changing the last line of this: ->
/*
* 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;


To this: ->
uint64_t		  affected_by;

?
18 Apr, 2009, Skol wrote in the 39th comment:
Votes: 0
Bob, did you want me to just re-write the affect 2 snippet into one that goes in more easily?
I haven't looked at it, but it seems like it's either written at a higher level, or not written well as far as commenting and 'step by step'.
18 Apr, 2009, boblinski wrote in the 40th comment:
Votes: 0
I guess so… If the last idea of mine was going to work I might stop using affect2 and adopt that method.

If you are re-writting the snippet.. could you include ability to add affects to mobs and objs via olc?
20.0/47