char buf[MAX_STRING_LENGTH];
int skill, percent;
skill = get_skill (ch, gsn_read_thoughts);
percent = number_percent();
// I added returns to the next part just so it's more readable.
sprintf (buf, "Your read thoughts skill is %d, percent was %d (-10 = %d). "
"You %s the check.\r\n", skill, percent, percent - 10,
skill >= percent - 10 ? "passed" : "failed");
send_to_char (buf, ch);
// The actual code to DO whatever read thoughts does goes here
if (skill >= percent - 10)
{
// Do the success stuff
}
else
{
// The fail stuff here
}
void do_think (CHAR_DATA *ch, char *argument)
{
DESCRIPTOR_DATA *d;
CHAR_DATA *vch;
char buf[MAX_STRING_LENGTH];
if (argument[0] == '\0')
{
send_to_char ("What are you thinking?\n\r", ch);
return;
}
sprintf(buf, "{6%s thinks '{7%s{6'{x\n\r", ch->name, argument);
for(d = descriptor_list; d != NULL; d = d->next)
{
if( d->connected == CON_PLAYING
&& IS_IMMORTAL(d->character) )
{
send_to_char(buf, d->character);
}
}
for(vch = ch->in_room->people; vch != NULL; vch = vch->next_in_room)
{
if (vch->level < 52
&& vch->name != ch->name)
{
if(get_skill(vch, gsn_read_thoughts) > 1
&& get_curr_stat(vch, STAT_INT) >= get_curr_stat(ch, STAT_INT)
&& get_skill(vch, gsn_read_thoughts) > number_percent()
&& vch->level+2 >= ch->level)
{
send_to_char(buf, vch);
check_improve (vch, gsn_read_thoughts, TRUE, 2);
}
}
}
act ("{6You think '{7$T{6'{x", ch, NULL, argument, TO_CHAR);
return;
}
get_skill(vch, gsn_read_thoughts)-10 >= number_percent()
&& get_skill(vch, gsn_read_thoughts) > number_percent()
get_skill(vch,gsn_read_thoughts)Then it is comparing this number to see if it is > than
number_percent()which generates a random number from 1-100.
if (*class_table[ch->class].name == ranger
&& ch->in_room->sector_type == SECT_FOREST) /*line 73*/
{
if (ch->level < 13)
{
shallow = 2;
}
else if (ch->level < 26)
{
shallow = 3;
}
else if (ch->level < 39)
{
shallow = 4;
}
else
shallow = 5;
}
if (*class_table[ch->class].name == ranger
&& ch->in_room->sector_type == SECT_FOREST) /*line 73
if (class_table[ch->class].name == "ranger"
&& ch->in_room->sector_type == SECT_FOREST) /*line 73
if( !strcasecmp(class_table[ch->class].name, "ranger") && ch->in_room->sector_type == SECT_FOREST)
#define IS_PRIEST(ch) ( ch->class == 17 )
#define IS_BERSERKER(ch)( ch->class == 18 )
#define IS_MFIGHTER(ch) ( ch->class == 19 )
#define IS_DRAGOON(ch) ( ch->class == 20 )
#define IS_KENSAI(ch) ( ch->class == 21 )
#define IS_HUMAN(ch) (ch->race == 1)
#define IS_GUADO(ch) (ch->race == 2)
#define IS_CETRA(ch) (ch->race == 3)
#define IS_MOOGLE(ch) (ch->race == 4)
#define IS_ROBOT(ch) (ch->race == 5)
#define IS_RONSO(ch) (ch->race == 6)
#define IS_BEAST(ch) (ch->race == 7)
#define IS_REPTITE(ch) (ch->race == 8)
#define IS_DWARF(ch) (ch->race == 9)
# if (IS_RANGER(ch) && ch->in_room->sector_type == SECT_FOREST) /*line 73*/
if (ch->level < 13)
{
shallow = 2;
}
else if (ch->level < 26)
{
shallow = 3;
}
else if (ch->level < 39)
{
shallow = 4;
}
else
shallow = 5;
if (*class_table[ch->class].name == ranger
&& ch->in_room->sector_type == SECT_FOREST)
if (ch->class == class_lookup("ranger"))
&& ch->in_room->sector_type == SECT_FOREST)
I've got a new skill called "read thoughts" it's an automatic skill, and I want it to be successful in reading peoples "thinks" the amount of their skill % minus 10 percent..
this is what I have:
But it seems not to take into account the '-10' and seems to work simply the the skill% alone.