?? skill.cpp
字號:
// if( no == oldno ) goto NEXT_;
// oldno = no;
fp = Fopen( "./data/gamestatusexplain.txt", "rt" );
if( fp == NULL ) return;
while( !feof( fp ) )
{
fgets( temp, FILENAME_MAX, fp );
token = strtok( temp, "\t\n");
tno = atoi( token );
if( tno == no )
{
token = strtok( NULL, "\t\n");
strcpy( text, token );
fclose(fp);
if( strchr( text, '%' ) )
{
sprintf( temp, text, SkillOutputMessage );
AddCurrentStatusMessage( 255,0,0, temp );
}
else
{
AddCurrentStatusMessage( 255,0,0, temp );
}
return;
}
}
fclose(fp);
}
// Bomb...
void SendCMD_FOOT_ON_TRAP_0_ITEM( int server_id )
{
t_packet p;
p.h.header.type = CMD_FOOT_ON_TRAP_0_ITEM;
p.u.client_foot_on_trap0.idServer = server_id;
p.h.header.size = sizeof(t_client_foot_on_trap0 );
QueuePacket( &p, 1 );
}
void RecvCMD_STEAL_ON_TRAP( t_server_steal_on_trap *p )
{
LPCHARACTER ch = ReturnCharacterPoint(p->idServer);
if( ch == NULL ) return;
int no;
int t = rand()%4 +1;
for( int j = 0 ; j < t; j ++)
InsertMagic( ch, ch, 287,0, ch->x+(rand()%32) - 16, ch->y+ (rand()%32)-16, 0,0 );
if( ch== Hero )
{
no = SCharacterData.nCharacterHP - p->nLife;
SCharacterData.nCharacterHP = p->nLife;
}
else
{
no = ch->hp - p->nLife;
ch->hp = p->nLife;
}
AddNumberAni( NUMBER_ANIMATION_TYPE_DOWN_, ch->y+1, ch->x, ch->y, no );
//1013 zhh
if( ch->hp > 0 )
{
if( ch->sprno <= 1 )
{
ch->nCurrentAction = ACTION_ATTACKED;
ch->nCurrentFrame = 0;
}
else
{
ch->nCurrentAction = MON1_ATTACKED;
ch->nCurrentFrame = 0;
}
}
}
void RecvCMD_FOOT_ON_TRAP_0_ITEM( t_server_foot_on_trap0 *p )
{
LPCHARACTER ch = ReturnCharacterPoint(p->idServer);
if( ch == NULL ) return;
LPITEMGROUND i = FindItemList(p->idItem);
if( i == NULL ) return;
int no;
int t = rand()%4 +1;
for( int j = 0 ; j < t; j ++)
InsertMagic( ch, ch, 287,0, i->x+(rand()%32) - 16, i->y+ (rand()%32)-16, 0,0 );
if( ch== Hero )
{
no = SCharacterData.nCharacterHP - p->nLife;
SCharacterData.nCharacterHP = p->nLife;
}
else
{
no = ch->hp - p->nLife;
ch->hp = p->nLife;
}
no = i->attr[IATTR_DURATION];//021030 lsw
AddNumberAni( NUMBER_ANIMATION_TYPE_DOWN_, ch->y+1, ch->x, ch->y, no );
//1013 zhh
if( ch->hp > 0 )
{
if( ch->sprno <= 1 )
{
ch->nCurrentAction = ACTION_ATTACKED;
ch->nCurrentFrame = 0;
}
else
{
ch->nCurrentAction = MON1_ATTACKED;
ch->nCurrentFrame = 0;
}
}
}
// Trap...
void SendCMD_FOOT_ON_TRAP_1_ITEM( int server_id )
{
t_packet p;
p.h.header.type = CMD_FOOT_ON_TRAP_1_ITEM;
p.u.client_foot_on_trap1.idServer = server_id;
p.h.header.size = sizeof(t_client_foot_on_trap1 );
QueuePacket( &p, 1 );
}
void RecvCMD_FOOT_ON_TRAP_1_ITEM( t_server_foot_on_trap1 *p )
{
LPCHARACTER ch = ReturnCharacterPoint(p->idServer);
if( ch == NULL ) return;
LPITEMGROUND i = FindItemList(p->idItem);
if( i == NULL ) return;
int no;
// int t = rand()%4 +1;
// for( int j = 0 ; j < t; j ++)
// InsertMagic( ch, ch, 208,0, i->x+(rand()%32) - 16, i->y+ (rand()%32)-16, 0,0 );
InsertMagic( ch, ch, 288,0, i->x+(rand()%32) - 16, i->y+ (rand()%32)-16, 0,0 );
if( ch== Hero )
{
no = SCharacterData.nCharacterHP - p->nLife;//別牢劇
SCharacterData.nCharacterHP = p->nLife;
}
else
{
no = ch->hp - p->nLife;
ch->hp = p->nLife;
}
no = i->attr[IATTR_DURATION];//021030 lsw
AddNumberAni( NUMBER_ANIMATION_TYPE_DOWN_, ch->y+1, ch->x, ch->y, no );
if( ch->hp > 0 )
{
if( ch->sprno <= 1 )
{
ch->nCurrentAction = ACTION_ATTACKED;
ch->nCurrentFrame = 0;
}
else
{
ch->nCurrentAction = MON1_ATTACKED;
ch->nCurrentFrame = 0;
}
}
}
void RecvViewtypeChange( t_viewtype_change *p )
{
LPCHARACTER ch = ReturnCharacterPoint( p->server_id );
if( ch == NULL ) return;
ch->viewtype = p->viewtype;
switch( ch->viewtype )
{
////////////////// 1220 撈痹繞 ///////////////////////
case VIEWTYPE_CONFUSION_: break;
case VIEWTYPE_TREE_ : break;
case VIEWTYPE_GHOST_ :
{
ch->ghostani = rand()%10 + 15;
ch->peacests = 0;
if( Hero == ch ) // 0711 YGI
{
SetBattlePeace( PEACE_MODE );
SmallMenuClose();
// 蠟飛老錠 皋春 努府絹
CSDMainIconClear(); // CSD-TW-030627
if(Hero->lv <= 20)//付闌肺 混酒唱扁 020627 lsw
{
if( MapNumber!=85 && MapNumber!=30)//檬焊磊 薦訪家啊 酒聰扼擱 //020827 lsw
{
CallSmallMenu(MN_GHOST_TO_ALIVE);
}
}
}
SettingBasicActionSub( ch );
ch->nCurrentAction = ch->basicAction;
CharDoAni( ch, ch->direction, ch->basicAction);
}break;
case VIEWTYPE_CAMELEON_ :
break;
}
}
void RecvViewCharInfo( t_view_char_info *p )
{
char temp[ FILENAME_MAX];
int id = p->server_id;
LPCHARACTER ch = ReturnCharacterPoint( id );
if( ch == NULL ) return;
SkillSettingClear();
switch( p->type )
{
case WIS : if( ch->name[0])
{
//1024 zhh
AddCurrentStatusMessage( 255,255,255, lan->OutputMessage(2,204), ch->name, p->data );
sprintf( temp, lan->OutputMessage(2,205), ch->name, p->data );
// AddCurrentStatusMessage( 255,255,255, "%s狼 瘤驅(qū)綽 %d澇聰促. ", ch->name, p->data );
// sprintf( temp, "%s狼 瘤慶綽 %d瀝檔 登擺焙...", ch->name, p->data );
}
else
{
//1024 zhh
AddCurrentStatusMessage( 255,255,255, lan->OutputMessage(2,206), p->data );
sprintf( temp, lan->OutputMessage(2,207), p->data );
// AddCurrentStatusMessage( 255,255,255, "舅酒焊聰, 瘤驅(qū)綽 %d澇聰促. ", p->data );
// sprintf( temp, "瘤慶綽 %d瀝檔 登擺焙...", p->data );
}
strcpy( Hero->szChatMessage, temp );
Hero->ChatDelay = 70;
break;
case INT_ : if( ch->name[0])
{
//1024 zhh
AddCurrentStatusMessage( 255,255,255, lan->OutputMessage(2,208), ch->name, p->data );
sprintf( temp, lan->OutputMessage(2,209), ch->name, p->data );
// AddCurrentStatusMessage( 255,255,255, "%s狼 瘤瓷綽 %d澇聰促. ", ch->name, p->data );
// sprintf( temp, "%s狼 瘤瓷綽 %d瀝檔 登擺焙...", ch->name, p->data );
}
else
{
//1024 zhh
AddCurrentStatusMessage( 255,255,255, lan->OutputMessage(2,210), p->data );
sprintf( temp, lan->OutputMessage(2,211), p->data );
// AddCurrentStatusMessage( 255,255,255, "舅酒焊聰, 瘤瓷綽 %d澇聰促. ", p->data );
// sprintf( temp, "瘤瓷綽 %d瀝檔 登擺焙...", p->data );
}
strcpy( Hero->szChatMessage, temp );
Hero->ChatDelay = 70;
break;
// 磷闌 寸矯 惑炔..
case 9999: if( p->killer == NULL )
{
NNEXTT_:
//1024 zhh
AddCurrentStatusMessage( 255,255,255, lan->OutputMessage(2,212) );
sprintf( temp, lan->OutputMessage(2,213) );
// AddCurrentStatusMessage( 255,255,255, "磷闌 寸矯狼 惑炔撈 頗廄撈 登瘤 臼嚼聰促. " );
// sprintf( temp, "恐 磷菌綽瘤 肋 葛福擺絹." );
}
else
{
if( p->killer[0] == 0 ) goto NNEXTT_;
if( ch->name[0] )
{
//1024 zhh
AddCurrentStatusMessage( 255,255,255, lan->OutputMessage(2,214), ch->name, p->killer );
sprintf( temp, lan->OutputMessage(2,215), p->killer );
// AddCurrentStatusMessage( 255,255,255, "%s籃(綽) %s俊 狼秦 磷烙闌 寸沁嚼聰促.", ch->name, p->killer );
// sprintf( temp, "%s俊 寸茄巴 鞍焙.", p->killer );
}
else
{
//1024 zhh
AddCurrentStatusMessage( 255,255,255, lan->OutputMessage(2,216), p->killer );
sprintf( temp, lan->OutputMessage(2,217), p->killer );
// AddCurrentStatusMessage( 255,255,255, "%s俊 狼秦 磷烙闌 寸沁嚼聰促.", p->killer );
// sprintf( temp, "%s俊 寸茄巴 鞍焙.", p->killer );
}
}
strcpy( Hero->szChatMessage, temp );
Hero->ChatDelay = 70;
break;
}
}
// Skill竅絆 抄第 促矯 滾瓢闌 穿甫鞘夸絕撈 館汗且薦 樂霸 茄促.
void AgainSkill( int skillno )
{
switch( skillno )
{
case 4 :
case 5 :
case 16 :
case 21 :
case 23 :
case 24 :
case 25 :
case 26 :
case 28 :
case 30 :
case 32 :
// case 34 :
case 35 :
case 36 :
case 38 :
case 39 :
case 41 :
{
//1004 zhh
if(AmIEquitSkillTool(skillno)==0)
break;
SelectSkill( skillno );
SkillStatus = SKILL_ON;
//1007 zhh 扁賤撈 角菩沁闌 版快 酒撈能撈 波瘤綽 巴闌 阜綽促び
int para = 1;
if( skill[skillno].series==1 ) para = 0;
SkillOn = para;
}
break;
case 22 : // 父距 酒撈袍撈 巢酒 樂促擱..
{
//1004 zhh
if(AmIEquitSkillTool(skillno)==0)
break;
SelectSkill( skillno );
SkillStatus = SKILL_READY; // SelectSkill() 關(guān)俊客具 茄促.
//1007 zhh 扁賤撈 角菩沁闌 版快 酒撈能撈 波瘤綽 巴闌 阜綽促び
int para = 1;
if( skill[skillno].series==1 ) para = 0;
SkillOn = para;
}
break;
}
}
void PutSkillUseItem_skill_use_item( int skillno )
{
int c;
int ino;
CItem *ii;
switch( skillno )
{
// Sow..
case 22 :
{
c = 0;
for( int i= 0 ; i < 3 ; i ++)
for( int j= 0 ; j < 3 ; j ++)
for( int k= 0 ; k < 8 ; k ++)
{
ino = InvItemAttr[i][j][k].item_no;
ii = ItemUnit( ino / 1000, ino % 1000 );
if( ii )
if( ii->GetItemKind() == IK_SEED )
{
skill_use_item[c/10][c%10].item_no = ino;
SetItemPos( INV, i,j,k, &skill_use_item[c/10][c%10].pos );
c++;
}
}
// Quick..
for( int k= 0 ; k < 5 ; k ++)
{
ino = QuickItemAttr[k].item_no;
ii = ItemUnit( ino / 1000, ino % 1000 );
if( ii )
{
if( ii->GetItemKind() == IK_SEED )
{
skill_use_item[c/10][c%10].item_no = ino;
SetItemPos( QUICK, k, &skill_use_item[c/10][c%10].pos );
c++;
}
}
}
}
break;
}
}
void DrawSkilltile( void )
{
int x, y;
int skillno = SkillNo;
int mx = Mox / TILE_SIZE;
int my = Moy / TILE_SIZE;
int rx, ry;
int r;
int mapx, mapy;
DWORD lineColor;
lpMAPSKILLTABLE result;
if( SkillStatus == SKILL_OFF ) return;
switch( skillno )
{
case 21 ://Reclaim
case 22 ://Sow
case 23 ://Cultivate
case 24 ://Havest
skillno = 1;
lineColor=RGB16(221,189,140);
break;
case 25 ://Detect Mineral
case 26 ://Mining
skillno = 2;
lineColor=RGB16(203,185,156);
break;
case 28 ://Fish
case 30 ://Netting
skillno = 3;
lineColor=RGB16(118,100,85);
break;
case 32 ://Cutting
case 33 ://Lumbering
skillno = 4;
lineColor=RGB16(197,79,0);
break;
case 35 ://Detect Herb
case 36 ://Digging
skillno = 5;
lineColor=RGB16(137,202,157);
break;
default : return;
}
mapy = g_Map.y;
for ( y = 0; y < GAME_SCREEN_YSIZE ; y += TILE_SIZE, mapy ++ )
{
for ( mapx = g_Map.x, x = 0; x < GAME_SCREEN_XSIZE ; x+= TILE_SIZE, mapx ++ )
{
result=FindSkill(&Header[(int)(mapx/(int)((g_Map.file.wWidth+7)/8))][(int)(mapy/(int)((g_Map.file.wHeight+7)/8))],mapx,mapy);
if( result )
{
if( result->skillno == skillno )
{
r = result->tile_Range;
if( BoxAndDotCrash( mapx - r, mapy - r, r+r, r+r, mx, my ))
{
rx=(mapx-r)*TILE_SIZE;
ry=(mapy-r)*TILE_SIZE;
r = (r+r)*TILE_SIZE + TILE_SIZE;
Box( rx-1, ry-1, rx+r+1, ry+r+1, lineColor);
Box( rx , ry , rx+r , ry+r , lineColor);
Box( rx+1, ry+1, rx+r-1, ry+r-1, lineColor);
return;
}
}
}
}
}
}
void DrawSkillGauge( LPSKILLGAUGE n )
{
Spr *sp, *g;
int sx, sy, ex, ey;
int x,y;
int gx,gy;
sp = &spr[ n->type];
g = &spr[732];
x = n->x - Mapx;
y = n->y - Mapy - 100;
gx = -g->xl/2;
gy = g->yl/2;
sx = x - g->xl/2;
sy = y - g->yl/2;
ex = sx + g->xl * n->min / 100;
ey = sy + g->yl;
//PutCompressedImage( x, y + 50, g );
// sx, sy, ex, ey
switch( n->type )
{
case SKILLGAUGE_RESTTIME :
// 薦犬啦
case SKILLGAUGE_HAVEST :
// 牢傍利犁硅啦
case SKILLGAUGE_CULTIVATE :
// 煉訪檔
case SKILLGAUGE_TAME :
// 配瘤俺埃檔
case SKILLGAUGE_RECLAIM :
// 頗輛啦
case SKILLGAUGE_SOWING :
//1018 zhh
case SKILLGAUGE_FISHING :
break;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -