summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-04 12:41:49 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-04 12:41:49 +0000
commitff2dd3a0c696cbcd659837ff736f927fab8937e3 (patch)
tree03aec2e46cbd950af34cfcb4995580e6a1deeae4 /doc
parent1903717ee1d6f3d7834b8ed807cf40f52364129b (diff)
downloadhercules-ff2dd3a0c696cbcd659837ff736f927fab8937e3.tar.gz
hercules-ff2dd3a0c696cbcd659837ff736f927fab8937e3.tar.bz2
hercules-ff2dd3a0c696cbcd659837ff736f927fab8937e3.tar.xz
hercules-ff2dd3a0c696cbcd659837ff736f927fab8937e3.zip
Modified the map_setcell() code to to use a boolean flag instead of needing SET_ / CLR_ pairs of defines (topic:174323).
Also removed script object 'setcell', added script function 'setcell'. - Now you can manipulate cell information without needing @loadnpc - You can also manipulate the terrain ('gat') type itself, using the new cell_walkable, cell_shootable and cell_water constants (currently the implementation uses bit flags too, so to get the type you want, you need to adjust the flags one by one) - This breaks current scripts, so please adjust places that use setcell (also be sure to _only_ use predefined constants, not direct numbers) - Details can be found in the script reference. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12009 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt53
1 files changed, 42 insertions, 11 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index a7564b672..2c52024d2 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -95,6 +95,8 @@
//= Corrected various mistakes mentioned in bugreport:373 [ultramage]
//= 3.12.20071227
//= Corrected description of scope and npc variables. [FlavioJS]
+//= 3.13.20080104
+//= Updated 'setcell' desc to match latest code changes [ultramage]
//=========================================================
This document is a reference manual for all the scripting commands and functions
@@ -390,17 +392,6 @@ The code part is the script code that will execute whenever the function is
called with 'callfunc'. It has to be in curly brackets, unlike elsewhere where
we use curly brackets, these do NOT signify an optional parameter.
-** Alter a map cell
-
-<map name>%TAB%setcell%TAB%<type>,<x1>,<y1>,<x2>,<y2>
-
-This is sneaky, and isn't used in any official scripts, but it will let you
-define an area (x1/y1-x2/y2 square) of a map as having cell type 'type', where
-type is a number, which, among other things, defines whether the area is
-walkable or not, whether it has Basilica working in it or not, and some other
-things. This is a solution just itching for a problem and there's a number of
-interesting things you could use it for. Further investigation on what types are
-valid and mean what exactly is pending.
Once an object is defined which has a 'code' field to it's definition, it
contains script commands which can actually be triggered and executed.
@@ -6118,5 +6109,45 @@ This will recalculate the homunculus stats acording to its level, of the
current invoking character.
---------------------------------------
+
+*setcell "<map name>",<x1>,<y1>,<x2>,<y2>,<type>,<flag>;
+
+Each map cell has several 'flags' that specify the properties of that cell.
+These include terrain properties (walkability, shootability, presence of water),
+skills (basilica, land protector, ...) and other (npc nearby, no vending, ...).
+Each of these can be 'on' or 'off'. Together they define a cell's behavior.
+
+This command lets you alter these flags for all map cells in the specified
+(x1,y1)-(x2,y2) rectangle. The 'flag' can be 0 or 1 (0:clear flag, 1:set flag).
+The 'type' defines which flag to modify. Possible options include cell_walkable,
+cell_shootable, cell_basilica. For a full list, see const.txt.
+
+Example:
+
+ setcell "arena",0,0,300,300,cell_basilica,1;
+ setcell "arena",140,140,160,160,cell_basilica,0;
+ setcell "arena",135,135,165,165,cell_walkable,0;
+ setcell "arena",140,140,160,160,cell_walkable,1;
+
+This will add a makeshift ring into the center of the map. The ring will be
+surrounded by a 5-cell wide 'gap' to prevent interference from outside, and
+the rest of the map will be marked as 'basilica', preventing observers from
+casting any offensive skills or fighting among themselves. Note that the wall
+will not be shown nor known client-side, which may cause movement problems.
+
+Another example:
+
+OnBarricadeDeploy:
+ setcell "schg_cas05",114,51,125,51,cell_walkable,0;
+ end;
+OnBarricadeBreak:
+ setcell "schg_cas05",114,51,125,51,cell_walkable,1;
+ end;
+
+This could be a part of the WoE:SE script, where attackers are not allowed
+to proceed until all barricades are destroyed. This script would place and
+remove a nonwalkable row of cells after the barricade mobs.
+
+---------------------------------------
Whew.
That's about all of them.