本文整理汇总了C++中skill_lookup函数的典型用法代码示例。如果您正苦于以下问题:C++ skill_lookup函数的具体用法?C++ skill_lookup怎么用?C++ skill_lookup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了skill_lookup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ready_heal_room
/* returns false if mob needed to cast a room affect spell */
bool ready_heal_room( CHAR_DATA * ch )
{
bool ready = TRUE;
if ( ( !IS_SET( ch->in_room->affected_by, ROOM_BV_HEAL_REGEN ) ) && ( ch->hit < ch->max_hit * 75 / 100 ) )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "healing light" ) ) )
{
ready = FALSE;
do_cast( ch, "'healing light'" );
return ready;
}
}
if ( ( !IS_SET( ch->in_room->affected_by, ROOM_BV_MANA_REGEN ) ) && ( ch->mana < ch->max_mana * 75 / 100 ) )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "mana flare" ) ) )
{
ready = FALSE;
do_cast( ch, "'mana flare'" );
return ready;
}
}
return ready;
}
示例2: spell_cure_blindness
void Character::spell_cure_blindness (int sn, int lvl, void *vo)
{
Character *victim = (Character *) vo;
if (!victim->has_affect(skill_lookup("blindness")))
return;
victim->affect_strip (skill_lookup("blindness"));
victim->send_to_char ("Your vision returns!\r\n");
if (this != victim)
send_to_char ("Ok.\r\n");
return;
}
示例3: spell_remove_curse
void Character::spell_remove_curse (int sn, int lvl, void *vo)
{
Character *victim = (Character *) vo;
if (victim->has_affect(skill_lookup("curse"))) {
victim->affect_strip (skill_lookup("curse"));
victim->send_to_char ("You feel better.\r\n");
if (this != victim)
send_to_char ("Ok.\r\n");
}
return;
}
示例4: dragon
/*
* Core procedure for dragons.
*/
bool dragon( CHAR_DATA *ch, char *spell_name )
{
CHAR_DATA *victim;
CHAR_DATA *v_next;
int sn;
if ( ch->position != POS_FIGHTING
&& ch->position != POS_EVASIVE
&& ch->position != POS_DEFENSIVE
&& ch->position != POS_AGGRESSIVE
&& ch->position != POS_BERSERK
)
return FALSE;
for ( victim = ch->in_room->first_person; victim; victim = v_next )
{
v_next = victim->next_in_room;
if ( who_fighting( victim ) == ch && number_bits( 2 ) == 0 )
break;
}
if ( !victim )
return FALSE;
if ( ( sn = skill_lookup( spell_name ) ) < 0 )
return FALSE;
(*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
return TRUE;
}
示例5: group_add
/* use for processing a skill or group for addition */
void group_add( CHAR_DATA *ch, const char *name, bool deduct)
{
int sn = skill_lookup(name);
int gn = group_lookup(name);
if (IS_NPC(ch)) /* NPCs do not have skills */
return;
if (sn != -1)
{
if (ch->pcdata->learned[sn] == 0) /* i.e. not known */
{
ch->pcdata->learned[sn] = 1;
if (deduct)
ch->pcdata->points += skill_table[sn].rating[ch->iclass];
}
return;
}
/* now check groups */
if (gn != -1)
{
if (ch->pcdata->group_known[gn] == FALSE)
{
ch->pcdata->group_known[gn] = TRUE;
if (deduct)
ch->pcdata->points += group_table[gn].rating[ch->iclass];
}
gn_add(ch,gn); /* make sure all skills in the group are known */
}
}
示例6: can_see_help
int can_see_help(CHAR_DATA *ch, MYSQL_ROW row, bool fOnlyResult)
{
int sn = skill_lookup(row[2]);
if(!str_cmp(row[2],"olc"))
{
if(ch->pcdata->security > 0)
return TRUE;
else
return FALSE;
}
if(atoi(row[3]) > ch->level && ch->level > 0)
return FALSE;
if(atoi(row[3]) == 51 && (!str_cmp(row[2],"heroimm") && !IS_HEROIMM(ch)))
return FALSE;
if(sn > 1 && get_skill(ch,sn) < 1)
{
send_to_char("Viewing that helpfile requires a skill you do not have.\n\r",ch);
return FALSE;
}
return TRUE;
}
示例7: do_chaosblast
void do_chaosblast(CHAR_DATA *ch, char *argument) {
CHAR_DATA *victim;
char arg [MAX_INPUT_LENGTH];
int sn;
int level;
int spelltype;
argument = one_argument( argument, arg );
if (IS_NPC(ch)) return;
if (!IS_CLASS(ch, CLASS_DROW) || (!IS_SET(ch->special,
SPC_DROW_MAG) && ch->generation > 2)) {
return;}
if ( ( victim = get_char_room( ch, arg ) ) == NULL )
if ((victim = ch->fighting) == NULL)
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if (ch->mana < 750) {
send_to_char("You don't have enough mana.\n\r", ch);
return;}
if ( ( sn = skill_lookup( "chaos blast" ) ) < 0 ) return;
spelltype = skill_table[sn].target;
level = ch->spl[spelltype]/3;
act("You concentrate your power on $N.",ch,NULL,victim,TO_CHAR);
act("$n concentrates $s power on you.",ch,NULL,victim,TO_VICT);
(*skill_table[sn].spell_fun) ( sn, level, ch, victim );
WAIT_STATE( ch, 12 );
ch->mana = ch->mana - 750;
return;
}
示例8: do_harmony
void do_harmony( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *victim;
char arg[MAX_INPUT_LENGTH];
int sn, level;
argument = one_argument( argument, arg );
if (IS_NPC(ch)) return;
if (!IS_CLASS(ch, CLASS_ANGEL))
{
send_to_char("Huh?\n\r",ch);
return;
}
if (ch->pcdata->powers[ANGEL_HARMONY] < 5)
{
send_to_char("Your not in contact with your inner harmonies.\n\r",ch);
return;
}
if ((victim = get_char_room(ch, arg)) == NULL)
{
send_to_char("They are not here.\n\r", ch);
return;
}
level = number_range(100,200);
sn = skill_lookup("spirit kiss");
if (sn > 0) (*skill_table[sn].spell_fun) (sn,level,ch,victim);
WAIT_STATE(ch,12);
return;
}
示例9: group_add
/* use for processing a skill or group for addition */
void group_add( CHAR_DATA *ch, const char *name, bool deduct)
{
int sn,gn;
if (IS_NPC(ch)) /* NPCs do not have skills */
return;
sn = skill_lookup(name);
if (sn != -1 && sn != gsn_gladiator_skill && sn != gsn_duelist_skill &&
sn != gsn_barbarian_skill && sn != gsn_dragoon_skill && sn != gsn_skirmisher_skill &&
sn != gsn_tactician_skill)
{
if (ch->pcdata->learned[sn] == 0)
{
ch->pcdata->learned[sn] = 1;
}
return;
}
/* now check groups */
gn = group_lookup(name);
if (gn != -1)
{
if (ch->pcdata->group_known[gn] == FALSE)
{
ch->pcdata->group_known[gn] = TRUE;
}
gn_add(ch,gn); /* make sure all skills in the group are known */
}
}
示例10: do_new_prereq
void do_new_prereq (CHAR_DATA *ch, char *argy)
{
SPELL_DATA *spell;
int i;
DEFINE_COMMAND ("zprerequisite", do_new_prereq, POSITION_DEAD, 0, LOG_NORMAL, "Allows you to see prerequisites to the skill-big tree format.")
if (IS_MOB (ch))
return;
for (i = 0; i < 100; i ++)
vert_line[i] = FALSE;
for (i = 0; i < SKILL_COUNT; i++)
used_spell[i] = FALSE;
if (argy[0] == '\0' || (spell = skill_lookup (argy, -1)) == NULL)
{
send_to_char ("Syntax: Prereq <skill/spell/prof name>\n\r", ch);
return;
}
xprereq(ch, spell);
/* Now clean up our static bool */
return;
}
示例11: how_good
char *
how_good (CHAR_DATA *ch, int gsn)
{
static char bf[256];
int i;
int learned = 0;
SPELL_DATA *spl;
bf[0] = '\0';
if (IS_MOB(ch))
{
strcpy (bf, "No Mobs Plz");
return bf;
}
if ((spl = skill_lookup(NULL, gsn)) == NULL)
{
strcpy (bf, "No spell!");
return (bf);
}
else
{
if (learned != 100)
learned = ch->pcdata->learned[gsn];
for (i = 0; i < 20; i++)
{
if (pow.learned[i] != NULL && learned >= pow.low_range[i] && learned <= pow.high_range[i])
{
strcpy (bf, pow.learned[i]);
return (bf);
}
}
}
return bf;
}
示例12: power_up_mob
void power_up_mob( CHAR_DATA * ch )
{
int num_percent;
/*
* you can only have one cloak spell
*/
if ( !IS_AFFECTED( ch, AFF_CLOAK_ABSORPTION )
&& !IS_AFFECTED( ch, AFF_CLOAK_REFLECTION ) && !IS_AFFECTED( ch, AFF_CLOAK_FLAMING ) )
{
num_percent = number_percent( );
if ( num_percent > 75 )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "cloak:flaming" ) ) )
do_cast( ch, "'cloak:flaming'" );
return;
}
if ( num_percent > 50 )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "cloak:reflection" ) ) )
do_cast( ch, "cloak:reflection" );
return;
}
if ( num_percent > 25 )
{
if ( ch->mana >= mana_cost( ch, skill_lookup( "cloak:absorption" ) ) )
do_cast( ch, "cloak:absorption" );
return;
}
}
/*
* usually i only have mobs do one thing per round but what they hell
* * let the kids have their fun :)
*/
if ( !IS_AFFECTED( ch, AFF_SANCTUARY ) )
if ( ch->mana >= mana_cost( ch, skill_lookup( "sanctuary" ) ) )
do_cast( ch, "sanctuary" );
if ( !IS_AFFECTED( ch, AFF_PROTECT ) )
if ( ch->mana >= mana_cost( ch, skill_lookup( "protection" ) ) )
do_cast( ch, "protection" );
if ( !IS_AFFECTED( ch, skill_lookup( "bless" ) ) )
if ( ch->mana >= mana_cost( ch, skill_lookup( "bless" ) ) )
do_cast( ch, "bless" );
if ( !IS_AFFECTED( ch, skill_lookup( "stone skin" ) ) )
if ( ch->mana >= mana_cost( ch, skill_lookup( "stone skin" ) ) )
do_cast( ch, "stone" );
return;
}
示例13: check_style_improve
/* check improve for styles */
void check_style_improve( CHAR_DATA *ch, int style, int multiplier )
{
int chance,sn,skill,gn,i;
char test[MSL];
if(style == 0 || style >= 100)
return;
sn = skill_lookup( style_table[style].name );
chance = 10 * int_app[get_curr_stat(ch,STAT_INT)].learn;
chance /= ( multiplier
* 4);
chance += ch->level * 2;
if(number_range(1,1000) > chance)
return;
ch->pcdata->learned[sn]++;
if(ch->pcdata->learned[sn] > 100)
ch->pcdata->learned[sn] = 100;
/* check for newly learned style skills */
for(i=0; i<MAX_STYLE_SKILL; i++)
{
skill = skill_lookup(style_percent[i].name);
if(skill > 0)
{
gn = gn_skill_lookup(skill);
if(gn > 1)
{
if(!str_prefix(group_table[gn].name,style_table[style].name))
{
if(ch->pcdata->learned[sn] == style_percent[i].percent)
{
sprintf(test,"%sYou make a breakthrough in your understanding of the %s style!%s",
get_char_color(ch, "lightyellow"), style_table[style].name, END_COLOR(ch));
act(test,ch,0,0,TO_CHAR);
sprintf(test,"You feel ready to learn the %s skill.",style_percent[i].name);
act(test,ch,0,0,TO_CHAR);
}
}
}
}
}
}
示例14: handle_reaction
void handle_reaction(CHAR_DATA *ch, CHAR_DATA *victim)
{
if(skill_lookup("counter") == victim->reaction_num)
{
if(number_range(1,100) < 60)
f_multi_hit( victim, ch, TYPE_UNDEFINED );
}
}
示例15: spec_cast_cleric
bool spec_cast_cleric( CHAR_DATA *ch )
{
CHAR_DATA *victim;
CHAR_DATA *v_next;
char *spell;
int sn;
summon_if_hating( ch );
if ( ch->position != POS_FIGHTING
&& ch->position != POS_EVASIVE
&& ch->position != POS_DEFENSIVE
&& ch->position != POS_AGGRESSIVE
&& ch->position != POS_BERSERK
)
return FALSE;
for ( victim = ch->in_room->first_person; victim; victim = v_next )
{
v_next = victim->next_in_room;
if ( who_fighting( victim ) == ch && number_bits( 2 ) == 0 )
break;
}
if ( !victim || victim == ch )
return FALSE;
for ( ;; )
{
int min_level;
switch ( number_bits( 4 ) )
{
case 0: min_level = 0; spell = "cause light"; break;
case 1: min_level = 3; spell = "cause serious"; break;
case 2: min_level = 6; spell = "earthquake"; break;
case 3: min_level = 7; spell = "blindness"; break;
case 4: min_level = 9; spell = "cause critical"; break;
case 5: min_level = 10; spell = "dispel evil"; break;
case 6: min_level = 12; spell = "curse"; break;
case 7: min_level = 13; spell = "flamestrike"; break;
case 8:
case 9:
case 10: min_level = 15; spell = "harm"; break;
default: min_level = 16; spell = "dispel magic"; break;
}
if ( ch->level >= min_level )
break;
}
if ( ( sn = skill_lookup( spell ) ) < 0 )
return FALSE;
(*skill_table[sn]->spell_fun) ( sn, ch->level, ch, victim );
return TRUE;
}