Timasu 30 Posted May 5, 2014 Share Posted May 5, 2014 (edited) I made a short tut^^: At first i want to say: this is not compatible with a table_postfix or item_vnum ranges. [1] open "ClientManagerBoot.cpp" and make these both if-terms to comments or delete them (in my tree at line 22 - 26 and 34 - 38) [2] edit the function "CClientManager::InitializeMobTable()" like this: bool CClientManager::InitializeMobTable() { static const char * query = "SELECT vnum, name, locale_name, rank, type, battle_type, level, size, ai_flag+0, mount_capacity," "setRaceFlag+0, setImmuneFlag+0, empire, folder, on_click, st, dx, ht, iq, damage_min, damage_max," "max_hp, regen_cycle, regen_percent, gold_min, gold_max, exp, def, attack_speed, move_speed, aggressive_hp_pct," "aggressive_sight, attack_range, drop_item, resurrection_vnum, enchant_curse, enchant_slow," "enchant_poison, enchant_stun, enchant_critical, enchant_penetrate, resist_sword, resist_twohand," "resist_dagger, resist_bell, resist_fan, resist_bow, resist_fire, resist_elect, resist_magic, resist_wind," "resist_poison, dam_multiply, summon, drain_sp, mob_color, polymorph_item, skill_level0, skill_vnum0," "skill_level1, skill_vnum1, skill_level2, skill_vnum2, skill_level3, skill_vnum3, skill_level4, skill_vnum4," "sp_berserk, sp_stoneskin, sp_godspeed, sp_deathblow, sp_revive FROM mob_proto ORDER BY vnum"; std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query)); SQLResult * pRes = pkMsg->Get(); if (!pRes->uiNumRows) { sys_err("No result from Mob_Proto!"); return false; } if (!m_vec_mobTable.empty()) { sys_log(0, "RELOAD: mob_proto"); m_vec_mobTable.clear(); } m_vec_mobTable.reserve(pRes->uiNumRows); MYSQL_ROW data; int col; while ((data = mysql_fetch_row(pRes->pSQLResult))) { TMobTable t; memset(&t, 0, sizeof(t)); col = 0; str_to_number(t.dwVnum, data[col++]); strlcpy(t.szName, data[col++], sizeof(t.szName)); strlcpy(t.szLocaleName, data[col++], sizeof(t.szLocaleName)); str_to_number(t.bRank, data[col++]); str_to_number(t.bType, data[col++]); str_to_number(t.bBattleType, data[col++]); str_to_number(t.bLevel, data[col++]); str_to_number(t.bSize, data[col++]); str_to_number(t.dwAIFlag, data[col++]); str_to_number(t.bMountCapacity, data[col++]); str_to_number(t.dwRaceFlag, data[col++]); str_to_number(t.dwImmuneFlag, data[col++]); str_to_number(t.bEmpire, data[col++]); strlcpy(t.szFolder, data[col++], sizeof(t.szFolder)); str_to_number(t.bOnClickType, data[col++]); str_to_number(t.bStr, data[col++]); str_to_number(t.bDex, data[col++]); str_to_number(t.bCon, data[col++]); str_to_number(t.bInt, data[col++]); str_to_number(t.dwDamageRange[0], data[col++]); str_to_number(t.dwDamageRange[1], data[col++]); str_to_number(t.dwMaxHP, data[col++]); str_to_number(t.bRegenCycle, data[col++]); str_to_number(t.bRegenPercent, data[col++]); str_to_number(t.dwGoldMin, data[col++]); str_to_number(t.dwGoldMax, data[col++]); str_to_number(t.dwExp, data[col++]); str_to_number(t.wDef, data[col++]); str_to_number(t.sAttackSpeed, data[col++]); str_to_number(t.sMovingSpeed, data[col++]); str_to_number(t.bAggresiveHPPct, data[col++]); str_to_number(t.wAggressiveSight, data[col++]); str_to_number(t.wAttackRange, data[col++]); str_to_number(t.dwDropItemVnum, data[col++]); str_to_number(t.dwResurrectionVnum, data[col++]); str_to_number(t.cEnchants[0], data[col++]); str_to_number(t.cEnchants[1], data[col++]); str_to_number(t.cEnchants[2], data[col++]); str_to_number(t.cEnchants[3], data[col++]); str_to_number(t.cEnchants[4], data[col++]); str_to_number(t.cEnchants[5], data[col++]); str_to_number(t.cResists[0], data[col++]); str_to_number(t.cResists[1], data[col++]); str_to_number(t.cResists[2], data[col++]); str_to_number(t.cResists[3], data[col++]); str_to_number(t.cResists[4], data[col++]); str_to_number(t.cResists[5], data[col++]); str_to_number(t.cResists[6], data[col++]); str_to_number(t.cResists[7], data[col++]); str_to_number(t.cResists[8], data[col++]); str_to_number(t.cResists[9], data[col++]); str_to_number(t.cResists[10], data[col++]); str_to_number(t.fDamMultiply, data[col++]); str_to_number(t.dwSummonVnum, data[col++]); str_to_number(t.dwDrainSP, data[col++]); str_to_number(t.dwMobColor, data[col++]); str_to_number(t.dwPolymorphItemVnum, data[col++]); str_to_number(t.Skills[0].bLevel, data[col++]); str_to_number(t.Skills[0].dwVnum, data[col++]); str_to_number(t.Skills[1].bLevel, data[col++]); str_to_number(t.Skills[1].dwVnum, data[col++]); str_to_number(t.Skills[2].bLevel, data[col++]); str_to_number(t.Skills[2].dwVnum, data[col++]); str_to_number(t.Skills[3].bLevel, data[col++]); str_to_number(t.Skills[3].dwVnum, data[col++]); str_to_number(t.Skills[4].bLevel, data[col++]); str_to_number(t.Skills[4].dwVnum, data[col++]); str_to_number(t.bBerserkPoint, data[col++]); str_to_number(t.bStoneSkinPoint, data[col++]); str_to_number(t.bGodSpeedPoint, data[col++]); str_to_number(t.bDeathBlowPoint, data[col++]); str_to_number(t.bRevivePoint, data[col++]); sys_log(0, "Monster: %s loaded", t.szLocaleName); m_vec_mobTable.push_back(t); } return true; } [3] edit the function "CClientManager::InitializeItemTable()" like this: bool CClientManager::InitializeItemTable() { /* I needed to make 2 mysql queries because with only 1 there was always a stackoverflow.... * However^^ It works so idc */ const char * c_ist_doof = "SELECT refined_vnum, refine_set, magic_pct FROM item_proto ORDER BY vnum"; SQLMsg* sqlMsg1 = CDBManager::instance().DirectQuery(c_ist_doof); const char * query = "SELECT vnum, name, locale_name, type, subtype, weight, size, antiflag+0," "flag+0, wearflag+0, immuneflag+0, gold, shop_buy_price, refined_vnum," "refine_set, magic_pct, limittype0, limitvalue0, limittype1, limitvalue1," "applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2," "value0, value1, value2, value3, value4, value5, socket0, socket1, socket2," "socket3, socket4, socket5, specular, socket_pct, addon_type FROM item_proto ORDER BY vnum"; SQLMsg* sqlMsg = CDBManager::instance().DirectQuery(query); MYSQL_RES* pRes1 = sqlMsg1->vec_pkResult[0]->pSQLResult; MYSQL_RES* pRes = sqlMsg->vec_pkResult[0]->pSQLResult; if (sizeof(pRes) <= 1 || sizeof(pRes1) <= 1) { sys_err("Kein Ergebnis aus Item_Proto!"); return false; } if (!m_vec_itemTable.empty()) { sys_log(0, "Reloading Item_Proto"); m_vec_itemTable.clear(); } MYSQL_ROW data; MYSQL_ROW data1; while ((data = mysql_fetch_row(pRes)) && (data1 = mysql_fetch_row(pRes1))) { TItemTable t; TItemTable baum; str_to_number(baum.dwRefinedVnum, data1[0]); str_to_number(baum.wRefineSet, data1[1]); str_to_number(baum.bAlterToMagicItemPct, data1[2]); str_to_number(t.dwVnum, data[0]); strlcpy(t.szName, data[1], sizeof(t.szName)); strlcpy(t.szLocaleName, data[2], sizeof(t.szLocaleName)); str_to_number(t.bType, data[3]); str_to_number(t.bSubType, data[4]); str_to_number(t.bWeight, data[5]); str_to_number(t.bSize, data[6]); str_to_number(t.dwAntiFlags, data[7]); str_to_number(t.dwFlags, data[8]); str_to_number(t.dwWearFlags, data[9]); str_to_number(t.dwImmuneFlag, data[10]); str_to_number(t.dwGold, data[11]); str_to_number(t.dwShopBuyPrice,data[12]); str_to_number(t.aLimits[0].bType, data[16]); str_to_number(t.aLimits[0].lValue, data[17]); str_to_number(t.aLimits[1].bType, data[18]); str_to_number(t.aLimits[1].lValue, data[19]); str_to_number(t.aApplies[0].bType, data[20]); str_to_number(t.aApplies[0].lValue, data[21]); str_to_number(t.aApplies[1].bType, data[22]); str_to_number(t.aApplies[1].lValue, data[23]); str_to_number(t.aApplies[2].bType, data[24]); str_to_number(t.aApplies[2].lValue, data[25]); str_to_number(t.alValues[0], data[26]); str_to_number(t.alValues[1], data[27]); str_to_number(t.alValues[2], data[28]); str_to_number(t.alValues[3], data[29]); str_to_number(t.alValues[4], data[30]); str_to_number(t.alValues[5], data[31]); str_to_number(t.alSockets[0], data[32]); str_to_number(t.alSockets[1], data[33]); str_to_number(t.alSockets[2], data[34]); str_to_number(t.alSockets[3], data[35]); str_to_number(t.alSockets[4], data[36]); str_to_number(t.alSockets[5], data[37]); str_to_number(t.bSpecular, data[38]); str_to_number(t.bGainSocketPct, data[39]); str_to_number(t.sAddonType, data[40]); t.cLimitRealTimeFirstUseIndex = -1; t.cLimitTimerBasedOnWearIndex = -1; for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i) { if (LIMIT_REAL_TIME_START_FIRST_USE == t.aLimits.bType) t.cLimitRealTimeFirstUseIndex = (char) i; if (LIMIT_TIMER_BASED_ON_WEAR == t.aLimits.bType) t.cLimitTimerBasedOnWearIndex = (char) i; } // Conversion t.dwRefinedVnum = baum.dwRefinedVnum; t.wRefineSet = baum.wRefineSet; t.bAlterToMagicItemPct = baum.bAlterToMagicItemPct; //Debug //sys_log(0,"%d %d %d",t.dwRefinedVnum, t.wRefineSet, t.bAlterToMagicItemPct); //sys_log(0,"%d %d %d",baum.dwRefinedVnum, baum.wRefineSet, baum.bAlterToMagicItemPct); m_vec_itemTable.push_back(t); } m_map_itemTableByVnum.clear(); __gnu_cxx::__normal_iterator<SItemTable*, std::vector<SItemTable, std::allocator<SItemTable> > > it = m_vec_itemTable.begin(); while (it != m_vec_itemTable.end()) { TItemTable * item_table = &(*(it++)); sys_log(0,"Item %s geladen", item_table->szLocaleName); m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table)); } sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum()); return true; } [4] make both functions "bool CClientManager::MirrorMobTableIntoDB()" and "bool CClientManager::MirrorItemTableIntoDB()" to comments or delete them [5] open "ClientManager.h" and delete or make these functions to comments: (in my tree they are at line 190 and 191) Thanks to iMer because i use some lines of his code and he had to stand over my skype spam^^ NOTE: If you have different table structures or more columns you want to use, you have to change the functions Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal 5 Link to comment Share on other sites More sharing options...
.CHNoel 3 Posted May 6, 2014 Share Posted May 6, 2014 Mhh, this does not work. :S Link to comment Share on other sites More sharing options...
Timasu 30 Posted May 6, 2014 Author Share Posted May 6, 2014 You wrong something. I've tested it and works. Link to comment Share on other sites More sharing options...
.JαyZoN 41 Posted May 10, 2014 Share Posted May 10, 2014 There are missing parts and this is only for item_proto. I don't see a difference between iMer's and your post so this isn't a tutorial. You have to uncomment / remove MirrorItemTableIntoDB and MirrorMobTableIntoDB and their calls. And this will not work on VS 2008. Link to comment Share on other sites More sharing options...
DaCookie -Raven 35 Posted May 10, 2014 Share Posted May 10, 2014 I made a function for mob_proto and i cant find a bug: bool CClientManager::InitializeMobTable() { static const char * query = "SELECT vnum, name, locale_name, rank, type, battle_type, level, size, ai_flag, mount_capacity," "setRaceFlag, setImmuneFlag, empire, folder, on_click, st, dx, ht, iq, damage_min, damage_max," "max_hp, regen_cycle, regen_percent, gold_min, gold_max, exp, def, attack_speed, move_speed, aggressive_hp_pct," "aggressive_sight, attack_range, drop_item, resurrection_vnum, enchant_curse, enchant_slow," "enchant_poison, enchant_stun, enchant_critical, enchant_penetrate, resist_sword, resist_twohand," "resist_dagger, resist_bell, resist_fan, resist_bow, resist_fire, resist_elect, resist_magic, resist_wind," "resist_poison, dam_multiply, summon, drain_sp, mob_color, polymorph_item, skill_level0, skill_vnum0," "skill_level1, skill_vnum1, skill_level2, skill_vnum2, skill_level3, skill_vnum3, skill_level4, skill_vnum4," "sp_berserk, sp_stoneskin, sp_godspeed, sp_deathblow, sp_revive FROM mob_proto ORDER BY vnum"; std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query)); SQLResult * pRes = pkMsg->Get(); if (!pRes->uiNumRows) { sys_err("No result from Mob_Proto!"); return false; } if (!m_vec_mobTable.empty()) { sys_log(0, "RELOAD: mob_proto"); m_vec_mobTable.clear(); } m_vec_mobTable.reserve(pRes->uiNumRows); MYSQL_ROW data; int col; while ((data = mysql_fetch_row(pRes->pSQLResult))) { TMobTable t; memset(&t, 0, sizeof(t)); col = 0; str_to_number(t.dwVnum, data[col++]); strlcpy(t.szName, data[col++], sizeof(t.szName)); strlcpy(t.szLocaleName, data[col++], sizeof(t.szLocaleName)); str_to_number(t.bRank, data[col++]); str_to_number(t.bType, data[col++]); str_to_number(t.bBattleType, data[col++]); str_to_number(t.bLevel, data[col++]); str_to_number(t.bSize, data[col++]); str_to_number(t.dwAIFlag, data[col++]); str_to_number(t.bMountCapacity, data[col++]); str_to_number(t.dwRaceFlag, data[col++]); str_to_number(t.dwImmuneFlag, data[col++]); str_to_number(t.bEmpire, data[col++]); strlcpy(t.szFolder, data[col++], sizeof(t.szFolder)); str_to_number(t.bOnClickType, data[col++]); str_to_number(t.bStr, data[col++]); str_to_number(t.bDex, data[col++]); str_to_number(t.bCon, data[col++]); str_to_number(t.bInt, data[col++]); str_to_number(t.dwDamageRange[0], data[col++]); str_to_number(t.dwDamageRange[1], data[col++]); str_to_number(t.dwMaxHP, data[col++]); str_to_number(t.bRegenCycle, data[col++]); str_to_number(t.bRegenPercent, data[col++]); str_to_number(t.dwGoldMin, data[col++]); str_to_number(t.dwGoldMax, data[col++]); str_to_number(t.dwExp, data[col++]); str_to_number(t.wDef, data[col++]); str_to_number(t.sAttackSpeed, data[col++]); str_to_number(t.sMovingSpeed, data[col++]); str_to_number(t.bAggresiveHPPct, data[col++]); str_to_number(t.wAggressiveSight, data[col++]); str_to_number(t.wAttackRange, data[col++]); str_to_number(t.dwDropItemVnum, data[col++]); str_to_number(t.dwResurrectionVnum, data[col++]); str_to_number(t.cEnchants[0], data[col++]); str_to_number(t.cEnchants[1], data[col++]); str_to_number(t.cEnchants[2], data[col++]); str_to_number(t.cEnchants[3], data[col++]); str_to_number(t.cEnchants[4], data[col++]); str_to_number(t.cEnchants[5], data[col++]); str_to_number(t.cResists[0], data[col++]); str_to_number(t.cResists[1], data[col++]); str_to_number(t.cResists[2], data[col++]); str_to_number(t.cResists[3], data[col++]); str_to_number(t.cResists[4], data[col++]); str_to_number(t.cResists[5], data[col++]); str_to_number(t.cResists[6], data[col++]); str_to_number(t.cResists[7], data[col++]); str_to_number(t.cResists[8], data[col++]); str_to_number(t.cResists[9], data[col++]); str_to_number(t.cResists[10], data[col++]); str_to_number(t.fDamMultiply, data[col++]); str_to_number(t.dwSummonVnum, data[col++]); str_to_number(t.dwDrainSP, data[col++]); str_to_number(t.dwMobColor, data[col++]); str_to_number(t.dwPolymorphItemVnum, data[col++]); str_to_number(t.Skills[0].bLevel, data[col++]); str_to_number(t.Skills[0].dwVnum, data[col++]); str_to_number(t.Skills[1].bLevel, data[col++]); str_to_number(t.Skills[1].dwVnum, data[col++]); str_to_number(t.Skills[2].bLevel, data[col++]); str_to_number(t.Skills[2].dwVnum, data[col++]); str_to_number(t.Skills[3].bLevel, data[col++]); str_to_number(t.Skills[3].dwVnum, data[col++]); str_to_number(t.Skills[4].bLevel, data[col++]); str_to_number(t.Skills[4].dwVnum, data[col++]); str_to_number(t.bBerserkPoint, data[col++]); str_to_number(t.bStoneSkinPoint, data[col++]); str_to_number(t.bGodSpeedPoint, data[col++]); str_to_number(t.bDeathBlowPoint, data[col++]); str_to_number(t.bRevivePoint, data[col++]); sys_log(0, "Monster: %d - %s loaded [Test: Int: %d | Yang-Drop Max: %d | Attack Speed: %d | Movement Speed.: %d]", t.dwVnum, t.szLocaleName, t.bInt, t.dwGoldMax, t.sAttackSpeed, t.sMovingSpeed); m_vec_mobTable.push_back(t); } return true; } You also have to remove "MirrorMobTableIntoDB" and the call (starting in my ClientManagerBoot.cpp in line 22) and if you want also in the header file The same i tried with the item_proto but 3 columns are always 0 .... take a look if you find an error please tell me^^ bool CClientManager::InitializeItemTable() { static const char * query = "SELECT vnum, name, locale_name, type, subtype, weight, size, antiflag," "flag, wearflag, immuneflag, gold, shop_buy_price, refined_vnum," "refine_set, magic_pct, limittype0, limitvalue0, limittype1, limitvalue1," "applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2," "value0, value1, value2, value3, value4, value5, socket0, socket1, socket2," "socket3, socket4, socket5, specular, socket_pct, addon_type FROM item_proto ORDER BY vnum"; std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query)); SQLResult * pRes = pkMsg->Get(); if (!pRes->uiNumRows) { sys_err("Kein Ergebnis aus Item_Proto!"); return false; } if (!m_vec_itemTable.empty()) { sys_log(0, "RELOAD: item_proto"); m_vec_itemTable.clear(); } m_vec_itemTable.reserve(pRes->uiNumRows); MYSQL_ROW data; int col; while ((data = mysql_fetch_row(pRes->pSQLResult))) { TItemTable t; memset(&t, 0, sizeof(t)); col = 0; str_to_number(t.dwVnum, data[col++]); strlcpy(t.szName, data[col++], sizeof(t.szName)); strlcpy(t.szLocaleName, data[col++], sizeof(t.szLocaleName)); str_to_number(t.bType, data[col++]); str_to_number(t.bSubType, data[col++]); str_to_number(t.bWeight, data[col++]); str_to_number(t.bSize, data[col++]); str_to_number(t.dwAntiFlags, data[col++]); str_to_number(t.dwFlags, data[col++]); str_to_number(t.dwWearFlags, data[col++]); str_to_number(t.dwImmuneFlag, data[col++]); str_to_number(t.dwGold, data[col++]); str_to_number(t.dwShopBuyPrice, data[col++]); str_to_number(t.dwRefinedVnum, data[col++]); str_to_number(t.wRefineSet, data[col++]); str_to_number(t.bAlterToMagicItemPct, data[col++]); str_to_number(t.aLimits[0].bType, data[col++]); str_to_number(t.aLimits[0].lValue, data[col++]); str_to_number(t.aLimits[1].bType, data[col++]); str_to_number(t.aLimits[1].lValue, data[col++]); str_to_number(t.aApplies[0].bType, data[col++]); str_to_number(t.aApplies[0].lValue, data[col++]); str_to_number(t.aApplies[1].bType, data[col++]); str_to_number(t.aApplies[1].lValue, data[col++]); str_to_number(t.aApplies[2].bType, data[col++]); str_to_number(t.aApplies[2].lValue, data[col++]); str_to_number(t.alValues[0], data[col++]); str_to_number(t.alValues[1], data[col++]); str_to_number(t.alValues[2], data[col++]); str_to_number(t.alValues[3], data[col++]); str_to_number(t.alValues[4], data[col++]); str_to_number(t.alValues[5], data[col++]); str_to_number(t.alSockets[0], data[col++]); str_to_number(t.alSockets[1], data[col++]); str_to_number(t.alSockets[2], data[col++]); str_to_number(t.alSockets[3], data[col++]); str_to_number(t.alSockets[4], data[col++]); str_to_number(t.alSockets[5], data[col++]); str_to_number(t.bSpecular, data[col++]); str_to_number(t.bGainSocketPct, data[col++]); str_to_number(t.sAddonType, data[col++]); sys_log(0,"%d %s %d %d %d %d",t.dwVnum, t.szLocaleName,t.dwShopBuyPrice, t.dwRefinedVnum, t.wRefineSet, t.bAlterToMagicItemPct); m_vec_itemTable.push_back(t); } return true; } Link to comment Share on other sites More sharing options...
cBaraN 109 Posted May 14, 2014 Share Posted May 14, 2014 ready're doing No txt ClientManagerBoot.cpp send me please? Link to comment Share on other sites More sharing options...
DaCookie -Raven 35 Posted May 14, 2014 Share Posted May 14, 2014 (edited) I made a short tut^^: At first i want to say: this is not compatible with a table_postfix or item_vnum ranges. [1] open "ClientManagerBoot.cpp" and make these both if-terms to comments or delete them (in my tree at line 22 - 26 and 34 - 38) [2] edit the function "CClientManager::InitializeMobTable()" like this: bool CClientManager::InitializeMobTable() { static const char * query = "SELECT vnum, name, locale_name, rank, type, battle_type, level, size, ai_flag+0, mount_capacity," "setRaceFlag+0, setImmuneFlag+0, empire, folder, on_click, st, dx, ht, iq, damage_min, damage_max," "max_hp, regen_cycle, regen_percent, gold_min, gold_max, exp, def, attack_speed, move_speed, aggressive_hp_pct," "aggressive_sight, attack_range, drop_item, resurrection_vnum, enchant_curse, enchant_slow," "enchant_poison, enchant_stun, enchant_critical, enchant_penetrate, resist_sword, resist_twohand," "resist_dagger, resist_bell, resist_fan, resist_bow, resist_fire, resist_elect, resist_magic, resist_wind," "resist_poison, dam_multiply, summon, drain_sp, mob_color, polymorph_item, skill_level0, skill_vnum0," "skill_level1, skill_vnum1, skill_level2, skill_vnum2, skill_level3, skill_vnum3, skill_level4, skill_vnum4," "sp_berserk, sp_stoneskin, sp_godspeed, sp_deathblow, sp_revive FROM mob_proto ORDER BY vnum"; std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query)); SQLResult * pRes = pkMsg->Get(); if (!pRes->uiNumRows) { sys_err("No result from Mob_Proto!"); return false; } if (!m_vec_mobTable.empty()) { sys_log(0, "RELOAD: mob_proto"); m_vec_mobTable.clear(); } m_vec_mobTable.reserve(pRes->uiNumRows); MYSQL_ROW data; int col; while ((data = mysql_fetch_row(pRes->pSQLResult))) { TMobTable t; memset(&t, 0, sizeof(t)); col = 0; str_to_number(t.dwVnum, data[col++]); strlcpy(t.szName, data[col++], sizeof(t.szName)); strlcpy(t.szLocaleName, data[col++], sizeof(t.szLocaleName)); str_to_number(t.bRank, data[col++]); str_to_number(t.bType, data[col++]); str_to_number(t.bBattleType, data[col++]); str_to_number(t.bLevel, data[col++]); str_to_number(t.bSize, data[col++]); str_to_number(t.dwAIFlag, data[col++]); str_to_number(t.bMountCapacity, data[col++]); str_to_number(t.dwRaceFlag, data[col++]); str_to_number(t.dwImmuneFlag, data[col++]); str_to_number(t.bEmpire, data[col++]); strlcpy(t.szFolder, data[col++], sizeof(t.szFolder)); str_to_number(t.bOnClickType, data[col++]); str_to_number(t.bStr, data[col++]); str_to_number(t.bDex, data[col++]); str_to_number(t.bCon, data[col++]); str_to_number(t.bInt, data[col++]); str_to_number(t.dwDamageRange[0], data[col++]); str_to_number(t.dwDamageRange[1], data[col++]); str_to_number(t.dwMaxHP, data[col++]); str_to_number(t.bRegenCycle, data[col++]); str_to_number(t.bRegenPercent, data[col++]); str_to_number(t.dwGoldMin, data[col++]); str_to_number(t.dwGoldMax, data[col++]); str_to_number(t.dwExp, data[col++]); str_to_number(t.wDef, data[col++]); str_to_number(t.sAttackSpeed, data[col++]); str_to_number(t.sMovingSpeed, data[col++]); str_to_number(t.bAggresiveHPPct, data[col++]); str_to_number(t.wAggressiveSight, data[col++]); str_to_number(t.wAttackRange, data[col++]); str_to_number(t.dwDropItemVnum, data[col++]); str_to_number(t.dwResurrectionVnum, data[col++]); str_to_number(t.cEnchants[0], data[col++]); str_to_number(t.cEnchants[1], data[col++]); str_to_number(t.cEnchants[2], data[col++]); str_to_number(t.cEnchants[3], data[col++]); str_to_number(t.cEnchants[4], data[col++]); str_to_number(t.cEnchants[5], data[col++]); str_to_number(t.cResists[0], data[col++]); str_to_number(t.cResists[1], data[col++]); str_to_number(t.cResists[2], data[col++]); str_to_number(t.cResists[3], data[col++]); str_to_number(t.cResists[4], data[col++]); str_to_number(t.cResists[5], data[col++]); str_to_number(t.cResists[6], data[col++]); str_to_number(t.cResists[7], data[col++]); str_to_number(t.cResists[8], data[col++]); str_to_number(t.cResists[9], data[col++]); str_to_number(t.cResists[10], data[col++]); str_to_number(t.fDamMultiply, data[col++]); str_to_number(t.dwSummonVnum, data[col++]); str_to_number(t.dwDrainSP, data[col++]); str_to_number(t.dwMobColor, data[col++]); str_to_number(t.dwPolymorphItemVnum, data[col++]); str_to_number(t.Skills[0].bLevel, data[col++]); str_to_number(t.Skills[0].dwVnum, data[col++]); str_to_number(t.Skills[1].bLevel, data[col++]); str_to_number(t.Skills[1].dwVnum, data[col++]); str_to_number(t.Skills[2].bLevel, data[col++]); str_to_number(t.Skills[2].dwVnum, data[col++]); str_to_number(t.Skills[3].bLevel, data[col++]); str_to_number(t.Skills[3].dwVnum, data[col++]); str_to_number(t.Skills[4].bLevel, data[col++]); str_to_number(t.Skills[4].dwVnum, data[col++]); str_to_number(t.bBerserkPoint, data[col++]); str_to_number(t.bStoneSkinPoint, data[col++]); str_to_number(t.bGodSpeedPoint, data[col++]); str_to_number(t.bDeathBlowPoint, data[col++]); str_to_number(t.bRevivePoint, data[col++]); sys_log(0, "Monster: %s loaded", t.szLocaleName); m_vec_mobTable.push_back(t); } return true; } [3] edit the function "CClientManager::InitializeItemTable()" like this: bool CClientManager::InitializeItemTable() { /* I needed to make 2 mysql queries because with only 1 there was always a stackoverflow.... * However^^ It works so idc */ const char * c_ist_doof = "SELECT refined_vnum, refine_set, magic_pct FROM item_proto ORDER BY vnum"; SQLMsg* sqlMsg1 = CDBManager::instance().DirectQuery(c_ist_doof); const char * query = "SELECT vnum, name, locale_name, type, subtype, weight, size, antiflag+0," "flag+0, wearflag+0, immuneflag+0, gold, shop_buy_price, refined_vnum," "refine_set, magic_pct, limittype0, limitvalue0, limittype1, limitvalue1," "applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2," "value0, value1, value2, value3, value4, value5, socket0, socket1, socket2," "socket3, socket4, socket5, specular, socket_pct, addon_type FROM item_proto ORDER BY vnum"; SQLMsg* sqlMsg = CDBManager::instance().DirectQuery(query); MYSQL_RES* pRes1 = sqlMsg1->vec_pkResult[0]->pSQLResult; MYSQL_RES* pRes = sqlMsg->vec_pkResult[0]->pSQLResult; if (sizeof(pRes) <= 1 || sizeof(pRes1) <= 1) { sys_err("Kein Ergebnis aus Item_Proto!"); return false; } if (!m_vec_itemTable.empty()) { sys_log(0, "Reloading Item_Proto"); m_vec_itemTable.clear(); } MYSQL_ROW data; MYSQL_ROW data1; while ((data = mysql_fetch_row(pRes)) && (data1 = mysql_fetch_row(pRes1))) { TItemTable t; TItemTable baum; str_to_number(baum.dwRefinedVnum, data1[0]); str_to_number(baum.wRefineSet, data1[1]); str_to_number(baum.bAlterToMagicItemPct, data1[2]); str_to_number(t.dwVnum, data[0]); strlcpy(t.szName, data[1], sizeof(t.szName)); strlcpy(t.szLocaleName, data[2], sizeof(t.szLocaleName)); str_to_number(t.bType, data[3]); str_to_number(t.bSubType, data[4]); str_to_number(t.bWeight, data[5]); str_to_number(t.bSize, data[6]); str_to_number(t.dwAntiFlags, data[7]); str_to_number(t.dwFlags, data[8]); str_to_number(t.dwWearFlags, data[9]); str_to_number(t.dwImmuneFlag, data[10]); str_to_number(t.dwGold, data[11]); str_to_number(t.dwShopBuyPrice,data[12]); str_to_number(t.aLimits[0].bType, data[16]); str_to_number(t.aLimits[0].lValue, data[17]); str_to_number(t.aLimits[1].bType, data[18]); str_to_number(t.aLimits[1].lValue, data[19]); str_to_number(t.aApplies[0].bType, data[20]); str_to_number(t.aApplies[0].lValue, data[21]); str_to_number(t.aApplies[1].bType, data[22]); str_to_number(t.aApplies[1].lValue, data[23]); str_to_number(t.aApplies[2].bType, data[24]); str_to_number(t.aApplies[2].lValue, data[25]); str_to_number(t.alValues[0], data[26]); str_to_number(t.alValues[1], data[27]); str_to_number(t.alValues[2], data[28]); str_to_number(t.alValues[3], data[29]); str_to_number(t.alValues[4], data[30]); str_to_number(t.alValues[5], data[31]); str_to_number(t.alSockets[0], data[32]); str_to_number(t.alSockets[1], data[33]); str_to_number(t.alSockets[2], data[34]); str_to_number(t.alSockets[3], data[35]); str_to_number(t.alSockets[4], data[36]); str_to_number(t.alSockets[5], data[37]); str_to_number(t.bSpecular, data[38]); str_to_number(t.bGainSocketPct, data[39]); str_to_number(t.sAddonType, data[40]); t.cLimitRealTimeFirstUseIndex = -1; t.cLimitTimerBasedOnWearIndex = -1; for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i) { if (LIMIT_REAL_TIME_START_FIRST_USE == t.aLimits[i].bType) t.cLimitRealTimeFirstUseIndex = (char) i; if (LIMIT_TIMER_BASED_ON_WEAR == t.aLimits[i].bType) t.cLimitTimerBasedOnWearIndex = (char) i; } // Conversion t.dwRefinedVnum = baum.dwRefinedVnum; t.wRefineSet = baum.wRefineSet; t.bAlterToMagicItemPct = baum.bAlterToMagicItemPct; //Debug //sys_log(0,"%d %d %d",t.dwRefinedVnum, t.wRefineSet, t.bAlterToMagicItemPct); //sys_log(0,"%d %d %d",baum.dwRefinedVnum, baum.wRefineSet, baum.bAlterToMagicItemPct); m_vec_itemTable.push_back(t); } m_map_itemTableByVnum.clear(); __gnu_cxx::__normal_iterator<SItemTable*, std::vector<SItemTable, std::allocator<SItemTable> > > it = m_vec_itemTable.begin(); while (it != m_vec_itemTable.end()) { TItemTable * item_table = &(*(it++)); sys_log(0,"Item %s geladen", item_table->szLocaleName); m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table)); } sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum()); return true; } [4] make both functions "bool CClientManager::MirrorMobTableIntoDB()" and "bool CClientManager::MirrorItemTableIntoDB()" to comments or delete them [5] open "ClientManager.h" and delete or make these functions to comments: (in my tree they are at line 190 and 191) Thanks to iMer because i use some lines of his code and he had to stand over my skype spam^^ NOTE: If you have different table structures or more columns you want to use, you have to change the functions Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal 3 Link to comment Share on other sites More sharing options...
xBlackeagle 0 Posted August 7, 2014 Share Posted August 7, 2014 Thanks Link to comment Share on other sites More sharing options...
sTyKKeR 0 Posted January 4, 2015 Share Posted January 4, 2015 Hello, someone can help me in PM ? Where i found "ClientManagerBoot.cpp" fille ? Link to comment Share on other sites More sharing options...
Erryas 2 Posted January 17, 2015 Share Posted January 17, 2015 need help SYSERR: Jan 17 23:02:25 :: Start: TABLE_POSTFIX not configured use default SYSERR: Jan 17 23:02:26 :: Load: DirectQuery failed(SELECT login FROM block_exception) SYSERR: Jan 17 23:02:31 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jan 17 23:02:37 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jan 17 23:02:41 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jan 17 23:02:47 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jan 17 23:02:49 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jan 17 23:02:53 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jan 17 23:02:59 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jan 17 23:03:04 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jan 17 23:03:09 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jan 17 23:03:14 :: Process: FDWATCH: peer null in event: ident 21 Link to comment Share on other sites More sharing options...
bumxd 16 Posted March 3, 2015 Share Posted March 3, 2015 item don`t stack.. how to fix? Link to comment Share on other sites More sharing options...
bumxd 16 Posted March 8, 2015 Share Posted March 8, 2015 up Link to comment Share on other sites More sharing options...
bumxd 16 Posted March 25, 2015 Share Posted March 25, 2015 item don`t stack.. how to fix? Link to comment Share on other sites More sharing options...
Premium Cataclismo 86 Posted March 26, 2015 Premium Share Posted March 26, 2015 I don't understand the thing with "overflow". Also, what's your nationality, Timasu? Link to comment Share on other sites More sharing options...
Chris90909090909090 50 Posted July 1, 2015 Share Posted July 1, 2015 SYSERR: Jul 1 17:29:12 :: pid_init: Start of pid: 817 SYSERR: Jul 1 17:29:12 :: Start: TABLE_POSTFIX not configured use defaultSYSERR: Jul 1 17:29:12 :: Load: DirectQuery failed(SELECT IP_FROM, IP_TO, COUNTRY_NAME FROM iptocountry)SYSERR: Jul 1 17:29:24 :: Process: FDWATCH: peer null in event: ident 21SYSERR: Jul 1 17:29:29 :: Process: FDWATCH: peer null in event: ident 21 Link to comment Share on other sites More sharing options...
Cyxer 140 Posted November 25, 2015 Share Posted November 25, 2015 On 1/7/2015, 8:42:35, Chris90909090909090 said: SYSERR: Jul 1 17:29:12 :: pid_init: Start of pid: 817 SYSERR: Jul 1 17:29:12 :: Start: TABLE_POSTFIX not configured use default SYSERR: Jul 1 17:29:12 :: Load: DirectQuery failed(SELECT IP_FROM, IP_TO, COUNTRY_NAME FROM iptocountry) SYSERR: Jul 1 17:29:24 :: Process: FDWATCH: peer null in event: ident 21 SYSERR: Jul 1 17:29:29 :: Process: FDWATCH: peer null in event: ident 21 same. help! Link to comment Share on other sites More sharing options...
Premium phayara 424 Posted November 25, 2015 Premium Share Posted November 25, 2015 this is not compatible with a table_postfix or item_vnum ranges. Link to comment Share on other sites More sharing options...
scrabbyyy 20 Posted January 3, 2016 Share Posted January 3, 2016 this compitable with dragon soul items so i mean with special item drop.txt? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now