bool is_affected2 (CHAR_DATA * ch, int sn)
{
AFFECT_DATA *paf;
for (paf = ch->affected2; paf != NULL; paf = paf->next)
{
if (paf->type == sn)
return TRUE;
}
return FALSE;
}
/*
* Character macros.
*/
#define IS_NPC(ch) (IS_SET((ch)->act, ACT_IS_NPC))
#define IS_IMMORTAL(ch) (get_trust(ch) >= LEVEL_IMMORTAL)
#define IS_HERO(ch) (get_trust(ch) >= LEVEL_HERO)
#define IS_TRUSTED(ch,level) (get_trust((ch)) >= (level))
#define IS_AFFECTED(ch, sn) (IS_SET((ch)->affected_by, (sn)))
#define IS_AFFECTED2(ch, sn) (IS_SET((ch)->affected2_by, (sn))) /*affect2*/
DECLARE_DO_FUN( do_creep );
/*
* Bits for 'affected2_by'.
* Used in #MOBILES.
*/
#define AFF_CAMOFLAGUE (A)
#define AFF_FOCUS (B)
#define AFF_CREEP (C)
//and further down
extern sh_int gsn_creep;
// in 'void move_char'
if (IS_AFFECTED2(ch, AFF_CREEP)
&& (to_room->sector_type == SECT_AIR
|| to_room->sector_type == SECT_CITY
|| to_room->sector_type == SECT_INSIDE
|| to_room->sector_type == SECT_WATER_SWIM
|| to_room->sector_type == SECT_WATER_NOSWIM
|| to_room->sector_type == SECT_UNUSED
|| to_room->sector_type == SECT_DESERT))
{
affect_strip (ch, gsn_creep);
REMOVE_BIT (ch->affected2_by, AFF_CAMOFLAGUE);
REMOVE_BIT (ch->affected2_by, AFF_CREEP);
send_to_char ("Your movement becomes more noticeable.\n\r", ch);
}
//and further down
void do_creep (CHAR_DATA * ch, char *argument)
{
AFFECT_DATA af;
send_to_char ("You try to make your movements go unnoticed.\n\r", ch);
affect_strip (ch, gsn_creep);
if (IS_AFFECTED2 (ch, AFF_CREEP))
return;
if (number_percent () < get_skill (ch, gsn_creep))
{
check_improve (ch, gsn_creep, TRUE, 3);
af.where = TO_AFFECTS;
af.type = gsn_creep;
af.level = ch->level;
af.duration = ch->level;
af.location = APPLY_NONE;
af.modifier = 0;
af.bitvector = AFF_CREEP;
affect_to_char (ch, &af);
}
else
check_improve (ch, gsn_creep, FALSE, 3);
return;
}
{
"creep", {53, 53, 4, 10}, {0, 0, 4, 6},
spell_null, TAR_IGNORE, POS_STANDING,
&gsn_creep, SLOT (0), 0, 12,
"", "Your movement becomes more noticeable.", ""},
sh_int gsn_creep;
//in 'int get_skill'
else if (sn == gsn_creep || sn == gsn_camoflague)
skill = ch->level * 2 + 20;
//and further down
//in 'char *affect2_bit_name'
if (vector & AFF_CREEP)
strcat (buf, " creep");
{"creep", do_creep, POS_STANDING, 0, LOG_NORMAL, 1},
//in 'const struct flag_type affect2_flags'
{"creep", C, TRUE},
#define TO_AFFECTS2 6
case TO_AFFECTS2:
SET_BIT(ch->affected2_by, paf->bitvector);
break;
af.where = TO_AFFECTS2;
Creep is basically an exact copy of Sneak, except it works in different areas.. I can't seem to figure out why it's not working right because I copied it from sneak part by part..
I'm not having any trouble compiling.. it's just that when I -move- (n, s, e, w, u, d) creep should fail depending on the sector type of the new room..
Here's the code:
But, if I 'creep' and move from a SECT_FOREST room to a SECT_CITY room.. it tells me I'm still creeping.