summaryrefslogtreecommitdiff
path: root/doc/script_commands.txt
diff options
context:
space:
mode:
authorgepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-04 18:37:29 +0000
committergepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-04 18:37:29 +0000
commit262e60ab0b9cfc1f942a7b3ef11f7ed3abc7b208 (patch)
tree82cb02f8048521c7479ff012511a066612f6d439 /doc/script_commands.txt
parentce4352cfef6f07bf3b4c0324f48f880c5c74f041 (diff)
downloadhercules-262e60ab0b9cfc1f942a7b3ef11f7ed3abc7b208.tar.gz
hercules-262e60ab0b9cfc1f942a7b3ef11f7ed3abc7b208.tar.bz2
hercules-262e60ab0b9cfc1f942a7b3ef11f7ed3abc7b208.tar.xz
hercules-262e60ab0b9cfc1f942a7b3ef11f7ed3abc7b208.zip
- Guild Castle code cleanup:
- removed `MAX_GUILDCASTLE` limit - char-server now caches guild castles in `DBMap` - improved guild castle SQL queries to support non-default values of `MAX_GUARDIANS` - disallowed declaring guild castles on maps that are on other map-servers - map-server now requests data for all guild castles from char-server on initial connect (bugreport:287) - removed ''guildcastleinfo events'' as they were esentially duplicated ''OnAgitInit'' - optimized castle data load packets (bugreport:287) - updated WoE scripts to reflect source changes (scripts no longer need or should request castle or guild data) - updated related docs - Added `db_size` macro. - Replaced manual counting of castles occupied by a guild with `guild_checkcastles()` calls. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15657 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r--doc/script_commands.txt63
1 files changed, 36 insertions, 27 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 1e8df68e9..e3606b971 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -848,8 +848,10 @@ OnAgitInit2:
OnAgitStart will run whenever the server shifts into WoE mode, whether it is
done with @agitstart GM command or with 'AgitStart' script command. OnAgitEnd
-will do likewise for the end of WoE. OnAgitInit will run when castle data is
-loaded from the char-server by the map server.
+will do likewise for the end of WoE.
+
+OnAgitInit will run when data for all castles and all guilds that hold a castle
+is received by map-server from the char-server after initial connect.
No RID will be attached while any of the above mentioned labels are triggered, so
no character or account-based variables will be accessible, until you attach a
@@ -2850,37 +2852,44 @@ castle. The data is read from 'db/castle_db.txt'.
---------------------------------------
-*getcastledata("<map name>",<type of data>{,<event>})
+*getcastledata("<map name>",<type of data>)
*setcastledata "<map name>",<type of data>,<value>;
This function returns the castle ownership information for the castle referred
-to by it's map name. Castle information stored in 'save\castle.txt' for the TXT
-version of the server and in 'guild_castle' table for the SQL version.
-
-Valid types of data are:
-
- 0 - Will make the map server request the castle data from the char server, and
- always return 0. This, apparently, will also cause indirectly the execution
- of an 'OnAgitInit:' event mentioned at the beginning of this document.
- 1 - Guild ID
- 2 - Castle Economy score.
- 3 - Castle Defense score.
- 4 - Number of times the economy was invested in today.
- 5 - Number of times the defense was invested in today.
- 9 - Will return 1 if a Kafra was hired for this castle, 0 otherwise.
-10 - Is 1 if the 1st guardian is present (Soldier Guardian)
-11 - Is 1 if the 2nd guardian is present (Soldier Guardian)
-12 - Is 1 if the 3rd guardian is present (Soldier Guardian)
-13 - Is 1 if the 4th guardian is present (Archer Guardian)
-14 - Is 1 if the 5th guardian is present (Archer Guardian)
-15 - Is 1 if the 6th guardian is present (Knight Guardian)
-16 - Is 1 if the 7th guardian is present (Knight Guardian)
-17 - Is 1 if the 8th guardian is present (Knight Guardian)
+to by its map name. Castle information is stored in `guild_castle` SQL table.
+
+Types of data correspond to `guild_castle` table columns:
+
+ 1 - `guild_id` - Guild ID.
+ 2 - `economy` - Castle Economy score.
+ 3 - `defense` - Castle Defense score.
+ 4 - `triggerE` - Number of times the economy was invested in today.
+ 5 - `triggerD` - Number of times the defense was invested in today.
+ 6 - `nextTime` - unused
+ 7 - `payTime` - unused
+ 8 - `createTime` - unused
+ 9 - `visibleC` - Is 1 if a Kafra was hired for this castle, 0 otherwise.
+10 - `visibleG0` - Is 1 if the 1st guardian is present (Soldier Guardian)
+11 - `visibleG1` - Is 1 if the 2nd guardian is present (Soldier Guardian)
+12 - `visibleG2` - Is 1 if the 3rd guardian is present (Soldier Guardian)
+13 - `visibleG3` - Is 1 if the 4th guardian is present (Archer Guardian)
+14 - `visibleG4` - Is 1 if the 5th guardian is present (Archer Guardian)
+15 - `visibleG5` - Is 1 if the 6th guardian is present (Knight Guardian)
+16 - `visibleG6` - Is 1 if the 7th guardian is present (Knight Guardian)
+17 - `visibleG7` - Is 1 if the 8th guardian is present (Knight Guardian)
+
+All types of data have their meaning determined by War of Emperium scripts,
+with exception of:
+ - `guild_id` that is always considered ID of the guild that owns the castle,
+ - `defense` that is used in Guardians & Emperium HP calculations,
+ - `visibleG` that is always considered to hold guardian presence bits.
The 'setcastledata' command will behave identically, but instead of returning
values for the specified types of accessible data, it will alter them and cause
-them to be sent to the char server for storage. Data type of 0 won't do
-anything, obviously.
+them to be sent to the char-server for storage.
+
+Changing Guild ID or Castle Defense will trigger additional actions, like
+recalculating guardians' HP.
---------------------------------------