Exemple #1
0
    //--------------------------------------------------------------------------------------------
	// MG_CN_MODIFY
    MG::Bool BigMapResCsv::load( Str16 fileName, IMGExternalPackManager* packManager/* = NULL */)
    {
        CsvReader csvreader;
		// MG_CN_MODIFY
        if(!csvreader.create(fileName, packManager))
        {
            return false;
        }

        CsvData* csvdata = NULL;
        Int RowCount = csvreader.count();

        for(int i = 0; i < RowCount; ++i)
        {
            csvdata = csvreader.findValue(i);
            if(!csvdata)
            {
                continue;
            }

            UInt nCol = 3;

            std::string widgetName;
            MGStrOp::toString(csvdata->mData[nCol++].c_str(), widgetName);
            UInt placeid = 0;
            MGStrOp::toU32(csvdata->mData[nCol++].c_str(), placeid );


            mMapWidgetNamePlaceId[widgetName] = placeid;
        }

        return true;
    }
    //-----------------------------------------------------------------------------------
	// MG_CN_MODIFY
	MG::Bool CharacterResourceConfig::load( Str16 fileName, IMGExternalPackManager* packManager/* = NULL*/ )
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(fileName, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			CharacterResInfo* res_info = new CharacterResInfo();
			MGStrOp::toU32(csvdata->mData[CHARACTER_ID].c_str(),res_info->id);
			MGStrOp::toU32(csvdata->mData[CHARACTER_TEMPLATEID].c_str(),res_info->templateid);
			res_info->name = csvdata->mData[CHARACTER_NAME].c_str();
			MGStrOp::toU32(csvdata->mData[CHARACTER_MAPLISTID].c_str(),res_info->maplistid);
            MGStrOp::toU32(csvdata->mData[CHARACTER_POINTRESId].c_str(),res_info->pointresid);
			MGStrOp::toI32(csvdata->mData[CHARACTER_MAPLISTTYPE].c_str(),(I32&)res_info->maplisttype);
			mCharacterResourceList[res_info->id] = res_info;
            
		}
		return true;

	}
Exemple #3
0
	//--------------------------------------------------------------------------
	// MG_CN_MODIFY
	Bool ArtMapResCsv::load(const Char16* FileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(FileName, packManager))
		{
			return false;
		}

		DYNAMIC_ASSERT(csvreader.getColumnSize() == AMR_RPGRadarID + 1 || csvreader.getColumnSize() == AMR_Max);
		
		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(Int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			ArtMapResIdType artMapResId;
			MGStrOp::toI32(csvdata->mData[AMR_ArtMapResId].c_str(), artMapResId);
			if (true == mArtMapResList.hasData(artMapResId))
			{
				DYNAMIC_ASSERT(0);
				continue;
			}

			ArtMapResCsvInfo* newArtMapRes = mArtMapResList.createOrRetrieve(artMapResId, false);
			newArtMapRes->artMapResId	= artMapResId;
			newArtMapRes->name			= csvdata->mData[AMR_Name];
			newArtMapRes->BaseFilePath	= csvdata->mData[AMR_BaseFilePath];
			//newArtMapRes->cameraId		= csvdata->mData[AMR_CameraSetID];

			MGStrOp::toI32(csvdata->mData[AMR_UseType].c_str(), (I32&)newArtMapRes->mapType);
			MGStrOp::toU32(csvdata->mData[AMR_RPGCamSetID].c_str(), newArtMapRes->rpgCameraId);
			MGStrOp::toU32(csvdata->mData[AMR_RPGRadarID].c_str(), newArtMapRes->rpgRadarId);

			if ( csvdata->mData.size() > AMR_RPGRadarID + 1 )
			{
				MGStrOp::toU32(csvdata->mData[AMR_SLGCamSetID].c_str(), newArtMapRes->slgCameraId);
				MGStrOp::toU32(csvdata->mData[AMR_SLGRadarID].c_str(), newArtMapRes->slgRadarId);
			}
			else
			{
				newArtMapRes->slgCameraId = newArtMapRes->rpgCameraId;
				newArtMapRes->slgRadarId = newArtMapRes->rpgRadarId;
			}
		}

		return true;
	}
Exemple #4
0
	//--------------------------------------------------------------------------
	// MG_CN_MODIFY
	Bool DistrictListCsv::loadCsv(const Char16* FileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(FileName, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(Int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			DistrictIdType id;
			MGStrOp::toI32(csvdata->mData[DistrictListRow::districtId].c_str(), id);
			if (true == isInDistrictList(id))
			{
				DYNAMIC_ASSERT(0);
				continue;
			}

			I32 openType = -1;
			MGStrOp::toI32(csvdata->mData[DistrictListRow::openType].c_str(), openType);
			if (DOT_OPEN != (DistrictOpenType)openType)
			{
				continue;
			}

			DistrictListCsvInfo* newDistrictInfo = mDistrictList.createOrRetrieve(id, false);
			
			newDistrictInfo->setDistrictId(id);
			newDistrictInfo->setName(csvdata->mData[DistrictListRow::name]);
			newDistrictInfo->setText(csvdata->mData[DistrictListRow::text]);
			newDistrictInfo->setTitle(csvdata->mData[DistrictListRow::title]);
			newDistrictInfo->setOpenType((DistrictOpenType)openType);

			I32 rank = -1;
			MGStrOp::toI32(csvdata->mData[DistrictListRow::districtRank].c_str(), rank);
			newDistrictInfo->setRank((DistrictRankType)rank);
			int kk = 0;
		}

		return true;
	}
Exemple #5
0
	//-------------------------------------------------------------------------------------------------------
	// MG_CN_MODIFY
	MG::Bool CharacterNpcList::loadFile( Str16 filename, IMGExternalPackManager* packManager/* = NULL*/ )
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(filename, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			CharacterNpcInfo* tempCharInfo = new CharacterNpcInfo;
			UInt nCol = 0;

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterNpcId);
			nCol++;
			tempCharInfo->ListName		    = csvdata->mData[nCol++].c_str();
			tempCharInfo->SurName		    = csvdata->mData[nCol++].c_str();
			tempCharInfo->Name				= csvdata->mData[nCol++].c_str();
			tempCharInfo->Title				= csvdata->mData[nCol++].c_str();
			tempCharInfo->Tips				= csvdata->mData[nCol++].c_str();

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), (U32&)tempCharInfo->GenderType   );
			DYNAMIC_ASSERT(tempCharInfo->GenderType < GENDER_TYPE_MAX  &&  tempCharInfo->GenderType > GENDER_TYPE_NULL);

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->Level						);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterAppellationId		);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterDialogId			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AIId						);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->InfluenceId				); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtIconId					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtMashId					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtEffectId				);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterVisionEventListId	); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AIBaseGroupId				); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AIFightGroupId				);

			mMapCharacterNpcInfo[tempCharInfo->CharacterNpcId] = tempCharInfo;
		}

		return true;
	}
Exemple #6
0
    //-----------------------------------------------------------------------------------
	// MG_CN_MODIFY
    MG::Bool ColorResConfig::load( Str16 fileName, IMGExternalPackManager* packManager/* = NULL*/)
    {
        CsvReader csvreader;
		// MG_CN_MODIFY
        if(!csvreader.create(fileName, packManager))
        {
            return false;
        }

        CsvData* csvdata = NULL;
        Int RowCount = csvreader.count();

        for(int i = 0; i < RowCount; ++i)
        {
            csvdata = csvreader.findValue(i);
            if(!csvdata)
            {
                continue;
            }

            ColorResCsvInfo* tempInfo = new ColorResCsvInfo;
            UInt nCol = 0;

            MGStrOp::toU32(csvdata->mData[nCol++].c_str(),      tempInfo->ColorRes_Id     );
			nCol++;
			MGStrOp::toString(csvdata->mData[nCol++].c_str(),   tempInfo->ColorName	  );
            MGStrOp::toU32(csvdata->mData[nCol++].c_str(),      (U32&)tempInfo->UseType   );

			Str16 tempStr = csvdata->mData[nCol++];
			MGStrOp::toFlt(tempStr.substr(0,3).c_str(),(tempInfo->ColorValue).r);
			MGStrOp::toFlt(tempStr.substr(3,3).c_str(),(tempInfo->ColorValue).g);
			MGStrOp::toFlt(tempStr.substr(6,3).c_str(),(tempInfo->ColorValue).b);
			MGStrOp::toFlt(tempStr.substr(9,3).c_str(),(tempInfo->ColorValue).a);

			tempInfo->ColorValue.r = tempInfo->ColorValue.r/255.0f;
			tempInfo->ColorValue.g = tempInfo->ColorValue.g/255.0f;
			tempInfo->ColorValue.b = tempInfo->ColorValue.b/255.0f;
			tempInfo->ColorValue.a = tempInfo->ColorValue.a/255.0f;

			MGStrOp::toString(csvdata->mData[nCol++].c_str(),   tempInfo->EscapeChar);

            mColorResCsvMap[tempInfo->ColorRes_Id] = tempInfo;
        }

        return true;
    }
Exemple #7
0
	//--------------------------------------------------------------------------
	// MG_CN_MODIFY
	Bool RelationCsvBase::load(const Char16* FileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(FileName, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(Int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			RelationIdType relationId;
			MGStrOp::toI32(csvdata->mData[RCB_RelationId].c_str(), relationId);
			if (true == mRelationList.hasData(relationId))
			{
				DYNAMIC_ASSERT(0);
				continue;
			}

			MapIdType mapId;
			MGStrOp::toU32(csvdata->mData[RCB_MapId].c_str(), mapId);

			GameObjectIdType gameDataId;
			MGStrOp::toU64(csvdata->mData[RCB_GameDataId].c_str(), gameDataId);

			RelationInfo* newRelationInfo = mRelationList.createOrRetrieve(relationId, false);
			newRelationInfo->relationId	= relationId;
			newRelationInfo->mapId		= mapId;
			newRelationInfo->artName	= csvdata->mData[RCB_ArtName];
			newRelationInfo->gameDataId	= gameDataId;

			//mArtMapResList[id] = newArtMapRes;
		}

		return true;
	}
Exemple #8
0
	// MG_CN_MODIFY
	MG::Bool QuestValueChangeInfos::load(Str16 fileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(fileName, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int rowCount = csvreader.count();
		for(Int i = 0; i < rowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}
			QuestValueChangeInfo* tempInfo = MG_NEW QuestValueChangeInfo;

			MGStrOp::toU32(csvdata->mData[questvaluechangeinfoid].c_str(),					tempInfo->id);
			MGStrOp::toU32(csvdata->mData[questvaluechangeinfogroupid].c_str(),				tempInfo->groupId);
			I32 tempType;
			MGStrOp::toI32(csvdata->mData[questvaluechangeinfotype].c_str(),				tempType);
			tempInfo->type = (CHANGE_TYPE)tempType; 
			MGStrOp::toU32(csvdata->mData[questvaluechangeinfoparam1].c_str(),				tempInfo->param1);
			MGStrOp::toU32(csvdata->mData[questvaluechangeinfoparam2].c_str(),				tempInfo->param2);
			MGStrOp::toU32(csvdata->mData[questvaluechangeinfoparam3].c_str(),				tempInfo->param3);
			MGStrOp::toU32(csvdata->mData[questvaluechangeinfoparam4].c_str(),				tempInfo->param4);

			MGStrOp::toI32(csvdata->mData[questvaluechangeinfovaluechangetype].c_str(),		tempType);       
			tempInfo->valueChangeType = (VALUECHANGE_TYPE)(tempType-1);                   //Мо±нґУ1їЄКј
			MGStrOp::toI32(csvdata->mData[questvaluechangeinfovaluechangenum].c_str(),		tempInfo->valueChangeNum);
			if (getQuestValueChangeInfo(tempInfo->id))
			{
				DYNAMIC_ASSERT(false);
				MG_SAFE_DELETE(tempInfo);
				continue;
			}
			mQuestValueChangeInfoMap[tempInfo->id] = tempInfo;
		}
		return true;
	}
	//-------------------------------------------------------------------------------------------
	// MG_CN_MODIFY
	Bool ParabolaAreaSkillTemplate::load(Str16 fileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(fileName, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int rowCount = csvreader.count();
		for(Int i = 0; i < rowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			ParabolaAreaSkillInfo* tempInfo = MG_NEW ParabolaAreaSkillInfo;

			MGStrOp::toU32(csvdata->mData[SKILLTYPEID].c_str(),	tempInfo->skillTypeId);
			MGStrOp::toU32(csvdata->mData[SKILLTYPEGROUPID].c_str(), tempInfo->skillTypeGroupId);
			MGStrOp::toU32(csvdata->mData[SKILLLEVEL].c_str(), tempInfo->skillLevel);
			tempInfo->name = csvdata->mData[NAME];
			tempInfo->text = csvdata->mData[TEXT];
			tempInfo->kindName = csvdata->mData[KINDNAME];
			MGStrOp::toU32(csvdata->mData[ARTICONID].c_str(), tempInfo->artIconId);
			//MGStrOp::toU32(csvdata->mData[ACTIONTIME].c_str(), tempInfo->actionTime);

			for(UInt i = 0; i < 2; ++i)
			{
				tempInfo->skillExpression[i+1].action = csvdata->mData[ACTION2 + 3 * i];
				MGStrOp::toU32(csvdata->mData[ACTION2 + 3 * i + 1].c_str(), tempInfo->skillExpression[i+1].artEffectId);
				MGStrOp::toU32(csvdata->mData[ACTION2 + 3 * i + 2].c_str(), tempInfo->skillExpression[i+1].audioResId);
			}

			MGStrOp::toU32(csvdata->mData[POINTEFFECTID].c_str(), tempInfo->pointEffectId);
			MGStrOp::toU32(csvdata->mData[ARTEFFECTFLYID].c_str(), tempInfo->artEffectFlyId);
			Flt tempSpeed = 0;
			MGStrOp::toFlt(csvdata->mData[ARTEFFECTFLYSPEED].c_str(), tempSpeed);
			tempInfo->artEffectFlySpeed = tempSpeed / 10;
			MGStrOp::toU32(csvdata->mData[POINTAUDIOID].c_str(), tempInfo->pointAudioId);
			UInt tempParabolaType = 0;
			MGStrOp::toU32(csvdata->mData[PARABOLATYPE].c_str(), tempParabolaType);
			tempInfo->parabolaType = (ParabolaType)tempParabolaType;
			UInt tempParabolaAngle = 0;
			MGStrOp::toU32(csvdata->mData[PARABOLAANGLE].c_str(), tempParabolaAngle);
			tempInfo->parabolaAngle = tempParabolaAngle;
			MGStrOp::toFlt(csvdata->mData[ATTACKFRONTTIME].c_str(), tempInfo->attackFrontTime);
			tempInfo->attackFrontTime /= 10;
			MGStrOp::toFlt(csvdata->mData[ATTACKBEHINDTIME].c_str(), tempInfo->attackBehindTime);
			tempInfo->attackBehindTime /= 10;
			MGStrOp::toU32(csvdata->mData[PUBLICTIMEPIECEID].c_str(), tempInfo->publicTimepieceId);
			MGStrOp::toU32(csvdata->mData[PUBLICTIMEPIECEDELAY].c_str(), tempInfo->publicTimepieceDelay);
			tempInfo->publicTimepieceDelay *= 100;
			MGStrOp::toU32(csvdata->mData[OWNERTIMEPIECEID].c_str(), tempInfo->ownerTimepieceId);
			MGStrOp::toU32(csvdata->mData[OWNERTIMEPIECEDELAY].c_str(), tempInfo->ownerTimepieceDelay);
			tempInfo->ownerTimepieceDelay *= 100;
			MGStrOp::toU32(csvdata->mData[RESETTIMEPIECEID].c_str(), tempInfo->resetTimepieceId);
			MGStrOp::toU32(csvdata->mData[RESETTIMEPIECEGROUPID].c_str(), tempInfo->resetTimepieceGroupId);
			MGStrOp::toU32(csvdata->mData[CHARACTERJUDGEID1].c_str(), tempInfo->characterJudgeId1);
			MGStrOp::toU32(csvdata->mData[CHARACTERJUDGEID2].c_str(), tempInfo->characterJudgeId2);
			MGStrOp::toFlt(csvdata->mData[RANGE].c_str(), tempInfo->range);
			tempInfo->range /= 10;
			MGStrOp::toFlt(csvdata->mData[MAXRANGE].c_str(), tempInfo->maxRange);
			tempInfo->maxRange /= 10;
			MGStrOp::toFlt(csvdata->mData[SKILLRADIUO].c_str(), tempInfo->skillRadius);
			tempInfo->skillRadius /= 10;
			MGStrOp::toU32(csvdata->mData[ATTACKNUM].c_str(), tempInfo->attackNum);
			UInt tempShareType; 
			MGStrOp::toU32(csvdata->mData[SHARETYPE].c_str(), tempShareType);
			tempInfo->shareType = (ShareType)tempShareType;
			UInt tempSpendType; 
			MGStrOp::toU32(csvdata->mData[SPENDTYPE].c_str(), tempSpendType);
			tempInfo->spendType = (SpendType)tempSpendType;
			MGStrOp::toU32(csvdata->mData[FORMULAPARAMETERID2].c_str(), tempInfo->formulaParameterId2);
			UInt tempAttackType; 
			MGStrOp::toU32(csvdata->mData[ATTACKTYPE].c_str(), tempAttackType);
			tempInfo->attackType = (AttackType)tempAttackType;
			MGStrOp::toU32(csvdata->mData[FORMULAPARAMETERID1].c_str(), tempInfo->formulaParameterId);
			UInt tempDamageType; 
			MGStrOp::toU32(csvdata->mData[DAMAGETYPE].c_str(), tempDamageType);
			tempInfo->damageType = (DamageType)tempDamageType;
			MGStrOp::toU32(csvdata->mData[RANDOMSTATE].c_str(), tempInfo->randomState);
			MGStrOp::toU32(csvdata->mData[STATEID].c_str(), tempInfo->stateId);
			MGStrOp::toU32(csvdata->mData[STATENUM].c_str(), tempInfo->stateNum);
			MGStrOp::toU32(csvdata->mData[HATE].c_str(), tempInfo->hate);

			if (getParabolaAreaSkillInfo(tempInfo->skillTypeId))
			{
				DYNAMIC_ASSERT(false);
				MG_SAFE_DELETE(tempInfo);
				continue;
			}

			mParabolaAreaSkillInfoList[tempInfo->skillTypeId] = tempInfo;
		}

		return true;
	}
	//-------------------------------------------------------------------------------------------------------
	// MG_CN_MODIFY
	MG::Bool CharacterGenrealList::loadFile( Str16 filename, IMGExternalPackManager* packManager/* = NULL*/ )
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(filename, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			CharacterGenrealInfo* tempCharInfo = new CharacterGenrealInfo;
			UInt nCol = 0;

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterGeneralId);
			nCol++;
			tempCharInfo->ListName		    = csvdata->mData[nCol++].c_str();
			tempCharInfo->SurName		    = csvdata->mData[nCol++].c_str();
			tempCharInfo->Name				= csvdata->mData[nCol++].c_str();
			tempCharInfo->Title				= csvdata->mData[nCol++].c_str();
			tempCharInfo->Tips				= csvdata->mData[nCol++].c_str();

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), (U32&)tempCharInfo->GenderType		);
			DYNAMIC_ASSERT(tempCharInfo->GenderType> GENDER_TYPE_NULL  &&  tempCharInfo->GenderType < GENDER_TYPE_MAX);

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), (U32&)tempCharInfo->PowerfulType		);
			DYNAMIC_ASSERT(tempCharInfo->PowerfulType> POWERFUL_TYPE_NULL  &&  tempCharInfo->PowerfulType < POWERFUL_TYPE_MAX);

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), (U32&)tempCharInfo->FormulaType		);
			DYNAMIC_ASSERT(tempCharInfo->FormulaType> CHAR_FORMULA_TYPE_NULL  &&  tempCharInfo->FormulaType < CHAR_FORMULA_TYPE_MAX);


			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->Level						);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->LineageLevel				);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityInitId1				);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityInitId2				); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityInitId3				);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityAppendId			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterSkillId1			); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterSkillId2			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->Age						);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->MinLifeSpan				);
			//MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->MaxLifeSpan				);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->NatureId					); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterAppellationId		);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterDialogId			); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtIconId					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtMashId1					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtMashId2					); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtMashId3					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->WeaponAcction				); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterVisionEventListId	);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AIBaseGroupId				); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AIFightGroupId				);


			mMapCharacterGenrealInfo[tempCharInfo->CharacterGeneralId] = tempCharInfo;
		}

		return true;
	}
Exemple #11
0
	//-------------------------------------------------------------------------------------------------
	// MG_CN_MODIFY
	Bool FightAITemplate::load( Str16 fileName, IMGExternalPackManager* packManager/* = NULL*/ )
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(fileName, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			FightAIInfo* tempInfo = new FightAIInfo;

			MGStrOp::toU32(csvdata->mData[AIFIGHTID].c_str(), tempInfo->aiFightId);
			MGStrOp::toU32(csvdata->mData[PRIORITY].c_str(), tempInfo->priority);

			UInt tempContactType = 0;
			MGStrOp::toU32(csvdata->mData[CONTACTTYPE].c_str(), tempContactType);
			tempInfo->contactType = (ContactType)tempContactType;

			UInt tempContactCharacterType = 0;
			MGStrOp::toU32(csvdata->mData[CONTACTPARAM1].c_str(), tempContactCharacterType);
			tempInfo->contactParam1 = (ContactCharacterType)tempContactCharacterType;

			MGStrOp::toFlt(csvdata->mData[CONTACTPARAM2].c_str(), tempInfo->contactParam2);
			MGStrOp::toFlt(csvdata->mData[CONTACTPARAM3].c_str(), tempInfo->contactParam3);
			MGStrOp::toFlt(csvdata->mData[CONTACTPARAM4].c_str(), tempInfo->contactParam4);

			switch(tempInfo->contactType)
			{
			case CT_ContactType1:
			case CT_ContactType7:
			case CT_ContactType8:
				tempInfo->contactParam2 /= 10;
				break;
			}

			MGStrOp::toU32(csvdata->mData[RANDOMNUM].c_str(), tempInfo->randomNum);
			MGStrOp::toU32(csvdata->mData[CONTACTNUM].c_str(), tempInfo->contactNum);

			UInt tempEventType = 0;
			MGStrOp::toU32(csvdata->mData[EVENTTYPE].c_str(), tempEventType);
			tempInfo->eventType = (EventType)tempEventType;
			UInt tempEventCharacterType = 0;
			MGStrOp::toU32(csvdata->mData[EVENTPARAM1].c_str(), tempEventCharacterType);
			tempInfo->eventParam1 = (EventCharacterType)tempEventCharacterType;
			MGStrOp::toU32(csvdata->mData[EVENTPARAM2].c_str(), tempInfo->eventParam2);
			MGStrOp::toU32(csvdata->mData[EVENTPARAM3].c_str(), tempInfo->eventParam3);
			MGStrOp::toU32(csvdata->mData[EVENTPARAM4].c_str(), tempInfo->eventParam4);

			mFightAIInfoList[tempInfo->aiFightId] = tempInfo;
		}

		return true;
	}
	//--------------------------------------------------------------------------
	Bool InstanceAtkStrengthListCsv::load(const Char16* FileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;

		if(!csvreader.create(FileName, packManager))
		{
			return false;
		}

		DYNAMIC_ASSERT(csvreader.getColumnSize() == InstanceAtkStrengthListCsvRow_Max);

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(Int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			CampIdType campId;
			MGStrOp::toU64(csvdata->mData[InstanceAtkStrengthListCsvRow_CampId].c_str(), campId);
			if (true == mInstanceAtkStrengthList.hasData(campId))
			{
				DYNAMIC_ASSERT(0);
				continue;
			}

			U32 buildTemplateId;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_CharacterBuildId].c_str(), buildTemplateId);

			U32 campPoint;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_CampPointId].c_str(), campPoint);

			U32 generalRefreshPoint;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_GeneraRefreshpoint].c_str(), generalRefreshPoint);

			U32 generalAlivePoint;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_GeneraSpawnPoint].c_str(), generalAlivePoint);

			U32 armyPoint01;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint01].c_str(), armyPoint01);

			U32 armyPoint02;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint02].c_str(), armyPoint02);

			U32 armyPoint03;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint03].c_str(), armyPoint03);

			U32 armyPoint04;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint04].c_str(), armyPoint04);

			U32 armyPoint05;
			MGStrOp::toU32(csvdata->mData[InstanceAtkStrengthListCsvRow_ArmyPlayedPoint05].c_str(), armyPoint05);

			InstanceAtkStrengthListCsvInfo* newInfo	= mInstanceAtkStrengthList.createOrRetrieve(campId, false);
			newInfo->campId					= campId;
			newInfo->buildTemplateId		= buildTemplateId;
			newInfo->campPoint				= campPoint;
			newInfo->generalRefreshPoint	= generalRefreshPoint;
			newInfo->generalAlivePoint		= generalAlivePoint;
			newInfo->armyPoint[0]			= armyPoint01;
			newInfo->armyPoint[1]			= armyPoint02;
			newInfo->armyPoint[2]			= armyPoint03;
			newInfo->armyPoint[3]			= armyPoint04;
			newInfo->armyPoint[4]			= armyPoint05;
		}

		return true;
	}
	//-------------------------------------------------------------------------------------------------------
	MG::Bool CharacterGenrealList::loadFile( Str16 filename )
	{
		CsvReader csvreader;

		if(!csvreader.create(filename))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			CharacterGenrealInfo* tempCharInfo = new CharacterGenrealInfo;
			UInt nCol = 0;

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterGeneralId);

			tempCharInfo->SurName		    = csvdata->mData[nCol++].c_str();
			tempCharInfo->Name				= csvdata->mData[nCol++].c_str();
			tempCharInfo->ZhiName			= csvdata->mData[nCol++].c_str();
			tempCharInfo->Title				= csvdata->mData[nCol++].c_str();
			tempCharInfo->Tips				= csvdata->mData[nCol++].c_str();

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), (U32&)tempCharInfo->GenderType		  );
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), (U32&)tempCharInfo->PowerfulType		  );
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), (U32&)tempCharInfo->RaceType			  );
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), (U32&)tempCharInfo->FormulaType		  );

			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->Level						);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->LineageLevel				);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), (U32&)tempCharInfo->AbilityRandomType	);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityAppendId1			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityAppendId2			); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityAppendId3			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityAppendId4			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityAppendId5			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AbilityAppendId6			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterSkillId1			); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterSkillId2			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->Age						);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->MinLifeSpan				);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->MaxLifeSpan				);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->NatureId					); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterAppellationId		);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->CharacterDialogId			); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->OfficialLevelId			);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->TitleId					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtIconId1					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtIconId2					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtMashId1					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtMashId2					); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->ArtMashId3					);
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->WeaponAcction				); 
			MGStrOp::toU32(csvdata->mData[nCol++].c_str(), tempCharInfo->AudioResId					);


			mMapCharacterGenrealInfo[tempCharInfo->CharacterGeneralId] = tempCharInfo;
		}

		return true;
	}
	//-------------------------------------------------------------------------------------------
	// MG_CN_MODIFY
	Bool LongRangeGeneralAttackSkillTemplate::load(Str16 fileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(fileName, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int rowCount = csvreader.count();
		for(Int i = 0; i < rowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}
			LongRangeGeneralAttackSkillInfo* tempInfo = MG_NEW LongRangeGeneralAttackSkillInfo;

			MGStrOp::toU32(csvdata->mData[SKILLTYPEID].c_str(),	tempInfo->skillTypeId);
			MGStrOp::toU32(csvdata->mData[SKILLTYPEGROUPID].c_str(), tempInfo->skillTypeGroupId);
			tempInfo->name = csvdata->mData[NAME];
			tempInfo->text = csvdata->mData[TEXT];
			tempInfo->kindName = csvdata->mData[KINDNAME];
			MGStrOp::toU32(csvdata->mData[ARTICONID].c_str(), tempInfo->artIconId);

			for(UInt i = 0; i < 4; ++i)
			{
				tempInfo->skillExpression[i].action = csvdata->mData[ACTION1 + 3 * i];
				MGStrOp::toU32(csvdata->mData[ACTION1 + 3 * i + 1].c_str(), tempInfo->skillExpression[i].artEffectId);
				MGStrOp::toU32(csvdata->mData[ACTION1 + 3 * i + 2].c_str(), tempInfo->skillExpression[i].audioResId);
			}

			UInt tempArtEffectFlyType; 
			MGStrOp::toU32(csvdata->mData[ARTEFFECTFLYTYPE].c_str(), tempArtEffectFlyType);
			tempInfo->artEffectFlyType = (SkillFlyType)tempArtEffectFlyType;
			MGStrOp::toU32(csvdata->mData[ARTEFFECTFLYID].c_str(), tempInfo->artEffectFlyId);
			MGStrOp::toU32(csvdata->mData[ARTEFFECTFLYSPEED].c_str(), tempInfo->artEffectFlySpeed);
			tempInfo->artEffectFlySpeed /= 10;
			MGStrOp::toFlt(csvdata->mData[ATTACKFRONTTIME].c_str(), tempInfo->attackFrontTime);
			tempInfo->attackFrontTime /= 10;
			MGStrOp::toFlt(csvdata->mData[ATTACKBEHINDTIME].c_str(), tempInfo->attackBehindTime);
			tempInfo->attackBehindTime /= 10;
			MGStrOp::toU32(csvdata->mData[PUBLICTIMEPIECEID].c_str(), tempInfo->publicTimepieceId);
			MGStrOp::toU32(csvdata->mData[PUBLICTIMEPIECEDELAY].c_str(), tempInfo->publicTimepieceDelay);
			tempInfo->publicTimepieceDelay *= 100;
			MGStrOp::toU32(csvdata->mData[CHARACTERJUDGEID1].c_str(), tempInfo->characterJudgeId1);
			MGStrOp::toU32(csvdata->mData[CHARACTERJUDGEID2].c_str(), tempInfo->characterJudgeId2);
			MGStrOp::toFlt(csvdata->mData[RANGE].c_str(), tempInfo->range);
			tempInfo->range /= 10;
			MGStrOp::toFlt(csvdata->mData[MAXRANGE].c_str(), tempInfo->maxRange);
			tempInfo->maxRange /= 10;
			UInt tempAttackType; 
			MGStrOp::toU32(csvdata->mData[ATTACKTYPE].c_str(), tempAttackType);
			tempInfo->attackType = (AttackType)tempAttackType;
			MGStrOp::toU32(csvdata->mData[FORMULAPARAMETERID].c_str(), tempInfo->formulaParameterId);
			MGStrOp::toU32(csvdata->mData[HATE].c_str(), tempInfo->hate);
			
			if (getLongRangeGeneralAttackSkillInfo(tempInfo->skillTypeId))
			{
				DYNAMIC_ASSERT(false);
				MG_SAFE_DELETE(tempInfo);
				continue;
			}

			mLongRangeGeneralAttackSkillInfoList[tempInfo->skillTypeId] = tempInfo;
		}

		return true;
	}
Exemple #15
0
	//--------------------------------------------------------------------------
	// MG_CN_MODIFY
	Bool MapListCsv::load(const Char16* FileName, IMGExternalPackManager* packManager/* = NULL*/)
	{
		CsvReader csvreader;
		// MG_CN_MODIFY
		if(!csvreader.create(FileName, packManager))
		{
			return false;
		}

		CsvData* csvdata = NULL;
		Int RowCount = csvreader.count();

		for(Int i = 0; i < RowCount; ++i)
		{
			csvdata = csvreader.findValue(i);
			if(!csvdata)
			{
				continue;
			}

			MapIdType mapListId = -1;
			MGStrOp::toU32(csvdata->mData[MLC_MapId].c_str(), mapListId);
			if (true == mMapList.hasData(mapListId))
			{
				DYNAMIC_ASSERT(0);
				continue;
			}

			Str mapGroupName = "";
			MGStrOp::toString(csvdata->mData[MLC_MapGroupName].c_str(), mapGroupName);

			Int mapOpenType = -1;
			MGStrOp::toI32(csvdata->mData[MLC_OpenType].c_str(), mapOpenType);

			Int mapType = -1;
			MGStrOp::toI32(csvdata->mData[MLC_MapType].c_str(), mapType);

			ArtMapResIdType artMapResId = -1;
			MGStrOp::toI32(csvdata->mData[MLC_ArtMapResId].c_str(), artMapResId);

			U32 audioResID = -1;
			MGStrOp::toU32(csvdata->mData[MLC_AudioResId].c_str(), audioResID);


			ArtPointResId rpgJumpPointId = 0;
			MGStrOp::toI32(csvdata->mData[MLC_RpgJumpPointId].c_str(), rpgJumpPointId);
			
			ArtPointResId rpgAlivePointId = 0;
			MGStrOp::toI32(csvdata->mData[MLC_RpgAlivePointId].c_str(), rpgAlivePointId);
			
			ArtPointResId slgAttackJumpPointId = 0;
			MGStrOp::toI32(csvdata->mData[MLC_SlgAttackJumpPointId].c_str(), slgAttackJumpPointId);
			
			ArtPointResId slgAttackAlivePointId = 0;
			MGStrOp::toI32(csvdata->mData[MLC_SlgAttackAlivePointId].c_str(), slgAttackAlivePointId);
			
			ArtPointResId slgDefenseJumpPointId = 0;
			MGStrOp::toI32(csvdata->mData[MLC_SlgDefenseJumpPointId].c_str(), slgDefenseJumpPointId);
			
			ArtPointResId slgDefenseAlivePointId = 0;
			MGStrOp::toI32(csvdata->mData[MLC_SlgDefenseAlivePointId].c_str(), slgDefenseAlivePointId);


			MapListCsvInfo* newMapInfo = mMapList.createOrRetrieve(mapListId, false);
			newMapInfo->mapListId		= mapListId;
			newMapInfo->mapGroupName	= csvdata->mData[MLC_MapGroupName];
			newMapInfo->mapName			= csvdata->mData[MLC_MapName];
			newMapInfo->mapText			= csvdata->mData[MLC_MapText];
			newMapInfo->mapOpenType		= (MapOpenType)mapOpenType;
			newMapInfo->mapType			= (MapType)mapType;
			newMapInfo->artMapResId		= artMapResId;
			newMapInfo->fileName		= csvdata->mData[MLC_MapFileName];
			newMapInfo->filePath		= csvdata->mData[MLC_MapFilePath];
			newMapInfo->audioResID		= audioResID;
			
			newMapInfo->rpgJumpPointId			= rpgJumpPointId;
			newMapInfo->rpgAlivePointId			= rpgAlivePointId;
			newMapInfo->slgAttackJumpPointId	= slgAttackJumpPointId;
			newMapInfo->slgAttackAlivePointId	= slgAttackAlivePointId;
			newMapInfo->slgDefenseJumpPointId	= slgDefenseJumpPointId;
			newMapInfo->slgDefenseAlivePointId	= slgDefenseAlivePointId;
		}

		return true;
	}