Example #1
0
/*====================================
 * read all item-related databases
 *------------------------------------*/
static void itemdb_read(void)
{
#ifndef TXT_ONLY
	if (db_use_sqldbs)
		itemdb_read_sqldb();
	else
#endif
		itemdb_readdb();

	itemdb_read_itemgroup();
	sv_readdb(db_path, "item_avail.txt",   ',', 2, 2, -1,             &itemdb_read_itemavail);
	sv_readdb(db_path, "item_noequip.txt", ',', 2, 2, -1,             &itemdb_read_noequip);
	sv_readdb(db_path, "item_trade.txt",   ',', 3, 3, -1,             &itemdb_read_itemtrade);
	sv_readdb(db_path, "item_delay.txt",   ',', 2, 2, MAX_ITEMDELAYS, &itemdb_read_itemdelay);
	sv_readdb(db_path, "item_buyingstore.txt", ',', 1, 1, -1,         &itemdb_read_buyingstore);
}
Example #2
0
int read_mercenarydb(void)
{
	memset(mercenary_db,0,sizeof(mercenary_db));
	sv_readdb(db_path, "mercenary_db.txt", ',', 26, 26, MAX_MERCENARY_CLASS, &read_mercenarydb_sub);

	return 0;
}
Example #3
0
void instance_readdb(void)
{

	memset(&instance_db, 0, sizeof(instance_db));
	sv_readdb(db_path, DBPATH"instance_db.txt", ',', 7, 7+MAX_MAP_PER_INSTANCE, MAX_INSTANCE_DB, &instance_readdb_sub);

}
Example #4
0
int read_homunculusdb(void)
{
	int i;
	const char *filename[]={"homunculus_db.txt","homunculus_db2.txt"};

	memset(homunculus_db,0,sizeof(homunculus_db));
	for(i = 0; i<ARRAYLENGTH(filename); i++)
	{
		char path[256];

		if( i > 0 )
		{
			sprintf(path, "%s/%s", db_path, filename[i]);

			if( !exists(path) )
			{
				continue;
			}
		}

		sv_readdb(db_path, filename[i], ',', 50, 50, MAX_HOMUNCULUS_CLASS, &read_homunculusdb_sub);
	}

	return 0;
}
Example #5
0
int read_homunculus_skilldb(void)
{
	memset(hskill_tree,0,sizeof(hskill_tree));
	sv_readdb(db_path, "homun_skill_tree.txt", ',', 13, 14, -1, &read_homunculus_skilldb_sub);

	return 0;
}
Example #6
0
void read_elemental_skilldb(void) {
	const char *filename[] = { "elemental_skill_db.txt", DBIMPORT"/elemental_skill_db.txt" };
	uint8 i;
	for(i = 0; i<ARRAYLENGTH(filename); i++){
		sv_readdb(db_path, filename[i], ',', 4, 4, -1, &read_elemental_skilldb_sub, i);
	}
}
Example #7
0
/**
* Load Mercenary's skill database
**/
void mercenary_read_skilldb(void){
	const char *filename[]={ "mercenary_skill_db.txt",DBIMPORT"/mercenary_skill_db.txt"};
	uint8 i;

	for(i = 0; i<ARRAYLENGTH(filename); i++){
		sv_readdb(db_path, filename[i], ',', 3, 3, -1, &mercenary_read_skilldb_sub, i);
	}
}
Example #8
0
void instance_readdb(void)
{
	const char* filename[] = { DBPATH"instance_db.txt", "import/instance_db.txt"};
	int f;
	memset(&instance_db, 0, sizeof(instance_db));
	for (f=0; f<ARRAYLENGTH(filename); f++){
		sv_readdb(db_path, filename[f], ',', 7, 7+MAX_MAP_PER_INSTANCE, MAX_INSTANCE_DB, &instance_readdb_sub, f);
	}
}
Example #9
0
int read_homunculusdb(void)
{
	int i;
	const char *filename[]={DBPATH"homunculus_db.txt","import/homunculus_db.txt"};
	memset(homunculus_db,0,sizeof(homunculus_db));
	for(i = 0; i<ARRAYLENGTH(filename); i++){
		sv_readdb(db_path, filename[i], ',', 50, 50, MAX_HOMUNCULUS_CLASS, &read_homunculusdb_sub, i);
	}
	return 0;
}
Example #10
0
void do_init_guild(void)
{
	guild_db=idb_alloc(DB_OPT_RELEASE_DATA);
	castle_db=idb_alloc(DB_OPT_BASE);
	guild_expcache_db=idb_alloc(DB_OPT_BASE);
	guild_infoevent_db=idb_alloc(DB_OPT_BASE);
	expcache_ers = ers_new(sizeof(struct guild_expcache)); 
	guild_castleinfoevent_db=idb_alloc(DB_OPT_BASE);

	sv_readdb(db_path, "castle_db.txt", ',', 4, 5, -1, &guild_read_castledb);

	memset(guild_skill_tree,0,sizeof(guild_skill_tree));
	sv_readdb(db_path, "guild_skill_tree.txt", ',', 2+MAX_GUILD_SKILL_REQUIRE*2, 2+MAX_GUILD_SKILL_REQUIRE*2, -1, &guild_read_guildskill_tree_db); //guild skill tree [Komurka]

	add_timer_func_list(guild_payexp_timer,"guild_payexp_timer");
	add_timer_func_list(guild_send_xy_timer, "guild_send_xy_timer");
	add_timer_interval(gettick()+GUILD_PAYEXP_INVERVAL,guild_payexp_timer,0,0,GUILD_PAYEXP_INVERVAL);
	add_timer_interval(gettick()+GUILD_SEND_XY_INVERVAL,guild_send_xy_timer,0,0,GUILD_SEND_XY_INVERVAL);
}
Example #11
0
/**
* Read homunculus skill db (check the files)
*/
int read_homunculus_skilldb(void)
{
	const char *filename[]={ "homun_skill_tree.txt",DBIMPORT"/homun_skill_tree.txt"};
	int i;
	memset(hskill_tree,0,sizeof(hskill_tree));
	for(i = 0; i<ARRAYLENGTH(filename); i++){
		sv_readdb(db_path, filename[i], ',', 13, 15, -1, &read_homunculus_skilldb_sub, i);
	}
	return 0;
}
Example #12
0
void read_elementaldb(void) {
	const char *filename[] = { "elemental_db.txt", DBIMPORT"/elemental_db.txt" };
	uint8 i;

	elemental_count = 0;
	memset(elemental_db, 0, sizeof(elemental_db));
	for(i = 0; i<ARRAYLENGTH(filename); i++){
		sv_readdb(db_path, filename[i], ',', 26, 26, -1, &read_elementaldb_sub, i);
	}
}
Example #13
0
/**
* Load Mercenary's database
**/
void mercenary_readdb(void) {
	const char *filename[]={ "mercenary_db.txt",DBIMPORT"/mercenary_db.txt"};
	uint8 i;

	mercenary_count = 0; //Reset the counter
	memset(mercenary_db,0,sizeof(mercenary_db));
	for(i = 0; i<ARRAYLENGTH(filename); i++){
		sv_readdb(db_path, filename[i], ',', 26, 26, MAX_MERCENARY_CLASS, &mercenary_readdb_sub, i);
	}
}
Example #14
0
/**
* Read homunculus db (check the files)
*/
void read_homunculusdb(void) {
	uint8 i;
	const char *filename[] = {
		DBPATH"homunculus_db.txt",
		DBIMPORT"/homunculus_db.txt",
	};
	homunculus_count = 0;
	memset(homunculus_db,0,sizeof(homunculus_db));
	for(i = 0; i<ARRAYLENGTH(filename); i++){
		sv_readdb(db_path, filename[i], ',', 50, 50, MAX_HOMUNCULUS_CLASS, &read_homunculusdb_sub, i);
	}
}
Example #15
0
/*====================================
 * read all item-related databases
 *------------------------------------*/
static void itemdb_read(void)
{
#ifndef TXT_ONLY
	if (db_use_sqldbs)
		itemdb_read_sqldb();
	else
#endif
		itemdb_readdb();

	if( battle_config.renewal_system_enable ) itemdb_read_matk();
	itemdb_read_customrates(); // [Zephyrus] Drop Rate Bonus
	itemdb_read_ancientdb();
	itemdb_read_logenable();
	itemdb_read_itemgroup();
	sv_readdb(db_path, "item_avail.txt",   ',', 2, 2, -1,             &itemdb_read_itemavail);
	sv_readdb(db_path, "item_noequip.txt", ',', 2, 2, -1,             &itemdb_read_noequip);
	sv_readdb(db_path, "item_trade.txt",   ',', 3, 3, -1,             &itemdb_read_itemtrade);
	sv_readdb(db_path, "item_delay.txt",   ',', 2, 2, MAX_ITEMDELAYS, &itemdb_read_itemdelay);
	sv_readdb(db_path, "item_buyingstore.txt", ',', 1, 1, -1,         &itemdb_read_buyingstore);

	// Extended Vending System
	memset(coins_db, 0, sizeof(coins_db));
	sv_readdb(db_path, "item_vending.txt", ',', 1, 1, MAX_COIN_DB,    &itemdb_read_vending);
	
	itemdb_load_serials();
}
Example #16
0
int read_homunculus_skilldb(void)
{
	memset(hskill_tree,0,sizeof(hskill_tree));
	if (db_use_sqldbs)
	{
		sv_readsqldb(homun_skill_tree_db, NULL, 13, -1, &read_homunculus_skilldb_sub);
	}
	else
	{
		sv_readdb(db_path, "homun_skill_tree.txt", ',', 13, 14, -1, &read_homunculus_skilldb_sub);
	}
	return 0;
}
Example #17
0
/*====================================
 * read all item-related databases
 *------------------------------------*/
static void itemdb_read(void) {
	
	if (db_use_sqldbs)
		itemdb_read_sqldb();
	else
		itemdb_readdb();

	itemdb_read_itemgroup();
	sv_readdb(db_path, "item_avail.txt",         ',', 2, 2, -1, &itemdb_read_itemavail);
	sv_readdb(db_path, DBPATH"item_noequip.txt", ',', 2, 2, -1, &itemdb_read_noequip);
	sv_readdb(db_path, DBPATH"item_trade.txt",   ',', 3, 3, -1, &itemdb_read_itemtrade);
	sv_readdb(db_path, "item_delay.txt",         ',', 2, 2, -1, &itemdb_read_itemdelay);
	sv_readdb(db_path, "item_stack.txt",         ',', 3, 3, -1, &itemdb_read_stack);
	sv_readdb(db_path, "item_buyingstore.txt",   ',', 1, 1, -1, &itemdb_read_buyingstore);	
}
Example #18
0
/*====================================
 * read all item-related databases
 *------------------------------------*/
static void itemdb_read(void)
{
	if (db_use_sqldbs)
		itemdb_read_sqldb();
	else
		itemdb_readdb();

	itemdb_read_itemgroup();
	sv_readdb(db_path, "item_avail.txt",   ',', 2, 2, -1,             &itemdb_read_itemavail);
	sv_readdb(db_path, "item_noequip.txt", ',', 2, 2, -1,             &itemdb_read_noequip);
#if REMODE
	sv_readdb(db_path, "re/item_trade.txt",   ',', 3, 3, -1,             &itemdb_read_itemtrade);
#else
	sv_readdb(db_path, "pre-re/item_trade.txt",   ',', 3, 3, -1,             &itemdb_read_itemtrade);
#endif
	sv_readdb(db_path, "item_delay.txt",   ',', 2, 2, MAX_ITEMDELAYS, &itemdb_read_itemdelay);
	sv_readdb(db_path, "item_buyingstore.txt", ',', 1, 1, -1,         &itemdb_read_buyingstore);
}
Example #19
0
/**
 * Load Mercenary's skill database
 */
void mercenary_read_skilldb(void)
{
	sv_readdb(db_path, "mercenary_skill_db.txt", ',', 3, 3, -1, &mercenary_read_skilldb_sub);
}
Example #20
0
int read_mercenary_skilldb(void)
{
	sv_readdb(db_path, "mercenary_skill_db.txt", ',', 3, 3, -1, &read_mercenary_skilldb_sub);

	return 0;
}
Example #21
0
void do_init_channel(void)
{
	channel_db = strdb_alloc(DB_OPT_RELEASE_DATA, NAME_LENGTH);
	memset(server_channel, 0, sizeof(server_channel));
	sv_readdb(db_path, "channel_db.txt", ',', 5, 5, -1, &channel_read_channeldb);
}
Example #22
0
/**
 * Load Mercenary's database
 */
void mercenary_readdb(void)
{
	memset(mercenary_db,0,sizeof(mercenary_db));
	sv_readdb(db_path, "mercenary_db.txt", ',', 26, 26, MAX_MERCENARY_CLASS, &mercenary_readdb_sub);
}