Jump to content
jessuss

[C++]Quitar item_proto y mob_proto ( NO TXT DB ) 40k

Recommended Posts

Hola, estas cansado de editar item_proto.txt y mob_proto.txt?

 

Pues aqui tienes la solución.

 

Utilizaremos los Archivos:

 

ClientManager.h

ClientManagerBoot.cpp

 

Comencemos.

 

ClientManager.h buscamos: MirrorMobTableIntoDB

 

 

 

QAdGLj.png

 
 

 

Se Elimina la sección marcada Gris

 

ClientManagerBoot.cpp Abrir.

 

CClientManager::InitializeTables Se busca como las siguientes 4 Función Cambio;

 

 

NqQJ2L.png

 

Se busca: MirrorMobTableIntoDB y se elimina.

Se busca: MirrorItemTableIntoDB y se elimina.

 

JYgBBj.png

 

Se busca todo lo señalado en gris y se elimina.

 

Si ahora bool CClientManager::InitializeMobTable() busca el siguiente codigo y remplazalo por:

 

bool CClientManager::InitializeMobTable()
{
char query[4096];
snprintf(query, sizeof(query),
"SELECT vnum, name, %s, type, rank, battle_type, level, "
"size+0, ai_flag+0, setRaceFlag+0, setImmuneFlag+0, "
"on_click, empire, drop_item, resurrection_vnum, folder, "
"st, dx, ht, iq, damage_min, damage_max, max_hp, regen_cycle, regen_percent, exp, "
"gold_min, gold_max, def, attack_speed, move_speed, "
"aggressive_hp_pct, aggressive_sight, attack_range, polymorph_item, "
"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, "
"skill_vnum0, skill_level0, skill_vnum1, skill_level1, skill_vnum2, skill_level2,"
"skill_vnum3, skill_level3, skill_vnum4, skill_level4 , sp_berserk, sp_stoneskin, "
"sp_godspeed, sp_deathblow, sp_revive "
"FROM mob_proto%s ORDER BY vnum",
g_stLocaleNameColumn.c_str(), GetTablePostfix());

std::auto_ptr pkMsg(CDBManager::instance().DirectQuery(query));
SQLResult * pRes = pkMsg->Get();

if (!pRes->uiNumRows)
{
sys_err("Could not load mob_proto. No results!");
return false;
}

sys_log(0, "MOB_PROTO loading...");

if (!m_vec_mobTable.empty())
{
sys_log(0, "RELOAD: mob_proto");
m_vec_mobTable.clear();
}

m_vec_mobTable.resize(pRes->uiNumRows);
memset(&m_vec_mobTable[0], 0, sizeof(TMobTable) * m_vec_mobTable.size());
TMobTable * mob_table = &m_vec_mobTable[0];

MYSQL_ROW data;
int col;
while ((data = mysql_fetch_row(pRes->pSQLResult)))
{
col = 0;
str_to_number(mob_table->dwVnum, data[col++]);
strlcpy(mob_table->szName, data[col++], sizeof(mob_table->szName));
strlcpy(mob_table->szLocaleName, data[col++], sizeof(mob_table->szLocaleName));
str_to_number(mob_table->bType, data[col++]);
str_to_number(mob_table->bRank, data[col++]);
str_to_number(mob_table->bBattleType, data[col++]);
str_to_number(mob_table->bLevel, data[col++]);
str_to_number(mob_table->bSize, data[col++]);
str_to_number(mob_table->dwAIFlag, data[col++]);
str_to_number(mob_table->dwRaceFlag, data[col++]);
str_to_number(mob_table->dwImmuneFlag, data[col++]);
str_to_number(mob_table->bOnClickType, data[col++]);
str_to_number(mob_table->bEmpire, data[col++]);
str_to_number(mob_table->dwDropItemVnum, data[col++]);
str_to_number(mob_table->dwResurrectionVnum, data[col++]);
strlcpy(mob_table->szFolder, data[col++], sizeof(mob_table->szFolder));
str_to_number(mob_table->bStr, data[col++]);
str_to_number(mob_table->bDex, data[col++]);
str_to_number(mob_table->bCon, data[col++]);
str_to_number(mob_table->bInt, data[col++]);
str_to_number(mob_table->dwDamageRange[0], data[col++]);
str_to_number(mob_table->dwDamageRange[1], data[col++]);
str_to_number(mob_table->dwMaxHP, data[col++]);
str_to_number(mob_table->bRegenCycle, data[col++]);
str_to_number(mob_table->bRegenPercent, data[col++]);
str_to_number(mob_table->dwExp, data[col++]);
str_to_number(mob_table->dwGoldMin, data[col++]);
str_to_number(mob_table->dwGoldMax, data[col++]);
str_to_number(mob_table->wDef, data[col++]);
str_to_number(mob_table->sAttackSpeed, data[col++]);
str_to_number(mob_table->sMovingSpeed, data[col++]);
str_to_number(mob_table->bAggresiveHPPct, data[col++]);
str_to_number(mob_table->wAggressiveSight, data[col++]);
str_to_number(mob_table->wAttackRange, data[col++]);
str_to_number(mob_table->dwPolymorphItemVnum, data[col++]);

int i;
for (i = 0; i < MOB_ENCHANTS_MAX_NUM; ++i)
str_to_number(mob_table->cEnchants, data[col++]);

for (i = 0; i < MOB_RESISTS_MAX_NUM; ++i)
str_to_number(mob_table->cResists, data[col++]);

str_to_number(mob_table->fDamMultiply, data[col++]);
str_to_number(mob_table->dwSummonVnum, data[col++]);
str_to_number(mob_table->dwDrainSP, data[col++]);

for (i = 0; i < MOB_SKILL_MAX_NUM; ++i)
{
str_to_number(mob_table->Skills.dwVnum, data[col++]);
str_to_number(mob_table->Skills.bLevel, data[col++]);
}

str_to_number(mob_table->bBerserkPoint, data[col++]);
str_to_number(mob_table->bStoneSkinPoint, data[col++]);
str_to_number(mob_table->bGodSpeedPoint, data[col++]);
str_to_number(mob_table->bDeathBlowPoint, data[col++]);
str_to_number(mob_table->bRevivePoint, data[col++]);

sys_log(1, "MOB #%-5d %-24s %-24s level: %-3u rank: %u empire: %d", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
++mob_table;
}

sort(m_vec_mobTable.begin(), m_vec_mobTable.end(), FCompareVnum());
sys_log(0, "CClientManager::InitializeMobTable:: %d mobs loaded.n", m_vec_mobTable.size());
fprintf(stderr, "CClientManager::InitializeMobTable:: %d mobs loaded\n", m_vec_mobTable.size());
return true;
}

 

 

Ahora: bool CClientManager::InitializeItemTable() busca el siguiente codigo y remplazalo por:

 

bool CClientManager::InitializeItemTable()
{
char query[4096];
snprintf(query, sizeof(query),
"SELECT vnum, name, %s, type, subtype, gold, shop_buy_price, weight, size, flag, wearflag, "
"antiflag, immuneflag+0, refined_vnum, refine_set, magic_pct, socket_pct, addon_type, "
"limittype0, limitvalue0, limittype1, limitvalue1, "
"applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2, "
"value0, value1, value2, value3, value4, value5 "
"FROM item_proto%s ORDER BY vnum",
g_stLocaleNameColumn.c_str(), GetTablePostfix());

std::auto_ptr pkMsg(CDBManager::instance().DirectQuery(query));
SQLResult * pRes = pkMsg->Get();

if (!pRes->uiNumRows)
{
sys_err("Could not load item_proto. No results!");
return false;
}

sys_log(0, "ITEM_PROTO loading...");

if (!m_vec_itemTable.empty())
{
sys_log(0, "RELOAD: item_proto");
m_vec_itemTable.clear();
m_map_itemTableByVnum.clear();
}

m_vec_itemTable.resize(pRes->uiNumRows);
memset(&m_vec_itemTable[0], 0, sizeof(TItemTable) * m_vec_itemTable.size());
TItemTable * item_table = &m_vec_itemTable[0];

MYSQL_ROW data;
int col;

while ((data = mysql_fetch_row(pRes->pSQLResult)))
{
col = 0;

str_to_number(item_table->dwVnum, data[col++]);
strlcpy(item_table->szName, data[col++], sizeof(item_table->szName));
strlcpy(item_table->szLocaleName, data[col++], sizeof(item_table->szLocaleName));
str_to_number(item_table->bType, data[col++]);
str_to_number(item_table->bSubType, data[col++]);
str_to_number(item_table->dwGold, data[col++]);
str_to_number(item_table->dwShopBuyPrice, data[col++]);
str_to_number(item_table->bWeight, data[col++]);
str_to_number(item_table->bSize, data[col++]);
str_to_number(item_table->dwFlags, data[col++]);
str_to_number(item_table->dwWearFlags, data[col++]);
str_to_number(item_table->dwAntiFlags, data[col++]);
str_to_number(item_table->dwImmuneFlag, data[col++]);
str_to_number(item_table->dwRefinedVnum, data[col++]);
str_to_number(item_table->wRefineSet, data[col++]);
str_to_number(item_table->bAlterToMagicItemPct, data[col++]);
str_to_number(item_table->bGainSocketPct, data[col++]);
str_to_number(item_table->sAddonType, data[col++]);

item_table->cLimitRealTimeFirstUseIndex = -1;
item_table->cLimitTimerBasedOnWearIndex = -1;

int i;
for (i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
{
str_to_number(item_table->aLimits.bType, data[col++]);
str_to_number(item_table->aLimits.lValue, data[col++]);

if (LIMIT_REAL_TIME_START_FIRST_USE == item_table->aLimits.bType)
item_table->cLimitRealTimeFirstUseIndex = (char)i;

if (LIMIT_TIMER_BASED_ON_WEAR == item_table->aLimits.bType)
item_table->cLimitTimerBasedOnWearIndex = (char)i;
}

for (i = 0; i < ITEM_APPLY_MAX_NUM; ++i)
{
str_to_number(item_table->aApplies.bType, data[col++]);
str_to_number(item_table->aApplies.lValue, data[col++]);
}

for (i = 0; i < ITEM_VALUES_MAX_NUM; ++i)
str_to_number(item_table->alValues, data[col++]);

sys_log(1, "ITEM: #%-5lu %-24s %-24s VAL: %ld %ld %ld %ld %ld %ld WEAR %lu ANTI %lu IMMUNE %lu REFINE %lu REFINE_SET %u MAGIC_PCT %u",
item_table->dwVnum,item_table->szName,item_table->szLocaleName,
item_table->alValues[0],item_table->alValues[1],item_table->alValues[2],
item_table->alValues[3],item_table->alValues[4],item_table->alValues[5],
item_table->dwWearFlags,item_table->dwAntiFlags,item_table->dwImmuneFlag,
item_table->dwRefinedVnum,item_table->wRefineSet,item_table->bAlterToMagicItemPct);

m_map_itemTableByVnum.insert(std::map::value_type(item_table->dwVnum, item_table));
++item_table;
}

sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum());
sys_log(0, "CClientManager::InitializeItemTable:: %d items loaded.n", m_vec_itemTable.size());
fprintf(stderr, "CClientManager::InitializeItemTable:: %d items loaded\n", m_vec_itemTable.size());
return true;
}

,>

 

Al abrir la Base de datos durante el inicio debe verse como esto;

 

CClientManager::InitializeMobTable:: 1198 mobs loaded.
CClientManager::InitializeItemTable:: 5562 items loaded.

 

Así que has hecho con éxito.

 

By: - Pelin Melek Aslan -

Fuente:

Debes iniciar sesión para ver el contenido del enlace en esta publicación.

Share this post


Link to post
Share on other sites

No es dificil,solo es copy paste,editar un poco y de paso ponerlo en el dump proto para crear la parte del cliente sin perder el tiempo

Dilong para dev

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...