summaryrefslogtreecommitdiff
path: root/doc/script_commands.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/script_commands.txt')
-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.