summaryrefslogtreecommitdiff
path: root/src/char/int_elemental.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-09 21:09:03 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-15 11:47:30 +0300
commitc60c9292886f436eb12d4042a05af1e462705e3d (patch)
treed6a5cd0f78d9c845e966e18ecfb386e0b31515b2 /src/char/int_elemental.c
parent63075b84ecf52e329ee524e1e90878469c388f9d (diff)
downloadhercules-c60c9292886f436eb12d4042a05af1e462705e3d.tar.gz
hercules-c60c9292886f436eb12d4042a05af1e462705e3d.tar.bz2
hercules-c60c9292886f436eb12d4042a05af1e462705e3d.tar.xz
hercules-c60c9292886f436eb12d4042a05af1e462705e3d.zip
Move global variable into interface in inter.c
Diffstat (limited to 'src/char/int_elemental.c')
-rw-r--r--src/char/int_elemental.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index d54a13320..3f8e7b190 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -27,24 +27,24 @@ bool mapif_elemental_save(struct s_elemental* ele) {
bool flag = true;
if( ele->elemental_id == 0 ) { // Create new DB entry
- if( SQL_ERROR == SQL->Query(sql_handle,
+ if( SQL_ERROR == SQL->Query(inter->sql_handle,
"INSERT INTO `%s` (`char_id`,`class`,`mode`,`hp`,`sp`,`max_hp`,`max_sp`,`atk1`,`atk2`,`matk`,`aspd`,`def`,`mdef`,`flee`,`hit`,`life_time`)"
"VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%u')",
elemental_db, ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->atk, ele->atk2, ele->matk, ele->amotion, ele->def, ele->mdef, ele->flee, ele->hit, ele->life_time) )
{
- Sql_ShowDebug(sql_handle);
+ Sql_ShowDebug(inter->sql_handle);
flag = false;
}
else
- ele->elemental_id = (int)SQL->LastInsertId(sql_handle);
- } else if( SQL_ERROR == SQL->Query(sql_handle,
+ ele->elemental_id = (int)SQL->LastInsertId(inter->sql_handle);
+ } else if( SQL_ERROR == SQL->Query(inter->sql_handle,
"UPDATE `%s` SET `char_id` = '%d', `class` = '%d', `mode` = '%d', `hp` = '%d', `sp` = '%d',"
"`max_hp` = '%d', `max_sp` = '%d', `atk1` = '%d', `atk2` = '%d', `matk` = '%d', `aspd` = '%d', `def` = '%d',"
"`mdef` = '%d', `flee` = '%d', `hit` = '%d', `life_time` = '%u' WHERE `ele_id` = '%d'",
elemental_db, ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->atk, ele->atk2,
ele->matk, ele->amotion, ele->def, ele->mdef, ele->flee, ele->hit, ele->life_time, ele->elemental_id) )
{ // Update DB entry
- Sql_ShowDebug(sql_handle);
+ Sql_ShowDebug(inter->sql_handle);
flag = false;
}
return flag;
@@ -57,36 +57,36 @@ bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
ele->elemental_id = ele_id;
ele->char_id = char_id;
- if( SQL_ERROR == SQL->Query(sql_handle,
+ if( SQL_ERROR == SQL->Query(inter->sql_handle,
"SELECT `class`, `mode`, `hp`, `sp`, `max_hp`, `max_sp`, `atk1`, `atk2`, `matk`, `aspd`,"
"`def`, `mdef`, `flee`, `hit`, `life_time` FROM `%s` WHERE `ele_id` = '%d' AND `char_id` = '%d'",
elemental_db, ele_id, char_id) )
{
- Sql_ShowDebug(sql_handle);
+ Sql_ShowDebug(inter->sql_handle);
return false;
}
- if( SQL_SUCCESS != SQL->NextRow(sql_handle) ) {
- SQL->FreeResult(sql_handle);
+ if( SQL_SUCCESS != SQL->NextRow(inter->sql_handle) ) {
+ SQL->FreeResult(inter->sql_handle);
return false;
}
- SQL->GetData(sql_handle, 0, &data, NULL); ele->class_ = atoi(data);
- SQL->GetData(sql_handle, 1, &data, NULL); ele->mode = atoi(data);
- SQL->GetData(sql_handle, 2, &data, NULL); ele->hp = atoi(data);
- SQL->GetData(sql_handle, 3, &data, NULL); ele->sp = atoi(data);
- SQL->GetData(sql_handle, 4, &data, NULL); ele->max_hp = atoi(data);
- SQL->GetData(sql_handle, 5, &data, NULL); ele->max_sp = atoi(data);
- SQL->GetData(sql_handle, 6, &data, NULL); ele->atk = atoi(data);
- SQL->GetData(sql_handle, 7, &data, NULL); ele->atk2 = atoi(data);
- SQL->GetData(sql_handle, 8, &data, NULL); ele->matk = atoi(data);
- SQL->GetData(sql_handle, 9, &data, NULL); ele->amotion = atoi(data);
- SQL->GetData(sql_handle, 10, &data, NULL); ele->def = atoi(data);
- SQL->GetData(sql_handle, 11, &data, NULL); ele->mdef = atoi(data);
- SQL->GetData(sql_handle, 12, &data, NULL); ele->flee = atoi(data);
- SQL->GetData(sql_handle, 13, &data, NULL); ele->hit = atoi(data);
- SQL->GetData(sql_handle, 14, &data, NULL); ele->life_time = atoi(data);
- SQL->FreeResult(sql_handle);
+ SQL->GetData(inter->sql_handle, 0, &data, NULL); ele->class_ = atoi(data);
+ SQL->GetData(inter->sql_handle, 1, &data, NULL); ele->mode = atoi(data);
+ SQL->GetData(inter->sql_handle, 2, &data, NULL); ele->hp = atoi(data);
+ SQL->GetData(inter->sql_handle, 3, &data, NULL); ele->sp = atoi(data);
+ SQL->GetData(inter->sql_handle, 4, &data, NULL); ele->max_hp = atoi(data);
+ SQL->GetData(inter->sql_handle, 5, &data, NULL); ele->max_sp = atoi(data);
+ SQL->GetData(inter->sql_handle, 6, &data, NULL); ele->atk = atoi(data);
+ SQL->GetData(inter->sql_handle, 7, &data, NULL); ele->atk2 = atoi(data);
+ SQL->GetData(inter->sql_handle, 8, &data, NULL); ele->matk = atoi(data);
+ SQL->GetData(inter->sql_handle, 9, &data, NULL); ele->amotion = atoi(data);
+ SQL->GetData(inter->sql_handle, 10, &data, NULL); ele->def = atoi(data);
+ SQL->GetData(inter->sql_handle, 11, &data, NULL); ele->mdef = atoi(data);
+ SQL->GetData(inter->sql_handle, 12, &data, NULL); ele->flee = atoi(data);
+ SQL->GetData(inter->sql_handle, 13, &data, NULL); ele->hit = atoi(data);
+ SQL->GetData(inter->sql_handle, 14, &data, NULL); ele->life_time = atoi(data);
+ SQL->FreeResult(inter->sql_handle);
if( save_log )
ShowInfo("Elemental loaded (%d - %d).\n", ele->elemental_id, ele->char_id);
@@ -94,8 +94,8 @@ bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
}
bool mapif_elemental_delete(int ele_id) {
- if( SQL_ERROR == SQL->Query(sql_handle, "DELETE FROM `%s` WHERE `ele_id` = '%d'", elemental_db, ele_id) ) {
- Sql_ShowDebug(sql_handle);
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `ele_id` = '%d'", elemental_db, ele_id) ) {
+ Sql_ShowDebug(inter->sql_handle);
return false;
}