summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-14 23:38:11 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-14 23:38:11 +0000
commit1382b22cd68bf90f2adc4ae13187416982f9a12f (patch)
tree60602ab8f3578407bffbd1859603c3a586c52256 /src/char_sql
parent78474fe9877675f3fc173f0b7e7235fd6c105067 (diff)
downloadhercules-1382b22cd68bf90f2adc4ae13187416982f9a12f.tar.gz
hercules-1382b22cd68bf90f2adc4ae13187416982f9a12f.tar.bz2
hercules-1382b22cd68bf90f2adc4ae13187416982f9a12f.tar.xz
hercules-1382b22cd68bf90f2adc4ae13187416982f9a12f.zip
Guardian hp handling code removal (see bugreport:342)
- removed guardian hp from the castle data structure, database, savefiles and various script functions (use upgrade_svn11914.sql) - removed guardian hp calculation and manipulation from the castle manager npc, now the hp values are updated by the server itself (glitch: when castle defense changes, all guardians are healed to full) - tweaked script function 'guardianinfo' to provide some data needed by the manager npc (currently available are hp, maxhp and visibility); also, it doesn't need a player attached to execute anymore The whole thing is experimental, use at your own risk (seems to work though...) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11915 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/int_guild.c48
1 files changed, 5 insertions, 43 deletions
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index e148532de..016cf4408 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -564,13 +564,10 @@ ShowDebug("Save guild_castle (%d)\n", gc->castle_id);
// sql_query("DELETE FROM `%s` WHERE `castle_id`='%d'",guild_castle_db, gc->castle_id);
if( SQL_ERROR == Sql_Query(sql_handle, "REPLACE INTO `%s` "
"(`castle_id`, `guild_id`, `economy`, `defense`, `triggerE`, `triggerD`, `nextTime`, `payTime`, `createTime`,"
- "`visibleC`, `visibleG0`, `visibleG1`, `visibleG2`, `visibleG3`, `visibleG4`, `visibleG5`, `visibleG6`, `visibleG7`,"
- "`Ghp0`, `Ghp1`, `Ghp2`, `Ghp3`, `Ghp4`, `Ghp5`, `Ghp6`, `Ghp7`)"
- "VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d')",
- guild_castle_db, gc->castle_id, gc->guild_id, gc->economy, gc->defense, gc->triggerE, gc->triggerD, gc->nextTime, gc->payTime,
- gc->createTime, gc->visibleC,
- gc->guardian[0].visible, gc->guardian[1].visible, gc->guardian[2].visible, gc->guardian[3].visible, gc->guardian[4].visible, gc->guardian[5].visible, gc->guardian[6].visible, gc->guardian[7].visible,
- gc->guardian[0].hp, gc->guardian[1].hp, gc->guardian[2].hp, gc->guardian[3].hp, gc->guardian[4].hp, gc->guardian[5].hp, gc->guardian[6].hp, gc->guardian[7].hp) )
+ "`visibleC`, `visibleG0`, `visibleG1`, `visibleG2`, `visibleG3`, `visibleG4`, `visibleG5`, `visibleG6`, `visibleG7`)"
+ "VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d')",
+ guild_castle_db, gc->castle_id, gc->guild_id, gc->economy, gc->defense, gc->triggerE, gc->triggerD, gc->nextTime, gc->payTime, gc->createTime, gc->visibleC,
+ gc->guardian[0].visible, gc->guardian[1].visible, gc->guardian[2].visible, gc->guardian[3].visible, gc->guardian[4].visible, gc->guardian[5].visible, gc->guardian[6].visible, gc->guardian[7].visible) )
Sql_ShowDebug(sql_handle);
#ifndef TXT_SQL_CONVERT
@@ -605,8 +602,7 @@ int inter_guildcastle_fromsql(int castle_id,struct guild_castle *gc)
memset(gc,0,sizeof(struct guild_castle));
if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `castle_id`, `guild_id`, `economy`, `defense`, `triggerE`, `triggerD`, `nextTime`, `payTime`, `createTime`, "
- "`visibleC`, `visibleG0`, `visibleG1`, `visibleG2`, `visibleG3`, `visibleG4`, `visibleG5`, `visibleG6`, `visibleG7`,"
- "`Ghp0`, `Ghp1`, `Ghp2`, `Ghp3`, `Ghp4`, `Ghp5`, `Ghp6`, `Ghp7`"
+ "`visibleC`, `visibleG0`, `visibleG1`, `visibleG2`, `visibleG3`, `visibleG4`, `visibleG5`, `visibleG6`, `visibleG7`"
" FROM `%s` WHERE `castle_id`='%d'", guild_castle_db, castle_id) )
{
Sql_ShowDebug(sql_handle);
@@ -637,14 +633,6 @@ int inter_guildcastle_fromsql(int castle_id,struct guild_castle *gc)
Sql_GetData(sql_handle, 15, &data, NULL); gc->guardian[5].visible = atoi(data);
Sql_GetData(sql_handle, 16, &data, NULL); gc->guardian[6].visible = atoi(data);
Sql_GetData(sql_handle, 17, &data, NULL); gc->guardian[7].visible = atoi(data);
- Sql_GetData(sql_handle, 18, &data, NULL); gc->guardian[0].hp = atoi(data);
- Sql_GetData(sql_handle, 19, &data, NULL); gc->guardian[1].hp = atoi(data);
- Sql_GetData(sql_handle, 20, &data, NULL); gc->guardian[2].hp = atoi(data);
- Sql_GetData(sql_handle, 21, &data, NULL); gc->guardian[3].hp = atoi(data);
- Sql_GetData(sql_handle, 22, &data, NULL); gc->guardian[4].hp = atoi(data);
- Sql_GetData(sql_handle, 23, &data, NULL); gc->guardian[5].hp = atoi(data);
- Sql_GetData(sql_handle, 24, &data, NULL); gc->guardian[6].hp = atoi(data);
- Sql_GetData(sql_handle, 25, &data, NULL); gc->guardian[7].hp = atoi(data);
Sql_FreeResult(sql_handle);
memcpy(&castles[castle_id],gc,sizeof(struct guild_castle));
@@ -1231,14 +1219,6 @@ int mapif_guild_castle_alldataload(int fd)
Sql_GetData(sql_handle, 15, &data, NULL); gc->guardian[5].visible = atoi(data);
Sql_GetData(sql_handle, 16, &data, NULL); gc->guardian[6].visible = atoi(data);
Sql_GetData(sql_handle, 17, &data, NULL); gc->guardian[7].visible = atoi(data);
- Sql_GetData(sql_handle, 18, &data, NULL); gc->guardian[0].hp = atoi(data);
- Sql_GetData(sql_handle, 19, &data, NULL); gc->guardian[1].hp = atoi(data);
- Sql_GetData(sql_handle, 20, &data, NULL); gc->guardian[2].hp = atoi(data);
- Sql_GetData(sql_handle, 21, &data, NULL); gc->guardian[3].hp = atoi(data);
- Sql_GetData(sql_handle, 22, &data, NULL); gc->guardian[4].hp = atoi(data);
- Sql_GetData(sql_handle, 23, &data, NULL); gc->guardian[5].hp = atoi(data);
- Sql_GetData(sql_handle, 24, &data, NULL); gc->guardian[6].hp = atoi(data);
- Sql_GetData(sql_handle, 25, &data, NULL); gc->guardian[7].hp = atoi(data);
memcpy(WFIFOP(fd, len), gc, sizeof(struct guild_castle));
len += sizeof(struct guild_castle);
@@ -1853,15 +1833,6 @@ int mapif_parse_GuildCastleDataLoad(int fd,int castle_id,int index)
case 16:
case 17:
return mapif_guild_castle_dataload(gc.castle_id,index,gc.guardian[index-10].visible); break;
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- return mapif_guild_castle_dataload(gc.castle_id,index,gc.guardian[index-18].hp); break;
default:
ShowError("mapif_parse_GuildCastleDataLoad ERROR!! (Not found index=%d)\n", index);
return 0;
@@ -1906,15 +1877,6 @@ int mapif_parse_GuildCastleDataSave(int fd,int castle_id,int index,int value)
case 16:
case 17:
gc.guardian[index-10].visible = value; break;
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- gc.guardian[index-18].hp = value; break; // end additions [Valaris]
default:
ShowError("mapif_parse_GuildCastleDataSave ERROR!! (Not found index=%d)\n", index);
return 0;