#include "version.h" #include #include #include #include #include #include #include #include "common.h" #include "char.h" #include "util.h" #include "buf.h" #include "npcutil.h" #include "char_base.h" #include "object.h" #include "char_data.h" #include "handletime.h" #include "chatmagic.h" #include "configfile.h" #include "readmap.h" #include "map_deal.h" #include "lssproto_serv.h" #include "log.h" #include "battle.h" #include "pet.h" #include "enemy.h" #include "encount.h" #include "magic_base.h" #include "magic.h" #include "pet_skill.h" #include "pet_event.h" #include "item_gen.h" #include "mclient.h" #include "npc_eventaction.h" #include "map_warppoint.h" #include "npc_manorsman.h" #include "net.h" #include "saacproto_cli.h" #include "npc_scheduleman.h" #include "trade.h" #include "npccreate.h" #ifdef _DEATH_CONTEND #include "deathcontend.h" #endif #ifdef _CHAR_PROFESSION // WON ADD 人物职业 #include "profession_skill.h" #endif #include "char_talk.h" // WON ADD 修正族长问题 #include "family.h" #include "petmail.h" #ifdef _WON_TEST // WON TEST #include "unpipc.h" #endif // WON ADD 重新读取ITEMSET.TXT #include "item.h" #include "npc_raceman.h" extern tagRidePetTable ridePetTable[146]; extern int *pWorkAttackPower; extern time_t initTime; int *pWorkAttackPower = NULL; struct GMINFO gminfo[GMMAXNUM]; #define LSGENWORKINGBUFFER 65536*4 void CHAR_CHAT_DEBUG_warp( int charindex , char *message ) { char token[100]; int fl,x,y; easyGetTokenFromString( message , 1 , token, sizeof(token)); fl = atoi( token ); easyGetTokenFromString( message , 2 , token , sizeof(token)); x = atoi( token ); easyGetTokenFromString( message , 3 , token , sizeof(token)); y = atoi( token ); CHAR_warpToSpecificPoint(charindex, fl, x, y); } void CHAR_CHAT_DEBUG_hp( int charindex , char *message ) { CHAR_setInt( charindex , CHAR_HP,atoi( message ) ); CHAR_complianceParameter( charindex ); CHAR_send_P_StatusString( charindex , CHAR_P_STRING_HP); } void CHAR_CHAT_DEBUG_setmp( int charindex , char *message ) { int i; char setmp[15]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , setmp, sizeof(setmp)); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt( i , CHAR_MAXMP, atoi( setmp ) ); CHAR_setInt( i , CHAR_MP, atoi( setmp ) ); CHAR_complianceParameter( i ); CHAR_send_P_StatusString( i , CHAR_P_STRING_MP); sprintf( token, "[GM]%s把你的MP设置为%d!", CHAR_getChar( charindex, CHAR_NAME),(int)atoi(setmp)/100); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的MP的设置为%d!", CHAR_getChar( i, CHAR_NAME),(int)atoi(setmp)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt( charindex , CHAR_MAXMP, atoi( setmp ) ); CHAR_setInt( charindex , CHAR_MP, atoi( setmp ) ); CHAR_complianceParameter( charindex ); CHAR_send_P_StatusString( charindex , CHAR_P_STRING_MP); sprintf( token, "MP设置为%d!",(int)atoi(setmp)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_mp( int charindex , char *message ) { int Mymp; CHAR_setInt( charindex , CHAR_MP, atoi( message ) ); Mymp = CHAR_getWorkInt( charindex , CHAR_WORKMAXMP); if( Mymp > CHAR_getWorkInt( charindex , CHAR_WORKMAXMP) ) CHAR_setInt( charindex , CHAR_MP, CHAR_getWorkInt( charindex , CHAR_WORKMAXMP)); CHAR_complianceParameter( charindex ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( charindex , CHAR_P_STRING_MP); } void CHAR_CHAT_DEBUG_str( int charindex , char *message ) { int i; char str[15]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , str, sizeof(str)); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt( i , CHAR_STR,atoi( str ) ); CHAR_complianceParameter( i ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( i ,CHAR_P_STRING_STR|CHAR_P_STRING_MAXHP|CHAR_P_STRING_ATK); sprintf( token, "[GM]%s把你的腕力设置为%d!", CHAR_getChar( charindex, CHAR_NAME),(int)atoi(str)/100); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的腕力设置为%d!", CHAR_getChar( i, CHAR_NAME),(int)atoi(str)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt( charindex , CHAR_STR,atoi( str ) ); CHAR_complianceParameter( charindex ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( charindex ,CHAR_P_STRING_STR|CHAR_P_STRING_MAXHP|CHAR_P_STRING_ATK); sprintf( token, "腕力设置为%d!",(int)atoi(str)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_tgh( int charindex , char *message ) { int i; char tgh[15]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , tgh, sizeof(tgh)); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt( i , CHAR_TOUGH,atoi( tgh ) ); CHAR_complianceParameter( i ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( i ,CHAR_P_STRING_TOUGH|CHAR_P_STRING_MAXHP|CHAR_P_STRING_DEF); sprintf( token, "[GM]%s把你的耐力设置为%d!", CHAR_getChar( charindex, CHAR_NAME),(int)atoi(tgh)/100); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的耐力设置为%d!", CHAR_getChar( i, CHAR_NAME),(int)atoi(tgh)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt( charindex , CHAR_TOUGH,atoi( tgh ) ); CHAR_complianceParameter( charindex ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( charindex ,CHAR_P_STRING_TOUGH|CHAR_P_STRING_MAXHP|CHAR_P_STRING_DEF); sprintf( token, "耐力设置为%d!",(int)atoi(tgh)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_dex( int charindex , char *message ) { int i; char dex[15]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , dex, sizeof(dex)); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt( i , CHAR_DEX,atoi( dex ) ); CHAR_complianceParameter( i ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( i ,CHAR_P_STRING_DEX|CHAR_P_STRING_MAXHP|CHAR_P_STRING_ATK|CHAR_P_STRING_QUICK); sprintf( token, "[GM]%s把你的敏捷设置为%d!", CHAR_getChar( charindex, CHAR_NAME),(int)atoi(dex)/100); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的敏捷设置为%d!", CHAR_getChar( i, CHAR_NAME),(int)atoi(dex)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt( charindex , CHAR_DEX,atoi( dex ) ); CHAR_complianceParameter( charindex ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( charindex ,CHAR_P_STRING_DEX|CHAR_P_STRING_MAXHP|CHAR_P_STRING_ATK|CHAR_P_STRING_QUICK); sprintf( token, "敏捷设置为%d!",(int)atoi(dex)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_vital( int charindex , char *message ) { int i; char vital[15]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , vital, sizeof(vital)); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt( i , CHAR_VITAL,atoi( vital ) ); CHAR_complianceParameter( i ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( i ,CHAR_P_STRING_VITAL|CHAR_P_STRING_MAXHP|CHAR_P_STRING_DEF); sprintf( token, "[GM]%s把你的体力设置为%d!", CHAR_getChar( charindex, CHAR_NAME),(int)atoi(vital)/100); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的体力设置为%d!", CHAR_getChar( i, CHAR_NAME),(int)atoi(vital)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt( charindex , CHAR_VITAL,atoi( vital ) ); CHAR_complianceParameter( charindex ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( charindex ,CHAR_P_STRING_VITAL|CHAR_P_STRING_MAXHP|CHAR_P_STRING_DEF); sprintf( token, "体力设置为%d!",(int)atoi(vital)/100); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_luck( int charindex , char *message ) { int i; char buf[64]; int luck; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , buf, sizeof(buf)); luck=atoi(buf); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(luck<1)luck=1; if(luck>5)luck=5; if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt( i , CHAR_LUCK,luck); CHAR_complianceParameter( i ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( i , CHAR_P_STRING_LUCK); sprintf( token, "[GM]%s把你的运气设置为%d!", CHAR_getChar( charindex, CHAR_NAME),luck); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的运气设置为%d!", CHAR_getChar( i, CHAR_NAME),luck); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt( charindex , CHAR_LUCK,luck); CHAR_complianceParameter( charindex ); //CHAR_sendStatusString( charindex , "P"); CHAR_send_P_StatusString( charindex , CHAR_P_STRING_LUCK); sprintf( token, "运气设置为%d!",luck); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_gold( int charindex , char *message ) { int i, MaxGold, money; char cdkey[CDKEYLEN]; char buf[64]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , buf, sizeof(buf)); money = atoi( buf ); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); MaxGold = CHAR_getMaxHaveGold( charindex); if( money > MaxGold ) money = MaxGold; if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt( i , CHAR_GOLD , money ); CHAR_complianceParameter( i ); CHAR_send_P_StatusString( i , CHAR_P_STRING_GOLD); sprintf( token, "[GM]%s把你的金钱设置为%d!", CHAR_getChar( charindex, CHAR_NAME),money); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的金钱设置为%d!", CHAR_getChar( i, CHAR_NAME),money); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt( charindex , CHAR_GOLD , money ); CHAR_complianceParameter( charindex ); CHAR_send_P_StatusString( charindex , CHAR_P_STRING_GOLD); sprintf( token, "金钱设置为%d!",money); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); } } #ifdef _TEST_DROPITEMS void CHAR_CHAT_DEBUG_dropmypet( int charindex, char *message ) { char buf[256]; int petID, x, y, floor, objindex, petindex, count=0; int i, j, k, petarray, cLeve=1; if( getStringFromIndexWithDelim( message, " ", 1, buf, sizeof( buf)) == FALSE ) return; petID = atoi( buf); if( getStringFromIndexWithDelim( message, " ", 2, buf, sizeof( buf)) != FALSE ){ cLeve = atoi( buf); } floor = CHAR_getInt( charindex, CHAR_FLOOR); x = CHAR_getInt( charindex, CHAR_X); y = CHAR_getInt( charindex, CHAR_Y); if( getStringFromIndexWithDelim( message, " ", 3, buf, sizeof( buf)) != FALSE ){ floor = atoi( buf); } if( getStringFromIndexWithDelim( message, " ", 4, buf, sizeof( buf)) != FALSE ){ x = atoi( buf); } if( getStringFromIndexWithDelim( message, " ", 5, buf, sizeof( buf)) != FALSE ){ y = atoi( buf); } for( i=(x-3); i<(x+3); i++) { for( j=(y-3); j<(y+3); j++) { petarray = ENEMY_getEnemyArrayFromId( petID); petindex = ENEMY_TEST_createPetIndex( petarray ); if( !CHAR_CHECKINDEX( petindex) ){ CHAR_talkToCli( charindex, -1, "err Can't create pet", CHAR_COLORYELLOW); return; } CHAR_complianceParameter( petindex ); objindex = PET_dropPetAbsolute( petindex, floor, i, j, FALSE ); if( objindex == -1 ){ CHAR_talkToCli( charindex, -1, "err Can't Drop", CHAR_COLORYELLOW); return; } for( k = 1; k < cLeve; k ++ ){ //升级 CHAR_PetLevelUp( petindex ); CHAR_PetAddVariableAi( petindex, AI_FIX_PETLEVELUP ); CHAR_setInt( petindex, CHAR_LV, CHAR_getInt( petindex, CHAR_LV) +1 ); } CHAR_complianceParameter( petindex ); CHAR_setInt( petindex , CHAR_HP , CHAR_getWorkInt( petindex , CHAR_WORKMAXHP ) ); CHAR_setWorkInt( petindex, CHAR_WORKOBJINDEX, objindex ); CHAR_setInt( petindex, CHAR_FLOOR, floor); CHAR_setInt( petindex, CHAR_X, i); CHAR_setInt( petindex, CHAR_Y, j); CHAR_sendCToArroundCharacter( objindex); CHAR_setInt( petindex, CHAR_PUTPETTIME, NowTime.tv_sec); CHAR_setChar( petindex, CHAR_OWNERCDKEY, "SYSTEM_WAYI" ); CHAR_setChar( petindex, CHAR_OWNERCHARANAME, "SYSTEM_WAYI" ); count++; } } sprintf( buf, "总共丢掷 %d只宠物。", count); CHAR_talkToCli( charindex, -1, buf, CHAR_COLORYELLOW); } void CHAR_CHAT_DEBUG_dropmyitem( int charindex, char *message ) { char buf[256]; int itemID, SitemID, maxflg=0,emptyitemindexinchara, i, j; int floor, x, y, objindex; if( getStringFromIndexWithDelim( message, " ", 1, buf, sizeof( buf)) == FALSE ) return; SitemID = atoi( buf); if( getStringFromIndexWithDelim( message, " ", 2, buf, sizeof( buf)) != FALSE ){ maxflg = atoi( buf); } floor = CHAR_getInt( charindex, CHAR_FLOOR); x = CHAR_getInt( charindex, CHAR_X); y = CHAR_getInt( charindex, CHAR_Y); if( getStringFromIndexWithDelim( message, " ", 3, buf, sizeof( buf)) != FALSE ){ floor = atoi( buf); } if( getStringFromIndexWithDelim( message, " ", 4, buf, sizeof( buf)) != FALSE ){ x = atoi( buf); } if( getStringFromIndexWithDelim( message, " ", 5, buf, sizeof( buf)) != FALSE ){ y = atoi( buf); } itemID = SitemID; for( i=(x-3); i<(x+3); i++) { for( j=(y-3); j<(y+3); j++) { int ret = 0 , count=0; int itemindex; while( count < 10 ){ count++; itemindex = ITEM_makeItemAndRegist( itemID ); if( maxflg == 1 ) itemID++; if( !ITEM_CHECKINDEX( itemindex)) continue; break; } emptyitemindexinchara = CHAR_findEmptyItemBox( charindex ); CHAR_setItemIndex( charindex, emptyitemindexinchara, itemindex ); ITEM_setWorkInt(itemindex, ITEM_WORKOBJINDEX,-1); ITEM_setWorkInt(itemindex, ITEM_WORKCHARAINDEX,charindex); CHAR_sendItemDataOne( charindex, emptyitemindexinchara); //drop if( (ret = CHAR_DropItemFXY( charindex, emptyitemindexinchara, floor, i, j, &objindex )) != 0 ){ char buf[256]; sprintf( buf, "错误%d", ret); CHAR_talkToCli( charindex, -1, buf, CHAR_COLORYELLOW); } ITEM_setInt(itemindex,ITEM_PUTTIME,NowTime.tv_sec); CHAR_sendWatchEvent(objindex,CHAR_ACTSTAND,NULL,0,TRUE); CHAR_setItemIndex(charindex, emptyitemindexinchara ,-1); CHAR_sendItemDataOne(charindex, emptyitemindexinchara); CHAR_sendCToArroundCharacter(CHAR_getWorkInt( charindex, CHAR_WORKOBJINDEX)); } } { char buf[256]; sprintf( buf, "最後ID%d", itemID-1); CHAR_talkToCli( charindex, -1, buf, CHAR_COLORYELLOW); } } #endif void CHAR_CHAT_DEBUG_additem( int charindex , char *message ) { int emptyitemindexinchara, itemindex; int i; int num = 0; int itemid; char buf[64]; char msgbuf[128]; char cdkey[CDKEYLEN]; easyGetTokenFromString( message , 1 , buf, sizeof(buf)); itemid = atoi( buf); easyGetTokenFromString( message , 2 , buf, sizeof(buf)); num = atoi( buf); easyGetTokenFromString( message , 3 , cdkey, sizeof(cdkey)); if( num <= 0 ) num = 1; if(strlen(cdkey)>0){ int playernum = CHAR_getPlayerMaxNum(); int j; for(j=0;j=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } for( i = 0; i < num; i ++ ) { emptyitemindexinchara = CHAR_findEmptyItemBox( j ); if( emptyitemindexinchara < 0 ){ sprintf( msgbuf, "玩家%s物品栏位不足。", CHAR_getChar( j, CHAR_NAME )); CHAR_talkToCli( charindex, -1, msgbuf, CHAR_COLORYELLOW); sprintf( msgbuf, "你的%s物品栏位不足。", CHAR_getChar( j, CHAR_NAME )); CHAR_talkToCli( j, -1, msgbuf, CHAR_COLORYELLOW); return; } itemindex = ITEM_makeItemAndRegist( itemid ); if( itemindex != -1 ){ CHAR_setItemIndex( j, emptyitemindexinchara, itemindex ); ITEM_setWorkInt(itemindex, ITEM_WORKOBJINDEX,-1); ITEM_setWorkInt(itemindex, ITEM_WORKCHARAINDEX,charindex); CHAR_sendItemDataOne( j, emptyitemindexinchara); LogItem( CHAR_getChar( charindex, CHAR_NAME ), CHAR_getChar( charindex, CHAR_CDKEY ), #ifdef _add_item_log_name // WON ADD 在item的log中增加item名称 itemindex, #else atoi( message), #endif "AddItem(制作道具GM)", CHAR_getInt( charindex,CHAR_FLOOR), CHAR_getInt( charindex,CHAR_X ), CHAR_getInt( charindex,CHAR_Y ), ITEM_getChar( itemindex, ITEM_UNIQUECODE), ITEM_getChar( itemindex, ITEM_NAME), ITEM_getInt( itemindex, ITEM_ID) ); snprintf( msgbuf, sizeof( msgbuf), "[GM]%s给你制作%s成功\。", CHAR_getChar( charindex, CHAR_NAME ),ITEM_getChar( itemindex, ITEM_NAME)); CHAR_talkToCli( j, -1,msgbuf, CHAR_COLORYELLOW); snprintf( msgbuf, sizeof( msgbuf), "成功为%s制作 %s\。", CHAR_getChar( j, CHAR_NAME ),ITEM_getChar( itemindex, ITEM_NAME)); CHAR_talkToCli( charindex, -1,msgbuf, CHAR_COLORYELLOW); }else{ sprintf( msgbuf, "制作道具失败。" ); CHAR_talkToCli( charindex, -1,msgbuf, CHAR_COLORYELLOW); } } }else{ for( i = 0; i < num; i ++ ) { emptyitemindexinchara = CHAR_findEmptyItemBox( charindex ); if( emptyitemindexinchara < 0 ){ sprintf( msgbuf, "物品栏位不足。" ); CHAR_talkToCli( charindex, -1, msgbuf, CHAR_COLORYELLOW); return; } itemindex = ITEM_makeItemAndRegist( itemid ); if( itemindex != -1 ){ CHAR_setItemIndex( charindex, emptyitemindexinchara, itemindex ); ITEM_setWorkInt(itemindex, ITEM_WORKOBJINDEX,-1); ITEM_setWorkInt(itemindex, ITEM_WORKCHARAINDEX,charindex); CHAR_sendItemDataOne( charindex, emptyitemindexinchara); LogItem( CHAR_getChar( charindex, CHAR_NAME ), CHAR_getChar( charindex, CHAR_CDKEY ), #ifdef _add_item_log_name // WON ADD 在item的log中增加item名称 itemindex, #else atoi( message), #endif "AddItem(制作道具GM)", CHAR_getInt( charindex,CHAR_FLOOR), CHAR_getInt( charindex,CHAR_X ), CHAR_getInt( charindex,CHAR_Y ), ITEM_getChar( itemindex, ITEM_UNIQUECODE), ITEM_getChar( itemindex, ITEM_NAME), ITEM_getInt( itemindex, ITEM_ID) ); snprintf( msgbuf, sizeof( msgbuf), "制作%s成功\。", ITEM_getChar( itemindex, ITEM_NAME)); CHAR_talkToCli( charindex, -1,msgbuf, CHAR_COLORYELLOW); }else{ sprintf( msgbuf, "制作道具失败。" ); CHAR_talkToCli( charindex, -1, msgbuf, CHAR_COLORYELLOW); } } } } void CHAR_CHAT_DEBUG_metamo( int charindex , char *message ) { char metamoid[7]; char cdkey[CDKEYLEN]; char token[255]; int i=0; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , metamoid, sizeof(metamoid)); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt( i , CHAR_BASEIMAGENUMBER , atoi( metamoid ) ); CHAR_setInt( i , CHAR_BASEBASEIMAGENUMBER , atoi( metamoid ) ); CHAR_complianceParameter( i ); CHAR_sendCToArroundCharacter( CHAR_getWorkInt( i , CHAR_WORKOBJINDEX )); CHAR_send_P_StatusString( i , CHAR_P_STRING_BASEBASEIMAGENUMBER); sprintf( token, "[GM]%s把你的人物形象设置为%d!", CHAR_getChar( charindex, CHAR_NAME),(int)atoi(metamoid)); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的人物形象设置为%d!", CHAR_getChar( i, CHAR_NAME),(int)atoi(metamoid)); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt( charindex , CHAR_BASEIMAGENUMBER , atoi( metamoid ) ); CHAR_setInt( charindex , CHAR_BASEBASEIMAGENUMBER , atoi( metamoid ) ); CHAR_complianceParameter( charindex ); CHAR_sendCToArroundCharacter( CHAR_getWorkInt( charindex , CHAR_WORKOBJINDEX )); CHAR_send_P_StatusString( charindex , CHAR_P_STRING_BASEBASEIMAGENUMBER); sprintf( token, "人物形象设置为%d!",(int)atoi(metamoid)); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_info( int charindex , char *message ) { char line[256]; int index; if( strlen( message) != 0 ) { index = atoi( message); } else { index = charindex; } if( !CHAR_CHECKINDEX( index)) { CHAR_talkToCli( charindex, -1 , "该index无法使用。" , CHAR_COLORWHITE ); return; } snprintf( line, sizeof( line), "name:%s i:%d B:%d BB:%d LV:%d EXP:%d MakeSeq:%d", CHAR_getChar( index, CHAR_NAME), charindex, CHAR_getInt( index, CHAR_BASEIMAGENUMBER ), CHAR_getInt( index, CHAR_BASEBASEIMAGENUMBER ), CHAR_getInt( index, CHAR_LV ), CHAR_getInt( index, CHAR_EXP ), CHAR_getCharMakeSequenceNumber( index)); CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); snprintf( line, sizeof( line), "Gold:%d HP:%d MP/MHP:%d/%d" , CHAR_getInt( index, CHAR_GOLD ), CHAR_getInt( index, CHAR_HP ), CHAR_getInt( index, CHAR_MP ), CHAR_getInt( index, CHAR_MAXMP )); CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); if( CHAR_getInt( index, CHAR_WHICHTYPE ) == CHAR_TYPEPET ){ snprintf( line, sizeof(line), "体:%d 力:%d 丈:%d 早:%d 耐:%d 攻:%d 守:%d 敏:%d 忠修:%d 忠变:%.2f 编码:%s", CHAR_getInt( index, CHAR_VITAL )/100, CHAR_getInt( index, CHAR_STR )/100, CHAR_getInt( index, CHAR_TOUGH )/100, CHAR_getInt( index, CHAR_DEX )/100, CHAR_getWorkInt( index, CHAR_WORKFIXVITAL ), CHAR_getWorkInt( index, CHAR_WORKATTACKPOWER ), CHAR_getWorkInt( index, CHAR_WORKDEFENCEPOWER ),//CHAR_WORKFIXDEX CHAR_getWorkInt( index, CHAR_WORKQUICK ), CHAR_getInt( index, CHAR_MODAI ), CHAR_getInt( index, CHAR_VARIABLEAI ) * 0.01, CHAR_getChar( index, CHAR_UNIQUECODE) ); }else{ snprintf( line, sizeof(line), "体:%d 力:%d 丈:%d 早:%d 耐:%d 攻:%d 守:%d 魅:%d 运:%d", CHAR_getInt( index, CHAR_VITAL )/100, CHAR_getInt( index, CHAR_STR )/100, CHAR_getInt( index, CHAR_TOUGH )/100, CHAR_getInt( index, CHAR_DEX )/100, CHAR_getWorkInt( index, CHAR_WORKFIXVITAL ), CHAR_getWorkInt( index, CHAR_WORKATTACKPOWER ), CHAR_getWorkInt( index, CHAR_WORKDEFENCEPOWER ), CHAR_getWorkInt( index, CHAR_WORKFIXCHARM ), CHAR_getWorkInt( index, CHAR_WORKFIXLUCK )); } CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); snprintf( line, sizeof(line), "土:%d 水:%d 火:%d 风:%d", CHAR_getWorkInt( index, CHAR_WORKFIXEARTHAT ), CHAR_getWorkInt( index, CHAR_WORKFIXWATERAT ), CHAR_getWorkInt( index, CHAR_WORKFIXFIREAT ), CHAR_getWorkInt( index, CHAR_WORKFIXWINDAT )); CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); snprintf( line, sizeof( line), "Sk Itm:%d ChV:%d Rad:%d" , CHAR_MAXITEMHAVE, CHAR_getInt( index, CHAR_CHATVOLUME ), CHAR_getInt( index, CHAR_RADARSTRENGTH ) ); CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); snprintf( line, sizeof( line), "Status 毒:%d 麻:%d 默:%d 石:%d 暗:%d 乱:%d" , CHAR_getInt( index , CHAR_POISON ), CHAR_getInt( index , CHAR_PARALYSIS ), CHAR_getInt( index , CHAR_SLEEP ), CHAR_getInt( index , CHAR_STONE ), CHAR_getInt( index , CHAR_DRUNK ), CHAR_getInt( index , CHAR_CONFUSION ) ); CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); #ifdef _PERSONAL_FAME // Arminius: 家族个人声望 snprintf( line, sizeof( line), #ifdef _NEW_MANOR_LAW "TitInd:%d FL:%d X:%d Y:%d DIR:%d FAME:%d MOMENTUM:%d" , #else "TitInd:%d FL:%d X:%d Y:%d DIR:%d FAME:%d" , #endif CHAR_getInt( index , CHAR_INDEXOFEQTITLE ), CHAR_getInt( index , CHAR_FLOOR ), CHAR_getInt( index , CHAR_X ), CHAR_getInt( index , CHAR_Y ), CHAR_getInt( index , CHAR_DIR ), CHAR_getInt( index , CHAR_FAME) #ifdef _NEW_MANOR_LAW ,CHAR_getInt( index , CHAR_MOMENTUM) #endif ); #else snprintf( line, sizeof( line), "TitInd:%d FL:%d X:%d Y:%d DIR:%d" , CHAR_getInt( index , CHAR_INDEXOFEQTITLE ), CHAR_getInt( index , CHAR_FLOOR ), CHAR_getInt( index , CHAR_X ), CHAR_getInt( index , CHAR_Y ), CHAR_getInt( index , CHAR_DIR ) ); #endif CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); snprintf( line, sizeof( line), "walk:%d dead:%d ItemMergecnt:%d" , CHAR_getInt( index , CHAR_WALKCOUNT ) , CHAR_getInt( index , CHAR_DEADCOUNT ) , CHAR_getInt( index, CHAR_MERGEITEMCOUNT) ); CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); if( CHAR_getInt( index, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER) { snprintf( line, sizeof( line), "petindex [%d][%d][%d][%d][%d] " , CHAR_getCharPet( index, 0), CHAR_getCharPet( index, 1), CHAR_getCharPet( index, 2), CHAR_getCharPet( index, 3), CHAR_getCharPet( index, 4)); } else { snprintf( line, sizeof( line), "PetskillIndex [%d][%d][%d][%d][%d][%d][%d] " , CHAR_getPetSkill( index, 0), CHAR_getPetSkill( index, 1), CHAR_getPetSkill( index, 2), CHAR_getPetSkill( index, 3), CHAR_getPetSkill( index, 4), CHAR_getPetSkill( index, 5), CHAR_getPetSkill( index, 6)); } CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); if( CHAR_getInt( index, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER) { snprintf( line, sizeof( line), "poolpetindex [%d][%d][%d][%d][%d] " , CHAR_getCharPoolPet( index, 0), CHAR_getCharPoolPet( index, 1), CHAR_getCharPoolPet( index, 2), CHAR_getCharPoolPet( index, 3), CHAR_getCharPoolPet( index, 4)); CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); snprintf( line, sizeof( line), "poolpetindex [%d][%d][%d][%d][%d] " , CHAR_getCharPoolPet( index, 5), CHAR_getCharPoolPet( index, 6), CHAR_getCharPoolPet( index, 7), CHAR_getCharPoolPet( index, 8), CHAR_getCharPoolPet( index, 9)); CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); } snprintf( line, sizeof( line), "levelup [%d], 累积 %d 赌场积分[%d]" , CHAR_getInt( index, CHAR_LEVELUPPOINT), CHAR_getWorkInt( index, CHAR_WORKULTIMATE), CHAR_getInt( index, CHAR_GAMBLENUM) ); CHAR_talkToCli( charindex, -1 , line , CHAR_COLORWHITE ); } void CHAR_CHAT_DEBUG_sysinfo( int charindex , char *message ) { char msg[1024],name[256]; int i; time_t new_t; int dd,hh,mm,ss; int items=0 , chars=0, golds=0, nouses=0; int players=0,pets=0,others=0; int whichtype= -1; int objnum = OBJECT_getNum(); int itemnum = ITEM_getITEM_itemnum(); int itemuse =0; makeEscapeString( getGameserverID(), name, sizeof( name)); sprintf( msg, "GSID:%s GSNAME:%s", getGameserverID(), name); CHAR_talkToCli( charindex, -1, msg, CHAR_COLORYELLOW); for( i=0 ; i0){ for(i=0;i=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt(i,CHAR_LV, atoi( message )); CHAR_send_P_StatusString( i , CHAR_P_STRING_LV); sprintf( token, "[GM]%s把你的等级设置为%d!", CHAR_getChar( charaindex, CHAR_NAME),level); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的等级设置为%d!", CHAR_getChar( i, CHAR_NAME),level); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt(charaindex,CHAR_LV, atoi( message )); CHAR_send_P_StatusString( charaindex , CHAR_P_STRING_LV); sprintf( token, "等级设置为%d!",level); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_exp( int charaindex, char* message ) { int i; char exp[15]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , exp, sizeof(exp)); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setMaxExp( i, atoi( exp )); CHAR_send_P_StatusString( i , CHAR_P_STRING_EXP); sprintf( token, "[GM]%s把你的经验设置为%d!", CHAR_getChar( charaindex, CHAR_NAME),(int)atoi(exp)); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的经验设置为%d!", CHAR_getChar( i, CHAR_NAME),(int)atoi(exp)); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setMaxExp( charaindex, atoi( exp )); CHAR_send_P_StatusString( charaindex , CHAR_P_STRING_EXP); sprintf( token, "经验设置为%d!",(int)atoi(exp)/100); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_delitem( int charindex , char *message ) { int itemid; if( strcmp( message, "all") == 0 ) { int i; for( i = CHAR_STARTITEMARRAY; i < CHAR_MAXITEMHAVE; i ++ ) { itemid = CHAR_getItemIndex(charindex, i); if( itemid != -1 ) { { LogItem( CHAR_getChar( charindex, CHAR_NAME ), CHAR_getChar( charindex, CHAR_CDKEY ), #ifdef _add_item_log_name // WON ADD 在item的log中增加item名称 itemid, #else ITEM_getInt( itemid, ITEM_ID ), #endif "DelItem(删除道具GM)", CHAR_getInt( charindex,CHAR_FLOOR), CHAR_getInt( charindex,CHAR_X ), CHAR_getInt( charindex,CHAR_Y ), ITEM_getChar( itemid, ITEM_UNIQUECODE), ITEM_getChar( itemid, ITEM_NAME), ITEM_getInt( itemid, ITEM_ID) ); } CHAR_DelItem( charindex, i); } } }else { int equipplace; equipplace = atoi( message); if( equipplace < CHAR_STARTITEMARRAY || equipplace > CHAR_MAXITEMHAVE -1 ) { CHAR_talkToCli( charindex, -1, "号码不正确。", CHAR_COLORWHITE); return; } itemid = CHAR_getItemIndex(charindex, equipplace); if( itemid == -1 ) return; { LogItem( CHAR_getChar( charindex, CHAR_NAME ), CHAR_getChar( charindex, CHAR_CDKEY ), #ifdef _add_item_log_name // WON ADD 在item的log中增加item名称 itemid, #else ITEM_getInt( itemid, ITEM_ID ), #endif "DelItem(删除道具GM)", CHAR_getInt( charindex,CHAR_FLOOR), CHAR_getInt( charindex,CHAR_X ), CHAR_getInt( charindex,CHAR_Y ), ITEM_getChar( itemid, ITEM_UNIQUECODE), ITEM_getChar( itemid, ITEM_NAME), ITEM_getInt( itemid, ITEM_ID) ); } CHAR_DelItem( charindex, equipplace); } } #ifdef _CHAR_PROFESSION // WON ADD 人物职业 void CHAR_CHAT_DEBUG_addsk( int charaindex, char* message ) { CHAR_HaveSkill *pSkil; int skill, i, j, level=1; char cdkey[CDKEYLEN]; char msg1[20], msg2[20]; int playernum = CHAR_getPlayerMaxNum(); getStringFromIndexWithDelim( message, " ", 1, msg1, sizeof( msg1)); getStringFromIndexWithDelim( message, " ", 2, msg2, sizeof( msg2)); getStringFromIndexWithDelim( message, " ", 3, cdkey, sizeof( cdkey)); skill = atoi(msg1); level = atoi(msg2); if( level > 100 ){ CHAR_talkToCli( charaindex, -1, "等级不正确", CHAR_COLORWHITE); return; } if( level < 1 ) level = 1; if(strlen(cdkey)>0){ for(j=0;j=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } for( i = 0; i < CHAR_SKILLMAXHAVE; i ++ ){ int skill_id = -1; pSkil = CHAR_getCharHaveSkill( j, i ); skill_id = SKILL_getInt( &pSkil->skill, SKILL_IDENTITY); if( skill == skill_id && skill_id != -1 ){ CHAR_talkToCli(j,-1, "你已经学习过此技能", CHAR_COLORYELLOW); CHAR_talkToCli(charaindex,-1, "玩家已经学习过此技能", CHAR_COLORYELLOW); return; } if( pSkil == NULL ) continue; if( pSkil->use != 0 ) continue; break; } if( i >= CHAR_SKILLMAXHAVE ){ CHAR_talkToCli(j,-1, "技能数量已达上限", CHAR_COLORYELLOW); CHAR_talkToCli(charaindex,-1, "玩家技能数量已达上限", CHAR_COLORYELLOW); return; }else{ level *= 100; SKILL_makeSkillData( &pSkil->skill, skill, level); pSkil->use = TRUE; } CHAR_sendStatusString( j , "S"); return;} else{ for( i = 0; i < CHAR_SKILLMAXHAVE; i ++ ){ int skill_id = -1; pSkil = CHAR_getCharHaveSkill( charaindex, i ); skill_id = SKILL_getInt( &pSkil->skill, SKILL_IDENTITY); if( skill == skill_id && skill_id != -1 ){ CHAR_talkToCli(charaindex,-1, "你已经学习过此技能", CHAR_COLORYELLOW); return; } if( pSkil == NULL ) continue; if( pSkil->use != 0 ) continue; break; } if( i >= CHAR_SKILLMAXHAVE ){ CHAR_talkToCli(charaindex,-1, "技能数量已达上限", CHAR_COLORYELLOW); return; }else{ level *= 100; SKILL_makeSkillData( &pSkil->skill, skill, level); pSkil->use = TRUE; } CHAR_sendStatusString( charaindex , "S"); return;} } void CHAR_CHAT_DEBUG_delsk( int charaindex, char* message ) { int i; CHAR_HaveSkill *pSkil; if( strcmp( message, "all" ) == 0 ){ // CHAR_talkToCli( charaindex, -1, "清除所有技能", CHAR_COLORWHITE); for( i = CHAR_SKILLMAXHAVE-1; i >= 0; i -- ){ pSkil = CHAR_getCharHaveSkill( charaindex, i ); if( pSkil == NULL )continue; if( pSkil->use == 0 )continue; SKILL_makeSkillData( &pSkil->skill, 0, 0 ); pSkil->use = 0; } } for( i = CHAR_SKILLMAXHAVE-1; i >= 0; i -- ){ pSkil = CHAR_getCharHaveSkill( charaindex, i ); if( pSkil == NULL )continue; if( pSkil->use == 0 )continue; print( "SKILUSE %d\n", pSkil->use ); break; } if( i < 0 ){ // CHAR_talkToCli( charaindex, -1, "已无法再削减了。", CHAR_COLORWHITE); ;; }else{ SKILL_makeSkillData( &pSkil->skill, 0, 0 ); pSkil->use = 0; } CHAR_sendStatusString( charaindex , "S"); } #endif void CHAR_CHAT_Kusabana( int charaindex, char* message ){ int dir, ff, fx, fy; int tile, obj; ff = CHAR_getInt( charaindex, CHAR_FLOOR ); fx = CHAR_getInt( charaindex, CHAR_X ); fy = CHAR_getInt( charaindex, CHAR_Y ); dir = CHAR_getInt( charaindex, CHAR_DIR ); fx += CHAR_getDX(dir); fy += CHAR_getDY(dir); if( MAP_getTileAndObjData( ff, fx, fy, &tile, &obj) == FALSE )return; #if 0 { char szBuffer[256]; snprintf( szBuffer, sizeof( szBuffer ), "TILE = %d, OBJ = %d", tile, obj ); CHAR_talkToCli( charaindex, -1, szBuffer, CHAR_COLORWHITE); } #else if( obj != 0 ){ CHAR_talkToCli( charaindex, -1, "有零件。", CHAR_COLORWHITE); return; } if( MAP_walkAbleFromPoint( ff, fx, fy, FALSE ) == FALSE ){ CHAR_talkToCli( charaindex, -1, "无法走了。", CHAR_COLORWHITE); return; } MAP_setObjData( ff, fx, fy, 3416, 100 ); #if 1 { char *stringdata; RECT seekr , retr; seekr.x = fx; seekr.y = fy; seekr.width = 1; seekr.height = 1; stringdata = MAP_getdataFromRECT(ff,&seekr,&retr); if( stringdata ){ if( CHAR_getInt( charaindex , CHAR_WHICHTYPE ) == CHAR_TYPEPLAYER ){ int fd = getfdFromCharaIndex( charaindex ); lssproto_M_send(fd,ff, retr.x,retr.y, retr.x+retr.width,retr.y+retr.height, stringdata ); } } else { } } #endif #endif return ; } void CHAR_CHAT_Fukuwa( int charaindex, char* message ){ int dir, ff, fx, fy, objindex, vs_index, vs_fd, stringlen; OBJECT obj; char szBuffer[2048]; stringlen = strlen( message ); if( message[0] == '[' && message[stringlen-1] == ']' ){ CHAR_talkToCli( charaindex, -1, "语言没有转换。", CHAR_COLORWHITE); return ; } ff = CHAR_getInt( charaindex, CHAR_FLOOR ); fx = CHAR_getInt( charaindex, CHAR_X ); fy = CHAR_getInt( charaindex, CHAR_Y ); dir = CHAR_getInt( charaindex, CHAR_DIR ); fx += CHAR_getDX(dir); fy += CHAR_getDY(dir); stringlen = strlen( message ); snprintf( szBuffer, sizeof( szBuffer ), "P|%s", message ); for( obj=MAP_getTopObj( ff, fx, fy ); obj; obj=NEXT_OBJECT(obj) ){ objindex = GET_OBJINDEX(obj); if( OBJECT_getType(objindex) != OBJTYPE_CHARA )continue; vs_index = OBJECT_getIndex(objindex); vs_fd = getfdFromCharaIndex( vs_index ); CHAR_Talk( vs_fd, vs_index, szBuffer, CHAR_COLORWHITE, 3 ); break; } } void CHAR_CHAT_DEBUG_superman( int charaindex, char* message ) { #define CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF 100000 int i; char hp[15]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , hp, sizeof(hp)); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt(charaindex,CHAR_SKILLUPPOINT, 32); CHAR_Skillupsend(charaindex); CHAR_setInt( charaindex , CHAR_HP, CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF); CHAR_setInt( charaindex , CHAR_MP,CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex , CHAR_MAXMP,CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex , CHAR_STR,CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex , CHAR_TOUGH,CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex , CHAR_DEX , CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex,CHAR_LV, 200); CHAR_complianceParameter( charaindex ); CHAR_sendStatusString( charaindex , "P"); sprintf( token, "[GM]%s把你为超人状态!", CHAR_getChar( charaindex, CHAR_NAME)); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s设置为超人状态!", CHAR_getChar( i, CHAR_NAME)); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt(charaindex,CHAR_SKILLUPPOINT, 32); CHAR_Skillupsend(charaindex); CHAR_setInt( charaindex , CHAR_HP, CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF); CHAR_setInt( charaindex , CHAR_MP,CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex , CHAR_MAXMP,CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex , CHAR_STR,CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex , CHAR_TOUGH,CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex , CHAR_DEX , CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF ); CHAR_setInt( charaindex,CHAR_LV, 200); CHAR_complianceParameter( charaindex ); CHAR_sendStatusString( charaindex , "P"); CHAR_talkToCli( charaindex, -1,"设置超人状态!", CHAR_COLORYELLOW ); } #undef CHAT_CHAT_DEBUG_SUPERMAN_PARAMDEF } void CHAR_CHAT_printcount( int charaindex, char* message ) { char msgbuf[512]; snprintf( msgbuf,sizeof( msgbuf), "你说了 %d 次话,走了 %d 步路,死了 %d 次", CHAR_getInt( charaindex, CHAR_TALKCOUNT), CHAR_getInt( charaindex, CHAR_WALKCOUNT), CHAR_getInt( charaindex, CHAR_DEADCOUNT) ); CHAR_talkToCli( charaindex, -1, msgbuf, CHAR_COLORWHITE); } void CHAR_CHAT_DEBUG_battlein( int charaindex, char* message ) { int fd = getfdFromCharaIndex( charaindex ); if( fd != -1) { lssproto_EN_recv( fd, CHAR_getInt( charaindex, CHAR_X), CHAR_getInt( charaindex, CHAR_Y)); } } void CHAR_CHAT_DEBUG_battleout( int charaindex, char* message ) { BATTLE_WatchStop( charaindex ); } void CHAR_CHAT_DEBUG_petmake( int charaindex, char* message ) { int ret; int enemynum; int enemyid; int i,j; int level=-1; char buf[10]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , buf, sizeof(buf)); enemyid=atoi(buf); easyGetTokenFromString( message , 2 , buf, sizeof(buf)); level=atoi(buf); easyGetTokenFromString( message , 3 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(j=0;j=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } enemynum = ENEMY_getEnemyNum(); for( i = 0; i < enemynum; i ++ ) { if( ENEMY_getInt( i, ENEMY_ID) == enemyid) { break; } } if( i == enemynum )return; ret = ENEMY_createPetFromEnemyIndex( j, i); if( !CHAR_CHECKINDEX( ret))return; snprintf( token,sizeof( token), "宠物制作成功\!",ret); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORWHITE); sprintf( token, "[GM]%s制作了只宠物给你!index[%d]", CHAR_getChar( charaindex, CHAR_NAME),ret); CHAR_talkToCli( j, -1, token, CHAR_COLORYELLOW ); sprintf( token, "给玩家%s的宠物制作成功!index[%d]", CHAR_getChar( j, CHAR_NAME),ret); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); for( i = 0; i < CHAR_MAXPETHAVE; i ++ ){ if( CHAR_getCharPet( j, i ) == ret )break; } if( i == CHAR_MAXPETHAVE )i = 0; if( CHAR_CHECKINDEX( ret ) == TRUE ){ CHAR_setMaxExpFromLevel( ret, CHAR_getInt( ret, CHAR_LV )); } if( level != -1 ){ if( level > 200 ) level = 200; if( level < 0 ) level = 0; level = level - CHAR_getInt( ret, CHAR_LV ); if( level > 0 ){ int k; for( k = 1; k <= level; k ++ ){ //升级 CHAR_PetLevelUp( ret ); CHAR_PetAddVariableAi( ret, AI_FIX_PETLEVELUP ); CHAR_setInt( ret, CHAR_LV, CHAR_getInt( ret, CHAR_LV) +1 ); } } } snprintf( token, sizeof( token ), "K%d", i ); CHAR_sendStatusString( j, token ); snprintf( token, sizeof( token ), "W%d", i ); CHAR_sendStatusString( j, token ); }else{ enemynum = ENEMY_getEnemyNum(); for( i = 0; i < enemynum; i ++ ) { if( ENEMY_getInt( i, ENEMY_ID) == enemyid) { break; } } if( i == enemynum )return; ret = ENEMY_createPetFromEnemyIndex(charaindex, i); if( !CHAR_CHECKINDEX( ret))return; snprintf( token,sizeof( token), "宠物制作成功\!index[%d]",ret); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORWHITE); for( i = 0; i < CHAR_MAXPETHAVE; i ++ ){ if( CHAR_getCharPet( charaindex, i ) == ret )break; } if( i == CHAR_MAXPETHAVE )i = 0; if( CHAR_CHECKINDEX( ret ) == TRUE ){ CHAR_setMaxExpFromLevel( ret, CHAR_getInt( ret, CHAR_LV )); } if( level != -1 ){ if( level > 200 ) level = 200; if( level < 0 ) level = 0; level = level - CHAR_getInt( ret, CHAR_LV ); if( level > 0 ){ int k; for( k = 1; k <= level; k ++ ){ //升级 CHAR_PetLevelUp( ret ); CHAR_PetAddVariableAi( ret, AI_FIX_PETLEVELUP ); CHAR_setInt( ret, CHAR_LV, CHAR_getInt( ret, CHAR_LV) +1 ); } } } snprintf( token, sizeof( token ), "K%d", i ); CHAR_sendStatusString( charaindex, token ); snprintf( token, sizeof( token ), "W%d", i ); CHAR_sendStatusString( charaindex, token ); } } void CHAR_CHAT_DEBUG_deletepet( int charaindex, char* message ) { int i, pindex; char category[12]; int playernum = CHAR_getPlayerMaxNum(); for( i = 0; i < CHAR_MAXPETHAVE; i ++ ) { pindex = CHAR_getCharPet( charaindex, i); if( CHAR_CHECKINDEX( pindex)) { CHAR_endCharOneArray( pindex ); CHAR_setCharPet( charaindex, i, -1); snprintf( category, sizeof( category), "K%d",i); CHAR_sendStatusString( charaindex, category ); snprintf( category, sizeof( category), "W%d",i); CHAR_sendStatusString( charaindex, category ); } } CHAR_talkToCli( charaindex, -1, "清除身上所有宠物。", CHAR_COLORWHITE); } #define MAXMESS_LISTNUM 8 #define ALLRESET (MAXMESS_LISTNUM - 1) void CHAR_CHAT_DEBUG_reset( int charaindex, char* message ) { int i; char mess[MAXMESS_LISTNUM][256]={ "enemy", "encount", "magic", "warppoint", "petskill", "pettalk", "npc", "all"}; for( i=0; i= MAXMESS_LISTNUM ){ CHAR_talkToCli( charaindex, -1, "指令错误", CHAR_COLORRED);//CHAR_COLORYELLOW return; } switch( i){ case ALLRESET: case 0: if( !ENEMYTEMP_reinitEnemy() || !ENEMY_reinitEnemy() ){ CHAR_talkToCli( charaindex, -1, "重新读取敌人基本资料失败。", CHAR_COLORRED); return; } if( i != ALLRESET ) break; case 1: if( !GROUP_reinitGroup() || !ENCOUNT_reinitEncount() ){ CHAR_talkToCli( charaindex, -1, "重新读取遭遇团队资料失败。", CHAR_COLORRED); } if( i != ALLRESET ) break; case 2: if( !MAGIC_reinitMagic() || !ATTMAGIC_reinitMagic() ) { CHAR_talkToCli( charaindex, -1, "重新读取咒术资料失败。", CHAR_COLORRED); } if( i != ALLRESET ) break; case 3: MAPPOINT_resetMapWarpPoint( 1); if( !MAPPOINT_loadMapWarpPoint() ){ CHAR_talkToCli( charaindex, -1, "重新读取跳跃点资料失败。", CHAR_COLORRED); } if( i != ALLRESET ) break; case 4: if( !PETSKILL_reinitPetskill() ) { CHAR_talkToCli( charaindex, -1, "重新读取宠物技能资料失败。", CHAR_COLORRED); } if( i != ALLRESET ) break; case 5: LoadPetTalk(); if( i != ALLRESET ) break; break; case 6: CHAR_talkToCli( charaindex, -1, "未开放", CHAR_COLORRED); return; if( i != ALLRESET ) break; break; } CHAR_talkToCli( charaindex, -1, "重新读取游戏资料。", CHAR_COLORYELLOW); } void CHAR_CHAT_DEBUG_enemyrestart( int charaindex, char* message ) { if( ENEMYTEMP_reinitEnemy()) { CHAR_talkToCli( charaindex, -1, "再次读取敌人基本资料。", CHAR_COLORWHITE); }else { CHAR_talkToCli( charaindex, -1, "再次读取敌人基本资料失败。", CHAR_COLORWHITE); } if( ENEMY_reinitEnemy()) { CHAR_talkToCli( charaindex, -1, "再次读取敌人资料。", CHAR_COLORWHITE); }else { CHAR_talkToCli( charaindex, -1, "再次读取敌人基本资料失败。", CHAR_COLORWHITE); } if( GROUP_reinitGroup()) { CHAR_talkToCli( charaindex, -1, "再次读取团队资料。", CHAR_COLORWHITE); }else { CHAR_talkToCli( charaindex, -1, "再次读取团队资料失败。", CHAR_COLORWHITE); } if( ENCOUNT_reinitEncount()) { CHAR_talkToCli( charaindex, -1, "再次读取遭遇资料。", CHAR_COLORWHITE); } else { CHAR_talkToCli( charaindex, -1, "再次读取遭遇资料失败。", CHAR_COLORWHITE); } if( MAGIC_reinitMagic()) { CHAR_talkToCli( charaindex, -1, "再次读取咒术资料。", CHAR_COLORWHITE); } else { CHAR_talkToCli( charaindex, -1, "再次读取咒术资料失败。", CHAR_COLORWHITE); } #ifdef __ATTACK_MAGIC if( ATTMAGIC_reinitMagic() ) CHAR_talkToCli( charaindex , -1 , "再次读取咒术资料。" , CHAR_COLORWHITE ); else CHAR_talkToCli( charaindex , -1 , "再次读取咒术资料失败。" , CHAR_COLORWHITE ); #endif if( PETSKILL_reinitPetskill()) { CHAR_talkToCli( charaindex, -1, "再次读取宠物技能资料。", CHAR_COLORWHITE); } else { CHAR_talkToCli( charaindex, -1, "再次读取宠物技能资料失败。", CHAR_COLORWHITE); } LoadPetTalk(); // Arminius 8.15 pet talk CHAR_talkToCli( charaindex, -1, "再次读取宠物讲话资料。", CHAR_COLORWHITE); } void CHAR_CHAT_DEBUG_battlewatch( int charaindex, char* message ) { int fd = getfdFromCharaIndex( charaindex ); if( fd != -1) { lssproto_LB_recv( fd, CHAR_getInt( charaindex, CHAR_X), CHAR_getInt( charaindex, CHAR_Y)); } } // shan 2001/12/18 Begin 由於改变过多,故将原先的function注掉 void CHAR_CHAT_DEBUG_eventclean( int charaindex, char* message ) { #ifdef _ADD_NEWEVENT // WON 多增任务旗标 int event_num = 8; #else int event_num = 6; #endif int point; int shiftbit; int eventno=0; char token[1024]; int array; int shift; char token_cdkey[256]="", token_name[256]="", cdkey[CDKEYLEN], token_flag[256]=""; unsigned int max_user = 0; BOOL find = FALSE; BOOL ret1, ret2; int charaindex_tmp = 0; int i; getStringFromIndexWithDelim( message, " ", 1, token_flag, sizeof( token)); ret1 = getStringFromIndexWithDelim( message, " ", 2, token_cdkey, sizeof( token_cdkey)); ret2 = getStringFromIndexWithDelim( message, " ", 3, token_name, sizeof( token_name)); shiftbit = atoi(token_flag); eventno = atoi(token_flag); if( shiftbit!=-1 && ret1==FALSE && ret2==FALSE ){ charaindex_tmp = charaindex; find=TRUE; }else{ if( shiftbit==-1 || strlen(token_cdkey)==0 || strlen(token_name)==0 ){ sprintf( token, "%s", "参数不正确。正确格式:[eventsetend 任务旗标 帐号 人物名称]"); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORWHITE); return; } max_user = getFdnum(); for( i=0; i=event_num ){ sprintf( token, "错误!!你所设的任务旗标编号已超过 围(0~%d)。",32*event_num-1); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORWHITE); return; } point = CHAR_getInt( charaindex_tmp, CHAR_ENDEVENT+array); point = point & ~(1<=event_num ){ sprintf( token, "错误!!你所设的任务旗标编号已超过 围(0~%d)。",32*event_num-1); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORWHITE); return; } point = CHAR_getInt( charaindex_tmp, CHAR_NOWEVENT+array); point = point | (1<=event_num ){ sprintf( token, "错误!!你所设的任务旗标编号已超过 围(0~%d)。",32*event_num-1); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORWHITE); return; } point = CHAR_getInt( charaindex_tmp, CHAR_ENDEVENT+array); point = point | (1<0){ for(i=0;i=playernum) { CHAR_talkToCli( charindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt( i , CHAR_DUELPOINT, atoi( dp ) ); CHAR_send_P_StatusString( i ,CHAR_P_STRING_DUELPOINT ); sprintf( token, "[GM]%s把你的DP设置为%d!", CHAR_getChar( charindex, CHAR_NAME),(int)atoi(dp)); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的DP设置为%d!", CHAR_getChar( i, CHAR_NAME),(int)atoi(dp)); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt( charindex , CHAR_DUELPOINT, atoi( dp ) ); CHAR_send_P_StatusString( charindex ,CHAR_P_STRING_DUELPOINT ); sprintf( token, "DP设置为%d!",(int)atoi(dp)); CHAR_talkToCli( charindex, -1,token, CHAR_COLORYELLOW ); } } #ifdef _EQUIT_ARRANGE void CHAR_CHAT_DEBUG_arrange( int charindex , char *message ) { CHAR_setWorkInt( charindex, CHAR_WORKFIXARRANGE, atoi( message) ); CHAR_complianceParameter( charindex ); CHAR_talkToCli( charindex, -1, "设定挡格", CHAR_COLORYELLOW); } #endif #ifdef _EQUIT_SEQUENCE void CHAR_CHAT_DEBUG_sequence( int charindex , char *message ) { CHAR_setWorkInt( charindex, CHAR_WORKFIXSEQUENCE, atoi( message) ); CHAR_complianceParameter( charindex ); CHAR_talkToCli( charindex, -1, "设定顺序", CHAR_COLORYELLOW); } #endif #define ITEMRESERVESTRING "item" #define POOLITEMRESERVESTRING "poolitem" void CHAR_CHAT_DEBUG_setmerge_main( int charaindex, char* message, int mode ) { int haveitemindex = atoi( message); int itemindex; if( !CHAR_CHECKITEMINDEX( charaindex, haveitemindex) ){ CHAR_talkToCli( charaindex, -1, "号码很奇怪。", CHAR_COLORWHITE); return; } itemindex = CHAR_getItemIndex( charaindex, haveitemindex); if( !ITEM_CHECKINDEX( itemindex)) { CHAR_talkToCli( charaindex, -1, "该处是否没有任何道具,情报亦很奇怪。", CHAR_COLORWHITE); return; } ITEM_setInt( itemindex, ITEM_MERGEFLG, mode); CHAR_talkToCli( charaindex, -1, "宁岳白仿弘及丑综毛仄引仄凶[", CHAR_COLORWHITE); CHAR_sendItemDataOne( charaindex, haveitemindex); } void CHAR_CHAT_DEBUG_effect( int charaindex, char* message ) { int floorid=-1, effectid=-1, level=0; char buf[ 256]; int i; int playernum = CHAR_getPlayerMaxNum(); BOOL flg = FALSE; getStringFromIndexWithDelim( message, " ", 1, buf, sizeof( buf)); if( strcmp( buf, "alloff" ) == 0 ) { flg = TRUE; }else { floorid = atoi( buf); if( !getStringFromIndexWithDelim( message, " ", 2, buf, sizeof( buf))) { return; } effectid = atoi( buf); if( !getStringFromIndexWithDelim( message, " ", 3, buf, sizeof( buf))) { return; } level = atoi( buf); } for( i = 0 ; i < playernum; i ++) { if( CHAR_CHECKINDEX( i)) { if( CHAR_getInt( i, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER){ if( flg) { int ef = CHAR_getWorkInt( i, CHAR_WORKEFFECT); if( ef != 0 ) { int fd = getfdFromCharaIndex( i); lssproto_EF_send( fd, 0, 0, ""); CHAR_setWorkInt( i, CHAR_WORKEFFECT, 0); } } else if( CHAR_getInt( i, CHAR_FLOOR) == floorid ) { int fd = getfdFromCharaIndex( i); lssproto_EF_send( fd, effectid, level, ""); if( level == 0 ) { CHAR_setWorkInt( i, CHAR_WORKEFFECT, CHAR_getWorkInt( i, CHAR_WORKEFFECT) & ~effectid); } else { CHAR_setWorkInt( i, CHAR_WORKEFFECT, CHAR_getWorkInt( i, CHAR_WORKEFFECT) | effectid); } } } } } } void CHAR_CHAT_DEBUG_setTrans( int charaindex, char *message) { int i; char setTrans[15]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , setTrans, sizeof(setTrans)); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setInt(i, CHAR_TRANSEQUATION, 0); CHAR_setInt(i, CHAR_TRANSMIGRATION, atoi( setTrans )); CHAR_sendCToArroundCharacter( CHAR_getWorkInt( i, CHAR_WORKOBJINDEX )); sprintf( token, "[GM]%s把你转生设置为%d转!", CHAR_getChar( charaindex, CHAR_NAME),(int)atoi(setTrans)); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s转生设置为%d转!", CHAR_getChar( i, CHAR_NAME),(int)atoi(setTrans)); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setInt(charaindex, CHAR_TRANSEQUATION, 0); CHAR_setInt(charaindex, CHAR_TRANSMIGRATION, atoi( setTrans )); CHAR_sendCToArroundCharacter( CHAR_getWorkInt( charaindex, CHAR_WORKOBJINDEX )); sprintf( token, "转生设置为%d转!",(int)atoi(setTrans)); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_shutup(int charindex ,char *message) { char token[100]; char token1[100]; char cdkey[CDKEYLEN]; char buf[256]; char line[256]; unsigned int MAX_USER=0,i; BOOL flg; easyGetTokenFromString( message , 1 , token, sizeof(token)); easyGetTokenFromString( message , 2 , token1, sizeof(token1)); if( strlen(message)==0){ sprintf(buf,"%s","参数不正确"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORYELLOW); return; } if( strlen(token1)==0){ sprintf(buf,"%s","参数不正确--> ON OFF"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORYELLOW); return; } flg = isstring1or0( token1); MAX_USER=getFdnum(); for(i=0;i= 10 )MOREs = TRUE; } } memset( token, 0, sizeof(token)); strcpy( token, "MORE:"); for( i=0; i= sizeof(token) ){ CHAR_talkToCli( charindex, -1 , token , CHAR_COLORWHITE); memset( token, 0, sizeof(token)); strcpy( token, "MORE:"); } strcat( token, temp); continue; } } sprintf( buf1, "NAME:%s UName:%s CDKey:%s Point:[%d,%d,%d]", CHAR_getChar( userindex, CHAR_NAME), CHAR_getUseName( userindex), CHAR_getChar( userindex, CHAR_CDKEY), CHAR_getInt( userindex, CHAR_FLOOR), CHAR_getInt( userindex, CHAR_X), CHAR_getInt( userindex, CHAR_Y) ); CHAR_talkToCli( charindex, -1 , buf1 , colors); } if( MOREs == TRUE ){ CHAR_talkToCli( charindex, -1 , token , CHAR_COLORWHITE); } } void CHAR_CHAT_DEBUG_waeikick( int charindex, char* message ) { char token[100]; char cdkey[CDKEYLEN]; char kcmsg[256],kctalk[256]; char szName[256]; char buf[256]; BOOL find=FALSE; int i=0; unsigned int MAX_USER=0; int fd_charaindex; if( strlen(message)==0){ sprintf(buf,"%s","参数不正确-> 帐号"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } easyGetTokenFromString( message , 1 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } MAX_USER=getFdnum(); for(i=0;i 帐号"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } easyGetTokenFromString( message , 1 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } MAX_USER=getFdnum(); for(i=0;i FLOOR X Y 帐号"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } easyGetTokenFromString( message , 1 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->地图编号"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } fl=atoi( token ); easyGetTokenFromString( message , 2 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->X座标 "); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } x = atoi( token ); easyGetTokenFromString( message , 3 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->Y座标 "); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } y = atoi( token ); easyGetTokenFromString( message , 4 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->帐号"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } for(i=0;i clear/add/send 请用小写"); CHAR_talkToCli(charaindex, -1, buf, CHAR_COLORWHITE); return; } easyGetTokenFromString(message, 1, cmd, sizeof(cmd)); if (strcmp(cmd,"clear")==0) { FILE *f=fopen(ANNOUNCEFILE,"w"); strcpy(buf, "石器时代公告\n"); fwrite(buf, strlen(buf), 1, f); fclose(f); LoadAnnounce(); CHAR_talkToCli(charaindex, -1, "OK", CHAR_COLORWHITE); } else if (strcmp(cmd,"add")==0) { FILE *f; easyGetTokenFromString(message, 2, say, sizeof(say)); if (strlen(say)==0) { sprintf(buf,"%s","参数不正确"); CHAR_talkToCli(charaindex, -1, buf, CHAR_COLORWHITE); return; } if (!(f=fopen(ANNOUNCEFILE,"a+"))) { f=fopen(ANNOUNCEFILE,"w"); strcpy(buf, "石器时代公告\n"); fwrite(buf, strlen(buf), 1, f); } fwrite(say, strlen(say), 1, f); fwrite("\n", sizeof(char), 1, f); fclose(f); LoadAnnounce(); CHAR_talkToCli(charaindex, -1, "OK", CHAR_COLORWHITE); } else if (strcmp(cmd,"send")==0) { int i; for (i=0; i clear/add/send (请用小写)"); CHAR_talkToCli(charaindex, -1, buf, CHAR_COLORWHITE); return; } } void CHAR_CHAT_DEBUG_checklock( int charaindex, char* message ) { char cmd[256]; if( strlen(message)==0){ CHAR_talkToCli(charaindex, -1, "参数不正确", CHAR_COLORWHITE); return; } easyGetTokenFromString( message, 1, cmd, sizeof(cmd)); saacproto_ACLock_send( acfd, cmd, 2, getFdidFromCharaIndex( charaindex)); } void CHAR_CHAT_DEBUG_unlock( int charaindex, char* message ) { char cmd[256]; #ifdef _WAEI_KICK int act=1; #endif if( strlen(message)==0){ CHAR_talkToCli(charaindex, -1, "参数不正确", CHAR_COLORWHITE); return; } easyGetTokenFromString(message, 1, cmd, sizeof(cmd)); #ifdef _WAEI_KICK saacproto_ACKick_send( acfd, cmd, getFdidFromCharaIndex( charaindex), act); #else saacproto_ACLock_send( acfd, cmd, 3, getFdidFromCharaIndex( charaindex)); #endif } void CHAR_CHAT_DEBUG_unlockserver( int charaindex, char* message ) { char cmd[256]; if( strlen(message)==0){ CHAR_talkToCli(charaindex, -1, "参数不正确", CHAR_COLORWHITE); return; } easyGetTokenFromString(message, 1, cmd, sizeof(cmd)); saacproto_ACLock_send( acfd, cmd, 4, getFdidFromCharaIndex( charaindex)); } void CHAR_CHAT_DEBUG_fixfmdata(int charaindex, char *message) { char szCmd[64],szData[64],szFamilyID[8],szID[64]; int i,index = -1,charindex = -1,iPlayerNum = CHAR_getPlayerMaxNum(); if(message == NULL || getStringFromIndexWithDelim(message," ",1,szFamilyID,sizeof(szFamilyID)) == FALSE){ CHAR_talkToCli(charaindex, -1, "参数不正确 [fixfmdata <家族ID> <帐号(or -1)> ]",CHAR_COLORRED); return; } if(message == NULL || getStringFromIndexWithDelim(message," ",2,szID,sizeof(szID)) == FALSE){ CHAR_talkToCli(charaindex, -1, "参数不正确 [fixfmdata <家族ID> <帐号(or -1)> ]",CHAR_COLORRED); return; } if(message == NULL || getStringFromIndexWithDelim(message," ",3,szCmd,sizeof(szCmd)) == FALSE){ CHAR_talkToCli(charaindex, -1, "参数不正确 [fixfmdata <家族ID> <帐号(or -1)> ]",CHAR_COLORRED); return; } if(message == NULL || getStringFromIndexWithDelim(message," ",4,szData,sizeof(szData)) == FALSE){ CHAR_talkToCli(charaindex, -1, "参数不正确 [fixfmdata <家族ID> <帐号(or -1)> ]",CHAR_COLORRED); return; } index = atoi(szFamilyID); if(index < 1 || index > 1000){ CHAR_talkToCli(charaindex,-1,"id 值错误", CHAR_COLORRED); return; } index -= 1; if(szID[0] != '-' && szID[1] != '1'){ for(i=0;i id]"); CHAR_talkToCli(charaindex, -1, buf, CHAR_COLORWHITE); return; } easyGetTokenFromString(message, 1, cmd, sizeof(cmd)); if (strcmp(cmd,"allpeace")==0) { #ifdef _NEW_MANOR_LAW struct tm tm1; memcpy( &tm1, localtime( (time_t *)&NowTime.tv_sec), sizeof( tm1)); #endif CHAR_talkToCli(charaindex, -1, "allpeace", CHAR_COLORWHITE); easyGetTokenFromString(message, 2, cmd, sizeof(cmd)); manorid=atoi(cmd); if ((manorid<1)||(manorid>MANORNUM)) { sprintf(buf,"%s","参数不正确。 id 必须在 1~9 之间。"); CHAR_talkToCli(charaindex, -1, buf, CHAR_COLORWHITE); return; } memcpy( &tm1, localtime( (time_t *)&NowTime.tv_sec), sizeof( tm1)); for (i=0; iMANORNUM)) { sprintf(buf,"%s","参数不正确。 id 必须在 1~9 之间。"); CHAR_talkToCli(charaindex, -1, buf, CHAR_COLORWHITE); return; } for (i=0; i id]"); CHAR_talkToCli(charaindex, -1, buf, CHAR_COLORWHITE); } } void CHAR_CHAT_DEBUG_shutdown(int charindex , char *message ) { char token[10]; int iTime; easyGetTokenFromString( message , 1 , token, sizeof(token)); iTime = atoi( token ); lssproto_Shutdown_recv(0, "hogehoge", iTime); } void CHAR_CHAT_DEBUG_watchevent( int charaindex, char* message ) { #ifdef _ADD_NEWEVENT // WON 多增任务旗标 int event_num = 8; #else int event_num = 6; #endif unsigned int max_user = 0; int charaindex_tmp = 0; int count = 0, point, ckpoint, i, j; char token_cdkey[256], token_name[256], cdkey[CDKEYLEN]; char buf[1024], buf1[64]; BOOL find = FALSE; if( strlen(message)==0 ){ charaindex_tmp = charaindex; find=TRUE; }else{ getStringFromIndexWithDelim( message, " ", 1, token_cdkey, sizeof( token_cdkey)); getStringFromIndexWithDelim( message, " ", 2, token_name, sizeof( token_name)); if( strlen(token_cdkey)==0 || strlen(token_name)==0 ){ sprintf(buf,"%s","参数不正确。正确格式:[wahctevent 帐号 人物名称]"); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORWHITE); return; } max_user = getFdnum(); for( i=0; i 4 || level < 1 || level > gminfo[i].level) { CHAR_talkToCli( charaindex, -1, "修改失败,无法将此帐号等级修改的比自己等级高!level(1~3)", CHAR_COLORWHITE); return; } for (i = 0; i < GMMAXNUM; i++) { if (strcmp(id, gminfo[i].cdkey) == 0) { if (gminfo[i].level > charlevel) { snprintf(tmpbuf, sizeof(tmpbuf), "修改失败,无法修改等级比自己高的帐号!"); CHAR_talkToCli(charaindex, -1, tmpbuf, CHAR_COLORWHITE); return; } gminfo[i].level = level; snprintf(tmpbuf, sizeof(tmpbuf), "修改%s等级为%dOK!", gminfo[i].cdkey, gminfo[i].level); CHAR_talkToCli(charaindex, -1, tmpbuf, CHAR_COLORWHITE); changeflag = 1; break; } } if (changeflag == 0) { snprintf(tmpbuf, sizeof(tmpbuf), "GM列表中查无此帐号,修改失败!"); CHAR_talkToCli(charaindex, -1, tmpbuf, CHAR_COLORWHITE); } } } #endif void CHAR_CHAT_DEBUG_checktrade( int charaindex, char*message ) { if( !strcmp( message, "waei" ) ){ TRADE_CheckTradeListUser(); } } void CHAR_CHAT_DEBUG_showtemp( int charaindex, char*message ) { #ifdef _NPC_SEPARATEDATA if( !CHAR_CHECKINDEX( charaindex) ) return; if( !strcmp( message, "waei" ) ) CHAR_showTempInt( charaindex); #endif } #ifdef _TEST_PETCREATE int avg_num; int m_cindex=-1; typedef struct AllCreatPetMy { char name[128]; int petId; int char_lv; int char_hp; int char_vital; int char_str; int char_tgh; int char_dex; int vital; int str; int tgh; int dex; int fixstr; int fixtgh; int fixdex; int creat_num; }AllCreatPet; AllCreatPet AVGCREATPET[380]={ {"",-1,0,0,0,0,0,0,0,0,0,0,0,0,0,-1}, }; void ResetAVGCREATPET() { int i; for( i=0; i 10000 ) return; if( pet_Id1 < 0 || pet_Id2 < 0 || pet_Id1 > pet_Id2 ) return; ResetAVGCREATPET(); i=0; for( ID=pet_Id1 ; ID <= pet_Id2; ID++) { AVGCREATPET[i].petId = ID; AVGCREATPET[i].char_lv = pet_Lv; AVGCREATPET[i].creat_num = pet_Num; AVGCREATPET[i+1].petId = ID; AVGCREATPET[i+1].char_lv = pet_Lv; AVGCREATPET[i+1].creat_num = pet_Num; print(" AVGCREATPET[%d].petId[%d]", i, ID); i+=2; if( i > arraysizeof( AVGCREATPET)-1 ) break; } avg_num = pet_Num; { char buf[256]; sprintf( buf,"CREAT[%d-%d] LV=%d,num=%d ", pet_Id1, pet_Id2, pet_Lv,pet_Num); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORYELLOW); m_cindex = charaindex; } return; } void DefPetNum( int flg, int petId) { char buf[128]; AVGCREATPET[flg].char_hp /= avg_num; AVGCREATPET[flg].char_vital /= avg_num; AVGCREATPET[flg].char_str /= avg_num; AVGCREATPET[flg].char_tgh /= avg_num; AVGCREATPET[flg].char_dex /= avg_num; AVGCREATPET[flg].vital /= avg_num; AVGCREATPET[flg].str /= avg_num; AVGCREATPET[flg].tgh /= avg_num; AVGCREATPET[flg].dex /= avg_num; AVGCREATPET[flg].fixstr /= avg_num; AVGCREATPET[flg].fixtgh /= avg_num; AVGCREATPET[flg].fixdex /= avg_num; AVGCREATPET[flg+1].char_hp /= avg_num; AVGCREATPET[flg+1].char_vital /= avg_num; AVGCREATPET[flg+1].char_str /= avg_num; AVGCREATPET[flg+1].char_tgh /= avg_num; AVGCREATPET[flg+1].char_dex /= avg_num; AVGCREATPET[flg+1].vital /= avg_num; AVGCREATPET[flg+1].str /= avg_num; AVGCREATPET[flg+1].tgh /= avg_num; AVGCREATPET[flg+1].dex /= avg_num; AVGCREATPET[flg+1].fixstr /= avg_num; AVGCREATPET[flg+1].fixtgh /= avg_num; AVGCREATPET[flg+1].fixdex /= avg_num; sprintf( buf,"%s_%d.log" ,"creatpetlog", petId ); backupTempLogFile( buf, "creatpetlog" , AVGCREATPET[flg].creat_num ); LogCreatPet( AVGCREATPET[flg].name, AVGCREATPET[flg].petId , 1, AVGCREATPET[flg].char_hp, AVGCREATPET[flg].char_vital, AVGCREATPET[flg].char_str, AVGCREATPET[flg].char_tgh, AVGCREATPET[flg].char_dex, AVGCREATPET[flg].vital, AVGCREATPET[flg].str, AVGCREATPET[flg].fixstr,AVGCREATPET[flg].fixtgh, AVGCREATPET[flg].tgh, AVGCREATPET[flg].dex, AVGCREATPET[flg].fixdex, avg_num, 0, 1 ); LogCreatPet( AVGCREATPET[flg+1].name, AVGCREATPET[flg+1].petId , AVGCREATPET[flg+1].char_lv, AVGCREATPET[flg+1].char_hp, AVGCREATPET[flg+1].char_vital, AVGCREATPET[flg+1].char_str, AVGCREATPET[flg+1].char_tgh, AVGCREATPET[flg+1].char_dex, AVGCREATPET[flg+1].vital, AVGCREATPET[flg+1].str, AVGCREATPET[flg+1].fixstr,AVGCREATPET[flg+1].fixtgh, AVGCREATPET[flg+1].tgh, AVGCREATPET[flg+1].dex, AVGCREATPET[flg+1].fixdex, avg_num, 0, 1 ); } void TEST_CreatPet( ) { int floor=777; char buf[128]; int petindex; int ret,pet_list; int k,lvup,i,j; int ID=-1; int pet_Num=40,struct_num=-1; int pet_Lv = -1; { if( m_cindex >= 0 ) { char buf[256]; sprintf( buf,"CREAT Start !!"); CHAR_talkToCli( m_cindex, -1, buf, CHAR_COLORYELLOW); } } if( AVGCREATPET[0].creat_num <= 0 && AVGCREATPET[0].petId < 0 ) { if( m_cindex >= 0 ) CHAR_talkToCli( m_cindex, -1, "FAIL !", CHAR_COLORYELLOW); m_cindex = -1; return; }else { if( m_cindex >= 0 ) CHAR_talkToCli( m_cindex, -1, "OK !", CHAR_COLORYELLOW); m_cindex = -1; } for( i=arraysizeof( AVGCREATPET)-2; i>=0; i-=2 ) { //creat_num if( AVGCREATPET[i].petId >= 0 ) { if( AVGCREATPET[i].creat_num <= 0 ) { AVGCREATPET[ i].petId = -1; AVGCREATPET[i+1].petId = -1; }else { ID = AVGCREATPET[i].petId; struct_num = i; pet_Lv = AVGCREATPET[i].char_lv; break; } } } if( ID < 0 && pet_Lv <= 0 && struct_num <= 0 ) return; pet_list = ENEMY_getEnemyArrayFromId( ID); if( !ENEMY_CHECKINDEX( pet_list) ){ AVGCREATPET[ struct_num].petId = -1; AVGCREATPET[struct_num+1].petId = -1; AVGCREATPET[struct_num].creat_num = 0; AVGCREATPET[struct_num+1].creat_num = 0; return; } //creat宠物 for( j=0; j < pet_Num; j++ ) { if( AVGCREATPET[struct_num].creat_num <= 0 ) { DefPetNum( struct_num, AVGCREATPET[struct_num].petId); AVGCREATPET[struct_num].petId = -1; AVGCREATPET[struct_num+1].petId = -1; AVGCREATPET[struct_num].creat_num = 0; AVGCREATPET[struct_num+1].creat_num = 0; //计算 return; } ret = ENEMY_TEST_createPetIndex( pet_list ); //ret = ENEMY_createPetFromEnemyIndex( charaindex, pet_list); if( CHAR_CHECKINDEX( ret ) == TRUE ){ CHAR_setMaxExpFromLevel( ret, pet_Lv); } petindex = ret; //log CHAR_complianceParameter( petindex ); lvup = CHAR_getInt( petindex, CHAR_ALLOCPOINT); LogCreatPet( CHAR_getChar( petindex, CHAR_NAME ), CHAR_getInt( petindex, CHAR_PETID ), CHAR_getInt( petindex, CHAR_LV ), CHAR_getInt( petindex, CHAR_HP ), CHAR_getInt( petindex, CHAR_VITAL), CHAR_getInt( petindex, CHAR_STR), CHAR_getInt( petindex, CHAR_TOUGH), CHAR_getInt( petindex, CHAR_DEX), (lvup >> 24 ), ((lvup >> 16)&0xff), ((lvup >> 8)&0xff), (lvup&0xff), CHAR_getWorkInt(petindex,CHAR_WORKFIXSTR), CHAR_getWorkInt(petindex,CHAR_WORKFIXTOUGH), CHAR_getWorkInt(petindex,CHAR_WORKFIXDEX), lvup, CHAR_getInt( petindex, CHAR_PETRANK ) , 0 ); sprintf( buf,"%s", CHAR_getChar( petindex, CHAR_NAME )); memcpy( AVGCREATPET[struct_num].name, buf, sizeof( AVGCREATPET[struct_num].name) ); AVGCREATPET[struct_num].creat_num -=1; //记录 AVGCREATPET[struct_num].char_hp += CHAR_getInt( petindex, CHAR_HP ); AVGCREATPET[struct_num].char_vital += CHAR_getInt( petindex, CHAR_VITAL); AVGCREATPET[struct_num].char_str += CHAR_getInt( petindex, CHAR_STR); AVGCREATPET[struct_num].char_tgh += CHAR_getInt( petindex, CHAR_TOUGH); AVGCREATPET[struct_num].char_dex += CHAR_getInt( petindex, CHAR_DEX); AVGCREATPET[struct_num].vital += (lvup >> 24 ); AVGCREATPET[struct_num].str += ((lvup >> 16)&0xff); AVGCREATPET[struct_num].tgh += ((lvup >> 8)&0xff); AVGCREATPET[struct_num].dex += (lvup&0xff); AVGCREATPET[struct_num].fixstr = CHAR_getWorkInt(petindex,CHAR_WORKFIXSTR); AVGCREATPET[struct_num].fixtgh = CHAR_getWorkInt(petindex,CHAR_WORKFIXTOUGH); AVGCREATPET[struct_num].fixdex = CHAR_getWorkInt(petindex,CHAR_WORKFIXDEX); CHAR_PetTakeLevelUp( petindex, pet_Lv);//强制宠物升级 CHAR_setInt( petindex , CHAR_HP , CHAR_getWorkInt( petindex , CHAR_WORKMAXHP ) ); //log lvup = CHAR_getInt( petindex, CHAR_ALLOCPOINT); LogCreatPet( CHAR_getChar( petindex, CHAR_NAME ), CHAR_getInt( petindex, CHAR_PETID ), CHAR_getInt( petindex, CHAR_LV ), CHAR_getInt( petindex, CHAR_HP ), CHAR_getInt( petindex, CHAR_VITAL), CHAR_getInt( petindex, CHAR_STR), CHAR_getInt( petindex, CHAR_TOUGH), CHAR_getInt( petindex, CHAR_DEX), (lvup >> 24 ), ((lvup >> 16)&0xff), ((lvup >> 8)&0xff), (lvup&0xff), CHAR_getWorkInt(petindex,CHAR_WORKFIXSTR), CHAR_getWorkInt(petindex,CHAR_WORKFIXTOUGH), CHAR_getWorkInt(petindex,CHAR_WORKFIXDEX), lvup, CHAR_getInt( petindex, CHAR_PETRANK ) , 0); sprintf( buf,"%s", CHAR_getChar( petindex, CHAR_NAME )); memcpy( AVGCREATPET[struct_num+1].name, buf, sizeof( AVGCREATPET[struct_num+1].name) ); AVGCREATPET[struct_num+1].creat_num -=1; AVGCREATPET[struct_num + 1].char_hp += CHAR_getInt( petindex, CHAR_HP ); AVGCREATPET[struct_num + 1].char_vital += CHAR_getInt( petindex, CHAR_VITAL); AVGCREATPET[struct_num + 1].char_str += CHAR_getInt( petindex, CHAR_STR); AVGCREATPET[struct_num + 1].char_tgh += CHAR_getInt( petindex, CHAR_TOUGH); AVGCREATPET[struct_num + 1].char_dex += CHAR_getInt( petindex, CHAR_DEX); AVGCREATPET[struct_num + 1].vital += (lvup >> 24 ); AVGCREATPET[struct_num + 1].str += ((lvup >> 16)&0xff); AVGCREATPET[struct_num + 1].tgh += ((lvup >> 8)&0xff); AVGCREATPET[struct_num + 1].dex += (lvup&0xff); AVGCREATPET[struct_num + 1].fixstr = CHAR_getWorkInt(petindex,CHAR_WORKFIXSTR); AVGCREATPET[struct_num + 1].fixtgh = CHAR_getWorkInt(petindex,CHAR_WORKFIXTOUGH); AVGCREATPET[struct_num + 1].fixdex = CHAR_getWorkInt(petindex,CHAR_WORKFIXDEX); CHAR_PetTakeDrop( petindex, floor, -1, -1); //强制丢弃宠物 CHAR_setInt( petindex, CHAR_PUTPETTIME, NowTime.tv_sec); } sprintf( buf,"%s_%d.log" ,"creatpetlog", AVGCREATPET[struct_num].petId ); backupTempLogFile( buf, "creatpetlog" , AVGCREATPET[struct_num].creat_num); for( k=20000; k>=0; k-- ) { if( CHAR_CHECKINDEX( k ) == FALSE ) continue; if( CHAR_getInt ( k, CHAR_WHICHTYPE) != CHAR_TYPEPET ) continue; if( CHAR_getInt( k, CHAR_FLOOR ) == 777 ) { CHAR_CharaDelete( k); ITEM_endExistItemsOne( k); } } } #endif void CHAR_CHAT_DEBUG_cleanfloor( int charaindex, char *message) { char buf[256]; int floor, objindex, itemnum=0,petnum=0,goldnum=0; int objmaxnum = OBJECT_getNum(); floor = atoi( message); for( objindex=0; objindex 10000) set_num = 10000; CHAR_setInt( charaindex, CHAR_GAMBLENUM, set_num); sprintf( buf,"个人游乐场积分设为%d点。", CHAR_getInt( charaindex, CHAR_GAMBLENUM)); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORYELLOW); return; } #endif void CHAR_CHAT_DEBUG_petlevelup( int charaindex, char* message ) { int level, petindex, petid, mylevel,i,j,k; char buf[10]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , buf, sizeof(buf)); level=atoi(buf); easyGetTokenFromString( message , 2 , buf, sizeof(buf)); petid=atoi(buf)-1; easyGetTokenFromString( message , 3 , cdkey, sizeof(cdkey)); if(level > 200 ) level=200; if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } petindex = CHAR_getCharPet( i, petid); if( !CHAR_CHECKINDEX( petindex) ){ sprintf( token, "玩家%s宠物栏%d上没宠物!", CHAR_getChar( i, CHAR_NAME),petid); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); return; } mylevel = CHAR_getInt( petindex, CHAR_LV); level = level-mylevel; for( j = 1; j <= level; j ++ ){ //升级 CHAR_PetLevelUp( petindex ); CHAR_PetAddVariableAi( petindex, AI_FIX_PETLEVELUP ); CHAR_setInt( petindex, CHAR_LV, CHAR_getInt( petindex, CHAR_LV) +1 ); } CHAR_complianceParameter( petindex ); CHAR_setInt( petindex , CHAR_HP , CHAR_getWorkInt( petindex , CHAR_WORKMAXHP ) ); sprintf( token, "[GM]%s把你宠物栏%d的宠物设为%d级!", CHAR_getChar( charaindex, CHAR_NAME), petid, level); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的宠物栏%d的宠物设为%d级!", CHAR_getChar( i, CHAR_NAME), petid, level); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); }else{ petindex = CHAR_getCharPet( charaindex, petid); if( !CHAR_CHECKINDEX( petindex) ){ sprintf( token, "你的宠物栏%d上没宠物!", petid); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); return; } mylevel = CHAR_getInt( petindex, CHAR_LV); level = level-mylevel; for( j = 1; j <= level; j ++ ){ //升级 CHAR_PetLevelUp( petindex ); CHAR_PetAddVariableAi( petindex, AI_FIX_PETLEVELUP ); CHAR_setInt( petindex, CHAR_LV, CHAR_getInt( petindex, CHAR_LV) +1 ); } CHAR_complianceParameter( petindex ); CHAR_setInt( petindex , CHAR_HP , CHAR_getWorkInt( petindex , CHAR_WORKMAXHP ) ); sprintf( token, "把宠物栏%d的宠物设为%d级!", petid, level); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); } } void CHAR_CHAT_DEBUG_engineer( int charindex, char *message) { int MaxGold; if( !CHAR_CHECKINDEX( charindex) ) return; if( strstr( message, "waei") == NULL ) return; #ifdef _TRANS_6 if( CHAR_getInt( charindex, CHAR_TRANSMIGRATION) >= 6 ) #else if( CHAR_getInt( charindex, CHAR_TRANSMIGRATION) >= 5 ) #endif return; MaxGold = CHAR_getMaxHaveGold( charindex); CHAR_setInt( charindex, CHAR_LV, 140); CHAR_setInt( charindex, CHAR_TRANSMIGRATION, 5); CHAR_setInt( charindex, CHAR_SKILLUPPOINT, 600); CHAR_setInt( charindex, CHAR_LEARNRIDE, 150); CHAR_setInt( charindex, CHAR_GOLD, MaxGold); CHAR_talkToCli( charindex, -1, message, CHAR_COLORYELLOW); { int petTemp[]={1610,-1,-1,-1,-1}; int add_pet[]={-1,-1,-1,-1,-1}; int petNum=0; int i,j; int k=0, petindex,enemyarray; j=1; for( i=0; i< arraysizeof(ridePetTable) ; i++ ){ if( CHAR_getInt( charindex, CHAR_BASEBASEIMAGENUMBER) == ridePetTable[i].charNo ){ petTemp[j]= ridePetTable[i].petId; j++; if( j >= arraysizeof( petTemp) ) break; } } j=0; for( petNum=0; petNum= arraysizeof( gmset) ) { CHAR_talkToCli(charindex, -1, "参数不正确", CHAR_COLORYELLOW); return; } act = i; // WON FIX 5 --> 6 if( act < 0 || act > 6 ){ CHAR_talkToCli(charindex, -1, "参数不正确", CHAR_COLORYELLOW); return; } } saacproto_ACKick_send( acfd, cmd, getFdidFromCharaIndex( charindex), act); } #endif void CHAR_CHAT_DEBUG_remserver( int charaindex, char *message ) { #ifdef _M_SERVER if( !CHAR_CHECKINDEX( charaindex) ) return; if( strstr( message, "on") != NULL ) { if (mfd < 0){ mfd = connectmServer(getmservername(),getmserverport()); if (mfd != -1){ initConnectOne(mfd,NULL,0); CHAR_talkToCli(charaindex, -1, "Connect OK", CHAR_COLORYELLOW); }else{ CHAR_talkToCli(charaindex, -1, "Connect FAIL", CHAR_COLORYELLOW); } }else { CHAR_talkToCli(charaindex, -1, "Connect Be LINK", CHAR_COLORYELLOW); } }else if( strstr( message, "off") != NULL ){ if (mfd >= 0){ CONNECT_endOne_debug(mfd); close(mfd); mfd = -1; CHAR_talkToCli(charaindex, -1, "Connect Be CLOSE", CHAR_COLORYELLOW); }else { CHAR_talkToCli(charaindex, -1, "Connect Not Be LINK", CHAR_COLORYELLOW); } } #endif } //丧志 #ifdef _M_SERVER void CHAR_CHAT_DEBUG_reloadmsip( int charaindex, char *message) { char buf1[256]; memset( buf1, 0, sizeof( buf1)); if( getStringFromIndexWithDelim( message, " ", 1, buf1, sizeof( buf1)) == FALSE ) return; setmservername( buf1); if( getStringFromIndexWithDelim( message, " ", 2, buf1, sizeof( buf1)) != FALSE ){ setmserverport( atoi( buf1)); } memset( buf1, 0, sizeof( buf1)); sprintf( buf1, "MServer IP:%s PORT:%d", getmservername(), getmserverport() ); CHAR_talkToCli( charaindex, -1, buf1, CHAR_COLORYELLOW); } #endif // WON ADD 当机指令 void CHAR_CHAT_DEBUG_crash(int charaindex , char *message) { int fd; fd = CHAR_getWorkInt( charaindex, CHAR_WORKFD); CHAR_Talk( fd, charaindex, message, 1, 3 ); /* char msg[1]; printf("\n carsh GMSV !! \n"); //sprintf( msg, "%s", CHAR_getChar( charaindex, CHAR_NAME ) ); sprintf( msg, "12345" ); */ } #ifdef _PETSKILL_SETDUCK void CHAR_CHAT_DEBUG_SetDuck( int charaindex, char *message) { CHAR_setWorkInt( charaindex, CHAR_MYSKILLDUCK, atoi( message)); CHAR_setWorkInt( charaindex, CHAR_MYSKILLDUCKPOWER, 100 ); } #endif #ifdef _TYPE_TOXICATION void CHAR_CHAT_DEBUG_Toxication( int charaindex, char *message) { int fd = getfdFromCharaIndex( charaindex ); if( strstr( message, "TRUE") != 0){ CHAR_talkToCli( charaindex, -1, "中毒", CHAR_COLORYELLOW); setToxication( fd, 1); }else { setToxication( fd, 0); } } #endif #ifdef _ACTION_BULLSCR void CHAR_CHAT_DEBUG_getascore(int charindex, char *message) { int witchi[5] = { -1,CHAR_ABULLSTART, CHAR_ABULLSCORE, CHAR_ABULLTIME, CHAR_ABULLSTARTTIME}; char witchn[5][256]={"全","参与旗标","活动绩分","战斗累积时间","开始时间"}; char witchs[5][256]={"all","start","score","btime","stime"}; int i; for( i=0; i<5; i++) { if( strstr( message, witchs[i]) != 0 ){ char buf[256]; if( i == 0 ){ sprintf( buf, "%s:%d %s:%d %s:%d %s:%d。", witchn[1], CHAR_getInt( charindex, witchi[1]), witchn[2], CHAR_getInt( charindex, witchi[2]), witchn[3], CHAR_getInt( charindex, witchi[3]), witchn[4], CHAR_getInt( charindex, witchi[4])); }else{ if( i == 2 ){ int batime = CHAR_getInt( charindex, witchi[i]); sprintf( buf, "%s : %d分%d秒。", witchn[i], batime/60, batime%60 ); }else { sprintf( buf, "%s : %d。", witchn[i], CHAR_getInt( charindex, witchi[i]) ); } } CHAR_talkToCli( charindex, -1, buf, CHAR_COLORYELLOW); break; } } } void CHAR_CHAT_DEBUG_setascore(int charindex, char *message) { int witchi[3] = {CHAR_ABULLSTART,CHAR_ABULLSCORE,CHAR_ABULLSTARTTIME}; char witchs[3][256]={"start","score","stime"}; char buf1[256]; memset( buf1, 0, sizeof( buf1)); if( getStringFromIndexWithDelim( message, " ", 1, buf1, sizeof( buf1)) == FALSE ) return; if( strstr( buf1, "clean") != 0 ){ }else { int i; for( i=0; i<3; i++) { if( strstr( buf1, witchs[i]) != 0 ){ char buf2[256]; int nums=0; char witchn[3][256]={"参与旗标","活动绩分","开始时间"}; if( getStringFromIndexWithDelim( message, " ", 2, buf2, sizeof( buf2)) == FALSE ) return; nums = atoi( buf2); if( i == 2 ) { sprintf( buf2, "%s设定为提前%d。", witchn[i], nums); nums = (nums * 24) * (60 * 60); nums = (int)time( NULL) - nums; }else{ sprintf( buf2, "%s设定为%d。", witchn[i], nums); } CHAR_setInt( charindex, witchi[i], nums); CHAR_talkToCli( charindex, -1, buf2, CHAR_COLORYELLOW); return; } } } } #endif #ifdef _CHAR_POOLITEM void CHAR_CHAT_DEBUG_saveditem(int charaindex, char *message) { if( CHAR_SaveDepotItem( charaindex) == FALSE ){ CHAR_talkToCli( charaindex, -1, "储存失败!", CHAR_COLORYELLOW); } } void CHAR_CHAT_DEBUG_insertditem(int charaindex, char *message) { if( CHAR_GetDepotItem( -1, charaindex) == FALSE ){ CHAR_talkToCli( charaindex, -1, "读取失败!", CHAR_COLORYELLOW); } } void CHAR_CHAT_DEBUG_ShowMyDepotItems( int charaindex, char *message ) { if( !CHAR_CheckDepotItem( charaindex) ){ char token[256]; sprintf( token, "尚未取得仓库。"); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORYELLOW); return; } CHAR_ShowMyDepotItems( charaindex); } void CHAR_CHAT_DEBUG_InSideMyDepotItems( int charaindex, char *message ) { int i, j, itemindex, count=0; char token[256]; if( !CHAR_CheckDepotItem( charaindex) ){ sprintf( token, "尚未取得仓库。"); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORYELLOW); return; } for( i=CHAR_STARTITEMARRAY; i 0 ){ char buf[256]; sprintf( buf, "清除%d 置宠物。", delobjnum); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORRED); } } #ifdef _NEW_PLAYERGOLD void CHAR_CHAT_DEBUG_acnewplayer(int charaindex, char *message) { char CdKey[256], UserName[256], buf[256]; int RunType; memset( buf, 0, sizeof( buf)); if( getStringFromIndexWithDelim( message, " ", 1, buf, sizeof( buf)) == FALSE ) return; buf[ strlen( buf)+1]=0; memcpy( CdKey, buf, strlen( buf)+1); if( getStringFromIndexWithDelim( message, " ", 2, buf, sizeof( buf)) == FALSE ) return; buf[ strlen( buf)+1]=0; memcpy( UserName, buf, strlen( buf)+1); if( getStringFromIndexWithDelim( message, " ", 3, buf, sizeof( buf)) == FALSE ) return; buf[ strlen( buf)+1]=0; RunType = atoi( buf); if( RunType < 1 || RunType > 2 ){ CHAR_talkToCli( charaindex, -1, "参数错误", CHAR_COLORRED); return; } saacproto_ACNEWPlayerList_send( acfd, CdKey, UserName, charaindex, RunType); } void CHAR_CHAT_DEBUG_loadnewplayer( int charaindex, char*message ) { saacproto_LoadNEWPlayer_send( acfd, charaindex, message); } #endif #ifdef _SEND_EFFECT // WON ADD AC送下雪、下雨等特效 void CHAR_CHAT_DEBUG_sendeffect( int charaindex, char *message) { int i, j, effect, level; char buf[256]; struct tm tm1; int playernum = CHAR_getPlayerMaxNum(); int player; int efnum = 0; struct { int floor; int effect; BOOL on; BOOL off; } ef[2048]; memcpy( &tm1, localtime( (time_t *)&NowTime.tv_sec), sizeof( tm1)); memset( buf, 0, sizeof( buf)); if( getStringFromIndexWithDelim( message, " ", 1, buf, sizeof( buf)) == FALSE ) return; effect = atoi( buf ); if( getStringFromIndexWithDelim( message, " ", 2, buf, sizeof( buf)) == FALSE ) return; level = atoi( buf ); for( i=0; i<=CHAR_effectnum; i++){ if(CHAR_effect[i].floor){ CHAR_effect[i].effect = effect; CHAR_effect[i].level = level; CHAR_effect[i].sendflg = FALSE; snprintf( CHAR_effect[i].month , sizeof( CHAR_effect[i].month) , "%d" , tm1.tm_mon+1); snprintf( CHAR_effect[i].day , sizeof( CHAR_effect[i].day) , "%d" , tm1.tm_mday); snprintf( CHAR_effect[i].hour , sizeof( CHAR_effect[i].hour) , "%d" , tm1.tm_hour); snprintf( CHAR_effect[i].min , sizeof( CHAR_effect[i].min) , "%d" , tm1.tm_min); snprintf( CHAR_effect[i].expire , sizeof( CHAR_effect[i].expire), "300000" ); }// if }// for i memset( &ef, 0, sizeof( ef)); for( i = 0; i < CHAR_effectnum; i ++){ if( !CHAR_effect[i].sendflg) { for( player = 0 ; player < playernum; player ++ ) { if( !CHAR_CHECKINDEX( player ) ) continue; if( CHAR_getInt( player, CHAR_FLOOR) == CHAR_effect[i].floor ) { int fd = getfdFromCharaIndex( player); lssproto_EF_send( fd, CHAR_effect[i].effect, CHAR_effect[i].level, ""); if( CHAR_effect[i].level == 0 ) { CHAR_setWorkInt( player, CHAR_WORKEFFECT, CHAR_getWorkInt( player, CHAR_WORKEFFECT) & ~CHAR_effect[i].effect); }else { CHAR_setWorkInt( player, CHAR_WORKEFFECT, CHAR_getWorkInt( player, CHAR_WORKEFFECT) | CHAR_effect[i].effect); } } } CHAR_effect[i].sendflg = TRUE; } for( j = 0; j < efnum; j ++ ) { if( ef[j].floor == CHAR_effect[i].floor && ef[j].effect == CHAR_effect[i].effect) { ef[j].on = TRUE; break; } } if( j == efnum ) { ef[j].floor = CHAR_effect[i].floor; ef[j].effect = CHAR_effect[i].effect; ef[j].on = TRUE; efnum++; if( efnum >= arraysizeof( ef)) { print( "err buffer over %s:%d\n", __FILE__, __LINE__); efnum --; } } } for( i = 0; i < efnum; i ++ ) { if( ef[i].on == FALSE && ef[i].off == TRUE ) { for( player = 0 ; player < playernum; player ++ ) { if( !CHAR_CHECKINDEX( player ) ) continue; if( CHAR_getInt( player, CHAR_FLOOR) == ef[i].floor ) { int fd = getfdFromCharaIndex( player); lssproto_EF_send( fd, 0, 0, ""); CHAR_setWorkInt( player, CHAR_WORKEFFECT, 0); } } } } } #endif void CHAR_CHAT_DEBUG_checktime( int charaindex, char *message) { time_t newsec; char buf[256]; char WKday[7][32]={"日","一","二","叁","四","五","六"}; struct tm *p; newsec = time( NULL); p = localtime( &newsec); // newsec = localtime( &newsec); sprintf( buf, "今天:%d年%d月%d日 %s %d:%d:%d ...newsec:%ld。", (1900+p->tm_year), (1+p->tm_mon), p->tm_mday, WKday[p->tm_wday], p->tm_hour, p->tm_min, p->tm_sec, newsec ); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORRED); //p = (struct tm *)calloc( 1, sizeof( struct tm) ); //if( p == NULL ) return; if( getStringFromIndexWithDelim( message, "/", 1, buf, sizeof( buf)) == FALSE ) return; print("ANDY 1.buf:%s\n", buf); p->tm_year = atoi( buf)-1900; if( getStringFromIndexWithDelim( message, "/", 2, buf, sizeof( buf)) == FALSE ) return; print("ANDY 2.buf:%s\n", buf); p->tm_mon = atoi( buf)-1; if( getStringFromIndexWithDelim( message, "/", 3, buf, sizeof( buf)) == FALSE ) return; print("ANDY 3.buf:%s\n", buf); p->tm_mday = atoi( buf); if( getStringFromIndexWithDelim( message, "/", 4, buf, sizeof( buf)) == FALSE ) return; p->tm_wday = atoi( buf); if( p->tm_wday < 0 || p->tm_wday >= 7 ) p->tm_wday = 0; if( getStringFromIndexWithDelim( message, "/", 5, buf, sizeof( buf)) == FALSE ) return; p->tm_hour = atoi( buf); if( getStringFromIndexWithDelim( message, "/", 6, buf, sizeof( buf)) == FALSE ) return; p->tm_min = atoi( buf); if( getStringFromIndexWithDelim( message, "/", 7, buf, sizeof( buf)) == FALSE ) return; p->tm_sec = atoi( buf); newsec = mktime( p); sprintf( buf, "确认1:%d年%d月%d日 %s %d:%d:%d ...newsec:%ld。", (1900+p->tm_year), (1+p->tm_mon), p->tm_mday, WKday[p->tm_wday], p->tm_hour, p->tm_min, p->tm_sec, newsec ); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORRED); p = localtime( &newsec); sprintf( buf, "确认2:%d年%d月%d日 %s %d:%d:%d ...newsec:%ld..time:%d。", (1900+p->tm_year), (1+p->tm_mon), p->tm_mday, WKday[p->tm_wday], p->tm_hour, p->tm_min, p->tm_sec, newsec, (int)time(NULL)); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORRED); } #ifdef _ACTION_GMQUE void CHAR_CHAT_DEBUG_cleanqute( int charaindex, char *message) { char cdkey[256], name[256]; int i; int playernum = CHAR_getPlayerMaxNum(); memset( cdkey, 0, sizeof( cdkey) ); memset( name, 0, sizeof( name) ); if( getStringFromIndexWithDelim( message, " ", 1, cdkey, sizeof( cdkey)) == FALSE ) return; if( getStringFromIndexWithDelim( message, " ", 2, name, sizeof( name)) == FALSE ) return; for( i=0; i 0){ int i,pclass = CHAR_getInt(charaindex,PROFESSION_CLASS) - 1; for(i=0;i 0 ){ array = PROFESSION_SKILL_getskillArray( skillid ); memset(token, 0, sizeof(token)); sprintf( token, "P%d(%s) ", i+1, PROFESSION_SKILL_getChar(array, PROFESSION_SKILL_NAME) ); if( strcmp(token, "") != 0) strcat( msg, token ); } } CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORRED); } CHAR_sendCToArroundCharacter( CHAR_getWorkInt( charaindex , CHAR_WORKOBJINDEX )); } #endif void CHAR_CHAT_DEBUG_samecode( int charaindex, char *message) { char buf1[256], buf2[256]; char cmd[3][256]={ "pet", "item", "set" }; int type=-1, j, total = 0; BOOL checkn = FALSE; int MAXPLAYER = CHAR_getPlayerMaxNum(); int MAXITEM = ITEM_getITEM_itemnum(); int MAXPET = CHAR_getPetMaxNum(); if( getStringFromIndexWithDelim( message, " ", 1, buf1, sizeof( buf1) ) == FALSE )return; for( j=0; j<3; j++){ if( strstr( buf1, cmd[j]) != NULL ){ type = j; break; } } if( j >= 3 ){ CHAR_talkToCli( charaindex, -1, "参数错误!", CHAR_COLORRED); return; } switch( type){ case 0: if( getStringFromIndexWithDelim( message, " ", 2, buf1, sizeof( buf1) ) == TRUE ){ checkn = TRUE; } for( j=MAXPLAYER; j 帐号 分钟"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } //flg = isstring1or0( token1); minu = atoi( token1 ); MAX_USER=getFdnum(); for(i=0;i--token=%s",token); if(strcmp(token,cdkey)==0){ int index = CONNECT_getCharaindex( i ); //print("\n--find-->cdkey %s",cdkey); //CONNECT_set_shutup(i,TRUE); // Robin CHAR_setInt(index,CHAR_SILENT, minu*60); //CHAR_setInt(index,CHAR_SILENT, (int)NowTime.tv_sec +(minu*60) ); { CHAR_setWorkInt( index, CHAR_WORKLOGINTIME, (int)NowTime.tv_sec); } //print(" set_silent:%s:%dmin ", cdkey, minu); //print("\n= 220 ){ CHAR_talkToCli( charindex, -1, token, CHAR_COLORYELLOW); strcpy( token, "可用GM指令:"); } strcat( token, buf2); continue; }else{ if( strstr( buf1, buf) != NULL || strstr( buf2, buf) != NULL ){ sprintf( token, "GM指令:[%s %s]", buf1, buf2); CHAR_talkToCli( charindex, -1, token, CHAR_COLORYELLOW); } continue; } } if( type == 1 ) CHAR_talkToCli( charindex, -1, token, CHAR_COLORYELLOW); } #ifdef _GM_IDENTIFY void CHAR_CHAR_DEBUG_gmidentify( int charaindex, char* message ) { int i; int MAX_USER=getFdnum(); //玩家数量 CHAR_setChar(charaindex, CHAR_GMIDENTIFY, message); //设定gm字串 CHAR_sendCToArroundCharacter(CHAR_getWorkInt( charaindex, CHAR_WORKOBJINDEX )); //传送给周围的人 //for(i=0;i= iPlayerNum){ CHAR_talkToCli(charaindex,-1,"找不到这名玩家",CHAR_COLORYELLOW); return; } CHAR_setInt(i,CHAR_MOMENTUM,id); sprintf(szMsg,"目前气势值: %d",CHAR_getInt(i,CHAR_MOMENTUM)/100); CHAR_talkToCli(charaindex,-1,szMsg,CHAR_COLORYELLOW); sprintf(buf,"%d",id); fd = getfdFromCharaIndex(i); saacproto_ACFixFMData_send(acfd, CHAR_getChar(i,CHAR_FMNAME),CHAR_getInt(i,CHAR_FMINDEX),CHAR_getWorkInt(i,CHAR_WORKFMINDEXI), FM_FIX_FMMOMENTUM,buf,"",CHAR_getWorkInt(i,CHAR_WORKFMCHARINDEX),CONNECT_getFdid(fd)); return; } void CHAR_CHAT_DEBUG_set_manor_owner( int charindex, char* message ) { int i,index = -1,iUseFlag; char szId[8],szUseFlag[2],szFamilyNameOrID[64],szToken[4096],szFamilyIndex[8],szGetFamilyName[64]; if(message == NULL || getStringFromIndexWithDelim(message," ",1,szId,sizeof(szId)) == FALSE){ CHAR_talkToCli(charindex,-1, "参数不正确 [set_manor_owner 庄园id(1~9) 使用旗标(0:名称 1:id) 家族名称或id]", CHAR_COLORRED); return; } if(atoi(szId) < 1 || atoi(szId) > MANORNUM){ CHAR_talkToCli(charindex,-1, "庄园ID值不正确(1~9)", CHAR_COLORRED); return; } if(getStringFromIndexWithDelim(message," ",2,szUseFlag,sizeof(szUseFlag)) == FALSE){ CHAR_talkToCli(charindex,-1, "参数不正确 [set_manor_owner 庄园id(1~9) 使用旗标(0:名称 1:id) 家族名称或id]", CHAR_COLORRED); return; } iUseFlag = atoi(szUseFlag); if(iUseFlag < 0 || iUseFlag > 1){ CHAR_talkToCli(charindex,-1, "使用旗标值不正确(0:名称 1:id)", CHAR_COLORRED); return; } if(getStringFromIndexWithDelim(message," ",3,szFamilyNameOrID,sizeof(szFamilyNameOrID)) == FALSE){ CHAR_talkToCli(charindex,-1, "参数不正确 [set_manor_owner 庄园id(1~9) 使用旗标(0:名称 1:id) 家族名称或id]", CHAR_COLORRED); return; } if(iUseFlag == 1){ // 检查是否都是数字 for(i=0;i '9' || szFamilyNameOrID < '0'){ CHAR_talkToCli(charindex,-1, "家族id格式错误", CHAR_COLORRED); return; } } for(i=0;;i++){ if(getStringFromIndexWithDelim(familyListBuf,"|",i,szToken,sizeof(szToken))){ if((getStringFromIndexWithDelim(szToken," ",1,szFamilyIndex,sizeof(szFamilyIndex))) && (getStringFromIndexWithDelim(szToken," ",2,szGetFamilyName,sizeof(szGetFamilyName)))){ if(strcmp(szFamilyNameOrID,szFamilyIndex) == 0){ index = atoi(szFamilyIndex) - 1; break; } } } else break; } if(index == -1){ CHAR_talkToCli(charindex,-1,"找不到此家族资料", CHAR_COLORRED); return; } sprintf(szToken,"庄园 %s 设定给 %s 家族",szId,szGetFamilyName); saacproto_ACFixFMPoint_send(acfd,szGetFamilyName,index+1,index,szGetFamilyName,index+1,index,atoi(szId)); } else{ for(i=0;;i++){ if(getStringFromIndexWithDelim(familyListBuf,"|",i,szToken,sizeof(szToken))){ if((getStringFromIndexWithDelim(szToken," ",1,szFamilyIndex,sizeof(szFamilyIndex))) && (getStringFromIndexWithDelim(szToken," ",2,szGetFamilyName,sizeof(szGetFamilyName)))){ if(strcmp(szFamilyNameOrID,szGetFamilyName) == 0){ index = atoi(szFamilyIndex) - 1; break; } } } else break; } if(index == -1){ CHAR_talkToCli(charindex,-1,"找不到此家族资料", CHAR_COLORRED); return; } sprintf(szToken,"庄园 %s 设定给 %s 家族",szId,szFamilyNameOrID); saacproto_ACFixFMPoint_send(acfd,szFamilyNameOrID,index+1,index,szFamilyNameOrID,index+1,index,atoi(szId)); } CHAR_talkToCli(charindex,-1,szToken,CHAR_COLORRED); } void CHAR_CHAT_DEBUG_set_schedule_time( int charindex, char* message ) { struct tm tm1; int i,char_max = CHAR_getCharNum(); char szId[8],szTime[12],szMsg[128]; if(message == NULL || getStringFromIndexWithDelim(message," ",1,szId,sizeof(szId)) == FALSE){ CHAR_talkToCli(charindex,-1, "参数不正确 [set_schedule_time 庄园id(1~9) 时间(分)]", CHAR_COLORRED); return; } if(atoi(szId) < 1 || atoi(szId) > MANORNUM){ CHAR_talkToCli(charindex,-1, "庄园ID值不正确", CHAR_COLORRED); return; } if(getStringFromIndexWithDelim(message," ",2,szTime,sizeof(szTime)) == FALSE){ CHAR_talkToCli(charindex,-1, "参数不正确 [set_schedule_time 庄园id(1~9) 时间(分)]", CHAR_COLORRED); return; } for(i=0;i=MAXMISSIONTABLE) { CHAR_talkToCli( charindex, -1, "编号不正确", CHAR_COLORYELLOW); return; } if( missiontable[mindex].flag == MISSION_NONE ) { CHAR_talkToCli( charindex, -1, "无此资料", CHAR_COLORYELLOW); return; } saacproto_ACMissionTable_send( acfd, mindex, 3, "", ""); sprintf( msg, " GM指令 清除任务资料 i:%d 使者:%s 勇者:%s m:%d flg:%d time:%d lt:%d ", mindex, missiontable[mindex].angelinfo, missiontable[mindex].heroinfo, missiontable[mindex].mission, missiontable[mindex].flag, missiontable[mindex].time, missiontable[mindex].limittime ); CHAR_talkToCli( charindex, -1, msg, CHAR_COLORYELLOW); LogAngel( msg); } void CHAR_CHAT_DEBUG_angelcreate(int charindex ,char *message) // 制造使者与勇者配对 { char angelid[256], heroid[256], msg[1024], buf[256]; int i, clean =FALSE; int MAXCHARA=0; int angelindex =-1, heroindex =-1, mission =-1; if( getStringFromIndexWithDelim( message, " ", 1, angelid, sizeof(angelid) ) == FALSE ){ CHAR_talkToCli( charindex, -1, "参数不正确 [angelcreate 使者帐号 勇者帐号 任务编号]", CHAR_COLORRED); return; } if( getStringFromIndexWithDelim( message, " ", 2, heroid, sizeof(heroid) ) == FALSE ){ CHAR_talkToCli( charindex, -1, "参数不正确 [angelcreate 使者帐号 勇者帐号 任务编号]", CHAR_COLORRED); return; } if( getStringFromIndexWithDelim( message, " ", 3, buf, sizeof(buf) ) == FALSE ){ CHAR_talkToCli( charindex, -1, "参数不正确 [angelcreate 使者帐号 勇者帐号 任务编号]", CHAR_COLORRED); return; } mission = atoi( buf); //if( mission <= 0 || mission >= MAXMISSION || missionlist[mission].id <= 0) { if( mission >= MAXMISSION ) { CHAR_talkToCli( charindex, -1, "任务编号不正确", CHAR_COLORRED); return; } MAXCHARA = CHAR_getPlayerMaxNum(); for( i=0; i= Playernum ){ sprintf(buf,"%s\n","失败!查无此帐号。"); CHAR_talkToCli(charaindex, -1, buf, CHAR_COLORRED); }else{ if(!CHAR_getInt( i , CHAR_FMTIMELIMIT )){ sprintf(buf,"%s\n","设定完成。"); CHAR_talkToCli(charaindex, -1, buf, CHAR_COLORYELLOW); } } } #endif #ifdef _DEF_GETYOU void CHAR_CHAT_DEBUG_getyou(int charaindex,char *message) { int floor,x,y,i,j,fd,area; char cdkey[CDKEYLEN],areabuf[5]; char szName[256],buf[256]; OBJECT object; char line[256]; int o,chara_index; int getnum = 0; getStringFromIndexWithDelim( message, " ", 1, areabuf , sizeof( areabuf )); area = atoi(areabuf); if( area <= 0 || area > 3 ){ sprintf(buf,"%s","没有输入 围或 围超出限制,请输入1~3"); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORYELLOW); return; } floor=CHAR_getInt( charaindex, CHAR_FLOOR ); x=CHAR_getInt( charaindex, CHAR_X ); y=CHAR_getInt( charaindex, CHAR_Y ); for(i=y-area;i<=y+area;i++){ for(j=x-area;j<=x+area;j++){ for( object = MAP_getTopObj(floor,j,i) ; object ;object = NEXT_OBJECT(object ) ){ o = GET_OBJINDEX(object); if( OBJECT_getType(o) == OBJTYPE_CHARA ){ chara_index=OBJECT_getIndex(o); if( CHAR_getInt( chara_index, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER ) continue; if( chara_index == charaindex ) continue; //找到自己了 if( ( fd = getfdFromCharaIndex(chara_index) ) != -1 ){ getnum++; CONNECT_getCharname( fd, szName, sizeof( szName ) ); //人物名称 CONNECT_getCdkey( fd, cdkey, sizeof( cdkey )); //帐号 //CHAR_getChar( chara_index, CHAR_NAME); snprintf( line, sizeof( line), "第%d个找到[%s]的帐号是[%s]",getnum,szName,cdkey); CHAR_talkToCli( charaindex, -1,line, CHAR_COLORRED); print("第%d个找到[%s]的帐号是[%s]\n",getnum,szName,cdkey); } } } } } if(!getnum) CHAR_talkToCli( charaindex, -1, " 围内没有人", CHAR_COLORYELLOW); } #endif #ifdef _DEF_NEWSEND void CHAR_CHAT_DEBUG_newsend(int charindex ,char *message) { char buf[256]; char token[100]; char szName[256]; char cdkey[CDKEYLEN]; char line[256]; char say[128]; int fl,x,y,i; unsigned int MAX_USER=0; MAX_USER=getFdnum(); if( strlen(message)==0){ sprintf(buf,"%s","参数不正确-> FLOOR X Y 无/要说的话"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } easyGetTokenFromString( message , 1 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->地图编号"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } fl=atoi( token ); easyGetTokenFromString( message , 2 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->X座标 "); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } x = atoi( token ); easyGetTokenFromString( message , 3 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->Y座标 "); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } y = atoi( token ); easyGetTokenFromString( message , 4 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->帐号"); CHAR_talkToCli( charindex, -1,buf, CHAR_COLORWHITE); return; } easyGetTokenFromString( message , 5 , say , sizeof(say)); for(i=0;i FLOOR X Y 帐号 格数 无/要说的话"); CHAR_talkToCli( charaindex, -1,buf, CHAR_COLORWHITE); return; } easyGetTokenFromString( message , 1 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->地图编号"); CHAR_talkToCli( charaindex, -1,buf, CHAR_COLORWHITE); return; } tofl=atoi( token ); easyGetTokenFromString( message , 2 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->X座标 "); CHAR_talkToCli( charaindex, -1,buf, CHAR_COLORWHITE); return; } toX = atoi( token ); easyGetTokenFromString( message , 3 , token, sizeof(token)); if( strlen(token)==0){ sprintf(buf,"%s","参数不正确-->Y座标 "); CHAR_talkToCli( charaindex, -1,buf, CHAR_COLORWHITE); return; } toY = atoi( token ); easyGetTokenFromString( message , 4 , cdkeytoken , sizeof(cdkeytoken)); if( strlen(cdkeytoken)==0){ sprintf(buf,"%s","参数不正确-->帐号"); CHAR_talkToCli( charaindex, -1,buf, CHAR_COLORWHITE); return; } easyGetTokenFromString( message , 5 , token, sizeof(token)); area = atoi( token ); if( strlen(token)==0 || area <= 0 || area > 3 ){ sprintf(buf,"%s","参数不正确-->格数(1~3)"); CHAR_talkToCli( charaindex, -1,buf, CHAR_COLORWHITE); return; } easyGetTokenFromString( message , 6 , say , sizeof(say)); //说话 MAX_USER=getFdnum(); for(k=0;k0){ for(i=0;i=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } CHAR_setWorkInt( i, CHAR_WORKFONTSIZE, atoi( fsize )); //CHAR_send_P_StatusString( charaindex , CHAR_P_STRING_LV); sprintf( token, "[GM]%把你的字体设置为%d!", CHAR_getChar( charaindex, CHAR_NAME),(int)atoi(fsize)); CHAR_talkToCli( i, -1, token, CHAR_COLORYELLOW ); sprintf( token, "玩家%s的字体设置为%d!", CHAR_getChar( i, CHAR_NAME),(int)atoi(fsize)); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); }else{ CHAR_setWorkInt( charaindex, CHAR_WORKFONTSIZE, atoi( fsize )); sprintf( token, "字体设置为%d!",(int)atoi(fsize)); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); } } #endif #ifdef _JOBDAILY void CHAR_CHAT_DEBUG_rejobdaily(int charaindex ,char *message) { print("Reading Jobdaily File..."); CHAR_talkToCli( charaindex, -1, "重新读取任务日志列表...", CHAR_COLORYELLOW); if(!LoadJobdailyfile()){ CHAR_talkToCli( charaindex, -1, "读取失败", CHAR_COLORYELLOW); print("fail!!\n"); return; } print("done\n"); CHAR_talkToCli( charaindex, -1, "读取完成", CHAR_COLORYELLOW); } #endif #ifdef _RACEMAN extern int asktotal; void CHAR_CHAT_DEBUG_changeask(int charaindex, char *message) { char cdkey[64] , free[64] , buf[256] , item[64]; int i ,toindex=0, Playernum = CHAR_getPlayerMaxNum(); int itemindex,itemid; unsigned int askno,asklv,temp; int petNo,intNo,shift,base; easyGetTokenFromString( message , 1 , cdkey , sizeof(cdkey)); if( strlen(cdkey)==0){ sprintf(buf,"%s","没有帐号。正确格式:[changeask 帐号 人物名称 宠证id 0/1]"); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORYELLOW); return; } easyGetTokenFromString( message , 2 , item, sizeof(item)); if( strlen(item)==0){ sprintf(buf,"%s","没有宠证id。正确格式:[changeask 帐号 宠证id 0/1]"); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORYELLOW); return; } easyGetTokenFromString( message , 3 , free , sizeof(free)); if( strlen(free)==0 ){ sprintf(buf,"%s","最後的参数错误。正确格式:[changeask 帐号 宠证id 0/1]"); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORYELLOW); return; } for( i=0;i=Playernum){ sprintf(buf,"%s","找不到这个人,请确认帐号"); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORYELLOW); return; } //找道具 for( i = 0 ; i < CHAR_MAXITEMHAVE ; i++ ) { itemindex=CHAR_getItemIndex( toindex , i ); if( ITEM_CHECKINDEX( itemindex) ) { itemid=ITEM_getInt( itemindex ,ITEM_ID ); if(itemid==atoi(item)){ //找到猎宠证 if(atoi(free)==1){ //设定解过 petNo = ( CHAR_getInt( toindex , CHAR_CHECKIN ) & 0x7FC00000 ) >> 22 ; intNo = petNo / 32 ; shift = petNo % 32 ; base = 1 << shift; CHAR_setInt( toindex , CHAR_KINDCNT1 + intNo , CHAR_getInt( toindex , CHAR_KINDCNT1 + intNo ) | base ); CHAR_setInt( toindex,CHAR_CATCHCNT5,CHAR_getInt( toindex,CHAR_CATCHCNT5 ) +1 ); } //给下一题 if(CHAR_getInt( toindex,CHAR_CATCHCNT5 ) >= asktotal ){ sprintf( buf,"恭喜你达到猎宠大赛终极目标,祝您抽中大奖"); }else{ askno = Raceman_getokask( toindex , rand() % asktotal ); asklv = asktable[askno].lowlv + rand()%((asktable[askno].highlv+1)-asktable[askno].lowlv); temp = (askno << 22) & 0x7FC00000; temp = temp | ((asklv << 14) & 0x003FC000); temp = temp | ((asktable[askno].bbi - 100000) & 0x00003FFF); CHAR_setInt( toindex , CHAR_CHECKIN , temp ); if( asktable[askno].highlv == 0 ) sprintf( buf,"请抓给我等级%d『以上』的%s好吗。您目前记录%d种", asktable[askno].lowlv , asktable[askno].petname, CHAR_getInt( toindex,CHAR_CATCHCNT5 ) ); else sprintf( buf,"请抓给我『只能』等级%d的%s好吗。您目前记录%d种", asklv , asktable[askno].petname, CHAR_getInt( toindex,CHAR_CATCHCNT5 ) ); } ITEM_setChar( itemindex, ITEM_EFFECTSTRING, buf); CHAR_sendItemDataOne( toindex , i ); break; } } } if( i >= CHAR_MAXITEMHAVE ){ sprintf(buf,"%s","找不到猎宠证!"); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORYELLOW); return; }else{ sprintf(buf,"%s","设定完成"); CHAR_talkToCli( charaindex, -1, buf, CHAR_COLORYELLOW); } } #endif #ifdef _CREATE_MM_1_2 void CHAR_CHAT_DEBUG_MM( int charaindex , char *message ) { int ret; int enemynum; int enemyid; int index; int i,j; int work[4]={50,50,50,50}; int LevelUpPoint; char buf[10]; char cdkey[CDKEYLEN]; char token[255]; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , buf, sizeof(buf)); index=atoi(buf); easyGetTokenFromString( message , 2 , cdkey, sizeof(cdkey)); if(index==1)enemyid=1479; else if(index==2)enemyid=2547; else{ CHAR_talkToCli( charaindex, -1, "目前只能制作1/2代玛蕾菲雅!", CHAR_COLORYELLOW ); return;} if(strlen(cdkey)>0){ for(j=0;j=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } enemynum = ENEMY_getEnemyNum(); for( i = 0; i < enemynum; i ++ ) { if( ENEMY_getInt( i, ENEMY_ID) == enemyid) { break; } } if( i == enemynum )return; ret = ENEMY_createPetFromEnemyIndex( j, i); if( !CHAR_CHECKINDEX( ret))return; snprintf( token,sizeof( token), "制作极品%d代玛蕾菲雅成功\!index[%d]",index,ret); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORWHITE); sprintf( token, "[GM]%s制作了只极品%d代玛蕾菲雅给你!index[%d]", CHAR_getChar( charaindex, CHAR_NAME),index,ret); CHAR_talkToCli( j, -1, token, CHAR_COLORYELLOW ); sprintf( token, "给玩家%s制作了只极品%d代玛蕾菲雅!index[%d]", CHAR_getChar( j, CHAR_NAME),index,ret); CHAR_talkToCli( charaindex, -1,token, CHAR_COLORYELLOW ); for( i = 0; i < CHAR_MAXPETHAVE; i ++ ){ if( CHAR_getCharPet( j, i ) == ret )break; } if( i == CHAR_MAXPETHAVE )i = 0; if( CHAR_CHECKINDEX( ret ) == TRUE ){ CHAR_setMaxExpFromLevel( ret, CHAR_getInt( ret, CHAR_LV )); } int k; LevelUpPoint = ( work[3]<< 24) + ( work[0]<< 16) + ( work[1]<< 8) + ( work[2]<< 0); CHAR_setInt( ret, CHAR_ALLOCPOINT, LevelUpPoint); for( k = 1; k < 79; k ++ ){ //升级 if(k%5==0){ LevelUpPoint = ( work[3]<< 24) + ( work[0]<< 16) + ( work[1]<< 8) + ( work[2]<< 0); CHAR_setInt( ret, CHAR_ALLOCPOINT, LevelUpPoint); } CHAR_PetLevelUp( ret ); CHAR_PetAddVariableAi( ret, AI_FIX_PETLEVELUP ); CHAR_setInt( ret, CHAR_LV, CHAR_getInt( ret, CHAR_LV) +1 ); } snprintf( token, sizeof( token ), "K%d", i ); CHAR_sendStatusString( j, token ); snprintf( token, sizeof( token ), "W%d", i ); CHAR_sendStatusString( j, token ); }else{ enemynum = ENEMY_getEnemyNum(); for( i = 0; i < enemynum; i ++ ) { if( ENEMY_getInt( i, ENEMY_ID) == enemyid) { break; } } if( i == enemynum )return; ret = ENEMY_createPetFromEnemyIndex(charaindex, i); if( !CHAR_CHECKINDEX( ret))return; snprintf( token,sizeof( token), "制作极品%d代玛蕾菲雅成功\!index[%d]",index,ret); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORWHITE); for( i = 0; i < CHAR_MAXPETHAVE; i ++ ){ if( CHAR_getCharPet( charaindex, i ) == ret )break; } if( i == CHAR_MAXPETHAVE )i = 0; if( CHAR_CHECKINDEX( ret ) == TRUE ){ CHAR_setMaxExpFromLevel( ret, CHAR_getInt( ret, CHAR_LV )); } int k; LevelUpPoint = ( work[3]<< 24) + ( work[0]<< 16) + ( work[1]<< 8) + ( work[2]<< 0); CHAR_setInt( ret, CHAR_ALLOCPOINT, LevelUpPoint); for( k = 1; k < 79; k ++ ){ //升级 if(k%5==0){ LevelUpPoint = ( work[3]<< 24) + ( work[0]<< 16) + ( work[1]<< 8) + ( work[2]<< 0); CHAR_setInt( ret, CHAR_ALLOCPOINT, LevelUpPoint); } CHAR_PetLevelUp( ret ); CHAR_PetAddVariableAi( ret, AI_FIX_PETLEVELUP ); CHAR_setInt( ret, CHAR_LV, CHAR_getInt( ret, CHAR_LV) +1 ); } snprintf( token, sizeof( token ), "K%d", i ); CHAR_sendStatusString( charaindex, token ); snprintf( token, sizeof( token ), "W%d", i ); CHAR_sendStatusString( charaindex, token ); } } #endif #ifdef _SendTo void CHAR_CHAT_DEBUG_Sendto( int charaindex , char *message ) { char cdkey[CDKEYLEN]; char token[255]; int i; int playernum = CHAR_getPlayerMaxNum(); easyGetTokenFromString( message , 1 , cdkey, sizeof(cdkey)); if(strlen(cdkey)>0){ for(i=0;i=playernum) { CHAR_talkToCli( charaindex, -1, "此账号不在线~", CHAR_COLORYELLOW ); return; } if(!strcmp(CHAR_getChar(charaindex,CHAR_CDKEY),cdkey)) { CHAR_DischargePartyNoMsg( charaindex);//解散团队 int floor, x, y; char token[256]; floor = CHAR_getInt( i, CHAR_FLOOR); x = CHAR_getInt( i, CHAR_X); y = CHAR_getInt( i, CHAR_Y); CHAR_warpToSpecificPoint( charaindex, floor, x, y ); sprintf( token, "已传送到玩家%s身边!", CHAR_getChar( i, CHAR_NAME)); CHAR_talkToCli( charaindex, -1, token, CHAR_COLORYELLOW ); return; } } } #endif