本文整理汇总了C++中CHAR_getInt函数的典型用法代码示例。如果您正苦于以下问题:C++ CHAR_getInt函数的具体用法?C++ CHAR_getInt怎么用?C++ CHAR_getInt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CHAR_getInt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NPC_CHECKFREEPETSKILL
BOOL NPC_CHECKFREEPETSKILL( int toindex, int petindex, int skillID)
{
int skillindex=-1;
char SCode[256];
char Free[256];
int i, petID;
skillindex = PETSKILL_getPetskillArray( skillID );
memset( Free, 0, sizeof( Free));
if( !PETSKILL_CHECKINDEX( skillindex) ) {
return FALSE;
}
petID = CHAR_getInt( petindex, CHAR_PETID);
sprintf( SCode, "%s", PETSKILL_getChar( skillindex, PETSKILL_KINDCODE));
sprintf( Free, "%s", PETSKILL_getChar( skillindex, PETSKILL_FREE));
//CHECK CODE
if( !strcmp( SCode, "\0")) {
return TRUE;
}
for( i=0; i<arraysizeof( Code_skill); i++) {
if( Code_skill[i].PetId == petID ) {
break;
}
}
//找不到这只宠物
if( i == arraysizeof( Code_skill) ) {
{
char buff1[256];
sprintf( buff1, "%s不能学特殊技能!!", CHAR_getChar( petindex, CHAR_NAME));
CHAR_talkToCli( toindex, -1, buff1, CHAR_COLORYELLOW);
}
return FALSE;
}
if( strstr( Code_skill[i].Code, SCode ) != NULL ) {
if( NPC_SkillShopPetCheck( toindex, petindex, skillID) == FALSE ) {
char buff1[256];
sprintf( buff1, "%s现在还不能学%s!", CHAR_getChar( petindex, CHAR_NAME),
PETSKILL_getChar( skillindex, PETSKILL_NAME) );
CHAR_talkToCli( toindex, -1, buff1, CHAR_COLORYELLOW);
return FALSE;
}
return TRUE;
}else {
char buff1[256];
sprintf( buff1, "%s不能学%s!!", CHAR_getChar( petindex, CHAR_NAME),
PETSKILL_getChar( skillindex, PETSKILL_NAME) );
CHAR_talkToCli( toindex, -1, buff1, CHAR_COLORYELLOW);
}
return FALSE;
}
示例2: NPC_EventSetFlg
/* 奶矛件玄蔽
* 申永玄白仿弘毛 化月分仃及質
*/
void NPC_EventSetFlg(int talker,int shiftbit)
{
int point=0;
int array;
int shift;
#ifdef _TEACHER_SYSTEM
int iGetFame = 0;
#endif
/*-- -1反白仿弘卞楮溢互卅中奶矛件玄 -*/
if(shiftbit==-1) return;
array = shiftbit / 32;
shift = shiftbit % 32;
point = CHAR_getInt( talker, CHAR_ENDEVENT+array);
// Arminius 8.24 prevent wash dp
if (!(point & (1 << shift))) {
// CoolFish: Family Adv 2001/8/4
AddFMAdv(talker, shiftbit);
#ifdef _TEACHER_SYSTEM
if(shiftbit < arraysizeof(FMAdvTbl)) iGetFame = FMAdvTbl[shiftbit];
#endif
}
#ifdef _TEACHER_SYSTEM
iGetFame /= 20; // 導師獲得學生所得聲望的 5% (1/20)
// 檢查所得的聲望有沒有大於0
if(iGetFame > 0){
// 檢查有沒有導師
if(strlen(CHAR_getChar(talker,CHAR_TEACHER_ID)) > 0 && strlen(CHAR_getChar(talker,CHAR_TEACHER_NAME)) > 0){
int iPlayernum = CHAR_getPlayerMaxNum(),i;
char szMsg[128];
// 檢查導師在不在線上
for(i=0;i<iPlayernum;i++){
if(CHAR_getCharUse(i) == FALSE) continue;
if(strcmp(CHAR_getChar(talker,CHAR_TEACHER_ID),CHAR_getChar(i,CHAR_CDKEY)) == 0 &&
strcmp(CHAR_getChar(talker,CHAR_TEACHER_NAME),CHAR_getChar(i,CHAR_NAME)) == 0){
float fGetFame = (float)iGetFame/100;
// 導師在線上
CHAR_setWorkInt(i,CHAR_WORK_GET_TEACHER_FAME,CHAR_getWorkInt(i,CHAR_WORK_GET_TEACHER_FAME) + iGetFame);
sprintf(szMsg,"獲得學生 %s %.2f 點聲望",CHAR_getChar(talker,CHAR_NAME),fGetFame);
CHAR_talkToCli(i,-1,szMsg,CHAR_COLORYELLOW);
break;
}
}
}
}
#endif
point = point | (1 << shift);
CHAR_setInt( talker, CHAR_ENDEVENT+array, point);
}
示例3: Check_EnemyWarpMe
void Check_EnemyWarpMe( int meindex, char *args )
{
char buf1[256];
int objindex,index;
int nfl, nx, ny;
OBJECT obj;
memset( buf1, 0, sizeof( buf1));
if( NPC_Util_GetStrFromStrWithDelim( args, "REPLACEMENT", buf1, sizeof( buf1)) == NULL ) {
return;
}
GetRand_WarpPoint( buf1, &nfl, &nx, &ny );
if( MAP_IsValidCoordinate( nfl, nx, ny ) == FALSE ){
char filename[256];
NPC_Util_CheckAssignArgFile( meindex, filename);
print( "NPCENEMY REPLACEMENT: %s .Invalid POINT( %d, %d, %d)\n", filename, nfl, nx, ny );
return;
}
{
int ofl, ox, oy;
ofl = CHAR_getInt( meindex, CHAR_FLOOR );
ox = CHAR_getInt( meindex, CHAR_X );
oy = CHAR_getInt( meindex, CHAR_Y );
for ( obj=MAP_getTopObj( nfl, nx, ny); obj; obj=NEXT_OBJECT( obj) ) {
objindex = GET_OBJINDEX( obj);
if (OBJECT_getType( objindex) != OBJTYPE_CHARA) continue;
index = OBJECT_getIndex( objindex);
if( CHAR_getInt( index, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER &&
CHAR_getWorkInt( index, CHAR_WORKEVENTTYPE) != CHAR_TYPEPET ) {
CHAR_warpToSpecificPoint( index, ofl, ox, oy);
CHAR_sendCToArroundCharacter( objindex);
break;
}
}
}
objindex = CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX);
CHAR_warpToSpecificPoint( meindex, nfl, nx, ny);
CHAR_sendCToArroundCharacter( objindex);
}
示例4: NPC_CharmUp
/*-- --*/
void NPC_CharmUp(int meindex,int talker)
{
int cost;
int i;
int petindex;
char petsend[64];
/*--云嗯毛蛹日仄引仄斤丹--*/
cost = NPC_CharmCost( meindex, talker);
CHAR_setInt( talker, CHAR_GOLD,
CHAR_getInt( talker, CHAR_GOLD) - cost);
CHAR_send_P_StatusString( talker, CHAR_P_STRING_GOLD);
/*-- 互ㄠㄟㄟ动晓卞卅月桦宁反雄娄卞ㄠㄟㄟ卞允月--*/
if(CHAR_getInt( talker, CHAR_CHARM) + CHARMHEAL >= 100) {
CHAR_setInt( talker, CHAR_CHARM, 100);
}else{
/*-- 毛本永玄--*/
CHAR_setInt(talker, CHAR_CHARM,
(CHAR_getInt( talker, CHAR_CHARM) + CHARMHEAL));
}
/*--旦 □正旦及凳蕙--*/
CHAR_complianceParameter( talker );
CHAR_send_P_StatusString( talker, CHAR_P_STRING_CHARM);
/*--矢永玄及由仿丢□正毛凳蕙--*/
for( i = 0 ; i < CHAR_MAXPETHAVE ; i++){
petindex = CHAR_getCharPet( talker, i);
if( petindex == -1 ) continue;
/* 平乓仿及 民尼永弁 */
if( !CHAR_CHECKINDEX( talker ) ) continue;
/*--由仿丢□正譬帮--*/
CHAR_complianceParameter( petindex );
sprintf( petsend, "K%d", i );
CHAR_sendStatusString( talker , petsend );
}
}
示例5: PetTalk_CheckMyPet
BOOL PetTalk_CheckMyPet( int meindex, int talker, int petLv, int flg, int petid)
{
int petsel,petindex=-1;
for(petsel=0 ; petsel < CHAR_MAXPETHAVE ; petsel++) {
petindex = CHAR_getCharPet( talker, petsel);
if( petindex == -1 )
continue;
if(CHAR_getInt( petindex, CHAR_PETID) != petid )
continue;
break;
}
if( petsel == CHAR_MAXPETHAVE ) {
return FALSE;
}else { //找到条件宠
if( PetTalk_BigSmallLastCheck( petLv, CHAR_getInt( petindex, CHAR_LV), flg ) == TRUE )
return TRUE;
}
return FALSE;
}
示例6: NPC_NewNpcManTalked
void NPC_NewNpcManTalked( int meindex , int talkerindex , char *msg , int color )
{
char npcarg[NPC_UTIL_GETARGSTR_BUFSIZE];
if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
return;
if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE)
return;
}
if(NPC_Util_GetArgStr( meindex, npcarg, sizeof(npcarg))==NULL){
print("TRANSER_MAN: GetArgStrErr!!");
return;
}
CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 0);
if( CHAR_getInt( talkerindex, CHAR_BASEBASEIMAGENUMBER) != 101578 ){
NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_SELECT1, 0);
return;
}
NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_START, 0);
}
示例7: NPC_NowEndEventSetFlgCls
void NPC_NowEndEventSetFlgCls(int talker, int shiftbit)
{
int point = 0;
int array;
int shift;
if (shiftbit == -1)
return;
array = shiftbit / 32;
shift = shiftbit % 32;
if (NPC_NowEventCheckFlg(talker, shiftbit) == TRUE) {
point = CHAR_getInt(talker, CHAR_NOWEVENT + array);
point = point ^ (1 << shift);
CHAR_setInt(talker, CHAR_NOWEVENT + array, point);
}
if (NPC_EventCheckFlg(talker, shiftbit) == TRUE) {
point = CHAR_getInt(talker, CHAR_ENDEVENT + array);
point = point ^ (1 << shift);
CHAR_setInt(talker, CHAR_ENDEVENT + array, point);
}
}
示例8: NPC_PauctionManTalked
void NPC_PauctionManTalked( int meindex, int talkerindex, char *msg, int color )
{
if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
return;
if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE)
return;
}
CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 0);
NPC_Pauctionman_selectWindow( meindex, talkerindex, WINDOW_START, 0);
}
示例9: NPC_WindowHealerLooked
void NPC_WindowHealerLooked( int meindex , int lookedindex)
{
if( CHAR_getInt( lookedindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
return;
}
if( NPC_Util_CharDistance( lookedindex, meindex )
> CHAR_getWorkInt(meindex,CHAR_WORK_RANGE)){
return;
}
NPC_WindowHealer_selectWindow( meindex, lookedindex,0);
}
示例10: NPC_MakePairManWindowTalked
void NPC_MakePairManWindowTalked( int meindex, int talkerindex, int seqno, int select, char *data)
{
char npcarg[NPC_UTIL_GETARGSTR_BUFSIZE];
if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
return;
memset( npcarg, 0, sizeof( npcarg));
if(NPC_Util_GetArgStr( meindex, npcarg, sizeof(npcarg))==NULL){
print("err NPC_MakePairMan: GetArgStrErr!!");
return;
}
switch( seqno) {
case WINDOW_TALKSTART:
{
int choose=atoi( data);
if( select == WINDOW_BUTTONTYPE_CANCEL || select == WINDOW_BUTTONTYPE_NO)
return;
switch( choose){
case 1://查人数
NPC_MakePair_selectWindow( meindex, talkerindex, WINDOW_USER, 0);
break;
case 2://配对
NPC_MakePair_selectWindow( meindex, talkerindex, WINDOW_PAIR, 0);
break;
case 3://心理测验
NPC_MakePair_selectWindow( meindex, talkerindex, WINDOW_SELECT, 0);
break;
}
}
break;
case WINDOW_TALKSELECT:
{
int title = CHAR_getWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT);
title = NPC_getNextTitle( meindex, talkerindex, npcarg, title, select);
if( title < 0 ) return ;
CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, title);
NPC_MakePair_selectWindow( meindex, talkerindex, WINDOW_SELECT, select);
}
break;
case WINDOW_TALKPAIR://配对邀请回覆
if( select == WINDOW_BUTTONTYPE_CANCEL || select == WINDOW_BUTTONTYPE_NO){
NPC_MakePair_selectWindow( meindex, talkerindex, WINDOW_PAIRNO, 0);
}else {
NPC_MakePair_selectWindow( meindex, talkerindex, WINDOW_PAIROK, 0);
}
break;
case WINDOW_RETURN:
NPC_MakePair_selectWindow( meindex, talkerindex, WINDOW_START, 0);
break;
case WINDOW_TALKEND:
break;
}
}
示例11: NPC_WarpWatch
void NPC_WarpWatch(int meobjindex, int objindex, CHAR_ACTION act, int x, int y, int dir, int *opt, int optlen) {
int meindex, moveindex;
if(OBJECT_getType(objindex) != OBJTYPE_CHARA)return;
meindex = OBJECT_getIndex(meobjindex);
moveindex = OBJECT_getIndex(objindex);
if(CHAR_getInt(moveindex, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER)
return;
if(act != CHAR_ACTWALK)
return;
if(opt[0] == x && opt[1] == y)
return;
if(CHAR_getInt(meindex, CHAR_X) == x && CHAR_getInt(meindex, CHAR_Y) == y) {
NPC_WarpWarpCharacter(meindex, moveindex);
}
}
示例12: MAGIC_Use
int MAGIC_Use( int charaindex, int haveitemindex, int toindex)
{
int itemindex;
int magicid,marray,mp;
int ret;
MAGIC_CALLFUNC func;
itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
if( !ITEM_CHECKINDEX( itemindex) ) return FALSE;
magicid = ITEM_getInt( itemindex, ITEM_MAGICID);
marray = MAGIC_getMagicArray( magicid);
if( marray == -1 ) return FALSE;
func = MAGIC_getMagicFuncPointer( MAGIC_getChar( marray, MAGIC_FUNCNAME));//MAGIC_NAME
if( (mp = ITEM_getInt( itemindex, ITEM_MAGICUSEMP)) < 0 ){
print("err mp:%d -%s-%d\n", mp, ITEM_getChar( itemindex, ITEM_NAME),
ITEM_getInt( itemindex, ITEM_ID) );
}
// shan add begin
if( CHAR_getInt( charaindex, CHAR_FMINDEX ) >= 1 ){
// 光精
if( CHAR_getInt( charaindex, CHAR_FMSPRITE ) == 0){
if( (marray >=0 && marray <=31) || (marray >= 105 && marray <=107 ))
mp *= MP_RATE;
}
// 暗精
if( CHAR_getInt( charaindex, CHAR_FMSPRITE ) == 1){
if( marray >=32 && marray <=81 )
mp *= MP_RATE;
}
}
// shan end
if( func ) {
ret = func( charaindex, toindex, marray, mp );
}else {
ret = FALSE;
}
return ret;
}
示例13: MAGIC_AttSkill
int MAGIC_AttSkill( int charaindex, int toindex,int marray, int mp )
{
int battlemode;
int battleindex=-1;
char *magicarg, funName[256];
int skillID=-1;
PETSKILL_CALLFUNC func;
if( CHAR_CHECKINDEX( charaindex ) == FALSE ) return FALSE;
if( IsBATTLING( charaindex ) == FALSE ) return FALSE;
battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
if( BATTLE_CHECKINDEX( battleindex ) == FALSE ) return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
if( battlemode == BATTLE_CHARMODE_INIT ) return FALSE;
if( toindex < 0 || toindex > 19 ) return FALSE;
if( CHAR_getInt( charaindex, CHAR_MP ) < mp ) return FALSE;
memset( funName, 0, sizeof( char)*256 );
//MAGIC_Recovery_Battle( charaindex, toindex, marray, mp );
magicarg = MAGIC_getChar( marray, MAGIC_OPTION );
if (!magicarg) return FALSE;
if( strstr( magicarg, ";" ) != NULL ) {
char buff1[256];
if( getStringFromIndexWithDelim( magicarg, ";", 1, buff1, sizeof( buff1)) == FALSE )
return FALSE;
snprintf( funName, sizeof(funName), buff1);
if( getStringFromIndexWithDelim( magicarg, ";", 2, buff1, sizeof( buff1)) == FALSE )
return FALSE;
skillID = atoi( buff1);
}else
return FALSE;
func = PETSKILL_getPetskillFuncPointer( funName);
if( !func ){
print("\n *func not FOUND !!");
return FALSE;
}
if( func( charaindex, toindex, skillID, "MAGICSKILL" ) == FALSE ) return FALSE;
CHAR_setInt( charaindex, CHAR_MP, CHAR_getInt( charaindex, CHAR_MP ) - mp );
return TRUE;
}
示例14: CHAR_makeCAOPT1String
BOOL CHAR_makeCAOPT1String( int objindex,char* buf, int buflen, int act,int opt1 )
{
char objindexbuf[64];
if( CHECKOBJECT(objindex) == FALSE ) return FALSE;
if( OBJECT_getType(objindex) != OBJTYPE_CHARA ) return FALSE;
snprintf( buf,buflen,"%s|%d|%d|%d|%d|%d",
cnv10to62( objindex,objindexbuf, sizeof(objindexbuf)),
OBJECT_getX(objindex), OBJECT_getY(objindex),
act,
CHAR_getInt(OBJECT_getIndex(objindex),CHAR_DIR), opt1);
return TRUE;
}
示例15: NPC_FreePetSkillShopTalked
void NPC_FreePetSkillShopTalked( int meindex , int talkerindex , char *szMes ,int color )
{
if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
return;
}
if(NPC_Util_isFaceToFace(talkerindex,meindex,2 )==FALSE){
if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;
}
CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 1 );
NPC_FreePetSkillShop_selectWindow( meindex, talkerindex, START_WINDOW,-1);
}