⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 skill.cpp

📁 国内著名网络游戏dragon的服务端完整源码 内附完整数据库结构
💻 CPP
📖 第 1 页 / 共 5 页
字号:
				if( s->resource4_amount ) 
				{
					ii = ItemUnit( s->resource4/1000, s->resource4%1000 );
					if( ii ) fprintf( fp, "        '%15s(%7d)'  %d俺 鞘夸\n", ii->GetHanName(), s->resource4, s->resource4_amount );
				}
		}		
		
		switch( s->Tool_kind )
		{
			case 48	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 俺埃侩(48)\n" );		break;
			case 49	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 眠荐侩(49)\n");		break;
			case 50	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 盲堡侩(50)\n");		break;
			case 51	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 力访侩(51)\n");		break;
			case 52	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 超矫侩(52)\n");		break;
			case 53	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 国格侩(53)\n");		break;
			case 54	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 格犁啊傍侩(54)\n");	break;
			case 55	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 档绵侩(55)\n");		break;
			case 56	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 距檬盲笼侩(56)\n");	break;
			case 57	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 距犁父甸扁侩(57)\n");	break;
			case 58	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 啊困幅(58)\n");		break;
			case 59	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 格傍侩(59)\n"); break;
			case 60	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 枚傍侩(60)\n"); break;
			case 61	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 措快绰夸府侩(捻目)(61)\n"); break;
			case 62	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 结绰夸府侩(62)\n"); break;
			case 63	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 官疵幅(63)\n"); break;
			case 64	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 劝力累侩(64)\n"); break;
			case 65	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 阂措(65)\n"); break;
			case 66	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 剧檬力累侩(66)\n"); break;
			case 67	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 剐吵啊傍侩(67)\n"); break;
			case 68	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 抛捞怪侩(68)\n"); break;
			case 69	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 弊拱幅(69)\n"); break;
			case 70	:		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 档备 何剿倒幅(70)\n"); break;

			default : 		fprintf( fp, "        鞘夸肺窍绰 窍绰 Tool 辆幅绰 : 绝澜..\n" ); break;
		}

		fprintf( fp, "        鞘夸茄 厘家绰  " );
		switch( s->Flatform_kind )
		{
			case 0 :  fprintf( fp, "'酒公单唱' 捞促. \n");			break;

			case 71	:		fprintf( fp, " 累诀措 侩堡肺(71)\n"); break;
			case 72	:		fprintf( fp, " 累诀措 硅撇(72)\n"); break;
			case 73	:		fprintf( fp, " 累诀措 急馆(73)\n"); break;
			case 74	:		fprintf( fp, " 累诀措 葛风(74)\n"); break;
			case 75	:		fprintf( fp, " 累诀措 拳傣(75)\n"); break;
			case 76	:		fprintf( fp, " 累诀措 矫氰包幅(76)\n"); break;
			case 77	:		fprintf( fp, " 累诀措 拱饭(77)\n"); break;
			case 78	:		fprintf( fp, " 累诀措 阂措 (78)\n"); break;

			default : fprintf( fp, "'抛捞喉蔼捞 肋给等巴鞍促.\n" );	break;
		}

		fprintf( fp, "---------------------------------------------------------------------------------------------\n" );
	}		
	fclose(fp);
}

void CItem_Join::ReadItemJoin( char *buf )
{	
	char *token;
	int *target;
	token = strtok(buf,"\t\n\r");
	if( token == NULL ) return;
	no = atoi(token);
	
	token = strtok(NULL,"\t\n\r");
	if( token == NULL ) return;
	item_id = atoi(token);
	
	token= strtok(NULL, "\t\n");
	if( token == NULL ) return;
	strcpy(item_name, token);

	token = strtok(NULL,"\t\n\r");
	if( token == NULL ) return;
	item_amount = atoi(token);
	
	token= strtok(NULL, "\t\n");
	if( token == NULL ) return;
	strcpy(han_name, token);
	
	target = &need_know;
	int ct=0;
	while( ( token= strtok(NULL, "\t\n\r")) != NULL )
	{
		*(target+ct) = atoi(token);
		ct++;
	}
}

bool LoadItemJoinTable( void )
{			
	TotalItemJoinTableCount=0;

	HSTMT		hStmt = NULL;
	RETCODE		retCode;
	SDWORD		cbValue;
	char		szQuerry[256];
			
	sprintf(szQuerry, "Select * From itemjoin order by no#" );
			
	SQLAllocStmt(hDBC, &hStmt);
	retCode = SQLExecDirect(hStmt, (UCHAR *)szQuerry, SQL_NTS);
	if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
	{		
		int i = 0;
		retCode = SQLFetch(hStmt);
		while( retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
		{	
			retCode = SQLGetData(hStmt, 1, SQL_C_LONG, &item_join[i].no,		0, &cbValue);
			retCode = SQLGetData(hStmt, 2, SQL_C_LONG, &item_join[i].item_id,	0, &cbValue);
			item_join[i].item_id/=100;
			retCode = SQLGetData(hStmt, 3, SQL_C_CHAR, &item_join[i].item_name	,31, &cbValue);
			retCode = SQLGetData(hStmt, 4, SQL_C_LONG, &item_join[i].item_amount	,0, &cbValue);
			retCode = SQLGetData(hStmt, 5, SQL_C_CHAR, &item_join[i].han_name	,31, &cbValue);
			retCode = SQLGetData(hStmt, 6, SQL_C_LONG, &item_join[i].need_know	,0, &cbValue);
			retCode = SQLGetData(hStmt, 7, SQL_C_LONG, &item_join[i].teach_place	,0, &cbValue);
			retCode = SQLGetData(hStmt, 8, SQL_C_LONG, &item_join[i].need_skill1	,0, &cbValue);
			retCode = SQLGetData(hStmt, 9, SQL_C_LONG, &item_join[i].skill1_minimum	,0, &cbValue);
			retCode = SQLGetData(hStmt,10, SQL_C_LONG, &item_join[i].skill1_maximum	,0, &cbValue);
			retCode = SQLGetData(hStmt,11, SQL_C_LONG, &item_join[i].need_skill2	,0, &cbValue);
			retCode = SQLGetData(hStmt,12, SQL_C_LONG, &item_join[i].skill2_minimum	,0, &cbValue);
			retCode = SQLGetData(hStmt,13, SQL_C_LONG, &item_join[i].skill2_maximum	,0, &cbValue);
			retCode = SQLGetData(hStmt,14, SQL_C_LONG, &item_join[i].tech_price	,0, &cbValue);
			retCode = SQLGetData(hStmt,15, SQL_C_LONG, &item_join[i].Tool_kind	,0, &cbValue);
			retCode = SQLGetData(hStmt,16, SQL_C_LONG, &item_join[i].Flatform_kind	,0, &cbValue);
			retCode = SQLGetData(hStmt,17, SQL_C_LONG, &item_join[i].resource1	,0, &cbValue);item_join[i].resource1/=100;
			retCode = SQLGetData(hStmt,18, SQL_C_LONG, &item_join[i].resource1_amount	,0, &cbValue);
			retCode = SQLGetData(hStmt,19, SQL_C_LONG, &item_join[i].resource2	,0, &cbValue);item_join[i].resource2/=100;
			retCode = SQLGetData(hStmt,20, SQL_C_LONG, &item_join[i].resource2_amount	,0, &cbValue);
			retCode = SQLGetData(hStmt,21, SQL_C_LONG, &item_join[i].resource3	,0, &cbValue);item_join[i].resource3/=100;
			retCode = SQLGetData(hStmt,22, SQL_C_LONG, &item_join[i].resource3_amount	,0, &cbValue);
			retCode = SQLGetData(hStmt,23, SQL_C_LONG, &item_join[i].resource4	,0, &cbValue);item_join[i].resource4/=100;
			retCode = SQLGetData(hStmt,24, SQL_C_LONG, &item_join[i].resource4_amount	,0, &cbValue);
			retCode = SQLGetData(hStmt,25, SQL_C_LONG, &item_join[i].Result_resource1	,0, &cbValue);
			retCode = SQLGetData(hStmt,26, SQL_C_LONG, &item_join[i].Result_resource1_amount	,0, &cbValue);
			retCode = SQLGetData(hStmt,27, SQL_C_LONG, &item_join[i].Result_resource2	,0, &cbValue);
			retCode = SQLGetData(hStmt,28, SQL_C_LONG, &item_join[i].Result_resource2_amount	,0, &cbValue);
			retCode = SQLGetData(hStmt,29, SQL_C_LONG, &item_join[i].reutilizerble	,0, &cbValue);
			retCode = SQLGetData(hStmt,30, SQL_C_LONG, &item_join[i].k1	,0, &cbValue);
			retCode = SQLGetData(hStmt,31, SQL_C_LONG, &item_join[i].k2	,0, &cbValue);
			retCode = SQLGetData(hStmt,32, SQL_C_CHAR, &item_join[i].txt	,220, &cbValue);
			TotalItemJoinTableCount= i;
			i++;
			
		retCode = SQLFetch(hStmt);
		if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
			{
			}
			
		else if( retCode == SQL_NO_DATA ) 
			{
				break;
			}
		
		else
			{
				SQLFreeStmt(hStmt, SQL_DROP);
				return 0;
			}

		}		
	TotalItemJoinTableCount= i; //010618 lsw 困俊辑 捞悼
	}			
				
	SQLFreeStmt(hStmt, SQL_DROP);
			
	PrintSkillItemJoin();
				
	return 1;	
}

bool LoadItemMutantKind()
{
	HSTMT		hStmt = NULL;
	RETCODE		retCode;
	SDWORD		cbValue;
	char		szQuerry[256];
			
	sprintf(szQuerry, "Select * From Item_mutant_kind order by item_kind" );
			
	SQLAllocStmt(hDBC, &hStmt);
	retCode = SQLExecDirect(hStmt, (UCHAR *)szQuerry, SQL_NTS);
	if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
	{		
		int i = 0;
		retCode = SQLFetch(hStmt);
		while( retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
		{
			if(i >= MAX_ITEM_MUTANT_KIND) return false;
			int column = 0;
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemMutantKind[i].item_kind,	0, &cbValue);
			//< CSD-030324
			//retCode = SQLGetData(hStmt, ++column, SQL_C_CHAR,	&ItemMutantKind[i].exp_kind,	100, &cbValue);
			++column;
			//> CSD-030324
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemMutantKind[i].upgrade_type,	0, &cbValue);
			int count = 0;
			for(count = 0; count <4; count ++)
			{
				int iDummy = 0;
				retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&iDummy,	0, &cbValue);
				ItemMutantKind[i].AddItem[count]= iDummy;
			}
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemMutantKind[i].iBuffer1,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemMutantKind[i].iBuffer2,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemMutantKind[i].iBuffer3,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemMutantKind[i].iBuffer4,	0, &cbValue);

			i++;
			retCode = SQLFetch(hStmt);
			if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
			{
			}
			else if( retCode == SQL_NO_DATA ) 
			{
				break;
			}
			else
			{
				SQLFreeStmt(hStmt, SQL_DROP);
				return false;
			}
		}	
	}		
	else 
	{
		SQLFreeStmt(hStmt, SQL_DROP);
		return 0;
	}
	SQLFreeStmt(hStmt, SQL_DROP);
	return true;	
}

bool LoadItemGrade()
{
	HSTMT		hStmt = NULL;
	RETCODE		retCode;
	SDWORD		cbValue;
			
	SQLAllocStmt(hDBC, &hStmt);
	retCode = SQLExecDirect(hStmt, (UCHAR *)"Select * From Item_grade order by grade", SQL_NTS);
	if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
	{		
		int i = 0;
		retCode = SQLFetch(hStmt);
		while( retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
		{
			if(i >= MAX_ITEM_GRADE) return false;
/*
		typedef struct ITEMGRADE
		{
			int iGrade;
			int iAble;
			int ResourceAmount[4];
			int iBuffer1;
			int iBuffer2;
			int iBuffer3;
			int iBuffer4;
		}t_ItemGrade,*LPITEM_GRADE;
*/
			int column = 0;
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemGrade[i].iGrade,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemGrade[i].iAble,	0, &cbValue);
			int count = 0;
			for(count = 0; count <4; count ++)
			{
				int iDummy = 0;
				retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&iDummy,	0, &cbValue);
				ItemGrade[i].ResourceAmount[count]= iDummy;
			}
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemGrade[i].iBuffer1,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemGrade[i].iBuffer2,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemGrade[i].iBuffer3,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemGrade[i].iBuffer4,	0, &cbValue);

			i++;
			retCode = SQLFetch(hStmt);
			if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
			{
			}
			else if( retCode == SQL_NO_DATA ) 
			{
				break;
			}
			else
			{
				SQLFreeStmt(hStmt, SQL_DROP);
				return false;
			}
		}	
	}
	else 
	{
		SQLFreeStmt(hStmt, SQL_DROP);
		return 0;
	}
	SQLFreeStmt(hStmt, SQL_DROP);
	return true;	
}

bool LoadItemRare( void )
{
	HSTMT		hStmt = NULL;
	RETCODE		retCode;
	SDWORD		cbValue;
			
	SQLAllocStmt(hDBC, &hStmt);
	retCode = SQLExecDirect(hStmt, (UCHAR *)"Select * From Item_rare order by [NO]", SQL_NTS);
	if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
	{		
		int i = 0;
		retCode = SQLFetch(hStmt);
		while( retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
		{
			if(i >= MAX_ITEM_RARE) return false;
/*
			typedef struct ITEM_MUTANT
			{
				int		iNo		;
				int		iType	;
				char	EngName[100];
				char	LocalName[100];
				char	Explain[100];
				char	ExplainAdd[100];
				int		iExpMark;// + - 扁龋 钎矫
				int		iMakeAble;//父甸绢 瘤绰啊?
				int		RaisePro[8];// 0锅篮 DefaultRaisePro
				int		iUpgradeAble;
				int		iAbleNation;//
				int		GRADE[16];//0锅篮 MAX 唱赣瘤绰 弊饭捞靛喊 蔼
				int		Buffer1;
				int		Buffer2;
				int		Buffer3;
				int		Buffer4;
				int		Buffer5;
				int		Buffer6;
			}t_Item_Mutant,*LPITEM_MUTANT;
*/
			int column = 0;
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemRare[i].iNo,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemRare[i].iType,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_CHAR,	&ItemRare[i].EngName,	100, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_CHAR,	&ItemRare[i].LocalName,	100, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_CHAR,	&ItemRare[i].Explain,	100, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_CHAR,	&ItemRare[i].ExplainAdd,	100, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemRare[i].iExpMark,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemRare[i].iMakeAble,	0, &cbValue);
			int count = 0;
			for(count = 0; count <8; count ++)
			{
				int iDummy = 0;
				retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&iDummy,	0, &cbValue);
				ItemRare[i].RaisePro[count]= iDummy;
			}
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemRare[i].iUpgradeAble,	0, &cbValue);
			retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&ItemRare[i].iAbleNation,	0, &cbValue);
							
			for(count= 0; count <16; count ++)
			{
				int iDummy = 0;
				retCode = SQLGetData(hStmt, ++column, SQL_C_LONG,	&iDummy,	0, &cbValue);
				ItemRare[i].GRADE[count]= iDummy;
			}

			i++;
			retCode = SQLFetch(hStmt);
			if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
			{
			}
			else if( retCode == SQL_NO_DATA ) 
			{
				break;
			}
			else
			{
				SQLFreeStmt(hStmt, SQL_DROP);
				return false;
			}
		}	
	}		
	else 
	{
		SQLFreeStmt(hStmt, SQL_DROP);
		return 0;
	}
	return true;	
}

bool LoadItemTable( void )//020815 lsw
{	//< CSD-038006
	if( !LoadItemRare() )			{return false;}
	if( !LoadItemMutantKind()	)	{return false;}
	if( !LoadItemGrade()		)	{return false;}
	if( !LoadRaregroup()		)	{return false;}
	if( !LoadItemFunctionGroup())	{return false;}
	if( !LoadRareProbability()	)	{return false;}
	if( !LoadItemFunction()		)	{return false;}
	if( !LoadLearnItemConvetrer())	{return false;}
	if( !LoadRareItemBag())			{return false;}//020505 lsw
	if( !LoadItemControlPercent())	{return false;}
	if( !LoadItemFallPercent())		{return false;}
	if( !LoadBasicItemBag())		{return false;}
	if( !LoadItemControl())			{return false;}
	if( !RareEM.LoadItem_Multi_Rare_Table()){return false;}//021111 lsw 
	if( !RareEM.LoadItem_Legend_Table()){return false;}//021111 lsw 
	if( !RareEM.LoadItem_Legend_Bonus_Item()){return false;}//021111 lsw 
	
	return true;
}	//> CSD-038006

bool youvegotitInventory(const int cn, ItemAttr *item )
{
	CHARLIST *ch = GetCharListPtr(cn);
	int  i,j,m;
	if( item == NULL ) return false;
	CItem *ii = ItemUnit( item->item_no/1000, item->item_no % 1000 );	// 弊繁 Item捞 Table俊 乐绰啊?
	if( ii == NULL ) return false;

	ItemAttr *tempitem;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -