请教如何添加可骑乘宠物的数量RIDE_PET
我修改了char_base.c和char_base.h,能编译,可是进去游戏后超过32位的干脆就错乱了,骑上超过33的宠物会变成31内的设置样子,求解啊,是不是除了char_base.c和char_base.h这两个文件还得设置别的
还得在item_event.c加入,就可以了
char_base.c
#ifdef _RIDE_CF
int RIDEPET_getNOindex( int baseNo)
{
int i;
for( i=0; i< sizeof(RPlistMode)/sizeof(tagRidePetList); i++ ) {
if( RPlistMode.charNo == baseNo ) {
return RPlistMode.Noindex;
}
}
return -1;
}
#ifdef _RIDE_CF
int RIDEPET_getPETindex( int PetNo, unsigned int learnCode, unsigned int learnCode1, unsigned int learnCode2 )
{
int i;
int max=sizeof(RideCodeMode)/sizeof(tagRideCodeMode);
//print( "RIDEPET_getPETindex128:debug: max = %d, learnCode = %d, learnCode1 = %d, learnCode2 = %d, learnCode4 = %d. \n", max, learnCode, learnCode1, learnCode2, learnCode3 );
for( i=0; i< max; i++ )
{
//print( "debug: PetNo = %d, PetNo = %d. \n", PetNo, RideCodeMode.petNo );
if( RideCodeMode.petNo == PetNo ){
if( i < 32 )
{
if(RideCodeMode.learnCode & learnCode)
{
return i;
}
}
else if( i < 64 )
{
if(RideCodeMode.learnCode & learnCode1)
{
return i;
}
}
else if( i < 96 )
{
if(RideCodeMode.learnCode & learnCode2)
{
return i;
}
}
}
}
return -1;
}
int CHAR_CheckLearnCode(int charindex, int ridno)
{
int i;
int max=sizeof(RideCodeMode)/sizeof(tagRideCodeMode);
unsigned int learnCode,learnCode1,learnCode2;
learnCode = CHAR_getInt( charindex, CHAR_LOWRIDEPETS);
learnCode1 = CHAR_getInt( charindex, CHAR_LOWRIDEPETS1);
learnCode2 = CHAR_getInt( charindex, CHAR_HIGHRIDEPETS2);
//print( "RIDEPET_getPETindex128:debug: max = %d, learnCode = %d, learnCode1 = %d, learnCode2 = %d, learnCode4 = %d. \n", max, learnCode, learnCode1, learnCode2, learnCode3 );
for( i=0; i< max; i++ )
{
//print( "debug: PetNo = %d, PetNo = %d. \n", PetNo, RideCodeMode.petNo );
if( RideCodeMode.petNo == ridno ){
if( i < 32 )
{
if(RideCodeMode.learnCode & learnCode)
{
return i;
}
}
else if( i < 64 )
{
if(RideCodeMode.learnCode & learnCode1)
{
return i;
}
}
else if( i < 96 )
{
if(RideCodeMode.learnCode & learnCode2)
{
return i;
}
}
}
}
return -1;
}
#else
int RIDEPET_getPETindex( int PetNo, unsigned int learnCode )
{
int i;
for( i=0; i< sizeof(RideCodeMode)/sizeof(tagRideCodeMode); i++ ){
if( RideCodeMode.petNo == PetNo &&
(RideCodeMode.learnCode & learnCode) ) {
return i;
}
}
return -1;
}
#endif
int RIDEPET_getRIDEno( int index, int ti)
{
if( index < 0 || index >= sizeof( RideNoList)/sizeof( tagRideNoList) )
return -1;
if( ti < 0 || ti >= MAXNOINDEX )
return -1;
return RideNoList[index].RideNo[ti];
}
#endif
#ifdef _EMENY_CHANCEMAN
int CHAR_getSexInt( int baseNo )
{
int i;
for( i=0; i< sizeof(RPlistMode)/sizeof(tagRidePetList); i++ ) {
if( RPlistMode.charNo == baseNo ) {
return RPlistMode.sex;
}
}
return -1;
}
#endif
[ 本帖最後由 n741209 於 2013-11-29 21:20 編輯 ]