void JGAnsMapSvrMove(PMSG_ANS_MAPSVRMOVE * lpMsg) { if ( gObjIsConnected(lpMsg->iIndex ) == FALSE ) { LogAddC(2, "[MapServerMng] Packet Error JG [0x7A] - User not Connected : %d", lpMsg->iIndex); return; } LPOBJ lpObj = &gObj[lpMsg->iIndex]; if ( strcmp( lpObj->AccountID , lpMsg->szAccountID ) || strcmp( lpObj->Name, lpMsg->szCharName) ) { LogAddC(2, "[MapServerMng] Packet Error JG [0x7A] - User Info Mismatch [%s][%s]-[%s][%s] (%d)", lpMsg->szAccountID, lpMsg->szCharName, lpObj->AccountID, lpObj->Name, lpObj->m_Index); return; } if ( lpMsg->iResult == 0 ) { PMSG_ANS_MAPSERVERCHANGE pMsg; PHeadSubSetBE((LPBYTE)&pMsg, 0xB1, 0x00, sizeof(pMsg)); pMsg.wMapSvrCode = g_MapServerManager.GetMapSvrGroup(); pMsg.iJoinAuthCode1 = lpMsg->iJoinAuthCode1 ; pMsg.iJoinAuthCode2 = lpMsg->iJoinAuthCode2 ; pMsg.iJoinAuthCode3 = lpMsg->iJoinAuthCode3; pMsg.iJoinAuthCode4 = lpMsg->iJoinAuthCode4 ; BOOL bRESULT = g_MapServerManager.GetSvrCodeData(lpMsg->wDstMapSvrCode, pMsg.szMapSvrIpAddress, &pMsg.wMapSvrPort); if ( bRESULT == FALSE ) { LogAddC(2, "[MapServerMng] Packet Error JG [0x7A] - Failed to find Map Info [%s]-[%s] (%d)", lpObj->AccountID, lpObj->Name, lpMsg->wDstMapSvrCode); return; } GJSetCharacterInfo(lpObj, lpObj->m_Index, TRUE); lpObj->m_bMapSvrMoveQuit = TRUE; lpObj->m_dwMapSvrQuitTick = GetTickCount(); DataSend(lpMsg->iIndex, (LPBYTE)&pMsg, pMsg.h.size); LogAddTD("[MapServerMng] [%s][%s] JG [0x7A] - Move Map Request OK : MAPSVR_D:%d", lpObj->AccountID, lpObj->Name, lpMsg->wDstMapSvrCode); } else { PMSG_NOTICE pNotice; TNotice::MakeNoticeMsgEx(&pNotice, 0, lMsg.Get(MSGGET(6, 77))); DataSend(lpObj->m_Index, (LPBYTE)&pNotice, pNotice.h.size); LogAddC(2, "[MapServerMng] Packet Error JG [0x7A] - Failed to Authorize User [%s][%s] Result:%d", lpObj->AccountID, lpObj->Name, lpMsg->iResult); } }
void DSProtocolCore(int aIndex, DWORD headcode, LPBYTE aRecv, int Len) { // g_ServerInfoDisplayer.SetState(TRUE,gSObj[aIndex].SType); switch( headcode ) { case 0x00: DataServerLogin((LPSDHP_SERVERINFO)aRecv,aIndex); break; case 0x01: JGPGetCharList((LPSDHP_GETCHARLIST)aRecv,aIndex); break; case 0x04: JGCharacterCreateRequest((LPSDHP_CREATECHAR)aRecv,aIndex); break; case 0x05: JGCharDelRequest((LPSDHP_CHARDELETE)aRecv,aIndex); break; case 0x06: JGGetCharacterInfo((LPSDHP_DBCHARINFOREQUEST)aRecv,aIndex); break; case 0x07: GJSetCharacterInfo((LPSDHP_DBCHAR_INFOSAVE)aRecv,aIndex); break; case 0x08: DGGetWarehouseList((LPSDHP_GETWAREHOUSEDB)aRecv,aIndex); break; case 0x09: GDSetWarehouseList((LPSDHP_GETWAREHOUSEDB_SAVE)aRecv,aIndex); break; case 0x11: GDUserItemSave((LPSDHP_DBCHAR_ITEMSAVE)aRecv,aIndex); break; case 0x13: DGGetMonsterKillInfo((LPMSG_REQ_QUESTMONSTERKILLINFO)aRecv,aIndex); break; case 0x14: DGSaveMonsterKillInfo((LPMSG_SAVE_MONSTERKILLINFO)aRecv,aIndex); break; case 0x15: DGSaveQuestExInfo((PMSG_REQ_QUESTEXINFO_SAVE*)aRecv,aIndex); break; case 0x16: DGReqQuestExInfo((PMSG_REQ_QUESTEXINFO*)aRecv,aIndex); break; case 0x40: { PBMSG_HEAD2 * lpDef = (PBMSG_HEAD2 *)aRecv; switch( lpDef->subcode ) { case 0x00: DGRequestServerInfo((PMSG_REQ_GENS_SERVERINFO*)aRecv,aIndex); break; case 0x01: DGRequestGensInfo((PMSG_REQ_GENS_INFO*)aRecv,aIndex); break; case 0x02: DGRequestJoinGens((PMSG_REQ_GENS_JOINREQUEST*)aRecv,aIndex); break; case 0x03: DGSaveGens((PMSG_GENS_INFOSAVE*)aRecv); break; case 0x04: DGRequestLeaveGens((PMSG_REQ_LEAVE_GENS*)aRecv,aIndex); break; } } break; case 0x30: JGGetMasterInfo((LPSDHP_DBMASTERINFOREQUEST)aRecv,aIndex); break; case 0x31: DGSaveMasterInfo((LPMSG_SAVE_MASTERINFO)aRecv,aIndex); break; case 0x52: ItemSerialCreateRecv((LPSDHP_ITEMCREATE)aRecv,aIndex); break; case 0x55: PetItemSerialCreateRecv((LPSDHP_ITEMCREATE)aRecv,aIndex); break; case 0x56: DGRecvPetItemInfo((LPSDHP_REQUEST_PETITEM_INFO)aRecv,aIndex); break; case 0x57: GDSavePetItemInfo((LPSDHP_SAVE_PETITEM_INFO)aRecv,aIndex); break; case 0x60: DGOptionDataRecv((LPSDHP_SKILLKEYDATA)aRecv,aIndex); break; case 0x61: DGMuBotOptionRecv((LPMUBOT_SETTINGS_REQ_SAVE)aRecv,aIndex); break; case 0x80: { PBMSG_HEAD2 * lpDef1 = (PBMSG_HEAD2 *)aRecv; switch(lpDef1->subcode) { case 0x01: DGAnsOwnerGuildMaster((LPCSP_REQ_OWNERGUILDMASTER)aRecv,aIndex); break; case 0x03: DGAnsCastleNpcBuy((LPCSP_REQ_NPCBUY)aRecv,aIndex); break; case 0x04: DGAnsCastleNpcRepair((LPCSP_REQ_NPCREPAIR)aRecv,aIndex); break; case 0x05: DGAnsCastleNpcUpgrade((LPCSP_REQ_NPCUPGRADE)aRecv,aIndex); break; case 0x06: DGAnsTaxInfo((LPCSP_REQ_TAXINFO)aRecv,aIndex); break; case 0x07: DGAnsTaxRateChange((LPCSP_REQ_TAXRATECHANGE)aRecv,aIndex); break; case 0x08: DGAnsCastleMoneyChange((LPCSP_REQ_MONEYCHANGE)aRecv,aIndex); break; case 0x09: DGAnsSiegeDateChange((LPCSP_REQ_SDEDCHANGE)aRecv,aIndex); break; case 0x0A: DGAnsGuildMarkRegInfo((LPCSP_REQ_GUILDREGINFO)aRecv,aIndex); break; case 0x0B: DGAnsSiegeEndedChange((LPCSP_REQ_SIEGEENDCHANGE)aRecv,aIndex); break; case 0x0C: DGAnsCastleOwnerChange((LPCSP_REQ_CASTLEOWNERCHANGE)aRecv,aIndex); break; case 0x0D: DGAnsRegAttackGuild((LPCSP_REQ_REGATTACKGUILD)aRecv,aIndex); break; case 0x0E: DGAnsRestartCastleState((LPCSP_REQ_CASTLESIEGEEND)aRecv,aIndex); break; case 0x0F: DGAnsMapSvrMsgMultiCast((LPCSP_REQ_MAPSVRMULTICAST)aRecv,aIndex); break; case 0x10: DGAnsRegGuildMark((LPCSP_REQ_GUILDREGMARK)aRecv,aIndex); break; case 0x11: DGAnsGuildMarkReset((LPCSP_REQ_GUILDRESETMARK)aRecv,aIndex); break; case 0x12: DGAnsGuildSetGiveUp((LPCSP_REQ_GUILDSETGIVEUP)aRecv,aIndex); break; case 0x16: DGAnsNpcRemove((LPCSP_REQ_NPCREMOVE)aRecv,aIndex); break; case 0x17: DGAnsCastleStateSync((LPCSP_REQ_CASTLESTATESYNC)aRecv,aIndex); break; case 0x18: DGAnsCastleTributeMoney((LPCSP_REQ_CASTLETRIBUTEMONEY)aRecv,aIndex); break; case 0x19: DGAnsResetCastleTaxInfo((LPCSP_REQ_RESETCASTLETAXINFO)aRecv,aIndex); break; case 0x1A: DGAnsResetSiegeGuildInfo((LPCSP_REQ_RESETSIEGEGUILDINFO)aRecv,aIndex); break; case 0x1B: DGAnsResetRegSiegeInfo((LPCSP_REQ_RESETREGSIEGEINFO)aRecv,aIndex); break; } } break; case 0x81: DGAnsCastleInitData((LPCSP_REQ_CSINITDATA)aRecv,aIndex); break; case 0x83: DGAnsAllGuildMarkRegInfo((LPCSP_REQ_ALLGUILDREGINFO)aRecv,aIndex); break; case 0x84: DGAnsFirstCreateNPC((LPCSP_REQ_NPCSAVEDATA)aRecv,aIndex); break; case 0x85: DGAnsCalcRegGuildList((LPCSP_REQ_CALCREGGUILDLIST)aRecv,aIndex); break; case 0x86: DGAnsCsGulidUnionInfo((LPCSP_REQ_CSGUILDUNIONINFO)aRecv,aIndex); break; case 0x87: DGAnsCsSaveTotalGuildInfo((LPCSP_REQ_CSSAVETOTALGUILDINFO)aRecv,aIndex); break; case 0x88: DGAnsCsLoadTotalGuildInfo((LPCSP_REQ_CSLOADTOTALGUILDINFO)aRecv,aIndex); break; case 0x89: DGAnsCastleNpcUpdate((LPCSP_REQ_NPCUPDATEDATA)aRecv,aIndex); break; case 0xB0: DGAnsCrywolfSync((LPCWP_REQ_CRYWOLFSYNC)aRecv,aIndex); break; case 0xB1: DGAnsCrywolfInfoLoad((LPCWP_REQ_CRYWOLFINFOLOAD)aRecv,aIndex); break; case 0xB2: DGAnsCrywolfInfoSave((LPCWP_REQ_CRYWOLFINFOSAVE)aRecv,aIndex); break; case 0xD0: { PBMSG_HEAD2 * lpMsg = (PBMSG_HEAD2 *)aRecv; switch ( lpMsg->subcode ) { case 0x03: DGAnsPeriodItemInsert((LPMSG_REQ_PERIODITEM_INSERT)aRecv,aIndex); break; case 0x05: DGAnsPeriodItemList((LPMSG_REQ_PERIODITEM_LIST)aRecv,aIndex); break; case 0x07: DGAnsPeriodItemUpdate((LPMSG_REQ_PERIODITEM_UPDATE)aRecv,aIndex); break; case 0x09: DGAnsPeriodItemDelete((LPMSG_REQ_PERIODITEM_DELETE)aRecv,aIndex); break; } } break; case 0xA2: DGSummonerCreate((CSHOP_SET_SUMMONER_CREATE*)aRecv); break; case 0xA3: DGExpandRequest((LPCSHOP_SET_EXPANDINVENTORY)aRecv); break; case 0xA4: DGAnsErtelList((LPMSG_REQ_ERTELLIST)aRecv,aIndex); break; case 0xA5: DGSaveErtelList((LPMSG_SAVE_ERTELLIST)aRecv); break; case 0xA6: //-> Custom { PBMSG_HEAD2* lpHead = (PBMSG_HEAD2*)aRecv; switch(lpHead->subcode) { case 0x00: { DGAchievUpdateMonsterData((AchievGDUpdateMonster*)aRecv, aIndex); } break; case 0x01: { DGAchievUpdateEventData((AchievGDUpdateEvent*)aRecv, aIndex); } break; case 0x02: { DGAchievUpdateMixData((AchievGDUpdateMix*)aRecv, aIndex); } break; } } break; case 0xEF: { PBMSG_HEAD2* lpHead = (PBMSG_HEAD2*)aRecv; // ---- switch(lpHead->subcode) { case 0x00: DGPartyMatchRegister((LPMSG_PARTYMATCHING_REG_REQ)aRecv,aIndex); break; case 0x01: DGPartyMatchInfo((LPMSG_PARTYMATCHING_INFO_REQ)aRecv,aIndex); break; case 0x02: DGPartyMatchJoin((LPMSG_PARTYMATCHING_JOIN_REQ)aRecv,aIndex); break; case 0x03: DGPartyMatchWaitInfo((LPMSG_PARTYMATCHING_WAIT_REQ)aRecv,aIndex); break; case 0x04: DGPartyMatchReqList((PARTYMATCH_GDREQ_REQUESTLIST*)aRecv, aIndex); break; case 0x05: DGPartyMatchRequestAnswer((PARTYMATCH_GDREQ_REQUESTANSWER*)aRecv, aIndex); break; case 0x06: DGPartyMatchCancel((LPMSG_PARTYMATCHING_CANCEL_REQ)aRecv,aIndex); break; case 0x07: GDPartyMatchUpdateStatus((PARTYMATCH_GDREQ_UPDATESTATUS*)aRecv); break; } } break; case 0xED: { PBMSG_HEAD2* lpHead = (PBMSG_HEAD2*)aRecv; // ---- switch(lpHead->subcode) { case 0x00: g_GuildClass.GDReqOfferList(aIndex, (GUILDMATCH_GDREQ_OFFERLIST*)aRecv); break; case 0x01: g_GuildClass.GDReqOfferListByFilter(aIndex, (GUILDMATCH_GDREQ_OFFERLISTFILTER*)aRecv); break; case 0x02: g_GuildClass.GDReqOfferCreate(aIndex, (GUILDMATCH_GDREQ_OFFERCREATE*)aRecv); break; case 0x03: g_GuildClass.GDReqOfferDelete(aIndex, (GUILDMATCH_GDREQ_OFFERDELETE*)aRecv); break; case 0x04: g_GuildClass.GDReqJoinReqAdd(aIndex, (GUILDMATCH_GDREQ_JOINREQ*)aRecv); break; case 0x05: g_GuildClass.GDReqJoinReqDelete(aIndex, (GUILDMATCH_GDREQ_JOINREQSTATUS*)aRecv); break; case 0x06: g_GuildClass.GDReqJoinReqAnswer(aIndex, (GUILDMATCH_GDREQ_REQUESTANSWER*)aRecv); break; case 0x07: g_GuildClass.GDReqJoinReqList(aIndex, (GUILDMATCH_GDREQ_REQUESTLIST*)aRecv); break; case 0x08: g_GuildClass.GDReqJoinReqStatus(aIndex, (GUILDMATCH_GDREQ_JOINREQSTATUS*)aRecv); break; } } break; case 0xFD: { PBMSG_HEAD2* lpHead = (PBMSG_HEAD2*)aRecv; // ---- switch(lpHead->subcode) { case 0x04: DBRecvVaultInfo((LPMSG_VAULT_INFO)aRecv,aIndex); break; } } break; case 0xFE: { PBMSG_HEAD2* lpHead = (PBMSG_HEAD2*)aRecv; // ---- switch(lpHead->subcode) { case 0: GD_HardcoreModeActivate((GD_HardcoreMode_Activate*)aRecv, aIndex); break; } } break; } // g_ServerInfoDisplayer.SetState(FALSE,gSObj[aIndex].SType); }
//005535a0 -> 100% int CMasterLevelSystem::MasterLevelUp(LPOBJ lpObj, __int64 iAddExp, bool bEventMapReward, int iMonsterType) //OK { if( !this->IsMasterLevelUser(lpObj) ) { return false; } int m_maxMasterLevel = GetPrivateProfileInt("Common", "MaxMasterLevel", 200, gDirPath.GetNewPath("MasterSystem.cfg")); int numCoded = 201; if (m_maxMasterLevel >= numCoded || m_maxMasterLevel <= 0){ int m_maxMasterLevel = 200; } // ---- if (lpObj->m_nMasterLevel >= m_maxMasterLevel) { GCServerMsgStringSend(lMsg.Get(1136), lpObj->m_Index, 1); return false; } // ---- if( bEventMapReward ) //-> New { iAddExp = iAddExp; //??? } else { #ifdef GENS if( gGensSystem.IsMapBattleZone(lpObj->MapNumber) ) //-> Original g_GensSystem maybe { iAddExp = iAddExp * (this->m_fAddExpRate + g_MLBattleZoneAddExp); } else { iAddExp = iAddExp * this->m_fAddExpRate; } #else iAddExp = iAddExp * this->m_fAddExpRate; #endif } // ---- if( lpObj->m_MPSkillOpt.MpsPlusExp > 0 ) { iAddExp += iAddExp * lpObj->m_MPSkillOpt.MpsPlusExp / 100; } // ---- if( iAddExp > 0 ) { gObjSetExpPetItem(lpObj->m_Index, iAddExp); // ---- LogAddTD("ML Experience : Map[%d]-(%d,%d) [%s][%s](%d) %I64d %I64d MonsterIndex : %d", //-> Updated lpObj->MapNumber, lpObj->X, lpObj->Y, lpObj->AccountID,lpObj->Name, lpObj->m_nMasterLevel, lpObj->m_i64MasterLevelExp, iAddExp, iMonsterType); // ---- if( iAddExp + lpObj->m_i64MasterLevelExp >= lpObj->m_i64NextMasterLevelExp ) { iAddExp = 0; // ----- int m_masterPointsPerLvl = GetPrivateProfileInt("Common", "MasterPointsPerLvl", 100, gDirPath.GetNewPath("MasterSystem.cfg")); int numCodeds = 101; if (m_maxMasterLevel >= numCodeds) { int m_masterPointsPerLvl = 1; } // ----- lpObj->m_i64MasterLevelExp = lpObj->m_i64NextMasterLevelExp; lpObj->m_nMasterLevel++; lpObj->m_iMasterLevelPoint += m_masterPointsPerLvl; //-> In future can use it for change ml point per level) // ----- gObjCalCharacter(lpObj->m_Index); // ----- lpObj->MaxLife += DCInfo.DefClass[ lpObj->Class ].LevelLife; lpObj->MaxMana += DCInfo.DefClass[ lpObj->Class ].LevelMana; lpObj->Life = lpObj->AddLife + lpObj->MaxLife; lpObj->Mana = lpObj->AddMana + lpObj->MaxMana; // ----- gObjCalcShieldPoint(lpObj); lpObj->iShield = lpObj->iAddShield + lpObj->iMaxShield; // ----- this->gObjNextMLExpCal(lpObj); // ---- gObjCalcMaxLifePower(lpObj->m_Index); gObjSetBP(lpObj->m_Index); GJSetCharacterInfo(lpObj, lpObj->m_Index, 0, 0); this->GCMasterLevelUpInfo(lpObj); GCReFillSend(lpObj->m_Index, lpObj->Life, 0xFF, 0, lpObj->iShield); GCManaSend(lpObj->m_Index, lpObj->Mana, 0xFF, 0, lpObj->BP); //-> Original name ->_BP } else { lpObj->m_i64MasterLevelExp += iAddExp; } // ---- GCSendExp_INT64(lpObj->m_Index, 65535, iAddExp, 0, 0); } // ---- return true; }