About

Home > About

NWN Lexicon February 2003

Lexicon \Lex"i*con\

A vocabulary, or book containing an alphabetical arrangement of the words in a language or of a considerable number of them, with the definition of each
NWN Lexicon - February 2003 Release

The fifth release of the Lexicon includes many fixes to errata discovered and brought to our attention via e-mail. Also included are new definitions for functions previously undefined, and documentation current of NWN patch 1.28.

Nearly all, if not all, of the ResRefs/Tags for items, placeables, and creatures should now be correct (special thanks to Lilac Soul for much needed help in this area). The long requested VFX_* series of constants have been detailed and even screen captured by Mike Kenyon. We also have a series of tutorials explaining how to create cut-scenes to enhance player immersion in your modules by Roger Sandbakk, and an advanced tutorial and script on providing a custom WalkWayPoints() function contributed by Graziano Lenzi. Due to popular request, the Events portion of the Reference section received a major overhaul, using information written by David Gaider and harvested by Ian Baker from the official BioWare NWN Forums.

There are still many incomplete entries, as well as a short laundry list of items that will be done prior to the next release.

NWN Lexicon

The NWN Lexicon Project is intended to be a community-based NWNScript Language Reference and Resource Guide for BioWare's Neverwinter Nights role playing game.

The NWN Lexicon is always in development, with value added by errata and information provide by the NWN community. It is the intent of this project to make the most complete, concise, and easy to use reference available. Judging by community opinion it appears that we are succeeding in our goals - but in order to improve the quality of the Lexicon we rely on the gathered knowledge of the individual script writers and module creators.

Community Based

XML dumps of the data used to generate the NWN Lexicon is available free upon request for use in non-commercial programs or references.

If you are interested in helping by contributing to the project, the best way to help is to submit fixes for any errors (documentation, programmatic, spelling, grammatical, etc) you find within the Lexicon to our team. You can request XML dumps of the data or submit fixes by e-mailing webmaster@reapers.org. We are also trying to build the code examples for all of the functions detailed in the Lexicon and welcome small working code snippets of scripts that use functions which currently do not have a code example. Financial donations, while nice, are neither requested nor accepted.

Release Schedule

Our planned release schedule is once every quarter, unless a particularly large error must be corrected. This allows us ample time to integrate information submitted via e-mail to the project, research problems, and still pay the bills.

Future Goals

Resource Guide

It is difficult to find a particular resource, like a certain *.wav file, while in the module editor because none of the file names are very descriptive. After getting a healthy amount of data harvested we intend to begin working on associating keywords with the resources so when you want to find that specific "woman disheartened grief" sound file name, you can very easily by using our built-in search.

Status: In Progress.

Anonymous Contributions

We're going to add an anonymous comment system, similiar to that found in the PHP documentation. Comments will also be reviewed for integration into the official, downloadable version of the Lexicon.

Status: Not Yet Started.

License

Copyright © 2002-2003 NWN Lexicon Group. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation. A copy of the license is included in the section entitled "License".

Neverwinter Nights © 2002 Infogrames Entertainment, S.A. Some code examples © 2001-2002 BioWare Corp. BioWare, BioWare Aurora Engine are trademarks of BioWare Corp. Neverwinter Nights, Forgotten Realms, Dungeons & Dragons, and D&D are trademarks owned by Wizards of the Coast, Inc., a subsidiary of Hasbro, Inc. All other trademarks are the property of their respective owners.

www.reapers.org/nwn/reference


Category - Contributers

Home > Contributors

このリストに名前が挙げられている人物達は、Lexiconを作るために少なからず彼らのプライベートな時間を費やしました。ファンクションの働きを明らかにするために、彼らは長い時間をかけて調査しました。我々が望むことは、より良いMOD製作の為にこのLexiconが何らかの役に立つことです。

Everyone included in the list below has contributed at least some of their time to the creation of the Lexicon; many contributers have spent long hours determining exactly how a specific function operates and what its quirks are. It is through these efforts we hope the Lexicon helps module developers create better quality modules.

Name | Title
Alex Skinner | Designer
Bill Castello | Contributer
Brett Lathrope | Contributor
Celowin | Content Contributer
Charles Feduke | Project Manager
Chaz Mead | Contributer
Craig Smith | Contributer
Dan Spezzano | Contributer
Daniel Beckman | Contributor
Dave Robinson | Support
Dave Withnall | Contributor
David Downing | Support
David Gaider | Support
Drake Coker | Editor
GoLeM | Contributor
Graziano Lenzi | Contributer
Herner Klenthur | Contributer
Iskander Merriman | Contributor
Jason Harris | Contributor
Jason Simpson | Contributer
Jeff Lindsey | Editor
Jeremy Ludwig | Contribuer
Jeremy Spilinek | Examples
Jochem van 't Hull | Editor
Jody Fletcher | Contributer
John Shuell | Contributor
Kenneth Toomey | Content Contributer
Kevin Rogala | Public Relations
Kristian Markon | Editor
Lilac Soul | Content Contributer
Maximus | Support
Michael Kenyon | Visual Effects Guide
Michael Nork | Contributor
Neil Burton | Contributer
Paul Thomas | Editor
Peter | Contributor
Peter Westergaard | Contributer
Richard Conner | Content Contributer
Roger Sandbakk | Content Contributer
Ryan Hunt | Designer
Sarev0k | Editor
Steve Moseley | Contributor
Timothy Tryzbiak | Content Contributer
Tom Cassiotis | Contributor
Troels Therkelsen | Contributer
akito | JP team
geshi | JP team
katsu794 | JP team
marimo | JP team
marshall | JP team
Masacy | JP team
macchi | JP team
NamaYake | JP team
ngtaicho | JP team
ohtsuki | JP team
Rainie | JP team
Redondo | JP team
ryuga | JP team
Tizumi | JP team
Volac | JP team
weed | JP team


 GNU Free Documentation License
Version 1.1, March 2000

Copyright (C) 2000 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other
written document "free" in the sense of freedom: to assure everyone
the effective freedom to copy and redistribute it, with or without
modifying it, either commercially or noncommercially. Secondarily,
this License preserves for the author and publisher a way to get
credit for their work, while not being considered responsible for
modifications made by others.

This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.

We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work that contains a
notice placed by the copyright holder saying it can be distributed
under the terms of this License. The "Document", below, refers to any
such manual or work. Any member of the public is a licensee, and is
addressed as "you".

A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (For example, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.

The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.

The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.

A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, whose contents can be viewed and edited directly and
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup has been designed to thwart or discourage
subsequent modification by readers is not Transparent. A copy that is
not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML designed for human modification. Opaque formats include
PostScript, PDF, proprietary formats that can be read and edited only
by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML produced by some word processors for output
purposes only.

The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and
you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies of the Document numbering more than 100,
and the Document's license notice requires Cover Texts, you must enclose
the copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.

If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a publicly-accessible computer-network location containing a complete
Transparent copy of the Document, free of added material, which the
general network-using public has access to download anonymously at no
charge using public-standard network protocols. If you use the latter
option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this
Transparent copy will remain thus accessible at the stated location
until at least one year after the last time you distribute an Opaque
copy (directly or through your agents or retailers) of that edition to
the public.

It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:

A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has less than five).
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section entitled "History", and its title, and add to
it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
K. In any section entitled "Acknowledgements" or "Dedications",
preserve the section's title, and preserve in the section all the
substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section as "Endorsements"
or to conflict in title with any Invariant Section.

If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.

You may add a section entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.

You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice.

The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections entitled "History"
in the various original documents, forming one section entitled
"History"; likewise combine any sections entitled "Acknowledgements",
and any sections entitled "Dedications". You must delete all sections
entitled "Endorsements."

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, does not as a whole count as a Modified Version
of the Document, provided no compilation copyright is claimed for the
compilation. Such a compilation is called an "aggregate", and this
License does not apply to the other self-contained works thus compiled
with the Document, on account of their being thus compiled, if they
are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one quarter
of the entire aggregate, the Document's Cover Texts may be placed on
covers that surround only the Document within the aggregate.
Otherwise they must appear on covers around the whole aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License provided that you also include the
original English version of this License. In case of a disagreement
between the translation and the original English version of this
License, the original English version will prevail.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.

ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:

Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
A copy of the license is included in the section entitled "GNU
Free Documentation License".

If you have no Invariant Sections, write "with no Invariant Sections"
instead of saying which ones are invariant. If you have no
Front-Cover Texts, write "no Front-Cover Texts" instead of
"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.

If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.


Category - Lyceum

Home > Lyceum

Lyceum

Lyceum \Ly*ce"um\

An institution for popular education providing discussions, lectures, etc

1　《米古風》文化会館,ホール.

2　《米》文化運動団体［機関］.

3　《L-》アリストテレス学派,逍遥（しょうよう）派.

4　＝lycee

語源　ラテン語←ギリシャ語Lykeion

(lykeiosアポロの＋-on名詞語尾＝アポロの神殿の近くの場所）．

プログレッシブ英和中辞典 第3版 (c)小学館

日本語によるチュートリアルサイト | 紹介
TRPG Online Neverwinter Nights特集 | ツールセット・スクリプトの解説の他に、DMについての手引きなどもあります。
NWN Summary | データサイトです。 NWNの各種データが一覧性に優れた形で記載されています。

Section | Description
Primer | NWNScript 入門書 - NWNScript におけるコードの書き方の基本。
Tutorial | チュートリアル

Send comments on this topic.


Prime Categories - Primer

Home > Lyceum > Primer

Primer

Title | Description
Basics | NWNScript の基礎
Best Practices | NWNスクリプトの慣習と標準について
Compiler Directives | コンパイラ指令はNWNスクリプトのなかに見つけられます
Conditionals and Loops | Conditional statements used in NWNScript.
Functions | Functions in NWNScript.
Miscellaneous | Miscellaneous NWNScript symbols and keywords.
Operators | Operators used in NWNScript.


Category - Basics

Home > Lyceum > Primer > Basics

Basics

NWNスクリプトの基本。

Title | Brief Description
Code Block Delimiter | コードブロックデリミタ： 変数スコープ、関数、ループ、構造体、条件分岐のために、「{」と「}」を使ってスクリプトをコードブロックに区切ります。
Comments | コメント： コード注釈用のデリミタ（区切り文字）と説明。
Constants | 定数： 変更できない値を持つシンボル。
Semicolon | セミコロン： セミコロン「;」はステートメント（文）の終了を表すために使用されます。
String Delimiter | 文字列デリミタ： 文字列データはそれが正確に解釈されるように「"」で囲んで下さい。
Struct | 構造体： 同じようなデータを保有するための構造
Variables | 変数： 変数は値を変更できるシンボル名です
Whitespace | ホワイトスペース： タブ、改行、半角スペースでコードを分解し、より読みやすくすることができます。

補足： ＣにあってNWNスクリプトに無いもの

・配列、定数、ポインタ、ビットフィールド、共用体、列挙型、typedefなど

JP team: ohtsuki


Primer - Code Block Delimiter

Home > Lyceum > Primer > Basics > Code Block Delimiter

Code Block Delimiter

コードブロックデリミタはスクリプトをコードブロックに区切ります。

変数は宣言されたコードブロックと、その内部のコードブロック（子ブロックや孫ブロック）でのみアクセスすることが出来ます。（変数のスコープとか変数の作用範囲と言います）

コードブロックは左中括弧「{」で始まり、右中括弧「}」で終わります。

関数、ループ(for,while,do)、構造体(struct)および条件分岐(if/else,switch/case)は全てコードブロックデリミタを使用します。

条件分岐とループは、含まれるステートメントの総数が１論理行であればコードブロックデリミタを必要としません。

（１論理行は、セミコロン１つ分の意味。コードエディタで見たときに複数行に渡っていても構いません。セミコロンの項とホワイトスペースの項も参照して下さい）

変数のスコープを定義するためだけに匿名コードブロック（ループや条件分岐などに付随しないもの）を使用することが可能です。

void main()
{ // main関数ここから

      // 匿名コードブロック。変数nはこのコードブロックだけで使用可能
     {
          int n = 13;
          PrintInteger( n );
     }

     // 変数nのスコープはここまで（これ以降は使う事が出来ない

     int x = 0;

     // ループの中身が１行の場合はコードブロックデリミタは不要（付けても良い
     while (x < 10)
          x++;

     // このループは複数のステートメントで構成される
     for (x = 10; x <= 30; x++)
     {
          PrintInteger(x);
          if (x > 25)
               PrintString("xが25を超えました");
          else
               PrintString("xは25以下です");
     }
} // main関数ここまで

author: Charles Feduke, additional contributor(s): Frank Succardi, JP team: ohtsuki


Primer - Comments

Home > Lyceum > Primer > Basics > Comments

Comments

スクリプトを後で読み返すとき、または他の人がスクリプトを読むときに、そのコードが何をしているのかを説明するため、コメント（注釈）を入れておくことができます。

NWNスクリプトにコメントを入れる複数の方法があります。

連続した２つの半角スラッシュ「//」がある場合、それ以降の文字はコメントと見なされます。

「/*」と「*/」で囲む方法もあります。

// １行のコメント

/* １行のコメント */

/*
   s複数行に
    渡る
    コメント
*/

モジュールのファイルサイズが必要以上に大きくならないよう、コメントはコンパイルされません。

コメントを書くのを時間の浪費と見なすべきではありません。

スクリプトを書いている間でさえそのコードが何を意味するのか容易に分かるため、時間の節約になります。

（コメントを仕様書や設計書代わりに書いておくとか、今調べた関数の役割を書いておくとかしておきましょうという事です。コメントの無いスクリプトはデバッグや改造の際に想像できないほどの労力を必要とします）

スクリプトや関数のヘッダにドキュメントを書くため、コメントを利用することもよくあります。

公式スクリプトライブラリより：

//::///////////////////////////////////////////////
//:: アシッド・フォグ: On Enter
//:: NW_S0_AcidFogA.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
  AoE内のクリーチャーは全て１ランドあたり2d6の酸ダメージを受ける
  範囲に入ったときにフォートセーブに失敗した場合は移動速度が半分になる
*/
//:://////////////////////////////////////////////
//:: 作者: Preston Watamaniuk
//:: 作成日: May 17, 2001
//:://////////////////////////////////////////////

author: Ryan Hunt, editor: Charles Feduke, JP team: ohtsuki


Primer - Constants

Home > Lyceum > Primer > Basics > Constants

Constants

定数は、スクリプト実行中に変わってはならない値を表すシンボル（あるいはラベル）です。

定数の使用はコードの可読性と保守性をあげるのに有効な手段です。

モジュール開発中に定数の値を変えたくなった場合、それが可能です。

最初の定数定義を変更するだけで全ての定数の値が変更されるので、スクリプトの中を隅から隅まで探して置換する必要がありません。

実際は、NWNスクリプトでの定数は、単に慣習に従った命名（英大文字とアンダーバー、数字のみを使う）をしただけの変数です。

（訳注：実行中に値を変更することももちろん可能です。こんなものを定数と言っては語弊があります。下の補足も合わせて考えると、NWNスクリプトでは定数は使えないと思った方が良いです）

int DAYS_IN_A_YEAR = 365;

NWNスクリプトが本当の定数をサポートしていないように見えますが、自分の定数を用意する方法もあります（推奨しません）。

\override\nwscript.nssに変数宣言と値を書けば、それは本当の定数として機能し、swith/case文の中で使用することが出来ます。

この方法を採った場合、あなたの\override\nwscrpit.nssをモジュールと一緒に配布してください。

さらに今後BioWareがNWNのバージョンアップの際にスクリプトを更新した場合にバージョン問題を引き起こす危険を被らなければならないでしょう。

上述したとおり真の定数でないため、switch/case文の値の条件として使うことは出来ません。

author: Charles Feduke, additional contributor(s): Iskander Merriman, David Delmont, JP team: ohtsuki


File Not Found

The requested URL was not found on this server.


Primer - Semicolon

Home > Lyceum > Primer > Basics > Semicolon

Semicolon

セミコロンはステートメントの論理的な行を終了するために使用されます。

可読性を高めるため、複数の物理的な行（コードエディタで表示している行）に渡って記述することができるので

物理行、論理行と言う別々の名前が付いています。

複数の論理行を含めたコードブロックも１論理行として扱うことができますが、最後にセミコロンは付けません。

ただし例外として、構造体を定義する際には最後にセミコロンを付けます。

int bCondition = TRUE; // １行のステートメント
if (bCondition)
     PrintString("bCondition is TRUE."); // 複数物理行に渡るステートメント

if (!bCondition)
{
     // 複数ステートメントから成るコードブロック
     PrintString("bCondition is FALSE.");
     bCondition = TRUE;
}    //コードブロック全体で１論理行としても扱うが、最後にセミコロンは付けない

author: Charles Feduke, additional contributor(s): Ryan Hunt, Frank Succardi, JP team: ohtsuki


Primer - String Delimiter

Home > Lyceum > Primer > Basics > String Delimiter

String Delimiter

ダブルクオーテーションマーク「"」で囲まれたテキストは、変数名や関数名などではなく文字列データとしてコンパイラに解釈されます。

void main()
{
     string Name = "Galryx";
     PrintString( "Name" ); //「Name」と表示される
     PrintString( Name );   //「Galryx」と表示される
}

author: Charles Feduke, additional contributor(s): Frank Succardi, JP team: ohtsuki


Primer - Struct

Home > Lyceum > Primer > Basics > Struct

Struct

構造体は複数の値を保持できる変数です。

個々の値（メンバと呼びます）にはピリオド「.」を使ってアクセスします。

構造体を使用する利点は、代入演算子を使用して簡単にそれをコピーできるという点で、多数の変数を一つ一つ代入していくより綺麗で簡潔なスクリプトを書くことが出来ます。

NWNスクリプトの構造体はＣ言語スタイルの構造体です。したがってメンバ関数を持つことが出来ません。

（Ｃ＋＋言語には、構造体に関数を含められるようにした「クラス」というデータ型があります）

（注：以下のサンプルと文章は訳者の手によるものです。原文とは全く違います）

//構造体を宣言
struct xy {
        int x;
        int y;
};

//この構造体を使う関数を宣言
int compute_add( struct xy s )	//「struct xy」型の引数「s」を受け取る
{
        int ans;
        ans = s.x + x.y;	//メンバ変数xとyを足し算する
        return ans;
}

void main()
{
        struct xy str1, str2;	//「struct xy」型の変数「str1」と「str2」を宣言

        str1.x = 10;	//str1のxに10を代入
        str1.y = 20;	//str1のyに20を代入

        str2.x = 30;	//str2のxに30を代入
        str2.y = 40;	//str2のyに40を代入

        str2 = str1;	//str2にstr1を代入（全てのメンバ変数の値が代入される

        PrintInteger( compute_add(str2) );
                    //出力されるのは70ではなく30となる
}

NWNスクリプトでは配列が使えないため構造体の利用方法はあまり思いつきませんが、自分で作った関数が多くの引数を必要とするような場合、もしくは複数の戻り値を持つ関数を作りたい場合には使えるかもしれません。

例１：引数にしたいものが５０個くらいあるとか考えてみて下さい

arg.x = 10;
arg.y = 20;
arg.text = "hello";
arg.oPC = GetLastUsedBy();
arg.delay = 2.0;
myfunction( arg );

例２：この関数は四則演算の結果と「余り」が入った構造体を返します。

struct dest compute( int x, int y ){
    struct dest ret;
    ret.add = x+y;
    ret.sub = x-y;
    ret.mlt = x*y;
    ret.dev = x/y;
    ret.mod = x%y;
  return ret;
}

main関数などの中でanswer = compute( 10, 20 );として使えば、answer.addには足し算の結果が、answer.subには引き算の結果が入っているという仕組みです。

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Jonathan Epp, JP team: ohtsuki


Primer - Variables

Home > Lyceum > Primer > Basics > Variables

Variables

変数は未知の値を表現するために使われます。

すなわち、スクリプトを書いている段階では決まった値を持っていないものです。

変数は複雑な計算をしたり、いろいろな関数を書いたり、様々な物事を行うことを可能にします。

変数は宣言と同時に初期化することが出来ます。変数の初期化とは、変数にデフォルト値（初期値）を与える事です。

void main()
{
     int nHours; // 変数宣言
     nHours = GetTimeHour() + 4;
     // ↓のvector型変数は宣言と同時に初期化される
     vector vPosition = Vector(1.0f, 2.0f, 86.3f);
}

NWNスクリプトで使える変数の型については「データタイプ」を参照して下さい。

author: Charles Feduke, JP team: ohtsuki


Primer - Whitespace

Home > Lyceum > Primer > Basics > Whitespace

Whitespace

ホワイトスペース（余白）の使い方はコードを書く人の好みしだいです。

コードをより読みやすくするため、ホワイトスペースを使用することをおすすめします。

コードブロック毎にインデントするためにタブやスペースを開けると可読性が上がります。

例えば次のサンプルを見て下さい。

if (bCondition) someFunction(TRUE); else someFunction(FALSE);

これはそのまま１行に全て書いてしまっていますが、改行とインデントを使用するとはるかに読みやすくなります。

if (bCondition)
     someFunction(TRUE);
else
     someFunction(FALSE);

行の終わりにセミコロンを置いた後、必須ではありませんが、改行を入れるのが一般的です。

改行を使わないとコードのメンテナンスがすぐに大変になります。

長い関数呼び出しを複数行（物理行）に分解したり、関数呼び出しのネスト（入れ子構造）を明確にするために改行を使用することが出来ます。

例えばこのスクリプトは

action aConvo = ActionStartConversation(GetObjectByTag("SOME_TAG"), "Hey you!", FALSE);

こう書いた方が分かりやすいでしょう

action aConvo = ActionStartConversation(
     GetObjectByTag("SOME_TAG"),
     "Hey you!",
     FALSE
);

author: Charles Feduke, JP team: ohtsuki


Category - Best Practices

Home > Lyceum > Primer > Best Practices

Best Practices (慣習と標準)

NWNスクリプトの慣習と標準について。

Title | Brief Description
Coding Standards | 標準的なコーディング: なにかしらの標準的なコーディング方法を守ることで、コードの組み込みやデバッグ、追加変更などが簡単に行えるようになります。
Function Prototypes | 関数プロトタイプ: 関数プロトタイプ宣言は関数自体を定義する前に、関数の情報をコンパイラに通知することができます。
Naming Conventions | 命名規則: 命名規則を守ることでコードの組み込みやメンテナンスが簡単になり、グループ開発時の混乱を回避する助けになります。
補足：ＣにあってNWNスクリプトに無いもの

仮引数名無しの関数プロトタイプ（int func(int,int,float);）など

JP team: ohtsuki


Primer - Coding Standards

Home > Lyceum > Primer > Best Practices > Coding Standards

Coding Standards (標準的なコーディング)

標準的なコーディングをすることは、コードを簡単にメンテナンス、問題解決、統合できるようになるのでモジュール作成に役立ち、より一貫性を持つコードを書くのに役に立ちます。

NWNライブラリプロジェクトは一貫性を維持するため、すべて標準的なコードと命名慣習(naming conventions)を守るように書かれています。グループ開発を行う場合、ここに示された通りでなくても、なんらかの標準コーディング方法や標準命名法則を決め全員が合意することは強く勧められます。

  1. インデントと全体的な構造
    • Biowareでは括弧の配置やインデントは完全に一貫していませんが、左括弧は関数プロトタイプやif文の次の行に大抵置かれています。if文はこう書かれているでしょう。
      if (TRUE)
{
     // ...
}
    • ひとつの物理行にはひとつの論理行だけが置かれるべきです。例外は例えば、switch/case構造などで可読性を高める場合です。
      switch (nCondition)
{
     case 1: sVariable = "one"; break;
     case 2: sVariable = "two"; break;
     case 3: sVariable = "three"; break;
}
    • ステートメントは入れ子の深さの分だけインデントするべきです。void main()内のif文は次のようになります。
      void main()
{
     if (TRUE)
     {
          // ...
     }
}
    • 余白と改行をうまく使うことで、変更を簡単にするのと、長い関数呼び出しや入れ子の関数呼び出しを分解して読むことができるようになります。
      action aConvo = ActionStartConversation(
     GetObjectByTag("SOME_TAG"),
     "Hey you!",
     FALSE
);

  2. 識別子と関数の宣言
    • 一般に識別子（変数や定数のこと）は関数の最初に宣言するべきです。これは識別子の型や初期値を見つけるのを簡単にします。識別子が一度しか使われない場合など、その使う箇所のコードブロックの内部で宣言することもできます。
    • 関数名は（最初の単語を除いて）単語の１文字目を大文字にするべきです。こうすればBioWareの関数と名前が一緒になることがありません。例えば以下のように書きます。
      int doSomething(int nKills)
{
     return nKills - 9;
}
    • 変数名は標準的な命名にするべきです。「命名規則(naming conventions)」を参照して下さい。

  3. 論理条件判定
    • BioWareでは論理型の条件判定の書き方は一貫していません。「bCondition==1」も「bCondition==TRUE」も使われていますし、「bCondition」や「!bCondition」も一般的な使われ方として認められています。
      int型の変数が真偽のみを表す論理型として使われる場合は接頭辞「b」を付けるのが標準となっています。
      int bTest = TRUE;
int nTries = 3;
// boolean test:
if (bTest)
{
     // ...
}
// numeric test:
if (nTries > 0)
{
     // ...
}

author: Charles Feduke, additional contributor(s): Steve Mosely, Michael Nork, pcfung, JP team: ohtsuki


Primer - Function Prototypes

Home > Lyceum > Primer > Best Practices > Function Prototypes

Function Prototypes (関数[かんすう]プロトタイプ)

関数はプロトタイプ宣言をすることができます。

関数の宣言にすぐ続けて内容を記述することもできますが、ファイルの先頭で関数名と引数[ひきすう]だけを宣言して、内容はファイルの後ろの方に書くこともできます。

コンパイラはトップダウン式に（上から下に）ソースコードをコンパイルするので、関数プロトタイプはコードを組織化するのに有用です。

コードの中からmain()関数やユーザー定義関数を簡単に見つけられるようになるため、これは一般的なプログラミングスタイルになっています。

コンパイラにとっては、main()関数中で使われるユーザー定義関数の引数や戻り値[もどりち]の型を知るために、main()関数より先にその関数のプロトタイプが必要になります。
( 参照: void main(), int StartingConditional() )

// 関数プロトタイプ
int getSomeNumber(string sName);
// ここではユーザー関数の内容は記述しない

void main()
{
     int nBlah = getSomeNumber("Chuck");
     // ここで上の関数を使用しているが、まだ内容は定義されていない（コンパイラも知らない）
     // それでもコンパイルが成功するのは、コンパイラが引数と戻り値の型チェックしか行わないため
}

// ここでユーザー関数の内容を記述する
int getSomeNumber(string sName)
{
     if (sName == "Chuck")
          return 24;
     else
          return 0;
}

伝統的なＣ言語と違い、NWNスクリプトでは引数の型だけを宣言した関数プロトタイプを作ることができません。

引数名は関数プロトタイプと関数の内容定義とで異なっていても構いません（もちろん同じ名前を付けることが推奨されます）

// コンパイルできない例：
void PrintValue(int);

void main()
{
     someValue(6);
}

void PrintValue(int nValue)
{
     PrintInt(nValue);
}

上記のものは仮引数の名前がないのでコンパイルできません。

以下のようにすればコンパイルできるようになります。

// コンパイルできる例：
void PrintValue(int nValue);

void main()
{
     someValue(6);
}

void PrintValue(int nValue)
{
     PrintInt(nValue);
}

BioWareの様々な関数はnwscript.nssの中でプロトタイプ宣言されています。

author: Charles Feduke, JP team: ohtsuki


Primer - Naming Conventions

Home > Lyceum > Primer > Best Practices > Naming Conventions

Naming Conventions (命名規則)

識別子[しきべつし]（変数名や関数名などのこと）の命名規則を守ることで、コードのメンテナンスや統合、グループ開発などがスムーズに行えるようになります。

数ヶ月前に作ったコードに変更や追加をする場合に便利です。

例えば「sName」はBioWareの命名規則に従った「文字列型」の「（誰かの）名前」を入れるための変数だというのが容易に分かります。それが「__NAME」とか「name」、「Name」もしくは他の派生語だった場合のように、コードの中を探し回る必要がなくなります。

他の人が作ったソースコードを自分のモジュールに組み込むとき、その両方が標準の命名規則に従っていれば大抵その組み込みは簡単に出来るでしょう。例えば自分のモジュール内にセットされたある変数に、他の誰かが作ったNPCが反応するようにしたい場合、そのNPCのスクリプトを一部変更することになるかも知れないのです。

グループ開発では１セットの命名規則および標準コーディング方法を全てのメンバーが守ることが特に大切です。そうでなければ混乱と無秩序に陥る結果になります。

変数名はその型を表す接頭辞[せっとうじ]（プレフィクス）に名前を続ける形で書くべきでしょう。

接頭辞は以下の表の通りです。

Type (型) | Prefix (接頭辞) | Example (例)
action | a | aKill
effect | e | eConPenalty
event | ev | evAttacked
float | f | fResult
int （数値を格納する場合） | n | nAge
int （boolean:論理値を格納する場合） | b | bIsSpell
location | loc | locJumpTo
object | o | oPC
string | s | sName
struct | str | strPerson
talent | t | tSkillHide
vector | v | vVelocity

author: Charles Feduke, JP team: ohtsuki


Category - Compiler Directives

Home > Lyceum > Primer > Compiler Directives

Compiler Directives (コンパイラ指令)

コンパイラ指令はNWNスクリプトのなかに見つけられます。

Title | Brief Description
#include | 外部スクリプトライブラリを取り込むコンパイラ指令

補足：ＣにあってNWNスクリプトにないもの

「#include」以外のプリプロセッサ指令やマクロ。#define, #ifdef, __DATE__等々。

JP team: ohtsuki


Primer - #include

Home > Lyceum > Primer > Compiler Directives > #include

#include (インクルード)

この宣言はスクリプト（*.nssファイル）に必要な外部コードライブラリをロードするために使用されます。

外部ライブラリの関数を使うところより上で宣言される必要がありますが、一般的にはスクリプトの一番上にまとめて#include指令を記述します。

#include指令は拡張子なしのファイル名を「"」で囲って記述します。

#include指令はコードステートメントではなくコンパイラ指令なので、最後にセミコロンを付けません。

// スクリプトの一番上で
#include "NW_I0_GENERIC"

再コンパイルされたライブラリをインクルードしているスクリプトは、再コンパイル前のライブラリを含んでいます。ライブラリの変更を反映させるためにはスクリプトを再コンパイルする必要があります。

例：

ライブラリAを作成しコンパイル

↓

スクリプトB（ライブラリAをインクルードしている）を作成しコンパイル

↓

ライブラリAを変更し再コンパイル（この時点ではBにはAの変更が反映されていない）

↓

スクリプトBを変更せずに再コンパイル（この時点でAの変更がBに反映される）

ツールセットの「ビルド(V)」→「モジュールのビルド(Y)」で全てのスクリプトを再コンパイルすることが出来ます。

注：複数行コメントによりコメントアウトされた#include指令は無効になりません。

無効にするためには、代わりに「//」を使ってコメントアウトして下さい。

author: Ryan Hunt, editor: Charles Feduke, JP team: ohtsuki


Category - Miscellaneous

Home > Lyceum > Primer > Miscellaneous

Miscellaneous

Miscellaneous NWNScript symbols and keywords.

Title | Brief Description
@ Symbol | Unknown supported symbol or operator.


Primer - @ Symbol

Home > Lyceum > Primer > Miscellaneous > @ Symbol

@ Symbol

Speculation: This operator may be used to override error messages in debugging. Code using this symbol compiles without error and the editor seems to recognize it as an operator and not as part of a variable name.

author: Ryan Hunt, editor: Charles Feduke


Category - Conditionals and Loops

Home > Lyceum > Primer > Conditionals and Loops

Conditionals and Loops

Conditional statements used in NWNScript.

Title | Brief Description
?: Ternary Conditional | Simple conditional operator similar to an if statement.
break Statement | Halts the execution of a loop or switch and skips any remaining statements within the loop or switch code block.
continue Statement | Skips any remaining statements within a loops current iteration, and begins execution at the beginning of the next iteration.
do Loop | Executes a block of code (at least once) and then repeats the block based on the value of an expression.
for Loop | Repeats the execution of a code block based on the value of a counter.
if/else Statement | Executes code blocks based on a Boolean condition.
switch/case Statement | Creates a series of conditional branches based on the value of a single variable.
while Loop | Repeats the execution of a code block based on the value of an expression.


Primer - ?: Ternary Conditional

Home > Lyceum > Primer > Conditionals and Loops > ?: Ternary Conditional

?: Ternary Conditional

expression1 ? expression2 : expression3;

The above code syntax would simply read:

if (expression1)
{
     expression2;
}
else
{
     expression3;
}

This operator can be a more efficient way to do a simple if statement, especially if the resulting value is being stored in a common variable. Sometimes this operator is referred to as an "inline if" statement.

The example below will assign the larger of x or y to the common variable z:

int x = 5;
int y = 10;
int z = (x > y) ? x : y;
// z = 10

author: Ryan Hunt, editor: Charles Feduke


Primer - break Statement

Home > Lyceum > Primer > Conditionals and Loops > break Statement

break Statement

Used to escape from a looping structure (do, while, and for) or switch case statement.

If a break statement is executed from within a looping code block the loop will halt execution regardless of the condition controlling the loop. Any remaining statements within the code block will not be executed.

If a break statement is executed from within a case inside of a switch statement, all following case statements are ignored.

The following example searches for a PC with a strength score higher than 12, and repeats until there are no more PCs to search:

object oTarget = GetFirstPC();

while (oTarget != OBJECT_INVALID)
{
     int nStr = GetAbilityScore(oTarget, ABILITY_STRENGTH);
     if (nStr > 12)
          break;
     oTarget = GetNextPC();
}

As soon as the loop finds a PC with a strength higher than 12 the break statement is called halting the loop and the search for a target.

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Rich Dersheimer


Primer - continue Statement

Home > Lyceum > Primer > Conditionals and Loops > continue Statement

continue Statement

Similar to the break statement in that it skips remaining statements within a looping code block (do, while, and for) , but instead of halting the remaining loop iterations, continue begins again at the next iteration.

author: Ryan Hunt, editor: Charles Feduke


Primer - do Loop

Home > Lyceum > Primer > Conditionals and Loops > do Loop

do Loop

The statements within a do code block are executed and then the condition of the loop is evaluated. This ensures that the statements will execute at least once. If the condition evaluates to FALSE the loop will halt.

// prototype
// do { statement; } while (expression);

// actual use
int i;
do
{
     PrintInteger(i);
     i++;
} while (i < 5);

author: Ryan Hunt, editor: Charles Feduke


Primer - for Loop

Home > Lyceum > Primer > Conditionals and Loops > for Loop

for Loop

// prototype
// for (expr1; expr2; expr3) { statement; }

Before executing, a for loop is initialized with a set of three expressions:

  • expr1 initializes the counter for the loop. Unlike most languages, the counter cannot be declared in the for loop.
  • expr2 is the condition for the loop's execution. If expr2 evaluates to FALSE the loop will break. This expression can be left blank to create an inifinate loop if you are planning on manually breaking out of the loop using the break statement.
  • expr3 is the increment (or decrement) statement. This will be executed after all the statements in the loop code block are carried out, every time the loop is cycled through.

int i;
for (i = 0; i < 5; i++)
{
     // statements ...
     // this loop will cycle i as 0, 1, 2, 3, and 4
}

author: Ryan Hunt, editor: Charles Feduke


Primer - if/else Statement

Home > Lyceum > Primer > Conditionals and Loops > if/else Statement

if/else Statement

if statements are used to control the flow of code execution. This is best illustrated with an example:

int bAlpha = FALSE;
int bBravo = FALSE;
if (bAlpha)
{
     // statement 1 ...
}
else if (bBravo)
{
     // statement 2 ...
}
else
{
     // statement 3 ...
     // in this example, this is the code that is executed becase
     // both bAlpha and bBravo are FALSE
}

If bAlpha evaluates to TRUE then statement 1 will execute. If it evaluates to FALSE then it will skip to the next if else and evaluate bBravo. If neither bAlpha or bBravo evaluates to TRUE then statement 3 will execute as the default (catch-all).

if statements can also be used alone without if else or else statements:

int bCondition = TRUE;
if (bCondition) PrintString("TRUE!");

If bCondition evaluates to FALSE it will skip PrintString("TRUE!") and move on to the next line of code.

author: Ryan Hunt, editor: Charles Feduke


Primer - switch/case Statement

Home > Lyceum > Primer > Conditionals and Loops > switch/case Statement

switch/case Statement

The switch statement operates like a series of if statements on the same condition. It makes the code clearer and easier to maintain in one value is being tested multiple times. However, only integers can be used as the comparison in a case statement (true integer constants can be used, as long as they are properly defined).

The following examples have the same effect:

int x = 0;
// if block - silly!
if (x == 0)
{
     // statements ...
}
else if (x == 1)
{
     // statements ...
}
else if (x == 2)
{
     // statements ...
}
else
{
     // statements ...
}

// switch block
// the above if/else block is functionally equivalent to the below
// switch statement
switch (x)
{
case 0:
     // statements ...
     // without a break testing would continue
     // in this example if we didn't use a break, the default
     // condition would also evaluate as true if x == 0
     break;
case 1:
     // statements ...
     break;
case 2:
     // statements ...
     break;
default:
     // statements ...
     break;
}

The variable x is passed into the switch statement and compared to the value after the case statement. If none of the case statements equal x then the optional default code block is executed.

It is important to include the break statement at the end of each case code block to escape from of the switch statement, or the proceeding cases will execute also (however, sometimes this is a desired effect).

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Rich Dersheimer, Simon Hassall


Primer - while Loop

Home > Lyceum > Primer > Conditionals and Loops > while Loop

while Loop

// prototype
// while (expression) { statement; }

The while loop tests expression and executes the statements repeatedly as long as expression is TRUE.

If the expression evaluates to FALSE at the beginning of the while loop's execution then the statements are skipped over entirely.

int i;
while (i < 5)
{
     // statements ...
     i++;
}

author: Ryan Hunt, editor: Charles Feduke


Category - Functions

Home > Lyceum > Primer > Functions

Functions

Functions in NWNScript.

Title | Brief Description
Function Declarations | Syntax to define custom functions.
int StartingConditional() | Default code block executed by conversation scripts.
return Statement | Halts function execution and returns a value.
void main() | Default code block executed by scripts.


Primer - Function Declarations

Home > Lyceum > Primer > Functions > Function Declarations

Function Declarations

Functions can be declared (or defined) which can then be invoked (called) from anywhere within the script you defined it in. This has many important uses:

  • Grouping similar code blocks for ease of readability.
  • Cutting down on redundancy when the same statements are to be called repeated from different places in a script.
  • Saving useful routines in an include file.

/* prototype
type functionName([type parameter1,] [...,] [type parameterN])
{
     // code block ...
     return value;
}
*/
  • type is the data type that the function will return. Functions that don't return values should be declared as type void (although you can still use the return statement in them to exit the function).
  • functionName should be alphanumeric names with the first character being a letter or underscore. Underscores are permitted, but not recommend (underscores should be limited to identifier names and constant expressions).
  • The parameters are optional but must be declared with a valid data type, and have unique, well-formed names (alphanumeric, starting with a letter or underscore). These parameters are only available within the scope of the function body, and are not available to code outside the function's execution (scope). Changes to the parameter's value within the function body do not affect the value of the actual variable passed in as the parameter (if a variable was used instead of a literal expression.
  • code block are the statements to actually be executed by the function.
  • return is used to return the value specified after the return statement to the calling function (return can be called with no value to just return the flow of the execution to the calling function).
string CombineStrings(string str1, string str2)
{
     return str1 + str2;
}

author: Ryan Hunt, editor: Charles Feduke


Primer - int StartingConditional()

Home > Lyceum > Primer > Functions > int StartingConditional()

int StartingConditional()

This function declaration is necessary for any script which controls the flow of a conversation file. It returns an int and should have at least one return statement within its code block. Any custom functions used within the StartingConditional() code block should be declared or prototyped before it (above the void StartingConditional() line).

// function declarations
void myProcedure()
{
     // statements ...
}

int StartingConditional()
{
     // main code block
     myProcedure(); // myProcedure is executed
     return 0;
}

author: Ryan Hunt, editor: Charles Feduke


Primer - return Statement

Home > Lyceum > Primer > Functions > return Statement

return Statement

When the return statement is reached within a function it will halt execution and pass the return value to the code block which initially made the function call. If the value being returned does not match the data type of the function, then the compiler will throw a type mismatched error. In the case of void functions, return statements are optional, but can still be used to prematurely halt execution, however if a value is specified after return the compiler will throw a type mismatched error.

// returns a float with the value 0
float someFunction()
{
     return 0.0f;
}

void function return example usage:

// does nothing
void someFunction()
{
     return;
}

author: Ryan Hunt, editor: Charles Feduke


Primer - void main()

Home > Lyceum > Primer > Functions > void main()

void main()

This function declaration is necessary for all script with the exception of conversation scripts, and #include files. All statements to be exectuted should fall within this functions code block. Any custom functions used within the main() code block should be declared before it (above the void main() line) by declaring a function or using a function prototype.

// declaration of a function
int getAge(object oPC)
{
     // ...
     return 0;
}

// function prototype (this function body appears after
// void main()
string getName(object oPC);

// main program execution
void main()
{
     // main code block
     PrintString(getName(GetFirstPC()));
     PrintInteger(getAge(GetFirstPC()));
}

// our "getName" function body appears below (after
// void main() so it was prototyped above)
string getName(object oPC)
{
     return "";
}

author: Ryan Hunt, editor: Charles Feduke


Category - Operators

Home > Lyceum > Primer > Operators

Operators

Operators used in NWNScript.

Title | Brief Description
Arithmatic and String Operators | Operators for numeric expressions and string concatenation.
Assignment | Assignment operators.
Bitwise Operators | Operators for binary arithmetic.
Dot (".") Operator | Accesses public data within structs and certain data types.
Logical Operators/Truth Tests | Operators for conditionals (truth tests)
Parenthesis: Expression Grouping Operator | Operator used for grouping expressions for precendence.


Primer - Arithmatic and String Operators

Home > Lyceum > Primer > Operators > Arithmatic and String Operators

Arithmatic and String Operators

Numeric operators are for addition, subtraction, multiplication, division, and other arithmetic operations. The following operators can be used in the Toolset:

Arithmatic Operators (perform operations on int and float data types)

Symbol | Operation | Description
+ | Addition | Simple addition.
-- | Decrement | Decrements the value of a variable by one.
/ | Division | Simple division. Division by 0 results in the classic "Divide by zero" error.
++ | Increment | Increments the value of a variable by one.
* | Multiplication | Simple product. Multiplication by zero always results in 0, multiplying by 1 always returns the number being multiplied.
% | Modulo | Calculates the remainder of a division statement (not the result; works on integers only).
- | Subtraction | Simple subtraction.

String Operators (perform operations on string data type)

Symbol | Operation | Description
+ | Concatenation | Concatenates, or appends, one string to another.

The '=' assignment is used to assign the value of an expression on its left side to a variable on the right.

int nSomeNumber = 23;
int nAge = nSomeNumber;

If the data type of nSomeNumber does not evaluate to the data type of nAge, then nSomeNumber will need to be cast using the appropriate function (IntToString(), FloatToInt(), or any other type casting/conversion function).

When doing numeric assignments it's important to make sure that the result is stored in the right data type. This is mainly an issue with division in which the decimal value needs to be preserved. If assigned to an int variable, the result will be truncated (everything after the decimal place will be lopped off).

int nResult = 10 / 3;

After the above expression nResult will equal 3.

float nResult = 10 / 3.0;

After this expression nResult will equal 3.333333254

The only operator that will work on string data is the concatenation operator ("+").

string sFullName = "John" + " " + "Doe";
// sFullName will equal "John Doe"
Data casting (converting one data type to another) is important when concatenating string and numeric data. The concatenation operator will only work on string variables. For instance:
// incorrect
int nTime = GetTimeHour();
string sTime = "The time is: " + nTime;

This example will not compile, and will return the error 'ARITHMETIC OPERATION HAS INVALID OPERANDS', because nTime is of type int.

// correct
int nTime = GetTimeHour();
string sTime = "The time is: " + IntToString(nTime);

nTime was cast to string using the IntToString() function - this time it will compile correctly.

Assignment operators do something to the variable being assigned:

int nDays = 4;
// the following is functionally equivalent to
// nDays = nDays + 7;
nDays += 7;
// nDays now equals 11
string sName = "Tom";
sName += " Cassiotis";
// sName now equals "Tom Cassiotis"

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Gerry Raban, Michael Nork


Primer - Assignment

Home > Lyceum > Primer > Operators > Assignment

Assignment

Assignments are used to assign the value of a variable or statement to that of another variable or statement. Assignments also allow some shortcuts; see the example below.

// assignment shortcut
void main()
{
     string sExample = "This is an ";
     sExample += "example";
     // functionally equivalent to typing
     // sExample = sExample + "example";
}
Arithmatic Assignments (perform assignments on int and float data types)

Symbol | Operation | Description
= | Assignment | Assigns the value of an expression to a variable.
+= | Assignment Addition | Assigns the value of the variable being assigned to incremented by a number.
/= | Assignment Division | Assigns the value of the variable being assigned to divided by a number.
%= | Assignment Modulo | Assigns the value of the variable being assigned to modulo by a number.
*= | Assignment Mulitplication | Assigns the value of the variable being assigned to multiplied by a number.
-= | Assignment Subtraction | Assigns the value of the variable being assigned to subtracted by a number.

String Assignments (perform assignments on string data type)

Symbol | Operation | Description
= | Assignment | Assigns the value of an expression to a string variable.
+= | Assignment Concatentation | Assigns the value of the variable being assigned concatenated with an expression.

Bitwise Assignments (perform assignments on int data type)

Symbol | Operation | Description
|= | OR Assignment | Assigns the value of the variable being assigned bitwise OR'd with an expression.
&= | AND Assignment | Assigns the value of the variable being assigned bitwise AND'd with an expression.
^= | XOR (exclusive OR) Assignment | Assigns the value of the variable being assigned bitwise XOR'd with an expression.
<<= | Shift Left Assignment | Assigns the value of the variable being assigned shifted left (multiple) by an expression.
>>= | Shift Right Assignment | Assigns the value of the variable being assigned shifted right (divided) by an expression.
>>>= | Shift Right Zero Fill Assignment | Assigns the value of the variable being assigned shifted right (divided) by an expression, but discarding values shifted off the right side of the resulting value and padding the left side with zeros ("0").

author: Charles Feduke, additional contributor(s): Ryan Hunt


Primer - Bitwise Operators

Home > Lyceum > Primer > Operators > Bitwise Operators

Bitwise Operators

These operators obtain results based on the logical relationships of individual bits within a binary counting system. Bitwise logic is also known as Boolean logic or Boolean mathematics.

Bitwise Operators

Symbol | Operation
| | OR
& | AND
~ | NOT
^ | XOR (exclusive OR)
<< | Shift Left
>> | Shift Right
>>> | Shift Right Zero Fill

The bitwise AND ("&") and bitwise OR ("|") are briefly detailed in the logical operators topic. Additional information on these operators appear below.

For our examples, let's use 8-bit binary numbers to practice. They are represented as 4 bits, a space, and the last four bits.

Example: 0001 1010 = 26

Bitwise 'OR' operator ("|"):

Will compare the bits of two numbers, and return a number with a 1 in every bit that has a 1 in either number. This is basically used to 'add' a bit to a number.

Example: 0001 1010 | 0001 0101 = 0001 1111

Bitwise 'AND' operator ("&"):

Will compare the bits of two numbers, and return a number with a 1 in every bit that has a 1 in both numbers. This is used to see if a bit exists in a number.

Example: 0001 1010 & 0000 1000 = 0000 1000

Bitwise 'NOT' operator ("~"):

Will compare the bits of two numbers, and return a number with 1s where neither number has a 1. This is used to subtract a bit from a number.

Example: 0001 1010 ~ 0100 0011 = 1010 0100

Bitwise 'XOR' operator ("^"):

Will compare the bits of two numbers, and return a number with a 1 in every bit that has a 1 in one number, but not the other. This is used to toggle a bit in a number.

Example: 0001 1010 ^ 0001 0000 = 0000 1010 and 0001 1010 ^ 0000 0100 = 0001 1110

Bitwise 'shift left' operator ("<<"):

Will take the bits of a number and move the 1s to the left a certain number of places. This is used to multiply by powers of 2.

Example: 0001 1010 << 2 = 0110 1000

Bitwise 'shift right' operator (">>"):

Will take the bits of a number and move the 1s to the right a certain number of places. This is used to divide by powers of 2.

Example: 0001 1010 >> 2 = 1000 0110

Bitwise 'shift right zero fill' operator (">>>"):

Will take the bits of a number and move the 1s to the right a certain number of places. The ones and zeros (bits) that pass the right bound of the byte are discarded, and the left side of the byte is padded with zeros (zero bits). This is used to divide by powers of 2.

Example: 0100 1111 >>> 2 = 0001 0011

Why on earth do I want to know this?

The trick to using bitwise arithmetic is to stop thinking of the numbers as numbers, but as groups of Yes/No flags. Each bit can represent a TRUE/FALSE value which you would check against.

To use this effectively, you would have some preset values like this:

int QUEST_ONE_DONE = 1;
int QUEST_TWO_DONE = 2;
int QUEST_THREE_DONE = 4;
int QUEST_FOUR_DONE = 8;

Notice that each value is a power of 2. This means it can be represented by a binary number with only a single 1 in place. That place value is the location for the 'flag' that represents a certain TRUE/FALSE value.

A practical example using the values set above.

  1. I want to know if a PC has done a particular quest.
  2. I want to eliminate the number of variables stored on the PC that depict the state of the quests.
  3. I want a cleaner, more efficient way of checking the status of my quests.
  4. I check a local int on the PC that I have called 'nQuestFlags' with the following line:
    5. // assumes the following code executes in one of the PC's
// events; if not use, the appropriate Get* function to retrieve
// the PC (in place of OBJECT_SELF)
int nQuestFlags = GetLocalInt(OBJECT_SELF, "nQuestFlags");
if (nQuestFlags & QUEST_TWO_DONE)
{
     // he did the quest
}
else
{
     // he did not do the quest
}
  5. When the PC completes quest 3, I add the flag with this line:
    6. // again, assumes this executes in one of the PC's events
// as OBJECT_SELF refers to the PC
nQuestFlags = nQuestFlags | QUEST_THREE_DONE;
SetLocalInt(OBJECT_SELF, "nQuestFlags", nQuestFlags);

One final example to demonstrate the flexibility that bitwise operators and arithmatic provide appears below.

// prototype
void testQuest(int nQuests);
// pseudo-constants (bit flags)
int QUEST_ONE_DONE = 1;
int QUEST_TWO_DONE = 2;
int QUEST_THREE_DONE = 4;
int QUEST_FOUR_DONE = 8;

void main()
{
    // demonstrate the flexibility of bitwise operations
    int nQuest = 0;
    // let's complete quest one
    nQuest = nQuest | QUEST_ONE_DONE;
    // let's now complete quest three
    nQuest |= QUEST_THREE_DONE; // same as "nQuest = nQuest | QUEST_THREE_DONE;"
    // what does the log print out?
    testQuest(nQuest);
    // examining the log, you would see
    /*
        Quest one complete
        Quest three complete
    */
    testQuest(QUEST_ONE_DONE | QUEST_TWO_DONE | QUEST_THREE_DONE | QUEST_FOUR_DONE);
    // examining the log for the above statement, you would see
    /*
        Quest one complete
        Quest two complete
        Quest three complete
        Quest four complete
    */
}

void testQuest(int nQuests)
{
    // writes the completed quest to the log file
    if (nQuests & QUEST_ONE_DONE)
        PrintString("Quest one complete");
    if (nQuests & QUEST_TWO_DONE)
        PrintString("Quest two complete");
    if (nQuests & QUEST_THREE_DONE)
        PrintString("Quest three complete");
    if (nQuests & QUEST_FOUR_DONE)
        PrintString("Quest four complete");
}
Bitwise AND and OR in logical evaluations (if/then-type tests)

Instead of using the short-circuit logical evaluators and ("&&") and or ("||") you can use bitwise AND ("&") and OR ("|") in their place, assuming the default NWN values of TRUE ("1") and FALSE ("0") are used. Of course using these operators on statements that do not return a TRUE or FALSE will perform mathematical operations that will not give you the results you seek unless you are specifically trying to use bitwise arithmatic (see above).

// these two simple functions are used for demonstrating bitwise
// AND and OR
int LogicalTestOne(int iReturn)
{
   PrintString("Test One Ran...");
   return iReturn;
}

int LogicalTestTwo(int iReturn)
{
   PrintString("Test Two Ran...");
   return iReturn;
}

The following code sample uses the above defined functions and outputs to the log:

void main()
{
     if (LogicalTestOne(1) & LogicalTestTwo(2))
     {
          PrintString("Both tests returned true.");
     }
}

Examining the log, we find the following:

Test One Ran...
Test Two Ran...

But we expect to see "Both tests returned true." in the log file as well! What happened?

To understand this you need to understand what the values of 1 and 2 are and how the bitwise operator works. First the value of 1 in binary is 0001 and the value of 2 is 0010. The bitwise AND returns a 1 or a 0 if both positions of the comparitors are 1. in the case of 1 & 2 the result is 0:

0001
0010
----
0000

More bitwise fun comes with the | operator. What the OR operator does is return a 1 if either of the bits in the position are 1. So evaluating 0 | 2 results in:

0000
0010
----
0010

Which is 2. Now for the fun part, by definition 0 is FALSE and all other values resolve to NOT-FALSE or TRUE (even negative numbers; only 0 is FALSE). This can be evidenced by running the script with the values of 2 & 3:

0010
0011
----
0010

And 0010 is 2 which resolves to TRUE. The danger here occurs when you test numbers like 1 & 2:

0001
0010
----
0000

Or 3 & 4:

0011
0100
----
0000

Or 7 & 8:

0111
1000
----
0000

However, going back to my original note, IF you stick with the predefined values (as defined in nwscript.nss) of FALSE (0) and TRUE (1) you can safely exchange && with &. While it is true that the bitwise operators are different creatures than logical operators, informed developers can and do exchange them. The secret is understanding what they do.

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Joseph Berkley


Primer - Dot (".") Operator

Home > Lyceum > Primer > Operators > Dot (".") Operator

Dot (".") Operator

The dot operator can be used to gain access to public data within a struct or some data types like vectors.

// working with a struct
struct strName
{
     string First;
     string Last;
};

void main()
{
     struct strName test;

     // dot operator assignment
     test.First = "Bob";
     test.Last = "Dobbs";

     // dot operator access

     string sFname = test.First;
     string sLname = test.Last;

     // working with a vector data type
     vector v = Vector(1.0f, 2.0f, 3.0f);
     v.x = 12.0f;
}

author: Ryan Hunt, editor: Charles Feduke


Primer - Logical Operators/Truth Tests

Home > Lyceum > Primer > Operators > Logical Operators/Truth Tests

Logical Operators/Truth Tests

Logical operators perform Boolean (TRUE/FALSE) comparisons on an expression. Since NWNScript does not support a strict Boolean data type, the result of a logical operation will be an int value of either FALSE (0) or TRUE (0).

Logical Operators

Symbol | Conditional
== | Equality test ("is equal to").
!= | Inequality test ("is not equal to").
< | Less than equality test.
> | Greater than equality test.
<= | Less than or equal to equality test.
>= | Greater than or equal to equality test.
&& | Short circuit logical AND.
& | Bitwise AND.
|| | Short circuit logical OR.
| | Bitwise OR.
! | Logical NOT.

The following expressions all equate to TRUE or 1:

// data
int nValue1 = 3;
int nValue2 = 3;

// expressions
int bTest = nValue1 == nValue2;
int bTest = nValue1 != 0;
int bTest = (nValue1 == 3) && (nValue2 != 0);
int bTest = (nValue1 == 3) || (nValue2 == 0);

The following examples all equate to FALSE or 0:

// data
int nValue1 = 3;
int nValue2 = 3;

// expressions
int bTest = nValue1 != nValue2;
int bTest = nValue1 == 0;
int bTest = (nValue1 == 3) && (nValue2 == 0);
int bTest = (nValue1 != 3) || (nValue2 == 0);

One good use for logical operators is to test multiple expressions in a single if statement. This will prevent unnecessary nested if statements which make code difficult to follow, and in some cases slower.

The Logical NOT operator is an exception because it's a unary operator (only operates on a single expression):

int bRunning = TRUE;
int bRunTest = !bRunning;

In this example bRunTest will equate to 0 or FALSE.

It should be noted that && and || are considered short-circuit operators: that is, in an && conditional the first condition to evaluate as FALSE from left-to-right stops evaluation of the remaining statements, and in an || conditional the first condition to evaluate as TRUE from left-to-right stops evaluation of the remaining statements. What does this mean? Suppose you had two functions and either function returns TRUE or FALSE:

int bFunction1()
{
     // check to see if a specific item is in the player's inventory
     int bRet = FALSE;
     bRet = GetItemPossessedBy(OBJECT_SELF, "some_item");
     PrintInteger(bRet); // out to the log file
     return bRet;
}

int bFunction2()
{
     // moves the camera around
     SetCameraFacing(270.0f, CAMERA_TRANSITION_TYPE_SLOW);
     // returns TRUE for absolutely no reason
     return TRUE;
}

bFunction2, above, has what is known as a side effect. That means that although it is a function, it also causes something else to happen as well. When we use a short circuit AND operator (&&)...

void main()
{
     if (bFunction1() && bFunction2())
     {
          // do something here
     }
}

If OBJECT_SELF does not have the item "some_item" then bFunction2() will never be called, thus the camera angle will never change. Contrast that to the following:

void main()
{
     if (bFunction1() & bFunction2())
     {
          // do something
     }
}

In this second example, the camera angle will be changed because we are not using a short circuit operator; the entire statement will be evaluated.

Don't get "==" confused with the assignment operator "="! Assigning a statement to a value always returns TRUE and is a common source of bugs in code.

int nNumber = 4;
if (nNumber = 5) // assignment; assigns value and returns TRUE!
{
     PrintInt(nNumber);
}
// this will print "5" to the log file because nNumber is assigned
// the value of 5 during the "if" test
// if (nNumber == 5) is what should really appear above

Finally because "==", "!=", "<", ">", "<=", and ">=" return TRUE or FALSE, you can use them for shortcuts when assigning values to boolean (TRUE/FALSE) integers. For example, the following code:

int nNumber = 3;
int bCondition = FALSE;
if (nNumber == 3)
     bCondition = TRUE;
else
     bCondition = FALSE;

can become a single line of code:

int nNumber = 3;
int bCondition = nNumber == 3;

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Bradley Beacham


Primer - Parenthesis: Expression Grouping Operator

Home > Lyceum > Primer > Operators > Parenthesis: Expression Grouping Operator

Parenthesis: Expression Grouping Operator

Parenthesis are used for grouping separate expressions to force precedence or just for readability.

int number = (2 + 3) * (4 + 5);
// number = 45
2 + (3 * (4 + 5));
// number = 29
2 + (3 * 4) + 5
// number = 19

author: Ryan Hunt, editor: Charles Feduke


Tutoria Categories - Tutorial

Home > Lyceum > チュートリアル

チュートリアル

タイトル | 概要
Advanced Scripting | Advanced scripting tutorials.
スクリプト入門 | 初心者向けのスクリプト作成チュートリアル
Cut-scenes | Cut-scenes for in-game storyline.
Toolset | Aurora toolset tutorials (non-scripting).
Writing a Module | This tutorial follows the design of a module. The module can be downloaded and played in NWN, then the tutorial read to see how everything is done. This tutorial is intended for beginning module designers with little or no scripting experience.

JP team: katsu794


Category - Advanced Scripting

Home > Lyceum > Tutorial > Advanced Scripting

Advanced Scripting

Advanced scripting tutorials.

Title | Brief Description
Celowin - Part X: Henchmen | Tenth in a series of tutorials teaching the fundamentals of NWNScript programming to a complete beginner.
nwscript.nss - Playing with Fire and Custom Constants | A short tutorial on nwscript.nss and how to create real custom constants in the toolset.
Graziano Lenzi - Custom WalkWayPoints | Better control of NPCs with a custom WalkWayPoints function.


Tutorial - Celowin - Part X: Henchmen

Home > Lyceum > Tutorial > スクリプト応用 > Celowin - パート １０: ヘンチマン

Celowin - パート １０: ヘンチマン

Preamble

The purpose of this sequence of lessons is to take a complete beginner to programming, and teach him or her how to use NWNScript to write modules. The early lessons will be very basic, and anyone that has done any coding at all will be able to skip over them. The goal here is to make the lessons so that even the people that just shudder at any type of code can learn.

Feel free to post these lessons on any forum, print them out, or modify them. However, just give me credit for doing them.

Any comments on these lessons, good or bad, can be sent to me, Celowin.

I am going to assume that anyone looking at these lessons has at least played around with the Aurora Toolset a bit. If there is enough feedback that people don't know how to do the simple placements that I have in these lessons, I will consider spelling out in more detail what needs to be done.

For those of you that missed earlier lessons and are interested in looking them up, they have all been placed into the sticky Scripting FAQ and Tutorials post in the Bioware Scripting Forum. [They're also being mirrored here in the NWN Lexicon's Lyceum - ed.].

このレッスンにおけるいくつかの注意点

このレッスンは、今までの全てのレッスンとはかなり異なったものになります。実際、私はこのレッスンを書くのに少し躊躇しました。なぜなら、このレッスンにはスクリプト作成に関することが余り含まれていないからです。ほんんどは、BioWareが作った関数をどこで使うかを知ることについて書かれています。しかし、このことについてかなり多くの質問があるので私は降参することに決めました。

今回は、ヘンチマンの性能レベルを上げるためにBioWareの関数を書き直しました。それには以下の理由がありました。

  • 何かもっと一般的なことをしたかったからです。BioWareの関数には、変更が難しいという固有の制限があります。
  • I didn't like the naming convention needed for BioWare's function. It doesn't make a lot of sense to me.
  • Boredom is a powerful motivator. ヘンチマンを作成するプロセスのほとんどは退屈なので、私は何か面白いことをしたかったのです。
  • Er, well... I couldn't find BioWare's function at first. I pretty much had the whole thing written at the point where I found the right place to look.

また、モジュールにヘンチマンを作成することは、例えステップ・バイ・ステップの作業であっても、つまらないものではないことも心に止めておいて下さい。基本的なヘンチマンを１つ作成するだけでも、２、３時間は要しますし、面白い会話を作ろうと思えば更に時間がかかります。

ヘンチマンの拡張に取り組んでいる人は他にもいます。AIや改善したり、それをスムーズに導入する方法、そして複数のヘンチマンが私が聞いているいくつかの例です。このレッスンでは基本的なヘンチマンを作りますので、その他の修正は自己責任で行って下さい。

Step 1: Create the Lowest Level Version

The first thing to do is to create the "first" henchman, at the lowest level. (For the official compaign, the lowest level henchmen are level 4, but there is no reason here why you need to stick to that). My suggestion on handling this (and all higher level versions) is to start out with a PC. Create it using the "Create New Character" in the game, and then put the character into a module with a "level up" lever. Here's how:

Create a simple module, with one tiny area. Insert a placeable lever, and into the OnUsed script, attach the following:

// On Used Script:  tm_xplever_ou
// Award the lever puller with tons of xp.
// To be used only for testing purposes, remove from final
// module.
//
// Written By: Celowin
// Last Updated: 7/25/02
//
void main()
{
  object oPC = GetLastUsedBy();
  GiveXPToCreature(oPC, 10000);
}

Save everything, and start up the module with your "PC version" of the henchman. Pull the lever, and start leveling up your character. Pick all the skills, spells, feats, etc. as you feel fit the character. Then, when you have the "henchman" to the appropriate level for the first version, stop and write everything down.

Remember to save the game (we'll be coming back here later), and then open up your "real" module, where you want your henchman, in the toolset. Create your henchman, giving it all the abilities that we figured out using the XP lever.

From here, on, to stop using the term "your henchman," I'm going to be using the name "Coric Galroud." Of course, there is nothing magical about this name, you can call it whatever you want. I do, however, suggest you keep the first name relatively short, about 10 characters maximum.

Important! Badger Alert! I can't count the number of times I've seen a message like this, "Help! I made a henchman, and when it leveled up it turned into a badger!" In almost every single case, this is because the tag and/or blueprint ResRef for the NPC was set wrong. [When asked to create certain object classes, the engine picks defaults if it can't find the blueprint ResRef you specified... the default creature is a badger. For no particular reason that makes me giggle - ed.]

Again, I'm not using the BioWare level up functions, so my naming conventions are a little bit different from theirs. The tag for the henchman should be the first name, but in all caps. In my case, the tag is CORIC. The blueprint ResRef (found on the Advanced tab) is the name in all lower case, plus the two digit version of the henchman level. Again, in my case for a level 4 Coric, the blueprint ResRef would be coric04.

I can't stress this enough. Tag = uppercase, blueprint ResRef = lowercase with level.

One more time –

  • Tag: CORIC
  • Blueprint ResRef: coric04

Moving on, other things to set on our henchman:

  • Make sure the faction is set to "Merchant"
  • Make sure the No Permanent Death box is checked.
  • Equip the henchman. Start him out with a melee weapon equipped, but have a ranged weapon in inventory, with plenty of ammunition.
  • There will be lots of conversation with the henchman. Make certain it has a portrait.
  • Make sure perception range is set to Default.

Now, we need to set up the basic scripts for our henchman. I'm just going to use a "plug and play" approach here, we're not going to delve into exactly how these scripts work. All these scripts can be selected from the drop down menu, or else the names typed in manually. (Of course, double check you have the name exactly right if you type it.)

A couple of notes: While BioWare references nw_ch_aca for the OnRested script, this script doesn't seem to exist. I left it blank, and I don't really notice any difference in behavior. Further, the nw_ch_acd script does absolutely nothing. I put it in for reference, but you can safely leave it out if you're not planning on modifying your henchman behavior.

  • OnBlocked: nw_ch_ace
  • OnCombatRoundEnd: nw_ch_ac3
  • OnConversation: nw_ch_ac4
  • OnDamaged: nw_ch_ac6
  • OnDeath: nw_ch_ac7
  • OnDisturbed: nw_ch_ac8
  • OnHeartbeat: nw_ch_ac1
  • OnPerception: nw_ch_ac2
  • OnPhysicalAttacked: nw_ch_ac5
  • OnRested: Leave Blank
  • OnSpawn: nw_ch_ac9
  • OnSpellCastAt: nw_ch_acb
  • OnUserDefined: nw_ch_acd

OK, check one more time that your tag and blueprint ResRef are set properly, and also make certain that the henchman actually has the feats to use the equipment you've given it. Once everything is set, it is time to work on the conversation.

Step 2: Setting up the Conversation

Actually, before going too much further, I would 'OK' out of the NPC, and save the module. There is no sense in losing all of your hard work if the editor crashes. After that, start back up, open the NPC, and edit the conversation. [If you're working on a big project, I would go further, and make a copy of the .mod file now and then. Better safe than corrupted beyond repair - ed.]

This is probably the most complicated part, because there are lots of annoying little details for the conversation. I stripped the conversation down about as far as it could go, down to just "do this," and there are still a lot of nodes.

Anyway, be sure you have a bit of time to spend setting this up, and edit the tree to look like this. Note that the H3: type things are just so I can reference specific conversation nodes in the tutorial, and need not be typed in. Hxx is something the henchman is saying, Pxx is something the player is saying. [I've typed this into the conversation editor,and prepared a piccy for you. View the source of this page for the original ASCII text. NB. P13-15,17-25 are all followed by a link to node H9, which I've collapsed for convenience. - ed.]

Note, of course, that I would never actually use a conversation this stripped down in an actual adventure. Your henchman would have zero personality. Also, I haven't put any provisions for "memory" of the henchman.

OK, the basic tree is set up, now we have to attach conditions and actions to it. Again, I'm just going to use the BioWare functions as much as possible. A few places I've made my own, but I'll deal with those last. (Note: A few of the BioWare functions reference journal updates. While it would be good form to comment those lines out, it isn't strictly necessary. Just be aware that if you "Build" your module, the editor will throw a hissy fit over the missing journal entries. Ignore it, the module will still run fine.)

  • H1, Text Appears When: tm_hirecheck (see below)
  • H2, Actions Taken: nw_ch_action_13
  • H4, Text Appears When: tm_othercheck (see below)
  • P4, Actions Taken: nw_ch_remove
  • P6, Text Appears When: tm_levcheck (see below)
  • H7, Actions Taken: tm_henchlev (see below)
  • P8, Text Appears When: nw_ch_comrange
  • P8, Actions Taken: nw_ch_gomelee
  • P11, Text Appears When: nw_ch_commelee
  • P11, Actions Taken: nw_ch_goranged
  • P13, Actions Taken: nw_ch_dist_6
  • P14, Actions Taken: nw_ch_dist_12
  • P15, Actions Taken: nw_ch_dist_18
  • P16, Text Appears When: nw_ch_heal_0
  • P17, Actions Taken: nw_ch_heal_75
  • P18, Actions Taken: nw_ch_heal_50
  • P19, Actions Taken: nw_ch_heal_25
  • P20, Text Appears When: nw_ch_yes_srch
  • P20, Actions Taken: nw_ch_srch_off
  • P21, Text Appears When: nw_ch_no_srch
  • P21, Actions Taken: nw_ch_srch_on
  • P22, Text Appears When: nw_ch_no_stlth
  • P22, Actions Taken: nw_ch_stlth_on
  • P23, Text Appears When: nw_ch_yes_stlth
  • P23, Actions Taken: nw_ch_stlth_off
  • P24, Text Appears When: nw_ch_no_locks
  • P24, Actions Taken: nw_ch_lock_on
  • P25, Text Appears When: nw_ch_yes_locks
  • P25, Actions Taken: nw_ch_lock_off

Step 3: Writing Our Functions

OK, there were a few functions that we need up there for the conversation. All but the level up one is very easy, so I'll start with those.

For node H1: tm_hirecheck

// Starting Conditional script: tm_hirecheck
// Should only be placed in a henchman conversation file.
// This function returns TRUE if the henchman does not have a master.
//
// Written by: Celowin
// Last Updated: 7/25/02
//
int StartingConditional()
{
  int nResult;
  nResult = GetMaster() == OBJECT_INVALID;
  return nResult;
}

For node H4: tm_othercheck

// Starting Conditional script: tm_othercheck
// Should only be placed in a henchman conversation file.
// This function returns TRUE if the PC speaking is not the henchman's
// current master.
//
// Written by: Celowin
// Last Updated: 7/25/02
//
int StartingConditional()
{
  int nResult;
  nResult = GetPCSpeaker() != GetMaster();
  return nResult;
}

Now for the hard stuff. I'm going to be using a few functions multiple times, so I'm going to write a library. People that went through lesson 9 should know what these are. If you are just coming here to learn about henchmen, a quick rundown: Put in the following as a script tm_henchlib, and save it, not attached to any event handle. It won't compile properly, you'll get an error message like NO VOID MAIN() IN SCRIPT. Just ignore that message.

A further note. I've made it so that it is easy to change three properties of henchmen: the minimum level, the maximum level, and how many levels behind the PC the henchman will "lag." For example, say you're writing a module for characters of level 4-10. You want to give your characters a bit of a boost early on, so you set the minimum henchman level to 6. Later on, you want less of an impact from henchmen, so you set that they will lag 2 levels behind the PCs. And just in case the PCs get more XP than you anticipate, you set the maximum level on the henchman to 10.

In that case, when a level 4 PC gets the first henchman, it will start out at level 6. It will remain level 6 until the PC hits level 9... then the henchman becomes level 7. The henchman will always remain 2 levels behind the PC until the PC hits level 12. From then on, the henchman will always be level 10.

Anyway, to set these things, just alter the numbers at the start of the tm_henchlib file you're about to create:

// My henchman routines: tm_henchlib
//
// Written by: Celowin
// Last updated: 7/25/02

#include "nw_i0_henchman"

// Defines how many levels behind the PC the henchman lags
// Minimum of 0
int HENCH_LAG = 1;

// Defines the lowest level the henchman can be
// Minimum of 1, Maximum of 20
int HENCH_MIN = 4;

// Defines the highest level the henchman can be
// Minimum of HENCHMIN, Maximum of 20
int HENCH_MAX = 14;

// This function figures out what level the henchman
// "should" be, based on the min, max, and lag
// numbers above, as well as the PC level.
int GetTargetLevel(object oHench = OBJECT_SELF)
{
  // Find the PC's level.
  int nMasterLevel = GetHitDice(GetMaster(oHench));
  // Apply the lag.
  int nTargetLevel = nMasterLevel-HENCH_LAG;
  // If that is less than the minimum level, the
  // henchman should be that minimum level.
  if (nTargetLevel < HENCH_MIN)
    nTargetLevel = HENCH_MIN;
  // If the level is over the max, cap the level
  // to that max.
  if (nTargetLevel > HENCH_MAX)
    nTargetLevel = HENCH_MAX;
  return nTargetLevel;
}

// This function checks to see if the henchman
// is ready to level up.
int GetReadyToLevel(object oHench = OBJECT_SELF)
{
  // Find both the current henchman level, and
  // what level the henchman should be.
  int nTargetLevel = GetTargetLevel(oHench);
  int nCurrentLevel = GetHitDice(oHench);

  // If the current level is too low, it is ready
  // to level up.
  if (nCurrentLevel < nTargetLevel)
    return TRUE;
  else
    return FALSE;
}

// This is the biggie.  This is the function to
// actually level up the henchman.
void LevelHench(object oHench = OBJECT_SELF)
{
  // Find the desired level.
  int nTargetLevel = GetTargetLevel(oHench);

  // Whee!  Fun with string manipulation!
  // All this is working to find the appropriate blueprint ResRef
  // to create the "new and improved" henchman.
  string sNewBlueprint = GetTag(oHench);
  sNewBlueprint = GetStringLowerCase(sNewBlueprint);
  if (nTargetLevel <= 9)
    sNewBlueprint = sNewBlueprint + "0";
  sNewBlueprint = sNewBlueprint + IntToString(nTargetLevel);

  // Create the new henchman.
  // There will be a "fade in" of the new one and a "fade out"
  // of the old.
  object oNewHench = CreateObject(OBJECT_TYPE_CREATURE, sNewBlueprint, GetLocation(oHench));

  // Get rid of the old henchman.  You're fired!
  object oMaster = GetMaster(oHench);
  RemoveHenchman(oMaster, oHench);

  // Copy our desired behavior patterns to the new henchman.
  CopyLocals(oHench, oNewHench);
  AssignCommand(oNewHench,SetAssociateListenPatterns());

  // Add in our new henchman.
  AddHenchman(oMaster,oNewHench);

  // Take out the trash.
  DestroyObject(oHench);
}

Now that we have that library set up, the rest of the scripts are easy, and just involve calling the appropriate functions from the library.

For node P6: tm_levcheck

// Starting Conditional script: tm_henchlev
// Should only be put into a conversation file for a henchman
//
// Returns TRUE if the henchman is ready to level up.

#include "tm_henchlib"

int StartingConditional()
{
  int nResult;
  object oHench = GetHenchman(GetPCSpeaker());
  nResult = GetReadyToLevel(oHench) == TRUE;
  return nResult;
}

For node H7: tm_henchlev

// Action Taken script: tm_henchlev
// To be put in a henchman conversation.
//
// This amazingly complicated script causes a henchman to level up.

#include "tm_henchlib"

void main()
{
  LevelHench();
}

OK, enough for the conversation. Save the conversation, and save the module.

Step 4: Creating Higher Level Versions of the Henchman

At this point, our "base" henchman is completely done. It has equipment, stats, the appropriate tag and blueprint ResRef, and a conversation. Now, we need to create all the henchman that it will "level up" into.

Go back to the save game from when we first found the stats for our henchman. Now, using the lever for XP, keep levelling up, and write down the changes as you go. You don't need to write down absolutely everything, but at least write down the information from the "changes" window at the end of the level up process.

For example, if I'm working on a fighter henchman, I might write down something like:

Lev 4: Str +1, HP +14, Disc +1, Parry +1, Spec(longsword)

And so on for each level up, until I'm at the max henchman level.

Now, close out the game, and start up the toolset. Go to your henchman, and add him to your custom palette.

On the palette, select "Edit Copy." Start putting in changes to the next higher level. Update the character level, feats, skills... everything your wrote down from before.

Warning! Badger alert! Remember to update the blueprint ResRef to the appropriate value. You shouldn't have to change the tag, but the blueprint ResRef needs to be changed to the coric05 format. Also, remember that you have to change the class levels for your henchman to account for the new levels you're granting.

Yet another reminder –

  • Tag: CORIC
  • Blueprint ResRef: coric12

Keep doing this. Each time you have the new level in, edit another copy and update it to the next level, until you have all your henchman versions set up.

Now, go back through the henchmen and tweak their equipment, giving them more level appropriate stuff. Starting at level 7, their ranged weapons should have the Unlimited Ammunition ability. (Unfortunately, that makes the weapon level 7 minimum, so it can't be given to lower level henchmen). Stats, spells, skills, feats, levels, blueprint ResRef, and equipment. Remember to change all these things for each new copy of the henchman. Then, we're almost done.

Step 5: Module Properties

Almost everything is set to go at this point. There are just a few minor things to add to the module to make things work.

First, at whatever "home base" place you want in your module, add a waypoint with tag NW_DEATH_TEMPLE. This is where the henchman will return to when it dies.

Second, we need to add a script to have the henchman level up when the PC does. Go to Edit -> Module Properties -> Events -> OnPlayerLevelUp, and put in the following script:

// OnPlayerLevelUp script:  tm_levelup
//
// When a player levels, this checks to see if the henchman is ready to
// level up as well, and takes necessary action.

#include "tm_henchlib"

void main()
{
  // Find the leveling PC and its henchman
  object oPC = GetPCLevellingUp();
  object oHench = GetHenchman(oPC);

  if (GetIsObjectValid(oHench))  // Don't go on if no henchman
  {
    if (GetReadyToLevel(oHench)) // Don't go on if not time to level
      LevelHench(oHench);
  }
}

Conclusion

And that should do it. If you've followed everything, your henchman should pretty much behave exactly like the ones in the official campaign. (No story or quests, of course. You'll have to come up with those on your own.) You have at least a bit more flexibility on henchman level up behavior if you want to exercise it.

Starting next lesson, I'm going to be taking a slightly different tack. I've discussed my plans in a few places, I won't reiterate them here. Anyway, we'll see how it goes, and whether people will like the new format.

Now that all the real basics are covered, I don't feel quite the pressure to churn out lessons. I'll continue to write, but probably at a lower pace. I'm thinking maybe one a week... since Wednesdays we've been getting new stuff from BioWare, maybe I'll try to schedule putting out a new lesson every Friday. That way you have something to play with over the weekend.

?author: Celowin, editor: Charles Feduke, additional contributor(s): Steve Kubere, JP team: katsu794


Tutorial - nwscript.nss - Playing with Fire and Custom Constants

Home > Lyceum > Tutorial > Advanced Scripting > nwscript.nss - Playing with Fire and Custom Constants

nwscript.nss - Playing with Fire and Custom Constants

Introduction

Editors Note: nwscript.nss is no longer in the override directory. Since version 1.29, you can include your own versions of the nwscript.nss when distributing a module without ruining the NWN installation. That solves the problem of sharing your custom constants used in your module with others. The only downside to this is that when you build the module, it will attempt to compile nwscript.nss as well. It, of course, fails and the build log gives an error. However, all the actual module scripts still compile fine with the new constants defined in your custom nwscript.nss file.

This is a short tutorial on how to get custom constants to appear in the 'Constants' section of the Toolset editor. Along the way, I'll describe the nwscript.nss file, how you can manipulate it, and some of the many dangers of doing so.

Lasciate ogni speranza, voi ch'entrate - Abandon All Hope, Ye Who Enter Here

Warning: it is entirely possible to knacker your nwscript.nss sufficiently to make using the Script Editor impossible, and your game unpatchable. (I know, I've done both). If you're going to play with nwscript.nss - and why not - BACK IT UP NOW... and back it up with your current patch version, too. From here on out, I'm going to assume you have a backup for your current and every future patch, know how to recover it, and wouldn't dream of whining to me when your installation goes tits-up and has to be reinstalled from scratch. Trust me, you won't like my response.

What Is It, Where Do I Find It?

nwscript.nss is a special NWNScript source file, that's used by the Aurora Toolset for two principal purposes:

  1. Function descriptions - all that helpful text that appears in the Script Editor when you've highlighted a function in the browser pane comes from nwscript.nss. You'll demonstrate this to yourself in a minute.
  2. Constant declarations - all the 'built-in' constants that appear in the Script Editor browser when you press the 'Constants' button come from nwscript.nss. Any supposedly invariant constants you want to create in include files just get lumped in with all your other variables.

Unlike every other script that comes with the game, however, nwscript.nss is not compiled. Yes, you read correctly, its never compiled. In fact the game engine itself doesn't even need it. You can test this out pretty easily. Since the first patch the game's used the copy of nwscript.nss that you'll find in the /override folder. Delete everything in the file except any single constant definition, and save it again, still in the /override folder. Now play the game... it plays fine. The same can't be said for the Script Editor, however, which is now a little bit reluctant to compile your scripts. Restore the backup you took before deleting. [See section with oh-so-erudite, and not-at-all-cliched heading above if you didn't take a backup.]

Some of the Comments Could Use Some Expansion

Boy, could they ever. I'm hugely grateful that BioWare produced the game, and totally understand that writing documentation is utterly, utterly boring, especially for a cool project where you could be writing code involving EffectDeath instead; that's what the NWN Lexicon project is all about - spreading the documentation load amongst hopeless fanboys (present company included). Happily, you can replace any comment you like by editing nwscript.nss. It's as simple as that. Why not pick a function and try it? Since these are just comments, there's not much to go wrong here (but see below), so knock yourself out. Note: there's a possibility that the NWN Lexicon project may, in future, produce an 'enhanced' nwscript.nss. Maybe. You're probably better off just using the .chm help file, though.

So why isn't the file compiled? After all, there are all these commented function declarations. Well, those functions are all built-in to the engine, compiled in Edmonton, buried in the code functions. You can't change them. Unlike those pesky nw_i0_generic-type included functions, they're graven in stone (until the next patch) and you don't get to see the source, either, unless Muzyka and Zeschuk are writing your paycheck.

Constants, Constants, Show me the Constants

One of the minor irritations I found with the script editor is that manifest constants defined in included libraries appear in the 'Variables' section of the browser, behave like variables (which they are, I guess). There's no way to make them real replace-them-at-compile-time constants. Officially. But nwscript.nss is where the Toolset compiler gets its list of constants, and nwscript.nss is just another text file, so you can add your own.

Why is this not a horribly bad idea?
Because all the constants are replaced by their values at compile-time, it's perfectly safe to do this with your custom constants if you want to distribute your module to the general NWN populace.
Why does this suck a bit?
Because no-one else can compile your source code without your custom nwscript.nss, making it hard to evolve or reuse your work, bugfix or treat it like the open source that it ought to be.
Why does it suck less than it might?
It's a good idea to keep a copy of any constant you add into your nwscript.nss to an includable script as well... partly because you're probably going to have to recreate nwscript.nss after a patch, but mostly because then you can include a commented '#include' statement in your source code, so all the nice re-users of your fine code can re-use your code.
Is there anything else to do with this?
You could implement a half-hearted copy-protection with this, but you would be a plonker to bother.

Details! Details! I want Details!

  1. Open nwscript.nss.
  2. Add a constant, like: int ISK_MASK_WITLESS = 0x1;
  3. Save nwscript.nss.
  4. Use your constant in your other scripts.
  5. Er... that's it.

So What Can Go Wrong?

Aside from inconveniencing re-users of your code, there's only a couple of ways to really mess yourself up (that I've found, anyway). First, you can render the Script Editor incapable of compiling. Easily fixed: restore your backup. The less obvious, and more irksome problem is that the updater is incremental (that's how it patches 30Mb of files with a 3Mb patch). To be able to patch a file, the updater has to verify that the old version is exactly the same as the version it expects to patch... otherwise things could go horribly, horribly wrong. If you've gone and edited nwscript.nss, and those lovely folks at BioWare implement some new engine function (SetMapVisible(FALSE), please), the updater will barf when it gets to your munged file. Easily fixed: restore your backup to the patch target version.

Conclusion

That's all folks. It turned out there wasn't a lot to say about nwscript.nss, except "you can change it", and "be careful". Never mind, I had fun writing this, hope you enjoyed reading it. If you have any feedback (positive, negative or bipolar), you can reach me as Iskander on the NWN boards.

author: Iskander Merriman, editor: Charles Feduke, additional contributor(s): Diego Chiodini, Joseph Berkley, Andrew Hart


Tutorial - Graziano Lenzi - Custom WalkWayPoints

Home > Lyceum > Tutorial > Advanced Scripting > Graziano Lenzi - Custom WalkWayPoints

Graziano Lenzi - Custom WalkWayPoints

Custom WalkWayPoints

The following script evolved from the need of more intelligent way for NPCs to move with waypoints. Normally when an NPC is walking waypoints but is interrupted between points (i.e. engages in combat), then the NPC goes to the nearest waypoint and resumes walking the points. This seems normal at first, but what if you actually wanted the NPC to continue pressing forward even if they are near the previous waypoint?

The specific example used is for a simple quest. A caravan of NPCs must be moved from one trading post to another, directed by the PC. Ten waypoints were used, and bandits attacked the caravan in six different places; the chances that the caravan would make no progress after an attack and frustrating the player by returning to the previous waypoint were great.

The following NPCs were created for this particular quest:

  • Caravan Leader (walks the waypoints and interacts with the PC by direct commands in conversation)
  • Caravan Men (follows the Caravan Leader)

Events are scripted to run as follows:

  • OnConversation (Caravan Leader): Listens for particular commands ("Stop", "Go") and sets a local variable "strCommand" with the command ("Stop" or "Go").
  • OnHeartbeat (Caravan Leader): Checks the local variable "strCommand" with GetLocalString():
    • if (strCommand == "Go") then it calls "MyWalkWayPoint2" (see code below) and sets this variable to "WALK_WAY_POINT" (this way because MyWalkWayPoint2 can be called only 1 time for any "Go" spoken by the PC)
    • if (strCommand == "Stop") then the Caravan Leader stops walking (and the Caravan Men do likewise)
  • OnAttack (Caravan Leader): when the bandits attack the caravan, the default OnAttack script fires and performs a ClearAllActions() command.
  • When the attack has ended, the PC can command the Caravan Leader to "Go" again to make the Caravan Leader and his Caravan continue the route (instead of going to the closest waypoint which could potentially be one that has already been past).

Custom waypoints cannot be named with the normal "WP_" prefix as this confuses the WalkWayPoints() command found in default scripts (like OnSpawn) and other functions (like DetermineCombatRound()). For the MyWalkWayPoint2 script, you should use the default header of "LW" (or change the value of sWayPointHeader in the script to your own custom header).

Also note that calling ActionDoCommand() during the OnSpawn event for a creature can cause that creature to assume unpredictable behavior. Because MyWalkWayPoint2() makes use of ActionDoCommand() you should not use this script during the OnSpawn event, but instead place it in a creature's OnHeartbeat event.

//::///////////////////////////////////////////////////////////
//:: MyWalkWayPoint2 ()
//:: version: recursively-standalone
//::///////////////////////////////////////////////////////////
//::///
//::/// don't use in the OnSpawn event:
//::/// there is a kind of queue-initialize during this event,
//::/// so this routine will not run;
//::///
//::/// If a creature is walking, and a ClearAllAction() occurs,
//::/// you can call this routine to continue walking to the right
//::/// direction until end of circuit
//::///
//::/// N.B.: the original WalkWayPoint restarts the circuit from
//::///       the nearest valid WayPoint... nice... but what if the
//::///       nearest waypoint is behind ?
//::///
//::///////////////////////////////////////////////////////////
//::///
//::/// in simple words....
//::/// - if no waypoint active to walk to, set it to the
//::///   first waypoint (if exists),
//::///   else set the next waypoint;
//::/// - ActionMoveToObject (waypoint);
//::/// - Reschedule itself by ActionDoCommand;
//::///////////////////////////////////////////////////////////
//::/// it is an asyncronous way to do the same as:
//::///     while next-waypoint-is-valid
//::///         move to next-waypoint
//::///         wait until next-waypoint reached
//::///         waypoint++
//::///     end
//::///////////////////////////////////////////////////////////

void MyWalkWayPoint2()
{
//::///////////////////////////////////////////////////////////
//::
//:: init variables
//::
//::///////////////////////////////////////////////////////////
//::
//:: NOTE: the WayPoint header (standard is "WP_") has to be different from
//::       standard. Why? Because we have not to get in conflict with the
//::       Bioware's WalkWayPoint. This Because the Bioware's WalkWayPoint is
//::       called in many Bioware's standard scripts...
//::
//::///////////////////////////////////////////////////////////

    string sLocalWalkToName = "WALK_TARGET";
    string sLocalWalkTo = "";

    string  sWayPointHeader = "LW";
    string  sWayPointNum = "01";
    int iWayPointNum = 1;
    string  sWayPoint = "";
    object  oWayPoint;

//::///////////////////////////////////////////////////////////
//::
//:: the current destination is stored in an OBJECT_SELF's local variable:
//::
//::///////////////////////////////////////////////////////////

    sWayPoint = GetLocalString (OBJECT_SELF, sLocalWalkToName);
    oWayPoint = GetObjectByTag (sWayPoint);

//::///////////////////////////////////////////////////////////
//::
//:: if local variable exists, we have to find the NEXT WayPoint
//::
//::///////////////////////////////////////////////////////////

    if (GetIsObjectValid(oWayPoint) && (sWayPoint != "") )
    {
        sWayPoint = GetStringRight(sWayPoint, 2);
        iWayPointNum = StringToInt(sWayPoint);
        if (iWayPointNum > 0)
        {
            iWayPointNum++;
            if (iWayPointNum < 10)
            {
                sWayPointNum = "0" + IntToString(iWayPointNum);
            } else
            {
                sWayPointNum = IntToString(iWayPointNum);
            }
            sWayPoint = sWayPointHeader  + "_"  + GetTag(OBJECT_SELF) + "_" + sWayPointNum;
            oWayPoint = GetObjectByTag (sWayPoint);
        }
    }
//::///////////////////////////////////////////////////////////
//::
//:: if local variable doesn't exist, or invalid,
//:: the creature has to start the circuit, so
//:: we have to set this local variable to its first waypoint
//::
//::///////////////////////////////////////////////////////////
    else
    {
        sWayPoint = sWayPointHeader  + "_"  + GetTag(OBJECT_SELF) + "_" + sWayPointNum;
        oWayPoint = GetObjectByTag (sWayPoint);
    }

//::///////////////////////////////////////////////////////////
//::
//:: The waypoint we have found is a valid waypoint:
//::  - the creature has to move to it!
//::  - it is possible a next waypoint esists, so,
//::    after the creature has moved to the new destination,
//::    it is better to check all again,
//::    so we put this routine in the Action Queue;
//::    doing this way, when creature stops, the first action
//::    the creature do will be the executing of MyWalkWayPoint2!
//::
//:: The waypoint we have found is not valid, it doesn't exist:
//::  - the creature has reached the end of the circuit, so
//::    it is a good way to reset the local variable and to stop
//::
//::///////////////////////////////////////////////////////////

    if (GetIsObjectValid(oWayPoint) )
    {
        SetLocalString(OBJECT_SELF, sLocalWalkToName,sWayPoint);
        ActionMoveToObject(oWayPoint);
        ActionDoCommand(MyWalkWayPoint2() );
    }
//::///////////////////////////////////////////////////////////
//::
//:: The waypoint we have found is not valid, it doesn't exist:
//::  - the creature has reached the end of the circuit, so
//::    it is a good way to reset the local variable and to stop
//::
//::///////////////////////////////////////////////////////////

    else
    {
        SetLocalString(OBJECT_SELF, sLocalWalkToName,"");
    }

//::///////////////////////////////////////////////////////////
//::
//:: return to the main call
//::
//::///////////////////////////////////////////////////////////

    return;
}

author: Graziano Lenzi, editor: Charles Feduke


Category - Beginning Scripting

Home > Lyceum > Tutorial > スクリプト入門

スクリプト入門

初心者向けのスクリプト作成チュートリアル

タイトル | 概要
David Gaider - 変数の設定 | オブジェクトの状態を維持するための変数の設定及び取り出し方法についての解説
Celowin - パート １: 基本 | NWNスクリプト作成の基礎を教える完全な初心者向けのチュートリアル 第１回
Celowin - パート ２: ローカル変数 | NWNスクリプト作成の基礎を教える完全な初心者向けのチュートリアル 第２回
Celowin - パート ３: 条件 | NWNスクリプト作成の基礎を教える完全な初心者向けのチュートリアル 第３回
Celowin - パート ４: ユーザー定義イベント | NWNスクリプト作成の基礎を教える完全な初心者向けのチュートリアル 第４回
Celowin - パート ５: 自己学習、非NPCを扱ったスクリプト | NWNスクリプト作成の基礎を教える完全な初心者向けのチュートリアル 第５回
Celowin - パート ６: ループ | NWNスクリプト作成の基礎を教える完全な初心者向けのチュートリアル 第６回
Celowin - パート ７: アイテムのためのスクリプト | NWNスクリプト作成の基礎を教える完全な初心者向けのチュートリアル 第７回
Celowin - パート ８: 関数 | NWNスクリプト作成の基礎を教える完全な初心者向けのチュートリアル 第８回
Celowin - パート ９: 値を返す関数、デフォルトパラメーター、ライブラリ | NWNスクリプト作成の基礎を教える完全な初心者向けのチュートリアル 第９回
BubaDragons NWNスクリプトのデバッギングガイド | BubaDragons NWNスクリプトのデバッギングガイド

JP team: katsu794


Tutorial - David Gaider - Setting Variables

Home > Lyceum > Tutorial > スクリプト入門 > David Gaider - 変数の設定

David Gaider - 変数の設定

変数を設定し、取り出すことは、スクリプト作成において最も行われる行為の１つでしょう。変数の設定と取り出しを用いて、ほとんどのイベントが発生しているかどうかを決定したり、異なったストーリー の状態の変更や記録をすることができます。

変数を設定する時に最も使用される関数は、以下のとおりでしょう。

// void SetLocalInt(object oObject, string sVarName, int nValue)
SetLocalInt(OBJECT_SELF, "VARIABLE1", 1);

この関数は、 ローカル整数を設定します。ローカルに設定するとはどういう意味でしょうか？それは、指定しているoObjectに整数が関係付けられ、保管されるという意味です。(物理的には保管されませんが、この方法だと整数を簡単に参照できます。)

覚えておくべき重要な点は、以下の３つです。

  1. oObjectは有効なオブジェクトである必要があります。SetLocalInt関数の頭の部分がvoidになっているように、返されるオブジェクトが頭の部分にある多くの関数が見られます。これは、それらの関数がそのタイプのオブジェクトを返すということを意味します。
    どんなオブジェクトに対しても整数を関係付けることができます。会話の中でGetPCSpeaker()関数を使用すると、現在NPCと話しているPCがオブジェクトして返されるでしょう。GetModule()関数を使用して、モジュール自身に整数を保管することができます。OBJECT_SELFを使用して、現在のスクリプトを実行しているオブジェクト上の整数を参照できます。
    変数は、そのオブジェクトにとって特有のものになるということも重要です。モジュール上に "VARIABLE1" という変数名で1という値を保管する場合、 その変数は、そのモジュールにとって特有の変数となります。例えばPCといったような異なるオブジェクトに "VARIABLE1" を持たせることはできますが、それは全く違った変数になります。
  2. sVarName は、変数に与える名前です。与える変数名がそのモジュールにとって特有の名前であることを確認して下さい。変数名は全ての文字列のように、 ダブルクォーテーションで囲む必要があります。(上の"VARIABLE1"がその例) 変数名は大文字小文字を区別しません。
  3. nValue は、変数に保管する情報です。この関数では整数を設定しようとしているので、1, 15 または 320といった数字(少数部分なし)である必要があります。モジュールにタイプの異なった情報を保管したければ、異なった関数を使用する必要があります。
// 浮動小数(少数部分がある数字)を保管します。
// void SetLocalFloat(object oObject, string sVarName, float fValue);
SetLocalFloat(OBJECT_SELF, "nw_some_key", 12.0f);
// 文字列(文章、単語、オブジェクトの名前など)を保管します。
// 変数名のようにクォーテーションで囲む必要があります。
// void SetLocalString(object oObject, string sVarName, string sValue);
SetLocalString(OBJECT_SELF, "nw_some_key", "some string");
// void SetLocalLocation(object oObject, string sVarName, location lValue);
// ロケーションを保管します。
SetLocalLocation(OBJECT_SELF, "nw_some_key", GetLocation(OBJECT_SELF));
// void SetLocalObject(object oObject, string sVarName, object oValue);
// オブジェクトデータ(配置可能オブジェクト、所有アイテム、クリーチャーなど)を保管します。
SetLocalObject(OBJECT_SELF, "nw_some_key", OBJECT_SELF);
変数はどのように使うのでしょうか？

一度変数をあるオブジェクトに設定すると、それは置き換えらえれり、または破棄されるまで保持されます。別のスクリプト(または同じスクリプト)の他の場所においても、その変数を呼び出したり、情報を保管し直したりすることができます。

一度設定した整数データを呼び出したい場合には、以下のようになるでしょう。

// int GetLocalInt(object oObject, string sVarName);

これは、先ほど変数を設定する時に使用した関数から実際のデータ値を指定することを除くと、全く同じ関数です。

void型の関数ではないことに注意してください。この関数は実際の情報として整数値を返します。この関数を単独で使用することはないということです。例えば、以下のようにあらかじめ定義されたintデータを設定する時に使用します。

int nValue = GetLocalInt(OBJECT_SELF, "VARIABLE1");

これは、OBJECT_SELF内の変数"VARIABLE1"に設定された値と同じ値を持った、nValueという新しい変数を設定したということを意味します。

まだ理解しにくいですか? 例を挙げましょう。

変数を使用する方法の１つの良い例は、プロット（ここではクエストとします。）の進行を追跡することです。そこで、"STORY"という変数を用意して、プレイヤーがクエストを受けた時に変数を1に設定し、プレイヤーがクエストを完了したときに変数を2に設定することにします。

プレイヤーがクエストを受けました。

プレイヤーがクエストを受ける会話ノードの「テキストによる処理」に、PC上の"STORY"変数の値を1に設定するスクリプトを作成します。

void main()
{
     SetLocalInt(GetPCSpeaker(), "STORY", 1);
}
プレイヤーがクエストを完了しました。

プレイヤーは、NPCが望んだことをやり遂げて戻ってきました。NPCはプレイヤーを褒め称え、PC上の"STORY"変数を2に設定します。

void main()
{
     SetLocalInt(GetPCSpeaker(), "STORY", 2);
}
プレイヤーがクエストを受けたかどうか、クエストを完了したかどうかを、どのようにすれば知ることができるのでしょうか？

そのためには、会話の該当箇所においてそれぞれの条件に対する新しいノードを作成する必要があります。コンピュータは、先頭のノードから処理を開始して、「テキスト表示の条件」に書かれているスクリプトをチェックします。そして、その戻り値がTRUEである場合、そのテキストを表示します。(何もスクリプトがない場合には、自動的にTRUEと判断されます。)TRUEでない場合は、続けて次のノードをチェックします。

よって、このクエストにおいては、以下のように逆順でノードを並べる必要があります。

  1. (クエストを完了した) "クエストを成し遂げたことに感謝します。"
  2. (クエストを既に受けている) "クエストは完了しましたか？"
  3. (クエストを受けてもなく、完了してもない) "こんにちは！"

そうすると、1.の会話の表示させるために、PC上の"STORY"変数の値が2である場合にTRUEを返すスクリプトを作成する必要がありますよね？ また、2.の会話を表示させるためには、"STORY"変数の値が1である場合にTRUEを返すスクリプトが必要になります。3.の会話を表示させるためのスクリプトは必要ありません。なぜなら、1.と2.両方のスクリプトがFALSEを返す場合は、クエストを受けてもいなく、完了してもいないからです。

クエストは完了しましたか？

int StartingConditional()
{
     int nDone = GetLocalInt(GetPCSpeaker(), "STORY") == 2;
     return nDone;
}

クエストを受けましたか？

int StartingConditional()
{
     int nAccept = GetLocalInt(GetPCSpeaker(), "STORY") == 1;
     return nAccept;
}
よって、まとめると以下のようになります。

  1. (「テキスト表示の条件」に設定する最初のスクリプト) "クエストを成し遂げたことに感謝します。"
  2. (「テキスト表示の条件」に設定する２番目のスクリプト) "クエストは完了しましたか？"
  3. (スクリプトなし) "こんにちは！"
上記のスクリプトにおいて、NPCは１人のPCにだけクエストを与えたいとします。

そのためには、PC上の"STORY"変数を1に設定する時に、OBJECT_SELF(NPC)上の"PLOT_GIVEN"という変数を1に設定するというのはどうでしょうか？

それならば、以下のように3.の会話から２つの会話を分岐させる必要があります。(なぜなら、"STORY"変数を持っていない別のPCがぶらりと歩いてきて、NPCに話しかけることもあるからです。)

|
|
--> (「テキスト表示の条件」に設定するスクリプト。OBJECT_SELF上の"PLOT_GIVEN"変数が1である場合にTRUEを返す。) "ごめんなさい。今日はあなたに依頼する仕事はありません。"
|
|
--> (スクリプトなし) "私の依頼を受けてくれませんか？"

非常に簡単なクエストの会話例

ルートの下にノードを並べる時には、実際の会話の逆順に並べなければならないということを憶えておいてください。

以下に、それぞれのノードに必要なスクリプトを示します。

#1 - PC上の"Job"変数の値が4である場合にTRUEを返すスクリプトを、「テキスト表示の条件」に設定します。

int StartingConditional()
{
     int nJob = GetLocalInt(GetPCSpeaker(), "Job") == 4;
     return nJob;
}

#2 - PC上の"Job"変数の値が3(#3で設定されます。)である場合にTRUEを返すスクリプトを「テキスト表示の条件」に設定します。PCが仕事を完了している場合に表示する会話を作成し、NPCがPCに報酬を与え"Job"変数の値を4(これ以上仕事はないということを示す値)に設定するスクリプトを、 「テキストによる処理」に設定します。

void main()
{
     SetLocalInt(GetPCSpeaker(), "Job", 4);
}

#3 - PC上の"Job"変数の値が2(#4で設定されます。)である場合にTRUEを返すスクリプトを「テキスト表示の条件」に設定します。PCが仕事を完了している場合に表示する会話を作成し、NPCがPCに報酬を与え、"Job"変数の値を3に設定するスクリプトを、 「テキストによる処理」に設定します。NPCは次の仕事を依頼します。

#4 - PC上の"Job"変数の値が1(#5で設定されます。)である場合にTRUEを返すスクリプトを「テキスト表示の条件」に設定します。PCが仕事を完了している場合に表示する会話を作成し、NPCがPCに報酬を与え、"Job"変数の値を2に設定するスクリプトを、 「テキストによる処理」に設定します。NPCは次の仕事を依頼します。

#5 - PC上の"TalkedToJoe"変数の値が1(#6で設定されます。)である場合にTRUEを返すスクリプトを「テキスト表示の条件 」に設定します。PCが最初の仕事を受けた場合に表示する会話を作成し、PC上の"Job"変数を1に設定するスクリプトを「テキストによる処理」に設定します。

#6 - 「テキスト表示の条件」にはスクリプトを設定しません。(上記のスクリプトが全てFALSEを返す場合、それはPCがNPCに初めて話しかけたということを意味するからです。)PC上の"TalkedToJoe"変数の値を1に設定するスクリプトを、 「テキストによる処理」に設定します。

これまでに書いたことは、基本的な変数の設定と取り出しに関することです。文字列やオブジェクトデータ、そして他の種類のデータを扱う場合は、少し複雑になります。しかし、一度整数を扱うことに慣れれば、他の種類についても幾分か容易に理解することができると思います。このチュートリアルが、あなたにとってのスクリプト作成のきっかけになれば幸いです。

author: David Gaider, editor: Charles Feduke, JP team: katsu794


Tutorial - Celowin - Part I: The Basics

Home > Lyceum > Tutorial > スクリプト入門 > Celowin - パート １: 基本

Celowin - パート１: 基本

前置き

この一連のレッスンの目的は、全くの初心者をプログラミングの世界に誘い、モジュールを作成するためにNWNのスクリプトをどのように使うかを教えることです。初めの 部分のレッスンはとても基本的なものになると思われるので、何かのプログラムを書いたことがある人は飛ばしても構わないでしょう。これらのレッスンの最終目的は、プログラムと聞いただけで身震いするような人々でも学べる場を提供することです。

これらのレッスンをフォーラムに掲示したり、印刷したり、修正を加えることは大いに構いません。しかし、その際には私が作成したということをどこかで触れて下さい。良い悪いを含めて、これらのレッスンについて何かコメントがあれば私に送って下さい。Celowin.

これらのレッスンは、オーロラツールセットをある程度触っている人を想定して書かれています。これらのレッスンにおいて解りにくい部分があるという意見が多数寄せられれば、必要な部分をさらに詳しく説明することも考えています。

イントロダクション

ツールセットを起動し、モジュールウィザードを使って新しいモジュールを作成して下さい。モジュール名は「テストモジュール」とします。新しいエリアを作成して下さい。名前は「テストエリア001」とします。サイズやタイルセットは自由に設定して下さい。このレッスンにおいては、さほど重要なことではありません。(配置物を簡単に把握するためにも、縦2、横2程度のサイズをお奨めします。)

「クリーチャーをペイント」ボタンを使って、NPCを配置して下さい。どんな外観でも構いません。そして、以下のことを行って下さい。

  • 配置したNPC上で右クリックします。
  • 表示されたメニューから「プロパティ」を選択します。
  • NPCのタグを「SINGER」に変更します。
  • 「スクリプト」タブを選択します。
  • すべてのスロットにはデフォルトのスクリプトが表示されています。それぞれのスロットを選択し、スクリプト名を全て削除します。
  • 「OnHeartbeat」スロットの側にある「編集」ボタンをクリックします。
  • 以下のスクリプトを入力します。(一字一句が正確である必要があります。)
    void main()
{
    ClearAllActions();
    ActionSpeakString("これは永遠に終わることのない歌です。");
    ActionWait(1.5);
    ActionSpeakString("そう。ずっと歌い続けられるのです。友よ。");
    ActionWait(1.5);
    ActionSpeakString("ある人々が、何の歌かも分からずにこの歌を歌い始めました。");
    ActionWait(1.5);
    ActionSpeakString("そして、これからも彼らはこの歌を永遠に歌い続けるでしょう。ただそれだけの理由で...。");
}

    上のスクリプトは、カットアンドペーストせずに実際に入力することをお勧めします。そうすることで、スクリプトを書く方法をより学ぶことができるでしょう。入力ミスをすれば、その一字一句がいかに重要な意味を持っているかを確認することができるでしょう。

  • 「名前を付けて保存」をクリックし、「tm_singer_hb」という名前で保存します。
  • スクリプト・エディタウィンドウの下の部分をチェックします。次のようになっていれば大丈夫です。0 Errors. 'tm_singer_hb' Compiled successfully. もしそうでなければ、タイプミスをしています。入力したスクリプトを再度チェックして下さい。
  • 「終了」をクリックし、スクリプト・エディタを閉じます。
  • クリーチャーのプロパティウィンドウの「OK」ボタンをクリックします。
  • モジュールを保存して、ツールセットを終了します。
  • NWNを起動して、「その他のモジュール」から今作成したモジュールを選択してプレイします。
  • NPCがちょっとした歌を歌い続けることが確認できるでしょう。

解説

難しい部分に関しては、行ったことを全てステップ・バイ・ステップで説明したいと思います。みなさんが質問しそうなことを推測して、Q&A方式にしてみようと思います。

なぜ「テストモジュール」という名前にしたのですか？

実際のところ、特に理由はありません。「その他のジュール」画面で簡単に見つけられるようにしたかっただけです。

なぜ「テストエリア001」という名前にしたのですか？ ツールセットで与えられたデフォルトの名前でも十分だったのでは？

今回のような簡単なモジュールでは、それで問題ないかもしれません。しかし、エクスポートを行う時のためにも、名前を変更する習慣をつけておいた方が良いと思います。もし、あなたが作成したモジュールから１つのエリアをエクスポートして、他のモジュールにインポートしたい場合、そのエリアの名前は特有の名前である必要があります。仮にみんなが 「エリア001」という名前にした場合、エリアのエクスポートとインポートにおいて問題が生じる可能性があるからです。

なぜNPCのタグをSINGERにしたのですか？ なぜ全て大文字なのですか？

いくつかの理由で、タグは全て大文字である必要があります。決してその理由に触れることはないかもしれませんが、そういう習慣をつけておいた方が良いということです。

また、配置したクリーチャーにはシンプルで覚えやすいタグを与えることをお勧めします。SINGER であれば、NPCがどんなNPCであるかは一目瞭然です。そして、もっと複雑なスクリプトでNPCを参照することが容易にできます。

タグは短くし、８文字以内にすることをお勧めします。

なぜデフォルトのスクリプトを全て削除したのですか？ なぜ元々それらが表示されていたのですか？

デフォルトのスクリプトには、まだ扱いたくないNPCの振る舞いがいくつか定義されているからです。例えば、オリジナルのNPCのままだと、最終的にプレイヤーを攻撃する結果になる可能性もあるからです。今回は、NPCにただ歌を歌ってもらいたくて、それ以外に何もさせないために他のスクリプトを削除しました。

後のレッスンにおいて、デフォルトのスクリプトの活用方法について触れるつもりです。

なぜスクリプトを「OnHeartbeat」スロットに作成したのですか？ いずれにしろ、なぜそんなに多くのスロットがあるのですか？

それぞれのスロットは、そこに書かれている特定のスクリプトが呼ばれるタイミングを定義しています。「OnHeartbeat」スロットは、そこに書かれているスクリプトを６秒毎に実行します。それで、NPCが６秒毎に作成した４行の歌を歌い続けるのです。

させたい行為に応じて、それぞれのスロットを使用します。しかし、「OnHeartbeat」スロットに設定するスクリプトは最小限に止めるべきです。なぜなら、多数のスクリプトが６秒毎に実行されると、コンピュータのパフォーマンスに問題が生じる可能性があるからです。

void main()とは何ですか？

この関数はシンプルで、しかも、ほとんど全てのスクリプトで見ることができるので、多くの人がその存在を忘れがちです。このレッスンにおいて、この関数に関して十分な説明をしようと思いますが、後のレッスンまでに全てを説明できるかどうかは分かりません。

NWNのスクリプトは、「関数」を使って作成されます。関数はプログラムに何をすればいいかを伝えます。いくつかの関数は、あらかじめ作成されており、スクリプトに書くだけで使うことができます。しかし、スクリプトを作成する時には、オリジナルの関数を作成することもあります。このことを自らの関数を「セットアップする」、または、関数のシグネチャを定義すると呼ぶこともあります。

初めにvoidについて説明します。この部分は、関数からどんな種類の「答え」が返されるかを示しています。我々が配置したNPCは歌を歌うだけであり、何らかの「答え」を計算して返すわけではありません。したがって、voidは、その関数が実際に何も答えを返さないということを示しています。

mainは、そこがスクリプトのメイン部分であることを示しています。他の関数をスクリプトに書くこともできますが、スクリプトが実行されるとmain関数から処理が開始されます。

( )の間は、どんな種類の入力情報がスクリプトに与えられるかを示しています。今回のスクリプトには何の入力情報も必要ないので、( )の間は空欄になっています。しかし、入力情報がなくても( )は必ず必要です。

{ }はどういう意味ですか？

{ }は、スクリプト内のセクションをグルーピングするために使われます。今回の場合、書かれた内容は全てmain関数の一部であるということになります。

なぜmain関数の全ての行が、';'で終わっているのですか？

基本的には、スクリプトにそこが行の終わりであることを伝えるためです。複雑なスクリプトを書くと、大抵１行では済まないでしょう。その場合は、複数の行に分けるのが好ましいと言えます。プログラムは、セミコロンが現れるまでは１行として扱います。

英語におけるピリオドにとても似ていると思われるかもしれません。(ピリオドの代わりにセミコロンが使われている理由は、ピリオドと小数点が混同されることによる混乱を避けるためです。)

ClearAllActions()は何をするのですか？

これはちょっとややこしいです。なぜなら、今回のケースでは、この関数は実際には何も行わないからです。他の行為を行わないように、保険として書いてあるに過ぎません。

これについて説明しましょう。ClearAllActions()関数以外の他の行は、全てActionから始まる関数です。NPCは、前に行ったアクションが終わったことを確認してから次のアクションをすると思われるでしょう。

しかし、関数は「OnHeartbeat」スロットに割り当てられていて、６秒毎に呼ばれるということを思い出して下さい。NPCには７つのアクションをさせたいのですが、６秒間に４つのアクションしか終わらすことができなかったらどうなるでしょうか？ まだ行っていない３つのアクションが残ることになり、そして再び７つのアクションをするように伝えられますので、結果的に１０のアクションをしなければならないことになります。NPCは実行可能な４つのアクションを行い、さらに７つのアクションをするように伝えられます。そうすると、１３のアクションをしなければならないことになります。NPCには、やるべきアクションが次から次へと残されていきます。結果的に、問題を引き起こすことになるでしょう。

この問題を解決する良い方法がありますが、ここではNPCに「やらなければならないことを全て忘れなさい」と言うのが一番簡単です。このためにClearAllActions()関数があるのです。

もし試したければ、スクリプトを編集して全てのActionWait()関数の中の数値を1.5から3.0に変えてみて下さい。NPCが、全ての歌を歌わないまま再び同じ歌を繰り返すのが確認できるでしょう。

ここまで説明しましたが、少し前に述べた部分にちょっと戻ってみます。ClearAllActions()関数は、main関数のように( )間が空欄ですので、この関数には何の入力情報がないことを示しています。

main関数の他の行は何を意味しているのですか？

これらは全てNPCに何をすればいいかを伝える指令です。おおよそ見当はつくと思いますが、いずれにしろ少し説明したいと思います。

ActionSpeakString()関数は、NPCにあることを話させます。今までに扱ってきた関数とは違って、この関数は、実際の入力情報を必要とします。それは、NPCが話すテキストです。このテキストは「文字列」と呼ばれており、英語における会話テキストと同様にダブルクォーテーションで囲む必要があります。

ActionWait()関数は、NPCの動きを止め、与えられた数字に等しい秒数だけ何もさせないようにします。よって、ActionWait(1.5)は、NPCにそれぞれのテキストを話す間1.5秒待たせることを意味します。

なぜスクリプトの名前をtm_singer_hbとしたのですか？

スクリプト名は自由に付けることができますが、覚えやすい名前を付けたいとします。その場合は、「標準化」が鍵になります。

  • 「テストモジュール」を表すために、'tm'を使います。よって、テストモジュールで使用される全てのスクリプト名は、この２文字(tm)から始まるようにします。
  • 'singer' は、このスクリプトが関連付けられたNPCを表しています。NPCのタグが全て大文字であっても、スクリプト名は全て小文字を用います。(注意：これがオブジェクトのタグを８文字以下にした方が良いと勧めた理由です。さもなければ、スクリプト名がとても長くなるに違いありません。)
  • 'hb' は、このスクリプトがNPCの「OnHeartbeat」スロットに設定されているということを表しています。
このレッスンはここまでですか？

この最初のレッスンだけでは、まだ完全に自分自身のスクリプトを作成できないことは良く分かっています。しかし、一気にやり過ぎるよりは、むしろやり足りなくて情報不足にフラストレーションを感じる位が良いと思っています。２、３日もらえれば、次のレッスンをお披露目することができるでしょう。

author: Celowin, editor: Iskander Merriman, JP team: katsu794


Tutorial - Celowin - Part II: Local Variables

Home > Lyceum > Tutorial > スクリプト入門 > Celowin - パート ２: ローカル変数

Celowin - パート ２: ローカル変数

前置き

この一連のレッスンの目的は、全くの初心者をプログラミングの世界に誘い、モジュールを作成するためにNWNのスクリプトをどのように使うかを教えることです。初めの 部分のレッスンはとても基本的なものになると思われるので、何かのプログラムを書いたことがある人は飛ばしても構わないでしょう。これらのレッスンの最終目的は、プログラムと聞いただけで身震いするような人々でも学べる場を提供することです。

これらのレッスンをフォーラムに掲示したり、印刷したり、修正を加えることは大いに構いません。しかし、その際には私が作成したということをどこかで触れて下さい。良い悪いを含めて、これらのレッスンについて何かコメントがあれば私に送って下さい。Celowin.

これらのレッスンは、オーロラツールセットをある程度触っている人を想定して書かれています。これらのレッスンにおいて解りにくい部分があるという意見が多数寄せられれば、必要な部分をさらに詳しく説明することも考えています。

イントロダクション

このレッスンは、前のレッスンよりは少し長くなるでしょう。そして、もう少し高度な概念を扱います。どのようにすれば上手く説明できるか自信がないので、何か分からないことがあったら質問して下さい。あなたが分からないことに対して、きっと他に５人は同じように分からないと思っているでしょう。

前回作ったモジュールに手を加えてみましょう。ツールセットでモジュールを開いて下さい。

配置したNPC上で右クリックをして、プロパティを選択します。そして、スクリプトタブを選択します。

今回は２つのスクリプトを作成します。両方とも短いスクリプトです。

最初のスクリプトは、OnSpawnスロットに設定します。

void main()
{
  SetLocalInt(OBJECT_SELF, "SINGER_COUNT", 0);
}

スクリプトをtm_singer_os ('os' はOnSpawnという意味です)という名前で保存します。

たった１行のスクリプトですが、一度もスクリプトを書いたことのない人にとっては不安に感じるものです。したがって、「真の」スクリプト作成に入る前に、このスクリプトについて説明をしようと思います。

まず第一に、このスクリプトを、以前に扱ったイベントスロットとは異なったスロットに設定していることに注意して下さい。OnSpawnスロットに設定されているスクリプトは、NPCがゲームにロードされた時に１回だけ実行されます。従って、我々がここで行っているように、何かを初期化するのに理想的です。

この１行のスクリプトは、ある変数を設定しています。あなたの最後の数学の授業を思い出して下さい。変数とは何でしたか？それは、数字を表す文字です。１文字ではなく長い名前を付けていることを除いては、ここでいう変数は数学で習った変数とほとんど一緒です。

SetLocalInt関数は、ローカル変数を設定する関数で、コンマで区切られた３つの入力情報を必要とします。

  • 最初の入力情報は、変数を「関連づける」オブジェクトです。
  • ２番目は、変数名です。
  • ３番目は、変数に代入する値です。

ここで、２番目と３番目の入力情報は意味が分かると思います。変数名をSINGER_COUNTとして、それに0という値を与えています。最初の入力情報について、もう少し説明をします。

モジュール内にあるものは、ほとんど全てがオブジェクトです。NPC、配置可能物、ウェイポイントもオブジェクトですが、PC自身でさえもオブジェクトです。モジュール内にはとても多くのオブジェクトが存在しているので、その中から正しいものを参照する時にちょっとややこしくなります。

OBJECT_SELF は、オブジェクトを参照する時の最も便利な方法の１つです。OBJECT_SELF は、スクリプトを呼び出したオブジェクトを参照するので、今回の場合、スクリプトはNPCに設定されたのでOBJECT_SELFはNPCを意味しているということが推測できます。

まとめると、この１行のスクリプトは、 SINGER_COUNTという変数を定義し、それに0という値を代入して、NPC SINGERに保管するということを行っています。

SetLocalInt関数の「Int」は「Integer(整数)」を意味しているということにも注意して下さい。4、0、–35といった値は設定できますが、例えば3.8といった値は設定できません。

さて、次のスクリプトに移りましょう。前回OnHeartbeatスロットに設定したスクリプトを上書きしたいと思います。

int nCount=GetLocalInt(OBJECT_SELF, "SINGER_COUNT");
void main()
{
    nCount = nCount+1;
    ActionSpeakString("私は "+IntToString(nCount)+" 回話しました。");
    SetLocalInt(OBJECT_SELF, "SINGER_COUNT", nCount);
}

名前はtm_singer_hbのままで保存します。

説明の前に、このスクリプトが実際に何を行うかを見た方がいいでしょう。よって、スクリプトエディタを閉じて、OKを押してNPCのプロパティ画面を閉じて下さい。そして、モジュールを保存します。モジュールを起動してNPCがどんな行動するか確認して下さい。

このスクリプトで初めて、void main()の前にコードを書いています。これについて説明しなければならないでしょう。main関数の前に書かれているコードは全て、スクリプトの「初期化」と呼ばれています。基本的に、そこで設定したものはスクリプトから参照できます。前に扱ったローカル変数とは違って、nCountは、スクリプトが実行されている間だけ保持されます。スクリプトが終了すると、nCountは破棄されます。このため、このように使用される変数は、「一時変数」と呼ばれています。

main関数の中で、nCountが何回使われているかに注意して下さい。nCountを使う代わりに、毎回GetLocalInt(OBJECT_SELF, "SINGER_COUNT")を書いていたら、スクリプトがどんなに長く、ややこしいものになるか想像してみて下さい。うんざりしますよね？

ここで、nCountという名前は、ある種の標準化を用いています。一時変数を宣言するときは、変数名の最初の１文字から、この変数が保持している値の種類が分かるようにします。「n」は整数を表しています。変数にはどんな名前をつけることもできますが、この方法を使えば、変数が整数値を持っているに違いないとすぐに知ることができます。「Count」の部分で、この変数が何のために使われるのかをある程度知ることができます。

intは、整数値を定義しているという意味です。「=」は「値を代入する」という意味です。GetLocalInt関数は、変数SINGER_COUNTに保管されている値を取り出します。これに似た関数があったことを思い出して下さい。前回、SetLocalInt関数を使ってローカル変数に値を保管しました。GetLocalInt関数は、その値を取り出すために使われます。

したがって、最初の１行は多くのことを行っています。スクリプトが使用できる一時変数nCountを作成し、それにNPC上の変数SINGER_COUNTに保管されている値を代入しています。OnSpawnスロットに設定したスクリプトにおいて、SINGER_COUNTには0という値を設定したので、最初にこの行が実行されるとnCountには 0という値が代入されます。

１行のコードとしては、説明が多すぎるのというのは分かっていますし、みんなが１回で理解できるとは思っていません。もう一度じっくり読んでみて下さい。仮に分からなくても心配しすぎる必要はありません。この種のコードは、いくつかの例を扱えばより理解できるようになります。

main関数の本体の説明に移りましょう。最初の行について考えてみて下さい。

nCount = nCount+1;

これは、一時変数に１を加えた値を、再度同じ変数に代入しています。このような表現の場合、頭に「set」という言葉を付けて考えると分かりやすい人もいるようです。言葉に言い換えると、「nCountに１を加えた値をnCountに設定する」という感じになります。

もしnCountが9という値であれば、新しい10という値が設定されます。

(付け加えると、NWNスクリプトでは以下のような表現もできます。

nCount++;

[++]は 「インクリメント(増加)」を表しており、値を１つ増加させます。一度使えば便利な表現ですが、一般的に、スクリプト初心者にとっては少しとまどいを感じる表現だといえます。)

２行目はActionSpeakString関数ですが、中身がちょっと変わっています。まず第一に、+ 記号で区切られた３つの部分から成り立っていることに注目して下さい。文字列に使用する時、+記号は一方をもう一方に接続します。簡単な例を挙げると、「これは文字列です。」と、「これは」+「文字列です。」は全く同じものになります。

上のような表現にした理由は特にありませんが、真ん中の表現IntToString(nCount)を使うときに便利になります。この関数は正にその名前通りのことを行います。nCountは整数ですので、数字を文字列に変換します。

この方法は、プログラムを書いたことの無い人をちょっと混乱させると思うので、説明させて下さい。私が「象がチュチュを着ている」というような変なことを言っていると仮定して下さい。あなたは、すぐに頭の中にその絵が浮かび、私が言った文章を構成する個々の単語についてまでは考えないでしょう。文字に書くときだけ、象が...というように文字を考え始めます。

コンピュータも同じです。変数に値を保管している時は、それをどのように「文字に書く」かについては考えていません。IntToString関数は、NPCが話すことができるように、値を文字列に変換するようにコンピュータに伝えます。

最後の行も理解する必要があります。ここでは、新しいnCountの値をローカル変数に戻しています。nCountは一時的なものであり、スクリプトが終了すると破棄されることを思い出して下さい。したがって、NPC上の変数を更新したいときには、再度値を保管する必要があります。

レッスン３のプレビュー

レッスン２は、長いので元々２回か３回に渡って説明するつもりでしたが、別のレッスンに分けたいと思います。しかしここで、最後のスクリプトにあるちょっとした失敗を見逃す訳にはいきません。

あなたが細かい人なら、最初にスクリプトをテストしたときにおやっと思ったかもしれません。NPCが一番最初に話す言葉は、「私は１回話しました。」です。どういう意味かは簡単に分かりますが、文章表現が上手くないですね。

この問題を避けるには、「条件」や「if文」を用いる方法があります。レッスン３まで説明するつもりはありませんが、問題を解決したスクリプトを書いておきます。OnHeartBeatスロットに設定したスクリプトを以下のスクリプトに置き換えるだけです。

int nCount=GetLocalInt(OBJECT_SELF, "SINGER_COUNT");
void main()
{
  nCount = nCount + 1;
  if (nCount == 1)
  {
    ActionSpeakString("今初めて話しました。");
  }
  else
  {
    ActionSpeakString("私は " + IntToString(nCount) + " 回話しました。");
  }
  SetLocalInt(OBJECT_SELF, "SINGER_COUNT", nCount);
}

説明無しでもいくらか理解できると期待しています。実際、このスクリプトを完全に理解したら、自分自身のスクリプトを書く方法を80% は理解していると言ってもいいでしょう。

author: Celowin, editor: Iskander Merriman, JP team: katsu794


Tutorial - Celowin - Part III: Conditionals

Home > Lyceum > Tutorial > スクリプト入門 > Celowin - パート ３: 条件

Celowin - パート ３: 条件

前置き

この一連のレッスンの目的は、全くの初心者をプログラミングの世界に誘い、モジュールを作成するためにNWNのスクリプトをどのように使うかを教えることです。初めの 部分のレッスンはとても基本的なものになると思われるので、何かのプログラムを書いたことがある人は飛ばしても構わないでしょう。これらのレッスンの最終目的は、プログラムと聞いただけで身震いするような人々でも学べる場を提供することです。

これらのレッスンをフォーラムに掲示したり、印刷したり、修正を加えることは大いに構いません。しかし、その際には私が作成したということをどこかで触れて下さい。良い悪いを含めて、これらのレッスンについて何かコメントがあれば私に送って下さい。Celowin.

これらのレッスンは、オーロラツールセットをある程度触っている人を想定して書かれています。これらのレッスンにおいて解りにくい部分があるという意見が多数寄せられれば、必要な部分をさらに詳しく説明することも考えています。

イントロダクション

このレッスンでは、スクリプト作成においてもっとも重要であろうと思われる部分について触れます。それは、ある条件にマッチした時だけコードを実行する方法です。私がフォーラムを見ている限りにおいて、質問の90%位はこのテーマに落ち着くと思います。

レッスン２の最後のスクリプトでこの方法を用いましたが、まだ説明はしていませんでした。私がこのレッスンの最後で紹介したいスクリプトは、ちょっと複雑です。従って、まず概念について少し説明しようと思います。

基本的な条件または、「if文」の構文は以下の通りです。

if ( 条件 )
{
   ある処理;
   他の処理;
   別の処理;
}

(上記は、本当のスクリプトではありません。ただ一般的な考え方を示しているだけです。この種のにせの関数を用いたスクリプト例を、一般的に「疑似コード」と呼んでいます。)

基本的に、「条件」にマッチした場合、スクリプトは{　}に囲まれた部分の処理を実行します。条件が真でなければ、何も行いません。(構文上の注意：初心者は、if ( 条件 )の後にセミコロンを付けるという間違いをしがちです。セミコロンを付けることはできません。)

条件部分には、スクリプトの実行に影響を及ぼす数多くのパターンの条件を指定することができます。このレッスンでその全てをカバーできるとは思っていません。私自身、使える関数を全て知っているかどうか怪しいものです。ここでは、他の人が書いたスクリプトから学ぶことができるように、基本を十分理解することを目標とします。

ほとんどの条件では、比較が使われます。例えば、レッスン２の最後のスクリプトでは以下のような比較を使いました。

if (nCount == 1)

「==」が、２つの等号であることに注目して下さい。レッスン２においては、１つの等号は変数を「設定」するために使っています。２つの等号は、「両側のものが同じであるか？」という問いをします。 (比較)

上の文を見る限りでは、両側は全く異なったものに見えます。一方はテキストで、もう一方は数字です。これらが同じであるかと言う質問がどうしてできるのでしょうか？

ここで、「nCount」は変数であり、実際は数字と等しいことを思い出して下さい。よって、全ては「nCount」に保管されている値に依存するということです。もし「nCount」が1という数字を保管していれば、条件は真となり、指定された処理が実行されます。もし「nCount」が7という数字を保管していれば、条件は偽となり、何の処理も行われません。

条件の実行をテストするポピュラーな方法として、あらかじめ定義された関数を利用するという方法があります。次のスクリプト例で行ってみましょう。

スクリプト例

簡単な条件文を含んだスクリプトを作ってみましょう。スクリプトの中でいくつかの新しい関数を使っていますが、それについては後で説明することにします。まず、スクリプトを実行させるための準備をいくつか行います。

  • ツールセットで、テストモジュールを開きます。
  • 新しいエリアを作って、タイルセットを森林地帯(forest)、大きさを縦4、横 2に設定して、「Test Area 002」という名前を付けます。
  • エリアの端にスタート地点を配置します。
  • もう一方の端に、NPCを配置し、シンプルにコモナーに設定します。
  • NPCのタグをGUARDに変更します。
  • NPCのスクリプトタブを選択し、デフォルトで設定されている全てのスクリプトを削除します。(NPCが望んでいない行動をすることを防ぐためであり、次のレッスンではこのステップを省略できると思います。)
  • OnPerceptionスロットに以下のスクリプトを設定します。
    object oSeen = GetLastPerceived();
void main()
{
   if (GetIsPC(oSeen))
   {
     ActionSpeakString("こんにちは、友よ。");
   }
}
  • いつもの標準化の名前を用いて、tm_guard_op (opはOnPerceptionを表しています)という名前で保存します。
  • Okを押してNPCのプロパティウィンドウを閉じ、モジュールを保存します。そして、モジュールをテストしてみて下さい。

ガードの方へ走ってみます。ガードの近くまで行くと、ガードは挨拶をします。ガードから十分離れたあとに戻ってくると、ガードは再び挨拶をします。しかし、ガードの近くに止まっていると、ガードは何も話しません。

Ｑ＆Ａ方式でスクリプトについて説明したいと思います。

別の新しいイベントスロットが出てきましたね？ OnPerceptionスロットは何をするのですか?

このスロットに設定されたスクリプトは、NPCがゲーム中に何かに気づいた時に実行されます。透明なもの、隠れているもので、NPCがそれに気づかない時には、スクリプトは実行されません。

PCを見た時にNPCに反応させたいので、このスロットを使っています。

最初の行にあるobjectというのは一体何ですか？ 前回main関数の前に何かを書いた時もよく分からなかったのに、また同じことをしているじゃないですか！

新しい「データ型」を使っていることを除いては、前回と同じことをしています。前は、変数に整数を保管しました。今回は、オブジェクトを保管しています。

I前にも言いましたし、これからも何度も言うかもしれませんが、ゲーム内のほとんどの物はオブジェクトです。NPC、プレイヤー、アイテム、ウェイポイント、配置用オブジェクトなど、これらは全てオブジェクトです。ゲーム内の多くの関数は、オブジェクトが何であるかを得るために書かれ、他の多くの関数はオブジェクトを操作するために書かれています。

従ってここでは、oSeen(oで始めているのは、それがオブジェクトであることを連想させるためです)という一時変数に値を保管しています。

GetLastPerceived()の行はどういう意味ですか？

これはBioWareによって書かれた関数です。「Get」で始まる関数は、ある種のデータを返します。ほとんどの関数は説明的な名前を持っています。この関数は、NPCによって最後に見られたオブジェクトを返します。

(注意：この関数は基本的にOnPerceptionスロット以外では使用しないで下さい。)

まとめると、最初の行は、NPCが最後に見たオブジェクトをスクリプトで参照できるように設定しています。

比較の説明に散々時間を掛けたのに、if 文の( )の中にはたった１つの項目しかないじゃないですか！これはどういうことですか？

これは、GetIsPC()関数特有の表現です。この関数は、オブジェクトを入力情報として、それがPCであればTRUE、そうでなければFALSEを返します。

しかし、条件に必要なのはこれだけでいいのです！PCであれば、割り当てられた行の処理が実行されます。PCでなければ、何も実行されません。望むならば、より比較らしく見せるために、以下のように変更することもできます。

if (GetIsPC(oSeen)==TRUE)

if文のチェックはこれで全てですか？ NPCが気づくのはいつもPCとは限らないのでは？

この小さなテストモジュールでは大丈夫です。ガードが気づくのが、PC以外に何もないからです。

このレッスンでは、実際のモジュールで通用するようなスクリプトを書いていこうと思っています。敵対的なゴブリンが近くに来たらどうなるでしょうか？ガードに「友よ」とは 言わせたくないですよね。

友好的なNPCであっても、話す気がしないPCが話しかけてきたら迷惑じゃないでしょうか？

あなたの言いたいことは分かりました！全てのPCが友好的だとは限らないということですね！

良い指摘です。モジュールを少しいじってみましょう。

ガードスクリプトの変更

ここでは、ガードが特定の指輪を持っていないPCを見たときに攻撃するように、モジュールに修正を加えます。PCがその指輪を持っている時だけ、友好的な挨拶をするようにします。

  • ツールセットを起動して、テストモジュールを開きます。そして、Test Area 002を開きます。
  • 始めに、指輪を作ります。「アイテムをペイント」、「その他」、「装飾品類類」、「リング」、「カッパーリング」を選択して、モジュールのスタート地点の近くに配置します。
  • カッパーリングのプロパティを開いて、タグをPASSRINGに変更します。
  • 必要であれば、リングの名前を編集したり、説明を加えたりしても構いません。このスクリプトでは、タグだけが重要です。
  • ガードのプロパティを開いて、スクリプトタブのOnPerceptionスロットのスクリプトを以下に変更します。
    // 「味方か敵か」スクリプト:  tm_guard_op
// このスクリプトはガードのOnPerceptionスロットに設定する必要があります。
//
// ガードはPCがpassringを持っているかどうかをチェックし、持っていなければPCを攻撃します。
object oSeen = GetLastPerceived();
object oRing = GetItemPossessedBy(oSeen, "PASSRING");
void main()
{
   // ガードが見たものがPCでなければ、何も行いません。
   if (GetIsPC(oSeen))
   {
     if (oRing == OBJECT_INVALID)
     {
        // PCがリングを持っていなければ、PCを攻撃します。
       ActionSpeakString("死ね、不法侵入者め！");
       ActionAttack(oSeen);
     }
     else
     {
        // PCがリングを持っていれは、友好的に接します。
       ActionPlayAnimation(ANIMATION_FIREFORGET_GREETING);
       ActionSpeakString("こんにちは、友よ。");
     }
   }
}

スクリプトには新しい関数がいくつか使われています。始めは少し戸惑うかもしれませんが、基本的な構造が理解できれば、これらの関数を自在に使えるようになります。

ともかく、モジュールを保存して、実際に何が起きるかテストしてみて下さい。始めに、地面からリングを拾ってガードに近づいてみて下さい。ガードは友好的な態度を示すでしょう。次に、ガードから離れてリングを捨てます。そして、再びガードに近づいてみて下さい。今回は、ガードがPCを攻撃するでしょう。

解説

また別の初期化をしていますね！もううんざりです！

私が言えるのは、私を信じて下さいということだけです。この初期化がなければ、スクリプトは悪くなってしまいます。そこで、新しい初期化が行われている行を見てみましょう。

object oRing = GetItemPossessedBy(oSeen, "PASSRING");

この行は、オブジェクトを保持する一時変数を設定しています。GetItemPossessedBy()関数は、２つの入力情報を必要とします。１つ目は、アイテムを持っているかどうかを調べたいクリーチャーオブジェクト、２つ目は、調べたいアイテムのタグです。

NPCによって気づかれたPCは、既にoSeenとして定義していますので、oRingはそのPCが持っているPASSRINGというタグのリングを指しています。

PCがリングを持っていない場合はどうなりますか？

それでもGetItemPossessedBy()関数は実行されます。その場合は、OBJECT_INVALIDを返します。「そんなものはない」という意味です。

「//」で始まる行は何ですか？スクリプトというよりは、英文ではないですか？

「//」で始まる行は全て、スクリプトでは無視されます。それらは、「コメント」と呼ばれています。親切なスクリプト作成者は、そこでどんな処理を行っているかをコメントに記述しています。

コメントを書くのはあなた自身のためにもなります。スクリプトを書いたときには完璧に理解しているかもしれませんが、１ヶ月後にスクリプトを修正したいと思った時には、その全てを憶えていない可能性もあるからです。

あなたが書いたスクリプトを他の誰かが見る時に、コメントが書いてあれば親切だといえます。あなたが何をしようとしているかを細かく書けば書くほど、他の人にとっては理解しやすくなります。

main関数のスクリプトは、とても複雑に見えます。{　}で囲まれた部分が４つもあります！どのようにしてそれら全てを覚えればいいのですか？

確かにそうですね。スクリプトが複雑になるほど、このような「入れ子」文が多くなります。見やすくする方法の１つとして、インデントを使うという方法があります。

空白行を入れることによって、スクリプトを「ブロック」単位に分ける人もいます。このスクリプトでは余り効果があるか分かりませんが、私も多少そのようにしています。コメントでブロック分けするのもいい手でしょう。

これらの対策をしても、まだ複雑であることに変わりはないかもしれません。「読む練習を重ねた方がいい」と言う以外は、他に適当な言葉が見つかりません。

elseは何ですか？

elseは、if文の追加形式です。構文は以下のようになります。

if ( 条件 )
{
   処理１;
   処理２;
}
else
{
   代わりの処理１;
   代わりの処理２;
}

基本的に、「if」部分が実行されなければ、「else」部分が代わりに実行されます。

スクリプトのif文全体を解析してみましょう。まず、一時変数oRingがOBJECT_INVALIDと等しいかどうかを調べます。(すなわち、PCがリングを持っていないかどうかを調べます。) もし持っていなければ、PCを攻撃します。

反対に、PCがリングを持っている場合は条件はtrueではないので、「else」部分が実行され、友好的な態度を示します。

多くの人にとって、このようにスクリプトにおいてロジックを追跡することは難しいことです。もっと視覚的にとらえたいというならば、フローチャートを作成すると分かりやすいです。

新しく追加したアクションは何ですか？

関数名が説明的なので幾分か分かると思います。ActionAttack関数は、入力情報に与えたオブジェクトを攻撃させます。 ActionPlayAnimation関数は、NPCにあるアニメーションをさせます。今回は、ANIMATION_FIREFORGET_GREETINGというアニメーションを指定しており、これはただNPCに手を振らせるアニメーションです。

もう一工夫

すでにこのレッスンは長くなりましたが、もう１つ触れておきたいことがあります。(わかりました。私は嘘をついてました...。本当は5,217個位言いたいことがあるのですが、なるべくまとめたいと思います。)

ガードに反対の行動をさせたい場合はどうすればいいのですか？ PCがリングを持っていれば攻撃して、そうでない場合は友好的に接するようにしたい場合は？ 例えば、リングが盗まれた物かもしれないとか？

if文のブロックを間違いなく入れ替えれば、正しく動作するでしょう。しかし、実際は、スクリプトを以下のように１文字変えるだけで実現できます。

if (oRing == OBJECT_INVALID)

を

if (oRing != OBJECT_INVALID)

に変えます。

「!=」は、別の比較演算子です。両方が等しくないかどうかをチェックします。したがって、今回は、PCがリングを持っていれば、ガードはPCを攻撃するということになります。

結論

このレッスンでは多くの新しい手法が出てきてます。しかし、これらをマスターすれば、スクリプトの真のパワーを解き放ったと言ってもいいでしょう。特に、ローカル変数と条件を組み合わせることは、あらゆることができる可能性を秘めています。

分からないことがあれば、いつでも気軽に質問して下さい。出来る限り全ての人に分かるような形で説明したいと思いますが、今までにスクリプトを扱ったことがない人にとっては複雑に感じるかもしれません。私にとって明らかであることでも、他の人にとっては難しいものもあるからです。

レッスン４はもっと簡単になるでしょう。間もなくお披露目できると思います。興味がある人のために話しますと、次のレッスンでは、ユーザー定義イベントについて説明し、それを使ってBioWareによって書かれた複雑なスクリプトを削除せずにNPCにスクリプトを割り当てる方法を述べます。

author: Celowin, editor: Iskander Merriman, JP team: katsu794


Tutorial - Celowin - Part IV: User Defined Events

Home > Lyceum > Tutorial > スクリプト入門 > Celowin - パート ４: ユーザー定義イベント

Celowin - パート ４: ユーザー定義イベント

前置き

この一連のレッスンの目的は、全くの初心者をプログラミングの世界に誘い、モジュールを作成するためにNWNのスクリプトをどのように使うかを教えることです。初めの 部分のレッスンはとても基本的なものになると思われるので、何かのプログラムを書いたことがある人は飛ばしても構わないでしょう。これらのレッスンの最終目的は、プログラムと聞いただけで身震いするような人々でも学べる場を提供することです。

これらのレッスンをフォーラムに掲示したり、印刷したり、修正を加えることは大いに構いません。しかし、その際には私が作成したということをどこかで触れて下さい。良い悪いを含めて、これらのレッスンについて何かコメントがあれば私に送って下さい。Celowin.

これらのレッスンは、オーロラツールセットをある程度触っている人を想定して書かれています。これらのレッスンにおいて解りにくい部分があるという意見が多数寄せられれば、必要な部分をさらに詳しく説明することも考えています。

レッスン３の整理

今までこの一連のレッスンを読んできた人の中で鋭い人は、レッスン３で作ったガードのスクリプトは「まあまあ」ではあるけれども、我々が望むような行動を正確にはしていないことに気づいているでしょう。 ガードは、友好的な時はいつでも２回挨拶をします。注意深い人だけが気づくと思いますが、ここで問題を解決しておいた方がいいでしょう。加えて、別の概念について説明する機会としても利用したいと思います。

まず、ガードが何故そのそうな行動をしたのかを正確に把握し、それをOnPerceptionスロットのスクリプトに要約する必要があります。OnPerceptionスロットのスクリプトが実行される要因としては、以下の４つがあります。

  • NPC何かを見るとき
  • NPCが何かを聞くとき
  • NPCが視界から何かが消えることに気づくとき
  • NPCが何かの音が止むことに気づくとき

したがって、NPCはPCを見て、かつPCの音を聞いたのでスクリプトが２回実行されたのです。重大なことではありませんが、どっちにしろ我々が望んだ行動ではありません。

この問題を次の方法で解決してみましょう。何かを見るときだけ、ガードに反応させます。

if文を入れ子にすることで、このことを実現できますが、既にスクリプトが少し複雑になっています。代わりに、スクリプトに２つのことを同時にチェックさせることにします。つまり、気づかれたオブジェクトがPCで、かつ視認されたということを確認させます。両方の条件が満たされる時だけ、後の処理を行います。

条件に演算子「&&」(シンプルに 'and'と呼びます)を追加することで可能です。条件に用いられる場合、「&&」は、２つの条件を繋ぎ合わせます。両方の条件がtrueの時だけ、全体の条件がtrueとなります。スクリプトを以下のように修正するだけです。

if (GetIsPC(oSeen))

を

if (GetIsPC(oSeen) && GetLastPerceptionSeen())

に修正します。そうすると、スクリプトは、PCがガードに気づかれた時、しかも、他の方法ではなく視認によって気づかれた時だけ処理を実行します。

GetLastPerceptionSeen関数は、視認によって気づかれた場合は、TRUE、そうでない場合はFALSEを返す関数です。

今回は例を示すつもりはありませんが、条件を結び繋げる演算子として「&&」の他に「||」があります。「||」は「or」と読み、いずれかの条件がtrueであれば、trueであるということを意味します。これは、ガードがPCを攻撃する理由が複数ある場合に利用できるかもしれません。(例えば、PCがリングを持っていない場合、PCが村長の首を持っている場合、いずれかの条件が満たされればガードがPCを攻撃するとか)

告白

ここで、私はこれまでのレッスンで嘘をついていたと認めなければなりません。私は何回も、実際のモジュール作成を想定したスクリプトの書き方をしますと言ってきました。しかし、これまで書いてきたスクリプトは、私が最終的に書く形ではないということを白状しなければなりません。

問題は、我々が作ったNPCが大抵の刺激に無反応であるということです。我々がこれまでに作成したガードは、スタートしたらその場に立っているだけで、現実的な行動をしているとは到底言えません。興味があれば次のことを試してみて下さい。ガードのHPとレベルを増強して、モジュールをスタートします。リングを拾って近づくと、ガードは友好的に接するでしょう。それから、ガードを攻撃します。ガードは攻撃されるがままに、その場に立っているだけでです。これは、大抵のNPCに望む行動とは決して言えません。

このようなNPCとなってしまった理由は、BioWareによって丹念に作られたデフォルトのスクリプトを削除したためです。デフォルトのスクリプトには、ほとんどのケースにおいて我々が求めると思われる便利な「標準」の行動が定義されています。 (実際、このレッスンで作成するNPCの中に、デフォルトのスクリプトを削除するものもありますが、他についてはデフォルトのスクリプトを使用します。)

では、どのようにしてデフォルトのスクリプトを削除せずに我々独自の行動を定義すればいいのでしょうか？ それには、「OnUserDefined」スロットのスクリプトを使用します。上手く使えば、OnSpawnのスクリプトを少し修正し、大部分のスクリプトをOnUserDefinedスロットのスクリプトに書くことで、他の全てのスロットのスクリプトを利用することができます。

ここまで、ガードの作成に多くの時間を費やしてきました。先に進んで、あるべき姿に修正してみましょう。

  • テストモジュールを開きます。
  • ガードを削除します。
  • ガードが居た場所に新しいNPCを作成します。(これでデフォルトのスクリプトが復活します。)
  • NPCのタグをGUARDに変更します。
  • 「詳細設定」タブで、ガードのファクションが「コモナー」であることを確認します。
  • スクリプトタブを選択します。
  • OnSpawnスロットのスクリプトを編集します。数多くのスクリプトが書かれていますが、今回はほとんど手を加えません。
  • スクリプト後半から、以下の行を探します。
    //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT);         //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
  • 行の頭の「//」を削除します。(「OPTIONAL」の前にある２番目の「//」は削除しないで下さい。)
  • スクリプトをtm_guard_osという名前で保存します。
  • スクリプトエディタを閉じて、OnUserDefinedスロットを選択します。
  • スクリプトリストの中から、tm_guard_opを選択します。
  • 編集ボタンをクリックして、エディタで開きます。スクリプトをtm_guard_udという名前で保存します。
  • 新しいスロットに設定され、新しいスクリプト名となったのでスクリプトのコメントを更新します。
  • もう一度保存します。
  • 「OK」をクリックしてウィンドウを閉じ、モジュールを保存します。

モジュールをスタートすると、今度はガードがよりリアルな行動をするでしょう。ガードは、我々が書いたスクリプトに従って反応しますが、今回は他の刺激に対しても反応します。ガードを攻撃すれば、反撃してきます。他にも数多くの行動がスクリプトに書かれていますが、それらの多くは内密に行われており、通常は決して気づくことはないでしょう。

では、実際に何を行ったのでしょうか？ OnSpawnスクリプトの「//」を削除するということは、何かの「コメントアウトを外す」ということです。「//」の後のスクリプトは全て無視されると言うことを思い出して下さい。つまり、BioWareはOnSpawnにちょっとした「オプション」を設定しており、その前に「//」をつけることで処理されないようにしたのです。

しかし、今回は処理させたいので、「//」を削除することで「その行を処理して欲しい」と伝えています。

では、その「復活した」行は実際に何を行っているのでしょうか？ それは、「OnPerceptionスロットのスクリプトを実行するときに、OnUserDefinedスロットのスクリプトも実行する」ということです。

より鋭い人は、「NPCに複数の新しい行動をさせたい場合は？つまり、OnPerceptionとOnHeartbeatにおいて、特別な行動をさせたい場合はどうすればいいのでしょうか？」と思うでしょう。

それは可能ですが、少し追加の作業が必要です。スクリプトを単純にするために、NPCの行動も単純にしましょう。６秒毎に「退屈だ」と言い、PCを見たときにお辞儀をするNPCを作成してみます。

  • ツールセットを起動して、NPCを作成し、タグをBOREDに変更します。
  • OnSpawnスロットのスクリプトを編集して、OnHeartBeat と OnPerceptionに該当する行のコメントアウトを外します。
  • それぞれ関連づけられた「数字」を元に該当する行を探します。OnPerceptionが1002で、OnHeartBeatが1001です。
  • スクリプトをtm_bored_osという名前で保存します。.
  • 以下のスクリプトをOnUserDefinedスロットに設定し、tm_bored_udという名前で保存します。:
    // OnUserDefinedスロットに設定するスクリプト: tm_bored_ud
// OnHeartbeatスロットとOnPerceptionスロットのスクリプトから呼ばれます。
//
// NPCは６秒毎に退屈であると不満を言います。
// そして、PCを見たときにお辞儀をします。
//
int nCalledBy=GetUserDefinedEventNumber();
void main()
{
 switch(nCalledBy)
 {
   case 1001:  // OnHeartbeatスロットから呼ばれます。
     ActionSpeakString("退屈だな");
     break;
    //
   case 1002:  // OnPerceptionスロットから呼ばれます。
     object oSeen=GetLastPerceived();
     if (GetIsPC(oSeen) && GetLastPerceptionSeen())
       ActionPlayAnimation(ANIMATION_FIREFORGET_BOW);
     break;
 }
}

Q&A

GetUserDefinedEventNumberとは何ですか？

この数字には注目する必要があります。BioWareはとてもかしこい事をしました。それぞれの異なったスロットからユーザ定義のスクリプトを呼べるようにしただけでなく、呼ばれた時にそれぞれ別々の数字を情報として渡すようにしました。 よって、最初の行で行っているのは、スクリプトがHeartbeat (1001)、または、Perception (1002)のどのスロットから呼ばれたのかを調べています。

switch命令とは何ですか？

ここでは全て詳しく説明するつもりはありません。 基本的に、switch命令は与えられた整数に対して、その数字が含まれている「case」の行に「ジャンプ」します。よって、nCalledByが1001であれば、スクリプトは「case 1001」の行にジャンプします。そして、break文までの間にある処理を実行します。

書式上の注意: switch命令は、{ }で囲まれた部分の処理だけを実行します。また、if文のようにswitchの行の後ろにはセミコロンは必要ありません。

私は、OnUserDefinedスロットのスクリプトを書くとき、例え１つのスロットからしか呼ばれなくても、いつもswitch文を使うようにしています。なぜなら、後で気が変わって複数のスロットから呼ぶようにするかもしれないからです。前もって計画を立てることを怠ったがために、スクリプトをいじくらなければならない羽目になるよりも、今後の可能性を考え準備しておいた方が良いと言えます。

おい、if文に{ } が使われていないじゃないか！

if文の処理が１行しかない場合は、{ }は必要ありません。 私にとっては、{ }があった方が良いと思うときもあれば、ない方が良いと思うときもあります。どちらにしろ、スクリプトをすっきりさせるためです。今回は、{ }があると邪魔だと思ってつけませんでした。

追加例

この時点で、あなたはスクリプトを大分扱えるようになっていると思います。 もうこのレッスンを完全な初心者のレッスンとは呼ぶべきではありません。なぜなら、あなたはもう完全な初心者ではないからです。 まだ、学ぶ必要がある関数や、テクニックは多くあります。しかし、今まで学んできたことを上手く組み合わせれば、クールなことがたくさんできます。

その例をこれから示したいと思います。スクリプトはちょっと複雑で、多くの設定、いくつかの新しい関数を使います。しかし、最後までやる価値はあると思います。

  • テストモジュールを開きます。
  • とりあえずガードからは離れようと思うので、始めに作ったエリアを開きます。
  • 先に作ったSINGER NPCを削除します。
  • スタート地点をペイントします。
  • コモナーのNPCを部屋の一方の角に作成します。
  • 「基本設定」タブで、それぞれ、名をダーツボード、タグをDARTBRD、種族を「人造」、外観を「弓の標的」、性別を「なし」、そして、ポートレイトをpo_PLC_F01_ に変更します。(「配置用オブジェクトとドア」をクリックすると見つかります。)
  • 「詳細設定」タブで、「プロット」をチェックします。
  • 「詳細設定」タブで、ファクション・エディタを開きます。元ファクションを「敵対的」として、新しいファクション「Target」を作成します。Target対コモナー、コモナー対Targetの値を両方とも50に設定します。
  • ダーツボードのファクションをTargetに変更します。
  • 「スクリプト」タブで、デフォルトのスクリプトを全て削除します。(今回は、ダーツボードに暴れたり、人々を攻撃したりさせたくないからです。)
  • 「OnDamaged」スロットのスクリプトを編集して、以下のスクリプトを設定します。
    // OnDamagedスロットに設定するスクリプト: tm_dartbrd_dm
// Dartboard のスクリプト
// 長距離武器で攻撃された時に、「ゴトッ」となります。
//
void main()
{
    if (GetWeaponRanged(GetLastWeaponUsed(GetLastAttacker())))
    {
    SpeakString("**ゴトッ**");
    }
}
  • この時点でモジュールを保存して試すことはできますが、まだクールとは言えません。
  • ダーツボードから1ブロックほど離れたところに、ウェイポイントを作成します。
  • ウェイポイントのタグをDARTWP001に変更します。
  • ウェイポイントの近くにコモナーのNPCを作成します。
  • NPCのタグをDARTPLAYに変更します。
  • たまには「ランダムの名称を作成」ボタンをクリックするのもいいでしょう。
  • 「特技」タブで、「単純武器習熟」を選択します。
  • NPCのポートレイトの下にある「所持品編集」ボタンを押します。
  • 右側から「武器」、「投擲系武器」、「ダーツ」を選択し、左側の「内容」の方にドラッグします。
  • ドラッグしたダーツの上で右クリックしてプロパティを編集し、最大スタック数を3に変更します。
  • OKをクリックし、ダーツをNPCの装備にドラッグします。
  • OKをクリックし、「入れ物の内容」画面を抜けます。.
  • 次にスクリプトタブを選択します。
  • OnSpawnスロットのスクリプトを編集し、HeartBeat(1001)の行のコメントアウトを外します。
  • 同様に次の行のコメントアウトも外します。: SetSpawnInCondition (NW_FLAG_SET_WARNINGS);
  • そして、スクリプトの適当な場所に次の行を追加します。: SetLocalInt(OBJECT_SELF, "DARTSTATE", 1);
  • スクリプトをtm_dartplay_osという名前で保存します。
  • OnUserDefinedスロットのスクリプトを編集して、以下のスクリプトを設定し、tm_dartplay_udという名前で保存します。
    // OnUserDefinedスロットに設定するスクリプト
// tm_dartplay_ud
// NPCにダーツをプレイさせます。OnHeartBeatスロットのスクリプトから呼ばれます。
//
//  ダーツプレイヤーは、所持品のダーツを全て投げます。(スタートは3本です。)
//  そして、dartboardに歩いて行き、3本のダーツを拾って元の場所に戻り、再びダーツを繰り返します。
//
void main()
{
    int nCalledBy = GetUserDefinedEventNumber();
    object oTarget = GetNearestObjectByTag("DARTBRD");
    int nDartsReady = GetLocalInt(OBJECT_SELF, "DARTSTATE");
//
    switch(nCalledBy)
    {
     case 1001:  // OnHeartbeatスロットから呼ばれた場合
       //
       // ダーツを投げる準備が出来ていれば、nDartsReadyは1、そうでなければ2となるでしょう。
       //
       if ((GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND)))
            && (nDartsReady == 1))
          {
             // 右手にダーツを持っていれば、投げる準備が出来ているので、ダーツを投げます。
             ClearAllActions();
             ActionAttack(oTarget, TRUE);
           }
       else
          {
             // 他の場合は、２つのケースがあります。ダーツを切らしたか、
             // ダーツを拾いに行く途中であるかです。既にダーツを拾いに行っているのであれば、
             // その行動を邪魔させないようにしています。
             if (nDartsReady == 1)
              {
                SetLocalInt(OBJECT_SELF, "DARTSTATE", 2);
                ActionMoveToObject(oTarget);
                ActionWait(0.5);
                ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 1.0, 1.0);
                ActionWait(0.5);
                ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 1.0, 1.0);
                ActionWait(0.5);
                ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 1.0, 1.0);
                object oDestination=GetNearestObjectByTag("DARTWP001");
                ActionMoveToObject(oDestination);
                CreateItemOnObject("nw_wthdt001", OBJECT_SELF, 3);
                ActionEquipMostDamagingRanged();
                ActionDoCommand(SetLocalInt(OBJECT_SELF, "DARTSTATE", 1));
              }
            }
       break;
    }
}

さて、これは本当に複雑なスクリプトです。 全てについて説明するつもりはありませんが、いくつかポイント的に説明します。

ローカル変数 DARTSTATEを使って、準備が出来てない時にはダーツを投げないようにしたり、ダーツを拾いに行く行動を邪魔させないようにしています。

ActionDoCommand関数は、驚くほど便利です。この関数は、アクションキューに配置されないコマンドを、キューに配置するように変更します。通常、スクリプトはSetLocalInt関数を見つけると、すぐにローカル変数を設定します。ここでのActionDoCommand関数は、キューに配置されたNPCの行動が全て終わるまで、スクリプトにSetLocalInt関数の処理を待つように伝えます。

CreateItemOnObject関数は、NPCのために新しいダーツを作成するために使われています。「nw_wthdt001」は、ダーツのブループリントで、最後の3はスタック数です。

他の部分は、スクリプトをじっくり追跡出来るときに確認して下さい。新しい関数がいくつかありますが、そのほとんどは説明的な名前です。いずれにしろ、分からないことがあればいつでも質問して下さい。

author: Celowin, editor: Charles Feduke, additional contributor(s): Jenn Jimerson, Sergio Paschoal, JP team: katsu794


Tutorial - Celowin - Part V: Learning on Your Own, Non-NPC Scripts

Home > Lyceum > Tutorial > Beginning Scripting > Celowin - Part V: Learning on Your Own, Non-NPC Scripts

Celowin - Part V: Learning on Your Own, Non-NPC Scripts

Preamble

The purpose of this sequence of lessons is to take a complete beginner to programming, and teach him or her how to use NWNScript to write modules. The early lessons will be very basic, and anyone that has done any coding at all will be able to skip over them. The goal here is to make the lessons so that even the people that just shudder at any type of code can learn.

Feel free to post these lessons on any forum, print them out, or modify them. However, just give me credit for doing them.

Any comments on these lessons, good or bad, can be sent to me, Celowin.

I am going to assume that anyone looking at these lessons has at least played around with the Aurora Toolset a bit. If there is enough feedback that people don't know how to do the simple placements that I have in these lessons, I will consider spelling out in more detail what needs to be done.

Other Resources

I've been getting a lot of requests for help on scripts lately. If I have time I'm glad to help point people in the right direction, but I don't always have the luxury of answering everyone that asks. So, I'm going to take a little bit of time to try and explain where else you can look to figure out what you need. Honestly, over 90% of the questions I see have been asked before, and it is only a matter of finding where the answers have been placed.

Really, there are four main places that you should look for answers, in no particular order:

  • The Scripting FAQ (sticky thread in the scripting forum).
  • The NWN Scripting Forum.
  • The official campaign.
  • The toolset itself.

Let's take a brief look at each of these, and how to use them. [There's also the NWN Lexicon, of course... but you know that already :) - ed.]

The Scripting FAQ

Well, they are called "Frequently Asked Questions" for a reason. The documents that have been compiled here answer many of the most confusing issues in scripting, and many easier issues that are common for people to want to know about. Really, if you have an issue on something, it is a good idea to look here first. There may not be something that specifically deals with what you need to know... but then, there might be. [ed. - most of this information will be reformatted and incorporated into the Lyceum]

Also, don't be afraid to look at a document in the FAQ that doesn't immediately seem applicable to your problem. Odds are, everything in there is something you'll want to do at one time or another. The more you learn about NWNScript, the more it starts to make sense. Often, while reading about how to do something totally unrelated to a problem I'm working on, I see something that can help me. It might be just a function that I wasn't aware of, or it might be a clever use of a variable that inspires me.

Because of the variety of different authors of the documents in the FAQ, some will be a bit beyond your current level of understanding. If so, fine... learn more, and come back to them later. You might be surprised at how much you can pick up on even now, though. Give it a try.

The NWN Scripting Forum

There is a constant stream of people asking questions, and there are many dedicated people answering questions. As I was saying, odds are that any question you are likely to have has been answered already.

How then to find the answer? Well, the search tool is probably a good place to start. It isn't perfectly reliable, but it can't hurt to try.

If I don't find what I'm looking for through the search, then I just start scanning the first few pages of posts. Since the same questions are repeated so frequently, there is actually a good chance that what you are looking for has been answered within the first three pages.

If neither of those works, then, and only then, make a post asking for help. A quick note: the more effort you put out to solve your problem on your own, the more effort people are going to put out to help you. Let me give an example. (Any similarities to actual posts made by people is intended in general, but not meant to make fun of any individuals.)

  • One person posts, and the entire content of the post is "How do u make a lever close a door?"
  • Another person posts, and gives a detailed explanation of what they are trying to accomplish. They describe the tags they have given to their door and to the lever. They explain that they have tried attaching a script to the "OnActivate" of the lever, explain the local variables they have set, and explain what they have attempted to do in order to get the door to close.

I can't speak for everyone, but I'm much more inclined to help out the second person. Even putting aside my bias against the use of "u" as a pronoun, I don't feel any particular sympathy for the first. Maybe that person has spent 15 hours trying to get it to work... but from what he has said, I don't know that. It comes across as "I'm not willing to put any effort into learning it, you do it for me." The second person, on the other hand, I can see is honestly giving it a try. It is easy to identify exactly where the problem is, and because of all the detail, I might even be able to write the code out for the person.

One final note about getting help from the forum: it is polite, though not strictly necessary, to give credit in your comments to the person who helped you fix your script. Just something like:

// On user defined script: tm_guard_ud
// Has a guard growl a warning when it sees a PC wielding a weapon.
//
// Last updated: 7/11/02
// Written by The Great Gatsby
// Some debugging help from Celowin of the NWN Scripting Forum

People who just play through your module will likely never see such credit, but those people that pick through your code will. If you don't know a person's real name, the user name you know them by is fine. It is a good idea, though, to put in a blurb as I did above about where that user name comes from.

The Official Campaign

Over and over again, I see questions like "How do I do (mumble) like they did in (mumble) part of the official campaign?" I have to hope that this type of question is from a lack of knowledge of how to look at the official campaign modules, rather than laziness.

So, here are the steps to making the campaign modules available for opening in the toolset:

  1. Inside your main Neverwinter Nights directory, there is a subdirectory called nwm. This is where the official campaign modules are stored.
  2. Copy the file or files you want to look at from there into the modules folder.
  3. Rename the files in the modules folder from .nwm to .mod (When you do this, you may see the '.mod' file extension disappear, depending on your Windows settings).
  4. Right click on the renamed file, and go to "Properties." Uncheck the "Read Only" box, and then click 'OK'.
  5. Now, whatever chapters you copied over can be opened in the toolset.

You can learn tons from seeing how BioWare did different things. Want to know how to have an NPC initiate a coversation? Look at Pavel from the Prelude. Want to know how to summon in creatures to attack the PCs? Look at Aribeth's conversation from the Prelude. Want to know how to have an NPC follow you until it sees a particular NPC, then head off? Look at the butler or maid from Chapter 1. And so on.... they pulled all sorts of tricks in the campaign, all of them are now available for your perusal.

I personally go to the prelude first if I'm trying to figure something out... for the simple reason that it is faster to load up into the toolset. Certainly, there are lots of tricks used throughout the campaign that were not used in the prelude... but there is a lot of useful information even in that first little introduction to the game.

Sometimes their code can be difficult to follow, particularly for complicated things. However, if you can't figure out how to modify their code, odds are it is a bit above your current level of scripting. Work on something else, and come back to it.

Which actually, brings to mind something I've been meaning to mention for awhile. Usually, when people are starting work on their modules, they right away want to jump to the "cool part" which unfortunately is almost always the most complicated script. You have to learn to walk before you can run, Grasshopper. Not every script in your module is going to be complicated, start out with something easy, even if it seems boring. Work your way up to the more difficult ones. I remember reading awhile ago about someone who wanted his first script to involve six levers, twelve gems, a portal with multiple destinations, and lots of other visual effects. What he was doing was certainly possible, and not even all that difficult... once you know what you're doing. For a first script, though, it would be a logical nightmare.

The Toolset

It may seem a bit strange to think of the toolset as a way to learn about scripting. Honestly, though, this is where I've learned most of what I know. Once you know the basics of scripting, you can pull a lot of information out of the documentation in the toolset, minimal as it may seem.

First off, notice when you are editing a script, there is a long list of functions over on the right side. If you click on any one of those commands, you get a bit of information about that command down at the bottom of the screen. Since most of the functions are pretty logically named, you often just scan the list until you find something that looks appropriate, and then look at it to see how it works.

Let's take an example from the script we're going to be looking at later in the lesson. I want to teleport a PC to a different location. I don't know off the top of my head what function to call to do that, so I start scanning through the list of functions.

We want to move the PC to a location, so ActionMoveToLocation sounds promising. However, we've used Move commands before, and it causes walking rather than a teleport. Right nearby in the list, though, is ActionJumpToLocation, and I have never seen my PCs playing any hopscotch in the game, so let's take a look at that. I click on it over on the right, and down below the following appears:

// The subject will jump to lLocation instantly (even between areas).
// If lLocation is invalid, nothing will happen.
void ActionJumpToLocation(location lLocation);

The first two lines are comments, and tell us a little bit about the function we're looking at. The first line tells us that it is pretty much what we want, the second tells us something special about the behavior. What is the third line, then?

Well, that third line is telling us important information about how to use that function in the code. This really goes back to Lesson 1... the void tells us that there is no "output" from this function – it does something in game, but doesn't give us an answer of any kind. Then comes the name of the function, we knew that already. Then, however, it tells us what kind of inputs we need to pass to the function – we need to give it a location.

We can then hunt further through the function list to find other things that might help us. First off, this is an "Action" command, and so would make the teleport part of the action queue. If we want it to happen immediately, we need to find an alternative... what about just JumpToLocation? What do you know, it is a command.

Next problem is how do we get a location to pass to the function? Most of the functions that return an answer start with "Get" so let's look at that section. Yep, there is a GetLocation command. Again, we can click on it and get information on how to use it.

Hmmmm... the JumpToLocation command doesn't take as an input what it is that you're trying to move. This one is a little bit tough to figure out, but I'll let you look for a bit. If you can't find it, it will be in the final scripts down below.

So, you see, with a little bit of perseverence, and maybe a bit of intuition (which comes with time) we can learn an awful lot about what commands to use. Also, if you're bored sometime, I recommend just looking through the list and clicking on random things that look interesting. Maybe you'll find something that you didn't know about that will make your life easier.

NWN Lexicon

[Iskander:] Chances are you're reading this from the Lexicon... need I say more?

Moving On

OK, enough about places to learn things, let's go ahead and make a script. Everything we've done in previous lessons has all dealt with NPC scripting, so let's try something different. Let's do some placeable scripting, and some trigger scripting.

In general, no matter what you're scripting for, it is pretty much the same. The "triggers" for calling the script vary, and you have to be careful with what OBJECT_SELF refers to, but the basic structure and commands are exactly the same.

In our test module, if you've been following along with what I've been doing, we have two areas that aren't connected in any way. We've just been painting our module start point in whatever area as needed. While that is a great testing tool, it is boring. We could make an area transition from one place to the other... boring, again. So, let's try something a bit more interesting.

How about this: In one of the areas, we'll make two levers, that start in the "off" position. When both levers are moved to the "on" position, we'll summon a portal which a PC can step through to get to the other place. OK, step by step, here we go:

  1. Open the toolset, load up the module, and open the area you want to put your portal (presumably the larger of the two areas).
  2. Put down two "Floor Levers" from the "Placeable Objects", "Containers and Levers" menu
  3. Give one the tag LEVER1, the other LEVER2
  4. Paint a waypoint where you want the portal to appear, and tag it TM_INWP.
  5. Paint a trigger around that waypoint (Click places for segments, after you have it pretty much enclosed, double click to close the polygon). Tag the Trigger PORTTRIG.
  6. Attach this script to the OnUsed handle for each lever (same script for both levers). Save it as tm_lever_ou.
    // OnUsed script: tm_lever_ou
//
// This script sets up levers named LEVER1 and LEVER2.
// They both start deactivated. If both get turned on simultaneously,
// a portal is summoned at the waypoint TM_INWP and the trigger
// PORTTRIG is turned on.
//
// Written by Celowin
// Last Modified: 7/12/02
//
void main()
{
  int nUsed1 = GetLocalInt(OBJECT_SELF, "LEVER_STATE");
  int nUsed2;
  //
  // nUsed1 and nUsed2 are used to temporarily hold the states of the two levers.
  // 0 is off, 1 is on
  // LEVER_STATE is the permanent holding spot for the variables.
  // Each lever stores its own LEVER_STATE
  //
  if(nUsed1 == 0)
  {
    ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    SetLocalInt(OBJECT_SELF, "LEVER_STATE", 1);
    nUsed1 = 1;
  }
  else
  {
    PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
    SetLocalInt(OBJECT_SELF, "LEVER_STATE", 0);
    nUsed1 = 0;
  }
  nUsed1 = GetLocalInt(GetObjectByTag("LEVER1"), "LEVER_STATE");
  nUsed2 = GetLocalInt(GetObjectByTag("LEVER2"), "LEVER_STATE");
  if ((nUsed1 == 1) && (nUsed2 == 1))  // Are both levers on?
  {  // If so, create the portal, and tell the trigger to get ready to port.
    object oPortalSpot = GetWaypointByTag("TM_INWP");
    CreateObject(OBJECT_TYPE_PLACEABLE,"plc_portal",GetLocation(oPortalSpot), TRUE);
    SetLocalInt(GetObjectByTag("PORTTRIG"), "READY", 1);
  }
}

    There are things to discuss about this script, but for the most part I hope the comments make it clear. I'll hold off on explaining everything until the whole shebang has been set up.

  7. Go now to the trigger that you painted.
  8. Open up the properties, and go to the scripts tab there.
  9. Put this script into the "OnEnter" tab. Save it as tm_portal_en.
    // OnEnter script: tm_portal_en
//
// If the portal has been turned on, and a PC enters, warp that PC to
// the waypoint TM_OUTWP
//
// Written by Celowin
// Last Updated: 7/12/02
//
void main()
{
  // Set up the temporary variables that we need.
  object oPC = GetEnteringObject();
  object oDest = GetWaypointByTag("TM_OUTWP");
  int nReady = GetLocalInt(OBJECT_SELF, "READY");

  // Check: Is it a PC and is the portal turned on?
  // If so, cause the PC to jump to the exit.
  if ((nReady == 1) && (GetIsPC(oPC)))
    AssignCommand(oPC, JumpToLocation(GetLocation(oDest)));
}
  10. Almost done. 'OK' out of the trigger.
  11. Now, switch to the other area, where you want to be teleported to.
  12. Paint down a waypoint, and call it TM_OUTWP
  13. Save everything, and go out of the editor.
  14. Load it up, and test it out.

The portal script is really straightforward. The only thing worth mentioning is the "AssignCommand". This is another one of those things that once you find, you wonder how you ever got by without it. Basically, it is used to make something else do an action. In this case, we want the PC to do the JumpToLocation... so we assign the command to the PC. This comes in handy all over the place.

The other script isn't really that hard to parse through either. The key is just the storing of the local variables to keep track of "on" and "off". There are a few things that I think are worth mentioning, though. It is sort of bad form for me to use nUsed1 twice in the script. Once I use it as the state of the current lever, whichever one it is. Later, I used it to mean the state of LEVER1 in particular. Some programmers would whack me with a large stick and say that I should use different variables for these. Why didn't I? Well, just so I can raspberry the programmers that would try to tell me what to do. Seriously, the two uses are close enough to the same thing, and it is a simple enough script, that I felt there was no point in putting in another temporary variable. For a longer script, I probably would.

The other thing worth mentioning is the CreateObject call. For this, we need to understand the difference between "tags" and "blueprint ResRefs". Objects that are in the game have tags. You can find already created things through their tags. However, if something hasn't been made yet it can't have a tag. Imagine a physical nametag... you can't put a nametag on something that doesn't exist yet.

Instead, we have to use a "blueprint", the plan to make the thing, and we need to label the blueprint to identify it uniquely. That is what the "plc_portal" is... it is the blueprint 'resource reference' (ResRef) for the portal object. Note: to find that ResRef, I temporarily painted a portal object somewhere in my Area. I then looked under the properties of that portal to find the ResRef, and deleted the temporary portal. Don't try to look up a ResRef by right-clicking on in the palette and selecting 'Edit Copy'... you'll get the (new) unique ResRef of a copy of the original blueprint - not what you want. As a guide, if you're looking for the ResRef of a standard object it will never end with '001'.

Other than that, I hope things are pretty clear. I tried to comment pretty extensively, so you can follow what I did.

Further Exercises

OK, here is where my background as a teacher comes out.... homework time! I can't force you to do this, but I think it is worthwhile for those of you trying to learn this stuff to maybe take the time to extend what we've done.

So, try to do this: Right now, turning on both levers activates the portal. Fair enough. If we turn one lever on then off, then turn the other lever on, no portal. Still reasonable. However, if we activate both levers so the portal comes on, and then turn off one of the levers, the portal still stays up. This doesn't make as much sense. If you can, try to go through and fix it so that the portal turns off again when you turn off either one of the switches. Of course, it should then be possible to turn it back on again.

Another extension: Right now, our portal is "one way." We go in one place, and come out another. Try to make it two way.

I'd rate the first one as moderately challenging for someone that has followed the lessons so far, the second one as easy.

At any rate, good luck!

author: Celowin, editor: Charles Feduke, additional contributor(s): Iskander Merriman, Mads Eibe Sørensen


Tutorial - Celowin - Part VI: Loops

Home > Lyceum > Tutorial > スクリプト入門 > Celowin - パート ６: ループ

Celowin - パート ６: ループ

前置き

この一連のレッスンの目的は、全くの初心者をプログラミングの世界に誘い、モジュールを作成するためにNWNのスクリプトをどのように使うかを教えることです。初めの 部分のレッスンはとても基本的なものになると思われるので、何かのプログラムを書いたことがある人は飛ばしても構わないでしょう。これらのレッスンの最終目的は、プログラムと聞いただけで身震いするような人々でも学べる場を提供することです。

これらのレッスンをフォーラムに掲示したり、印刷したり、修正を加えることは大いに構いません。しかし、その際には私が作成したということをどこかで触れて下さい。良い悪いを含めて、これらのレッスンについて何かコメントがあれば私に送って下さい。Celowin.

これらのレッスンは、オーロラツールセットをある程度触っている人を想定して書かれています。これらのレッスンにおいて解りにくい部分があるという意見が多数寄せられれば、必要な部分をさらに詳しく説明することも考えています。

今までのレッスンを見逃した人で、興味のある人は、BiowareのスクリプトフォーラムにあるScripting FAQ and Tutorialsを見て下さい。そこに全て置いてあります。[NWN Lexicon's Lyceumにも同様にミラーされていいます。].

警告の言葉

一連のレッスンに、今回の話題を一回分として掲載することに少し狼狽しています。全てはこの「基本のスクリプト」にいきつくと考えています。これまでの５つのレッスンで使われているテクニックは、 今までに作ってきたスクリプトにほどんど集約されています。しかし、今回のレッスンは、中間的な概念について説明するつもりです。それはとても重要なテクニックですが、今までのスクリプトでは使っていません。

私が心配をしている本当の理由は、このレッスンで初めて「危険なスクリプト」について述べるからです。確かに、スクリプトにおけるミスはよくありますし、問題があればスクリプトが思ったように動かないだけです。しかし、ループを使うスクリプトの場合は、本当に困った状態を引き起こす可能性を持っています。

幸運にも、BioWareは手に負えない状態にならないようにコントロールする方法を用意しています。それでも、私がこれから述べる問題について常に十分注意する必要があります。

ループとは何ですか？

簡単な言葉で言えば、ループとはスクリプトのある部分を何回も繰り返し処理させる方法です。まず、一回目の処理を行い、その後再び実行する必要があるかをチェックします。もしそうであれば、再びスタート部分に戻り繰り返し処理を行います。そして、繰り返しを必要としない条件になるまで、繰り返し処理を行い続けます。

ループ処理を書く上でのキーとなる部分は主に、それを何時使うか、そして、ループが正しいタイミングで終わるようにどのように「チェック」の設定を行うかです。特にチェックは重要です。もし間違ったチェックを行ってしまうと、ループを決して「抜ける」ことなく、エラーになるまで同じ処理を延々と繰り返す可能性があります。

ループには２つのタイプがあります。「for ループ」と「while ループ」です。まず最初に頭に浮かぶ質問は、「この２つのタイプをいつどのようにして使い分けするのですか？」ということでしょう。それは簡単なことであり、100%正確なルールを述べることができると思います。しかし、実際は、どのタイプのループを使えばいいのかを分かるためにはいくらかの経験が必要と言えます。また、全てのforループは、whileループでも書けるので、「何故２つもあるのですか？どっちを使えば十分なのですか？」というように困惑してしまいます。

しかし、一般的なルールの指標となるものがあります。このルールは完璧ではありませんが、大抵のケースをカバーできます。ある回数分処理を行わせたいのなら、for ループを使います。処理が何回行われるか知る術がない場合は、while ループを使います。それぞれのタイプについて個別に見てみましょう。

For ループ

for ループのキーポイントは、ループを通じて記録される「インデックス」変数です。

基本的な構文は以下のようになります。

int nIndex;
for (nIndex = 1; nIndex <= 7; nIndex++)
{
  ある処理;
}

少し複雑ですね。それぞれの部分を見てみましょう。

まず、インデックス変数を定義する必要があります。(C言語のプログラマーは、ループ定義の中に変数を定義する習慣があるかもしれませんが、NWNスクリプトでは前もって宣言する必要があります。) 初期値を与える必要はありませんが、変数を設定する必要があります。

for ループには３つの項目があります。最初の(nIndex = 1)は、変数の初期化です。既に変数を設定(宣言')したので、その変数に初期値を与えています。

２番目の(nIndex <= 7)は、条件と呼ばれています。ここで実際にループをいつまで「実行」するかを決定しています。 この条件にマッチしている限り、ループ処理は実行されます。始めから再びループするかどうかを毎回チェックして、条件がtrueでなくなると速やかにループを「終了」させます。よって、今回の場合、何回かのプールを経たあとnIndexは8という値になり、ループは終了します。

最後の(nIndex++)は、毎回のループ処理の最後にスクリプトが行う処理です。「++」については、以前のレッスンで簡単に説明しました。ここでは、変数nIndexを1ずつ増加させます。この部分は、nIndex = nIndex + 1のように置き換えることもできます。しかし、一般的に1ずつ増加させるケースが最も多いので、ほとんどのスクリプト経験者は「++」を使うことを好みます。使うには少し慣れが必要ですが、スクリプトコードをすっきりさせることができます。

結局のところ、ループ内ではどんなことが起こっているのでしょうか？まず、nIndexが1としてスタートします。1は7以下なので、ある処理の部分が実行されます。そして、最初の繰り返しが終わり、nIndexが2に増加します。それから、条件部分に戻ります。2は、まだ7以下なので、ある処理の部分が再び実行されます。２回目の繰り返しが終わり、nIndexが3に増加します。この処理を繰り返しながら、nIndexは4, 5, 6, 7と増えていき、最終的に8になります。この時点の条件チェックで、nIndexは7より大きいので、ループは終了します。

For ループの例

ちょっとややこしくなってきたので、具体的な例を見てみましょう。チェストを壊そうとするキャラクターを罰してみることにします。よって、壊された時に５体のゾンビと５体のスケルトンを召喚するタンスを作成したいと思います。CreateObject関数を10回呼び出すために、ループを使います。(注意: テストするときには、多くのゾンビとスケルトンの攻撃に耐えられるPCが必要だと思います。もし用意できない場合は、呼び出すクリーチャーをニワトリと平民にするか、攻撃に耐えられるPCを作成した方がいいでしょう。)

  1. モジュール内に、タンスを配置します。
  2. プロパティの「錠」タブで、「施錠されている」をチェックし、DCを100にします。
  3. スクリプトタブを選択し、「OnDeath」スロットに以下のスクリプトを設定します。
    // OnDeathスロットに設定するスクリプト: tm_chest_dt
//
// このスクリプトは、タンスを破壊したPCの近くに５体のゾンビと
// ５体のスケルトンを召喚します。
//
// 作成者 Celowin
// 最終更新日: 7/13/02
//
void main()
{
  // 初期化: タンスを破壊したPCのロケーションを得ます。
  // ループの設定をします。
  object oPC = GetLastKiller();
  int nUndeadIndex;
  location lSpawn = GetLocation(oPC);

  // 5回ループします。
  for (nUndeadIndex = 1; nUndeadIndex <= 5; nUndeadIndex++)
  {
    // 毎回のループにおいて、PCのロケーションにゾンビ一体とスケルトン一体を作成します。

    CreateObject(OBJECT_TYPE_CREATURE, "nw_zombie01", lSpawn, TRUE);
    CreateObject(OBJECT_TYPE_CREATURE, "nw_skeleton", lSpawn, TRUE);
  }
}

モジュールを保存してテストしてみて下さい。チェストを破壊すると、突然あなたのキャラクターはアンデッドの大群に囲まれます。簡単ですよね？

先ほどのスクリプトを少し修正してみましょう。５体ずつのスケルトンとゾンビを召喚する代わりに、ゾンビだけを召喚してみましょう。しかし、召喚するゾンビの数はPCのレベルに等しい数にしてみます。ほんんど一緒なので、スクリプト全体は書きません。必要な変更箇所は以下のとおりです。

  1. 「object oPC」から始まる行の下に、次の行を追加します。int nPCLevel = GetHitDice( oPC );
  2. 追加した行を別々の行に分けたいと思うかもしれません。セミコロンが行の終わりに付いている限りは大丈夫です。
  3. そして、ループの設定で、２番目の部分をnUndeadIndex <= nPCLevel; に変更します。
  4. スケルトンを召喚する行をコメントアウトして、必要であればコメントを更新します。これで修正は完了です。

モジュールを異なったキャラクターで２、３回テストして、召喚されるゾンビの数がどのように変わるか確認してみて下さい。

For ループのまとめ

forループを使う場合のキーポイントは、for文内の３つの部分を理解することです。初期化はスタート時に一回行われます。条件は初回を含め、毎回のループでチェックされます。trueであればループ部分が繰り返され、そうでなければ、ループが終了します。３番目の部分は、それぞれのループ処理の最後に実行されます。

あなたが作成したループが間違いなく終わるとは断言できません！もし、条件をnUndeadIndex > 0 に変えたらどうなるでしょうか？変数がいくら増加しても、条件はいつもtrueです。すると、スクリプトはエラーが起きるまでゾンビを召喚し続けるでしょう。ゾンビがどこまで増えるか見るのは楽しいかもしれませんが、そのようなエラーはどんな犠牲を払っても回避すべきです。従って、ループを作成するときは、常に構文のダブルチェックをして下さい。実際にループがどの時点で終わるかを、明確に把握しておく必要があります。

While ループ

While ループは、forループよりもいくらか分かりやすいです。しかし、条件が確かではないので、より使うのは難しいです。以前に、ループを何回行えば良いのか分からない時に、大抵whileループが使われると言いました。少しややこしいので、説明をさせて下さい。エリア内を走っているヘルハウンドの群れがいると想定して下さい。ある祭壇が壊された時に、全てのヘルハウンドが突然死ぬようにしたいとします。この場合の問題は、PCがヘルハウンドを殺すかもしれないので、何体のヘルハウンドが存在しているかが確実に分からない点です。この問題のため、祭壇は破壊されるまで、ヘルハウンドを召喚し続けるでしょう。そして、周りは多くのヘルハウンドで溢れることになるでしょう。

また、実際に「ヘルハウンドを殺す」命令を何回行えばいいのかが分かりません。１回も行わないかもしれませんし、50回行う必要があるかもしれません。そこでwhile ループの出番となります。基本的には、「全滅するまでヘルハウンドを殺し続けなさい」、言い換えれば、「ヘルハウンドが存在している限り、一体ずつ殺し続けなさい」ということを言いたいのです。

while ループの基本的な構文は以下のとおりです。

while (条件)
{
  ある処理;
}

正に単純明快です。スクリプトはwhile ループの条件をチェックします。もしtrueであれば、内部の処理が行われます。そして、条件を再びチェックします。まだtrueであれば、処理を繰り返します。条件がtrueでなくなるまで、処理が繰り返されます。単純ですよね？実際、多くの面で for に似ており、同じ３つの部分を持っています。変数の初期化と更新を自分自身で確認して書く必要があるだけです。

ヘルハウンドについては後ほど触れますので、まず、より単純なものから挑戦してみましょう。PCがクエストを完了したときに、その苦労に対して経験値を与えるのは一般的になっています。PCが一人であれば簡単です。しかし、マルチプレイをしている時はどうでしょうか？どのようにしてそれぞれのPCに確実に報酬を与えればいいのでしょうか？

あなたがこれまでのレッスンをずっと辿ってきているのならば、何人かのNPCが作成されていると思います。(そうでなければ、PASSRINGというタグのリングを作成し、何人かのNPCを作成して下さい。) NPCの中から１人を選んで、簡単な会話を作成します。(あなたがカンバセーション・エディタの使い方を知っていると仮定しています。)

(ルート) 指輪を手に入れましたか？
|-(PCの返答1) いいえ。
| |- ダイアログ終了
|
|-(PCの返答2) はい。
  |- (NPCの返答) ありがとう。

(実際には会話をもう少し膨らましたいと思いますが、あなたの文章作成能力のためにそのままにしておきます。)

PCの返答2の「テキスト表示の条件」で、スクリプトウィザードを使います。条件の中の「所持品」をチェックします。そして、新しいタグにPASSRING を追加します。

NPCの返答「ありがとう」の「テキストによる処理」タブのスクリプトを編集して、以下のスクリプトを書きます。

// 会話スクリプト: tm_guard_c1
// 話しているPCからリングを取り去り、
// 全てのPCに経験値50を与えます。
//
void main()
{
  object oPC = GetFirstPC();
  DestroyObject(GetObjectByTag("PASSRING"));

  while (oPC != OBJECT_INVALID)
  {
    GiveXPToCreature(oPC, 50);
    oPC = GetNextPC();
  }
}

スクリプト、カンバセーション、そしてモジュールを保存して下さい。そして、テストしてみて下さい。本当に適切に動作するかどうか確認するためには、手伝ってくれる友達が必要ですが、自分自身だけでも基本動作は確認できます。

今回はループの基本的な勉強をしなければならないので、DestroyObject関数については触れません。まず、( oPC = GetFirstPC() )で初期化を行っています。( oPC != OBJECT_INVALID )という条件を設定して、( oPC = GetNextPC() )で変数を更新しています。

つまり、このスクリプトは、OBJECT_INVALIDとなるまで、つまり、経験値を与えるPCがいなくなるまでループして、それぞれのPCに経験値50を与えます。

繰り返しになりますが、while ループを書くときには、最終的にループが終わる設定になっていることを必ず確認して下さい。無限ループになるとやっかいです。

演習

ふーむ。私はヘルハウンドのスクリプトを作成しようと思っていましたが、考えれば考えるほど、やらなければならないという気持ちが薄れてきました。実際、基本的には、スクリプト作成に必要なテクニックはこのレッスンのどこかで使われています。どのスロットを使えばいいのか、スクリプトにどんな関数を使うのか、材料は全てあります。よって、あなた自身でやってみて下さい。祭壇と何体かのヘルハウンドをモジュールに作成して、祭壇を破壊するとヘルハウンドが全て死ぬようにしてみて下さい。(祭壇が破壊されるまで、ヘルハウンドを召喚し続ける場合は、難易度は中くらいです。一定のレベルを超えないようにヘルハウンドの数を確認する場合には、難易度がアップします。)

別の演習: トリガーを作成し、トリガーに入った時にモジュール内のPCの数の２倍のクリーチャー(どんな種類でもいいです)を召喚するように設定して下さい。

終わりに

レッスンを進めるにつれて、みなさんからの反応がだんだん少なくなってきています。みんな役に立つと思っているのでしょうか？まだこのレッスンで学んでいるかどうか是非教えて下さい。私を満足させるのは、クールなモジュールを作るために私のレッスンが役に立っているという情報だけです。

実際、私にとって最もほめ言葉となるのは、みんなが学んできた結果を私に見せてもらうことでしょう。私が扱ってきたアイディアを使って、クールなスクリプトを書いて、その作品を私に見せて下さい。レッスン４終了後、ある人が正に私を打ち負かすような、ダーツプレイヤーのスクリプトを拡張したスクリプトを見せてくれました。私は、その人のスクリプト作成の手助けになれてとても良かったと思っています。

とにかく、あたなのスクリプト作成がうまくいっているかどうか情報を下さい。特になければ、私が与えた演習について理解できたかどうかを教えて下さい。

author: Celowin, editor: Charles Feduke, additional contributor(s): Jotham, JP team: katsu794


Tutorial - Celowin - Part VII: Scripting for Items

Home > Lyceum > Tutorial > スクリプト入門 > Celowin - パート ７: アイテムのためのスクリプト

Celowin - パート ７: アイテムのためのスクリプト

前置き

この一連のレッスンの目的は、全くの初心者をプログラミングの世界に誘い、モジュールを作成するためにNWNのスクリプトをどのように使うかを教えることです。初めの 部分のレッスンはとても基本的なものになると思われるので、何かのプログラムを書いたことがある人は飛ばしても構わないでしょう。これらのレッスンの最終目的は、プログラムと聞いただけで身震いするような人々でも学べる場を提供することです。

これらのレッスンをフォーラムに掲示したり、印刷したり、修正を加えることは大いに構いません。しかし、その際には私が作成したということをどこかで触れて下さい。良い悪いを含めて、これらのレッスンについて何かコメントがあれば私に送って下さい。Celowin.

これらのレッスンは、オーロラツールセットをある程度触っている人を想定して書かれています。これらのレッスンにおいて解りにくい部分があるという意見が多数寄せられれば、必要な部分をさらに詳しく説明することも考えています。

今までのレッスンを見逃した人で、興味のある人は、BiowareのスクリプトフォーラムにあるScripting FAQ and Tutorialsを見て下さい。そこに全て置いてあります。[NWN Lexicon's Lyceumにも同様にミラーされていいます。].

イントロダクション

私は、「アイテムにスクリプトを割り当てるためにはどうすればいいでしょうか？」という質問を多く受けます。

単純な答えは「できません。」です。しかし、それでは十分な答えではありませんので、詳しく説明させて下さい。どんな理由であっても(私の推測ではキャラクターのエクスポートにおけるバランス調整のため) [そして、パフォーマンスのため]、BioWareはアイテムに直接スクリプトを設定することを禁止しています。しかし、アイテムのためにスクリプトを書くことはできます。そのためには、幾分遠回りな方法を使う必要があります。

アイテムのプロパティを編集するときの「呪文詠唱」オプションの下に、２つの追加選択があります。特殊な機能と特殊な機能：自身のみです。 これらの２つを使って、全ての種類の特殊な機能を追加することができます。「特殊な機能：自身のみ」は、使われるだけのアイテムのためのものです。ただの「特殊な機能」は使用対象が必要なアイテムのために使います。

アイテムにスクリプトを設定できないのであれば、どのようにしてスクリプトを書くのでしょうか？Well, go to Edit > Module Properties > Events tab, そこにはモジュール全体に設定できるスクリプトスロット一覧があります。その中の１つに「OnActivateItem」というのがあります。今回はこのスロットを使って楽しいことをします。アイテムのためのスクリプトを書くためには、以下の４つの関数を理解する必要があります。

  1. GetItemActivated – この関数は使われたアイテムを返します。
  2. GetItemActivatedTarget – アイテムがオブジェクトに対して使われたのであれば、そのオブジェクトを返します。(もちろんクリーチャーもオブジェクトであることを思い出して下さい。)
  3. GetItemActivatedTargetLocation – アイテムが場所に対して使われたのであれば、そのロケーションを返します。アイテムがオブジェクトに対して使われたのであれば、そのオブジェクトのロケーションを返します。
  4. GetItemActivator – アイテムを使ったPCを返します。

これらはとても簡単な説明なので、例をとおしてそれぞれの機能を見てみましょう。

例 1: 欠点のあるヒーリング・アミュレット

PCをヒーリングできるアミュレットを作ってみましょう。しかし、ちょっと面白くするために、完璧なヒーリングをできないようにしてみます。PCが受けたダメージの半分だけしかヒーリングできないようにして、その力を押さえるために、使用できる回数は１日１回に制限したいと思います。

まず、元となるアイテムを作ります。

  1. アイテム・ウィザードを起動します。
  2. アイテムの種類で、「アミュレット」を選択します。
  3. 「割れたアミュレット」という名前にします。
  4. 「魔法関連」をチェックし、アイテムのレベルを 1-5、アイテムの品質を低に設定します。
  5. 次の画面で、その他、装飾品類、アミュレットを選択します。
  6. 最後の画面で、「アイテムのプロパティを起動」をチェックして完了をクリックします。
  7. 「一般」タブで、タグをHEALNECKに変更します。
  8. 「プロパティ」タブで、貸与済みのプロパティを全て削除します。
  9. 「呪文詠唱」、「特殊な機能：自身のみ」を追加します。
  10. 追加したプロパティを選択して、画面下の「プロパティの編集」をクリックします。
  11. 「１日１回まで使用可」を選択して、OKを押します。
  12. テストを楽にするために、「鑑定済み」をチェックします。
  13. OKを押して、アイテムのプロパティ画面を閉じます。

次に、スクリプトを編集するために、編集メニューから「モジュールのプロパティ」を選択して、「イベント」タブを選択し、そして、OnActivateItemスロットに以下のスクリプトを設定します。

// モジュールのOnActivateItemスロットに設定するスクリプト: tm_activate
//
// このスクリプトはモジュール内の特定のアイテムを扱います。
// 現在の特定アイテム:
// 割れたアミュレット
//
// 作成者: Celowin
// 最終更新日: 7/15/02
//
void main()
{
  // 全体的な初期化:  どのアイテムが使われたかを見つける。
  object oUsed = GetItemActivated();

  // 以下のセクションは、割れたアミュレットのためのスクリプトです。
  // アミュレットは、使用された時にPCのダメージの半分をヒーリングします。
  if (GetTag(oUsed) ==  "HEALNECK")
  {
    // まず、PCを得る。
    object oPC = GetItemActivator();

    // PCがどれだけのダメージを受けているかを調べます。ヒーリングするのはその半分です。
    int nDamageTaken = GetMaxHitPoints(oPC)-GetCurrentHitPoints(oPC);
    int nHealing = FloatToInt(IntToFloat(nDamageTaken)/2);

    // ヒーリングを実行し、ちょっとした視覚エフェクトを適用します。
    effect eHeal = EffectHeal(nHealing);
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oPC);
    effect eVisual = EffectVisualEffect(VFX_FNF_SMOKE_PUFF);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVisual, oPC, 1.0);
  }
}

スクリプトを保存して、テストしてみて下さい。(アミュレットをモジュール内に置くことを忘れないで下さい。)

このスクリプトには２点説明した方がいい箇所があります。最初は、次の行です。 int nHealing = FloatToInt ( IntToFloat( nDamageTaken ) / 2 );

基本的なアイディアは単純です。どれだけヒーリングすればいいのかを知るために、ダメージ量の半分の値を算出しています。それでは、IntToFloat と FloatToInt はどういう意味でしょうか？int は整数であることを思い出して下さい。少数値は使用できません。２つの数字を割ったとき、必ず少数部分が出てくると思います。よって、整数を割ると少数部分が出てくる可能性が常にあります。

「float」は、少数部分を持った数字です。割り算をするので、まず整数nDamageTakenを少数値に変換する必要があります。よって、IntToFloat関数を使います。しかし、割り算をしたあとの最終的な結果は整数である必要があります。よって、逆にFloatToInt関数を使っています。この関数は、数字の小数部分を「切断」し、その結果を整数として返します。

実際の数字を例にして使ってみましょう。17ポイントのダメージを受けているPCがいるとします。17を小数に変換すると、17.0になります。それから、17.0を半分に割ります。すると、8.5になります。それを再び整数に戻し、小数部分をカットします。すると、8になります。つまり、8ポイントのダメージがヒーリングされることになります。

２点目は、スクリプトの下部にある「Effect」関数の部分です。オブジェクトに何らかの影響を直接与えたい場合には、エフェクトを使う必要があります。ヒーリング、視覚効果、特殊能力、ノックダウン、これらは全て１つかそれ以上のエフェクトで構成されています。このスクリプトでは、２つのエフェクトを使っています。１つはヒーリング、もう１つはプレイヤーの周りに表示される煙の視覚効果です。(アミュレットは完全な能力を持っていないと仮定しているので、煙がふさわしいと思いました。) それぞれのエフェクト処理は、２つの部分から構成されています。エフェクトの定義部分とPCに適用する部分です。

ヒーリングのエフェクトを使うときには、まず、どれくらいヒーリングするかを伝える必要があります。それが、「effect eHeal = EffectHeal(nHealing);'」です。そして、「ApplyEffectToObject ( DURATION_TYPE_INSTANT , eHeal, oPC);.」で、PCをヒーリングしています。エフェクトを適用する場合、DURATION_TYPE_INSTANT は、エフェクトが即座に適用され終了するということを意味しています。eHeal は、定義したエフェクトです。そして、oPC はエフェクトの対象です。

２番目のエフェクトも似ています。煙の視覚効果を定義して、それをPCに適用しています。このエフェクトは何秒間か持続します。よって、_TEMPORARY が設定されています。そして、エフェクトと対象を指定しています。最後の数字は、エフェクトの持続時間です。

数多くの使用可能なエフェクトがあるので、使用したいエフェクトを捜すのはとても苦労しますが、全てのエフェクトは、基本的には同じ方法で使用します。

例 ２: アルフレッドのリング

スクリプト作成にだけ関心がある人は、この段落は飛ばして下さい。この段落は、私の古い友人の一人で、素晴らしいD&DそしてDMであった人を思い出しながら書きたいと思います。彼がユーモアのあるキャンペーンに参加した時の話です。不運にも、私はそのキャンペーンに参加していなかったのですが、数多くの話を聞きました。彼のキャラクターは「Alfred the were-chicken」でした。キャラクターのバックストーリーは覚えていませんが、全ての獣人的なパワーを当たり前のように持っていました。満月に変身し、銀の武器以外は効き目がなく、そしてもちろん、特定の動物をコントロールできました。AD&D1stエディッションのプレイヤーハンドブックを持っている人なら、１匹のニワトリを家畜にするためのコストを見つけることができます。それは銅のかけら1つです。200の銅のかけらで１ゴールドです。したがって、2ゴールドあれば、400匹のニワトリの大軍を持つことができました。確かに個々のニワトリは大したことありませんが、一度に400匹のニワトリに囲まれ、それら全てにツメで引っかかれ、くちばしで突かれるとしたらどうでしょう。身震いしますね。とにかく、このアイテムはその「Alfred the were-chicken」の思い出です。

このリングの能力はニワトリを召喚することです。地面をクリックすると、そこにニワトリを召喚します。クリーチャーをクリックすると、ニワトリはクリーチャーを攻撃します。(ちょっと待って下さい。ニワトリが勇敢に戦うかは分かりません。)

先に進んで、アイテムを作りましょう。基本的に、最初に作ったアイテムと作り方は同じですので、ステップ・バイ・ステップでは説明しません。アルフレッドのリングという名前のリングを作って、タグをCHCKRINGにして、１日１回使用の制限はかけません。(役に立つクリーチャーであれば、バランスを崩すでしょうが、ニワトリなら大丈夫ですよね？)

このアイテムを機能させるためには、同じスクリプトに以下のスクリプトを追加する必要があります。

// 以下のセクションは、アルフレッドのリングのためのスクリプトです。
// ニワトリを召喚します。クリーチャーに対して使うとニワトリはクリーチャーを攻撃します。
if (GetTag(oUsed) == "CHCKRING")
  {
    // リングが何処に使われたかを調べます。
    location lTarget = GetItemActivatedTargetLocation();

    // 出現エフェクトを設定します。
    effect eChickIn = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);

    // ニワトリを召喚します。
    object oNewChicken = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", lTarget, TRUE);

    // リングの使用対象がクリーチャーであれば、ニワトリは少し間隔を置いて召喚されます。
    // よって、ロケーションを更新して、エフェクトを適用します。
    lTarget = GetLocation(oNewChicken);
    ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eChickIn, lTarget, 1.5);

    // 最後に、対象となっているオブジェクトがあるかどうかを調べ、あれば攻撃します。
    object oEnemy = GetItemActivatedTarget();
    if (GetIsObjectValid(oEnemy))
      AssignCommand(oNewChicken, ActionAttack(oEnemy));
  }

スクリプトの頭部分のコメントも更新して下さい。(毎回更新するのが面倒なのは知っていますが、内容を頭の中に入れる良い練習になります。)

次に進んで、モジュールを保存し、テストしてみて下さい。(テストするときの注意: ニワトリは実際には、友好的な物に対しては攻撃しません。よって、上手く攻撃するようにファクションを少しいじる必要があります。一度試してみると面白いです。ニワトリは攻撃はしますが、その後怯えて逃げ出します。)

いくつかの注意事項

スクリプトで実現可能な色々なアイテムのアイディアが湧いてくると思いますが、それらのアイテムはモジュール内においては２、３個作成する位に、自分自身で制限すべきです。１つの理由は、バランスです。そのようなアイテムを多く作成すればするほど、キャラの個性が薄れていきます。別の理由は、作業能率です。全てのエフェクトが１つのスクリプトに書かれるので、多くのアイテムを作成するとそれだけスクリプトが巨大になってしまいます。

その他の注意事項は、アイテムに関するスクリプトは別のモジュールで動くとは限らないということです。もちろん、OnActivateItemスロットのスクリプトを他のモジュールにカット・アンド・ペーストすることはできますが、それだけでは上手く動作しないでしょう。

これらの理由で、特殊な機能をアイテムに与えるときは、プロット・アイテムとして使うのが一般的です。強制ではありませんが、考慮する必要はあるかもしれません。

演習

これらのアイテムをどのように利用するかは、自分自身のアイディアがあると思いますが、必要であれば以下の演習にトライしてみて下さい。

  1. 異なった場所に２つの祭壇を作ります。いずれか１つに祈ることで、そこがPCの召還地点として設定されます。そして、あるアイテムを使うとその召還地点にPCがテレポートするようにして下さい。(中くらいの難易度)
  2. PCがアルフレッドのリングを使うことに夢中になると、多くのニワトリが出現し、ゲームのパフォーマンスに影響を与えるに違いありません。一定時間経過後に、ニワトリの召喚が解除されるように修正してみて下さい。(正しい関数を見つけられれば簡単です。)
  3. 使うと対象をヒーリングしますが、使用者から経験値100を取り去るワンドを作って下さい。(中くらいの難易度。ワンドにビームのエフェクトを加えると難易度は高くなります。)

いずれにしろ、楽しみながらやって下さい。

author: Celowin, editor: Charles Feduke, JP team: katsu794


Tutorial - Celowin - Part VIII: Functions

Home > Lyceum > Tutorial > スクリプト入門 > Celowin - パート ８: 関数

Celowin - パート ８: 関数

前置き

この一連のレッスンの目的は、全くの初心者をプログラミングの世界に誘い、モジュールを作成するためにNWNのスクリプトをどのように使うかを教えることです。初めの 部分のレッスンはとても基本的なものになると思われるので、何かのプログラムを書いたことがある人は飛ばしても構わないでしょう。これらのレッスンの最終目的は、プログラムと聞いただけで身震いするような人々でも学べる場を提供することです。

これらのレッスンをフォーラムに掲示したり、印刷したり、修正を加えることは大いに構いません。しかし、その際には私が作成したということをどこかで触れて下さい。良い悪いを含めて、これらのレッスンについて何かコメントがあれば私に送って下さい。Celowin.

これらのレッスンは、オーロラツールセットをある程度触っている人を想定して書かれています。これらのレッスンにおいて解りにくい部分があるという意見が多数寄せられれば、必要な部分をさらに詳しく説明することも考えています。

今までのレッスンを見逃した人で、興味のある人は、BiowareのスクリプトフォーラムにあるScripting FAQ and Tutorialsを見て下さい。そこに全て置いてあります。[NWN Lexicon's Lyceumにも同様にミラーされていいます。].

イントロダクション

このレッスンは難しいものになると思います。レッスン１からずっと、我々はBioWareが作成した関数を使ってきました。今回は、自分自身の関数を書く方法を学ぼうと思います。

このレッスンについて、私が言うことを全て理解できなくても心配しないで下さい。今回のテーマは決して１回では理解できません。そして、事実、分かるまでには多くの練習を要します。頭に入らないと感じたら、少しの間離れてみて下さい。他のことをやって後に、再び取り組んで下さい。

始める前に少し注意事項があります。例え関数を書いたとしても、それは「ローカル」でしか使えません。例えば、特定のスロットのためにスクリプトを書いていると想定して下さい。それは、NPCのOnPerceptionスロットだとします。我々はそのスロットで使うために関数を書きます。そのスクリプトの「main」関数の中では使うことができますが、他の場所では使うことはできません。そのNPCの他のスロットでは使うことができませんし、別のNPCのOnPerceptionスロットでも使うことはできません。

そうです。このことは、関数を書く際に多くの制限を設けてしまいます。しかし、同時に、それは多くの可能性を広げているとも言えます。心配いりません。将来のレッスンで、もっと普通に便利な関数を書く方法を説明したいと思います。しかし、ここでは一歩一歩進まなければなりません。

関数の定義

全ての関数は以下のような行から始まります。

void GateIn(string sBluePrint, location lGate)

短い行ですが、多くの複雑な概念が詰め込まれています。

始めの部分のvoid は、その関数の出力が何であるかを示しています。この場合は、出力は .... うーん ... 何もないです。この部分には、int、float、object、eventなど全てのデータタイプを使用することができます。最も一般的なのはvoidで、このレッスンではvoidだけを扱おうと思います。

次の部分、GateInは関数の名前です。名前を一度定義すると、BioWareが定義した関数のように、この名前を使って関数を呼び出すことができます。(繰り返しになりますが、現在のスロットのスクリプト中でしかその関数は使えないという制限があることを忘れないで下さい。)

( )の中の部分は、最も理解するのが難しい部分です。ここで、関数の入力を設定しています。(これらの専門的な名称は、「パラメーター」ですが、覚えなくてもいいでしょう。) ここでは、関数に２つの入力があるということを宣言しています。１つは文字列で、もう１つはロケーションです。

ここまではいいでしょう。ここから難しい部分に入ります。実際に関数を書く前に、その関数がどんな動作をするかを理解する必要があります。恐らく、我々はこれらの入力を元に何らかの処理をする関数を書いています。そうでなければ、それらの入力は必要ありません。

スクリプトのどこかで、以下のように関数を呼び出すと想定して下さい。

GateIn("nw_fireelder", lSummonPoint);

そうすると、文字列"nw_fireelder"が１つめの入力です。事実上、関数が最初に行うことはsBluePrint を"nw_fireelder"を設定することです。関数の何処においても、"nw_fireelder"を表す変数としてsBluePrintを使うことができます。２つめの入力も同じです。lGateは、lSummonPointが保持している何らかのロケーションに設定されます。

関数の定義２

さて、関数全体を見てみましょう。

// この関数はsBluePrintで与えられたブループリントのクリーチャーを
// ロケーションlGateに召喚します。そして、召喚されたクリーチャーは、
// この関数を呼び出したオブジェクトに最も近いPCを攻撃します。
//
void GateIn(string sBluePrint, location lGate)
{
  // クリーチャーを作成します。
  object oNewCreature = CreateObject(OBJECT_TYPE_CREATURE, sBluePrint, lGate);

  // 最も近いPCを見つけます。
  object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF);

  // クリーチャーにPCを攻撃させます。
  AssignCommand(oNewCreature, ActionAttack(oPC));
}

上の関数を入力してコンパイルしようとすると、次のエラーメッセージが表示されるでしょう。ERROR: NO FUNCTION MAIN() IN SCRIPT 関数自体だけでは、スクリプトにはなりません。void main()が必要ですが、今は関数自体だけを見てみたいと思います。

おそらく、最も重要な部分は、オブジェクトを作成している最初の行でしょう。ここでは、過去に何度も使ったCreateObject関数を使っていますが、我々の関数の入力情報を与えています。GateInに入力を与えると、それらはCreateObject関数に与えられます。ややこしいと思うかもしれませんが、ここで我々の作った関数の真の力が発揮されます。GateIn関数に異なった入力を与えることによって、異なったクリーチャーを何度も呼び出せるのです。

「object oPC =」で始まる次の行は長いですが、「OBJECT_SELFに最も近いPCを見つけなさい」と言っているだけです。GateIn関数をどんなオブジェクトが呼ぶか分からないので、OBJECT_SELFは何になるか分かりません。

最後に、先ほど見つけたPCを攻撃するように、作成されたクリーチャーに伝えています。

挑戦してみよう

ここでは、先ほど作成した関数を使って少し複雑なスクリプトを書いてみます。もっと簡単な方法があるに違いありませんが、何故その関数を使いたいかの例を示したいと思います。

  1. ツールセットを起動します。
  2. まず、アイテムウィザードを使って、雑貨（中）を作ります。
  3. アイテムの名前を、「魔法使いの頭蓋骨」にします。
  4. パレットのカテゴリー選択で、プロットアイテムに設定します。
  5. ウィザードを終了して、プロパティを編集します。
  6. タグをALTSKULLにします。
  7. 外観タブでiit_midmisc_021を選択します。
  8. OKを押して、ウィンドウを閉じます。
  9. ウェイポイントを作成して、タグをALTSUMWPにします。
  10. ウェイポイントの側に祭壇を作成して、プロパティを編集します。
  11. 祭壇のタグをSUMMALTRにします。
  12. 「使用可」と「入れ物」をチェックします。
  13. 祭壇の所持品編集ボタンを押して、先ほど作った頭蓋骨を入れます。
  14. 「OK」を押して所持品編集を抜け、スクリプトタブを選択します。
  15. OnDisturbedスロットに以下のスクリプトを書きます。
    // OnDisturbedスロットに設定するスクリプト: tm_summaltr_ds
//
// このスクリプトは、祭壇から頭蓋骨ALTSKULLが取り去られた時に
// 10種類のクリーチャーの中からランダムに1種類のクリーチャーを選んで召喚します。
// クリーチャーはウェイポイントALTSUMWPに召喚されます。
//
//
// 作成者 Celowin
// 最終更新日: 7/16/02

// この関数はsBluePrintで与えられたブループリントのクリーチャーを
// ロケーションlGateに召喚します。そして、召喚されたクリーチャーは、
// この関数を呼び出したオブジェクトに最も近いPCを攻撃します。
//
void GateIn(string sBluePrint, location lGate)
{
  // クリーチャーを作成します。
  object oNewCreature = CreateObject(OBJECT_TYPE_CREATURE, sBluePrint, lGate);
  // 最も近いPCを見つけます。
  object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF);
  // クリーチャーにPCを攻撃させます。
  AssignCommand(oNewCreature, ActionAttack(oPC));
} // GateIn関数の終わり

// ここからはmain関数
void main()
{
  // 祭壇の中に骸骨があれば問題ないので、何もしません。
  // OBJECT_SELFは祭壇を参照しています。
  if (GetItemPossessor(GetObjectByTag("ALTSKULL")) != OBJECT_SELF)
  {
   // ウェイポイントを通じて召喚場所を見つけます。
  location lSummonPoint = GetLocation(GetWaypointByTag("ALTSUMWP"));

  // 召喚する時の視覚エフェクトを作成します。
  effect eGate = EffectVisualEffect(VFX_FNF_SUMMON_GATE);
  ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eGate, lSummonPoint, 3.0);

  // 召喚するクリーチャーを決めるためにランダムな数を決定します。
  int nCreature = d10();
  switch(nCreature)
    {
    case 1:  // ポーラーベアーを召喚します。
      DelayCommand(3.0,GateIn("nw_bearpolar", lSummonPoint));
      break;
    case 2:  // ウシを召喚します。
      DelayCommand(3.0,GateIn("nw_cow", lSummonPoint));
      break;
    case 3:  // ボーンゴーレムを召喚します。
      DelayCommand(3.0,GateIn("nw_golbone", lSummonPoint));
      break;
    case 4:  // エルダー・ファイアーエレメンタルを召喚します。
      DelayCommand(3.0,GateIn("nw_fireelder", lSummonPoint));
      break;
    case 5:  // オーガ・ハイメイジを召喚します。
      DelayCommand(3.0,GateIn("nw_ogremageboss", lSummonPoint));
      break;
    case 6:  // ユアンティ・メイジを召喚します。
      DelayCommand(3.0,GateIn("nw_yuan_ti002", lSummonPoint));
      break;
    case 7:  // スピッティング・ファイアービートルを召喚します。
      DelayCommand(3.0,GateIn("nw_btlfire02", lSummonPoint));
      break;
    case 8:  // クレンシャーを召喚します。
      DelayCommand(3.0,GateIn("nw_kreshar", lSummonPoint));
      break;
    case 9:  // ワーキャットを召喚します。
      DelayCommand(3.0,GateIn("nw_werecat001", lSummonPoint));
      break;
    case 10:  // ハイリッチを召喚します。
      DelayCommand(3.0,GateIn("nw_lichboss", lSummonPoint));
      break;
    } // switch文の終わり
  } // if文の終わり
} // main関数の終わり

全てを保存して、モジュールをテストしてみて下さい。祭壇から頭蓋骨を取り去ると、10種類のクリーチャーの中からランダムに1種類のクリーチャーが召喚され、PCを攻撃します。(もちろん、ウシは攻撃しないでしょうが、その他のクリーチャーは攻撃するでしょう。)

まず、誰が頭蓋骨を持っているかを調べます。祭壇以外が頭蓋骨を持っていれば、if文内部の処理を行います。

召喚時の視覚エフェクトをウェイポイントに作成します。これは前回のレッスンで行ったエフェクト作成と同じ方法です。それから、1から10の間のランダムな数字を決定して、クリーチャーを召喚するためにGateIn関数を呼び出しています。

さて、ここで、何故自分で作成した関数を使いたかったについて述べます。それには２つの理由があります。１つは単純明快な理由で、もう１つは少し複雑な理由です。

まず、１つ目の理由について述べましょう。基本的には、GateIn 関数を呼びだすことで、クリーチャーを召喚する３行のスクリプトを毎回書かなくても済みます。GateIn 関数を呼び出すだけで、クリーチャーを召喚し、ターゲットを見つけ、PCを攻撃することが１度にできます。10種類の場合分けを行っているので、コメント部分を除いても約20行のスクリプトを書かずに済んでいるということになります。

２つ目の理由は、少し理解しにくいです。しかし、基本的に、今回の場合はその関数を使う必要があったということです。スクリプトでは、召喚のゲートが形成されるまで、召喚を遅らせています。なぜなら、そのままだと視覚エフェクトがクリーチャーの姿を覆い隠してしまうからです。つまり、DelayCommand　関数を使う必要があったからです。しかし、DelayCommand 関数は、voidを返す関数にしか使用できません。CreateObject 関数は、オブジェクトを返します。DelayCommand　関数に直接CreateObject 関数を指定するとコンパイルできません。CreateObject関数を別の関数に入れ、その関数がvoidを返すようにすることで、その制限を回避しています。

ここまでの整理

このレッスンは、自分自身の関数を作ったことのない人にとっては、ちょっと複雑過ぎたと思っています。しかし、今回作ったスクリプトは少し修正の必要がありそうです。頭蓋骨が祭壇の中にあれば、全てはＯＫです。祭壇の中に頭蓋骨が残っている限り、アイテムを祭壇の中に入れたり、それを取り出したりできます。そして、頭蓋骨を取り去るやいなや、クリーチャーが召喚されます。特に問題はありません。

しかし、祭壇をいじり続けるとどうなるでしょうか？ 頭蓋骨を持った状態で、他のアイテムを祭壇の中にいれてみると、別のクリーチャーが召喚されるではありませんか！ 入れたアイテムを取り去ると、また別のクリーチャーが召喚されます！これはおそらく望んだ結果ではありません。よって、頭蓋骨が取り去られた時だけクリーチャーが召喚されるように修正してみて下さい。関数全体を修正する必要はありません。ちょっとif文の条件をいじるだけで大丈夫です。

例 2: プロットアイテムを取り去る

青白い顔をして、性格のひねくれたDM (おっと待って下さい。それは私でした。)が、プレイヤーに超現実的な夢の世界を作って見せます。言葉を話すペンギン、怪奇なパズル、クエスト。しかし、結局はプレイヤーは夢の世界から目覚めます。ペンと紙の世界では、夢の世界でプレイヤーが拾ったアイテムを全て取り除くのは簡単です。しかし、NWNにおいてはどうでしょうか？

ちょっと考える必要がありますが、可能です。まず、私は夢の世界の全てのアイテムを似たタグ名にしました。全てのプロットアイテムは、DREAMITM、全ての武器は DREAMWPN、全ての防具は、DREAMARM、そして鍵(１つだけです)は、DREAMKEYというタグにしました。

そして、夢の世界のOnExit スロットに以下のスクリプトを設定しました。

// エリアのOnExitスロットに設定するスクリプト: tm_area002_ex
//
// このスクリプトは、タグがDREAMITM、DREAMWPN、
// DREAMARM、または、DREAMKEYの全てのアイテムをエリアを出たPCから取り去ります。
//
// 作成者 Celowin
// 最終更新日: 7/16/02

// この関数は、オブジェクトoStrippeeからタグsTagのアイテムを
// 全て取り去ります。
void StripItems(object oStrippee, string sTag)
{
  // 初期化: 所持品欄の最初のアイテムを得ます。
  object oCurrentItem = GetFirstItemInInventory(oStrippee);

  // 所持品欄の全てのアイテムに対してループします。
  while (oCurrentItem != OBJECT_INVALID)
  {
   if (GetTag(oCurrentItem) == sTag)
     DestroyObject(oCurrentItem); // 正しいタグのアイテムを破壊します。
   oCurrentItem = GetNextItemInInventory(oStrippee);
  } // whileループの終わり
} // StripItems関数の終わり

void main()
{
  // まず、エリアを出たオブジェクトを得ます。
  object oPC = GetExitingObject();
  if (GetIsPC(oPC))  // それがPCであれば、アイテムを取り去ります。
  {
    StripItems(oPC, "DREAMITM"); // 一般的な夢のアイテム
    StripItems(oPC, "DREAMWPN"); // 夢の武器
    StripItems(oPC, "DREAMARM"); // 夢のアーマー
    StripItems(oPC, "DREAMKEY"); // 夢の鍵
  } // if文の終わり
} // main関数の終わり

(このスクリプトでは、文字列操作を使った方がより良いでしょう。このバージョンは、PCの所持品欄を4回もループするので、効率的ではありません。)

必要であれば試してみることも可能です。DREAM***のアイテムをいくつか作ってモジュールに置き、１つのエリアのOnExitスロットにスクリプトを設定して、プレイしてみて下さい。あなたが残酷なDMならば、プレイヤーから全てのアイテムを取り去るように修正することも簡単にできます。

要約

このレッスンでは、関数の機能の一部を紹介しました。何かを計算するための関数を作ったり、関数のライブラリを作ったり、スクリプトの複雑さを劇的に軽減するために関数を使うこともできます。しかし、関数のパワーは計り知れないので、一度で全てをカバーすることは難しいです。

ほとんどの部分において、みなさんからのフィードバックはポジティブなものです。次の様な、少数派の意見が１つだけ何度も来ました。「私はあなたのレッスンについていけるし、あなたの説明も良いです。だから、どのように、そしてなぜかが理解できます。しかし、それらのテクニックをいつ使えば良いかが分かりません。」

私はそれも説明しようと頑張っていますが、問題はいつもその時間がないということです。スクリプトを十分見ることをできるようになったら、そのテクニックをいつ使えばいいのかが直感的に分かり始めます。それは簡単とは言えません。私は何をしているか分かっている時でさえも、しばしば複雑なスクリプトに取り組んで、何時間もキーボードの前で頭を抱えることもあります。

では、関数を使うときにおける「一般的なルール」とは何でしょうか？それは、あなた自身がやってきたことを見て下さいと私は言うでしょう。もしあなたが同じ事を何度も何度も書いていると気づいたら、簡潔にするために関数を使いたいと思うでしょう。繰り返し書いているスクリプトが例え２、３行であっても、その行を関数として囲むことによって、あなたのスクリプトコードがより簡単に理解できるものになります。

今後について

このレッスンで取り扱うアイディアが尽き果てようとしています。「基本」は、全てカバーしてきましたし、実際、いくつかの高度な概念についても扱い始めています。確かに説明は詳しくないし、表面だけ触れて省いたものもありますが、この時点で、あなたはほとんどのスクリプトを見ることができて、「おい、これが何をするか知っているぜ」と言うことができるだろうと思います。自分自身で一からスクリプトを書くことはできないかもしれませんが、スクリプトを分析して、それがどんな動作をするのか理解することがきっとできるでしょう。

あとは、「include」文について、そして、自分自身の関数ライブラリの書き方について少し説明する必要があると感じていますが、とても複雑なレッスンになるとは思っていません。

従って、突然のインスピレーションが無い限りは、このレッスンは10回位で終わろうと思っています。「続編」シリーズのアイディアもありますが、それは異なったアプローチになると思います。その詳細については、もう少し考え出してからお披露目する予定です。

author: Celowin, editor: Iskander Merriman, JP team: katsu794


Tutorial - Celowin - Part IX: Functions that Return, Default Parameters, Libraries

Home > Lyceum > Tutorial > Beginning Scripting > Celowin - Part IX: Functions that Return, Default Parameters, Libraries

Celowin - Part IX: Functions that Return, Default Parameters, Libraries

Preamble

The purpose of this sequence of lessons is to take a complete beginner to programming, and teach him or her how to use NWNScript to write modules. The early lessons will be very basic, and anyone that has done any coding at all will be able to skip over them. The goal here is to make the lessons so that even the people that just shudder at any type of code can learn.

Feel free to post these lessons on any forum, print them out, or modify them. However, just give me credit for doing them.

Any comments on these lessons, good or bad, can be sent to me, Celowin.

I am going to assume that anyone looking at these lessons has at least played around with the Aurora Toolset a bit. If there is enough feedback that people don't know how to do the simple placements that I have in these lessons, I will consider spelling out in more detail what needs to be done.

For those of you that missed earlier lessons and are interested in looking them up, they have all been placed into the sticky Scripting FAQ and Tutorials post in the Bioware Scripting Forum. [They're also being mirrored here in the NWN Lexicon's Lyceum - ed.].

Introduction

It has been awhile since my last lesson, and this one is going to build heavily on that one. So if you were at all shaky on lesson 8, I recommend re-reading it. You don't have to have it mastered, and in fact I would expect that most people won't be that far along. In fact, I'm hoping that seeing more examples in this lesson will help people that are still a bit confused on the subject. However, if you don't at least get the general idea of the last lesson, this one won't make much sense at all.

We're going to be taking the idea of the function from the last lesson, and extending that idea in a couple of different ways. The last time, we talked about the very basics of using a function, and while there were uses for it, the concept was very limited. Here, we're going to add a few things to make functions much more versatile.

Functions that Return

Up until this point, every function that we've written ourselves has been an "action." That is, it has done things, but it hasn't returned an answer. We specified that our function was an action by declaring it as type void.

My guess is that nearly all of the functions you will end up writing will end up being actions. However, there are a few times when you need to calculate something. Let's do a simple example... suppose we have a mage's guild. As they are fond of their privacy, their tower can only be accessed through a magical portal, and that portal makes sure only to transport in people whose primary focus is magery.

The way I'm going to handle this is to write a function to check the percentage, by level, of a character's magical classes. A pure level 1 Wizard with no multiclass would return 100%. A second level Fighter, third level Sorcerer multiclassed character would return 60%. Both of those would be let in, but the level 7 Rogue, level 2 Wizard would only be 22.22%, and would be left out in the cold.

First, let's write our function. We want it to take in an object (a creature), and spit out the percentage. We'll give the percentage in decimal form. If you remember, a decimal number is type float. So to declare the function, it is:

float GetMagePercent(object oPerson)

Really, the calculation done here is fairly easy. We need to get the total level of the creature passed to the function. We also need the levels of wizard and sorcerer, easily gotten with GetLevelByClass. A simple division, and we have our percentage.

The thing is, how do we tell the function we are writing that the number we found is our "answer"? It is fairly simple... we tell it to return the value. Let's take a look at the entire code.

// This function will return the percent of a creature's
// levels that are mage-related, expressed as a decimal
// number. It will return 0.0 if the object passed to it
// is not a creature.
float GetMagePercent(object oPerson)
{
  int nTotalLevel = GetHitDice(oPerson);
  if (nTotalLevel == 0)  // if not a creature, return 0.0
    return 0.0;
  else  // else, calculate the percent and return it
  {
    int nMageLevel = GetLevelByClass(CLASS_TYPE_WIZARD, oPerson) + GetLevelByClass(CLASS_TYPE_SORCERER, oPerson);
    float fMagePercent = IntToFloat(nMageLevel)/IntToFloat(nTotalLevel);
    return fMagePercent;
  }
}

Most of it should be familiar to you, it is just the last line that is new. We've spent the rest of the script calculating fMagePercent, the last line just says that when the function is called, that will be the output.

A further note on what I did: notice that I am careful about what happens if GetHitDice returns 0. If we use our function properly, that should never happen. However, the more "checks" you put in to deal with errors, the better. It may be that a weapon accidentally gets passed to our function. If that were to happen, we'd get a "division by 0" error, and cause all sorts of havoc.

Now that the function is written, how do we make use of it? Well, pretty much like any BioWare written function. (Again, remember that for the moment, we have to put the whole function code into our script where we want to call it). So, plop down a portal placeable (I actually used a magic sparks, for variety), and put a trigger around it. Paint a waypoint elsewhere, and call it WIZTOWER_WP

Put the following into the OnEnter code for the trigger:

// This function will return the percent of a creature's
// levels that are mage-related, expressed as a decimal
// number. It will return 0.0 if the object passed to it
// is not a creature.
float GetMagePercent(object oPerson)
{
  int nTotalLevel = GetHitDice(oPerson);
  if (nTotalLevel == 0)  // if not a creature, return 0.0
    return 0.0;
  else  // else, calculate the percent and return it
  {
    int nMageLevel = GetLevelByClass(CLASS_TYPE_WIZARD, oPerson) + GetLevelByClass(CLASS_TYPE_SORCERER, oPerson);
    float fMagePercent = IntToFloat(nMageLevel)/IntToFloat(nTotalLevel);
    return fMagePercent;
  }
}

void main()
{
  object oPC = GetEnteringObject();
  if (GetIsPC(oPC) &amp;&amp; (GetMagePercent(oPC) &gt; 0.50))
    AssignCommand(oPC, JumpToLocation(GetLocation(GetWaypointByTag("WIZTOWER_WP"))));
}

It might not be a bad idea to break the AssignCommand line into several steps... first get the waypoint, then the location, and then jump to that location. It is sort of a matter of style... here, I can follow the levels of nesting fairly easily, so I don't feel the need to break it down into steps.

Another Example

Here's another example of a function to calculate something. Sometimes (well, OK, often), I like to be a little bit sadistic to my PCs. I made an imp that had a key that they needed. He offers to sell the key to them, for a certain amount of gold. The kicker is that the gold he asks for is always 1GP more than the entire party has....

So, we need a function for finding the total party gold. Obviously, this will be an integer. There is a function to get the gold from one PC, so we'll just loop through all the PCs, check if they are in the party, and if so add the gold to the count.

Here is my version of the function, then:

// Return the total gold of all PCs in the same party as oPC.
// It will return 0 if the input is not a player character.
int GetPartyGold(object oPC)
{
  if (!GetIsPC(oPC))  // if not a PC, return 0
    return 0;
  else  // loop to get the gold
  {
    object oCharacter = GetFirstPC();
    int nGoldCount = 0;
    while (oCharacter != OBJECT_INVALID)
    {
      if (GetFactionEqual(oPC, oCharacter))  // different parties have different factions
        nGoldCount = nGoldCount + GetGold(oCharacter);
      oCharacter = GetNextPC();
    }
    return nGoldCount;
  }
}

To test this, go ahead and put an NPC into your module. Make a conversation for it, getting as detailed as you want. At some point, put in a node for the NPC to offer to sell the key. Make the text:

"Of course I will sell you the key, mortal. It shall cost you a mere gold coins."

Then, on the "ActionsTaken" tab, put in the following script:

// Return the total gold of all PCs in the same party as oPC.
// It will return 0 if the input is not a player character.
int GetPartyGold(object oPC)
{
  if (!GetIsPC(oPC))  // if not a PC, return 0
    return 0;
  else  // loop to get the gold
  {
    object oCharacter = GetFirstPC();
    int nGoldCount = 0;
    while (oCharacter != OBJECT_INVALID)
    {
      if (GetFactionEqual(oPC, oCharacter))  // different parties have different factions
        nGoldCount = nGoldCount + GetGold(oCharacter);
      oCharacter = GetNextPC();
    }
    return nGoldCount;
  }
}

void main()
{
  object oTalker = GetPCSpeaker();  // Get the speaking PC
  int nPrice = GetPartyGold(oTalker) + 1;  // Set the price to 1 more than party gold
  SetCustomToken(1000,IntToString(nPrice));  // Set the token for the conversation
}

The SetCustomToken is an interesting function... it is only used inside a conversation. Basically, it allows you to stick any kind of text into a conversation. Note in the text of the conversation, we put . When the conversation is "spoken", that will be taken out and replaced with whatever we have set as custom token number 1000.

Thus, that last line of the script is saying to convert the price to a string, and store that price into token 1000.

A note about custom tokens: It is best if you always set the custom token where you are going to use it. While it is possible to set it and refer back to it later, this is generally considered bad form. (Especially when dealing with erfs.) Further, note that tokens 0 through 9 are used by BioWare, and attempting to use them in your conversation can result in unexpected behavior, so it is best to avoid those numbers.

Default Inputs

Here is a very generic little function that is quite handy in many situations.

// Flip a lever (or some other placeables) between two positions.
// The STATE variable on the lever is set to 1 the first time
// the lever is used, and 0 when used again.
//
// Written by Celowin
// Last Updated: 7/23/02
//
void FlipSwitch(object oLever = OBJECT_SELF)
{
  // STATE will be 0 for off, 1 for on
  int nUsed = GetLocalInt(oLever, "STATE");
  if (nUsed == 0)
  {
    AssignCommand(oLever, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
    SetLocalInt(oLever, "STATE", 1);
  }
  else
  {
    AssignCommand(oLever, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
    SetLocalInt(oLever, "STATE", 0);
  }
}

Basically, all this does is takes in as input a placeable (like a lever), and causes it to flip between two states... on and off.

Nothing in this script is all that exciting, but there is a new concept inside the declaration.

void FlipSwitch(object oLever = OBJECT_SELF)

What is the " = OBJECT_SELF" doing there? Basically, it is saying that if no input is given to the function, it is going to assume that the input is OBJECT_SELF.

So, if we have a script on a lever, we could just put the command:

FlipSwitch();

into the script, and it would to the animation and change the state of the lever which the script was attached to.

If, on the other hand, we wanted the switch to flip under some other circumstance (say when a chest was opened), we could put into the script something like:

oRemoteLever = GetObjectByTag("Lever6");

FlipSwitch(oRemoteLever);

You never have to declare this kind of default input, and in fact I would be kind of careful about when I would do so. However, under the right circumstances, it adds another layer of versatility to what you can do with functions.

Another Example

Here's another example of default inputs. I like to add a lot of horror and mystery to my adventures. Most of the time, I go for subtlety, keeping the players guessing as to what is really going on. However, sometimes nothing can beat a good dose of old fashioned gore. Hence, I use the following function once in awhile:

// Kill a creature in an explosion of gore.
//
// oVictim is the target of the effect
// If bAffectPlot is TRUE, then the script will work on
// creatures with the plot flag set.
//
// Written by Celowin
// Last Updated: 7/23/02
//
void BloodExplode(object oVictim = OBJECT_SELF, int bAffectPlot = FALSE)
{
  if ((!GetPlotFlag(oVictim) || bAffectPlot) &amp;&amp; (GetObjectType(oVictim) == OBJECT_TYPE_CREATURE))
  // If the victim doesn't have the plot flag, it works
  // If bAffectPlot is TRUE, it works
  // Only works on creatures
  {
    // Create the effects:  the explosion, and the death
    effect eBloodShower = EffectVisualEffect(VFX_COM_CHUNK_RED_LARGE);
    effect eDeath = EffectDeath();
    // Make sure the victim can be killed
    SetPlotFlag(oVictim, FALSE);
    // Apply the effects
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oVictim);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBloodShower, GetLocation(oVictim));
  }
}

In this function, we have two inputs: the creature we want to explode (defaults to OBJECT_SELF) and a true/false input that says whether we wish it to affect creatures with the plot flag set (defaults to FALSE).

So, any one of these declarations would be exactly the same if used in a script:

BloodExplode();

BloodExplode(OBJECT_SELF);

BloodExplode(OBJECT_SELF, FALSE);

Note that we can leave off as many variables from the end as we want, but we can't leave off an input from the front if we're going to change one of the later ones. That sentence is more confusing than the concept is, so let me try to give an example.

Suppose we want to have a zombie explode when it is hit, regardless of whether the plot flag is set. So, the first input would be OBJECT_SELF (the default) but the second input would be TRUE (non-default). There is no way to actually make use of the default for the first input, since we're changing the second. The only way to declare this would be

BloodExplode(OBJECT_SELF, TRUE);

Something like:

BloodExplode(,TRUE);

is not valid syntax.

The other thing from this function that I should probably talk about is the conditional, the line:

if ( (!GetPlotFlag(oVictim) || bAffectPlot) &amp;&amp; (GetObjectType(oVictim) == OBJECT_TYPE_CREATURE) )

Unless you are really familiar with this stuff, you probably got to this line, scratched your head for a bit, looked at it again, and then gave up on figuring it out. Again, it is sort of a matter of style... I loathe nested ifs. Sometimes they are needed, but if you go overboard on them, it makes your code a nightmare to trace through. Perhaps it is the fact that I have a mathematical background rather than a programming one, but the statement I just wrote is far easier for me to follow than a bunch of ifs inside each other.

So, let's break it down. When do we want the script to actually work?

It will only affect creatures.

It will affect creatures without the plot flag set.

If a creature has the plot flag set, it will still affect it if bAffectPlot is TRUE.

The first one of these is immutable. It has to be a creature, otherwise nothing else matters. In other words, it has to be a creature AND other conditions need to be true. The &amp;&amp; stands for logical "and", so the script is checking that the object type of the input is creature, and also something else.

That leaves us with the part of it that reads:

(!GetPlotFlag(oVictim) || bAffectPlot)

The || is "or". If either side of it is true, then this part of the statement is true. bAffectPlot is the input we gave... TRUE or FALSE. If it is true, we don't have anything more to worry about. The !GetPlotFlag(oVictim) is saying that if oVictim does not have the plot flag, it will be true. (The ! in front sort of "flips" what we are looking for. Without the !, it would be true if oVictim did have the plot flag.)

So, putting it all together.... it has to be a creature, AND either that creature doesn't have the plot flag OR the function is set to affect things with the plot flag. Confusing, but if you learn to use the logical operators, your code will be much cleaner.

Function Libraries

Over and over again, to use our functions we have had to put them into the script where we were going to use them. While they can still be useful, this is kind of limiting.

In particular, both the FlipSwitch and BloodExplode are functions that you might want to use over and over again, in all sorts of places in the module. (Well, maybe most people wouldn't use the BloodExplode as much as I do, but anyway...) Sure, we can cut and paste again and again, but there is a better way.

Before I begin, just a general note: I only put things into a library like this if I'm going to be using them in many different scripts. If I'm only going to use a function in one place, I won't worry about it at all. If I'm going to be using that function in two or three scripts, I'll probably just cut and paste it to where I'm going to need it. It is only the ones that I use repeatedly that I end up putting into a library.

Let's go ahead and set up a simple library to use in our module. Edit a new script, call it something like "tm_myfunctions". Cut and paste both the FlipSwitch function and the BloodExplode function into it. Save it.

When you try to save, it will pop up with something like NO FUNCTION MAIN() IN SCRIPT. Just ignore it.

Now for the cool part. Now, in any script we write, we can put at the top the line

#include "tm_myfunctions"

And we can use any function we've put into that file!

So, as a simple example, suppose I want to pull a lever and make the nearest zombie explode. (I'll give the zombie the tag ZOMBOMB, and the lever the tag ZOMBLEV.) The script is then simplicity in itself:

// tm_zomblev_ou
// Destroy the nearest zombie with tag ZOMBOMB to the lever.
//
// Written by Celowin
// Last Updated: 7/23/02
//
#include "tm_myfunctions"
void main()
{
  FlipSwitch();
  if (GetLocalInt(OBJECT_SELF, "STATE") == 1)
  {
    object oZomb = GetNearestObjectByTag("ZOMBOMB");
    BloodExplode(oZomb);
  }
}

Basically, all the #include does is take the text of the file and stick it in place of itself. In essence, it does the "cut and paste" for you.

Warnings about Libraries

As amazingly useful as libraries are, there are a few things you have to be very careful about.

First, I'm going to reiterate what I said before: only put functions that you are going to use and reuse into your libraries. The larger your libraries get, the longer they take to compile. In a big module, this gets annoying very fast.

Even if you're only putting in repeatedly used functions, you might find a library getting large and clunky. If so, consider breaking it down into smaller libraries: one for creatures, one for placeables, one for doors... or however else you want to divide it. It is up to you, whatever helps you to know what library to use for the function you want.

Along with that, also realize that since the include statement is just sticking in text, there is no reason why you have to restrict yourself one include statement in your script.

#include "tm_creaturelib"

#include "tm_doorlib"

would be perfectly acceptable.

Finally, a very important point that many non-programmers forget about... if you modify your library, you should recompile any script that includes that library. This could get ugly, since it is very easy to lose track of what scripts call your libraries. Luckily, there is a way around it.

In the toolset, there is a "Build" button. This basically says "recompile all of the scripts for this module." Hence, if you ever modify a library, you should immediately hit that Build button to make sure everything "checks out." Again, you will get error messages that the libraries themselves have no void main() in them... but as long as that is the only error message you get, you're set.

Onward

This lesson has been huge and has a lot of little concepts. I want to stress for the people reading that if you don't understand everything in the lesson, you're probably not hurting yourself too badly. While the things here can certainly make your scripting lives easier, none of them are strictly needed. Definitely attempt to learn it, and ask questions if you're having problems, but if you feel you're in over your head it isn't the end of the world.

I think my next lesson is going to be on henchmen, if I can figure it out. I really don't think there is a lot of actual scripting that has to be done to set up a henchman, but I'm sick of seeing 50 questions a day on the subject.

After that, I'm going to change the format of the lessons. You really have almost all the general syntax needed for scripting at this point, so there really isn't a whole lot more I can do in that regard. Instead, I'm going to focus more on the "scripting process."

I'll start with an idea, talk about design considerations, limiting the scope, and implementation. (I'll probably go light on the debugging phase, because the forum moderators wouldn't appreciate the amount of profanity that is involved in my debugging methods.)

author: Celowin, editor: Iskander Merriman


Tutorial - BubaDragons guide to NWNScript Debugging

Home > Lyceum > Tutorial > スクリプト入門 > BubaDragons NWNスクリプトのデバッギングガイド

BubaDragons NWNスクリプトのデバッギングガイド

BubaDragons guide to NWNScript Debugging

概要

NWNのスクリプトのトラブルシューティングは、やりがいがありますし、時間を要します。この作業を能率のいい方法で行うことで、スクリプトのバグを見つけ修正することで生じるフラストレーションを減らすことができます。このドキュメントでは、スクリプトのトラブルシューティングにおける基本的な発見的方法と、いくつかのサンプルシナリオについて説明します。

読者の前提

このドキュメントは、オーロラツールセットに慣れ親しんでいて、スクリプト言語の基本を理解している読者を想定して書かれています。このドキュメントは、スクリプトの基本を教えるというよりはむしろ、スクリプトのエラーの原因を見つけるプロセス、そして、エラーの修正方法についての説明に力を注いでいます。

トラブルシューティングとは？

プログラムのトラブルシューティング、あるいは、デバッギング*とは、プログラムコードのエラー箇所を見つけて、それを修正、または、回避するプロセスをいいます。デバッグとは、問題を発見し、それを隔離して、それを修正することです。スクリプトにエラーが起きた時に行う重要な作業は以下のとおりです。

·問題を明らかにする

·問題箇所を隔離する

·問題を修正する

·修正されているかテストする

悲しいことに、このように簡単に述べることは、それを成し遂げることよりよほど簡単です。以下で、私がNWNのスクリプトコードとモジュールに対して 行うトラブルシューティングの方法について述べます。

基本的なトラブルシューティングのガイドライン

明らかなことを疑う

オーロラツールセットを非難したり、BioWareの開発者を呪ったり、スクリプトのエラーのために憂鬱になることを責める前に、以下のリストから可能性のありそうな原因を調べて下さい。

·(=)と(==)の使い分けをチェックする

·全ての文がセミコロン(;)で終わっているか確認する

· 適切な型、適切な関数が使われているかチェックする

· 割り当てた変数を間違って呼んでないかチェックする(fooとFooは別の変数)

· スクリプトが呼ばれているか確認する

シンプルに見えますが、私はこの方法で数え切れないくらい問題を解決してきました。

エラーを隔離する

時々この作業だけで問題を解決できることもあります。始めに、問題箇所を関数だけに制限し、それからセクションに広げて、最終的に１行のコードにします。

簡単なテストケースを作ります。問題をテストするために十分なオブジェクトだけを含んだ小さなモジュールを作ります。

事実を調べる

知ったかぶりをしていないかチェックします。ツールセットで関数を調べます。実際に動いているスクリプトを見つけて、それを調べます。関数の全てのパラメーターを調べます。

ツールセットとスクリプト言語について少し勉強する

イベントを扱ったプログラミングのドキュメントをいくつか調べます。基礎を理解することが、スクリプトにおける問題を解決する道へと続きます。

スクリプト作成は論理学の練習

動作のアイディアを、それを実行するために一連の命令に変換することは芸術であり、科学でもあります。全てのプログラムは、最初にコンパイルされた時には完璧に動くでしょう。しかし、いつかそうでない時が来ます。

しかし、落胆しないで下さい。この記事を読んでいることや、ツールセットを学ぶことがトラブルシューティングを成し遂げるために必要な材料を示しています。あなたがこの作業を楽しんでやっているか確かめて下さい。そうでなければ、作業をしばし止めて、フラストレーションを笑い飛ばして再び取り組んでみて下さい。

デバッギングツール

まず最初にみなさんが言うことは、「デバッギングツールとは？」ということででしょう。私は、それはBjornがC++のコードを書いたときに使った主に両耳の間にあるもの（脳）と同じ答えます。それは、ネアンデルタール人がマンモスを狩っていた時から備わっていたツールです。

文章を打ち出す

どのようにしてパラメーターの値をチェックすればいいのでしょうか？ 簡単です。文字に打ち出して下さい。以下のようにして打ち出します。

SpeakString(“ある文字列“+IntToString(iVariable));

SpeakString(“他の文字列”+FloatToString(fVariable));

SpeakString(“オブジェクトの名前は”+GetTag(oObject));

//等々

他には、以下のようにログファイルに書き出す方法があります。

void PrintString(string sMessage).

ログファイルがあることを知っていましたか？ ログファイルはNWNがインストールされているフォルダのLogsフォルダの中にあります。ログファイルはnwclient1.txtという名前のファイルで、どんなテキストエディタでも開けます。(私はこのファイルのショートカットをデスクトップに作成しています。)

スクリプトエディタ

おそらく、最も便利で有益なデバッギングツールは、スクリプトエディタそれ自体でしょう。スクリプトエディタからは、豊富な関数の情報やObject、Effect、Vectorといったオブジェクトタイプの情報を得ることができます。パラメーターリストのタイプを見て、それらがどのように作成され使われているか調べて下さい。

スクリプトエディタには、あなたの友達であるコンパイラが含まれています。コンパイラによって生み出される全てのエラーには、行番号とエラーの概要が含まれています。私が遭遇したいくつかの難解なエラーは以下のとおりです。

· ERROR: UNKNOWN STATE IN COMPILER

このエラーの原因のほどんどは、括弧のアンマッチによるものである可能性があります。

· ERROR: NO SEMICOLON AFTER EXPRESSION

このエラーは、最後にセミコロンが付いている行をハイライトすることがあります。これは実際は、その行の上の行にエラーがある場合がしばしばあるためです。

· ERROR: DECLARATION DOES NOT MATCH PARAMETERS

関数の定義を見てパラメーターリストを再確認する必要があると想定されます。間違ったタイプのパラメーターが使用されている、あるいは、パラメーターが抜けている時にこのエラーが起きます。

· ERROR: PARSING VARIABLE LIST

私のお気に入りのエラーの１つです。なぜなら、とても説明的だからです。このエラーは大抵、関数名の右側部分のスペルが間違っている時に起こります。

コンパイラの一番良い点は、いつもエラーの場所を示してくれる所です。コンパイラが示している行とその直前の行にエラーがないかどうか調べることを決して忘れないで下さい。スクリプトのエラーである限りは、見つける のはとても簡単です。

BioWare メッセージボード

スクリプトフォーラム、カスタムコンテンツフォーラム、ツールセットフォーラムには、あなたが抱いている質問が既に質問され、回答されている可能性が非常に高いです。質問する前にフォーラムを検索する習慣を身につけて下さい。同じ質問を何度も何度もすることは、回線を無駄に使っていることになります。加えて、あなたが非難の対象にもなります。

NWN Lexicon

共同作業で作成された数多くの素晴らしいAPIドキュメントがあります。それから情報を得て、それを利用して、それを愛して、あなたの友達にLexiconの事を教えて下さい。

トラブルシューティングの例

以下は、トラブルシューティングに関する上記の法則を示した実例です。

問題の出発点

私の目標は、特定のタイルの照明をオフにする方法を見つけることでした。そこで、私が最初に行ったことは、「light」をキーワードに含む関数を検索することでした。その結果はもちろん以下のとおりでした。

GetTileMainLight1Color

GetTileMainLight2Color

GetTileSourceLight1Color

GetTileSourceLight2Color

RecomputeStaticLighting

SetTileMainLightColor

SetTileSourceLightColor

それぞれの関数から得られたデータは以下のとおりでした。

// lTileにあるタイルの主照明１の色(TILE_MAIN_LIGHT_COLOR_*)を返します。

//

// - lTile: ベクター値部分はタイルのグリッド位置(x,y)です。

int GetTileMainLight1Color(location lTile)

//  lTileにあるタイルの主照明２の色(TILE_MAIN_LIGHT_COLOR_*)を返します。

//

// - lTile: ベクター値部分はタイルのグリッド位置(x,y)です。

//

int GetTileMainLight2Color(location lTile)

// lTileにあるタイルの光源１の色(TILE_MAIN_LIGHT_COLOR_*)を返します。

//

// - lTile: ベクター値部分はタイルのグリッド位置(x,y)です。

//

int GetTileSourceLight1Color(location lTile)

// lTileにあるタイルの光源２の色(TILE_MAIN_LIGHT_COLOR_*)を返します。

//

// - lTile: ベクター値部分はタイルのグリッド位置(x,y)です。

//

int GetTileSourceLight2Color(location lTile)

// oArea内の静的な照明を全て再計算します。

// タイルの照明を変えた後、または、照明を伴った配置用オブジェクトが追加/削除されている場合に

// 照明を更新するために使うことが可能です。

void RecomputeStaticLighting(object oArea)

// lTileLocationにあるタイルの主照明の色を設定します。

// - lTileLocation: ベクター値部分はタイルのグリッド位置(x,y)です。

//

// - nMainLight1Color: 主照明１の色(TILE_MAIN_LIGHT_COLOR_*)

// - nMainLight2Color: 主照明２の色(TILE_MAIN_LIGHT_COLOR_*)

void SetTileMainLightColor(location lTileLocation, int nMainLight1Color, int nMainLight2Color)

// lTileLocationにあるタイルの光源の色を設定します。

// - lTileLocation: ベクター値部分はタイルのグリッド位置(x,y)です。

//

// - nSourceLight1Color: 光源１の色(TILE_SOURCE_LIGHT_COLOR_*)

// - nSourceLight2Color: 光源２の色(TILE_SOURCE_LIGHT_COLOR_*)

void SetTileSourceLightColor(location lTileLocation, int nSourceLight1Color, int nSourceLight2Color)

問題を隔離する

見ての通り私が求めていた関数は以下の関数でした。

  • SetTileMainLightColor(location lTileLocation, int nMainLight1Color, int nMainLight2Color)
  • SetTileSourceLightColor(location lTileLocation, int nSourceLight1Color, int nSourceLight2Color).

これらの関数のパラメーターリストと概要を見てみたところ、これらの関数にはロケーションオブジェクト(“タイルのグリッド位置(x,y)”を含んだベクターオブジェクト)と２つの整数(照明色)が必要でした。このことで私は堂々巡りになってしまいました。「グリッド 位置」とは何だろう？

私はグリッド座標が何であるか全く分かりませんでしたが、それがローケーションオブジェクトの一部であろうということは知っていました。そこで、私が次に行ったことは、ローケーションオブジェクトについて調べることでした。その結果は、私が求めていたもの以上のものでしたが、以下のようにいくつか有望なものがありました。

// lLocationからエリアオブジェクトのIDを得ます。

object GetAreaFromLocation(location lLocation)

// oObjectのロケーションを得ます。

location GetLocation(object oObject)

// lLocationのベクター位置を得ます。

vector GetPositionFromLocation(location lLocation)

そして、もちろん全てにおいて重要な以下のコンストラクタも含まれます。

// ロケーションを作成します。

location Location(object oArea, vector vPosition, float fOrientation)

よって、この時点で私はローケーションオブジェクトについていくらか知ることができて、SetTileMainLightColor関数が、どのエリアに影響を与えるかを知るためにGetPositionFromLocationを利用するのではないかということも推測できました。私は、“グリッド位置”が何であるかはまだ分かりませんでしたが、それを含んだロケーションオブジェクトの作成方法を知りました。このパズルの欠片が集まり始めました。

グリッド座標の問題は置いておいて、私は照明色について調べ始めました。私は、これらの定数が全てTILE_MAIN_LIGHT_COLOR_　から始まり、ツールセットの定数セクションにこれら全てが詰め込まれていることを知りました。私は文字をタイプするのが嫌いなので、周り道を避けるために、エリアの照明色をテストするためにそれらの定数が定義されたスクリプトを単純に見ました。エリアを配置した後に、色を明るい白に設定すると以下のように定義されました。

int TILE_MAIN_LIGHT_COLOR_BRIGHT_WHITE = 3;

この時点で先に進むためには、“グリッド位置” が何であり、それがどの様な形式なのかを知る必要がありました。そこで私は、PrintString(string sMessage)を使ってスイッチのロケーションをログファイルに書き出すことを始めました。しばらくして、私はスイッチのロケーションを手に入れたので、それを以下のようにSetLight関数に直接指定しました。

location lLocation = getLocation(OBJECT_SELF);

SetTileMainLightColor(lLocation, 3, 3);

もちろんこれは失敗したので、私はツールセットを起動してマウスのカーソルをスイッチのロケーションの上に載せてみました。その時、ステータスラインに以下のようなメッセージが表示されました。

マウス位置(x:n, y:n) グリッド位置(行:n, 列:n) タイル(tileSet_tile_name)

それから、私はマウス位置(x:n, x:n)とグリッド位置(行:n, 列:n)の間には関係があり、Row と Colは[x|y]/10(x あるいは y を10で割った値と読みます。)の整数部分であることが分かり始めました。よって、この時点でタイルが左下(0,0)から右上へ向かって参照されていることを知りました。

これで、特定のタイルへの参照が必要であることが分かりました。しかし、エリアについてはどうでしょうか？再びツールセットで“area”というキーワードを使って検索してみたところ以下のような関数があることが分かりました。

// oTargetが現在いるエリアを得ます。

// * エラー時にはOBJECT_INVALIDを返します。

object GetArea(object oTarget)

// lLocationからエリアオブジェクトのIDを得ます。

object GetAreaFromLocation(location lLocation)

エリアはオブジェクトに他ならないので、オブジェクトについて調べる必要がありました。そこで、オブジェクトについて検索すると以下の関数が見つかりました。

// 指定されたタグを持っているnNth番目のオブジェクトを得ます。

// - sTag

// - nNth: 要求されたタグを持っているnNth番目のオブジェクト

// * オブジェクトを見つけられない場合にはOBJECT_INVALIDを返します。

object GetObjectByTag(string sTag, int nNth=0)

これは、もしエリアのタグを知っていたら、そのタグを使ってエリアを取り出せるということを確証するものでした。私はエリアを作っていたので、そのタグを知ることができました。この時点で、以下の関数のための全てのパラメーターを入手しました。

SetTileMainLightColor(location, int, int)

簡単に言うと、エリア内のタイルの位置のベクター値を含んだロケーションオブジェクト、そして、nwscriptファイルに定義されている２つの色を表す整数でした。

問題を修正する

この時点で、私は小さなパズルの全ての欠片を手に入れました。特定のタイルを参照するためには以下のものが必要であることを知りました。

1) タイルがあるエリアへオブジェクトの値

2) タイル自体のグリッド位置

次に私は、3X3サイズのエリアを作って、それに「foo」という名前をつけました。そして、エリアのプロパティで照明をoffにしました。 (torchlight only). それから、以下のスクリプトを作成しました。

void main()

{

object oArea = GetObjectByTag("foo");

vector vLocation = Vector(1.0, 1.0, 0.0);

location lTile = Location(oArea, vLocation, 0.0);

SetTileMainLightColor(lTile, 3, 3);

}

このスクリプトをコンパイルしたときの私の驚きを想像してみて下さい！このスクリプトをスイッチのOnUsedスロットに設定して、モジュールを起動し、照明がついた時の私の喜びようを想像できますか？私は、次に再びエリアオブジェクトを得て次のグリッドの新しいロケーションを得るアルゴリズムを作成する必要があると分かりました。しかし、それは必要なく、もしエリア内の全ての照明をオフにしたければ、以下のようにエリアのグリッドを捜査する２つのforループを入れ子にして使えばいいことが分かりました。

for (int x = 0; x < MaxX; x++)

for (int y = 0; y < MaxY; y++)

tileVector.x = x

tileVector.y = y

tileLocation = Location( oArea, tileVector, 0.0)

SetTileMainLightColor( tileLocation, color1, color2)

SetTileSourceLightColor( tileLocation, color3, color4)

修正結果をテストする

次は実際のテストを行いました。nwscriptファイルのTILE_LIGHT_MAIN_COLOR_* セクション以下の行を見つけました。

int TILE_MAIN_LIGHT_COLOR_BLACK = 1;

私はもちろん、誰でも黒はオフと思うでしょう。TILE_MAIN_LIGHT_COLOR_BLACKを使って簡単なテストを行うと、少し落胆する結果でした。確かに、暗くはなりましたが私が望んでいた暗さではありませんでした。ここで、トラブルシューティングを行う新しい問題が発生しました。照明がオフとはどういう状態かということでした。そこで、私は小規模なデバッグサイクルを開始しました。この問題は特定され、隔離されました。照明をオフにするためにはオフの状態とはどういうことであるかを知る必要がありました。エリアの照明をオフ(たいまつのみ)にして、二次的な光源を持っていないタイルを使うと私が望んだ効果になりました。しかし、その色とは何でしょうか？ツールセットで色に関する関数を検索すると以下のリストが表示されました。

int GetTileMainLight1Color(location lTile)

int GetTileMainLight2Color(location lTile)

int GetTileSourceLight1Color(location lTile)

int GetTileSourceLight2Color(location lTile)

以下のコードを使えば、照明がオフの色の値を知ることができるというのは明らかでした。

object oArea = GetObjectByTag("foo");

location lTile = Location(oArea, 1.0, 1.0, 0.0);

PrintString("主照明１の色は "+IntToString(GetTileMainLight1Color(lTile)));

PrintString("主照明２の色は"+IntToString(GetTileMainLight2Color(lTile)));

PrintString("光源１の色は"+IntToString(GetTileSourceLight1Color(lTile)));

PrintString("光源２の色は"+IntToString(GetTileSourceLight2Color(lTile)));

このコードをモジュールでテストして、ログを見ると以下の結果が書かれていました。

主照明１の色は 255

主照明２の色は 255

光源１の色は 255

光源２の色は 255

これで、照明がオフの状態とは何であるかを知りました。すぐに、 SetTileMainLightColor(lTile, 255, 255)、 SetTileSourceLightColor(lTile, 255, 255)でテストすると正しく照明をオフにできました。これが、私の小規模なデバッグサイクルの結論です。

ここで、１つのタイル、あるいはグループ単位のタイルの照明をオフにするために必要な情報を全て得ることができました。繰り返すと以下のようになります。

  1. 影響を与えたいタイルがあるエリアオブジェクトの値
  2. エリア上のタイルのグリッド位置

(グリッド上のロケーションを10で割った値の整数部分)

  3. 1と2を含んだ新しいロケーションオブジェクト
  4. 新しい照明色を表す整数値 (または、あらかじめ定義された定数)

最後のステップは、これをコードに組み込んで再びテストすることでした。このコードの利便性を最大にしたかったので、私が集めた情報を元に最も一般的なスクリプトを作る必要がありました。スクリプトは以下のようになりました。

void ChangeLights(int c1, int c2, int c3, int c4)

{

string sAreaTag = "Crypt"; //エリア名に合わせて名前を変更して下さい。

float maxX = 3.0; //Max Width.あなたのモジュールに合わせて変更して下さい。

float maxY = 3.0; //Max Height あなたのモジュールに合わせて変更して下さい。

//それぞれのタイルに必要なベクター値

vector vTile = Vector(0.0, 0.0, 0.0);

//エリア上の始めのタイル(location[0,0])

location lTile = Location(GetObjectByTag(sAreaTag, 0), vTile, 0.0);

//whileループに必要な変数

float fx = 0.0;

float fy = 0.0;

int notDone = TRUE;

while (notDone)

{

while (fx < maxX)

{

vTile.x = fx;

vTile.y = fy;

lTile = Location(GetObjectByTag(sAreaTag, 0), vTile, 0.0);

SetTileMainLightColor (lTile, c1, c2);

SetTileSourceLightColor (lTile, c3, c4);

fx += 1.0;

}

fy += 1.0;

fx = 0.0;

if (fy >= maxY)

{

notDone = FALSE;

}

}

RecomputeStaticLighting(GetObjectByTag(sAreaTag));

}

私の計画は、このスクリプトをそれ自体で保管して、別のスクリプトからChangeLights(int c1, int c2, int c3, int c4) として呼び出すことでした。スクリプトは、それを呼び出すスクリプトから#include 文を介して参照されます。 (これは私にとってはスタイル的な問題です。私はスクリプトにおいて#include文を使う回数を減らすために、結合可能な多くの小さな関数をライブラリとして持っています。私にとっては、数多くの小さなスクリプトよりも１つか２つの巨大なスクリプトの方が脅威です。特に、小さなスクリプトをテストするときに、それが言えます。)

ついに、多くの苦難を越えたあとに私は言えました。「照明スイッチが生まれたぞ！」

結論

第一に問題を特定する:

問題を１つか２つの文に特定します。できるだけ簡潔にします。まず、１つの問題を解決するように努力して下さい。全てを１度に解決しようとしないで下さい。スクリプトのデバッギングは、象のチョコレートを食べるようなものです。一度に１口しか噛めません。

次に問題を隔離する:

問題を再現するために、最小限度のテストケースを作ります。あなたの問題に影響を与えるものだけではなく、全ての変数についてスクリプトやツールセットで検索して下さい。モジュールとテストケース内の全てのオブジェクトをチェックして下さい。全ての関数について、パラメーターを調べて下さい。パラメーターについては、そのコンストラクタを含めて調べて下さい。パラメーターがどのように初期化され、予想される値がどのようにして入力されるか注目して下さい。

次に問題を修正する:

上の２つの項目を終えたら、テストケースで全てをチェックできます。もしデフォルトのスクリプトで生成されるオブジェクトが問題に含まれていたら、それを外して下さい。テストをして、少しずつそれを戻して下さい。あなたと同じ問題を抱えた人がいないかどうか、Biowareのフォーラムをチェックして下さい。あなたが抱えている問題を他の誰かが抱えているかもしれません。時間が過ぎるほど、その可能性は低くなります。(サーチパラメーターをJuly 28 2002に戻すことを忘れないで下さい。デフォルトのサーチでは、１ヶ月前からになっています。) これら全てを行っても情報が得られない場合に、あなたの問題をフォーラムに投稿して下さい。その際には、あなたが持っている十分な情報とあなたの意見を書いて下さい。完璧な質問に近づくほど、より素早く的確な答えが返ってくるでしょう。

最後に結果をテストする:

あなたのテストモジュールでは修正したものが上手く動くかもしれませんが、より大きなモジュールではどうでしょうか？私は、よく自分のコードを、私が作っていないカスタムモジュールや、公式キャンペーンの第１章でテストします。

これらはデバッギングボタンを押すようにはいきませんが、プログラムのエラーの修正における確かな方法といえます。スクリプト作成は簡単ではないですが、これらの方法を活用すれば、楽しくやりがいのあるものにきっとなるでしょう。

脚注:

*Grace Murray Hopperがハーバード大学においてMark IIコンピュータで作業しているときに、初めてコンピュータのバグを発見しました。彼女はそれをコンピュータのログブックに記録しました。それ以来、コンピュータが止まる時、彼らはディレクターのHoward Aikenにコンピュータを “デバッギング” していると言うようになりました。一番最初のコンピュータのバグは、今でもスミソニアン協会の国立アメリカ歴史博物館に存在しています。

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Boris Maréchal, JP team: katsu794


Category - Cut-scenes

Home > Lyceum > Tutorial > Cut-scenes

Cut-scenes

Cut-scenes for in-game storyline.

Title | Brief Description
NorseDude - Part I: What is a Cut-Scene? | A cut-scene is a short movie or chain of events that advances a story.
NorseDude - Part II: Lets Get Started! | Laying out a cut-scene area and creatures.
NorseDude - Part III: Coding Cut-Scenes | Adding the NWScript code to make the cut-scene come alive.
NorseDude - Part IV: What Did We Just Do? | Indepth description of Part III.
NorseDude - Part V: Improving Cut-Scenes | Improving your cut-scenes.


Tutorial - NorseDude - Part I: What is a Cut-Scene?

Home > Lyceum > Tutorial > Cut-scenes > NorseDude - Part I: What is a Cut-Scene?

NorseDude - Part I: What is a Cut-Scene?

NorseDude's Cut-Scene Tutorial

The purpose of these tutorials: To help the average NWN module maker create his or her own cut-scenes in NWN. Simple as that.

Requirements: Not much, but I do expect you to know at least the basics in module-creation. When I say "Create a NPC named 'Bob' with the Tag 'bob'", I will not tell you how to do just that since I expect you to know that already.

My e-mail: norsedude@tiscali.no

Part I: What is a Cut-Scene?

A cut-scene is a short movie, or chain of events if you like. An example might be you see a NPC walk in a door, start a conversation with another NPC, and then the two of them walk away. It could be simpler (with just the NPC entering the room), or as complicated as you could ever like. You could even create a five-hour long cut-scene if you want, although this is a game, not a movie.

For this tutorial, we will focus on learning what a cut-scene is and how to create one; the rest is up to you. As soon as you get the basics, you will be able to make your own cut-scenes with ease. But to start somewhere, let's find out what we want the cut-scene to do first (this is actually usually the hardest part). What could we possibly do in a cut-scene that could be of any interest? A NPC entering a room and talks to another one could of course be fun the first time you do it, but it quickly gets boring, right? We need more... well, more. So here's an idea. We enter a room, and... uh-oh, we're taken prisoner! Two guards quickly remove all our inventory, and throw us in jail. Better? Well, yes. But not good enough. Why would we be thrown in jail just like that, without being able to explain we are innocent? So let's make the guards take us to the leader so we can talk to him. The leader won't believe us, so we're going to jail anyway. But wait, what if we were in fact only a distraction so other people could storm the room and kill the leader? We're standing there, talking to the leader, and... boom! Enter the cavalry! Wait, why would the others kill the leader without talking to him first? So let's make their leader talk to the other leader, and just for fun, let's have a random outcome. Either our leader convinces their leader a war is a bad idea and everyone gets to go home and have dinner, or he fails and everyone starts fighting anyway. Getting interesting now, isn't it?

As you can see, a cut-scene is nothing more than a few scripts and conversations combined. As soon as you get the basics figured out so you can start, you're already almost done. There are a few things you should remember about cut-scenes, though. First of all, a human player needs to be in the area for a cut-scene to happen. More, the camera can't be moved away from the player. With this in mind. always have the cut-scene very close to the player so you are sure he can see it. You could make one player trigger the cut-scene and let another player in another area see it, but that would only be useful if you run a check to see if the second player is where you want him to be. And if he is, why can't he start the cut-scene?

A cut-scene can be of any length, but keep in mind not everyone will enjoy a very long cut-scene. With this in mind, there are two different kinds of cut-scenes: plot related and non-plot related. The plot related cut-scenes have something to do with the story (the player gets captured), while the non-plot related don't have anything to do with the story itself (two NPC's discussing the weather for example). Why do we need to separate them? The plot-related can't be skipped, since they are very important for the plot. Since not everyone enjoys a long cut-scene, these should be kept a bit on the short side. The non-plot related cut-scenes on the other hand have nothing to do with the story, and can be any length you want. If the player don't like the cut-scene, he can simply walk away since he don't need the cut-scene to be able to finish the module.

author: Michael Kenyon, editor: Charles Feduke


Tutorial - NorseDude - Part II: Lets Get Started!

Home > Lyceum > Tutorial > Cut-scenes > NorseDude - Part II: Lets Get Started!

NorseDude - Part II: Lets Get Started!

NorseDude's Cut-Scene Tutorial

The purpose of these tutorials: To help the average NWN module maker create his or her own cut-scenes in NWN. Simple as that.

Requirements: Not much, but I do expect you to know at least the basics in module-creation. When I say "Create a NPC named 'Bob' with the Tag 'bob'", I will not tell you how to do just that since I expect you to know that already.

My e-mail: norsedude@tiscali.no

Part II: Let's Get Started!

Right. Now the fun part begins. The creation of a cut-scene. I assume you have the toolset open by now, so let's make the background for the module. We need:

  • 1 Area with four rooms or more
  • 1 Door, locked, Tag: "guard_door"
  • 2 NPC's. Tags: "guard" and "leader"

Since this is just a tutorial it's up to you how fancy you want all of this, as long as the Tags are the same as mine and you place the start location and the creatures where I tell you to. For the record, I placed mine like this:

Area:

Small 2x2 House Interior with four rooms (actually four doorways). The two top rooms are 1 and 2, while the bottom rooms are 3 and 4. 3 is directly under 1, and 4 under 2. We start in room 3, the guard is in room 4, we head up to the leader in room 4 and are thrown into the jail in room 1. Hope this wasn't to confusing, but again the important part is you have four rooms.

NPCs:

I have one Bandit and one Bandit Chief, but it's up to you. The faction doesn't matter, as long as they are friendly.

Doors:

Not many requirements, as long as the tag name is "guard_door". The "guard_door" is placed on the door between the guard and the guard leader. This is just the Tag we use in the tutorial, and can be changed to whatever you want.

Wait, that's it? What about all the other stuff, like the second guard, the spy, the people outside, the jail, the...? Heh, don't worry. It will all be there by the end. But for now, these will do. One day at a time, sweet... no, wait. One step at a time. Right. Sorry 'bout that.

Anyway, got the module up and running by now, have we? Good. Now, place the start location in the room just outside the guard room, and we're ready to begin...

author: Michael Kenyon, editor: Charles Feduke


Tutorial - NorseDude - Part III: Coding Cut-Scenes

Home > Lyceum > Tutorial > Cut-scenes > NorseDude - Part III: Coding Cut-Scenes

NorseDude - Part III: Coding Cut-Scenes

NorseDude's Cut-Scene Tutorial

The purpose of these tutorials: To help the average NWN module maker create his or her own cut-scenes in NWN. Simple as that.

Requirements: Not much, but I do expect you to know at least the basics in module-creation. When I say "Create a NPC named 'Bob' with the Tag 'bob'", I will not tell you how to do just that since I expect you to know that already.

My e-mail: norsedude@tiscali.no

Part III: At Last... the Code!

By now you should have one Area with four rooms, one guard, one leader and a door with the Tag "guard_door". So, let's begin. To start somewhere, right-click on Scripts and create a new one. We need three scripts, and I suggest you name them "cutscene_1_1", "cutscene_1_2", and "cutscene_1_3". It's easy to remember, and you usually need at least three scripts in a cut-scene. If you have five cut-scenes, that's fifteen scripts right there - plus all the other scripts you might add to them (I'm working on a module right now that have 220+ scripts and 70+ conversations so far, so trust me when I say it's handy to have a name you can easily remember).

Type this code in the first script - cutscene_1_1 (please, do not just copy and paste it; you'll learn it much better if you type it on your own):

// cutscene_1_1
void main()
{
     object oGuard = GetObjectByTag("guard");
     object oLeader = GetObjectByTag("leader");
     object oPC = GetLastPerceived();

     object oDoor = GetObjectByTag("guard_door");

     if (GetIsPC(oPC))
     {
          SetCommandable(FALSE,oPC);
          DelayCommand(10.0, SetCommandable(TRUE, oPC));
          AssignCommand(oPC, SpeakString("Lead the way!"));
          AssignCommand(oPC, ActionForceFollowObject(oGuard));
          AssignCommand(oGuard, ActionOpenDoor(oDoor));
          AssignCommand(oGuard, ActionForceMoveToObject(oLeader, FALSE));
          AssignCommand(oPC, ClearAllActions());
     }
}

Done? Good. Here's some more code for you - cutscene_1_2:

// cutscene_1_2
int StartingConditional()
{
     int l_iResult;

     l_iResult = !GetIsObjectValid(GetPCSpeaker()) &&
          GetLocalInt(OBJECT_SELF, "TalkingToGuard") == 10;

     return l_iResult;
}

With me so far? Good. The third script - cutscene_1_3 - goes like this:

#include "nw_i0_plot"
// cutscene_1_3
void main()
{
     object oGuard=GetObjectByTag("guard");

     if (GetLocalInt(OBJECT_SELF,"TalkingToGuard") == 0 &&
          CanSeePlayer() &&
          GetObjectSeen(oGuard))
     {
          SetLocalInt(OBJECT_SELF, "TalkingToGuard", 10);
          ActionStartConversation(oGuard);
     }
}

I know this was a lot of code all at once, but we're still not done. We need a few more things. A series of conversations is the first. Why would we follow a guard for no reason? And even if the guard and his leader communicate through sign-language, won't that be just a bit boring for the player? No, we better let everyone know what is going on. First, we need a conversation for the guard. This one is straight forward, just make a regular conversation and name it whatever you want. The clue is this conversation will start the entire cut-scene, so we need to include a line in the conversation that starts it. It can of course be anything, but for now let's go with something like "Come." or "Follow me." Under the "Actions Taken", place the first script (cutscene_1_1).

Now make the conversation for the leader. This is the part where it starts getting a bit messy. First we need to make a conversation line for the guard. We could make one for the leader, but it's handy to learn this from the start. Make a new line and type something like "A prisoner, boss.". Go to the Speaker Tag and select the guard from the list. Now, add a response from the player leave it blank and add a response for the NPC. Type something like "I'll take it from here." and check the Speaker Tag. It should be blank, so the conversation says "[OWNER] I'll take it from here."

Two more things to do before we are done. In the conversation you just made, check the "Text appears when..." and select the second script. This will make sure the cut-scene launches when it's supposed to and also makes sure you can talk to the leader just like you would any other NPC. I know it don't make sense if you are taken prisoner, but what if the leader was a shop-keeper and the other NPC a friend? The possibilities are endless.

When all this is done, there's just one little thing left. Go to the leader properties and put the third script (cutscene_1_3) in the onHeartbeat slot.

Save your module and check it out? I'll see you in Part 4.

author: Michael Kenyon, editor: Lilac Soul


Tutorial - NorseDude - Part IV: What Did We Just Do?

Home > Lyceum > Tutorial > Cut-scenes > NorseDude - Part IV: What Did We Just Do?

NorseDude - Part IV: What Did We Just Do?

NorseDude's Cut-Scene Tutorial

The purpose of these tutorials: To help the average NWN module maker create his or her own cut-scenes in NWN. Simple as that.

Requirements: Not much, but I do expect you to know at least the basics in module-creation. When I say "Create a NPC named 'Bob' with the Tag 'bob'", I will not tell you how to do just that since I expect you to know that already.

My e-mail: norsedude@tiscali.no

Part IV: What Did We Just Do?

If you did the last three steps correctly, you should now have a module where the PC talks to a guard, the guard forces you to follow him to their leader, the guard tells the leader he has a prisoner, and the leader replies. You can only take control over yourself again when this is done. So how did we do it? Time for some explanation.

Let's take a look at the first script (cutscene_1_1):

// cutscene_1_1
void main()
{
     object oGuard = GetObjectByTag("guard");
     object oLeader = GetObjectByTag("leader");
     object oPC = GetLastPerceived();
     object oDoor = GetObjectByTag("guard_door");

     if (GetIsPC(oPC))
     {
          SetCommandable(FALSE, oPC);
          DelayCommand(10.0, SetCommandable(TRUE, oPC));
          AssignCommand(oPC, SpeakString("Lead the way!"));
          AssignCommand(oPC, ActionForceFollowObject(oGuard));
          AssignCommand(oGuard, ActionOpenDoor(oDoor));
          AssignCommand(oGuard, ActionForceMoveToObject(oLeader, FALSE));
          AssignCommand(oPC, ClearAllActions());
     }
}

If you are familiar to module making, you will recognize more or less all of the above code. It's very simple, actually. The first four lines (starting with "object") tells the game what variables you need for the script. To be short, a variable is akin to putting a new name on a object in the game so you can access in a script. The object can be anything like a player, creature, or even a waypoint or trap. With those set, the actual script first checks if we are a player instead of an NPC, and if we are a player, makes us just another NPC for the time being. Don't worry, this just means we can't control the player but that was sort of the point, right?

If we can't control the player during the cut-scene, how can we control him afterwards? I have tried many, many ways to do this, and so far the only way I have found out how to really get control again is if we use a DelayCommand to set the control back. What this does is when the script starts, it runs through the commands and executes all at once. However if the commands start with "Action", they are put "on hold" and are executed one at a time. The SetCommandable does not start with Action, so when the script starts it first turns the player into a NPC and then back again to a player before it even starts with the Action-commands. This is pointless, so we use a DelayCommand instead. The Action-commands wait for their turn to launch, while the DelayCommand starts right away - but don't execute the sub-command until the timer runs out. In this time we start the DelayCommand when the script starts, but it waits for ten seconds before it launches the sub-command SetCommandable. This will give us plenty of time to run the cut-scene first. This is a bit tricky, since we need to time it correct. We can't give the player control of the character during the cut-scene, and we really shouldn't give him control back too late either. A handy work-around is to start a conversation with the player after the cut-scene, so he will be talking when he can finally move again. You can run another cut-scene with another SetCommandable after the conversation, but who can tell how long the player will be talking?

The next line (the first one starting with AssignCommand) is just to demonstrate that it is fully possible to make the player speak in the cut-scene, so you can have fun with him as well. After that we follow the guard, and this is the fun part: The "Force" in ActionForceFollowObject actually forces the player to follow the NPC - even through areas. Now why would we want to do that? Well, what if we are thrown in jail, and the jail is in the basement? What if we are talking to some guy inside a inn, and we hear a strange noise outside? Everyone would be running out to check - including the player.

While we're on the subject, the AssignCommand simply gives a command to someone or something. Many commands can't be given directly, so we need to assign the command to someone first. I know it's a bit complicated, but once you get the hang of it, it really isn't that annoying. Sort of like the semicolon (";") at the end of every single line, you know?

The ActionOpenDoor part is kinda useless right now, but keep it in mind anyway.

ActionForceMoveToObject makes the guard walk up to the leader, but take a second to read the line. ActionForceMove... Force... the Force-part is a lot like the Force-part in the ForceFollow line we had earlier. Basically it forces the NPC to move to the leader - no matter where the leader is. All that's required is a free path to him. Not only can this path lead to a different area, but it can even span multiple areas if you want. I haven't tested the maximum limit, but I have made a NPC walk from one area, walk through a crowded street, enter a house, walk past two more NPC's and up the stairs - all with a single ForceMove-command. And again, if you force the player to follow...

Now, let's take a look at the second script while we're at it (cutscene_1_2):

// cutscene_1_2
int StartingConditional()
{
     int l_iResult;

     l_iResult = !GetIsObjectValid(GetPCSpeaker()) &&
          GetLocalInt(OBJECT_SELF, "TalkingToGuard") == 10;

     return l_iResult;
}

A bit tougher, this one. Basically it makes the leader check if there is a player nearby (no point in a cut-scene if there isn't anyone there to see it), and then checks if the player has talked to the guard already.

So, the third script (cutscene_1_3):

// cutscene_1_3
void main()
{
     object oGuard=GetObjectByTag("guard");

     if (GetLocalInt(OBJECT_SELF,"TalkingToGuard") == 0 &&
          CanSeePlayer() &&
          GetObjectSeen(oGuard))
     {
          SetLocalInt(OBJECT_SELF, "TalkingToGuard", 10);
          ActionStartConversation(oGuard);
     }
}

It's really not as hard as it looks. You do recognize the object oGuard-part? We had the same one in the first script. This time we don't need to make the player a variable, and since it is the leader who will be running the script, so we don't need him either. So what does it do?

"if (GetLocalInt(OBJECT_SELF, "TalkingToGuard") == 0 &&" checks if we have talked to the guard. If we have, no need to restart the conversation. The && might confuse you at first, but think of it as AND. The second line, "CanSeePlayer() &&" should be obvious, and so the next line, "GetObjectSeen(oGuard))". Let's put it all together:

"We have not talked to the guard yet" AND "We can see the player" AND "We can see the guard".

(When you don't end a line with a semicolon, then that line is assumed to continue onto the next actual line in the script - this is a way to make your code more "readible" - Ed.).

So if we haven't talked to the guard, we can see him but we can not see the player, don't do anything. If we can see the guard and the player but we have already talked to them, don't do anything. If we can see both but we haven't talked to them yet, let's talk to them now. We perform these tests because this script goes into the OnHeartbeat event, which fires every six seconds. When all three conditions are met, then we can continue on with the cut-scene.

author: Michael Kenyon, editor: Charles Feduke


Tutorial - NorseDude - Part V: Improving Cut-Scenes

Home > Lyceum > Tutorial > Cut-scenes > NorseDude - Part V: Improving Cut-Scenes

NorseDude - Part V: Improving Cut-Scenes

NorseDude's Cut-Scene Tutorial

The purpose of these tutorials: To help the average NWN module maker create his or her own cut-scenes in NWN. Simple as that.

Requirements: Not much, but I do expect you to know at least the basics in module-creation. When I say "Create a NPC named 'Bob' with the Tag 'bob'", I will not tell you how to do just that since I expect you to know that already.

My e-mail: norsedude@tiscali.no

Part V: Improving the Cut-Scene

By now you should have a module where you talk to a guard, he takes you to his leader and then they have a very short conversation. The cut-scene works, but it's just a basic one. The stuff you can do with a cut-scene is limited to only your imagination, and there is no way I can cover everything. So for now, I can help you improve the one you already have to get you started. What you need to remember is a cut-scene is basically just a normal script combined with another normal script, and perhaps with a normal conversation or two. The problem is to do the actual scripting, but I can help you with some of that by giving you a detailed list of some common things you might want to do:

Make a NPC open a locked door: Simple. Just take a door, mark it as "Plot" so the player(s) can't break it, mark it as Locked, and require a special key to unlock. The Tag of the key can be anything. Now create the NPC who will open the door unless you already have one, and check his inventory. Create a new key, and give it the same Tag as the lock (the lock, not the door). Remember the line where the NPC walks to the door? "ActionOpenDoor(oDoor);" will have the NPC open the door, but what it is is locked? Just place the line "ActionUnlockObject(oDoor);" before this line and there you go! The player can't open the door no matter how hard he tries, but the NPC can since you gave him the key.

Make the NPC speak to another NPC: Even easier. The guard told the leader he had a prisoner, and the leader said he would take it from here, right? Well, there you go. Just add another PC response, leave it empty and add another NPC response. Keep doing this until you are happy. The Speaker Tag can be anything you want, but obviously it doesn't make much sense unless the NPC who speaks the lines are in the room.

Make the guard walk back to where he came from after delivering the prisoner: Make a waypoint where the guard is standing before he starts walking, and Tag it "WP_guard". Now add the line 'object oGuardWP = GetObjectByTag("WP_guard");' in the first script along with all the other objects. Under the object-part, type in "location lGuardWP = GetLocation(oGuardWP);". Finally, when you want the guard to walk back, simply "AssignCommand(oGuard, ActionMoveToLocation(lGuardWP));"

It's very simple, really. First we tell the game we need another object, the waypoint. Note you can use GetWaypointByTag instead of GetObjectByTag. Both will work on waypoints, and some find it easier to remember that way. I prefer to just use GetObjectByTag on all objects, but it's up to you what you want to use. Same with the two next lines, location lGuardWP and ActionMoveToLocation. First of all, you don't need that location-line at all if you don't want to. As I said earlier a waypoint is an object just like a creature or a placeable, so you could use 'ActionMoveToObject(GetObjectByTag("WP_guard"));' instead of "ActionMoveToLocation()". Personally I find it easier to handle if I put all the physical objects first, and then all the locations afterwards.

Summoning stuff that talks: Imagine this: You're walking down a corridor in a long abandoned castle, and find a large door. Just as you are about to open it, a NPC appears from thin air and warns you to not open the door, and then suddenly leaves again without a trace (a standard NPC might be dull, but what about a ghost - or mysterious person hidden in a cloak?). This can be done in many ways, including in a cut-scene. The easiest way is to create the creature you want to spawn in, note it's Tag and use that to spawn in the creature:

void main()
{
     /* This script will summon the creature with the Tag "strange_dog_1"
        at the waypoint with the Tag "strangedog1"
     */

     string strTemplate = "strange_dog_1";
     location locLocation = GetLocation(GetObjectByTag("strangedog1"));
     int bUseAppearAnimation = FALSE;
     CreateObject(OBJECT_TYPE_CREATURE, strTemplate, locLocation, bUseAppearAnimation);
}

For this script to work, you will need one creature with the Tag "strange_dog_1" and one waypoint with the Tag "strangedog1". You will also need to make the conversation for the creature before hand, as in the blueprint. To make it go away again after the conversation, simply use a "DestroyObject(OBJECT_SELF);" command in a script and launch it at the end of the conversation assigned to the creature you want to disappear. If you place the first script in the onEnter-slot on a trigger, this will make the creature appear from thin air at the waypoint. The player will need to manually talk to the creature, but after the conversation the creature will go away. If you set the bUseAppearAnimation to TRUE, the creature will even spawn in with a fancy animation effect.

Why do I mention all this, if it doesn't have anything to do with a cut-scene? Well, since it can easily be put in a cut-scene if you want. What if you are in a dark, scary cave, and suddenly a ghost appears and asks you to retrieve it's magical ring? You enter the cave, find the ring inside a chest, and get stuck in the spider's web. The ghost appears just as the huge spider appears, and you throw it the ring. With this ring, the ghost manages to kill the huge spider and rescue you. All this in the same cut-scene. And by now, I think you know how to do all this as well!

The Camera: Friend or Foe? The camera in NWN is great when it comes to playing - but it's very bad when it comes to cut-scenes. Sure there are a few mods out there that can fix this, but if you want to use that camera it would require everyone who plays your module to have the same mod installed. The only way to work around this is to have the mod included in the module-file (zip, rar, or whatever) which would take a lot more space than required, telling everyone to install that file in your readme-file, or let those who want the mod use it and don't use it in the module itself. I know it would be very interesting if you could focus the camera in a dark spot in a corner, in another room and so on, but unfortunately this isn't possible. What is possible however is rotating the camera through a SetCameraFacing() command.

author: Michael Kenyon, editor: Charles Feduke


Category - Toolset

Home > Lyceum > Tutorial > Toolset

Toolset

Aurora toolset tutorials (non-scripting).

Title | Brief Description
A Simple Quest | Step-by-step tutorial for constructing a simple quest - no scripting required
A Simple Quest - Part II | Enhancing a simple quest with journal entries, mutlilingual dialogue and more.


Tutorial - A Simple Quest

Home > Lyceum > Tutorial > Toolset > A Simple Quest

A Simple Quest

HOWTO: A Simple Quest in Neverwinter Nights

Introduction

It's perhaps the easiest quest of all to imagine - PC meets NPC, NPC has lost item, PC fetches item, NPC is happy, and rewards PC. It should be trivial to do this in the NWNToolset. But wait! It looks like it needs scripting! Yikes! I know no programming!! What can I do? Who can help? There's no documentation! PANIC!

Fear not - help is at hand!

The NWNToolset has a set of Wizards that automate simple scripting tasks, so you don't need to know how to script to create dynamic NPC interactions, and create quests. To get you started, this tutorial aims to describe how you would set up a simple 'Go fetch!' quest using only the Wizards, and not writing a single line of code.

Important Note: tutorial has been reformatted from one I put up in the NWN Scripting Forum the week after NWN was published. It contains several opinions that are mine alone... don't blame the Lexicon. Feedback to Iskander, throught the BioWare site, please.

Prerequisites

Like any Tutorial, I have to assume some knowledge. I've tried to pitch it for everyone, but there are some concepts I can't get by without. For example, I assume that you know a little bit about scripting - you don't have to know how to script, but you should be at least familiar with:

  • Variables - what variables are. If you've never programmed a lick in your life, this is going to be a bit challenging. Review the elementary material on the NWVault site, which is a great introduction to programming/scripting in general
  • Tags - Objects in NWN have tags. The tag name is case sensitive, and need not be unique. In this tutorial, yours should be.
  • The NWN Toolset - You need to know how to paint areas and add NPCs and Items to your areas.
  • The Conversation Editor - Most of what you do will be in the Conversation Editor, you should know how to add nodes and understand what 'root' 'parent' and 'child' mean in this context

If you're already daunted, don't be!. Read on, and see if you follow what I'm talking about. Concepts that you're a little hazy on might be clearer the further into the tutorial you get.

Tutorial

Preparation

You're going to construct a quest for an NPC, Plott deVice. He's lost his Doohickey of Destruction, and wants you to go fetch it for him. Before we start, create Plott and the Doohickey, and place Plott in an Area. Paint a Doohickey in the Area too, and set its Tag to itemPlottsDoohickey. We're also going to need a variable to keep track of our quest's state, so let's decide now that it's going to be an integer, iPlottQuest

Planning

It may be a trivial quest, but we still need to do some planning. We need to know what the different stages of the quest are, and how we will represent them in our quest state variable. We'll decide ahead of time that iPlottQuest will have three potential values:

  • 0 - The PC hasn't been given the quest (default).
  • 100 - The PC has been given the quest, but hasn't completed it.
  • 200 - The PC has finished the quest, and can't do it again.

Starting The Conversation

The core of the quest is the conversation the PC has with Plott deVice. Normally, you would plan the conversation tree in advance, and build all the dialogue nodes before adding scripts with the Wizards. We'll do it in two steps, however, for illustrative purposes. To get started, edit Plott's Properties, and press "Edit" next to the Conversation field on the "Basic" tab to open the Conversation Editor with a new Conversation file. Add these three nodes to the root:

Note that the lines of dialogue seem backwards because when faced with multiple choices for an NPC at the same conversation level, the engine will choose the first line of dialogue that either has no 'Text Appears When...' script, or whose 'Text Appears When...' script evaluates to TRUE. (If you have no idea what that last bit meant... don't worry, the Wizard will take care of it). What this means in practice, is that your conversations will frequently start with the end of a quest, and work back towards the start.

To vary the text that appears when the NPC is spoken to, we need to set conditionals on the first two dialogue nodes. In other words, we need to describe the conditions that have to be true for the text to appear. The first node should only appear when the quest is complete, and that's when the iPlottQuest variable is equal to 200. Let's configure that with the wizard:

A note about script names

For this example, the script names are irrelevant, and if you're only going to use the Wizards when creating a module, you can safely accept the defaults and forget them. But in larger projects, you should decide on a naming convention for your scripts so that you can quickly identify them. You're likely to have a lot.

  1. Select the first node (Thank you again...)
  2. Click on the 'Text Appears When...' tab in the bottom right of the Conversation Editor
  3. Click on the Wizard Hat button to start the Script Wizard.
  4. Check the 'Local Variable' box, and click 'Next'
  5. Type the name of the local variable ('iPlottQuest') in the top right box.
  6. Type the value that iPlottQuest must be (200) in the bottom left box.
  7. Click 'Add'. You should get a line of code appearing in the 'Local Expressions' box, that says: GetLocalInt( GetPCSpeaker(), "iPlottQuest") == 200

  8. Click 'Next', call the script 'dlg_plott_01' and save it.

The wizard has generated a script so that the first line of dialogue will only show up when the PC has completed the quest. You don't need to edit this script, but when you want to learn more about scripting, a good place to start is reading the Wizard's scripts, and figuring out how they do what they do. To fix our conversation up for the intermediate quest state, repeat the process above with the Have you found... line, setting the value to 100 instead of 200.

Filling out the Quest

Now you need to flesh out the conversation to give the PC some paths of response. PC's got to be able to accept the quest, and say 'Yes' when he's got the item. Add lines of dialogue to the conversation so it looks like this the tree below. You can vary the text as much as you like, but for the time being, leave the tree structure exactly as shown.

It's time to trigger the quest - to change the PC's quest state from 'Not started' to 'Incomplete', or to put it another way, to set iPlottQuest to 100. We already know when to do this, because we've go the conversation right there. The line Yep. Be right back. is begging for the start of the quest (and a rewrite... but that's not my problem). So far, we've only tested for the value of iPlottQuest, now we're going to set it. Unsurprisingly, we'll do it in the 'Actions Taken' tab. Here's how:

  1. Select the Yep. Be right back. node.
  2. Click on the 'Actions Taken' tab.
  3. Click on the Wizard Hat button to start the Script Wizard.
  4. Check the 'Set Local Variables' box, and click 'Next'.
  5. Type the variable name in the top right box.
  6. In the bottom left box, fill in the value for our 'Quest Started' state
  7. Click 'Add'. You should get a line of code appearing in the 'Local Expressions' box, that says: SetLocalInt( GetPCSpeaker(), "iPlottQuest") = 100
  8. Click 'Next', call the script 'dlg_plott_02' and save it.

So far, so good. We've just arranged it so the PC can start the quest, and we've already got the mechanics worked out for the different conversation paths, so let's complete the quest, and dole out the rewards. Everything's in place for the PC to come back after the quest has started, and get asked Have you found the Doohickey of Destruction?. We have to assume that the PC is fundamentally dishonest, and will try to get something for nothing, so when the PC chooses Yes, we should check that they really have got Plott's Doohickey. By now, you should have a pretty good idea how to check this with a wizard. It's just a variation on checking the iPlottQuest, only easier. Full instructions are hidden below, highlight the text with your mouse to reveal them. (Fellow Opera 6 users click here.)

  1. Select the 'Thank you, thank you, thank you...' node.
  2. Click on the 'Text Appears When...' tab in the bottom right of the Conversation Editor
  3. Click on the Wizard Hat button to start the Script Wizard.
  4. Check the 'Item in Inventory' box, and click 'Next'
  5. Type the Tag of the Doohickey of Destruction ('itemPlottsDoohickey') top box.
  6. Click 'Add'. The Tag should appear in the 'Currently required item tags' box.
  7. Click 'Next', call the script 'dlg_plott_03' and save it.

Rewards'R'us

Finally, we get to mark the quest as complete for this PC, and dish out some rewards. Still on the Thank you, thank you line, use the 'Actions Taken' tab's Script Wizard. You will need to check the 'Give Rewards', 'Take from Player', and 'Set Local Variable', and each will give you it's own pag in the Wizard. This should, by now, be familiar territory, so I'll leave it as an exercise for you to figure the rewards out. Just don't forget to set iPlottsQuest to the 'Quest Finished' state. If you're still hopelessly lost, there's a step-by-step description hidden below.

You're done!

That's right... if you're still with me, by now you have a miniature quest of your own, and - with luck - an understanding of how it to make your own. All that remains is for you to save your module, load it into single-player, and go chat to your NPC. Be sure to test every conversation path... good testing is the secret to good code!

This is an elementary 'Go fetch!' quest, without a single line of script-writing necessary. You do need to understand a little bit about variables, and tags, and you need to be aware that the Conversation Editor and the Script Wizard is writing a bunch of little scripts behind the scenes (you'll see they've been added to your module already). But you don't need to write the scripts yourself. Which is cool.

Exercises for the reader!

Here are some variations, all achievable with the wizards, that you might like to try:

  • You've given the PC money and experience... how about improving his reputation with the NPC's faction?
  • Give the PC the chance to insult the NPC, and have that change the PC's reputation with the NPC's faction for the worse.
  • Add a '&lt;StartHighlight&gt;[ Keep the Doohickey ] &lt;/Start&gt; Nope... couldn't find it, honest!' line of dialogue to the 'Have you found...' tree. Make it appear only when the PC has the Doohickey... and add some consequences to the theft.
  • Make the NPC xenophobic: only start the quest if the PC is the same race.
  • Add a Persuade option for PCs to try and get the quest from the xenophobic NPC.
  • Make it so that the Persuade check doesn't appear for PCs with low Charisma.
  • How would you make it a 'Go kill!' quest? (Hint: Bandit scalp)

...and some that will need some scripting:

  • Should Plott keep losing his Doohickey? After destruction, respawn it in a new location.
  • Create a blueprint of the Doohickey, and spawn it to a random location when the quest starts.
  • Set up a multiplayer Easter Egg hunt.

Some Conversation Editor Tips

  • Returning to earlier nodes... To get a conversation to loop back to an earlier node, use linking. Copy the node you want to return to, and then right-click the node you want to come from, and select 'Paste as link'. (Note that you can't paste links from a speaker onto its own dialogue)
  • To break long NPC descriptions up into multiple nodes, add a single child conversation node, and delete all of its text. Add a child to the empty node, and the empty node will change from '[END DIALOGUE]' to '[CONTINUE]' in the editor. The PC will then get the familiar 'Continue' option in the conversation.

Coda

I hope this is of use in getting you started on the path of NWNToolset Wizardry, and Script Sorcery (man, I'm corny). If you find an error or typo, or want to publish this somewhere, please let me, Iskander, know through the Bioware Boards

Assigning rewards... the secrets revealed!

Highlight this box with your mouse to reveal the hidden text, unless you have a browser that works, like Opera 6, in which case, click here.)

  1. Highglight the 'Thank you, thank you, thank you...' node
  2. Go to the 'Actions Taken' tab
  3. Check 'Give Rewards', 'Take from Player', and 'Set Local Variable', and click 'Next'.
  4. In the 'Give what rewards?' screen... give rewards, and decide whether the party or just the PC gets the benefits. Click 'Next'.
  5. In the 'Take what?' screen, type 'iPlottsDoohickey' into the 'Take item (by Tag)' box, and leave 'Destroy' selected. Click 'Next'.
  6. Finally, we need to set our flag variable for the last time. Set 'iPlottsQuest' to 200, click 'Add', 'Next', save the script, and you're done.

author: Iskander Merriman, editor: Charles Feduke


Tutorial - A Simple Quest - Part II

Home > Lyceum > Tutorial > Toolset > A Simple Quest - Part II

A Simple Quest - Part II

A Simple Quest - Part II

Introduction

In my first tutorial, you learnt how to build a simple 'Go fetch!' quest using the Conversation Editor and the Script Wizard, without having to actually write a single line of code. In Part II, you will learn how to add Journal entries for your quest, and how to make your module multi-lingual. We will make a simple modification to change the quest from a 'Go fetch!' to a variation on the 'Go kill!' theme. While we're at it, we'll look in on Area Transitions, and the Faction Editor on the way.

Prerequisites

Like any Tutorial, I have to assume some knowledge. I've tried to pitch it for everyone, but there are some concepts I can't get by without. They are detailed in part one, which you will be building on, so there's only one real prerequisite (apart from owning NWN):

  • Complete Part I You should have a test module complete with Plott, a Doohickey of Destruction, and the conversation as constructed in the first tutorial. You should have tested the module, and have the Quest working.

Tutorial

Preparation

You should already have a conversation tree that looks like this:

The Journal

You've built a quest, and now you want to give the PC an easy way to track the quest. Happily, NWN comes with a Journal, and unsurprisingly, there's a Journal Editor. Open it up now, and have a look. Having got used to the Conversation Editor in the first part, the Journal Editor will look reassuringly familiar, if even easier. Your module's Journal (there's only one per module) only allows two types of entry, the Journal Category, and its Journal Entries. The Journal Category gives you the general heading you see in the client's Journal screen, the Journal Entry is the larger text that describes what's going on in more detail. To give yourself Journal entries appropriate for Plott's quest, you will create two entries: one for 'started' quest state, and one for 'completed' state. Here's how to set them up:

  1. Open the Journal Editor
  2. Click on the 'Add' icon to add a single node. This will be your Journal Category; it will be created with a default Name and Tag, and set to the lowest priority.
  3. Change the Name to Plott deVice's Problem. This is the heading in the client Journal under which all your detailed plot update descriptions will appear.
  4. Change the Tag to journal_plotts_quest. If you assign journal entries with the Conversation Editor (as you will in a minute), you won't need this tag. If you want to make journal entries with custom scripts, however, this is the reference you will be using.
  5. By default, Plott deVice's Problem is the lowest priority. Journal entries can be sorted by their priority in the NWN Client. It's up to you to decide which quests a player should consider most important - or if you want to give them that much of a hint.
  6. Now highlight your new node, and click the 'Add' icon twice. The Journal Editor will create two Journal Entries for you, with default names. Each entry has three features: an ID, some Text, and a Quest Completion Flag.
  7. First change the IDs. By default, the Editor will create consecutive numbered IDs, but it's a good idea to leave room for expansion later, so change the tags to 100 and 200. Notice that the main pane of the Editor will sort itself as you do so.
  8. Now, to fill in the Journal Entry Text: highlight the first node again, ([0100]), and write in the Text box something like "Plott deVice has lost his doohickey of Destruction. You've promised to find it for him."
  9. Click on the second node ([0200]), and give it a description along the lines of "You've found Plott's Doohickey, and returned it to him. He gave you some gold for your trouble - what a nice chap."
  10. Finally, check the 'Completed' box for the second node. This tells the engine that the quest is done when this Journal Entry is set, and moves the Journal Category from the 'Active' leaf of the Journal, to the 'Done' leaf.
  11. Your journal should now look something like this:

  12. Click on the 'OK' button to close the Editor

Linking The Conversation and the Journal

Now you've constructed the two Journal entries, let's get the Toolset to add them to the Player's Journal at the right moment in the conversation with Plott. Once you know how, this bit's easy as falling off a log:

  1. Open the Conversation Editor
  2. Select the Yep. Be right back. node.
  3. Click on the 'Other Actions' tab in the bottom right corner of the Editor.
  4. There are two drop-down boxes underneath 'Journal', from the first one, select the only Journal Category, "Plott deVice's Problem".
  5. The second one gives you numeric choices for the Journal Entries you created. Since there are only two so far, it shouldn't be too hard to remember that 100 is the quest's "started" state Entry, so leave it selected.
  6. Notice, while you're there, the Edit button, which will open the Journal Editor directly; very useful for adding Journal Entries as conversation inspires you, or checking up on your Entry numbers.
  7. Now click on the Thank you, thank you, thank you.... node, and give it Journal Entry 200.
  8. While you're there, let's have some fun, and make Plott absurdly grateful to you. In the 'Play Animation' drop-down box, select the 'Worship' animation. (Feel free to go back to other significant conversation nodes, and add animation to them... maybe 'Talk Pleading' would go well with the "Have you found..." line. Don't overdo it, though: sometimes 'less is more' - you don't want to make all of the actors in your module total hams!)

That's all there is to it; I told you it was easy! Why not open up the client and check that the Journal now updates when you're assigned the quest, and that it completes when you give Plott his Doohickey back.

Multilingual Modules

Internationalisation (or i18n as it's often abbreviated) is something you might think is difficult, but the folks at BioWare are cunning - and appreciate the international market, even if the nature of international shipping and the Laws of Physics give some people a differing perspective. As you will see, the hardest thing about i18n in NWN is getting your text translated. Fortunately for me, almost as soon as Part I was published, a very cool person translated it into German. Hence this quick lesson:

Another neat feature

You'll notice that there's a Male/Female choice that's available in some languages, but greyed out for English. In many languages how you say something depends on the gender of the person you're addressing. NWN is cool enough to keep track of all of that for you - provided you've got the translations!

  1. Open the Conversation Editor
  2. Highlight the first node, Thank you again, you're wonderful.
  3. At the bottom of the Editor, to the right of the 'Text' box is a button with an ellipsis. Click on it.
  4. Select 'German' and type Danke nochmals, Sie sind der Beste. into the text box.
  5. Click on 'OK', and when someone playing the German version of NWN runs you're module, Plott's last words will be in German.
  6. A lot of text in NWN is configured for i18n, including NPC names, item names and descriptions, and Journal Categories and Entries and so on. If you're cool enough to be a polyglot, keep an eye out for the i18n ellipsis, and make your mods multilingual!
  7. If you want to finish off Plott's German dialogue, use the German translation of Part I

Go Kill! - The Easy Way

One of the most common complaints I've heard since writing Part I is that 'Go Fetch!' quests are all very well, but what if you want to make a 'Go Kill!' quest. The bad news is that you can't create a pure and simple 'Go Kill!' quest without some scripting - which I've tried to avoid so far. The good news is that, using a slight variation to 'Go Fetch!', you can achieve the satisfying elimination of an unwanted foe with no scripting by hand! Unsurprisingly, you need a second NPC (or a monster - no difference, really) for Plott to have you kill. To give Plott deVice some depth (about as much, say as a puddle after a light shower), paint another NPC, and call her Ai von Kallink. We'll imagine that there's some long-running feud between their two families, and that they're both now after each others' blood.

How Shallow is This?

The quest so far is pretty trivial, but it doesn't need to be. This simple format can be the foundation for some very compelling story-telling, and that's what NWN is all about. (If you haven't figured it out already: 'cheating', power-levelling, munchkinism and twinking are so easy with NWN that they're utterly pointless). But indulge me, and imagine you're creating a campaign setting. I maintain that a 'Go Fetch!' quest with fatal variations could be used to define new (Server Vault) characters' Alignment - based on their behaviour - not an arbitrary choice. Think about it. You're players are asserting in their PC creation screen that they're going to behave a certain way - and the game is able to effect changes on them if they 'stray' from that choice.

Consider populating your prelude what - at first blush - looks like a simple, get-you-to-level-2, 'Go Fetch!' item quest. But then, the person who has the item claims its hers, and the local priest of a Lawful god says it belongs to the City. The initial NPCs neighbours say he's a gentleman, and kind-hearted, but there are rumours in the tavern that all is not what it seems. The second NPC has a so-so reputation, but is a devout member of the priest's flock, and sponors the local militia. In fact, the prelude is populated NPCs who have conflicting stories about the item... and the PCs alignment will be decided by his decisions about where the Item ends up, and who (if anyone) he kills.

Of course, you would have to establish a genuine story for the Item, and write dialogue and characters that could be determined to be honest or lying, prejudiced or impartial, a path through the quest that the genuine Lawful Good Paladin would get right (or fall if he kills the wrong participants). It's no mean feat to balance that conversation right, and you'd want to make sure you warned players what they were getting into in your module description, but the possibilites are huge.

Great modules will succeed by breaking the NWN paradigm

Variation 1: 'Go Kill - and Prove it!'

This trick is all in the title. If you were a diligent follower of Part I, you've already figured out how to turn Plott's quest into a 'Go Kill - and Prove it!" quest, especially if you played the original Baldur's Gate and got the hint about the Bandit Scalp. It's as simple as giving a third party an item that the quest initiator wants. Building on our previous work, you're going to modify Plott's quest, so that it leads to Ai von Kallink's doom.

  1. Open Plott deVice's conversation in the Editor, and highlight the I've lost my Doohickey... line.
  2. Change the line so it reads That evil hag Ai von Kallink has stolen a precious family heirloom - the famous Doohickey of Destruction. Can you recover it for me? You may need to ... er ... persuade her to give it back.
  3. Leave the rest of Plott's dialog (and the Journal entries) for now, and close the Editor
  4. Edit Ai von Kallink's Properties, and look at the first tab, 'Basic'
  5. Open her Inventory (the button under her model), and give her a Doohickey of Destruction. Make sure it's flagged as 'plot', and 'droppable'.
  6. Close the Inventory, to return to her properties.
  7. Still on the 'Basic' tab, click on the 'Edit' button in the 'Conversation' section under her portrait.
  8. Give her a single line of conversation, You've come for the Doohickey, haven't you, you scum? Tell Plott he'll get it over my dead body!
  9. Add another node below that, and delete its default text, leaving only [END DIALOGUE]
  10. In the 'Actions Taken' tab, click on the Wizard's Hat to start the Script Wizard
  11. Check the 'Perform an Action' box, and click 'Next'.
  12. Select 'Attack'. Notice that this option automatically ruins the PC's reputation with every member of the NPC's faction. Click 'Next'.
  13. Save the script as 'dlg_avk_01', and save the conversation as 'dlg_aivonkallink'.
  14. Close Ai von Kallink's properties, and save the module. (Incidentally, I strongly recommend you save your module regularly, and back it up, too).
  15. We've set up Ai so she has a one-liner conversation, and launches an attack at you as soon as you click 'Continue' - a surefire way of getting herself killed.
  16. Test the module as it stands.

Problems?

You may discover a small problem. Once you've made mincemeat of Ai, and recovered the Doohickey, Plott is reluctant to talk to you... in fact, he's outright hostile, and you don't even have the option to talk to him... and you though he wanted her dead. The problem is that they're both in the same Faction. Note: if you've used certain blueprints for Plott and Ai, they won't necessarily be in the same Faction. To see this problem in action, go to the 'Advanced' tab of their properties sheet, and change their Faction to 'Commoner'.

Factions, or 'Why Are All the Guards Trying to Kill Me?'

When you told the Wizard to make Ai attack you after she'd mouthed off, it made her whole faction hate you too. If you used some of the regular NPC blueprints, the chances are that both Ai and Plott were in the same Faction, 'Commoner'. Factions are used for some of the coarse-grained behaviour in NWN. Each Faction is given a set of numeric values between 0 and 100, each representing that Faction's opinions of every other. Let's have a look at Factions now:

  1. Open the Faction Editor. (Tools &gt; Faction Editor or Ctrl+Alt+F)
  2. You will see a bar chart. Before looking at the chart, look to the list of Factions at the right. Each checked faction will appear across the bottom axis of the chart. The (single) highlighted faction will be the faction whose opinions are being plotted. The vertical axis of the chart shows you the value of the highlighted values opinions.
  3. Check all the boxes, and highlight 'hostile', as an example. Only one bar shows up... above the 'hostile' faction, and its totally full - at 100. This means that members of the hostile faction are friendly towards other members of the hostile faction.
  4. Click the chart somewhere above the 'PC' label on the bottom axis. Notice the descriptive text at the bottom of the window changes to 'Hostile is hostile toward PC'. Creatures that are hostile to a creature of a give faction will tend to attack them.
  5. Just for kicks, click on the bottom axis of the chart above PC, and drag your mouse to the top. As you drag, a bar will appear, and change color from an angry hostile red, to a friendly blue color. If you leave it at the top, the status bar will now tell you that 'Hostile is friendly toward PC'... members of the Hostile faction (that's most of the monsters) will now attack your attackers.
  6. Restore the Hostile faction to being hostile to PCs
  7. Click on the 'Full Detail' button. Now each labelled faction has two bars - one showing how the highlighted faction feels about the labelled faction, and the right-hand bar showing how the labelled faction feels about the selected faction
  8. Select the 'Defender' faction. Notice that Defender is friendly to Commoner, but Commoner is impartial to Defender. This is why Guards will attack you when you hit a peasant, but Commoners won't rally to the defense of Guards.
  9. Notice, incidentally, that you can't set the PC's opinion of any faction - which is as it should be. It's up to the player to decide whether to be friendly or hostile to any given NPC.
  10. Let's add a new faction for Ai, so Plott doesn't automatically become hostile when you bump her off. Click 'Add Faction'.
  11. You get to name your faction (call it 'vonKallink'), and also select a 'parent' faction, which determines the defaults for the new factions opinions.
  12. Select 'Commoner' (which is the faction most like to what we want) and click 'OK'.
  13. Have a look at her chart - she's hostile to monsters, friendly to other vonKallinks and Commoners, and impartial to everything else.
  14. Make her impartial to Commoners as well. You don't want Ai flying off the handle if you decide she's in the right and want to give Plott a pummelling instead.
  15. Now select the 'Commoner' Faction, and make them impartial to vonKallink. Now you've got a new Faction that really won't be fussed if you bump Plott off, and vice versa

Bear in mind that if you create an item called 'Ai von Kallink's severed head', and leave it as the only droppable Inventory item that Ai leaves behind her on her untimely demise, most players will pick it up without thinking - they understand how the game works (but see How Shallow is This?, above). You won't need to give Plott a conversation node that says Bring me the head of that harridan, Ai von Kallink, you'll just have to arrange for her demise.

Area Transitions

So far, you've only been working in one area - and that can be a little dull for players. Now, you're going to add a new area, move Ai von Kallink to the new area, and set up Area Transitions between the two areas so the players can move either way. You're going to do this the easy way, using Doors. I'll cover other Area Transitions another time.

  1. Depending on the tileset you used, you may or may not have an somewhere to add a door. If you're indoors, add a doorway from the Features of the "Paint Terrain" set, otherwise add a group that's got a door space.
  2. Once you've got a doorway, add a door. When you move your mouse cursor near to the doorway, the neat spinning door will 'snap' to the doorway. Paint it in.
  3. Edit the door's properties and change its tag to doorPlottExit. Door tags can be confusing, so choose a convention for your modules and stick to it.
  4. Save the Area, and start the 'Area Wizard' to create a new one.
  5. Create a small Forest Area, and call it something snappy like 'Outside'.
  6. Add a 'Lodge 2x2' group in the middle of the area (feel free to take some artistic license here... just make sure you've got at least one doorway on the map before...
  7. Add a Door to the doorway of the Lodge
  8. Edit the Door's properties, and change it's tag to doorPlottEntrance. Don't worry if your first area was also outside, or isn't appropriate for Lodge interior. It won't matter to the engine. Your players might find it wierd, but hey, change its name to 'Spooky Door', and give it a description like 'The hairs on your arm stand on end as you reach a tentative hand towards this door... is that the sound of screaming in the distance?', and all will be forgiven.
  9. Go to the 'Area Transition' tab. You could do this bit by hand, and set the destination and type of each door manually... but these tutorials are all about exploring the easy ways to do things first.
  10. Click on 'Setup Area Transition'
  11. The wizard kicks off by default with the current area, 'Outside' (if you followed my lame suggestion, as the 'Target Area'. Change that to the name of your first Area.
  12. Make sure the Target Type is set to 'Door'.
  13. You'll see a list of available doors in the Target Area. Select doorPlottExit, and you'll see the door highlighted in the wireframe model to the left. Cute.
  14. Set the Connection Type to 'Both Ways'. This makes the toolset configure a one-way transition on each of your two doors, linking them.
  15. Click 'OK', and 'Yes' if you're asked to save the Area.
  16. Go back to your first area, and select Ai von Kallink.
  17. Use Ctrl-X to 'cut' her, and switch to the 'Outside' Area.
  18. Use Ctrl-V to 'paste' Ai, and paint her somewhere appropriate.

Now go test your module. Check the door transitions, run the quest, and have a ball!

Exercises for the Reader!

Some more suggestions to trigger ideas, no scripting required:

  • Find a pretext to give the option to have the PC go back to Plott after first speaking to Ai, and then go kill her.
  • If the PC takes the long way, perhaps Plott should reward them with more xp and less gold?
  • Give the 'deVice' family a faction. How would you make the deVices and vonKallinks attack each other on sight?
  • Create a module in which all the monsters hate eachother and fight eachother to the death
  • Set the deVices and vonKallinks up to be in a state of cold war, and fix Plott and Ai's dialogue so that the PCs actions could either reconcile the families, or descend into all-out war? (Hint: Look at the options available in the 'Actions Taken' wizard)
  • Could you recreate Romeo and Juliet in NWN?

Coda

I hope this is of use in getting you started on the path of NWNToolset Wizardry, and Script Sorcery (man, I'm corny). If you find an error or typo, or want to publish this somewhere, please let me, Iskander, know by PM'ing me on the Bioware Boards

author: Iskander Merriman, editor: Charles Feduke, additional contributor(s): Palme (German translation)


Category - Writing a Module

Home > Lyceum > Tutorial > Writing a Module

Writing a Module

This tutorial follows the design of a module. The module can be downloaded and played in NWN, then the tutorial read to see how everything is done. This tutorial is intended for beginning module designers with little or no scripting experience.

Title | Brief Description
Robert Straughan - Capture Glory: Introduction | Introdution to the Capture Glory module and tutorial.
Robert Straughan - Capture Glory: Death Rules | Covers the penalties associated with dying for the Capture Glory module.
Robert Straughan - Capture Glory: Crowbar in a Well | Demonstrates working with items an PCs in a module.
Robert Straughan - Capture Glory: Strip Tease | Shows how to strip all the PC's equipment and start the PC at least at level 3.
Robert Straughan - Capture Glory: Garbage Treasure | Creates new items tailored to the character's class so the PC isn't helpless.
Robert Straughan - Capture Glory: Dwarf NPC | Shows how to add a henchman to the PC's party.
Robert Straughan - Capture Glory: Minotaur Death | A fight between the PC, his henchman, and a minotaur.
Robert Straughan - Capture Glory: Raging Battle | The PC leaves the caves with an NPC to see a battle taking place.
Robert Straughan - Capture Glory: Light Show | The dramatic conclusion to the Capture Glory module.
Robert Straughan - Capture Glory: Miscellaneous/Reference | Miscellaneous and outside reference information.


Tutorial - Robert Straughan - Capture Glory: Introduction

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Introduction

Robert Straughan - Capture Glory: Introduction

Introduction

Okay, what I am actually going to try and show you is just how easy using Neverwinter Script can be if you can learn to use the right frame of mind when writing your scripts.

In order to do this, I have built a small module to demonstrate to you how easy it can be to use the scripting language. Before attempting this tutorial, you should play through the module (it'll only take about ten minutes).

[Editor's Note: The complete tutorial and module is available from NWVault at nwvault.ign.com/Files/other/data/1044836522765.shtml.]

The Basic Principle

Remember, no matter how complicated scripting looks, there is a basic principle to keep in mind:

"Scripting is like LEGO."

This may seem a bizarre statement, but it's true. Anybody who doesn't understand what LEGO is for would probably throw the bricks around or try and eat them.

Once you understand how the bricks can snap together, you can sit there and build up a massive pile of junk until your heart's content. While you can learn how to clip together LEGO and build that pile of junk in almost no time, it takes practice to come up with a 14-room mansion.

While it can take very little time to learn how to put together scripting, you must bear in mind that scripting is not like experimenting with the toolset. You can't sit down and write a script without having a rather specific idea of what you wish it to do.

This is why I believe most tutorials go wrong by trying to teach you bits and pieces. Useful information to have at hand, but it doesn't necessarily teach you how to do scripting by yourself. They teach you the language. I'm going to teach you to script. To get end results.

The Module

The module was not intended to be entertaining as such, it was more to include a variety of scripting challenges that I could run through and show you the process of writing them out.

Screenshots

I've placed a number of screenshots of this module in action, as well as some editor shots. I have placed links on the relevant pages from this tutorial so that you can see end results while reading.

The Tasks

At the end of each page, I've set a task based on what I've done on that page. Open up the editor, and see if you can complete the tasks I have set. [Note: a hit to the task appears in seemingly empty box at the bottom of each topic; you can view the hint by highlighting the text within the box - but try and complete the task without using the hint if you can --Ed.]

Update

This tutorial has been updated. The updates have been made in bold type-face, so that those who have previously used this tutorial can see which parts I've added.

This Box

This box will give you some useful information on the basics of scripting throughout the course of this tutorial.

Don't worry if you can't understand what it says straight away, it will help when running through the tutorial.

Basic Scripting

One of the first and most basic concepts of scripting that you should grasp is the types of information script deals with.

int

int stands for integer, which means a whole value. It does not have letters, and cannot have a decimal point. Should a fraction occur, the integer will be rounded down.

object

An object can be anything which is physically represented within the module. Areas, creatures, placeables, waypoints, etc. These are all objects.

float

A float is also a numeric value only, but this can have a decimal point. Note that some scripters do place an f after the number. This does not interfere with the script.

string

A string is a series of numbers or letters encased within a set of quote marks. A string is case sensitive.

location

A location is the x/y coordinates of an object within an area in your module.

effect

Effects are things from visual effects, to applying spell effects or other bonuses/penalties upon an object.

vector

A vector is similar to a location, only it includes the z-axis value as well. A vector is made up of three floats, but is treated as one value in the script.

author: Robert Straughan, editor: Charles Feduke


Tutorial - Robert Straughan - Capture Glory: Death Rules

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Death Rules

Robert Straughan - Capture Glory: Death Rules

Starting Off

Okay, for this module, I decided to keep to just two areas. This is not a tutorial on how to use the toolset, or how to do custom content. I am going to run you through how I came up with the scripts that make this module happen.

Module Properties

The first thing I did was removed the default OnDeath, OnDying, and OnRespawn scripts from the Module properties, found in the Edit menu. I then decided what sort of special rules I would want to implement for these.

I chose:

When a player is reduced to 0 or less hit points, they are automatically killed (ie. there is no bleeding).

If the player chooses to respawn, they lose a point of Constitution, as though they had been resurrected.

If the player chooses to respawn, they respawn at a point near the beginning of the area.

OnDying

In order to ensure that the player actually dies when they are reduced to 0 or less hit points, I wrote the script "tutorial_ody". In it, you will find the following lines:

//Script "tutorial_ody"
void main()
{
     ApplyEffectToObject(DURATION_TYPE_INSTANT,
          EffectDeath(),
          GetLastPlayerDying()
     );
}

Now, this is probably one of the simplest pieces of scripting you'll find in this tutorial. Be sure to read about functions in the box to the right before continuing.

If you look at the definition of ApplyEffectToObject in the box at the bottom of the script editor, you'll see this:

//Definition of the ApplyEffectToObject function
void ApplyEffectToObject(int nDurationType, effect eEffect,
     object oTarget, float fDuration=0.0f)

Now, the function is a void function, which means it will simply run by itself, as it returns nothing. Notice it has four parameters. We need to fill in that information so that the function knows what to do.

The first value is an integer, called nDurationType. We don't have to worry about the name of the parameter, since that is used within the functions code to refer to whatever value we place there. In this case, we have used DURATION_TYPE_INSTANT.

Notice that despite the fact this is an integer parameter, the value uses letters. This is because certain constants used by the engine have been given predefined text values so that we can easily know which value to use.

In this case, DURATION_TYPE_INSTANT is actually the equivalent of the value zero. Since some functions use values up to 300 or more, its easier for us to use the text equivalents. That way we know what is going on.

The next parameter is an effect, called eEffect. In this case, we have gone and put EffectDeath() into it. Look in the editor for this function, and you'll find the following definition:

//Definition of the EffectDeath function
effect EffectDeath(int nSpectacularDeath=FALSE, int nDisplayFeedback=TRUE)

As you can see, this function returns an effect value. Since the parameter requires an effect piece of information, we can place this function into the parameter (told you it was like LEGO).

Notice that I haven't entered any information into the parameters of the function, even though it asks for them. That's because the parameters already have values by default. When this occurs, if I don't want to change those values, I don't have to put them in.

The final parameter I've entered is GetLastPlayerDying(), for the parameter oTarget. As you can see, oTarget must be an object. Find the GetLastPlayerDying function, and you'll get this:

//Definition of the GetLastPlayerDying function
object GetLastPlayerDying()

This function has no parameters, and returns an object value, so what I've entered will be valid. Note that there are many functions like this, and you must choose the one which matches the event handler that fired the script.

In this instance, it was the OnDying handler, so I used the GetLastPlayerDying function. Some other examples include:

  • OnUsed = GetLastUsedBy
  • OnClosed = GetLastClosedBy
  • OnAreaTransition = GetClickingObject

Notice that there is one last parameter for the function we are using. A float value called fDuration. This has already been declared by the function as being zero.

It is actually used for when we have a DURATION_TYPE_TEMPORARY effect. Since we aren't using one of those, and the value has already been given a default of zero, we can skip it out.

And that's it. The script will run whenever a player is between 0 and -10 hit points, and will apply the effect of death to them.

OnDeath

Now that we've established that players die when they drop to or below 0 hit points, we need to present them with whatever options they have. To do this, we place a script in the OnDeath handler, with the following lines:

//Script "tutorial_odth"
void main()
{
     object oPlayer = GetLastPlayerDied();

     PopUpDeathGUIPanel(oPlayer, TRUE, FALSE, 1,
          "If you press respawn, you will be resurrected at the beginning of " +
          "the level, and will suffer a -1 to your constitution.");
}

Now, as ever, the void main() means that the script will run whatever is in those curly brackets as soon as the script is fired. In this case, whenever a player actually dies.

Notice how I have declared an object. The first line means I have created a value that the script can use. I've made it an object value, and I've called it oPlayer. I could have left it at that.

Instead, I've also initialised the value, by giving it a value equal to whatever the GetLastPlayerDied function equals. This is one of those functions that gets an object based on the handler firing this script.

The PopUpDeathGUIPanel is the function which makes that set of buttons you get when you die appear. It has a number of paremeters we can give it, as defined below:

//Definition of the PopUpDeathGUIPanel function
void PopUpDeathGUIPanel(object oPC, int bRespawnButtonEnabled=TRUE,
     int bWaitForHelpButtonEnabled=TRUE, int nHelpStringReference=0,
     string sHelpString="")

So, another void function, that's why I haven't declared it, and just run it straight away. You can't actually declare void functions at all. They are meant to be run by themselves.

The first parameter is an object called oPC, and indicates the object that we wish to target. Notice I place oPlayer into this parameter. Once I've declared oPlayer, and initialised it with a value, I can refer to the declared name from then on to use that object.

Notice that even though the next parameter has been declared for me by the function, I've still put it in. This is because I wish to change the values of parameters after that one in the sequence. I cannot skip out a parameter, even if already declared, if I wish to change ones after it.

I have changed the next parameter to FALSE. The next parameter I have set to 1, to let the function know that it should show the string I have entered into the last parameter. If in doubt as to what you should put in, read the function definition in the bottom box of the editor.

The final parameter is a string value, which is a message put up on the screen when the death panel shows.

Before moving on, just to make sure I have made the point clear, consider the following script:

//Example Script
void main()
{
     object oPlayer = GetLastPlayerDied();
     string sMessage = "If you press respawn, you will be resurrected at " +
     "the beginning of the level, and will suffer a -1 to your constitution.";
     PopUpDeathGUIPanel(oPlayer, TRUE, FALSE, 1, sMessage);
}

What does this do? If you've read it correctly, you'll notice it does the exact same thing as the previous script. All that this does differently is that it declares a string called sMessage, and initialises it. I then use the declared name to represent that value in the function's parameter.

OnRespawn

Finally, the OnRespawn script. This is where we put everything we've learned from the previous two scripts together. Observe the following:

//Script "tutorial_ores"
void main()
{
     object oRespawner = GetLastRespawnButtonPresser();
     object oWP = GetNearestObjectByTag("RESPAWN_WAYPOINT", oRespawner);

     ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oRespawner);
     AssignCommand(oRespawner, JumpToLocation(GetLocation (oWP)));

     DelayCommand(0.1f, ApplyEffectToObject(DURATION_TYPE_INSTANT,
          EffectHeal(GetMaxHitPoints (oRespawner)), oRespawner)
     );

     DelayCommand(0.2f,
          ApplyEffectToObject(DURATION_TYPE_PERMANENT,
               SupernaturalEffect(
                    EffectAbilityDecrease(ABILITY_CONSTITUTION, 1)
               ),
               oRespawner
          )
     );

     DelayCommand(0.2f,
          FloatingTextStringOnCreature(
               "*constitution decrease*",
               oRespawner,
               FALSE
          )
     );
}

So, what does it do? By now void main() should be familiar to you. I've declared and initialised two values. Both are objects, and one is called oRespawner while the other is oWP.

oRespawner is one of the simple 'get an object based on the handler' functions. But what about oWP. Here, I've used the function GetNearestObjectByTag function. Here's the definition:

//Definition of the GetNearestObjectByTag function
object GetNearestObjectByTag(string sTag, object oTarget=OBJECT_SELF,
     int nNth=1)

This function returns an object, so I won't get an error for declaring it as an object. The first parameter is a string value. Here, we enter the tag of the object we are after, namely a waypoint with the tag RESPAWN_WAYPOINT.

Notice that although the tag for the waypoint does not have the quote marks, the string does. Any string, regardless of whether it contains numbers or letters, must be encased in quote marks.

The next parameter is an object. In this function, oTarget has already been declared, but the script is in the OnRespawn handler, which means OBJECT_SELF, is the module. That won't work.

I've placed the declared name for the last person to push the respawn button into this parameter, since it is an object. I haven't specified the last value, since I don't need it for the moment.

What this function will do is get the nearest object to the person who pressed the respawn button with the tag that I have specified. It will not be able to get objects outside the area that the respawning player is in.

Next I use the same ApplyEffectToObject function as I did in the OnDying script, only this time, I've specified that it is using an EffectResurrection() instead. It has no parameters, so I've entered none.

The next line is interesting. I've used the function AssignCommand. Look at the definition:

//Definition of the AssignCommand function
void AssignCommand(object oActionSubject, action aActionToAssign)

As you can see, for the object parameter I've given the respawning player as the oActionSubject. But what about this action?

The majority of commands that can be given to an object in the module have Action at the front of their names. Some don't have this, but all Action commands are placed into the action queue of the target object.

You can also place void commands into the action slot. Why? Well, look at the listed Action functions in the editor. See their definitions? They are all void commands. The only difference is that functions with Action in their name are queued.

So what does this mean? Well, AssignCommand means we can tell an object other than the calling object to do something. As this is the OnRespawn script, using the action command I've given without this extra function means it would try to get the module to do this action.

//Definition of JumpToLocation function
void JumpToLocation(location lDestination)

This is the action in question. Notice that there is actually an ActionJumpToLocation function. I'm using this one since I don't want the target to queue this command, I want it to happen instantly.

The parameter is a location value, and I've used the GetLocation function to specify the location of oWP, as follows:

//Definition of GetLocation function
location GetLocation(object oObject)

The function returns a location value, and has an object value for a parameter. So I can combine the two together, and specify an object within GetLocation, in this case, oWP. Obviously I didn't want the module to jump to the location of oWP, which is why I used AssignCommand.

The next two lines are also ApplyEffectToObject functions, with two different effect functions used. They are slightly modified however, using the following function:

//Definition of DelayCommand function
void DelayCommand(float fSeconds, action aActionToDelay)

This is exactly the same in application as the AssignCommand function. It is used to delay the firing of a void function, typically one with an Action in its name. You can delay the function using a float value that represents the number of seconds before the function will fire.

Note that the DelayCommand functions will fire themselves as soon as this script has fired. They wait for the specified amount of time, and then trigger the commands they have been given.

This does not mean that commands beneath the DelayCommand will wait until the delayed function has fired. The script remains open and comes back for the delayed commands when their time is up.

Imagine I'm sitting at the end of a conveyor belt, which is sending random LEGO bricks in my direction. I'm in the process of building a wall when a window shows up. But I'm not ready to place the window.

So I put it to one side, and continue building the wall from the bricks the conveyor is sending me. Eventually, I see where I want the window to go, so I pick up the brick and place it. This is how DelayCommand works, the script keeps running, but you can put a function to one side for a while.

The first effect used is EffectHeal:

//Definition of EffectHeal function
effect EffectHeal(int nDamageToHeal)

This will heal an amount of damage equal to the integer value we specify in the parameter. In this case, I've used GetMaxHitPoints:

//Definition of GetMaxHitPoints function
int GetMaxHitPoints(object oObject=OBJECT_SELF)

This returns an integer value, but since I don't want to get the hit points of OBJECT_SELF (which is the caller of this script, ie. the module) I have specified that oRespawner should be the value for oObject.

The next one is also an odd one:

//Definition of EffectAbilityDecrease function
effect EffectAbilityDecrease(int nAbility, int nModifyBy)

This in itself does not look all that complicated. An effect returning function, with two integer parameters. For the first, we specify ABILITY_CONSTITUTION to tell it we wish to decrease the target's constitution score.

For the second, we tell it 1. Note that this is not -1. The function itself has already taken into account that it is subtracting, so had you placed -1 into this parameter, it would add instead.

The interesting part of all this is that this effect has been encased within another function:

//Definition for SupernaturalEffect function
effect SupernaturalEffect(effect eEffect)

The duration type for the ApplyEffectToObject function has been set to DURATION_TYPE_PERMANENT, but there's a small nuance with this. It isn't permanent. Not truly. This is to make an effect very long lasting, but dispellable.

By placing the effect we wish to apply within this effect returner, we aren't changing anything other than the fact the effect is no longer dispellable. This makes it truly permanent, and not even a script can remove this effect any more.

And finally, the last line:

//Definition of FloatingTextStringOnCreature function
void FloatingTextStringOnCreature(string sStringToDisplay,
     object oCreatureToFloatAbove, int bBroadcastToFaction=TRUE)

Floating text is that slightly transparent text which floats up the player's model on certain events, such as a locked door. To let the player know what is happening, I've decided to add some in for the respawn.

It's a void function, so I can delay it. The string value I've typed directly into the function parameter. For the object target, oRespawner makes sure I'm sending the message to the right player.

The last parameter I've set to FALSE, since I don't want this message to appear to other party members. A lot of working out what parameters to specify is an application of logical thought, or simply looking at the definition in the box at the bottom of the editor.

So, what does this script do? When a player pushes the respawn button, it will resurrect them, send them to the nearest object with the tag I specified, heal them to their maximum hit points, decrease their constitution by 1 permanently, and inform them of the loss.

What have you just learned?

Believe it or not, on this one page, you have learned all there is to know about the basics of scripting. If you think you can handle this, move onto the next section. From now on, I'll be going a lot faster.

Don't believe me? Well, perhaps you should read through it all again one more time to be sure you understand it. Or better yet, close this tutorial, and try and write the above three scripts in the editor yourself, then see if you got close.

Tasks

Here's a task for you. In the OnRespawn script, I healed the player of their hit points. Alter the script so that it heals them by exactly the amount they need to be fully healed.

Hint

You need to change the integer amount that the player is healed by to the exact amount they have remaining. You can use the functions for retrieving the player's hit point values to do the maths and get the correct value.

White Space

The first important concept to be aware of is that the compiler ignores white space.

There is no must or must not on how you space out the lines in your code, it is simply for presentation and to ensure your code is easy to read.

To tell the compiler where each line begins and ends, you place a semi-colon to mark the end of a line. There are some exceptions to this, which I will explain later.

Functions

Functions are the majority of script. They are the processes that the game does to get the results you want.

So what do you need to know about functions? Basically every function is made up of four parts:

The Returners

At the beginning of every function will be a returner. This indicates what kind of information is returned by this function when it is run.

The Function

This is the name of the function, and usually gives you an indication of what the function does.

Note that you can tell the difference between a function and a value name because functions will always have a pair of parentheses () after their names.

The Parameters

The last section of the function is contained within brackets. These are the pieces of information that the function needs to be given to do what it does.

There may be no parameters for a function. There may be several parameters, and these are seperated by commas.

Some parameters might be pre-declared, in which case, provided it is the information you need, you can skip entering that information in.

The Code

Underneath every function is a set of curly brackets. Within these are the code that forms what the function does.

Two Scripts

At the end of the day, there is only ever two kinds of scripts.

Those which start with void main() are the majority of them. void main() is the function which is run straight away when a script is called. It does so because it is a void function, and thus returns no information.

There are some which start with int StartingConditional(), which means the script returns an integer value based upon the scripts results. It is used to determine whether a conversation line should be spoken or not.

True or False

A nice little nuance with the NWScript language is that we can use the boolean expressions TRUE and FALSE in our scripting. What's even nicer is that FALSE is equal to the integer value zero, and TRUE is equal to one. This helps out a great deal in a number of situations.

Duration Types

One of the little nuances that I've seen some people have difficulty with is duration types.

With the example script to the left in mind, EffectDeath you might think is a permanent effect. This is in fact wrong.

EffectDeath is the act of killing the target. We don't want to tell the script to continually kill the target. Once will suffice. This means we use an instant effect instead.

The area where this really applies is when dealing with visual effects, which come in different types. Generally, VFX_DUR type visuals are duration or permanent visual effects, and VFX_IMP and VFX_FNF effects are instant.

Declarations

Rather than placing a value straight into a function's parameter, I can declare the information seperately.

For example, I could have a string called sMyString, and set it to "Hello" if I wanted, or I could use a function which returns a string instead.

When declaring a value, if I do not initialise it, its default status is 0. With strings this means it starts as a blank string, and with objects it starts as OBJECT_INVALID.

The advantage of declaring a value is two-fold:

First, I don't have to type out values over and over. I can declare it once and then just refer to the name I assigned it.

This also means that the value in question will never change. It will always be the exact same value on line x as it is on line y (unless of course I change it over the course of the script).

Second, it's efficient when you need to use a function multiple times. Functions that get or set information to and from the module take a little processing power each time the script is run.

By declaring a function once, the script only has to do that process once. Even if the function in question takes up only a small amount of procesing power, where you have lots of scripts firing in multiple places, you should attempt to only ever use a function once in any one script.

It reduces the amount of processing the computer has to do to run a script, and it also ensures that you are manipulating the same piece of information throughout the script, and not getting or setting different ones.

The last thing to remember about declaring values is that, when you declare them, the reason you are declaring them is to tell the script what type of value they are.

From then on, it knows what the value type is whenever you type it into the script. This means when you initialise the value, and you later wish to change what it equals, you do not need to give its value type again.

This is why you nearly always see declarations in a group near the beginning of the script. If you don't declare what type of value it is before using it in the script, the script doesn't understand what you're asking it to do.

Once declared, from then on you can use the value in mathematical operations, or in any other way, and you won't have to tell the script what kind of value it is.

Screenshot

  • Con. Loss Sucks
  • Module Properties

author: Robert Straughan, editor: Charles Feduke


Tutorial - Robert Straughan - Capture Glory: Crowbar in a Well

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Crowbar in a Well

Robert Straughan - Capture Glory: Crowbar in a Well

Initial Area

For the first area, I decided to make a set of caves. You start out captive in one, and the exit is in the other. I placed the start point, and then a door to block the player's way.

Now, the first problem. I have locked the door. A thief could get past this with a reasonable roll, and a wizard with Knock could open it. A strong character could bash it down, though it might take some time. We need an easy way to open the door for those who can't do any of the above.

Pry the doors!

What about a crowbar? Okay, so where would the player find a crowbar in the cave? I've placed a well placeable in the cave, and I've checked the usable checkbox in its properties to allow the player to click on it.

I now need to tell the well how to give the crowbar to the player. I do this using the OnUsed handler, in which I place the following script:

//Script "cave_well"
void main()
{
     object oLast = GetLastUsedBy();
     int nDone = GetLocalInt(OBJECT_SELF, "DONE_ONCE");
     if (nDone == 0)
     {
          SpeakString("You look down into the well, " +
          "and see some old rope still tied to " +
          "something dangling in the dark." );
          SetLocalInt(OBJECT_SELF, "DONE_ONCE", 1);
     }
     if (nDone == 1)
     {
          SpeakString ("You pull the rope and haul " +
          "up what appears to be a crowbar." );
          CreateItemOnObject("crowbar", oLast);
          SetLocalInt(OBJECT_SELF, "DONE_ONCE", 2);
     }
}

Follow it through. I declare and initialise oLast using an object returner based on the handler being used. I then declare and initialise nDone using a function, defined as follows:

//Definition of GetLocalInt function
int GetLocalInt(object oObject, string sVarName)

This function returns a local integer variable, which is why nDone is an integer. OBJECT_SELF (ie. the well, since the script is firing from a handler on the well) is oObject, and "DONE_ONCE" is the sVarName (read the box for information on Local Variables).

Now, here's a new feature of scripting for you. Conditional statements. Think about the following: "I'm going to the shops tomorrow, unless its raining, in which case I'll watch television."

This is a statement. You are declaring what you will do. However, there is a conditional in there. If it is raining, you have stated that you will do something else. That's all there is to knowing about these in script. They do something if something is true, and might do something else if it isn't.

The script above has two conditional statements. They both look at nDone, and use a comparison operator (read the box) to determine whether or not they should do the lines of code within the curly brackets.

So, if nDone is equal to 0, then the top set of lines will get run, but the bottom set won't, since that conditional is not true. Also, if nDone is equal to 1, then the bottom set of lines will run, but the top set won't.

Remember that variables that are declared but not initialised are equal to zero. Also remember that any local variable that has not been set or changed will also default to zero. This means, the first time this script runs, nDone will be equal to zero, because it hasn't been set before now.

That means the first set of lines will run. Since the well is the caller of the script, I don't need to AssignCommand anything. Instead, I just tel it to SpeakString the given string value.

//Definition of SpeakString function
void SpeakString(string sStringToSpeak,
     int nTalkVolume=TALKVOLUME_TALK)

Speaking a string is different to the floating text I used earlier. It will appear as though the object actually spoke the words. As you can see, I haven't declared the second parameter, since its already declared and I don't wish to change it.

//Definition of SetLocalInt function
void SetLocalInt(object oObject, string sVarName, int nValue)

Notice how I use this function in the first set of lines. The first two parameters are the same as those used when getting the local integer value for nDone. By doing this, if this script should run again, nDone will be equal to 1, preventing these lines from occuring again.

So the second time this script runs, it will do the bottom set of lines. Notice that the last line in that conditional statement is another SetLocalInt function. This one sets the value nDone becomes to 2, which means should this run again, nether conditional statement will occur.

There's yet another SpeakString function here. Notice in the functions list of the editor that there is an ActionSpeakString. I'm using this version because I'm dealing with a placeable, which can't have an action queue.

Now, CreateItemOnObject:

//Definition of CreateItemOnObject function
object CreateItemOnObject(string sItemTemplate,
     object oTarget=OBJECT_SELF, int nStackSize=1)

Notice that this is an object returner, yet I treat it in the script as though it were a void function. This is a minor nuance with the Create functions, where the object is actually being returned to the module itself, so you don't have to declare it.

The string sItemTemplate is the blueprint resref of the item (read the box on tags and resrefs). In this case, I went and made a custom item, and the resref was crowbar (as ever, a string must go in between quote marks).

oTarget is already declared as OBJECT_SELF, but since that is the well, and I want this to go on the player, I enter in a new parameter of oLast (which I've already declared earlier). The final value I've skipped, since I don't wish to change it (as its name suggests, it controls how many items there are in a stack).

So, the final result? The player clicks on the well, and the first time it says something. The next time it says something else, and gives them an object which I've made. Any further clicking will result in nothing.

(I am now dropping the lengthy explanations, you may need to have the editor open alongside this tutorial to look at definitions of script functions. Faster pussycat! Faster! [or you can refer to them directly within the Lexicon --Ed.])

Now I need to give the crowbar the ability to open the door. This is done by giving the crowbar a Cast Spell: Unique Power ability in the magical properties. These unique powers trigger the OnActivateItem handler for the module.

Read the following script, and see if you can tell what it does:

//Script "tutorial_oia"
void main()
{
     object oItem = GetItemActivated();
     object oTarget = GetItemActivatedTarget();
     object oUser = GetItemActivator();
     string sTag = GetTag (oItem);
     if (sTag == "CROWBAR")
     {
          AssignCommand(oUser, ActionMoveToObject(oTarget, TRUE));
          if (GetTag(oTarget) == "CAVE_JAIL_DOOR")
          {
               SetLocked(oTarget, FALSE);
               DelayCommand(2.0f,
                    AssignCommand(oTarget, ActionOpenDoor (oTarget))
               );
          }
          if (GetObjectType (oTarget) == OBJECT_TYPE_CREATURE)
                    AssignCommand(oUser,
                         ActionDoCommand(
                              ApplyEffectToObject(DURATION_TYPE_INSTANT,
                                   EffectDamage(d6(2)),
                                   oTarget
                              )
                         )
                    );
     }
     SendMessageToPC(oUser, "You have used a " + GetName(oItem) + ".");
}

Look challenging? It shouldn't. There's only one or two new things in there. Okay, follow me through.

First we've got a bunch of declarations, and they are all initialised to one value or another. The first three objects are all object returner functions used in conjunction with the handler we're dealing with (OnItemActivate).

The string sTag gets the tag value for the item that was activated. Why? Because there might be multiple items in a module, and we need to know which one was activated.

So, if the tag matches the string given in the first conditional statement, then it will run what is within the curly brackets. The first thing it does is assign a command to the activator of the item (oUser) to move to the items target. The command is an Action, so it won't happen immediately.

Next, we've got two more conditional statements. There's nothing that says you can't have a conditional statement within a conditional statement. So what do they do?

The first one checks the tag of the item power's target against the given string (notice that I haven't declared the string value for the target tag before, like with the item's tag. There's no technical reason for this, it was just the way I wrote it). The second one uses the GetObjectType function to learn what sort of object the item's target is.

If the target has a tag equal to CAVE_JAIL_DOOR, then it will unlock the target by using SetLocked, and after a further 2 seconds (DelayCommand), it will AssignCommand the target of the item to open itself (the caller is the module, so we need to use AssignCommand to do this).

If the target is a creature, then what it actually does is has the user of the item deal damage to the target. Notice the use of ActionDoCommand. This function allows us to add a void function that normally doesn't go in the action queue of a creature to that queue.

This way, the damage will actually be attributed to having been caused by the player using the item. Additionally, the EffectDamage (which itself shouldn't be a surprise) uses a nice little function called d6. This rolls a number of d6 dice equal to the value in the brackets (default is 1) and returns the value rolled.

Why did I add this in? I don't know, but I thought it would be the sort of thing most players would like to do with it (after all, what did you do with a crowbar in Half Life?).

So what's new in this script? Two thing, both found in the last two lines. Firstly, you may have noticed I didn't have any curly brackets after the bottom conditional statement. This is a nuance in the scripting language.

If statements don't need to have curly brackets after them when only one line is being run when it returns true. It is technically improper scripting practice to do this, and a properly written script would include the brackets, but I've opted for readability.

Secondly, the last function I run. The function itself is simple, enter an object and a string parameter, and the function sends the string to the object. However, I've done a bit of string manipulation here.

The following line "I have a ball." is exactly the same as "I have " + "a ball." in NWScript. The operator + adds integer and float values, totalling them up, and in a way, that is exactly what it is doing with the string.

In the above script, I have used the GetName function to create a string value equal to the name of any object which uses its unique power. The SendMessageToPC function will therefore send a piece of text to the player using the item saying "You have used a Crowbar." in this case.

The fact that I've left the function outside the conditional statements that tell the script what to do if it recognises the item being used means that if I go and throw in a bunch of extra items with unique powers, even though nothing will happen when you use them, it will always return that message, telling them what they used.

Keeping Up?

So far, I've been teaching you script by showing you how to build them. I hope this is a productive method, otherwise the rest of this tutorial isn't going to do much, is it? If you've understood all this, carry on. If not, try writing the scripts yourself, to see if you can get the same effect.

Tasks

Here's a challenge for you. Using the knowledge from this chapter about the OnItemActivate handler, can you make a compass? (I know there's one in the game, but see if you can make an item that will inform the player which way they are facing. Use the function list in the editor.)

Hint

The trick here is to make an item that when you use it, it tells you which direction you're facing in. For this, you need the OnItemActivate script to recognise the compass, work out the facing of the user, and then send a message to the user informing them of the direction gotten.

Variables

int nDone;
string sMyString;
object oObject;

Up until now I've refered to these as information, or values. Another term for these is variables.

Variables are called this because they can change, either by themselves or because you change them within the script.

Some variables do not ever change, and these are referred to as constants. You've already seen an example in the DURATION_TYPE used in previous scripts.

Although you could change those values (as they are declared in the file "nwscript.nss"), they are always the same value every time you use them.

Local Variables

One of the nice things about NWScript is that variables you define in one place can be used again elsewhere without fear of getting them mixed up.

These are called local variables. Within scripting for instance, you can declare a variable, lets say nDone, in one place, and refer to that throughout your script.

But you can use the term nDone in another script, and they won't at all get mixed up.

You'll see local variables used a lot in NWScript, even though they won't always be apparent.

The most common and useful form of a local variable is the stored kind. Nearly every object in the module can store variables upon themselves.

These are manipulated using the Get and Set Local Variable functions. It allows us to store information to use from one script to the next.

Think of them as books. The object itself is the book, and within that book, we store information under chapter headings.

Local variables work in this same way. We can define a variable, and store it upon an object under a name, which allows us to retrieve or change that variable at a later stage.

Global Variables

Global variables are variables that are declared and even initialised outside the void main() function. These are most useful when working with custom functions, which will be explained later.

Semi-Colons

In the previous chapter I said that lines of code are seperated by semi-colons because the compiler ignores white space. I also said there are exceptions.

The exception to this is if you have a conditional statement. They are easily identified within a void main() because they have a set of curly brackets after them.

When writing code, the conditional statement ignores the rule about semi-colons. You do not need to place one after the conditional, nor after the curly brackets.

Technically the semi-colon marks the point at which the code performs whatever script you have given it. This is mainly important to remember when dealing with pre-fix and post-fix operators.

Operators

The signs we use in maths are operators. They manipulate values, such as adding them together.

They can also do comparisons. We can determine if a variable is equal to, less than, greater than, or not equal to another variable.

It is important to note that a standard operator has only one symbol, eg. +, where as comparison operators have two, eg. >=.

Tag Vs ResRef

There are two ways of identify any object in the module, the tag and the resref.

Tags can be recognised by any script, regardless of the object being checked is.

ResRefs are the blueprint value in the palette for an object, so you can only work with the resref of an object which exists in the palette of the module.

When creating objects via script, bare this in mind. Objects in the standard palette use the tag value for sItemTemplate, and objects in the custom palette use the resref value.

Screenshots

  • Well First Reply
  • Well Second Reply
  • The Area

author: Robert Straughan, editor: Charles Feduke


Tutorial - Robert Straughan - Capture Glory: Strip Tease

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Strip Tease

Robert Straughan - Capture Glory: Strip Tease

Starting Out

I've decided I'd like the player to start out stripped of all their equipment. I'd also like to make the player start at level 3, instead of level 1. Finally, it would be nice to have them start out lying down on the ground.

This can be done by writing the OnClientEnter script like the following:

//Script "tutorial_oce"
void main()
{
     object oEnter = GetEnteringObject();
     object oItem = GetFirstItemInInventory(oEnter);

     while (GetIsObjectValid(oItem))
     {
          DestroyObject(oItem);
          oItem = GetNextItemInInventory(oEnter);
     }
     int nSlot;
     for (nSlot = 0; nSlot < NUM_INVENTORY_SLOTS; nSlot++)
     {
          oItem = GetItemInSlot(nSlot, oEnter);
          DestroyObject(oItem);
     }

     TakeGoldFromCreature(GetGold(oEnter), oEnter, TRUE);
     object oClothes = CreateItemOnObject("NW_CLOTH024", oEnter);
     if (GetXP(oEnter) < 3000)
          SetXP(oEnter, 3000);
     ApplyEffectToObject(DURATION_TYPE_INSTANT,
          EffectDeath(),
          oEnter
     );
}

This script introduces two new conditional statements, while and for. They are both exactly the same as if statements, but they work in different ways.

A while loop is exactly like an if statement, except that it will continue to run the script within its curly brackets for as long as the conditional is true. Think of it as an if statement that jumps back to the if part every time it gets to the end.

The for statement is also a while loop, but it has some in built features. The actual conditional statement is the one in the middle of the brackets, nSlot <= 18. For as long as that is true, the lines in the curly brackets will continue to run.

The first statement in a for loop is an initialise statement. You can only initialise a variable here, you cannot declare it also (hence why nSlot is declared prior to the for statement). Since I want nSlot to be zero, and I can't skip the initialise section, I have to put nSlot = 0 even though it was zero to start with.

The last section is the mathematical statement. Everytime the for loops back to the beginning, while it only does the initialise section once, if the conditional remains true, then it will do the maths found at the end section of the for statement.

In this case, I've chosen to increment nSlot. The proper way of writing this down is nSlot = nSlot + 1. That would mean that nSlot becomes whatever it previously was, plus one.

However, to tidy things up, the language allows you to simply add ++ after the variable name. This means it will increase the variable by one. For future note, -- does mean decrement.

So, now that you know how those two work, can you see what this script does? Take a look, then read on.

The first thing it does is declare and initialise the object entering, since this is an OnEnter handler, and gets the first item in that object's inventory.

I want to strip the target of their inventory, so I'm going to need to keep on going through every object they have until there are no more. For this, I use a while loop, which runs for as long as the item in the inventory is a valid target.

I have used DestroyObject to get rid of the item in the inventory. But I can't just leave it like that, since oItem will no longer be valid (be careful with while loops, if you don't change what you're checking against, it may get stuck).

So, I then use the GetNextItemInInventory function to cycle through the objects in the target's inventory. For as long as they have objects, they will continue being destroyed.

But this only deals with objects in the inventory, what about ones they have equipped. For this, we use the for loop. It will run through the loop 19 times, since we start at 0, and add 1 every time the loop finishes, until the conditional is no longer true.

But what about the nSlot value. If you look at the definition of the GetItemInSlot function, you'll notice it asks for an integer equivalent named INVENTORY_SLOT_.

As you learned earlier with DURATION_TYPE, the text is really just representing an integer value. Looking in nwscript.nss reveals that the INVENTORY_SLOT values run from 0-18.

So we can use actual integer values, and not the text form. There's no difference, except with the true integer form, we can actually do mathematical operations with it. In this case, incrementing it.

So, that sorts out the strip items. What about the next two lines? Well, it looks like we're taking gold from the entering object. By using the GetGold function, I don't have to state how much gold to take, since the script will find out how much the object has.

The CreateItemOnObject function is actually to give the entering object back some clothes. Since I've just stripped every object off the entering object, it would be nice to have something to wear.

Notice that I've actually declared it properly. This is for no technical reason, but it shows that you can use the Create functions either to declare new objects in a script, or to simply create them in the module.

The next two lines should be easy. A simple if statement, which checks to see if the XP of the entering object is less than 3000, and if so, sets their XP to that amount.

Paying attention to what variable type a function returns is crucial with numbers, as some return floats, and some return integers. The two variable types are not interchangeable.

Recognise the last one? Whoops! The entering object dies! This is because there currently isn't a 'lying down' or 'unconscious' effect in the engine. You could use EffectKnockdown, but they remain awake for it.

This throws up an immediate problem. Our OnDeath script is going to fire when the player enters! This is not very good. So we need to go back and alter it to ensure it doesn't happen.

Can you guess what I'm going to do with it? Take a look:

//Script "tutorial_odth"
void main()
{
     object oPlayer = GetLastPlayerDied();
     if (GetLocalInt(oPlayer, "DIED_ONCE") == 0)
     {
          SetLocalInt(oPlayer, "DIED_ONCE", 1);
          return;
     }
     PopUpDeathGUIPanel(oPlayer, TRUE, FALSE, 1,
          "If you press respawn, you will be resurrected at " +
          "the beginning of the level, and will suffer a -1 to " +
          "your constitution."
     );
}

Notice the use of local variables. I'm getting a local variable on the last player who died. If it is equal to zero, which it will be by default since I've not touched it yet, then it sets it to 1, meaning from now on, the if statement won't do what's in its curly brackets.

So does that stop the death panel? No, what it does is prevent the line return; from being run. The return is a built in function to the code. It immediately quits the script (this is not entirely accurate, but you'll learn that a bit later).

So the first time the player dies, since the if statement will be true, the script will quit before it can put the death panel up. But after that, it will always display the panel. Simple, huh?

What have you learned?

Well, I'm hoping you'll be beginning to see just how simple scripting really is. Once you've learned the basic of how the script all plugs into each other, it just becomes a case of asking yourself "What do I want this script to do?"

If you need to, try writing the script on this page out for yourself in the editor, or re-read what you've just read. Otherwise, move along.

Tasks

Notice how I strip all equipment off the entering object, and then place some clothes back onto the object. What I want you to try and do is to change the script so that instead of placing the new clothes onto the object, prevent the loops which strip the object of its items from taking the objects clothes that it currently has on.

Hint

You need to place an if statement into the for loop, that checks to see if the current value of nSlot is not equal to the same one as the chest slot value. This way, if it finds that the current slot is the chest slot, it won't do the DestroyObject function.

Curly Brackets

As you've learned by now, all script is contained within curly brackets, to let the compiler know how everything is laid out.

You've seen me use if statements without them though, but only because only one line of code runs if the if statement is true.

This is not the same for the other conditional statements. It only works with if statements.

First/Next

There are a number of functions in NWScript which have GetFirst/GetNext in their names.

These are designed to work with loops, in order to cycle through a particular type of object in the module.

Conversion

You may notice in the list of functions a number of functions which refer to the conversion of one variable type to another.

Namely, these allow the transferring of integers, floats and strings to and from one type or the other.

This can be useful when using variables of different sorts and needing to perform calculations with them, since you can't do mathematical work with different variable types.

Also note that since integers are whole numbers, doing division with them can produce unwanted results.

If doing division with integers, use the IntToFloat function to convert the numbers to ones which can handle decimal points.

Also note that in a number of scripts, you may or may not see an f after a floating-point number. The f is used to force the number to remain a float, and not do any rounding of numbers.

author: Robert Straughan, editor: Charles Feduke


Tutorial - Robert Straughan - Capture Glory: Garbage Treasure

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Garbage Treasure

Robert Straughan - Capture Glory: Garbage Treasure

Starting Equipment

I've stripped the player of their equipment, so we'd better let them have something to get through the module with. What I'm about to do next is probably the most complex thing you will need to grasp.

Firstly, I've placed two garbage placeables into the cave. I've made them both useable, and they both have inventories. Into their OnOpen handlers, I've placed the following:

//Script "cave_garbage"
#include "tutorial_weapon"
#include "tutorial_lib"
void main()
{
     object oOpen = GetLastOpenedBy();
     int nClass = GetBestClass(oOpen);
     int nOnce = GetLocalInt(oOpen, "HAS_BEEN_TO_OTHER");
     if (nOnce == 1)
     {
          if (nClass == CLASS_TYPE_BARBARIAN)
               CreateItemOnObject("NW_AARCL004");
          if (nClass == CLASS_TYPE_BARD)
               CreateItemOnObject("NW_AARCL004");
          if (nClass == CLASS_TYPE_CLERIC)
               CreateItemOnObject("NW_AARCL006");
          if (nClass == CLASS_TYPE_DRUID)
               CreateItemOnObject("NW_AARCL002");
          if (nClass == CLASS_TYPE_FIGHTER)
               CreateItemOnObject("NW_AARCL004");
          if (nClass == CLASS_TYPE_MONK)
               CreateItemOnObject("NW_IT_MRING001");
          if (nClass == CLASS_TYPE_PALADIN)
               CreateItemOnObject("NW_AARCL006");
          if (nClass == CLASS_TYPE_RANGER)
               CreateItemOnObject("NW_AARCL002");
          if (nClass == CLASS_TYPE_ROGUE)
               CreateItemOnObject("NW_AARCL001");
          if (nClass == CLASS_TYPE_SORCERER)
               CreateItemOnObject("NW_IT_MRING001");
          if (nClass == CLASS_TYPE_WIZARD)
               CreateItemOnObject("NW_IT_MRING001");

          SetLocalInt(oOpen, "HAS_BEEN_TO_OTHER", 2);
     }
     if (nOnce == 0)
     {
          GetWeapon(oOpen);
          SetLocalInt (oOpen, "HAS_BEEN_TO_OTHER", 1);
     }
}

Okay, a long script, but by now this shouldn't be partiularly difficult to figure out. A typical object returner based on the handler, and a pair of if statements with local variables used to prevent either one from happening more than once. You saw this on the well with the crowbar.

There are four lines in here that probably won't look familiar. Firstly the two #include lines at the top. #include is like a copy and paste function that runs when you compile the script. (Read the box for more details).

Which means there are lines of code that this script uses that you can't see here. They are what form the two functions that you probably don't recognise, GetBestClass, and GetWeapon. That's because these are custom functions that I've written.

Open up "tutorial_lib", and you'll find the following:

//Script "tutorial_lib"
int GetBestClass (object oTarget)
{
     int nClass1 = GetClassByPosition(1, oTarget);
     int nClass2 = GetClassByPosition(2, oTarget);
     int nClass3 = GetClassByPosition(3, oTarget);
     int nLevel1 = GetLevelByClass(nClass1, oTarget);
     int nLevel2 = GetLevelByClass(nClass2, oTarget);
     int nLevel3 = GetLevelByClass(nClass3, oTarget);
     if (nLevel1 >= nLevel2 && nLevel1 >= nLevel3)
          return nClass1;
     if (nLevel2 > nLevel1 && nLevel2 >= nLevel3)
          return nClass2;
     if (nLevel3 > nLevel1 && nLevel3 > nLevel2)
          return nClass3;
     return -1;
}

That's all there is to writing your own function. It must be done before the void main() line, but basically, a custom function is a process which can be called on through the name you give it within a script. You do it everytime you write script within the void main().

There is a change here through. Before I told you that return simply ends the script. When used in void main() this is the case. A return command in a void function simply stops the function, so in a void main(), you are stopping the script.

Here however, we are using it to return a value. This is how the functions you've been using return their information. Consider the above function.

Look at the first line. The function is called GetBestClass, and has a return type of int. It has one parameter, an object called oTarget. Nothing out of the ordinary there, you've seen plenty of functions like this.

The next bunch of lines declare the class types of the three classes of oTarget, and then works out the level of each of them. But I haven't declared oTarget... well, actually, I have. You see this is a function other than void main().

You know all those functions where they had some parameters already initialised? This is the same thing. If I wanted to, I could have put object oTarget = OBJECT_SELF into the function parameter, and oTarget would already have a value. But I haven't, so whenever I use this function, I must specify oTarget in the parameters.

Now, since I have made this function an int returner, I had better return the appropriate information. By using the return command with the appropriate variable to return, the function is complete.

In the case of the above function, it will return the class type of the first class of oTarget if it is the highet level class oTarget has, or the second class if it is higher than the first and higher or equal to the last, and only the last class returns if it is higher than both the previous ones.

Note the last line, return -1. You may notice in some function definitions, it states that the function returns a certain value, like -1 or OBJECT_INVALID, when there is an error.

The scripts don't generate these errors internally, they are values that have been returned because the script we used for defining how this function works did not do its job.

Consider the process of the conditional statements. If it has not found any of them to be true, then it will hit that last line, and return -1. This means something went wrong, and the function did not determine the highest class of the target for some reason.

It is a way in which we can determine errors. Additionally, when building a function that returns a value, you must always return a value of that kind. If I hadn't added that return -1 line, the compiler wouldn't do its job, because there's a chance that none of the three return commands would fire.

Before moving on, I'd better point out the use of the && operator. This is equivalent to logical AND. Basically, you use this to have multiple conditionals that must all be true before the following lines will fire.

Now, although I've put this function into a seperate script file, since I've used #include, it's effectively in place over the void main(). So the void main() section now knows how to get the highest level clas of the target.

Although I've only used this function once, and could probably have made the script it uses part of the main script here, this method leaves me free to do the whole process multiple times in the same script, or even use it in other scripts, simply by using #include.

So, back to the script. It gets the best class of the target, in this case, the last person to open the container. The first time it runs this script, it runs the bottom section. Ignore that for the moment.

The second time, it runs the top section. This is a bunch of if statements that looks at the class type returned by our custom function. Based on which class is the highest for the target, it will create an item in the garbage's inventory.

Now, that bottom bit. I've got a function called GetWeapon. What does it do? Well, it works out what weapon would be the best one to spawn for the player. How?

I'm going to steal script from Bioware. Some of you may be familiar with this process already. Specifically, I want what is in the script file "nw_o2_classweap" If you open it up, you'll find around 2000 lines of code.

This is why I don't want to have to write it out myself. So, how do we use this for our purposes. The script is designed to be put on a container, to spawn a weapon appropriate for the player.

Since I already have a script that runs for the container in question (ie. this script), what I'm going to do is change the void main() function here to a custom one to call on from this script.

I opened it up and saved it as "tutorial_weapon" I then changed the initial three lines of the void main() from this:

//Script "nw_o2_classweap"
void main()
{
     object oLastOpener = GetLastOpener();
     object oContainer = OBJECT_SELF;
     /* rest of script */

to this:

//Script "tutorial_weapon"
void GetWeapon (object oLastOpener, object oContainer = OBJECT_SELF)
{
     /* rest of script */

Can you see what I have done? I've changed the void main() into a custom function called GetWeapon. It too is a void, since I don't want to return any information, just get the script to run.

The two parameters used for the function are actually the variables used by the original script. So essentially, I've just changed the way this script gets its information to perform its processes.

Instead of being a standalone script that runs by itself, I can now call upon it at any time to work out the best weapon for oLastOpener (which I would point out, since this is now a custom function, does not have to be the last opener of a container).

So, this script will mean that, regardless of what order the player goes to them in, they will first get a weapon that is best suited to them (I believe this works by focus and proficiency), and then they will get an item that I have designated as being the item for their best class.

What was that?

As I said, this is the most complex thing you will have to learn in this tutorial. If you're still not sure about it, try writing a little script for yourself, and creating a custom function for that.

When you're sure you have understood all this, proceed.

Tasks

Previously I've made a mention about efficiency of scripting by declaring certain things only once to cut down on the amount of processing done. While that does not actually apply to this script, there is a more efficient way of writing this. Try rewriting the script so that it is more efficient.

If you're stuck on what to do for your little test script to see if you can create a custom function, try the following. Create a custom function which will place a badger at a point, and apply a visual effect to it. Have the main script fire this function four times at 2 second intervals.

Hint

You need to have a CreateObject function within a void returner function that you can place in a DelayCommand. You then have the value of the DelayCommand calulated within a for loop, which increments the counter by two each time. That way, it runs the loop four times, and Delays the command by an increasing 2 seconds each time.
The actual reason I chose the CreateObject function for the custom function task is to point out that you cannot use DelayCommand on the CreateObject function.

#include

The #include function is a benefit, but can give some absolute headaches when debugging.

It works with scripts, and effectively copies and pastes the attached script to the script you are working on. It must always go before the void main() function.

This allows us to keep various functions or processes in one script, but quickly being able to use them again in multiple scripts without having to copy and paste for real.

Note that since it is literally a copy and paste, you can't have a void main() in both the script you are compiling and any script which you attach.

You also cannot have global variables of the same name in multiple #included scripts. The compiler will give you an error if this occurs.

I said there was a headache, well here it is. When you get an error in a script which has a #include statement, always check the line number it gives for the error.

Sometimes you may notice that the error it gives is not applicable to the line it says, or that the script does not go upto that line number.

This is because scripts without a void main() in don't actually compile normally. Any errors in them will not show up. They only show up when you compile a script that #includes them.

So when error correcting in your scripts, if the error doesn't make sense, or you fix it and keep getting it, check the line number given in the #include scripts, as it may be an error in one of those.

Another headache is that the #include is not a link. If you change something in a script which is #included in another, you must compile the original script again, for the new change to take effect.

The #include is an import function, not a link. This means that all scripts which #include a script that has been changed must then be recompiled. When you have lots of scripts to recompile, use the Build option in the menu.

Custom Functions

There's nothing difficult about custom functions, if you follow the tutorial, you'll do fine.

What I haven't mentioned about the custom functions I used in the tutorial is the extra line of code directly above them in the script.

It's exactly the same as the first line which indicates the function information, but has a semi-colon after it.

This is a declaration of the function. You do not need to do this at all if you don't want to but there are two reasons why you may wish to do so.

Firstly, if you open the "cave_garbage" script and scroll down the list of functions in the editor, you may find the GetBestClass function listed in bold.

The script editor can recognise and list custom functions if you have declared them at the start of the script, whether through the use of a #include command or by writing them into the script being compiled.

The second reason for doing this is if you wish to leave the custom function definition until after the void main() section of script.

Any function which utilises another function defined within the same script must have the custom function it uses placed prior to it in the script, or else it won't know what you're talking about (like with variable declarations).

By declaring the function before the void main() it now realises there is a custom function written into this script, and knows that it is okay if you have typed that custom function into its main block of script.

This leaves you free to define the custom function at the bottom of the script, after the void main(). This can be useful if your custom function is a long list of if statements, or large processes that you wanted to get out of the way so you could see what the main script is doing quickly and easily.

Screenshots

  • Garbage

author: Robert Straughan, editor: Charles Feduke


Tutorial - Robert Straughan - Capture Glory: Dwarf NPC

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Dwarf NPC

Robert Straughan - Capture Glory: Dwarf NPC

Snow White and...

If you played the module, you will no doubt have seen Kilinar. He's a dwarf NPC that I've placed into the module to act as a henchman. He has a conversation with several scripts throughout them. Let's take a look.

//Script "cave_hench1"
int StartingConditional()
{
     int iResult;
     iResult = GetLocalInt(OBJECT_SELF, "SPOKEN") == 0;
     return iResult;
}

This is actually the default one generated by the script editor when you press edit on the TextAppearsWhen handler in a conversation. It can also be written like this:

//Example Script
int StartingConditional()
{
     if (GetLocalInt(OBJECT_SELF, "SPOKEN") == 0)
          return 1;

     return 0;
}

Essentially, iResult is a 1 or a 0, depending on whether the comparison statement is true or false. That value is then returned, since this is a StartingConditional script, not a void main().

Almost the only use for this kind of script is in conversations, and essentially, if a 1 is returned, then the node this is attached to will either be said by the NPC, or will be an option available to the PC. If a zero, then it won't show.

What does the script do? If the local integer labelled SPOKEN is equal to one, then the script returns a one, and the line will be said. I'm using this to stop the line from being said twice. How? Read on:

//Script "cave_hench4"
void main()
{
     SetLocalInt(OBJECT_SELF, "SPOKEN", 1);
}

By placing this script in the ActionsTaken handler of the very same conversation node, it means that the line will only show if the local integer hasn't been touched, and then immediately sets it to one to prevent the line from being said again.

Later on, I do another script as follows:

//Script "cave_hench2"
int StartingConditional()
{
     int iResult;
     iResult = GetLocalInt(OBJECT_SELF, "SPOKEN") == 1;
     return iResult;
}

This means that if I place this node above the one that checks for the same value to be set to zero, the line won't get spoken until the 'one-liner' node has been spoken. This is not necessary, but it can help when placing nodes into a specific order.

At some point, Kilinar joins the player's party. This was done with the following script:

//Script "cave_hench3"
void main()
{
     AddHenchman(GetPCSpeaker());
}

Notice that I've made this just one line. What can we tell from this? GetPCSpeaker is an object returner like all the others that are based upon which handler you are using. It gets whatever PC is currently involved in the conversation.

AddHenchman is the function which actually makes the NPC join the targetted object's party. There is actually a hidden parameter here, which if you look in the definitions, you'll find is already declared to OBJECT_SELF, which is fine given the caller of this script.

//Script "cave_hench5"
int StartingConditional()
{
     int iResult;
     iResult = GetMaster() == GetPCSpeaker();
     return iResult;
}

This script prevents a line being said unless the player talking to the NPC is their master. See how it does it? If you don't then you should look at the definition of the GetMaster function.

Still don't understand it? GetMaster returns an object variable based on who is the master of a specified object. By default, the function uses OBJECT_SELF, so I don't need to add a parameter value to it. If the speaking NPCs master is the speaking PC, then the node shows.

In case you're wondering, yes. Comparison operators can work with any kind of variable. The difference is that the operators == and != are equality tests, rather than mathematical, such as <= and >=. They are essentially EQUAL TO and NOT EQUAL TO. That does not require numeric values to be used.

Really most of the dwarf's scripting is down to timing in the conversation file. I'm not even going to begin teaching you how to use conversations properly, or even that you should use it (a lot of DMs possess NPCs rather than use their own conversations). The scripting involved is simple.

Do we trust him?

The dwarf's conversation leads the player to believe that he/she might not be able to trust Kilinar. As a little extra, in the OnExhausted handler of one of the encounters in the tunnel leading away from the cave, I placed the following:

void main()
{
     object oWP = GetObjectByTag("JOURNAL_POINTER");
     object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,
          PLAYER_CHAR_IS_PC,
          oWP
     );
    if (GetLocalInt(oPC, "NW_JOURNAL_ENTRYHenchKilinar") > 10)
          AddJournalQuestEntry ("HenchKilinar", 30, oPC);
}

Here's a useful function to know. AddJournalQuestEntry. Kilinar's conversation used the OtherActions tab to deal with the journal entries, but what if you wish to set a quest journal to a particular place without a conversation.

The OnExhausted occurs when an encounter's spawned creatures have been killed off. However, because the encounter is not physically represented in the game, we need to use a waypoint as a reference to get the nearest player.

So I've gotten the waypoint, and then the nearest creature to it which matches the criteria I specified (read the function definition if you're ever not sure of what values to use).

Another useful piece of information about journal entries is that they are stored on a player as a local integer, labelled NW_JOURNAL_ENTRY and then with the quest tag given to it in the journal editor added onto the end.

So the if statement compares the current state of the player's path in the HenchKilinar quest, and if it is greater than 10 (which I happen to know means that Kilinar has joined the player as a henchman) then this will change the player's journal entry accordingly.

It is a matter of judgement as to whether you should use AddJournalQuestEntry, or SetLocalInt, in order to change a player's current position in a quest.

What have I just done?

Well, you've learned how to use scripts in conjunction with a conversation, and the use of the StartingConditional scripts. You've also seen how to manipulate the journal through use of scripts.

This was a pretty simple bunch of scripts, but you should be sure you've read the box before moving on. Try making an NPC of your own, and making a conversation to add or remove them from the player's party.

Tasks

Create a conversation which presents options to the player that allow him/her to make an ability check against any ability to gain an NPC as a henchman. The check is made against the NPCs ability check.

To make this more interesting, you could also remove any ability check from the conversation that the player would be unable to pass given their score and the target DC of the check.

For something even more interesting, try making it so that the player can only make an attempt at each ability check once.

Hint

The conversation is easy to create. When you've got your six options for the tests, in each one, have a local string set in the ActionsTaken handlers, that stores which test is being done.
Then, have a single node that is linked to by the six options, which gets which test is being done, and runs the necessary calculations to figure out if the test was successful. Do this in the starting conditional for the node, and place a 'You have failed' line underneath that.
This way, you can have the script return 1 if successful, and if it returns a 0 for failure, the success node will be skipped, and the failure node will show instead.

To make it so the checks don't show if the player can't do them, in the StartingConditional scripts for each test, have a check to see what the maximum scores are, and return 0 if the player can't get higher than the NPC.

To have each one be done once, you need to use the Get and Set local variable functions to have a toggle value on each option. In the starting conditional script, you check to see if the variable is zero, returning a 1 if true, and in the ActionsTaken you set that variable to 1, so the player won't see that option again.

Conversations

Remember that when running a conversation file, the game runs from the top most node, down to the bottom one.

This can be important when using StartingConditional scripts to get lines to be stated at different points in time.

A further note that I would make is that a StartingCOnditional is run before a node appears. This acn be useful for doing things that you would normally do in a void main() script prior to the conversation option appearing.

In this instance, all you do is add the line return 1; at the end of the StartingConditional script, and the node will always appear, but you will have been able to do other scripting that you needed to that couldn't wait until the ActionsTaken handler fired.

Callers

I've mentioned before now about callers, and I'm going to make sure that you understand the concept.

A caller is whatever object in the module (or even the module itself) called the script. This is usually defined by which object has the script in one of its handlers.

It's important to remember that all functions in a script are run by the caller, which is why some of the scripts use AssignCommand to get other objects to use a function.

OBJECT_SELF always refers to the script caller, which is also why when AssignCommand is used on a door, ActionOpenDoor (OBJECT_SELF) is what you usually see, since OBJECT_SELF becomes the door, as it is now the caller of that function.

Note that I've had intermittent results with this concept. Sometimes it does work, but sometimes you might find it better to actually declare the objects involved and just use those instead, since it is more certain that you are manipulating the correct objects.

Henchmen

To add or remove a henchman is a single script. However, there is a more complicated procedure you must do before trying to add henchmen.

In a creature's script handlers, when first created in the palette, you'll find they all begin with nw_c2_default#, where # is a number or letter which corresponds to the handler the script is in.

If you wish to create a henchman out of an NPC, you must change these scripts so that they are nw_ch_ac#, where # is the same number or letter as the default scripts used for each handler.

Screenshots

  • Dwarf
  • Dwarf Fights Rats
  • Fried Rats
  • Lazy Rats

author: Robert Straughan, editor: Charles Feduke


Tutorial - Robert Straughan - Capture Glory: Minotaur Death

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Minotaur Death

Robert Straughan - Capture Glory: Minotaur Death

Granthos

When the player leaves the caves, I want them to meet Granthos the minotaur. Since Granthos is probably too high a level for the player to beat, even though I've made them level 3, I'm going to rig the fight.

(I'd like to just point out that I've actually seen Kilinar win this fight, so it is possible for the player to defeat Granthos by themselves. However, since I wanted to kill Kilinar and bring in Alluen, I decided to go ahead and rig it anyway.)

When the player gets to the exit, I want them to stop and be forced to talk to Granthos. To do this, I use the following script:

//Script "cave_triggerboss"
void main()
{
     object oEnter = GetEnteringObject();
     AssignCommand(oEnter, ClearAllActions());
     SetCommandable(FALSE, oEnter);
     if (GetIsPC(oEnter) && GetLocalInt (OBJECT_SELF, "FIRED") == 0)
     {
          SetLocalInt(OBJECT_SELF, "FIRED", 1);
          object oBoss = CreateObject(OBJECT_TYPE_CREATURE,
               "minotaur001",
               GetLocation(GetObjectByTag("DOOR_SPAWN"))
          );

          AssignCommand(oBoss,
               ActionMoveToObject(GetObjectByTag("CAVE_WALK_TO"))
          );

          DelayCommand(3.0f,
             AssignCommand(oBoss, ActionStartConversation (oEnter))
          );
     }
}

If you read through this, you'll notice nothing that I haven't done before. Declare the object that triggered this handler (which is an OnEnter handler for a trigger I've placed so the player must cross it before reaching the exit).

I've assigned a command to that object (since I don't want the caller to do it) that tells it to stop everything it's doing. I've then told it that it can no longer take any actions.

I don't know whether the object involved was a player or not (it might be Kilinar), and I also don't want this to fire more than once. In which case, I have a conditional statement that looks to see if this has been done once, and if the entering object was a player.

Provided the checks are both true (because of the logical AND), I make sure the loop won't happen again, and then create the minotaur. Notice two things, first, I haven't declared or initialised either the location or the waypoint prior to this function, I've just slotted them straight in.

Second, I used the resref of the creature to create it, since it is in the custom palette. Neither of these should be particularly difficult to fathom out at this point, so if you have difficulty understanding that line, try some of the previous tasks again.

Notice also that I have actually declared the newly created object. Rather than using the function as though it were a void function, I've given it a name. This is so I can immediately give it command in this same script.

The next two lines shouldn't be difficult either, using AssignCommand and DelayCommand to tell the minotaur what to do. Notice I've delayed the second command by 3 seconds, to ensure that the actions are stacked in the queue in the correct order.

Go Kilinar! Go!

So, now that I have my boss creature, and the player can't do anything but talk to them, I create a conversation to use. At this stage, the player may or may not have Kilinar with them. If they don't, I get rid of the Kilinar object, to prevent confusion.

//Script "cave_bosscon1"
int StartingConditional()
{
     object oDwarf = GetObjectByTag("HENCH_DWARF");
     if (GetMaster(oDwarf) == GetPCSpeaker())
          return 1;
     DestroyObject(oDwarf);
          return 0;
}

This is a starting conditional statement for a conversation. Notice the order this does things in. We get the dwarf, and if they are the henchman to the speaker, we allow the node to be spoken.

If the statement was not true, the script will continue on, and destroy the dwarf. It will then return zero, meaning the line won't fire. So all I do is attach this to the line that responds assuming the dwarf is in your party, and place it above the one where he isn't.

//Script "cave_bosscon2"
#include "nw_i0_generic"
void main()
{
     object oDwarf = GetObjectByTag("HENCH_DWARF");
     SetCommandable(TRUE, oDwarf);
     RemoveHenchman(GetMaster(oDwarf), oDwarf);
     AdjustReputation(OBJECT_SELF, oDwarf, -100);
     AdjustReputation(oDwarf, OBJECT_SELF, -100);
     AssignCommand(oDwarf, DetermineCombatRound());
     DetermineCombatRound();
}

Nothing new here in terms of the scripting, but there's a nice little trick I've done here. This script is part of the node that fires when the dwarf is found to be in the PC's party. It gets him, and makes him commandable (since he might have made uncommandable by the trigger).

I then remove him from the player's party. I could have specified GetPCSpeaker for the first parameter of the RemoveHenchman function, but instead I used GetMaster. This is a nice line to bare in mind, since it can be used anywhere to remove the target from any party.

We then do a bit of manipulation of reputations. If you've been fiddling with the editor, you will have noticed factions. I've explained them a bit in the box, but otherwise, these functions make the minotaur and the dwarf hostile towards each other.

I've then gone and used a function in the final two lines that you won't find in the function list. So how can I use it? Remember custom functions? Remember how #include works?

The file this script includes, nw_i0_generic, is Bioware's extra function library. If you can't find a function in the list of functions that does what you want, before writing it yourself, check to see if the function already exists in this file.

By #including the file, I now have access to all the functions in that file. Note that any script which #includes this file will take noticeably longer to compile than normal. That's because the file is a very large script.

In this instance, I've used DetermineCombatRound. While most people find it has different uses, purposes or results, I've always found that by using it on an object, it causes that object to determine the best course of action to take in combat.

So, when this conversation ends, the dwarf and the minotaur will have a fight. However, I know the dwarf can win on occasion, so I want to be sure that he dies.

To do this, I've modified his OnPhysicalAttacked script to the following:

//Script "cave_insurance"
void main()
{
     if (GetTag(GetLastAttacker()) == "BOSS_GRANTHOS")
          DelayCommand (3.0f,
               ApplyEffectToObject(DURATION_TYPE_INSTANT,
                    EffectDeath(),
                    OBJECT_SELF
               )
          );

/* rest of script */

What does it do? If the last attacker was Granthos, then the dwarf will die. Simple. Note that I could have left this script intact, and used a User Defined Event (read the box).

Notice that I place a DelayCommand on the death effect. This is because the OnPhysicalAttacked handler fires the instant the object is attacked, which wouldn't look too good. By delaying the death by 3 seconds, the attack animation will have time to play out.

I then put into the OnDeath script handler for Kilinar the following:

//Script "cave_diedwarf"
void main()
{
     object oKiller = GetLastHostileActor();
     if (GetTag(oKiller) == "BOSS_GRANTHOS")
     {
          object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,
               PLAYER_CHAR_IS_PC
          );
          SetLocalInt(oKiller, "DWARF_DIED", 1);
          AssignCommand(oKiller, ClearAllActions());
          AssignCommand(oKiller, ActionStartConversation(oPC));
          AddJournalQuestEntry("HenchKilinar", 40, oPC);
     }
}

What does this do? GetLastHostileActor gets the last person to do anything vaguely hostile towards the caller, such as attack, or cast a spell. I could have used GetLastAttacker, given the handler I'm using, but I've chosen this one (it's more accurate in case the object was killed by means other than being physically attacked).

If the last person to be hostile towards the dwarf turns out to be Granthos, I get hold of the player using the GetNearestCreature function and the right criteria.

The local variable I set is to let the minotaur's conversation know the dwarf has died. Somewhere in the conversation, you'll find a node with the following script:

//Script "cave_bosscon4"
int StartingConditional()
{
     int iResult;
     iResult = GetLocalInt(OBJECT_SELF, "DWARF_DIED") == 1;
     return iResult;
}

This is a standard StartingConditional script which checks against that variable to see if the dwarf has died or not. This is a matter of how I've ordered the conversation nodes in the conversation.

As for the rest of the script, we tell the killer of the dwarf, which we know is Granthos, to stop what he's doing, and talk to the nearest player. In addition, we advance the journal entry for the dwarf to the one where he's dead.

The last script attached to the minotaur's conversation is the following one:

//Script "cave_bosscon3"
void main()
{
     SetCommandable (TRUE, GetPCSpeaker());
     object oAlluen = CreateObject(OBJECT_TYPE_CREATURE,
          "alluen",
          GetLocation(GetObjectByTag("DOOR_SPAWN"))
     );

     object oGranthos = OBJECT_SELF;
     AdjustReputation(OBJECT_SELF, oAlluen, -100);
     DelayCommand(2.0f,
          AssignCommand(oAlluen,
              ActionSpeakString("Not so fast, Granthos!")
          )
     );

     DelayCommand(2.3f,
          AssignCommand(oAlluen, ActionAttack(oGranthos))
     );
}

This is where the player is made free again. Also, we create Alluen, an NPC, near the doorway (where I've placed the waypoint that I'm using in this script).

I've then adjusted the way Alluen feels about Granthos, and setup her action queue to do two things. First, actually say something to Granthos, and second, to actually attack Granthos.

Notice that I've declared oGranthos as OBJECT_SELF. Why have I done this? Becasue when I AssignCommand, I am changing the caller of a function. OBJECT_SELF refers to the caller, so by having OBJECT_SELF directly in the Attack function, I would actually be telling Alluen to attack herself.

To avoid this, I have declared OBJECT_SELF while Granthos is the object calling this script, and then referred to this declaration in the function. That way, I know for certain I am telling her to attack Granthos.

Since I want Granthos to die, I'm going to place the same kind of script in his OnPhysicalAttacked as I did with Kilinar:

//Script "cave_dieboss"
void main()
{
     if (GetTag(GetLastAttacker()) == "HENCH_ELF")
          DelayCommand(3.0f,
               ApplyEffectToObject(DURATION_TYPE_INSTANT,
                    EffectDeath(),
                    OBJECT_SELF
               )
          );

/* rest of script */

So, by adding these two lines into the script, I've got the same effect as I did with Kilinar, only it checks to see if it was Alluen instead of Granthos (since he couldn't kill himself... theoretically).

Next!

This entire section was about creating a sequence of events. I had the minotaur enter the area, and speak with the player. If the dwarf was there, the two had a fight, which the minotaur won. Then the elf showed up and slew the minotaur.

If you didn't keep up, I suggest looking at how the minotaur's conversation is setup, since nearly all of the order in which this scripting occured was handled by that one file. When you're ready, move onto the next section.

Tasks

I haven't been totally efficient in my scripting here. Try re-writing the scripting for Granthos and Kilinar to have the extra lines that I placed in there fired by their OnUserDefined handler (you'll need to read the box if you don't know how to do this).

Better yet, re-write the scripting for all three NPCs so that they use their plot flag to prevent the NPC that we want to remain alive from dying. This way the fight will be longer, and more realistic.

Hint

The UserDefinedEvent is a matter of moving the scripting from the individual scripts to the UDE script, and enabling the SignalEvent lines in the OnSpawn scripts for those particular UDEs.

Switching to the Plot Flag is simply working out when you want the creatures to be killable. So Granthos' plot flag gets removed when Alluen shows, and Alluens gets removed when she speaks to the PC.

UDEs

You may come across this term, it's short for User Defined Event. Essentially, it allows you to write script for an NPC without altering too many of their default scripts.

If you look through the various scripts on an NPC, at the bottom of each of them, you'll find a SignalEvent function used.

This is to send a number value to the NPC having the signal sent to. This causes the OnUserDefined script to fire.

There is a function which will retrieve the calling number of the event that just triggered the OnUserDefined script, and thus we can determine which piece of code to run using conditional statements.

To enable the default user events fired by the default scripts on an NPC, you must alter the OnSpawn script. Open one up now, and scroll down to the bottom. You'll find a number of commented out lines, which refer to the various default script handlers.

By deleting the double // marks before a line, you will enable the user defined event for that handler. Note the number it calls, and then adjust the OnUserDefined script accordingly.

PC or DM

The GetIsPC and GetFirst/NextPC functions will check against whether or not an object is a player. That is, any player in the game, including a DM.

GetIsDM must be used if you wish to determine if the target object is a player or a DM, since the PC functions will target anybody in the game.

Prevention

You've seen me do a number of if statements and loops, but I always have some way to determine whether or not the loop should end, or if it should only fire once.

There are two things to bare in mind. Firstly, if the script that you want to fire only once is on an object such as a trigger, you could simply use DestroyObject on the caller.

Secondly, if using a locally stored variable to determine how many times the statement should occur, always set the variable's new value before doing anything else in the conditional statement.

This is because in some cases where you have a lot of instructions in the conditional statement, you may find the player can trigger the script twice before it gets to the part where it sets the new variable state.

Reputations

Reputations are values used to determine whether two objects are friendly, neutral or hostile towards each other.

They range from 0-100, where 0 is hostile, and 100 is allied. Every pair of objects has values for their behaviour towards each other.

Factions

Factions are initial sets of reputation values. They establish how objects feel about each other when they first are created.

Changing the reputation of a faction towards another faction will change the way all objects in those factions feel towards each other.

However, the reputation values are still individually owned by those objects, so you can still alter the individual reputations, overriding the reputation values that were set because of their assigned faction.

Be aware that the AdjustReputation function does not alter the reputation values of individual objects in the way you might think.

While it will target a single object and adjust its reputation towards another object, it does so by changing the way the object's faction feels about the target.

So while you are still adjusting an individual object's reputation value, you are also adjusting how an entire faction feels about that object.

Be sure to pay attention to the definition of the AdjustReputation function, so that you know which one is which.

Screenshots

  • Granthos
  • He's Big
  • Go Badger!
  • Dead Dwarf
  • Dead Granthos

author: Robert Straughan, editor: Charles Feduke


Tutorial - Robert Straughan - Capture Glory: Raging Battle

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Raging Battle

Robert Straughan - Capture Glory: Raging Battle

Onwards

Now, I don't want the player leaving the caves until they've spoken to Alluen. To do this, I open up the properties for the exit, and click on edit for the OnAreaTransition.

You'll notice the script editor pre-generates some script for you. I've altered this to the following:

//Script "cave_exit"
void main()
{
     object oAlluen = GetObjectByTag("HENCH_ELF");
     object oClicker = GetClickingObject();
     object oTarget = GetTransitionTarget(OBJECT_SELF);
     location lLoc = GetLocation(oTarget);

     if (!GetIsObjectValid(oAlluen) ||
          GetMaster(oAlluen) != oClicker)
     {
          SendMessageToPC(oClicker,
               "You must have Alluen in your party to continue."
          );

         return;
     }
     AssignCommand(oClicker, JumpToLocation(lLoc));
}

I've added the declaration of Alluen, and then I have a conditional statement which checks two things. The last section probably looks familiar to you, as I've done it before (!= is NOT EQUAL TO, as opposed to ==).

That should clue you to what the ! in front of the GetIsObjectValid function does. You can place an exclamation mark before a value to logically invert it.

The majority of GetIs functions return TRUE or FALSE. By placing the exclamation mark before a function (or even before the values themselves) you invert their value. So GetIsObjectValid would return TRUE if Alluen exists, but I've changed it to equal FALSE.

This means that the function is effectively GetIsObjectNOTValid. If you get at all confused about whether to use the exclamation mark, remember that if statements only run their lines of code of the conditional returns TRUE.

There is another symbol here that I haven't used before, and thats the || symbol (it's two | marks. On UK keyboards, this is in the bottom left). This denotes logical OR, which means if one or other of the conditionals returns TRUE, then the if statement will fire its code.

In this case, if Alluen is not a valid object, or if she is not the henchman to the player attempting to pass through the door, then the message function will fire, and the return command will exit the script, preventing the jump to the exit transition target.

Notice that the use of OR means that as soon as Alluen is a valid object, the player may pass through the door. The last check is not actually of any use. If I wanted to prevent the player from passing through until they got Alluen as a henchman, then I'd make the || symbol an && one (or alternatively, I could just remove the first part altogether).

For the conversation with Alluen, I've entirely used the same scripts as Kilinar had on him. This is always something to bare in mind, if you can use the same script in multiple places, do so. It saves cluttering up your script library.

Into the Flames!

Right, now, outside I want their to be a battle going on, since Alluen has mentioned one. I could script this in a number of ways, but I've gone for simplicity.

I've created some orcs and some guards, and two new factions. I've set the factions to be hostile to one another, but neutral to everybody else. This way, they will fight each other, but leave the player alone.

To set up the battle so that it starts when the player gets outside, I've not placed any of the creatures at all into the module. Instead, we'll create them when the time is right.

//Script "out_oe"
void main()
{
     object oEnter = GetEnteringObject();
     if (GetIsPC(oEnter) && GetLocalInt(OBJECT_SELF, "FIRED") == 0)
     {
          SetLocalInt(OBJECT_SELF, "FIRED", 1);
          int nNth;
          object oWP = GetObjectByTag("SPAWN_FIGHT", nNth);
          while (GetIsObjectValid(oWP))
          {
               string sResRef = "guard";

               if (d2() == 1)
                    sResRef = "orc";

               object oCreate = CreateObject(OBJECT_TYPE_CREATURE,
                    sResRef,
                    GetLocation(oWP)
               );

               nNth++;
               oWP = GetObjectByTag("SPAWN_FIGHT", nNth);
          }
          AddJournalQuestEntry("HenchAlluen", 20, oEnter);
     }
     if (GetTag(oEnter) == "HENCH_ELF")
          AssignCommand(oEnter,
               SpeakString(
                    "Quickly! We must find Thar! Run for it!"
               )
          );
}

There's a new trick to learn here. This script is fired from the OnEnter handler for the area, so as soon as any object enters (not just PCs) this script will fire. Most of this should look familiar.

If the entering object is a player (as I said, OnEnter fires every time an object enters or spawns), and this has not been done before, then we get an object with the appropriate tag.

Note that I've filled in the usually pre-declared parameter for the GetObjectByTag function. nNth hasn't been initialised, so it will start at zero. The purpose of the integer value in the last parameter is to get the object with the tag that many times.

It's like a cycle. Imagine I have several LEGO bricks to choose from, and they are all of different colours. If I want a specific red one, I can't just say "Pick up the red one." because there are several red ones. I have to say "Pick up the third red brick from the top."

So, by giving GetObjectByTag a value, it will cycle through all the objects with the tag that many times, and return the selected object to the script. This is important, because if you are using GetObjectByTag, and have multiple objects with the same tag, you don't know that the script has gotten the one you want to use.

But here, I'm not using this because I want to be certain of which waypoint I get. If you look at the while loop that follows, you'll notice that it continues to run its code as long as the object I've gotten is valid.

But that's going to result in a continuous loop unless I change the object. Look at the end of the while loop. Notice that I've incremented nNth by one, and then gotten the object with the same tag but of the newly incremented amount.

This setup is like having a GetFirst/NextObjectByTag set of functions. It allows me to cycle through every waypoint with that tag until there are no more (since it would get to a value higher than the number of waypoints available, and return an OBJECT_INVALID).

So what does the loop do? Well, as it gets each waypoint, it declares and initialises a string variable. It then rolls a d2, and on a 1, changes that variable to something else.

It then uses CreateObject to make a creature with the resref (or tag, but the string variable refers to a resref in this case, read the box if this doesn't make sense). It does so at the location of the current waypoint object declared as oWP.

Now you can see how easy it can be to do mass processes. When scripting, if you find you are using the same function over and over, just as with deciding when to declare a function or to just use it straight off, you should try to refine your script to use those functions the least possible number of times.

If the battle has been started, the last thing we do is advance the journal for the player. Notice the bottom two lines. If the entering object turns out to be Alluen, we get her to say some lines. This was to encourage the player to do the correct thing.

Fe-Fi-Fo-Fum

As a nice little touch, and to add a level of atmosphere to the battle, when the player runs down into the gulley, I'd like to have a bunch of soldiers running away from a giant which is chasing them.

To do this, I first place a bunch of waypoints where I'm going to spawn the creatures involved. I then place a trigger where the player would be just in the right place to witness the chase. Finally, I add the following script to the trigger:

//Script "out_runnerstart"
void main()
{
     int nNth;
     object oDest = GetObjectByTag("RUNNER_DEST");
     for (nNth = 1; nNth <= 4; nNth++)
     {
          object oWP = GetObjectByTag("RUNNER_"
               + IntToString(nNth)
          );

          object oRunner = CreateObject(OBJECT_TYPE_CREATURE,
               "runningguard",
               GetLocation(oWP)
          );

          AssignCommand(oRunner, ActionMoveToObject(oDest, TRUE));
     }
     object oGiant = CreateObject(OBJECT_TYPE_CREATURE,
          "gntmount001",
          GetLocation(GetObjectByTag("GIANT_SPAWNER"))
     );

    AssignCommand(oGiant, ActionMoveToObject(oDest, TRUE));
    DestroyObject(OBJECT_SELF);
}

Notice that I use DestroyObject at the end of this to prevent the script from firing more than once, instead of a locally stored value. This is technically a bad move, since I haven't put any of this within an if statement.

Why an if statement? Consider the line: if (GetIsPC (GetEnteringObject())). I haven't placed a check to ensure the object triggering this script is a player. What if one of the guards or orcs walks into the trigger? What if the player's henchman does?

These are the sorts of things that a scripter has to take into account. Just like with GetIsPC/DM checks, you have to try and account for every possible outcome or possibility when writing a script, or else something might happen how you didn't intend.

So, what about the rest of the script? Well, we get an object by a given tag. We then use a for loop which runs four times. We know this, since nNth starts at 1, and then increases by 1 every time the loop completes, until nNth is 5 or more, when it will stop.

The loop runs through a set of waypoints. Notice how I haven't used the hidden parameter this time. Instead, I've actually tagged the waypoints with a number, and added the nNth value onto the end of the tag I'm getting.

Also notice that I've placed the nNth within a function called IntToString. This is because I am doing a mathematical process with two different variable types. RUNNER_ is a string, but nNth is an integer. I would get an error if I tried to do "RUNNER_" + nNth.

In this example, it isn't actually necessary for me to use individual tags for the waypoints, I could have done what I did earlier and used the hidden parameter on the end of GetObjectByTag.

It's useful to note that you can do this though, since you may wish to target objects in a specific order. Using the tag means you know exactly which object the script is targetting, whereas using the parameter, you don't actually know which one is which.

We then create an object of value runningguard at the location of the currently targetted waypoint. We also tell them to run towards the waypoint I declared at the beginning of the script (the TRUE/FALSE parameter in MoveToObject states whether to run or not).

Finally, once all four guards have been created, I then make a giant at its own waypoint, and tell it to run towards the same point also. Note that I didn't actually tell it to go any slower, I altered the movement speed in the creature editor instead.

There are two things I now need to consider. One, what if the player somehow stops them, or if they get stuck on a piece of terrain. To solve this, I can use the OnHeartbeat handler for these creatures:

//Script "out_runner1"
void main()
{

    object oRunTo = GetObjectByTag ("RUNNER_DEST");

    if (GetTag (OBJECT_SELF) == "RUNNER")
         if (d2() == 1)
               SpeakString ("Aargh! Runaway!");

    if (GetDistanceToObject (oRunTo) >= 1.0f)
         ActionMoveToObject (oRunTo, TRUE);

}

This script will fire for each creature I place this on every 6 seconds. The bottom two lines means that if the creature is still too far away from the target that they are moving to, then they will be told to move towards it again (avoids problems with the NPC stopping).

The first three lines have two interesting points. First is the fact that I actually check the tag of OBJECT_SELF. This means that I can place this same script in multiple creatures' OnHeartbeat handler, but the following lines won't occur for anything but the one with the tag I've looked for.

Also note that I've got two if statements one after the other. Remember that you do not need to place the curly brackets after an if statement if only one line follows it. This makes the script easier to read.

You must be careful with this sort of placement though. Look at the following script:

//Example script
void main()
{
     if (nNth == 1)
     {
          nNth = nNth + 10;
     }
}

This is the same as this:

//Example script
void main()
{
     if (nNth == 1)
     nNth = nNth + 10;
}

But, what about the following:

//Example script
void main()
{
     if (nNth == 1)
          nNth = nNth + 10;
     if (nNth == 2)
          nNth = nNth - 10;
     if (nNth == 1)
     {
          nNth = nNth + 10;
          if (nNth == 2)
          {
               nNth = nNth - 10;
          }
     }
}

Now, you've got two sets of if statements that do the same thing, right? Wrong. The bottom set will only run the if (nNth == 2) line if the first if statement was true. Whereas the top set will run both if statements regardless of whether one or the other is true.

Always remember, when skipping out the curly brackets in script, the if statement applies only to the line immediately after it. Any lines beyond the first will run regardless of the if statement's validity.

So what did the script do? If the creature running the script has a tag of RUNNER, and when a d2 is rolled a 1 is the result, then they will speak a line. (Read the box for more on using if statements in OnHeartbeats.)

Finally, my runners are all going to stop when they reach their destination. So I need to destroy them when they get there, and the easiest way to do that is with a trigger.

//Script "out_runner2"
void main()
{
     object oEnter = GetEnteringObject();
     string sTag = GetTag(oEnter);
     string sLeft = GetStringLeft(sTag, 6);
     if (sLeft == "RUNNER")
          DestroyObject(oEnter);
}

This script gets the object entering the trigger (because I'm using the OnEnter handler of the trigger). It then gets the tag of the entering object.

Because the tags for the runners and the giant are different, I can't just check the tags to see if they are the right objects to destroy (I could, but it would make this tutorial a bit incomplete).

So, for this, I do a bit of string manipulation. Using the GetStringLeft function, I can get a number of characters from the left end of a specified string. I choose to use the tag of the entering object (which is a string) and to get the first 6 characters from the left end.

Six characters would be the same length as the word RUNNER, which is how both the guards' and the giant's tags start. So if the entering object is one of the runners, the script will destroy them.

It goes on and on...

You've just learned how to use loops to do mass processes, and to save you from having to type out every single thing you want the script to do. You've also learned how to use the fi statements without brackets a bit more accurately.

Remember, the difference between a beginner and an advanced scripter is not what functions you use or how you use them, but how efficient you are at writing the script.

If you've got this all downpat, head on. If not, try following the scripts on this page through again. Sometimes a lengthy explanation may help, but sometimes simply trying to understand the sequence that a script runs through to achieve its end results will help more.

Tasks

Create an area with a room. In this room, you must have at least six creatures spaced out. Write a script which will have each creature say a different line, before being destroyed with a flashy effect. The script must be as efficient as possible.

Hint

Create the room, and place the six creatures into the room. Make their tags all the same. Create a loop which cycles through each monster, assigns a SpeakString command with a string determined from a random number, and then destroys the current creature.

Syntax

Throughout my scripting, you've noticed that the names I use for declaring variables tend to start with a lower case letter.

This is just a scripting practice, to keep the names of the variables recognisable throughout the code, and making sure we can see what type of variable we are using.

Jump Vs Move

A small point, but one to be aware of. JumpToLocation is a teleport effect, moving an object from one point to the next without passing through the intervening space.

MoveToLocation means the object will actually attempt to walk the distance.

Hail the Badger

Badger syndrome is an early error found by most scripters. It has to do with the CreateObject function.

When creating creatures, you must obey the rule regarding tag vs resref of the object you are creating with regard to which palette it is in.

If the string you give the CreateObject function does not match the tag of any creature in the standard palette, or the resref of any creature in the custom palette, it defaults to the first creature in its listing alphabetically.

Thus the almighty badger is born.

OnHeartbeat

This is the only way scripting can have a timer outside of DelayCommand. The script in any OnHeartbeat handler fires every 6 seconds.

This allows us to not only time events, but also keep track of changing values, such as distance from an object.

There is a major drawback to this though. The script fires every 6 seconds regardless of whether it is necessary or not.

Consider a large battlefield of creatures. Each one has an OnHeartbeat handler. Each one fires a script every 6 seconds. That's a lot of processing the computer has to do.

Most people avoid using OnHeartbeat scripts for the reason that it can slow things down. While most scripts are not processor intensive when run, if you start ending up with a lot of scripts running at the same time, it can have a performance hit.

This is usually why people prefer to build modules using encounters or custom scripted spawnings, since the creature is not in the game until we know it is needed, thus reducing the amount of unnecessary processes being run.

Another common point about those OnHeartbeat scripts that do get written is that they often have a lot of conditional statements in them. This means that none of its scripting will run unless its absolutely certain it has to do so, also reducing the amount of processing a script does.

When writing if statements in OnHeartbeat scripts, always try to avoid using &&. Instead, write out each if statement seperately. If the processing should be done anyway, then you aren't increasing the amount of work it has to do, but if something isn't TRUE, and you use &&, the if statement will still work out all the values first.

Pre/Post-Fix

You may have noticed that in order to increment numbers I have used the notation ++ (-- works for decrement).

x++ is the same as saying x = x + 1. It is also the same as saying x += 1.

There are various operators such as *=, or -=, which essentially do the indicated maths with the values you give. For example, x *= 2 would do x = x * 2.

The ++ notation is what's called a post-fix increment. ++x is the prefix version. Essentially they both do the same thing, however, in some cases it can be important to know which one to use.

The prefix version does the increment as soon as it encounters the notation in the script. The post-fix version does the increment after it has done any calculation in the script.

This is especially important when you include a pre/post-fix increment or decrement directly into a calculation.

For example, x = y + z++ would work out x to be y + z, and then increment z by one. Whereas x = y - ++z would increment z first, and then subtract it from y to get x.

Screenshots

  • Need a Light?
  • Fe-Fi-Fo-Fum
  • Keep On Running
  • The Area

author: Robert Straughan, editor: Charles Feduke


Tutorial - Robert Straughan - Capture Glory: Light Show

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Light Show

Robert Straughan - Capture Glory: Light Show

The Final Battle

To make the final battle interesting, I've decided to add something more than just a straight out fight. Sometimes a simple time limit on the battle will do, but for this, I've decided the player must solve a simple puzzle.

First, when the player gets to the temple, he will or will not have Alluen with him (most likely he will, but I have to account for both possibilties). So, I place a trigger around the temple, and when the player enters, the following script fires:

//Script "out_templestart"
void main()
{
     object oEnter = GetEnteringObject();
     object oElf = GetObjectByTag("HENCH_ELF");
     if (GetIsPC(oEnter) && GetLocalInt(OBJECT_SELF, "ENTERED") == 0)
     {
          SetLocalInt(OBJECT_SELF, "ENTERED", 1);
          if (GetIsObjectValid(oElf) && GetMaster(oElf) == oEnter)
          {
               RemoveHenchman(GetMaster(oElf), oElf);
               DelayCommand(0.1f, AssignCommand(oElf,
                    ClearAllActions())
               );

               DelayCommand(0.2f,
                    AssignCommand(oElf,
                         ActionMoveToObject(GetObjectByTag("EVIL_ALTAR"),
                              TRUE
                         )
                    )
               );
          }
          if (!GetIsObjectValid(oElf))
          {
               object oSpawn = GetObjectByTag("SPAWN_AID");
               object oGuard = CreateObject(OBJECT_TYPE_CREATURE,
                    "soldier",
                    GetLocation(oSpawn)
               );

               AssignCommand(oGuard, ActionMoveToObject(oEnter, TRUE));
               AddHenchman(oEnter, oGuard);
          }
     }
}

First, the script gets the entering object and Alluen. Then, provided this hasn't been done before and the object is the player, it has two possible options.

First, if Alluen is the player's henchman, then it removes Alluen from their party, and tells her to drop what she's doing, and run for the altar. Remember that using Action commands stacks the queue, so you need to clear the object's queue if you want the action to be immediate.

The second option is if Alluen is not valid. If this is the case, it gets the waypoint I have indicated, and creates a creature there. Because I have actually declared to a variable name, I can assign commands to it immediately.

Notice the third option? There is a third option, but it requires that you understand the process this script is going through. What if Alluen exists, but is not the player's henchman? Then Alluen will not do anything, and the player won't get a henchman.

Still can't see it? Think about it, I've checked for two possible options, but this third option could still happen. Since I've done nothing to prevent it, that's what will happen.

So, I've given Alluen a conversation option which won't appear unless the following StartingConditional returns true:

//Script "out_hench2"
int StartingConditional()
{
int iResult;

     iResult = GetDistanceBetween (GetObjectByTag ("EVIL_ALTAR"),
        OBJECT_SELF) <= 2.5f;
return iResult;
}

Like all other StartingConditionals, this boils down to a check for whether something is true or not. In this case, it gets the distance between the NPC and the altar, and checks to see if it's less than 2.5 metres. If so, then the line will be stated.

What happens next is that the player must remove all the gems from the altar. To check this, since the altar is a container, I've used the following script in the OnClosed handler:

//Script "out_altarclose"
void StartThar(object oWP, object oPC)
{
     object oAlluen = GetObjectByTag("HENCH_ELF");
     object oThar = CreateObject(OBJECT_TYPE_CREATURE,
          "thar001",
          GetLocation(oWP)
     );

     if (GetIsObjectValid(oAlluen))
          AdjustReputation(oThar, oAlluen, 100);

     AssignCommand (oThar, ActionStartConversation(oPC));
}

void main()
{
     object oInv = GetFirstItemInInventory();
     object oPC = GetLastClosedBy();
     object oWP;
     while (GetIsObjectValid(oInv))
     {
          string sTag = GetTag(oInv);
          string sLeft = GetStringLeft(sTag, 4);
          if (sLeft == "GEM_")
               return;
          oInv = GetNextItemInInventory();
     }
     if (GetLocalInt(OBJECT_SELF, "FIRED") == 0)
     {
          SetLocalInt(OBJECT_SELF, "FIRED", 1);
          int nNth;
          effect eLightning = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
          ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,
               eLightning,
               GetLocation(OBJECT_SELF),
               15.0f
          );

          for (nNth = 1; nNth <= 5; nNth++)
          {
               oWP = GetObjectByTag("WP_" + IntToString(nNth));
               string sResRef = "invisobj00" + IntToString(nNth);
               object oNode = CreateObject(OBJECT_TYPE_PLACEABLE,
                    sResRef,
                    GetLocation(oWP)
               );

               effect eNode = EffectBeam(VFX_BEAM_LIGHTNING,
                    oNode,
                    BODY_NODE_CHEST
               );

               DelayCommand(0.5f,
                    ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
                         eLightning,
                         GetLocation(oWP)
                    )
               );

               DelayCommand(1.0f,
                    ApplyEffectToObject(DURATION_TYPE_PERMANENT,
                         eNode,
                         OBJECT_SELF
                    )
               );

          }
          oWP = GetObjectByTag("TEMPLE_SPAWN");
          DelayCommand(1.0f,
               ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
                    EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL),
                    GetLocation(oWP)
               )
          );

        DelayCommand(5.0f, StartThar(oWP, oPC));
    }
}

Complicated? Nope, just long winded. Walk through it, and you'll see I'm doing nothing new here.

First of all, we start out with a custom function called StartThar. Remember, I have to do this before the void main(), or else when I use it in the main script, it won't know what I'm talking about.

This function is void, so it returns nothing to the script, and it has two parameters. Using those parameters, we find Alluen, create Thar at the location of one of those parameters, make Alluen friendly to Thar, and then have Thar speak to the object given in the other parameter.

Why make Alluen friendly to Thar? Well, I need Thar to talk to the player, and don't want her to attack him and interrupt. But her faction isn't hostile to Thar's faction? Yes it is, because we altered the way her faction feels about Thar's faction when we had her attack Granthos.

Don't worry if you don't think of this sort of thing when actually writing the script, a lot of the bugs in a script are found when you play through the module, and find things not happening the way they should.

So what does this script do? Okay, first we get the first item in the inventory of the container this script is called by. Then we get the object which just closed this container.

Notice that we also tell the script there's an object variable called oWP, but we haven't initialised it. Which means its equal to OBJECT_INVALID at the moment. This is because we're going to set it to a new value later on.

We've next got a while loop that does a GetFirst/Next loop through the items in the container's inventory. It gets the tag, and then the first four characters of that tag from the left end. If those characters are equal to GEM_, then we quit the script.

Just to make sure you understand the concept of return, it only quits the script here beacuse its being used in the void main() script. If I placed a return in the custom function StartThar, it would actually quit back to the void Main() script where it left off.

This is why void scripts are void. Because they don't return anything, they just go back to where they were. Earlier, in the StartingConditional scripts, I had to return a value, because the function they were being used in was an int returner.

Okay, moving on, this means that the rest of the script won't even get touched if the script finds one of the gems still in the container. Had I used the OnOpen handler, the player would have had to open the container again after removing the gems before this would have fired.

If it manages to get past the while loop, it means there are none of the gems left in the container, and the next part can fire. Because I'm using an if statement, it means I can prevent the rest happening more than once.

Notice that I declare a visual effect. This is because I wish to use the same effect in multiple places throughout the rest fo this script, and it saves me some typing to declare it once.

So, even though I've used a DURATION_TYPE_TEMPORARY in the apply effect, a lightning bolt will strike the alter only once, because its not a visual effect designed to be run for a duration of time (actually, it appears to do so, I've targetted the location of the altar, not the altar itself).

From the for statement, we can tell that whatever comes next will occur 5 times. We also set oWP to a value. This is an example of when you would want to use string manipulation to target specific waypoints. I'm using the numbers on the end of several objects to identify which colour light is where.

I create the energy node for the currently targetted waypoint (it's an invisible object with a container property) at the location of oWP (notice I've again used nNth to determine which one to make).

The next thing is an application of logic. The beam effect requires that you specify the emitter, which I have set to the node which I just created. I then fire the lightning effect at the location of oWP, and have the beam effect target the altar.

What's the end result of this for loop? Where the five waypoints are, we place an invisible object with a container, and fire a lightning bolt at it. A moment after the lightning strikes, the bolt appears to shoot from the node to the altar (it's not the same bolt, it's a different effect altogether, but by delaying it, that's what it appears as).

The last bit shows why I declared oWP outside this section. If you declare a variable inside a conditional statement, it cannot be used outside the curly brackets, because there's a chance the variable won't get declared if the conditional locks it out (and the compiler won't risk this).

So, I now change the target to be another waypoint, and apply a new visual effect to its location. I then run the custom function I created at the beginning of the script.

Now, an important thing to bare in mind. Why did I not just place the script in the custom function at the end of this script? Note that the CreateObject function returns an object variable. In the past, you've seen that you can use this function either to declare an object or use it as a void function.

Unfortunately, the DelayCommand function won't differentiate like this, and since it requires the use of a void function, we cannot use an object returner in a DelayCommand. The way to delay a Create command is to place it within a void returner, that way the DelayCommand works.

So far, we've gotten a whole bunch of special effects to occur, and for some lightning beams to be set up running from the node objects to the altar. We've also created Thar and made sure that Alluen won't attack him.

Thar's conversation ends with the following script:

//Script "out_bosscon1"
#include "nw_i0_generic"
void main()
{
     object oHench = GetHenchman(
          GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,
               PLAYER_CHAR_IS_PC
          )
     );

     object oThar = OBJECT_SELF;
     if (GetIsObjectValid(oHench))
     {
          AdjustReputation(oThar, oHench, -100);
          AdjustReputation(oHench, oThar, -100);
          AssignCommand(oHench, ActionAttack(oThar));
     }
    ChangeToStandardFaction(oThar, STANDARD_FACTION_HOSTILE);
    AssignCommand(oHench, DetermineCombatRound());
}

Like earlier, this script will cause the player's henchman to go hostile on Thar. Nothing here is anything I haven't done before, and it should all be making sense to you now.

We get the henchman of the nearest player, and we declare OBJECT_SELF so that we can properly refer to the caller in AssignCommand functions.

If the henchman is valid we run some functions to make them hostile towards each other, and then have the henchman attack Thar. Regardless of if this happens though, Thar will become hostile and attack anyone.

We end this final battle with the following script, which is placed in the OnClose handler of the nodes which we created (notice I didn't just place them down in the editor, this was for realism, since I didn't want the player clicking on them before they had the gems).

//Script "out_nodeclose"
void main()
{
     object oMod = GetModule();
     object oInv = GetFirstItemInInventory();
     string sInv = GetTag(oInv);
     string sTag = GetTag(OBJECT_SELF);
     string sCheck = GetStringRight(sInv, 1);
     string sSelf = GetStringRight(sTag, 1);
     if (!GetIsObjectValid(oInv) ||
          GetStringLeft(sInv, 4) != "GEM_" ||
          GetIsObjectValid(GetNextItemInInventory()) ||
          sCheck != sSelf
     )
          return; // if true

     int nCount = GetLocalInt(oMod, "NODE_COUNT");
     nCount++;
     SetLocalInt(oMod, "NODE_COUNT", nCount);
     if (nCount >= 5)
     {
          object oThar = GetObjectByTag("BOSS_THAR");

          SetPlotFlag(oThar, FALSE);
          ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
               EffectVisualEffect(VFX_IMP_LIGHTNING_M),
               GetLocation(oThar)
          );

          AssignCommand(oThar, SpeakString("Nooooo!"));

          ApplyEffectToObject(DURATION_TYPE_INSTANT,
               EffectDeath(),
               oThar
          );
     }
    DestroyObject(GetObjectByTag("SHAFT_" + sSelf));
    DestroyObject(oInv);
    DestroyObject(OBJECT_SELF);
}

This script gets the module, and the first item in the node. It gets the tag of the item, and the tag of the node. I then get the last character of the item's and the node's tags.

Note the if statement. Although there is only one line afterwards, a return command, there are four conditions that must be met for that command to happen.

If the item is not valid (exclamation mark, so its inverted), or if the item's tag doesn't begin with GEM_, or if there is more than one item in the container, or if the last character of the item's and node's tags do not match, then this script will stop running.

Now, the next three lines are a common sight in many scripts. This is a stored counter. We get the value of a local variable, we then increment it, and set the exact same local variable to the new value. This allows us to keep track of things outside of the script.

Now, if that counter has reached 5 or more, then we get Thar, remove his plot flag status, create a lightning effect at his location, tell him to shout, and then kill him.

Regardless of if the counter has reached 5 or more, this script will then destroy the appropriate shaft of light (see why I was using numbers to match these up?), the gemstone itself, and the node.

What's the effect? When a player puts the right gemstone into the right node, the node will vanish (which incidently also removes the beam effect, since I applied them from the node) and so will the light. When they're all gone, Thar will be killed.

Well, this may have taken a bit of effort to script, but it adds a new dimension to the experience beyond just fighting (in fact, throughout this module, it's possible the player didn't have to attack anything!).

To wrap the module up, I've placed the following into the OnDeath script for Thar:

//Script "out_questboss"
void main()
{
     object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,
          PLAYER_CHAR_IS_PC
     );

     AddJournalQuestEntry ("NPCThar", 40, oPC);
     object oWP = GetObjectByTag("SPAWN_AID");
     object oHarris = CreateObject(OBJECT_TYPE_CREATURE,
          "dand",
          GetLocation(oWP)
     );

     AssignCommand(oHarris, ActionStartConversation(oPC));
}

The first line will actually happen since there's about a second before the object that fires an OnDeath script actually becomes invalid. It's important to bare that in mind when dealing with OnDeath, because any number of problems with scripting OnDeath scripts can occur.

We advance the player's journal, and then create a new NPC at the waypoint specified. We then tell this NPC to go and speak to the player. This way, as soon as Thar dies, it'll only be about a second or so before the NPC comes running in.

The conversation is pretty basic and has two scripts:

//Script "out_gold"
void main()
{
     GiveGoldToCreature(GetPCSpeaker(), 1000);
}

//Script "out_endgame"
void main()
{
     DelayCommand(10.0f, EndGame(""));
}

The first one will give some gold to the player. The second one will actually cause the module to end, and the credits video to run. This can be useful if you want to definitively let the player know the module is over.

Hurrah!

That's it! The end! In this last section, you learned how to use while and for loops to reduce the amount of scripting you needed to do in order to get a reasonably complex puzzle going for the final battle.

If you feel that this last page went too fast, just read back through the scripts (not the descriptions), and use your basic knowledge of scripting to work out what they are doing.

Tasks

Write a script that will fire every 60 seconds, and will reset any of the nodes which have already been deactivated (thus meaning the player must place the gems correctly within one minute or do it all again). Put the gems that have been destroyed back into the altar.

Erm, free doughnut for the writer from each person who reads this?

Screenshots

  • Pretty Lights
  • Whoops!
  • Die Thar!
  • Dead Thar

author: Robert Straughan, editor: Charles Feduke


Tutorial - Robert Straughan - Capture Glory: Miscellaneous/Reference

Home > Lyceum > Tutorial > Writing a Module > Robert Straughan - Capture Glory: Miscellaneous/Reference

Robert Straughan - Capture Glory: Miscellaneous/Reference

Anything Else?

There are one or two things I haven't done in this tutorial, which I'm quickly going to explain. There are also many nuances in the scripting language, but they really take practice to find. I've made a mention of one here.

Firstly, the important conditional statement that I missed out in this tutorial was the switch/case statement. Consider the script "cave_garbage"

In it, there's a long list of if statements. This entire piece could have been replaced by a switch/case statement. Now that you've got that in mind, let me show you a typical OnUserDefined script.

//Example script
void main()
{
     int nCall = GetUserDefinedEventNumber();
     switch (nCall)
     {
          case 1001:
               ActionSpeakString("This is my heartbeat event.");
               break;
          case 1002:
               ActionSpeakString ("I have perceived something.");
               break;
    }
}

Now, this script is the equivalent of two if statements. I get an integer value called nCall, which is based on the number determined by the function. I then put that into the parameter of the switch.

The brackets after the switch are like the brackets after an if statement. In here, we place an integer value (note that we can only use integer values in a switch/case statement. Remember that some integers are represented by string constants, and these are still valid with switch/case).

What the switch effectively does is run down the lines of code, and says if (nParameter == nCase). So it will run down the list of case statements, and look for the one which matchs the parameter.

Also note the use of the break command. This can be used to break out of any loop or conditional statement, without actually ending the script (making it different to return).

It is used in switch/case statements, because although the switch searches down the case statements for the value which matches its parameter, and won't run any script until it finds that value, it will then continue running all script beneath that case line which matches the parameter.

So if I have a large list of case statements, but don't put a break command in, when the switch is run, it will run all the lines below that case, even if some are within other case statements, which you probably don't want it to do.

So in the above example, it gets the calling UserDefinedEventNumber, and then checks to see if it has some script to run according to what number it got. In these examples the numbers are defined by the OnSpawn script for the creature involved.

This is a simple method of keeping long lists of if statements neat and tidy, and also reducing the amount of processing the script has to do, since all those if conditional statements have been reduced to one.

Okay, so I've shown you switch/case, and I've shown you break. I'm also going to show you the other variable type that I haven't used, which is vectors.

A vector is made up of three co-ordinates. They are the x-, y- and z-axis values of any object within an area. Generally, you'll only have to deal with them in one form, that of a vector variable.

You can however split them up if you wish, using the 'dot' operator, as follows:

//Example script
void main()
{
     object oTarget;
     vector vVector = GetPosition(oTarget);
     float fX = vVector.x;
     float fY = vVector.y;
     float fZ = vVector.z;
     vector vNewVector = Vector(fX, fY, fZ);
}

This script gets a vector of an object, pulls it apart, then puts it back together under a new name. That's all there is to a vector really. It's useful if you want to get exact positions, or if you wish to create a new location from scratch.

I'm also going to show you a useful function for conversation files.

//Definition of SetCustomToken function
void SetCustomToken(int nCustomTokenNumber, string sTokenValue)

This function can be used to define a custom token of a given value to a set string. Generally, you determine the number when writing the conversation, and then use the StartingConditional script to run this function (since we need to set it before it appears to the player).

You place the token into the conversation with &lt;CUSTOM##&gt;, where ## is the number of the custom token you have just set. You are not limited to two-digits, but as you are about to read, you must have at least that many.

It's useful if you want to insert information that you don't necessarily know at the time of writing the conversation. The editor already has some predefined tokens, such as &lt;FirstName&gt;, &lt;race&gt;, etc. These get information based on the PC speaking to them.

Why have I included this? Because there's a small nuance that, if you didn't know about it, you could spend forever debugging a script with this function in, and never find a problem. For the custom token number, you cannot use 0-9, as these are reserved numbers.

Common Errors

The compiler is your friend. It will usually tell you if you've made a mistake with your script. The most common error is simply syntax. Misspellings, mistypings, or misuse of variables/functions, or something as simple as missing out a bracket or semi-colon, can all be the problem you're looking for.

Here are a few errors that I got when writing this module:

PARSING VARIABLE LIST - common one, usually meaning you've missed a semi-colon at the end of a line.

IF CANNOT BE FOLLOWED BY NULL STATEMENT - This means you've got an if statement where you've placed a semi-colon immediately after it, instead of having the curly brackets.

VARIABLE DEFINED WITHOUT TYPE - This usually means you forgot to declare a variable before you used it in the script.

ARITHMETIC OPERATION HAS INVALID OPERANDS - This appears when you are trying to do some maths (eg + or -) with variables that are of different variable types, such as trying to add an integer to a float.

NOT ALL CONTROL PATHS RETURN A VALUE - This is found when you are using custom functions, and means you have a conditional statement within your function, where the return command is within the conditional, meaning there's a chance that no return command will be run.

RETURN TYPE AND FUNCTION TYPE MISMATCH - This is also found when using custom functions. It means you've returned the wrong type of variable with the return command, as opposed to what kind of variable you said the function would return.

SKIPPING DECLARATION VIA CASE STATEMENT DISALLOWED - This appears when you use a switch/case statement. You cannot declare any variables within a switch/case statement, they must be declare outside of it (since it's a conditional, so there's a chance it might not get declared).

Tada

Phew. We got there. I may not have explained everything in as great a detail as I could, but to be honest, all that there is to learn about scripting is the basics.

What did I say at the beginning?

"Scripting is like LEGO."

All that I can really teach you is how to put the bricks together. The rest is down to you. Your imagination tells you what you want, and your logical thought tells you how to get there using the basic building techniques.

There is nothing else to it, beyond practice. I could go into lengthy detail about each and every function, and their nuances, but that would take forever.

Just always remember, start with the basics, and build them up to get the complex end result. That's all there ever is to it (any nuances that you run into are not usually a fault of learning, the language or even your logic, more often than not its because of the game engine itself).

If you want a final task, try to build your own module that does everything this one did. Here's the checklist I had when designing this:

  • Must have custom OnDying, OnDeath and OnRespawn rules
  • Must have at least one custom item power
  • Must have at least one henchman
  • Must have at least one scripted sequence of events
  • Must have a multiple creature spawning script
  • Must have at least one puzzle
  • Must have a immersive event which has nothing to do with the player but adds flavour to the current activities (in this one, it was the giant)

For Your Reference

Here are a bunch of useful things you may wish to get hold of when building your Neverwinter Nights Modules.

My Stuff

  • Design Guides
  • Downloadable ERFs/Mods
  • Freebies

Community Content

  • Celowin's Tutorials - These are some excellent little tutorials on how to use scripting. If you've tried this tutorial, you may wish to cover these, as they may explain things a bit better than I have. [Celowin's tutorals also appear in the tutorials section of the Lexicon --Ed.]
  • The Scripter's Guild - The best way to learn scripting is to practice, and this guild allows community members to pull together and share their scripting knowledge, both with asking questions, and answering them.
  • Eligio's Custom Content Guide - Useful guide for building all manner of custom content.
  • Memetic AI - The AI supplied with the game suffices for simple combat, but is not the best. Many different AI's have been written to replace the default one, but currently this one looks to be the best available. You may wish to experiment based on what you're after, and what level skill of scripting you possess.
  • Custom Scripts courtesy of the NWVault - The Vault has many useful custom scripts written by scripters in the community. If you're having trouble writing a script, try searching the Vault, somebody may have written a script which does what you want.

Writer's Information

If you have questions, email me at jazael@telarnia.com, or send me a PM on the Bioware forum site (username: Jazael). Alternatively, for live scripting help, you can usually find me in the IRC chat room #nwscript found on the server irc.nwconnections.com.

Practice Makes Perfect

Just keep on scripting, and you'll get the hang of it. And remember, always take a break from scripting at least every half an hour, or you'll start seeing the world like Neo does at the end of the Matrix.

Screenshots

  • nw_i0_generic

author: Robert Straughan, editor: Charles Feduke


Resources

注意: タグ名は大文字と小文字の区別があります。名前の長さは最大32文字です。

Creatures（クリーチャー）

Items（アイテム）

Placeables（配置物）

Sounds（音）


Creature Categories - Creatures

Home > Resources > Creatures

Creatures

Creatures | Description
Animals, Bears | クマ
Animals, Birds | 鳥類
Animals, Canine | イヌ
Animals, Feline | ネコ
Animals, Other | その他の動物
Companion Creatures | ドルイドとレンジャーのアニマルコンパニオン
Constructs | 魔法によって、操られた/作られた物
Dragons | ドラゴン
Elementals | エレメンタル（召喚された世界の物質により成り立つ存在）
Familiars | ウィザードとソーサラーの使い魔
Giant, Common | 巨人・一般
Giant, Noble | 巨人・特定元素の力を持った巨人
Giant, Ogres | 巨人・オーガ
Giant, Trolls | 巨人・トロール
Humanoid, Bugbears | バグベア
Humanoid, Fey | 妖精族（森の住人）
Humanoid, Gnoll | ノールは外見だけでなく、残酷で獰猛な点もハイエナによく似ている
Humanoid, Goblin | ゴブリン類
Humanoid, Kobold | 身長の低い人間型の爬虫類
Humanoid, Lizardfolk | リザードフォーク
Humanoid, Minotaur | 牛のような人型生物
Humanoid, Orc | ゴブリンより大柄で強い種
Insects, Beetles | 蟲類（甲虫類）
Insects, Spiders | クモ
NPC, Dwarves | エールを溺愛し背は低くずんぐりした一族で素晴らしき武具の造り手
NPC, Elves | 美や詩歌そして芸術に彩られた優雅な一族
NPC, Gnomes | ノームはドワーフより小さく、奇妙な道具の発明家である
NPC, Half-Elves | 人間とエルフの親から生まれた混種
NPC, Half-Orcs | 人間とオークの親を持つ混種
NPC, Halflings | 楽天的な小人族
NPC, Humans | 人間
Other Creatures | その他の分類できないクリーチャー
Planar, Celestial | 善なる異次元に住むクリーチャー
Planar, Fiendish | 邪悪なる異次元（Nine HellsとAbyss）に住む極悪非道なクリーチャー
Planar, Imps | Nine Hellsの有害なクリーチャー
Planar, Other | その他の異次元のクリーチャー
Planar, Slaad | スラード（蛙に似た人型生物）
Shape Changers | 変身生物（ライカンスロープやドッペルゲンガー）
Summoned Creatures | 魔法により召還されるクリーチャー
Undead, Ghoul | 死肉を食らうアンデッドクリーチャー
Undead, Mummy | 儀式により埋葬され操られし死体
Undead, Other | アンデッド（生きる死人）
Undead, Shadow | シャドーは闇に潜むクリーチャーで、生命や光をはげしく嫌っている。彼らに触られると虚無の悪寒を感じる、とても危険な相手だ
Undead, Skeleton | 死者の骨から造られたアンデッドクリーチャー
Undead, Wraith | 悪意が具現化したアンデッド
Undead, Zombie | 蘇えらされ操られし死体

JP team: geshi, Rainie


Resource.Creatures - Animals, Bears

Home > Reference > Resources > Creatures > Animals, Bears

Animals, Bears (野獣、クマ)

クマ

Bears.

Creatures

Creatures | CR | ResRef | Tag
エンシェント・ダイアベア | 15 |  | NW_BEARDIREBOSS
ブラックベア | 2 | nw_bearblck | NW_BEARBLCK
ブラウンベア | 5 | nw_bearbrwn | NW_BEARBRWN
ダイアベア | 9 | nw_beardire | NW_BEARDIRE
グリズリーベア | 6 |  | NW_BEARKODIAK
ポーラーベア | 6 | nw_bearpolar | NW_BEARPOLAR

JP team: geshi


Resource.Creatures - Animals, Birds

Home > Reference > Resources > Creatures > Animals, Birds

Animals, Birds (野獣、鳥類)

鳥類

Birds.

Creatures

Creatures | CR | ResRef | Tag
ニワトリ | 1/4 | nw_chicken | NW_CHICKEN
ハヤブサ | 1/3 |  | NW_RAPTOR001
ホーク |  | nw_raptor |
レイヴン | 1/3 | nw_raven | NW_RAVEN

JP team: geshi


Resource.Creatures - Animals, Canine

Home > Reference > Resources > Creatures > Animals, Canine

Animals, Canine (野獣、イヌ系)

イヌ

Canine (dog).

Creatures

Creatures | CR | ResRef | Tag
ダイアウルフ | 5 | nw_direwolf | NW_DIREWOLF
イヌ | 1 | nw_dog | NW_DOG
群れのリーダー | 11 |  | NW_WOLFDIREBOSS
ウィンターウルフ | 5 | nw_wolfwint | NW_WOLFWINT
ウルフ | 1 | nw_wolf | NW_WOLF
ウォーグ | 3 | nw_worg | NW_WORG

JP team: geshi


Resource.Creatures - Animals, Feline

Home > Reference > Resources > Creatures > Animals, Feline

Animals, Feline (野獣、ネコ系)

ネコ

Feline (cat).

Creatures

Creatures | CR | ResRef | Tag
クーガー | 2 | nw_cougar | NW_COUGAR
クラッグ・キャット | 2 | nw_cragcat | NW_CRAGCAT
ダイアタイガー | 11 | nw_diretiger | NW_DIRETIGER
ジャガー | 3 | nw_jaguar | NW_JAGUAR
レオパード | 2 | nw_cat | NW_CAT
ライオン | 3 | nw_lion | NW_LION
マラー・パンサー | 7 |  | NW_BEASTMALAR001
パンサー | 2 | nw_panther | NW_PANTHER

JP team: geshi


Resource.Creatures - Animals, Other

Home > Reference > Resources > Creatures > Animals, Other

Animals, Other (野獣、その他)

その他の動物

Other unclassified animals.

Creatures

Creatures | CR | ResRef | Tag
バッジャー | 1/2 | nw_badger | NW_BADGER
バット | 1/3 | nw_bat | NW_BAT
ボアー | 2 | nw_boar | NW_BOAR
ウシ | 1/6 | nw_cow | NW_COW
シカ | 1/3 | nw_deer | NW_DEER
バイアバッジャー | 3 | nw_direbadg | NW_DIREBADG
ダイアボアー | 5 | nw_boardire | NW_BOARDIRE
ダイアラット | 1/3 | nw_ratdire001 | NW_RATDIRE001
雄牛 | 1/2 | nw_ox | NW_OX
ラット | 1/8 | nw_rat001 | NW_RAT001
白シカ | 1/3 | nw_deerstag | NW_DEERSTAG

JP team: geshi


Resource.Creatures - Companion Creatures

Home > Reference > Resources > Creatures > Companion Creatures

Companion Creatures (アニマルコンパニオン)

ドルイドとレンジャーのアニマルコンパニオン

Druid's or ranger's animal companions.

Creatures

Creatures | ResRef | Tag
バッジャー・コンパニオン | nw_ac_badger01 |
バッジャー・コンパニオン | nw_ac_badger02 |
バッジャー・コンパニオン | nw_ac_badger03 |
バッジャー・コンパニオン | nw_ac_badger04 |
バッジャー・コンパニオン | nw_ac_badger05 |
バッジャー・コンパニオン | nw_ac_badger06 |
バッジャー・コンパニオン | nw_ac_badger07 |
バッジャー・コンパニオン | nw_ac_badger08 |
バッジャー・コンパニオン | nw_ac_badger09 |
バッジャー・コンパニオン | nw_ac_badger10 |
バッジャー・コンパニオン | nw_ac_badger11 |
バッジャー・コンパニオン | nw_ac_badger12 |
バッジャー・コンパニオン | nw_ac_badger13 |
バッジャー・コンパニオン | nw_ac_badger14 |
バッジャー・コンパニオン | nw_ac_badger15 |
バッジャー・コンパニオン | nw_ac_badger16 |
バッジャー・コンパニオン | nw_ac_badger17 |
バッジャー・コンパニオン | nw_ac_badger18 |
バッジャー・コンパニオン | nw_ac_badger19 |
バッジャー・コンパニオン | nw_ac_badger20 |
ブラウンベア・コンパニオン | nw_ac_bear01 |
ブラウンベア・コンパニオン | nw_ac_bear02 |
ブラウンベア・コンパニオン | nw_ac_bear03 |
ブラウンベア・コンパニオン | nw_ac_bear04 |
ブラウンベア・コンパニオン | nw_ac_bear05 |
ブラウンベア・コンパニオン | nw_ac_bear06 |
ブラウンベア・コンパニオン | nw_ac_bear07 |
ブラウンベア・コンパニオン | nw_ac_bear08 |
ブラウンベア・コンパニオン | nw_ac_bear09 |
ブラウンベア・コンパニオン | nw_ac_bear10 |
ブラウンベア・コンパニオン | nw_ac_bear11 |
ブラウンベア・コンパニオン | nw_ac_bear12 |
ブラウンベア・コンパニオン | nw_ac_bear13 |
ブラウンベア・コンパニオン | nw_ac_bear14 |
ブラウンベア・コンパニオン | nw_ac_bear15 |
ブラウンベア・コンパニオン | nw_ac_bear16 |
ブラウンベア・コンパニオン | nw_ac_bear17 |
ブラウンベア・コンパニオン | nw_ac_bear18 |
ブラウンベア・コンパニオン | nw_ac_bear19 |
ブラウンベア・コンパニオン | nw_ac_bear20 |
ダイアボアー・コンパニオン | nw_ac_boar01 |
ダイアボアー・コンパニオン | nw_ac_boar02 |
ダイアボアー・コンパニオン | nw_ac_boar03 |
ダイアボアー・コンパニオン | nw_ac_boar04 |
ダイアボアー・コンパニオン | nw_ac_boar05 |
ダイアボアー・コンパニオン | nw_ac_boar06 |
ダイアボアー・コンパニオン | nw_ac_boar07 |
ダイアボアー・コンパニオン | nw_ac_boar08 |
ダイアボアー・コンパニオン | nw_ac_boar09 |
ダイアボアー・コンパニオン | nw_ac_boar10 |
ダイアボアー・コンパニオン | nw_ac_boar11 |
ダイアボアー・コンパニオン | nw_ac_boar12 |
ダイアボアー・コンパニオン | nw_ac_boar13 |
ダイアボアー・コンパニオン | nw_ac_boar14 |
ダイアボアー・コンパニオン | nw_ac_boar15 |
ダイアボアー・コンパニオン | nw_ac_boar16 |
ダイアボアー・コンパニオン | nw_ac_boar17 |
ダイアボアー・コンパニオン | nw_ac_boar18 |
ダイアボアー・コンパニオン | nw_ac_boar19 |
ダイアボアー・コンパニオン | nw_ac_boar20 |
ダイアウルフ・コンパニオン | nw_ac_dwlf01 |
ダイアウルフ・コンパニオン | nw_ac_dwlf02 |
ダイアウルフ・コンパニオン | nw_ac_dwlf03 |
ダイアウルフ・コンパニオン | nw_ac_dwlf04 |
ダイアウルフ・コンパニオン | nw_ac_dwlf05 |
ダイアウルフ・コンパニオン | nw_ac_dwlf06 |
ダイアウルフ・コンパニオン | nw_ac_dwlf07 |
ダイアウルフ・コンパニオン | nw_ac_dwlf08 |
ダイアウルフ・コンパニオン | nw_ac_dwlf09 |
ダイアウルフ・コンパニオン | nw_ac_dwlf10 |
ダイアウルフ・コンパニオン | nw_ac_dwlf11 |
ダイアウルフ・コンパニオン | nw_ac_dwlf12 |
ダイアウルフ・コンパニオン | nw_ac_dwlf13 |
ダイアウルフ・コンパニオン | nw_ac_dwlf14 |
ダイアウルフ・コンパニオン | nw_ac_dwlf15 |
ダイアウルフ・コンパニオン | nw_ac_dwlf16 |
ダイアウルフ・コンパニオン | nw_ac_dwlf17 |
ダイアウルフ・コンパニオン | nw_ac_dwlf18 |
ダイアウルフ・コンパニオン | nw_ac_dwlf19 |
ダイアウルフ・コンパニオン | nw_ac_dwlf20 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid01 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid02 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid03 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid04 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid05 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid06 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid07 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid08 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid09 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid10 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid11 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid12 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid13 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid14 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid15 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid16 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid17 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid18 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid19 |
ジャイアントスパイダー・コンパニオン | nw_ac_spid20 |
ホーク・コンパニオン | nw_ac_hawk01 |
ホーク・コンパニオン | nw_ac_hawk02 |
ホーク・コンパニオン | nw_ac_hawk03 |
ホーク・コンパニオン | nw_ac_hawk04 |
ホーク・コンパニオン | nw_ac_hawk05 |
ホーク・コンパニオン | nw_ac_hawk06 |
ホーク・コンパニオン | nw_ac_hawk07 |
ホーク・コンパニオン | nw_ac_hawk08 |
ホーク・コンパニオン | nw_ac_hawk09 |
ホーク・コンパニオン | nw_ac_hawk10 |
ホーク・コンパニオン | nw_ac_hawk11 |
ホーク・コンパニオン | nw_ac_hawk12 |
ホーク・コンパニオン | nw_ac_hawk13 |
ホーク・コンパニオン | nw_ac_hawk14 |
ホーク・コンパニオン | nw_ac_hawk15 |
ホーク・コンパニオン | nw_ac_hawk16 |
ホーク・コンパニオン | nw_ac_hawk17 |
ホーク・コンパニオン | nw_ac_hawk18 |
ホーク・コンパニオン | nw_ac_hawk19 |
ホーク・コンパニオン | nw_ac_hawk20 |
パンサー・コンパニオン | nw_ac_pant01 |
パンサー・コンパニオン | nw_ac_pant02 |
パンサー・コンパニオン | nw_ac_pant03 |
パンサー・コンパニオン | nw_ac_pant04 |
パンサー・コンパニオン | nw_ac_pant05 |
パンサー・コンパニオン | nw_ac_pant06 |
パンサー・コンパニオン | nw_ac_pant07 |
パンサー・コンパニオン | nw_ac_pant08 |
パンサー・コンパニオン | nw_ac_pant09 |
パンサー・コンパニオン | nw_ac_pant10 |
パンサー・コンパニオン | nw_ac_pant11 |
パンサー・コンパニオン | nw_ac_pant12 |
パンサー・コンパニオン | nw_ac_pant13 |
パンサー・コンパニオン | nw_ac_pant14 |
パンサー・コンパニオン | nw_ac_pant15 |
パンサー・コンパニオン | nw_ac_pant16 |
パンサー・コンパニオン | nw_ac_pant17 |
パンサー・コンパニオン | nw_ac_pant18 |
パンサー・コンパニオン | nw_ac_pant19 |
パンサー・コンパニオン | nw_ac_pant20 |
ウルフ・コンパニオン | nw_ac_wolf01 |
ウルフ・コンパニオン | nw_ac_wolf02 |
ウルフ・コンパニオン | nw_ac_wolf03 |
ウルフ・コンパニオン | nw_ac_wolf04 |
ウルフ・コンパニオン | nw_ac_wolf05 |
ウルフ・コンパニオン | nw_ac_wolf06 |
ウルフ・コンパニオン | nw_ac_wolf07 |
ウルフ・コンパニオン | nw_ac_wolf08 |
ウルフ・コンパニオン | nw_ac_wolf09 |
ウルフ・コンパニオン | nw_ac_wolf10 |
ウルフ・コンパニオン | nw_ac_wolf11 |
ウルフ・コンパニオン | nw_ac_wolf12 |
ウルフ・コンパニオン | nw_ac_wolf13 |
ウルフ・コンパニオン | nw_ac_wolf14 |
ウルフ・コンパニオン | nw_ac_wolf15 |
ウルフ・コンパニオン | nw_ac_wolf16 |
ウルフ・コンパニオン | nw_ac_wolf17 |
ウルフ・コンパニオン | nw_ac_wolf18 |
ウルフ・コンパニオン | nw_ac_wolf19 |
ウルフ・コンパニオン | nw_ac_wolf20 |

JP team: geshi


Resource.Creatures - Constructs

Home > Reference > Resources > Creatures > Constructs

Constructs (人造)

魔法によって、操られた/作られた物

Magically animated/created constructs.

Creatures

Creatures | CR | ResRef | Tag
バトルホラー | 13 | nw_bathorror | NW_BATHORROR
ボーンゴーレム | 11 | nw_golbone | NW_GolBone
クレイゴーレム | 10 | nw_golclay | NW_GolClay
フレッシュゴーレム | 8 | nw_golflesh | NW_GOLFLESH
ヘルムドホラー | 11 | nw_helmhorr | NW_HELMHORR
アイアンゴーレム | 16 | nw_goliron | NW_GOLIRON
ミノゴン | 8 | nw_minogon | NW_MINOGON
シールゴガーティアン | 13 | nw_shguard | NW_SHGUARD
ストーンゴーレム | 12 | nw_golstone | NW_GOLSTONE

JP team: geshi


Resource.Creatures - Dragons

Home > Reference > Resources > Creatures > Dragons

Dragons (ドラゴン)

ドラゴン

Dragons.

Creatures

Creatures | CR | ResRef | Tag
アダルト・ブラックドラゴン | 13 | nw_drgblack001 | NW_DRGBLACK001
アダルト・ブルードラゴン | 14 | nw_drgblue001 | NW_DRGBLUE001
アダルト・ブラスドラゴン | 13 | nw_drgbrass001 | NW_DRGBRASS001
アダルト・ブロンズドラゴン | 15 | nw_drgbrnz001 | NW_DRGBRNZ001
アダルト・カッパードラゴン | 14 | nw_drgcopp001 | NW_DRGCOPP001
アダルト・ゴールドドラゴン | 16 | nw_drggold001 | NW_DRGGOLD001
アダルト・グリーンドラゴン | 14 | nw_drggreen001 | NW_DRGGREEN001
アダルト・レッドドラゴン | 15 | nw_drgred001 | NW_DRGRED001
アダルト・シルバードラゴン | 16 | nw_drgsilv001 | NW_DRGSILV001
アダルト・ホワイトドラゴン | 12 | nw_drgwhite001 | NW_DRGWHITE001
エンシェント・ブラックドラゴン | 21 | nw_drgblack003 | NW_DRGBLACK003
エンシェント・ブルードラゴン | 23 | nw_drgblue003 | NW_DRGBLUE003
エンシェント・ブラスドラゴン | 22 | nw_drgbrass003 | NW_DRGBRASS003
エンシェント・ブロンズドラゴン | 23 | nw_drgbrnz003 | NW_DRGBRNZ003
エンシェント・カッパードラゴン | 22 | nw_drgcopp003 | NW_DRGCOPP003
エンシェント・ゴールドドラゴン | 25 | nw_drggold003 | NW_DRGGOLD003
エンシェント・グリーンドラゴン | 22 | nw_drggreen003 | NW_DRGGREEN003
エンシェント・レッドドラゴン | 24 | nw_drgred003 | NW_DRGRED003
エンシェント・シルバードラゴン | 24 | nw_drgsilv003 | NW_DRGSILV003
エンシェント・ホワイトドラゴン | 20 | nw_drgwhite003 | NW_DRGWHITE003
ハーフドラゴン・クレリック | 8 | nw_halfdra002 | NW_HALFDRA002
ハーフドラゴン・ソーサラー | 9 | nw_halfdra001 | NW_HALFDRA001
オールド・ブラックドラゴン | 17 | nw_drgblack002 | NW_DRGBLACK002
オールド・ブルードラゴン | 18 | nw_drgblue002 | NW_DRGBLUE002
オールド・ブラスドラゴン | 17 | nw_drgbrass002 | NW_DRGBRASS002
オールド・ブロンズドラゴン | 19 | nw_drgbrnz002 | NW_DRGBRNZ002
オールド・カッパードラゴン | 18 | nw_drgcopp002 | NW_DRGCOPP002
オールド・ゴールドドラゴン | 21 | nw_drggold002 | NW_DRGGOLD002
オールド・グリーンドラゴン | 18 | nw_drggreen002 | NW_DRGGREEN002
オールド・レッドドラゴン | 19 | nw_drgred002 | NW_DRGRED002
オールド・シルバードラゴン | 20 | nw_drgsilv002 | NW_DRGSILV002
オールド・ホワイトドラゴン | 16 | nw_drgwhite002 | NW_DRGWHITE002

JP team: geshi


Resource.Creatures - Elementals

Home > Reference > Resources > Creatures > Elementals

Elementals (エレメンタル)

エレメンタル（召喚された世界の物質により成り立つ存在）

Elementals (beings composed of material from the plane from which they were summoned).

Creatures

Creatures | CR | ResRef | Tag
エアーエレメンタル | 4 | nw_air | NW_AIR
ベルケール（Belker） |  | nw_belker |
アースエレメンタル | 4 | nw_earth | NW_Earth
エルダー・エアーエレメンタル | 20 | nw_airelder | NW_AIRELDER
エルダー・アースエレメンタル | 17 | nw_eartheld | NW_EARTHELD
エルダー・ファイアーエレメンタル | 17 | nw_fireelder | NW_FIREELDER
エルダー・ウォーターエレメンタル | 16 |  | NW_WATELDER
ファイアーエレメンタル | 3 | nw_fire | NW_FIRE
グレーター・エアーエレメンタル | 18 | nw_airgreat | NW_AIRGREAT
グレーター・アースエレメンタル | 15 | nw_earthgreat | NW_EARTHGREAT
グレーター・ファイアーエレメンタル | 15 | nw_firegreat | NW_FIREGREAT
グレーター・ウォーターエレメンタル | 14 | nw_watergreat | NW_WATERGREAT
ヒュージ・エアーエレメンタル | 13 | nw_airhuge | NW_AIRHUGE
ヒュージ・アースエレメンタル | 11 | nw_earthhuge | NW_EARTHHUGE
ヒュージ・ファイアーエレメンタル | 12 | nw_firehuge | NW_FIREHUGE
ヒュージ・ウォーターエレメンタル | 11 | nw_waterhuge | NW_WATERHUGE
インヴィジブルストーカー | 6 | nw_invstalk | NW_INVSTALK
ウォーターエレメンタル | 4 | nw_water | NW_WATER

JP team: geshi


Resource.Creatures - Familiars

Home > Reference > Resources > Creatures > Familiars

Familiars (ファミリアー)

ウィザードとソーサラーの使い魔

Wizard's and sorcerer's familiars.

Creatures

Creatures | ResRef | Tag
バット・ファミリアー | nw_fm_bat01 |
バット・ファミリアー | nw_fm_bat02 |
バット・ファミリアー | nw_fm_bat03 |
バット・ファミリアー | nw_fm_bat04 |
バット・ファミリアー | nw_fm_bat05 |
バット・ファミリアー | nw_fm_bat06 |
バット・ファミリアー | nw_fm_bat07 |
バット・ファミリアー | nw_fm_bat08 |
バット・ファミリアー | nw_fm_bat09 |
バット・ファミリアー | nw_fm_bat10 |
バット・ファミリアー | nw_fm_bat11 |
バット・ファミリアー | nw_fm_bat12 |
バット・ファミリアー | nw_fm_bat13 |
バット・ファミリアー | nw_fm_bat14 |
バット・ファミリアー | nw_fm_bat15 |
バット・ファミリアー | nw_fm_bat16 |
バット・ファミリアー | nw_fm_bat17 |
バット・ファミリアー | nw_fm_bat18 |
バット・ファミリアー | nw_fm_bat19 |
バット・ファミリアー | nw_fm_bat20 |
パンサー・ファミリアー（Crag Cat Familiar） | nw_fm_crag01 |
パンサー・ファミリアー | nw_fm_crag02 |
パンサー・ファミリアー | nw_fm_crag03 |
パンサー・ファミリアー | nw_fm_crag04 |
パンサー・ファミリアー | nw_fm_crag05 |
パンサー・ファミリアー | nw_fm_crag06 |
パンサー・ファミリアー | nw_fm_crag07 |
パンサー・ファミリアー | nw_fm_crag08 |
パンサー・ファミリアー | nw_fm_crag09 |
パンサー・ファミリアー | nw_fm_crag10 |
パンサー・ファミリアー | nw_fm_crag11 |
パンサー・ファミリアー | nw_fm_crag12 |
パンサー・ファミリアー | nw_fm_crag13 |
パンサー・ファミリアー | nw_fm_crag14 |
パンサー・ファミリアー | nw_fm_crag15 |
パンサー・ファミリアー | nw_fm_crag16 |
パンサー・ファミリアー | nw_fm_crag17 |
パンサー・ファミリアー | nw_fm_crag18 |
パンサー・ファミリアー | nw_fm_crag19 |
パンサー・ファミリアー | nw_fm_crag20 |
ファイアーメフィット・ファミリアー | nw_fm_fire01 |
ファイアーメフィット・ファミリアー | nw_fm_fire02 |
ファイアーメフィット・ファミリアー | nw_fm_fire03 |
ファイアーメフィット・ファミリアー | nw_fm_fire04 |
ファイアーメフィット・ファミリアー | nw_fm_fire05 |
ファイアーメフィット・ファミリアー | nw_fm_fire06 |
ファイアーメフィット・ファミリアー | nw_fm_fire07 |
ファイアーメフィット・ファミリアー | nw_fm_fire08 |
ファイアーメフィット・ファミリアー | nw_fm_fire09 |
ファイアーメフィット・ファミリアー | nw_fm_fire10 |
ファイアーメフィット・ファミリアー | nw_fm_fire11 |
ファイアーメフィット・ファミリアー | nw_fm_fire12 |
ファイアーメフィット・ファミリアー | nw_fm_fire13 |
ファイアーメフィット・ファミリアー | nw_fm_fire14 |
ファイアーメフィット・ファミリアー | nw_fm_fire15 |
ファイアーメフィット・ファミリアー | nw_fm_fire16 |
ファイアーメフィット・ファミリアー | nw_fm_fire17 |
ファイアーメフィット・ファミリアー | nw_fm_fire18 |
ファイアーメフィット・ファミリアー | nw_fm_fire19 |
ファイアーメフィット・ファミリアー | nw_fm_fire20 |
ヘルハウンド・ファミリアー | nw_fm_hell01 |
ヘルハウンド・ファミリアー | nw_fm_hell02 |
ヘルハウンド・ファミリアー | nw_fm_hell03 |
ヘルハウンド・ファミリアー | nw_fm_hell04 |
ヘルハウンド・ファミリアー | nw_fm_hell05 |
ヘルハウンド・ファミリアー | nw_fm_hell06 |
ヘルハウンド・ファミリアー | nw_fm_hell07 |
ヘルハウンド・ファミリアー | nw_fm_hell08 |
ヘルハウンド・ファミリアー | nw_fm_hell09 |
ヘルハウンド・ファミリアー | nw_fm_hell10 |
ヘルハウンド・ファミリアー | nw_fm_hell11 |
ヘルハウンド・ファミリアー | nw_fm_hell12 |
ヘルハウンド・ファミリアー | nw_fm_hell13 |
ヘルハウンド・ファミリアー | nw_fm_hell14 |
ヘルハウンド・ファミリアー | nw_fm_hell15 |
ヘルハウンド・ファミリアー | nw_fm_hell16 |
ヘルハウンド・ファミリアー | nw_fm_hell17 |
ヘルハウンド・ファミリアー | nw_fm_hell18 |
ヘルハウンド・ファミリアー | nw_fm_hell19 |
ヘルハウンド・ファミリアー | nw_fm_hell20 |
アイスメフィット・ファミリアー | nw_fm_ice01 |
アイスメフィット・ファミリアー | nw_fm_ice02 |
アイスメフィット・ファミリアー | nw_fm_ice03 |
アイスメフィット・ファミリアー | nw_fm_ice04 |
アイスメフィット・ファミリアー | nw_fm_ice05 |
アイスメフィット・ファミリアー | nw_fm_ice06 |
アイスメフィット・ファミリアー | nw_fm_ice07 |
アイスメフィット・ファミリアー | nw_fm_ice08 |
アイスメフィット・ファミリアー | nw_fm_ice09 |
アイスメフィット・ファミリアー | nw_fm_ice10 |
アイスメフィット・ファミリアー | nw_fm_ice11 |
アイスメフィット・ファミリアー | nw_fm_ice12 |
アイスメフィット・ファミリアー | nw_fm_ice13 |
アイスメフィット・ファミリアー | nw_fm_ice14 |
アイスメフィット・ファミリアー | nw_fm_ice15 |
アイスメフィット・ファミリアー | nw_fm_ice16 |
アイスメフィット・ファミリアー | nw_fm_ice17 |
アイスメフィット・ファミリアー | nw_fm_ice18 |
アイスメフィット・ファミリアー | nw_fm_ice19 |
アイスメフィット・ファミリアー | nw_fm_ice20 |
インプ・ファミリアー | nw_fm_imp01 |
インプ・ファミリアー | nw_fm_imp02 |
インプ・ファミリアー | nw_fm_imp03 |
インプ・ファミリアー | nw_fm_imp04 |
インプ・ファミリアー | nw_fm_imp05 |
インプ・ファミリアー | nw_fm_imp06 |
インプ・ファミリアー | nw_fm_imp07 |
インプ・ファミリアー | nw_fm_imp08 |
インプ・ファミリアー | nw_fm_imp09 |
インプ・ファミリアー | nw_fm_imp10 |
インプ・ファミリアー | nw_fm_imp11 |
インプ・ファミリアー | nw_fm_imp12 |
インプ・ファミリアー | nw_fm_imp13 |
インプ・ファミリアー | nw_fm_imp14 |
インプ・ファミリアー | nw_fm_imp15 |
インプ・ファミリアー | nw_fm_imp16 |
インプ・ファミリアー | nw_fm_imp17 |
インプ・ファミリアー | nw_fm_imp18 |
インプ・ファミリアー | nw_fm_imp19 |
インプ・ファミリアー | nw_fm_imp20 |
ピクシー・ファミリアー | nw_fm_pixi01 |
ピクシー・ファミリアー | nw_fm_pixi02 |
ピクシー・ファミリアー | nw_fm_pixi03 |
ピクシー・ファミリアー | nw_fm_pixi04 |
ピクシー・ファミリアー | nw_fm_pixi05 |
ピクシー・ファミリアー | nw_fm_pixi06 |
ピクシー・ファミリアー | nw_fm_pixi07 |
ピクシー・ファミリアー | nw_fm_pixi08 |
ピクシー・ファミリアー | nw_fm_pixi09 |
ピクシー・ファミリアー | nw_fm_pixi10 |
ピクシー・ファミリアー | nw_fm_pixi11 |
ピクシー・ファミリアー | nw_fm_pixi12 |
ピクシー・ファミリアー | nw_fm_pixi13 |
ピクシー・ファミリアー | nw_fm_pixi14 |
ピクシー・ファミリアー | nw_fm_pixi15 |
ピクシー・ファミリアー | nw_fm_pixi16 |
ピクシー・ファミリアー | nw_fm_pixi17 |
ピクシー・ファミリアー | nw_fm_pixi18 |
ピクシー・ファミリアー | nw_fm_pixi19 |
ピクシー・ファミリアー | nw_fm_pixi20 |
レイヴン・ファミリアー | nw_fm_rave01 |
レイヴン・ファミリアー | nw_fm_rave02 |
レイヴン・ファミリアー | nw_fm_rave03 |
レイヴン・ファミリアー | nw_fm_rave04 |
レイヴン・ファミリアー | nw_fm_rave05 |
レイヴン・ファミリアー | nw_fm_rave06 |
レイヴン・ファミリアー | nw_fm_rave07 |
レイヴン・ファミリアー | nw_fm_rave08 |
レイヴン・ファミリアー | nw_fm_rave09 |
レイヴン・ファミリアー | nw_fm_rave10 |
レイヴン・ファミリアー | nw_fm_rave11 |
レイヴン・ファミリアー | nw_fm_rave12 |
レイヴン・ファミリアー | nw_fm_rave13 |
レイヴン・ファミリアー | nw_fm_rave14 |
レイヴン・ファミリアー | nw_fm_rave15 |
レイヴン・ファミリアー | nw_fm_rave16 |
レイヴン・ファミリアー | nw_fm_rave17 |
レイヴン・ファミリアー | nw_fm_rave18 |
レイヴン・ファミリアー | nw_fm_rave19 |
レイヴン・ファミリアー | nw_fm_rave20 |

JP team: geshi


Resource.Creatures - Giant, Common

Home > Reference > Resources > Creatures > Giant, Common

Giant, Common (巨人、一般)

巨人、一般

Giant common humanoids.

Creatures

Creatures | CR | ResRef | Tag
エティン | 8 | nw_ettin | NW_ETTIN
ヒルジャイアント | 10 | nw_gnthill | NW_GNTHILL
マウンテンジャイアント | 10 | nw_gntmount | NW_GNTMOUNT
トロールシャーマン | 7 | nw_trollwiz | NW_TROLLWIZ

JP team: geshi


Resource.Creatures - Giant, Noble

Home > Reference > Resources > Creatures > Giant, Noble

Giant, Noble (巨人、貴族)

特定元素の力を持った巨人

Giants of a particular element.

Creatures

Creatures | CR | ResRef | Tag
ファイアージャイアント | 12 | nw_gntfire | NW_GNTFIRE
フロストジャイアント | 10 | nw_gntfrost | NW_GNTFROST

JP team: geshi


Resource.Creatures - Giant, Ogres

Home > Reference > Resources > Creatures > Giant, Ogres

Giant, Ogres (巨人、オーガ)

オーガ

Ogres.

Creatures

Creatures | CR | ResRef | Tag
オーガ | 3 | nw_ogre01 | NW_OGRE01
オーガ | 3 | nw_ogre02 | NW_OGRE02
オーガ・バーサーカー | 6 |  | NW_OGRECHIEF01
オーガ・バーサーカー | 6 |  | NW_OGRECHIEF02
オーガ・チーフテン | 9 |  | nw_ogreboss
オーガ・ハイメイジ | 18 |  | NW_OGREMAGEBOSS
オーガ・メイジ | 5 | nw_ogremage01 | NW_OGREMAGE01
オーガ・メイジ | 5 | nw_ogremage02 | NW_OGREMAGE02

JP team: geshi


Resource.Creatures - Giant, Trolls

Home > Reference > Resources > Creatures > Giant, Trolls

Giant, Trolls (巨人、トロル)

トロル

Trolls.

Creatures

Creatures | CR | ResRef | Tag
トロル | 5 | nw_troll | NW_TROLL
トロル・バーサーカー | 7 |  | NW_TROLLCHIEF
トロル・チーフテン | 9 |  | NW_TROLLBOSS

JP team: geshi


Resource.Creatures - Humanoid, Bugbears

Home > Reference > Resources > Creatures > Humanoid, Bugbears

Humanoid, Bugbears

バグベア

Creatures

Creatures | CR | ResRef | Tag
バグベア | 2 | nw_bugbeara | NW_BUGBEARA
バグベア | 2 | nw_bugbearb | NW_BUGBEARB
バグベア･チーフテン | 10 | nw_bugchiefa | nw_bugbearboss
バグベア･チーフテン |  | nw_bugchiefb |
バグベア･ヒーロー | 5 |  | NW_BUGCHIEFA
バグベア･ヒーロー | 5 |  | NW_BUGCHIEFB
バグベア･シャーマン | 4 | nw_bugwiza | NW_BUGWIZA
バグベア･シャーマン | 4 | nw_bugwizb | NW_BUGWIZB

JP team: Rainie


Resource.Creatures - Humanoid, Fey

Home > Reference > Resources > Creatures > Humanoid, Fey

Humanoid, Fey

妖精族（森の住人）

Creatures

Creatures | CR | ResRef | Tag
ドライアド | 2 | nw_dryad | NW_DRYAD
グリッグ | 2 | nw_grig | NW_GRIG
ニクシー | 1 | nw_nixie | NW_NIXIE
ニンフ | 3 | nw_nymph | NW_NYMPH
ピクシー | 2 | nw_pixie | NW_PIXIE

JP team: Rainie


Resource.Creatures - Humanoid, Gnoll

Home > Reference > Resources > Creatures > Humanoid, Gnoll

Humanoid, Gnoll

ノールは外見だけでなく、残酷で獰猛な点もハイエナによく似ている

Creatures

Creatures | CR | ResRef | Tag
ノール | 1 | nw_gnoll001 | NW_GNOLL001
ノール･シャーマン | 3 | nw_gnoll002 | NW_GNOLL002

JP team: Rainie


Resource.Creatures - Humanoid, Goblin

Home > Reference > Resources > Creatures > Humanoid, Goblin

Humanoid, Goblin

ゴブリン類

Creatures

Creatures | CR | ResRef | Tag
ゴブリン | 1/4 | nw_goblina | NW_GOBLINA
ゴブリン | 1/4 | nw_goblinb | NW_GOBLINB
ゴブリン･チーフテン | 11 | nw_gobchiefa | NW_GOBLINBOSS
ゴブリン･チーフテン | 11 | nw_gobchiefb |
ゴブリン･エリート | 4 |  | NW_GOBCHIEFA
ゴブリン･エリート | 3 |  | NW_GOBCHIEFB
ゴブリン･シャーマン | 3 | nw_gobwiza | NW_GOBWIZA
ゴブリン･シャーマン | 3 | nw_gobwizb | NW_GOBWIZB

JP team: Rainie


Resource.Creatures - Humanoid, Kobold

Home > Reference > Resources > Creatures > Humanoid, Kobold

Humanoid, Kobold

身長の低い人間型の爬虫類

Creatures

Creatures | CR | ResRef | Tag
コボルト | 1/3 |  | NW_KOBOLD001
コボルト | 1/3 |  | NW_KOBOLD002
コボルド･フットパッド | 2 |  | NW_KOBOLD004
コボルド･ヒーラー | 2 |  | NW_KOBOLD006
コボルド･シャーマン | 2 |  | NW_KOBOLD005
コボルド･サッグ | 2 |  | NW_KOBOLD003

Remarks

FootPadは「追い剥ぎ」、Thugは「暴漢」のこと。

JP team: Rainie


Resource.Creatures - Humanoid, Lizardfolk

Home > Reference > Resources > Creatures > Humanoid, Lizardfolk

Humanoid, Lizardfolk

リザードフォーク

Creatures

Creatures | CR | ResRef | Tag
リザードフォーク･チーフテン | 4 | nw_oldchiefa | NW_OLDCHIEFA
リザードフォーク･チーフテン | 4 | nw_oldchiefb | NW_OLDCHIEFB
リザードフォーク･シャーマン | 4 | nw_oldmagea | NW_OLDMAGEA
リザードフォーク･シャーマン | 4 | nw_oldmageb | NW_OLDMAGEB
リザードフォーク･ウォーリアー | 2 | nw_oldwarb | NW_OLDWARB
リザードフォーク･ウォーリアー | 2 | nw_oldwarra | NW_OLDWARRA
ユアン-ティ | 5 |  | NW_YUAN_TI001
ユアン-ティ･チーフテン |  | nw_yuanchief |
ユアン-ティ･エヴォーカー |  | nw_yuanevok |
ユアン-ティ･ネクロマンサー |  | nw_yuannecro |
ユアン-ティ･ネクロマンサー |  | nw_yuan_ti001 |
ユアン-ティ･プリースト | 6 |  | NW_YUAN_TI003
ユアン-ティ･ソーサラー | 5 |  | NW_YUAN_TI002

JP team: Rainie


Resource.Creatures - Humanoid, Minotaur

Home > Reference > Resources > Creatures > Humanoid, Minotaur

Humanoid, Minotaur

牛のような人型生物

Creatures

Creatures | CR | ResRef | Tag
ミノタウロス | 4 | nw_minotaur | NW_MINOTAUR
ミノタウロス･バーサーカー | 8 |  | NW_MinChief
ミノタウロス･チーフテン | 13 |  | NW_MINOTAURBOSS
ミノタウロス･シャーマン | 9 | nw_minwiz | NW_MINWIZ

JP team: Rainie


Resource.Creatures - Humanoid, Orc

Home > Reference > Resources > Creatures > Humanoid, Orc

Humanoid, Orc

ゴブリンより大柄で強い種

Creatures

Creatures | CR | ResRef | Tag
オーク | 1/4 | nw_orca | NW_ORCA
オーク | 1/4 | nw_orcb | NW_ORCB
オーク･チャンピオン | 3 |  | NW_OrcChiefA
オーク･チャンピオン | 3 |  | NW_ORCCHIEFB
オーク･チーフテン | 10 |  | nw_orcboss
オーク･シャーマン | 4 | nw_orcwiza | NW_ORCWIZA
オーク･シャーマン | 4 | nw_orcwizb | NW_ORCWIZB

JP team: Rainie


Resource.Creatures - Insects, Beetles

Home > Reference > Resources > Creatures > Insects, Beetles

Insects, Beetles

蟲類（甲虫類）

Creatures

Creatures | CR | ResRef | Tag
ボンバディエ･ビートル | 3 | nw_btlbomb | NW_BTLBOMB
ファイアー･ビートル | 1/4 | nw_btlfire | NW_BTLFIRE
ハイブ･マザー | 16 |  | nw_beetleboss
スピッティング･ファイアー･ビートル | 3 |  | NW_BTLFIRE02
スタグ･ビートル | 7 | nw_btlstag | NW_BTLSTAG
スティンク･ビートル | 3 | nw_btlstink | NW_BTLSTINK

JP team: Rainie


Resource.Creatures - Insects, Spiders

Home > Reference > Resources > Creatures > Insects, Spiders

Insects, Spiders

クモ

Creatures

Creatures | CR | ResRef | Tag
ダイアスパイダー | 7 | nw_spiddire | NW_SPIDDIRE
ジャイアントスパイダー | 3 | nw_spidgiant | NW_SPIDGIANT
フェーズスパイダー | 3 | nw_spidphase | NW_SPIDPHASE
クィーンスパイダー | 14 |  | NW_SPIDERBOSS
ソードスパイダー | 4 | nw_spidswrd | NW_SPIDSWRD
レイススパイダー | 4 | nw_spidwra | NW_SPIDWRA

JP team: Rainie


Resource.Creatures - NPC, Dwarves

Home > Reference > Resources > Creatures > NPC, Dwarves

NPC, Dwarves

エールを溺愛し背は低くずんぐりした一族で素晴らしき武具の造り手

Creatures

Creatures | CR | ResRef | Tag
デュエルガー･クレリック | 1 | nw_duecler001 | NW_DUECLER001
デュエルガー･クレリック | 4 | nw_duecler005 | NW_DUECLER005
デュエルガー･クレリック | 8 | nw_duecler010 | NW_DUECLER010
デュエルガー･クレリック | 11 | nw_duecler015 | NW_DUECLER015
デュエルガー･クレリック | 15 | nw_duecler020 | NW_DUECLER020
デュエルガー･メイジ | 1 | nw_duemage001 | NW_DUEMAGE001
デュエルガー･メイジ | 4 | nw_duemage005 | NW_DUEMAGE005
デュエルガー･メイジ | 7 | nw_duemage010 | NW_DUEMAGE010
デュエルガー･メイジ | 11 | nw_duemage015 | NW_DUEMAGE015
デュエルガー･メイジ | 14 | nw_duemage020 | NW_DUEMAGE020
デュエルガー･ローグ | 1 | nw_duerogue001 | NW_DUEROGUE001
デュエルガー･ローグ | 4 | nw_duerogue005 | NW_DUEROGUE005
デュエルガー･ローグ | 7 | nw_duerogue010 | NW_DUEROGUE010
デュエルガー･ローグ | 10 | nw_duerogue015 | NW_DUEROGUE015
デュエルガー･ローグ | 13 | nw_duerogue020 | NW_DUEROGUE020
デュエルガー･ウォリアー | 1 | nw_duefight001 | NW_DUEFIGHT001
デュエルガー･ウォリアー | 4 | nw_duefight005 | NW_DUEFIGHT005
デュエルガー･ウォリアー | 7 | nw_duefight010 | NW_DUEFIGHT010
デュエルガー･ウォリアー | 11 | nw_duefight015 | NW_DUEFIGHT015
デュエルガー･ウォリアー | 14 | nw_duefight020 | NW_DUEFIGHT020
ドワーフ･マーシナリー | 1/2 | nw_dwarfmerc001 | NW_DWARFMERC001
ドワーフ･マーシナリー | 13 | nw_dwarfmerc006 | NW_DWARFMERC006
ドワーフ･マーシナリー | 2 | nw_dwarfmerc002 | NW_DWARFMERC002
ドワーフ･マーシナリー | 4 | nw_dwarfmerc003 | NW_DWARFMERC003
ドワーフ･マーシナリー | 7 | nw_dwarfmerc004 | NW_DWARFMERC004
ドワーフ･マーシナリー | 9 | nw_dwarfmerc005 | NW_DWARFMERC005

JP team: Rainie


Resource.Creatures - NPC, Elves

Home > Reference > Resources > Creatures > NPC, Elves

NPC, Elves

美や詩歌そして芸術に彩られた優雅な一族

Creatures

Creatures | CR | ResRef | Tag
ドロウ･アサシン | 1 | nw_drowrogue001 | NW_DROWROGUE001
ドロウ･アサシン | 3 | nw_drowrogue005 | NW_DROWROGUE005
ドロウ･アサシン | 7 | nw_drowrogue010 | NW_DROWROGUE010
ドロウ･アサシン | 10 | nw_drowrogue015 | NW_DROWROGUE015
ドロウ･アサシン | 13 | nw_drowrogue020 | NW_DROWROGUE020
ドロウ･メイジ | 1 | nw_drowmage001 | NW_DROWMAGE001
ドロウ･メイジ | 4 | nw_drowmage005 | NW_DROWMAGE005
ドロウ･メイジ | 7 | nw_drowmage010 | NW_DROWMAGE010
ドロウ･メイジ | 11 | nw_drowmage015 | NW_DROWMAGE015
ドロウ･メイジ | 14 | nw_drowmage020 | NW_DROWMAGE020
ドロウ | 1 | nw_drowfight001 | NW_DROWFIGHT001
ドロウ | 4 | nw_drowfight005 | NW_DROWFIGHT005
ドロウ | 8 | nw_drowfight010 | NW_DROWFIGHT010
ドロウ | 11 | nw_drowfight015 | NW_DROWFIGHT015
ドロウ | 15 | nw_drowfight020 | NW_DROWFIGHT020
ドロウ･プリーステス | 1 | nw_drowcler001 | NW_DROWCLER001
ドロウ･プリーステス | 4 | nw_drowcler005 | NW_DROWCLER005
ドロウ･プリーステス | 8 | nw_drowcler010 | NW_DROWCLER010
ドロウ･プリーステス | 11 | nw_drowcler015 | NW_DROWCLER015
ドロウ･プリーステス | 15 | nw_drowcler020 | NW_DROWCLER020
エルフ･メイジ | 1/2 | nw_elfmage001 | NW_ELFMAGE001
エルフ･メイジ | 4 | nw_elfmage005 | NW_ELFMAGE005
エルフ･メイジ | 11 | nw_elfmage015 | NW_ELFMAGE015
エルフ･マーシナリー | 2 | nw_elfmerc001 | NW_ELFMERC001
エルフ･マーシナリー | 4 | nw_elfmerc002 | NW_ELFMERC002
エルフ･マーシナリー | 6 | nw_elfmerc003 | NW_ELFMERC003
エルフ･マーシナリー | 9 | nw_elfmerc004 | NW_ELFMERC004
エルフ･マーシナリー | 11 | nw_elfmerc005 | NW_ELFMERC005
エルフ･マーシナリー | 14 | nw_elfmerc006 | NW_ELFMERC006
エルフ･レンジャー | 1/2 | nw_elfranger001 | NW_ELFRANGER001
エルフ･レンジャー | 4 | nw_elfranger005 | NW_ELFRANGER005
エルフ･レンジャー | 11 | nw_elfranger015 | NW_ELFRANGER015

JP team: Rainie


Resource.Creatures - NPC, Gnomes

Home > Reference > Resources > Creatures > NPC, Gnomes

NPC, Gnomes

ノームはドワーフより小さく、奇妙な道具の発明家である

Creatures

Creatures ResRef Tag

JP team: Rainie


Resource.Creatures - NPC, Half-Elves

Home > Reference > Resources > Creatures > NPC, Half-Elves

NPC, Half-Elves

人間とエルフの親から生まれた混種

Creatures

Creatures ResRef Tag

JP team: Rainie


Resource.Creatures - NPC, Halflings

Home > Reference > Resources > Creatures > NPC, Halflings

NPC, Halflings

楽天的な小人族

Creatures

Creatures | CR | ResRef | Tag
ハーフリング | 1/2 | nw_halfling001 | NW_HALFLING001
ハーフリング | 3 | nw_halfling005 | NW_HALFLING005
ハーフリング | 10 | nw_halfling015 | NW_HALFLING015
ハーフリング･マーシナリー | 10 | nw_halfmerc005 | NW_HALFMERC005
ハーフリング･マーシナリー | 13 | nw_halfmerc006 | NW_HALFMERC006
ハーフリング･マーシナリー | 1 | nw_halfmerc001 | NW_HALFMERC001
ハーフリング･マーシナリー | 3 | nw_halfmerc002 | NW_HALFMERC002
ハーフリング･マーシナリー | 5 | nw_halfmerc003 | NW_HALFMERC003
ハーフリング･マーシナリー | 7 | nw_halfmerc004 | NW_HALFMERC004

JP team: Rainie


Resource.Creatures - NPC, Half-Orcs

Home > Reference > Resources > Creatures > NPC, Half-Orcs

NPC, Half-Orcs

人間とオークの親を持つ混種

Creatures

Creatures | CR | ResRef | Tag
ハーフオーク･バンディット | 7 | nw_bandit006 | NW_BANDIT006
ハーフオーク傭兵 |  | nw_hench001 |

JP team: Rainie


Resource.Creatures - NPC, Humans

Home > Reference > Resources > Creatures > NPC, Humans

NPC, Humans

人間

Creatures

Creatures | CR | ResRef | Tag
バンディット | 1/2 | nw_bandit001 | NW_BANDIT001
バンディット･アーチャー | 1/2 | nw_bandit002 | NW_BANDIT002
バンディット･チーフ | 11 | nw_bandit007 | NW_BANDIT007
バンディット･クレリック | 3 | nw_bandit004 | NW_BANDIT004
バンディット･メイジ | 4 | nw_bandit005 | NW_BANDIT005
バンディット･ローグ | 1 | nw_bandit003 | NW_BANDIT003
物乞い |  | nw_beggfemale |
物乞い |  | nw_beggmale |
ブラッドセイラー |  | nw_humsailor |
平民、女性 |  | nw_comfemale |
平民、男性 |  | nw_commale |
乱暴者の戦士 |  | nw_hench002 |
ジプシー、女性 |  | nw_gypfemale |
ジプシー、男性 |  | nw_gypmale |
ジプシー･チーフ |  | nw_gypsy006 |
ジプシー･ヒーラー |  | nw_gypsy005 |
ジプシー･メイジ |  | nw_gypsy004 |
ジプシー･メイジ |  | nw_gypsy007 |
ジプシー･ローグ |  | nw_gypsy002 |
ジプシー･ウォーリアー |  | nw_gypsy001 |
ジプシー･ウォーリアー |  | nw_gypsy003 |
番兵 |  | nw_guard |
人間の傭兵 |  | nw_humanmerc001 |
人間の傭兵 |  | nw_humanmerc002 |
人間の傭兵 |  | nw_humanmerc003 |
人間の傭兵 |  | nw_humanmerc004 |
人間の傭兵 |  | nw_humanmerc005 |
人間の傭兵 |  | nw_humanmerc006 |
クルスの兵士 |  | nw_kurthsold |
ラスカン衛兵 |  | nw_luskanite |
ネヴァーウィンター市民兵 |  | nw_nevmilitia |
貴族 |  | nw_noblmale |
貴婦人 |  | nw_noblfemale |
疫病患者、女性 |  | nw_plagfemale |
疫病患者、男性 |  | nw_plagmale |

JP team: Rainie


Resource.Creatures - Other Creatures

Home > Reference > Resources > Creatures > Other Creatures

Other Creatures

その他の分類できないクリーチャー

Creatures

Creatures | CR | ResRef | Tag
バトル･ディヴァウラー | 11 | nw_battdevour | NW_BATTDEVOUR
エターキャップ | 5 | nw_ettercap | NW_ETTERCAP
ガーゴイル | 3 | nw_gargoyle | NW_GARGOYLE
グレイレンダー | 8 | nw_grayrend | NW_GRAYREND
フックホラー | 5 | nw_horror | NW_HORROR
インテレクト･ディヴァウラー | 7 | nw_devour | NW_DEVOUR
クレンシャー | 2 | nw_krenshar | NW_KRENSHAR
スタージ | 1/3 | nw_stirge | NW_STIRGE
アンバーハルク | 9 | nw_umberhulk | NW_UMBERHULK
ウングラク（Ungrak） |  | progrgoon |
ウィル・オー・ウィスプ | 8 | nw_willowisp | NW_WILLOWISP

JP team: Rainie


Resource.Creatures - Planar, Celestial

Home > Reference > Resources > Creatures > Planar, Celestial

Planar, Celestial

善なる異次元に住むクリーチャー

Creatures

Creatures | CR | ResRef | Tag
セレスチャル･アヴェンジャー | 11 |  | NW_CTRUMPET
ハーフセレスチャル･ウォーリアー | 9 | nw_halfcel001 | NW_HALFCEL001
ハウンド･アーコン | 6 | nw_chound01 | NW_CHOUND01
ランタン･アーコン | 5 | nw_clantern | NW_CLANTERN
トランペット･アーコン |  | nw_ctrumpet |

JP team: Rainie


Resource.Creatures - Planar, Fiendish

Home > Reference > Resources > Creatures > Planar, Fiendish

Planar, Fiendish

邪悪なる異次元（Nine HellsとAbyss）に住む極悪非道なクリーチャー

Creatures

Creatures | CR | ResRef | Tag
ベイラー | 15 | nw_demon | NW_DEMON
ベイラー･ロード | 16 |  | NW_DEMON
バーゲスト（Barghest） |  | nw_barghest |
ハーフフィーンド･ウォリアー | 8 | nw_halffnd001 | NW_HALFFND001
ヘルハウンド | 4 | nw_hellhound | NW_HELLHOUND
ハウン・オブ・ズヴィム | 5 | nw_beastxvim | NW_BEASTXVIM
ラクシャサ | 7 | nw_rakshasa | NW_RAKSHASA
シャドー･マスティフ | 4 | nw_shmastif | NW_SHMASTIF
サキュバス | 7 | nw_dmsucubus | NW_DMSUCUBUS
ヴロック | 10 | nw_dmvrock | NW_DMVROCK

JP team: Rainie


Resource.Creatures - Planar, Imps

Home > Reference > Resources > Creatures > Planar, Imps

Planar, Imps

Nine Hellsの有害なクリーチャー

Creatures

Creatures | CR | ResRef | Tag
エアーメフィット | 3 | nw_mepair | NW_MEPAIR
ダストメフィット | 3 | nw_mepdust | NW_MEPDUST
アースメフィット | 3 | nw_mepearth | NW_MEPEARTH
ファイアーメフィット | 3 | nw_mepfire | NW_MEPFIRE
アイスメフィット | 3 | nw_mepice | NW_MEPICE
インプ | 3 | nw_imp | NW_IMP
マグマメフィット | 3 | nw_mepmagma | NW_MEPMAGMA
ウーズメフィット | 3 | nw_mepooze | NW_MEPOOZE
クアジット | 3 | nw_dmquasit | NW_DMQUASIT
ソルトメフィット | 3 | nw_mepsalt | NW_MEPSALT
スチームメフィット | 3 | nw_mepsteam | NW_MEPSTEAM
ウォーターメフィット | 3 | nw_mepwater | NW_MEPWATER

JP team: Rainie


Resource.Creatures - Planar, Other

Home > Reference > Resources > Creatures > Planar, Other

Planar, Other

その他の異次元のクリーチャー

Creatures

Creatures | CR | ResRef | Tag
アゼル（Azer） |  | nw_azer01 |
ブリンクドッグ | 3 | nw_blinkdog | NW_BLINKDOG
フェンハウンド | 4 | nw_fenhound | NW_FENHOUND
ティーフリング | 1/2 | nw_tiefling02 | NW_TIEFLING02

JP team: Rainie


Resource.Creatures - Planar, Slaad

Home > Reference > Resources > Creatures > Planar, Slaad

Planar, Slaad

スラード（蛙に似た人型生物）

Creatures

Creatures | CR | ResRef | Tag
ブルー･スラード | 7 | nw_slaadbl | NW_SLAADBL
デス･スラード | 15 | nw_slaaddeth | NW_SLAADDETH
デス･スラード･ロード | 15 |  | NW_SLAADDTHBOSS
グレイ･スラード | 10 | nw_slaadgray | NW_SLAADGRAY
グレイ･スラード･ロード | 11 |  | NW_SLAADGRYBOSS
グリーン･スラード | 9 | nw_slaadgrn | NW_SLAADGRN
レッド･スラード | 6 | nw_slaadred | NW_SLAADRED

JP team: geshi, Rainie


Resource.Creatures - Shape Changers

Home > Reference > Resources > Creatures > Shape Changers

Shape Changers

変身生物（ライカンスロープやドッペルゲンガー）

Creatures

Creatures | CR | ResRef | Tag
アラニア | 3 | nw_aranea | NW_ARANEA
ワーキャット | 5 | nw_werecat | NW_WERECAT
ワーラット | 1/2 | nw_wererat | NW_WERERAT
ワーウルフ | 2 | nw_werewolf | NW_WEREWOLF

JP team: Rainie


Resource.Creatures - Summoned Creatures

Home > Reference > Resources > Creatures > Summoned Creatures

Summoned Creatures

魔法により召還されるクリーチャー

Creatures

Creatures | ResRef | Tag
エアーエレメンタル（召還） | nw_s_air |
ベイラー（召還） | nw_s_balor |
デス･スラード（召還） | nw_s_slaaddeth |
ダイアバッジャー（召還） | nw_s_badgerdire |
ダイアベア（召還） | nw_s_beardire |
ダイアボアー（召還） | nw_s_boardire |
ダイアスパイダー（召還） | nw_s_spiddire |
ダイアタイガー（召還） | nw_s_diretiger |
ダイアウルフ（召還） | nw_s_wolfdire |
ドゥームナイト（召還） | nw_s_doomkght |
アースエレメンタル（召還） | nw_s_earth |
エルダー･エアーエレメンタル（召還） | nw_s_airelder |
エルダー･アースエレメンタル（召還） | nw_s_eartheld |
エルダー･ファイアーエレメンタル（召還） | nw_s_fireelder |
エルダー･ウォーターエレメンタル（召還） | nw_watelder |
ファイアーエレメンタル（召還） | nw_s_fire |
ガーゴイル（召還） | nw_s_gargoyle |
ガスト（召還） | nw_s_ghast |
グール（召還） | nw_s_ghoul |
グレーター･エアエレメンタル（召還） | nw_sw_airgreat |
グレーター･エアエレメンタル（召還） | nw_s_airgreat |
グレーター･アースエレメンタル（召還） | nw_sw_earthgreat |
グレーター･アースエレメンタル（召還） | nw_s_earthgreat |
グレーター･ファイアーエレメンタル（召還） | nw_sw_firegreat |
グレーター･ファイアーエレメンタル（召還） | nw_s_firegreat |
グレーター･マミー（召還） | nw_s_mumcleric |
グレーター･ウォーターエレメンタル（召還） | nw_sw_watergreat |
グレーター･ウォーターエレメンタル（召還） | nw_s_watergreat |
グリーン･スラード（召還） | nw_s_slaadgrn |
ヘルムド･ホラー（召還） | nw_s_helmhorr |
ハウンドアーコン（召還） | nw_s_chound |
ヒュージ･エアエレメンタル（召還） | nw_s_airhuge |
ヒュージ･アースエレメンタル（召還） | nw_s_earthhuge |
ヒュージ･ファイアーエレメンタル（召還） | nw_s_firehuge |
ヒュージ･ウォーターエレメンタル（召還） | nw_s_waterhuge |
インプ（召還） | nw_s_imp |
ランタン･アーコン（召還） | nw_s_clantern |
リッチ（召還） | nw_s_lich |
ミノゴン（召還） | nw_s_minogon |
レッド･スラード（召還） | nw_s_slaadred |
シャドゥ（召還） | nw_s_shadow |
シャドゥ･フィーンド（召還） | nw_s_shfiend |
シャドー･ロード（召還） | nw_s_shadlord |
シャドー･マスティフ（召還） | nw_s_shadmastif |
スケルトン（召還） | nw_s_skeleton |
スケルトン･チーフテン（召還） | nw_s_skelchief |
スケルトン･ウォリアー（召還） | nw_s_skelwarr |
スペクター（召還） | nw_s_spectre |
サキュバス（召還） | nw_s_succubus |
ソードスパイダー（召還） | nw_s_spidsword |
トランペット･アーコン（召還） | nw_s_ctrumpet |
タイラント･ゾンビ（召還） | nw_s_zombtyrant |
ヴァンパイア（召還） | nw_s_vampire |
ヴロック（Vrock）（召還） | nw_s_vrock |
ウォリアー･マミー（召還） | nw_s_mumfight |
ウォーターエレメンタル（召還） | nw_s_water |
ワイト（召還） | nw_s_wight |
レイス（召還） | nw_s_wraith |
ゾンビ（召還） | nw_s_zombie |

JP team: Rainie


Resource.Creatures - Undead, Ghoul

Home > Reference > Resources > Creatures > Undead, Ghoul

Undead, Ghoul

死肉を食らうアンデッドクリーチャー

Creatures

Creatures | CR | ResRef | Tag
ガスト | 4 | nw_ghast | NW_GHAST
グール | 2 | nw_ghoul | NW_GHOUL
グール･ロード | 5 | nw_ghoullord | NW_GHOULLORD
グール･ラヴァジャー | 10 |  | NW_GHOULBOSS

JP team: Rainie


Resource.Creatures - Undead, Mummy

Home > Reference > Resources > Creatures > Undead, Mummy

Undead, Mummy

儀式により埋葬され操られし死体

Creatures

Creatures | CR | ResRef | Tag
グレーター･マミー | 10 | nw_mumcleric | NW_MUMCLERIC
マミー | 5 | nw_mummy | NW_MUMMY
マミー･ロード | 11 |  | NW_MUMMYBOSS
ウォリアー･マミー | 10 | nw_mumfight | NW_MUMFIGHT

JP team: Rainie


Resource.Creatures - Undead, Other

Home > Reference > Resources > Creatures > Undead, Other

Undead, Other

アンデッド（生きる死人）

Creatures

Creatures | CR | ResRef | Tag
バエルノーン | 18 | nw_lich002 | NW_LICH002
ボダック | 9 | nw_bodak | NW_Bodak
カースト･モンク | 6 | nw_curst004 | NW_CURST004
カースト･レンジャー | 5 | nw_curst003 | NW_CURST003
カースト･ローグ | 6 | nw_curst002 | NW_CURST002
カースト･ウォリアー | 5 | nw_curst001 | NW_CURST001
ドゥームナイト | 10 | nw_doomkght | NW_DOOMKGHT
ドゥームナイト･コマンダー | 15 |  | NW_DOOMKGHTBOSS
リッチ | 28 | nw_lich001 | NW_LICH001
リッチ | 17 | nw_lich003 | NW_LICH003
リッチ | 21 |  | NW_LICHBOSS
モーグ | 12 | nw_mohrg | NW_MOHRG
レブナント | 7 | nw_revenant001 | NW_REVENANT001
スケルタル･ディヴァウラー | 13 | nw_skeldevour | NW_SKELDEVOUR
ヴァンパイア | 6 |  | NW_VAMPIRE
ヴァンパイア･メイジ | 16 | nw_vampire003 | NW_VAMPIRE003
ヴァンパイア･プリースト | 13 | nw_vampire004 | NW_VAMPIRE004
ヴァンパイア･ローグ | 13 | nw_vampire002 | NW_VAMPIRE002
ヴァンパイア･ウォリアー | 12 | nw_vampire001 | NW_VAMPIRE001
ヴァンパイア（霧状） |  | nw_mistvamp |
ワイト | 4 | nw_wight | NW_WIGHT

JP team: Rainie


Resource.Creatures - Undead, Shadow

Home > Reference > Resources > Creatures > Undead, Shadow

Undead, Shadow

シャドーは闇に潜むクリーチャーで、生命や光をはげしく嫌っている。彼らに触られると虚無の悪寒を感じる、とても危険な相手だ

Creatures

Creatures | CR | ResRef | Tag
ガス状形態 | 3 | nw_vampire_shad | NW_VAMPIRE_SHAD
シャドー | 3 | nw_shadow | NW_SHADOW
シャドー | 7 | nw_shfiend | NW_SHFIEND

JP team: Rainie


Resource.Creatures - Undead, Skeleton

Home > Reference > Resources > Creatures > Undead, Skeleton

Undead, Skeleton

死者の骨から造られたアンデッドクリーチャー

Creatures

Creatures | CR | ResRef | Tag
スケルトン | 1/2 | nw_skeleton | NW_SKELETON
スケルトン･チーフテン | 7 | nw_skelchief | NW_SKELCHIEF
スケルトン･メイジ | 4 | nw_skelmage | NW_SKELMAGE
スケルトン･プリースト | 4 | nw_skelpriest | NW_SKELPRIEST
スケルトン･ウォリアー | 6 | nw_skelwarr01 | NW_SKELWARR01
スケルトン･ウォリアー | 6 | nw_skelwarr02 | NW_SKELWARR02

JP team: Rainie


Resource.Creatures - Undead, Wraith

Home > Reference > Resources > Creatures > Undead, Wraith

Undead, Wraith

悪意が具現化したアンデッド

Creatures

Creatures | CR | ResRef | Tag
アリップ | 3 | nw_allip | NW_ALLIP
スペクター | 6 | nw_spectre | NW_SPECTRE
レイス | 5 | nw_wraith | NW_WRAITH

JP team: Rainie


Resource.Creatures - Undead, Zombie

Home > Reference > Resources > Creatures > Undead, Zombie

Undead, Zombie

蘇えらされ操られし死体

Creatures

Creatures | CR | ResRef | Tag
タイラントフォグ･ゾンビ | 3 | nw_zombtyrant | NW_ZOMBTYRANT
ゾンビ | 1 | nw_zombie01 | NW_ZOMBIE01
ゾンビ | 1 | nw_zombie02 | NW_ZOMBIE02
ゾンビ･ロード | 8 |  | NW_ZOMBIEBOSS
ゾンビ･ウォリアー | 4 | nw_zombwarr01 | NW_ZOMBWARR01
ゾンビ･ウォリアー | 4 | nw_zombwarr02 | NW_ZOMBWARR02

JP team: Rainie


Item Categories - Items

Home > Resources > Items

Items

Items | Description
Ammunition（弾薬） | 弾薬（通常の弾薬と魔法の弾薬）
Amulets（アミュレット） | 魔法のアミュレット
Armor, Heavy | ヘビーアーマー（通常の鎧と魔法の鎧）
Armor, Helmets | Non-magical and magical helmets.
Armor, Light | Light non-magical and magical armor.
Armor, Medium | Medium non-magical and magical armor.
Axes, Great | Great axes.
Axes, One-Handed | One-handed axes.
Axes, Two-Handed | Two-handed axes.
Belts | Magical belts.
Books | Books
Boots | Magical boots.
Bracers | Magical bracers.
Cloaks | Magical cloaks.
Clothing | Clothing sets and magical clothing.
Clubs | Clubs.
Creature Armor and Clothing | Armor and clothing that belongs to creatures.
Creature Natural Weapons | Attacks such as claws and bites employable only by creatures.
Creature Properties | Special properties of a creature.
Creature Special Attack | Special attacks employable only by creatures.
Creature Weapons | Weapons employable by creatures only (not including natural weapons).
Crossbows | Crossbows.
Daggers | Daggers.
Double-Sided | Double-sided weapons (weapons that can be used in both the on hand and off hand at the same time; dire weapons).
Exotic | Exotic weapons.
Flails | Flails.
Gauntlets | Magical guantlets
Gems | Valuable gems.
Hammers | Hammers.
Jewelry | Jewelry.
Kits | Traps and craft kits.
Longbows | Longbows.
Maces | Maces.
Morningstars | Morningstars.
Nunchaku | Nunchakus.
Other | Miscellaneous items.
Other Bladed Weapons | Other bladed weapons (various types of swords).
Other Weapons | Other weapons.
Polearms | Polearms and spears (used primarily against calvary or other charging opponents).
Potions | Magical potions and drinks.
Rods | Magical rods.
Scrolls | Spell scrolls.
Shields, Large | Large non-magical and magical shields.
Shields, Small | Small non-magical and magical shields.
Shields, Tower | Tower non-magical and magical shields.
Shortbows | Shortbows.
Slings | Slings.
Staves | Magical staves (quarterstaves are located under the "Double-Sided" category).
Swords, Bastard | Bastard (hand and a half) swords.
Swords, Great | Great swords.
Swords, Long | Longswords.
Swords, Short | Short swords.
Throwing Weapons | Various other missile/throwing weapons.
Unknown | Unknown; currently ungrouped.
Wands | Magical wands.


Resource.Items - Ammunition

Home > Reference > Resources > Items > Ammunition

Ammunition

弾薬

弾薬（通常の弾薬と魔法の弾薬）

Items

Items | ResRef | Tag
アシッドアロー：Acid Arrow | nw_wammar003 | NW_WAMMAR003
矢：Arrow | nw_wamar001 | NW_WAMAR001
アロー・オブ・ヴァンパイア：Arrow of the Vampire | nw_wammar001 | NW_WAMMAR001
ボルト：Bolt | nw_wambo001 | NW_WAMBO001
ボルト・オブ・ファイアー：Bolt of Fire | nw_wammbo005 | NW_WAMMBO005
ボルト・オブ・フロストバイト：Bolt of Frostbite | nw_wammbo001 | NW_WAMMBO001
ボルト・オブ・ライトニング：Bolt of Lightning | nw_wammbo002 | NW_WAMMBO002
ボルト・オブ・ピアーシング：Bolt of Piercing | nw_wammbo004 | NW_WAMMBO004
ブレット：Bullet | nw_wambu001 | NW_WAMBU001
ブレット・オブ・スクリーミング：Bullet of Screaming | nw_wammbu002 | NW_WAMMBU002
ブレット・オブ・スマイティング：Bullets of Smiting | nw_wammbu004 | NW_WAMMBU004
ファレルズ・ゴールド：Farel's Gold | nw_wammbu003 | NW_WAMMBU003
ファイアーアロー：Fire Arrow | nw_wammar002 | NW_WAMMAR002
ファイアーブレット：Fire Bullet | nw_wammbu005 | NW_WAMMBU005
ファイアント・ベイン：Giant's Bane | nw_wammbu001 | NW_WAMMBU001
アイスアロー：Ice Arrow | nw_wammar005 | NW_WAMMAR005
アイスブレット：Ice Bullet | nw_wammbu006 | NW_WAMMBU006
ライトニングアロー：Lightning Arrow | nw_wammar006 | NW_WAMMAR006
ライトニングブレット：Lightning Bullet | nw_wammbu007 | NW_WAMMBU007
マイルド・ポイズンアロー：Mild Poison Arrow | nw_wammar007 | NW_WAMMAR007
マイルド・ポイズンブレット：Mild Poison Bolt | nw_wammbo006 | NW_WAMMBO006
パラリティック・ボルト：Paralytic Bolt | nw_wammbo003 | NW_WAMMBO003
ピアーシングアロー：Piercing Arrow | nw_wammar004 | NW_WAMMAR004
ポイズンアロー：Poison Arrow | nw_wammar008 | NW_WAMMAR008
ポイズンボルト：Poison Bolt | nw_wammbo007 | NW_WAMMBO007


Resource.Items - Amulets

Home > Reference > Resources > Items > Amulets

Amulets

アミュレット

魔法のアミュレット

Items

Items ResRef Tag


Resource.Items - Armor, Heavy

Home > Reference > Resources > Items > Armor, Heavy

Armor, Heavy

ヘビーアーマー（通常の鎧と魔法の鎧）

Items

Items | ResRef | Tag
アーマー・オブ・コンフォート：Armor of Comfort | nw_maarcl021 | NW_MAARCL021
アーマー・オブ・フリーダム：Armor of Freedom | nw_maarcl054 | NW_MAARCL054
バルダランノアーマー：Balduran's Armor | nw_maarcl025 | NW_MAARCL025
バンデッドメイル：Banded Mail | nw_aarcl011 | NW_AARCL011
バンデッドメイル＋１：Banded Mail +1 | nw_maarcl051 | NW_MAARCL051
バンデッドメイル＋２：Banded Mail +2 | nw_maarcl064 | NW_MAARCL064
バンデッドメイル＋３：Banded Mail +3 | nw_maarcl076 | NW_MAARCL076
ブルードラゴン・アーマー：Blue Dragon Armor | nw_maarcl028 | NW_MAARCL028
カッパードラゴン・アーマー：Copper Dragon Armor | nw_maarcl042 | NW_MAARCL042
デルヴァーのアーマー：Delver's Armor | nw_maarcl024 | NW_MAARCL024
ドロウ・フルプレート：Drow Full Plate |  | nw_it_creitem060
ドロウ・フルプレート＋１：Drow Full Plate +1 |  | nw_it_creitem126
ドロウ・フルプレート＋２：Drow Half Plate +2 |  | nw_it_creitem127
ドロウ・フルプレート＋３：Duergar Full Plate |  | nw_it_creitem137
ドゥエルガー・フルプレート＋１：Duergar Full Plate +1 |  | nw_it_creitem053
エルフ・セレモニアル・アーマー：Elven Ceremonial Armor | nw_maarcl022 | NW_MAARCL022
エンキドウのアーマー：Enkidu's Armor | nw_maarcl029 | NW_MAARCL029
フル・プレート：Full Plate | nw_aarcl007 | NW_AARCL007
フルプレート＋１：Full Plate +1 | nw_maarcl053 | NW_MAARCL053
フル・プレート＋２：Full Plate +2 | nw_maarcl068 | NW_MAARCL068
フルプレート＋３：Full Plate +3 | nw_maarcl080 | NW_MAARCL080
ノームのマグネティック・アーマー：Gnomish Magnetic Armor | nw_maarcl026 | NW_MAARCL026
ハーフプレート：Half Plate | nw_aarcl006 | NW_AARCL006
ハーフプレート＋１：Half Plate +1 | nw_maarcl052 | NW_MAARCL052
ハーフプレート＋２：Half Plate +2 | nw_maarcl069 | NW_MAARCL069
ハーフプレート＋３：Half Plate +3 | nw_maarcl081 | NW_MAARCL081
ミスリル･スプリントメイル：Mithral Splint Mail | nw_maarcl041 | NW_MAARCL041
レインボー・アーマー：Rainbow Armor | nw_maarcl020 | NW_MAARCL020
レッドドラゴン･アーマー：Red Dragon Armor | nw_maarcl027 | NW_MAARCL027
スケイル・オブ・トゥルース：Scales of Truth | nw_maarcl019 | NW_MAARCL019
スケイル・オブ・トゥルース＋１：Scales of Truth +1 | nw_maarcl059 | NW_MAARCL059
スケイル・オブ・トゥルース＋３：Scales of Truth +3 | nw_maarcl062 | NW_MAARCL062
シルバーボーン・アーマー＋２：Silverbone Armor +2 | nw_maarcl063 | NW_MAARCL063
スプリントメイル：Splint Mail | nw_aarcl005 | NW_AARCL005
スプリントメイル+１：Splint Mail +1 | nw_maarcl050 | NW_MAARCL050
スプリントメイル+２：Splint Mail +2 | nw_maarcl074 | NW_MAARCL074
スプリントメイル＋３：Splint Mail +3 | nw_maarcl086 | NW_MAARCL086
ホワイトドラゴン・アーマー：White Dragon Armor | nw_maarcl018 | NW_MAARCL018
ホワイトボーン・アーマー：Whitebone Armor | nw_maarcl023 | NW_MAARCL023
ホワイトボーン・アーマー＋２：Whitebone Armor +2 | nw_maarcl060 | NW_MAARCL060


Resource.Items - Armor, Helmets

Home > Reference > Resources > Items > Armor, Helmets

Armor, Helmets

Non-magical and magical helmets.

Items

Items | ResRef | Tag
Duergar Cleric Helmet |  | nw_it_creitem185
Duergar Heavy Flail +3 |  | nw_it_crewhf001
Duergar Warrior Helmet |  | nw_it_creitem186
Golden Circlet | nw_armhe010 | NW_ARMHE010
Greater Mask of Persuasion | nw_armhe012 | NW_ARMHE012
Half-Orc Bandit Helmet |  | nw_it_creitem187
Horse Hair Helmet | nw_arhe004 | NW_ARHE004
Mask of Persuasion | nw_armhe011 | NW_ARMHE011
Moonstone Mask | nw_it_novel004 | NW_IT_NOVEL004
Pot Helmet | nw_arhe001 | NW_ARHE001
Shukenja Helm | nw_armhe008 | NW_ARMHE008
Spike Helmet | nw_arhe002 | NW_ARHE002
Stag Helmet | nw_arhe005 | NW_ARHE005
Thayvian Circlet | nw_armhe009 | NW_ARMHE009
Thieves' Hood | nw_armhe007 | NW_ARMHE007
Watchman's Helm | nw_armhe006 | NW_ARMHE006
Winged Helmet | nw_arhe003 | NW_ARHE003


Resource.Items - Armor, Light

Home > Reference > Resources > Items > Armor, Light

Armor, Light

Light non-magical and magical armor.

Items

Items | ResRef | Tag
Armor of Fleetness | nw_maarcl004 | NW_MAARCL004
Armor of Loyalty | nw_maarcl011 | NW_MAARCL011
Armor of the Stars | nw_maarcl003 | NW_MAARCL003
Armor of the Wolf | nw_maarcl001 | NW_MAARCL001
Armor of Thorns | nw_maarcl013 | NW_MAARCL013
Aslyferund Elven Chain | nw_mcloth005 | NW_MCLOTH005
Aurumvorax Armor | nw_maarcl006 | NW_MAARCL006
Benzo's Luck | nw_maarcl032 | NW_MAARCL032
Black Flame Armor | nw_maarcl009 | NW_MAARCL009
Broewende Family Armor | nw_maarcl017 | NW_MAARCL017
Callurdan Smoothand's Armor | nw_maarcl012 | NW_MAARCL012
Chain Shirt | nw_aarcl012 | NW_AARCL012
Chain Shirt +1 | nw_maarcl046 | NW_MAARCL046
Chain Shirt +2 | nw_maarcl067 | NW_MAARCL067
Chain Shirt +3 | nw_maarcl079 | NW_MAARCL079
Drow Chain Shirt |  | nw_it_creitem123
Drow Chain Shirt +1 |  | nw_it_creitem124
Drow Leather Armor |  | nw_it_creitem121
Drow Studded Leather Armor |  | nw_it_creitem122
Duergar Chain Shirt |  | nw_it_creitem135
Duergar Chain Shirt +1 |  | nw_it_creitem054
Duergar Leather Armor |  | nw_it_creitem128
Duergar Studded Leather Armor |  | nw_it_creitem129
Elf Ranger Studded Leather Armor |  | nw_it_creitem062
Greenleaf | nw_maarcl033 | NW_MAARCL033
Half-Orc Bandit Chain Mail |  | nw_it_creitem082
Halfling Merc Leather Armor +1 |  | nw_it_creitem068
Halfling Merc Padded Armor |  | nw_it_creitem067
Halfling Merc Studded Leather Armor +1 |  | nw_it_creitem069
Halfling Merc Studded Leather Armor +3 |  | nw_it_creitem070
Halfling Studded Leather Armor |  | nw_it_creitem065
Halfling Studded Leather Armor +1 |  | nw_it_creitem066
Leather Armor | nw_aarcl001 | NW_AARCL001
Leather Armor +1 | nw_maarcl044 | NW_MAARCL044
Leather Armor +2 | nw_maarcl071 | NW_MAARCL071
Leather Armor +3 | nw_maarcl083 | NW_MAARCL083
Mirrored Armor | nw_maarcl002 | NW_MAARCL002
Padded Armor | nw_aarcl009 | NW_AARCL009
Padded Armor +1 | nw_maarcl043 | NW_MAARCL043
Padded Armor +2 | nw_maarcl072 | NW_MAARCL072
Padded Armor +3 | nw_maarcl084 | NW_MAARCL084
Rogue Links | nw_maarcl034 | NW_MAARCL034
Shadow Legion Armor | nw_maarcl005 | NW_MAARCL005
Squire's Defense | nw_maarcl008 | NW_MAARCL008
Storm Armor | nw_it_novel003 | NW_IT_NOVEL003
Studded Leather Armor | nw_aarcl002 | NW_AARCL002
Studded Leather Armor +1 | nw_maarcl045 | NW_MAARCL045
Studded Leather Armor +2 | nw_maarcl075 | NW_MAARCL075
Studded Leather Armor +3 | nw_maarcl087 | NW_MAARCL087
The Great Oak | nw_maarcl007 | NW_MAARCL007


Resource.Items - Armor, Medium

Home > Reference > Resources > Items > Armor, Medium

Armor, Medium

Medium non-magical and magical armor.

Items

Items | ResRef | Tag
Adamantine Breastplate | nw_maarcl040 | NW_MAARCL040
Armor of Command | nw_maarcl014 | NW_MAARCL014
Armor of Horus-Re | nw_maarcl016 | NW_MAARCL016
Breastplate | nw_aarcl010 | NW_AARCL010
Breastplate +1 | nw_maarcl049 | NW_MAARCL049
Breastplate +2 | nw_maarcl065 | NW_MAARCL065
Breastplate +3 | nw_maarcl077 | NW_MAARCL077
Chainmail | nw_aarcl004 | NW_AARCL004
Chainmail +1 | nw_maarcl035 | NW_MAARCL035
Chainmail +2 | nw_maarcl066 | NW_MAARCL066
Chainmail +3 | nw_maarcl078 | NW_MAARCL078
Chainmail of Speed | nw_maarcl039 | NW_MAARCL039
Chromatic Breastplate | nw_maarcl038 | NW_MAARCL038
Chromatic Breastplate +1 | nw_maarcl058 | NW_MAARCL058
Chromatic Breastplate +3 | nw_maarcl061 | NW_MAARCL061
Doron's Mistake | nw_maarcl036 | NW_MAARCL036
Dragon Armor | nw_maarcl015 | NW_MAARCL015
Drow Chainmail |  | nw_it_creitem125
Duergar Chainmail |  | nw_it_creitem136
Elven Chainmail | nw_maarcl037 | NW_MAARCL037
Hide Armor | nw_aarcl008 | NW_AARCL008
Hide Armor +1 | nw_maarcl047 | NW_MAARCL047
Hide Armor +2 | nw_maarcl070 | NW_MAARCL070
Hide Armor +3 | nw_maarcl082 | NW_MAARCL082
Kumakawa | nw_maarcl010 | NW_MAARCL010
Scale Mail | nw_aarcl003 | NW_AARCL003
Scale Mail +1 | nw_maarcl048 | NW_MAARCL048
Scale Mail +2 | nw_maarcl073 | NW_MAARCL073
Scale Mail +3 | nw_maarcl085 | NW_MAARCL085


Resource.Items - Axes, Great

Home > Reference > Resources > Items > Axes, Great

Axes, Great

Great axes.

Items

Items | ResRef | Tag
Axe of the Culling | nw_waxmgr004 | NW_WAXMGR004
Greataxe | nw_waxgr001 | NW_WAXGR001
Greataxe +1 | nw_waxmgr002 | NW_WAXMGR002
Greataxe +2 | nw_waxmgr009 | NW_WAXMGR009
Greataxe +3 | nw_waxmgr011 | NW_WAXMGR011
Gruumsh Hand | nw_waxmgr006 | NW_WAXMGR006
Netherese Axe | nw_waxmgr003 | NW_WAXMGR003
Re's Redemption | nw_waxmgr005 | NW_WAXMGR005
Stonefire Axe | nw_waxmgr007 | NW_WAXMGR007
Stonefire Axe +1 | nw_waxmgr008 | NW_WAXMGR008
Stonefire Axe +2 | nw_waxmgr010 | NW_WAXMGR010


Resource.Items - Axes, One-Handed

Home > Reference > Resources > Items > Axes, One-Handed

Axes, One-Handed

One-handed axes.

Items

Items | ResRef | Tag
Blood Rust Axe | nw_waxmhn005 | NW_WAXMHN005
Ember's Axe | nw_waxmhn003 | NW_WAXMHN003
Handaxe | nw_waxhn001 | NW_WAXHN001
Handaxe +1 | nw_waxmhn002 | NW_WAXMHN002
Handaxe +2 | nw_waxmhn010 | NW_WAXMHN010
Handaxe +3 | nw_waxmhn011 | NW_WAXMHN011
Ice Reaver | nw_waxmhn007 | NW_WAXMHN007
Ice Reaver +1 | nw_waxmhn008 | NW_WAXMHN008
Ice Reaver +3 | nw_waxmhn009 | NW_WAXMHN009
Offhand Axe | nw_waxmhn006 | NW_WAXMHN006
Woodcutter's Axe | nw_waxmhn004 | NW_WAXMHN004


Resource.Items - Axes, Two-Handed

Home > Reference > Resources > Items > Axes, Two-Handed

Axes, Two-Handed

Two-handed axes.

Items

Items | ResRef | Tag
Axe of Dead Illusk | nw_waxmbt003 | NW_WAXMBT003
Azure Progeny | nw_waxmbt007 | NW_WAXMBT007
Battleaxe | nw_waxbt001 | NW_WAXBT001
Battleaxe +1 | nw_waxmbt002 | NW_WAXMBT002
Battleaxe +2 | nw_waxmbt010 | NW_WAXMBT010
Battleaxe +3 | nw_waxmbt011 | NW_WAXMBT011
Clangeddin's Wayward Axe | nw_waxmbt005 | NW_WAXMBT005
Deepstone Progeny | nw_waxmbt006 | NW_WAXMBT006
Mordan's Withering Blade | nw_waxmbt004 | NW_WAXMBT004
Sentinel +1 | nw_waxmbt008 | NW_WAXMBT008
Sentinel +2 | nw_waxmbt009 | NW_WAXMBT009
Silvermane's Axe | nw_it_novel006 | NW_IT_NOVEL006


Resource.Items - Belts

Home > Reference > Resources > Items > Belts

Belts

Magical belts.

Items

Items | ResRef | Tag
Archers Belt | nw_it_mbelt011 | nw_it_mbelt011
Belt of Agility +1 | nw_it_mbelt018 | nw_it_mbelt018
Belt of Agility +2 | nw_it_mbelt019 | nw_it_mbelt019
Belt of Agility +3 | nw_it_mbelt020 | nw_it_mbelt020
Belt of Agility +4 | nw_it_mbelt021 | nw_it_mbelt021
Belt of Fire Giant Strength | nw_it_mbelt008 | NW_IT_MBELT008
Belt of Frost Giant Strength | nw_it_mbelt007 | NW_IT_MBELT007
Belt of Guiding Light | nw_it_mbelt016 | nw_it_mbelt016
Belt of Hill Giant Strength | nw_it_mbelt002 | NW_IT_MBELT002
Belt of Inertial Barrier | nw_item_000 | NW_ITEM_000
Belt of Inertial Barrier | nw_it_mbelt006 | NW_IT_MBELT006
Brawlers Belt | nw_it_mbelt010 | nw_it_mbelt010
Ceremonial Uthgardt Belt | nw_it_mbelt003 | NW_IT_MBELT003
Encircling Scale | nw_it_mbelt004 | NW_IT_MBELT004
Girdle of Holy Might | nw_it_mbelt001 | NW_IT_MBELT001
Greater Archers Belt | nw_it_mbelt014 | nw_it_mbelt014
Greater Belt of Guiding Light | nw_it_mbelt017 | nw_it_mbelt017
Greater Brawlers Belt | nw_it_mbelt013 | nw_it_mbelt013
Greater Swordsmans Belt | nw_it_mbelt012 | nw_it_mbelt012
Lesser Belt of Guiding Light | nw_it_mbelt015 | nw_it_mbelt015
Sash of Shimmering | nw_it_mbelt005 | NW_IT_MBELT005
Swordsmans Belt | nw_it_mbelt009 | nw_it_mbelt009


Resource.Items - Books

Home > Reference > Resources > Items > Books

Books

Books

Items

Items | ResRef | Tag
Bhaal's Legacy | nw_it_book023 | NW_IT_BOOK023
Famous Citizens of the Sword Coast | nw_it_book013 | NW_IT_BOOK013
Helm's Hold | nw_it_book014 | NW_IT_BOOK014
History of the Creator Races | nw_it_book001 | NW_IT_BOOK001
Host Tower of the Arcane, & the Arcane Brotherhood | nw_it_book015 | NW_IT_BOOK015
Port Llast | nw_it_book022 | NW_IT_BOOK022
Religions of the Sword Coast | nw_it_book020 | NW_IT_BOOK020
Return of the Beast | nw_it_book018 | NW_IT_BOOK018
The 'Northern Four' Adventuring Troupe | nw_it_book021 | NW_IT_BOOK021
The Adventures of Grin, Richard, and Wu-Wei | nw_it_book029 | NW_IT_BOOK029
The City of Luskan | nw_it_book007 | NW_IT_BOOK007
The City of Neverwinter | nw_it_book005 | NW_IT_BOOK005
The Dessarin River | nw_it_book010 | NW_IT_BOOK010
The Doombringers | nw_it_book003 | NW_IT_BOOK003
The Fallen Tower Tavern | nw_it_book008 | NW_IT_BOOK008
The Ghost of Conyberry | nw_it_book009 | NW_IT_BOOK009
The Imps' Prison | nw_it_book024 | NW_IT_BOOK024
The Leadership of Neverwinter | nw_it_book031 | NW_IT_BOOK031
The Nether Scrolls | nw_it_book026 | NW_IT_BOOK026
The Neverwintan Mines & the Neverwinter Wood | nw_it_book006 | NW_IT_BOOK006
The Origin of Magic | nw_it_book017 | NW_IT_BOOK017
The Rise & Fall of the Netherese | nw_it_book030 | NW_IT_BOOK030
The Rival Orc Tribes, & their Great Battles | nw_it_book011 | NW_IT_BOOK011
The Ruins of Illusk | nw_it_book012 | NW_IT_BOOK012
The Sword Coast | nw_it_book004 | NW_IT_BOOK004
The Time of Troubles | nw_it_book025 | NW_IT_BOOK025
The War of Light and Darkness | nw_it_book027 | NW_IT_BOOK027
Uthgardt Barbarians | nw_it_book016 | NW_IT_BOOK016
Wars of the Creator Races | nw_it_book002 | NW_IT_BOOK002
Waterdeep | nw_it_book028 | NW_IT_BOOK028
Wind by the Fireside | nw_it_book019 | NW_IT_BOOK019


Resource.Items - Boots

Home > Reference > Resources > Items > Boots

Boots

Magical boots.

Items

Items | ResRef | Tag
Boots of Elvenkind | nw_it_mboots002 | NW_IT_MBOOTS002
Boots of Hardiness +1 | nw_it_mboots015 | NW_IT_MBOOTS015
Boots of Hardiness +2 | nw_it_mboots016 | NW_IT_MBOOTS016
Boots of Hardiness +3 | nw_it_mboots017 | NW_IT_MBOOTS017
Boots of Reflexes +1 | nw_it_mboots010 | nw_it_mboots010
Boots of Reflexes +2 | nw_it_mboots011 | nw_it_mboots011
Boots of Reflexes +3 | nw_it_mboots012 | nw_it_mboots012
Boots of Reflexes +4 | nw_it_mboots013 | nw_it_mboots013
Boots of Reflexes +5 | nw_it_mboots014 | nw_it_mboots014
Boots of Speed | nw_it_mboots005 | NW_IT_MBOOTS005
Boots of Striding +1 | nw_it_mboots001 | NW_IT_MBOOTS001
Boots of Striding +2 | nw_it_mboots006 | NW_IT_MBOOTS006
Boots of Striding +3 | nw_it_mboots007 | NW_IT_MBOOTS007
Boots of Striding +4 | nw_it_mboots008 | NW_IT_MBOOTS008
Boots of Striding +5 | nw_it_mboots009 | NW_IT_MBOOTS009
Boots of the Sun Soul +1 | nw_it_mboots018 | NW_IT_MBOOTS018
Boots of the Sun Soul +2 | nw_it_mboots019 | NW_IT_MBOOTS019
Boots of the Sun Soul +3 | nw_it_mboots020 | NW_IT_MBOOTS020
Boots of the Sun Soul +4 | nw_it_mboots021 | NW_IT_MBOOTS021
Boots of the Sun Soul +5 | nw_it_mboots022 | NW_IT_MBOOTS022
Dragon Slippers | nw_it_mboots003 | NW_IT_MBOOTS003
Gargoyle Boots | nw_it_mboots004 | NW_IT_MBOOTS004


Resource.Items - Bracers

Home > Reference > Resources > Items > Bracers

Bracers

Magical bracers.

Items

Items | ResRef | Tag
Bracers of Armor +1 | nw_it_mbracer002 | NW_IT_MBRACER002
Bracers of Armor +2 | nw_it_mbracer007 | NW_IT_MBRACER007
Bracers of Armor +3 | nw_it_mbracer008 | NW_IT_MBRACER008
Bracers of Armor +4 | nw_it_mbracer009 | NW_IT_MBRACER009
Bracers of Armor +5 | nw_it_mbracer010 | NW_IT_MBRACER010
Bracers of Dexterity +1 | nw_it_mbracer001 | NW_IT_MBRACER001
Bracers of Dexterity +2 | nw_it_mbracer003 | NW_IT_MBRACER003
Bracers of Dexterity +3 | nw_it_mbracer004 | NW_IT_MBRACER004
Bracers of Dexterity +4 | nw_it_mbracer005 | NW_IT_MBRACER005
Bracers of Dexterity +5 | nw_it_mbracer006 | NW_IT_MBRACER006


Resource.Items - Cloaks

Home > Reference > Resources > Items > Cloaks

Cloaks

Magical cloaks.

Items

Items | ResRef | Tag
Cloak of Elvenkind | nw_maarcl057 | NW_MAARCL057
Cloak of Fortification +1 | nw_maarcl104 | NW_MAARCL104
Cloak of Fortification +2 | nw_maarcl105 | NW_MAARCL105
Cloak of Fortification +3 | nw_maarcl106 | NW_MAARCL106
Cloak of Movement | nw_maarcl056 | NW_MAARCL056
Cloak of Protection +1 | nw_maarcl055 | NW_MAARCL055
Cloak of Protection +2 | nw_maarcl088 | NW_MAARCL088
Cloak of Protection +3 | nw_maarcl089 | NW_MAARCL089
Cloak of Protection +4 | nw_maarcl090 | NW_MAARCL090
Cloak of Protection +5 | nw_maarcl091 | NW_MAARCL091
Cloak of Protection vs Chaos | nw_maarcl098 | nw_maarcl098
Cloak of Protection vs Evil | nw_maarcl097 | nw_maarcl097
Cloak of Protection vs Good | nw_maarcl096 | nw_maarcl096
Cloak of Protection vs Law | nw_maarcl099 | nw_maarcl099
Cloak of the High Forest | nw_maarcl030 | NW_MAARCL030
Greater Cloak of Protection vs Chaos | nw_maarcl102 | nw_maarcl102
Greater Cloak of Protection vs Evil | nw_maarcl101 | nw_maarcl101
Greater Cloak of Protection vs Good | nw_maarcl100 | nw_maarcl100
Greater Cloak of Protection vs Law | nw_maarcl103 | nw_maarcl103
Nymph Cloak +1 | nw_maarcl031 | NW_MAARCL031
Nymph Cloak +2 | nw_maarcl092 | NW_MAARCL092
Nymph Cloak +3 | nw_maarcl093 | NW_MAARCL093
Nymph Cloak +4 | nw_maarcl094 | NW_MAARCL094
Nymph Cloak +5 | nw_maarcl095 | NW_MAARCL095
Starred Cloak | nw_aarcl013 | NW_AARCL013


Resource.Items - Clothing

Home > Reference > Resources > Items > Clothing

Clothing

Clothing sets and magical clothing.

Items

Items | ResRef | Tag
Adept's Tunic | nw_cloth027 | NW_CLOTH027
Adventurer's Robe | nw_mcloth011 | NW_MCLOTH011
Assassin's Garb | nw_cloth017 | NW_CLOTH017
Barbarian's Outfit | nw_cloth015 | NW_CLOTH015
Bard's Tunic | nw_cloth021 | NW_CLOTH021
Black Robe of the Archmagi | nw_mcloth004 | NW_MCLOTH004
Commoner's Outfit | nw_cloth022 | NW_CLOTH022
Commoner's Tunic | nw_cloth024 | NW_CLOTH024
Conjurer's Robe | nw_cloth012 | NW_CLOTH012
Duergar Mage Clothing |  | nw_it_creitem131
Duergar Mage Clothing |  | nw_it_creitem134
Duergar Mage Clothing |  | nw_it_creitem130
Duergar Mage Clothing |  | nw_it_creitem133
Duergar Mage Clothing |  | nw_it_creitem132
Elf Mage Clothing |  | nw_it_creitem063
Elf Mage/Elf Merc Clothing |  | nw_it_creitem064
Elf Merc Clothing +2 |  | nw_it_creitem071
Elf Merc Clothing +3 |  | nw_it_creitem072
Gladiator's Outfit | nw_cloth011 | NW_CLOTH011
Greater Battle Robe | nw_mcloth014 | NW_MCLOTH014
Grey Robe of the Archmagi | nw_mcloth003 | NW_MCLOTH003
Illusionist's Robe | nw_cloth020 | NW_CLOTH020
Improved Robes of the Old Order | nw_mcloth016 | NW_MCLOTH016
Jester's Outfit | nw_cloth014 | NW_CLOTH014
Mage's Battle Robe | nw_mcloth013 | NW_MCLOTH013
Master Adventurer's Robe | nw_mcloth012 | NW_MCLOTH012
Monk's Outfit | nw_cloth016 | NW_CLOTH016
Necromancer's Robe | nw_cloth026 | NW_CLOTH026
Noble Guardsman Tunic | nw_cloth018 | NW_CLOTH018
Noble Outfit | nw_cloth003 | NW_CLOTH003
Noble's Tunic | nw_cloth028 | NW_CLOTH028
Paladin's Tunic | nw_cloth010 | NW_CLOTH010
Performer's Outfit | nw_cloth002 | NW_CLOTH002
Priest's Robe | nw_cloth007 | NW_CLOTH007
Robe of Acid Resistance | nw_mcloth007 | NW_MCLOTH007
Robe of Cold Resistance | nw_mcloth008 | NW_MCLOTH008
Robe of Electrical Resistance | nw_mcloth010 | NW_MCLOTH010
Robe of Fire Resistance | nw_mcloth009 | NW_MCLOTH009
Robe of Light | nw_mcloth006 | NW_MCLOTH006
Robe of Vecna | nw_mcloth001 | NW_MCLOTH001
Robes of the Dark Moon | nw_mcloth017 | NW_MCLOTH017
Robes of the Old Order | nw_mcloth015 | NW_MCLOTH015
Robes of the Shining Hand +1 | nw_mcloth018 | NW_MCLOTH018
Robes of the Shining Hand +2 | nw_mcloth019 | NW_MCLOTH019
Robes of the Shining Hand +3 | nw_mcloth020 | NW_MCLOTH020
Robes of the Shining Hand +4 | nw_mcloth021 | NW_MCLOTH021
Robes of the Shining Hand +5 | nw_mcloth022 | NW_MCLOTH022
Rogue's Tunic | nw_cloth004 | NW_CLOTH004
Soldier's Tunic | nw_cloth019 | NW_CLOTH019
Sorcerer's Robe | nw_cloth008 | NW_CLOTH008
Squire's Tunic | nw_cloth013 | NW_CLOTH013
Urchin Rags | nw_cloth009 | NW_CLOTH009
Vagabond Rags | nw_cloth023 | NW_CLOTH023
Veteran's Outfit | nw_cloth006 | NW_CLOTH006
Warrior's Tunic | nw_cloth025 | NW_CLOTH025
White Robe of the Archmagi | nw_mcloth002 | NW_MCLOTH002
Wizard's Robe | nw_cloth005 | NW_CLOTH005
Woodsman Outfit | nw_cloth001 | NW_CLOTH001


Resource.Items - Clubs

Home > Reference > Resources > Items > Clubs

Clubs

Clubs.

Items

Items | ResRef | Tag
Club | nw_wblcl001 | NW_WBLCL001
Club +1 | nw_wblmcl002 | NW_WBLMCL002
Club +2 | nw_wblmcl010 | NW_WBLMCL010
Club +3 | nw_wblmcl011 | NW_WBLMCL011
Club of Smiting | nw_wblmcl012 | NW_WBLMCL012
Gladiator's Club +1 | nw_wblmcl008 | NW_WBLMCL008
Gladiator's Club +4 | nw_wblmcl009 | NW_WBLMCL009
Tethir-Wood Cudgel | nw_wblmcl005 | NW_WBLMCL005
The Angry Soul | nw_wblmcl007 | NW_WBLMCL007
The Angry Soul | nw_wblmcl006 | NW_WBLMCL006
Watchman's Club | nw_wblmcl003 | NW_WBLMCL003
Will of the Lost | nw_wblmcl004 | NW_WBLMCL004


Resource.Items - Creature Armor and Clothing

Home > Reference > Resources > Items > Creature Armor and Clothing

Creature Armor and Clothing

Armor and clothing that belongs to creatures.

Items

Items | ResRef | Tag
Azer Clothing | nw_it_creitem195 | NW_IT_CREITEM195
Baelnorn Lich Clothing | nw_it_creitem139 | NW_IT_CREITEM139
Begger Clothes | nw_it_creitem189 | NW_IT_CREITEM189
Blood Sailor Outfit | nw_cloth029 | NW_CLOTH029
Curst Clothing | nw_it_creitem146 | NW_IT_CREITEM146
Curst Leather Armor | nw_it_creitem145 | NW_IT_CREITEM145
Gypsy Mage Clothing | nw_it_creitem061 | NW_IT_CREITEM061
Half-Celestial Full Plate | nw_it_creitem147 | NW_IT_CREITEM147
Half-Fiend Studded Leather Armor | nw_it_creitem148 | NW_IT_CREITEM148
Hound Archon Clothing | nw_it_creitem183 | NW_IT_CREITEM183
Human Bandit Helmet | nw_it_creitem188 | NW_IT_CREITEM188
Human Merc Banded Mail +1 | nw_it_creitem078 | NW_IT_CREITEM078
Human Merc Breastplate | nw_it_creitem076 | NW_IT_CREITEM076
Human Merc Chain Shirt Armor | nw_it_creitem075 | NW_IT_CREITEM075
Human Merc Full Plate +2 | nw_it_creitem080 | NW_IT_CREITEM080
Human Merc Padded Armor | nw_it_creitem073 | NW_IT_CREITEM073
Human Merc Studded Leather Armor | nw_it_creitem074 | NW_IT_CREITEM074
Human Merc Tower Shield +1 | nw_it_creitem077 | NW_IT_CREITEM077
Human Merc Tower Shield +2 | nw_it_creitem079 | NW_IT_CREITEM079
Human Mercenary Helmet | nw_it_creitem194 | NW_IT_CREITEM194
Human Mercenary Helmet | nw_it_creitem191 | NW_IT_CREITEM191
Human Mercenary Helmet | nw_it_creitem192 | NW_IT_CREITEM192
Human Mercenary Helmet | nw_it_creitem193 | NW_IT_CREITEM193
Human Mercenary Helmet | nw_it_creitem190 | NW_IT_CREITEM190
Lich Clothing | nw_it_creitem140 | NW_IT_CREITEM140
Rakshasa Clothing | nw_it_creitem150 | NW_IT_CREITEM150
Revenant Chain Mail +1 | nw_it_creitem149 | NW_IT_CREITEM149
Trumpet Archon Clothes | nw_it_creitem184 | NW_IT_CREITEM184
Vampire Clothing | nw_it_creitem144 | NW_IT_CREITEM144
Vampire Half Plate | nw_it_creitem142 | NW_IT_CREITEM142
Vampire Studded Leather Armor | nw_it_creitem143 | NW_IT_CREITEM143
Yuan-ti Chain Mail | nw_it_creitem084 | NW_IT_CREITEM084
Yuan-ti Clothing | nw_it_creitem085 | NW_IT_CREITEM085
Yuan-ti Leather Armor | nw_it_creitem083 | NW_IT_CREITEM083


Resource.Items - Creature Natural Weapons

Home > Reference > Resources > Items > Creature Natural Weapons

Creature Natural Weapons

Attacks such as claws and bites employable only by creatures.

Items

Items | ResRef | Tag
Allip Claw | nw_it_crewpsp014 | NW_IT_CREWPSP014
Aranea Bite | nw_it_crewps006 | NW_IT_CREWPS006
Battle Devourer Claw | nw_it_crewpsp021 | NW_IT_CREWPSP021
Bite1d10 | nw_it_crewps012 | NW_IT_CREWPS012
Bite1d2 | nw_it_crewps001 | NW_IT_CREWPS001
Bite1d3 | nw_it_crewps014 | NW_IT_CREWPS014
Bite1d4 | nw_it_crewps002 | NW_IT_CREWPS002
Bite1d6 | nw_it_crewps005 | NW_IT_CREWPS005
Bite1d8 | nw_it_crewps010 | NW_IT_CREWPS010
Bite2d10 | nw_it_crewps016 | NW_IT_CREWPS016
Bite2d12 | nw_it_crewps022 | NW_IT_CREWPS022
Bite2d4 | nw_it_crewps003 | NW_IT_CREWPS003
Bite2d6 | nw_it_crewps015 | NW_IT_CREWPS015
Bite2d8 | nw_it_crewps017 | NW_IT_CREWPS017
Bite4d4 | nw_it_crewps021 | NW_IT_CREWPS021
Bite4d6 | nw_it_crewps020 | NW_IT_CREWPS020
Blue Slaad Bite | nw_it_crewps023 | NW_IT_CREWPS023
Claw1d2 | nw_it_crewpsp001 | NW_IT_CREWPSP001
Claw1d3 | nw_it_crewpsp002 | NW_IT_CREWPSP002
Claw1d4 | nw_it_crewpsp026 | NW_IT_CREWPSP026
Claw1d6 | nw_it_crewpsp005 | NW_IT_CREWPSP005
Claw1d8 | nw_it_crewpsp010 | NW_IT_CREWPSP010
Claw2d4 | nw_it_crewpsp006 | NW_IT_CREWPSP006
Claw2d6 | nw_it_crewpsp015 | NW_IT_CREWPSP015
Claw2d8 | nw_it_crewpsp027 | NW_IT_CREWPSP027
Claw3d6 | nw_it_crewpsp016 | NW_IT_CREWPSP016
Claw3d8 | nw_it_crewpsp022 | NW_IT_CREWPSP022
Deadly Giant Spider Bite | nw_it_crewps029 | NW_IT_CREWPS029
Dire Spider Bite | nw_it_crewps019 | NW_IT_CREWPS019
Ettercap Bite | nw_it_crewps011 | NW_IT_CREWPS011
Fire/Magma/Steam Mephit Claw | nw_it_crewpsp004 | NW_IT_CREWPSP004
Ghast Bite | nw_it_crewps026 | NW_IT_CREWPS026
Ghast Claw | nw_it_crewpsp024 | NW_IT_CREWPSP024
Ghoul Bite | nw_it_crewps025 | NW_IT_CREWPS025
Ghoul Claw | nw_it_crewpsp023 | NW_IT_CREWPSP023
Ghoul Lord Bite | nw_it_crewps027 | NW_IT_CREWPS027
Ghoul Lord Claw | nw_it_crewpsp025 | NW_IT_CREWPSP025
Gore1d2 | nw_it_crewpp001 | NW_IT_CREWPP001
Gore1d6 | nw_it_crewpp005 | NW_IT_CREWPP005
Gore1d8 | nw_it_crewpp010 | NW_IT_CREWPP010
Gore2d6 | nw_it_crewpp015 | NW_IT_CREWPP015
Half-Dragon/Half-Fiend Bite | nw_crewphdfbt | NW_CREWPHDFBT
Half-Dragon/Half-Fiend Claw | nw_crewphdfcl | NW_CREWPHDFCL
Ice Mephit Claw | nw_it_crewpsp007 | NW_IT_CREWPSP007
Lich Claw | nw_crewplcl | NW_CREWPLCL
Magmin Claw | nw_it_crewpsp012 | NW_IT_CREWPSP012
Mohrg Bite | nw_it_crewps004 | NW_IT_CREWPS004
Phase Spider Bite | nw_it_crewps007 | NW_IT_CREWPS007
Quasit Claw | nw_it_crewpsp003 | NW_IT_CREWPSP003
Red Slaad Claw | nw_it_crewpsp009 | NW_IT_CREWPSP009
Shadow Claw | nw_it_crewpsp008 | NW_IT_CREWPSP008
Skeletal Devourer Claw | nw_it_crewpsp020 | NW_IT_CREWPSP020
Slam1d2 | nw_it_crewpb001 | NW_IT_CREWPB001
Slam1d6 | nw_it_crewpb005 | NW_IT_CREWPB005
Slam1d8 | nw_it_crewpb010 | NW_IT_CREWPB010
Slam2d10 | nw_it_crewpb017 | NW_IT_CREWPB017
Slam2d6 | nw_it_crewpb015 | NW_IT_CREWPB015
Slam2d8 | nw_it_crewpb016 | NW_IT_CREWPB016
Slam3d8 | nw_it_crewpb019 | NW_IT_CREWPB019
Spectre Claw | nw_it_crewpsp013 | NW_IT_CREWPSP013
Stirge Bite | nw_it_crewps013 | NW_IT_CREWPS013
Sword/Giant Spider Bite | nw_it_crewps018 | NW_IT_CREWPS018
Vampire Bite | nw_crewpvbt | NW_CREWPVBT
Weak Giant Spider Bite | nw_it_crewps028 | NW_IT_CREWPS028
Wraith Claw | nw_it_crewpsp018 | NW_IT_CREWPSP018
Wraith Spider Bite | nw_it_crewps008 | NW_IT_CREWPS008
Zombie, Tyrantfog Claw | nw_it_crewpsp019 | NW_IT_CREWPSP019


Resource.Items - Creature Properties

Home > Reference > Resources > Items > Creature Properties

Creature Properties

Special properties of a creature.

Items

Items | ResRef | Tag
Adult Black Dragon Properties | nw_it_creitemdr3 | NW_IT_CREITEMDR3
Adult Blue Dragon Properties | nw_it_creitemdrc | NW_IT_CREITEMDRC
Adult Brass Dragon Properties | nw_it_creitemdr6 | NW_IT_CREITEMDR6
Adult Bronze Dragon Properties | nw_it_creitemdrf | NW_IT_CREITEMDRF
Adult Copper/Green Dragon Properties | nw_it_creitemdri | NW_IT_CREITEMDRI
Adult Gold Dragon Properties | nw_it_creitemdr2 | NW_IT_CREITEMDR2
Adult Red Dragon Properties | nw_it_creitemdrm | NW_IT_CREITEMDRM
Adult Silver Dragon Properties | nw_it_creitemdrp | NW_IT_CREITEMDRP
Adult White Dragon Properties | nw_it_creitemdrs | NW_IT_CREITEMDRS
Ancient Black Dragon Properties | nw_it_creitemdr5 | NW_IT_CREITEMDR5
Ancient Blue Dragon Properties | nw_it_creitemdre | NW_IT_CREITEMDRE
Ancient Brass Dragon Properties | nw_it_creitemdr8 | NW_IT_CREITEMDR8
Ancient Bronze Dragon Properties | nw_it_creitemdrh | NW_IT_CREITEMDRH
Ancient Copper Dragon Properties | nw_it_creitemdrk | NW_IT_CREITEMDRK
Ancient Gold Dragon Properties | nw_it_creitemdrb | NW_IT_CREITEMDRB
Ancient Green Dragon Properties | nw_it_creitemdrl | NW_IT_CREITEMDRL
Ancient Red Dragon Properties | nw_it_creitemdro | NW_IT_CREITEMDRO
Ancient Silver Dragon Properties | nw_it_creitemdrr | NW_IT_CREITEMDRR
Ancient White Dragon Properties | nw_it_creitemdru | NW_IT_CREITEMDRU
Azer Properties | nw_it_creitem047 | NW_IT_CREITEM047
Balor Properties | nw_it_creitem020 | NW_IT_CREITEM020
Barghest Properties | nw_it_creitem040 | NW_IT_CREITEM040
Bat FM HD 1 Properties | nw_it_creitem101 | NW_IT_CREITEM101
Bat FM HD 10 Properties | nw_it_creitem103 | NW_IT_CREITEM103
Bat FM HD 15 Properties | nw_it_creitem104 | NW_IT_CREITEM104
Bat FM HD 20 Properties | nw_it_creitem105 | NW_IT_CREITEM105
Bat FM HD 5 Properties | nw_it_creitem102 | NW_IT_CREITEM102
Battle Devourer Properties | nw_it_creitem046 | NW_IT_CREITEM046
Beast of Xvim Properties | nw_creitembea | NW_CREITEMBEA
Beast Properties | nw_it_creitem019 | NW_IT_CREITEM019
Bodak Properties | nw_it_creitemunb | NW_IT_CREITEMUNB
Bone Golem Properties | nw_it_creitemco7 | NW_IT_CREITEMCO7
Clay Golem Properties | nw_it_creitemco4 | NW_IT_CREITEMCO4
Construct Properties | nw_it_creitem001 | NW_IT_CREITEM001
Construct Properties | nw_it_creitemcon | NW_IT_CREITEMCON
Crag Cat FM HD 11 Properties | nw_it_creitem088 | NW_IT_CREITEM088
Crag Cat FM HD 16 Properties | nw_it_creitem089 | NW_IT_CREITEM089
Crag Cat FM HD 2 Properties | nw_it_creitem086 | NW_IT_CREITEM086
Crag Cat FM HD 21 Properties | nw_it_creitem090 | NW_IT_CREITEM090
Crag Cat FM HD 6 Properties | nw_it_creitem087 | NW_IT_CREITEM087
Crag Cat Properties | nw_it_creitem081 | NW_IT_CREITEM081
Curst Properties | nw_creitemcur | NW_CREITEMCUR
Death Slaad Properties | nw_it_creitem022 | NW_IT_CREITEM022
Doom Knight Properties | nw_it_creitem048 | NW_IT_CREITEM048
Dragon Properties | nw_it_creitem002 | NW_IT_CREITEM002
Dragon Properties | nw_it_creitemdra | NW_IT_CREITEMDRA
Drow Level 1 Properties |  | nw_it_creitem055
Drow Level 10 Properties |  | nw_it_creitem057
Drow Level 15 Properties |  | nw_it_creitem058
Drow Level 20 Properties |  | nw_it_creitem059
Drow Level 5 Properties |  | nw_it_creitem056
Duergar Properties |  | nw_it_creitem052
Earth/Salt Mephit Properties | nw_it_creitem032 | NW_IT_CREITEM032
Elder Elemental Properties | nw_it_creitemel2 | NW_IT_CREITEMEL2
Elder Fire Elemental Properties | nw_it_creitemel7 | NW_IT_CREITEMEL7
Elder Water Elemental Properties | nw_it_creitemel4 | NW_IT_CREITEMEL4
Elemental Properties | nw_it_creitem003 | NW_IT_CREITEM003
Elemental Properties | nw_it_creitemele | NW_IT_CREITEMELE
Fenhound Properties | nw_it_creitem043 | NW_IT_CREITEM043
Fire Elemental Properties | nw_it_creitemel3 | NW_IT_CREITEMEL3
Fire Giant/Hellhound Properties | nw_it_creitem027 | NW_IT_CREITEM027
Fire Mephit FM HD 1 Properties | nw_it_creitem111 | NW_IT_CREITEM111
Fire Mephit FM HD 10 Properties | nw_it_creitem113 | NW_IT_CREITEM113
Fire Mephit FM HD 15 Properties | nw_it_creitem114 | NW_IT_CREITEM114
Fire Mephit FM HD 20 Properties | nw_it_creitem115 | NW_IT_CREITEM115
Fire Mephit FM HD 5 Properties | nw_it_creitem112 | NW_IT_CREITEM112
Fire/Magma/Steam Mephit Properties | nw_it_creitem049 | NW_IT_CREITEM049
Flesh Golem Properties | nw_it_creitemco2 | NW_IT_CREITEMCO2
Frost Giant/Winter Wolf Properties | nw_it_creitem026 | NW_IT_CREITEM026
Gargoyle Properties | nw_it_creitem030 | NW_IT_CREITEM030
Ghoul Lord Properties | nw_it_creitemunc | NW_IT_CREITEMUNC
Ghoul/Ghast Properties | nw_it_creitemund | NW_IT_CREITEMUND
Gray Slaad Properties | nw_it_creitem041 | NW_IT_CREITEM041
Grig/Nixie/Pixie Properties | nw_it_creitem138 | NW_IT_CREITEM138
Half-Celestial Properties | nw_creitemcel | NW_CREITEMCEL
Half-Fiend Properties | nw_creitemfnd | NW_CREITEMFND
Hellhound FM HD 11 Properties | nw_it_creitem108 | NW_IT_CREITEM108
Hellhound FM HD 16 Properties | nw_it_creitem109 | NW_IT_CREITEM109
Hellhound FM HD 2 Properties | nw_it_creitem106 | NW_IT_CREITEM106
Hellhound FM HD 21 Properties | nw_it_creitem110 | NW_IT_CREITEM110
Hellhound FM HD 6 Properties | nw_it_creitem107 | NW_IT_CREITEM107
Helmed/Battle Horror Properties | nw_it_creitemco6 | NW_IT_CREITEMCO6
Hound Archon Properties | nw_it_creitem182 | NW_IT_CREITEM182
Hound of Xvim Properties | nw_it_creitem141 | NW_IT_CREITEM141
Huge/Greater Elemental Properties | nw_it_creitemel8 | NW_IT_CREITEMEL8
Huge/Greater Fire Elemental Properties | nw_it_creitemel9 | NW_IT_CREITEMEL9
Huge/Greater Water Elemental Properties | nw_it_creitemela | NW_IT_CREITEMELA
Ice Mephit FM HD 1 Properties | nw_it_creitem096 | NW_IT_CREITEM096
Ice Mephit FM HD 10 Properties | nw_it_creitem098 | NW_IT_CREITEM098
Ice Mephit FM HD 15 Properties | nw_it_creitem099 | NW_IT_CREITEM099
Ice Mephit FM HD 20 Properties | nw_it_creitem100 | NW_IT_CREITEM100
Ice Mephit FM HD 5 Properties | nw_it_creitem097 | NW_IT_CREITEM097
Ice Mephit Properties | nw_it_creitem050 | NW_IT_CREITEM050
Imp FM HD 1 Properties | nw_it_creitem116 | NW_IT_CREITEM116
Imp FM HD 10 Properties | nw_it_creitem118 | NW_IT_CREITEM118
Imp FM HD 15 Properties | nw_it_creitem119 | NW_IT_CREITEM119
Imp FM HD 20 Properties | nw_it_creitem120 | NW_IT_CREITEM120
Imp FM HD 5 Properties | nw_it_creitem117 | NW_IT_CREITEM117
Imp Properties | nw_it_creitem023 | NW_IT_CREITEM023
Intellect Devourer Properties | nw_it_creitem034 | NW_IT_CREITEM034
Iron Golem Properties | nw_it_creitemco3 | NW_IT_CREITEMCO3
Lantern Archon Properties | nw_it_creitem028 | NW_IT_CREITEM028
Lich Properties | nw_creitemlic | NW_CREITEMLIC
Lizardfolk Chieftan Properties | nw_it_creitem036 | NW_IT_CREITEM036
Lizardfolk Warrior Properties | nw_it_creitem037 | NW_IT_CREITEM037
Magmin Elemental Properties | nw_it_creitemel5 | NW_IT_CREITEMEL5
Mephit Properties | nw_it_creitem031 | NW_IT_CREITEM031
Mummy Properties | nw_creitemmum | NW_CREITEMMUM
Ogre Mage/Lizardfolk Shaman Properties | nw_it_creitem035 | NW_IT_CREITEM035
Old Black Dragon Properties | nw_it_creitemdr4 | NW_IT_CREITEMDR4
Old Blue Dragon Properties | nw_it_creitemdrd | NW_IT_CREITEMDRD
Old Brass Dragon Properties | nw_it_creitemdr7 | NW_IT_CREITEMDR7
Old Bronze Dragon Properties | nw_it_creitemdrg | NW_IT_CREITEMDRG
Old Copper/Green Dragon Properties | nw_it_creitemdrj | NW_IT_CREITEMDRJ
Old Gold Dragon Properties | nw_it_creitemdr9 | NW_IT_CREITEMDR9
Old Red Dragon Properties | nw_it_creitemdrn | NW_IT_CREITEMDRN
Old Silver Dragon Properties | nw_it_creitemdrq | NW_IT_CREITEMDRQ
Old White Dragon Properties | nw_it_creitemdrt | NW_IT_CREITEMDRT
Orc Shaman/Wizard Properties | nw_it_creitem038 | NW_IT_CREITEM038
Quasit Properties | nw_it_creitem029 | NW_IT_CREITEM029
Rakshasa Properties | nw_it_creitem039 | NW_IT_CREITEM039
Raven/Faerie FM HD 1 Properties | nw_it_creitem091 | NW_IT_CREITEM091
Raven/Faerie FM HD 10 Properties | nw_it_creitem093 | NW_IT_CREITEM093
Raven/Faerie FM HD 15 Properties | nw_it_creitem094 | NW_IT_CREITEM094
Raven/Faerie FM HD 20 Properties | nw_it_creitem095 | NW_IT_CREITEM095
Raven/Faerie FM HD 5 Properties | nw_it_creitem092 | NW_IT_CREITEM092
Red Half-Dragon Properties | nw_creitemhdr | NW_CREITEMHDR
Red/Blue/Green Slaad Properties | nw_it_creitem025 | NW_IT_CREITEM025
Revenant Properties | nw_creitemrev | NW_CREITEMREV
Shadow Fiend Properties | nw_it_creitemun5 | NW_IT_CREITEMUN5
Shadow/Spectre/Allip/Wraith Properties | nw_it_creitemun4 | NW_IT_CREITEMUN4
Shapechanger Properties | nw_it_creitem018 | NW_IT_CREITEM018
Shield Guardian Properties | nw_it_creitemco8 | NW_IT_CREITEMCO8
Silver Half-Dragon Properties | nw_creitemhd2 | NW_CREITEMHD2
Skeletal Devourer Properties | nw_it_creitemuna | NW_IT_CREITEMUNA
Skeleton Mage/Priest Properties | nw_it_creitemun6 | NW_IT_CREITEMUN6
Skeleton Properties | nw_it_creitemune | NW_IT_CREITEMUNE
Skeleton Warrior Properties | nw_it_creitemun7 | NW_IT_CREITEMUN7
Stone Golem Properties | nw_it_creitemco5 | NW_IT_CREITEMCO5
Succubus Properties | nw_it_creitem024 | NW_IT_CREITEM024
Tiefling Properties | nw_it_creitem196 | NW_IT_CREITEM196
Troll Properties | nw_it_creitem042 | NW_IT_CREITEM042
Trumpet Archon Properties | nw_it_creitem045 | NW_IT_CREITEM045
Undead Properties | nw_it_creitem004 | NW_IT_CREITEM004
Undead Properties | nw_it_creitemunh | NW_IT_CREITEMUNH
Vampire Properties | nw_creitemvam | NW_CREITEMVAM
Vampiric Mist Properties | nw_it_creitemel6 | NW_IT_CREITEMEL6
Vermin Properties | nw_it_creitem005 | NW_IT_CREITEM005
Vrock Properties | nw_it_creitem021 | NW_IT_CREITEM021
Warrior/Greater Mummy Properties | nw_it_creitemun3 | NW_IT_CREITEMUN3
Will-O'-Wisp Properties | nw_it_creitem033 | NW_IT_CREITEM033
Wraith Spider Properties | nw_it_creitem051 | NW_IT_CREITEM051
Yuan-ti Properties | nw_it_creitem044 | NW_IT_CREITEM044
Zombie, Tyrantfog Properties | nw_it_creitemun9 | NW_IT_CREITEMUN9


Resource.Items - Creature Special Attack

Home > Reference > Resources > Items > Creature Special Attack

Creature Special Attack

Special attacks employable only by creatures.

Items

Items | ResRef | Tag
Balor Slam | nw_it_crewpb009 | NW_IT_CREWPB009
Elder/Greater/Huge Fire Elemental Slam | nw_it_crewpb018 | NW_IT_CREWPB018
Fire Elemental Slam | nw_it_crewpb006 | NW_IT_CREWPB006
Imp Stinger | nw_it_crewpp016 | NW_IT_CREWPP016
Lantern Archon Lightray | nw_it_crewbs001 | NW_IT_CREWBS001
Mummy Slam | nw_it_crewpb007 | NW_IT_CREWPB007
Vampiric Mist Slam | nw_it_crewpb011 | NW_IT_CREWPB011
Warrior/Greater Mummy Slam | nw_it_crewpb008 | NW_IT_CREWPB008
Wight Slam | nw_it_crewpb002 | NW_IT_CREWPB002
Will-O'-Wisp Shock | nw_it_crewpsp011 | NW_IT_CREWPSP011


Resource.Items - Creature Weapons

Home > Reference > Resources > Items > Creature Weapons

Creature Weapons

Weapons employable by creatures only (not including natural weapons).

Items

Items | ResRef | Tag
Azer Warhammer | nw_it_crewwh001 | NW_IT_CREWWH001
Balor Sword | nw_it_crewsw001 | NW_IT_CREWSW001
Balor Sword | nw_it_crewgs001 | NW_IT_CREWGS001
Bugbear Chieftan/Drow Sword | nw_it_crewbsw01 | NW_IT_CREWBSW01
Doom Knight/Drow Sword | nw_it_crewgs004 | NW_IT_CREWGS004
Ettin Club | nw_it_crewcl003 | NW_IT_CREWCL003
Fire Giant Sword | nw_it_crewls001 | NW_IT_CREWLS001
Gypsy Scimitar | nw_it_crewsc001 | NW_IT_CREWSC001
Gypsy/Elf/Elf Merc Dagger | nw_it_crewda002 | NW_IT_CREWDA002
Helmed Horror Sword | nw_it_crewsw002 | NW_IT_CREWSW002
Helmed/Battle Horror Sword | nw_it_crewgs005 | NW_IT_CREWGS005
Human Merc Morningstar +1 | nw_it_crewms002 | NW_IT_CREWMS002
Ironwood Mace | nw_wdbmma007 | NW_WDBMMA007
Lizardfolk/Yuan-ti Chieftan Sword | nw_it_crewls003 | NW_IT_CREWLS003
Mace of Disruption | nw_wblmml003 | NW_WBLMML003
Minogon Battleaxe | nw_it_crewbx001 | NW_IT_CREWBX001
Minotaur Chief Battleaxe | nw_it_crewbx003 | NW_IT_CREWBX003
Minotaur Chieftain Greataxe | nw_it_crewgx003 | NW_IT_CREWGX003
Minotaur/Frost Giant Battleaxe | nw_it_crewbx002 | NW_IT_CREWBX002
Minotaur/Minogon/Frost Giant Greataxe | nw_it_crewgx002 | NW_IT_CREWGX002
Ogre Chieftain Club | nw_it_crewcl002 | NW_IT_CREWCL002
Ogre Mage/Skeleton Warrior Sword | nw_it_crewgs002 | NW_IT_CREWGS002
Ogre/Hill Giant Club | nw_it_crewcl001 | NW_IT_CREWCL001
Old One Warrior Sword | nw_it_crewls002 | NW_IT_CREWLS002
Orc Chieftan/Bugbear Chieftan/Duergar Greataxe | nw_it_crewgx001 | NW_IT_CREWGX001
Summoned Helmed Horror Sword | nw_it_crewgs006 | NW_IT_CREWGS006
Trumpet Archon Sword | nw_it_crewls005 | NW_IT_CREWLS005


Resource.Items - Crossbows

Home > Reference > Resources > Items > Crossbows

Crossbows

Crossbows.

Items

Items | ResRef | Tag
Crossbow of Accuracy | nw_wbwmxh003 | NW_WBWMXH003
Crossbow of Affliction | nw_wbwmxl003 | NW_WBWMXL003
Crossbow of Enchantment | nw_wbwmxh004 | NW_WBWMXH004
Crossbow of Murder | nw_wbwmxl007 | NW_WBWMXL007
Crossbow of the High Forest | nw_wbwmxl004 | NW_WBWMXL004
Crossbow of the Unicorn | nw_wbwmxl006 | NW_WBWMXL006
Feywarden Crossbow | nw_wbwmxh005 | NW_WBWMXH005
Glorious Revolution | nw_wbwmxh007 | NW_WBWMXH007
Graceblood Bow | nw_wbwmxh006 | NW_WBWMXH006
Heavy Crossbow | nw_wbwxh001 | NW_WBWXH001
Heavy Crossbow +1 | nw_wbwmxh002 | NW_WBWMXH002
Heavy Crossbow +2 | nw_wbwmxh008 | NW_WBWMXH008
Heavy Crossbow +3 | nw_wbwmxh009 | NW_WBWMXH009
Light Crossbow | nw_wbwxl001 | NW_WBWXL001
Light Crossbow +1 | nw_wbwmxl002 | NW_WBWMXL002
Light Crossbow +2 | nw_wbwmxl008 | NW_WBWMXL008
Light Crossbow +3 | nw_wbwmxl009 | NW_WBWMXL009
Ruby Crossbow | nw_wbwmxl005 | NW_WBWMXL005


Resource.Items - Daggers

Home > Reference > Resources > Items > Daggers

Daggers

Daggers.

Items

Items | ResRef | Tag
Courtesan Blade | nw_wswmdg003 | NW_WSWMDG003
Dagger | nw_wswdg001 | NW_WSWDG001
Dagger +1 | nw_wswmdg002 | NW_WSWMDG002
Dagger +2 | nw_wswmdg008 | NW_WSWMDG008
Dagger +3 | nw_wswmdg009 | NW_WSWMDG009
Duergar/Drow/Elf Merc Dagger +1 |  | nw_it_crewda001
Ice Talon | nw_wswmdg004 | NW_WSWMDG004
Leech | nw_wswmdg005 | NW_WSWMDG005
Pixie Lance | nw_wswmdg007 | NW_WSWMDG007
Tagget's Talon | nw_wswmdg006 | NW_WSWMDG006


Resource.Items - Double-Sided

Home > Reference > Resources > Items > Double-Sided

Double-Sided

Double-sided weapons (weapons that can be used in both the on hand and off hand at the same time; dire weapons).

Items

Items | ResRef | Tag
Aiedo Wither-Stick | nw_wdbmqs003 | NW_WDBMQS003
Ardulia's Fall | nw_wdbmma004 | NW_WDBMMA004
Ascorian Double Axe | nw_wdbmax006 | NW_WDBMAX006
Axe for the Tall Kin +1 | nw_wdbmax008 | NW_WDBMAX008
Axe for the Tall Kin +3 | nw_wdbmax009 | NW_WDBMAX009
Blackforest Staff | nw_wdbmqs006 | NW_WDBMQS006
Blade of Corellon | nw_wdbmsw007 | NW_WDBMSW007
Blade of the Red Masque | nw_wdbmsw005 | NW_WDBMSW005
Bloodstone Double Axe | nw_wdbmax007 | NW_WDBMAX007
Death Shroud Axe | nw_wdbmax005 | NW_WDBMAX005
Dire Mace | nw_wdbma001 | NW_WDBMA001
Dire Mace +1 | nw_wdbmma002 | NW_WDBMMA002
Dire Mace +2 | nw_wdbmma010 | NW_WDBMMA010
Dire Mace +3 | nw_wdbmma011 | NW_WDBMMA011
Double Axe | nw_wdbax001 | NW_WDBAX001
Double Axe +1 | nw_wdbmax002 | NW_WDBMAX002
Double Axe +2 | nw_wdbmax010 | NW_WDBMAX010
Double Axe +3 | nw_wdbmax011 | NW_WDBMAX011
Duergar/Drow Quarterstaff +3 |  | nw_it_crewqs001
Ebon Dire Mace | nw_wdbmma006 | NW_WDBMMA006
Ironwood Mace +1 | nw_wdbmma008 | NW_WDBMMA008
Ironwood Mace +3 | nw_wdbmma009 | NW_WDBMMA009
Krotan's Skullcrusher | nw_wdbmma003 | NW_WDBMMA003
Negastaff | nw_wdbmqs004 | NW_WDBMQS004
Quarterstaff | nw_wdbqs001 | NW_WDBQS001
Quarterstaff +1 | nw_wdbmqs002 | NW_WDBMQS002
Quarterstaff +2 | nw_wdbmqs008 | NW_WDBMQS008
Quarterstaff +3 | nw_wdbmqs009 | NW_WDBMQS009
Red Tiger Double Axe | nw_wdbmax003 | NW_WDBMAX003
Red Tiger Double Axe | nw_wdbmax004 | NW_WDBMAX004
Staff of Ascension | nw_wdbmqs007 | NW_WDBMQS007
Staff of Curing | nw_wdbmqs005 | NW_WDBMQS005
Stoutcorps Key | nw_wdbmma005 | NW_WDBMMA005
Sword of Bao | nw_wdbmsw006 | NW_WDBMSW006
Sword of Lyons | nw_wdbmsw004 | NW_WDBMSW004
Sword of Lyons | nw_wdbmsw003 | NW_WDBMSW003
Two-Bladed Sword | nw_wdbsw001 | NW_WDBSW001
Two-Bladed Sword +1 | nw_wdbmsw002 | NW_WDBMSW002
Two-Bladed Sword +2 | nw_wdbmsw010 | NW_WDBMSW010
Two-Bladed Sword +3 | nw_wdbmsw011 | NW_WDBMSW011
Uthgardt Ceremonial Blade +1 | nw_wdbmsw008 | NW_WDBMSW008
Uthgardt Ceremonial Blade +2 | nw_wdbmsw009 | NW_WDBMSW009


Resource.Items - Exotic

Home > Reference > Resources > Items > Exotic

Exotic

Exotic weapons.

Items

Items | ResRef | Tag
Blacksoul Sickle | nw_wspmsc004 | NW_WSPMSC004
Blightbringer Lineage | nw_wspmsc003 | NW_WSPMSC003
Cutting Star | nw_wspmku005 | NW_WSPMKU005
Empty Fields | nw_wspmka006 | NW_WSPMKA006
Golden Sickle +1 | nw_wspmsc008 | NW_WSPMSC008
Golden Sickle +2 | nw_wspmsc009 | NW_WSPMSC009
Hideo's Kama | nw_wspmka004 | NW_WSPMKA004
Imaskari Kama | nw_wspmka007 | NW_WSPMKA007
Kama | nw_wspka001 | NW_WSPKA001
Kama +1 | nw_wspmka002 | NW_WSPMKA002
Kama +2 | nw_wspmka008 | NW_WSPMKA008
Kama +3 | nw_wspmka009 | NW_WSPMKA009
Kukri | nw_wspku001 | NW_WSPKU001
Kukri +1 | nw_wspmku002 | NW_WSPMKU002
Kukri +2 | nw_wspmku008 | NW_WSPMKU008
Kukri +3 | nw_wspmku009 | NW_WSPMKU009
Ladymist Talon | nw_wspmku003 | NW_WSPMKU003
Messenger Blade | nw_wspmku007 | NW_WSPMKU007
Neverwinter Kukri | nw_wspmku004 | NW_WSPMKU004
Peasant Dynasty | nw_wspmka005 | NW_WSPMKA005
Rod of Beguiling | nw_wmgmrd004 | NW_WMGMRD004
Rod of Frost | nw_wmgmrd006 | nw_wmgmrd006
Rod of Resurrection | nw_wmgmrd002 | NW_WMGMRD002
Rod of Reversal | nw_wmgmrd005 | NW_WMGMRD005
Rod of Terror | nw_wmgmrd003 | NW_WMGMRD003
Rod of the Ghost | nw_wmgrd002 | NW_WMGRD002
Sharpshadow Blade | nw_wspmku006 | NW_WSPMKU006
Sickle | nw_wspsc001 | NW_WSPSC001
Sickle +1 | nw_wspmsc002 | NW_WSPMSC002
Sickle +2 | nw_wspmsc010 | NW_WSPMSC010
Sickle +3 | nw_wspmsc011 | NW_WSPMSC011
Sickle of Holy Mourning | nw_wspmsc005 | NW_WSPMSC005
Staff of Command | nw_wmgst002 | NW_WMGST002
Staff of Defense | nw_wmgst004 | NW_WMGST004
Staff of Power | nw_wmgst005 | NW_WMGST005
Staff of the Holy | nw_wmgst006 | NW_WMGST006
Staff of the Magi | nw_wmgst003 | NW_WMGST003
Staff of Valmaxian | nw_it_novel008 | NW_IT_NOVEL008
Teneraard's Sickle | nw_wspmsc006 | NW_WSPMSC006
Teneraard's Sickle | nw_wspmsc007 | NW_WSPMSC007
Thread of Life | nw_wspmka003 | NW_WSPMKA003
Wand of Arcane Disjunction | nw_wmgwn011 | NW_WMGWN011
Wand of Fear | nw_wmgwn003 | NW_WMGWN003
Wand of Fire | nw_wmgwn002 | NW_WMGWN002
Wand of Lesser Summoning | nw_wmgwn013 | NW_WMGWN013
Wand of Lightning | nw_wmgwn007 | NW_WMGWN007
Wand of Missiles | nw_wmgwn004 | NW_WMGWN004
Wand of Negative Energy | nw_wmgwn006 | NW_WMGWN006
Wand of Paralyzation | nw_wmgwn005 | NW_WMGWN005
Wand of Sleep | nw_wmgwn012 | nw_wmgwn012
Wand of Stinking Cloud | nw_wmgwn010 | NW_WMGWN010
Wand of Summoning | nw_wmgwn008 | NW_WMGWN008
Wand of the Heavens | nw_wmgwn009 | NW_WMGWN009


Resource.Items - Flails

Home > Reference > Resources > Items > Flails

Flails

Flails.

Items

Items | ResRef | Tag
Asp Flail | nw_wblmfh004 | NW_WBLMFH004
Dwarf Heavy Flail +1 |  | nw_it_crewhf002
Eberond's Flail | nw_wblmfl007 | NW_WBLMFL007
Flail of Destruction | nw_wblmfl006 | NW_WBLMFL006
Flail of Jergal | nw_wblmfh003 | NW_WBLMFH003
Flail of Stars | nw_wblmfh005 | NW_WBLMFH005
Foundation | nw_wblmfl003 | NW_WBLMFL003
Foundation +1 | nw_wblmfl008 | NW_WBLMFL008
Foundation +4 | nw_wblmfl009 | NW_WBLMFL009
Heavy Flail | nw_wblfh001 | NW_WBLFH001
Heavy Flail +1 | nw_wblmfh002 | NW_WBLMFH002
Heavy Flail +2 | nw_wblmfh010 | NW_WBLMFH010
Heavy Flail +3 | nw_wblmfh011 | NW_WBLMFH011
Heirs of Osiris | nw_wblmfl005 | NW_WBLMFL005
Kintharsta | nw_wblmfh006 | NW_WBLMFH006
Kintharsta | nw_wblmfh007 | NW_WBLMFH007
Light Flail | nw_wblfl001 | NW_WBLFL001
Light Flail +1 | nw_wblmfl002 | NW_WBLMFL002
Light Flail +2 | nw_wblmfl010 | NW_WBLMFL010
Light Flail +3 | nw_wblmfl011 | NW_WBLMFL011
Reaver +1 | nw_wblmfh008 | NW_WBLMFH008
Reaver +2 | nw_wblmfh009 | NW_WBLMFH009
Writ of the Vizier | nw_wblmfl004 | NW_WBLMFL004


Resource.Items - Gauntlets

Home > Reference > Resources > Items > Gauntlets

Gauntlets

Magical guantlets

Items

Items | ResRef | Tag
Gauntlets of Locking Grip | nw_it_mglove002 | NW_IT_MGLOVE002
Gauntlets of Locking Grip | nw_it_mbracer011 | NW_IT_MBRACER011
Gauntlets of Ogre Power | nw_it_mbracer013 | NW_IT_MBRACER013
Gloves of Animal Handling | nw_it_mglove006 | nw_it_mglove006
Gloves of Concentration | nw_it_mglove004 | nw_it_mglove004
Gloves of Discipline | nw_it_mglove008 | nw_it_mglove008
Gloves of Spellcraft | nw_it_mglove007 | nw_it_mglove007
Gloves of Swordplay | nw_it_mglove009 | nw_it_mglove009
Gloves of the Hin Fist +1 | nw_it_mglove016 | NW_IT_MGLOVE016
Gloves of the Hin Fist +2 | nw_it_mglove017 | NW_IT_MGLOVE017
Gloves of the Hin Fist +3 | nw_it_mglove018 | NW_IT_MGLOVE018
Gloves of the Hin Fist +4 | nw_it_mglove019 | NW_IT_MGLOVE019
Gloves of the Hin Fist +5 | nw_it_mglove020 | NW_IT_MGLOVE020
Gloves of the Long Death +1 | nw_it_mglove021 | NW_IT_MGLOVE021
Gloves of the Long Death +2 | nw_it_mglove022 | NW_IT_MGLOVE022
Gloves of the Long Death +3 | nw_it_mglove023 | NW_IT_MGLOVE023
Gloves of the Long Death +4 | nw_it_mglove024 | NW_IT_MGLOVE024
Gloves of the Long Death +5 | nw_it_mglove025 | NW_IT_MGLOVE025
Gloves of the Minstrel | nw_it_mglove005 | nw_it_mglove005
Gloves of the Rogue | nw_it_mglove003 | NW_IT_MGLOVE003
Gloves of the Yellow Rose +1 | nw_it_mglove026 | NW_IT_MGLOVE026
Gloves of the Yellow Rose +2 | nw_it_mglove027 | NW_IT_MGLOVE027
Gloves of the Yellow Rose +3 | nw_it_mglove028 | NW_IT_MGLOVE028
Gloves of the Yellow Rose +4 | nw_it_mglove029 | NW_IT_MGLOVE029
Gloves of the Yellow Rose +5 | nw_it_mglove030 | NW_IT_MGLOVE030
Greater Gloves of Animal Handling | nw_it_mglove012 | nw_it_mglove012
Greater Gloves of Concentration | nw_it_mglove010 | nw_it_mglove010
Greater Gloves of Discipline | nw_it_mglove014 | nw_it_mglove014
Greater Gloves of Spellcraft | nw_it_mglove013 | nw_it_mglove013
Greater Gloves of Swordplay | nw_it_mglove015 | nw_it_mglove015
Greater Gloves of the Minstrel | nw_it_mglove011 | nw_it_mglove011
Lesser Gauntlets of Ogre Power | nw_it_mbracer012 | NW_IT_MBRACER012
Wondrous Gloves | nw_it_mglove001 | NW_IT_MGLOVE001


Resource.Items - Gems

Home > Reference > Resources > Items > Gems

Gems

Valuable gems.

Items

Items | ResRef | Tag
Alexandrite | nw_it_gem013 | NW_IT_GEM013
Amethyst | nw_it_gem003 | NW_IT_GEM003
Aventurine | nw_it_gem014 | NW_IT_GEM014
Diamond | nw_it_gem005 | NW_IT_GEM005
Emerald | nw_it_gem012 | NW_IT_GEM012
Fire Agate | nw_it_gem002 | NW_IT_GEM002
Fire Opal | nw_it_gem009 | NW_IT_GEM009
Fluorspar | nw_it_gem015 | NW_IT_GEM015
Garnet | nw_it_gem011 | NW_IT_GEM011
Greenstone | nw_it_gem001 | NW_IT_GEM001
Malachite | nw_it_gem007 | NW_IT_GEM007
Phenalope | nw_it_gem004 | NW_IT_GEM004
Ruby | nw_it_gem006 | NW_IT_GEM006
Sapphire | nw_it_gem008 | NW_IT_GEM008
Topaz | nw_it_gem010 | NW_IT_GEM010


Resource.Items - Hammers

Home > Reference > Resources > Items > Hammers

Hammers

Hammers.

Items

Items | ResRef | Tag
Daraz Hammer | nw_wblmhl004 | NW_WBLMHL004
Duergar Warhammer +1 |  | nw_it_crewwh002
Dwarf Warhammer +3 |  | nw_it_crewwh003
Forge Fire | nw_wblmhl006 | NW_WBLMHL006
Hammer of Blasting | nw_wblmhl003 | NW_WBLMHL003
Hammer of Justice | nw_wblmhw006 | NW_WBLMHW006
Hammer of the Beast | nw_wblmhl005 | NW_WBLMHL005
Hammer of the Wisp | nw_wblmhw003 | NW_WBLMHW003
Hammer of Thunderbolt | nw_wblmhw004 | NW_WBLMHW004
Light Hammer | nw_wblhl001 | NW_WBLHL001
Light Hammer +1 | nw_wblmhl002 | NW_WBLMHL002
Light Hammer +2 | nw_wblmhl010 | NW_WBLMHL010
Light Hammer +3 | nw_wblmhl011 | NW_WBLMHL011
Rift Hammer | nw_wblmhw005 | NW_WBLMHW005
Rune Hammer | nw_wblmhw008 | NW_WBLMHW008
Rune Hammer +1 | nw_wblmhw009 | NW_WBLMHW009
Rune Hammer +2 | nw_wblmhw010 | NW_WBLMHW010
Storm | nw_wblmhl007 | NW_WBLMHL007
Storm +1 | nw_wblmhl008 | NW_WBLMHL008
Storm +2 | nw_wblmhl009 | NW_WBLMHL009
Warhammer | nw_wblhw001 | NW_WBLHW001
Warhammer +1 | nw_wblmhw002 | NW_WBLMHW002
Warhammer +2 | nw_wblmhw011 | NW_WBLMHW011
Warhammer +3 | nw_wblmhw012 | NW_WBLMHW012


Resource.Items - Jewelry

Home > Reference > Resources > Items > Jewelry

Jewelry

Jewelry.

Items

Items | ResRef | Tag
Amulet of Acid Resistance | nw_it_mneck032 | nw_it_mneck032
Amulet of Cold Resistance | nw_it_mneck030 | nw_it_mneck030
Amulet of Electrical Resistance | nw_it_mneck031 | nw_it_mneck031
Amulet of Fire Resistance | nw_it_mneck029 | nw_it_mneck029
Amulet of Health | nw_it_mneck036 | NW_IT_MNECK036
Amulet of Natural Armor +1 | nw_it_mneck001 | NW_IT_MNECK001
Amulet of Natural Armor +2 | nw_it_mneck012 | NW_IT_MNECK012
Amulet of Natural Armor +3 | nw_it_mneck013 | NW_IT_MNECK013
Amulet of Natural Armor +4 | nw_it_mneck014 | NW_IT_MNECK014
Amulet of Natural Armor +5 | nw_it_mneck015 | NW_IT_MNECK015
Amulet of Power | nw_it_mneck005 | NW_IT_MNECK005
Amulet of Red Tiger Tribe +1 | nw_hen_dae1rw | NW_HEN_DAE1RW
Amulet of Red Tiger Tribe +3 | nw_hen_dae2rw | NW_HEN_DAE2RW
Amulet of the Long Death +1 | nw_hen_gri1rw | NW_HEN_GRI1RW
Amulet of the Long Death +3 | nw_hen_gri2rw | NW_HEN_GRI2RW
Amulet of the Master | nw_it_mneck034 | NW_IT_MNECK034
Amulet of the Silent Lord +4 | nw_hen_gri3rw | NW_HEN_GRI3RW
Amulet of the Uthgardt +4 | nw_hen_dae3rw | NW_HEN_DAE3RW
Amulet of Will +1 | nw_it_mneck024 | nw_it_mneck024
Amulet of Will +2 | nw_it_mneck025 | nw_it_mneck025
Amulet of Will +3 | nw_it_mneck026 | nw_it_mneck026
Amulet of Will +4 | nw_it_mneck027 | nw_it_mneck027
Amulet of Will +5 | nw_it_mneck028 | nw_it_mneck028
Copper Necklace | nw_it_mneck020 | NW_IT_MNECK020
Copper Ring | nw_it_mring021 | NW_IT_MRING021
Glittering Necklace | nw_it_mneck023 | NW_IT_MNECK023
Gold Necklace | nw_it_mneck022 | NW_IT_MNECK022
Gold Ring | nw_it_mring023 | NW_IT_MRING023
Greater Amulet of Health | nw_it_mneck037 | NW_IT_MNECK037
Lantanese Ring +1 | nw_hen_bod1rw | NW_HEN_BOD1RW
Lantanese Ring +3 | nw_hen_bod2rw | NW_HEN_BOD2RW
Lesser Amulet of Health | nw_it_mneck035 | NW_IT_MNECK035
Lesser Amulet of the Master | nw_it_mneck033 | NW_IT_MNECK033
Lesser Ring of Power | nw_it_mring029 | NW_IT_MRING029
Necklace of Prayer Beads | nw_it_mneck003 | NW_IT_MNECK003
Pendant of the Elf +1 | nw_hen_lin1rw | NW_HEN_LIN1RW
Pendant of the Elf +3 | nw_hen_lin2rw | NW_HEN_LIN2RW
Pendant of the Elf +4 | nw_hen_lin3rw | NW_HEN_LIN3RW
Periapt of Wisdom +1 | nw_it_mneck007 | NW_IT_MNECK007
Periapt of Wisdom +2 | nw_it_mneck008 | NW_IT_MNECK008
Periapt of Wisdom +3 | nw_it_mneck009 | NW_IT_MNECK009
Periapt of Wisdom +4 | nw_it_mneck010 | NW_IT_MNECK010
Periapt of Wisdom +5 | nw_it_mneck011 | NW_IT_MNECK011
Prophyro's Ring +4 | nw_hen_bod3rw | NW_HEN_BOD3RW
Ring of Clear Thought +1 | nw_it_mring006 | NW_IT_MRING006
Ring of Clear Thought +2 | nw_it_mring014 | NW_IT_MRING014
Ring of Clear Thought +3 | nw_it_mring015 | NW_IT_MRING015
Ring of Clear Thought +4 | nw_it_mring016 | NW_IT_MRING016
Ring of Clear Thought +5 | nw_it_mring017 | NW_IT_MRING017
Ring of Crimson | nw_it_mring010 | NW_IT_MRING010
Ring of Cyan | nw_it_mring009 | NW_IT_MRING009
Ring of Elemental Resistance | nw_it_mring002 | NW_IT_MRING002
Ring of Fortitude +1 | nw_it_mring024 | nw_it_mring024
Ring of Fortitude +2 | nw_it_mring025 | nw_it_mring025
Ring of Fortitude +3 | nw_it_mring026 | nw_it_mring026
Ring of Fortitude +4 | nw_it_mring027 | nw_it_mring027
Ring of Fortitude +5 | nw_it_mring028 | nw_it_mring028
Ring of Holiness | nw_it_mring007 | NW_IT_MRING007
Ring of Insight | nw_it_mring012 | NW_IT_MRING012
Ring of Invisibility | nw_it_mring003 | NW_IT_MRING003
Ring of Jade | nw_it_mring011 | NW_IT_MRING011
Ring of Magic Defences | nw_it_mring005 | NW_IT_MRING005
Ring of Power | nw_it_mring030 | NW_IT_MRING030
Ring of Protection +1 | nw_it_mring001 | NW_IT_MRING001
Ring of Protection +2 | nw_it_mring008 | NW_IT_MRING008
Ring of Protection +3 | nw_it_mring018 | NW_IT_MRING018
Ring of Protection +4 | nw_it_mring019 | NW_IT_MRING019
Ring of Protection +5 | nw_it_mring020 | NW_IT_MRING020
Ring of Regeneration | nw_it_mring004 | NW_IT_MRING004
Ring of Resistance +1 | nw_it_mring031 | NW_IT_MRING031
Ring of Resistance +2 | nw_it_mring032 | NW_IT_MRING032
Ring of Resistance +3 | nw_it_mring033 | NW_IT_MRING033
Ring of Scholars | nw_it_mring013 | NW_IT_MRING013
Ring of the Rogue +1 | nw_hen_gal1rw | NW_HEN_GAL1RW
Ring of the Rogue +3 | nw_hen_gal2rw | NW_HEN_GAL2RW
Ring of the Rogue +4 | nw_hen_gal3rw | NW_HEN_GAL3RW
Ring of the Wood Elves | nw_it_novel001 | NW_IT_NOVEL001
Scarab of Protection +1 | nw_it_mneck006 | NW_IT_MNECK006
Scarab of Protection +2 | nw_it_mneck016 | NW_IT_MNECK016
Scarab of Protection +3 | nw_it_mneck017 | NW_IT_MNECK017
Scarab of Protection +4 | nw_it_mneck018 | NW_IT_MNECK018
Scarab of Protection +5 | nw_it_mneck019 | NW_IT_MNECK019
Silver Necklace | nw_it_mneck021 | NW_IT_MNECK021
Silver Ring | nw_it_mring022 | NW_IT_MRING022
Talisman of Pure Evil | nw_it_mneck002 | NW_IT_MNECK002
Talisman of Pure Good | nw_it_mneck004 | NW_IT_MNECK004


Resource.Items - Kits

Home > Reference > Resources > Items > Kits

Kits

Traps and craft kits.

Items

Items | ResRef | Tag
Average Acid Splash Trap Kit | nw_it_trap034 | NW_IT_TRAP034
Average Blob of Acid Trap Kit | nw_it_trap014 | NW_IT_TRAP014
Average Electrical Trap Kit | nw_it_trap022 | NW_IT_TRAP022
Average Fire Trap Kit | nw_it_trap018 | NW_IT_TRAP018
Average Frost Trap Kit | nw_it_trap030 | NW_IT_TRAP030
Average Gas Trap Kit | nw_it_trap026 | NW_IT_TRAP026
Average Holy Trap Kit | nw_it_trap006 | NW_IT_TRAP006
Average Negative Trap | nw_it_trap042 | NW_IT_TRAP042
Average Sonic Trap Kit | nw_it_trap038 | NW_IT_TRAP038
Average Spike Trap Kit | nw_it_trap002 | NW_IT_TRAP002
Average Tangle Trap Kit | nw_it_trap010 | NW_IT_TRAP010
Deadly Acid Splash Trap Kit | nw_it_trap036 | NW_IT_TRAP036
Deadly Blob of Acid Trap Kit | nw_it_trap016 | NW_IT_TRAP016
Deadly Electrical Trap Kit | nw_it_trap024 | NW_IT_TRAP024
Deadly Fire Trap Kit | nw_it_trap020 | NW_IT_TRAP020
Deadly Frost Trap Kit | nw_it_trap032 | NW_IT_TRAP032
Deadly Gas Trap Kit | nw_it_trap028 | NW_IT_TRAP028
Deadly Holy Trap Kit | nw_it_trap008 | NW_IT_TRAP008
Deadly Negative Trap Kit | nw_it_trap044 | NW_IT_TRAP044
Deadly Sonic Trap Kit | nw_it_trap040 | NW_IT_TRAP040
Deadly Spike Trap Kit | nw_it_trap004 | NW_IT_TRAP004
Deadly Tangle Trap Kit | nw_it_trap012 | NW_IT_TRAP012
Healer's Kit +1 | nw_it_medkit001 | NW_IT_MEDKIT001
Healer's Kit +10 | nw_it_medkit004 | NW_IT_MEDKIT004
Healer's Kit +3 | nw_it_medkit002 | NW_IT_MEDKIT002
Healer's Kit +6 | nw_it_medkit003 | NW_IT_MEDKIT003
Minor Acid Splash Trap | nw_it_trap033 | NW_IT_TRAP033
Minor Blob of Acid Trap Kit | nw_it_trap013 | NW_IT_TRAP013
Minor Electrical Trap Kit | nw_it_trap021 | NW_IT_TRAP021
Minor Fire Trap Kit | nw_it_trap017 | NW_IT_TRAP017
Minor Frost Trap Kit | nw_it_trap029 | NW_IT_TRAP029
Minor Gas Trap Kit | nw_it_trap025 | NW_IT_TRAP025
Minor Holy Trap Kit | nw_it_trap005 | NW_IT_TRAP005
Minor Negative Trap Kit | nw_it_trap041 | NW_IT_TRAP041
Minor Sonic Trap Kit | nw_it_trap037 | NW_IT_TRAP037
Minor Spike Trap Kit | nw_it_trap001 | NW_IT_TRAP001
Minor Tangle Trap Kit | nw_it_trap009 | NW_IT_TRAP009
Strong Acid Splash Trap | nw_it_trap035 | NW_IT_TRAP035
Strong Blob of Acid Trap Kit | nw_it_trap015 | NW_IT_TRAP015
Strong Electrical Trap Kit | nw_it_trap023 | NW_IT_TRAP023
Strong Fire Trap Kit | nw_it_trap019 | NW_IT_TRAP019
Strong Frost Trap Kit | nw_it_trap031 | NW_IT_TRAP031
Strong Gas Trap Kit | nw_it_trap027 | NW_IT_TRAP027
Strong Holy Trap Kit | nw_it_trap007 | NW_IT_TRAP007
Strong Negative Trap Kit | nw_it_trap043 | NW_IT_TRAP043
Strong Sonic Trap Kit | nw_it_trap039 | NW_IT_TRAP039
Strong Spike Trap Kit | nw_it_trap003 | NW_IT_TRAP003
Strong Tangle Trap Kit | nw_it_trap011 | NW_IT_TRAP011


Resource.Items - Longbows

Home > Reference > Resources > Items > Longbows

Longbows

Longbows.

Items

Items | ResRef | Tag
Composite Longbow +1 | nw_wbwmln010 | NW_WBWMLN010
Composite Longbow +2 | nw_wbwmln011 | NW_WBWMLN011
Composite Longbow +3 | nw_wbwmln012 | NW_WBWMLN012
Elven Court Bow | nw_wbwmln004 | NW_WBWMLN004
Longarm | nw_wbwmln006 | NW_WBWMLN006
Longbow | nw_wbwln001 | NW_WBWLN001
Longbow +1 | nw_wbwmln002 | NW_WBWMLN002
Longbow +2 | nw_wbwmln008 | NW_WBWMLN008
Longbow +3 | nw_wbwmln009 | NW_WBWMLN009
North Wind Bow | nw_wbwmln007 | NW_WBWMLN007
Ripper | nw_wbwmln005 | NW_WBWMLN005
Taralash | nw_wbwmln003 | NW_WBWMLN003


Resource.Items - Maces

Home > Reference > Resources > Items > Maces

Maces

Maces.

Items

Items | ResRef | Tag
Duergar/Drow Mace +1 |  | nw_it_crewma001
Fist of the Legion | nw_wblmml006 | NW_WBLMML006
Kiss of Sune | nw_wblmml004 | NW_WBLMML004
Mace | nw_wblml001 | NW_WBLML001
Mace +1 | nw_wblmml002 | NW_WBLMML002
Mace +2 | nw_wblmml011 | NW_WBLMML011
Mace +3 | nw_wblmml012 | NW_WBLMML012
Mace of Disruption +2 | nw_wblmml009 | NW_WBLMML009
Mace of Disruption +5 | nw_wblmml010 | NW_WBLMML010
Petty's Tempest | nw_wblmml007 | NW_WBLMML007
Planar Mace | nw_wblmml005 | NW_WBLMML005
Soldier's Might | nw_wblmml008 | NW_WBLMML008


Resource.Items - Morningstars

Home > Reference > Resources > Items > Morningstars

Morningstars

Morningstars.

Items

Items | ResRef | Tag
Bone Phoenix | nw_wblmms003 | NW_WBLMMS003
Circling Star | nw_wblmms006 | NW_WBLMMS006
Drone +1 | nw_wblmms008 | NW_WBLMMS008
Drone +4 | nw_wblmms009 | NW_WBLMMS009
Duergar/Drow/Human Merc Morningstar +3 |  | nw_it_crewms001
Morningstar | nw_wblms001 | NW_WBLMS001
Morningstar +1 | nw_wblmms002 | NW_WBLMMS002
Morningstar +2 | nw_wblmms010 | NW_WBLMMS010
Morningstar +3 | nw_wblmms011 | NW_WBLMMS011
One of Many | nw_wblmms007 | NW_WBLMMS007
Sleepwalker Kin | nw_wblmms004 | NW_WBLMMS004


Resource.Items - Nunchaku

Home > Reference > Resources > Items > Nunchaku

Nunchaku

Nunchakus.

Items

Items | ResRef | Tag
Beautiful Death | nw_wspmnn006 | NW_WSPMNN006
Chained Lightning | nw_wspmnn005 | NW_WSPMNN005
Dazzling Lights Nunchaku | nw_wspmnn004 | NW_WSPMNN004
Nunchaku | nw_wspmnn001 | NW_WSPMNN001
Nunchaku +1 | nw_wspmnn002 | NW_WSPMNN002
Nunchaku +2 | nw_wspmnn008 | NW_WSPMNN008
Nunchaku +3 | nw_wspmnn009 | NW_WSPMNN009
Trouble's Braids | nw_wspmnn007 | NW_WSPMNN007


Resource.Items - Other

Home > Reference > Resources > Items > Other

Other

Miscellaneous items.

Items

Items | ResRef | Tag
Adamantine | nw_it_msmlmisc16 | NW_IT_MSMLMISC16
Bag of Holding | nw_it_contain006 | NW_IT_CONTAIN006
Belladonna | nw_it_msmlmisc23 | NW_IT_MSMLMISC23
Bodak's Tooth | nw_it_msmlmisc06 | NW_IT_MSMLMISC06
Dragon Blood | nw_it_msmlmisc17 | NW_IT_MSMLMISC17
Empty Ale Stein | nw_it_thnmisc002 | NW_IT_THNMISC002
Empty Bottle | nw_it_thnmisc001 | NW_IT_THNMISC001
Empty Spirits Bottle | nw_it_thnmisc003 | NW_IT_THNMISC003
Empty Wine Bottle | nw_it_thnmisc004 | NW_IT_THNMISC004
Ettercap's Silk Gland | nw_it_msmlmisc07 | NW_IT_MSMLMISC07
Fairy Dust | nw_it_msmlmisc19 | NW_IT_MSMLMISC19
Fenberry | nw_it_msmlmisc12 | NW_IT_MSMLMISC12
Fire Beetle's Belly | nw_it_msmlmisc08 | NW_IT_MSMLMISC08
Fish | nw_it_msmlmisc20 | NW_IT_MSMLMISC20
Gargoyle Skull | nw_it_msmlmisc14 | NW_IT_MSMLMISC14
Garlic | nw_it_msmlmisc24 | NW_IT_MSMLMISC24
Gold Piece | nw_it_gold001 | NW_IT_GOLD001
Harp of Charming | nw_it_mmidmisc01 | NW_IT_MMIDMISC01
Harp of Charming | nw_it_msmlmisc01 | NW_IT_MSMLMISC01
Harp of Haunting | nw_it_msmlmisc02 | NW_IT_MSMLMISC02
Harp of Haunting | nw_it_mmidmisc02 | NW_IT_MMIDMISC02
Harp of Pandemonium | nw_it_mmidmisc03 | NW_IT_MMIDMISC03
Harp of Pandemonium | nw_it_msmlmisc03 | NW_IT_MSMLMISC03
Instrument of the Winds | nw_it_novel002 | NW_IT_NOVEL002
Ironwood | nw_it_msmlmisc18 | NW_IT_MSMLMISC18
Large Box | nw_it_contain001 | NW_IT_CONTAIN001
Magic Bag | nw_it_contain002 | NW_IT_CONTAIN002
Magic Bag | nw_it_contain003 | NW_IT_CONTAIN003
Magic Bag | nw_it_contain004 | NW_IT_CONTAIN004
Magic Bag | nw_it_contain005 | NW_IT_CONTAIN005
Meat | nw_it_mmidmisc05 | NW_IT_MMIDMISC05
Quartz Crystal | nw_it_msmlmisc11 | NW_IT_MSMLMISC11
Rags | nw_it_msmlmisc21 | NW_IT_MSMLMISC21
Rakshasa's Eye | nw_it_msmlmisc09 | NW_IT_MSMLMISC09
Saintsblood Pearl | nw_it_msmlmisc05 | NW_IT_MSMLMISC05
Scabbard of Blessing | nw_it_mmidmisc04 | NW_IT_MMIDMISC04
Scabbard of Blessing | nw_it_msmlmisc04 | NW_IT_MSMLMISC04
Skeleton's Knuckle | nw_it_msmlmisc13 | NW_IT_MSMLMISC13
Skin | nw_it_mmidmisc06 | NW_IT_MMIDMISC06
Slaad's Tongue | nw_it_msmlmisc10 | NW_IT_MSMLMISC10
Special Holy Water | nw_it_msmlmisc15 | NW_IT_MSMLMISC15
Thieves' Tools +1 | nw_it_picks001 | NW_IT_PICKS001
Thieves' Tools +10 | nw_it_picks004 | NW_IT_PICKS004
Thieves' Tools +3 | nw_it_picks002 | NW_IT_PICKS002
Thieves' Tools +6 | nw_it_picks003 | NW_IT_PICKS003
Torch | nw_it_torch001 | NW_IT_TORCH001


Resource.Items - Other Bladed Weapons

Home > Reference > Resources > Items > Other Bladed Weapons

Other Bladed Weapons

Other bladed weapons (various types of swords).

Items

Items | ResRef | Tag
Black Rider Quill | nw_wswmrp003 | NW_WSWMRP003
Black Rider Quill | nw_wswmrp004 | NW_WSWMRP004
Blade of the Elements | nw_wswmka007 | NW_WSWMKA007
Bleederkin | nw_wswmrp006 | NW_WSWMRP006
Celestial Fury | nw_wswmka003 | NW_WSWMKA003
Desert Wind +1 | nw_wswmsc008 | NW_WSWMSC008
Desert Wind +2 | nw_wswmsc009 | NW_WSWMSC009
Divine Fury | nw_wswmka004 | NW_WSWMKA004
Duergar Rapier +3 |  | nw_it_crewrp001
Kaga-To | nw_wswmka005 | NW_WSWMKA005
Katana | nw_wswka001 | NW_WSWKA001
Katana +1 | nw_wswmka002 | NW_WSWMKA002
Katana +2 | nw_wswmka010 | NW_WSWMKA010
Katana +3 | nw_wswmka011 | NW_WSWMKA011
Laughing Blade | nw_wswmsc006 | NW_WSWMSC006
Master Li's Way | nw_wswmka006 | NW_WSWMKA006
Mercykiller Blade | nw_wswmrp005 | NW_WSWMRP005
Namarra (Neversleep) +1 | nw_wswmrp008 | NW_WSWMRP008
Namarra (Neversleep) +2 | nw_wswmrp009 | NW_WSWMRP009
Rapier | nw_wswrp001 | NW_WSWRP001
Rapier +1 | nw_wswmrp002 | NW_WSWMRP002
Rapier +2 | nw_wswmrp010 | NW_WSWMRP010
Rapier +3 | nw_wswmrp011 | NW_WSWMRP011
Rapier of the High Road | nw_wswmrp007 | NW_WSWMRP007
Scimitar | nw_wswsc001 | NW_WSWSC001
Scimitar +1 | nw_wswmsc002 | NW_WSWMSC002
Scimitar +2 | nw_wswmsc010 | NW_WSWMSC010
Scimitar +3 | nw_wswmsc011 | NW_WSWMSC011
Scimitar of Speed | nw_wswmsc005 | NW_WSWMSC005
Scimitar of Speed | nw_wswmsc003 | NW_WSWMSC003
Shimmering Blade | nw_wswmsc004 | NW_WSWMSC004
Sword Saint Legacy +1 | nw_wswmka008 | NW_WSWMKA008
Sword Saint Legacy +4 | nw_wswmka009 | NW_WSWMKA009
Ula's Heart | nw_wswmsc007 | NW_WSWMSC007


Resource.Items - Other Weapons

Home > Reference > Resources > Items > Other Weapons

Other Weapons

Other weapons.

Items

Items | ResRef | Tag
Jester's Fury | nw_wspmnn003 | NW_WSPMNN003


Resource.Items - Polearms

Home > Reference > Resources > Items > Polearms

Polearms

Polearms and spears (used primarily against calvary or other charging opponents).

Items

Items | ResRef | Tag
Arc Asunder | nw_wplmhb003 | NW_WPLMHB003
Black Kumade | nw_wplmss005 | NW_WPLMSS005
Black Kumade | nw_wplmss003 | NW_WPLMSS003
Briarspike | nw_wplmss007 | NW_WPLMSS007
Death's Handmaiden | nw_wplmsc004 | NW_WPLMSC004
Dragon's Breath | nw_wplmhb006 | NW_WPLMHB006
Fey Spear +1 | nw_wplmss008 | NW_WPLMSS008
Fey Spear +3 | nw_wplmss009 | NW_WPLMSS009
Halberd | nw_wplhb001 | NW_WPLHB001
Halberd +1 | nw_wplmhb002 | NW_WPLMHB002
Halberd +2 | nw_wplmhb010 | NW_WPLMHB010
Halberd +3 | nw_wplmhb011 | NW_WPLMHB011
Heartwood Spear | nw_wplmss004 | NW_WPLMSS004
King's Scythe | nw_wplmsc005 | NW_WPLMSC005
Nature's Scythe | nw_wplmsc003 | NW_WPLMSC003
Ravager | nw_wplmhb005 | NW_WPLMHB005
Ravager +1 | nw_wplmhb008 | NW_WPLMHB008
Ravager +4 | nw_wplmhb009 | NW_WPLMHB009
Scythe | nw_wplsc001 | NW_WPLSC001
Scythe +1 | nw_wplmsc002 | NW_WPLMSC002
Scythe +2 | nw_wplmsc010 | NW_WPLMSC010
Scythe +3 | nw_wplmsc011 | NW_WPLMSC011
Sea Reaver +1 | nw_wplmsc008 | NW_WPLMSC008
Sea Reaver +2 | nw_wplmsc009 | NW_WPLMSC009
Spear | nw_wplss001 | NW_WPLSS001
Spear +1 | nw_wplmss002 | NW_WPLMSS002
Spear +2 | nw_wplmss010 | NW_WPLMSS010
Spear +3 | nw_wplmss011 | NW_WPLMSS011
Spear of Withering | nw_wplmss006 | NW_WPLMSS006
Water's Edge | nw_wplmhb007 | NW_WPLMHB007
Wicked Union | nw_wplmsc006 | NW_WPLMSC006
Wicked Union | nw_wplmsc007 | NW_WPLMSC007
Will of Atar | nw_wplmhb004 | NW_WPLMHB004


Resource.Items - Potions

Home > Reference > Resources > Items > Potions

Potions

Magical potions and drinks.

Items

Items | ResRef | Tag
Ale | nw_it_mpotion021 | NW_IT_MPOTION021
Potion of Aid | nw_it_mpotion016 | NW_IT_MPOTION016
Potion of Antidote | nw_it_mpotion006 | NW_IT_MPOTION006
Potion of Barkskin | nw_it_mpotion005 | NW_IT_MPOTION005
Potion of Bless | nw_it_mpotion009 | NW_IT_MPOTION009
Potion of Bull's Strength | nw_it_mpotion015 | NW_IT_MPOTION015
Potion of Cat's Grace | nw_it_mpotion014 | NW_IT_MPOTION014
Potion of Clarity | nw_it_mpotion007 | NW_IT_MPOTION007
Potion of Cure Critical Wounds | nw_it_mpotion003 | NW_IT_MPOTION003
Potion of Cure Light Wounds | nw_it_mpotion001 | NW_IT_MPOTION001
Potion of Cure Moderate Wounds | nw_it_mpotion020 | NW_IT_MPOTION020
Potion of Cure Serious Wounds | nw_it_mpotion002 | NW_IT_MPOTION002
Potion of Eagle's Splendor | nw_it_mpotion010 | NW_IT_MPOTION010
Potion of Endurance | nw_it_mpotion013 | NW_IT_MPOTION013
Potion of Fox's Cunning | nw_it_mpotion017 | NW_IT_MPOTION017
Potion of Heal | nw_it_mpotion012 | NW_IT_MPOTION012
Potion of Invisibility | nw_it_mpotion008 | NW_IT_MPOTION008
Potion of Lesser Restoration | nw_it_mpotion011 | NW_IT_MPOTION011
Potion of Lore | nw_it_mpotion019 | NW_IT_MPOTION019
Potion of Owl's Wisdom | nw_it_mpotion018 | NW_IT_MPOTION018
Potion of Speed | nw_it_mpotion004 | NW_IT_MPOTION004
Spirits | nw_it_mpotion022 | NW_IT_MPOTION022
Wine | nw_it_mpotion023 | NW_IT_MPOTION023


Resource.Items - Rods

Home > Reference > Resources > Items > Rods

Rods

Magical rods.

Items

Items ResRef Tag


Resource.Items - Scrolls

Home > Reference > Resources > Items > Scrolls

Scrolls

Spell scrolls.

Items

Items | ResRef | Tag
Acid Fog | nw_it_spscrol001 | NW_IT_SPSCROL001
Acid Fog | nw_it_sparscr603 | NW_IT_SPARSCR603
Animate Dead | nw_it_sparscr509 | NW_IT_SPARSCR509
Animate Dead | nw_it_spscrol002 | NW_IT_SPSCROL002
Bestow Curse | nw_it_sparscr414 | NW_IT_SPARSCR414
Bestow Curse | nw_it_spscrol003 | NW_IT_SPSCROL003
Blindness / Deafness | nw_it_sparscr211 | NW_IT_SPARSCR211
Blindness / Deafness | nw_it_spscrol004 | NW_IT_SPSCROL004
Bull's Strength | nw_it_spscrol005 | NW_IT_SPSCROL005
Bull's Strength | nw_it_sparscr212 | NW_IT_SPARSCR212
Burning Hands | nw_it_sparscr112 | NW_IT_SPARSCR112
Burning Hands | nw_it_spscrol006 | NW_IT_SPSCROL006
Cat's Grace | nw_it_sparscr213 | NW_IT_SPARSCR213
Cat's Grace | nw_it_spscrol007 | NW_IT_SPSCROL007
Chain Lightning | nw_it_sparscr607 | NW_IT_SPARSCR607
Chain Lightning | nw_it_spscrol008 | NW_IT_SPSCROL008
Charm Monster | nw_it_sparscr405 | NW_IT_SPARSCR405
Charm Monster | nw_it_spscrol009 | NW_IT_SPSCROL009
Charm Person | nw_it_spscrol010 | NW_IT_SPSCROL010
Charm Person | nw_it_sparscr107 | NW_IT_SPARSCR107
Charm Person or Animal | nw_it_spdvscr202 | NW_IT_SPDVSCR202
Charm Person or Animal | nw_it_spscrol011 | NW_IT_SPSCROL011
Circle of Death | nw_it_sparscr610 | NW_IT_SPARSCR610
Circle of Death | nw_it_spscrol012 | NW_IT_SPSCROL012
Clairaudience & Clairvoy | nw_it_sparscr307 | NW_IT_SPARSCR307
Clairaudience & Clairvoyance | nw_it_spscrol013 | NW_IT_SPSCROL013
Clarity | nw_it_sparscr217 | NW_IT_SPARSCR217
Clarity | nw_it_spscrol014 | NW_IT_SPSCROL014
Cloudkill | nw_it_sparscr502 | NW_IT_SPARSCR502
Cloudkill | nw_it_spscrol015 | NW_IT_SPSCROL015
Color Spray | nw_it_sparscr110 | NW_IT_SPARSCR110
Color Spray | nw_it_spscrol016 | NW_IT_SPSCROL016
Cone of Cold | nw_it_sparscr507 | NW_IT_SPARSCR507
Cone of Cold | nw_it_spscrol017 | NW_IT_SPSCROL017
Confusion | nw_it_spscrol018 | NW_IT_SPSCROL018
Confusion | nw_it_sparscr406 | NW_IT_SPARSCR406
Contagion | nw_it_spscrol019 | NW_IT_SPSCROL019
Contagion | nw_it_sparscr411 | NW_IT_SPARSCR411
Control Undead | nw_it_sparscr707 | NW_IT_SPARSCR707
Control Undead | nw_it_spscrol020 | NW_IT_SPSCROL020
Darkness | nw_it_sparscr206 | NW_IT_SPARSCR206
Darkness | nw_it_spscrol025 | NW_IT_SPSCROL025
Daze | nw_it_spscrol026 | NW_IT_SPSCROL026
Daze | nw_it_sparscr003 | NW_IT_SPARSCR003
Delayed Blast Fireball | nw_it_sparscr704 | NW_IT_SPARSCR704
Delayed Blast Fireball | nw_it_spscrol027 | NW_IT_SPSCROL027
Dismissal | nw_it_sparscr501 | NW_IT_SPARSCR501
Dismissal | nw_it_spscrol028 | NW_IT_SPSCROL028
Dispel Magic | nw_it_sparscr301 | NW_IT_SPARSCR301
Dispell Magic | nw_it_spscrol029 | NW_IT_SPSCROL029
Dominate Monster | nw_it_sparscr905 | NW_IT_SPARSCR905
Dominate Monster | nw_it_spscrol030 | NW_IT_SPSCROL030
Dominate Person | nw_it_spscrol031 | NW_IT_SPSCROL031
Dominate Person | nw_it_sparscr503 | NW_IT_SPARSCR503
Eagle's Splendor | nw_it_sparscr219 | nw_it_sparscr219
Elemental Shield | nw_it_spscrol032 | NW_IT_SPSCROL032
Elemental Shield | nw_it_sparscr416 | NW_IT_SPARSCR416
Endurance | nw_it_sparscr215 | NW_IT_SPARSCR215
Endurance | nw_it_spscrol033 | NW_IT_SPSCROL033
Endure Elements | nw_it_spscrol034 | NW_IT_SPSCROL034
Endure Elements | nw_it_sparscr101 | NW_IT_SPARSCR101
Energy Drain | nw_it_sparscr908 | NW_IT_SPARSCR908
Energy Drain | nw_it_spscrol035 | NW_IT_SPSCROL035
Enervation | nw_it_spscrol036 | NW_IT_SPSCROL036
Enervation | nw_it_sparscr412 | NW_IT_SPARSCR412
Ethereal Visage | nw_it_sparscr608 | NW_IT_SPARSCR608
Ethereal Visage | nw_it_spscrol088 | NW_IT_SPSCROL088
Fear | nw_it_sparscr413 | NW_IT_SPARSCR413
Fear | nw_it_spscrol037 | NW_IT_SPSCROL037
Feeblemind | nw_it_spscrol038 | NW_IT_SPSCROL038
Feeblemind | nw_it_sparscr504 | NW_IT_SPARSCR504
Finger of Death | nw_it_sparscr708 | NW_IT_SPARSCR708
Finger of Death | nw_it_spscrol039 | NW_IT_SPSCROL039
Fireball | nw_it_spscrol040 | NW_IT_SPSCROL040
Fireball | nw_it_sparscr309 | NW_IT_SPARSCR309
Flame Arrow | nw_it_sparscr304 | NW_IT_SPARSCR304
Flame Arrow | nw_it_spscrol041 | NW_IT_SPSCROL041
Fox's Cunning | nw_it_sparscr220 | nw_it_sparscr220
Gate | nw_it_sparscr902 | NW_IT_SPARSCR902
Gate | nw_it_spscrol042 | NW_IT_SPSCROL042
Ghostly Visage | nw_it_spscrol087 | NW_IT_SPSCROL087
Ghostly Visage | nw_it_sparscr208 | NW_IT_SPARSCR208
Ghoul Touch | nw_it_spscrol043 | NW_IT_SPSCROL043
Ghoul Touch | nw_it_sparscr209 | NW_IT_SPARSCR209
Globe of Invulnerability | nw_it_sparscr601 | NW_IT_SPARSCR601
Globe of Invulnerability | nw_it_spscrol044 | NW_IT_SPSCROL044
Grease | nw_it_spscrol045 | NW_IT_SPSCROL045
Grease | nw_it_sparscr103 | NW_IT_SPARSCR103
Greater Dispelling | nw_it_sparscr602 | NW_IT_SPARSCR602
Greater Dispelling | nw_it_spscrol046 | NW_IT_SPSCROL046
Greater Planar Binding | nw_it_sparscr803 | NW_IT_SPARSCR803
Greater Planar Binding | nw_it_spscrol048 | NW_IT_SPSCROL048
Greater Restoration | nw_it_spscrol137 | NW_IT_SPSCROL137
Greater Restoration | nw_it_spdvscr701 | NW_IT_SPDVSCR701
Greater Shadow Conjunction | nw_it_sparscr508 | NW_IT_SPARSCR508
Greater Shadow Conjunction | nw_it_spscrol049 | NW_IT_SPSCROL049
Greater Spell Breach | nw_it_sparscr612 | NW_IT_SPARSCR612
Greater Spell Breach | nw_it_spscrol050 | NW_IT_SPSCROL050
Greater Spell Mantle | nw_it_spscrol051 | NW_IT_SPSCROL051
Greater Spell Mantle | nw_it_sparscr912 | NW_IT_SPARSCR912
Greater Stoneskin | nw_it_sparscr613 | NW_IT_SPARSCR613
Greater Stoneskin | nw_it_spscrol052 | NW_IT_SPSCROL052
Gust of Wind | nw_it_spscrol053 | NW_IT_SPSCROL053
Haste | nw_it_spscrol054 | NW_IT_SPSCROL054
Haste | nw_it_sparscr312 | NW_IT_SPARSCR312
Hold Monster | nw_it_spscrol056 | NW_IT_SPSCROL056
Hold Monster | nw_it_sparscr505 | NW_IT_SPARSCR505
Hold Person | nw_it_sparscr308 | NW_IT_SPARSCR308
Hold Person | nw_it_spscrol057 | NW_IT_SPSCROL057
Horrid Wilting | nw_it_sparscr809 | NW_IT_SPARSCR809
Identify | nw_it_sparscr106 | NW_IT_SPARSCR106
Identify | nw_it_spscrol058 | NW_IT_SPSCROL058
Improved Invisibility | nw_it_spscrol059 | NW_IT_SPSCROL059
Improved Invisibility | nw_it_sparscr408 | NW_IT_SPARSCR408
Incendiary Cloud | nw_it_sparscr804 | NW_IT_SPARSCR804
Incendiary Cloud | nw_it_spscrol060 | NW_IT_SPSCROL060
Invisibility | nw_it_spscrol061 | NW_IT_SPSCROL061
Invisibility | nw_it_sparscr207 | NW_IT_SPARSCR207
Invisibility Sphere | nw_it_sparscr314 | NW_IT_SPARSCR314
Invisibility Sphere | nw_it_spscrol062 | NW_IT_SPSCROL062
Knock | nw_it_sparscr216 | NW_IT_SPARSCR216
Knock | nw_it_spscrol063 | NW_IT_SPSCROL063
Lesser Dispel | nw_it_sparscr218 | NW_IT_SPARSCR218
Lesser Dispel | nw_it_spscrol064 | NW_IT_SPSCROL064
Lesser Mind Blank | nw_it_sparscr511 | NW_IT_SPARSCR511
Lesser Mind Blank | nw_it_spscrol065 | NW_IT_SPSCROL065
Lesser Planar Binding | nw_it_sparscr512 | NW_IT_SPARSCR512
Lesser Planar Binding | nw_it_spscrol066 | NW_IT_SPSCROL066
Lesser Restoration | nw_it_spscrol138 | NW_IT_SPSCROL138
Lesser Restoration | nw_it_spdvscr201 | NW_IT_SPDVSCR201
Lesser Spell Breach | nw_it_sparscr417 | NW_IT_SPARSCR417
Lesser Spell Breach | nw_it_spscrol067 | NW_IT_SPSCROL067
Lesser Spell Mantle | nw_it_spscrol068 | NW_IT_SPSCROL068
Lesser Spell Mantle | nw_it_sparscr513 | NW_IT_SPARSCR513
Light | nw_it_spscrol069 | NW_IT_SPSCROL069
Light | nw_it_sparscr004 | NW_IT_SPARSCR004
Lightning Bolt | nw_it_sparscr310 | NW_IT_SPARSCR310
Lightning Bolt | nw_it_spscrol070 | NW_IT_SPSCROL070
Mage Armor | nw_it_sparscr104 | NW_IT_SPARSCR104
Mage Armor | nw_it_spscrol071 | NW_IT_SPSCROL071
Magic Circle against Alignment | nw_it_sparscr302 | NW_IT_SPARSCR302
Magic Circle against Alignment | nw_it_spscrol143 | NW_IT_SPSCROL143
Magic Missile | nw_it_spscrol076 | NW_IT_SPSCROL076
Magic Missile | nw_it_sparscr109 | NW_IT_SPARSCR109
Mass Blindness / Deafness | nw_it_sparscr807 | NW_IT_SPARSCR807
Mass Blindness / Deafness | nw_it_spscrol078 | NW_IT_SPSCROL078
Mass Charm | nw_it_spscrol079 | NW_IT_SPSCROL079
Mass Charm | nw_it_sparscr806 | NW_IT_SPARSCR806
Mass Domination | nw_it_spscrol080 | NW_IT_SPSCROL080
Mass Haste | nw_it_spscrol081 | NW_IT_SPSCROL081
Mass Haste | nw_it_sparscr611 | NW_IT_SPARSCR611
Melf's Acid Arrow | nw_it_sparscr202 | NW_IT_SPARSCR202
Melf's Acid Arrow | nw_it_spscrol082 | NW_IT_SPSCROL082
Meteor Swarm | nw_it_sparscr906 | NW_IT_SPARSCR906
Meteor Swarm | nw_it_spscrol083 | NW_IT_SPSCROL083
Mind Blank | nw_it_sparscr801 | NW_IT_SPARSCR801
Mind Blank | nw_it_spscrol084 | NW_IT_SPSCROL084
Mind Fog | nw_it_spscrol085 | NW_IT_SPSCROL085
Mind Fog | nw_it_sparscr506 | NW_IT_SPARSCR506
Minor Globe of Invulnerability | nw_it_sparscr401 | NW_IT_SPARSCR401
Minor Globe of Invulnerability | nw_it_spscrol086 | NW_IT_SPSCROL086
Mordenkainen's Disjunction | nw_it_sparscr901 | NW_IT_SPARSCR901
Mordenkainen's Disjunction | nw_it_spscrol089 | NW_IT_SPSCROL089
Mordenkainen's Sword | nw_it_spscrol090 | NW_IT_SPSCROL090
Mordenkainen's Sword | nw_it_sparscr705 | NW_IT_SPARSCR705
Nature's Balance | nw_it_spscrol091 | NW_IT_SPSCROL091
Nature's Balance | nw_it_spdvscr801 | NW_IT_SPDVSCR801
Negative Energy Burst | nw_it_sparscr315 | nw_it_sparscr315
Negative Energy Ray | nw_it_sparscr113 | nw_it_sparscr113
Neutralize Poison | nw_it_spdvscr402 | NW_IT_SPDVSCR402
Neutralize Poison | nw_it_spscrol092 | NW_IT_SPSCROL092
Owl's Wisdom | nw_it_sparscr221 | nw_it_sparscr221
Phantasmal Killer | nw_it_sparscr409 | NW_IT_SPARSCR409
Phantasmal Killer | nw_it_spscrol093 | NW_IT_SPSCROL093
Planar Binding | nw_it_sparscr604 | NW_IT_SPARSCR604
Planar Binding | nw_it_spscrol094 | NW_IT_SPSCROL094
Polymorph Self | nw_it_sparscr415 | NW_IT_SPARSCR415
Polymorph Self | nw_it_spscrol095 | NW_IT_SPSCROL095
Power Word Kill | nw_it_sparscr903 | NW_IT_SPARSCR903
Power Word Stun | nw_it_sparscr702 | NW_IT_SPARSCR702
Power Word, Kill | nw_it_spscrol096 | NW_IT_SPSCROL096
Power Word, Stun | nw_it_spscrol097 | NW_IT_SPSCROL097
Premonition | nw_it_spscrol098 | NW_IT_SPSCROL098
Premonition | nw_it_sparscr808 | NW_IT_SPARSCR808
Prismatic Spray | nw_it_sparscr706 | NW_IT_SPARSCR706
Prismatic Spray | nw_it_spscrol099 | NW_IT_SPSCROL099
Protection from Alignment | nw_it_sparscr102 | NW_IT_SPARSCR102
Protection from Alignment | nw_it_spscrol144 | NW_IT_SPSCROL144
Protection from Elements | nw_it_spscrol100 | NW_IT_SPSCROL100
Protection from Elements | nw_it_sparscr303 | NW_IT_SPARSCR303
Protection from Spells | nw_it_sparscr802 | NW_IT_SPARSCR802
Protection from Spells | nw_it_spscrol101 | NW_IT_SPSCROL101
Raise Dead | nw_it_spdvscr501 | NW_IT_SPDVSCR501
Raise Dead | nw_it_spscrol139 | NW_IT_SPSCROL139
Ray of Enfeeblement | nw_it_spscrol102 | NW_IT_SPSCROL102
Ray of Enfeeblement | nw_it_sparscr111 | NW_IT_SPARSCR111
Ray of Frost | nw_it_sparscr002 | NW_IT_SPARSCR002
Ray of Frost | nw_it_spscrol103 | NW_IT_SPSCROL103
Remove Blindness / Deafness | nw_it_spscrol104 | NW_IT_SPSCROL104
Remove Blindness / Deafness | nw_it_spdvscr301 | NW_IT_SPDVSCR301
Remove Curse | nw_it_sparscr402 | NW_IT_SPARSCR402
Remove Curse | nw_it_spscrol105 | NW_IT_SPSCROL105
Remove Disease | nw_it_spscrol106 | NW_IT_SPSCROL106
Remove Disease | nw_it_spdvscr302 | NW_IT_SPDVSCR302
Resist Elements | nw_it_sparscr201 | NW_IT_SPARSCR201
Resist Elements | nw_it_spscrol107 | NW_IT_SPSCROL107
Resistance | nw_it_spscrol108 | NW_IT_SPSCROL108
Resistance | nw_it_sparscr001 | NW_IT_SPARSCR001
Restoration | nw_it_spdvscr401 | NW_IT_SPDVSCR401
Restoration | nw_it_spscrol140 | NW_IT_SPSCROL140
Resurrection | nw_it_spscrol141 | NW_IT_SPSCROL141
Resurrection | nw_it_spdvscr702 | NW_IT_SPDVSCR702
Scare | nw_it_sparscr210 | NW_IT_SPARSCR210
See Invisibility | nw_it_sparscr205 | NW_IT_SPARSCR205
See Invisibility | nw_it_spscrol109 | NW_IT_SPSCROL109
Shades | nw_it_sparscr609 | NW_IT_SPARSCR609
Shades | nw_it_spscrol110 | NW_IT_SPSCROL110
Shadow Conjuration | nw_it_spscrol111 | NW_IT_SPSCROL111
Shadow Conjuration | nw_it_sparscr410 | NW_IT_SPARSCR410
Shapechange | nw_it_spscrol112 | NW_IT_SPSCROL112
Shapechange | nw_it_sparscr910 | NW_IT_SPARSCR910
Silence | nw_it_spdvscr203 | NW_IT_SPDVSCR203
Silence | nw_it_spscrol113 | NW_IT_SPSCROL113
Sleep | nw_it_spscrol114 | NW_IT_SPSCROL114
Sleep | nw_it_sparscr108 | NW_IT_SPARSCR108
Slow | nw_it_sparscr313 | NW_IT_SPARSCR313
Slow | nw_it_spscrol115 | NW_IT_SPSCROL115
Sound Burst | nw_it_spdvscr204 | NW_IT_SPDVSCR204
Sound Burst | nw_it_spscrol116 | NW_IT_SPSCROL116
Spell Mantle | nw_it_spscrol117 | NW_IT_SPSCROL117
Spell Mantle | nw_it_sparscr701 | NW_IT_SPARSCR701
Sphere of Chaos | nw_it_spscrol118 | NW_IT_SPSCROL118
Stinking Cloud | nw_it_spscrol119 | NW_IT_SPSCROL119
Stinking Cloud | nw_it_sparscr305 | NW_IT_SPARSCR305
Stoneskin | nw_it_sparscr403 | NW_IT_SPARSCR403
Stoneskin | nw_it_spscrol120 | NW_IT_SPSCROL120
Summon Creature I | nw_it_spscrol121 | NW_IT_SPSCROL121
Summon Creature I | nw_it_sparscr105 | NW_IT_SPARSCR105
Summon Creature II | nw_it_sparscr203 | NW_IT_SPARSCR203
Summon Creature II | nw_it_spscrol122 | NW_IT_SPSCROL122
Summon Creature III | nw_it_spscrol123 | NW_IT_SPSCROL123
Summon Creature III | nw_it_sparscr306 | NW_IT_SPARSCR306
Summon Creature IV | nw_it_sparscr404 | NW_IT_SPARSCR404
Summon Creature IV | nw_it_spscrol124 | NW_IT_SPSCROL124
Summon Creature IX | nw_it_spscrol129 | NW_IT_SPSCROL129
Summon Creature IX | nw_it_sparscr904 | NW_IT_SPARSCR904
Summon Creature V | nw_it_sparscr510 | NW_IT_SPARSCR510
Summon Creature V | nw_it_spscrol125 | NW_IT_SPSCROL125
Summon Creature VI | nw_it_spscrol126 | NW_IT_SPSCROL126
Summon Creature VI | nw_it_sparscr605 | NW_IT_SPARSCR605
Summon Creature VII | nw_it_sparscr703 | NW_IT_SPARSCR703
Summon Creature VII | nw_it_spscrol127 | NW_IT_SPSCROL127
Summon Creature VIII | nw_it_spscrol128 | NW_IT_SPSCROL128
Summon Creature VIII | nw_it_sparscr805 | NW_IT_SPARSCR805
Tenser's Transformation | nw_it_sparscr614 | NW_IT_SPARSCR614
Time Stop | nw_it_spscrol130 | NW_IT_SPSCROL130
Time Stop | nw_it_sparscr911 | NW_IT_SPARSCR911
True Seeing | nw_it_spscrol131 | NW_IT_SPSCROL131
True Seeing | nw_it_sparscr606 | NW_IT_SPARSCR606
Ultravision | nw_it_sparscr214 | NW_IT_SPARSCR214
Vampiric Touch | nw_it_spscrol132 | NW_IT_SPSCROL132
Vampiric Touch | nw_it_sparscr311 | NW_IT_SPARSCR311
Wail of the Banshee | nw_it_spscrol133 | NW_IT_SPSCROL133
Wail of the Banshee | nw_it_sparscr909 | NW_IT_SPARSCR909
Wall of Fire | nw_it_sparscr407 | NW_IT_SPARSCR407
Wall of Fire | nw_it_spscrol134 | NW_IT_SPSCROL134
Web | nw_it_spscrol135 | NW_IT_SPSCROL135
Web | nw_it_sparscr204 | NW_IT_SPARSCR204
Weird | nw_it_sparscr907 | NW_IT_SPARSCR907
Weird | nw_it_spscrol136 | NW_IT_SPSCROL136


Resource.Items - Shields, Large

Home > Reference > Resources > Items > Shields, Large

Shields, Large

Large non-magical and magical shields.

Items

Items | ResRef | Tag
Dragon Shield | nw_ashmlw006 | NW_ASHMLW006
Large Shield | nw_ashlw001 | NW_ASHLW001
Large Shield +1 | nw_ashmlw002 | NW_ASHMLW002
Large Shield +2 | nw_ashmlw008 | NW_ASHMLW008
Large Shield +3 | nw_ashmlw009 | NW_ASHMLW009
Mirror Shield | nw_ashmlw005 | NW_ASHMLW005
Shield of the Holy | nw_ashmlw003 | NW_ASHMLW003
Shield of the Sun | nw_ashmlw004 | NW_ASHMLW004
Uthgardt Holy Shield | nw_ashmlw007 | NW_ASHMLW007


Resource.Items - Shields, Small

Home > Reference > Resources > Items > Shields, Small

Shields, Small

Small non-magical and magical shields.

Items

Items | ResRef | Tag
Dwarven Mirth | nw_ashmsw005 | NW_ASHMSW005
Hearth Shield | nw_ashmsw004 | NW_ASHMSW004
Mithral Shield | nw_ashmsw007 | NW_ASHMSW007
Protector | nw_ashmsw003 | NW_ASHMSW003
Shield of Dawn | nw_ashmsw010 | NW_ASHMSW010
Shield of the Watch | nw_ashmsw011 | NW_ASHMSW011
Shield of the Wisp Hunter | nw_ashmsw006 | NW_ASHMSW006
Small Shield | nw_ashsw001 | NW_ASHSW001
Small Shield +1 | nw_ashmsw002 | NW_ASHMSW002
Small Shield +2 | nw_ashmsw008 | NW_ASHMSW008
Small Shield +3 | nw_ashmsw009 | NW_ASHMSW009


Resource.Items - Shields, Tower

Home > Reference > Resources > Items > Shields, Tower

Shields, Tower

Tower non-magical and magical shields.

Items

Items | ResRef | Tag
Darksteel Tower Shield | nw_ashmto007 | NW_ASHMTO007
Goblin Shield of Nulbish | nw_ashmto005 | NW_ASHMTO005
Greater Shield of Dawn | nw_ashmto010 | NW_ASHMTO010
Greater Shield of the Watch | nw_ashmto011 | NW_ASHMTO011
Hastsezini's Shield | nw_ashmto006 | NW_ASHMTO006
Imaskari Shield | nw_ashmto003 | NW_ASHMTO003
Shield of the Dragonslayer | nw_ashmto004 | NW_ASHMTO004
Tower Shield | nw_ashto001 | NW_ASHTO001
Tower Shield +1 | nw_ashmto002 | NW_ASHMTO002
Tower Shield +2 | nw_ashmto008 | NW_ASHMTO008
Tower Shield +3 | nw_ashmto009 | NW_ASHMTO009


Resource.Items - Shortbows

Home > Reference > Resources > Items > Shortbows

Shortbows

Shortbows.

Items

Items | ResRef | Tag
Composite Shortbow +1 | nw_wbwmsh010 | NW_WBWMSH010
Composite Shortbow +2 | nw_wbwmsh011 | NW_WBWMSH011
Composite Shortbow +3 | nw_wbwmsh012 | NW_WBWMSH012
Eaglebow | nw_wbwmsh003 | NW_WBWMSH003
Lesser Oathbow | nw_wbwmsh006 | NW_WBWMSH006
Lilting Note | nw_wbwmsh007 | NW_WBWMSH007
Phantom Bow | nw_wbwmsh004 | NW_WBWMSH004
Shortbow | nw_wbwsh001 | NW_WBWSH001
Shortbow +1 | nw_wbwmsh002 | NW_WBWMSH002
Shortbow +2 | nw_wbwmsh008 | NW_WBWMSH008
Shortbow +3 | nw_wbwmsh009 | NW_WBWMSH009
Tansheron's Bow | nw_wbwmsh005 | WBWMSH005


Resource.Items - Slings

Home > Reference > Resources > Items > Slings

Slings

Slings.

Items

Items | ResRef | Tag
Acid Dart | nw_wthmdt006 | NW_WTHMDT006
Asp's Nest | nw_wthmdt004 | NW_WTHMDT004
Axe of the Coming Storm | nw_wthmax004 | NW_WTHMAX004
Black Raven Axe | nw_wthmax005 | NW_WTHMAX005
Charming Sling | nw_wbwmsl007 | NW_WBWMSL007
Dart | nw_wthdt001 | NW_WTHDT001
Dart +1 | nw_wthmdt002 | NW_WTHMDT002
Dart +2 | nw_wthmdt008 | NW_WTHMDT008
Dart +3 | nw_wthmdt009 | NW_WTHMDT009
Dart of Accuracy | nw_wthmdt007 | NW_WTHMDT007
Dart of Stunning | nw_wthmdt003 | NW_WTHMDT003
Dragon's Tail | nw_wthmsh004 | NW_WTHMSH004
Fire Axe | nw_wthmax007 | NW_WTHMAX007
Grains of Sand | nw_wthmsh007 | NW_WTHMSH007
Ice Dart | nw_wthmdt005 | NW_WTHMDT005
Many Talons | nw_wthmsh006 | NW_WTHMSH006
Rifthome Axe | nw_wthmax006 | NW_WTHMAX006
Shining Light | nw_wthmsh005 | NW_WTHMSH005
Shuriken | nw_wthsh001 | NW_WTHSH001
Shuriken +1 | nw_wthmsh002 | NW_WTHMSH002
Shuriken +2 | nw_wthmsh008 | NW_WTHMSH008
Shuriken +3 | nw_wthmsh009 | NW_WTHMSH009
Sling | nw_wbwsl001 | NW_WBWSL001
Sling +1 | nw_wbwmsl001 | NW_WBWMSL001
Sling +2 | nw_wbwmsl009 | NW_WBWMSL009
Sling +3 | nw_wbwmsl010 | NW_WBWMSL010
Sling of Arvoreen | nw_wbwmsl004 | NW_WBWMSL004
Sling of Force | nw_wbwmsl006 | NW_WBWMSL006
Sling of Seeking | nw_wbwmsl003 | NW_WBWMSL003
Stars of Ojy-do | nw_wthmsh003 | NW_WTHMSH003
Sunlight Sling | nw_wbwmsl005 | NW_WBWMSL005
Tempertuppin's Ever-Thrower | nw_wbwmsl008 | NW_WBWMSL008
Throwing Axe | nw_wthax001 | NW_WTHAX001
Throwing Axe +1 | nw_wthmax002 | NW_WTHMAX002
Throwing Axe +2 | nw_wthmax008 | NW_WTHMAX008
Throwing Axe +3 | nw_wthmax009 | NW_WTHMAX009
Thunderbeast Axe | nw_wthmax003 | NW_WTHMAX003


Resource.Items - Staves

Home > Reference > Resources > Items > Staves

Staves

Magical staves (quarterstaves are located under the "Double-Sided" category).

Items

Items ResRef Tag


Resource.Items - Swords, Bastard

Home > Reference > Resources > Items > Swords, Bastard

Swords, Bastard

Bastard (hand and a half) swords.

Items

Items | ResRef | Tag
Bastard Sword | nw_wswbs001 | NW_WSWBS001
Bastard Sword +1 | nw_wswmbs002 | NW_WSWMBS002
Bastard Sword +2 | nw_wswmbs009 | NW_WSWMBS009
Bastard Sword +3 | nw_wswmbs010 | NW_WSWMBS010
Bloodletter | nw_wswmbs004 | NW_WSWMBS004
Discord | nw_wswmbs008 | NW_WSWMBS008
Discord | nw_wswmbs007 | NW_WSWMBS007
Dragonslayer | nw_wswmbs006 | NW_WSWMBS006
Lawgiver | nw_wswmbs005 | NW_WSWMBS005
Nameless Light | nw_wswmbs003 | NW_WSWMBS003


Resource.Items - Swords, Great

Home > Reference > Resources > Items > Swords, Great

Swords, Great

Great swords.

Items

Items | ResRef | Tag
Blade of the Rashemi | nw_wswmgs004 | NW_WSWMGS004
Gemsword | nw_wswmgs003 | NW_WSWMGS003
Greatsword | nw_wswgs001 | NW_WSWGS001
Greatsword +1 | nw_wswmgs002 | NW_WSWMGS002
Greatsword +2 | nw_wswmgs011 | NW_WSWMGS011
Greatsword +3 | nw_wswmgs012 | NW_WSWMGS012
Harbinger Kin | nw_wswmgs007 | NW_WSWMGS007
Harbinger Kin +1 | nw_wswmgs009 | NW_WSWMGS009
Harbinger Kin +3 | nw_wswmgs010 | NW_WSWMGS010
Shining Light of Lathander | nw_wswmgs005 | NW_WSWMGS005
The Dagger of Chaos | nw_it_novel009 | NW_IT_NOVEL009
Vermin's Bane | nw_wswmgs006 | NW_WSWMGS006


Resource.Items - Swords, Long

Home > Reference > Resources > Items > Swords, Long

Swords, Long

Longswords.

Items

Items | ResRef | Tag
Angurvadal (Flame Tongue) | nw_wswmls005 | NW_WSWMLS005
Astral Blade +1 | nw_wswmls009 | NW_WSWMLS009
Astral Blade +2 | nw_wswmls011 | NW_WSWMLS011
Blackrazor Minion | nw_wswmls003 | NW_WSWMLS003
Blade of the Gladiator | nw_it_novel007 | NW_IT_NOVEL007
Blessing of the Daystar | nw_wswmls006 | NW_WSWMLS006
Cold Iron Blade | nw_wswmls007 | NW_WSWMLS007
Elf Ranger Longsword |  | nw_it_crewls004
Longsword | nw_wswls001 | NW_WSWLS001
Longsword +1 | nw_wswmls002 | NW_WSWMLS002
Longsword +2 | nw_wswmls010 | NW_WSWMLS010
Longsword +3 | nw_wswmls012 | NW_WSWMLS012
Soulrazor Minion | nw_wswmls004 | NW_WSWMLS004
Sunelf Blade | nw_wswmls008 | NW_WSWMLS008


Resource.Items - Swords, Short

Home > Reference > Resources > Items > Swords, Short

Swords, Short

Short swords.

Items

Items | ResRef | Tag
Breath of the Maiden | nw_wswmss005 | NW_WSWMSS005
Drow Shortsword |  | nw_it_crewss001
Drow Shortsword +1 |  | nw_it_crewss002
Drow Shortsword +3 |  | nw_it_crewss003
Feyduster | nw_wswmss007 | NW_WSWMSS007
Feyduster +1 | nw_wswmss008 | NW_WSWMSS008
Feyduster +2 | nw_wswmss010 | NW_WSWMSS010
Halfling Merc Shortsword +1 |  | nw_it_crewss005
Halfling/Merc Shortsword +3 |  | nw_it_crewss004
Ichthia's Neck-Knife | nw_wswmss004 | NW_WSWMSS004
Short Sword | nw_wswss001 | NW_WSWSS001
Short Sword +1 | nw_wswmss002 | NW_WSWMSS002
Short Sword +2 | nw_wswmss009 | NW_WSWMSS009
Short Sword +3 | nw_wswmss011 | NW_WSWMSS011
Short Sword of Quickness | nw_wswmss003 | NW_WSWMSS003
The Lucky One | nw_wswmss006 | NW_WSWMSS006


Resource.Items - Throwing Weapons

Home > Reference > Resources > Items > Throwing Weapons

Throwing Weapons

Various other missile/throwing weapons.

Items

Items ResRef Tag


Resource.Items - Unknown

Home > Reference > Resources > Items > Unknown

Unknown

Unknown; currently ungrouped.

Items

Items ResRef Tag


Resource.Items - Wands

Home > Reference > Resources > Items > Wands

Wands

Magical wands.

Items

Items ResRef Tag


Placeable Categories - Placeables

Home > Resources > Placeables

Placeables

Placeables | Description
Battlefield | Things that would appear on a battlefield.
Containers and Switches | Items that can contain other items or be switched [off and on].
Military | Siege equipment and torture devices.
Miscellaneous | Miscellaneous exterior placeables.
Miscellaneous Interior | Miscellaneous interior placeables (like furniture).
Nature | Things that are normally found outside in nature.
Penants and Signs | Penants and signs.
Trades and Academic and Farm | Work and craft equipment.
Visual Effects | Eye catching visuals (ooh... its magic!).


Resource.Placeables - Battlefield

Home > Reference > Resources > Placeables > Battlefield

Battlefield

Things that would appear on a battlefield.

Placeables

Placeables | ResRef | Tag
Arrow-filled Corpse | plc_arrowcorpse | Arrowfilledcorpse
Bloodstain | plc_bloodstain | Bloodstain
Bones | plc_bones | Bones
Corpse Wagon | plc_fcrpsewagon | FlyCladCorpseWagon
Defaced Statue | plc_statue2 | StatueDefaced
Impaled Human Corpse | plc_impledcrpse1 | ImpalingSpearwHumanCorpse
Impaled Human Head | plc_impledhead1 | ImpalingSpearwHumanHead
Impaled Monster Corpse | plc_impledcrpse2 | ImpalingSpearwMonsterCorpse
Impaled Monster Head | plc_impledhead2 | ImpalingSpearwMonsterHead
Pile Of Skulls | plc_pileskulls | PileofSkulls
Plague Victim Corpse | plc_fplaguecrpse | FlyCladPlagueVictimCorpse
Plague Victim Pyre | plc_plaguepyre | PlagueVictimPyre
Rubble | plc_rubble | Rubble
Ruined Wagon (1) | plc_burnwagon | BurningWagon
Ruined Wagon (2) | plc_ruinwagon | RuinedWagon
Scorch Mark | plc_weathmark | WeatheringScorchMark
Skeleton Bones | nw_pl_skeleton | NW_PL_SKELETON
Speared Corpse | plc_spearcorpse | SpearSwordfilledCorpse
Torture Equipment | plc_torture2 | TortureEquipmentwCorpse
Wrecked Ballista | plc_ballistabrk | BallistaBurningBroken
Wrecked Battering Ram | plc_bttrrambrk | BatteringRamBurningBroken
Wrecked Catapult | plc_catpltbrk | CatapultBurningBroken
Zombie Corpse | nw_pl_zombie | NW_PL_ZOMBIE


Resource.Placeables - Containers and Switches

Home > Reference > Resources > Placeables > Containers and Switches

Containers and Switches

Items that can contain other items or be switched [off and on].

Placeables

Placeables | ResRef | Tag
Armoire | plc_armoire | Armoire
Barrel | plc_barrel | Barrel
Book Piles | plc_bookpiles | BookPiles
Bookshelf | plc_bookshelf | Bookshelf
Cabinet | plc_cabinet | Cabinet
Chest (1) | plc_chest1 | Chest1
Chest (2) | plc_chest2 | Chest2
Chest (3) | plc_chest3 | Chest3
Chest (4) | plc_chest4 | Chest4
Chest Of Drawers | plc_chstdrwrs | ChestofDrawers
Coffin | nw_vampire_shad | NW_VAMPIRE_SHAD
Corpse (1) | plc_corpse1 | Corpse1
Corpse (2) | plc_corpse2 | Corpse2
Corpse (3) | plc_corpse3 | Corpse3
Corpse (4) | plc_corpse4 | Corpse4
Crate (1) | plc_box1 | BoxCrate1
Crate (2) | plc_box2 | BoxCrate2
Crate (3) | plc_box3 | BoxCrate3
Crate (4) | plc_box4 | BoxCrate4
Desk | plc_desk | Desk
Fenberry Bush | plc_fenbush | PLC_Fenbush
Floor Lever (1) | plc_flrlever1 | FloorLever1
Floor Lever (2) | plc_flrlever2 | FloorLever2
Loot Bag (1) | plc_lootbag1 | LootBag1
Loot Bag (2) | plc_lootbag2 | LootBag2
Loot Bag (3) | plc_lootbag3 | LootBag3
Loot Bag (4) | plc_lootbag4 | LootBag4
Loot Bag (5) | plc_lootbag5 | LootBag5
Loot Bag (6) | plc_lootbag6 | LootBag6
Pile Of Stones | plc_pilestones | PLC_PileStones
Pillar (1) | plc_pllrbutton1 | PillarButton1
Pillar (2) | plc_pllrbutton2 | PillarButton2
Pillar (3) | plc_pllrlever1 | PillarLever1
Pillar (4) | plc_pllrlever2 | PillarLever2
Pressure Plate (1) | plc_prssplate1 | PressurePlate1
Pressure Plate (2) | plc_prssplate2 | PressurePlate2
Pull Chain | plc_pullrope | PullRopeChain
Sarcophagus (1) | plc_sarco1 | SarcophagusEgyptian
Sarcophagus (2) | plc_sarco2 | SarcophagusEvil
Sarcophagus (3) | plc_sarco3 | SarcophagusGood
Treasure (1) | plc_treasurelrg | TreasureLarge
Treasure (2) | plc_treasuremed | TreasureMedium
Treasure (3) | plc_treasuresml | TreasureSmall


Resource.Placeables - Military

Home > Reference > Resources > Placeables > Military

Military

Siege equipment and torture devices.

Placeables

Placeables | ResRef | Tag
Archery Target | plc_archtarget | ArcheryTarget
Ballista | plc_ballista | Ballista
Battering Ram | plc_bttrram | BatteringRam
Catapult | plc_catplt | Catapult
Combat Dummy | plc_cmbtdummy | CombatDummy
Gallows | plc_hangmnpost | HangmansPost
Humanoid Cage | plc_humancage | HumanoidCage
Stocks | plc_stocks | Stocks
Torture Equipment | plc_torture1 | TortureEquipment
Weapon Rack | plc_weaponrack | WeaponRack


Resource.Placeables - Miscellaneous

Home > Reference > Resources > Placeables > Miscellaneous

Miscellaneous

Miscellaneous exterior placeables.

Placeables

Placeables | ResRef | Tag
Birdbath | plc_birdbath | Birdbath
Brazier | plc_brazier | Brazier
Cage | plc_animalcage | AnimalCage
Campfire (1) | plc_campfr | Campfire
Campfire (2) | plc_campfrwpot | CampfireCauldron
Campfire (3) | plc_campfrwspit | CampfirewithSpit
Cocoon | plc_spdcocoon | SpiderwebCocoon
Easel | plc_pntingeasel | PaintingonEasel
Fountain | plc_fountain | Fountain
Garbage | plc_garbage | Garbage
Gnomish Contraption | plc_gnomcntrptn | GnomishContraptionEngine
Gong | plc_gong | Gong
Invisible Object | plc_invisobj | InvisibleObject
Keg | plc_keg | Keg
Lamp Post | plc_lamppost | LampPost
Pedestal | plc_pedestal | Pedestal
Pillar (miscellaneous, 1) | plc_pillar1 | PillarStyle1
Pillar (miscellaneous, 2) | plc_pillar2 | PillarStyle2
Pillar (miscellaneous, 3) | plc_pillar3 | PillarStyle3
Statue (1) | nw_stat_garg | NW_STAT_GARG
Statue (2) | plc_statue1 | StatueStone
Statue (3) | plc_statue3 | NW_STATUE3
Sundial | plc_sundial | Sundial
Torch Bracket | plc_freetorch | FreestandingTorchBracket
Wagon (1) | plc_emptywagon | EmptyWagon
Wagon (2) | plc_fullwagon | FullWagon
Wagon Wheel | plc_wagonwheel | WagonWheel
Water Trough | plc_watertrough | WaterTrough
Well | plc_well | Well


Resource.Placeables - Miscellaneous Interior

Home > Reference > Resources > Placeables > Miscellaneous Interior

Miscellaneous Interior

Miscellaneous interior placeables (like furniture).

Placeables

Placeables | ResRef | Tag
Altar (1) | plc_altrevil | AltarShrineEvil
Altar (2) | plc_altrgood | AltarShrineGood
Altar (3) | plc_altrneutral | AltarShrineNeutral
Bed | plc_bed | Bed
Bed Roll | plc_bedrolls | BedBeddingRolls
Bench | plc_bench | BenchPew
Bird Cage | plc_birdcage | BirdCage
Candelabra | plc_candelabra | Candelabra
Chair | plc_chair | Chair
Cot | plc_cot | BedCot
Couch | plc_couch | Couch
Floor Design (1) | plc_flrdesigns1 | FloorDesignsStyle1
Floor Design (2) | plc_flrdesigns2 | FloorDesignsStyle2
Floor Design (3) | plc_flrdesigns3 | FloorDesignsStyle3
Floor-anchored Shackles | plc_flrshackles | Flooranchoredshackles
Footstool | plc_footstool | Footstool
Hidden Trapdoor | nw_pl_hiddendr03 | NW_PL_HIDDENDR03
Hidden Trapdoor Trigger | nw_pl_hiddendr04 | NW_PL_HIDDENDR04
Hidden Wall Door | nw_pl_hiddendr01 | NW_PL_HIDDENDR01
Hidden Wall Door Trigger | nw_pl_hiddendr02 | NW_PL_HIDDENDR02
Oven | plc_woodoven | WoodBurningOven
Potted Plant | plc_pottedplant | PottedPlant
Stool | plc_stool | Stool
Table | plc_table | Table
Throne (1) | plc_throneevil | ThroneEvil
Throne (2) | plc_thronegood | ThroneGood
Throw Rug | plc_throwrug | ThrowRug
Trap Door | plc_trapdoor | TrapDoor
Urn | plc_urn | Urn
Woodpile | plc_woodpile | Woodpile


Resource.Placeables - Nature

Home > Reference > Resources > Placeables > Nature

Nature

Things that are normally found outside in nature.

Placeables

Placeables | ResRef | Tag
Butterflies | plc_butterflies | Butterflies
Debris | nw_pl_rubble001 | NW_PL_RUBBLE001
Fern | plc_fern | Fern
Grass Tuft | plc_grasstuft | PlantGrowthGrassTufts
Shrub | plc_shrub | PlantGrowthShrubs
Stones | plc_stones | Stones
Tree (1) | plc_tree | TreeNormal
Tree (2) | plc_treeautumn | TreeAutumn


Resource.Placeables - Penants and Signs

Home > Reference > Resources > Placeables > Penants and Signs

Penants and Signs

Penants and signs.

Placeables

Placeables | ResRef | Tag
Banner (1) | plc_flag1 | FlagPennantBanner1
Banner (2) | plc_flag2 | FlagPennantBanner2
Banner (3) | plc_flag3 | FlagPennantBanner3
Banner (4) | plc_flag4 | FlagPennantBanner4
Banner (5) | plc_flag5 | FlagPennantBanner5
Banner (6) | plc_flag6 | FlagPennantBanner6
Banner (7) | plc_flag7 | FlagPennantBanner7
Banner (8) | plc_flag8 | FlagPennantBanner8
Boulder | plc_boulder | Boulder
Headstone | plc_headstone | Headstone
Merchants Shingle (1) | plc_billboard1 | MerchantsShingle1
Merchants Shingle (2) | plc_billboard2 | MerchantsShingle2
Merchants Shingle (3) | plc_billboard3 | MerchantsShingle3
Merchants Shingle (4) | plc_billboard4 | MerchantsShingle4
Merchants Shingle (5) | plc_billboard5 | MerchantsShingle5
Merchants Shingle (6) | plc_billboard6 | MerchantsShingle6
Merchants Shingle (7) | plc_billboard7 | MerchantsShingle7
Merchants Shingle (8) | plc_billboard8 | MerchantsShingle8
Placard (1) | plc_placard1 | FreestandingMerchantsPlacard1
Placard (2) | plc_placard2 | FreestandingMerchantsPlacard2
Placard (3) | plc_placard3 | FreestandingMerchantsPlacard3
Placard (4) | plc_placard4 | FreestandingMerchantsPlacard4
Placard (5) | plc_placard5 | FreestandingMerchantsPlacard5
Placard (6) | plc_placard6 | FreestandingMerchantsPlacard6
Placard (7) | plc_placard7 | FreestandingMerchantsPlacard7
Placard (8) | plc_placard8 | FreestandingMerchantsPlacard8
Signpost (1) | plc_signpost | Signpost1
Signpost (2) | plc_signpost2 | Signpost2
Signpost (3) | plc_signpost3 | Signpost3


Resource.Placeables - Trades and Academic and Farm

Home > Reference > Resources > Placeables > Trades and Academic and Farm

Trades and Academic and Farm

Work and craft equipment.

Placeables

Placeables | ResRef | Tag
Alchemist's Apparatus | plc_alchapprtus | AlchemistsApparatus
Anvil | plc_anvil | Anvil
Bolts Of Cloth | plc_bltofcloth | BoltsofCloth
Divining Pool (1) | nw_pl_lostitems | NW_PL_LOSTITEMS
Divining Pool (2) | plc_diviningpl | DiviningPool
Forge | plc_forge | Forge
Hay Bale | plc_haybundle | HayBundle
Lecturn | plc_lecturn | Lecturn
Sacks Of Flour | plc_sacks | SacksofFlourGrainetc
Sawhorse | plc_sawhorse | Sawhorse


Resource.Placeables - Visual Effects

Home > Reference > Resources > Placeables > Visual Effects

Visual Effects

Eye catching visuals (ooh... its magic!).

Placeables

Placeables | ResRef | Tag
Dust Plume | plc_dustplume | DustPlume
Flame (1) | plc_flamelarge | FlameLarge
Flame (2) | plc_flamemedium | FlameMedium
Flame (3) | plc_flamesmall | FlameSmall
Magic Sparks (1) | plc_magicblue | MagicSparksBlue
Magic Sparks (2) | plc_magiccyan | MagicSparksCyan
Magic Sparks (3) | plc_magicgreen | MagicSparksGreen
Magic Sparks (4) | plc_magicorange | MagicSparksOrange
Magic Sparks (5) | plc_magicpurple | MagicSparksPurple
Magic Sparks (6) | plc_magicred | MagicSparksRed
Magic Sparks (7) | plc_magicwhite | MagicSparksWhite
Magic Sparks (8) | plc_magicyellow | MagicSparksYellow
Portal | plc_portal | Portal
Recall Portal | nw_recall_portal | NW_RECALL_PORTAL
Server Portal | nw_defportal | NW_DEFPORTAL
Shaft Of Light (1) | plc_solblue | ShaftofLightBlue
Shaft Of Light (2) | plc_solcyan | ShaftofLightCyan
Shaft Of Light (3) | plc_solgreen | ShaftofLightGreen
Shaft Of Light (4) | plc_solorange | ShaftofLightOrange
Shaft Of Light (5) | plc_solred | ShaftofLightRed
Shaft Of Light (6) | plc_solwhite | ShaftofLightWhite
Shaft Of Light (7) | plc_solyellow | ShaftofLightYellow
Shaft Of Light (8) | plc_solpurple | ShaftofLightPurple
Tilepathfindwarning | tilepathfindwarn | TilePathfindWarning
Water Drip | plc_waterdrip | WaterDrip


Soun Categories - Sound

Home > Resources > Sound

Sound

Sound | Description
Music | Track numbers for use with several functions found within the Music Effects function category. Note that there are currently no constants to refer to these track numbers; instead they must be referred by numerical index. Track information provided by Tyson McCann.


Resource.Sound - Music

Home > Reference > Resources > Sound > Music

Music

Track numbers for use with several functions found within the Music Effects function category. Note that there are currently no constants to refer to these track numbers; instead they must be referred by numerical index. Track information provided by Tyson McCann.

Sound

Music | Integer Value
Arabeth Theme 1 | 51
Arabeth Theme 2 | 52
Boss Combat City | 43
Boss Combat Forest | 44
Boss Lizardfolk | 45
City Combat 1 | 40
City Combat 2 | 41
City Combat 3 | 42
City Docks Day | 17
City Docks Night | 18
City Marketplace | 20
City Night | 21
City Slum Day | 15
City Slum Night | 16
City Wealthy | 19
Combat Aribeth | 47
Crypt 1 | 11
Crypt 2 | 12
Dragon Combat | 46
Dungeon Combat 1 | 37
Dungeon Combat 2 | 38
Dungeon Combat 3 | 39
Evil Dungeon 1 | 13
Evil Dungeon 2 | 14
Evil Temple | 28
Final Boss Combat Source Stone | 48
Forest Combat 1 | 35
Forest Combat 2 | 36
Forest Day 1 | 4
Forest Day 2 | 5
Forest Night | 6
Generic Castle Interior | 50
Generic Dungeon | 7
Generic Store | 26
Generic Wealthy House | 25
Good Temple | 27
Good Temple 2 | 49
Mines 1 | 9
Mines 2 | 10
NWN Chapter 1 | 30
NWN Chapter 2 | 31
NWN Chapter 3 | 32
NWN Chapter 4 | 33
NWN City Theme | 29
Rural Combat 1 | 34
Rural Day 1 | 1
Rural Day 2 | 2
Rural Night | 3
Sewer | 8
Tavern 1 | 22
Tavern 2 | 23
Tavern 3 | 24
Tavern 4 | 56
Theme Aarin Gend | 53
Theme Maugrim | 54
Theme Morag | 55


Data Type Categories - Data Type

Home > Reference

Reference (リファレンス)

Functions (ファンクション)

Events (イベント)

Constants (定数)

Data Type (データ・タイプ)


Constant Categories - Constants

Home > Reference > Constants

Constants

定数とは数値を表す名称です。

定数は特定の値を表す記述として一ヶ所で定義しておけば、ソースコード上のその定数は全て同じ数値として振る舞います。

例えば年数を表す数値をソースコード上で扱います。その値を2002から2003に変更しようとします。

ソースコード上のあちこちにある2002という記述を2003に変更するよりも、定数"YEAR"をソースコード上に用いておけば、あとから"YEAR"の定義を2002から2003に変更するだけで済むのです。

また、定数は一意の名前を付けることにより、人間が解釈しやすいようにするといった用途でも用いられます。

例えば、白を表す数値(0xFFFFFF)の代わりにWHITEと書いた方が解釈しやすいでしょう。

定数は変数と異なり一定の値をとり、その値を動的に変えることはできません。

コンパイル時にプリコンパイラーがソースコード上の定数を意味するコードを探し出して実際の数値に置き換えます。

Constant Groups

Constant Group | Description
ABILITY_* | キャラクターの基本的な６つの能力値
AC_* | Armor class adjustments.
ACTION_* | Standard actions.
ALIGNMENT_* | 属性の設定。気質(善と悪)と、道徳的規範(秩序と混沌)を含んでいます。
ANIMAL_COMPANION_CREATURE_TYPE_* | 動物の相棒に出来るカテゴリー。動物の相棒と使い魔が異なることに注意してください。
ANIMATION_* | List of animations.
AOE_MOB_* | Area effects with mobile areas. Usually fixed on a mobile creature or target.
AOE_PER_* | Area effects centered on a fixed point. Location data type? UNKNOWN
AREA_TRANSITION_* | Defines the various different categories of area transition screens that are displayed when an area is loading.
ASSOCIATE_COMMAND_* | Used to define various commands that can be issued to NPC associates.
ASSOCIATE_TYPE_* | プレイヤーキャラクターが仲間に出来るNPCの種類。
ATTACK_BONUS_* | Used to specify which attacks are modified by an EffectAttackIncrease() or EffectAttackDecrease() effect.
ATTITUDE_* | Determines attitudes between creatures.
BASE_ITEM_* | Base items that other items can be built on top of.
BODY_NODE_* | Location on a body; either hand or chest. Purpose unknown.
CAMERA_MODE_* | Selects one of the three perspective views available in the game.
CAMERA_TRANSITION_TYPE_* | Used with SetCameraFacing() to determine how smoothly to transition the camera.
CLASS_TYPE_* | Defines the standard class types.
COMBAT_MODE_* | Different combat modes.
CREATURE_SIZE_* | The size classes that creatures can belong to. Does not include gargantuan and colossal.
CREATURE_TYPE_* | NWN-specific subtype denoting special attributes for a given creature.
DAMAGE_BONUS_* | Determines magical adjustments to damage. Not treated the same as DAMAGE_POWER_*, which determines if an attack can penetrate damage reduction.
DAMAGE_POWER_* | Determines the magical strength of a melee or missile attack (for harming creatures with damage reduction). Does not determine actual magical bonus (see DAMAGE_BONUS_*), just determines what damage reductions an attack bypasses.
DAMAGE_TYPE_* | The type of damage that can be inflicted.
DIRECTION_* | Used for determining compass direction.
DISEASE_* | Different types of Diseases used in creating disease effect objects.
DOOR_ACTION_* | A list of actions that can be done on a door.
DURATION_TYPE_* | Duration types for ApplyEffectAtLocation and ApplyEffectToObject functions.
EFFECT_TYPE_* | Constants that reflect the different effects that can be applied to creatures.
ENCOUNTER_DIFFICULTY_* | The list of encounter difficulties.
FAMILIAR_CREATURE_TYPE_* | 使い魔とはウィザードやソーサラーに特別に召喚され、仕えるクリーチャーです。 彼らは術者の仕事を手伝います。例えば呪文のスクロールを集めたり、メッセージを届けたり、戦闘さえも参加します。 しかしたいていは術者の肩や帽子の先に停まり、腕白な笑みをもらしています。 ウィザードやソーサラーの使い魔が死ぬと術者は肉体的なショックを受けます。(１ｄ６ダメージ) 使い魔と動物の相棒は異なることに注意してください。
FEAT_* | Constants that deal with different feats that can be performed.
GAME_DIFFICULTY_* | Specifies the list of available setting for game difficulty.
GENDER_* | List of genders
Globals | Global, non-grouped constant values.
GUI_PANEL_* | List of all graphical panels (dialogs in windows programming terminology).
IMMUNITY_TYPE_* | Constants to identify different immunities that creatures could possible have.
INVENTORY_DISTURB_TYPE_* | The list of possible ways an inventory can be disturbed.
INVENTORY_SLOT_* | Constant group for inventory equipment slots. These are the slots where items are placed when that are equiped (in use), and not the slots where items are just stored.
INVISIBILITY_TYPE_* | Determines how a creature is protected from the sight of other creatures.
ITEM_PROPERTY_* | Magical or other properties that can be applied to an item.
METAMAGIC_* | Metamagic feats applied to a spell.
NW_ASC_* | Covers miscellaneous skills and settings not categorized into other subgroups.
NW_ASC_AGRESSIVE_* | Determines what skills or abilities an NPC associate uses automatically.
NW_ASC_DISTANCE_* | Determines the distance, in meters, the NPC associate follows the PC at.
NW_ASC_HEAL_AT_* | Used to determine at which percentage of the master's hit points an NPC associate should attempt to heal the master.
NW_FLAG_* | Used to cause events to fire various numeric signals to OnUserDefined and set other attributes of a creature during the OnSpawn script using SetSpawnInCondition. The OnUserDefined event can thus be used to customize the behavior of an object without actually modifying the default behavior.
NW_FLAG_BEHAVIOR_* | Determines how an NPC reacts, irregardless of faction. &quot;NW_I0_GENERIC&quot; must be included to use these constants (include &quot;NW_I0_GENERIC using the #include compiler directive).
OBJECT_TYPE_* | Used to categorize types of objects.
PANEL_BUTTON_* | Client panel buttons including character sheet, inventory, journal, map, options, player vs player, resting and spellbook.
PERCEPTION_* | Determines if a creature perceives another creature using its Spot skill vs. the other creature's Hide skill and its Listen skill vs. the other creature's Move Silently skill.
PERSISTENT_ZONE_* | Used with GetFirstInPersistentObject() and GetNextInPersistentObject() functions.
PLACEABLE_ACTION_* | Actions that can be performed on placeable objects.
PLAYER_CHAR_* | Used for testing if a PC is actually controlled by a player.
POISON_* | This constant group defines the many in game poisons.
POLYMORPH_TYPE_* | These constants define the properties applied to targets when they are polymorphed into different creatures.
PROJECTILE_PATH_TYPE_* | Different types of project paths (the path a missile weapon or other projectile follows as it travels).
RACIAL_TYPE_* | Constants used to identify different races (human, dwarf etc)
RADIUS_SIZE_* | Different degrees of radius size used in area-based functions.
REPUTATION_TYPE_* | Determines how creatures react to one another.
REST_EVENTTYPE_* | Determines the status of the last rest event for the PC.
SAVING_THROW_TYPE_* | Describes different saving throw types.
SHAPE_* | SHAPE_* constants are used in the GetFirstObjectInShape() and GetNextObjectInShape() functions.
SKILL_* | Skills used in NWN.
SPECIAL_ATTACK_* | Special attacks that can be performed during combat.
SPELL_* | Magical spells cast by classes such as wizards, sorcerers, bards, clerics, and druids.
SPELL_SCHOOL_* | Schools of spells.
SPELLABILITY_* | Magical spell-like abilities some creatures possess.
STANDARD_FACTION_* | The four generic factions used to determine enmity and friendship by NPCs.
SUBSKILL_* | Subskills for dealing with traps; additions for Rogues to their standard Search skill.
SUBTYPE_* | Effect subtypes.
TALENT_CATEGORY_* | Groups the talents into categories.
TALENT_TYPE_* | Primary category of talents for use by creatures in game.
TALKVOLUME_* | Sets the broadcast range of text displayed using SpeakString() and ActionSpeakString() functions.
TILE_MAIN_LIGHT_COLOR_* | List of available colors to be used as the main light source of a tile.
TRAP_BASE_TYPE_* | Used to catagorize the strength and type of traps.
TREASURE_* | Treasure types. These constants are defined in &quot;nw_o2_coninclude&quot;; in order to use the constant values the file &quot;nw_o2_coninclude&quot; must be included (using the &quot;#include&quot; compiler directive).
VFX_BEAM_* | Beams fire in a straight line towards their targets.
VFX_COM_* | Common visual special effects.
VFX_DUR_* | Temporary visual effects that last for a specified duration.
VFX_FNF_* | Bigger, flashier visual effects.
VFX_IMP_* | Impact visual effects that are generally used for spells when the spell effect hits someone. VFX_IMP_* -type effects can only be applied with DURATION_TYPE_INSTANT
VOICE_CHAT_* | List of character voice sayings.
WEATHER_* | Different weather types.

JP team: marshall, geshi


Constant - ABILITY

Home > Reference > Constants > ABILITY_*

ABILITY_* Constant Group

キャラクターの基本的な６つの能力値

Constants

Constant Description
ABILITY_CHARISMA
基本的な能力値の１つで、キャラクターの説得力、魅力、統率力を表します。

"CHR"と略記します。

ABILITY_CONSTITUTION
基本的な能力値の１つで、キャラクターの体格、健康、苦痛・負傷・病気への肉体的耐性を表します。

"CON"と略記します。

ABILITY_DEXTERITY
基本的な能力値の１つで、キャラクターの反射神経、敏捷性、反応速度、バランス感覚を表します。

"DEX"と略記します。

ABILITY_INTELLIGENCE
基本的な能力値の１つで、キャラクターの記憶力、論理的思考、習得能力(文献から正確に得られるもの以外も含みます)を表します。

"INT"と略記します。

ABILITY_STRENGTH
基本的な能力値の１つで、キャラクターの筋力、耐久力、持久力を表します。

"STR"と略記します。

ABILITY_WISDOM
基本的な能力値の１つで、キャラクターの啓発、判断力、狡猾さ、意志の強さ、常識、洞察力を表します。

"WIS"と略記します。

See Also

functions:? EffectAbilityDecrease | EffectAbilityIncrease | GetAbilityModifier | GetAbilityScore

JP team: marshall


Constant - AC

Home > Reference > Constants > AC_*

AC_* Constant Group

アーマークラス修正

Constants

Constant Description
AC_ARMOUR_ENCHANTMENT_BONUS
魔法によってボーナスを得たものや熟練工による高品質のボーナスです。
鎧にのみ適用され、盾には適用されません。
AC_DEFLECTION_BONUS
反発修正
AC_DODGE_BONUS
回避修正
AC_NATURAL_BONUS
クリーチャーの持つ強靭な皮革や高い敏捷力による生来のボーナス。
AC_SHIELD_ENCHANTMENT_BONUS
魔法によってボーナスを得たものや熟練工による高品質のボーナスです。
盾に適用されます。

See Also

functions: EffectACDecrease | EffectACIncrease


Constant - ACTION

Home > Reference > Constants > ACTION_*

ACTION_* Constant Group

標準のアクション

Constants

Constant Description
ACTION_ANIMALEMPATHY
UNKNOWN
ACTION_ATTACKOBJECT
UNKNOWN
ACTION_CASTSPELL
UNKNOWN
ACTION_CLOSEDOOR
UNKNOWN
ACTION_COUNTERSPELL
UNKNOWN
ACTION_DIALOGOBJECT
UNKNOWN
ACTION_DISABLETRAP
UNKNOWN
ACTION_DROPITEM
UNKNOWN
ACTION_EXAMINETRAP
UNKNOWN
ACTION_FLAGTRAP
UNKNOWN
ACTION_FOLLOW
UNKNOWN
ACTION_HEAL
UNKNOWN
ACTION_INVALID
UNKNOWN
ACTION_ITEMCASTSPELL
UNKNOWN
ACTION_LOCK
UNKNOWN
ACTION_MOVETOPOINT
UNKNOWN
ACTION_OPENDOOR
UNKNOWN
ACTION_OPENLOCK
UNKNOWN
ACTION_PICKPOCKET
UNKNOWN
ACTION_PICKUPITEM
UNKNOWN
ACTION_RECOVERTRAP
UNKNOWN
ACTION_REST
UNKNOWN
ACTION_SETTRAP
UNKNOWN
ACTION_SIT
UNKNOWN
ACTION_TAUNT
UNKNOWN
ACTION_USEOBJECT
UNKNOWN
ACTION_WAIT
UNKNOWN

See Also

functions: GetCurrentAction


Constant - AI_LEVEL

Home > Reference > Constants > AI_LEVEL_*

AI_LEVEL_* Constant Group

クリーチャーを動かしているAI（人工知能）のレベルを定めます。
AIのレベルが”高度”ということはCPU時間がより多いということです。

Constants

Constant Description
AI_LEVEL_DEFAULT
デフォルトの設定です。必要に応じて適切なAIを選択します。
AI_LEVEL_HIGH
優先度が高く、頭の良いAIです。しかしかなりのCPUパワーを消費します。
カットシーン中以外では避けましょう。
AI_LEVEL_INVALID
無効なAIの設定です。
AI_LEVEL_LOW
優先度の低い、あまり頭の良くないAIです。しかし使うCPUパワーはあまり多くありません。
戦闘中での使用は避け、プレーヤーがエリア内にいる普通の状況で使いましょう。
AI_LEVEL_NORMAL
標準の優先度で、標準の頭の良さです。少しCPUパワーを必要とします。
戦闘中で使うと良いでしょう。
AI_LEVEL_VERY_LOW
優先度はとても低く、頭の悪いAIです。しかしCPUパワーを最も必要としません。
プレーヤーがエリア内にいない状況で使います。

See Also

functions: GetAILevel | SetAILevel


Constant - ALIGNMENT

Home > Reference > Constants > ALIGNMENT_*

ALIGNMENT_* Constant Group

属性の設定。気質(善と悪)と、道徳的規範(秩序と混沌)を含んでいます。

Constants

Constant Description
ALIGNMENT_ALL
標準的な属性設定の象徴していて、呼ばれた関数によって効果が異なります。
ALIGNMENT_CHAOTIC
混沌属性のキャラクターは自らの道義的判断に基づいて行動します。何をすべきかということを言われるのを不快に思い、伝統よりも新しいアイディアを好み、好ましいと思った約束は実行します。

混沌属性は３つの標準的な分類、混沌にして善(ChaoticGood－"反乱分子")、混沌にして中立(ChaoticNeutral－"自由人")、混沌にして悪(ChaoticEvil－"破壊者")を含んでいます。

ALIGNMENT_EVIL
悪属性は快楽または利己のために他人を傷つけ、虐げ、殺害を行います。
ALIGNMENT_GOOD
善属性は利他的行為、生命の尊重、生物の尊厳に注意を払います。
ALIGNMENT_LAWFUL
秩序属性のキャラクターは真実を述べ、口にしたことを守り、権威を尊重し、伝統を重んじ、果たすべき義務を満たさない人々を裁きます。

秩序属性は３つの標準的な分類、秩序にして善(LawfulGood－"求道者")、秩序にして中立(LawfulNeutral－"裁定者")、秩序にして悪(LawfulEvil－"圧政者")を含んでいます。

ALIGNMENT_NEUTRAL
この定数は気質(善と悪)と道徳的規範(秩序と混沌)の両方が中立であることを表しています。

道徳的規範として中立であるキャラクターは権威に対して標準的な敬意を抱き、服従心や反逆心といった衝動は感じません。

中立属性は３つの標準的な分類、中立にして善(NeutralGood－"慈善家")、真なる中立(TrueNeutral－"中立")、中立にして悪(NeutralEvil－"悪人")を含んでいます。

See Also

functions: AdjustAlignment | CreateProtectionFromAlignmentLink | DoGiveXP | GetAlignmentGoodEvil | GetAlignmentLawChaos | RewardXP | VersusAlignmentEffect

JP team: marshall


Constant - ANIMAL_COMPANION_CREATURE_TYPE

Home > Reference > Constants > ANIMAL_COMPANION_CREATURE_TYPE_*

ANIMAL_COMPANION_CREATURE_TYPE_* Constant Group

動物の相棒に出来るカテゴリー。動物の相棒と使い魔が異なることに注意してください。

Constants

Constant Description
ANIMAL_COMPANION_CREATURE_TYPE_BADGER
通常のバッジャー(アナグマ)は小さいが獰猛な哺乳動物です。

長い爪を持った四肢は強力で、穴を掘ったり、自らを守るために用います。

ノームは使い魔や動物の相棒としてバッジャーを好みます。

第３版モンスターマニュアルの193ページに載っています。

ANIMAL_COMPANION_CREATURE_TYPE_BEAR
ブラウンベア(ヒグマ)は通常、非常に気性の激しい縄張り意識がある動物だと認識されています。

ブラウンベアはしばしばドルイドの相棒として見かけられます。

第３版モンスターマニュアルの193ページに載っています。

ANIMAL_COMPANION_CREATURE_TYPE_BOAR
ボア(イノシシ)はとても気性が激しく、通常は邪魔する者に対して突進して牙で引き裂きます。

第３版モンスターマニュアルの194ページに載っています。

ANIMAL_COMPANION_CREATURE_TYPE_DIREWOLF
ダイアウルフは通常の狼よりも大きく悪意に満ちています。

ダイアウルフはしばしば強力なレンジャーやドルイドの相棒として見かけられます。

第３版モンスターマニュアルの57ページに載っています。

ANIMAL_COMPANION_CREATURE_TYPE_HAWK
ホーク(タカ)は上空から優れた視認能力で標的を見つけ、齧歯(げっし)類を捕獲する鳥類です。

第３版モンスターマニュアルの196ページに載っています。

ANIMAL_COMPANION_CREATURE_TYPE_NONE
この値は動物の相棒を仲間にしていないクリーチャーを表すのに使われます。
ANIMAL_COMPANION_CREATURE_TYPE_PANTHER
パンサー(ヒョウ)は獲物の背後に一旦身を潜め、影から攻撃をしかけてきます。
ANIMAL_COMPANION_CREATURE_TYPE_SPIDER
スパイダー(クモ)は８本の足を持つクリーチャーで、獲物を捕らえるために様々な形や大きさをした巣を張ります。

動物の相棒になるクモは大きなクモです。

第３版モンスターマニュアルの210ページに載っています。

ANIMAL_COMPANION_CREATURE_TYPE_WOLF
厳格な個人主義の象徴であり、群れでの狩りの能力でも有名です。気高いウルフ(オオカミ)は神秘性と力を備えた動物です。

第３版モンスターマニュアルの204ページに載っています。

See Also

functions:? GetFamiliarCreatureType

JP team: marshall


Constant - ANIMATION

Home > Reference > Constants > ANIMATION_*

ANIMATION_* Constant Group

アニメーションのリスト

Constants

Constant Description
ANIMATION_FIREFORGET_BOW
おじぎのアニメーション
ANIMATION_FIREFORGET_DODGE_DUCK
回避の際のかがむアニメーション
ANIMATION_FIREFORGET_DODGE_SIDE
回避の際の半歩避けるアニメーション
ANIMATION_FIREFORGET_DRINK
飲むアニメーション
ANIMATION_FIREFORGET_GREETING
挨拶のアニメーション
ANIMATION_FIREFORGET_HEAD_TURN_LEFT
左に首を振るアニメーション
ANIMATION_FIREFORGET_HEAD_TURN_RIGHT
右に首を振るアニメーション
ANIMATION_FIREFORGET_PAUSE_BORED
立ちっぱなしで退屈しているアニメーション
ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD
頭をかくアニメーション
ANIMATION_FIREFORGET_READ
読むアニメーション
ANIMATION_FIREFORGET_SALUTE
敬礼のアニメーション
ANIMATION_FIREFORGET_STEAL
盗むアニメーション
ANIMATION_FIREFORGET_TAUNT
挑発するアニメーション
ANIMATION_FIREFORGET_VICTORY1
喜びのアニメーションの一つ
ANIMATION_FIREFORGET_VICTORY2
喜びのアニメーションの一つ
ANIMATION_FIREFORGET_VICTORY3
喜びのアニメーションの一つ
ANIMATION_LOOPING_CONJURE1
体の前で手を動かして、魔法をかけるアニメーションのループ
ANIMATION_LOOPING_CONJURE2
頭の上で手を動かして、魔法をかけるアニメーションのループ
ANIMATION_LOOPING_DEAD_BACK
ANIMATION_LOOPING_DEAD_FRONTと同様、倒れているアニメーション。
仰向けで寝ている。
ANIMATION_LOOPING_DEAD_FRONT
死や眠りのエフェクトとしてうつ伏せで寝る。移動や自身をクリックするとやめます。
寝ているときに攻撃をされても起き上がりません。
ANIMATION_LOOPING_GET_LOW
床から物を拾うアニメーション
ANIMATION_LOOPING_GET_MID
腰の高さのものから拾うアニメーション
ANIMATION_LOOPING_LISTEN
聴いているアニメーションのループ
ANIMATION_LOOPING_LOOK_FAR
遠くを眺めるアニメーションのループ
ANIMATION_LOOPING_MEDITATE
瞑想しているループアニメーション
ANIMATION_LOOPING_PAUSE
立っているループアニメーション
ANIMATION_LOOPING_PAUSE_DRUNK
酔っ払っているアニメーションのループ
ANIMATION_LOOPING_PAUSE_TIRED
疲れているアニメーションのループ
ANIMATION_LOOPING_PAUSE2
立っているループアニメーション
ANIMATION_LOOPING_SIT_CHAIR
椅子に座るアニメーション
ANIMATION_LOOPING_SIT_CROSS
足を組んで座るアニメーション
ANIMATION_LOOPING_SPASM
痙攣のループアニメーション。
個人的には変だと思います…
ANIMATION_LOOPING_TALK_FORCEFUL
力説しているアニメーションのループ
ANIMATION_LOOPING_TALK_LAUGHING
笑うループアニメーション
ANIMATION_LOOPING_TALK_NORMAL
話しているループアニメーション
ANIMATION_LOOPING_TALK_PLEADING
懇願しているループアニメーション
ANIMATION_LOOPING_WORSHIP
祈っているアニメーションのループ
ANIMATION_PLACEABLE_ACTIVATE
配置物が稼動状態となるアニメーション
ANIMATION_PLACEABLE_CLOSE
配置物が閉じるアニメーション
ANIMATION_PLACEABLE_DEACTIVATE
配置物が非稼動状態となるアニメーション
ANIMATION_PLACEABLE_OPEN
配置物が開くアニメーション

See Also

functions: ActionPlayAnimation | MakeDrunk | PlayAnimation | PlayConversationAnimation


Constant - AOE_MOB

Home > Reference > Constants > AOE_MOB_*

AOE_MOB_* Constant Group

範囲エフェクトです。通常は移動するクリーチャーに設定されます。

Constants

Constant Description
AOE_MOB_BLINDING
UNKNOWN
AOE_MOB_CIRCCHAOS
UNKNOWN
AOE_MOB_CIRCEVIL
UNKNOWN
AOE_MOB_CIRCGOOD
UNKNOWN
AOE_MOB_CIRCLAW
UNKNOWN
AOE_MOB_DRAGON_FEAR
UNKNOWN
AOE_MOB_ELECTRICAL
UNKNOWN
AOE_MOB_FEAR
UNKNOWN
AOE_MOB_FIRE
UNKNOWN
AOE_MOB_FROST
UNKNOWN
AOE_MOB_INVISIBILITY_PURGE
UNKNOWN
AOE_MOB_MENACE
UNKNOWN
AOE_MOB_PROTECTION
UNKNOWN
AOE_MOB_SILENCE
UNKNOWN
AOE_MOB_STUN
UNKNOWN
AOE_MOB_TYRANT_FOG
UNKNOWN
AOE_MOB_UNEARTHLY
UNKNOWN
AOE_MOB_UNNATURAL
UNKNOWN

See Also

Send comments on this topic.


Constant - AOE_PER

Home > Reference > Constants > AOE_PER_*

AOE_PER_* Constant Group

ある一点を中央とした範囲エフェクトです。位置のデータタイプは不明。

Constants

Constant Description
AOE_PER_CREEPING_DOOM
UNKNOWN
AOE_PER_DARKNESS
UNKNOWN
AOE_PER_DELAY_BLAST_FIREBALL
UNKNOWN
AOE_PER_ENTANGLE
UNKNOWN
AOE_PER_EVARDS_BLACK_TENTACLES
UNKNOWN
AOE_PER_FOGACID
UNKNOWN
AOE_PER_FOGFIRE
UNKNOWN
AOE_PER_FOGGHOUL
UNKNOWN
AOE_PER_FOGKILL
UNKNOWN
AOE_PER_FOGMIND
UNKNOWN
AOE_PER_FOGSTINK
UNKNOWN
AOE_PER_GREASE
UNKNOWN
AOE_PER_INVIS_SPHERE
UNKNOWN
AOE_PER_STORM
UNKNOWN
AOE_PER_WALLBLADE
UNKNOWN
AOE_PER_WALLFIRE
UNKNOWN
AOE_PER_WALLWIND
UNKNOWN
AOE_PER_WEB
UNKNOWN

See Also

Send comments on this topic.


Constant - APPEARANCE_TYPE

Home > Reference > Constants > APPEARANCE_TYPE_*

APPEARANCE_TYPE_* Constant Group

クリーチャーの外見

Constants

Constant Description
APPEARANCE_TYPE_ALLIP
APPEARANCE_TYPE_ARANEA
APPEARANCE_TYPE_ARCH_TARGET
APPEARANCE_TYPE_ARIBETH
APPEARANCE_TYPE_ASABI_CHIEFTAIN
APPEARANCE_TYPE_ASABI_SHAMAN
APPEARANCE_TYPE_ASABI_WARRIOR
APPEARANCE_TYPE_BADGER
APPEARANCE_TYPE_BADGER_DIRE
APPEARANCE_TYPE_BALOR
APPEARANCE_TYPE_BARTENDER
APPEARANCE_TYPE_BASILISK
APPEARANCE_TYPE_BAT
APPEARANCE_TYPE_BAT_HORROR
APPEARANCE_TYPE_BEAR_BLACK
APPEARANCE_TYPE_BEAR_BROWN
APPEARANCE_TYPE_BEAR_DIRE
APPEARANCE_TYPE_BEAR_KODIAK
APPEARANCE_TYPE_BEAR_POLAR
APPEARANCE_TYPE_BEETLE_FIRE
APPEARANCE_TYPE_BEETLE_SLICER
APPEARANCE_TYPE_BEETLE_STAG
APPEARANCE_TYPE_BEETLE_STINK
APPEARANCE_TYPE_BEGGER
APPEARANCE_TYPE_BLOOD_SAILER
APPEARANCE_TYPE_BOAR
APPEARANCE_TYPE_BOAR_DIRE
APPEARANCE_TYPE_BODAK
APPEARANCE_TYPE_BUGBEAR_A
APPEARANCE_TYPE_BUGBEAR_B
APPEARANCE_TYPE_BUGBEAR_CHIEFTAIN_A
APPEARANCE_TYPE_BUGBEAR_CHIEFTAIN_B
APPEARANCE_TYPE_BUGBEAR_SHAMAN_A
APPEARANCE_TYPE_BUGBEAR_SHAMAN_B
APPEARANCE_TYPE_CAT_CAT_DIRE
APPEARANCE_TYPE_CAT_COUGAR
APPEARANCE_TYPE_CAT_CRAG_CAT
APPEARANCE_TYPE_CAT_JAGUAR
APPEARANCE_TYPE_CAT_KRENSHAR
APPEARANCE_TYPE_CAT_LEOPARD
APPEARANCE_TYPE_CAT_LION
APPEARANCE_TYPE_CAT_MPANTHER
APPEARANCE_TYPE_CAT_PANTHER
APPEARANCE_TYPE_CHICKEN
APPEARANCE_TYPE_COCKATRICE
APPEARANCE_TYPE_COMBAT_DUMMY
APPEARANCE_TYPE_CONVICT
APPEARANCE_TYPE_COW
APPEARANCE_TYPE_CULT_MEMBER
APPEARANCE_TYPE_DEER
APPEARANCE_TYPE_DEER_STAG
APPEARANCE_TYPE_DEVIL
APPEARANCE_TYPE_DOG
APPEARANCE_TYPE_DOG_BLINKDOG
APPEARANCE_TYPE_DOG_DIRE_WOLF
APPEARANCE_TYPE_DOG_FENHOUND
APPEARANCE_TYPE_DOG_HELL_HOUND
APPEARANCE_TYPE_DOG_SHADOW_MASTIF
APPEARANCE_TYPE_DOG_WINTER_WOLF
APPEARANCE_TYPE_DOG_WOLF
APPEARANCE_TYPE_DOG_WORG
APPEARANCE_TYPE_DOOM_KNIGHT
APPEARANCE_TYPE_DRAGON_BLACK
APPEARANCE_TYPE_DRAGON_BLUE
APPEARANCE_TYPE_DRAGON_BRASS
APPEARANCE_TYPE_DRAGON_BRONZE
APPEARANCE_TYPE_DRAGON_COPPER
APPEARANCE_TYPE_DRAGON_GOLD
APPEARANCE_TYPE_DRAGON_GREEN
APPEARANCE_TYPE_DRAGON_RED
APPEARANCE_TYPE_DRAGON_SILVER
APPEARANCE_TYPE_DRAGON_WHITE
APPEARANCE_TYPE_DROW_CLERIC
APPEARANCE_TYPE_DROW_FIGHTER
APPEARANCE_TYPE_DRUEGAR_CLERIC
APPEARANCE_TYPE_DRUEGAR_FIGHTER
APPEARANCE_TYPE_DRYAD
APPEARANCE_TYPE_DWARF
APPEARANCE_TYPE_DWARF_NPC_FEMALE
APPEARANCE_TYPE_DWARF_NPC_MALE
APPEARANCE_TYPE_ELEMENTAL_AIR
APPEARANCE_TYPE_ELEMENTAL_AIR_ELDER
APPEARANCE_TYPE_ELEMENTAL_EARTH
APPEARANCE_TYPE_ELEMENTAL_EARTH_ELDER
APPEARANCE_TYPE_ELEMENTAL_FIRE
APPEARANCE_TYPE_ELEMENTAL_FIRE_ELDER
APPEARANCE_TYPE_ELEMENTAL_WATER
APPEARANCE_TYPE_ELEMENTAL_WATER_ELDER
APPEARANCE_TYPE_ELF
APPEARANCE_TYPE_ELF_NPC_FEMALE
APPEARANCE_TYPE_ELF_NPC_MALE_01
APPEARANCE_TYPE_ELF_NPC_MALE_02
APPEARANCE_TYPE_ETTERCAP
APPEARANCE_TYPE_ETTIN
APPEARANCE_TYPE_FAERIE_DRAGON
APPEARANCE_TYPE_FAIRY
APPEARANCE_TYPE_FALCON
APPEARANCE_TYPE_FEMALE_01
APPEARANCE_TYPE_FEMALE_02
APPEARANCE_TYPE_FEMALE_03
APPEARANCE_TYPE_FEMALE_04
APPEARANCE_TYPE_FORMIAN_MYRMARCH
APPEARANCE_TYPE_FORMIAN_QUEEN
APPEARANCE_TYPE_FORMIAN_WARRIOR
APPEARANCE_TYPE_FORMIAN_WORKER
APPEARANCE_TYPE_GARGOYLE
APPEARANCE_TYPE_GHAST
APPEARANCE_TYPE_GHOUL
APPEARANCE_TYPE_GHOUL_LORD
APPEARANCE_TYPE_GIANT_FIRE
APPEARANCE_TYPE_GIANT_FIRE_FEMALE
APPEARANCE_TYPE_GIANT_FROST
APPEARANCE_TYPE_GIANT_FROST_FEMALE
APPEARANCE_TYPE_GIANT_HILL
APPEARANCE_TYPE_GIANT_MOUNTAIN
APPEARANCE_TYPE_GNOLL_WARRIOR
APPEARANCE_TYPE_GNOLL_WIZ
APPEARANCE_TYPE_GNOME
APPEARANCE_TYPE_GNOME_NPC_FEMALE
APPEARANCE_TYPE_GNOME_NPC_MALE
APPEARANCE_TYPE_GOBLIN_A
APPEARANCE_TYPE_GOBLIN_B
APPEARANCE_TYPE_GOBLIN_CHIEF_A
APPEARANCE_TYPE_GOBLIN_CHIEF_B
APPEARANCE_TYPE_GOBLIN_SHAMAN_A
APPEARANCE_TYPE_GOBLIN_SHAMAN_B
APPEARANCE_TYPE_GOLEM_BONE
APPEARANCE_TYPE_GOLEM_CLAY
APPEARANCE_TYPE_GOLEM_FLESH
APPEARANCE_TYPE_GOLEM_IRON
APPEARANCE_TYPE_GOLEM_STONE
APPEARANCE_TYPE_GORGON
APPEARANCE_TYPE_GREY_RENDER
APPEARANCE_TYPE_GYNOSPHINX
APPEARANCE_TYPE_HALF_ELF
APPEARANCE_TYPE_HALF_ORC
APPEARANCE_TYPE_HALF_ORC_NPC_FEMALE
APPEARANCE_TYPE_HALF_ORC_NPC_MALE_01
APPEARANCE_TYPE_HALF_ORC_NPC_MALE_02
APPEARANCE_TYPE_HALFLING
APPEARANCE_TYPE_HALFLING_NPC_FEMALE
APPEARANCE_TYPE_HALFLING_NPC_MALE
APPEARANCE_TYPE_HELMED_HORROR
APPEARANCE_TYPE_HEURODIS_LICH
APPEARANCE_TYPE_HOBGOBLIN_WARRIOR
APPEARANCE_TYPE_HOBGOBLIN_WIZARD
APPEARANCE_TYPE_HOOK_HORROR
APPEARANCE_TYPE_HOUSE_GUARD
APPEARANCE_TYPE_HUMAN
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_01
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_02
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_03
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_04
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_05
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_06
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_07
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_08
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_09
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_10
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_11
APPEARANCE_TYPE_HUMAN_NPC_FEMALE_12
APPEARANCE_TYPE_HUMAN_NPC_MALE_01
APPEARANCE_TYPE_HUMAN_NPC_MALE_02
APPEARANCE_TYPE_HUMAN_NPC_MALE_03
APPEARANCE_TYPE_HUMAN_NPC_MALE_04
APPEARANCE_TYPE_HUMAN_NPC_MALE_05
APPEARANCE_TYPE_HUMAN_NPC_MALE_06
APPEARANCE_TYPE_HUMAN_NPC_MALE_07
APPEARANCE_TYPE_HUMAN_NPC_MALE_08
APPEARANCE_TYPE_HUMAN_NPC_MALE_09
APPEARANCE_TYPE_HUMAN_NPC_MALE_10
APPEARANCE_TYPE_HUMAN_NPC_MALE_11
APPEARANCE_TYPE_HUMAN_NPC_MALE_12
APPEARANCE_TYPE_HUMAN_NPC_MALE_13
APPEARANCE_TYPE_HUMAN_NPC_MALE_14
APPEARANCE_TYPE_HUMAN_NPC_MALE_15
APPEARANCE_TYPE_HUMAN_NPC_MALE_16
APPEARANCE_TYPE_HUMAN_NPC_MALE_17
APPEARANCE_TYPE_HUMAN_NPC_MALE_18
APPEARANCE_TYPE_IMP
APPEARANCE_TYPE_INN_KEEPER
APPEARANCE_TYPE_INTELLECT_DEVOURER
APPEARANCE_TYPE_INVALID
Invalid appearance type.
APPEARANCE_TYPE_INVISIBLE_HUMAN_MALE
APPEARANCE_TYPE_INVISIBLE_STALKER
APPEARANCE_TYPE_KID_FEMALE
APPEARANCE_TYPE_KID_MALE
APPEARANCE_TYPE_KOBOLD_A
APPEARANCE_TYPE_KOBOLD_B
APPEARANCE_TYPE_KOBOLD_CHIEF_A
APPEARANCE_TYPE_KOBOLD_CHIEF_B
APPEARANCE_TYPE_KOBOLD_SHAMAN_A
APPEARANCE_TYPE_KOBOLD_SHAMAN_B
APPEARANCE_TYPE_LANTERN_ARCHON
APPEARANCE_TYPE_LICH
APPEARANCE_TYPE_LIZARDFOLK_A
APPEARANCE_TYPE_LIZARDFOLK_B
APPEARANCE_TYPE_LIZARDFOLK_SHAMAN_A
APPEARANCE_TYPE_LIZARDFOLK_SHAMAN_B
APPEARANCE_TYPE_LIZARDFOLK_WARRIOR_A
APPEARANCE_TYPE_LIZARDFOLK_WARRIOR_B
APPEARANCE_TYPE_LUSKAN_GUARD
APPEARANCE_TYPE_MALE_01
APPEARANCE_TYPE_MALE_02
APPEARANCE_TYPE_MALE_03
APPEARANCE_TYPE_MALE_04
APPEARANCE_TYPE_MALE_05
APPEARANCE_TYPE_MANTICORE
APPEARANCE_TYPE_MEDUSA
APPEARANCE_TYPE_MEPHIT_AIR
APPEARANCE_TYPE_MEPHIT_DUST
APPEARANCE_TYPE_MEPHIT_EARTH
APPEARANCE_TYPE_MEPHIT_FIRE
APPEARANCE_TYPE_MEPHIT_ICE
APPEARANCE_TYPE_MEPHIT_MAGMA
APPEARANCE_TYPE_MEPHIT_OOZE
APPEARANCE_TYPE_MEPHIT_SALT
APPEARANCE_TYPE_MEPHIT_STEAM
APPEARANCE_TYPE_MEPHIT_WATER
APPEARANCE_TYPE_MINOGON
APPEARANCE_TYPE_MINOTAUR
APPEARANCE_TYPE_MINOTAUR_CHIEFTAIN
APPEARANCE_TYPE_MINOTAUR_SHAMAN
APPEARANCE_TYPE_MOHRG
APPEARANCE_TYPE_MUMMY_COMMON
APPEARANCE_TYPE_MUMMY_FIGHTER_2
APPEARANCE_TYPE_MUMMY_GREATER
APPEARANCE_TYPE_MUMMY_WARRIOR
APPEARANCE_TYPE_NW_MILITIA_MEMBER
APPEARANCE_TYPE_NWN_AARIN
APPEARANCE_TYPE_NWN_ARIBETH_EVIL
APPEARANCE_TYPE_NWN_HAEDRALINE
APPEARANCE_TYPE_NWN_MAUGRIM
APPEARANCE_TYPE_NWN_MORAG
APPEARANCE_TYPE_NWN_NASHER
APPEARANCE_TYPE_NWN_SEDOS
APPEARANCE_TYPE_NYMPH
APPEARANCE_TYPE_OGRE
APPEARANCE_TYPE_OGRE_CHIEFTAIN
APPEARANCE_TYPE_OGRE_CHIEFTAINB
APPEARANCE_TYPE_OGRE_MAGE
APPEARANCE_TYPE_OGRE_MAGEB
APPEARANCE_TYPE_OGREB
APPEARANCE_TYPE_OLD_MAN
APPEARANCE_TYPE_OLD_WOMAN
APPEARANCE_TYPE_ORC_A
APPEARANCE_TYPE_ORC_B
APPEARANCE_TYPE_ORC_CHIEFTAIN_A
APPEARANCE_TYPE_ORC_CHIEFTAIN_B
APPEARANCE_TYPE_ORC_SHAMAN_A
APPEARANCE_TYPE_ORC_SHAMAN_B
APPEARANCE_TYPE_OX
APPEARANCE_TYPE_PENGUIN
APPEARANCE_TYPE_PLAGUE_VICTIM
APPEARANCE_TYPE_PROSTITUTE_01
APPEARANCE_TYPE_PROSTITUTE_02
APPEARANCE_TYPE_PSEUDODRAGON
APPEARANCE_TYPE_QUASIT
APPEARANCE_TYPE_RAKSHASA_BEAR_MALE
APPEARANCE_TYPE_RAKSHASA_TIGER_FEMALE
APPEARANCE_TYPE_RAKSHASA_TIGER_MALE
APPEARANCE_TYPE_RAKSHASA_WOLF_MALE
APPEARANCE_TYPE_RAT
APPEARANCE_TYPE_RAT_DIRE
APPEARANCE_TYPE_RAVEN
APPEARANCE_TYPE_SHADOW
APPEARANCE_TYPE_SHADOW_FIEND
APPEARANCE_TYPE_SHIELD_GUARDIAN
APPEARANCE_TYPE_SHOP_KEEPER
APPEARANCE_TYPE_SKELETAL_DEVOURER
APPEARANCE_TYPE_SKELETON_CHIEFTAIN
APPEARANCE_TYPE_SKELETON_COMMON
APPEARANCE_TYPE_SKELETON_MAGE
APPEARANCE_TYPE_SKELETON_PRIEST
APPEARANCE_TYPE_SKELETON_WARRIOR
APPEARANCE_TYPE_SKELETON_WARRIOR_1
APPEARANCE_TYPE_SKELETON_WARRIOR_2
APPEARANCE_TYPE_SLAAD_BLUE
APPEARANCE_TYPE_SLAAD_DEATH
APPEARANCE_TYPE_SLAAD_GRAY
APPEARANCE_TYPE_SLAAD_GREEN
APPEARANCE_TYPE_SLAAD_RED
APPEARANCE_TYPE_SPECTRE
APPEARANCE_TYPE_SPHINX
APPEARANCE_TYPE_SPIDER_DIRE
APPEARANCE_TYPE_SPIDER_GIANT
APPEARANCE_TYPE_SPIDER_PHASE
APPEARANCE_TYPE_SPIDER_SWORD
APPEARANCE_TYPE_SPIDER_WRAITH
APPEARANCE_TYPE_STINGER
APPEARANCE_TYPE_STINGER_CHIEFTAIN
APPEARANCE_TYPE_STINGER_MAGE
APPEARANCE_TYPE_STINGER_WARRIOR
APPEARANCE_TYPE_SUCCUBUS
APPEARANCE_TYPE_TROLL
APPEARANCE_TYPE_TROLL_CHIEFTAIN
APPEARANCE_TYPE_TROLL_SHAMAN
APPEARANCE_TYPE_UMBERHULK
APPEARANCE_TYPE_UTHGARD_ELK_TRIBE
APPEARANCE_TYPE_UTHGARD_TIGER_TRIBE
APPEARANCE_TYPE_VAMPIRE_FEMALE
APPEARANCE_TYPE_VAMPIRE_MALE
APPEARANCE_TYPE_VROCK
APPEARANCE_TYPE_WAITRESS
APPEARANCE_TYPE_WAR_DEVOURER
APPEARANCE_TYPE_WERECAT
APPEARANCE_TYPE_WERERAT
APPEARANCE_TYPE_WEREWOLF
APPEARANCE_TYPE_WIGHT
APPEARANCE_TYPE_WILL_O_WISP
APPEARANCE_TYPE_WRAITH
APPEARANCE_TYPE_WYRMLING_BLACK
APPEARANCE_TYPE_WYRMLING_BLUE
APPEARANCE_TYPE_WYRMLING_BRASS
APPEARANCE_TYPE_WYRMLING_BRONZE
APPEARANCE_TYPE_WYRMLING_COPPER
APPEARANCE_TYPE_WYRMLING_GOLD
APPEARANCE_TYPE_WYRMLING_GREEN
APPEARANCE_TYPE_WYRMLING_RED
APPEARANCE_TYPE_WYRMLING_SILVER
APPEARANCE_TYPE_WYRMLING_WHITE
APPEARANCE_TYPE_YUAN_TI
APPEARANCE_TYPE_YUAN_TI_CHIEFTEN
APPEARANCE_TYPE_YUAN_TI_WIZARD
APPEARANCE_TYPE_ZOMBIE
APPEARANCE_TYPE_ZOMBIE_ROTTING
APPEARANCE_TYPE_ZOMBIE_TYRANT_FOG
APPEARANCE_TYPE_ZOMBIE_WARRIOR_1
APPEARANCE_TYPE_ZOMBIE_WARRIOR_2

See Also

functions: GetAppearanceType


Constant - AREA_TRANSITION

Home > Reference > Constants > AREA_TRANSITION_*

AREA_TRANSITION_* Constant Group

エリアをロード中に表示される画面の種類。

Constants

Constant Description
AREA_TRANSITION_CASTLE_01
城屋内
AREA_TRANSITION_CASTLE_02
城屋内
AREA_TRANSITION_CASTLE_03
城屋内
AREA_TRANSITION_CASTLE_04
城屋内
AREA_TRANSITION_CASTLE_05
城屋内
AREA_TRANSITION_CASTLE_06
城屋内
AREA_TRANSITION_CASTLE_07
城屋内
AREA_TRANSITION_CASTLE_08
城屋内
AREA_TRANSITION_CITY
市街地屋外：以前のAREA_TRANSITION_CITY_01と同じ。
AREA_TRANSITION_CITY_01
市街地屋外：以前のAREA_TRANSITION_CITYと同じ。
AREA_TRANSITION_CITY_02
市街地屋外
AREA_TRANSITION_CITY_03
市街地屋外
AREA_TRANSITION_CITY_04
市街地屋外
AREA_TRANSITION_CITY_05
市街地屋外
AREA_TRANSITION_CRYPT
地下墓地：以前のAREA_TRANSITION_CRYPT_01と同じ。
AREA_TRANSITION_CRYPT_01
地下墓地：以前のAREA_TRANSITION_CRYPTと同じ。
AREA_TRANSITION_CRYPT_02
地下墓地
AREA_TRANSITION_CRYPT_03
地下墓地
AREA_TRANSITION_CRYPT_04
地下墓地
AREA_TRANSITION_CRYPT_05
地下墓地
AREA_TRANSITION_DUNGEON_01
ダンジョン
AREA_TRANSITION_DUNGEON_02
ダンジョン
AREA_TRANSITION_DUNGEON_03
ダンジョン
AREA_TRANSITION_DUNGEON_04
ダンジョン
AREA_TRANSITION_DUNGEON_05
ダンジョン
AREA_TRANSITION_DUNGEON_06
ダンジョン
AREA_TRANSITION_DUNGEON_07
ダンジョン
AREA_TRANSITION_DUNGEON_08
ダンジョン
AREA_TRANSITION_FOREST
森林地帯：以前のAREA_TRANSITION_FOREST_01と同じ。
AREA_TRANSITION_FOREST_01
森林地帯：以前のAREA_TRANSITION_FORESTと同じ。
AREA_TRANSITION_FOREST_02
森林地帯
AREA_TRANSITION_FOREST_03
森林地帯
AREA_TRANSITION_FOREST_04
森林地帯
AREA_TRANSITION_FOREST_05
森林地帯
AREA_TRANSITION_INTERIOR_01
市街地屋内
AREA_TRANSITION_INTERIOR_02
市街地屋内
AREA_TRANSITION_INTERIOR_03
市街地屋内
AREA_TRANSITION_INTERIOR_04
市街地屋内
AREA_TRANSITION_INTERIOR_05
市街地屋内
AREA_TRANSITION_INTERIOR_06
市街地屋内
AREA_TRANSITION_INTERIOR_07
市街地屋内
AREA_TRANSITION_INTERIOR_08
市街地屋内
AREA_TRANSITION_INTERIOR_09
市街地屋内
AREA_TRANSITION_INTERIOR_10
市街地屋内
AREA_TRANSITION_INTERIOR_11
市街地屋内
AREA_TRANSITION_INTERIOR_12
市街地屋内
AREA_TRANSITION_INTERIOR_13
市街地屋内
AREA_TRANSITION_INTERIOR_14
市街地屋内
AREA_TRANSITION_INTERIOR_15
市街地屋内
AREA_TRANSITION_INTERIOR_16
市街地屋内
AREA_TRANSITION_MINES_01
鉱山／洞窟
AREA_TRANSITION_MINES_02
鉱山／洞窟
AREA_TRANSITION_MINES_03
鉱山／洞窟
AREA_TRANSITION_MINES_04
鉱山／洞窟
AREA_TRANSITION_MINES_05
鉱山／洞窟
AREA_TRANSITION_MINES_06
鉱山／洞窟
AREA_TRANSITION_MINES_07
鉱山／洞窟
AREA_TRANSITION_MINES_08
鉱山／洞窟
AREA_TRANSITION_MINES_09
鉱山／洞窟
AREA_TRANSITION_RANDOM
ランダム。直前のエリアもロードしているエリアも、どちらにもよらない。
AREA_TRANSITION_RURAL
田園地域：以前のAREA_TRANSITION_RURAL_01と同じ。
AREA_TRANSITION_RURAL_01
田園地域：AREA_TRANSITION_RURALと同じ。
AREA_TRANSITION_RURAL_02
田園地域
AREA_TRANSITION_RURAL_03
田園地域
AREA_TRANSITION_RURAL_04
田園地域
AREA_TRANSITION_RURAL_05
田園地域
AREA_TRANSITION_SEWER_01
下水道
AREA_TRANSITION_SEWER_02
下水道
AREA_TRANSITION_SEWER_03
下水道
AREA_TRANSITION_SEWER_04
下水道
AREA_TRANSITION_SEWER_05
下水道
AREA_TRANSITION_USER_DEFINED
下水道

See Also

functions: SetAreaTransitionBMP


Constant - ASSOCIATE_COMMAND

Home > Reference > Constants > ASSOCIATE_COMMAND_*

ASSOCIATE_COMMAND_* Constant Group

仲間のNPCに対する命令

Constants

Constant Description
ASSOCIATE_COMMAND_ATTACKNEAREST
最も近い敵を攻撃するように、NPCに指示する。
ASSOCIATE_COMMAND_DISARMTRAP
罠を解除するように、NPCに指示する。
ASSOCIATE_COMMAND_FOLLOWMASTER
主人の後をついてくるように、NPCに指示する。
ASSOCIATE_COMMAND_GUARDMASTER
主人を守るように、NPCに指示する。
ASSOCIATE_COMMAND_HEALMASTER
主人を回復させるように、NPCに指示する。
ASSOCIATE_COMMAND_INVENTORY
インベントリーを開くように、NPCに指示する。（SoU）
ASSOCIATE_COMMAND_LEAVEPARTY
ヘンチマンを解雇する。
ASSOCIATE_COMMAND_MASTERATTACKEDOTHER
主人が他のクリーチャーを攻撃したというしるしに使う。
ASSOCIATE_COMMAND_MASTERFAILEDLOCKPICK
主人が鍵を開けるのに失敗したというしるしに使う。破壊、鍵開け、もしくは単に開けようとした場合に使う。
ASSOCIATE_COMMAND_MASTERGOINGTOBEATTACKED
主人が攻撃されそうになったというしるしに使う。
ASSOCIATE_COMMAND_MASTERSAWTRAP
主人が罠を発見したというしるしに使う。
ASSOCIATE_COMMAND_MASTERUNDERATTACK
主人が攻撃されているというしるしに使う。
ASSOCIATE_COMMAND_PICKLOCK
開錠するように、NPCに指示する。
ASSOCIATE_COMMAND_RELEASEDOMINATION
支配中（チャームや魔法など）のクリーチャーを開放する。
ASSOCIATE_COMMAND_STANDGROUND
その場から動かないように、NPCに指示する。NPCはOnHeartbeatスクリプト中には動かない。
ASSOCIATE_COMMAND_UNPOSSESSFAMILIAR
PCによって憑依されているファミリアーの憑依を解除する。
ASSOCIATE_COMMAND_UNSUMMONANIMALCOMPANION
アニマルコンパニオンの召喚を解除する。
ASSOCIATE_COMMAND_UNSUMMONFAMILIAR
ファミリアーの召喚を解除する。
ASSOCIATE_COMMAND_UNSUMMONSUMMONED
召喚したクリーチャーの召喚を解除する。

See Also

functions: GetLastAssociateCommand | SetAssociateListenPatterns


Constant - ASSOCIATE_TYPE

Home > Reference > Constants > ASSOCIATE_TYPE_*

ASSOCIATE_TYPE_* Constant Group

プレイヤーキャラクターが仲間に出来るNPCの種類。

Constants

Constant Description
ASSOCIATE_TYPE_ANIMALCOMPANION
動物の相棒。

動物の相棒とウィザードやソーサラーの使い魔は異なることに注意してください。

ASSOCIATE_TYPE_DOMINATED
魅了(charm)状態か魔法効果を掛けられているNPC。
ASSOCIATE_TYPE_FAMILIAR
ウィザードやソーサラーの使い魔。

使い魔と動物の相棒は異なることに注意してください。

ASSOCIATE_TYPE_HENCHMAN
NPCの傭兵
ASSOCIATE_TYPE_SUMMONED
呪文やアイテムによって召喚されたNPC。(通常はクリーチャー)

See Also

functions: GetAssociate

JP team: marshall


Constant - ATTACK_BONUS

Home > Reference > Constants > ATTACK_BONUS_*

ATTACK_BONUS_* Constant Group

EffectAttackIncrease()とEffectAttackDecrease()によって修正される種類

Constants

Constant Description
ATTACK_BONUS_MISC
EffectAttackIncrease() とEffectAttackDecrease()) ??
ATTACK_BONUS_OFFHAND
EffectAttackIncrease() と EffectAttackDecrease() で使われた場合、逆手（左手）による攻撃にのみ適用。
ATTACK_BONUS_ONHAND
EffectAttackIncrease() と EffectAttackDecrease() で使われた場合、利き手（右手）による攻撃にのみ適用。

See Also

functions: EffectAttackDecrease | EffectAttackIncrease


Constant - ATTITUDE

Home > Reference > Constants > ATTITUDE_*

ATTITUDE_* Constant Group

クリーチャー間の態度

Constants

Constant Description
ATTITUDE_AGGRESSIVE
嫌いな相手、または自分のファクションの敵に対して攻撃します。
ATTITUDE_DEFENSIVE
自分のファクションに属する仲間を守ります。
ATTITUDE_NEUTRAL
中立。受身の態度です。
ATTITUDE_SPECIAL
特別な設定です。

See Also

Send comments on this topic.


Constant - BASE_ITEM

Home > Reference > Constants > BASE_ITEM_*

BASE_ITEM_* Constant Group

Base items that other items can be built on top of.

Constants

Constant Description
BASE_ITEM_AMULET
Amulet
BASE_ITEM_ARMOR
Armor (there isn't any differentiation in the BASE_ITEM_* constants between types of armor)
BASE_ITEM_ARROW
Arrows
BASE_ITEM_BASTARDSWORD
Bastard Sword
BASE_ITEM_BATTLEAXE
Battleaxe
BASE_ITEM_BELT
Belt
BASE_ITEM_BOLT
Bolts
BASE_ITEM_BOOK
Book
BASE_ITEM_BOOTS
Boots
BASE_ITEM_BRACER
Bracer
BASE_ITEM_BULLET
Bullets
BASE_ITEM_CBLUDGWEAPON
Creature Bludgeoning weapon
BASE_ITEM_CLOAK
Cloak
BASE_ITEM_CLUB
Club
BASE_ITEM_CPIERCWEAPON
Creature Piercing Weapon
BASE_ITEM_CSLASHWEAPON
Creature Slashing Weapon
BASE_ITEM_CSLSHPRCWEAP
Creature Slashing and Piercing Weapon
BASE_ITEM_DAGGER
Dagger
BASE_ITEM_DART
Dart
BASE_ITEM_DIREMACE
Dire Mace
BASE_ITEM_DOUBLEAXE
Double Axe
BASE_ITEM_GEM
Gem
BASE_ITEM_GLOVES
Gloves
BASE_ITEM_GOLD
Gold
BASE_ITEM_GREATAXE
Greataxe
BASE_ITEM_GREATSWORD
Greatsword
BASE_ITEM_HALBERD
Halberd
BASE_ITEM_HANDAXE
Handaxe
BASE_ITEM_HEALERSKIT
Healer's Kit
BASE_ITEM_HEAVYCROSSBOW
Heavy Crossbow
BASE_ITEM_HEAVYFLAIL
Heavy Flail
BASE_ITEM_HELMET
Helmet
BASE_ITEM_INVALID
An Invalid Object.
BASE_ITEM_KAMA
Kama
BASE_ITEM_KATANA
Katana
BASE_ITEM_KEY
Key
BASE_ITEM_KUKRI
Kukri
BASE_ITEM_LARGEBOX
Large Box (a container)
BASE_ITEM_LARGESHIELD
Large Shield
BASE_ITEM_LIGHTCROSSBOW
Light Crossbow
BASE_ITEM_LIGHTFLAIL
Light Flail
BASE_ITEM_LIGHTHAMMER
Light Hammer
BASE_ITEM_LIGHTMACE
Light Mace
BASE_ITEM_LONGBOW
Longbow
BASE_ITEM_LONGSWORD
Longsword
BASE_ITEM_MAGICROD
Magic Rod
BASE_ITEM_MAGICSTAFF
Magic Staff
BASE_ITEM_MAGICWAND
Magic Wand
BASE_ITEM_MISCLARGE
A miscellaneous large (3x2 in inventory) item.
BASE_ITEM_MISCMEDIUM
A miscellaneous medium-sized (2x2 in inventory) item.
BASE_ITEM_MISCSMALL
A miscellaneous small (1x1 in inventory) item.
BASE_ITEM_MISCTALL
A miscellaneous tall item. Not sure on the size of these, as they don't seem to be createable in the toolset.
BASE_ITEM_MISCTHIN
A miscellaneous thin (2x1 in inventory) item.
BASE_ITEM_MISCWIDE
A miscellaneous wide item. Not sure on the size of these, as they don't seem to be createable in the toolset.
BASE_ITEM_MORNINGSTAR
Morningstar
BASE_ITEM_POTIONS
Potion
BASE_ITEM_QUARTERSTAFF
Quarterstaff
BASE_ITEM_RAPIER
Rapier
BASE_ITEM_RING
Ring
BASE_ITEM_SCIMITAR
Scimitar
BASE_ITEM_SCROLL
Unsure; use BASE_ITEM_SPELLSCROLL for magical spell scrolls. Speculation: probably used for plot items.
BASE_ITEM_SCYTHE
Scythe
BASE_ITEM_SHORTBOW
Shortbow
BASE_ITEM_SHORTSPEAR
Short Spear
BASE_ITEM_SHORTSWORD
Short Sword
BASE_ITEM_SHURIKEN
Shuriken
BASE_ITEM_SICKLE
Sickle
BASE_ITEM_SLING
Sling
BASE_ITEM_SMALLSHIELD
Small Shield
BASE_ITEM_SPELLSCROLL
Magical spell scroll. BASE_ITEM_SCROLL is not a magical spell scroll.
BASE_ITEM_THIEVESTOOLS
Thieves' Tools
BASE_ITEM_THROWINGAXE
Throwing Axe
BASE_ITEM_TORCH
Torch
BASE_ITEM_TOWERSHIELD
Tower Shield
BASE_ITEM_TRAPKIT
Trap Kit
BASE_ITEM_TWOBLADEDSWORD
Two-bladed Sword
BASE_ITEM_WARHAMMER
Warhammer

See Also

functions: GetBaseItemType | HasAnyItemOfBaseType | IsMisc


Constant - BODY_NODE

Home > Reference > Constants > BODY_NODE_*

BODY_NODE_* Constant Group

体の位置；手と胸。

EffectBeamエフェクトで使用されます。

Constants

Constant Description
BODY_NODE_CHEST
胸
BODY_NODE_HAND
手
BODY_NODE_MONSTER_0
不明
BODY_NODE_MONSTER_1
不明
BODY_NODE_MONSTER_2
不明
BODY_NODE_MONSTER_3
不明
BODY_NODE_MONSTER_4
不明
BODY_NODE_MONSTER_5
不明
BODY_NODE_MONSTER_6
不明
BODY_NODE_MONSTER_7
不明
BODY_NODE_MONSTER_8
不明
BODY_NODE_MONSTER_9
不明

See Also

functions: EffectBeam


Constant - CAMERA_MODE

Home > Reference > Constants > CAMERA_MODE_*

CAMERA_MODE_* Constant Group

カメラ視点

Constants

Constant Description
CAMERA_MODE_CHASE_CAMERA
プレーヤーの後ろから見る視点。PCの周りを見るためにカメラを回転させられる。
CAMERA_MODE_STIFF_CHASE_CAMERA
プレーヤーの後ろから見る視点。カメラの回転は固定されている。
CAMERA_MODE_TOP_DOWN
プレーヤーを上から見下ろす視点。

See Also

functions: SetCameraMode


Constant - CAMERA_TRANSITION_TYPE

Home > Reference > Constants > CAMERA_TRANSITION_TYPE_*

CAMERA_TRANSITION_TYPE_* Constant Group

SetCameraFacing() でどの程度スムーズにカメラを移動させるかの設定

Constants

Constant Description
CAMERA_TRANSITION_TYPE_CRAWL
カメラの移動はもっとも遅い
CAMERA_TRANSITION_TYPE_FAST
カメラの移動は早い
CAMERA_TRANSITION_TYPE_MEDIUM
カメラの移動は普通
CAMERA_TRANSITION_TYPE_SLOW
カメラの移動は遅い
CAMERA_TRANSITION_TYPE_SNAP
カメラの移動はもっとも早い。瞬間的に移動する。
CAMERA_TRANSITION_TYPE_VERY_FAST
カメラの移動は二番目に早い
CAMERA_TRANSITION_TYPE_VERY_SLOW
カメラの移動は二番目に遅い

See Also

functions: SetCameraFacing


Constant - CLASS_TYPE

Home > Reference > Constants > CLASS_TYPE_*

CLASS_TYPE_* Constant Group

クラス

Constants

Constant Description
CLASS_TYPE_ABBERATION
不明
CLASS_TYPE_ANIMAL
不明
CLASS_TYPE_ARCANE_ARCHER
One of the prestige classes added with SoU. Master of the elven war bands, the arcane archer is a warrior skilled in using magic to supplement his combat prowess. Fighters, rangers, paladins, and barbarians become arcane archers to add a little magic to their combat abilities. Conversely, wizards and sorcerers may adopt this prestige class to add combat abilities to their repetoires. SoU Manual - page 13.
CLASS_TYPE_ASSASSIN
One of the prestige classes added with SoU. The assassin is a master of dealing quick, lethal blows. Assassins often function as spies, informants, killers for hire, or agents of vengeance. The assassin's skills in a variety of dark arts allows him to carry out missions of death with shocking, terrifying precision. Rogues, monks, and bards are ideal candidates for training as assassins. Unlike the blackguard, the assassin is not evil due to devotion to an evil power, but rather due to a complete lack of morals or ethics. These ruthless and avaricious killers have but one requirement other than a predisposition for evil and a penchant for stealth. They must kill another intelligent being for no other reason than pay. SoU Manual - page 14.
CLASS_TYPE_BARBARIAN
バーバリアンは時に無謀とも思える勇猛果敢な屈強の戦士であり、その腕は冒険において大いに役立つことだろう。バーバリアンは鍛錬と規律による洗練された武術よりも、怒りを爆発させて身体能力を高めた状態での本能的な戦闘を得意とする。激昂状態に入るのは一日に数回が限界ではあるものの、目前の敵を倒すにはそれだけで事足りてしまうことが多い。常に危険と隣り合わせに生きているバーバリアンは常軌を逸した鋭い勘で危険を察して攻撃をかわし、伝説的とすらいえる走力を誇る。
CLASS_TYPE_BARD
バードはしばしば交渉人、伝令、斥候、密偵などとして活躍することが多いクラスである。彼らは英雄（悪党）に同道してその偉業（悪行）を目の当たりにし、後に武勇伝（蛮行伝）として語り聞かせ、同業の者達の尊敬の眼差しを浴びることを何よりもの喜びとしている。バードはウィザード、ソーサラーと同様に秘術（Arcane）呪文を使用できるが、ウィザードのようにあらかじめ呪文を記憶しておく必要はない。彼らはローグの特殊技能も一部習得することができ、アイテムに関する伝承知識においては他クラスの群を抜いており、また魔法的な効果をもつ歌により味方の能力を高めることもできる。
CLASS_TYPE_BEAST
Unknown.
CLASS_TYPE_BLACKGUARD
One of the prestige classes added with SoU. A blackguard epitomizes evil. He is nothing short of a mortal fiend, a black knight with the foulest sort of reputation. A blackguard is an evil villain of the first order, equivalent in power to the righteous paladin, but devoted to the powers of darkness. No one class makes the best blackguard - all that is required is a willingness to serve the forces of darkness. SoU Manual - page 15.
CLASS_TYPE_CLASS_TYPE_SHADOWDANCER
Rogues, bards and monks make excellent shadowdancers, but fighters, barbarians, rangers and paladins also find that shadowdancer abilities allow them to strike at their opponents with surprise and skill. Wizard, sorcerer, cleric and druid shadowdancers employ the defensive capabilities inherent in the prestige class to allow them to cast their spells from safety and move away quickly. Despite their link with shadows and trickery, shadowdancers are as often good as evil. They may use their incredible abilities as they wish. Shadowdancers often work in troupes, never staying in one place too long. Some use their abilities to entertain. Others operate as thieves, using their abilities to infiltrate past defenses and dupe others. All shadowdancer troupes maintain an aura of mystery among the populace, who never know whether to think well or ill of them. SoU Manual - page 18.
CLASS_TYPE_CLERIC
クレリックとは地上と天界（もしくは魔界）との仲介を担う者達である。善良なるクレリックは人々に恩恵を与えてこれを助け、邪悪なるクレリックは守護神の野望を達成せしめんと暗躍する。クレリックは守護神の力を借りることで傷を癒し、力のある者は死んだ者を蘇らせることすらできるという。彼らはアンデッド（死人）に対しても力を及ぼすことができ、これらを退散させたり破壊したりすることができる。クレリックはまた、守護神の司る領域（Domain）のうちの2つを選択し、領域ごとに固有の特殊能力を得たり、通常のクレリック呪文に加えて特殊な呪文を習得することもできる。
CLASS_TYPE_COMMONER
不明
CLASS_TYPE_CONSTRUCT
不明
CLASS_TYPE_DRAGON
不明
CLASS_TYPE_DRUID
ドルイドは自然を支配しようとする代わりに、自然との調和によってその力を得る者達である。彼らは異形のものやアンデッドなど、自然の摂理を逸脱した存在を憎悪しており、可能な限りこれらを払拭しようと試みる者が多い。ドルイドは自然の力により呪文を唱えることができ、また経験を積むことにより動物に姿を変える能力をも身につけることも可能である。彼らは戦いに際して心強い味方となる動物の相棒（Animal companion）を連れていることが多い。ドルイドは伝統的な戒律により、一部の武器・防具の扱いに習熟していないことが多い。
CLASS_TYPE_ELEMENTAL
不明
CLASS_TYPE_FEY
これから定義される予定
CLASS_TYPE_FIGHTER
ファイターとは兵士や警務官から傭兵まで、戦技が必要とされる様々な職業の総称的なクラスで、者によっては富と栄光を求めて冒険をし、別の者は弱き者達を守るために剣を振るう。ファイターは全クラス中で最も戦闘技術が幅広く、あらゆる基本的な武器・防具の扱いに慣れている。絶え間ない武術訓練によりファイターは他クラスよりも戦闘関連の特技を多く習得することができ、高レベルのファイターは多種多様な特殊攻撃を繰り出すことが可能になる。
CLASS_TYPE_GIANT
不明
CLASS_TYPE_HARPER
Harpers are members of a secret society dedicated to holding back evil, preserving knowledge, and maintaining the balance between civilization and the wild. Harpers learn arcane spells and many skills to help them in their duties of espionage, stealth and reporting information. Many Harpers are bards, but by no means all. Ranger, rogue, sorcerer and wizard are common vocations for Harpers, as these classes tend to have versatility and mobility. All have some skill at manipulating others, a resistance to outside mental influences, acute abilities of perception, and a talent for solving problems. Not all Harpers are members of the Harper scout prestige class, and rank within the organization does not depend upon a character’s level in this or any other class. However, most of the higher-ranked Harpers have at least one level in the Harper scout prestige class. SoU Manual - page 16.
CLASS_TYPE_HUMANOID
不明
CLASS_TYPE_INVALID
無効なクラス
CLASS_TYPE_MAGICAL_BEAST
不明
CLASS_TYPE_MONK
モンクとは武器や鎧を用いない特殊格闘の技術に秀でたクラスである。善良なモンクは弱き者の味方となり、邪悪なモンクは密偵、刺客として最適である。モンクは呪文を使用することはできないが、「気」の力を自在に操ることにより自らの傷を瞬時に癒したり、飛来する矢を素手で受け止めたり、常軌を逸した素早さで攻撃をかわすことができる。これらの能力はモンクが経験を積むとともにより強化され、自らの肉体および周囲の状況に及ぼしうる影響力も増してくる。鎧を身につけることはモンクの戒律を破ることになり、能力が大幅に制限されてしまう。
CLASS_TYPE_MONSTROUS
Unknown.
CLASS_TYPE_OUTSIDER
Unknown.
CLASS_TYPE_PALADIN
パラディンは大志を抱いて冒険に望む人々であり、地味な任務であってもパラディン本人にとっては自らの勇気を示し、戦術を学び、善行を成し遂げる一大試練なのである。人徳あるこれらの勇士達は守護神の力によって疾病・恐怖・邪悪なるものからの加護、癒しの力などを得ており、またこの力を傷や病気の治療、および邪悪なる者の成敗に使うことで他者の手助けをすることができる。ある程度の経験を積んだパラディンは邪悪なる敵に強力な一撃を加えたり、アンデッドを退散させたりすることができる。パラディンはクレリックと同様の呪文を一部使用することができ、またその魅力(CHA)の大小により種々の特殊能力の効果に影響が出る。
CLASS_TYPE_RANGER
レンジャーは野外での生活や追跡、狩りを得意とする者達のことである。ファイターに追随する戦闘能力を有するが、彼らほどには武術の訓練を積んでいない。レンジャーは数種類の特定の敵との戦闘に特化した戦術を身につけており、これらの敵を憎み、滅ぼそうと努力する（得意な敵［Favored Enemy］）。レンジャーはしばしば森の守護者となり、そこに住む者や旅人などの手助けをしたりする。彼らは隠密行動に長け、野外であれば姿を隠して音も無く移動できるという。経験を積んだレンジャーは自然との調和により、ドルイド同様にいくつかの呪文を使用することができ、また動物の相棒（Animal Companion）を連れて歩けるようになる。
CLASS_TYPE_ROGUE
ローグとひとことで言っても、その実態は十人十色である。隠密行動を得意とする盗人が多いと言われているが、これ以外にも斥候・密偵・調査官・外交特使・ごろつきなどもこの総称にあてはまる。ローグは応用力と適応力に優れ、他者が重宝しているものを奪う術に長けている。戦士ほど戦闘に向いてこそいないものの、ローグは相手の弱点を突くことで手痛い傷を負わせることができ、また危険を察知して身をかわす能力も発達している。経験を積み、隠密行動や身かわし、不意打ちの技を極めたローグはほとんど魔法と言ってもいいような次元の力を身につける。加えて、自らが呪文を唱えることはできないものの、ローグは見よう見真似でスクロールやワンドを始めとする種々の魔術品の力を発動させることができる。
CLASS_TYPE_SORCERER
ソーサラーとは魔術の修行をせずとも魔力を操れる才能を生まれつきもっており、想像力とひらめきでこれを使いこなす能力をもったものたちのことである。彼らは魔術の書物にも、師匠にも、理論にさえも頼ることなく、精神力のみによって魔力そのものを形作ることができる。ソーサラーはウィザードに比べ習得できる呪文の総数が少なく、習得そのものも遅くなりがちであるが、使用する呪文をあらかじめ記憶しておく必要が無く、また使用する呪文を臨機応変に選択できるという利点がある。ウィザードの条件ともいえる長年の訓練と研究を経ていないため、ソーサラーは特定の系統（School）の呪文に特化することはできない反面、武術を身につける時間があったために基本的な武器を使いこなすことができる。なお、ソーサラーは使い魔（Familiar）を召喚し、従わせることもできる。
CLASS_TYPE_UNDEAD
不明
CLASS_TYPE_VERMIN
不明
CLASS_TYPE_WIZARD
ウィザードは熱心な修行と研究により魔力を操るものたちであり、彼らにしてみれば魔法は才能というよりも難解ながら得られるものも多い芸術のようなものなのである。あらかじめ準備を整えてさえおけば戦いの場において圧倒的な力を発揮できる反面、ウィザードは不意を突かれると脆い一面をもつ。ウィザードの長所は呪文の数々であり、その他の能力はこれに比べると霞んでしまう。彼らは経験を積むにつれ実験や試行錯誤の中で新たな呪文を編み出せるほか、他のウィザードが書き残したスクロールからも新たな呪文を習得することができ、また、呪文の射程の延長や効果の増強といった微調整にも他の呪文使いよりも長けている。ウィザードは使い魔（Familiar）を召喚し、従わせることもできる。

See Also

functions: GetClassByPosition | GetFactionMostFrequentClass | GetLevelByClass | GetNearestCreature | GetNearestCreatureToLocation | LevelUpHenchman


Constant - COMBAT_MODE

Home > Reference > Constants > COMBAT_MODE_*

COMBAT_MODE_* Constant Group

戦闘モード

Constants

Constant Description
COMBAT_MODE_FLURRY_OF_BLOWS
連打（モンク）：
素手もしくはカマ系武器での攻撃時に、攻撃回数が１増加する。なお、「連打」発動中に繰り出す攻撃はすべて命中判定に対し－ 2 のペナルティーを課せられる。
COMBAT_MODE_IMPROVED_POWER_ATTACK
強打強化：
命中判定に－ 10 のペナルティー、ダメージに＋ 10 のボーナスにて近接攻撃を行なうことができる。
COMBAT_MODE_INVALID
無効な戦闘モード
COMBAT_MODE_PARRY
受け流し：
目標にしている対象からの攻撃を防御することに専念し、敵の命中判定値を難易度（DC）とした技能判定成功により、攻撃を完全に受け流すことができる。1 ラウンド毎の攻撃回数と同数の攻撃に用いることができる。技能判定値が難易度（DC）を10 以上上回った場合、自動的に敵の隙を突いて反撃を加えることになる。なお、受け流しモード時には防御を重視するため、機会攻撃を繰り出すことができなくなる。
COMBAT_MODE_POWER_ATTACK
強打：
命中判定に－ 5 のペナルティー、ダメージに＋ 5 のボーナスにて近接攻撃を行なうことができる。
COMBAT_MODE_RAPID_SHOT
速射：
飛び道具によるラウンド毎の攻撃回数を1 増加させる。増加分の攻撃は基本攻撃ボーナスの最大値にて行なわれるが、同ラウンド内の攻撃にはすべて－ 2 の命中判定ペナルティーが課せられる。

See Also

functions: GetLastAttackMode


Constant - CREATURE_SIZE

Home > Reference > Constants > CREATURE_SIZE_*

CREATURE_SIZE_* Constant Group

クリーチャーの身体サイズ。極巨大なサイズ（gargantuanとolossalｔ?は含まれない。

Constants

Constant Description
CREATURE_SIZE_HUGE
巨大型
CREATURE_SIZE_INVALID
無効なサイズ
CREATURE_SIZE_LARGE
大型
CREATURE_SIZE_MEDIUM
中型
CREATURE_SIZE_SMALL
小型
CREATURE_SIZE_TINY
極小型

See Also

functions: GetCreatureSize


Constant - CREATURE_TYPE

Home > Reference > Constants > CREATURE_TYPE_*

CREATURE_TYPE_* Constant Group

NWN-specific subtype denoting special attributes for a given creature.

Constants

Constant Description
CREATURE_TYPE_CLASS
Unknown.
CREATURE_TYPE_DOES_NOT_HAVE_SPELL_EFFECT
Unknown. Speculation: determines if the creature does not have a specific spell effect.
CREATURE_TYPE_HAS_SPELL_EFFECT
Unknown. Speculation: determines if the creature has a specific spell effect.
CREATURE_TYPE_IS_ALIVE
Unknown. Speculation: determines if the creature is still alive.
CREATURE_TYPE_PERCEPTION
Unknown.
CREATURE_TYPE_PLAYER_CHAR
Unknown. Speculation: denote a player character (PC).
CREATURE_TYPE_RACIAL_TYPE
Unknown.
CREATURE_TYPE_REPUTATION
Unknown.

See Also

functions: GetNearestCreature | GetNearestCreatureToLocation


Constant - DAMAGE_BONUS

Home > Reference > Constants > DAMAGE_BONUS_*

DAMAGE_BONUS_* Constant Group

Determines magical adjustments to damage. Not treated the same as DAMAGE_POWER_*, which determines if an attack can penetrate damage reduction.

Constants

Constant Description
DAMAGE_BONUS_1
Magical +1 bonus. Deals 1 extra point of damage on a successful hit.
DAMAGE_BONUS_1D10
An extra 1d10 (1-10) points of damage due to an additional property (fire, cold, sonic, acid, etc).
DAMAGE_BONUS_1D4
An extra 1d4 (1-4) points of damage due to an additional property (fire, cold, sonic, acid, etc).
DAMAGE_BONUS_1D6
An extra 1d6 (1-6) points of damage due to an additional property (fire, cold, sonic, acid, etc).
DAMAGE_BONUS_1D8
An extra 1d8 (1-8) points of damage due to an additional property (fire, cold, sonic, acid, etc).
DAMAGE_BONUS_2
Magical +2 bonus. Deals 2 extra points of damage on a successful hit.
DAMAGE_BONUS_2D6
An extra 2d6 (2-12) points of damage due to an additional property (fire, cold, sonic, acid, etc).
DAMAGE_BONUS_3
Magical +3 bonus. Deals 3 extra points of damage on a successful hit.
DAMAGE_BONUS_4
Magical +4 bonus. Deals 4 extra points of damage on a successful hit.
DAMAGE_BONUS_5
Magical +5 bonus. Deals 5 extra points of damage on a successful hit.

See Also

functions: EffectDamageIncrease | EffectDamageShield


Constant - DAMAGE_POWER

Home > Reference > Constants > DAMAGE_POWER_*

DAMAGE_POWER_* Constant Group

Determines the magical strength of a melee or missile attack (for harming creatures with damage reduction). Does not determine actual magical bonus (see DAMAGE_BONUS_*), just determines what damage reductions an attack bypasses.

Constants

Constant Description
DAMAGE_POWER_ENERGY
Harms creatures no matter what their damage resistance is, as if the spell was a force spell (like Magic Missile).
DAMAGE_POWER_NORMAL
Standard, non-magical damage source.
DAMAGE_POWER_PLUS_FIVE
Harms creatures with a normal damage reduction of */+5 or lower.
DAMAGE_POWER_PLUS_FOUR
Harms creatures with a normal damage reduction of */+4 or lower.
DAMAGE_POWER_PLUS_ONE
Harms creatures with a normal damage reduction of */+1 or */silver.
DAMAGE_POWER_PLUS_THREE
Harms creatures with a normal damage reduction of */+3 or lower.
DAMAGE_POWER_PLUS_TWO
Harms creatures with a normal damage reduction of */+2 or lower.

See Also

functions: EffectDamage | EffectDamageReduction


Constant - DAMAGE_TYPE

Home > Reference > Constants > DAMAGE_TYPE_*

DAMAGE_TYPE_* Constant Group

The type of damage that can be inflicted.

Constants

Constant Description
DAMAGE_TYPE_ACID
Damage inflicted by acid.
DAMAGE_TYPE_BLUDGEONING
Damage inflicted by bludgeoning (eg. club).
DAMAGE_TYPE_COLD
Damage inflicted by cold and cold based attacks.
DAMAGE_TYPE_DIVINE
Damage inflicted by divine based attacks.
DAMAGE_TYPE_ELECTRICAL
Damage inflicted by electrical based attacks.
DAMAGE_TYPE_FIRE
Damage inflicted by fire and fire based attacks.
DAMAGE_TYPE_MAGICAL
Damage inflicted by magical effects.
DAMAGE_TYPE_NEGATIVE
Damage inflicted by negative attacks.
DAMAGE_TYPE_PIERCING
Damage inflicted by piercing attacks. Value = 2.
DAMAGE_TYPE_POSITIVE
Damage inflicted by positive attacks.
DAMAGE_TYPE_SLASHING
Damage dealt from a slashing weapon, such as a sword or hand axe.
DAMAGE_TYPE_SONIC
Damage inflicted by sonic attacks.

See Also

functions: EffectACDecrease | EffectACIncrease | EffectDamage | EffectDamageDecrease | EffectDamageImmunityDecrease | EffectDamageImmunityIncrease | EffectDamageIncrease | EffectDamageResistance | EffectDamageShield | GetDamageDealtByType


Constant - DEFENSIVE_CASTING_MODE

Home > Reference > Constants > DEFENSIVE_CASTING_MODE_*

DEFENSIVE_CASTING_MODE_* Constant Group

Determines if a creature is casting a spell defensively so they suffer no attacks of opportunity.

Constants

Constant Description
DEFENSIVE_CASTING_MODE_DISABLED
Defensive casting mode is disabled; the creature will suffer attacks of opportunity when applicable.
DEFENSIVE_CASTING_MODE_ENABLED
Defensive casting mode is enabled; the creature won't suffer attacks of opportunity, but runs the risk of losing the spell completely if they cannot keep their concentraction.

See Also

functions: GetDefensiveCastingMode


Constant - DETECT_MODE

Home > Reference > Constants > DETECT_MODE_*

DETECT_MODE_* Constant Group

Determines how a perceptive a creature is being.

Constants

Constant Description
DETECT_MODE_ACTIVE
Actively looking or searching.
DETECT_MODE_PASSIVE
Not actively looking or searching.

See Also

functions: GetDetectMode


Constant - DIRECTION

Home > Reference > Constants > DIRECTION_*

DIRECTION_* Constant Group

コンパスの方角

Constants

Constant Description
DIRECTION_EAST
東
DIRECTION_NORTH
北
DIRECTION_SOUTH
南
DIRECTION_WEST
西

See Also

functions: SetFacing


Constant - DISEASE

Home > Reference > Constants > DISEASE_*

DISEASE_* Constant Group

Different types of Diseases used in creating disease effect objects.

Constants

Constant Description
DISEASE_BLINDING_SICKNESS
The Blinding Sickness Disease First save at a DC of 16. Subsequent saves at a DC of 16. Incubates for 1 hour then lowers STR by 1D4. Extradinary Effect. After 24 hours, 40% chance to cause blindness in target.
DISEASE_BURROW_MAGGOTS
The Burrow Maggots Disease. First save at a DC of 17. Subsequent saves at a DC of 17. Incubates for 1 hour then lowers INT by 1D4 and WIS by 1D4. Supernatural Effect.
DISEASE_CACKLE_FEVER
The Cackle Fever Disease. First save at a DC of 16. Subsequent saves at a DC of 16. Incubates for 1 hour then lowers WIS by 1D6. Extradinary Effect.
DISEASE_DEMON_FEVER
The Demon Fever Disease. First save at a DC of 18. Subsequent saves at a DC of 18. Incubates for 1 hour then lowers CON by 1D6. Supernatural Effect. Lowers Constitution again (permanently) by 1 if target fails a Fortitude save at a DC of 18.
DISEASE_DEVIL_CHILLS
The Devil Chills Disease. First save at a DC of 14. Subsequent saves at a DC of 14. Incubates for 1 hour then lowers STR by 1D4. Supernatural Effect.
DISEASE_DREAD_BLISTERS
The Dread Blisters Disease. First save at a DC of 13. Subsequent saves at a DC of 13. Incubates for 1 hour then lowers CHA by 1D4 and CON by 1D4. Supernatural Effect.
DISEASE_FILTH_FEVER
The Filth Fever Disease. First save at a DC of 12. Subsequent saves at a DC of 12. Incubates for 1 hour then lowers CON by 1D3 and INT by 1D3. Extraordinary Effect.
DISEASE_GHOUL_ROT
The Ghoul Rot Disease. First save at a DC of 18. Subsequent saves at a DC of 18. Incubates for 1 hour then lowers CON by 1D6 and STR by 1D6. Supernatural Effect.
DISEASE_MINDFIRE
The Mindfire Disease. First save at a DC of 12. Subsequent saves at a DC of 12. Incubates for 1 hour then lowers INT by 1D4. Extraordinary Effect.
DISEASE_MUMMY_ROT
The Mummy Rot Disease. First save at a DC of 20. Subsequent saves at a DC of 20. Incubates for 1 hour then lowers CON by 1D6. Supernatural Effect.
DISEASE_RED_ACHE
The Red Ache Disease. First save at a DC of 15. Subsequent saves at a DC of 15. Incubates for 1 hour then lowers STR by 1D6. Extraordinary Effect.
DISEASE_RED_SLAAD_EGGS
The Red Slaad Eggs Disease. First save at a DC of 17. Subsequent saves at a DC of 17. Incubates for 1 hour then lowers DEX by 2D6, STR by 2D6, and CON by 2D6. Extraordinary Effect. At the end of the hour incubation period, the diseased target will take 4D6 of magical damage, be knocked down and a Red Slaad will burst forth from them.
DISEASE_SHAKES
The Shakes Disease. First save at a DC of 13. Subsequent saves at a DC of 13. Incubates for 1 hour then lowers STR by 1D6. Extraordinary Effect.
DISEASE_SLIMY_DOOM
The Slimy Doom Disease. First save at a DC of 14. Subsequent saves at a DC of 14. Incubates for 1 hour then lowers DEX by 1D4. Extraordinary Effect.
DISEASE_SOLDIER_SHAKES
The Soldier Shakes Disease. First save at a DC of 25. Supernatural Effect. After 24 hours, the diseased will have one of their ability scores lowered by 1 (permanently).
DISEASE_VERMIN_MADNESS
The Vermin Madness Disease. First save at a DC of 13. Subsequent saves at a DC of 13. Incubates for 1 hour then lowers INT by 1, WIS by 1 and CHA by 1. Extraordinary Effect.
DISEASE_ZOMBIE_CREEP
The Zombie Creep Disease. First save at a DC of 15. Subsequent saves at a DC of 15. Incubates for 1 hour then lowers DEX by 1D4 and CON by 1D4. Supernatural Effect.

See Also

functions: EffectDisease


Constant - DOOR_ACTION

Home > Reference > Constants > DOOR_ACTION_*

DOOR_ACTION_* Constant Group

A list of actions that can be done on a door.

Constants

Constant Description
DOOR_ACTION_BASH
Specifies the action of bashing a door.
DOOR_ACTION_IGNORE
Specifies the action of ignoring a door.
DOOR_ACTION_KNOCK
Specifies the action of casting the knock spell on a door.
DOOR_ACTION_OPEN
Specifies the action of opening a door.
DOOR_ACTION_UNLOCK
Specifies the action of unlocking a door.

See Also

functions: DoDoorAction | GetIsDoorActionPossible


Constant - DURATION_TYPE

Home > Reference > Constants > DURATION_TYPE_*

DURATION_TYPE_* Constant Group

Duration types for ApplyEffectAtLocation and ApplyEffectToObject functions.

Constants

Constant Description
DURATION_TYPE_INSTANT
Instantaneous. This would apply to any effect that is both immediate and permanent and cannot be removed. EffectDamage would be one example, as well as any of the 'fire-and-forget' visual effects.
DURATION_TYPE_PERMANENT
Permanent duration. This is as it sounds... the effect lasts until removed or dispelled
DURATION_TYPE_TEMPORARY
A temporary duration means that the effect must have a duration specified in the command (and is the only time this is so). Once the time has expired, the effect will be removed.

See Also

functions: ApplyEffectAtLocation | ApplyEffectToObject | GetEffectDurationType


Constant - EFFECT_TYPE

Home > Reference > Constants > EFFECT_TYPE_*

EFFECT_TYPE_* Constant Group

Constants that reflect the different effects that can be applied to creatures.

Constants

Constant Description
EFFECT_TYPE_ABILITY_DECREASE
EFFECT_TYPE_ABILITY_INCREASE
EFFECT_TYPE_AC_DECREASE
EFFECT_TYPE_AC_INCREASE
EFFECT_TYPE_ARCANE_SPELL_FAILURE
EFFECT_TYPE_AREA_OF_EFFECT
EFFECT_TYPE_ATTACK_DECREASE
EFFECT_TYPE_ATTACK_INCREASE
EFFECT_TYPE_BEAM
EFFECT_TYPE_BLINDNESS
EFFECT_TYPE_CHARMED
EFFECT_TYPE_CONCEALMENT
EFFECT_TYPE_CONFUSED
EFFECT_TYPE_CURSE
EFFECT_TYPE_DAMAGE_DECREASE
EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE
EFFECT_TYPE_DAMAGE_IMMUNITY_INCREASE
EFFECT_TYPE_DAMAGE_INCREASE
EFFECT_TYPE_DAMAGE_REDUCTION
EFFECT_TYPE_DAMAGE_RESISTANCE
EFFECT_TYPE_DARKNESS
EFFECT_TYPE_DAZED
EFFECT_TYPE_DEAF
EFFECT_TYPE_DISEASE
EFFECT_TYPE_DISPELMAGICALL
EFFECT_TYPE_DISPELMAGICBEST
EFFECT_TYPE_DOMINATED
EFFECT_TYPE_ELEMENTALSHIELD
EFFECT_TYPE_ENEMY_ATTACK_BONUS
EFFECT_TYPE_ENTANGLE
EFFECT_TYPE_FRIGHTENED
EFFECT_TYPE_HASTE
EFFECT_TYPE_IMMUNITY
EFFECT_TYPE_IMPROVEDINVISIBILITY
EFFECT_TYPE_INVALIDEFFECT
EFFECT_TYPE_INVISIBILITY
EFFECT_TYPE_INVULNERABLE
EFFECT_TYPE_MISS_CHANCE
EFFECT_TYPE_MOVEMENT_SPEED_DECREASE
EFFECT_TYPE_MOVEMENT_SPEED_INCREASE
EFFECT_TYPE_NEGATIVELEVEL
EFFECT_TYPE_PARALYZE
EFFECT_TYPE_POISON
EFFECT_TYPE_POLYMORPH
EFFECT_TYPE_REGENERATE
EFFECT_TYPE_RESURRECTION
EFFECT_TYPE_SANCTUARY
EFFECT_TYPE_SAVING_THROW_DECREASE
EFFECT_TYPE_SAVING_THROW_INCREASE
EFFECT_TYPE_SEEINVISIBLE
EFFECT_TYPE_SILENCE
EFFECT_TYPE_SKILL_DECREASE
EFFECT_TYPE_SKILL_INCREASE
EFFECT_TYPE_SLEEP
EFFECT_TYPE_SLOW
EFFECT_TYPE_SPELL_IMMUNITY
EFFECT_TYPE_SPELL_RESISTANCE_DECREASE
EFFECT_TYPE_SPELL_RESISTANCE_INCREASE
EFFECT_TYPE_SPELLLEVELABSORPTION
EFFECT_TYPE_STUNNED
EFFECT_TYPE_TEMPORARY_HITPOINTS
EFFECT_TYPE_TIMESTOP
EFFECT_TYPE_TRUESEEING
EFFECT_TYPE_TURNED
EFFECT_TYPE_ULTRAVISION

See Also

functions: EffectBeam | EffectEthereal | EffectHeal | EffectHitPointChangeWhenDying | EffectMissChance | EffectModifyAttacks | EffectNegativeLevel | EffectSkillDecrease | EffectSpellLevelAbsorption | EffectTemporaryHitpoints | GetEffectType | GetHasEffect | RemoveSpecificEffect


Constant - ENCOUNTER_DIFFICULTY

Home > Reference > Constants > ENCOUNTER_DIFFICULTY_*

ENCOUNTER_DIFFICULTY_* Constant Group

The list of encounter difficulties.

Constants

Constant Description
ENCOUNTER_DIFFICULTY_EASY
An easy difficulty encounter
ENCOUNTER_DIFFICULTY_HARD
The hard encounter difficulty.
ENCOUNTER_DIFFICULTY_IMPOSSIBLE
The impossible encounter difficulty.
ENCOUNTER_DIFFICULTY_NORMAL
The normal encounter difficulty.
ENCOUNTER_DIFFICULTY_VERY_EASY
The easiest encounter level.

See Also

functions: GetEncounterDifficulty | SetEncounterDifficulty


Constant - EVENT

Home > Reference > Constants > EVENT_*

EVENT_* Constant Group

User-defined event codes.

Constants

Constant Description
EVENT_ATTACKED
OnPhysicalAttacked event.
EVENT_DAMAGED
OnDamaged event.
EVENT_DIALOGUE
OnConversation event.
EVENT_END_COMBAT_ROUND
OnCombatRoundEnd event.
EVENT_HEARTBEAT
OnHeardbeat event.
EVENT_PERCEIVE
OnPerception event.
EVENT_SPELL_CAST_AT
OnSpellCastAt event.

See Also

Send comments on this topic.


Constant - FADE_SPEED

Home > Reference > Constants > FADE_SPEED_*

FADE_SPEED_* Constant Group

Determines the amount of time a fade screen effect takes.

Constants

Constant Description
FADE_SPEED_FAST
Fast fade speed.
FADE_SPEED_FASTEST
Fastest fade speed.
FADE_SPEED_MEDIUM
Medium fade speed.
FADE_SPEED_SLOW
Slow fade speed.
FADE_SPEED_SLOWEST
Slowest fade speed.

See Also

functions: FadeFromBlack | FadeToBlack


Constant - FAMILIAR_CREATURE_TYPE

Home > Reference > Constants > FAMILIAR_CREATURE_TYPE_*

FAMILIAR_CREATURE_TYPE_* Constant Group

使い魔とはウィザードやソーサラーに特別に召喚され、仕えるクリーチャーです。

彼らは術者の仕事を手伝います。例えば呪文のスクロールを集めたり、メッセージを届けたり、戦闘さえも参加します。

しかしたいていは術者の肩や帽子の先に停まり、腕白な笑みをもらしています。

ウィザードやソーサラーの使い魔が死ぬと術者は肉体的なショックを受けます。(１ｄ６ダメージ)

使い魔と動物の相棒は異なることに注意してください。

Constants

Constant Description
FAMILIAR_CREATURE_TYPE_BAT
バット(コウモリ)は翼を持つ夜行性の齧歯(げっし)動物で、彼らの権利が脅かされると感じることは殆んどありません。民話では吸血鬼やアンデットと関わりがあるとされてきました。

第３版モンスターマニュアルの193ページに載っています。

FAMILIAR_CREATURE_TYPE_CRAGCAT
"Hunter of men"の伝説に名高い北部に生息する的確な捕食動物です。

しかしながらその上いくらかの魔法特性を巧みに使います。

第３版モンスターマニュアルの195ページに載っています。

FAMILIAR_CREATURE_TYPE_FIREMEPHIT
混沌にして破壊的であるメフィットは多彩な形や幅広い能力を持っています。

ファイアーメフィットは、炎のエレメンタルプレーンからの来訪者で、適切に炎に基づいた攻撃を仕掛けます。

3rd Edition MM page 132.

第３版モンスターマニュアルの132ページに載っています。

FAMILIAR_CREATURE_TYPE_HELLHOUND
ヘルハウンドは攻撃的で炎を吐くイヌ科の動物で、邪悪な主人に仕えるために地獄の奥底からPrime Materialプレーンへと連れて来られた来訪者です。

第３版モンスターマニュアルの118ページに載っています。

FAMILIAR_CREATURE_TYPE_ICEMEPHIT
混沌にして破壊的であるメフィットは多彩な形や幅広い能力を持っています。

アイスメフィットは、氷のエレメンタルプレーンからの来訪者で、適切に冷気に基づいた攻撃を仕掛けます。

第３版モンスターマニュアルの132ページに載っています。

FAMILIAR_CREATURE_TYPE_IMP
小さいながら狡猾なこの悪魔はしばしばソーサラーやウィザードに奉仕するために仕えています。

インプは悪戯や謎掛け、下品な冗談などといった陽気な魅力があります。

第３版モンスターマニュアルの48ページに載っています。

FAMILIAR_CREATURE_TYPE_NONE
この値は使い魔を仲間にしていないクリーチャーを表すのに使われます。
FAMILIAR_CREATURE_TYPE_PIXIE
ピクシーです。
FAMILIAR_CREATURE_TYPE_RAVEN
レイヴンです。

See Also

functions: GetAnimalCompanionCreatureType

JP team: marshall


Constant - FEAT

Home > Reference > Constants > FEAT_*

FEAT_* Constant Group

Constants that deal with different feats that can be performed.

Constants

Constant Description
FEAT_AIR_DOMAIN_POWER
Ability to turn elementals as if they were undead. Access to the following spells (and level): Call Lightning (level 3), Chain Lightning (level 6).
FEAT_ALERTNESS
Prerequisite: None. Gives +2 on all Spot and Listen checks. Use: Automatic. NWN Manual - pg. 87.
FEAT_AMBIDEXTERITY
Prerequisite: DEX 15+. When fighting with two weapons, this feat reduces the penalty for the off-hand weapon by 4. Use: Automatic when fighting with two weapons. Rangers get this feat at 1st level. NWN Manual - pg. 87.
FEAT_ANIMAL_COMPANION
Ability to summon forth a stalwart animal companion. Gained: Druid - 1st level, Ranger - 6th level. Use: Once per day, until killed or unsummoned. Bonuses: Animal companions are chosen at character creation and can be changed with each new druid or ranger class level. NWN Manual - pg. 59.
FEAT_ANIMAL_DOMAIN_POWER
Ability to summon more powerful allies. Summon Creature I through VIII spells summon creature of 1 level higher Summon spell. (i.e. Casting Summon Creature II creates a level III creature.) Cast the following spells (and at what level): Cat'e Grace (2), True Seeing (3), Polymorph Self (5).
FEAT_ARMOR_PROFICIENCY_HEAVY
Prerequisite: Armor Proficiency (Light) and Armor Proficiency (Medium). Knowledge of effective use of heavy armor. Use: Automatic. Fighters, Paladins and Clerics receive this feat for free. NWN Manual - pg. 87.
FEAT_ARMOR_PROFICIENCY_LIGHT
Knowledge of effective use of light armor. Use: Automatic. All classes except Monk, Wizard and Sorcerers get this feat free. NWN Manual - pg. 87.
FEAT_ARMOR_PROFICIENCY_MEDIUM
Prerequisite: Armor Proficiency (Light). Ability to effectively use medium armor. Use: Automatic. All classes except monks, rogues, wizards and sorcerers get this feat free. NWN Manual - pg. 88.
FEAT_AURA_OF_COURAGE
The paladin is immune to all fear spells and effects. Gained: Paladin - 2nd level. Use: Automatic. Bonuses: Immune to fear. NWN Manual - pg. 65.
FEAT_BARBARIAN_ENDURANCE
Barbarians gain a 10% bonus to their movement speed. Gained: Barbarian - 1st level. Use: Automatic. NWN Manual - pg. 56.
FEAT_BARBARIAN_RAGE
Can catapult into a merderous fury becoming a more formidable foe. Use: Selected. 1st level - 1/day, 4th level - 2/day, 8th level - 3/day, 12th level - 4/day. Gives the following bonuses: +4 to strength, +4 to constitution, +2 morale bonus to Will saving throws. Penalty: -2 to AC. Note: Duration is 3 rounds + adjusted constitution bonus. Refer to NWN Manual - pg. 56 for more info.
FEAT_BARD_SONGS
Capable of singing bardic music. Song can be sung once per day/per class level. Affects all allies within 30 feet and lasts 6 rounds. The higher the Perform skill, the better the bardsong. Bard song bonuses do not stack. Refer to NWN Manual - pg 58.
FEAT_BARDIC_KNOWLEDGE
The bard is able to identify items more easiliy than other classes. Gained: Bard - 1st level. Use: Automatic. Bonuses: Apply bard levels as a bonus to any Lore skill checks. NWN Manual - pg. 57.
FEAT_BATTLE_TRAINING_VERSUS_GIANTS
Dwarven and Gnome racial ability. +4 Dodge Bonus to Armor Class versus Giants. Their small stature grants them a bonus when dealing with Giants who find their tactics to be frustrating.
FEAT_BATTLE_TRAINING_VERSUS_GOBLINS
Dwarven and Gnome racial ability. +1 to Attack Rolls versus Goblinoids. Constant warfare against Goblinoids (which includes Goblins, Hobgoblins, and Bugbears) has lead to special training from birth against those races.
FEAT_BATTLE_TRAINING_VERSUS_ORCS
Dwarven racial ability. +1 to Attack Rolls versus Orcs. Constant warfare against Orcs has lead to special training from birth against that race.
FEAT_BATTLE_TRAINING_VERSUS_REPTILIANS
Gnome racial ability. +1 to Attack Rolls versus Reptilian Humanoids. The Gnome has often struggled against the creatures of reptilian nature who consider them a delicacy.
FEAT_CALLED_SHOT
Prerequisite: Base attack bonus of +1 or higher. Grants the ability to make a potentially disabling attack against an opponent's arms or legs. Called shots are made at a -4 penalty. Refer to NWN Manual - pg. 88.
FEAT_CLEAVE
Prerequisite: STR 13+, Power Attack feat. If a character with this feat kills an opponent in melee combat, they get a free attack against any opponent who is within melee range. Use: Automatic. NWN Manual - pg. 88.
FEAT_COMBAT_CASTING
Prerequisite: Ability to cast 1st level spells. Character is adept at casting spells in combat removing the standard -4 penalty to Concentration checks when within 3 meters of an enemy. Use: Automatic. NWN Manual - pg. 89.
FEAT_CRIPPLING_STRIKE
Ability of the rogue to damage a foe's strength during a sneak attack. Gained: Rogue - 10th and every three levels thereafter (choice). Use: Automatic. Bonuses: Any successful sneak attack deals two points of Strength ability damage to the target. NWN Manual - pg. 68.
FEAT_DAMAGE_REDUCTION
Capability to shrug off some amount of injury from each blow or attack. Gained: Barbarian - 11th level. Use: Automatic. Bonuses: 11th level = Damage reduced by one point; 14th level = damage reduced by two; 17th level = damage reduced by three; 20th level = damage reduced by four. NWN Manual - pg. 57.
FEAT_DARKVISION
Dwarf and Half-orc racial ability. Ability to see in darkness almost as if it were daylight to 60'.
FEAT_DEATH_DOMAIN_POWER
Gives ability to summon a shadow of similar level to person with feat. Also the following spells (and level attained) are received: Phantasmal Killer (4), Enervation (5).
FEAT_DEFENSIVE_ROLL
Gained: Rogue - 10th and every three levels thereafter (choice). Use: Automatic. Once per day. Bonuses: If you are struck by a potentially leath blow (i.e. you suffer weapon damage that would normally drop you below 1 hit point), you make a Reflex saving throw (DC = damage dealt). If successful, you take only half damage from the blow (which may still be enough to kill you). If you are caught flat-footed, you may not make a defensive roll. NWN Manual - pg. 69.
FEAT_DEFLECT_ARROWS
Prerequisite: DEX 13+, Improved Unarmed Strike. Character can attempt to deflect one incoming missile attack per round (Reflex save made against DC 20). Use: Automatic if not caught flat-footed. Monks receive this feat for free at level 2. NWN Manual - pg. 89.
FEAT_DESTRUCTION_DOMAIN_POWER
Ability to damage construct-type creatures using undead turn ability. Cast the following spells (and level needed): Stinking Cloud (3), Acid Fog (6).
FEAT_DIAMOND_BODY
Through meditation and control over his body, the disciplined monk eventually becomes immune to all natural and most magical poisons. Gained: Monk - 11th level. Use: Automatic. Bonuses: Immunity to poison. NWN Manual - pg. 63.
FEAT_DIAMOND_SOUL
Ki, the spiritual energy that powers the monk, eventually develops into a force that is capable of repelling all but the most determined magic attacks. Gained: Monk - 12th level. Use: Automatic. Bonuses: Spell resistance equal to the character's level + 10. NWN Manual - pg. 63.
FEAT_DISARM
Prerequisite: Int 13+. The character can attempt to disarm an opponent in melee combat. Attampting a disarm applies a -6 penalty to the attack roll and the combatant with the larger weapon gains a +4 bonus per size category of difference. Refer to NWN Manual - pg. 89.
FEAT_DIVINE_GRACE
Blessed by her deity, the paladin gains bonuses to resist various forms of attack. Gained: Paladin - 1st level. Use: Automatic. Bonuses: The paladin adds her positive Charisma bonus (if any) to all saving throws. NWN Manual - pg. 64.
FEAT_DIVINE_HEALTH
Most disease are naturally repelled by the holy power of the paladin. Gained: Paladin - 1st level. Use: Automatic. Bonuses: Immune to disease. NWN Manual - pg. 64.
FEAT_DODGE
Prerequisite: DEX 13+. Increased agility grants a +1 dodge bonus to AC against attacks from a characters current target (or last attacker). Use: Automatic, though a condition that negates a Dexterity bonus to AC also negates any dodge bonuses. Multiple dodge bonuses (different feats, racial bonuses) are cumulative. NWN Manual - pg. 89.
FEAT_EARTH_DOMAIN_POWER
Ability to turn elementals as if they were undead. Ability to cast following spells (and level needed): Stoneskin (4), Energy Buffer (5).
FEAT_ELEMENTAL_SHAPE
The druid gains the ability to shape shift into various elemental forms. Gained: Druid - 16th level. Use: Selected. 1/day at 16th level, 2/day at 17th level, 3/day at 19th level. This ability last one hour per level. Bonuses: Huge elementals at 16th level and elder elementals at 20th level. NWN Manual - pg. 60.
FEAT_EMPOWER_SPELL
Prerequisite: Ability to cast 2nd-level spells. Magical expertise allows certain spells to be cast with a 50% increase in variable numeric effects (number of targets, damage, etc.), excluding duration. Use: Empowered spells occupy spell slots two levels higher than normal. Saving throws and opposed rolls, such as those made when dispel magic is cast, are not allowed. NWN Manual - pg. 90.
FEAT_EMPTY_BODY
Mastering their ki can allow the monk to fade from sight. Gained: Monk - 18th level. Use: Selected. Once per day. Bonuses: The monk gains 50% concealment. NWN Manual - pg. 63.
FEAT_EVASION
Monks and Rogues are able to escape potentially deadly situations. Gained: Monk - 1st level, Rogue - 2nd level. Use: Automatic. Bonuses: In situations where a successful Reflex saving throw would allow others to take half damage, the PC escapes unscathed. NWN Manual - pg. 61.
FEAT_EVIL_DOMAIN_POWER
Ability to turn outsiders as if they were undead. Gain following spells (and level needed): Negative Energy Ray (1), Negative Energy Burst (4), Enervation (5).
FEAT_EXTEND_SPELL
Prerequisite: Ability to cast 1st-level spells. Magical expertise allows certain spells to be cast with a 100% increase in duration. Use: Extended spells occupy spell slots one level higher than normal. Spells with an instantaneous or permanent duration are not affected. NWN Manual - pg. 90.
FEAT_EXTRA_TURNING
Prerequisite: Exclusive to cleric or paladin. This divine ability allows the character to turn undead 6 additional times per day. Use: Automatic.
FEAT_FAVORED_ENEMY_ABERRATION
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_ANIMAL
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_BEAST
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_CONSTRUCT
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_DRAGON
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_DWARF
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_ELEMENTAL
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_ELF
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_FEY
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_GIANT
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_GNOME
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_GOBLINOID
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_HALFELF
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_HALFLING
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_HALFORC
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_HUMAN
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_MAGICAL_BEAST
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_MONSTROUS
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_ORC
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_OUTSIDER
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_REPTILIAN
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_SHAPECHANGER
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_UNDEAD
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FAVORED_ENEMY_VERMIN
Rangers study their enemies and develop a keen understanding of the weakness of various creatures. Gained: Ranger - 1st level and ever 5 levels thereafter. Use: Automatic. Bonuses: Rangers gain a +1 bonus to Listen, Spot, and Taunt checks against their favorite enemy, as well as a +1 bonus to any physical damage applied to the enemy. Refer to NWN Manual - pg. 66 for additional information.
FEAT_FEARLESS
Halfling racial ability. +2 saving throws versus Fear and fear-like spells and effects. Halflings show a remarkable lack of common sense, uh, I mean fear when faced with something others tremble and balk at.
FEAT_FIRE_DOMAIN_POWER
Ability to turn elementals as if they were undead. Ability to cast the following spells (and level needed): Wall of Fire (4), Energy Buffer (5).
FEAT_FLURRY_OF_BLOWS
The monk receives an extra attack per round when fighting unarmed or with a kama. Gained: Monk - 1st level. Use: Selected. Penalties: The monk suffers a -2 penalty to all attack rolls made as part of a flurry of blows. NWN Manual - pg. 61.
FEAT_GOOD_AIM
Halfling racial ability. +1 to Attack Rolls with thrown weapons. Early on, halflings practice throwing things at each other giving them an advantage with thrown weapons.
FEAT_GOOD_DOMAIN_POWER
Ability to turn outsiders as if they were undead. Ability to cast following spells (and level needed): Stoneskin (4), Lesser Planar Binding (5).
FEAT_GREAT_FORTITUDE
Prerequisite: None. A character with this feat is very hardy, gaining a +2 bonus to all Fortitude saving throws. Use: Automatic.
FEAT_HARDINESS_VERSUS_ENCHANTMENTS
Elf and Half-elf racial ability. +2 to saving throws versus mind-affecting spells. These races have minds especially suited to resisting influences by magical forces trying to dominate them.
FEAT_HARDINESS_VERSUS_ILLUSIONS
Gnome racial ability. +2 saving throws versus Illusion spells. Gnomes have a natural affinity for illusions which also helps them recognize spells of that nature for what they are.
FEAT_HARDINESS_VERSUS_POISONS
Dwarven racial ability. +2 to saving throws versus all types of poisons. Dwarves are hardier and resistant to toxin that most other races.
FEAT_HARDINESS_VERSUS_SPELLS
Dwarven racial ability. +2 to saving throws versus all spells. Dwarves have a natural, genetic resistance to spells and spell-like effects.
FEAT_HEALING_DOMAIN_POWER
Following healing spells are cast as if using the EMPOWER metamagic feat: Cure Light Wounds, Cure Moderate Wounds, Cure Serious Wounds, Cure Critical Wounds. Ability to cast the following spells (and level needed): Cure Serious Wounds (2), Heal (5).
FEAT_IMMUNITY_TO_SLEEP
Elf and Half-elf racial ability. These races are immune to the Sleep spell and all sleep-like spells.
FEAT_IMPROVED_CRITICAL_BASTARD_SWORD
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_BATTLE_AXE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_CLUB
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_CREATURE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_DAGGER
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_DART
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_DIRE_MACE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_DOUBLE_AXE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_GREAT_AXE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_GREAT_SWORD
FEAT_IMPROVED_CRITICAL_HALBERD
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_HAND_AXE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_HEAVY_CROSSBOW
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_HEAVY_FLAIL
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_KAMA
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_KATANA
FEAT_IMPROVED_CRITICAL_KUKRI
FEAT_IMPROVED_CRITICAL_LIGHT_CROSSBOW
FEAT_IMPROVED_CRITICAL_LIGHT_FLAIL
FEAT_IMPROVED_CRITICAL_LIGHT_HAMMER
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_LIGHT_MACE
FEAT_IMPROVED_CRITICAL_LONG_SWORD
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_LONGBOW
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_MORNING_STAR
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_RAPIER
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_SCIMITAR
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_SCYTHE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_SHORT_SWORD
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_SHORTBOW
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_SHURIKEN
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_SICKLE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_SLING
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_SPEAR
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_STAFF
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_THROWING_AXE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_TWO_BLADED_SWORD
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_UNARMED_STRIKE
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_CRITICAL_WAR_HAMMER
Prerequisite: Proficiency with specific weapon, Base attack bonus of +8 or higher. Combat ability doubles the critical threat range with a given weapon. A weapon with a normal critical range of 19-20 would now threaten on a roll of 17-20. Use: Automatic. The threat range of a Keen weapon is already doubled, increasing to triple with this feat. This feat can be selected multiple time, applying to a new weapon category each time.
FEAT_IMPROVED_DISARM
Prerequisite: INT 13+, Disarm. A character with this feat has learned not to provoke an attack of opportunity when attempting to disarm an opponent. Success knocks the opponent's weapon away from them. The penalty to make a disarm attempt is reduced to -4. Use: Automatic. NWN Manual - pg. 91.
FEAT_IMPROVED_EVASION
The PC gains a superhuman ability to avoid danger. Gained: Monk - 9th level, Rogue - 10th and every three levels thereafter (choice). Use: Automatic. Bonuses: In situations where a successful Reflex saving throw would allow others to take half damage, the character escapes unsacathed on a successful save and takes only half damage even if the saving throw fails. NWN Manual - pg. 62.
FEAT_IMPROVED_KNOCKDOWN
Prerequisite: Knockdown, Base attack bonus +7 or higher. Characters with the feat have learned to use the Knockdown ability as if one size category larger than they really are. All other Knockdown conditions still apply. Use: Selected. Monks receive this feat for free at 6th level. NWN Manual - pg. 91.
FEAT_IMPROVED_PARRY
Prerequisite: INT 13+. Grants a +4 competence bonus to the character's opposed attack rolls when using the Parry skill. Use: Automatic. NWN Manual - pg. 91.
FEAT_IMPROVED_POWER_ATTACK
Prerequisite: Power Attack, STR 13+. This feat can be used at a -10 penalty to attack but with a +10 bonus to any damage given. Improved Power Attack is very useful when fighting large numbers of easy-to-hit opponents. Use: Combat Mode. NWN Manual - pg. 92.
FEAT_IMPROVED_TWO_WEAPON_FIGHTING
Prerequisite: Two-Weapon Fighting, Ambidexterity, Base attack bonus of +9 or higher. The character with this feat is able to get a second off-hand attack (at a penalty of -5 to the attack roll). Use: Automatic. Rangers receive this feat at 9th level, even if they don't meet the requirements. NWN Manual - pg. 92.
FEAT_IMPROVED_UNARMED_STRIKE
Prerequisite: None. Armed opponents no longer get attacks of opportunity against the character when you make unarmed attacks against them. Use: Automatic. Monks receive this feat for free at 1st level. NWN Manual - pg. 92.
FEAT_IRON_WILL
FEAT_KEEN_SENSE
Elf racial ability. Elves do not have to actively search to notice that which is hidden. This means that they can continually search without taking movement penalties.
FEAT_KI_STRIKE
When attacking creatures with the damage reduction ability, the character's unarmed attack is treated as a weapon with an enhancement bonus. Gained: Monk - 10th level. Use: Automatic. Bonuses: Equivalent to a +1 enchancement bonus at 10th level, +2 bonus at 13th level, +3 bonus at 16th level. NWN Manual - pg. 62.
FEAT_KNOCKDOWN
Prerequisite: None. With this maneuver, a character can attempt to knock an opponent to the ground. An attack roll is made with a -4 penalty to the attack and, if successful, an opposed roll is made, comparing your attack roll with the defender's Discipline skill check. If successful, the target is knocked to a prone position. Use: Selected. Prone characters cannot attack. Refer to NWN Manual - pg. 93 for more info.
FEAT_KNOWLEDGE_DOMAIN_POWER
Ability to cast the following spells (and level needed): Identify (1), Knock (2), Clairvoyance/Clairaudience (3), True Seeing (4), Legend Lore (6).
FEAT_LAY_ON_HANDS
The holy might of the paladin can be used to heal wounds. Gained: Paladin - 1st level. Use: Selected. Once per day. Bonuses: If the paladin has a positive Charisma modifier, then she can cure a number of hit points equal to her Charisma modifier * paladin level. NWN Manual - pg. 64.
FEAT_LIGHTNING_REFLEXES
Prerequisite: None. This feat grants a +2 bonus to all Reflex saving throws, due to faster than normal reflexes. Use: Automatic. NWN Manual - pg. 93.
FEAT_LOWLIGHTVISION
Elf, Half-elf, and Gnome racial ability. Ability to see better than normal in low light situations.
FEAT_LUCK_DOMAIN_POWER
UNKNOWN
FEAT_LUCKY
Halfling racial ability. +1 to All saving throws. Halflings seem to have a knack for getting themselves out of trouble that they manage to land themselves in.
FEAT_MAGIC_DOMAIN_POWER
Ability to cast the following spells (and level needed): Mage Armor (1), Melf's Acid Arrow (2), Negative Energy Burst (3), Stoneskin (4), Ice Storm (5).
FEAT_MAXIMIZE_SPELL
Prerequisite: Ability to cast 3rd-level spells. Magical expertise allows certain spells to be cast with all variable numeric effects (number of targets, damage, etc.) applied at their maximum. Use: Maximized spells occupy spell slots three levels higher than normal. Saving throws and opposed rolls, such as those made when dispel magic is cast, are not affected. NWN Manual - pg. 93.
FEAT_MOBILITY
Prerequisite: DEX 13+, Dodge. A character with this feat has learned to avoid attacks of opportunity more effectively, gaining a +4 dodge bonus to AC against them. Use: Automatic, though a condition that negates a Dexterity bonus to AC also negates any dodge bonuses. Multiple dodge bonuses (from different feats or racial bonuses) are cumulative. NWN Manual - pg. 94.
FEAT_MONK_AC_BONUS
Monks add both their wisdom modifier and their dexterity modifier to their armor class. NWN Manual - pg. 61.
FEAT_MONK_ENDURANCE
Monks gain the ability to move quickly. Gained: Monk - 3rd level. Use: Automatic. Bonuses: Monks move faster than other classes and this ability improves with experience, as outlined on page 186 of the NWN Manual. NWN Manual - pg. 62 * Manual incorrectly states information is on page 162.
FEAT_NATURE_SENSE
The druid gains a +2 bonus to all attacks made while fighting in wilderness areas. Gained: Druid - 1st level. Use: Automatic. NWN Manual - pg. 59.
FEAT_OPPORTUNIST
Gained: Rogue - 10th and every three levels thereafter (choice). Use: Automatic. Bonuses: The rogue gains a +4 competence bonus to attack rolls when making an attack of opportunity. NWN Manual - pg. 68.
FEAT_PARTIAL_SKILL_AFFINITY_LISTEN
Half-elf racial ability. +1 to Listen skill. Half-Elves get some of the sharp senses of their elven heritage.
FEAT_PARTIAL_SKILL_AFFINITY_SEARCH
Half-elf racial ability. +1 to Search skill. Half-Elves get some of the sharp senses of their elven heritage.
FEAT_PARTIAL_SKILL_AFFINITY_SPOT
Half-elf racial ability. +1 to Spot skill. Half-Elves get some of the sharp senses of their elven heritage.
FEAT_PERFECT_SELF
So complete is the monk's mastery over his body and spirit that he becomes a supernatural being, able to shrug off ordinary weapons and many spells. Gained: Monk - 20th level. Use: Automatic. Bonuses: Immune to all mind-affecting spells; gains damage reduction 20/+1. NWN Manual - pg. 64.
FEAT_PLANT_DOMAIN_POWER
Ability to turn vermin as if they were undead. Ability to cast the following spells (and level needed): Barkskin (2), Creeping Doom (7).
FEAT_POINT_BLANK_SHOT
Prerequisite: None. Unfazed by close combat, a character with this feat negates the -4 penalty for using missile weapons within melee attack range, and gains an additional +1 to attack and damage with ranged weapons when the target is within 15 feet. Use: Automatic. NWN Manual - pg. 94.
FEAT_POWER_ATTACK
Prerequisite: STR 13+. A character with this feat can make powerful but ungainly attacks. When selected, this grants a +5 bonus to the damage roll, but inflicts a -5 penalty to the attack roll. Use: Combat mode. NWN Manual - pg. 94.
FEAT_PROTECTION_DOMAIN_POWER
Ability to cast modified type of Sanctuary spell. Spell DC set at 10 + charisma bonus + clerical level. Duration is 1 round per caster level + charisma bonus. Ability to cast following spells (and level needed): Minor Globe of Invulnerability (4), Energy Buffer (5).
FEAT_PURITY_OF_BODY
Monks are immune to common diseases. Gained: Monk - 5th level. Use: Automatic. Bonuses: Immune to diseases. NWN Manual - pg. 62.
FEAT_QUICK_TO_MASTER
Human racial ability. 1 extra feat gained at 1st level.
FEAT_QUICKEN_SPELL
Prerequisite: Ability to cast 4th-level spells. Magical expertise allows spells to be cast instantaneously, making them invulnerable to counterspells or interruption. A quickened spell is cast as a free action, and another action can be attempted within the same round, including the casting of another spell. Only one quickened spell can be cast in a round, however. Use: Quickened spells occupy spell slots four levels higher than normal. NWN Manual - pg. 95.
FEAT_QUIVERING_PALM
Harnessing his ki, the monk is able to deliver quick death with an unarmed strike. Gained: Monk - 15th level. Use: Selected. Once per day. Bonuses: If the attack succeeds and does damage, the target must make a Fortitude save (DC 10 + 1/2 the monk's level + the monk's Wisdom modifier). Failure results in the target's immediate death. NWN Manual - pg. 63.
FEAT_RAPID_SHOT
Prerequisite: DEX 13+, Point Blank Shot. A character with this feat is quick with ranged weapons, gaining an extra attack per round while using them. When a rapid attack round is attempted, the extra attack is made at the highest base attack bonus, though all attacks wihin the round suffer a -2 penalty. NWN Manual - pg. 95.
FEAT_REMOVE_DISEASE
Her access to the divine allows the paladin to remove disease from herself or her companions. Gained: Paladin - 3rd level. Use: Selected. Once per day. Bonuses: Remove disease, as the spell. NWN Manual - pg. 65.
FEAT_RESIST_NATURES_LURE
Due to their inherent understanding of nature, druids can avoid the most common dangers that the natural world presents. Gained: Druid - 4th level. Use: Automatic. Bonuses: Grants a +2 insight bonus to saving throws against all fear spells and effects. NWN Manual - pg. 60.
FEAT_SAP
Prerequisite: Base attack bonus +1, Called Shot. A character with this feat is able to attack with a -4 penalty. A successful hit deals normal damage at which point the target gets to make a Discipline check against a DC = the attacker's modified attack roll. If the opponent's roll fails, he or she is dazed for 12 seconds. Sap can only work on creatures of large-size or smaller. Use: Selected. NWN Manual - pg. 95.
FEAT_SHIELD_PROFICIENCY
Prerequisite: None. A character with this feat has the basic knowledge of how to effectively use a shield. Use: All classes except monks, rogues, sorcerers, and wizards have this feat for free. NWN Manual - pg. 96.
FEAT_SILENCE_SPELL
Prerequisite: Ability to cast 1st-level spells. Magical experise allows the casting of certain spells without using a verbal component. Use: Silenced spells occupy spell slots one level higher than normal. NWN Manual - pg. 96.
FEAT_SKILL_AFFINITY_CONCENTRATION
Gnome racial ability. +2 to Concentration skill. Gnomes are very focused when given a target to study.
FEAT_SKILL_AFFINITY_LISTEN
Elf, Halfling, and Gnome racial ability. +2 to Listen skill. These races are especially sharp of hearing.
FEAT_SKILL_AFFINITY_LORE
Dwarven racial ability. +2 to Lore skill. Dwarves have an eye for the valuable.
FEAT_SKILL_AFFINITY_MOVE_SILENTLY
Halfling racial ability. +2 to Move Silently skill. Halflings are adept at moving silently as they practice it for fun almost their first steps.
FEAT_SKILL_AFFINITY_SEARCH
Elf racial ability. +2 to Search skill. Elves have an affinity for recognizing that which is hidden or elusive to the eye.
FEAT_SKILL_AFFINITY_SPOT
Elf racial ability. +2 to Spot skill. Elves are especially sharp sighted.
FEAT_SKILL_FOCUS_ANIMAL_EMPATHY
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_CONCENTRATION
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_DISABLE_TRAP
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_DISCIPLINE
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_HEAL
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_HIDE
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_LISTEN
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_LORE
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_MOVE_SILENTLY
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_OPEN_LOCK
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_PARRY
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_PERFORM
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_PERSUADE
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_PICK_POCKET
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_SEARCH
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_SET_TRAP
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_SPELLCRAFT
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_SPOT
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_TAUNT
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_FOCUS_USE_MAGIC_DEVICE
Prerequisite: Able to use the skill. A character with this feat is adept at the specific skill, gaining a +3 bonus on all checks with it. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different skill in each case.
FEAT_SKILL_MASTERY
Gained: Rogue - 10th and every three levels thereafter (choice). Use: Automatic. Bonuses: The rogue can take 20 whenever using the Disable Trap, Open Lock, or Set Traps skills, even if in combat. NWN Manual - pg. 68.
FEAT_SLIPPERY_MIND
Gained: Rogue - 10th and every three levels thereafter (choice). Use: Automatic. Bonuses: If the rogue fails his save against a mind-affecting spell, he makes an automatic reroll. NWN Manual - pg. 68.
FEAT_SMITE_EVIL
Gathering the might of his patron deity, the paladin can unleash a holy attack that devastates evil enemies. Gained: Paladin - 2nd level. Use: Selected. Once per day. Bonuses: The paladin applies her Charisma bonus (if positive) to her next melee attack roll, and adds a damage bonus equal to her paladin level. If the target of this attack is not evil, Smite Evil has no effect and is wasted. NWN Manual - pg. 65.
FEAT_SNEAK_ATTACK
Rogues study the weaknesses of their opponents, and are capable of capitalizing on this knowledge with thei deadly sneak attacks. Gained: Rogue - 1st level. Use: Automatic. Bonuses: Refer to NWN Manual - pg. 67 for additional information.
FEAT_SPELL_FOCUS_ABJURATION
Prerequisite: Ability to cast 1st-level spells. A character with this feat is adept in a certain school of magic, granting a +2 bonus to spell save DC for all spells that the character casts from that school. This makes it more difficult for enemies to resist the effects of spells of this school when the caster casts them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different school of magic in each case. NWN Manual - pg. 96.
FEAT_SPELL_FOCUS_CONJURATION
Prerequisite: Ability to cast 1st-level spells. A character with this feat is adept in a certain school of magic, granting a +2 bonus to spell save DC for all spells that the character casts from that school. This makes it more difficult for enemies to resist the effects of spells of this school when the caster casts them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different school of magic in each case. NWN Manual - pg. 96.
FEAT_SPELL_FOCUS_DIVINATION
Prerequisite: Ability to cast 1st-level spells. A character with this feat is adept in a certain school of magic, granting a +2 bonus to spell save DC for all spells that the character casts from that school. This makes it more difficult for enemies to resist the effects of spells of this school when the caster casts them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different school of magic in each case. NWN Manual - pg. 96.
FEAT_SPELL_FOCUS_ENCHANTMENT
Prerequisite: Ability to cast 1st-level spells. A character with this feat is adept in a certain school of magic, granting a +2 bonus to spell save DC for all spells that the character casts from that school. This makes it more difficult for enemies to resist the effects of spells of this school when the caster casts them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different school of magic in each case. NWN Manual - pg. 96.
FEAT_SPELL_FOCUS_EVOCATION
Prerequisite: Ability to cast 1st-level spells. A character with this feat is adept in a certain school of magic, granting a +2 bonus to spell save DC for all spells that the character casts from that school. This makes it more difficult for enemies to resist the effects of spells of this school when the caster casts them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different school of magic in each case. NWN Manual - pg. 96.
FEAT_SPELL_FOCUS_ILLUSION
Prerequisite: Ability to cast 1st-level spells. A character with this feat is adept in a certain school of magic, granting a +2 bonus to spell save DC for all spells that the character casts from that school. This makes it more difficult for enemies to resist the effects of spells of this school when the caster casts them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different school of magic in each case. Gnome racial ability. NWN Manual - pg. 96.
FEAT_SPELL_FOCUS_NECROMANCY
Prerequisite: Ability to cast 1st-level spells. A character with this feat is adept in a certain school of magic, granting a +2 bonus to spell save DC for all spells that the character casts from that school. This makes it more difficult for enemies to resist the effects of spells of this school when the caster casts them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different school of magic in each case. NWN Manual - pg. 96.
FEAT_SPELL_FOCUS_TRANSMUTATION
Prerequisite: Ability to cast 1st-level spells. A character with this feat is adept in a certain school of magic, granting a +2 bonus to spell save DC for all spells that the character casts from that school. This makes it more difficult for enemies to resist the effects of spells of this school when the caster casts them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a different school of magic in each case. NWN Manual - pg. 96.
FEAT_SPELL_PENETRATION
Prerequisite: Ability to cast 1st-level spells. A character with this feat can use magic to better pierce the defenses of his opponents, gaining a +2 bonus to caster level checks to beat a creature's spell resistance. Use: Automatic. NWN Manual - pg. 97.
FEAT_STILL_MIND
FEAT_STILL_SPELL
Prerequisite: Ability to cast 1st-level spells. Magical expertise allows certain spells to be cast without gestures, ignoring their somatic component. Any penalties incurred from casting in armor do not apply to a spell that has been prepared by this feat. Use: Stilled spells occupy spell slots one level higher than normal. NWN Manual - pg. 97.
FEAT_STONECUNNING
Dwarven racial ability. +2 to Search Skill in subterranean areas. Dwarves are particularly aware of their surroundings while beneath the surface of the earth.
FEAT_STRENGTH_DOMAIN_POWER
Ability to activate "Divine Strength" giving the PC a bonus to strength of 2 + 1 for every 3 class levels. It has a duration of 5 + charisma bonus. Ability to cast following spells (and level needed): Divine Power (3), Stoneskin (5).
FEAT_STUNNING_FIST
Prerequisite: DEX 13+, WIS 13+, Sap, Base attack bonus +8 or higher, Improved Unarmed Strike. A character with this feat can attempt a disabling strike with a -4 attack penalty and a -4 damage penalty. If successful they have hit a vulnerable spot, and the target must make a Fortitude save (DC 10 + 1/2 the attacker's level + the attacker's Wisdom modifier) or be held for three rounds. Refer to NWN Manual - pg. 97 for additional info.
FEAT_SUMMON_FAMILIAR
Gained: Sorcerer/Wizard - 1st level. Use: Selected. Once per day. Bonuses: Able to summon a small creature to assist in combat or scouting. If the familiar dies, the caster loses 1d6 hit points, but the familiar will be available to summon again the next day. NWN Manual - pg. 69.
FEAT_SUN_DOMAIN_POWER
Add 1d6 to all undead turning checks to determine maximum HD of undead turned. Adds 1d4 to number of undead turned. Ability to cast the following spells (and level needed): Searing Light (2), Sunbeam (7).
FEAT_TOUGHNESS
Prerequisite: None. A character with this feat is tougher than normal, gaining one bonus hit point per level. Hit points are gained retroactively when choosing this feat. Use: Automatic. NWN Manual - pg. 98.
FEAT_TRACKLESS_STEP
Druid or Ranger moves stealthily through wilderness area. Gained: Druid - 3rd level, Ranger - 1st level. Use: Automatic. Bonuses: Grants a +4 competence bonus to Hide and Move Silently checks when in wilderness areas. NWN Manual - pg. 59.
FEAT_TRAVEL_DOMAIN_POWER
Ability to cast the following spells (and level needed): Entangle (1), Web (2), Freedom of Movement (3), Slow (4), Haste (5).
FEAT_TRICKERY_DOMAIN_POWER
Ability to activate "Divine Trickery" which affects the following skills: Hide, Persuade, Search, Disable Trap, Move Silently, Open Locks, and Pick Pockets. It adds a bonus of 1 per 2 class levels. Duration is 5 + charisma bonus. Ability to cast the following spells (and level needed): Invisibility (2), Invisibility Sphere (3), Improved Invisibility (5).
FEAT_TURN_UNDEAD
With this ability, the character can cause undead to flee. Gained: Cleric - 1st level, Paladin - 3rd level. Use: Selected. Can be used three times per day, plus the character's Charisma modifier. Bonuses: The character's level and Charisma are used to determine how many HD of undead are turned. If the PC has twice as many levels as the undead have HD, the undead are instantly destroyed. NWN Manual - pg. 59.
FEAT_TWO_WEAPON_FIGHTING
Prerequisite: None. A character with this feat reduces the penalties suffered when using a weapon in each hand. The normal penalty of -6 to the primary hand and -10 to off-hand becomes -4 for the primary hand and -8 for the off-hand. Use: The ambidexterity feat further reduces the attack penalty for the second weapon by 4 (-4/-4). Best results are achieved if the off-hand weapon is light, further reducing the penalty for both the primary and off-hand by 2 (-2/-2). Rangers receive this feat for free at 1st level. NWN Manual - pg. 98.
FEAT_UNCANNY_DODGE_1
FEAT_UNCANNY_DODGE_2
FEAT_UNCANNY_DODGE_3
FEAT_UNCANNY_DODGE_4
FEAT_UNCANNY_DODGE_5
FEAT_UNCANNY_DODGE_6
FEAT_UNCANNY_REFLEX
FEAT_VENOM_IMMUNITY
Druids are eventually able to resist the effects of most poisons. Gained: Druid - 9th level. Use: Automatic. Bonuses: Immune to poison. NWN Manual - pg. 60.
FEAT_WAR_DOMAIN_POWER
Ability to activate "Battle Master" which gives a bonus to: Constitution, Dexterity, Attack Rolls, and Damage. This bonus is 1 + 1 for every 5 class levels. Damage Reduction of the same amount is also granted. The duration for this effect is 5 round + the charisma bonus. Ability to cast the following spells (and level needed): Cat's Grace (2), Aura of Vitality (7).
FEAT_WATER_DOMAIN_POWER
Ability to turn elementals as if they were undead. Ability to cast the following spells (and level needed): Poison (3), Ice Storm (5).
FEAT_WEAPON_FINESSE
Prerequisite: Base attack bonus +1 or higher. A character with this feat isa dept at using light weapons subtly and effectively, allowing him to calculate attack rolls with their Dexterity modifier bonus instead of their Strength bonus (if Dexterity is higher than Strength). Use: Automatic when using any of the following weapons: dagger, handaxe, kama, kukri, light crossbow, light hammer, mace, rapier, short sword, shuriken, sickle, sling, throwing axe, and unarmed strike. NWN Manual - pg. 98.
FEAT_WEAPON_FOCUS_BASTARD_SWORD
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_BATTLE_AXE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_CLUB
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_CREATURE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_DAGGER
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_DART
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_DIRE_MACE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_DOUBLE_AXE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_GREAT_AXE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_GREAT_SWORD
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_HALBERD
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_HAND_AXE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_HEAVY_FLAIL
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_KAMA
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_KATANA
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_KUKRI
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_LIGHT_FLAIL
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_LIGHT_HAMMER
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_LIGHT_MACE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_LONG_SWORD
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_LONGBOW
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_MORNING_STAR
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_RAPIER
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_SCIMITAR
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_SCYTHE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_SHORT_SWORD
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_SHORTBOW
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_SHURIKEN
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_SICKLE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_SLING
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_SPEAR
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_STAFF
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_THROWING_AXE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_TWO_BLADED_SWORD
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_UNARMED_STRIKE
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_FOCUS_WAR_HAMMER
Prerequisite: Proficiency with the chosen weapon type, Base attack bonus of +1 or higher. A character with this feat is particularly skilled with a specific weapon, gaining a +1 attack bonus with them. Use: Automatic. This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case. NWN Manual - pg. 99.
FEAT_WEAPON_PROFICIENCY_CREATURE
FEAT_WEAPON_PROFICIENCY_DRUID
FEAT_WEAPON_PROFICIENCY_ELF
Elf racial ability. Regardless of class, all Elves are proficient in longsword, rapier, shortbow and longbow. They are trained from childhood to use each of them and no matter their later vocation, they will always have knowledge of their use.
FEAT_WEAPON_PROFICIENCY_EXOTIC
Prerequisite: Base attack bonus +1 or higher. This feat allows effective use of all exotic weapons. The exotic weapons list includes the dire mace, double axe, kama, katana, kukri, scythe, shuriken, and two-bladed sword. Use: Automatic. NWN Manual - pg. 99.
FEAT_WEAPON_PROFICIENCY_MARTIAL
Prerequisite: None. This feat allows effective use of all martial weapons. A character cannot equip weapons they are not proficient in. The martial weapons list includes the bastard sword, battleaxe, greataxe, greatsword, halberd, handaxe, heavy flail, light flail, light hammer, longbow, longsword, rapier, scimitar, short sword, shortbow, throwing axe, and warhammer. Use: Barbarians, fighters, paladins, and rangers are automatically proficient with all martial weapons. NWN Manual - pg. 99.
FEAT_WEAPON_PROFICIENCY_MONK
FEAT_WEAPON_PROFICIENCY_ROGUE
FEAT_WEAPON_PROFICIENCY_SIMPLE
Prerequisite: None. This feat allows effective use of all simple weapons including club, dagger, mace, sickle, spear, morningstar, quarterstaff, light crossbow, dart, sling, and havey crossbow. A character cannot equip weapons they are not proficient in. Use: All characters except for druids, monks, rogues, and wizards are automatically proficient with all simple weapons. The spell Tenser's Transformation gives a wizard a temporary proficiency with all simple weapons. NWN Manual - pg. 100.
FEAT_WEAPON_PROFICIENCY_WIZARD
FEAT_WEAPON_SPECIALIZATION_BASTARD_SWORD
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_BATTLE_AXE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_CLUB
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_CREATURE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_DAGGER
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_DART
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_DIRE_MACE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_DOUBLE_AXE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_GREAT_AXE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_GREAT_SWORD
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_HALBERD
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_HAND_AXE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_HEAVY_CROSSBOW
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_HEAVY_FLAIL
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_KAMA
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_KATANA
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_KUKRI
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_LIGHT_CROSSBOW
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_LIGHT_FLAIL
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_LIGHT_HAMMER
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_LIGHT_MACE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_LONG_SWORD
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_LONGBOW
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_MORNING_STAR
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_RAPIER
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_SCIMITAR
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_SCYTHE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_SHORT_SWORD
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_SHORTBOW
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_SHURIKEN
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_SICKLE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_SLING
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_SPEAR
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_STAFF
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_THROWING_AXE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_TWO_BLADED_SWORD
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_UNARMED_STRIKE
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WEAPON_SPECIALIZATION_WAR_HAMMER
Prerequisite: Fighter with Base attack bonus of +4 or higher, Weapon Focus in the chosen weapon type. A character with this feat has trained especially hard with a specific weapon group, gaining a +2 damage bonus with that category. Use: This feat may be selected multiple times, but the effects do not stack. It applies to a new weapon in each case, so long as that group is already associated with Weapon Focus. NWN Manual - pg. 100.
FEAT_WHOLENESS_OF_BODY
The monk is capable of healing their wounds. Gained: Monk - 7th level. Use: Selected. Once per day. Bonuses: Restore a number of hit points equal to twice the character's level. NWN Manual - pg. 62.
FEAT_WILD_SHAPE
The druid gains the ability to shape shift into various animal forms. Gained: Druid - 5th level. Use: Selected. 1/day at 5th level, 2/day at 6th level, 2/day at 7th level, 4/day at 10th level, 5/day at 14th level, and at 18th level, Wild Shape may be used 6 times a day. This ability last one hour per level. Bonuses: The druid may choose from several different animal forms (and these forms improve as the druid gains levels.) NWN Manual - pg. 60.
FEAT_WOODLAND_STRIDE
Druids may walk with ease through magical and non-magical impediments to movement. Gained: Druid - 2nd level. Use: Automatic. Bonuses: Immune to grease, web, and entangle spells and effects. NWN Manual - pg. 59.

See Also

functions: ActionUseFeat | DecrementRemainingFeatUses | GetHasFeat | GetHasFeatEffect | TalentFeat | VerifyDisarm


Constant - GAME_DIFFICULTY

Home > Reference > Constants > GAME_DIFFICULTY_*

GAME_DIFFICULTY_* Constant Group

Specifies the list of available setting for game difficulty.

Constants

Constant Description
GAME_DIFFICULTY_CORE_RULES
Specifies the 'core rules' game difficulty setting.
GAME_DIFFICULTY_DIFFICULT
Specifies the 'difficult' game difficulty setting.
GAME_DIFFICULTY_EASY
Specifies the 'easy' game difficulty setting.
GAME_DIFFICULTY_NORMAL
Specifies the 'normal' game difficulty setting.
GAME_DIFFICULTY_VERY_EASY
Specifies the 'very easy' game difficulty setting.

See Also

functions: GetGameDifficulty | GetScaledEffect


Constant - GENDER

Home > Reference > Constants > GENDER_*

GENDER_* Constant Group

List of genders

Constants

Constant Description
GENDER_BOTH
Specifies the male and female gender.
GENDER_FEMALE
Specifies the female gender.
GENDER_MALE
Specifies the male gender.
GENDER_NONE
Specifies the lack of gender.
GENDER_OTHER
Specifies a gender that isn't male or female (or none).

See Also

functions: GetGender


Constant - Globals

Home > Reference > Constants > Globals

Globals Constant Group

Global, non-grouped constant values.

Constants

Constant Description
FALSE
Boolean false. Zero is always treated as false. False should remain defined as the numerical value 0 so problems with bitwise AND ("&") and bitwise OR ("|") do not occur.
NUM_INVENTORY_SLOTS
Defines the maximum number of inventory slots as 18.
OBJECT_INVALID
Invalid object reference.
OBJECT_SELF
Not truely a constant. Refers to the object that generates an event within an event handler.
PI
Used when determining radius, area, or other mathematical operations with a circle (3.141592).
TRUE
Boolean true. Any non-zero number (even negatives) is true. True should remain defined as the numerical value 1 so problems with bitwise AND ("&") and bitwise OR ("|") do not occur.

See Also

Send comments on this topic.


Constant - GUI_PANEL

Home > Reference > Constants > GUI_PANEL_*

GUI_PANEL_* Constant Group

List of all graphical panels (dialogs in windows programming terminology).

Constants

Constant Description
GUI_PANEL_DEATH
Specifies the PC death panel.

See Also

functions: PopUpGUIPanel


Constant - IMMUNITY_TYPE

Home > Reference > Constants > IMMUNITY_TYPE_*

IMMUNITY_TYPE_* Constant Group

Constants to identify different immunities that creatures could possible have.

Constants

Constant Description
IMMUNITY_TYPE_ABILITY_DECREASE
Specifies immunity to effects that decrease abilities.
IMMUNITY_TYPE_AC_DECREASE
Specifies immunity to effects that decrease armor class.
IMMUNITY_TYPE_ATTACK_DECREASE
Specifies immunity to effects that decrease attacks.
IMMUNITY_TYPE_BLINDNESS
Specifies immunity to blindness.
IMMUNITY_TYPE_CHARM
Specifies immunity to charm.
IMMUNITY_TYPE_CONFUSED
Specifies immunity to confusion.
IMMUNITY_TYPE_CRITICAL_HIT
Specifies immunity to critical hits.
IMMUNITY_TYPE_CURSED
Specifies immunity to curses.
IMMUNITY_TYPE_DAMAGE_DECREASE
Specifies immunity to effects that decrease damage.
IMMUNITY_TYPE_DAMAGE_IMMUNITY_DECREASE
Specifies immunity to effects that decrease immunity to damage.
IMMUNITY_TYPE_DAZED
Specifies immunity to daze.
IMMUNITY_TYPE_DEAFNESS
Specifies immunity to deafness.
IMMUNITY_TYPE_DEATH
Specifies immunity to death attacks.
IMMUNITY_TYPE_DISEASE
Specifies immunity to disease.
IMMUNITY_TYPE_DOMINATE
Specifies immunity to domination.
IMMUNITY_TYPE_ENTANGLE
Specifies immunity to entanglement.
IMMUNITY_TYPE_FEAR
Specifies immunity to fear.
IMMUNITY_TYPE_KNOCKDOWN
Specifies immunity to knockdown.
IMMUNITY_TYPE_MIND_SPELLS
Specifies immunity to mind spells.
IMMUNITY_TYPE_MOVEMENT_SPEED_DECREASE
Specifies immunity to effects that decrease movement speed.
IMMUNITY_TYPE_NEGATIVE_LEVEL
Specifies immunity to level drains.
IMMUNITY_TYPE_NONE
Specifies the no immunity.
IMMUNITY_TYPE_PARALYSIS
Specifies immunity to paralysis.
IMMUNITY_TYPE_POISON
Specifies immunity to poison.
IMMUNITY_TYPE_SAVING_THROW_DECREASE
Specifies immunity to effects that decrease saving throws.
IMMUNITY_TYPE_SILENCE
Specifies immunity to silence.
IMMUNITY_TYPE_SKILL_DECREASE
Specifies immunity to effects that decrease skills.
IMMUNITY_TYPE_SLEEP
Specifies immunity to sleep.
IMMUNITY_TYPE_SLOW
Specifies immunity to slow.
IMMUNITY_TYPE_SNEAK_ATTACK
Specifies immunity to sneak attacks.
IMMUNITY_TYPE_SPELL_RESISTANCE_DECREASE
Specifies immunity to effects that decrease spell resistance.
IMMUNITY_TYPE_STUN
Specifies immunity to being stunned.
IMMUNITY_TYPE_TRAP
Specifies immunity to traps.

See Also

functions: EffectImmunity | GetIsImmune


Constant - INVENTORY_DISTURB_TYPE

Home > Reference > Constants > INVENTORY_DISTURB_TYPE_*

INVENTORY_DISTURB_TYPE_* Constant Group

The list of possible ways an inventory can be disturbed.

Constants

Constant Description
INVENTORY_DISTURB_TYPE_ADDED
Indicates that an item was added from an inventory.
INVENTORY_DISTURB_TYPE_REMOVED
Indicates that an item was removed from an inventory.
INVENTORY_DISTURB_TYPE_STOLEN
Indicates that an item was stolen from an inventory.

See Also

functions: GetInventoryDisturbType


Constant - INVENTORY_SLOT

Home > Reference > Constants > INVENTORY_SLOT_*

INVENTORY_SLOT_* Constant Group

Constant group for inventory equipment slots. These are the slots where items are placed when that are equiped (in use), and not the slots where items are just stored.

Constants

Constant Description
INVENTORY_SLOT_ARMS
The gloves or bracers slot in the inventory.
INVENTORY_SLOT_ARROWS
The arrows slot in the inventory. Can have up to 99 arrows stacked.
INVENTORY_SLOT_BELT
The belt slot in the inventory.
INVENTORY_SLOT_BOLTS
The bolts slot in the inventory. Can have up to 99 bolts stacked.
INVENTORY_SLOT_BOOTS
The boots slot in the inventory.
INVENTORY_SLOT_BULLETS
The bullets slot in the inventory. Can have up to 99 bullets stacked.
INVENTORY_SLOT_CARMOUR
Creature skin/hide slot (natural armor).
INVENTORY_SLOT_CHEST
The chest (or main armor) slot in the inventory. Clothes and body armor would go here.
INVENTORY_SLOT_CLOAK
The cloak slot in the inventory.
INVENTORY_SLOT_CWEAPON_B
Creature special attack slot (typically a bite).
INVENTORY_SLOT_CWEAPON_L
Creature's natural left attack (typically a claw).
INVENTORY_SLOT_CWEAPON_R
Creature's natural right attack (typically a claw).
INVENTORY_SLOT_HEAD
The head (or helmet) slot in the inventory.
INVENTORY_SLOT_LEFTHAND
Off-hand weapon slot.
INVENTORY_SLOT_LEFTRING
The left hand ring slot in the inventory.
INVENTORY_SLOT_NECK
The neck (or amulet) slot in the inventory.
INVENTORY_SLOT_RIGHTHAND
Primary weapon slot.
INVENTORY_SLOT_RIGHTRING
The right hand ring slot in the inventory.

See Also

functions: ActionEquipItem | GetItemInSlot


Constant - INVISIBILITY_TYPE

Home > Reference > Constants > INVISIBILITY_TYPE_*

INVISIBILITY_TYPE_* Constant Group

Determines how a creature is protected from the sight of other creatures.

Constants

Constant Description
INVISIBILITY_TYPE_DARKNESS
Miss chance due to darkness.
INVISIBILITY_TYPE_IMPROVED
Under the effects of an Improved Invisibility spell. The creature does not lose invisibility by performing a hostile action.
INVISIBILITY_TYPE_NORMAL
Under the effects of a standard Invisibility spell. When the creature performs a hostile action, it loses its Invisiblity.

See Also

functions: EffectInvisibility


Constant - ITEM_PROPERTY

Home > Reference > Constants > ITEM_PROPERTY_*

ITEM_PROPERTY_* Constant Group

Magical or other properties that can be applied to an item.

Constants

Constant Description
ITEM_PROPERTY_ABILITY_BONUS
Increases one of the six primary ability scores.
ITEM_PROPERTY_AC_BONUS
Grants a bonus to armor class (AC).
ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP
Grants a bonus to armor class (AC) when attacked by a particular alignment group (Lawful, Neutral, Chaotic).
ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE
Grants a bonus to armor class (AC) when attacked by a specific damage type (see DAMAGE_TYPE_* for available damage types).
ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP
Grants a bonus to armor class (AC) when attacked by a member of a particular racial group (see RACIAL_TYPE_* for racial groups).
ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT
Grants a bonus to armor class (AC) when attacked by a specific alignment (Lawful, Neutral, Chaotic; and Good, Neutral, or Evil).
ITEM_PROPERTY_ATTACK_BONUS
Grants the wearer/wielder a bonus to attack rolls.
ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP
Grants the wearer/wielder a bonus to attack rolls against a particular alignment group (Lawful, Neutral, or Chaotic).
ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP
Grants the wearer/wielder a bonus to attack rolls against a particular racial group (see RACIAL_TYPE_* for available racial groups).
ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNEMENT
Grants the wearer/wielder a bonus to attack rolls against a specific alignment group (Lawful, Neutral, Chaotic; and Good, Neutral, or Evil). Note that "alignment" in this constant literally reads "ALIGNEMENT".
ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION
Reduces the weight of the item this property is applied to.
ITEM_PROPERTY_BONUS_FEAT
Grants the wearer/wielder a bonus feat specific to the item.
ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N
Grants the wearer/wielder a bonus spell slot of a specified level, if the wearer/wielder is capable of casting a particular type of magic (divine or arcane).
ITEM_PROPERTY_BOOMERANG
Returns to the owner when thrown, typically applies to thrown missile weapons.
ITEM_PROPERTY_CAST_SPELL
Casts a spell.
ITEM_PROPERTY_DAMAGE_BONUS
Grants a damage bonus (see DAMAGE_BONUS_* for damage bonuses).
ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP
Grants a damage bonus (see DAMAGE_BONUS_* for damage bonuses) against a particular alignment group (Lawful, Neutral, or Chaotic).
ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP
Grants a damage bonus (see DAMAGE_BONUS_* for damage bonuses) against a racial group (see RACIAL_TYPE_* for racial groups).
ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT
Grants a damage bonus (see DAMAGE_BONUS_* for damage bonuses) against a specific alignment (Lawful, Neutral, Chaotic; and Good, Neutral, or Evil).
ITEM_PROPERTY_DAMAGE_REDUCTION
Grants the wearer/wielder damage reduction to a particular damage type (see DAMAGE_TYPE_* for damage types). Note damage reduction can normally be passed by weapons or attacks with certain magical enhancement bonuses.
ITEM_PROPERTY_DAMAGE_RESISTANCE
Grants the weilder/wearer complete immunity to a particular type of damage (see DAMAGE_TYPE_* for damage types).
ITEM_PROPERTY_DAMAGE_VULNERABILITY
Gives the wearer/wielder an inherant weakness to a particular type of damage (see DAMAGE_TYPE_* for damage types).
ITEM_PROPERTY_DANCING
Permits a melee weapon to make attacks on its own, as if animated.
ITEM_PROPERTY_DARKVISION
Grants the wearer/wielder darkvision (ability to see in complete darkness).
ITEM_PROPERTY_DECREASED_ABILITY_SCORE
Gives the wearer/wielder a decreased ability score in one of the six primary abilities. Normally this is the result of a curse.
ITEM_PROPERTY_DECREASED_AC
Gives the wearer/wielder a decreased armor class (AC). Normally this is the result of a curse.
ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER
Gives the wearer/wielder a decreased attack roll modifier. This is normally due to a curse.
ITEM_PROPERTY_DECREASED_DAMAGE
Causes the item, typically a weapon (missile or melee), to inflict decreased damage. Normally cursed items have decreased damage, but damaged, worn, or ruined items may also be affected by this property.
ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER
Usually denotes a cursed item by applying some sort of negative modifier to an item, typically a weapon (missile or melee).
ITEM_PROPERTY_DECREASED_SAVING_THROWS
Gives the wearer/wielder a general decrease to all three types of saving throws. This is normally the effect of a curse.
ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC
Gives the wearer/wielder a general decrease to a specific type of saving throw (Fortitude, Reflex, Will). This is normally the effect of a curse.
ITEM_PROPERTY_DECREASED_SKILL_MODIFIER
Gives the wearer/wielder a decreased skill modifier to a particular skill. Normally this is the result of a curse.
ITEM_PROPERTY_DOUBLE_STACK
Allows items to be stacked in inventory.
ITEM_PROPERTY_ENHANCED_CONTAINER_BONUS_SLOTS
Grants a magical container bonus slots for carrying additional gear.
ITEM_PROPERTY_ENHANCED_CONTAINER_REDUCED_WEIGHT
Grants a magical container reduced overall weight for making heavy things easier to carry.
ITEM_PROPERTY_ENHANCMENT_BONUS
Grants an enhancement bonus to an item, typically a weapon (missile or melee).
ITEM_PROPERTY_ENHANCMENT_BONUS_VS_ALIGNMENT_GROUP
Grants an enhancement bonus to an item, typically a weapon (missile or melee), against a particular alignment group (Lawful, Neutral, Chaotic).
ITEM_PROPERTY_ENHANCMENT_BONUS_VS_RACIAL_GROUP
Grants an enhancement bonus to an item, typically a weapon (missile or melee), against a particular racial group (see RACIAL_TYPE_* for a racial groups).
ITEM_PROPERTY_ENHANCMENT_BONUS_VS_SPECIFIC_ALIGNMENT
Grants an enhancement bonus to an item, typically a weapon (missile or melee), against a specific alignment combination (Lawful, Neutral, Chaotic; and Good, Neutral, or Evil).
ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE
Extra damage type dealt with a melee weapon (see DAMAGE_TYPE_* for available damage types).
ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE
Extra damage type dealt with a missile weapon (see DAMAGE_TYPE_* for available damage types).
ITEM_PROPERTY_FREEDOM_OF_MOVEMENT
Grants the wearer/wielder the ability to move freely in environments that restrict movements (like that of an area effected by a Web or Entangle spell).
ITEM_PROPERTY_HASTE
Grants the wearer/wielder the benefits of a Haste spell (allows an extra partial action every round (six seconds)).
ITEM_PROPERTY_HOLY_AVENGER
Oh, the destruction that can be wrought when found in the hands of a paladin...
ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE
Grants the wearer/wielder immunity to a particular damage type (see DAMAGE_TYPE_* for damage types).
ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS
Grants a miscellaneous immunity (effect unknown).
ITEM_PROPERTY_IMMUNITY_SPECIFIC_SCHOOL
Grants the wearer/wielder immunity to a specific school of spells.
ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL
Grants the wearer/wielder immunity to a specific spell.
ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL
Grants the wearer/wielder immunity to all spells of a particular level.
ITEM_PROPERTY_IMPROVED_EVASION
Grants the wearer/wielder the improved evasion special ability (allows them to completely avoid area of effect spells on a successful saving throw, half damage on a failed save, and avoid traps that require reflex saves).
ITEM_PROPERTY_KEEN
Doubles the threat range of a piercing or slashing weapon.
ITEM_PROPERTY_LIGHT
Generates light.
ITEM_PROPERTY_MASSIVE_CRITICALS
Unknown. Speculation: A weapon with this property deals maximum damage on a successful critical hit.
ITEM_PROPERTY_MIGHTY
Causes a ranged weapon, usually a short bow or long bow, to permit the weilder's Strength modifier to damage due to extra powerful stringing.
ITEM_PROPERTY_MIND_BLANK
Unknown. Speculation: causes a creature struck to lose a randomly selected spell or daily spell use.
ITEM_PROPERTY_MONSTER_DAMAGE
Unknown.
ITEM_PROPERTY_NO_DAMAGE
When applied to a weapon (missile or melee) that weapon does not inflict damage.
ITEM_PROPERTY_ON_HIT_PROPERTIES
Unknown.
ITEM_PROPERTY_ON_MONSTER_HIT
Unknown.
ITEM_PROPERTY_POISON
Weapons (missile or melee) with this property also inflict poison on a successful hit.
ITEM_PROPERTY_REGENERATION
Grants the wearer/wielder hit point regeneration.
ITEM_PROPERTY_REGENERATION_VAMPIRIC
Grants the wearer/wielder hit point regeneration equal to the damage inflicted by an attack with a weapon (melee or missile) with this property.
ITEM_PROPERTY_SAVING_THROW_BONUS
Grants the wearer/wielder a general bonus to all three types of saving throws.
ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC
Grants the wearer/wielder a general bonus to a specify type of saving throw (Fortitude, Reflex, Will).
ITEM_PROPERTY_SKILL_BONUS
Grants the wearer/wielder a bonus to a particular skill.
ITEM_PROPERTY_SPELL_RESISTANCE
Grants the wearer/wielder spell resistance to a specified degree.
ITEM_PROPERTY_THIEVES_TOOLS
Marks an item as thieves tools used for opening locks and disarming traps.
ITEM_PROPERTY_TRAP
Denotes an item as a trap that can be placed.
ITEM_PROPERTY_TRUE_SEEING
Grants the wearer/wielder the benefits of a True Seeing spell (see invisible or magically concealed creatures).
ITEM_PROPERTY_TURN_RESISTANCE
Grants the wearer/wielder additional turn resistance.
ITEM_PROPERTY_UNLIMITED_AMMUNITION
Grants the wearer/wielder unlimited ammunition with a missile weapon that requires ammunition.
ITEM_PROPERTY_USE_LIMITATION_ALIGNMENT_GROUP
Restricts the use of a particular item to a particular alignment group (Lawful, Neutral, or Chaotic).
ITEM_PROPERTY_USE_LIMITATION_CLASS
Restricts the use of a particular item to a specific class (see CLASS_TYPE_* for available classes).
ITEM_PROPERTY_USE_LIMITATION_RACIAL_TYPE
Restricts the use of a particular item to a particular racial group (see RACIAL_TYPE_* for available racial groups).
ITEM_PROPERTY_USE_LIMITATION_SPECIFIC_ALIGNMENT
Restricts the use of a particular item to a specific alignment (Lawful, Neutral, Chaotic; Good, Neutral, or Evil).
ITEM_PROPERTY_USE_LIMITATION_TILESET
Restricts the use of a particular item to a particular tileset (for example, an item may only be used while underground in the "Mines and Caverns" tileset).
ITEM_PROPERTY_VORPAL
Causes a slashing weapon to decapitate an opponent on a high natural attack roll.
ITEM_PROPERTY_WOUNDING
Causes a weapon to inflict wounds upon an opponent that continue to deal 1 point of damage per wound until magically healed (multiple wounds are cumulative).

See Also

functions: GetItemHasItemProperty


Constant - METAMAGIC

Home > Reference > Constants > METAMAGIC_*

METAMAGIC_* Constant Group

Metamagic feats applied to a spell.

Constants

Constant Description
METAMAGIC_ANY
Any metamagic spell effect (empower, extend, maximize, quicken, silent, still).
METAMAGIC_EMPOWER
All variable, numeric effects of an empowered spell are increased by one-half. An empowered spell uses up a spell slot two levels higher than the shell's actual level.
METAMAGIC_EXTEND
An extended spell lasts twice as long as normal. An extended spell uses up a spell slot one level higher than the spell's actual level.
METAMAGIC_MAXIMIZE
All variable, numeric effects of a maximized spell are maximized. A maximized spell uses up a spell slot three levels higher than the spell's actual level.
METAMAGIC_NONE
No metamagic feats attached to the spell.
METAMAGIC_QUICKEN
Casting a quickened spell is a free action. A quickened spell uses up a spell slot four levels higher than the spell's actual level.
METAMAGIC_SILENT
A silent spell can be cast with no verbal components. A silent spell uses up a spell slot one level higher than the spell's actual level.
METAMAGIC_STILL
A still spell can be cast with no somatic components. A still spell uses up a spell slot one level higher than the spell's actual level.

See Also

functions: ActionCastSpellAtLocation | ActionCastSpellAtObject | GetMetaMagicFeat


Constant - NW_ASC

Home > Reference > Constants > NW_ASC_*

NW_ASC_* Constant Group

Covers miscellaneous skills and settings not categorized into other subgroups.

Constants

Constant Description
NW_ASC_DISARM_TRAPS
Causes the NPC associate to automatically disarm traps that are spotted by the NPC or associated master.
NW_ASC_HAVE_MASTER
Used to determine if an NPC associate currently has a master.
NW_ASC_IS_BUSY
Used to determine if an NPC associate is currently busy. Busy only occurs when they are bashing or picking a lock.
NW_ASC_MASTER_GONE
UNKNOWN
NW_ASC_MASTER_REVOKED
UNKNOWN
NW_ASC_MODE_DEFEND_MASTER
Used to set the NPC associate to guard the master. AttackNearest removes this setting if it is set.
NW_ASC_MODE_STAND_GROUND
Causes the NPC associate to ignore move to object during the OnHeartbeat event. If this is set to false, the NPC associate is in follow mode.
NW_ASC_OVERKILL_CASTING
Causes the NPC associate to use the maximum combat rating spell currently available at their current level.
NW_ASC_POWER_CASTING
Causes the NPC associate to use double combat rating spells, if available.
NW_ASC_RETRY_OPEN_LOCKS
Automatically forces the NPC associate to retry opening a failed open lock attempt by the master ("I can pick that in no time!; Aye, its done!").
NW_ASC_SCALED_CASTING
Causes the NPC associate to use spells at combat rating plus 4 (CR + 4), if available.
NW_ASC_USE_CUSTOM_DIALOGUE
Causes the NPC associate to use a specified custom dialogue conversation script.
NW_ASC_USE_RANGED_WEAPON
Causes the NPC associate to use ranged weapons instead of melee attacks. When setting this state, its also probably a good idea to enable NW_ASC_DISTANCE_6_METERS for following distance.

See Also

functions: GetAssociateState | SetAssociateState


Constant - NW_ASC_AGRESSIVE

Home > Reference > Constants > NW_ASC_AGRESSIVE_*

NW_ASC_AGRESSIVE_* Constant Group

Determines what skills or abilities an NPC associate uses automatically.

Constants

Constant Description
NW_ASC_AGRESSIVE_BUFF
Benefits the master by bestowing spells or effects that increase hit points, blesses, or otherwise buffs.
NW_ASC_AGRESSIVE_SEARCH
Constantly search for traps in the immediate area.
NW_ASC_AGRESSIVE_STEALTH
Always move silently and hide in the shadows for sneak attacks.

See Also

Send comments on this topic.


Constant - NW_ASC_DISTANCE

Home > Reference > Constants > NW_ASC_DISTANCE_*

NW_ASC_DISTANCE_* Constant Group

Determines the distance, in meters, the NPC associate follows the PC at.

Constants

Constant Description
NW_ASC_DISTANCE_2_METERS
Follow at 2 meters.
NW_ASC_DISTANCE_4_METERS
Follow at 4 meters.
NW_ASC_DISTANCE_6_METERS
Follow at 6 meters.

See Also

functions: GetFollowDistance


Constant - NW_ASC_HEAL_AT

Home > Reference > Constants > NW_ASC_HEAL_AT_*

NW_ASC_HEAL_AT_* Constant Group

Used to determine at which percentage of the master's hit points an NPC associate should attempt to heal the master.

Constants

Constant Description
NW_ASC_HEAL_AT_25
Heal master at 25% or less hit points of total.
NW_ASC_HEAL_AT_50
Heal master at 50% or less hit points of total.
NW_ASC_HEAL_AT_75
Heal master at 75% or less hit points of total.

See Also

functions: GetAssociateHealMaster


Constant - NW_FLAG

Home > Reference > Constants > NW_FLAG_*

NW_FLAG_* Constant Group

Used to cause events to fire various numeric signals to OnUserDefined and set other attributes of a creature during the OnSpawn script using SetSpawnInCondition. The OnUserDefined event can thus be used to customize the behavior of an object without actually modifying the default behavior.

Constants

Constant Description
NW_FLAG_AMBIENT_ANIMATIONS
This will cause the NPC to play ambient animations until the NPC sees an enemy or is cleared. These animations will play automatically for encounter creatures.
NW_FLAG_AMBIENT_ANIMATIONS_AVIAN
Causes the NPC to play avian ambient animations.
NW_FLAG_APPEAR_SPAWN_IN_ANIMATION
Causes a spawn in animation to occur when the NPC spawns in.
NW_FLAG_ATTACK_EVENT
Used to fire OnUserDefined event signal 1005.
NW_FLAG_DAMAGED_EVENT
Used to fire OnUserDefined event signal 1006.
NW_FLAG_DAY_NIGHT_POSTING
Causes the NPC to act appropriately for the time of the day. SetSpawnInCondition(NW_FLAG_SLEEPING_AT_NIGHT) to cause the NPC to sleep at night (40% chance) and walk a set of waypoints during the day.
NW_FLAG_DEATH_EVENT
Used to fire OnUserDefined event signal 1007.
NW_FLAG_DISTURBED_EVENT
Used to fire OnUserDefined event signal 1008.
NW_FLAG_END_COMBAT_ROUND_EVENT
Used to fire OnUserDefined event signal 1003.
NW_FLAG_ESCAPE_LEAVE
Flee to a waypoint and do not return.
NW_FLAG_ESCAPE_RETURN
Causes the creature to flee to a waypoint and return a short time later.
NW_FLAG_FAST_BUFF_ENEMY
This means that the creature will cast all the buff spells (summons, stat and armor improvements etc) instantaneously in preperation for combat. Note: If TalentAdvancedBuff(40.0) returns TRUE, this flag is automatically disabled.
NW_FLAG_HEARTBEAT_EVENT
Used to fire OnUserDefined event signal 1001.
NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS
This will cause the NPC to play immobile ambient animations until the NPC sees an enemy or is cleared. These animations will play automatically for encounter creatures.
NW_FLAG_ON_DIALOGUE_EVENT
Used to fire OnUserDefined event signal 1004.
NW_FLAG_PERCIEVE_EVENT
Used to fire OnUserDefined event signal 1002.
NW_FLAG_RESTED_EVENT
Used to fire OnUserDefined event signal (UNKNOWN).
NW_FLAG_SEARCH
If the creature has search, it goes into search mode.
NW_FLAG_SHOUT_ATTACK_MY_TARGET
Sets the listening pattern on the NPC to attack when allies call.
NW_FLAG_SLEEPING_AT_NIGHT
Determines if the NPC sleeps at night. Use in conjuction with SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING) to cause the NPC to sleep at night (40% chance) or walk a set of waypoints during the day.
NW_FLAG_SPECIAL_COMBAT_CONVERSATION
This causes the NPC to say a special greeting in their conversation file upon perceiving the player (OnPerceive event). Attach the [NW_D2_GenCheck.nss] script to the desired greeting in order to designate it. As the NPC is actually saying this to himself, don't attach any player responses to the greeting.
NW_FLAG_SPECIAL_CONVERSATION
This causes the NPC to say a special greeting in their conversation file upon perceiving the player (OnPerceive event). Attach the [NW_D2_GenCheck.nss] script to the desired greeting in order to designate it. As the NPC is actually saying this to himself, don't attach any player responses to the greeting.
NW_FLAG_SPELL_CAST_AT_EVENT
Used to fire OnUserDefined event signal 1011.
NW_FLAG_STEALTH
If the NPC has stealth and they are a rogue, they go into stealth mode.
NW_FLAG_TELEPORT_LEAVE
Teleport to safety and do no return.
NW_FLAG_TELEPORT_RETURN
Teleport to safety and return a short time later.

See Also

functions: ActivateFleeToExit | CheckWayPoints | GetSpawnInCondition | SetSpawnInCondition | SetSpawnInLocals


Constant - NW_FLAG_BEHAVIOR

Home > Reference > Constants > NW_FLAG_BEHAVIOR_*

NW_FLAG_BEHAVIOR_* Constant Group

Determines how an NPC reacts, irregardless of faction. "NW_I0_GENERIC" must be included to use these constants (include "NW_I0_GENERIC using the #include compiler directive).

Constants

Constant Description
NW_FLAG_BEHAVIOR_CARNIVORE
The NPC will always attack regardless of faction.
NW_FLAG_BEHAVIOR_HERBIVORE
The NPC will never attack and will always flee.
NW_FLAG_BEHAVIOR_OMNIVORE
The NPC will only attack if approached.
NW_FLAG_BEHAVIOR_SPECIAL
UNKNOWN

See Also

functions: DetermineSpecialBehavior | GetBehaviorState | SetBehaviorState


Constant - OBJECT_TYPE

Home > Reference > Constants > OBJECT_TYPE_*

OBJECT_TYPE_* Constant Group

Used to categorize types of objects.

Constants

Constant Description
OBJECT_TYPE_ALL
Specifies all objects. Used for unrestricted searches. Strangely, OBJECT_TYPE_ALL and OBJECT_TYPE_INVALID equal the same value.
OBJECT_TYPE_AREA_OF_EFFECT
Specifies the object is an area of effect (AOE).
OBJECT_TYPE_CREATURE
Specifies the object is a creature (PC, animal, monster etc).
OBJECT_TYPE_DOOR
Specifies the object is a door.
OBJECT_TYPE_INVALID
Specifies the object is invalid. Strangely, OBJECT_TYPE_INVALID and OBJECT_TYPE_ALL equal the same value.
OBJECT_TYPE_ITEM
Specifies the object is an item.
OBJECT_TYPE_PLACEABLE
Specifies the object is a placeable.
OBJECT_TYPE_STORE
Specifies the object is a store.
OBJECT_TYPE_TRIGGER
Specifies the object is a trigger.
OBJECT_TYPE_WAYPOINT
Specifies the object is a waypoint.

See Also

functions: CreateObject | CreateObjectVoid | GetFirstInPersistentObject | GetFirstObjectInShape | GetNearestObject | GetNearestObjectToLocation | GetNextInPersistentObject | GetNextObjectInShape | GetObjectType | SpeakOneLinerConversation


Constant - PANEL_BUTTON

Home > Reference > Constants > PANEL_BUTTON_*

PANEL_BUTTON_* Constant Group

Client panel buttons including character sheet, inventory, journal, map, options, player vs player, resting and spellbook.

Constants

Constant Description
PANEL_BUTTON_CHARACTER
Character sheet panel button.
PANEL_BUTTON_INVENTORY
Inventory panel button.
PANEL_BUTTON_JOURNAL
Quest journal panel button.
PANEL_BUTTON_MAP
Map panel button.
PANEL_BUTTON_OPTIONS
Game options panel button.
PANEL_BUTTON_PLAYER_VERSUS_PLAYER
Player versus player panel button.
PANEL_BUTTON_REST
Resting panel button.
PANEL_BUTTON_SPELLS
Spellbook panel button.

See Also

functions: SetPanelButtonFlash


Constant - PERCEPTION

Home > Reference > Constants > PERCEPTION_*

PERCEPTION_* Constant Group

Determines if a creature perceives another creature using its Spot skill vs. the other creature's Hide skill and its Listen skill vs. the other creature's Move Silently skill.

Constants

Constant Description
PERCEPTION_HEARD
Heard (Listen beats Move Silently), no line of sight.
PERCEPTION_HEARD_AND_NOT_SEEN
Heard only (Hide beats Spot, Listen beats Move Silently). Usually arouses suspicion for a creature to take a closer look.
PERCEPTION_NOT_HEARD
Not heard (Move Silently beats Listen), no line of sight.
PERCEPTION_NOT_SEEN
Not seen (Hide beats Spot), too far away to heard or magically silcenced.
PERCEPTION_NOT_SEEN_AND_NOT_HEARD
Neither seen nor heard (Hide beats Spot, Move Silently beats Listen).
PERCEPTION_SEEN
Seen (Spot beats Hide), too far away to heard or magically silcenced.
PERCEPTION_SEEN_AND_HEARD
Both seen and heard (Spot beats Hide, Listen beats Move Silently).
PERCEPTION_SEEN_AND_NOT_HEARD
Seen only (Spot beats Hide, Move Silently beats Listen). Usually causes a creature to take instant notice.

See Also

Send comments on this topic.


Constant - PERSISTENT_ZONE

Home > Reference > Constants > PERSISTENT_ZONE_*

PERSISTENT_ZONE_* Constant Group

Used with GetFirstInPersistentObject() and GetNextInPersistentObject() functions.

Constants

Constant Description
PERSISTENT_ZONE_ACTIVE
Unknown.
PERSISTENT_ZONE_FOLLOW
Unknown.

See Also

functions: GetFirstInPersistentObject | GetNextInPersistentObject


Constant - PLACEABLE_ACTION

Home > Reference > Constants > PLACEABLE_ACTION_*

PLACEABLE_ACTION_* Constant Group

Actions that can be performed on placeable objects.

Constants

Constant Description
PLACEABLE_ACTION_BASH
Refers to the "Bash" action on placeable objects.
PLACEABLE_ACTION_KNOCK
Refers to the "Knock" action on placeable objects.
PLACEABLE_ACTION_UNLOCK
Refers to the "Unlock" action on placeable objects.
PLACEABLE_ACTION_USE
Refers to the "Use" action on placeable objects.

See Also

functions: DoPlaceableObjectAction | GetIsPlaceableObjectActionPossible


Constant - PLAYER_CHAR

Home > Reference > Constants > PLAYER_CHAR_*

PLAYER_CHAR_* Constant Group

Used for testing if a PC is actually controlled by a player.

Constants

Constant Description
PLAYER_CHAR_IS_PC
Same as TRUE.
PLAYER_CHAR_NOT_PC
Same as FALSE.

See Also

functions: GetNearestCreature | GetNearestCreatureToLocation


Constant - POISON

Home > Reference > Constants > POISON_*

POISON_* Constant Group

This constant group defines the many in game poisons.

Constants

Constant Description
POISON_ARANEA_VENOM
Aranea Venom. Initial Save DC: 13 Initial Effect: Lowers STR by 1D6. Secondary Effect: Lowers STR by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_ARSENIC
Arsenic Poison. Initial Save DC: 13 Initial Effect: Lowers CON by 1. Secondary Effect: Lowers CON by 2D8. Visual Effect: VFX_IMP_POISON_L
POISON_BEBILITH_VENOM
Bebilith Venom. Initial Save DC: 20 Initial Effect: Lowers CON by 1D6. Secondary Effect: Lowers CON by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_BLACK_ADDER_VENOM
Black Adder Venom. Initial Save DC: 12 Initial Effect: Nothing Secondary Effect: Lowers STR by 1D6. Visual Effect: VFX_IMP_POISON_S
POISON_BLACK_LOTUS_EXTRACT
Black Lotus Extract Poison. Initial Save DC: 20 Initial Effect: Lowers CON by 3D6. Secondary Effect: Lowers CON by 3D6. Visual Effect: VFX_IMP_POISON_L
POISON_BLADE_BANE
Blade Bane Poison. Initial Save DC: 15 Initial Effect: Lowers STR by 1D4. Secondary Effect: Lowers CON by 1D2. Visual Effect: VFX_IMP_POISON_S
POISON_BLOODROOT
Bloodroot Poison. Initial Save DC: 12 Initial Effect: Lowers WIS by 1D3. Secondary Effect: Lowers CON by 1D4. Visual Effect: VFX_IMP_POISON_S
POISON_BLUE_WHINNIS
Blue Whinnis Poison. Initial Save DC: 14 Initial Effect: Lowers CON by 1. Secondary Effect: Puts the target to sleep for 10 rounds. Visual Effect: VFX_IMP_POISON_S
POISON_BURNT_OTHUR_FUMES
Burnt Othur Fumes Poison. Initial Save DC: 18 Initial Effect: Lowers CON by 1 permanently. Secondary Effect: Lowers CON by 3D6. Visual Effects: VFX_IMP_REDUCE_ABILITY_SCORE, VFX_IMP_POISON_L
POISON_CARRION_CRAWLER_BRAIN_JUICE
Carrion Crawler Brain Juice Poison. Initial Save DC: 13 Initial Effect: Paralyzation. Secondary Effect: Nothing. Visual Effects: VFX_DUR_PARALYZED, VFX_IMP_POISON_S
POISON_CHAOS_MIST
Chaos Mist Poison. Initial Save DC: 15 Initial Effect: Lowers WIS by 1D4. Secondary Effect: Lowers WIS by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_COLOSSAL_SPIDER_VENOM
Colossal Spider Venom. Initial Save DC: 35 Initial Effect: Lowers STR by 2D8. Secondary Effect: Lowers STR by 2D8. Visual Effect: VFX_IMP_POISON_L
POISON_DARK_REAVER_POWDER
Dark ReaverPowder Poison. Initial Save DC: 18 Initial Effect: Lowers CON by 2D6. Secondary Effect: Lowers CON by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_DEATHBLADE
Deathblade Poison. Initial Save DC: 20 Initial Effect: Lowers CON by 1D6. Secondary Effect: Lowers CON by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_DRAGON_BILE
Dragon Bile Poison. Initial Save DC: 26 Initial Effect: Lowers STR by 3D6. Secondary Effect: Nothing. Visual Effect: VFX_IMP_POISON_L
POISON_ETTERCAP_VENOM
Ettercap Venom. Initial Save DC: 13 Initial Effect: Lowers DEX by 1D6. Secondary Effect: Lowers DEX by 2D4. Visual Effect: VFX_IMP_POISON_L
POISON_GARGANTUAN_SPIDER_VENOM
Gargantuan Spider Venom. Initial Save DC: 36 Initial Effect: Lowers STR by 2D6. Secondary Effect: Lowers STR by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_GIANT_WASP_POISON
Giant Wasp Poison. Initial Save DC: 18 Initial Effect: Lowers DEX by 1D6. Secondary Effect: Lowers DEX by 1D6. Visual Effect: VFX_IMP_POISON_L
POISON_GREENBLOOD_OIL
Greenblood Oil Poison. Initial Save DC: 13 Initial Effect: Lowers CON by 1. Secondary Effect: Lowers CON by 1D2. Visual Effect: VFX_IMP_POISON_S
POISON_HUGE_SPIDER_VENOM
Huge Spider Venom. Initial Save DC: 26 Initial Effect: Lowers STR by 1D8. Secondary Effect: Lowers STR by 2D8. Visual Effect: VFX_IMP_POISON_L
POISON_ID_MOSS
Id Moss Poison. Initial Save DC: 14 Initial Effect: Lowers INT by 1D4. Secondary Effect: Lowers INT by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_IRON_GOLEM
Iron Golem Fumes. Initial Save DC: 17 Initial Effect: Lowers CON by 1D4. Secondary Effect: Causes Death in the target. Visual Effect: VFX_IMP_POISON_L
POISON_LARGE_SCORPION_VENOM
Large Scorpion Venom. Initial Save DC: 18 Initial Effect: Lowers STR by 1D6. Secondary Effect: Lowers STR by 1D6. Visual Effect: VFX_IMP_POISON_S
POISON_LARGE_SPIDER_VENOM
Large Spider Venom. Initial Save DC: 18 Initial Effect: Lowers STR by 1D6. Secondary Effect: Lowers STR by 1D6. Visual Effect: VFX_IMP_POISON_L
POISON_LICH_DUST
Lich Dust Poison. Initial Save DC: 17 Initial Effect: Lowers STR by 2D6. Secondary Effect: Lowers STR by 1D6. Visual Effect: VFX_IMP_POISON_L
POISON_MALYSS_ROOT_PASTE
Malyss Root Paste Poison. Initial Save DC: 16 Initial Effect: Lowers DEX by 1. Secondary Effect: Lowers DEX by 2D4. Visual Effect: VFX_IMP_POISON_S
POISON_MEDIUM_SPIDER_VENOM
Medium Spider Venom. Initial Save DC: 14 Initial Effect: Lowers STR by 1D4. Secondary Effect: Lowers STR by 1D4. Visual Effect: VFX_IMP_POISON_L
POISON_NIGHTSHADE
Nightshade poison. Initial Save DC: 10 Initial Effect: Lowers DEX by 1. Secondary Effect: Lowers DEX by 1D2.
POISON_NITHARIT
Nitharit Poison. Initial Save DC: 13 Initial Effect: Nothing. Secondary Effect: Lowers CON by 3D6. Visual Effect: VFX_IMP_POISON_L
POISON_OIL_OF_TAGGIT
Oil of Taggit Poison. Initial Save DC: 15 Initial Effect: Nothing. Secondary Effect: Puts target to sleep for 10 rounds. Visual Effect: VFX_IMP_POISON_S
POISON_PHASE_SPIDER_VENOM
Phase Spider Venom. Initial Save DC: 15 Initial Effect: Lowers CON by 2D6. Secondary Effect: Lowers CON by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_PIT_FIEND_ICHOR
Pit Fiend Ichor Poison. Initial Save DC: 21 Initial Effect: Lowers CON by 3D6. Secondary Effect: Causes Death to the target. Visual Effects: VFX_IMP_DEATH, VFX_IMP_POISON_L
POISON_PURPLE_WORM_POISON
Purple Worm Poison. Initial Save DC: 24 Initial Effect: Lowers STR by 1D6. Secondary Effect: Lowers STR by 1D6. Visual Effect: VFX_IMP_POISON_S
POISON_QUASIT_VENOM
Quasit Venom. Initial Save DC: 13 Initial Effect: Lowers DEX by 1D4. Secondary Effect: Lowers DEX by 2D4. Visual Effect: VFX_IMP_POISON_L
POISON_SASSONE_LEAF_RESIDUE
Sassone Leaf Residue Poison. Initial Save DC: 16 Initial Effect: 2D12 Acid damage. Secondary Effect: Lowers CON by 1D6. Visual Effect: VFX_IMP_POISON_S
POISON_SHADOW_ESSENCE
Shadow Essence Poison. Initial Save DC: 17 Initial Effect: Lowers STR by 1 permanently. Secondary Effect: Lowers STR by 2D6. Visual Effects: VFX_IMP_REDUCE_ABILITY_SCORE, VFX_IMP_POISON_S
POISON_SMALL_CENTIPEDE_POISON
Small Centipede Poison. Initial Save DC: 11 Initial Effect: Lowers DEX by 1D2. Secondary Effect: Lowers DEX by 1D2. Visual Effect: VFX_IMP_POISON_S
POISON_SMALL_SPIDER_VENOM
Small Spider Venom. Initial Save DC: 11 Initial Effect: Lowers STR by 1D3. Secondary Effect: Lowers STR by 1D3. Visual Effect: VFX_IMP_POISON_L
POISON_STRIPED_TOADSTOOL
Striped Toadstool Poison. Initial Save DC: 11 Initial Effect: Lowers WIS by 1. Secondary Effect: Lowers WIS by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_TERINAV_ROOT
Terinav Root Poison. Initial Save DC: 16 Initial Effect: Lowers DEX by 1D6. Secondary Effect: Lowers DEX by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_TINY_SPIDER_VENOM
Tiny Spider Venom. Initial Save DC: 11 Initial Effect: Lowers STR by 1D2. Secondary Effect: Lowers STR by 1D2. Visual Effect: VFX_IMP_POISON_L
POISON_UNGOL_DUST
Ungol Dust Poison. Initial Save DC: 15 Initial Effect: Lowers CHA by 1. Secondary Effect: Lowers CHA by 1D6. Visual Effect: VFX_IMP_POISON_L
POISON_WRAITH_SPIDER_VENOM
Wraith Spider Venom. Initial Save DC: 26 Initial Effect: Lowers CON by 1D6. Secondary Effect: Lowers STR by 2D6. Visual Effect: VFX_IMP_POISON_L
POISON_WYVERN_POISON
Wyvern Poison. Initial Save DC: 17 Initial Effect: Lowers CON by 2D6. Secondary Effect: Lowers CON by 2D6. Visual Effect: VFX_IMP_POISON_L

See Also

functions: EffectPoison


Constant - POLYMORPH_TYPE

Home > Reference > Constants > POLYMORPH_TYPE_*

POLYMORPH_TYPE_* Constant Group

These constants define the properties applied to targets when they are polymorphed into different creatures.

Constants

Constant Description
POLYMORPH_TYPE_BADGER
Badger Properties Racial Type: Animal STR: 16 CON: 16 DEX: 16 Natural AC Bonus: 0 Hit Point Bonus: 10 Creature Weapon 1: Claw1d2 Monster Damage 1d2 Damage Creature Weapon 2: Claw1d2 Monster Damage 1d2 Damage Creature Weapon 3: Bite1d3 Monster Damage 1d3 Damage
POLYMORPH_TYPE_BALOR
Balor Properties Racial Type: Outsider STR: 24 CON: 24 DEX: 30 Natural AC Bonus: 10 Hit Point Bonus: 250 Creature Weapon 1: Balor Slam Monster Damage 1d6 Damage On Monster Hit: Fear Creature Hide: Balor Properties Damage Resistance: Acid Resist 20 / - Damage Resistance: Cold Resist 20 / - Damage Resistance: Fire Resist 20 / - Immunity: Damage Type: Electrical 100% Immunity Bonus Immunity: Miscellaneous: Poison Spell Resistance 28
POLYMORPH_TYPE_BOAR
Boar Properties Racial Type: Animal STR: 18 CON: 12 DEX: 18 Natural AC Bonus: 3 Hit Point Bonus: 10 Creature Weapon 3: Gore1d8 Monster Damage 1d8 Damage
POLYMORPH_TYPE_BROWN_BEAR
Brown Bear Properties Racial Type: Animal STR: 20 CON: 16 DEX: 12 Natural AC Bonus: 5 Hit Point Bonus: 10 Creature Weapon 1: Claw1d8 Monster Damage 1d8 Damage Creature Weapon 2: Claw1d8 Monster Damage 1d8 Damage Creature Weapon 3: Bite2d8 Monster Damage 2d8 Damage
POLYMORPH_TYPE_COW
Cow Properties Racial Type: Animal STR: 0 CON: 0 DEX: 0 Natural AC Bonus: 0 Hit Point Bonus: 0 Creature Weapon 3: Gore1d8 Monster Damage 1d8 Damage
POLYMORPH_TYPE_DEATH_SLAAD
Death Slaad Properties Racial Type: Outsider STR: 24 CON: 24 DEX: 36 Natural AC Bonus: 10 Hit Point Bonus: 225 Creature Weapon 1: Claw3d6 Monster Damage 3d6 Damage Creature Weapon 2: Claw3d6 Monster Damage 3d6 Damage Creature Weapon 3: Bite2d10 Monster Damage 2d10 Damage Creature Hide: Death Slaad Properties Damage Reduction: +2 Soak 20 Damage Damage Resistance: Acid Resist 5 / - Damage Resistance: Cold Resist 5 / - Damage Resistance: Electrical Resist 5 / - Damage Resistance: Fire Resist 5 / - Damage Resistance: Sonic Resist 5 / - Regeneration +5
POLYMORPH_TYPE_DOOM_KNIGHT
Doom Knight Properties Racial Type: Elf STR: 20 CON: 20 DEX: 20 Natural AC Bonus: 4 Hit Point Bonus: 0 Creature Hide: Doom Knight Properties Damage Reduction: +1 Soak 15 Damage Immunity: Miscellaneous: Critical Hits Immunity: Miscellaneous: Death Magic Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Level/Ability Drain Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack Spell Resistance 12
POLYMORPH_TYPE_ELDER_AIR_ELEMENTAL
Elder Air Elemental Properties Racial Type: Outsider STR: 22 CON: 33 DEX: 18 Natural AC Bonus: 8 Hit Point Bonus: 0 Creature Weapon 1: Slam2d8 Monster Damage 2d8 Damage Creature Hide: Elder Elemental Properties Damage Reduction: +3 Soak 15 Damage Immunity: Miscellaneous: Critical Hits Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack
POLYMORPH_TYPE_ELDER_EARTH_ELEMENTAL
Elder Earth Elemental Properties Racial Type: Outsider STR: 33 CON: 8 DEX: 21 Natural AC Bonus: 15 Hit Point Bonus: 0 Creature Weapon 1: Slam2d10 Monster Damage 2d10 Damage Creature Hide: Elder Elemental Properties Damage Reduction: +3 Soak 15 Damage Immunity: Miscellaneous: Critical Hits Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack
POLYMORPH_TYPE_ELDER_FIRE_ELEMENTAL
Elder Fire Elemental Properties Racial Type: Outsider STR: 22 CON: 29 DEX: 18 Natural AC Bonus: 8 Hit Point Bonus: 0 Creature Weapon 1: Elder/Greater/Huge Fire Elemental Slam Damage Bonus: Fire 1d8 Damage Damage Bonus: Fire 1d8 Damage Monster Damage 2d8 Damage Creature Hide: Elder Fire Elemental Properties Immunity: Miscellaneous: Critical Hits Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack
POLYMORPH_TYPE_ELDER_WATER_ELEMENTAL
Elder Water Elemental Properties Racial Type: Outsider STR: 28 CON: 22 DEX: 21 Natural AC Bonus: 9 Hit Point Bonus: 0 Creature Weapon 1: Slam2d10 Monster Damage 2d10 Damage Creature Hide: Elder Water Elemental Properties Immunity: Miscellaneous: Critical Hits Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack
POLYMORPH_TYPE_FIRE_GIANT
Fire Giant Properties Racial Type: Giant STR: 30 CON: 21 DEX: 30 Natural AC Bonus: 10 Hit Point Bonus: 200 Creature Weapon 1: Slam2d10 Monster Damage 2d10 Damage Creature Hide: Fire Giant/Hellhound Properties Damage Vulnerability: Cold 50% Damage Vulnerability Immunity: Damage Type: Fire 100% Immunity Bonus
POLYMORPH_TYPE_GIANT_SPIDER
Giant Spider Properties Racial Type: Vermin STR: 19 CON: 12 DEX: 17 Natural AC Bonus: 5 Hit Point Bonus: 5 Creature Weapon 3: Sword/Giant Spider Bite Monster Damage 1d8 Damage On Monster Hit: POISON_LARGE_SPIDER_VENOM Creature Hide: Polymorph Giant Spider Properties Freedom of Movement
POLYMORPH_TYPE_HUGE_AIR_ELEMENTAL
Huge Air Elemental Properties Racial Type: Outsider STR: 18 CON: 29 DEX: 18 Natural AC Bonus: 4 Hit Point Bonus: 0 Creature Weapon 1: Slam2d8 Monster Damage 2d8 Damage Creature Hide: Huge/Greater Elemental Properties Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack
POLYMORPH_TYPE_HUGE_EARTH_ELEMENTAL
Huge Earth Elemental Properties Racial Type: Outsider STR: 29 CON: 8 DEX: 21 Natural AC Bonus: 11 Hit Point Bonus: 0 Creature Weapon 1: Slam2d10 Monster Damage 2d10 Damage Creature Hide: Huge/Greater Elemental Properties Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack
POLYMORPH_TYPE_HUGE_FIRE_ELEMENTAL
Huge Fire Elemental Properties Racial Type: Outsider STR: 18 CON: 25 DEX: 18 Natural AC Bonus: 4 Hit Point Bonus: 0 Creature Weapon 1: Elder/Greater/Huge Fire Elemental Slam Damage Bonus: Fire 1d8 Damage Damage Bonus: Fire 1d8 Damage Monster Damage 2d8 Damage Creature Hide: Huge/Greater Fire Elemental Properties Immunity: Miscellaneous: Critical Hits Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack
POLYMORPH_TYPE_HUGE_WATER_ELEMENTAL
Huge Water Elemental Properties Racial Type: Outsider STR: 24 CON: 18 DEX: 21 Natural AC Bonus: 9 Hit Point Bonus: 0 Creature Weapon 1: Slam2d10 Monster Damage 2d10 Damage Creature Hide: Huge/Greater Water Elemental Properties Immunity: Miscellaneous: Critical Hits Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack
POLYMORPH_TYPE_IMP
Imp Properties Racial Type: Outsider STR: 0 CON: 0 DEX: 0 Natural AC Bonus: 3 Hit Point Bonus: 0 Creature Weapon 1: Claw1d4 Monster Damage 1d4 Damage Creature Weapon 2: Claw1d4 Monster Damage 1d4 Damage Creature Weapon 3: Imp Stinger Monster Damage 1d4 Damage On Monster Hit: Poison Quasit Venom Creature Hide: Imp Properties Damage Reduction: +1 Soak 5 Damage Damage Resistance: Fire Resist 20 / - Immunity: Miscellaneous: Poison Regeneration +2 Spell Resistance 10
POLYMORPH_TYPE_IRON_GOLEM
Iron Golem Properties Racial Type: Construct STR: 30 CON: 20 DEX: 20 Natural AC Bonus: 10 Hit Point Bonus: 300 Creature Weapon 1: Slam2d10 Monster Damage 2d10 Damage Creature Hide: Iron Golem Properties Immunity: Miscellaneous: Disease Immunity: Miscellaneous: Level/Ability Drain Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Poison Immunity: Miscellaneous: Sneak Attack
POLYMORPH_TYPE_PANTHER
Panther Properties Racial Type: Animal STR: 14 CON: 14 DEX: 22 Natural AC Bonus: 3 Hit Point Bonus: 7 Creature Weapon 1: Claw1d3 Monster Damage 1d3 Damage Creature Weapon 2: Claw1d3 Monster Damage 1d3 Damage Creature Weapon 3: Bite1d6 Monster Damage 1d6 Damage
POLYMORPH_TYPE_PENGUIN
Penguin Properties Racial Type: Animal STR: 0 CON: 0 DEX: 0 Natural AC Bonus: 0 Hit Point Bonus: 0 Creature Weapon 3: Bite2d6 Monster Damage 2d6 Damage
POLYMORPH_TYPE_PIXIE
Pixie Properties Racial Type: Fey STR: 10 CON: 10 DEX: 24 Natural AC Bonus: 2 Hit Point Bonus: 0 Creature Weapon 1: Claw1d4 Monster Damage 1d4 Damage Creature Weapon 2: Claw1d4 Monster Damage 1d4 Damage Creature Hide: Polymorph Pixie Properties Immunity: Spell School: Enchantment Immunity: Spells by Level Level 3 or Lower
POLYMORPH_TYPE_QUASIT
Quasit Properties Racial Type: Outsider STR: 0 CON: 0 DEX: 0 Natural AC Bonus: 3 Hit Point Bonus: 0 Creature Weapon 1: Claw1d4 Monster Damage 1d4 Damage Creature Weapon 2: Claw1d4 Monster Damage 1d4 Damage Creature Weapon 3: Imp Stinger Monster Damage 1d4 Damage On Monster Hit: Poison Quasit Venom Creature Hide: Imp Properties Damage Reduction: +1 Soak 5 Damage Damage Resistance: Fire Resist 20 / - Immunity: Miscellaneous: Poison Regeneration +2 Spell Resistance 10
POLYMORPH_TYPE_RED_DRAGON
Red Dragon Properties Racial Type: Dragon STR: 36 CON: 21 DEX: 30 Natural AC Bonus: 10 Hit Point Bonus: 150 Creature Weapon 1: Claw2d6 Monster Damage 2d6 Damage Creature Weapon 2: Claw2d6 Monster Damage 2d6 Damage Creature Weapon 3: Bite2d8 Monster Damage 2d8 Damage Creature Hide: Adult Red Dragon Properties Immunity: Damage Type: Fire 100% Immunity Bonus Immunity: Miscellaneous: Mind-Affecting Spells Immunity: Miscellaneous: Paralysis Immunity: Miscellaneous: Sneak Attack Spell Resistance 20 True Seeing
POLYMORPH_TYPE_SUCCUBUS
Succubus Properties Racial Type: Outsider STR: 0 CON: 0 DEX: 0 Natural AC Bonus: 9 Hit Point Bonus: 0 Creature Weapon 1: Claw1d6 Monster Damage 1d6 Damage Creature Weapon 2: Claw1d6 Monster Damage 1d6 Damage Creature Hide: Imp Properties Damage Reduction: +1 Soak 5 Damage Damage Resistance: Fire Resist 20 / - Immunity: Miscellaneous: Poison Regeneration +2 Spell Resistance 10
POLYMORPH_TYPE_TROLL
Troll Properties Racial Type: Giant STR: 23 CON: 23 DEX: 14 Natural AC Bonus: 7 Hit Point Bonus: 10 Creature Weapon 1: Claw1d6 Monster Damage 1d6 Damage Creature Weapon 2: Claw1d6 Monster Damage 1d6 Damage Creature Weapon 3: Bite1d6 Monster Damage 1d6 Damage Creature Hide: Polymorph Troll Properties Regeneration +5
POLYMORPH_TYPE_UMBER_HULK
Umber Hulk Properties Racial Type: Aberration STR: 23 CON: 19 DEX: 13 Natural AC Bonus: 7 Hit Point Bonus: 20 Creature Weapon 1: Claw2d4 Monster Damage 2d4 Damage Creature Weapon 2: Claw2d4 Monster Damage 2d4 Damage Creature Weapon 3: Bite2d8 Monster Damage 2d8 Damage Creature Hide: Polymorph Umberhulk Properties True Seeing
POLYMORPH_TYPE_WERECAT
Werecat Properties Racial Type: Shapechanger STR: 20 CON: 16 DEX: 20 Natural AC Bonus: 5 Hit Point Bonus: 15 Creature Weapon 1: Claw1d8 Monster Damage 1d8 Damage Creature Weapon 2: Claw1d8 Monster Damage 1d8 Damage Creature Weapon 3: Bite2d6 Monster Damage 2d6 Damage Creature Hide: Shapechanger Properties Damage Reduction: +1 Soak 10 Damage
POLYMORPH_TYPE_WERERAT
Wererat Properties Racial Type: Shapechanger STR: 16 CON: 16 DEX: 22 Natural AC Bonus: 5 Hit Point Bonus: 5 Creature Weapon 3: Claw1d3 Monster Damage 1d3 Damage Creature Hide: Shapechanger Properties Damage Reduction: +1 Soak 10 Damage
POLYMORPH_TYPE_WEREWOLF
Werewolf Properties Racial Type: Shapechanger STR: 18 CON: 18 DEX: 18 Natural AC Bonus: 5 Hit Point Bonus: 10 Creature Weapon 1: Claw1d3 Monster Damage 1d3 Damage Creature Weapon 2: Claw1d3 Monster Damage 1d3 Damage Creature Weapon 3: Bite1d6 Monster Damage 1d6 Damage Creature Hide: Shapechanger Properties Damage Reduction: +1 Soak 10 Damage
POLYMORPH_TYPE_WOLF
Wolf Properties Racial Type: Animal STR: 16 CON: 16 DEX: 16 Natural AC Bonus: 3 Hit Point Bonus: 7 Creature Weapon 3: Bite1d6 Monster Damage 1d6 Damage
POLYMORPH_TYPE_YUANTI
Yuan Ti Properties Racial Type: Humanoid, Reptilian STR: 20 CON: 20 DEX: 20 Natural AC Bonus: 4 Hit Point Bonus: 0 Creature Weapon 1: Tenser's Transformation Slam Enhancement Bonus +3 Monster Damage 1d8 Damage Creature Weapon 2: Tenser's Transformation Slam Enhancement Bonus +3 Monster Damage 1d8 Damage Creature Hide: Yuan-ti Properties Spell Resistance 16
POLYMORPH_TYPE_ZOMBIE
Zombie Properties Racial Type: Undead STR: 14 CON: 14 DEX: 14 Natural AC Bonus: 0 Hit Point Bonus: 40 Creature Weapon 1: Slam1d6 Monster Damage 1d6 Damage Creature Hide: Polymorph Zombie Properties Damage Resistance: Bludgeoning Resist 10 / - Damage Resistance: Piercing Resist 10 / - Damage Resistance: Slashing Resist 10 / -

See Also

functions: EffectPolymorph


Constant - PROJECTILE_PATH_TYPE

Home > Reference > Constants > PROJECTILE_PATH_TYPE_*

PROJECTILE_PATH_TYPE_* Constant Group

Different types of project paths (the path a missile weapon or other projectile follows as it travels).

Constants

Constant Description
PROJECTILE_PATH_TYPE_ACCELERATING
Increases in speed as the projectile travels its path to its destination.
PROJECTILE_PATH_TYPE_BALLISTIC
Unknown.
PROJECTILE_PATH_TYPE_DEFAULT
Standard path.
PROJECTILE_PATH_TYPE_HIGH_BALLISTIC
Unknown.
PROJECTILE_PATH_TYPE_HOMING
Follows a target.

See Also

functions: ActionCastFakeSpellAtLocation | ActionCastFakeSpellAtObject | ActionCastSpellAtLocation | ActionCastSpellAtObject


Constant - RACIAL_TYPE

Home > Reference > Constants > RACIAL_TYPE_*

RACIAL_TYPE_* Constant Group

Constants used to identify different races (human, dwarf etc)

Constants

Constant Description
RACIAL_TYPE_ABERRATION
An aberration has a bizarre anatomy, strange abilities, an alien mindset, or any combination of the three. Aberrations almost always have darkvision of 60 feet.
RACIAL_TYPE_ALL
Specifies all races. Used to have unrestricted race in searches.
RACIAL_TYPE_ANIMAL
An animal is a nonhumanoid creature, usually a vertebrate. Almost all animal have low-light vision.
RACIAL_TYPE_BEAST
A beast is a nonhistorical, vertebrate creature with a reasonably normal anatomy and no magical or unusual abilities. Almost all beasts have low-light vision and darkvision of 60 feet.
RACIAL_TYPE_CONSTRUCT
A construct is an animcated object or artificially constructed creature. Constructs are not subject to critical hits, subdual damage, ability damage, ability drain, or energy drain. A constract cannot be raised or resurrected. Nearly all constructs have darkvision with a range of 60 feet.
RACIAL_TYPE_DRAGON
A dragon is a reptilian creature, usually winged, with magical or unusual abilities. Dragons are immune to sleep and paralysis effects. All dragons have dark vision of 60 feet.
RACIAL_TYPE_DWARF
Specifies the dwarven race.
RACIAL_TYPE_ELEMENTAL
An elemental is a composed of one of the four classical elements: air, earth, fire, or water. Elementals are immune to poison, sleep, paralysis, stunning, critical hits, or flanking. All elementals have dark vision of 60 feet.
RACIAL_TYPE_ELF
Specifies the elven race.
RACIAL_TYPE_FEY
A fey is a creature with supernatural abilities and connections to nature or to some other force or place. Fey are usually human-shaped. Almost all fey have low-light vision.
RACIAL_TYPE_GIANT
A giant is a humanoid creature of great strength, usualy of at least Large size. Nearly all giants have darkvision with a range of 60 feet.
RACIAL_TYPE_GNOME
Specifies the gnomish race.
RACIAL_TYPE_HALFELF
Specifies the half-elven race.
RACIAL_TYPE_HALFLING
Specifies the halfling race.
RACIAL_TYPE_HALFORC
Specifies the half-orc race.
RACIAL_TYPE_HUMAN
Specifies the human race.
RACIAL_TYPE_HUMANOID_GOBLINOID
A humanoid usually has two arms, two legs, and one head, or a humanlike torse, arms, and head. Goblinoids are among the weakest of humanoids.
RACIAL_TYPE_HUMANOID_MONSTROUS
These are humanoid creatures with monstrous or animalistic features, often having supernatural abilities. Most monstrous humanoids have darkvision with a range of 60 feet.
RACIAL_TYPE_HUMANOID_ORC
A humanoid usually has two arms, two legs, and one head, or a humanlike torse, arms, and head. Orcs a brutal warlike race who raids, pillages, and attacks others.
RACIAL_TYPE_HUMANOID_REPTILIAN
A humanoid usually has two arms, two legs, and one head, or a humanlike torse, arms, and head. Reptialian humanoids comprise lizardfolk, troglodytes, and kobolds.
RACIAL_TYPE_INVALID
Specifies an invalid race.
RACIAL_TYPE_MAGICAL_BEAST
Magical beasts are similar to beatss but have supernatural or extraordinary abilities. Most magical beasts have darkvision of 60 feet.
RACIAL_TYPE_OUTSIDER
An outsider is a nonelemental creature that comes from another dimension, reality, or plane. All outsiders have darkvision with a range of 60 feet.
RACIAL_TYPE_SHAPECHANGER
Shapechangers have a stable body but can assume other forms. Most shapechangers have darkvision with a range of 60 feet.
RACIAL_TYPE_UNDEAD
Undead are once-living creatures animated by spiritual or supernatural forces. Undead are immune to poson, slepp, paralysis, stunning, disease, death effects, and necromantic effects, and they ignore mind-influencing effects. Undead are not subject to critical hits, subdual damage, ability damage, ability drain, or energy drain. Most undead have darkvision with a range of 60 feet.
RACIAL_TYPE_VERMIN
Insects, arachnids, arthropods, worms, and similar invertibrates are treated as vermin. Vermin normally have darkvision of 60 feet.

See Also

functions: GetRacialType | GetRacialTypeCount | VersusRacialTypeEffect


Constant - RADIUS_SIZE

Home > Reference > Constants > RADIUS_SIZE_*

RADIUS_SIZE_* Constant Group

Different degrees of radius size used in area-based functions.

Constants

Constant Description
RADIUS_SIZE_COLOSSAL
Largest circle.
RADIUS_SIZE_GARGANTUAN
Gigantic circle.
RADIUS_SIZE_HUGE
Huge circle.
RADIUS_SIZE_LARGE
Large circle.
RADIUS_SIZE_MEDIUM
Medium circle.
RADIUS_SIZE_SMALL
Smallest circle.

See Also

functions: GetFirstObjectInShape | TalentCureCondition


Constant - REPUTATION_TYPE

Home > Reference > Constants > REPUTATION_TYPE_*

REPUTATION_TYPE_* Constant Group

Determines how creatures react to one another.

Constants

Constant Description
REPUTATION_TYPE_ENEMY
Offensive, violent towards.
REPUTATION_TYPE_FRIEND
Friendly.
REPUTATION_TYPE_NEUTRAL
Passive.

See Also

functions: SetIsTemporaryEnemy | SetIsTemporaryFriend | SetIsTemporaryNeutral


Constant - REST_EVENTTYPE

Home > Reference > Constants > REST_EVENTTYPE_*

REST_EVENTTYPE_* Constant Group

Determines the status of the last rest event for the PC.

Constants

Constant Description
REST_EVENTTYPE_REST_CANCELLED
Rest event was cancelled through PC action, monster interaction, or another interrupting event.
REST_EVENTTYPE_REST_FINISHED
Rest event completed successfully. This is the normal constant sent after a rest.
REST_EVENTTYPE_REST_INVALID
Rest event last attempted was invalid due to closeness to hostile creatures, attempt was right after a combat, or another invalidating type of occurance happened to stop PC from resting.
REST_EVENTTYPE_REST_STARTED
Indicates that a rest event has been started for the specific PC.

See Also

functions: GetLastRestEventType


Constant - SAVING_THROW

Home > Reference > Constants > SAVING_THROW_*

SAVING_THROW_* Constant Group

Core saving throws.

Constants

Constant Description
SAVING_THROW_ALL
All saving throws (Fortitude, Reflex, Will).
SAVING_THROW_FORT
Fortitude saving throw.
SAVING_THROW_REFLEX
Reflex saving throw.
SAVING_THROW_WILL
Will saving throw.

See Also

functions: EffectSavingThrowDecrease | EffectSavingThrowIncrease | MySavingThrow


Constant - SAVING_THROW_TYPE

Home > Reference > Constants > SAVING_THROW_TYPE_*

SAVING_THROW_TYPE_* Constant Group

Describes different saving throw types.

Constants

Constant Description
SAVING_THROW_TYPE_ACID
Specifies saving throws against acid.
SAVING_THROW_TYPE_ALL
Specifies all types of saving throws.
SAVING_THROW_TYPE_CHAOS
Specifies saving throws against chaos effects.
SAVING_THROW_TYPE_COLD
Specifies saving throws against cold based effects.
SAVING_THROW_TYPE_DEATH
Specifies saving throws against death effects.
SAVING_THROW_TYPE_DISEASE
Specifies saving throws against disease.
SAVING_THROW_TYPE_DIVINE
Specifies saving throws against divine effects.
SAVING_THROW_TYPE_ELECTRICITY
Specifies saving throws against electical based effects.
SAVING_THROW_TYPE_EVIL
Specifies saving throws against evil effects.
SAVING_THROW_TYPE_FEAR
Specifies saving throws against fear.
SAVING_THROW_TYPE_FIRE
Specifies saving throws against fire.
SAVING_THROW_TYPE_GOOD
Specifies saving throws against good effects.
SAVING_THROW_TYPE_LAW
Specifies saving throws against law effects.
SAVING_THROW_TYPE_MIND_SPELLS
Specifies saving throws against mind affecting spells.
SAVING_THROW_TYPE_NEGATIVE
Specifies saving throws against negative effects.
SAVING_THROW_TYPE_NONE
Specifies no saving throw type.
SAVING_THROW_TYPE_POISON
Specifies saving throws against poison.
SAVING_THROW_TYPE_POSITIVE
Specifies saving throws against positive effects.
SAVING_THROW_TYPE_SONIC
Specifies saving throws against sound based effects.
SAVING_THROW_TYPE_SPELL
Specifies saving throws against spells.
SAVING_THROW_TYPE_TRAP
Specifies saving throws against trap type effects.

See Also

functions: EffectSavingThrowDecrease | EffectSavingThrowIncrease | FortitudeSave | GetReflexAdjustedDamage | MySavingThrow | ReflexSave | WillSave


Constant - SHAPE

Home > Reference > Constants > SHAPE_*

SHAPE_* Constant Group

SHAPE_* constants are used in the GetFirstObjectInShape() and GetNextObjectInShape() functions.

Constants

Constant Description
SHAPE_CONE
A cone. The difference(s) between SHAPE_CONE and SHAPE_SPELLCONE are unkown. Their constant values are, however, definitely different. SHAPE_CONE is used in only one spell script: nw_s1_krenscare.nss.
SHAPE_CUBE
A cube.
SHAPE_SPELLCONE
Presumably, a cone. The difference(s) between SHAPE_CONE and SHAPE_SPELLCONE are unkown. Their constant values are, however, definitely different.
SHAPE_SPELLCYLINDER
A cylinder.
SHAPE_SPHERE
A sphere.

See Also

functions: GetFirstObjectInShape | GetNextObjectInShape


Constant - SKILL

Home > Reference > Constants > SKILL_*

SKILL_* Constant Group

Skills used in NWN.

Constants

Constant Description
SKILL_ALL_SKILLS
All skills.
SKILL_ANIMAL_EMPATHY
Improves the attitude of an animal. Can be used on normal animals with no penalty, and with penalty on beasts and magical beasts.
SKILL_CONCENTRATION
Permits the casting of a spell despite distractions, such as taking damage, getting hit by an unfriendly spell, and so on.
SKILL_DISABLE_TRAP
Disarm a located trap (see Disarm Device skill in 3rd Edition Player's Handbook).
SKILL_DISCIPLINE
Unknown.
SKILL_HEAL
Used for applying Healer's Kit items for healing.
SKILL_HIDE
Opposed by an opponent's Spot skill for remaining visibly undetected.
SKILL_LISTEN
Opposed by an opponent's Move Silently skill to locate stealthy foes.
SKILL_LORE
Ability to identify magical items and their properties without the aid of an Identify spell.
SKILL_MOVE_SILENTLY
Opposed by an opponent's Listen skill for remaining audibly undetected.
SKILL_OPEN_LOCK
Used for opening locks on doors and chests.
SKILL_PARRY
Used to increase armor class against attacks.
SKILL_PERFORM
Used for performances.
SKILL_PERSUADE
Used for convincing an NPC to be more reasonable by sharing information, giving the PC a discount on a price of an item, etc.
SKILL_PICK_POCKET
Sleight of hand.
SKILL_SEARCH
Used for discovering hidden treasures, or secret doors in an area. SUBSKILL_FLAGTRAP is used by a Rogue when searching for traps.
SKILL_SET_TRAP
Sets a trap.
SKILL_SPELLCRAFT
Used for identifying spells and spell-like effects.
SKILL_SPOT
Opposed by an opponent's Hide skill to locate stealthy foes.
SKILL_TAUNT
Used to distract an opponent from attacking another member of your party.
SKILL_USE_MAGIC_DEVICE
Allows a PC to "fake" a requirement for a magical item (i.e. cast a spell from an arcane spell if the PC is a Rogue only).

See Also

functions: ActionUseSkill | AutoDC | EffectSkillDecrease | EffectSkillIncrease | GetHasSkill | GetIsSkillSuccessful | GetSkillRank | TalentSkill


Constant - SPECIAL_ATTACK

Home > Reference > Constants > SPECIAL_ATTACK_*

SPECIAL_ATTACK_* Constant Group

Special attacks that can be performed during combat.

Constants

Constant Description
SPECIAL_ATTACK_CALLED_SHOT_ARM
Attempt to disable or hinder a foe's ability to fight with its arms.
SPECIAL_ATTACK_CALLED_SHOT_LEG
Attempt to disable or hinder a foe's ability to move by walking.
SPECIAL_ATTACK_DISARM
Attempt to disarm a foe by sundering their weapon; provokes an attack of opportunity.
SPECIAL_ATTACK_FLURRY_OF_BLOWS
Monk's Flurry of Blows ability (additional unarmed attacks with a penalty to attack rolls).
SPECIAL_ATTACK_IMPROVED_DISARM
Attempt to disarm a foe by sundering his weapon without drawing an attack of opportunity.
SPECIAL_ATTACK_IMPROVED_KNOCKDOWN
Attempts to knock a foe down; does not draw an attack of opportunity.
SPECIAL_ATTACK_INVALID
Invalid special attack.
SPECIAL_ATTACK_KNOCKDOWN
Attempts to knock a foe down; draws an attack of opportunity.
SPECIAL_ATTACK_RAPID_SHOT
Grants an additional missile attack with all missile attack rolls taken at a penalty.
SPECIAL_ATTACK_SAP
Inflict subdual damage to try to knock out a foe. Inflicting subdual damage with a weapon that normally inflicts actual damage is done at a penalty to attack rolls.
SPECIAL_ATTACK_STUNNING_FIST
Monk's stunning fist ability.

See Also

functions: GetLastAttackType


Constant - SPELL

Home > Reference > Constants > SPELL_*

SPELL_* Constant Group

Magical spells cast by classes such as wizards, sorcerers, bards, clerics, and druids.

Constants

Constant Description
SPELL_ACID_FOG
Creates a billowing mass of misty vapors similar to a solid fog spell. Each round the fog deals 2d6 points of acid damage to creatures within it. 3rd edition PHB p 172.
SPELL_AID
The subject of an Aid spell gets the effect of a Bless spell (+1 attack rolls, morale bonus, and saves against fear rolls) and 1d8 temporary hit points. 3rd edition PHB p 172.
SPELL_ALL_SPELLS
A representational value of all spells.
SPELL_ANIMATE_DEAD
Turns the bones or bodies of dead creatures into undead skeletons or zombies that follow spoken commands. A maximum of 2 HD per caster level of undead may be animated and controlled by means of this spell at any one time. 3rd edition PHB p 174.
SPELL_AURA_OF_VITALITY
All allies within the area of effect gain +4 Str, Con, Dex. Magic of Faerun.
SPELL_AWAKEN
Awaken a tree or animal to humanlike sentience. 3rd edition PHB p 177.
SPELL_BARKSKIN
Makes a creatures skin as tough as bark. Grants a +3 natural armor bonus to AC, increased to +4 at 6th level and +5 at 12th level. 3rd edition PHB p 177.
SPELL_BESTOW_CURSE
Place a permanent curse on a creature. The curse may be a -6 decrease to one ability score (minimum: 1), a -4 enhancement penalty on attacks rolls, saving throws, ability checks, and skill checks; or each turn the creature has a 50% chance to act normally - otherwise the creature takes no action. 3rd edition PHB p 178.
SPELL_BLADE_BARRIER
Creates a spinning disk of razor sharp blades. Any creature passing through the blade barrier takes 1d6 points of damage per caster level (maximum 20d6). 3rd edition PHB p 179.
SPELL_BLESS
Bless fills allies with courage; they gain a morale bonus of +1 on attack rolls and a +1 on saving throws against fear effects. 3rd edition PHB p 180.
SPELL_BLESS_WEAPON
Makes a weapon striek true against evil foes. All critical rolls against evil foes are automatically successful (so every threat is a critical hit). The weapon negates the damage reduction of evil creatures and is capable of striking evil incorporeal creatures as if it had a +1 enhancement bonus. 3rd edition PHB p 180.
SPELL_BLINDNESS_AND_DEAFNESS
The creature becomes blind or deaf, choosen by the caster. 3rd edition PHB p 180.
SPELL_BULLS_STRENGTH
The recipient of this spell becomes stronger. The spell grants an enchancement bonus to strength of 1d4 + 1 points. 3rd edition PHB p 181.
SPELL_BURNING_HANDS
A thin sheet of searing flame shoots from the caster's outspread fingertips inflicting 1d4 points of damage per caster level (maximum 5d4). 3rd edition PHB p 182.
SPELL_CALL_LIGHTNING
Evoke bolts of lightning while remaining in a stormy area. The caster may evoke a bolt of lightening once every ten minutes. A bolt inflicts 1d10 per caster level of electrical damage (maximum 10d10). 3rd edition PHB p 182.
SPELL_CATS_GRACE
The transmuted creature becomes more graceful, agile, and coordinated. Grants an enhancement bonus to dexterity of 1d4 + 1 points. 3rd edition PHB p 182.
SPELL_CHAIN_LIGHTNING
Creates an electrical discharge that begins as a single stroke commencing from the caster's fingertips. Strikes one creature initially and then arcs to other targets. Deals 1d6 points of electical damage per caster level (maximum 20d6) and arc to as many additional targets as the caster's level and deal half as many damage dice (rounded down) to each additional target. 3rd edition PHB p 182.
SPELL_CHARM_MONSTER
As the spell charm person, but the spell is not restricted by creature type or size. 3rd edition PHB p 183.
SPELL_CHARM_PERSON
Makes a humanoid of medium-size or smaller regard the caster as a trusted friend and ally and perceive the caster's words and actions in a most favorable way. 3rd edition PHB p 183.
SPELL_CHARM_PERSON_OR_ANIMAL
As the spell charm person, but this spell can effect an animal. 3rd edition PHB p 183.
SPELL_CIRCLE_OF_DEATH
A circle of death snuffs out the life forces of living creatures, killing them instantly. Slays 1d4 HD worth of living creatures per caster level (maximum 20d4). 3rd edition PHB p 184.
SPELL_CIRCLE_OF_DOOM
Negative energy bursts in all directions from the point of origin, dealing 1d8 + 1 point per caster level (maximum +20 points). Heals undead in its area of effect rather than harming them. 3rd edition PHB p 184.
SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE
Enables the caster to concentrate upon some locale and hear or see (caster choice) almost as if the caster were there. 3rd edition PHB p 184.
SPELL_CLARITY
UNKNOWN
SPELL_CLOAK_OF_CHAOS
A random pattern of color surrounds the subjects, protecting them from attacks, granting them resistance to spells cast by lawful creatures, and confusing lawful creatures then they strike the subjects. Gain a +4 deflection bonus to AC and a +4 resistance bonus to saves. Gain SR 25 against lawful spells and spells cast by lawful creatures. Blocks possession and mental influence. 3rd edition PHB p 184.
SPELL_CLOUDKILL
Generates a bank of fog with ghastly yellowish green and poisonous vapors. Any living creature with 3 or fewer HD dies, and any creature with 4 to 6 HD must make fortitude saving throws or die. 3rd edition PHB p 185.
SPELL_COLOR_SPRAY
A vivid cone of clashing colors springs forth from the caster's hand, stunning creatures, blinding them, or even knocking them unconcious. The closest 1d6 creatures to the caster are affected, and the effect depends on the HD of the creatures affected. 3rd edition PHB p 185.
SPELL_CONE_OF_COLD
Creates an area of extreme cold, originating from the caster's hand and extending outward in a cone. It drains heat, causing 1d6 points of cold damage per caster level (maximum 15d6). 3rd edition PHB p 186.
SPELL_CONFUSION
Creatures affected by the spell behave randomly. 3rd edition PHB p 186.
SPELL_CONTAGION
The subject contracts a disease, which strikes immediately. The inflicted disease can be blinding sickness, cackle fever, filth fever, mindfire, red ache, the shakes, or slimy doom (see 3rd edition DMG p 75 for descriptions of diseases). 3rd edition PHB p 187.
SPELL_CONTROL_UNDEAD
Enables the caster to control undead creatures for a short period of time. 3rd edition PHB p 188.
SPELL_CREATE_GREATER_UNDEAD
As create undead, except that this spell allows you to create more powerful and intelligent sorts of undead, based on caster level. 3rd edition PHB p 189.
SPELL_CREATE_UNDEAD
A much more potent spell than animate dead, this spell allows the caster to create more powerful sorts of undead: ghasts, ghouls, shadow wights, and wraiths (depending on caster level). Undead created by this spell are not automatically under the control of the caster. 3rd edition PHB p 189.
SPELL_CREEPING_DOOM
Calls forth a mass of 1,000 venomous biting and stinging spiders, scorpions, beetles, and centipedes. Each vermin in the mass inflicts one point of damage to a creature in the area of effect of the spell and dies, thus allowing the mass to inflict up to 1000 hit points of damage total. 3rd edition PHB p 190.
SPELL_CURE_CRITICAL_WOUNDS
Heals 4d8 + 1 point per caster level (up to a maximum of +20 points). 3rd edition PHB p 190.
SPELL_CURE_LIGHT_WOUNDS
Heals 1d8 + 1 point per caster level (up to a maximum of +5 points). 3rd edition PHB p 190.
SPELL_CURE_MINOR_WOUNDS
Heals 1 hit point. 3rd edition PHB p 190.
SPELL_CURE_MODERATE_WOUNDS
Heals 2d8 + 1 point per caster level (up to a maximum of +10 points). 3rd edition PHB p 190.
SPELL_CURE_SERIOUS_WOUNDS
Heals 3d8 + 1 point per caster level (up to a maximum of +15 points). 3rd edition PHB p 190.
SPELL_DARKNESS
Causes an object to radiate darkness out to a 20-foot radius. Not even creatures with darkvision can see in an area shrouded with magical darkness. 3rd edition PHB p 190.
SPELL_DARKVISION
The subject gains the ability to see 60 feet even in total darkness. 3rd edition PHB p 191.
SPELL_DAZE
Clouds the mind of a humanoid of medium-size or smaller so it takes no actions. Humanoids of 5 HD or more are unaffected. 3rd edition PHB p 191.
SPELL_DEATH_WARD
The subject is immune to all death spells and magical death effects. 3rd edition PHB p 191.
SPELL_DELAYED_BLAST_FIREBALL
As fireball, except this spell is more powerful and can detonate up to 5 rounds after the spell is cast. The blast delivers 1d6 points of fire damage per caster level (up to a maximum of 20d6). 3rd edition PHB p 191.
SPELL_DESTRUCTION
Instantly slays the subject and consumes its remains utterly in a holy (or unholy) fire. If the target successfully makes a fortitude saving throw, it suffers 10d6 points of damage instead. 3rd edition PHB p 192.
SPELL_DISMISSAL
Forces an extraplanar creature back to its proper plane. 3rd edition PHB p 196.
SPELL_DISPEL_MAGIC
Can be used to dispel magical effects that are being cast or currently ongoing. 3rd edition PHB p 196.
SPELL_DIVINE_POWER
Calling upon the divine power of the caster's patron, the caster imbues himself with strength and skill in combat, gaining the base attack bonus of a fighter of the casters total character level, an enhancement bonus to strength sufficient enough to raise the caster's strength score to 18 (if not already 18 or higher) and one additional hit point per level. 3rd edition PHB p 197.
SPELL_DOMINATE_ANIMAL
Enchant an animal and direct it with simple commands such as "attack", "run", and "fetch". 3rd edition PHB p 197.
SPELL_DOMINATE_MONSTER
As dominate person, except this spell is not restricted by creature type or size. 3rd edition PHB p 197.
SPELL_DOMINATE_PERSON
Control the actions of any humanoid that is medium-size or smaller. 3rd edition PHB p 197.
SPELL_DOOM
Fills a single subject with a feeling of horrible dread and causes her to weaken and lose confidence. The subject is shaken, suffering a -2 morale penalty to attack rolls, checks, and saving throws.
SPELL_EAGLE_SPLEDOR
Adds an enhancement bonus of 1d4+1 to Charisma-based skills. (TnB, FRCS p.68)
SPELL_ELEMENTAL_SHIELD
UNKNOWN
SPELL_ELEMENTAL_SWARM
Opens a portal to an elemental plane allowing the caster to summon elements from that plane. 3rd edition PHB p 198.
SPELL_ENDURANCE
The subject gains greater vitality and stamina, granting an enhancement bonus of 1d4 + 1 points to constitution. 3rd edition PHB p 199.
SPELL_ENDURE_ELEMENTS
Grants a creature limited protection to damage from whichever one of five energy types selected: acid, cold, electricity, fire, or sonic. Each round the spell absorbs the first 5 points of damage from the specified energy type. 3rd edition PHB p 199.
SPELL_ENERGY_BUFFER
5th level. Touch spell (caster). Absorbs 1d6 points per caster level of engery damage. (TnB p.87)
SPELL_ENERGY_DRAIN
As ennervation, except the creature struck gains 2d4 negative levels, and the negative levels last longer. 3rd edition PHB p 199.
SPELL_ENERVATION
Releases a black bolt of cracking negative energy that suppresses the life force of any living creature it strikes (the caster must make a ranged touch attack to hit). If the attack succeeds, the subject gains 1d4 negative levels. If the subject has at least as many negative levels as HD, it dies. 3rd edition PHB p 199.
SPELL_ENTANGLE
Grasses, weeds, bushes, and even trees wrap, twist, and entwine about creatures in the area or those who enter the area, holding them fast. 3rd edition PHB p 200.
SPELL_ETHEREAL_VISAGE
UNKNOWN
SPELL_EVARDS_BLACK_TENTACLES
Conjures 1d4 + 1 per caster level rubbery black tentacles. These tentacles are large (10 feet long), AC 16, 1 hit point per caster level, an attack bonus of +1 per caster level, and a strength score of 19 (+4 bonus). 3rd edition PHB p 201.
SPELL_FEAR
An invisible cone of terror causes living creature to become panicked. They suffer a -2 morale penalty on saving throws and flee from the caster. 3rd edition PHB p 203.
SPELL_FEEBLEMIND
The subject's intelligence spell drops to 1, roughly the intellect of a lizard. 3rd edition PHB p 203.
SPELL_FIND_TRAPS
The caster gains intuitive insite into the workings of traps and may use the search skill to detect traps just as a rogue can, but gain no special bonus on search checks. 3rd edition PHB p 203.
SPELL_FINGER_OF_DEATH
Slays one living creature within range. The subject is entitled to a fortitude saving throw to survive; if successful the subject suffers 3d6 + 1 point per caster level of damage. 3rd edition PHB p 203.
SPELL_FIRE_STORM
Creates a zone of destruction around the caster within which all living creatures are pummeled with fire. Deals 1d6 points of fire damage per caster level (up to a maximum of 20d6). 3rd edition PHB.
SPELL_FIREBALL
Causes a burst of flame that detonates with a low roar and deals 1d6 points of fire damage per caster level (up to a maximum of 10d6). 3rd edition PHB p 204.
SPELL_FLAME_ARROW
Creates flames that turn normal arrows, bolts, and stones into fiery projectiles or create fiery bolts and shoot them at enemies. 3rd edition PHB p 205.
SPELL_FLAME_LASH
UNKNOWN
SPELL_FLAME_STRIKE
Produces a vertical column of divine fire roaring downward, dealing 1d6 points of damage per caster level (to a maximum of 15d6). Half of the damage is fire damage, the other half is from divine power. 3rd edition PHB p 205.
SPELL_FOXS_CUNNING
Touch spell. Gives 1d4+1 enhancement bonus to Intelligence. (TnB p.89)
SPELL_FREEDOM_OF_MOVEMENT
Enables the caster or subject touched to move and attack normally for the duration of the spell, even under the influence of magic that usually impedes movement. 3rd edition PHB p 207.
SPELL_GATE
Creatures a link between the casters current plane of existance and any plane desired, allowing travel between either plane. The caster may also call a particular individal or type of being through the gate. 3rd edition PHB p 208.
SPELL_GHOSTLY_VISAGE
UNKNOWN
SPELL_GHOUL_TOUCH
Allows the caster to paralyze a single humanoid for 1d6 + 2 rounds with a successful melee attack hit. 3rd edition PHB p 209.
SPELL_GLOBE_OF_INVULNERABILITY
As minor globe of invulnerability, except this spell also excludes 4th-level spells and spell-like effects. 3rd edition PHB p 209.
SPELL_GREASE
A grease spell covers a solid surface with a layer of slippery grease. 3rd edition PHB p 210.
SPELL_GREATER_BULLS_STRENGTH
Improved version of bull's strength. Exact effect is unknown.
SPELL_GREATER_CATS_GRACE
Improved version of cat's grace. Exact effect is unknown.
SPELL_GREATER_DISPELLING
As dispel magic, except that the maximum bonus on the dispel check is +20 instead of +10. 3rd edition PHB p 210.
SPELL_GREATER_EAGLE_SPLENDOR
Improved version of eagle splendor. Exact effect is unknown.
SPELL_GREATER_ENDURANCE
Improved version of endurace. Exact effect is unknown.
SPELL_GREATER_FOXS_CUNNING
Improved version of fox's cunning. Exact effect is unknown.
SPELL_GREATER_MAGIC_WEAPON
Gives a weapon an enhancement bonus to attack and damage of +1 per every three caster levels (maximum +5). 3rd edition PHB p 210.
SPELL_GREATER_OWLS_WISDOM
Improved version of owl's wisdom. Exact effect is unknown.
SPELL_GREATER_PLANAR_BINDING
As lesser planar binding, except the caster may call a single creature of up to 24 HD or a number of creatures of the same type who's HD total no more than 24. 3rd edition PHB p 211.
SPELL_GREATER_RESTORATION
As lesser restoration, except the spell dispels all negative energy levels afflicting the healed creature, restoring the creature to the highest leve it had previously achieved. 3rd edition PHB p 211.
SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW
As Melf's acid arrow, except the spell is woven using material from the Plane of Shadow. The creature struck is allowed a will save; if successful the creature only takes 20% of the damage total. 3rd edition PHB p 211.
SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE
As minor globe of invulnerability, except the spell is woven using material from the Plane of Shadow and is less potent. 3rd edition PHB p 211.
SPELL_GREATER_SHADOW_CONJURATION_MIRROR_IMAGE
As mirror image, except the spell is woven using material from the Plane of Shadow and is less potent. 3rd edition PHB p 211.
SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW
As summon shadow, except the spell is woven using material from the Plane of Shadow and is less potent. 3rd edition PHB p 211.
SPELL_GREATER_SHADOW_CONJURATION_WEB
As web, except the spell is woven using material from the Plane of Shadow and is less potent. 3rd edition PHB p 211.
SPELL_GREATER_SPELL_BREACH
Improved version of spell breach. Exact effect is unknown.
SPELL_GREATER_SPELL_MANTLE
Improved version of spell mantle. Exact effect is unknown.
SPELL_GREATER_STONESKIN
Improved version of stone skin. Exact effect is unknown.
SPELL_HAMMER_OF_THE_GODS
UNKNOWN
SPELL_HARM
Harm charges a subject with negative energy that causes the loss of all but 1d4 hit points. 3rd edition PHB p 212.
SPELL_HASTE
The subject moves and acts more quickly than normal, gaining an extra partial action during his turn, a +4 haste bonus to AC, and jump one and a half times as far as normal. 3rd edition PHB p 212.
SPELL_HEAL
Channels positive energy into a creature to wipe away disease and injury. It completely cures all diseases, blindness, deafness, hit point damage, and all temporary ability damage. It neutralizes poisons in the subject's system so no additional damage or effects are suffered. It offsets a feeblemind spell. It cures those mental disorders caused by spells or injury to the brain. 3rd edition PHB p 213.
SPELL_HEALING_CIRCLE
Positive energy spreads out in all directions from the point of origin, curing 1d8 points of damage +1 point per caster level (maximum +20 points) to nearby living allies. 3rd edition PHB p 213.
SPELL_HOLD_ANIMAL
Like the spell hold person, except this spell affects an animal instead. 3rd edition PHB p 214.
SPELL_HOLD_MONSTER
As hold person, except this spell holds any living creature that fails its will save. 3rd edition PHB p 214.
SPELL_HOLD_PERSON
The subject freezes in place, standing helpless. He is aware nad breathes normally, but cannot take any physical actions, even speech. 3rd edition PHB p 214.
SPELL_HOLY_AURA
A brilliant divine radiance surrounds the subjects, protecting them from attacks, granting them resistance to spells cast by eveil creatures, and blinding evil creatures when they strike the subjects. 3rd edition PHB p 214.
SPELL_HOLY_SWORD
Allows the caster to channel holy power into a sword, or any other weapon the caster chooses. The weapon acts as a +5 magic weapon and deals double damage against evil opponents. 3rd edition PHB p 215.
SPELL_HORRID_WILTING
Evaporates moisture from the bodies of all the subject living creatures, dealing 1d8 points of damage per caster level (maximum 25d8). 3rd edition PHB p 215.
SPELL_ICE_STORM
Greater hailstones pound down, inflcting 5d6 points of damage to creatures in their path; the damage is 3d6 impact plus 2d6 cold based. 3rd edition PHB p 216.
SPELL_IDENTIFY
Identifies the single most basic function of a magic item, including how to activate that funciton. 3rd edition PHB p 216.
SPELL_IMPLOSION
Creates a destructive resonance in a corporeal creature's body. For each round the caster concentrates, he causes one creature to collapse in on itself, killing it. 3rd edition PHB p 216.
SPELL_IMPROVED_INVISIBILITY
SPELL_INCENDIARY_CLOUD
SPELL_INVISIBILITY
SPELL_INVISIBILITY_PURGE
SPELL_INVISIBILITY_SPHERE
SPELL_KNOCK
SPELL_LEGEND_LORE
SPELL_LESSER_DISPEL
SPELL_LESSER_MIND_BLANK
SPELL_LESSER_PLANAR_BINDING
SPELL_LESSER_RESTORATION
SPELL_LESSER_SPELL_BREACH
SPELL_LESSER_SPELL_MANTLE
SPELL_LIGHT
SPELL_LIGHTNING_BOLT
SPELL_MAGE_ARMOR
SPELL_MAGIC_CIRCLE_AGAINST_CHAOS
SPELL_MAGIC_CIRCLE_AGAINST_EVIL
SPELL_MAGIC_CIRCLE_AGAINST_GOOD
SPELL_MAGIC_CIRCLE_AGAINST_LAW
SPELL_MAGIC_MISSILE
A missile of magical energy darts forth from the caster's fingertip and unerringly strikes its target, dealing 1d4 + 1 points of damage. For every two levels of experience past 1st, the caster gains another missile (up to a maximum of 5 at 9th level). "Galstaff, you enter the door to the north…"
SPELL_MAGIC_VESTMENT
UNKNOWN
SPELL_MAGIC_WEAPON
SPELL_MASS_BLINDNESS_AND_DEAFNESS
SPELL_MASS_CHARM
SPELL_MASS_HASTE
As haste, except that it affects multiple creatures. 3rd edition PHB p 226.
SPELL_MASS_HEAL
SPELL_MELFS_ACID_ARROW
A creature who is struck by the acid arrow suffers 2d4 points of damage and the acid lasts for another round for every three levels of the caster (up to a maximum of 7 rounds). 3rd edition PHB p 227.
SPELL_METEOR_SWARM
SPELL_MIND_BLANK
SPELL_MIND_FOG
SPELL_MINOR_GLOBE_OF_INVULNERABILITY
SPELL_MORDENKAINENS_DISJUNCTION
SPELL_MORDENKAINENS_SWORD
SPELL_NATURES_BALANCE
SPELL_NEGATIVE_ENERGY_BURST
SPELL_NEGATIVE_ENERGY_PROTECTION
SPELL_NEGATIVE_ENERGY_RAY
SPELL_NEUTRALIZE_POISON
SPELL_OWLS_WISDOM
SPELL_PHANTASMAL_KILLER
SPELL_PLANAR_BINDING
SPELL_POISON
SPELL_POLYMORPH_SELF
Polymorphs the caster into another creature for the duration of the spell. Polymorphing a PC causes them to trigger the OnExit and OnEnter events (in that order).
SPELL_POWER_WORD_KILL
SPELL_POWER_WORD_STUN
SPELL_PRAYER
SPELL_PREMONITION
SPELL_PRISMATIC_SPRAY
SPELL_PROTECTION__FROM_CHAOS
SPELL_PROTECTION_FROM_ELEMENTS
SPELL_PROTECTION_FROM_EVIL
SPELL_PROTECTION_FROM_GOOD
SPELL_PROTECTION_FROM_LAW
SPELL_PROTECTION_FROM_SPELLS
SPELL_RAISE_DEAD
SPELL_RAY_OF_ENFEEBLEMENT
SPELL_RAY_OF_FROST
SPELL_REGENERATE
SPELL_REMOVE_BLINDNESS_AND_DEAFNESS
SPELL_REMOVE_CURSE
SPELL_REMOVE_DISEASE
SPELL_REMOVE_FEAR
SPELL_REMOVE_PARALYSIS
SPELL_RESIST_ELEMENTS
SPELL_RESISTANCE
SPELL_RESTORATION
SPELL_RESURRECTION
SPELL_SANCTUARY
SPELL_SCARE
SPELL_SEARING_LIGHT
SPELL_SEE_INVISIBILITY
SPELL_SHADES_CONE_OF_COLD
SPELL_SHADES_FIREBALL
SPELL_SHADES_STONESKIN
SPELL_SHADES_SUMMON_SHADOW
SPELL_SHADES_WALL_OF_FIRE
SPELL_SHADOW_CONJURATION_DARKNESS
SPELL_SHADOW_CONJURATION_INIVSIBILITY
SPELL_SHADOW_CONJURATION_MAGE_ARMOR
SPELL_SHADOW_CONJURATION_MAGIC_MISSILE
SPELL_SHADOW_CONJURATION_SUMMON_SHADOW
SPELL_SHADOW_SHIELD
SPELL_SHAPECHANGE
SPELL_SHIELD_OF_LAW
SPELL_SILENCE
SPELL_SLAY_LIVING
SPELL_SLEEP
SPELL_SLOW
SPELL_SOUND_BURST
SPELL_SPELL_MANTLE
SPELL_SPELL_RESISTANCE
SPELL_SPHERE_OF_CHAOS
SPELL_STINKING_CLOUD
SPELL_STONESKIN
SPELL_STORM_OF_VENGEANCE
SPELL_SUMMON_CREATURE_I
SPELL_SUMMON_CREATURE_II
SPELL_SUMMON_CREATURE_III
SPELL_SUMMON_CREATURE_IV
SPELL_SUMMON_CREATURE_IX
SPELL_SUMMON_CREATURE_V
SPELL_SUMMON_CREATURE_VI
SPELL_SUMMON_CREATURE_VII
SPELL_SUMMON_CREATURE_VIII
SPELL_SUNBEAM
SPELL_TENSERS_TRANSFORMATION
SPELL_TIME_STOP
SPELL_TRUE_SEEING
SPELL_UNHOLY_AURA
SPELL_VAMPIRIC_TOUCH
SPELL_VIRTUE
SPELL_WAIL_OF_THE_BANSHEE
SPELL_WALL_OF_FIRE
SPELL_WAR_CRY
SPELL_WEB
SPELL_WEIRD
SPELL_WORD_OF_FAITH

See Also

functions: ActionCastFakeSpellAtLocation | ActionCastFakeSpellAtObject | ActionCastSpellAtLocation | ActionCastSpellAtObject | CompareLastSpellCast | DecrementRemainingSpellUses | EffectSanctuary | EffectSpellImmunity | EventSpellCastAt | GetHasSpell | GetHasSpellEffect | GetIdFromTalent | GetLastGenericSpellCast | GetNearestCreature | GetNearestCreatureToLocation | GetSpellBreachProtection | GetSpellId | HasSpell | RemoveProtections | SetLastGenericSpellCast | TalentSpell


Constant - SPELLABILITY

Home > Reference > Constants > SPELLABILITY_*

SPELLABILITY_* Constant Group

Magical spell-like abilities some creatures possess.

Constants

Constant Description
SPELLABILITY_ACTIVATE_ITEM
SPELLABILITY_AURA_BLINDING
SPELLABILITY_AURA_COLD
SPELLABILITY_AURA_ELECTRICITY
SPELLABILITY_AURA_FEAR
SPELLABILITY_AURA_FIRE
SPELLABILITY_AURA_MENACE
SPELLABILITY_AURA_OF_COURAGE
SPELLABILITY_AURA_PROTECTION
SPELLABILITY_AURA_STUN
SPELLABILITY_AURA_UNEARTHLY_VISAGE
SPELLABILITY_AURA_UNNATURAL
SPELLABILITY_BARBARIAN_RAGE
SPELLABILITY_BATTLE_MASTERY
SPELLABILITY_BOLT_ABILITY_DRAIN_CHARISMA
SPELLABILITY_BOLT_ABILITY_DRAIN_CONSTITUTION
SPELLABILITY_BOLT_ABILITY_DRAIN_DEXTERITY
SPELLABILITY_BOLT_ABILITY_DRAIN_INTELLIGENCE
SPELLABILITY_BOLT_ABILITY_DRAIN_STRENGTH
SPELLABILITY_BOLT_ABILITY_DRAIN_WISDOM
SPELLABILITY_BOLT_ACID
SPELLABILITY_BOLT_CHARM
SPELLABILITY_BOLT_COLD
SPELLABILITY_BOLT_CONFUSE
SPELLABILITY_BOLT_DAZE
SPELLABILITY_BOLT_DEATH
SPELLABILITY_BOLT_DISEASE
SPELLABILITY_BOLT_DOMINATE
SPELLABILITY_BOLT_FIRE
SPELLABILITY_BOLT_KNOCKDOWN
SPELLABILITY_BOLT_LEVEL_DRAIN
SPELLABILITY_BOLT_LIGHTNING
SPELLABILITY_BOLT_PARALYZE
SPELLABILITY_BOLT_POISON
SPELLABILITY_BOLT_SHARDS
SPELLABILITY_BOLT_SLOW
SPELLABILITY_BOLT_STUN
SPELLABILITY_BOLT_WEB
SPELLABILITY_CONE_ACID
SPELLABILITY_CONE_COLD
SPELLABILITY_CONE_DISEASE
SPELLABILITY_CONE_FIRE
SPELLABILITY_CONE_LIGHTNING
SPELLABILITY_CONE_POISON
SPELLABILITY_CONE_SONIC
SPELLABILITY_DETECT_EVIL
SPELLABILITY_DIVINE_PROTECTION
SPELLABILITY_DIVINE_STRENGTH
SPELLABILITY_DIVINE_TRICKERY
SPELLABILITY_DRAGON_BREATH_ACID
SPELLABILITY_DRAGON_BREATH_COLD
SPELLABILITY_DRAGON_BREATH_FEAR
SPELLABILITY_DRAGON_BREATH_FIRE
SPELLABILITY_DRAGON_BREATH_GAS
SPELLABILITY_DRAGON_BREATH_LIGHTNING
SPELLABILITY_DRAGON_BREATH_PARALYZE
SPELLABILITY_DRAGON_BREATH_SLEEP
SPELLABILITY_DRAGON_BREATH_SLOW
SPELLABILITY_DRAGON_BREATH_WEAKEN
SPELLABILITY_DRAGON_FEAR
SPELLABILITY_DRAGON_WING_BUFFET
SPELLABILITY_ELEMENTAL_SHAPE
SPELLABILITY_EMPTY_BODY
SPELLABILITY_FEROCITY_1
SPELLABILITY_FEROCITY_2
SPELLABILITY_FEROCITY_3
SPELLABILITY_GAZE_CHARM
SPELLABILITY_GAZE_CONFUSION
SPELLABILITY_GAZE_DAZE
SPELLABILITY_GAZE_DEATH
SPELLABILITY_GAZE_DESTROY_CHAOS
SPELLABILITY_GAZE_DESTROY_EVIL
SPELLABILITY_GAZE_DESTROY_GOOD
SPELLABILITY_GAZE_DESTROY_LAW
SPELLABILITY_GAZE_DOMINATE
SPELLABILITY_GAZE_DOOM
SPELLABILITY_GAZE_FEAR
SPELLABILITY_GAZE_PARALYSIS
SPELLABILITY_GAZE_STUNNED
SPELLABILITY_GOLEM_BREATH_GAS
SPELLABILITY_HELL_HOUND_FIREBREATH
SPELLABILITY_HOWL_CONFUSE
SPELLABILITY_HOWL_DAZE
SPELLABILITY_HOWL_DEATH
SPELLABILITY_HOWL_DOOM
SPELLABILITY_HOWL_FEAR
SPELLABILITY_HOWL_PARALYSIS
SPELLABILITY_HOWL_SONIC
SPELLABILITY_HOWL_STUN
SPELLABILITY_INTENSITY_1
SPELLABILITY_INTENSITY_2
SPELLABILITY_INTENSITY_3
SPELLABILITY_KRENSHAR_SCARE
SPELLABILITY_LAY_ON_HANDS
SPELLABILITY_LESSER_BODY_ADJUSTMENT
SPELLABILITY_MEPHIT_SALT_BREATH
SPELLABILITY_MEPHIT_STEAM_BREATH
SPELLABILITY_MUMMY_BOLSTER_UNDEAD
SPELLABILITY_NEGATIVE_PLANE_AVATAR
SPELLABILITY_PULSE_ABILITY_DRAIN_CHARISMA
SPELLABILITY_PULSE_ABILITY_DRAIN_CONSTITUTION
SPELLABILITY_PULSE_ABILITY_DRAIN_DEXTERITY
SPELLABILITY_PULSE_ABILITY_DRAIN_INTELLIGENCE
SPELLABILITY_PULSE_ABILITY_DRAIN_STRENGTH
SPELLABILITY_PULSE_ABILITY_DRAIN_WISDOM
SPELLABILITY_PULSE_COLD
SPELLABILITY_PULSE_DEATH
SPELLABILITY_PULSE_DISEASE
SPELLABILITY_PULSE_DROWN
SPELLABILITY_PULSE_FIRE
SPELLABILITY_PULSE_HOLY
SPELLABILITY_PULSE_LEVEL_DRAIN
SPELLABILITY_PULSE_LIGHTNING
SPELLABILITY_PULSE_NEGATIVE
SPELLABILITY_PULSE_POISON
SPELLABILITY_PULSE_SPORES
SPELLABILITY_PULSE_WHIRLWIND
SPELLABILITY_QUIVERING_PALM
SPELLABILITY_RAGE_3
SPELLABILITY_RAGE_4
SPELLABILITY_RAGE_5
SPELLABILITY_REMOVE_DISEASE
SPELLABILITY_ROGUES_CUNNING
SPELLABILITY_SMITE_EVIL
SPELLABILITY_SMOKE_CLAW
SPELLABILITY_SUMMON_ANIMAL_COMPANION
SPELLABILITY_SUMMON_CELESTIAL
SPELLABILITY_SUMMON_FAMILIAR
SPELLABILITY_SUMMON_MEPHIT
SPELLABILITY_SUMMON_SLAAD
SPELLABILITY_SUMMON_TANARRI
SPELLABILITY_TRUMPET_BLAST
SPELLABILITY_TURN_UNDEAD
SPELLABILITY_TYRANT_FOG_MIST
SPELLABILITY_WHOLENESS_OF_BODY
SPELLABILITY_WILD_SHAPE

See Also

Send comments on this topic.


Constant - SPELL_SCHOOL

Home > Reference > Constants > SPELL_SCHOOL_*

SPELL_SCHOOL_* Constant Group

Schools of spells.

Constants

Constant Description
SPELL_SCHOOL_ABJURATION
Spells that protect, block, or banish.
SPELL_SCHOOL_CONJURATION
Spells that bring creatures or materials to the caster.
SPELL_SCHOOL_DIVINATION
Spells that reveal information.
SPELL_SCHOOL_ENCHANTMENT
Spells that imbue the recipient with some property or grant the caster power over another being.
SPELL_SCHOOL_EVOCATION
Spells that manipulate energy or create something for nothing.
SPELL_SCHOOL_GENERAL
Standard spells that all casters have access to.
SPELL_SCHOOL_ILLUSION
Spells that alter perception or create false images.
SPELL_SCHOOL_NECROMANCY
Spells that maniputlate, create, or destroy life or life force.
SPELL_SCHOOL_TRANSMUTATION
Spells that transform the recipient physically or change its properties in a more subtle way.

See Also

functions: EffectSpellFailure | EffectSpellLevelAbsorption


Constant - STANDARD_FACTION

Home > Reference > Constants > STANDARD_FACTION_*

STANDARD_FACTION_* Constant Group

The four generic factions used to determine enmity and friendship by NPCs.

Constants

Constant Description
STANDARD_FACTION_COMMONER
Characterized as an average townsperson. Indifferent to PCs, merchant and defender factions, defend other commoner faction members, and attack hostile faction members.
STANDARD_FACTION_DEFENDER
Characterized by a town guard. Defends commoners, merchants, other defenders, and PCs, and attacks hostile faction members.
STANDARD_FACTION_HOSTILE
Characterized as a normal monster. Attacks all other factions except other hostile faction members.
STANDARD_FACTION_MERCHANT
Characterized as a normal tradesman or merchant. Indifferent to PCs and commoners, defends other merchants and defenders, and attacks hostile.

See Also

functions: ChangeToStandardFaction | GetStandardFactionReputation | SetStandardFactionReputation


Constant - SUBSKILL

Home > Reference > Constants > SUBSKILL_*

SUBSKILL_* Constant Group

Subskills for dealing with traps; additions for Rogues to their standard Search skill.

Constants

Constant Description
SUBSKILL_EXAMINETRAP
Unknown.
SUBSKILL_FLAGTRAP
Allows a Rogue to find a trap.
SUBSKILL_RECOVERTRAP
Allows a rogue to disable, recover, and pocket a trap if the Disable Device skill check is high enough.

See Also

functions: ActionUseSkill


Constant - SUBTYPE

Home > Reference > Constants > SUBTYPE_*

SUBTYPE_* Constant Group

Effect subtypes.

Constants

Constant Description
SUBTYPE_EXTRAORDINARY
See 3rd Edition DMG page 71 for a description of Extraordinary Abilities. The extent to which the Aurora Engine follows these restrictions is unknown.
SUBTYPE_MAGICAL
Default subtype for effects.
SUBTYPE_SUPERNATURAL
See 3rd Edition DMG page 71 for a description of Supernatural Abilities. The extent to which the Aurora Engine follows these restrictions is unknown.

See Also

functions: ExtraordinaryEffect | GetEffectSubType | MagicalEffect | SupernaturalEffect


Constant - TALENT_CATEGORY

Home > Reference > Constants > TALENT_CATEGORY_*

TALENT_CATEGORY_* Constant Group

Groups the talents into categories.

Constants

Constant Description
TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_AREAEFFECT
Used with Restoration, Clarity, and other spells that remove effects (in a given area of effect).
TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_POTION
Used for beneficial spells that occur as the result of imbibing a potion.
TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_SINGLE
Used for Restoration, Clarity, and other spells that remove effects (single target).
TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_AREAEFFECT
Specifies a talent that enhances the abilities of creatures in an area.
TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_POTION
Specifies the talent of using a potion of some type of ability enhancement.
TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SELF
Specifies a talent that enhances the abilities of the creature queried (OBJECT_SELF).
TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SINGLE
Specifies a talent that enhances the abilities of a creature.
TALENT_CATEGORY_BENEFICIAL_HEALING_AREAEFFECT
Specifies the talents that are area of effect and cause healing.
TALENT_CATEGORY_BENEFICIAL_HEALING_POTION
Specifies a talent that of using a healing potion (whether a healing potion is accessible).
TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH
Specifies the talents that heal by touch.
TALENT_CATEGORY_BENEFICIAL_OBTAIN_ALLIES
Specifies a talent that will call forth allies.
TALENT_CATEGORY_BENEFICIAL_PROTECTION_AREAEFFECT
Specifies a talent that will protect creatues in an area in some way.
TALENT_CATEGORY_BENEFICIAL_PROTECTION_POTION
Specifies the talent of using a potion of some type of protection.
TALENT_CATEGORY_BENEFICIAL_PROTECTION_SELF
Specifies a talent that will protect the caller in some way.
TALENT_CATEGORY_BENEFICIAL_PROTECTION_SINGLE
Specifies a talent that will protect a single creatue in some way.
TALENT_CATEGORY_DRAGONS_BREATH
Specifies the talent of dragon's breath.
TALENT_CATEGORY_HARMFUL_AREAEFFECT_DISCRIMINANT
Specifies the talents that are area of effect and harmful but do not damage friendlies.
TALENT_CATEGORY_HARMFUL_AREAEFFECT_INDISCRIMINANT
Specifies a talent that causes harm to all creatures in an area.
TALENT_CATEGORY_HARMFUL_MELEE
Specifies the talent of melee based attack.
TALENT_CATEGORY_HARMFUL_RANGED
Specifies the talents that are harmful and are delivered over a range.
TALENT_CATEGORY_HARMFUL_TOUCH
Specifies the talents that are harmful and are delivered by touch.
TALENT_CATEGORY_PERSISTENT_AREA_OF_EFFECT
Specifies a talent that will have a persistent effect in an area like an aura.

See Also

functions: GetCanCastHealingSpells | GetCreatureTalentBest | GetCreatureTalentRandom


Constant - TALENT_TYPE

Home > Reference > Constants > TALENT_TYPE_*

TALENT_TYPE_* Constant Group

Primary category of talents for use by creatures in game.

Constants

Constant Description
TALENT_TYPE_FEAT
Feat talent.
TALENT_TYPE_SKILL
Primary category for all skills in the game.
TALENT_TYPE_SPELL
Spell casting talent.

See Also

functions: GetTypeFromTalent


Constant - TALKVOLUME

Home > Reference > Constants > TALKVOLUME_*

TALKVOLUME_* Constant Group

Sets the broadcast range of text displayed using SpeakString() and ActionSpeakString() functions.

Constants

Constant Description
TALKVOLUME_SHOUT
Sets the text visibility range to long.
TALKVOLUME_SILENT_SHOUT
Sets the text visibility to long, but hides the text from the screen (so it can still be heard and acted on by creatures in the area).
TALKVOLUME_SILENT_TALK
Sets the text visibility to short, but hides the text from the screen (so it can still be heard and acted on by creatures in the area).
TALKVOLUME_TALK
Set the text visibility to medium.
TALKVOLUME_WHISPER
Sets the text visibility range to short. Must be standing very near to the speaker to see. Placeables will not display whispered text.

See Also

functions: ActionSpeakString | ActionSpeakStringByStrRef | SpeakString | SpeakStringByStrRef


Constant - TILE_MAIN_LIGHT_COLOR

Home > Reference > Constants > TILE_MAIN_LIGHT_COLOR_*

TILE_MAIN_LIGHT_COLOR_* Constant Group

List of available colors to be used as the main light source of a tile.

Constants

Constant Description
TILE_MAIN_LIGHT_COLOR_AQUA
Specifies a aqua colored light.
TILE_MAIN_LIGHT_COLOR_BLACK
Specifies a black light (dark).
TILE_MAIN_LIGHT_COLOR_BLUE
Specifies a blue colored light.
TILE_MAIN_LIGHT_COLOR_BRIGHT_WHITE
Specifies a bright white colored light.
TILE_MAIN_LIGHT_COLOR_DARK_AQUA
Specifies a dark aqua colored light.
TILE_MAIN_LIGHT_COLOR_DARK_BLUE
Specifies a dark blue colored light.
TILE_MAIN_LIGHT_COLOR_DARK_GREEN
Specifies a dark green colored light.
TILE_MAIN_LIGHT_COLOR_DARK_ORANGE
Specifies a dark orange colored light.
TILE_MAIN_LIGHT_COLOR_DARK_PURPLE
Specifies a dark purple colored light.
TILE_MAIN_LIGHT_COLOR_DARK_RED
Specifies a dark red colored light.
TILE_MAIN_LIGHT_COLOR_DARK_YELLOW
Specifies a dark yellow colored light.
TILE_MAIN_LIGHT_COLOR_DIM_WHITE
Specifies a dim white light.
TILE_MAIN_LIGHT_COLOR_FEAT
Feat talent.
TILE_MAIN_LIGHT_COLOR_GREEN
Specifies a green colored light.
TILE_MAIN_LIGHT_COLOR_ORANGE
Specifies a orange colored light.
TILE_MAIN_LIGHT_COLOR_PALE_AQUA
Specifies a pale aqua colored light.
TILE_MAIN_LIGHT_COLOR_PALE_BLUE
Specifies a pale blue colored light.
TILE_MAIN_LIGHT_COLOR_PALE_DARK_AQUA
Specifies a pale dark aqua colored light.
TILE_MAIN_LIGHT_COLOR_PALE_DARK_BLUE
Specifies a pale dark blue colored light.
TILE_MAIN_LIGHT_COLOR_PALE_DARK_GREEN
Specifies a pale dark green colored light.
TILE_MAIN_LIGHT_COLOR_PALE_DARK_ORANGE
Specifies a pale dark orange colored light.
TILE_MAIN_LIGHT_COLOR_PALE_DARK_PURPLE
Specifies a pale dark purple colored light.
TILE_MAIN_LIGHT_COLOR_PALE_DARK_RED
Specifies a pale dark red colored light.
TILE_MAIN_LIGHT_COLOR_PALE_DARK_YELLOW
Specifies a pale dark yellow colored light.
TILE_MAIN_LIGHT_COLOR_PALE_GREEN
Specifies a pale green colored light.
TILE_MAIN_LIGHT_COLOR_PALE_ORANGE
Specifies a pale orange colored light.
TILE_MAIN_LIGHT_COLOR_PALE_PURPLE
Specifies a pale purple colored light.
TILE_MAIN_LIGHT_COLOR_PALE_RED
Specifies a pale red colored light.
TILE_MAIN_LIGHT_COLOR_PALE_YELLOW
Specifies a pale yellow colored light.
TILE_MAIN_LIGHT_COLOR_PURPLE
Specifies a purple colored light.
TILE_MAIN_LIGHT_COLOR_RED
Specifies a red colored light.
TILE_MAIN_LIGHT_COLOR_WHITE
Specifies a white colored light.
TILE_MAIN_LIGHT_COLOR_YELLOW
Specifies a yellow colored light.

See Also

functions: GetTileMainLight1Color | GetTileMainLight2Color | SetTileMainLightColor


Constant - TRAP_BASE_TYPE

Home > Reference > Constants > TRAP_BASE_TYPE_*

TRAP_BASE_TYPE_* Constant Group

Used to catagorize the strength and type of traps.

Constants

Constant Description
TRAP_BASE_TYPE_AVERAGE_ACID
Average damage amount, Acid damage type trap.
TRAP_BASE_TYPE_AVERAGE_ACID_SPLASH
Average damage amount, Acid splash damage type trap.
TRAP_BASE_TYPE_AVERAGE_ELECTRICAL
Average damage amount, Electrical damage type trap.
TRAP_BASE_TYPE_AVERAGE_FIRE
Average damage amount, Fire damage type trap.
TRAP_BASE_TYPE_AVERAGE_FROST
Average frost trap.
TRAP_BASE_TYPE_AVERAGE_GAS
Average damage amount, Gas damage type trap.
TRAP_BASE_TYPE_AVERAGE_HOLY
Average damage amount, Holy damage type trap.
TRAP_BASE_TYPE_AVERAGE_NEGATIVE
Average damage amount, Negative damage type trap.
TRAP_BASE_TYPE_AVERAGE_SONIC
Average damage amount, Sonic damage type trap.
TRAP_BASE_TYPE_AVERAGE_SPIKE
Average damage amount, Spike damage type trap.
TRAP_BASE_TYPE_AVERAGE_TANGLE
Average damage & duration amount, Tangle damage type trap. This trap also slows PC for a length of time.
TRAP_BASE_TYPE_DEADLY_ACID
Deadly damage amount, Acid damage type trap.
TRAP_BASE_TYPE_DEADLY_ACID_SPLASH
Deadly damage amount, Acid splash damage type trap.
TRAP_BASE_TYPE_DEADLY_ELECTRICAL
Deadly damage amount, Electrical damage type trap.
TRAP_BASE_TYPE_DEADLY_FIRE
Deadly damage amount, Fire damage type trap.
TRAP_BASE_TYPE_DEADLY_FROST
Deadly damage amount, Frost damage type trap.
TRAP_BASE_TYPE_DEADLY_GAS
Deadly damage amount, Gas damage type trap.
TRAP_BASE_TYPE_DEADLY_HOLY
Deadly damage amount, Holy damage type trap.
TRAP_BASE_TYPE_DEADLY_NEGATIVE
Deadly damage amount, Negative damage type trap.
TRAP_BASE_TYPE_DEADLY_SONIC
Deadly damage amount, Sonic damage type trap.
TRAP_BASE_TYPE_DEADLY_SPIKE
Deadly damage amount, Spike damage type trap.
TRAP_BASE_TYPE_DEADLY_TANGLE
Deadly damage and duration amount, Tangle damage type trap. This trap also slows the PC down for a length of time.
TRAP_BASE_TYPE_MINOR_ACID
Minor damage amount, Acid damage type trap.
TRAP_BASE_TYPE_MINOR_ACID_SPLASH
Minor damage amount, Acid splash damage type trap.
TRAP_BASE_TYPE_MINOR_ELECTRICAL
Minor damage amount, Electrical damage type trap.
TRAP_BASE_TYPE_MINOR_FIRE
Minor damage amount, Fire damage type trap.
TRAP_BASE_TYPE_MINOR_FROST
Minor damage amount, Frost damage type trap.
TRAP_BASE_TYPE_MINOR_GAS
Minor damage amount, Gas damage type trap.
TRAP_BASE_TYPE_MINOR_HOLY
Minor damage amount, Holy damage type trap.
TRAP_BASE_TYPE_MINOR_SONIC
Minor damage amount, Sonic damage type trap.
TRAP_BASE_TYPE_MINOR_SPIKE
Minor damage amount, Spike damage type trap.
TRAP_BASE_TYPE_MINOR_TANGLE
Minor damage and duration amount, Tangle damage type trap. This type of trap also slows the PC down for a length of time.
TRAP_BASE_TYPE_STRONG_ACID
Strong damage amount, Acid damage type trap.
TRAP_BASE_TYPE_STRONG_ACID_SPLASH
Strong damage amount, Acid splash damage type trap.
TRAP_BASE_TYPE_STRONG_ELECTRICAL
Strong damage amount, Electrical splash damage type trap.
TRAP_BASE_TYPE_STRONG_FIRE
Strong damage amount, Fire damage type trap.
TRAP_BASE_TYPE_STRONG_FROST
Strong damage amount, Frost damage type trap.
TRAP_BASE_TYPE_STRONG_GAS
Strong damage amount, Gas damage type trap.
TRAP_BASE_TYPE_STRONG_HOLY
Strong damage amount, Holy damage type trap.
TRAP_BASE_TYPE_STRONG_NEGATIVE
Strong damage amount, Negative damage type trap.
TRAP_BASE_TYPE_STRONG_SONIC
Strong damage amount, Sonic damage type trap.
TRAP_BASE_TYPE_STRONG_SPIKE
Strong damage amount, Spike damage type trap.
TRAP_BASE_TYPE_STRONG_TANGLE
Strong damage and duration amount, Tangle damage type trap. This trap also slows the PC down for a length of time.

See Also

functions: GetTrapBaseType


Constant - TREASURE

Home > Reference > Constants > TREASURE_*

TREASURE_* Constant Group

Treasure types. These constants are defined in "nw_o2_coninclude"; in order to use the constant values the file "nw_o2_coninclude" must be included (using the "#include" compiler directive).

Constants

Constant Description
TREASURE_BOOK
One of the many books.
TREASURE_BOSS
The best type of treasure that can be acquired. Normally boss treasures are determined based on the character acquiring them.
TREASURE_HIGH
A good treasure.
TREASURE_LOW
A small amount of treasure.
TREASURE_MEDIUM
A standard alottment of treasure.

See Also

functions: GetNumberOfItems


Constant - VFX_BEAM

Home > Reference > Constants > VFX_BEAM_*

VFX_BEAM_* Constant Group

Beams fire in a straight line towards their targets.

Constants

Constant Description
VFX_BEAM_COLD
A beam of frost from the source to target.
Location: Body
Color(s): blue, white
VFX_BEAM_EVIL
A beam of evil from the source to target.
Location: Body
Color(s): red, white
VFX_BEAM_FIRE
A beam of fire from the source to target.
Location: Body
Color(s): fire, yellow
VFX_BEAM_FIRE_LASH
Two lashing whips of fire from source to target.
Location: Body
Color(s): fire, yellow
VFX_BEAM_HOLY
A divine beam from source to target.
Location: Body
Color(s): yellow
VFX_BEAM_LIGHTNING
A beam of lightning from the source to target.
Location: Body
Color(s): blue, white
VFX_BEAM_MIND
A beam of mental power from the source to target.
Location: Body
Color(s): purple, white
VFX_BEAM_ODD
Another color beam attack.
Location: Body
Color(s): purple, white

See Also

functions: EffectBeam


Constant - VFX_COM

Home > Reference > Constants > VFX_COM_*

VFX_COM_* Constant Group

Common visual special effects.

Constants

Constant Description
VFX_COM_BLOOD_CRT_GREEN
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): green
VFX_COM_BLOOD_CRT_RED
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): red
VFX_COM_BLOOD_CRT_WIMP
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): white
VFX_COM_BLOOD_CRT_YELLOW
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): yellow
VFX_COM_BLOOD_LRG_GREEN
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): green
VFX_COM_BLOOD_LRG_RED
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): red
VFX_COM_BLOOD_LRG_WIMP
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): white
VFX_COM_BLOOD_LRG_YELLOW
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): yellow
VFX_COM_BLOOD_REG_GREEN
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): green
VFX_COM_BLOOD_REG_RED
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): red
VFX_COM_BLOOD_REG_WIMP
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): white
VFX_COM_BLOOD_REG_YELLOW
This effect produces a small ring of color around the neck area for a second.
Location: Neck
Color(s): yellow
VFX_COM_BLOOD_SPARK_LARGE
White sparks coming from chest area of target.
Location: Chest
Color(s): white
VFX_COM_BLOOD_SPARK_MEDIUM
White sparks coming from chest area of target. An image can be found under VFX_COM_BLOOD_SPARK_LARGE
Location: Chest
Color(s): white
VFX_COM_BLOOD_SPARK_SMALL
White sparks coming from chest area of target. An image can be found under VFX_COM_BLOOD_SPARK_LARGE
Location: Chest
Color(s): white
VFX_COM_CHUNK_BONE_MEDIUM
Gray cloud of smoke and bones exploding about head area.
Location: About Head
Color(s): gray
VFX_COM_CHUNK_GREEN_MEDIUM
Green slime and bones exploding and falling to the ground
Location: About Body
Color(s): green
VFX_COM_CHUNK_GREEN_SMALL
Smaller version of VFX_COM_CHUNK_GREEN_MEDIUM
Location: About Body
Color(s): green
VFX_COM_CHUNK_RED_LARGE
Red blood and bones exploding and falling to the ground
Location: About Body
Color(s): red
VFX_COM_CHUNK_RED_MEDIUM
Smaller version of VFX_COM_CHUNK_RED_LARGE
Location: About Body
Color(s): red
VFX_COM_CHUNK_RED_SMALL
Smaller version of VFX_COM_CHUNK_RED_LARGE
Location: About Body
Color(s): red
VFX_COM_CHUNK_YELLOW_MEDIUM
Yellow-green slime and bones exploding and falling to the ground
Location: About Body
Color(s): yellow
VFX_COM_CHUNK_YELLOW_SMALL
Smaller version of VFX_COM_CHUNK_YELLOW_MEDIUM
Location: About Body
Color(s): yellow
VFX_COM_HIT_ACID
Green spears of light protruding from torso area
Location: About Body
Color(s): green
VFX_COM_HIT_DIVINE
Yellow spears of light protruding from torso area
Location: About Body
Color(s): yellow
VFX_COM_HIT_ELECTRICAL
Blue-White (electric) spears of light protruding from torso area
Location: About Body
Color(s): electric
VFX_COM_HIT_FIRE
Puff of fire covering torso area
Location: About Body
Color(s): fire
VFX_COM_HIT_FROST
White spears of light protruding from torso area
Location: About Body
Color(s): white
VFX_COM_HIT_NEGATIVE
Red spears of light protruding from torso area
Location: About Body
Color(s): red
VFX_COM_HIT_SONIC
White spears of light protruding from torso area
Location: About Body
Color(s): white
VFX_COM_SPARKS_PARRY
Sparks from a parry.
Location: Feet
Color(s): white
VFX_COM_SPECIAL_BLUE_RED
Didn't work, no image.
VFX_COM_SPECIAL_PINK_ORANGE
Didn't work, no image.
VFX_COM_SPECIAL_RED_ORANGE
Didn't work, no image.
VFX_COM_SPECIAL_RED_WHITE
Didn't work, no image.
VFX_COM_SPECIAL_WHITE_BLUE
Didn't work, no image.
VFX_COM_SPECIAL_WHITE_ORANGE
Didn't work, no image.
VFX_COM_UNLOAD_MODEL
No image. Not sure what this does.

See Also

Send comments on this topic.


Constant - VFX_DUR

Home > Reference > Constants > VFX_DUR_*

VFX_DUR_* Constant Group

Temporary visual effects that last for a specified duration.

Constants

Constant Description
VFX_DUR_ANTI_LIGHT_10
Temporary lighting effect; darken area and change of light color.
Location: Area
VFX_DUR_AURA_COLD
Orbiting effect 5m from the body.
Location: About Body
Color(s): blue
VFX_DUR_AURA_DISEASE
Orbiting effect 5m from the body.
Location: About Body
Color(s): green, brown
VFX_DUR_AURA_DRAGON_FEAR
Orbiting effect 5m from the body.
Location: About Body
VFX_DUR_AURA_FIRE
Orbiting effect 5m from the body.
Location: About Body
Color(s): fire, yellow
VFX_DUR_AURA_ODD
Orbiting effect 5m from the body.
Location: About Body
VFX_DUR_AURA_POISON
Orbiting effect 5m from the body.
Location: About Body
Color(s): green
VFX_DUR_AURA_SILENCE
Orbiting effect 5m from the body.
Location: About Body
VFX_DUR_BARD_SONG
Floating notes over PC head.
Location: Above Head
Color(s): white
VFX_DUR_BLACKOUT
Creates a completely dark area fullscreen.
VFX_DUR_BLIND
Didn't work, no image
VFX_DUR_BLINDVISION
Didn't work, no image
VFX_DUR_BLUR
Creates a pulsating aura, colored blue and white.
VFX_DUR_CESSATE_NEGATIVE
Causes a small animation to occur to signal that an effect has worn off. The CESSATE effects POSITIVE and NEGATIVE are "effect active" and "effect inactive" effects. Example: Apply both effects at the same time with a duration of 10 seconds. Then first the CESSATE_POSITIVE effect will appear. At the end of the 10 seconds the CESSATE_NEGATIVE effect will appear. So using the CESSATE_NEGATIVE saves the hassle of an additional DelayCommand.
Location: About Body
VFX_DUR_CESSATE_NEUTRAL
Causes a small animation to occur to signal that a neutral effect has worn off (colored balls that disappear fast).
Location: About Body
VFX_DUR_CESSATE_POSITIVE
Causes a small animation to occur to signal that an effect has worn off (bright balls that disappear fast). The CESSATE effects POSITIVE and NEGATIVE are "effect active" and "effect inactive" effects. Example: Apply both effects at the same time with a duration of 10 seconds. Then first the CESSATE_POSITIVE effect will appear. At the end of the 10 seconds the CESSATE_NEGATIVE effect will appear. So using the CESSATE_NEGATIVE saves the hassle of an additional DelayCommand.
Location: About Body
VFX_DUR_DARKNESS
Creates a dark area around target. No image.
Location: Area
Color(s): dark
VFX_DUR_DARKVISION
Didn't work no image.
VFX_DUR_ELEMENTAL_SHIELD
Fiery circular pattern on the floor.
Location: Floor
Color(s): blue, fire
VFX_DUR_ENTANGLE
A single bush entangles the feet.
Location: Floor
Color(s): green
VFX_DUR_ETHEREAL_VISAGE
Translucent ghost image with short visual effect above head.
Location: Above Head
VFX_DUR_FREEDOM_OF_MOVEMENT
Green translucent floor design.
Location: Floor
Color(s): green
VFX_DUR_GHOSTLY_PULSE
Pulsating from solid appearance to translucent.
Location: About Body
VFX_DUR_GHOSTLY_VISAGE
Translucent ghost image.
VFX_DUR_GLOBE_INVULNERABILITY
White globe around target.
VFX_DUR_GLOBE_MINOR
Weaker-looking globe no image.
VFX_DUR_INVISIBILITY
Makes the creature invisible (difficult to see).
Location: About Body
VFX_DUR_LIGHT
Didn't work, no image.
VFX_DUR_LIGHT_BLUE_10
Creates an area of colored blue light in a 10 foot radius.
Location: Floor
VFX_DUR_LIGHT_BLUE_15
Creates an area of colored blue light in a 15 foot radius.
Location: Floor
VFX_DUR_LIGHT_BLUE_20
Creates an area of colored blue light in a 20 foot radius.
Location: Floor
VFX_DUR_LIGHT_BLUE_5
Creates an area of colored blue light in a 5 foot radius.
Location: Floor
VFX_DUR_LIGHT_GREY_10
Creates an area of colored gray light in a 10 foot radius.
Location: Floor
VFX_DUR_LIGHT_GREY_15
Creates an area of colored gray light in a 15 foot radius.
Location: Floor
VFX_DUR_LIGHT_GREY_20
Creates an area of colored gray light in a 20 foot radius.
Location: Floor
VFX_DUR_LIGHT_GREY_5
Creates an area of colored gray light in a 5 foot radius.
Location: Floor
VFX_DUR_LIGHT_ORANGE_10
Creates an area of colored orange light in a 10 foot radius.
Location: Floor
VFX_DUR_LIGHT_ORANGE_15
Creates an area of colored orange light in a 15 foot radius.
Location: Floor
VFX_DUR_LIGHT_ORANGE_20
Creates an area of colored orange light in a 20 foot radius.
Location: Floor
VFX_DUR_LIGHT_ORANGE_5
Creates an area of colored orange light in a 5 foot radius.
Location: Floor
VFX_DUR_LIGHT_PURPLE_10
Creates an area of colored purple light in a 10 foot radius.
Location: Floor
VFX_DUR_LIGHT_PURPLE_15
Creates an area of colored purple light in a 15 foot radius.
Location: Floor
VFX_DUR_LIGHT_PURPLE_20
Creates an area of colored purple light in a 20 foot radius.
Location: Floor
VFX_DUR_LIGHT_PURPLE_5
Creates an area of colored purple light in a 5 foot radius.
Location: Floor
VFX_DUR_LIGHT_RED_10
Creates an area of colored red light in a 10 foot radius.
Location: Floor
VFX_DUR_LIGHT_RED_15
Creates an area of colored red light in a 15 foot radius.
Location: Floor
VFX_DUR_LIGHT_RED_20
Creates an area of colored red light in a 20 foot radius.
Location: Floor
VFX_DUR_LIGHT_RED_5
Creates an area of colored red light in a 5 foot radius.
Location: Floor
VFX_DUR_LIGHT_WHITE_10
Creates an area of colored white light in a 10 foot radius.
Location: Floor
VFX_DUR_LIGHT_WHITE_15
Creates an area of colored white light in a 15 foot radius.
Location: Floor
VFX_DUR_LIGHT_WHITE_20
Creates an area of colored white light in a 20 foot radius.
Location: Floor
VFX_DUR_LIGHT_WHITE_5
Creates an area of colored white light in a 5 foot radius.
Location: Floor
VFX_DUR_LIGHT_YELLOW_10
Creates an area of colored yellow light in a 10 foot radius.
Location: Floor
VFX_DUR_LIGHT_YELLOW_15
Creates an area of colored yellow light in a 15 foot radius.
Location: Floor
VFX_DUR_LIGHT_YELLOW_20
Creates an area of colored yellow light in a 20 foot radius.
Location: Floor
VFX_DUR_LIGHT_YELLOW_5
Creates an area of colored yellow light in a 5 foot radius.
Location: Floor
VFX_DUR_LOWLIGHTVISION
Didn't work, no image.
Location: Floor
VFX_DUR_MAGIC_RESISTANCE
Translucent blue orbital pattern about body.
Location: About Body
Color(s): blue
VFX_DUR_MAGICAL_SIGHT
Little eyes orbiting the head.
Location: About Head
Color(s): multi
VFX_DUR_MIND_AFFECTING_DISABLED
Shimmering light about the head.
Location: About Head
Color(s): white
VFX_DUR_MIND_AFFECTING_DOMINATED
Shimmering light about the head.
Location: About Head
Color(s): white, blue
VFX_DUR_MIND_AFFECTING_FEAR
The fear effect.
Location: About Head
Color(s): black, yellow
VFX_DUR_MIND_AFFECTING_NEGATIVE
Shimmering light about the head.
Location: About Head
Color(s): blue, white
VFX_DUR_MIND_AFFECTING_POSITIVE
Short spears of light slanting up and away from head and rotating in an orbit.
Location: About Head
Color(s): white
VFX_DUR_MIRV_ACID
An acid arrow.
Location: To Body
Color(s): green
VFX_DUR_PARALYZE_HOLD
White pattern orbiting the body.
Location: About Body
Color(s): white
VFX_DUR_PARALYZED
Like blur, but colors white and red.
Location: About Body
VFX_DUR_PROT_BARKSKIN
Re-textures a creature with a "wood" appearance.
Location: About Body
VFX_DUR_PROT_GREATER_STONESKIN
Re-textures a creature with a "stone" appearance.
Location: About Body
VFX_DUR_PROT_PREMONITION
Blue mist forming about body
Location: About Body
Color(s): blue
VFX_DUR_PROT_SHADOW_ARMOR
Create a "shadow armor" effect (re-texturing the object with a moving black/white pattern).
VFX_DUR_PROT_STONESKIN
Re-textures a creature with a "stone" appearance.
VFX_DUR_PROTECTION_ELEMENTS
Yellow/White engulf effect.
Location: About Body
Color(s): white, yellow
VFX_DUR_PROTECTION_EVIL_MAJOR
Red engulf effect.
Location: About Body
Color(s): red
VFX_DUR_PROTECTION_EVIL_MINOR
Red floating lights above head.
Location: Above Head
Color(s): red
VFX_DUR_PROTECTION_GOOD_MAJOR
Yellow engulf effect.
Location: About Body
Color(s): yellow
VFX_DUR_PROTECTION_GOOD_MINOR
Yellow floating lights above head.
Location: Above Head
Color(s): yellow
VFX_DUR_SANCTUARY
White dancing lights around body.
Location: About Body
Color(s): white, purple
VFX_DUR_SPELLTURNING
Bright blue effect.
Location: Floor
Color(s): blue
VFX_DUR_ULTRAVISION
Didn't work no image.
VFX_DUR_WEB
Web on target.
Location: Feet
Color(s): white
VFX_DUR_WEB_MASS
Web covering area.
Location: Area
Color(s): white

See Also

functions: EffectPetrify


Constant - VFX_FNF

Home > Reference > Constants > VFX_FNF_*

VFX_FNF_* Constant Group

Bigger, flashier visual effects.

Constants

Constant Description
VFX_FNF_BLINDDEAF
Bright white light effect.
Location: Area
Color(s): white
VFX_FNF_DISPEL
Bright white light effect.
Location: Area
Color(s): white
VFX_FNF_DISPEL_DISJUNCTION
Bright white/blue light effect.
Location: Area
Color(s): white, blue
VFX_FNF_DISPEL_GREATER
Bright white light effect.
Location: Area
Color(s): white
VFX_FNF_FIREBALL
Exploding Fireball
Location: Area
Color(s): fire, yellow
VFX_FNF_FIRESTORM
Imploding area (huge)
Location: Area
Color(s): fire, yellow
VFX_FNF_GAS_EXPLOSION_ACID
An explosion from the feet moving up and out.
Location: Feet
Color(s): green
VFX_FNF_GAS_EXPLOSION_EVIL
An explosion from the feet moving up and out.
Location: Feet
Color(s): red
VFX_FNF_GAS_EXPLOSION_FIRE
An explosion from the feet moving up and out.
Location: Feet
Color(s): fire, yellow
VFX_FNF_GAS_EXPLOSION_GREASE
An explosion from the feet moving up and out.
Location: Feet
Color(s): black, dark
VFX_FNF_GAS_EXPLOSION_MIND
An explosion from the feet moving up and out.
Location: Feet
Color(s): blue, white
VFX_FNF_GAS_EXPLOSION_NATURE
An explosion from the feet moving up and out.
Location: Feet
Color(s): brown, green
VFX_FNF_HORRID_WILTING
This looks like a bog of stench.
Location: Area
Color(s): brown, green
VFX_FNF_HOWL_MIND
A bursting ring starting at the head and moving outward.
Location: About Head
Color(s): blue
VFX_FNF_HOWL_ODD
A bursting ring starting at the head and moving outward.
Location: About Head
Color(s): purple
VFX_FNF_HOWL_WAR_CRY
A bursting ring starting at the head and moving outward.
Location: About Head
Color(s): white
VFX_FNF_HOWL_WAR_CRY_FEMALE
A bursting ring starting at the head and moving outward.
Location: About Head
Color(s): white
VFX_FNF_ICESTORM
Huge icicles rain down from the sky.
Location: Area
Color(s): blue
VFX_FNF_IMPLOSION
Dark area in center, firey circle implodes.
Location: Area
Color(s): fire, yellow, black
VFX_FNF_LOS_EVIL_10
Large, translucent design on the floor. The screen shots are at a 30.
Location: Area
Color(s): red
VFX_FNF_LOS_EVIL_20
Large, translucent design on the floor. The screen shots are at a 30.
Location: Area
Color(s): red
VFX_FNF_LOS_EVIL_30
Large, translucent design on the floor. The screen shots are at a 30.
Location: Area
Color(s): red
VFX_FNF_LOS_HOLY_10
Large, translucent design on the floor. The screen shots are at a 30.
Location: Area
Color(s): yellow
VFX_FNF_LOS_HOLY_20
Large, translucent design on the floor. The screen shots are at a 30.
Location: Area
Color(s): yellow
VFX_FNF_LOS_HOLY_30
Large, translucent design on the floor. The screen shots are at a 30.
Location: Area
Color(s): yellow
VFX_FNF_LOS_NORMAL_10
Large, translucent design on the floor. The screen shots are at a 30.
Location: Area
Color(s): white
VFX_FNF_LOS_NORMAL_20
Large, translucent design on the floor. The screen shots are at a 30.
Location: Area
Color(s): white
VFX_FNF_LOS_NORMAL_30
Large, translucent design on the floor. The screen shots are at a 30.
Location: Area
Color(s): white
VFX_FNF_MASS_HEAL
Didn't work no images.
VFX_FNF_MASS_MIND_AFFECTING
Didn't work no images.
VFX_FNF_METEOR_SWARM
Falling meteors from the sky.
Location: Area
Color(s): fire, black
VFX_FNF_NATURES_BALANCE
Green vapors lifting from the ground around the target.
Location: Area
Color(s): green
VFX_FNF_PWKILL
Red translucent circular designs on the floor.
Location: Area
Color(s): red
VFX_FNF_PWSTUN
White dots orbiting and purple vapors lifting.
Location: About Body
Color(s): white, purple
VFX_FNF_SCREEN_BUMP
One bump of the screen no image.
Location: Area
VFX_FNF_SCREEN_SHAKE
Continual shaking screen no image.
Location: Area
VFX_FNF_SMOKE_PUFF
Light gray smoke rising from floor.
Location: Floor
Color(s): white, gray
VFX_FNF_SOUND_BURST
White rings on floor and white rays above head
Location: Floor
Color(s): white
VFX_FNF_STORM
Didn't work no image.
VFX_FNF_STRIKE_HOLY
Huge yellow/white beam from above floods target
Location: Area
Color(s): yellow, white
VFX_FNF_SUMMON_CELESTIAL
Three large ice pillars rise from the floor and a bright blue, white beam of light comes down from above.
Location: Area
Color(s): blue, white
VFX_FNF_SUMMON_GATE
Three large stone pillars rise from the floor and a bright beam of fire comes down from above.
Location: Area
Color(s): fire, yellow
VFX_FNF_SUMMON_MONSTER_1
Explosion of gray smoke
Location: About Body
Color(s): gray
VFX_FNF_SUMMON_MONSTER_2
Translucent design on floor and white light about body
Location: About Body
Color(s): purple, white
VFX_FNF_SUMMON_MONSTER_3
Translucent design on floor and white/blue light rising about body.
Location: About Body
Color(s): white, yellow
VFX_FNF_SUMMON_UNDEAD
White light bursts from body
Location: About Body
Color(s): white
VFX_FNF_SUNBEAM
Huge yellow light floods area.
Location: Area
Color(s): Yellow
VFX_FNF_TIME_STOP
Translucent rings of blue surround area
Location: Area
Color(s): blue, white
VFX_FNF_WAIL_O_BANSHEES
Banshee in fetal position above head suddenly screams and a white burst of energy is sent out in a ring.
Location: Area
Color(s): white
VFX_FNF_WEIRD
A large 3-headed creature comes up from the ground and lashes out
Location: Area
VFX_FNF_WORD
Large yellow floor design about 10m across
Location: Area
Color(s): yellow

See Also

Send comments on this topic.


Constant - VFX_IMP

Home > Reference > Constants > VFX_IMP_*

VFX_IMP_* Constant Group

Impact visual effects that are generally used for spells when the spell effect hits someone. VFX_IMP_* -type effects can only be applied with DURATION_TYPE_INSTANT

Constants

Constant Description
VFX_IMP_AC_BONUS
Three white rings orbit body (similar to the Mage Armor spell)
Location: About Body
Color(s): white
VFX_IMP_ACID_L
Acid burst at feet.
Location: Feet
Color(s): green
VFX_IMP_ACID_S
Acid burst on body.
Location: About Body
Color(s): green
VFX_IMP_AURA_FEAR
Small balls orbiting body at approximately 10m.
Location: About body
Color(s): green
VFX_IMP_AURA_HOLY
Small balls orbiting body at approximately 10m.
Location: About body
Color(s): yellow?
VFX_IMP_AURA_NEGATIVE_ENERGY
Small balls orbiting body at approximately 10m.
Location: About body
Color(s): red
VFX_IMP_AURA_UNEARTHLY
Small balls orbiting body at approximately 10m.
Location: About body
Color(s): ?
VFX_IMP_BLIND_DEAF_M
White halo effect around head.
Location: About Head
Color(s): white
VFX_IMP_BREACH
White sparkle effect about body.
Location: About Body
Color(s): white, blue
VFX_IMP_CHARM
Purple/Blue effect about body.
Location: About Body
Color(s): purple, blue
VFX_IMP_CONFUSION_S
White lightning effect about head.
Location: Above Head
Color(s): white
VFX_IMP_DAZED_S
White orbit effect about head.
Location: About Head
Color(s): white
VFX_IMP_DEATH
White imploding effect about body.
Location: About Body
Color(s): white
VFX_IMP_DEATH_L
Didn't work no image.
VFX_IMP_DEATH_WARD
Purple orbit effect about body.
Location: About Body
Color(s): purple
VFX_IMP_DESTRUCTION
Purple imploding effect at body.
Location: About Body
Color(s): purple
VFX_IMP_DISEASE_S
Brown/Green burst on neck.
Location: Neck
Color(s): brown, green
VFX_IMP_DISPEL
White sparkle effect about body.
Location: About Body
Color(s): white
VFX_IMP_DISPEL_DISJUNCTION
Didn't work no image.
VFX_IMP_DIVINE_STRIKE_FIRE
Fiery beam from above.
Location: Area
Color(s): fire, yellow
VFX_IMP_DIVINE_STRIKE_HOLY
White orbiting and imploding effect about head.
Location: About Head
Color(s): white
VFX_IMP_DOMINATE_S
White orbiting effect about head.
Location: About Head
Color(s): white
VFX_IMP_DOOM
Black cloud over head.
Location: Over Head
Color(s): dark, black
VFX_IMP_ELEMENTAL_PROTECTION
Fire consume and white rain effects.
Location: About body
Color(s): green, yellow
VFX_IMP_EVIL_HELP
Red translucent pattern on floor.
Location: Floor
Color(s): red
VFX_IMP_FEAR_S
Didn't work no image.
VFX_IMP_FLAME_M
Fire consume effect.
Location: About Body
Color(s): fire, yellow
VFX_IMP_FLAME_S
Yellow flash then smoke around head. No image.
VFX_IMP_FORTITUDE_SAVING_THROW_USE
Single purple ball rising above head.
Location: Over head
Color(s): purple
VFX_IMP_FROST_L
Blue bursting effect about body.
Location: About Body
Color(s): blue
VFX_IMP_FROST_S
White bursting effect about neck with smoke.
Location: Neck
Color(s): white
VFX_IMP_GLOBE_USE
White flickering globe surrounding target.
Location: About Body
Color(s): white
VFX_IMP_GOOD_HELP
Yellow translucent design on floor.
Location: Floor
Color(s): yellow
VFX_IMP_GREASE
Didn't work no image.
VFX_IMP_HARM
Red beam of light from above.
Location: About body
Color(s): red
VFX_IMP_HASTE
Blue impoding effect on floor about feet.
Location: Floor
Color(s): blue
VFX_IMP_HEAD_ACID
Four small beams which rise above the head and join over head.
Location: About head
Color(s): green
VFX_IMP_HEAD_COLD
Four small beams which rise above the head and join over head.
Location: About head
Color(s): ?
VFX_IMP_HEAD_ELECTRICITY
Four small beams which rise above the head and join over head.
Location: About head
Color(s): electric, blue, white
VFX_IMP_HEAD_EVIL
Four small beams which rise above the head and join over head.
Location: About head
Color(s): red
VFX_IMP_HEAD_FIRE
Four small beams which rise above the head and join over head.
Location: About head
Color(s): fire, flame, yellow
VFX_IMP_HEAD_HEAL
Four small beams which rise above the head and join over head.
Location: About head
Color(s): ?
VFX_IMP_HEAD_HOLY
Four small beams which rise above the head and join over head.
Location: About head
Color(s): ?
VFX_IMP_HEAD_MIND
Four small beams which rise above the head and join over head.
Location: About head
Color(s): ?
VFX_IMP_HEAD_NATURE
Four small beams which rise above the head and join over head.
Location: About head
Color(s): ?
VFX_IMP_HEAD_ODD
Four small beams which rise above the head and join over head.
Location: About head
Color(s): ?
VFX_IMP_HEAD_SONIC
Four small beams which rise above the head and join over head.
Location: About head
Color(s): white
VFX_IMP_HEALING_G
Cure critical wounds.
Location: About body
Color(s): yellow, blue
VFX_IMP_HEALING_L
Cure light wounds.
Location: About body
Color(s): white, blue
VFX_IMP_HEALING_M
Cure moderate wounds.
Location: About Head
Color(s): white, yellow
VFX_IMP_HEALING_S
Cure serious wounds.
Location: About body
Color(s): white, blue
VFX_IMP_HEALING_X
Heal spell effect.
Location: About body
Color(s): white, blue
VFX_IMP_HOLY_AID
Yellow imploding effect on body.
Location: About body
Color(s): yellow
VFX_IMP_IMPROVE_ABILITY_SCORE
Multi-color lights orbiting head.
Location: About head
Color(s): multicolor
VFX_IMP_KNOCK
White-blue light on body.
Location: About body
Color(s): blue, white
VFX_IMP_LIGHTNING_M
Huge lightning bolt from above.
Location: About body
Color(s): blue, white
VFX_IMP_LIGHTNING_S
Lightning blast from body.
Location: About body
Color(s): blue, white
VFX_IMP_MAGBLUE
White burst about body.
Location: About body
Color(s): white
VFX_IMP_MAGIC_PROTECTION
Blue consume turns into a white rain effect.
Location: About body
Color(s): blue
VFX_IMP_MAGIC_RESISTANCE_USE
Small white burst above head.
Location: Over head
Color(s): white
VFX_IMP_MAGICAL_VISION
Little multi-color eyes orbiting head.
Location: About head
Color(s): multicolor
VFX_IMP_MIRV
Magical projectile (like magic missile).
Location: Body
Color(s): white
VFX_IMP_MIRV_FLAME
Flaming arrow.
Location: Body
Color(s): fire, yellow
VFX_IMP_NEGATIVE_ENERGY
Red/White burst about body with a red cloud.
Location: Body
Color(s): red, white
VFX_IMP_POISON_L
Green cloud about body.
Location: Body
Color(s): green
VFX_IMP_POISON_S
Looks similar to VFX_IMP_POISON_L.
VFX_IMP_POLYMORPH
Green/White consume effect.
Location: About body
Color(s): white, green
VFX_IMP_PULSE_COLD
Pulse of energy along floor.
Location: floor
Color(s): ?
VFX_IMP_PULSE_FIRE
Pulse of energy along floor.
Location: floor
Color(s): fire, yellow
VFX_IMP_PULSE_HOLY
Pulse of energy along floor.
Location: floor
Color(s): ?
VFX_IMP_PULSE_NATURE
Pulse of energy along floor.
Location: floor
Color(s): ?
VFX_IMP_PULSE_NEGATIVE
Pulse of energy along floor.
Location: floor
Color(s): red
VFX_IMP_PULSE_WATER
Pulse of energy along floor.
Location: floor
Color(s): blue
VFX_IMP_PULSE_WIND
Pulse of energy along floor.
Location: floor
Color(s): ?
VFX_IMP_RAISE_DEAD
Floating skeleton (horizontal).
Location: About body
Color(s): white
VFX_IMP_REDUCE_ABILITY_SCORE
Red imploding effect about body.
Location: About Body
Color(s): red, dark, black
VFX_IMP_REFLEX_SAVE_THROW_USE
Single green ball rising above head.
Location: Above head
Color(s): green
VFX_IMP_REMOVE_CONDITION
Didn't work, no image
VFX_IMP_RESTORATION
Didn't work, no image
VFX_IMP_RESTORATION_GREATER
Didn't work, no image
VFX_IMP_RESTORATION_LESSER
Didn't work, no image
VFX_IMP_SILENCE
White burst effect above head.
Location: Above head
Color(s): white
VFX_IMP_SLEEP
Floating white Z's above head.
Location: Above head
Color(s): white
VFX_IMP_SLOW
Purple imploding effect on floor
Location: Floor
Color(s): purple
VFX_IMP_SONIC
White halo.
Location: About head
Color(s): white
VFX_IMP_SPELL_MANTLE_USE
White-blue globe of square panels about body.
Location: About Body
Color(s): blue, white
VFX_IMP_SPIKE_TRAP
Spike trap effect. No image provided.
VFX_IMP_STUN
White rays from head.
Location: About head
Color(s): white
VFX_IMP_SUNSTRIKE
Yellow/White burst about body.
Location: About body
Color(s): yellow, white
VFX_IMP_SUPER_HEROISM
White consume effect.
Location: About body
Color(s): white
VFX_IMP_UNSUMMON
Blue translucent floor design & white consume.
Location: Floor, about body
Color(s): blue, white
VFX_IMP_WILL_SAVING_THROW_USE
Single white ball rising above head.
Location: Above head
Color(s): white

See Also

functions: PlaySuccessVisual


Constant - VOICE_CHAT

Home > Reference > Constants > VOICE_CHAT_*

VOICE_CHAT_* Constant Group

List of character voice sayings.

Constants

Constant Description
VOICE_CHAT_ATTACK
Attack saying.
VOICE_CHAT_BADIDEA
UNKNOWN
VOICE_CHAT_BATTLECRY1
First battlecry voice.
VOICE_CHAT_BATTLECRY2
Second battlecry.
VOICE_CHAT_BATTLECRY3
Third battlecry.
VOICE_CHAT_BORED
UNKNOWN
VOICE_CHAT_CANDO
UNKNOWN
VOICE_CHAT_CANTDO
UNKNOWN
VOICE_CHAT_CHEER
UNKNOWN
VOICE_CHAT_CUSS
UNKNOWN
VOICE_CHAT_DEATH
UNKNOWN
VOICE_CHAT_ENCUMBERED
UNKNOWN
VOICE_CHAT_ENEMIES
The enemies are close saying.
VOICE_CHAT_FLEE
Call to flee saying.
VOICE_CHAT_FOLLOWME
UNKNOWN
VOICE_CHAT_GATTACK1
UNKOWN
VOICE_CHAT_GATTACK2
UNKOWN
VOICE_CHAT_GATTACK3
UNKOWN
VOICE_CHAT_GOODBYE
UNKNOWN
VOICE_CHAT_GOODIDEA
UNKNOWN
VOICE_CHAT_GROUP
UNKNOWN
VOICE_CHAT_GUARDME
The "guard me" saying.
VOICE_CHAT_HEALME
The "heal me" saying.
VOICE_CHAT_HELLO
UNKNOWN
VOICE_CHAT_HELP
Call for help saying
VOICE_CHAT_HIDE
UNKNOWN
VOICE_CHAT_HOLD
The hold position saying.
VOICE_CHAT_LAUGH
UNKNOWN
VOICE_CHAT_LOOKHERE
UNKNOWN
VOICE_CHAT_MOVEOVER
UNKNOWN
VOICE_CHAT_NEARDEATH
UNKNOWN
VOICE_CHAT_NO
UNKNOWN
VOICE_CHAT_PAIN1
UNKNOWN
VOICE_CHAT_PAIN2
UNKNOWN
VOICE_CHAT_PAIN3
UNKNOWN
VOICE_CHAT_PICKLOCK
UNKNOWN
VOICE_CHAT_POISONED
UNKNOWN
VOICE_CHAT_REST
UNKNOWN
VOICE_CHAT_SEARCH
UNKNOWN
VOICE_CHAT_SELECTED
UNKNOWN
VOICE_CHAT_SPELLFAILED
UNKNOWN
VOICE_CHAT_STOP
UNKNOWN
VOICE_CHAT_TALKTOME
UNKNOWN
VOICE_CHAT_TASKCOMPLETE
UNKNOWN
VOICE_CHAT_TAUNT
Taunt.
VOICE_CHAT_THANKS
UNKNOWN
VOICE_CHAT_THREATEN
UNKNOWN
VOICE_CHAT_WEAPONSUCKS
UNKNOWN
VOICE_CHAT_YES
UNKNOWN

See Also

functions: PlayVoiceChat


Constant - WEATHER

Home > Reference > Constants > WEATHER_*

WEATHER_* Constant Group

Different weather types.

Constants

Constant Description
WEATHER_CLEAR
Clear.
WEATHER_RAIN
Rain.
WEATHER_SNOW
Snow.
WEATHER_USE_AREA_SETTINGS
Use the settings defined for the current area.

See Also

functions: SetWeather


Data Typ Categories - Data Type

Home > Reference > Data Types

Data Types

データ型とは、値を格納するために使用される異なる変数の型です。

string型は文章だけを格納しますが、int型は小数点を持たない実数を格納します。

異なるデータ型は、異なった多様な使われ方をします。

Data Types

Data Type | Description
action | An action.
command | A void-returning function, whether it is user defined or engine-defined. This is used by the DelayCommand() and AssignCommand() functions.
constant | 定数(constant)とは値を変えることが出来ない数値で、通常は整数値です。 コードの中で直接数値を書くよりも解釈しやすくするために使われる"マジックナンバー"です。
effect | effect型はobjectに対する効果(エフェクト)を表す型です。(視覚的な効果と実際の能力に対する効果のどちらも含みます。) スクリプト言語内で場所またはobjectに適用したいエフェクトを取得し、ApplyEffectAtLocation関数、ApplyEffectToObject関数で適用します。
event | event型とはobjectに起こった出来事(イベント)を表すデータ型です。(例：(クリーチャーなどが)攻撃された、話しかけられた、(アイテムなどが)使用された、(ドアなどが)開けられた、etc') スクリプト実行中にあるobjectにイベントが発生すると、そのobjectに用意されたイベント処理スクリプトが実行されます。 スクリプト記述の中でイベント発行関数(SignalEvent)を用いることで任意のobjectにイベントを発生させることが出来ます。
float | float型は32bit浮動小数値です。 -3.402823e38～3.402823e38の範囲をとり、デフォルトは0.0です。 float型として値の初期化や設定をしたい場合には、必ず小数点を用いて少なくとも小数第一位まで書いてください。 float値を表す小文字のfはあっても無くてもコンパイラは認識します。(例：1.23でも1.23fでも可)
int | int型は符号つき32bit整数値です。 小数値を持たない実数で、マイナス(負)の値を持つことができます。 -2,147,483,648～2,147,483,647の範囲をとり、デフォルトは0です。
location | location型は以下の3つから構成される位置情報です。 ・エリアのIDとなるobject型 ・エリア内での位置を示すvector型 ・向いている方向を示すfloat型
object | ゲーム内にある特定の物体を示す整数値です。 基本的に実体のあるものを指すものです。(クリーチャー、アイテム、ドア、設置可能オブジェクト、etc')
string | string型は不定長の文字列で、NULL文字で終端を表します。(好きな長さの文字を表わせる型で、必ず""(ダブルクウォーテーション)で括る、という意味です) デフォルト値は空の文字列("")です。 +(プラス記号)を用いることで文字列同士を連結することが出来ます。
struct | 異なる変数をまとめ、1つの変数にした構造体。 関数で用いることによって多くの値を一度に返したい場合などに複雑さを軽減します。
talent | talent型は特技、技能または呪文を表すデータ型です。
vector | 3つのfloat値からなる構造体で、通常は位置や方向を示すベクトルとして定義されています。 vector型の構成要素を参照するためには、.(ピリオド)演算子を用います。 vector型のデフォルト値は、{ 0.0, 0.0, 0.0 } (x = 0.0、y = 0.0、z = 0.0)です。
void | 空の値を示すデータタイプです。 void型を返す関数は実際の値を何も返しません。 アクションキューに登録できる関数はvoid型の関数のみです。

JP team: marshall


Type - action

Home > Reference > Data Types > action

action

An action.

See Also

Data Types


Type - command

Home > Reference > Data Types > command

command

A void-returning function, whether it is user defined or engine-defined. This is used by the DelayCommand() and AssignCommand() functions.

See Also

Data Types


Type - constant

Home > Reference > Data Types > constant

constant

定数(constant)とは値を変えることが出来ない数値で、通常は整数値です。

コードの中で直接数値を書くよりも解釈しやすくするために使われる"マジックナンバー"です。

Example

int iOuch = DURATION_TYPE_PERMANENT;

See Also

Data Types

JP team: marshall


Type - effect

Home > Reference > Data Types > effect

effect

effect型はobjectに対する効果(エフェクト)を表す型です。

(視覚的な効果と実際の能力に対する効果のどちらも含みます。)

スクリプト言語内で場所またはobjectに適用したいエフェクトを取得し、
ApplyEffectAtLocation関数、ApplyEffectToObject関数で適用します。

Example

effect eConPenalty = EffectAbilityDecrease(ABILITY_CONSTITUTION, 1);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConPenalty, oTargetPC);

See Also

Data Types

JP team: marshall


Type - event

Home > Reference > Data Types > event

event

event型とはobjectに起こった出来事(イベント)を表すデータ型です。

(例：(クリーチャーなどが)攻撃された、話しかけられた、(アイテムなどが)使用された、(ドアなどが)開けられた、etc')

スクリプト実行中にあるobjectにイベントが発生すると、そのobjectに用意されたイベント処理スクリプトが実行されます。

スクリプト記述の中でイベント発行関数(SignalEvent)を用いることで任意のobjectにイベントを発生させることが出来ます。

Example

// this signal's oldTarget to behave as if they were
// just attacked by OBJECT_SELF
event evAttacked = EventOnAttacked(OBJECT_SELF);
SignalEvent(oldTarget, evAttacked);

See Also

Data Types

JP team: marshall


Type - float

Home > Reference > Data Types > float

float

float型は32bit浮動小数値です。

-3.402823e38～3.402823e38の範囲をとり、デフォルトは0.0です。

float型として値の初期化や設定をしたい場合には、必ず小数点を用いて少なくとも小数第一位まで書いてください。

float値を表す小文字のfはあっても無くてもコンパイラは認識します。(例：1.23でも1.23fでも可)

Example

float fCurrency = 19.99f;

See Also

Data Types

JP team: marshall


Type - int

Home > Reference > Data Types > int

int

int型は符号つき32bit整数値です。

小数値を持たない実数で、マイナス(負)の値を持つことができます。

-2,147,483,648～2,147,483,647の範囲をとり、デフォルトは0です。

Example

int iAge = 23;
int iResult = 2 + 2;

See Also

Data Types

JP team: marshall


Type - location

Home > Reference > Data Types > location

location

location型は以下の3つから構成される位置情報です。

・エリアのIDとなるobject型

・エリア内での位置を示すvector型

・向いている方向を示すfloat型

Example

location loc = Location(objArea, vecPosition, fFacing);

See Also

Data Types

JP team: marshall


Type - object

Home > Reference > Data Types > object

object

ゲーム内にある特定の物体を示す整数値です。

基本的に実体のあるものを指すものです。

(クリーチャー、アイテム、ドア、設置可能オブジェクト、etc')

Example

object oSucks = GetLastPlayerDied();

See Also

Data Types

JP team: marshall


Type - string

Home > Reference > Data Types > string

string

string型は不定長の文字列で、NULL文字で終端を表します。

(好きな長さの文字を表わせる型で、必ず""(ダブルクウォーテーション)で括る、という意味です)

デフォルト値は空の文字列("")です。

+(プラス記号)を用いることで文字列同士を連結することが出来ます。

Example

string sHero = "Galryx";

See Also

Data Types

JP team: marshall


Type - struct

Home > Reference > Data Types > struct

struct

異なる変数をまとめ、1つの変数にした構造体。

関数で用いることによって多くの値を一度に返したい場合などに複雑さを軽減します。

Example

struct Name
{
     string First;
     string Last;
};

See Also

Data Types

JP team: marshall


Type - talent

Home > Reference > Data Types > talent

talent

talent型は特技、技能または呪文を表すデータ型です。

Example

talent tHvyArmor = TalentFeat(FEAT_ARMOR_PROFICIENCY_HEAVY);
talent tTurnUndead = TalentFeat(SPELLLABILITY_TURN_UNDEAD);

See Also

Data Types

JP team: marshall


Type - vector

Home > Reference > Data Types > vector

vector

3つのfloat値からなる構造体で、通常は位置や方向を示すベクトルとして定義されています。

vector型の構成要素を参照するためには、.(ピリオド)演算子を用います。

vector型のデフォルト値は、{ 0.0, 0.0, 0.0 } (x = 0.0、y = 0.0、z = 0.0)です。

Example

vector v = GetPosition(OBJECT_SELF) - GetPosition(oidTargetObject);
vector v2 = Vector(1.0f, 2.0f, 3.0f);
PrintFloat(v2.x);
float fDistanceToTarget = sqrt(v.x * v.x + v.y * v.y + v.z * v.z);

See Also

Data Types

JP team: marshall


Type - void

Home > Reference > Data Types > void

void

空の値を示すデータタイプです。

void型を返す関数は実際の値を何も返しません。

アクションキューに登録できる関数はvoid型の関数のみです。

Example

void DeductXP(object oPC)
{
    // deduct some XP in here...
}

See Also

Data Types

JP team: marshall


Event Categories - Objects with Events

Home > Reference > Objects with Events

Objects with Events (イベント付オブジェクト)

イベントのあるオブジェクトはNWNで使われるオブジェクトの大半を占めます。

NWNのプログラマー達はオブジェクトにイベントを関連付けることによって、PC達と他のオブジェクトとの相互作用を実現できるようにしました。その方法は個々のスクリプトをそれぞれのイベントに割り当てます。

Objects

Area (エリア)

Creature (クリーチャー)

Door (ドア)

Encounter (エンカウンター)

Module (モジュール)

Placeable Object (配置用オブジェクト)

Trap (トラップ)

Trigger (トリガー)

JP team: geshi


Event - OnAcquireItem

Home > Reference > Events > OnAcquireItem

OnAcquireItem

このイベントに結びつけられたスクリプトは、アイテムが取得されたときに発動する。 そのアイテムをアイテムのリストに照らし合わせてテストすることができ、そのアイテムが見つかった場合にイベントを起こしたり（例えば、PCのまわりで死体が起きあがってきて彼らと戦う）、日記のエントリを更新したりすることができる。

Trigger

アイテムが誰かの所持品に加えられたとき。

Function(s)

GetModuleItemAcquired() は、取得したばかりの（このイベントを発動させた）アイテムを返す。
GetModuleItemAcquiredFrom() は、そのアイテムを取得していたまたは取り去ったもとのオブジェクトを返す。
GetItemPossessor(object oItem) は、そのアイテムを取得したオブジェクトを返す。

Known Bugs

PCがゴールドを拾ったときや、所持品の中にすでにあるスタックにアイテムが加えられたときは、このイベントは発動しない。

Example

// OnAcquireItemイベントにこのスクリプトをおいたモジュール内で
// アイテムを取得したキャラクターの名前をログファイルに記録する。
void main
{
     object oAcquirer = GetModuleItemAcquiredFrom(
          GetModuleItemAcquired()
     );
     string sName = GetName(oAcquirer);
     PrintString(sName);
}

See Also

 | Objects with Events | Module
functions: | GetItemPossessor | GetModuleItemAcquired | GetModuleItemAcquiredFrom

JP team: weed


Event - OnActivateItem

Home > Reference > Events > OnActivateItem

OnActivateItem

このイベントに結びつけられたスクリプトは、PCの所持品の中にあるアイテムがアクティベートされた（平たく言えば、使われた）ときに発動する。進んだり（例えば、ドアを開ける）、クリーチャーを召喚するといった目的で、特定のアイテムがある場所で使われなければならないときに、これを使うことができる。

Trigger

「呪文詠唱＞特殊な機能」（対象をターゲットする）もしくは「呪文詠唱＞特殊な機能：自身のみ」（対象は自分）のアイテムプロパティを持ったアイテムが、その呪文を投射するとき。

Function(s)

GetItemActivated() は、アクティベートされたアイテムを返す。
GetItemActivatedTarget() は、「特殊な機能」の呪文のターゲットを返す（ターゲットがオブジェクトのときのみ）。
GetItemActivatedTargetLocation() は、「特殊な機能」の呪文のターゲット（ロケーション）を返す（ターゲットがポイントのときのみ）。
GetItemActivator() は、アクティベートされたアイテムの所有者を返す。

See Also

 | Objects with Events | Module
functions: | GetItemActivated | GetItemActivatedTarget | GetItemActivatedTargetLocation | GetItemActivator

JP team: weed


Event - OnAreaTransitionClick

Home > Reference > Events > OnAreaTransitionClick

OnAreaTransitionClick

このイベントに結びつけられたスクリプトは、PCがエリア・トランジションに入ったときに発動する。このイベントにスクリプトを指定する場合、デフォルトのトランジションはもはや機能しないなので、トランジションの内容をマニュアルで準備して実行しなければならない。

Trigger

エリア・トランジションに何かが入ったとき

Function(s)

GetClickingObject() は、ドアをクリックした最後のオブジェクトを返す。

Remarks

OnAreaTransitionClick はドアにのみ適用され、エリア（訳注：トランジション・エリアはOnClick）には適用されない。

See Also

 | Objects with Events | Door
functions: | GetClickingObject

JP team: weed


Event - OnBlocked

Home > Reference > Events > OnBlocked

OnBlocked

このイベントに結びつけられたスクリプトは、ドアによってクリーチャーがブロックされたときに発動する。ドラマチックにドアが崩れ落ちるシーンを作ったり、クリーチャーに追跡をやめさせるのに、これを使うことができる。このイベントは、クリーチャーがドアによってブロックされたときにのみ発動し、ドア以外の何か他のオブジェクトによってブロックされたときは発動しないことに注意すること。

Trigger

ドアがクリーチャーの移動をブロックするとき

Function(s)

GetBlockingDoor() は、クリーチャーの移動をブロックしたドアを返す。

Remarks

将来は、配置オブジェクトやクリーチャーのような他のオブジェクトが衝突を感知するために使われるかもしれない。クリーチャーがドアを使うのにじゅうぶん賢ければ（INT 5 以上）、まずドアを開けようと試み、それが不可能ならば、次にそのドアを壊そうと試みる。

See Also

 | Objects with Events | Creature
functions: | GetBlockingDoor

JP team: weed


Event - OnClick

Home > Reference > Events > OnClick

OnClick

このイベントに結びつけられたスクリプトは、トリガーにPCが入ったときに発動する。

Trigger

トリガーがクリックされたとき

Function(s)

GetClickingObject() は、そのトリガーをクリックしたPCを返す。

Remarks

ほとんどのタイプのエリア・トランジションはこのイベントを使う（しかしながら、「エリア・トランジション」タイプとしてセットアップされたトリガーは、このイベントを使うのにウィザードを使うことができる）。

See Also

 | Objects with Events | Trigger
functions: | GetClickingObject

JP team: weed


Event - OnClientEnter

Home > Reference > Events > OnClientEnter

OnClientEnter

このイベントに結びつけられたスクリプトは、クライアントがそのモジュールに入るときに発動する。特定のPCのために変数のいくつかを初期化を実行したり、エンカウンターをリセットするのに使うことができる。

Trigger

プレイヤーがサーバーにログインするとき、もしくは、そのモジュールを開始するとき（訳注：後者はシングルでプレイするとき？）

Function(s)

GetEnteringObject() は、入ってくるPCを返す。

Example

// サーバーにジョインしたばかりの（もしくは、モジュールを開始したばかりの）
// プレイヤーのログイン名とIPアドレスを記録する
void main
{
     object oPC = GetEnteringObject();
     if (GetIsPC(oPC))
     {
          PrintString(GetPCPlayerName(oPC) + " (" +
               GetPCIPAddress(oPC) + ")"
          );
     }
}

See Also

 | Objects with Events | Module
functions: | GetEnteringObject

JP team: weed


Event - OnClientLeave

Home > Reference > Events > OnClientLeave

OnClientLeave

このイベントに結びつけられたスクリプトは、クライアントがそのモジュールを去るときに発動する。あるPCがいることによって出現したカスタムクリーチャーを取り除いたりするのに使うことができる。

Trigger

プレイヤーがサーバーからログアウトするとき、もしくはモジュールから去るとき。

Function(s)

GetExitingObject() は、去ろうとしているPCを返す。

See Also

 | Objects with Events | Module
functions: | GetExitingObject

JP team: weed


Event - OnClose

Home > Reference > Events > OnClose

OnClose

このイベントに結びつけられたスクリプトは、オブジェクトが閉じられたときに発動する。これは、入れ物の中身を調べてPCがお金を持ち去ったあとで近くのドアを開けるか警報を鳴らすのに使うことができる（訳注：scott free？）。

Trigger

ドアもしくは配置オブジェクトが閉じられたとき

Function(s)

GetLastClosedBy() は、OBJECT_SELFを閉じたオブジェクトを返す。

Remarks

すべての配置オブジェクトがこのイベントを発動するわけではなく、実際に閉じることができるものだけである。

Example

// 宝箱（明らかに、ドアでは動かない）の中に置く
// 宝箱の所持品が空ならば、100gpを与える
void main()
{
     // see if we have an item
     object oItem = GetFirstItemInInventory();
     if (!GetIsObjectValid(oItem))
     {
          CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 100);
     }
}

See Also

 | Objects with Events | Door | Placeable Object
functions: | GetLastClosedBy

JP team: weed


Event - OnCombatRoundEnd

Home > Reference > Events > OnCombatRoundEnd

OnCombatRoundEnd

このイベントに結びつけられたスクリプトは、それぞれの戦闘ラウンドの最後（NWNでは6秒おき）に発動する。

Trigger

戦闘ラウンドが終わったとき。

Function(s)

DetermineCombatRound(object, int) は、標準的な戦闘ラウンドのアクションを決める

Remarks

特別な動作がセットされていないか、OnSpawnの警告フラグがセットされていないならば、 新しい戦闘ラウンドが初期化される。

See Also

 | Objects with Events | Creature
functions: | DetermineCombatRound

JP team: weed


Event - OnConversation

Home > Reference > Events > OnConversation

OnConversation

このイベントに結びつけられたスクリプトは、別のクリーチャーとの会話が終わったとき、もしくはシャウトが聞こえたときに発動する。

Trigger

そのクリーチャーがカンバセーションのためにクリックされたとき、もしくは、誰かが聞こえるように話したとき。

Function(s)

GetLastSpeaker() は、OBJECT_SELFをクリックしたオブジェクト、もしくは最後に大声で話したオブジェクトを返す。
GetListenPatternNumber() は、パターン番号を返す（たいていOnSpawnイベントの中で準備される）。

Remarks

そのクリーチャーがカンバセーションのためにクリックされたら、そのクリーチャーはしていることをやめて（可能なら）会話を開始する。さもなければスクリプトは、話しかけられたフレーズ（その場で打ち込まれたものであることもある）が認識可能かどうか、そして、そのクリーチャーは戦闘シャウトを認識するようセットアップされたかどうか、をチェックする。

See Also

 | Objects with Events | Creature
functions: | GetLastSpeaker | GetListenPatternNumber

JP team: weed


Event - OnDamaged

Home > Reference > Events > OnDamaged

OnDamaged

このイベントに結びつけられたスクリプトは、オブジェクトがダメージを受けたときに発動する。

Trigger

クリーチャー、ドア、配置オブジェクトがヒットポイントを失ったとき

Function(s)

GetLastDamager() は、OBJECT_SELFに対して最後にダメージを与えた（つまりこのイベントを発動させた）オブジェクトを返す。
GetTotalDamageDealt() は、クリーチャーに与えられたダメージの量を返す（ドアや配置オブジェクトのOnDamagedイベントに入れて使っている場合は、0を返す）。
GetDamageDealtByType(int nDamageType) は、特定の攻撃によって与えられたダメージの量を返す。
GetCurrentHitPoints(object oObject = OBJECT_SELF) は、イベントを呼び出した主体の現在のヒットポイントを返すのに使うことができる。
GetMaxHitPoints(object oObject = OBJECT_SELF) は、最大ヒットポイントを返すのに使うことができる（なお、GetCurrentHitPoints(object oObject = OBJECT_SELF) とともに使うことで、そのクリーチャーがどれくらいやばい状況なのかを取得することもできる）。
DetermineCombatRound(object, int) は、標準的な戦闘アクションを決めるのに使うことができる。

Remarks

もしクリーチャーが、見ることのできない誰かによって傷つけられたなら、そのクリーチャーは攻撃者を捜そうと試みる。攻撃者を見つけることができれば、ターゲットの位置を決めて攻撃する。

Example

// クリーチャーのOnDamagedイベントに置く
// クリーチャーがヒットポイントの半分以上を失うと、//  "CAVE_EXIT" というタグのウェイポイントへ退却し、そこで消える。will retreat to a waypoint tagged "CAVE_EXIT" and disappear
void main()
{
     int nEvent = GetUserDefinedEventNumber();
     if (nEvent = 1006) // OnDamaged event
     {
          int nMaxHP = GetMaxHitPoints(); // OBJECT_SELF（イベントの呼び出し主）がデフォルト
          int nCurHP = GetCurrentHitPoints(); // OBJECT_SELF（イベントの呼び出し主）がデフォルト
          // 最大値の半分より少ない場合
          if (nCurHP < (nMaxHP / 2))
          {
               // そのクリーチャーがしていることをすべて止める
               ClearAllActions();
               // 悲鳴を上げる
               ActionSpeakString("I'm being violated!");
               // 一目散に逃げ出す
               ActionMoveToObject(GetObjectByTag("CAVE_EXIT"), TRUE);
               // 自身を破壊（出口で消えるように見せる）
               ActionDoCommand(DestroyObject(OBJECT_SELF));
               // 一切のAIコマンドを受け付けなくする（完全破壊！）
               SetCommandable(FALSE);
          }
     }
}

See Also

 | Objects with Events | Creature | Door | Placeable Object
functions: | DetermineCombatRound | GetCurrentHitPoints | GetCurrentHitPoints | GetDamageDealtByType | GetLastDamager | GetMaxHitPoints | GetTotalDamageDealt

JP team: weed


Event - OnDeath

Home > Reference > Events > OnDeath

OnDeath

このイベントに結びつけられたスクリプトは、そのオブジェクトが何らかの原因で死んだときに発動する。そのオブジェクトに宝物を落とさせたり、別の場所で再出現させたり、別のクリーチャーの出現（もしくは変身！）を引き起こすために使うことができる。

Trigger

クリーチャー、ドアもしくは配置オブジェクトが（通常はヒットポイントが0以下に減少することによって）殺されたとき

Function(s)

GetLastKiller() は、OBJECT_SELFを殺したオブジェクトを返す

Remarks

このイベントによって実行されるスクリプトは、即座にアクションが実行されるようにしなければならない。死の時点より後では、そのオブジェクトは命令を実行することができないので、DelayCommandを使っても駄目である。ドアと配置オブジェクトのための破壊のアニメーションは、自動的に起きる。クリーチャーが死んだ場合は、そのクリーチャーはイービルではないかどうかと、コモナーレベルを持っているかを調べる。もし両条件が該当する場合は、自動的に殺した者のアライメントをイービルへ少し変える。また、射程内のそれらを聞くようセットアップされたクリーチャーに対して、助けを呼ぶ標準的なシャウトを発する。

See Also

 | Objects with Events | Creature | Door | Placeable Object
functions: | GetLastKiller

JP team: weed


Event - OnDisarm

Home > Reference > Events > OnDisarm

OnDisarm

このイベントに結びつけられたスクリプトは、罠がうまく解除されたときに発動する。経験点を与えたり同様のデザインの他の罠を見つけやすくしたりするために使うことができる。

Trigger

罠が解除されたとき

Function(s)

GetLastDisarmed() は、その罠を解除したクリーチャーもしくはPCを返す

Example

// 罠を解除したクリーチャーやPCに1000点の経験点を与える
// その罠のOnDisarmイベントにこのスクリプトを置く
void main()
{
     object oPC = GetLastDisarmed();
     if (GetIsPC(oPC))
     {
          GiveXPToCreature(oPC, 1000);
     }
}

See Also

 | Objects with Events | Trap
functions: | GetLastDisarmed

JP team: weed


Event - OnDisturbed

Home > Reference > Events > OnDisturbed

OnDisturbed

このイベントに結びつけられたスクリプトは、そのオブジェクトの所持品が（完全に※？）変わったときに発動する。スリを試みられたり配置オブジェクトからアイテムが取り出されたりすると、所持品が乱された（※be disturbed）ことになる。

Trigger

クリーチャーもしくは配置オブジェクトの所持品から、何かが加えられた／取り除かれたとき

Function(s)

GetLastDisturbed() は、OBJECT_SELFを最後に乱したオブジェクトを返す。
GetInventoryDisturbType() は、何が起きたのかを知るために、INVENTORY_DISTURB_TYPE_* 定数の一つを返す。
GetInventoryDisturbItem() は、OBJECT_SELFの所持品に対して加えられた／取り除かれたアイテムを返す。

Remarks

クリーチャーは、自身の所持品に対してアイテムを加える／取り除くことはできないので、その所持品が乱された場合は、何かが盗まれたはずである。そのクリーチャーは正しいターゲットを見つけて攻撃する。

See Also

 | Objects with Events | Creature | Placeable Object
functions: | GetInventoryDisturbItem | GetInventoryDisturbType | GetLastDisturbed

JP team: weed


Event - OnEnter

Home > Reference > Events > OnEnter

OnEnter

The script attached to this event fires when a certain area boundry has been violated allowing you to throw a custom event, update the PC's journal, or a variety of other things.

このイベントに結びつけられたスクリプトは、特定のエリア境界が犯されたときに発動する。これにより、カスタムイベントを起こしたり、PCの日記を更新したり、他にも様々なことができる。

Trigger

Something has entered the area, encounter, or trigger (not neccessarily a PC).

エリア、エンカウンター、トリガに何か（必ずしもPCである必要はない）が入ったとき

Function(s)

GetEnteringObject() returns the object that has entered the area, encounter, or trigger.

GetEnteringObject() は、そのエリア・エンカウンター・トリガーに入ったオブジェクトを返す。

Remarks

Polymorphing a PC causes them to trigger the OnExit and OnEnter events (in that order).

PCのポリモーフはOnExitイベントとOnEnterイベントを引き起こす（まずOnExitイベントが発動し、次にOnEnterイベントが発動する）

Example

// このスクリプトを結びつけたエリアにPCが入ったことを、
// 「HUNTER」というタグのモンスターに知らせる。
// PCがエリアの中へ行ったかをあとでチェックすることができるように、
// ローカル変数もセットする。
// これは、同じPCに対してイベントが再び起きないようにするためである。
// （別のPCがやって来てこのイベントを引き起こすまで）
// 「HUNTER」は、侵入してきたPCを追いつめるのを手伝わせるために
// イベントに格納されたオブジェクト（oEntering）を使うこともできる。
void main
{
     object oEntering = GetEnteringObject();
     // PCであることを確認
     if (GetIsPC(oEntering))
     {
          // 「HUNTER」が2度以上来ないようにする
          if (!GetLocalObject(OBJECT_SELF, "PC_Entered") == oEntering)
          {
               object oMonster = GetObjectByTag("HUNTER");
               // PCをローカル変数にセット
               SetLocalObject(OBJECT_SELF, "PC_Entered", oEntering);
               // 「HUNTER」に食事の時間だぞと通知
               SignalEvent(oMonster, EventUserDefined(100));
          }
     }
}

See Also

 | Objects with Events | Area | Encounter | Trigger
functions: | GetEnteringObject

JP team: weed


Event - OnExhausted

Home > Reference > Events > OnExhausted

OnExhausted

このイベントに結びつけられたスクリプトは、エンカウンターによって出現したクリーチャーの最後の最後のメンバーが死亡したときに発動する。これにより、以前は開けることのできなかったドアを開けたり、他のイベントを引き起こしたりすることができる。

Known Bugs

OnExhaustedは正しくはたらかないことがある。それは、エンカウンターが出現した後だが、そのエンカウンターのすべてのモンスターを殺す前に、プレイヤーが死んでリロード（※？）した場合である。リロードしたあとでプレイヤーが先ほどの出現したモンスターを全滅させても、そのエンカウンターのためのOnExhaustedイベントは発動しない。

See Also

Objects with Events | Encounter

JP team: weed


Event - OnExit

Home > Reference > Events > OnExit

OnExit

このイベントに結びつけられたスクリプトは、エリア、トリガ、エンカウンターの境界から出たときに発動する。墓を荒らしにきたPCを殺すために眠りから覚まされたすべてのゾンビを殺したり、PCの所持品から聖杯を取り除いてPCに追っ手を差し向ける一連のエンカウンターの引き金を引くといった演出のために使うことができる。

Trigger

何か（必ずしもPCでなくてもよい）が現在のエリア、エンカウンターもしくはトリガを去ったとき

Function(s)

GetExitingObject() は、たった今そのエリア、エンカウンターもしくはトリガを去ったオブジェクトを返す。

Remarks

PCのポリモーフはOnExitイベントとOnEnterイベントを引き起こす（まずOnExitイベントが発動し、次にOnEnterイベントが発動する）

Example

// 以下のスクリプトの前提であるOnEnterイベントを見てください。
// PCがそのエリアを去ったら、
// 「HUNTER」をホーム（「HUNTER_CAVE」としましょうか）に帰します。
void main()
{
     object oExiting = GetExitingObject();
     object oMonster = GetObjectByTag("HUNTER");
     object oCave = GetObjectByTag("HUNTER_CAVE");
     if (GetIsPC(oExiting))
     {
          SetLocalObject(OBJECT_SELF, "PC_Entered", OBJECT_INVALID);
     }
     // もし「HUNTER」が追跡中にエリアを去ろうとしたら、ホームに戻します。
     if (oExiting == oMonster)
     {
          AssignCommand(oMonster, ClearAllActions());
          AssignCommand(oMonster, ActionMoveToObject(oCave));
     }
}

See Also

 | Objects with Events | Area | Encounter | Trigger
functions: | GetExitingObject

JP team: weed


Event - OnFailToOpen

Home > Reference > Events > OnFailToOpen

OnFailToOpen

このイベントに結びつけられたスクリプトは、ドアを開けようとする試みが失敗したときに発動する。奇妙な音の原因を調査するためのクリーチャーを出現させる、開けるには鍵が必要かもしくは通常の手段で開けることはできないということを知らせる、もしくはその他の様々なイベントを起こすことができる。

Example

// Fred Brentによる例
void main()
{
    object oPC = GetClickingObject();

    if (GetIsObjectValid(oPC))
        AssignCommand(oPC, SpeakString("I need to find the key..."));
    else
        SpeakString("NO VALID TEMP PC");
}

See Also

Objects with Events | Door

JP team: weed


Event - OnHeartbeat

Home > Reference > Events > OnHeartbeat

OnHeartbeat

このイベントに結びつけられたスクリプトは6秒（NWNの戦闘ラウンドの長さ）ごとに発動する。何かを繰り返しチェックする必要がある際や、アクションを定期的に実行する必要がある際に、これを使うとよい。OnHeartbeatスクリプトが多すぎると処理能力を食ってしまうことがあるので気を付けること。もし可能なら、他のタイプのイベントスクリプトを使って下さい。

Trigger

6秒（1ラウンド）が過ぎるたび

Remarks

クリーチャーのために使ったときは、OnSpawnスクリプト中でセットした条件がチェックされ、適用可能ならば実行される。これらは次のものを含む：敵のための「fast buff」（※戦闘準備？）（準備をシミュレートするためにPCが一定の範囲に入ったときに使われる）、WalkWayPoints()関数のための昼夜の見張り、まわりに立っているときにクリーチャーによって使われる標準的な背景的アニメーション。

See Also

Objects with Events | Area | Creature | Door | Encounter | Module | Placeable Object | Trigger

JP team: weed


Event - OnLock

Home > Reference > Events > OnLock

OnLock

このイベントに結びつけられたスクリプトは、オブジェクトが施錠されたときに発動する。

Trigger

ドアもしくは配置オブジェクトが別のオブジェクトによって施錠されたとき。

Function(s)

GetLastLocked() は、OBJECT_SELFを施錠したオブジェクトを返す。
GetLockLockDC() は、その施錠を開けるための開錠技能のDCを返す

Remarks

開くことのできる配置オブジェクトのみが施錠・開場できる

Known Bugs

OnLockとOnUnlockは現在働かない。Biowareはこの問題を知っているが、修正予定は今のところない（1.28パッチではどうなのか、誰か確かめてください）

See Also

 | Objects with Events | Door | Placeable Object
functions: | GetLastLocked | GetLockLockDC

JP team: weed


Event - OnModuleLoad

Home > Reference > Events > OnModuleLoad

OnModuleLoad

The script attached to this event fires when the module is first loaded. This is a good place to initialize any variables that need to be initialized.

Trigger

When a module is initially loaded.

See Also

Objects with Events | Module


Event - OnOpen

Home > Reference > Events > OnOpen

OnOpen

The script attached to this event fires when an object has been opened.

Trigger

Door or placeable object was opened.

Function(s)

GetLastOpenedBy() returns the object that opened OBJECT_SELF.

Remarks

Only placeable objects with inventories (has the "Has Inventory" check box checked) can be opened.

See Also

 | Objects with Events | Door | Placeable Object
functions: | GetLastOpenedBy


Event - OnPerception

Home > Reference > Events > OnPerception

OnPerception

The script attached to this event will fire whenever another creature perceives another creature or PC. Common uses of this script include having the creature yell a battle cry, greet the PC, or run away.

Trigger

Something has entered the creature's perception radius, but is not automatically detected. Note that something does not neccessarily mean a PC.

Function(s)

GetLastPerceived() returns the last perceived creature (whether or not it was actually seen or heard).
GetLastPerceptionHeard() returns TRUE or FALSE as to whether the last perceived object was also heard.
GetLastPerceptionInaudible() returns TRUE or FALSE as to whether or not the last perceived object has become inaudible (unable to be heard).
GetLastPerceptionSeen() returns TRUE or FALSE as to whether or not the last perceived object was seen.
GetLastPerceptionVanished() returns TRUE or FALSE as to whether or not the last perceived object can no longer be seen (invisible).
DetermineCombatRound(object, int) for standard combat round actions.

Remarks

The OnPerception generic AI gives priority to first going into search mode if an enemy has suddenly vanished, then telling the creature to combat an enemy that has appeared.

Example

// creature turns towards anyone he sees
// if the creature seen is female, the NPC bows
void main()
{
     int nEvent = GetUserDefinedEventNumber();
     if (nEvent == 1002) //  OnPerception event
     {
          object oTarget = GetLastPerceived();
          // check for sight
          if (GetLastPerceptionSeen())
          {
               ActionDoCommand(SetFacingPoint(GetPosition(oTarget)));
               // if they female, bow
               if (GetGender(oTarget) == GENDER_FEMALE)
               {
                    ActionWait(0.5);
                    ActionPlayAnimation(ANIMATION_FIREFORGET_BOW);
               }
          }
     }
}

See Also

 | Objects with Events | Creature
functions: | DetermineCombatRound | GetLastPerceived | GetLastPerceptionHeard | GetLastPerceptionInaudible | GetLastPerceptionSeen | GetLastPerceptionVanished


Event - OnPhysicalAttacked

Home > Reference > Events > OnPhysicalAttacked

OnPhysicalAttacked

The script attached to this event fires when the object is attacked for the first time, but does not fire during combat. This could be used for a reaction to the attack such as changing weapons, fleeing, surrendering, etc.

Trigger

A physical attack is brought against a creature, door, or placeable object.

Function(s)

GetLastAttacker() returns the object that last attacked OBJECT_SELF.
GetLastDamager() returns the object that actually dealt damage last (not neccessarily the last attacker).
DetermineCombatRound(object, int) for standard combat round actions.

Remarks

If a creature is attacked and not currently in combat, it goes hostile and emits appropriate shouts to alert allies nearby.

See Also

 | Objects with Events | Creature | Door | Placeable Object
functions: | DetermineCombatRound | GetLastAttacker | GetLastDamager


Event - OnPlayerDeath

Home > Reference > Events > OnPlayerDeath

OnPlayerDeath

The script attached to this event fires when a player has been reduced to -10 hit points or less. This event could be used to create changes in the storyline, record the deaths of all the players on the server to display at the town square, etc.

Trigger

Occurs when a PC dies.

Function(s)

GetLastPlayerDied() to return the PC who just died.

Remarks

The "nw_o0_death" script is normally used for this module event. This script clears the relationship of the standard factions to the player and determines when the "Death GUI Panel" appears that allows the player to exit NWN or respawn.

See Also

 | Objects with Events | Module
functions: | GetLastPlayerDied


Event - OnPlayerDying

Home > Reference > Events > OnPlayerDying

OnPlayerDying

The script attached to this event fires when the PC has been reduced to 0 hit points, but not at -10 (this state is considered unconcious). It is possible to just outright kill the PC at this point if there's no one around for ressurrections, but once below 0 hit points the unconcious PC will steadily lose hit points until dead.

Trigger

When a PC has been reduced to less than 0 hit points.

Function(s)

GetLastPlayerDying() returns the PC who triggered this event.

Remarks

"nw_o0_dying" is the default script for this event which applies the EffectDeath effect to the PC to kill him quickly and fire the OnPlayerDeath event. If this script is removed, a PC would bleed to death before officially dying at -10 hit points.

See Also

 | Objects with Events | Module
functions: | GetLastPlayerDying


Event - OnPlayerLevelUp

Home > Reference > Events > OnPlayerLevelUp

OnPlayerLevelUp

Occurs when a PC has gained a new level. This event fires when the PC starts the leveling process, and there is no way to prevent the level from occuring.

Trigger

When a PC gains a new level.

Function(s)

GetPCLevellingUp() returns the player who is leveling up.

See Also

 | Objects with Events | Module
functions: | GetPCLevellingUp


Event - OnPlayerRespawn

Home > Reference > Events > OnPlayerRespawn

OnPlayerRespawn

The script attached to this event fires when the player selected the "Respawn" button after dying. Normally the player would respawn where he or she died with no penalties and back to full health; however it typically makes sense to teleport the PC back to another area (or save location if this is a party-based module so as not to annoy the other players) and hit them for an XP and/or gold penalty.

Trigger

A player pressed the "Respawn" button on the "Death GUI Panel" popup dialog after dying.

Function(s)

GetLastRespawnButtonPresser() returns the PC who just respawned.

Remarks

The script "nw_o0_respawn" resurrects the PC, removes all adverse effects, and applies a XP and gold penalty. Also determines if there is a waypoint tagged "NW_DEATH_TEMPLE" and teleports the PC there. If there is no "NW_DEATH_TEMPLE" waypoint, then the PC is resurrected where he fell.

See Also

 | Objects with Events | Module
functions: | GetLastRespawnButtonPresser


Event - OnPlayerRest

Home > Reference > Events > OnPlayerRest

OnPlayerRest

The script attached to this event fires when a player attempts to rest, cancels resting, or resting is finished. It can be used to spawn some creatures around the PC to constantly badger him or her and prevent a successful rest in some areas or prevent natural healing altogether from a curse bestowed upon the player.

Trigger

When the player presses the "Rest" button (starting or cancelling a rest) or when the rest is finished.

Function(s)

GetLastPCRested() returns the PC of the player who just clicked the "Rest" button.
GetLastRestEventType() returns one of the REST_EVENTTYPE_REST_* constants to determine what caused this event to fire.

Remarks

If you want to control when a PC can rest, capture this event when GetLastRestEventType() returns REST_EVENTTYPE_REST_STARTED; then use AssignCommand() on the PC to ClearAllActions(). This prevents the attempted rest from completing.

Example

// prevents a PC from resting
// period
void main
{
     object oPC = GetLastPCRested();
     // capture begin rest attempts
     if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
     {
          // fun, fun, fun!
          AssignCommand(oPC, ClearAllActions());
     }
}

See Also

 | Objects with Events | Module
functions: | GetLastPCRested | GetLastRestEventType


Event - OnRested

Home > Reference > Events > OnRested

OnRested

The script attached to this event fires when the creature attempts to rest. It can be used to customize the behavior of the creature so that instead of just sitting down it could drink from a tankard or dance around to regain lost hit points.

Trigger

The creature has rested via ActionRest().

Remarks

Creatures don't normally rest so there is no default AI script behavior defined.

See Also

Objects with Events | Creature


Event - OnSpawn

Home > Reference > Events > OnSpawn

OnSpawn

The script attached to this event fires when the creature is first spawned and allows you to specify the default behaviors for the creature (i.e. does the creature flee when attacked, walk a set of waypoints, etc).

See Also

Objects with Events | Creature


Event - OnSpellCastAt

Home > Reference > Events > OnSpellCastAt

OnSpellCastAt

The script attached to this event fires when the object becomes the target of a spell. This can include responses such as casting a spell of the object's own, dying, disappearing, getting stronger (absorbing the magical effect), etc.

Trigger

A spell has been cast at the creature, door, or placeable object.

Function(s)

GetLastSpell() returns the SPELL_* that was cast.
GetLastSpellCaster() returns the object that cast the spell.
GetLastSpellHarmful() returns TRUE if the spell was marked as hostile, FALSE otherwise.
DetermineCombatRound(object, int) for standard combat actions.

Remarks

If a harmful spell has been cast on the creature and that creature is not already in combat, it becomes hostile.

See Also

 | Objects with Events | Creature | Door | Placeable Object
functions: | DetermineCombatRound | GetLastSpell | GetLastSpellCaster | GetLastSpellHarmful


Event - OnTrapTriggered

Home > Reference > Events > OnTrapTriggered

OnTrapTriggered

The script attached to this event fires when a trap is triggered. This could be used to spawn some creatures nearby who hear bells going off as part of a trap or include additional nasty effects to the trap springer (and anyone in its area of effect) above and beyond the standard effect.

See Also

Objects with Events | Trap


Event - OnUnAcquireItem

Home > Reference > Events > OnUnAcquireItem

OnUnAcquireItem

The script attached to this event fires when an item is removed from the PC's inventory. It can be useful to stop the Balor you have chasing the rogue when he drops the Vorpal Longsword +3 he just found or place the item in a common location (such as the Divining Pool in the Halls of Justice) if it is a Plot item.

Trigger

When an item has been dropped or removed.

Function(s)

GetModuleItemLost() return the item that was lost.
GetModuleItemLostBy() returns the former owner of the item that was lost.

Known Bugs

This event does not fire when an item that is stacked in inventory is lost (i.e. a potion that is stacked is used) or when gold is spent or taken.

See Also

 | Objects with Events | Module
functions: | GetModuleItemLost | GetModuleItemLostBy


Event - OnUnlock

Home > Reference > Events > OnUnlock

OnUnlock

The script attached to this event fires when an item has been unlocked.

Trigger

Door or placeable was unlocked.

Function(s)

GetLastUnlocked() returns the object that unlocked OBJECT_SELF.

Remarks

Only placeables that can be opened can be locked or unlocked.

Known Bugs

OnLock and OnUnlock currently do not work. Bioware is aware of this and is working on it, but no timetable for a fix (someone please verify this as of patch 1.28).

See Also

 | Objects with Events | Door | Placeable Object
functions: | GetLastUnlocked


Event - OnUsed

Home > Reference > Events > OnUsed

OnUsed

The script attached to this event fires when an item is used. This can be used to open a door or set off a trap when a level is pulled or a brazier is extinguished.

Trigger

When a placeable object is used.

Function(s)

GetLastUsedBy() returns the last object that used the placeable object.

See Also

 | Objects with Events | Placeable Object
functions: | GetLastUsedBy


Event - OnUserDefined

Home > Reference > Events > OnUserDefined

OnUserDefined

The script attached to this event fires depending on settings made during the OnSpawn event for creatures and some general level blanket signals for all objects (including creatures). Typically this script is a switch/case statement that does something different depending on the signal (numerical value) sent to it by an event that calls the script. This event makes it very easy to retain the default behavior of an object while adding custom mannerisms of your own.

Trigger

A script has used the SignalEvent() function.

Function(s)

GetUserDefinedEventNumber() to return the user defined event number being sent.

Remarks

In a script that generates a user-defined event, use the EventUserDefined(int) function to generate the appropriate internal event identification number which can be consumed in the OnUserDefined script.

Example

// OnUserDefined exists as an event for many objects
// to invoke it for a module, try something like...
// SignalEvent(GetModule(), EventUserDefined(112));
// then say we want to capture user-defined event number 112
// in our module's OnUserDefined event...
void main
{
     switch (GetUserDefinedEventNumber())
     {
          case EventUserDefined(112) :
               PrintString("Event #112 occured!");
               break;
          // ... additional case statements for other user-defined
          // events can be added as neccessary
     }
}

See Also

 | Objects with Events | Area | Creature | Door | Encounter | Module | Placeable Object | Trigger
functions: | GetUserDefinedEventNumber


Event Category - Area

Home > Reference > Events > Area

Area (エリア)

エリアはMOD内でのタイルセットを基本とした一単位です。エリア内にはイベントに関連したオブジェクトが多数配置されています。
エリアイベントではOBJECT_SELFの意味するものはそのイベントが起こったエリア自身です。

通常MODは複数のエリアで構成されています。

Events

OnEnter

OnExit

OnHeartbeat

OnUserDefined

See Also

Objects with Events

JP team: geshi


Event Category - Creature

Home > Reference > Events > Creature

Creature (クリーチャー)

コメントを削除することによって使用できます（もしくはOnUserDefinedにスクリプトを書き込みます）。

これによってクリーチャーの行動が予想通りになり、より複雑な行動をさせることもできるようになります。

Events

OnBlocked

OnCombatRoundEnd

OnConversation

OnDamaged

OnDeath

OnDisturbed

OnHeartbeat

OnPerception

OnPhysicalAttacked

OnRested

OnSpawn

OnSpellCastAt

OnUserDefined

See Also

Objects with Events

JP team: geshi


Event Category - Door

Home > Reference > Events > Door

Door (ドア)

ドアに対するイベント

Events

OnAreaTransitionClick

OnClose

OnDamaged

OnDeath

OnFailToOpen

OnHeartbeat

OnLock

OnOpen

OnPhysicalAttacked

OnSpellCastAt

OnUnlock

OnUserDefined

See Also

Objects with Events

JP team: geshi


Event Category - Encounter

Home > Reference > Events > Encounter

Encounter (エンカウンター)

エンカウンターは自動的にクリーチャーを出現させるトリガーです。

ここではエンカウンターの修正やPCのスキル･レベルに応じてランダムに出現させるようにできます。

Events

OnEnter

OnExhausted

OnExit

OnHeartbeat

OnUserDefined

See Also

Objects with Events

JP team: geshi


Event Category - Module

Home > Reference > Events > Module

Module (モジュール)

モジュールは技術的であり、冒険そのものであり、複数のMODをつなげてキャンペーンとすることもできます。

NWNの常設世界でもキャンペーンができますし、またあるサーバーで異なった時間に一つの巨大なMODや複数のMODを連続させることもできます。

OBJECT_SELFはイベントの起こったエリアをあらわします（MOD自身そのものではありません）。

Events

OnAcquireItem

OnActivateItem

OnClientEnter

OnClientLeave

OnHeartbeat

OnModuleLoad

OnPlayerDeath

OnPlayerDying

OnPlayerLevelUp

OnPlayerRespawn

OnPlayerRest

OnUnAcquireItem

OnUserDefined

See Also

Objects with Events

JP team: geshi


Event Category - Placeable Object

Home > Reference > Events > Placeable Object

Placeable Object (配置用オブジェクト)

配置用オブジェクトはNWNのMODに深みを与え、スクリプトを割り当てることによって様々なイベントを起こすことができます。

ここにはアイテムが含まれ、トリガーのように扱われたり、鍵や罠を仕掛けることもできます。

OBJECT_SELFはイベントを起こす配置用オブジェクト自身で、イベントを惹起したクリーチャーや他のオブジェクトではありません。

配置用オブジェクトはある行動を起こすこともできます（例えばActionPlayAnimation()がANIMATION_PLACEABLE_*定数を参照する場合など）。しかし本質的に不可能な行動を指定しようとすると（つまりActionLockObject(), ActionUnlockObject(), ActionEquipItem(), ActionPickUpItem()のこと）問題を引き起こします。

全ての配置用オブジェクトが空けたり/閉じたり、稼動（アクティベート）/停止（ディアクティベート）させられるとは限りません。

Events

OnClose

OnDamaged

OnDeath

OnDisturbed

OnHeartbeat

OnLock

OnOpen

OnPhysicalAttacked

OnSpellCastAt

OnUnlock

OnUsed

OnUserDefined

See Also

Objects with Events

JP team: geshi


Event Category - Trap

Home > Reference > Events > Trap

Trap (トラップ)

トラップ（罠）は解除可能、発見可能な装置です。発見も解除もされずにPCが引っかかると結構なダメージを与えていやな思いをさせられます。その上ダメージだけでなく追加効果もあるかもしれません。

Events

OnDisarm

OnTrapTriggered

See Also

Objects with Events

JP team: geshi


Event Category - Trigger

Home > Reference > Events > Trigger

Trigger (トリガー)

トリガーは三種類あります：エリア・トランジション、一般トリガー、トラップ。

エリア・トランジションはキャラクターを別の場所へ移動させます。

一般トリガーは特殊なイベントを起こすためにスクリプトを割り当てることができます。

トラップは床に指定し、そこに踏み込んだ者に何か不愉快な思いをさせることができます。

OBJECT_SELFはトリガー自身であって、トリガーを引き起こしたオブジェクトではありません。

Events

OnClick

OnEnter

OnExit

OnHeartbeat

OnUserDefined

See Also

Objects with Events

JP team: geshi


Category - Functions

NWN C-Script Function Categories

ファンクション　カテゴリー

Action on Object (78)
Alignment (11)
Area (33)
Combat (19)
Combat Actions (19)
Combat Information (26)
Conversation (24)
Core AI (67)
Core AI Talent (23)
Cut-Scene (11)
Database (15)
Debug (18)
Effects (107)
Encounter (12)
Experience (9)
Function (49)
Get Data (37)
Get Data from Creature (100)
Get Data from Object (55)
Henchmen/Familiars/Summoned (68)
Inventory (51)
Item Creation (100)
Journal (3)
Lighting Effects (8)
Local Variables (28)
Math (23)
Miscellaneous (52)
Module (24)
Module Specific (82)
Money (10)
Movement (34)
Music Effects (13)
Party (21)
PC Only (30)
Perception (14)
Private Functions (12)
Prototyped but Unused (17)
Reputation/Faction (41)
Saving Throw (10)
Server (7)
Sound Effects (16)
Spell Casting Effects (25)
Spells (49)
String (15)
Talents/Skills/Feats (42)
Targeting (19)
Time (19)
Traps (18)
Type Casting/Conversion (13)
Visual Effects (15)


Function Category - Action on Object

Home > Reference > Functions > Categories > Action on Object

Action on Object Function Category

特定オブジェクトにアクションを起こさせるファンクション

Functions

ActionAttack

ActionCastSpellAtLocation

ActionCastSpellAtObject

ActionCloseDoor

ActionCounterSpell

ActionDoCommand

ActionEquipItem

ActionEquipMostDamagingMelee

ActionEquipMostDamagingRanged

ActionEquipMostEffectiveArmor

ActionForceFollowObject

ActionForceMoveToLocation

ActionForceMoveToObject

ActionGiveItem

ActionInteractObject

ActionJumpToLocation

ActionJumpToObject

ActionLockObject

ActionMoveToLocation

ActionMoveToObject

ActionOpenDoor

ActionPauseConversation

ActionPickUpItem

ActionPlayAnimation

ActionPutDownItem

ActionRandomWalk

ActionRest

ActionResumeConversation

ActionSit

ActionSpeakString

ActionSpeakStringByStrRef

ActionStartConversation

ActionTakeItem

ActionUnequipItem

ActionUnlockObject

ActionUseFeat

ActionUseSkill

ActionUseTalentOnObject

ActionWait

AssignCommand

BeginConversation

ClearAllActions

DelayCommand

DestroyObject

DoDoorAction

DoPlaceableObjectAction

EquipAppropriateWeapons

EventActivateItem

EventConversation

EventUserDefined

GetCurrentAction

GetEnteringObject

GetExitingObject

GetIdentified

GetIsObjectValid

GetIsPlaceableObjectActionPossible

GetItemActivated

GetItemActivatedTarget

GetItemActivatedTargetLocation

GetItemActivator

GetLastClosedBy

GetLastDisarmed

GetLockKeyRequired

GiveGoldToCreature

GiveXPToCreature

JumpToLocation

JumpToObject

MakeDrunk

PlayConversationAnimation

RewardPartyGP

SetIsDestroyable

SetItemCharges

SetItemStackSize

SetLocked

ShoutDisturbed

SoundObjectSetPosition

SoundObjectSetVolume

TalentFlee

See Also

Function Categories


Function Category - Alignment

Home > Reference > Functions > Categories > Alignment

Alignment Function Category

アラインメントを扱う関数

Functions

AdjustAlignment

AutoAlignE

AutoAlignG

GetAlignmentGoodEvil

GetAlignmentLawChaos

GetFactionAverageGoodEvilAlignment

GetFactionAverageLawChaosAlignment

GetGoodEvilValue

GetLawChaosValue

GetReactionAdjustment

VersusAlignmentEffect

See Also

Function Categories


Function Category - Area

Home > Reference > Functions > Categories > Area

Area Function Category

エリアを扱うファンクション

Functions

ActivatePortal

ActivePortal

AmbientSoundChangeDay

AmbientSoundChangeNight

AmbientSoundPlay

AmbientSoundSetDayVolume

AmbientSoundSetNightVolume

AmbientSoundStop

ExploreAreaForPlayer

GetArea

GetAreaFromLocation

GetEnteringObject

GetExitingObject

GetFirstObjectInArea

GetIsAreaAboveGround

GetIsAreaNatural

GetMyArea

GetNextObjectInArea

GetTileMainLight1Color

GetTileMainLight2Color

GetWeather

Location

MusicBackgroundChangeDay

MusicBackgroundChangeNight

MusicBackgroundGetBattleTrack

MusicBackgroundGetDayTrack

MusicBackgroundGetNightTrack

MusicBackgroundSetDelay

MusicBackgroundStop

MusicBattleChange

MusicBattlePlay

MusicBattleStop

SetWeather

See Also

Function Categories


Function Category - Combat

Home > Reference > Functions > Categories > Combat

Combat Function Category

戦闘に関する関数

Functions

ActionCounterSpell

ActionUseFeat

AssociateCheck

BashDoorCheck

CheckEnemyGroupingOnTarget

CheckFriendlyFireOnTarget

chooseTactics

DetermineClassToUse

DetermineCombatRound

EffectDamageReduction

EffectDamageResistance

EffectDamageShield

EffectDeath

GetGoingToBeAttackedBy

GetIsFighting

GetLastHostileActor

JumpToWeakestEnemy

SearchForPlayer

TalentRangedAttackers

See Also

Function Categories


Function Category - Combat Actions

Home > Reference > Functions > Categories > Combat Actions

Combat Actions Function Category

戦闘行動に関する関数

Functions

ActionAttack

ActionCounterSpell

ActionEquipMostDamagingMelee

ActionEquipMostDamagingRanged

ActionEquipMostEffectiveArmor

ClearAllActions

DimensionHop

EffectModifyAttacks

EscapeViaTeleport

JumpToWeakestEnemy

SurrenderToEnemies

TalentAdvancedBuff

TalentAdvancedProtectSelf

TalentDragonCombat

TalentFlee

TalentMeleeAttack

TalentMeleeAttacked

TouchAttackMelee

TouchAttackRanged

See Also

Function Categories


Function Category - Combat Information

Home > Reference > Functions > Categories > Combat Information

Combat Information Function Category

戦闘の情報に関するファンクション

Functions

DetermineEnemies

FindSingleRangedTarget

GetAC

GetAttackTarget

GetAttemptedAttackTarget

GetAttemptedSpellTarget

GetCharacterLevel

GetDamageDealtByType

GetDefensiveCastingMode

GetDistanceBetween

GetDistanceToObject

GetFactionBestAC

GetFactionLeastDamagedMember

GetFactionMostDamagedMember

GetFactionWeakestMember

GetFactionWorstAC

GetIsInCombat

GetLastAttacker

GetLastAttackMode

GetLastAttackType

GetLastDamager

GetLastKiller

GetLastWeaponUsed

GetMostDangerousClass

GetTotalDamageDealt

SearchForPlayer

See Also

Function Categories


Function Category - Conversation

Home > Reference > Functions > Categories > Conversation

Conversation Function Category

会話を扱うファンクション

Functions

ActionPauseConversation

ActionResumeConversation

ActionSpeakString

ActionSpeakStringByStrRef

ActionStartConversation

AddJournalQuestEntry

BeginConversation

FaceNearestPC

FloatingTextStringOnCreature

FloatingTextStrRefOnCreature

GetDialogSoundLength

GetJournalQuestExperience

GetLastSpeaker

GetListenPatternNumber

GetMatchedSubstring

GetMatchedSubstringsCount

GetPCSpeaker

IsInConversation

PlayConversationAnimation

SetCustomToken

SpeakOneLinerConversation

SpeakString

SpeakStringByStrRef

StartingConditional

See Also

Function Categories


Function Category - Core AI

Home > Reference > Functions > Categories > Core AI

Core AI Function Category

コアAIを扱う関数

Functions

ActionCloseDoor

ActionForceFollowObject

ActionForceMoveToLocation

ActionForceMoveToObject

ActionMoveAwayFromLocation

ActionMoveAwayFromObject

ActionMoveToLocation

ActionMoveToObject

ActionRandomWalk

ActivateFleeToExit

AssociateCheck

BashDoorCheck

CheckEnemyGroupingOnTarget

CheckFriendlyFireOnTarget

CheckWayPoints

chooseTactics

CompareLastSpellCast

DetermineAssociateCombatRound

DetermineCombatRound

DetermineSpecialBehavior

FindSingleRangedTarget

GetAILevel

GetBehaviorState

GetCreatureTalentBest

GetDistanceBetween

GetDistanceBetweenLocations

GetDistanceToObject

GetFactionMostDamagedMember

GetFleeToExit

GetFollowDistance

GetGoingToBeAttackedBy

GetIsFighting

GetLastGenericSpellCast

GetLastHostileActor

GetLastPCRested

GetLastPerceptionInaudible

GetListenPatternNumber

GetMostDangerousClass

GetNPCWarningStatus

GetRacialTypeCount

GetSpawnInCondition

PlayImmobileAmbientAnimations

PlayMobileAmbientAnimations

Prefers

RemoveAmbientSleep

RespondToShout

RunCircuit

RunNextCircuit

SetAILevel

SetAssociateStartLocation

SetBehaviorState

SetLastGenericSpellCast

SetListening

SetListeningPatterns

SetListenPattern

SetNPCWarningStatus

SetSpawnInCondition

SetSummonEffect

SetSummonHelpIfAttacked

SetWayPointTo1

SupernaturalEffect

TalentMeleeAttack

TalentMeleeAttacked

TalentSeeInvisible

VerifyCombatMeleeTalent

VerifyDisarm

WalkWayPoints

See Also

Function Categories


Function Category - Core AI Talent

Home > Reference > Functions > Categories > Core AI Talent

Core AI Talent Function Category

コアAIの技能を扱うファンクション

Functions

GetCreatureHasTalent

GetCreatureTalentBest

GetCreatureTalentRandom

GetMatchCompatibility

MatchCombatProtections

MatchElementalProtections

MatchSpellProtections

StartProtectionLoop

TalentAdvancedBuff

TalentAdvancedProtectSelf

TalentBardSong

TalentBuffSelf

TalentCureCondition

TalentDragonCombat

TalentEnhanceOthers

TalentFlee

TalentHeal

TalentHealingSelf

TalentPersistentAbilities

TalentRangedAttackers

TalentUseEnhancementOnSelf

TalentUseProtectionOnSelf

TalentUseProtectionOthers

See Also

Function Categories


Function Category - Cut-Scene

Home > Reference > Functions > Categories > Cut-Scene

Cut-Scene Function Category

場面の演出用のファンクション

Functions

BlackScreen

EffectCutsceneParalyze

EffectEthereal

FadeFromBlack

FadeToBlack

GetDialogSoundLength

GetImmortal

GetLastPCToCancelCutscene

SetAILevel

SetCutsceneMode

StopFade

See Also

Function Categories


Function Category - Database

Home > Reference > Functions > Categories > Database

Database Function Category

データ-ベース等

Functions

DeleteCampaignVariable

DestroyCampaignDatabase

Get2DAString

GetCampaignFloat

GetCampaignInt

GetCampaignLocation

GetCampaignString

GetCampaignVector

RetrieveCampaignObject

SetCampaignFloat

SetCampaignInt

SetCampaignLocation

SetCampaignString

SetCampaignVector

StoreCampaignObject

See Also

Function Categories


Function Category - Debug

Home > Reference > Functions > Categories > Debug

Debug Function Category

デバッグとテストの為のファンクション

Functions

AssignAOEDebugString

AssignPCDebugString

dbCreateItemOnObject

dbSpeak

DebugPrintTalentID

DebugSpeak

DebugSTR

DubugPrintTalentID

MyPrintString

ObjectToString

PrintFloat

PrintInteger

PrintObject

PrintString

PrintVector

SendMessageToPC

SpawnScriptDebugger

WriteTimestampedLogEntry

See Also

Function Categories


Function Category - Effects

Home > Reference > Functions > Categories > Effects

Effects Function Category

さまざまなエフェクトを扱う関数

Functions

ApplyEffectAtLocation

ApplyEffectToObject

EffectAbilityDecrease

EffectAbilityIncrease

EffectACDecrease

EffectACIncrease

EffectAppear

EffectAreaOfEffect

EffectAttackDecrease

EffectAttackIncrease

EffectBeam

EffectBlindness

EffectCharmed

EffectConcealment

EffectConfused

EffectCurse

EffectCutsceneDominated

EffectCutsceneParalyze

EffectDamage

EffectDamageDecrease

EffectDamageImmunityDecrease

EffectDamageImmunityIncrease

EffectDamageIncrease

EffectDamageReduction

EffectDamageResistance

EffectDamageShield

EffectDarkness

EffectDazed

EffectDeaf

EffectDeath

EffectDisappear

EffectDisappearAppear

EffectDisease

EffectDispelMagicAll

EffectDispelMagicBest

EffectDominated

EffectEntangle

EffectEthereal

EffectFrightened

EffectHaste

EffectHeal

EffectHitPointChangeWhenDying

EffectImmunity

EffectInvisibility

EffectKnockdown

EffectLinkEffects

EffectMissChance

EffectModifyAttacks

EffectMovementSpeedDecrease

EffectMovementSpeedIncrease

EffectNegativeLevel

EffectParalyze

EffectPetrify

EffectPoison

EffectPolymorph

EffectRegenerate

EffectResurrection

EffectSanctuary

EffectSavingThrowDecrease

EffectSavingThrowIncrease

EffectSeeInvisible

EffectSilence

EffectSkillDecrease

EffectSkillIncrease

EffectSleep

EffectSlow

EffectSpellFailure

EffectSpellImmunity

EffectSpellLevelAbsorption

EffectSpellResistanceDecrease

EffectSpellResistanceIncrease

EffectStunned

EffectSummonCreature

EffectSwarm

EffectTemporaryHitpoints

EffectTimeStop

EffectTrueSeeing

EffectTurned

EffectTurnResistanceDecrease

EffectTurnResistanceIncrease

EffectUltravision

EffectVisualEffect

ExtraordinaryEffect

GetAreaOfEffectCreator

GetEffectCreator

GetEffectDurationType

GetEffectSpellId

GetEffectSubType

GetEffectType

GetFirstEffect

GetHasEffect

GetIsEffectValid

GetNextEffect

GetPlaceableIllumination

MagicalEffect

MakeDrunk

PlayAnimation

PlayVoiceChat

RecomputeStaticLighting

RemoveEffect

RemoveSpecificEffect

RunDrownImpact

RunMelfAcidImpact

SupernaturalEffect

VersusAlignmentEffect

VersusRacialTypeEffect

VersusTrapEffect

See Also

Function Categories


Function Category - Encounter

Home > Reference > Functions > Categories > Encounter

Encounter Function Category

エンカウンターを扱う為に使われる関数

Functions

ActionCreate

GetEncounterActive

GetEncounterDifficulty

GetEncounterSpawnsCurrent

GetEncounterSpawnsMax

GetEnteringObject

GetExitingObject

GetIsEncounterCreature

SetEncounterActive

SetEncounterDifficulty

SetEncounterSpawnsCurrent

SetEncounterSpawnsMax

See Also

Function Categories


Function Category - Experience

Home > Reference > Functions > Categories > Experience

Experience Function Category

経験点を扱う関数

Functions

AddJournalQuestEntry

DoGiveXP

EffectNegativeLevel

GetJournalQuestExperience

GetXP

GiveXPToCreature

RewardPartyXP

RewardXP

SetXP

See Also

Function Categories


Function Category - Function

Home > Reference > Functions > Categories > Function

Function Function Category

アクションを行ったり値を返したりする処理

Functions

BlackScreen

CopyItem

DeleteCampaignVariable

DestroyCampaignDatabase

FadeFromBlack

FadeToBlack

Get2DAString

GetAppearanceType

GetBaseAttackBonus

GetCampaignString

GetCampaignVector

GetDefensiveCastingMode

GetIsPossessedFamiliar

GetIsSkillSuccessful

GetItemCharges

GetItemStackSize

GetLastPCToCancelCutscene

GetWeight

LevelUpHenchman

OpenInventory

PlaySoundByStrRef

RestoreCameraFacing

RetrieveCampaignObject

SetCampaignFloat

SetCampaignInt

SetCampaignLocation

SetCampaignString

SetCampaignVector

SetCutsceneMode

SetDroppableFlag

SetImmortal

SetItemCharges

SetItemStackSize

SpawnScriptDebugger

SpeakStringByStrRef

StopFade

StoreCameraFacing

StoreCampaignObject

TalentRangedEnemies

TalentSkill

TalentSneakAttack

TalentSpell

TalentSpellAttack

TalentSummonAllies

TalentUseEnhancementOnSelf

TalentUseProtectionOnSelf

TalentUseProtectionOthers

TalentUseTurning

UnpossessFamiliar

See Also

Function Categories


Function Category - Get Data

Home > Reference > Functions > Categories > Get Data

Get Data Function Category

値を返す関数

Functions

CheckPartyForItem

Get2DAString

GetArea

GetAreaFromLocation

GetCalendarDay

GetCalendarMonth

GetCalendarYear

GetClickingObject

GetCurrentAction

GetIsAreaAboveGround

GetIsAreaNatural

GetIsDMPossessed

GetLastRestEventType

GetLastSpell

GetLastSpellCaster

GetLastTrapDetected

GetLocalFloat

GetLocalInt

GetLocalLocation

GetLocalObject

GetLocalString

GetLocation

GetLocked

GetLockedObject

GetLockKeyRequired

GetLockKeyTag

GetLockLockable

GetLockLockDC

GetLockUnlockDC

GetNearestCreatureToLocation

GetNearestPC

GetNearestSeenOrHeardEnemy

GetNumberOfMeleeAttackers

GetNumberOfRangedAttackers

GetWaypointByTag

GetWeather

Global

See Also

Function Categories


Function Category - Get Data from Object

Home > Reference > Functions > Categories > Get Data from Object

Get Data from Object Function Category

オブジェクトからデータを得る関数

Functions

CreatePersonalItemOn

EndModule

GetAreaOfEffectCreator

GetBaseItemType

GetCurrentHitPoints

GetFacingFromLocation

GetIsAreaAboveGround

GetIsAreaNatural

GetIsOpen

GetIsTrapped

GetIsWeaponEffective

GetItemACValue

GetItemCharges

GetItemHasItemProperty

GetItemStackSize

GetLastAttacker

GetLastHostileActor

GetLastLocked

GetLastOpenedBy

GetLastSpellHarmful

GetLastUnlocked

GetLastUsedBy

GetLocalFloat

GetLocalInt

GetLocalLocation

GetLocalObject

GetLocalString

GetLocked

GetLockKeyRequired

GetLockKeyTag

GetLockLockable

GetLockLockDC

GetLockUnlockDC

GetName

GetNearestObject

GetNearestObjectByTag

GetNearestObjectToLocation

GetObjectByTag

GetObjectType

GetPercentageHPLoss

GetPlotFlag

GetPosition

GetResRef

GetSittingCreature

GetTag

GetTileMainLight1Color

GetTransitionTarget

GetUseableFlag

GetWeaponRanged

GetWeather

GetWeight

IsMisc

IsValidBaseItem

PlayerWearsUniform

SetIdentified

See Also

Function Categories


Function Category - Get Data from Creature

Home > Reference > Functions > Categories > Get Data from Creature

Get Data from Creature Function Category

クリーチャーからデータを得る関数

Functions

CheckCharismaHigh

CheckCharismaLow

CheckCharismaMiddle

CheckCharismaNormal

CheckIntelligenceHigh

CheckIntelligenceLow

CheckIntelligenceNormal

CheckWayPoints

CheckWisdomHigh

DetermineClassToUse

GetAbilityModifier

GetAbilityScore

GetAge

GetAlignmentGoodEvil

GetAlignmentLawChaos

GetAnimalCompanionCreatureType

GetAnimalCompanionName

GetAppearanceType

GetAssociate

GetAttemptedSpellTarget

GetBaseAttackBonus

GetCasterLevel

GetChallengeRating

GetCharacterLevel

GetCharisma

GetClassByPosition

GetCommandable

GetCreatureHasTalent

GetCreatureSize

GetCreatureTalentBest

GetCreatureTalentRandom

GetCurrentHitPoints

GetDamageDealtByType

GetDefensiveCastingMode

GetDeity

GetDetectMode

GetFacing

GetFactionAverageGoodEvilAlignment

GetFactionAverageLawChaosAlignment

GetFactionAverageLevel

GetFactionAverageReputation

GetFactionAverageXP

GetFactionBestAC

GetFactionEqual

GetFactionGold

GetFactionLeastDamagedMember

GetFactionMostDamagedMember

GetFactionMostFrequentClass

GetFactionStrongestMember

GetFactionWeakestMember

GetFactionWorstAC

GetFamiliarCreatureType

GetFamiliarName

GetFirstPC

GetFleeToExit

GetGender

GetHasFeat

GetHasSpell

GetHitDice

GetImmortal

GetIntelligence

GetIsDM

GetIsDMPossessed

GetIsDoorActionPossible

GetIsListening

GetIsPC

GetIsPlayableRacialType

GetIsPossessedFamiliar

GetIsPostOrWalking

GetIsResting

GetItemPossessor

GetLastAssociateCommand

GetLastKiller

GetLastWeaponUsed

GetLawChaosValue

GetLevelByClass

GetLevelByPosition

GetLocalFloat

GetLocalInt

GetLocalLocation

GetLocalObject

GetLocalString

GetMaster

GetMaxHitPoints

GetMetaMagicFeat

GetMovementRate

GetNearestCreature

GetNextPC

GetNumItems

GetObjectNeedsHealing

GetRacialType

GetSpawnInCondition

GetStealthMode

GetSubRace

GetTotalDamageDealt

GetTurnResistanceHD

GetWeight

GetWisdom

GetXP

HasSpell

See Also

Function Categories


Function Category - Henchmen/Familiars/Summoned

Home > Reference > Functions > Categories > Henchmen/Familiars/Summoned

Henchmen/Familiars/Summoned Function Category

NPCヘンチマン・ファミリアー・召喚クリーチャーを扱う関数

Functions

ActionForceFollowObject

ActionUseSkill

AddHenchman

CheckIsUnlocked

CopyLocals

CreateBalor

DestroyAllPersonalItems

DestroyChapterQuestItem

DestroyChapterRewardItem

DoFollowMaster

DoLevelUp

EffectSwarm

EquipAppropriateWeapons

GetAnimalCompanionCreatureType

GetAnimalCompanionName

GetAssociate

GetAssociateCRMax

GetAssociateHealMaster

GetAssociateStartLocation

GetAssociateState

GetBeenHired

GetBehind

GetCanLevelUp

GetDidDie

GetFactionMostDamagedMember

GetFamiliarCreatureType

GetFamiliarName

GetFormerMaster

GetGoingToBeAttackedBy

GetHenchman

GetIsPossessedFamiliar

GetLastAssociateCommand

GetLastHostileActor

GetListenPatternNumber

GetLockedObject

GetMaster

GetMatchedSubstring

GetMatchedSubstringsCount

GetWorkingForPlayer

GiveChapterRewardItem

GivePersonalItem

HasChapterRewardItem

HasPersonalItem

IsBusy

LevelUpHenchman

OpenInventory

OpenNearestLock

PC

RemoveHenchman

RemoveSummonedAssociate

ResetHenchmenState

SetAssociateListenPatterns

SetAssociateStartLocation

SetAssociateState

SetBeenHired

SetDidDie

SetFormerMaster

SetIsBusy

SetListening

SetListenPattern

SetSummonEffect

SetWorkingForPlayer

SpawnHenchman

SpeakQuickChat

StripAllPersonalItemsFromEveryone

SummonAnimalCompanion

SummonFamiliar

UnpossessFamiliar

See Also

Function Categories


Function Category - Inventory

Home > Reference > Functions > Categories > Inventory

Inventory Function Category

インベントリーを扱う関数

Functions

ActionEquipItem

ActionEquipMostDamagingMelee

ActionEquipMostDamagingRanged

ActionEquipMostEffectiveArmor

ActionGiveItem

ActionPickUpItem

ActionPutDownItem

ActionTakeItem

ActionUnequipItem

CheckPartyForItem

CopyObject

CreateItemOnObject

GetBackpackMatch

GetDroppableFlag

GetFirstItemInInventory

GetHasInventory

GetInventoryDisturbItem

GetInventoryDisturbType

GetItemInInventory

GetItemInSlot

GetItemPossessedBy

GetItemPossessor

GetItemStackSize

GetLastDisturbed

GetLastOpener

GetModuleItemAcquired

GetModuleItemAcquiredBy

GetModuleItemAcquiredFrom

GetModuleItemAcquiredStackSize

GetModuleItemLost

GetModuleItemLostBy

GetNextItemInInventory

GetNumItems

GetNumStackedItems

GetStolenFlag

GetWeight

GiveNumItems

HasAnyItemOfBaseType

HasGold

HasItem

OpenInventory

SetItemCharges

SetItemStackSize

StripAllPersonalItemsFromEveryone

TakeArtifactItem

TakeComplexItem

TakeFetchItem

TakeGold

TakeNumItems

TakeStoryItem

TalentBuffSelf

See Also

Function Categories


Function Category - Item Creation

Home > Reference > Functions > Categories > Item Creation

Item Creation Function Category

アイテム生成を扱う関数

Functions

ActionCreate

CopyItem

CopyObject

CreateAmmo

CreateAnimalPart

CreateArcaneScroll

CreateBastardSword

CreateBattleAxe

CreateBook

CreateClub

CreateColmarrPotion

CreateDagger

CreateDart

CreateDireMace

CreateDivineScroll

CreateDoubleAxe

CreateForgeItem

CreateGem

CreateGenericClassItem

CreateGenericDruidWeapon

CreateGenericExotic

CreateGenericHeavyArmor

CreateGenericLightArmor

CreateGenericMartial

CreateGenericMediumArmor

CreateGenericMiscItem

CreateGenericMonkWeapon

CreateGenericRodStaffWand

CreateGenericSimple

CreateGenericWizardWeapon

CreateGold

CreateGreatAxe

CreateGreatSword

CreateHalberd

CreateHandAxe

CreateHealingKit

CreateHeavyCrossbow

CreateHeavyFlail

CreateItemOnObject

CreateJewel

CreateJunk

CreateKama

CreateKatana

CreateKit

CreateKukri

CreateLightCrossbow

CreateLightFlail

CreateLightHammer

CreateLightMace

CreateLockPick

CreateLongbow

CreateLongSword

CreateMorningstar

CreateObject

CreateObjectVoid

CreatePotion

CreateRapier

CreateScimitar

CreateScythe

CreateShortbow

CreateShortsword

CreateShuriken

CreateSickle

CreateSling

CreateSpear

CreateSpecificDruidWeapon

CreateSpecificExotic

CreateSpecificHeavyArmor

CreateSpecificLightArmor

CreateSpecificMartial

CreateSpecificMediumArmor

CreateSpecificMiscItem

CreateSpecificMonkWeapon

CreateSpecificRodStaffWand

CreateSpecificSimple

CreateSpecificWizardWeapon

CreateStaff

CreateTable2Item

CreateThrowingAxe

CreateTrapKit

CreateTwoBladedSword

CreateWarhammer

dbCreateItemOnObject

GenerateBookTreasure

GenerateBossTreasure

GenerateHighTreasure

GenerateLowTreasure

GenerateMediumTreasure

GenerateNPCTreasure

GenerateTreasure

GetBackpackMatch

GetIsValidCombination

Give2Q4PlotItem

GiveFetchItemToPC

GivePlayerPersonalItem

HasAnyItemOfBaseType

IsValidBaseItem

nDetermineClassToUse

nNumberOfCombos

Prefers

See Also

Function Categories


Function Category - Journal

Home > Reference > Functions > Categories > Journal

Journal Function Category

ゲーム内の日記を扱う関数

Functions

AddJournalQuestEntry

GetJournalQuestExperience

RemoveJournalQuestEntry

See Also

Function Categories


Function Category - Lighting Effects

Home > Reference > Functions > Categories > Lighting Effects

Lighting Effects Function Category

ライティング効果に関する関数

Functions

ApplyEffectAtLocation

GetTileMainLight1Color

GetTileMainLight2Color

GetTileSourceLight1Color

GetTileSourceLight2Color

SetPlaceableIllumination

SetTileMainLightColor

SetTileSourceLightColor

See Also

Function Categories


Function Category - Local Variables

Home > Reference > Functions > Categories > Local Variables

Local Variables Function Category

ローカル変数を扱う関数

Functions

aGetPLocalInt

aSetPLocalInt

DeleteLocalFloat

DeleteLocalInt

DeleteLocalLocation

DeleteLocalObject

DeleteLocalString

GetLocalArrayInt

GetLocalArrayString

GetLocalFloat

GetLocalLocation

GetLocalObject

GetLocalString

GetPLocalInt

Global

SetArtifactItem

SetAssassinHead

SetComplexItem

SetGlobal

SetLocalArrayInt

SetLocalArrayString

SetLocalFloat

SetLocalInt

SetLocalLocation

SetLocalObject

SetLocalString

SetPLocalInt

SetWorkingForPlayer

See Also

Function Categories


Function Category - Math

Home > Reference > Functions > Categories > Math

Math Function Category

数学、演算関連の関数

Functions

abs

acos

asin

atan

cos

fabs

FeetToMeters

FindSingleRangedTarget

GetDistanceBetween

GetDistanceBetweenLocations

GetDistanceToObject

GetFacingFromLocation

GetFactionAverageReputation

GetFactionAverageXP

GetRandomDelay

IntToFloat

IntToHexString

log

pow

Random

sin

sqrt

tan

See Also

Function Categories


Function Category - Miscellaneous

Home > Reference > Functions > Categories > Miscellaneous

Miscellaneous Function Category

他のカテゴリーに分類できないファンクション

Functions

ActionWait

BootPC

CopyObject

CreateObject

d10

d100

d12

d2

d20

d3

d4

d6

d8

DrinkIt

ExecuteScript

ExportSingleCharacter

GetAssassinHead

GetFirstInPersistentObject

GetFirstObjectInShape

GetGameDifficulty

GetIsDead

GetIsEnemy

GetIsImmune

GetIsNeutral

GetLastPCRested

GetLastRespawnButtonPresser

GetMyMaster

GetNextInPersistentObject

GetNextObjectInShape

GetPositionFromLocation

GetUserDefinedEventNumber

GiveRingToPlayer

gplotAppraiseOpenStore

OpenStore

PopUpGUIPanel

PrintString

RandomName

RestoreCameraFacing

SetAreaTransitionBMP

SetCameraFacing

SetCameraMode

SetCommandable

SetDeity

SetDroppableFlag

SetImmortal

SetMapPinEnabled

SetPlotFlag

SetSubRace

SignalEvent

StoreCameraFacing

TakeArtifactItem

TakeFetchItem

See Also

Function Categories


Function Category - Module

Home > Reference > Functions > Categories > Module

Module Function Category

モジュールを扱う関数

Functions

ActivatePortal

aGetPLocalInt

aSetPLocalInt

DoSinglePlayerAutoSave

EndGame

GetCalendarDay

GetCalendarMonth

GetCalendarYear

GetEnteringObject

GetExitingObject

GetModule

GetModuleItemAcquired

GetModuleItemAcquiredBy

GetModuleItemAcquiredFrom

GetModuleItemAcquiredStackSize

GetModuleItemLost

GetModuleItemLostBy

GetModuleName

GetPLocalInt

GetStartingLocation

GetStartLocation

SetAreaTransitionBMP

SetPLocalInt

StartNewModule

See Also

Function Categories


Function Category - Module Specific

Home > Reference > Functions > Categories > Module Specific

Module Specific Function Category

#includeに見られる特定モジュールで使われる特殊な関数。

Functions

BringBack

CanAfford

CanAffordIt

ClearArena

CreateSignPostNPC

DoOnce

GetArtifactItem

GetBackpackMatch

GetChapter

GetComplexItem

GetFetchee

GetFetchItem

GetForgeMatch

GetGreetingVar

GetHas2Q4PlotItem

GetIsMagical

GetItemPosition

GetLocalPlotIntFromCharacter

GetMachineState

GetNumberOfItems

GetPersonalItem

GetPlotGiver

GetPlotJournal

GetPlotRingTag

GetPlotTag

GetPlotToken

GetPrisoner

GetRange

GetRingGivenTo

GetStoryItem

GetUniform

GetValidItem

GetValidItemCost

GetVictim

Give2Q4PlotItem

GiveChapterRewardItem

GiveFetchItemToPC

GivePlayerPersonalItem

HasChapterRewardItem

HasPersonalItem

HasSpell

IsRecall

main

MakeWay

NextTag

PCAcceptedPlot

PlayerHasArtifactItem

PlayerHasComplexItem

PlayerHasFetchItem

PlayerHasHead

PlayerHasPersonalItem

PlayerHasRing

PlayerHasStoryItem

PlayerWearsUniform

PlotGiverDead

SetArtifactItem

SetAssassinHead

SetComplexItem

SetDoubleCrosserName

SetFetchee

SetFetchItem

SetGreetingVar

SetLocalPlotIntOnCharacter

SetMachineState

SetPersonalItem

SetPlotGiver

SetPlotJournal

SetPlotRing

SetPlotTag

SetPlotToken

SetPrisoner

SetRingGivenTo

SetSpawnInLocals

SetStoryItem

SetStoryVar

SetUniform

SetValidItem

SetValidItemCost

SetValidItemCostToken

SetVictim

VictimDead

VictimDeadButNoItems

See Also

Function Categories


Function Category - Money

Home > Reference > Functions > Categories > Money

Money Function Category

お金を扱う関数

Functions

GetFactionGold

GetGold

GetGoldPieceValue

GetReactionAdjustment

GiveGoldToCreature

HasGold

RewardGP

RewardPartyGP

TakeGold

TakeGoldFromCreature

See Also

Function Categories


Function Category - Movement

Home > Reference > Functions > Categories > Movement

Movement Function Category

移動に関する関数

Functions

ActionForceFollowObject

ActionForceMoveToLocation

ActionForceMoveToObject

ActionJumpToLocation

ActionJumpToObject

ActionMoveAwayFromLocation

ActionMoveAwayFromObject

ActionMoveToLocation

ActionMoveToObject

ActionPickUpItem

ActionRandomWalk

ActivateFleeToExit

ActivatePortal

CheckWayPoints

EffectMovementSpeedDecrease

EffectMovementSpeedIncrease

EscapeArea

GetBlockingDoor

GetDistanceBetweenLocations

GetDistanceToObject

GetFacing

GetFacingFromLocation

GetTransitionTarget

JumpToLocation

JumpToObject

MoveTo2Q4PlotPoint

RunCircuit

RunNextCircuit

SetFacing

SetFacingPoint

Vector

VectorMagnitude

VectorNormalize

WalkWayPoints

See Also

Function Categories


Function Category - Music Effects

Home > Reference > Functions > Categories > Music Effects

Music Effects Function Category

音楽効果に関する関数

Functions

MusicBackgroundChangeDay

MusicBackgroundChangeNight

MusicBackgroundGetBattleTrack

MusicBackgroundGetDayTrack

MusicBackgroundGetNightTrack

MusicBackgroundPlay

MusicBackgroundSetDelay

MusicBackgroundStop

MusicBattleChange

MusicBattlePlay

MusicBattleStop

PlayCharacterTheme

PlayOldTheme

See Also

Function Categories


Function Category - Party

Home > Reference > Functions > Categories > Party

Party Function Category

パーティを扱う関数

Functions

AddToParty

aGetPLocalInt

aSetPLocalInt

CheckPartyForItem

GetFactionAverageXP

GetFactionBestAC

GetFactionGold

GetFactionLeader

GetFactionLeastDamagedMember

GetFactionMostDamagedMember

GetFactionMostFrequentClass

GetFactionStrongestMember

GetFactionWeakestMember

GetFactionWorstAC

GetLevelByClass

GetLevelByPosition

GetListenPatternNumber

GetPLocalInt

RemoveFromParty

RewardPartyXP

SetPLocalInt

See Also

Function Categories


Function Category - PC Only

Home > Reference > Functions > Categories > PC Only

PC Only Function Category

プレーヤーキャラクターのみに影響のある関数

Functions

ActivatePortal

ApplyPenalty

BootPC

DoSinglePlayerAutoSave

FadeFromBlack

FadeToBlack

FloatingTextStringOnCreature

FloatingTextStrRefOnCreature

GetIsPC

GetJournalQuestExperience

GetLastPCRested

GetLastPCToCancelCutscene

GetLastPlayerDied

GetLastPlayerDying

GetLastRespawnButtonPresser

GetLastRestEventType

GetPCIPAddress

GetPCLevellingUp

GetPCPlayerName

GetPCPublicCDKey

GetPCSpeaker

PopUpDeathGUIPanel

Raise

RemoveEffects

RestoreCameraFacing

RewardPartyXP

SendMessageToPC

SetCameraFacing

SetCutsceneMode

StoreCameraFacing

See Also

Function Categories


Function Category - Perception

Home > Reference > Functions > Categories > Perception

Perception Function Category

認知（パーセプション）を扱う関数

Functions

CanSeePlayer

DetermineEnemies

GetCanSeePC

GetFactionLeastDamagedMember

GetFactionMostDamagedMember

GetLastPerceived

GetLastPerceptionHeard

GetLastPerceptionInaudible

GetLastPerceptionSeen

GetLastPerceptionVanished

GetNearestSeenOrHeardEnemy

GetObjectHeard

GetObjectSeen

GetTrapFlagged

See Also

Function Categories


Function Category - Private Functions

Home > Reference > Functions > Categories > Private Functions

Private Functions Function Category

これらの関数はBioWare公式モジュールの中で使用されているプライベート関数である。
インクルードファイルではないため、インクルードできず、その上"void main()"を使っているため、呼び出すことができない。
Scripts.bifアーカイブ・ファイルにあるスクリプトをローカルにコピーすることによって使用できる。

Functions

FakeRestore

FindTarget

GetValidWeapon

GreaterRestore

HasChapterQuestItem

JumpToWeakestEnemy

MakeWay

NextTag

RunDrownImpact

RunMelfAcidImpact

SearchForPlayer

SetSummonEffect

See Also

Function Categories


Function Category - Prototyped but Unused

Home > Reference > Functions > Categories > Prototyped but Unused

Prototyped but Unused Function Category

試作されたがBiowareによって使われなかった関数

Functions

ClearAllFactionMembers

CreateFetchItemOn

DetermineAssociateCombatRound

ExitAOESpellArea

GetAlliedHD

GetAttackCompatibility

GetEnemyHD

GetRangedAttackGroup

GetRunState

GetToughestAttacker

GetToughestMeleeAttacker

GetWeaponFocus

MatchFortAttacks

MatchReflexAttacks

OpenNearestLock

StartAttackLoop

UniversalSpellMatch

See Also

Function Categories


Function Category - Reputation/Faction

Home > Reference > Functions > Categories > Reputation/Faction

Reputation/Faction Function Category

Functions that deal with reputation or faction.

Functions

AdjustFactionReputation

AdjustReputation

ChangeFaction

ChangeToStandardFaction

ClearAllFactionMembers

ClearPersonalReputation

GetFactionAverageGoodEvilAlignment

GetFactionAverageLawChaosAlignment

GetFactionAverageLevel

GetFactionAverageReputation

GetFactionAverageXP

GetFactionBestAC

GetFactionEqual

GetFactionGold

GetFactionLeader

GetFactionLeastDamagedMember

GetFactionMostDamagedMember

GetFactionMostFrequentClass

GetFactionStrongestMember

GetFactionWeakestMember

GetFactionWorstAC

GetFirstFactionMember

GetIsEnemy

GetIsFriend

GetIsNeutral

GetIsReactionTypeFriendly

GetIsReactionTypeHostile

GetIsReactionTypeNeutral

GetNextFactionMember

GetReactionAdjustment

GetReputation

GetStandardFactionReputation

SetIsEnemy

SetIsTemporaryEnemy

SetIsTemporaryFriend

SetIsTemporaryNeutral

SetPCDislike

SetPCLike

SetStandardFactionReputation

ShoutDisturbed

SurrenderToEnemies

See Also

Function Categories


Function Category - Saving Throw

Home > Reference > Functions > Categories > Saving Throw

Saving Throw Function Category

セービング・スローを扱う関数

Functions

EffectSavingThrowDecrease

EffectSavingThrowIncrease

FortitudeSave

GetFortitudeSavingThrow

GetReflexAdjustedDamage

GetReflexSavingThrow

GetSpellSaveDC

GetWillSavingThrow

ReflexSave

WillSave

See Also

Function Categories


Function Category - Server

Home > Reference > Functions > Categories > Server

Server Function Category

サーバーを扱う関数

Functions

ActivatePortal

BootPC

ExportAllCharacters

ExportSingleCharacter

GetPCIPAddress

SendMessageToAllDMs

SetPanelButtonFlash

See Also

Function Categories


Function Category - Sound Effects

Home > Reference > Functions > Categories > Sound Effects

Sound Effects Function Category

音効果に関する関数

Functions

AmbientSoundChangeDay

AmbientSoundChangeNight

AmbientSoundPlay

AmbientSoundSetDayVolume

AmbientSoundSetNightVolume

AmbientSoundStop

ApplyPrismaticEffect

GetDialogSoundLength

GetStrRefSoundDuration

PlayDragonBattleCry

PlaySound

PlaySoundByStrRef

SoundObjectPlay

SoundObjectSetPosition

SoundObjectSetVolume

SoundObjectStop

See Also

Function Categories


Function Category - Spell Casting Effects

Home > Reference > Functions > Categories > Spell Casting Effects

Spell Casting Effects Function Category

呪文詠唱エフェクトに関連する関数

Functions

ActionCastFakeSpellAtLocation

ActionCastFakeSpellAtObject

ActionCastSpellAtLocation

ActionCastSpellAtObject

ApplyEffectToObject

CreateDoomEffectsLink

CreateProtectionFromAlignmentLink

EffectACDecrease

EffectACIncrease

EffectBeam

EffectSlow

EventSpellCastAt

GetDefensiveCastingMode

GetHasSpellEffect

GetMetaMagicFeat

GetSpellSaveDC

MyResistSpell

MySavingThrow

RunDrownImpact

ShadowBolt

SoundObjectSetPosition

SpellDelay

StripEffects

TalentSeeInvisible

VersusAlignmentEffect

See Also

Function Categories


Function Category - Spells

Home > Reference > Functions > Categories > Spells

Spells Function Category

呪文を扱う関数

Functions

ActionCastSpellAtLocation

ActionCastSpellAtObject

CreateProtectionFromAlignmentLink

DecrementRemainingSpellUses

EffectACDecrease

EffectACIncrease

EffectAreaOfEffect

EffectDispelMagicAll

EffectDispelMagicBest

EffectPolymorph

EffectSpellImmunity

EffectTurnResistanceDecrease

EffectTurnResistanceIncrease

EventSpellCastAt

GetAttemptedSpellTarget

GetDefensiveCastingMode

GetEnteringObject

GetExitingObject

GetHasSpell

GetLastSpell

GetLastSpellCaster

GetLastSpellHarmful

GetMetaMagicFeat

GetScaledDuration

GetScaledEffect

GetSpellBreachProtection

GetSpellCastItem

GetSpellEffectDelay

GetSpellId

GetSpellSaveDC

GetSpellTargetLocation

GetSpellTargetObject

GetTypeFromTalent

HasSpell

MyResistSpell

MySavingThrow

RemoveProtections

RemoveSpellEffects

ResistSpell

RunMelfAcidImpact

ShadowBolt

SpellDelay

StripEffects

TalentAdvancedBuff

TalentCureCondition

TalentSeeInvisible

TrimLevel

VersusAlignmentEffect

VersusRacialTypeEffect

See Also

Function Categories


Function Category - String

Home > Reference > Functions > Categories > String

String Function Category

文字列操作を扱う関数

Functions

FindSubString

Get2DAString

GetStringByStrRef

GetStringLeft

GetStringLength

GetStringLowerCase

GetStringRight

GetStringUpperCase

GetSubString

InsertString

PrintString

SendMessageToAllDMs

SendMessageToPC

SpeakQuickChat

TestStringAgainstPattern

See Also

Function Categories


Function Category - Talents/Skills/Feats

Home > Reference > Functions > Categories > Talents/Skills/Feats

Talents/Skills/Feats Function Category

特殊能力、スキル、フィートを扱う関数

Functions

ActionUseFeat

ActionUseSkill

ActionUseTalentAtLocation

ActionUseTalentOnObject

AutoDC

DebugPrintTalentID

DecrementRemainingFeatUses

EffectACDecrease

EffectACIncrease

EffectSkillIncrease

GetCanCastHealingSpells

GetCreatureTalentRandom

GetHasFeat

GetHasFeatEffect

GetHasSkill

GetIdFromTalent

GetIsSkillSuccessful

GetIsTalentValid

GetMatchCompatibility

GetSkillRank

GetTypeFromTalent

ShadowBolt

TalentAdvancedBuff

TalentAdvancedProtectSelf

TalentBardSong

TalentBuffSelf

TalentCureCondition

TalentDragonCombat

TalentFeat

TalentFlee

TalentHealingSelf

TalentPersistentAbilities

TalentRangedAttackers

TalentRangedEnemies

TalentSeeInvisible

TalentSkill

TalentSneakAttack

TalentSpell

TalentSpellAttack

TalentSummonAllies

TalentUseTurning

VersusTrapEffect

See Also

Function Categories


Function Category - Targeting

Home > Reference > Functions > Categories > Targeting

Targeting Function Category

目標指定を扱う関数

Functions

FindSingleRangedTarget

GetAttackTarget

GetAttemptedAttackTarget

GetAttemptedSpellTarget

GetDistanceBetween

GetDistanceBetweenLocations

GetDistanceToObject

GetFacingFromLocation

GetFactionBestAC

GetFactionLeastDamagedMember

GetFactionMostDamagedMember

GetFactionWorstAC

GetLastHostileActor

GetLocation

GetMostDangerousClass

GetNearestSeenOrHeardEnemy

SetBehaviorState

ShoutDisturbed

VersusRacialTypeEffect

See Also

Function Categories


Function Category - Time

Home > Reference > Functions > Categories > Time

Time Function Category

時間を扱う関数

Functions

ActionWait

DelayCommand

GetCalendarDay

GetCalendarMonth

GetCalendarYear

GetIsDawn

GetIsDay

GetIsDusk

GetIsNight

GetRandomDelay

GetTimeHour

GetTimeMillisecond

GetTimeMinute

GetTimeSecond

HoursToSeconds

RoundsToSeconds

SetCalendar

SetTime

TurnsToSeconds

See Also

Function Categories


Function Category - Traps

Home > Reference > Functions > Categories > Traps

Traps Function Category

トラップを扱う関数

Functions

EffectAreaOfEffect

GetEnteringObject

GetExitingObject

GetLastTrapDetected

GetNearestTrapToObject

GetTrapBaseType

GetTrapCreator

GetTrapDetectable

GetTrapDetectDC

GetTrapDetectedBy

GetTrapDisarmable

GetTrapDisarmDC

GetTrapFlagged

GetTrapKeyTag

GetTrapOneShot

SetTrapDetectedBy

SetTrapDisabled

VersusTrapEffect

See Also

Function Categories


Function Category - Type Casting/Conversion

Home > Reference > Functions > Categories > Type Casting/Conversion

Type Casting/Conversion Function Category

変数型を他の変数型に変換する関数

Functions

AngleToVector

FloatToInt

FloatToString

IntToFloat

IntToHexString

IntToString

RoundsToSeconds

StringToFloat

StringToInt

TalentFeat

TurnsToSeconds

VectorToAngle

YardsToMeters

See Also

Function Categories


Function Category - Visual Effects

Home > Reference > Functions > Categories > Visual Effects

Visual Effects Function Category

視覚効果に関する関数

Functions

ActionCastFakeSpellAtLocation

ActionCastFakeSpellAtObject

ActionPlayAnimation

ApplyEffectAtLocation

ApplyEffectToObject

EffectVisualEffect

FloatingTextStringOnCreature

MyResistSpell

MySavingThrow

PlayConversationAnimation

PlaySuccessVisual

SetSummonEffect

SetWeather

ShadowBolt

StripEffects

See Also

Function Categories


Function Categories - Functions

Home > Reference > Functions

Functions

implies Lexicon authored
implies BioWare original (to do)

abs
acos
ActionAttack
ActionCastFakeSpellAtLocation
ActionCastFakeSpellAtObject
ActionCastSpellAtLocation
ActionCastSpellAtObject
ActionCloseDoor
ActionCounterSpell
ActionCreate
ActionDoCommand
ActionEquipItem
ActionEquipMostDamagingMelee
ActionEquipMostDamagingRanged
ActionEquipMostEffectiveArmor
ActionForceFollowObject
ActionForceMoveToLocation
ActionForceMoveToObject
ActionGiveItem
ActionInteractObject
ActionJumpToLocation
ActionJumpToObject
ActionLockObject
ActionMoveAwayFromLocation
ActionMoveAwayFromObject
ActionMoveToLocation
ActionMoveToObject
ActionOpenDoor
ActionPauseConversation
ActionPickUpItem
ActionPlayAnimation
ActionPutDownItem
ActionRandomWalk
ActionRest
ActionResumeConversation
ActionSit
ActionSpeakString
ActionSpeakStringByStrRef
ActionStartConversation
ActionTakeItem
ActionUnequipItem
ActionUnlockObject
ActionUseFeat
ActionUseSkill
ActionUseTalentAtLocation
ActionUseTalentOnObject
ActionWait
ActivateFleeToExit
ActivatePortal
ActivePortal
AddHenchman
AddJournalQuestEntry
AddToParty
AdjustAlignment
AdjustFactionReputation
AdjustReputation
aGetPLocalInt
AmbientSoundChangeDay
AmbientSoundChangeNight
AmbientSoundPlay
AmbientSoundSetDayVolume
AmbientSoundSetNightVolume
AmbientSoundStop
AngleToVector
ApplyEffectAtLocation
ApplyEffectToObject
ApplyPenalty
ApplyPrismaticEffect
aSetPLocalInt
asin
AssignAOEDebugString
AssignCommand
AssignPCDebugString
AssociateCheck
atan
AutoAlignE
AutoAlignG
AutoDC

BashDoorCheck
BeginConversation
BlackScreen
BootPC
BringBack

CanAfford
CanAffordIt
CanSeePlayer
ChangeFaction
ChangeToStandardFaction
CheckCharismaHigh
CheckCharismaLow
CheckCharismaMiddle
CheckCharismaNormal
CheckEnemyGroupingOnTarget
CheckFriendlyFireOnTarget
CheckIntelligenceHigh
CheckIntelligenceLow
CheckIntelligenceNormal
CheckIsUnlocked
CheckPartyForItem
CheckWayPoints
CheckWisdomHigh
chooseTactics
ClearAllActions
ClearAllFactionMembers
ClearArena
ClearPersonalReputation
CompareLastSpellCast
CopyItem
CopyLocals
CopyObject
cos
CreateAmmo
CreateAnimalPart
CreateArcaneScroll
CreateBalor
CreateBastardSword
CreateBattleAxe
CreateBook
CreateClub
CreateColmarrPotion
CreateDagger
CreateDart
CreateDireMace
CreateDivineScroll
CreateDoomEffectsLink
CreateDoubleAxe
CreateFetchItemOn
CreateForgeItem
CreateGem
CreateGenericClassItem
CreateGenericDruidWeapon
CreateGenericExotic
CreateGenericHeavyArmor
CreateGenericLightArmor
CreateGenericMartial
CreateGenericMediumArmor
CreateGenericMiscItem
CreateGenericMonkWeapon
CreateGenericRodStaffWand
CreateGenericSimple
CreateGenericWizardWeapon
CreateGold
CreateGreatAxe
CreateGreatSword
CreateHalberd
CreateHandAxe
CreateHealingKit
CreateHeavyCrossbow
CreateHeavyFlail
CreateItemOnObject
CreateJewel
CreateJunk
CreateKama
CreateKatana
CreateKit
CreateKukri
CreateLightCrossbow
CreateLightFlail
CreateLightHammer
CreateLightMace
CreateLockPick
CreateLongbow
CreateLongSword
CreateMorningstar
CreateObject
CreateObjectVoid
CreatePersonalItemOn
CreatePotion
CreateProtectionFromAlignmentLink
CreateRapier
CreateScimitar
CreateScythe
CreateShortbow
CreateShortsword
CreateShuriken
CreateSickle
CreateSignPostNPC
CreateSling
CreateSpear
CreateSpecificDruidWeapon
CreateSpecificExotic
CreateSpecificHeavyArmor
CreateSpecificLightArmor
CreateSpecificMartial
CreateSpecificMediumArmor
CreateSpecificMiscItem
CreateSpecificMonkWeapon
CreateSpecificRodStaffWand
CreateSpecificSimple
CreateSpecificWizardWeapon
CreateStaff
CreateTable2Item
CreateThrowingAxe
CreateTrapKit
CreateTwoBladedSword
CreateWarhammer

d10
d100
d12
d2
d20
d3
d4
d6
d8
dbCreateItemOnObject
dbSpeak
DebugPrintTalentID
DebugSpeak
DebugSTR
DecrementRemainingFeatUses
DecrementRemainingSpellUses
DelayCommand
DeleteCampaignVariable
DeleteLocalFloat
DeleteLocalInt
DeleteLocalLocation
DeleteLocalObject
DeleteLocalString
DestroyAllPersonalItems
DestroyCampaignDatabase
DestroyChapterQuestItem
DestroyChapterRewardItem
DestroyObject
DetermineAssociateCombatRound
DetermineClassToUse
DetermineCombatRound
DetermineEnemies
DetermineSpecialBehavior
DimensionHop
DoDoorAction
DoFollowMaster
DoGiveXP
DoLevelUp
DoOnce
DoPlaceableObjectAction
DoSinglePlayerAutoSave
DrinkIt
DubugPrintTalentID

EffectAbilityDecrease
EffectAbilityIncrease
EffectACDecrease
EffectACIncrease
EffectAppear
EffectAreaOfEffect
EffectAttackDecrease
EffectAttackIncrease
EffectBeam
EffectBlindness
EffectCharmed
EffectConcealment
EffectConfused
EffectCurse
EffectCutsceneDominated
EffectCutsceneParalyze
EffectDamage
EffectDamageDecrease
EffectDamageImmunityDecrease
EffectDamageImmunityIncrease
EffectDamageIncrease
EffectDamageReduction
EffectDamageResistance
EffectDamageShield
EffectDarkness
EffectDazed
EffectDeaf
EffectDeath
EffectDisappear
EffectDisappearAppear
EffectDisease
EffectDispelMagicAll
EffectDispelMagicBest
EffectDominated
EffectEntangle
EffectEthereal
EffectFrightened
EffectHaste
EffectHeal
EffectHitPointChangeWhenDying
EffectImmunity
EffectInvisibility
EffectKnockdown
EffectLinkEffects
EffectMissChance
EffectModifyAttacks
EffectMovementSpeedDecrease
EffectMovementSpeedIncrease
EffectNegativeLevel
EffectParalyze
EffectPetrify
EffectPoison
EffectPolymorph
EffectRegenerate
EffectResurrection
EffectSanctuary
EffectSavingThrowDecrease
EffectSavingThrowIncrease
EffectSeeInvisible
EffectSilence
EffectSkillDecrease
EffectSkillIncrease
EffectSleep
EffectSlow
EffectSpellFailure
EffectSpellImmunity
EffectSpellLevelAbsorption
EffectSpellResistanceDecrease
EffectSpellResistanceIncrease
EffectStunned
EffectSummonCreature
EffectSwarm
EffectTemporaryHitpoints
EffectTimeStop
EffectTrueSeeing
EffectTurned
EffectTurnResistanceDecrease
EffectTurnResistanceIncrease
EffectUltravision
EffectVisualEffect
EndGame
EndModule
EquipAppropriateWeapons
EscapeArea
EscapeViaTeleport
EventActivateItem
EventConversation
EventSpellCastAt
EventUserDefined
ExecuteScript
ExitAOESpellArea
ExploreAreaForPlayer
ExportAllCharacters
ExtraordinaryEffect

fabs
FaceNearestPC
FadeFromBlack
FadeToBlack
FakeRestore
FeetToMeters
FindSingleRangedTarget
FindSubString
FindTarget
FloatingTextStringOnCreature
FloatingTextStrRefOnCreature
FloatToInt
FloatToString
FortitudeSave

GenerateBookTreasure
GenerateBossTreasure
GenerateHighTreasure
GenerateLowTreasure
GenerateMediumTreasure
GenerateNPCTreasure
GenerateTreasure
Get2DAString
GetAbilityModifier
GetAbilityScore
GetAC
GetAge
GetAILevel
GetAlignmentGoodEvil
GetAlignmentLawChaos
GetAlliedHD
GetAnimalCompanionCreatureType
GetAnimalCompanionName
GetAppearanceType
GetArea
GetAreaFromLocation
GetAreaOfEffectCreator
GetArtifactItem
GetAssassinHead
GetAssociate
GetAssociateCRMax
GetAssociateHealMaster
GetAssociateStartLocation
GetAssociateState
GetAttackCompatibility
GetAttackTarget
GetAttemptedAttackTarget
GetAttemptedSpellTarget
GetBackpackMatch
GetBaseAttackBonus
GetBaseItemType
GetBeenHired
GetBehaviorState
GetBehind
GetBlockingDoor
GetCalendarDay
GetCalendarMonth
GetCalendarYear
GetCampaignFloat
GetCampaignInt
GetCampaignLocation
GetCampaignString
GetCampaignVector
GetCanCastHealingSpells
GetCanLevelUp
GetCanSeePC
GetCasterLevel
GetChallengeRating
GetChapter
GetCharacterLevel
GetCharisma
GetClassByPosition
GetClickingObject
GetCommandable
GetComplexItem
GetCreatureHasTalent
GetCreatureSize
GetCreatureTalentBest
GetCreatureTalentRandom
GetCurrentAction
GetCurrentHitPoints
GetDamageDealtByType
GetDefensiveCastingMode
GetDeity
GetDetectMode
GetDialogSoundLength
GetDidDie
GetDistanceBetween
GetDistanceBetweenLocations
GetDistanceToObject
GetDroppableFlag
GetEffectCreator
GetEffectDurationType
GetEffectSpellId
GetEffectSubType
GetEffectType
GetEncounterActive
GetEncounterDifficulty
GetEncounterSpawnsCurrent
GetEncounterSpawnsMax
GetEnemyHD
GetEnteringObject
GetExitingObject
GetFacing
GetFacingFromLocation
GetFactionAverageGoodEvilAlignment
GetFactionAverageLawChaosAlignment
GetFactionAverageLevel
GetFactionAverageReputation
GetFactionAverageXP
GetFactionBestAC
GetFactionEqual
GetFactionGold
GetFactionLeader
GetFactionLeastDamagedMember
GetFactionMostDamagedMember
GetFactionMostFrequentClass
GetFactionStrongestMember
GetFactionWeakestMember
GetFactionWorstAC
GetFamiliarCreatureType
GetFamiliarName
GetFetchee
GetFetchItem
GetFirstEffect
GetFirstFactionMember
GetFirstInPersistentObject
GetFirstItemInInventory
GetFirstObjectInArea
GetFirstObjectInShape
GetFirstPC
GetFleeToExit
GetFollowDistance
GetForgeMatch
GetFormerMaster
GetFortitudeSavingThrow
GetGameDifficulty
GetGender
GetGoingToBeAttackedBy
GetGold
GetGoldPieceValue
GetGoodEvilValue
GetGreetingVar
GetHas2Q4PlotItem
GetHasEffect
GetHasFeat
GetHasFeatEffect
GetHasInventory
GetHasSkill
GetHasSpell
GetHasSpellEffect
GetHenchman
GetHitDice
GetIdentified
GetIdFromTalent
GetImmortal
GetIntelligence
GetInventoryDisturbItem
GetInventoryDisturbType
GetIsDawn
GetIsDay
GetIsDead
GetIsDM
GetIsDoorActionPossible
GetIsDusk
GetIsEffectValid
GetIsEncounterCreature
GetIsEnemy
GetIsFighting
GetIsFriend
GetIsImmune
GetIsInCombat
GetIsListening
GetIsMagical
GetIsNeutral
GetIsNight
GetIsObjectValid
GetIsOpen
GetIsPC
GetIsPlaceableObjectActionPossible
GetIsPlayableRacialType
GetIsPossessedFamiliar
GetIsPostOrWalking
GetIsReactionTypeFriendly
GetIsReactionTypeHostile
GetIsReactionTypeNeutral
GetIsResting
GetIsSkillSuccessful
GetIsTalentValid
GetIsTrapped
GetIsValidCombination
GetIsWeaponEffective
GetItemActivated
GetItemActivatedTarget
GetItemActivatedTargetLocation
GetItemActivator
GetItemACValue
GetItemCharges
GetItemHasItemProperty
GetItemInInventory
GetItemInSlot
GetItemPosition
GetItemPossessedBy
GetItemPossessor
GetItemStackSize
GetJournalQuestExperience
GetLastAssociateCommand
GetLastAttacker
GetLastAttackMode
GetLastAttackType
GetLastClosedBy
GetLastDamager
GetLastDisarmed
GetLastDisturbed
GetLastGenericSpellCast
GetLastHostileActor
GetLastKiller
GetLastLocked
GetLastOpenedBy
GetLastOpener
GetLastPCRested
GetLastPCToCancelCutscene
GetLastPerceived
GetLastPerceptionHeard
GetLastPerceptionInaudible
GetLastPerceptionSeen
GetLastPerceptionVanished
GetLastPlayerDied
GetLastPlayerDying
GetLastRespawnButtonPresser
GetLastRestEventType
GetLastSpeaker
GetLastSpell
GetLastSpellCaster
GetLastSpellHarmful
GetLastTrapDetected
GetLastUnlocked
GetLastUsedBy
GetLastWeaponUsed
GetLawChaosValue
GetLevelByClass
GetLevelByPosition
GetListenPatternNumber
GetLocalArrayInt
GetLocalArrayString
GetLocalFloat
GetLocalInt
GetLocalLocation
GetLocalObject
GetLocalPlotIntFromCharacter
GetLocalString
GetLocation
GetLocked
GetLockedObject
GetLockKeyRequired
GetLockKeyTag
GetLockLockable
GetLockLockDC
GetLockUnlockDC
GetMachineState
GetMaster
GetMatchCompatibility
GetMatchedSubstring
GetMatchedSubstringsCount
GetMaxHitPoints
GetMetaMagicFeat
GetModule
GetModuleItemAcquired
GetModuleItemAcquiredBy
GetModuleItemAcquiredFrom
GetModuleItemAcquiredStackSize
GetModuleItemLost
GetModuleItemLostBy
GetModuleName
GetMostDangerousClass
GetMovementRate
GetMyArea
GetMyMaster
GetName
GetNearestCreature
GetNearestCreatureToLocation
GetNearestObject
GetNearestObjectByTag
GetNearestObjectToLocation
GetNearestPC
GetNearestSeenOrHeardEnemy
GetNearestTrapToObject
GetNextEffect
GetNextFactionMember
GetNextInPersistentObject
GetNextItemInInventory
GetNextObjectInArea
GetNextObjectInShape
GetNextPC
GetNPCWarningStatus
GetNumberOfItems
GetNumberOfMeleeAttackers
GetNumberOfRangedAttackers
GetNumItems
GetNumStackedItems
GetObjectByTag
GetObjectHeard
GetObjectNeedsHealing
GetObjectSeen
GetObjectType
GetPCIPAddress
GetPCLevellingUp
GetPCPlayerName
GetPCPublicCDKey
GetPCSpeaker
GetPercentageHPLoss
GetPersonalItem
GetPlaceableIllumination
GetPLocalInt
GetPlotFlag
GetPlotGiver
GetPlotJournal
GetPlotRingTag
GetPlotTag
GetPlotToken
GetPosition
GetPositionFromLocation
GetPrisoner
GetRacialType
GetRacialTypeCount
GetRandomDelay
GetRange
GetRangedAttackGroup
GetReactionAdjustment
GetReflexAdjustedDamage
GetReflexSavingThrow
GetReputation
GetResRef
GetRingGivenTo
GetRunState
GetScaledDuration
GetScaledEffect
GetSittingCreature
GetSkillRank
GetSpawnInCondition
GetSpellBreachProtection
GetSpellCastItem
GetSpellEffectDelay
GetSpellId
GetSpellSaveDC
GetSpellTargetLocation
GetSpellTargetObject
GetStandardFactionReputation
GetStartingLocation
GetStartLocation
GetStealthMode
GetStolenFlag
GetStoryItem
GetStringByStrRef
GetStringLeft
GetStringLength
GetStringLowerCase
GetStringRight
GetStringUpperCase
GetStrRefSoundDuration
GetSubRace
GetSubString
GetTag
GetTileMainLight1Color
GetTileMainLight2Color
GetTileSourceLight1Color
GetTileSourceLight2Color
GetTimeHour
GetTimeMillisecond
GetTimeMinute
GetTimeSecond
GetTotalDamageDealt
GetToughestAttacker
GetToughestMeleeAttacker
GetTransitionTarget
GetTrapBaseType
GetTrapCreator
GetTrapDetectable
GetTrapDetectDC
GetTrapDetectedBy
GetTrapDisarmable
GetTrapDisarmDC
GetTrapFlagged
GetTrapKeyTag
GetTrapOneShot
GetTurnResistanceHD
GetTypeFromTalent
GetUniform
GetUseableFlag
GetUserDefinedEventNumber
GetValidItem
GetValidItemCost
GetValidWeapon
GetVictim
GetWaypointByTag
GetWeaponFocus
GetWeaponRanged
GetWeight
GetWillSavingThrow
GetWisdom
GetWorkingForPlayer
GetXP
Give2Q4PlotItem
GiveChapterRewardItem
GiveFetchItemToPC
GiveGoldToCreature
GiveNumItems
GivePersonalItem
GivePlayerPersonalItem
GiveRingToPlayer
GiveXPToCreature
Global
GreaterRestore

HasAnyItemOfBaseType
HasChapterQuestItem
HasChapterRewardItem
HasGold
HasItem
HasPersonalItem
HasSpell
HoursToSeconds

InsertString
IntToFloat
IntToHexString
IntToString
IsBusy
IsInConversation
IsMisc
IsRecall
IsValidBaseItem

JumpToLocation
JumpToObject
JumpToWeakestEnemy

LevelUpHenchman
Location
log

MagicalEffect
main
MakeDrunk
MakeWay
MatchCombatProtections
MatchElementalProtections
MatchFortAttacks
MatchReflexAttacks
MatchSpellProtections
MoveTo2Q4PlotPoint
MusicBackgroundChangeDay
MusicBackgroundChangeNight
MusicBackgroundGetBattleTrack
MusicBackgroundGetDayTrack
MusicBackgroundGetNightTrack
MusicBackgroundPlay
MusicBackgroundSetDelay
MusicBackgroundStop
MusicBattleChange
MusicBattlePlay
MusicBattleStop
MyPrintString
MyResistSpell
MySavingThrow

nDetermineClassToUse
NextTag
nNumberOfCombos

ObjectToString
OpenInventory
OpenNearestLock
OpenStore

PC
PCAcceptedPlot
PlayAnimation
PlayCharacterTheme
PlayConversationAnimation
PlayDragonBattleCry
PlayerHasArtifactItem
PlayerHasComplexItem
PlayerHasFetchItem
PlayerHasHead
PlayerHasPersonalItem
PlayerHasRing
PlayerHasStoryItem
PlayerWearsUniform
PlayImmobileAmbientAnimations
PlayMobileAmbientAnimations
PlayOldTheme
PlaySound
PlaySoundByStrRef
PlaySuccessVisual
PlayVoiceChat
PlotGiverDead
PopUpDeathGUIPanel
PopUpGUIPanel
pow
Prefers
PrintFloat
PrintInteger
PrintObject
PrintString
PrintVector

Raise
Random
RandomName
RecomputeStaticLighting
ReflexSave
RemoveAmbientSleep
RemoveEffect
RemoveEffects
RemoveFromParty
RemoveHenchman
RemoveJournalQuestEntry
RemoveProtections
RemoveSpecificEffect
RemoveSpellEffects
RemoveSummonedAssociate
ResetHenchmenState
ResistSpell
RespondToShout
RestoreCameraFacing
RetrieveCampaignObject
RewardGP
RewardPartyGP
RewardPartyXP
RewardXP
RoundsToSeconds
RunCircuit
RunDrownImpact
RunMelfAcidImpact
RunNextCircuit

SearchForPlayer
SendMessageToAllDMs
SendMessageToPC
SetAILevel
SetAreaTransitionBMP
SetArtifactItem
SetAssassinHead
SetAssociateListenPatterns
SetAssociateStartLocation
SetAssociateState
SetBeenHired
SetBehaviorState
SetCalendar
SetCameraFacing
SetCameraMode
SetCampaignFloat
SetCampaignInt
SetCampaignLocation
SetCampaignString
SetCampaignVector
SetCommandable
SetComplexItem
SetCustomToken
SetCutsceneMode
SetDidDie
SetDoubleCrosserName
SetDroppableFlag
SetEncounterActive
SetEncounterDifficulty
SetEncounterSpawnsCurrent
SetEncounterSpawnsMax
SetFacing
SetFacingPoint
SetFetchee
SetFetchItem
SetFormerMaster
SetGlobal
SetGreetingVar
SetIdentified
SetImmortal
SetIsBusy
SetIsDestroyable
SetIsEnemy
SetIsTemporaryEnemy
SetIsTemporaryFriend
SetIsTemporaryNeutral
SetItemCharges
SetItemStackSize
SetLastGenericSpellCast
SetListening
SetListeningPatterns
SetListenPattern
SetLocalArrayInt
SetLocalArrayString
SetLocalFloat
SetLocalInt
SetLocalLocation
SetLocalObject
SetLocalPlotIntOnCharacter
SetLocalString
SetLocked
SetMachineState
SetMapPinEnabled
SetNPCWarningStatus
SetPanelButtonFlash
SetPCDislike
SetPCLike
SetPersonalItem
SetPlaceableIllumination
SetPLocalInt
SetPlotFlag
SetPlotGiver
SetPlotJournal
SetPlotRing
SetPlotTag
SetPlotToken
SetPrisoner
SetRingGivenTo
SetSpawnInCondition
SetSpawnInLocals
SetStandardFactionReputation
SetStoryItem
SetStoryVar
SetSummonEffect
SetSummonHelpIfAttacked
SetTileMainLightColor
SetTileSourceLightColor
SetTime
SetTrapDetectedBy
SetTrapDisabled
SetUniform
SetValidItem
SetValidItemCost
SetValidItemCostToken
SetVictim
SetWayPointTo1
SetWeather
SetWorkingForPlayer
SetXP
ShadowBolt
ShoutDisturbed
SignalEvent
sin
SoundObjectPlay
SoundObjectSetPosition
SoundObjectSetVolume
SoundObjectStop
SpawnHenchman
SpawnScriptDebugger
SpeakOneLinerConversation
SpeakQuickChat
SpeakString
SpeakStringByStrRef
SpellDelay
sqrt
StartAttackLoop
StartingConditional
StartNewModule
StartProtectionLoop
StopFade
StoreCameraFacing
StoreCampaignObject
StringToFloat
StringToInt
StripAllPersonalItemsFromEveryone
StripEffects
SummonAnimalCompanion
SummonFamiliar
SupernaturalEffect
SurrenderToEnemies

TakeArtifactItem
TakeComplexItem
TakeFetchItem
TakeGold
TakeGoldFromCreature
TakeNumItems
TakeStoryItem
TalentAdvancedBuff
TalentAdvancedProtectSelf
TalentBardSong
TalentBuffSelf
TalentCureCondition
TalentDragonCombat
TalentEnhanceOthers
TalentFeat
TalentFlee
TalentHeal
TalentHealingSelf
TalentMeleeAttack
TalentMeleeAttacked
TalentPersistentAbilities
TalentRangedAttackers
TalentRangedEnemies
TalentSeeInvisible
TalentSkill
TalentSneakAttack
TalentSpell
TalentSpellAttack
TalentSummonAllies
TalentUseEnhancementOnSelf
TalentUseProtectionOnSelf
TalentUseProtectionOthers
TalentUseTurning
tan
TestStringAgainstPattern
TouchAttackMelee
TouchAttackRanged
TrimLevel
TurnsToSeconds

UniversalSpellMatch
UnpossessFamiliar

Vector
VectorMagnitude
VectorNormalize
VectorToAngle
VerifyCombatMeleeTalent
VerifyDisarm
VersusAlignmentEffect
VersusRacialTypeEffect
VersusTrapEffect
VictimDead
VictimDeadButNoItems

WalkWayPoints
WillSave
WriteTimestampedLogEntry

YardsToMeters


Function - abs

Home > Reference > Functions > Math > abs

abs(int)

整数の絶対値を返す

int abs(
    int nValue
);

Parameters

nValue

絶対値を取りたい整数値

Description

nValueの値の絶対値を返す。数値が負の場合はマイナスを取り除いた正の数値となる。

Version

1.22

Example

int nHigh = 12;
int nHighAbs = abs(nHigh);
// nHighAbsは12となる。

int nLow = -9;
int nLowAbs = abs(nLow);
// nLowAbsは9となる。

See Also

functions: | fabs
categories: | Math Functions

author: Charles Feduke, editor: Jeff Lindsey, JP team: ngtaicho


Function - acos

Home > Reference > Functions > Math > acos

acos(float)

アークコサイン計算し結果を返す。

float acos(
    float fValue
);

Parameters

fValue

コサイン値を意味する浮動小数値。値の範囲は -1.0 ～ 1.0

Description

アークコサインを計算し結果を度で返す（ラジアンではない）

返す値は0.0 から 180.0

Remarks

コサインの逆関数

Version

1.31

See Also

functions: | asin | atan | cos | sin | tan
categories: | Math Functions

author: Charles Feduke, additional contributor(s): Paul Catalano, JP team: geshi, ngtaicho


Function - ActionAttack

Home > Reference > Functions > Action on Object, Combat Actions > ActionAttack

ActionAttack(object, int)

２匹のクリーチャー間、またはクリーチャーとObject間で攻撃を開始します。

void ActionAttack(
    object oAttackee,
    int bPassive = FALSE
);

Parameters

oAttackee

攻撃されるクリーチャーまたはobject

bPassive

攻撃が受動モードがどうかを決定します。（デフォルト：FALSE）

Description

現在装備している武器を使って、呼出クリーチャーにoAttackeeを攻撃させます。攻撃はoAttackeeのOnPhysicalAttackedイベントを生じさせますので、そこに、oAttackeeの反応を攻撃者に変えるスクリプトがある場合、反撃するでしょう。しかしながら、ActionAttack単独では、反応を変更しません。

bPassiveがTRUEに設定されている場合、攻撃者はoAttackeeを攻撃するために動くことはありません。攻撃者が近接用武器しかもっていなく、oAttackeeが遠くにいる場合、彼はただその場に立ちつくします。

Remarks

複数回の戦闘を起こす時にはDetermineCombatRound()を使用してください。しかしながら、攻撃側と被攻撃側のファクションが同一の場合は注意してください。DetermineCombatRound()コマンドが出されても、彼等は戦いません。

ファクションが複雑な場合、一連の戦闘動作の全てを行わず、単発の攻撃を行います（酒場の女給さんがお痛がすぎる客をはたいたり、用心棒が一発くれてやったりするようにです）。そのような場合、ActionAttackを呼出す直前に

DelayCommand(2.0, SurrenderToEnemies()); を使用するか

－または－

単純に攻撃を中止するようにClearAllAction(TRUE)を命令してください。

ActionAttackは武器（近接用、遠距離用、モンスター用自然装備）のみを使用します。

いかなる特技（受動的なものは除く）、呪文、その他の能動的タレントも使用しません。

Version

1.29

Example

// 箱のOnOpenイベントに設定する。
// "CHEST_GUARD"というタグを持つ近くの衛兵に
// 箱を開けた人物を攻撃させる。
void main()
{
    // objectの初期化
    object oGuard = GetObjectByTag("CHEST_GUARD");
    object oPlayer = GetLastOpenedBy();
    // 衛兵は箱を開けたプレイヤーを攻撃する
    AssignCommand(oGuard, ActionDoCommand(SpeakString("Taste my blade you bloody thief!")));
    AssignCommand (oGuard, ActionAttack(oPlayer));
}

See Also

functions: | DetermineCombatRound | GetAttackTarget | GetAttemptedAttackTarget | TalentDragonCombat
categories: | Action on Object Functions | Combat Actions Functions

author: Ryan Hunt, editor: Lilac Soul, additional contributor(s): Le Proctophantasmiste, James Allen, Jassper, Lilac Soul, JP team: Rainie


Function - ActionCastFakeSpellAtLocation

Home > Reference > Functions > Spell Casting Effects, Visual Effects > ActionCastFakeSpellAtLocation

ActionCastFakeSpellAtLocation(int, location, int)

呪文効果なしで詠唱アニメーションと呪文ビジュアルを与えます。

void ActionCastFakeSpellAtLocation(
    int nSpell,
    location lTarget,
    int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT
);

Parameters

nSpell

SPELL_* constant

lTarget

呪文エフェクトの位置

nProjectilePathType

PROJECTILE_PATH_TYPE_* constant (Default: PROJECTILE_PATH_TYPE_DEFAULT)

Description

このアクションを受ける者はnSpell詠唱の動作をするが、結果としてゲームエフェクトに一致しません。呪文エフェクトはlTargetの中心に位置するか、もしくはlTargetに向かうものとなります。

Known Bugs

いくつかの理由により、このアクションを重ねると推測通りの詠唱のつながりは生まれません。クリーチャーが最初のFakeSpellを行ってアクションキューが次のFakeSpellになった時、以降のすべてのアクションキューが中断します。

Version

1.22

Example

//Function made by Lilac Soul to illustrate the use of
//ActionCastFakeSpellAtLocation - in this function, I use it
//to have the NPC speaker "cast a spell" which just misses
//the PC and fizzles - I guess the NPC is inept at magic!

void main()
{
object oTarget=GetPCSpeaker();

//The PC’s current location
location lLoc=GetLocation(oTarget);

//Generate a location near to the PC
vector vPos=GetPositionFromLocation(lLoc);

vPos.x+=IntToFloat(d6());
vPos.y+=IntToFloat(d6());

lLoc=Location(GetArea(oTarget), vPos, GetFacing(oTarget));

//Cast the spell at this new location
ActionCastFakeSpellAtLocation(SPELL_GATE, lLoc);

//Apply the fizzle effect at this new location
DelayCommand(2.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_DISPEL_GREATER), lLoc));

}

See Also

functions: | ActionCastFakeSpellAtObject | ActionCastSpellAtLocation
categories: | Spell Casting Effects Functions | Visual Effects Functions
constants: | PROJECTILE_PATH_TYPE_* Constants | SPELL_* Constants

author: Ryan Hunt, editor: Lilac Soul, additional contributor(s): NTIN, Lilac Soul, JP team: geshi, Redondo


Function - ActionCastFakeSpellAtObject

Home > Reference > Functions > Spell Casting Effects, Visual Effects > ActionCastFakeSpellAtObject

ActionCastFakeSpellAtObject(int, object, int)

呪文効果なしで詠唱アニメーションと呪文ビジュアルを与えます。

action ActionCastFakeSpellAtObject(
    int nSpell,
    object oTarget,
    int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT
);

Parameters

nSpell

SPELL_*

oTarget

呪文エフェクトのターゲット

nProjectilePathType

PROJECTILE_* (Default: PROJECTILE_PATH_TYPE_DEFAULT)

Description

このアクションを受ける者はnSpell詠唱の動作をするが、結果としてゲームエフェクトに一致しません。呪文エフェクトはoTargetの中心に位置するか、もしくはoTargetに向かうものとなります。

推量：lTargetがinvalidであれば、アクションは失敗します。

Known Bugs

いくつかの理由により、このActionを重ねると推測通りの詠唱のつながりは生まれません。クリーチャーが最初のFakeSpellを行ってアクションキューが次のFakeSpellになった時、以降のすべてのAction queueが中断します。

Version

1.22

Example

//Function made by Lilac Soul to illustrate the use of
//ActionCastFakeSpellAtObject - in this function, I use it
//to have the NPC speaker "cast a spell" at the PC which
//sets him or her at 1 experience point...

void main()
{
object oPC=GetPCSpeaker();

//Wave my hands and talk like I'm casting the
//wail of the banshee spell
ActionCastFakeSpellAtObject(SPELL_WAIL_OF_THE_BANSHEE, oPC);

//Apply a couple of visual effects to the PC
int nDur=DURATION_TYPE_INSTANT;
effect e1=EffectVisualEffect(VFX_FNF_HOWL_MIND);
effect e2=EffectVisualEffect(VFX_FNF_PWKILL);

ActionDoCommand(ApplyEffectToObject(nDur, e2, oPC));
DelayCommand(4.5, ApplyEffectToObject(nDur, e1, oPC));

//Set the PC to 1 XP - he won't be too happy with this spell!
DelayCommand(4.5, SetXP(oPC, 1));
}

See Also

functions: | ActionCastFakeSpellAtLocation | ActionCastSpellAtObject | ResistSpell
categories: | Spell Casting Effects Functions | Visual Effects Functions
constants: | PROJECTILE_PATH_TYPE_* Constants | SPELL_* Constants

author: Ryan Hunt, editor: Lilac Soul, additional contributor(s): NTIN, Lilac Soul, JP team: geshi, Redondo


Function - ActionCastSpellAtLocation

Home > Reference > Functions > Action on Object, Spell Casting Effects, Spells > ActionCastSpellAtLocation

ActionCastSpellAtLocation(int, location, int, int, int, int)

指定する位置に呪文を詠唱します。

void ActionCastSpellAtLocation(
    int nSpell,
    location lTargetLocation,
    int nMetaMagic = METAMAGIC_ANY,
    int bCheat = FALSE,
    int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT,
    int bInstantSpell = FALSE
);

Parameters

nSpell

SPELL_*

lTargetLocation

nMetaMagic

METAMAGIC_* (Default: METAMAGIC_ANY)

bCheat

TRUEであれば、Actionを行う者に詠唱アビリティがなくても詠唱することができます(デフォルト: FALSE)

nProjectilePathType

PROJECTILE_PATH_TYPE_* (Default: PROJECTILE_PATH_TYPE_DEFAULT)

bInstantSpell

TRUEの場合、即座に呪文が詠唱されます（呪文高速化フィートに似たアクション）。

このことによって呼び出し者は高レベル魔術師のように、緊急事態の際に先に呪文をかけることができるようになります（デフォルト：FALSE）

Description

この関数は指定した位置に呪文を詠唱します。動作するためにはすくなくともnSpellとlTargetLocationを設定する必要があります。

lTargetLocationはウェイポイントもしくはGetLocation関数で設定できるもの。

bCheatがTRUEであれば、スクリプトの実行者は詠唱アビリティを持っているかどうかに関わらず詠唱可能となります。

Remarks

この関数は特定の位置に呪文を詠唱します。この関数を呼び出すオブジェクトは詠唱の起点となる。例えば、fireball trapのトリガーを持つ箱など。この関数で詠唱される呪文は実際にダメージやエフェクトを与えます；ビジュアルのみ与える場合はActionCastFakeSpellAtLocationを参照。

Version

1.22

Example

// レバーなどの配置可能オブジェクトのOnUsedイベントに設定します
// レバーを使用されたときにターゲットにFireballを詠唱します
// ターゲットは"TARGET_WP1"のタグを持つウェイポイント

void main()
{
    location lTarget = GetLocation(GetWaypointByTag("TARGET_WP1"));

    ActionCastSpellAtLocation(SPELL_FIREBALL,lTarget,METAMAGIC_NONE,1,PROJECTILE_PATH_TYPE_HIGH_BALLISTIC,1);

}

See Also

functions: | ActionCastFakeSpellAtLocation | ActionCounterSpell
categories: | Action on Object Functions | Spell Casting Effects Functions | Spells Functions
constants: | METAMAGIC_* Constants | PROJECTILE_PATH_TYPE_* Constants | SPELL_* Constants

author: Dan Spezzano, editor: Jeff Lindsey, JP team: Redondo


Function - ActionCastSpellAtObject

Home > Reference > Functions > Action on Object, Spell Casting Effects, Spells > ActionCastSpellAtObject

ActionCastSpellAtObject(int, object, int, int, int, int, int)

オブジェクトに呪文を詠唱します。

void ActionCastSpellAtObject(
    int nSpell,
    object oTarget,
    int nMetaMagic = METAMAGIC_ANY,
    int bCheat = FALSE,
    int nDomainLevel = 0,
    int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT,
    int bInstantSpell = FALSE
);

Parameters

nSpell

SPELL_*

oTarget

呪文のターゲット

nMetaMagic

METAMAGIC_* (Default: METAMAGIC_ANY)

bCheat

TRUEであれば、アクションを行う者に詠唱アビリティがなくても詠唱します(デフォルト: FALSE)

nDomainLevel

TBD - SS (Default: 0)

nProjectilePathType

PROJECTILE_PATH_TYPE_* (Default: PROJECTILE_PATH_TYPE_DEFAULT)

bInstantSpell

TRUEの場合、即座に呪文が詠唱されます（呪文高速化フィートに似たアクション）。

このことによって呼び出し者は高レベル魔術師のように、緊急事態の際に先に呪文をかけることができるようになります（デフォルト：FALSE）

Description

ターゲットoTargetに呪文nSpellを詠唱します。

動作するためにはすくなくともnSpellとlTargetLocationを設定する必要があります。

Remarks

oTargetはクリーチャーやPCのようにvalidなターゲットである必要があります。テストによると、異なるいくつかのターゲットタイプではこの関数は動作しません。（テストはターゲットが樽の場合で、関数は動作しませんでした）

Known Bugs

ヘンチマンが自分自身に以下の3つの呪文のどれかをかけた場合、そのヘンチマンは呪文を唱える能力を失います
SPELL_EAGLE_SPLENDOR
SPELL_FOXS_CUNNING
SPELL_OWLS_WISDOM

Version

1.31

Example

// レバーなどの配置可能オブジェクトのOnUsedイベントに設定する
// レバーを使用されたときにターゲットにMagic Missileを詠唱します
// ターゲットはタグ"TARGET2"を持つ近くのコモナー

void main()
{
    object oTarget = GetObjectByTag("TARGET2");
    ActionCastSpellAtObject(SPELL_MAGIC_MISSILE,oTarget,1);
}

See Also

functions: | ActionCastFakeSpellAtObject | ActionCounterSpell | GetAttemptedSpellTarget | ResistSpell | TalentCureCondition
categories: | Action on Object Functions | Spell Casting Effects Functions | Spells Functions
constants: | METAMAGIC_* Constants | PROJECTILE_PATH_TYPE_* Constants | SPELL_* Constants

author: Dan Spezzano, editor: Charles Feduke, additional contributor(s): Daniel LeDuke, Slow Slosh, JP team: geshi, Redondo


Function - ActionCloseDoor

Home > Reference > Functions > Action on Object, Core AI > ActionCloseDoor

ActionCloseDoor(object)

オブジェクトにドアを閉める行動をさせます。

action ActionCloseDoor(
    object oDoor
);

Parameters

oDoor

閉めるドア。

Description

se it.

この関数を呼び出したオブジェクトにoDoorを閉めさせます。

対象が移動可能なクリーチャーであれば、クリーチャーはoDoorに向かって走るアニメーションをし、手を伸ばしてドアを閉めるでしょう。

この関数をドアオブジェクトに付けることによって、自動でドアを閉めさせることができます。(oDoor=OBJECT_SELF)

Version

1.26

Example

David Gaider氏のスクリプトFAQとチュートリアルより：

// ドアのOnHeartbeatスクリプトに設定すると
// ドアは夕闇になると自動で閉まって鍵がかかり、夜明けになると鍵が解除されるでしょう。
void main()
{
   if (GetIsDusk() && GetIsOpen (OBJECT_SELF))
   {
      ActionCloseDoor (OBJECT_SELF);
      // ActionDoCommand関数の中にSetLocked関数を設定します。
      // なぜなら、ドアのアクションキューに設定して、ドアに鍵をかける前に
      // ActionCloseDoor関数の呼び出しを完了させたいからです。
      ActionDoCommand (SetLocked (OBJECT_SELF, TRUE));
   }
   else if (GetIsDawn() && GetLocked (OBJECT_SELF))
   {
      SetLocked (OBJECT_SELF, FALSE);
   }
}

See Also

functions: | ActionOpenDoor | GetBlockingDoor
categories: | Action on Object Functions | Core AI Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Dave Dursley, JP team: katsu794


Function - ActionCounterSpell

Home > Reference > Functions > Action on Object, Combat, Combat Actions > ActionCounterSpell

ActionCounterSpell(object)

呼出者の戦闘状態を「呪文相殺」モードにします。

void ActionCounterSpell(
    object oCounterSpellTarget
);

Parameters

oCounterSpellTarget

「呪文相殺」で対抗する相手Object

Description

呼出クリーチャーを「呪文相殺」型戦闘モードにさせ、oCounterSpellTargetが呪文を唱えるまで待機します。

Remarks

呼出クリーチャーがこの関数を呼び出した後、別の行動をとった場合、「呪文相殺」モードは取り消されます。

呼出クリーチャーが「呪文相殺」モードに入り、oCounterSpellTargetを「呪文相殺」を試みる前には、ある基準が満たされてなければなりません。：

「呪文相殺」モードが使えるようになる前に、呪文を唱えることのできる職業で、唱えられるレベルになってなければなりません。

oCounterSpellTargetが唱えようとしている呪文が識別できる、十分な〈呪文学〉技能を持ってなければなりません。

「呪文相殺」で消費される適用可能な呪文を持っていなければなりません。（NWNマニュアルの109ページを見てください。（日本語版では134ページ））

上記の条件がすべて満たされても、「呪文相殺」の成功は保証されていません。

さらに「呪文相殺」モードが準備行動と見なされることに注意してください。それは単に相手のラウンドが始まる前に、効力を得るということを意味します。相手が呪文を唱えている間に「呪文相殺」を始めても、「呪文相殺」を試みることはできません。

[未知：「呪文相殺」モードにするクリーチャー指揮棒の作り方を知ってますか？DetermineCombatRound()は動作しません。プレイヤーが操作するクリーチャーでそれを行えば、「呪文相殺」モードは無期限に続くでしょう。]「呪文相殺」モードは1ラウンド（6秒間）続きます。

Version

1.22

See Also

functions: | ActionCastSpellAtLocation | ActionCastSpellAtObject
categories: | Action on Object Functions | Combat Functions | Combat Actions Functions

author: Troels Therkelsen, editor: Jeff Lindsey, JP team: Rainie


Function - ActionCreate

Home > Reference > Functions > Encounter, Item Creation > ActionCreate

ActionCreate(string, location)

この関数はアクションキューにCreateObjectをスタックさせるために使います。

void ActionCreate(
    string sCreature,
    location lLoc
);

Parameters

sCreature

生み出すクリーチャーのresref

lLoc

クリーチャーを作成するために位置を識別するlocation object

Description

この関数は本質的にvoid型で、CreateObjectを含みますので、それをアクションキューにおく事を可能にします。配置用オブジェクトにある戦場パレットの「骸骨の山」のOnHeartbeatで使われています。

Remarks

プレイヤーが接近したとき、objectをクリーチャーに化けさせたい場合に、"nw_o2_skeleton.nss"は適していると思います。

"nw_o2_skeleton"は、"void main()"関数定義を持つスクリプトを含むことできません。これは"nw_o2_skeleton"が"void main()"関数を定義しているからです。この関数を使いたい場合は、"nw_o2_skeleton"から独自のスクリプトにコピーしてください。

Requirements

#include "nw_o2_skeleton"

Version

1.28

Example

string sCreature = "NW_SKELWARR01";
location lLoc = GetLocation(OBJECT_SELF);
DelayCommand(0.3, ActionCreate(sCreature, lLoc));
/* ***
** 上記のDelayCommandは、
** ActionDoCommand(ActionCreate(sCreature, lLoc));
** と書き直すことが出来ます
。*** */

See Also

functions: | CreateObject
categories: | Encounter Functions | Item Creation Functions
events: | OnHeartbeat Event

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Albert Valls Rovira, JP team: geshi, Rainie


Function - ActionDoCommand

Home > Reference > Functions > Action on Object > ActionDoCommand

ActionDoCommand(action)

アクションキューにコマンドを挿入します。

action ActionDoCommand(
    action aCommand
);

Parameters

aCommand

実行するVoid 型の関数 ("action" データタイプは無視されます)

Description

関数の呼び出しaCommandをアクションキューに挿入します。一般的に、名前が‘Action’から始まらない関数はキューに挿入されません。ActionDoCommand関数を使わないで呼び出される関数は、既にアクションキューにある関数より先に、すぐさま実行されます。

Remarks

この関数を使用するのは、この関数を呼び出すオブジェクト自身です。他のオブジェクトやNPCに命令をする必要がある場合は、AssignCommand()関数を使います。ターゲットとなるオブジェクトのキューにコマンドをアクションとして追加するために、ActionDoCommand()関数をAssignCommand()関数の中にネストすることができます。
ActionDoCommand関数は、void型の関数だけしか受けつけないことにも注意して下さい。もし値を返す関数を使いたいのであれば、その関数をvoid型の関数で覆う必要があります。

Known Bugs

OnSpawnスロットのスクリプトに使用するときに、クリーチャーに異なった行動をさせる可能性があります。

Version

1.29

Example

// ActionDoCommand()関数を使わないスクリプト
// この例では、NPCはまず"ここが私の席です。"と話し
// それから椅子に歩いて座ります。
//
{
     object oNPC = GetObjectByTag("some_npc");
     object oChair = GetObjectByTag("chair");

     ActionMoveToObject(oChair);
     SpeakString("ここは私の席です!");
     ActionSit(oChair);
}

// ActionDoCommand()関数を使ったスクリプト
// この例では、NPCは与えられた関数(それらはNPCの
// アクションキューにあります)を順番に実行します。
// NPCはまず、椅子に歩いていき、それから言葉を話して
// 椅子に座ります。
{
     object oNPC = GetObjectByTag("some_npc");
     object oChair = GetObjectByTag("chair");

     ActionMoveToObject(oChair);
     ActionDoCommand(SpeakString("ここは私の席です!"));
     ActionSit(oChair);
}

See Also

functions: | AssignCommand | ClearAllActions
categories: | Action on Object Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Jens Eggert, Graziano Lenzi, JP team: katsu794


Function - ActionEquipItem

Home > Reference > Functions > Action on Object, Inventory > ActionEquipItem

ActionEquipItem(object, int)

所持しているアイテムを装備スロットに装備します。

void ActionEquipItem(
    object oItem,
    int nInventorySlot
);

Parameters

oItem

所持品にあるアイテム。

nInventorySlot

oItemを装備させるスロットをINVENTORY_SLOT_*で指定

Description

スクリプトを呼び出したクリーチャーの（nInventorySlotで指定した）装備スロットにoItemを装備させます。

既に対象の所持品の中に入っているアイテムのみ装備可能です。

（nInventorySlotで指定した）装備スロットに既にアイテムが装備されている場合、そのアイテムに代わってoItemが装備され、そのアイテムは所持品の中に戻されます。

エラー時には何も起こらず、ログファイルには"ActionEquipItem failed"のメッセージが記録されます。

Remarks

oItemを装備させる前に、ActionUnequipItem()関数を呼び出す必要はありません。

Known Bugs

不可能な組み合わせで装備させようとすると、ゲームがクラッシュする場合があります。

例えば、クリーチャーが右手にショートソード、左手にダガーを装備している状態で、ショートソードをダーツに持ち替えさせようとした場合、ゲームはクラッシュします。

Version

1.28

Example

//Function made by Lilac Soul to illustrate the use of
//ActionEquipItem. This function creates an armor with the
//resref "magic_armor" on an entering PC and makes him
//or her equip it.

void main()
{
object oPC=GetEnteringObject();

//Not if the object isn't a PC
if (!GetIsPC(oPC)) return;

//Give the armor to the PC - I could first have checked
//to see if the PC already had one...
object oArmor=CreateItemOnObject("magic_armor", oPC);

//Put on the armor
DelayCommand(0.5, AssignCommand(oPC, ActionEquipItem(oArmor, INVENTORY_SLOT_CHEST)));

DelayCommand(0.7, AssignCommand(oPC, ActionSpeakString("Ah, a new armor. I'd better put it on.")));
}

See Also

functions: | ActionUnequipItem | EquipAppropriateWeapons
categories: | Action on Object Functions | Inventory Functions
constants: | INVENTORY_SLOT_* Constants

author: Ryan Hunt, editor: Lilac Soul, additional contributor(s): Fran ois Guimond, Lilac Soul, JP team: NamaYake


Function - ActionEquipMostDamagingMelee

Home > Reference > Functions > Action on Object, Combat Actions, Inventory > ActionEquipMostDamagingMelee

ActionEquipMostDamagingMelee(object, int)

関数を呼び出したクリーチャーに一番ダメージの大きい武器を装備させます。

void ActionEquipMostDamagingMelee(
    object oVersus = OBJECT_INVALID,
    int bOffHand = FALSE
);

Parameters

oVersus

oVersusに対して最も大きなダメージを与えられる武器を装備させられます（デフォルトではOBJECT_INVALID）

bOffHand

(デフォルト: FALSE)

Description

クリーチャーは自分が所持している格闘武器で（oVersusが指定してあればoVersusに対して）最も大きいダメージを与えられる武器を装備します。

装備できる格闘用の武器を所持していなかった場合は、最も大きいダメージを与えられる飛び道具を装備します。

Remarks

この関数はEndOfCombatRound（戦闘ラウンドの終了時）に呼び出されます。

（onCombatRoundEndスクリプトか、onSpawnスクリプトのNW_FLAG_END_COMBAT_ROUND_EVENTの行をアンコメントしてonUserDefinedスクリプトの中で使用してください。

そうでなければ、対象のクリーチャーに武器を装備させるには、戦闘を終わらせなければならなくなります。

全ての ActionEquip*関数に共通することですが、新しいアイテムを装備させる前に現在同じスロットに装備しているアイテムを最初にはずさせる必要はありません。

[不明： bOffHandをTRUEにしても何の効果も現れません。もし関数を呼び出したクリーチャーが右手になんの武器も持っていなかったら、武器を右手に装備するのかもしれません。]

Version

1.22

See Also

functions: | ActionEquipMostDamagingRanged | ActionEquipMostEffectiveArmor | EquipAppropriateWeapons
categories: | Action on Object Functions | Combat Actions Functions | Inventory Functions

author: Troels Therkelsen, JP team: NamaYake


Function - ActionEquipMostDamagingRanged

Home > Reference > Functions > Action on Object, Combat Actions, Inventory > ActionEquipMostDamagingRanged

ActionEquipMostDamagingRanged(object)

関数を呼び出したクリーチャーに、最もダメージの大きい飛び道具を装備させます。

action ActionEquipMostDamagingRanged(
    object oVersus = OBJECT_INVALID
);

Parameters

oVersus

oVersusに対して最も大きいダメージを与えられる武器を装備させようします。（デフォルトでは OBJECT_INVALID）

Description

クリーチャーは所有している飛び道具で、（oVersusが指定されている場合はそれに対して）最も大きいダメージを与えられる飛び道具を装備します。

もし飛び道具を持っていなかった場合は、クリーチャーは最も大きいダメージの格闘用武器を装備します。

Remarks

この関数はEndOfCombatRound（戦闘ラウンドの終了時）に呼び出されます。

（onCombatRoundEndスクリプトか、onSpawnスクリプトのNW_FLAG_END_COMBAT_ROUND_EVENTの行をアンコメントしてonUserDefinedスクリプトの中で使用してください。

そうでなければ、対象のクリーチャーに武器を装備させるには、戦闘を終わらせなければならなくなります。

全ての ActionEquip*関数に共通することですが、新しいアイテムを装備させる前に現在同じスロットに装備しているアイテムを最初にはずさせる必要はありません。

Version

1.22

See Also

functions: | ActionEquipMostDamagingMelee | ActionEquipMostEffectiveArmor | EquipAppropriateWeapons
categories: | Action on Object Functions | Combat Actions Functions | Inventory Functions

author: Troels Therkelsen, editor: Dave Robinson, JP team: NamaYake


Function - ActionEquipMostEffectiveArmor

Home > Reference > Functions > Action on Object, Combat Actions, Inventory > ActionEquipMostEffectiveArmor

ActionEquipMostEffectiveArmor()

クリーチャーに所持品の中で最も良い鎧を装備させます。

void ActionEquipMostEffectiveArmor();

Description

関数を呼び出したクリーチャーは所持している鎧の中で最もACの高い鎧を装備します。

Remarks

全ての ActionEquip*関数に共通することですが、新しいアイテムを装備させる前に現在同じスロットに装備しているアイテムを最初にはずさせる必要はありません。

Version

1.22

See Also

functions: | ActionEquipMostDamagingMelee | ActionEquipMostDamagingRanged
categories: | Action on Object Functions | Combat Actions Functions | Inventory Functions

author: Troels Therkelsen, editor: Jeremy Spilinek, JP team: NamaYake


Function - ActionForceFollowObject

Home > Reference > Functions > Action on Object, Core AI, Henchmen/Familiars/Summoned, Movement > ActionForceFollowObject

ActionForceFollowObject(object, float)

NPCをobjectに付き従うよう強います。

void ActionForceFollowObject(
    object oFollow,
    float fFollowDistance = 0.0f
);

Parameters

oFollow

付いていく対象object

fFollowDistance

付き従う距離（デフォルト：0.0f）

Description

行動の主体は、ClearAllActions()が呼び出されるまで、oFollowに付き従います。主体は

oFollowのfFollowDistanceの範囲内に留まり、保つ様に走ります。

Remarks

oFollowは静的objectに設定することが可能です。しかし、それが所持品の外側である場合、主体は単に付き従います。この場合、この効果はActionMoveToObjectと同一です。しかしながら、アイテムが所持品から取り除かれ、ゲーム上にまた配置されなおした時、主体は再びそれに向け動き出します。アイテムがoFollowの対象である場合、NPCをアイテムの所有者に付き従わせるためには、この関数は使えません。

一方、バグではないのですが、歩いている先導に付いて行くNPCが「stutter step（カクカクした歩様）」には不満があります。これは追随者がこの関数によって、常に走ることを強いられ、リーダーに速く追いつきすぎるからであるように思われます。

これが問題となる場合、これへの代替スクリプトは、恐らく目標となる先導者のonHeartBeatの中でActionMoveToObjectを使用することができるでしょう。

Version

1.22

See Also

categories: Action on Object Functions | Core AI Functions | Henchmen/Familiars/Summoned Functions | Movement Functions

author: Ryan Hunt, editor: Jeremy Spilinek, JP team: Rainie


Function - ActionForceMoveToLocation

Home > Reference > Functions > Action on Object, Core AI, Movement > ActionForceMoveToLocation

ActionForceMoveToLocation(location, int, float)

locationにNPCを移動させるよう試みます。

void ActionForceMoveToLocation(
    location locDestination,
    int bRun = FALSE,
    float fTimeout = 30.0f
);

Parameters

locDestination

移動する対象の目的地。

bRun

走らせるか否かの真偽です。TRUEであれば主体はlocDestinationへと走るでしょう。

（デフォルト：FALSE）

fTimeout

進路の探知をやめるまでの時間量（デフォルト：30.0f）

Description

行動の主体はlocDestinationに移動するよう試みます。locDestinationまでの進路が見つけらない場合、諦める前にfTimeout秒間（デフォルト：30.0f）探し続けます。

返り値はありませんが、エラーが生じた場合は、ログファイルに"MoveToPoint failed."と残ります。

主体をlocationに走らせるのが望ましい場合、bRunはTRUEであるべきです。

Remarks

locationに移動するタイプの関数（ActionForceMoveToLocation, ActionMoveToLocation）は、実際に進路を発見するobjectに移動するタイプの関数（ActionForceMoveToObject, ActionMoveToObject）とは異なり、目的地に向かって直線的に動くように思われます。

更に、locationへ移動するタイプの関数は非常に容易に中断されます。もし何かが移動中のobjectに突き当たったり妨害したりした場合、命令は終了します。

Version

1.28

See Also

functions: | ActionJumpToLocation | ActionMoveAwayFromLocation | ActionMoveToLocation | ActionMoveToObject
categories: | Action on Object Functions | Core AI Functions | Movement Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Harold Myles, JP team: Rainie


Function - ActionForceMoveToObject

Home > Reference > Functions > Action on Object, Core AI, Movement > ActionForceMoveToObject

ActionForceMoveToObject(object, int, float, float)

明瞭な進路が存在しなくても、目標objectのある距離にNPCを移動させるよう試みます。

action ActionForceMoveToObject(
    object oMoveTo,
    int bRun = FALSE,
    float fRange = 1.0f,
    float fTimeout = 30.0f
);

Parameters

oMoveTo

移動する対象となるobject。

bRun

走らせるか否かの真偽です。TRUEであれば主体はoMoveToへと走るでしょう。

（デフォルト：FALSE）

fRange

立ち止まる際のoMoveToまでの距離（デフォルト：1.0f）

fTimeout

（ActionJumpToObjectのように）オブジェクトにジャンプするまでの、進路を探し続ける時間。（デフォルト：30.0f）

Description

行動の主体はoMoveToのfRangeメートル以内に移動するように試みます。クリーチャーはfTimeout秒の間、目的に達しようと試み、その時間内に進路を見つけたか否かに関わらずlocationにテレポートするでしょう。

返り値はありませんが、エラーが生じた場合は、ログファイルに"MoveToPoint failed."と残ります。

Remarks

objectに移動するタイプの関数（ActionForceMoveToObject, ActionMoveToObject）は、locationに移動するタイプの関数（ActionForceMoveToLocation, ActionMoveToLocation）に相当する物と異なり、実際に進路を発見します。

Version

1.29

See Also

functions: | ActionMoveAwayFromObject | ActionMoveToLocation | ActionMoveToObject
categories: | Action on Object Functions | Core AI Functions | Movement Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Jeff Harper, Harold Myles, Iyanga, JP team: Rainie


Function - ActionGiveItem

Home > Reference > Functions > Action on Object, Inventory > ActionGiveItem

ActionGiveItem(object, object)

指定したアイテムを指定したクリーチャーに与えます。

action ActionGiveItem(
    object oItem,
    object oReciever
);

Parameters

oItem

与えるアイテム

oReciever

アイテムを受け取る対象

Description

アイテムを手渡すようなアニメーションはありません。アイテムは直ちにoRecieverの所持品の中に入ります。

もしoItemが有効なアイテムでない場合、もしくはoRecieverが有効なオブジェクトでない場合には、何も起こりません。

Remarks

推測：oRecieverにはクリーチャー（PCもしくはNPC)または入れ物のオブジェクトを指定することができます。

Version

1.28

See Also

functions: | ActionPutDownItem | ActionTakeItem | CreateItemOnObject
categories: | Action on Object Functions | Inventory Functions

author: Ryan Hunt, editor: Charles Feduke, JP team: NamaYake


Function - ActionInteractObject

Home > Reference > Functions > Action on Object > ActionInteractObject

ActionInteractObject(object)

クリーチャーあるいはPCにオブジェクトを使用させます。

void ActionInteractObject(
    object oPlaceable
);

Parameters

oPlaceable

使用させる配置用オブジェクト。

Description

指定された配置用オブジェクトが使用可能であれば、この関数を呼び出すスクリプトが設定されているクリーチャーに、それを使用させます。

Version

1,29

See Also

categories: Action on Object Functions

author: Charles Feduke, additional contributor(s): Glenn J. Berden, JP team: katsu794


Function - ActionJumpToLocation

Home > Reference > Functions > Action on Object, Movement > ActionJumpToLocation

ActionJumpToLocation(location)

呼び出したobjectをlocTargetの位置に即座に送る。

void ActionJumpToLocation(
    location locTarget
);

Parameters

locTarget

目標のlocation

Description

呼び出したobjectをlocTargetの位置（または可能な限り近い場所）へ即座に転送します。この関数はエリアの境界内または跨いで機能するでしょう。

locTargetが有効なobjectではない(あるいは無指定の)場合、関数の呼出は失敗するでしょう。

Remarks

このアクションにはビジュアル・エフェクトがありません；

貴方自身で設定してください。ApplyEffectAtLocation()とApplyEffectAtObject()を使って、EffectVisualEffect()と組み合わせれば素晴らしく効果的です。

location値はGetLocation()関数を使用して、容易に得ることができ、またlocation()関数で設定することができます。

locationに飛んだ事によりPCがエリアやトリガーから立ち去った場合、立ち去ったobjectのOnExitイベントが発動します。

死んでいるクリーチャーには機能しません；この関数を適切に機能させる為には０以上のHPを持っている必要があります。

Version

1.26

Example

// このスクリプトはvPositionベクトルによって指定された座標へ
// 呼び出したオブジェクトを送る

// ActionJumpToLocationは難しい方法である
void main()
{
   area aCurrentArea = GetArea(OBJECT_SELF);
   vector vPosition = Vector(2.0, 3.0, 0.0); // x:2, y:3, z:0
   location locTarget = Location(aCurrentArea, vPosition, 90.0);

   ActionJumpToLocation(locTarget);
}

See Also

functions: | ActionForceMoveToLocation | ActionJumpToObject | ActionMoveToLocation | ActivatePortal | JumpToLocation | Location | Vector
categories: | Action on Object Functions | Movement Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Enigmatic, JP team: Rainie


Function - ActionJumpToObject

Home > Reference > Functions > Action on Object, Movement > ActionJumpToObject

ActionJumpToObject(object, int)

呼び出したobjectを目標に一番近い有効な場所にテレポートします。

action ActionJumpToObject(
    object oTarget,
    int bWalkStraightLineToPoint = TRUE
);

Parameters

oTarget

ジャンプする目標になるobject

bWalkStraightLineToPoint

(Default: TRUE)

Description

呼び出したobjectはoTargetの位置（または可能な近い場所）に即座に転送されます。この関数はエリア境界内または跨いで機能します。

oTargetが有効なobjectではない（また指定されていない）場合は、関数の呼び出しは失敗します。

Remarks

このアクションはビジュアル・エフェクトがありません。もし望むならば、自身で作成してください。ApplyEffectAtLocation()とApplyEffectAtObject()を使って、EffectVisualEffect()と組み合わせれば素晴らしく効果的です。

もし他のアクションを備えたキューへジャンプ・コマンドを付け加えるつもりが特になければ、即時の効果がある「JumpToObject」を使用することは通常はもっと実用的です。

全ての出現・ジャンプ型のコマンドのように、対象のobjectをoTargetに最も近い有効な位置に配置します。

locationに飛んだ事によりPCがエリアやトリガーから立ち去った場合、立ち去ったobjectのOnExitイベントが発動します。

死んでいるクリーチャーには機能しません；この関数を適切に機能させる為には０以上のHPを持っている必要があります。

Version

1.26

Example

// 長めのビジュアル・エフェクトで転送魔法を模す

void main()
{
     // 呪文の目標
     location locSpellTarget = GetLocation(OBJECT_SELF);

     // 転送の対象
     object oJumpTarget = GetObjectByTag("WP_jumpTarget");

     ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), locSpellTarget);
     ActionWait(2.0);
     ActionJumpToObject(oJumpTarget);
}

See Also

functions: | ActionJumpToLocation | ActionMoveToLocation | ActionMoveToObject | GetObjectByTag | JumpToLocation | JumpToObject
categories: | Action on Object Functions | Movement Functions
events: | OnPerception Event | OnSpellCastAt Event

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Enigmatic, JP team: Rainie


Function - ActionLockObject

Home > Reference > Functions > Action on Object > ActionLockObject

ActionLockObject(object)

クリーチャーにドアや他のオブジェクトを施錠させます。

void ActionLockObject(
    object oTarget
);

Parameters

oTarget

施錠を試みる対象となるドア、あるいは配置用オブジェクト。

Description

アクションを行う対象は、oTargetを施錠します。oTargetはドア、あるいは配置用オブジェクトです。

クリーチャーをドアに移動させて、そのドア(あるいは配置用オブジェクト)を施錠するために解錠スキルを使用させるスクリプトにおいて使われます。

Known Bugs

このコマンドを使ってドアを自動で施錠/解錠することはできません。しかし、そのように試みてもゲームがクラッシュすることはありません。ActionUnlockObject()関数の代わりに、ActionDoCommand(SetLocked(OBJECT_SELF, FALSE))をドアのスクリプトに設定すれば、確実にドアが'再び施錠できる'状態になります。

Version

1.30

See Also

functions: | ActionCloseDoor | ActionOpenDoor | ActionUnlockObject | SetLocked
categories: | Action on Object Functions

author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - ActionMoveAwayFromLocation

Home > Reference > Functions > Core AI, Movement > ActionMoveAwayFromLocation

ActionMoveAwayFromLocation(location, int, float)

実行者をlocationから立ち去らせます。

action ActionMoveAwayFromLocation(
    location locMoveAwayFrom,
    int bRun = FALSE,
    float fMoveAwayRange = 40.0f
);

Parameters

locMoveAwayFrom

bRun

走らせるか否かの真偽です。(デフォルト：FALSE)

fMoveAwayRange

(Default: 40.0f)

Description

行動の主体はlMoveAwayFromから立ち去るでしょう。

Version

1.22

See Also

functions: | ActionForceMoveToLocation | ActionMoveAwayFromObject | ActionMoveToLocation
categories: | Core AI Functions | Movement Functions

author: Ryan Hunt, JP team: Rainie


Function - ActionMoveAwayFromObject

Home > Reference > Functions > Core AI, Movement > ActionMoveAwayFromObject

ActionMoveAwayFromObject(object, int, float)

アクションの主体を、目標からある一定の距離を離れさせます。

action ActionMoveAwayFromObject(
    object oFleeFrom,
    int bRun = FALSE,
    float fMoveAwayRange = 40.0f
);

Parameters

oFleeFrom

アクションの主体が立ち去るobject

bRun

TRUE：アクションの主体は歩かずに走るでしょう。（デフォルト：FALSE）

fMoveAwayRange

アクションの主体とoFleeFromの間で置くべき距離。（デフォルト：40.0f）

Description

アクションの主体にfrom oFleeFromから一定の距離だけ離れさせます。
oFleeFromが、アクションの主体と同じエリアでない場合、何も起こりません。

Version

1.22

See Also

functions: | ActionForceMoveToObject | ActionMoveAwayFromLocation | ActionMoveToObject | TalentFlee
categories: | Core AI Functions | Movement Functions

author: Ryan Hunt, JP team: Rainie


Function - ActionMoveToLocation

Home > Reference > Functions > Action on Object, Core AI, Movement > ActionMoveToLocation

ActionMoveToLocation(location, int)

アクション・キュー中のさらにアクションを実行する前にNPCをlocationに移動させます。

void ActionMoveToLocation(
    location locDestination,
    int bRun = FALSE
);

Parameters

locDestination

objectはこのlocationへと移動します。位置が無効か、進路が見つけることができない場合、コマンドは何もしません。

bRun

TRUEである場合、行動の主体は歩かず走ります。（デフォルト：FALSE）

Description

行動の主体はlocDestinationに移動します。
この関数は、アクション・キューの他のアクションを実行するより先に、主体がlocDestinationに達するように待機させます。

もしエラーが生じた場合はログファイルに"MoveToPoint failed."と残ります。

Remarks

この関数はNPCとPCなどのクリーチャーのためにデザインされています。NWNでは配置物であるobjectを移動させることはできません。呼び出すobjectではないPCやNPCに、このコマンドを実行させる為には、AssignCommand()を使ってください。

locationに移動させるタイプの関数（ActionForceMoveToLocation, ActionMoveToLocation）は、実際に進路を捜索するobjectに移動させるタイプの関数（ActionForceMoveToObject, ActionMoveToObject）と異なり、直線的に目的地へ移動するように見えます。更に、locationに移動させるタイプの関数は簡単に中断されます。何かが突き当たったり、妨害した場合、コマンドは終了します。

Version

1.28

Example

// ウェイポイントへ呼び出したobjectを歩かせる。
void main()
{
     object oWP = GetObjectByTag("my_waypoint");
     location lDestination = GetLocation(oWP);
     ActionMoveToLocation(lDestination,FALSE);
}

See Also

functions: | ActionForceMoveToLocation | ActionJumpToLocation | ActionMoveAwayFromLocation | ActionMoveToObject
categories: | Action on Object Functions | Core AI Functions | Movement Functions

author: Brett Lathrope, editor: Charles Feduke, additional contributor(s): Harold Myles, JP team: Rainie


Function - ActionMoveToObject

Home > Reference > Functions > Action on Object, Core AI, Movement > ActionMoveToObject

ActionMoveToObject(object, int, float)

アクションの主体を目標objectの一定の距離へ移動させます。

void ActionMoveToObject(
    object oTarget,
    int bRun = FALSE,
    float fRange = 1.0f
);

Parameters

oTarget

アクションの主体を移動させるobject

bRun

これがTRUEである場合、アクションの主体は歩かずに走ります。（デフォルト：FALSE）

fRange

アクションの主体とoTargetとの望ましい距離です。（デフォルト：1.0f）

Description

アクションの主体はoTargetのfRangeの範囲内に移動します。oTargetへの進路がない場合、関数はなにも起こしません。この関数は、アクション・キューの他のアクションを実行するより先に、主体がlocDestinationに達するように待機させます。もしエラーが生じた場合はログファイルに "ActionMoveToObject failed."を残します。

Remarks

objectに移動するタイプの関数（ActionForceMoveToObject, ActionMoveToObject）は、locationに移動するタイプの関数（ActionForceMoveToLocation, ActionMoveToLocation）に相当する物と異なり、実際に進路を探索します。

Version

1.28

See Also

functions: | ActionForceMoveToLocation | ActionForceMoveToObject | ActionJumpToObject | ActionMoveAwayFromObject | ActionMoveToLocation
categories: | Action on Object Functions | Core AI Functions | Movement Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Harold Myles, JP team: Rainie


Function - ActionOpenDoor

Home > Reference > Functions > Action on Object > ActionOpenDoor

ActionOpenDoor(object)

クリーチャーにドアを開けさせます。

void ActionOpenDoor(
    object oDoor
);

Parameters

oDoor

開けるドア。

Description

アクションを行う対象にoDoorを開けさせます。

ActionOpenDoor関数を呼び出す対象がドアの場合、AssignCommand関数を通すか、ドアのスクリプトに設定すれば、ドアが自動で開きます。

しかし、ActionOpenDoor関数がクリーチャーのスクリプトで使用される場合は、そのクリーチャーはドアへ歩いていき、施錠されていなければそのドアを開けます。

Known Bugs

あらかじめ開いているドアを作成できないツールセットのバグは、もはや存在しません。そして、ActionOpenDoor関数があれば、以前に書いたような回り道の処理をする必要はありません。

Version

1.30

Example

// このスクリプトはエリアのOnEnterスロットに設定します。
// タグが"OPEN_DOOR"のドアを自動で開けさせます。
//

void main
{
     // オブジェクトを初期化します。
     object oDoor = GetObjectByTag("OPEN_DOOR");
     // ドアに自分で開くように伝えます。
     AssignCommand(oDoor, ActionOpenDoor(oDoor));
}

See Also

functions: | ActionCloseDoor | ActionDoCommand | ActionLockObject | ActionUnlockObject | SetLocked
categories: | Action on Object Functions

author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Drake Coker, Lilac Soul, JP team: katsu794


Function - ActionPauseConversation

Home > Reference > Functions > Action on Object, Conversation > ActionPauseConversation

ActionPauseConversation()

実行中のconversationを中断します

void ActionPauseConversation();

Description

その行動を取らせるスクリプトからこの関数を呼びだした会話ファイル中のノードである実行中のconversationを中断します。

Remarks

空きアクションキューを持った実行者に対して、この関数を使用すべきです。

そうでなければ効果はないでしょう。

ActionPauseConversation()が効果がない実行者にはClearAllActions()を使ってください。

会話でPCの返事の選択肢を中断する場合、PCの選択はActionResumeConversation()が呼び出されるか、PCが会話を中断する、もしくは範囲外へ出るまでハイライトされます。

Version

1.22

See Also

functions: | ActionResumeConversation | ActionStartConversation | GetLastSpeaker
categories: | Action on Object Functions | Conversation Functions

author: Troels Therkelsen, JP team: Rainie


Function - ActionPickUpItem

Home > Reference > Functions > Action on Object, Inventory, Movement > ActionPickUpItem

ActionPickUpItem(object)

主体をアイテムへ走らせてインベントリーに入れさせます。

action ActionPickUpItem(
    object oItem
);

Parameters

oItem

拾わせるアイテム

Description

アクションが実行された時、oItemの位置に走り、しゃがんで、インベントリーにoItemを入れます。

エラーが起こった場合には、ログファイルに"ActionPickUpItem failed"と記録されます。

Remarks

推測：oItemへの進路が塞がっている場合、関数は失敗するでしょう。

ActionPickUpItem関数を実行する前に、ActionForceMoveToObject関数を使用するようにしてください。

Version

1.22

See Also

functions: | ActionPutDownItem
categories: | Action on Object Functions | Inventory Functions | Movement Functions

author: Ryan Hunt, editor: Charles Feduke, JP team: NamaYake, Rainie


Function - ActionPlayAnimation

Home > Reference > Functions > Action on Object, Visual Effects > ActionPlayAnimation

ActionPlayAnimation(int, float, float)

キューで予定されている次の行動を実行する前に、アニメーション（fire and forget、looping、placeable）を行います。

void ActionPlayAnimation(
    int nAnimation,
    float fSpeed = 1.0,
    float fDurationSeconds = 0.0f
);

Parameters

nAnimation

ANIMATION_* type constant.

fSpeed

アニメーションを行う速度。値が大きいと速度は速いです（ANIMATION_LOOPING_* アニメーションに対しては使用されません）。(デフォルト: 1.0)

fDurationSeconds

アニメーションの継続時間。デフォルト値のままであれば、アニメーションは一瞬だけなされます。（実行後は放置するアニメーションには使用されません）(デフォルト: 0.0f)

Description

アクション対象にANIMATION_*で指定されるアニメーションをさせます。

Remarks

クリーチャーのアニメーションには２タイプあります。

'fire-and-forget' (FNF)は実行後はそのまま放置するアニメーションで、一度限りのアニメーションであり継続時間を設定する必要はありません。

'looping'は繰り返しのアニメーションで継続時間を設定する必要があります。

『すべてのモデルがすべてのアニメーションを持っているわけではありません』定数にあるアニメーションリストはモデルが可能な全アニメーションが定数になっているわけではありません（戦闘アニメーションや、そのほか死亡アニメーション等など）。それは現在スクリプトを通して可能なアニメーションのリストです。

光源、照明（ランプのような）'placeble'オブジェクト（配置可能オブジェクト）に対してはANIMATION_PLACEABLE_DEACTIVATEやANIMATION_PLACEABLE_ACTIVATEだけの使用では十分ではありません。これはだたそれ自身の光部分だけへの影響になります。あなたはSetPlaceableIlluminationコマンドをTRUEに設定し、エリアへRecomputeStaticLightingを使用する必要があります。

Version

1.29

Example

// 配置可能な照明へ使用する例
// 使用されたときにライトをオン、オフにします
// 配置オブジェクトのOnUsedイベントにセットします
void main()
{
  if (GetLocalInt (OBJECT_SELF,"NW_L_AMION") == 0)
  {
    SetLocalInt (OBJECT_SELF,"NW_L_AMION",1);
    PlayAnimation (ANIMATION_PLACEABLE_ACTIVATE);
    SetPlaceableIllumination (OBJECT_SELF, TRUE);
    RecomputeStaticLighting (GetArea(OBJECT_SELF));
  }
  else
  {
    SetLocalInt (OBJECT_SELF,"NW_L_AMION",0);
    PlayAnimation (ANIMATION_PLACEABLE_DEACTIVATE);
    SetPlaceableIllumination (OBJECT_SELF, FALSE);
    RecomputeStaticLighting (GetArea(OBJECT_SELF));
  }
}

See Also

functions: | PlayAnimation
categories: | Action on Object Functions | Visual Effects Functions
constants: | ANIMATION_* Constants

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): David Gaider, Joseph Berkley, JP team: geshi, Redondo


Function - ActionPutDownItem

Home > Reference > Functions > Action on Object, Inventory > ActionPutDownItem

ActionPutDownItem(object)

足元にアイテムを捨てます。

void ActionPutDownItem(
    object oItem
);

Parameters

oItem

捨てるアイテム。

Description

地面に物を置くアニメーションとともに、oItemを足元に捨てます。

エラーが起こった場合、ログファイルに "ActionPutDownItem failed."と記録されます。

Known Bugs

ActionPutDownItem関数はそれがアクションキューに加えられるとただちに現在いる位置を、アイテムを捨てる位置だと認識します。

もしあなたがNPCにA地点からB地点に移動してからアイテムを捨てるように指示した場合、NPCはB地点に移動した後A地点まで走って戻ってきてアイテムを捨てるでしょう。

これはあなたがNPCに何かを落とす前に移動するよう望んだ場合にのみ起こる問題です。

DelayCommand()関数を使ってその中に含めるようにしてください。

もしくはActionPutDownItem()の処理の部分は別のスクリプトに記述しておき、ActionDoCommand()関数を使用しその中で定義しておいたスクリプトを実行するようにしてください。

Version

1.28

See Also

functions: | ActionGiveItem | ActionPickUpItem
categories: | Action on Object Functions | Inventory Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Erik Mydland, JP team: NamaYake


Function - ActionRandomWalk

Home > Reference > Functions > Action on Object, Core AI, Movement > ActionRandomWalk

ActionRandomWalk()

主体をそれ自身に近い任意の位置に歩かせます。

void ActionRandomWalk();

Description

行動の主体は現在の位置から近い任意の位置を生み出し、移動します。この行動はClearAllActions()コマンドによってキャンセルされるまで、何度も繰り返されます。返す値はありませんが、エラーが生じた場合、ログファイルに"ActionRandomWalk failed."を残すでしょう。

Remarks

推測：

この関数のツールセットの記述には、全てのコマンドはアクション・キューからActionRandomWalkを取り除くと書いてありますが、これはそうではないようです。このアクションを上書きするただ一つの方法は、ClearAllActions()の呼出だと思います。

この関数の別の特徴として、主体がその元々の位置からあまり遠くに外れないように思います。

Version

1.22

See Also

functions: | WalkWayPoints
categories: | Action on Object Functions | Core AI Functions | Movement Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Adrian McKenzie, Jaxon, JP team: Rainie


Function - ActionRest

Home > Reference > Functions > Action on Object > ActionRest

ActionRest()

クリーチャーを休息させます。

void ActionRest();

Description

この関数を呼び出したクリーチャーは、休息モードになります。

この関数はクリーチャータイプのオブジェクトだけに適用されます。

Remarks

ActionRest関数はアクションキューの一番前に追加されます。ノーマルのアクションとして追加したい場合は、ActionDoCommand(ActionRest())とすれば可能です。

PC以外のクリーチャーには、休息時の行動はデフォルトでは設定されていません。(OnRestedスロットのスクリプトは、デフォルトでは空です。) 従って、何かを起こさせたい場合は、自分でスクリプトを書く必要があります。

Version

1.22

See Also

functions: | GetLastRestEventType
categories: | Action on Object Functions

author: Troels Therkelsen, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - ActionResumeConversation

Home > Reference > Functions > Action on Object, Conversation > ActionResumeConversation

ActionResumeConversation()

中断をかけていたconversationを戻します。

void ActionResumeConversation();

Description

前もってActionPauseConversation()によって中断していた会話を取り戻します。

Remarks

ポーズ中にPCが会話を中断した場合（ESCキーを押す、魔法を唱える等）、この関数が呼び出され、会話を戻します。この行為が望ましくない場合、"End Conversation Script - Aborted"スクリプトを使うことで独自にコード化できます。

PCが会話していたobjectの範囲外へ移動した場合、これは取り戻すことができません。

Version

1.22

See Also

functions: | ActionPauseConversation | ActionStartConversation | GetLastSpeaker
categories: | Action on Object Functions | Conversation Functions

author: Troels Therkelsen, editor: Dave Robinson. JP team: Rainie


Function - ActionSit

Home > Reference > Functions > Action on Object > ActionSit

ActionSit(object)

クリーチャーを座らせる

void ActionSit(
    object oChair
);

Parameters

oChair

座らせるobject（通常はイスやカウチ）

Description

呼び出したobject（PC、NPC）はoChairに座ろうとします。

oChairはこのスクリプトでのターゲットの例で、通常はOnUseに設定したobject自身を指すOBJECT_SELFを使います。

Remarks

全てのクリーチャーが座るわけではありません。また、全ての配置物に設定できるわけでもありません。

タイルセット上のアイテムに座らせる場合は、透明オブジェクトを使用します。

イスやカウチ以外の透明オブジェクトなど他のオブジェクトに座らせる場合は、常に東（90度）を向いて座ります。これはモデルの仕様です。

Version

1.28

Example

// the following script will allow the PC to sit in a chair
void main()
{
    object oPlayer = GetLastUsedBy();
    object oChair = OBJECT_SELF;
    if (GetIsPC(oPlayer))
    {
        if (GetIsObjectValid(oChair) && !GetIsObjectValid (GetSittingCreature(oChair)))
        {
            AssignCommand(oPlayer, ActionSit(oChair));
        }
    }
}

See Also

categories: Action on Object Functions

author: Dan Spezzano, editor: Charles Feduke, additional contributor(s): Dave Figueroa, Fran ois Guimond, JP team: geshi


Function - ActionSpeakString

Home > Reference > Functions > Action on Object, Conversation > ActionSpeakString

ActionSpeakString(string, int)

objectに会話させます

void ActionSpeakString(
    string sStringToSpeak,
    int nTalkVolume = TALKVOLUME_TALK
);

Parameters

sStringToSpeak

会話に使う文字列

nTalkVolume

TALKVOLUME_* (デフォルト：TALKVOLUME_TALK)

Description

実行者のアクションキューに、sStringToSpeakを話すアクションを追加します

nTalkVolumeはアクションの処理する時に文字列をどの大きさで話させるかを決定します

Remarks

この関数は、実行者に直接会話させるSpeakStringとは異なります

実行者は何かを行うためのアクションキューを持ってないといけないことに注意してください

Version

1.22

See Also

functions: | ActionSpeakStringByStrRef | ActionStartConversation | SpeakString
categories: | Action on Object Functions | Conversation Functions
constants: | TALKVOLUME_* Constants

author: Charles Feduke, editor: Maximus, additional contributor(s): Drake Coker, JP team: Rainie


Function - ActionSpeakStringByStrRef

Home > Reference > Functions > Action on Object, Conversation > ActionSpeakStringByStrRef

ActionSpeakStringByStrRef(int, int)

クリーチャーに翻訳した文字列を話させます

void ActionSpeakStringByStrRef(
    int nStrRef,
    int nTalkVolume = TALKVOLUME_TALK
);

Parameters

nStrRef

参照する文字列の会話テーブル

nTalkVolume

TALKVOLUME_* (デフォルト：TALKVOLUME_TALK)

Description

実行クリーチャーに会話テーブルのnStrRefで変換した文字列を話させます

Remarks

現在のところ、マルチ言語の文字列のStrRefを取得する方法がありませんので、この関数はあまり使えません

Version

1.22

See Also

functions: | ActionSpeakString | FloatingTextStrRefOnCreature
categories: | Action on Object Functions | Conversation Functions
constants: | TALKVOLUME_* Constants

author: Troels Therkelsen, editor: Charles Feduke, JP team: Rainie


Function - ActionStartConversation

Home > Reference > Functions > Action on Object, Conversation > ActionStartConversation

ActionStartConversation(object, string, int, int)

PCとのconversationをNPCに開始させます

action ActionStartConversation(
    object oObjectToConverseWith,
    string sDialogResRef = "",
    int bPublicConversation = FALSE
    int bPlayHello = TRUE
);

Parameters

oObjectToConverseWith

対話する対象にするObject

sDialogResRef

参照するconversationのファイル名（デフォルト：""）

bPublicConversation

conversationが周りに、またはPCにのみ聞こえるかどうか（デフォルト：FALSE）

bPlayHello

最初の挨拶をするかどうか (デフォルト: TRUE)

Description

この関数をスクリプトの中で使用すると、実行したObjectのアクション・キューにActionStartConversationを加えます

ObjectがActionStartConversationを実行すると、sDialogResRefで設定した対話ファイルを使って、oObjectToConverseWithに設定された対象に話かけるよう試みます

対象がPCでない場合、その対象のonConversationが開始されます

sResRefはの参照するconversationファイルのファイル名です

sResRefが指定されていない場合、PCではない側のObjectのデフォルトのconversationが使用されます（ツールセットのプロパティにあるセット）

bPublicConversationが指定されていない、もしくはFALSEである場合、そのconversationはPCとObjectの間にのみ残ります

そうでなければ、その会話は雑談として放送され、他のプレーヤーにも「聞こえ」ます

Remarks

PCは、NPCやplaceables（配置用オブジェクト）、トリガ及びドアとの対話を行うことができますがアイテムとは対話することができません

（しかしアイテムと同じ名前を持たせた'透明なオブジェクト'とは可能です）

元々、BioWareの原型ではbPublicConversationはbPrivateConversationと名付けられていましたが、このパラメーター名がその意図したものとは逆の働きをすることに混同していることに気をつけてください

会話をしようとするどのような静的ObjectもPCの視界範囲内にあるでしょう（カメラが自動拡大中でも約10ｍ以内）

もしドアとPCの会話を始めようとして、そのドアが10ｍ以上離れていれば、会話ウィンドウは簡潔に現われて即座に閉じてしまいますが、ドアの最初の文章はPCのチャットウィンドウに表示されるでしょう

アクションを実行するObjectが動的ならば、それはoObjectToConverseWithに走り寄り会話をしようと試みますが、別のアクションがそのキューに加えられるならやめるでしょう

ActionStartConversation関数を登録しようとすると結果は不定です

プレイヤーが通常の移動をしている場合には行動を止める可能性が非常に高いです

sResRefはモジュール内容一覧の「カンバーセーション」の項目にあるconversationのファイル名です

PCはOnConversationがないので、デフォルトのconvasationファイルを持ちません

カメラのZoomは操作できませんが、角度とモードはScriptで指定できます

Known Bugs

v1.28以前のpatchでは、ActionStartConversationをエリアやモジュールに割り当てた場合は問題を引き起こします。

Version

1.28

Example

// ---    NPCs   ----
/*
 *これはNPCのOnPerception用で, NPCが気付いた
 * 最初のPCに対し、デフォルトのconversationとして
 * "q_dragnbone"を開始させる。
 * そのconversationはそのPCにのみ聞こえる
 */
ActionStartConversation( GetLastPerceived(), "q_dragnbone");

// --- Placeables ---
/*
 * これは静的ではない配置用オブジェクトのOnUsed用で
 * その配置オブジェクトを使用したPCに対し
 * デフォルトのconversationを開始す
 * (配置用オブジェクトのプロパティの詳細設定タブで設定します)
 */
ActionStartConversation( GetLastUsedBy() );

/*
 * これは静的ではない配置用オブジェクトの
 * OnUsed用で、それを使用したPCに対して
 * "offer_healing"というファイルの会話を開始する
 * 他のプレイヤーもその会話を聞くことができる
 */
ActionStartConversation( GetLastUsedBy(), "offer_healing", TRUE );

// --- Triggers ---
/*
 * これはトリガーのOnEnter用Scriptで
 * 入ったPCとトリガーの間に"odd_voice"という
 * 会話を開始する。（トリガーに）入ったPCだけが
 * 会話を聞くことができる。しかし、会話が始まる前に、
 * プレイヤーの移動は会話を取り消すかもしれない
 */
ActionStartConversation( GetLastEntering(), "odd_voice" );

/*
 * これはトリガーのOnEnter用Scriptで
 * "rat_boy"というタグを持つNPCはPCに駆け寄り
 * 彼のデフォルトのconversationを開始する
 * またOnConversationも始まるが、表示した場合
 * BeginConversationで終わるべきである
 * onConversationの実行の中に異なるconversationのresrefが
 * セットされると、その会話が始められる
 */
object oBoy = GetObjectByTag("rat_boy");
object oPC = GetEnteringObject();
AssignCommand(oBoy, ActionStartConversation(oPC, "", TRUE));

See Also

functions: | ActionPauseConversation | ActionResumeConversation | ActionSpeakString | BeginConversation | FloatingTextStringOnCreature | GetLastSpeaker | GetPCSpeaker
categories: | Action on Object Functions | Conversation Functions

author: Iskander Merriman, editor: Charles Feduke, additional contributor(s): Michael Mason, John Detwiler, Jotham, Jassper, JP team: geshi, marshall, Rainie


Function - ActionTakeItem

Home > Reference > Functions > Action on Object, Inventory > ActionTakeItem

ActionTakeItem(object, object)

オブジェクトからアイテムを奪います。

void ActionTakeItem(
    object oItem,
    object oTakeFrom
);

Parameters

oItem

奪いとるアイテム。

oTakeFrom

奪いとるアイテムを持っているオブジェクト

Description

oItemが有効なアイテムでない場合またはoTakeFromが有効なオブジェクトでない場合は何も起こりません。

これはPCが所持しているアイテムや装備しているアイテムを奪いとることができます。

Remarks

このアクションは所持品を持つことができるオブジェクトのみ実行できます。

アクションを実行するｆオブジェクトは実際に所持品を持っている必要はありませんが、アイテムを所持する機能がなければいけません。

もしアクションを実行するオブジェクトが所持品を持つことができるなら、oItemは自動的にその所持品に移動します。

もしアクションを実行したオブジェクトが所持品を持つ機能がなかった場合でも、このアクションで奪いとられたアイテムは破壊されることはなく、それらのデータは不明な状態のまま保存されます。

それらは有効なオブジェクトのままで、ActionGiveItem関数を使うことで元に戻すこともできます

Known Bugs

エリアのOnEnterイベントでこのアクションをテストを実施したとき、エリアのアクションキューにこのアクションが加えられエリアのロード時にエリアはクラッシュしてしまいました。

Lilac Soulによる注意点：実際にはエリアとモジュールはアクションキューを持つことができませんので、おそらくクラッシュしてしまいます。

ActionTakeItem関数をコンテナ内のコンテナに対して使用するとゲームはクラッシュしてしまいます。

これの代替案としては、コンテナをフロア（それが見られない右上の隅に）に置き、そしてその上でActionTakeItemを実行するというものです。

Version

1.22

Example

// トリガーのOnEnterの中に使います。
//"plc_mystery"というタグを持った配置物がPCから着物をはぎとり、
//そして再び着せます。
#include "nw_i0_generic"
void main() {
  object oPC = GetEnteringObject();
  if (! GetIsPC( oPC )) return;
  object oClothes = GetItemInSlot(INVENTORY_SLOT_CHEST , oPC);
  object oMystery = GetObjectByTag("plc_mystery"); // あらかじめ用意しておいた透明オブジェクトのタグ
  // 順序が保存されるようにAssignCommandを使用すること
  AssignCommand(oMystery, ActionTakeItem(oClothes, oPC));
  if (GetHasInventory(oMystery)) SendMessageToPC(oPC, "Yup, oMystery has an inventory");
  else SendMessageToPC(oPC, "Nope, no inventory here");
  AssignCommand(oMystery, ActionDoCommand(SendMessageToPC(oPC, "HasItem on oMystery says: " + IntToString(HasItem(oMystery, GetTag(oClothes))) )));
  AssignCommand(oMystery, DelayCommand(1.0, ActionSpeakString("Hey, great abs! You been working out ")));
  AssignCommand(oMystery, DelayCommand(3.0, ActionGiveItem(oClothes, oPC)));
  AssignCommand(oMystery, DelayCommand(3.1, AssignCommand(oPC, ActionEquipItem(oClothes, INVENTORY_SLOT_CHEST))));
}

See Also

functions: | ActionGiveItem | ActionUnequipItem
categories: | Action on Object Functions | Inventory Functions

author: Iskander Merriman, editor: Lilac Soul, additional contributor(s): Enigmatic, JP team: NamaYake


Function - ActionUnequipItem

Home > Reference > Functions > Action on Object, Inventory > ActionUnequipItem

ActionUnequipItem(object)

クリーチャーに装備を外させて、それを所持品の中に収納します。

void ActionUnequipItem(
    object oItem
);

Parameters

oItem

装備解除するアイテム。

Description

オブジェクト（PCかNPC）にoItemを装備から外させて、それを所持品の中に収納します。

Remarks

oItemがOBJECT_INVALIDだった場合は何も起こりません。

oItemは破壊されません。スクリプトを呼び出したオブジェクト（PCかNPC）の所持品に収納されます。

Version

1.27

Example

// OnEnterスクリプトで、PCの服を脱がせます。
# include "nw_i0_generic"
void main()
{
     object oPC = GetEnteringObject();
     if (GetIsPC(oPC))
     {
          AssignCommand(oPC, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_CHEST , oPC)));
     }
}

See Also

functions: | ActionEquipItem | ActionTakeItem | GetItemInSlot
categories: | Action on Object Functions | Inventory Functions

author: Iskander Merriman, editor: Charles Feduke, JP team: NamaYake


Function - ActionUnlockObject

Home > Reference > Functions > Action on Object > ActionUnlockObject

ActionUnlockObject(object)

クリーチャーにドアや他の 施錠されたオブジェクトを解錠させます。

void ActionUnlockObject(
    object oTarget
);

Parameters

oTarget

解錠を試みる対象となるドア、あるいは配置用オブジェクト。

Description

アクションを行う対象は、oTargetを 解錠します。oTargetはドア、あるいは配置用オブジェクトです。 ActionUnlockObject関数は、オブジェクトの'解錠'スキルを使用します。それゆえに、配置用オブジェクト、トリガーやドア自体には適用できません。

Remarks

クリーチャーをドアに移動させて、そのドア(あるいは配置用オブジェクト)を 解錠するために解錠スキルを使用させるスクリプトにおいて使われます。

Known Bugs

このコマンドを使ってドアを自動で施錠/解錠することはできません。しかし、そのように試みてもゲームがクラッシュすることはありません。ActionUnlockObject()関数の代わりに、ActionDoCommand(SetLocked(OBJECT_SELF, FALSE))をドアのスクリプトに設定すれば、確実にドアが'再び施錠できる'状態になります。

Version

1.30

See Also

functions: | ActionCloseDoor | ActionLockObject | ActionOpenDoor | SetLocked
categories: | Action on Object Functions

author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - ActionUseFeat

Home > Reference > Functions > Action on Object, Combat, Talents/Skills/Feats > ActionUseFeat

ActionUseFeat(int, object)

oTargetのフィート（特技）を使用させます。

action ActionUseFeat(
    int nFeat,
    object oTarget
);

Parameters

nFeat

FEAT_*

oTarget

特技の対象になるobject

Description

ActionUseFeatは、クリーチャーに指定した特技を目標のobjectに対して使用させます（適切な場合）。クリーチャーがその特技を持っていない場合、この関数はなにもしません。

Remarks

この行動はPCにさせることはできません。

Version

1.22

Example

// NPCに「レイ・オン・ハンズ（Lay on Hands）」を
// 会話中にさせるスクリプト：
ActionUseFeat( FEAT_LAY_ON_HANDS, GetPCSpeaker() );

See Also

functions: | ActionUseSkill | ActionUseTalentAtLocation | ActionUseTalentOnObject | GetHasFeatEffect
categories: | Action on Object Functions | Combat Functions | Talents/Skills/Feats Functions
constants: | FEAT_* Constants

author: Iskander Merriman, JP team: Rainie


Function - ActionUseSkill

Home > Reference > Functions > Action on Object, Henchmen/Familiars/Summoned, Talents/Skills/Feats > ActionUseSkill

ActionUseSkill(int, object, int, object)

クリーチャーに他のobjectに対してスキルを使用させます。

void ActionUseSkill(
    int nSkill,
    object oTarget,
    int nSubSkill = 0,
    object oItemUsed = OBJECT_INVALID
);

Parameters

nSkill

SKILL_*

oTarget

nSubSkill

SUBSKILL_* (Default: 0)

oItemUsed

スキルと関係して使用するアイテム（デフォルト：OBJECT_INVALID）

Description

クリーチャーのキューにこのアクションを追加し、指定したスキルを使用するよう試みさせます。クリーチャーではないobjectに対しては何の効果もありません。

nSubSkillのパラメーターは、罠の回収、解除、印をつける際に使用します。

oItemUsedはスキルに対応した有効なアイテムである必要があります。例えば、「治療用具」はSKILL_HEALと共に使用することが出来ます。クリーチャーはアイテムを所有している必要があります。

Remarks

クリーチャーがそのスキルを所有し、使用できるかどうかを調べるためにGetHasSkillを使用してください。

幾つかのスキルは敵対行為になり、機会攻撃を引き起こします。例えば、SKILL_TAUNTです。

Version

1.22

Example

// 「治療用具」を使ってPCを治療する：
ActionUseSkill(SKILL_HEAL, oPC, 0, oKit);

See Also

functions: | ActionUseFeat | GetHasSkill | GetSkillRank
categories: | Action on Object Functions | Henchmen/Familiars/Summoned Functions | Talents/Skills/Feats Functions
constants: | SKILL_* Constants | SUBSKILL_* Constants

author: Iskander Merriman, JP team: Rainie


Function - ActionUseTalentAtLocation

Home > Reference > Functions > Talents/Skills/Feats > ActionUseTalentAtLocation

ActionUseTalentAtLocation(talent, location)

指定したlocationで、選択した能力を使用させます。

action ActionUseTalentAtLocation(
    talent tChosenTalent,
    location locTargetLocation
);

Parameters

tChosenTalent

使用させるTalent

locTargetLocation

目標とするlocation

Description

tChosenTalentをlTargetLocationで使用させます。

Version

1.22

See Also

functions: | ActionUseFeat | ActionUseTalentOnObject
categories: | Talents/Skills/Feats Functions

author: Ryan Hunt, JP team: Rainie


Function - ActionUseTalentOnObject

Home > Reference > Functions > Action on Object, Talents/Skills/Feats > ActionUseTalentOnObject

ActionUseTalentOnObject(talent, object)

指定した目標のObjectで選択した能力を使用させます。

action ActionUseTalentOnObject(
    talent tChosenTalent,
    object oTarget
);

Parameters

tChosenTalent

使用する能力

oTarget

目標となるObject

Description

oTargetにおいて、tChosenTalentを使用させます。

Version

1.22

See Also

functions: | ActionUseFeat | ActionUseTalentAtLocation
categories: | Action on Object Functions | Talents/Skills/Feats Functions

author: Ryan Hunt, JP team: Rainie


Function - ActionWait

Home > Reference > Functions > Action on Object, Miscellaneous, Time > ActionWait

ActionWait(float)

objectのキューに待機アクションを追加します。

void ActionWait(
    float fSeconds = 0.0
);

Parameters

fSeconds

待機させる時間（秒）（デフォルト：0.0）

Description

ActionWait()は、objectのアクションキューに、キュー内の他のアクションを実行する前に、fSecond秒間待機させるアクションを追加します。

Remarks

後に続くアクションの前に、NPCやその他のobjectがしてたことを中断させるために、ActionWait()は有効です。

注意として、ActionWaitはスクリプトの実行中にポーズをすることは「ありません」－なにもしないのです。（オブジェクトのアクションの実行よりむしろ）プログラム内部の一部の実行を遅らせたいならば、代わりに実行スクリプト上にDelayCommand()を使用すべきです。

Version

1.22

Example

/* NPCのスクリプトで、このプログラムは * NPCをウェイポイント("WP_LOOKING_1")に歩かし、
 * "Is anyone there?"（誰かいるか？）と叫ばせ、５秒間返事を待たせ、
 * ふさわしい失望をさせるというアクションをキューに並べる */
ActionMoveToObject(GetObjectByTag("WP_LOOKING_1"));
ActionSpeakString("Is anyone there ");
ActionWait(5.0);
ActionSpeakString("Dang!");

// --- NPC/NPC conversation ---
/* トリガーのOnEnterスクリプト用のアクションであるこのシーンは
 * ２人の近くにいるNPC同士の短い会話を演出する　*/
object oFrodo = GetObjectByTag("Frodo");
object oSam   = GetObjectByTag("Sam");
AssignCommand(oSam, ActionWait(2.0));
AssignCommand(oFrodo, ActionSpeakString("Oh, Sam, will we ever make it to Mordor "));
AssignCommand(oFrodo, ActionWait(4.0));
AssignCommand(oSam, ActionSpeakString("Of course we will, Master Frodo, if that pesky Gollum doesn't strangle us first."));
AssignCommand(oSam, ActionWait(4.0));
AssignCommand(oFrodo, ActionSpeakString("You're always so cheerful, Sam. I'm glad we're pals");
AssignCommand(oSam, ActionSpeakString("Pals  When this is over, you and I are going to have a long talk about the definition of 'walking holiday'.");

See Also

functions: | AssignCommand | DelayCommand
categories: | Action on Object Functions | Miscellaneous Functions | Time Functions

author: Iskander Merriman, editor: Dave Robinson, JP team: Rainie


Function - ActivateFleeToExit

Home > Reference > Functions > Core AI, Movement > ActivateFleeToExit

ActivateFleeToExit()

クリーチャーをその出口となるウェイポイントに走らせ消えます。

void ActivateFleeToExit();

Description

ActivateFleeToExitはNPCをEXIT+〈NPCのtag〉と付けたウェイポイントから消し去り、それ自身を消滅させ、随意にその出現位置から再出現させます。

ActionFleeToExitの動作のために、これら４つの出現コンディションの１つを設定しなくてはなりません：

・NW_FLAG_TELEPORT_LEAVE

・NW_FLAG_TELEPORT_RETURN

・NW_FLAG_ESCAPE_LEAVE

・NW_FLAG_ESCAPE_RETURN

テレポートフラグをもったNPCは、EFFECT_UNSUMMONエフェクトで自身を消し去ります。

Remarks

この関数でフラグがNPCに立っていることを、GetFleeToExit()で確認することができます。

NW_FLAG_ESCAPE_RETURNオプションを使用した際、NPCのtagがそれ自身のresrefと100%同一であるということは絶対に必要であります。nw_i0_generic.nssに見ることができるように、ActivateFleeToExit()関数は、再度NPCを大量に産むためにCreateSignPostNPC()(論点であるtagを備えた)を使用します。

よって、NPCのresrefが "halfling016"である場合、NPCのタグも "halfling016"でなければなりません。そうでなければNPCは消え去るでしょうが戻ってこないでしょう！

Requirements

#include "NW_I0_GENERIC"

Version

1.26

Example

// OnPerceptionイベント用、怯えたPCを立ち止まらせる。
#include "NW_I0_GENERIC"
void main()
{
  ActivateFleeToExit();
}

See Also

functions: | GetFleeToExit
categories: | Core AI Functions | Movement Functions
constants: | NW_FLAG_* Constants

author: Iskander Merriman, editor: Charles Feduke, additional contributor(s): Cheiron, Bjorn Toft, JP team: Rainie


Function - ActivatePortal

Home > Reference > Functions > Area, Module, Movement, PC Only, Server > ActivatePortal

ActivatePortal(object, string, string, string, int)

キャラクターがログインする新しいサーバーへプレイヤーのクライアントを送ります。

void ActivatePortal(
    object oTarget,
    string sIPaddress = "",
    string sPassword = "",
    string sWaypointTag = "",
    int bSeamless = FALSE
);

Parameters

oTarget

転送するクライアントのPC

sIPaddress

新しいサーバーのDNS名またはIPアドレス（とポート）。（デフォルト：""）

sPassword

目的のサーバーにログインするパスワード。（デフォルト：""）

sWaypointTag

もしセットされれば、到着するPCはスタート位置で現われた後にこのウェイポイントにジャンプするでしょう。（デフォルト：""）

bSeamless

TRUEであれば、転送は「境界無し」となり、PCは転送の際ダイアログボックスが出ないでしょう。（デフォルト：FALSE）

Description

ActivatePortalは新しいサーバーへと転送しようとします。（例えば、共有した世界を持つ周辺サーバーへ飛ぶ場合）

sIPaddressはIPアドレス（例．192.168.0.84）やDNS名（"www.bioware.com"）となり、ポート設定（192.168.0.84:5121 や "www.bioware.com:5121"）も含みます。ポートが特定されていない場合、デフォルトは5121になるでしょう。

sPasswordは目的となるサーバーのログインパスワードです。

sWaypointTag：これが設定されていれば、キャラクターが転移してきた後、このウェイポイントが存在していれば、そこに飛びます。

bSeamlessがTRUEに設定されていれば、クライアントは情報ウィンドゥでサーバー移動について注釈しません。またそれらのキャラクターのコピーを許可しません（ローカルヴォルトキャラクターの場合）。

Remarks

これはモジュール内にも転送するよう働きますが、「境界無し」モードであってさえも手短に「ログイン中」ウィンドゥを表示します。

「境界無し」ではない時のポップアップは非常に見苦しく、何が起こってるかさえ告げません。デフォルト・オプションを使用すれば、転送する前にPCに幾らかの情報を供給したいと思うかもしれません。

Known Bugs

- ジャンプさせる先のウェイポイントのタグは全て大文字でなければなりません。

- ActivatePortalでトリガーから立ち去る場合、OnExitイベントが発動しません。エリアのOnExitは（正しく）発動します。

Version

1.22

Example

// 石像のOnUsedに入れる
// 使用したPCを、プレイヤーパスワード"mumb0Jumb0"を持った
// 別の（虚構の）サーバーに送り、PCを
// ウェイポイント"ISK_WP_PORTAL"から出現させる
// プレイヤーはサーバーを移動したことに気付かない
#include "nw_i0_generic"
void main()
{
     object oPC = GetLastUsedBy();
     if (!GetIsPC( oPC )) return;
     ActivatePortal(oPC, "nwn.iskander.tv:5432", "mumb0Jumb0", "ISK_WP_PORTAL", TRUE);
}

See Also

functions: | ActionJumpToLocation
categories: | Area Functions | Module Functions | Movement Functions | PC Only Functions | Server Functions
events: | OnClientEnter Event | OnClientLeave Event

author: Iskander Merriman, editor: Dave Robinson, JP team: Rainie


Function - ActivePortal

Home > Reference > Functions > Area > ActivePortal

ActivePortal(string)

UNKNOWN

void ActivePortal(
    string sWaypointTag
);

Parameters

sWaypointTag

(case sensitive)

Description

UNKNOWN

Version

1.25

See Also

categories: Area Functions

author: Charles Feduke


Function - AddHenchman

Home > Reference > Functions > Henchmen/Familiars/Summoned > AddHenchman

AddHenchman(object, object)

ヘンチマンNPCをPCに加えます。

void AddHenchman(
    object oMaster,
    object oHenchman = OBJECT_SELF
);

Parameters

oMaster

ヘンチマンを従わせるPC

oHenchman

oMasterに従うヘンチマン（デフォルト：OBJECT_SELF）

Description

ヘンチマンとしてoHenchmanをoMasterに加えます。

Known Bugs

パッチv1.28以前では、AddHenchman()は他のPCやDMでさえも、プレイヤーのヘンチマンとして使用できました。

Version

1.28

See Also

functions: | AddToParty
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, JP team: Rainie


Function - AddJournalQuestEntry

Home > Reference > Functions > Conversation, Experience, Journal > AddJournalQuestEntry

AddJournalQuestEntry(string, int, object, int, int, int)

プレイヤーのジャーナルに登録事項を追加します。（日記エディタで、エントリーを作成するのが先決です。）

void AddJournalQuestEntry(
    string sCategoryTag,
    int nEntryID,
    object oCreature,
    int bAllPartyMembers = TRUE,
    int bAllPlayers = FALSE,
    int bAllowOverrideHigher = FALSE
);

Parameters

sCategoryTag

ジャーナルカテゴリーのタグ（ファイル名での大文字と小文字は区別されます）

nEntryID

ジャーナルエントリーのID

oCreature

ジャーナルエントリーを受け取らせたいPC

bAllPartyMembers

TRUEならば、エントリーはoCreatureのいるパーティのジャーナルに追加されます。

（デフォルト：TRUE）

bAllPlayers

TRUEならば、エントリーはモジュール内の全てのプレイヤーのジャーナルに表示されます。

（デフォルト：FALSE）

bAllowOverrideHigher

TRUEならば、nState（エントリーのID）を現在のジャーナルエントリーに可逆に上書きするに違いないでしょう。（デフォルト：FALSE）

Description

AddJournalQuestEntry()はまさにその名の通りに、プレイヤーの日記画面の「クエスト」または「完了したクエスト」のページにエントリーを追加します。

ただ1人のPC、PCのパーティメンバーの全て、またはモジュール内の全ての駐留者に対して、エントリーを追加しフラグを立てることができます。

関数はジャーナルエントリーを参照する為に、szPlotIDとnStateという、２つのパラメーターを参照します。
sCategoryTagはジャーナルカテゴリーのタグです。例えば、"ボブの素敵なブチ蹴り靴"という名前のクエストを作り、それに"isk_jrnl_bbbbk"というタグを与え、ジャーナルエントリーに割り当てる場合、そのタグを利用してください。

iEntryIDは特定のジャーナルエントリーのIDです。これは日記エディタのID欄に入力した数字で、ジャーナルエントリーを表示する順番を表す数字でもあります。デフォルトでは、AddJournalQuestEntry()を使用した場合、ジャーナルエントリーの数字は増えなければいけません。

このコマンドのジャーナル更新が行われたとき、ジャーナルカテゴリーの名前を無記名のチャットメッセージとして表示します。

Remarks

conversation内でジャーナルエントリーを更新するための、スクリプトを作る必要はありません。「その他のアクション」タブで、望みのジャーナルカテゴリーとジャーナルエントリーを選択するだけでいいのです。

bAllowOverrideHigherをTRUEにする際は注意してください。最終段階である「完了したクエスト」エントリーを、それより前の段階である「クエスト」エントリーへと、矛盾して移行することが簡単にできてしまいます。

日記エディタ内の「カテゴリー終了」チェックボックスで、日記タブのエントリーは固定されて表示されます。完遂した「クエスト」タブの他のものは「完了したクエスト」タブに移ります。「ユーザーメモ」タブにはメッセージを追加することは出来ません。

前にあったジャーナルエントリーは自動的に除去されます。同タイトルのクエストの効果を使いたいならば、異なるタグをカテゴリーに使って、名前だけを同じにします。

PvPトーナメントでの戦いの軌跡を残す為に、上書きフラグは有効に利用出来るかもしれません。

このコマンドはXPの指定は「行いません」。指定したいのであれば、GetJournalQuestExperience()、もしくはGiveXPToCreature()を使ってください。

AddJouralQuestEntryは大/小文字の区別されないsCategoryTagを見つけるでしょう。しかし、同じsCategoryTagではあるものの、異なる大/小文字を使用したクエストは、個々の異なるクエストを追加するでしょう。（同じクエストではありません）

PCのアイテム取得で、ジャーナルエントリーを追加させるようにするにはモジュールのOnItemAcquiredで、この関数を使う必要があります。下記のサンプルを見てください。

ジャーナルエントリーをPCにセットするときに、LocalIntegerは"NW_JOURNAL_ENTRY*"（*は追加されたエントリー名）という名前で、同一のPCに記憶させられます。integer value（整数値）は記憶したジャーナルエントリーのIDです。

Version

1.28

Example

// ジャーナルカテゴリー"isk_jrnl_bbbbk"に３のエントリーを登録:
// 1    - 始動メッセージ
// 100 - 中盤メッセージ
// 200 - 終了メッセージ (エディターの「カテゴリー終了」にチェック)
// oPCを有効なPC objectと仮定する
// 実行の順序:

// 参加してきたPCの日記に、ジャーナルカテゴリー"isk_jrnl_bbbbk"の
// ID 1のジャーナルエントリーを追加する
// 他人のジャーナルは影響されない
AddJournalQuestEntry("isk_jrnl_bbbbk", 1, oPC, FALSE, FALSE, FALSE);

// これはそのPCのジャーナルだけをID 100のエントリーに更新する
AddJournalQuestEntry("isk_jrnl_bbbbk", 100, GetEnteringObject(), FALSE, FALSE, FALSE);

// ジャーナルは既にエントリー100になっているため、これらは何も起きない
AddJournalQuestEntry("isk_jrnl_bbbbk", 100, oPC, FALSE, FALSE, FALSE);
AddJournalQuestEntry("isk_jrnl_bbbbk", 1, oPC, FALSE, FALSE, FALSE);

// これはPCの日記画面の「完了したクエスト」タブに
// 終了メッセージを追加する
AddJournalQuestEntry("isk_jrnl_bbbbk", 200, oPC, FALSE, FALSE, FALSE);

// これはクエストの終了メッセージを取り消し
// 「クエスト」タブに中盤メッセージを追加する
AddJournalQuestEntry("isk_jrnl_bbbbk", 100, oPC, FALSE, FALSE, TRUE);

// ----- Completely different example -----

// アイテムを拾う際にエントリーを追加する
// スクリプトをOnAcquireItemに入れる:
// (Thomas Daugaard氏の好意に感謝)
//
// "my_item_tag"と"my_item_quest"とが、
// チェックするアイテムのタグと、適切なジャーナルエントリーのカテゴリー・タグ、
// それぞれが一致するように修正する
void main()
{
     // 拾ったobjectを取得する
     object itemAcquired = GetModuleItemAcquired();

     if(itemAcquired != OBJECT_INVALID) {
          // 拾ったアイテムのタグを取得する
          // "my_item_tag"であれば、正しいアイテムである
          if ( GetTag(itemAcquired) == "my_item_tag") {
               // アイテムを持っているオブジェクト（プレーヤー）を取得する
               object oPC = GetItemPossessor(itemAcquired);
               // そのプレーヤーのジャーナルに適切なエントリーを追加する
               AddJournalQuestEntry ("my_item_quest", 100, oPC);
          }
     }
}

See Also

functions: | GetJournalQuestExperience | GiveXPToCreature | RemoveJournalQuestEntry | RewardPartyXP
categories: | Conversation Functions | Experience Functions | Journal Functions
events: | OnAcquireItem Event | OnActivateItem Event | OnAreaTransitionClick Event | OnEnter Event | OnUsed Event | OnUserDefined Event

author: Iskander Merriman, editor: Charles Feduke, additional contributor(s): Dave Dursley, Kenneth Cummins, Gabriel Weiss, JP team: geshi, Rainie


Function - AddToParty

Home > Reference > Functions > Party > AddToParty

AddToParty(object, object)

PCを他のPCのパーティに加えます。

void AddToParty(
    object oPC,
    object oPartyLeader
);

Parameters

oPC

パーティに加えるプレイヤー

oPartyLeader

既にパーティにいるプレイヤー

Description

oPCをoPartyLeaderのパーティに加えます。この関数を適切に動作させるためには、oPCおよびoPartyLeaderは共に有効なPCでなければなりません。

Remarks

NPCを加入させるには、PCにAddHenchman関数を使用させて下さい。

Version

1.22

See Also

functions: | AddHenchman | RemoveFromParty
categories: | Party Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: Rainie


Function - AdjustAlignment

Home > Reference > Functions > Alignment > AdjustAlignment

AdjustAlignment(object, int, int)

クリーチャーのアライメントを調整します。

action AdjustAlignment(
    object oSubject,
    int nAlignment,
    int nShift
);

Parameters

oSubject

アライメントを調整する目標。

nAlignment

ALIGNMENT_*

nShift

アライメントを変化する量（-100から100の範囲の数値）

Description

oSubjectのアライメントを調整します。

ALIGNMENT_LAWFUL, ALIGNMENT_CHAOTIC, ALIGNMENT_GOOD, ALIGNMENT_EVIL：アライメントは指定した軸に変化します。

ALIGNMENT_ALL：nShiftをoSubjectのロー/カオスとグッド/エビルアライメント値に加えます。（つまり、両方を同じ量だけ加算・減算します）

ALIGNMENT_NEUTRAL：oSubjectのロー/カオスとグッド/エビルアライメント値は共にニュートラル方向へsShiftは適用されます。

Remarks

ALIGNMENT_NEUTRALの例：oSubjectがロー/カオス値が10（即ちカオティック）、グッド/エビル値が80（即ちグッド）の場合、nShiftが15であるならば、ロー/カオス値は（10+15）で25となり、グッド/エビル値は（80-15）で65になります。

また、アライメント値が50以上にも以下にならないように変化するでしょう。

AdjustAlignmentの対象のpcが属するパーティにいるPC達もまたアライメントに影響を受けます。行為の当人(oSubject)は、そのアライメントの変化を完全に受け取り、ターゲットのパーティメンバーは、アライメントに20%の変化を受けます（切り上げとなります）。。

アライメント調整はDMには作用しません。

Known Bugs

下記のコードの実行に関して：

AdjustAlignment(GetPCSpeaker(), ALIGNMENT_GOOD, 5); AdjustAlignment(GetPCSpeaker(), ALIGNMENT_LAW, 5);

...既にアライメントがローフルグッドであるPCに対しては、黄色のステータスメッセージで、PCのアライメントはカオティックに5ポイント変化、イビルに5ポイント変化しました、と表示されます。

Version

1.31

See Also

functions: | AdjustReputation | GetAlignmentGoodEvil | GetAlignmentLawChaos | GetReputation
categories: | Alignment Functions
constants: | ALIGNMENT_* Constants

author: Charles Feduke, additional contributor(s): Jemoney, Tom Cassiotis, Xachaffery Vermillion, Martin Jorgensen, JP team: geshi, Rainie


Function - AdjustFactionReputation

Home > Reference > Functions > Reputation/Faction > AdjustFactionReputation

AdjustFactionReputation(object, object, int)

別のファクションに対するファクションメンバー全ての関係を調整します。

void AdjustFactionReputation(
    object oTargetCreature,
    object oMemberOfSourceFaction,
    int nAdjustment
);

Parameters

oTargetCreature

対象となるファクションに含まれるクリーチャー。

oMemberOfSourceFaction

関係を変化させるファクションに含まれるメンバー（このファクションが変化します）。

nAdjustment

ファクション関係の変化量（正もしくは負）。

Description

別のあるファクションに対するファクションメンバー全ての関係を調整します。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | ClearAllFactionMembers
categories: | Reputation/Faction Functions

author: Tom Cassiotis, JP team: Redondo


Function - AdjustReputation

Home > Reference > Functions > Reputation/Faction > AdjustReputation

AdjustReputation(object, object, int)

ある人物に対してファクション全体の関係を調整します。

action AdjustReputation(
    object oTarget,
    object oSourceFactionMember,
    int nAdjustment
);

Parameters

oTarget

対象となるクリーチャー

oSourceFactionMember

関係を変化させるファクションに含まれるメンバー（このファクションが変化します）。

nAdjustment

ファクション関係の変化量（正もしくは負）。

Description

oSourceFactionMemberのファクションがoTargetに対してどのように感じているか、関係を調整します。

Remarks

これはファクション関係を調整します。oSourceFactionMemberを含むファクションがoTargetに対してどのように感じているかを調整します。

カスタム・ファクションと連携させてAdujustReputation関数を最大限に使う方法の一つは、孤立したエリアを作り、そこにカスタム・ファクションを保持しているクリーチャーを配置する方法です。

例として、”CLO”という名のカスタム・ファクションを作ります。ファクション用の孤立したエリアに、”CustomFactionHolderCLO”というタグを持つクリーチャーを作成し配置します。カスタム・ファクションを保持しているクリーチャーはそれぞれ孤立させておきます。プロット指定にはしません（意味がなくなります）。配置物を使わずにクリーチャーを使う理由はAdujustReputation関数は配置物に使えないからです。最後に、カスタム・ファクションをPCに敵対させたい場合は、以下のようにスクリプトを記述します：

AdjustReputation(PC,CustomFactionHolderCLO,-100);

スタンダード・ファクションに連携してAdujustReputation関数を使いたい場合も、スタンダード・ファクションを保持するクリーチャーを用意します。

Version

1.31

Example

// 攻撃者（oAttacker）に対する攻撃を受けた者（OBJECT_SELF）のファクションを-35する
main()
{
     object oAttacker = GetLastAttacker();
     if(GetIsObjectValid(oAttacker))
     {
          AdjustReputation(oAttacker, OBJECT_SELF, -35);
     }
}

See Also

functions: | AdjustAlignment | ClearAllFactionMembers | ClearPersonalReputation | GetAlignmentGoodEvil | GetAlignmentLawChaos | GetFactionAverageReputation | GetReputation | SetIsTemporaryEnemy | SurrenderToEnemies
categories: | Reputation/Faction Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Karen Modell, JP team: geshi, Redondo


Function - aGetPLocalInt

Home > Reference > Functions > Local Variables, Module, Party > aGetPLocalInt

aGetPLocalInt(object, string) :（パーティの整数型変数を調べ最大値を返す）

PCパーティメンバーに保存された変数の値を比較し、一番大きい値を返す。

int aGetPLocalInt(
    object oPC,
    string sLocalName
);

Parameters

oPC

PCパーティメンバーの１人。

sLocalName

PCに保存された変数の名称

Description

戻り値

整数

PCパーティのメンバーに保存された変数の値を比較し、一番大きい値を返す。

この関数はパーティ全員をひとつのものとして GetLocalInt() と同じように取り扱うことができる。PCパーティ全員の中で一番大きい値を返す。

Remarks

変数が保存されているオブジェクトとして各ＰＣを順に処理していくため、

パラメーターにオブジェクト指定はない。

マルチプレイヤー対応MODをさらに楽しくすることができそう。

報酬を吊り上げた額を比較するなんてことに使えるかも。

Requirements

#include "nw_j_assassin"

Version

1.28

See Also

functions: | aSetPLocalInt | GetLocalInt | GetPLocalInt | SetPLocalInt
categories: | Local Variables Functions | Module Functions | Party Functions

author: Michael Nork, editor: Charles Feduke, JP team: ngtaicho


Function - AmbientSoundChangeDay

Home > Reference > Functions > Area, Sound Effects > AmbientSoundChangeDay

AmbientSoundChangeDay(object, int)

エリアの日中背景音を変更します。

action AmbientSoundChangeDay(
    object oArea,
    int nTrack
);

Parameters

oArea

変更したいエリア

nTrack

使用する背景音サウンドトラック

Description

oAreaの日中の背景音をnTrackへ変更します。nTrackは背景音トラックで与えられる整数です。

Remarks

背景音サウンドトラックはambientmusic.2daの中で参照されますが、それらの整数は定数として公表されていません。そのファイルは/musicディレクトリの*.bmu files（これらは別の名前のただの.mp3ファイルなのですが）として表されています。

もしそれらが消されれば、背景音も止まるでしょう。

Version

1.22

Example

// A trigger's OnEvent script:
void main()
{
     object oArea = GetArea(OBJECT_SELF);
     MusicBackgroundStop(oArea); // Shut the music up
     AmbientSoundChangeDay(oArea, 46); // al_an_lzrdflk1
     AmbientSoundChangeNight(oArea, 46); // al_an_lzrdflk1
     AmbientSoundPlay(oArea); // In case it's off
     AmbientSoundSetDayVolume(oArea, 100); // In case it's too quiet
     AmbientSoundSetNightVolume(oArea, 100); // In case it's too quiet
     // Start the music up again.
     DelayCommand(30.0, MusicBackgroundPlay(oArea));
}

/* From the Prelude, AREA_M1Q0C_4:
AmbientSoundChangeDay(OBJECT_SELF,26);
AmbientSoundChangeNight(OBJECT_SELF,26);
MusicBackgroundStop(OBJECT_SELF); */

See Also

functions: | AmbientSoundChangeNight | AmbientSoundPlay | AmbientSoundSetDayVolume | AmbientSoundSetNightVolume | AmbientSoundStop | SoundObjectPlay
categories: | Area Functions | Sound Effects Functions

author: Iskander Merriman, editor: Dave Robinson, JP team: Redondo


Function - AmbientSoundChangeNight

Home > Reference > Functions > Area, Sound Effects > AmbientSoundChangeNight

AmbientSoundChangeNight(object, int)

エリアの夜間背景音を変更します。

void AmbientSoundChangeNight(
    object oArea,
    int nTrack
);

Parameters

oArea

変更したいエリア

nTrack

使用する背景音サウンドトラック

Description

oAreaの夜間の背景音をnTrackへ変更します。

Remarks

詳細はAmbientSoundChangeDayを見てください。

Known Bugs

BioWareが使う背景音の定数が公開されていません。

Version

1.22

Example

// See AmbientSoundChangeDay

See Also

functions: | AmbientSoundChangeDay | AmbientSoundPlay | AmbientSoundSetDayVolume | AmbientSoundSetNightVolume | AmbientSoundStop
categories: | Area Functions | Sound Effects Functions

author: Iskander Merriman, JP team: Redondo


Function - AmbientSoundPlay

Home > Reference > Functions > Area, Sound Effects > AmbientSoundPlay

AmbientSoundPlay(object)

エリアの背景音トラックをスタートします。

void AmbientSoundPlay(
    object oArea
);

Parameters

oArea

背景音トラックをスタートするエリア

Description

oAreaの背景音を再生します。

Remarks

例はAmbientSoundChangeDayを見てください。

Version

1.22

See Also

functions: | AmbientSoundChangeDay | AmbientSoundChangeNight | AmbientSoundSetDayVolume | AmbientSoundSetNightVolume | AmbientSoundStop
categories: | Area Functions | Sound Effects Functions

author: Iskander Merriman, JP team: Redondo


Function - AmbientSoundSetDayVolume

Home > Reference > Functions > Area, Sound Effects > AmbientSoundSetDayVolume

AmbientSoundSetDayVolume(object, int)

エリアの日中背景音の音量を変更します。

void AmbientSoundSetDayVolume(
    object oArea,
    int nVolume
);

Parameters

oArea

変更するエリア

nVolume

0 - 100

Description

oAreaの日中背景音のボリュームを設定します。

Remarks

例はAmbientSoundChangeDayを見てください。

Note: これはクライアントオプションの音響スライダーは変更しません。これはサーバ側の音量に関係し、それ自身はクライアント音量設定の影響を受けます。

Version

1.22

Example

// 例はAmbientSoundChangeDayを見てください。

See Also

functions: | AmbientSoundChangeDay | AmbientSoundChangeNight | AmbientSoundPlay | AmbientSoundSetNightVolume | AmbientSoundStop
categories: | Area Functions | Sound Effects Functions

author: Iskander Merriman, JP team: Redondo


Function - AmbientSoundSetNightVolume

Home > Reference > Functions > Area, Sound Effects > AmbientSoundSetNightVolume

AmbientSoundSetNightVolume(object, int)

エリアの夜間背景音の音量を変更します。

void AmbientSoundSetNightVolume(
    object oArea,
    int nVolume
);

Parameters

oArea

変更するエリア

nVolume

0 - 100

Description

oAreaの夜間背景音のボリュームを設定します。

Remarks

例はAmbientSoundChangeDayを見てください。

Note: これはクライアントオプションの音響スライダーは変更しません。これはサーバ側の音量に関係し、それ自身はクライアント音量設定の影響を受けます。

Version

1.22

See Also

functions: | AmbientSoundChangeDay | AmbientSoundChangeNight | AmbientSoundPlay | AmbientSoundSetDayVolume | AmbientSoundStop
categories: | Area Functions | Sound Effects Functions

author: Iskander Merriman, JP team: Redondo


Function - AmbientSoundStop

Home > Reference > Functions > Area, Sound Effects > AmbientSoundStop

AmbientSoundStop(object)

エリアの背景音をストップします。

void AmbientSoundStop(
    object oArea
);

Parameters

oArea

背景音をストップするエリア

Description

oAreaの背景音を停止します。

Remarks

背景音が唐突に止まることはありません、短時間ですが自動的にフェイドが追加されて停止します。

Version

1.22

See Also

functions: | AmbientSoundChangeDay | AmbientSoundChangeNight | AmbientSoundPlay | AmbientSoundSetDayVolume | AmbientSoundSetNightVolume
categories: | Area Functions | Sound Effects Functions

author: Iskander Merriman, JP team: Redondo


Function - AngleToVector

Home > Reference > Functions > Type Casting/Conversion > AngleToVector

AngleToVector(float)

角度をベクトルに変換する。

vector AngleToVector(
    float fAngle
);

Parameters

fAngle

ベクトルに変換する角度

Description

fAngleの値をベクトルに変換して返す。

Version

1.30

Example

// ストーカースクリプト(NPCのOnHeartbeatスクリプト)
// 提供：Cheiron氏
void main()
{
     object oTarget = GetNearestCreature(
          CREATURE_TYPE_PLAYER_CHAR,
          PLAYER_CHAR_IS_PC
     );

     ClearAllActions();
     object oArea = GetArea(oTarget);
     vector vPosition = GetPosition(oTarget);

      float fOrientation = GetFacing(oTarget);
     // AngleToVectorの能力の発揮しどころ。
     vector vNewPos = AngleToVector(fOrientation);
     float vX = vPosition.x - vNewPos.x;
     float vY = vPosition.y - vNewPos.y;
     float vZ = vPosition.z;

     vNewPos = Vector(vX, vY, vZ);

     ActionMoveToLocation(
          Location(oArea, vNewPos, fOrientation)
     ); // PCについていく (PCがそこにいるなら)
     ActionDoCommand(SetFacing(fOrientation)); // PCに向く
}

See Also

functions: | Vector | VectorToAngle
categories: | Type Casting/Conversion Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Cheiron, Lilac Soul, JP team: geshi, ngtaicho


Function - ApplyEffectAtLocation

Home > Reference > Functions > Effects, Lighting Effects, Visual Effects > ApplyEffectAtLocation

ApplyEffectAtLocation(int, effect, location, float)

locationにeffectを適用します。

action ApplyEffectAtLocation(
    int nDurationType,
    effect eEffect,
    location lLocation,
    float fDuration = 0.0f
);

Parameters

nDurationType

DURATION_TYPE_*

eEffect

適用したいeffect

lLocation

effectを適用したいlocation

fDuration

effectの持続時間（秒）（ディフォルト： 0.0f）

Description

ApplyEffectAtLocationはlocationにeffectを適用し、EffectVisualEffectとEffectAreaOfEffectを用いるために最も良く使用されます。

nDurationTypeは、使用するeffectに依存します；effectによっては使えないduration typeがあるので、詳しくは個々のeffectのリファレンスを参照してください。

もしnDurationTypeがDURATION_TYPE_INSTANTまたはDURATION_TYPE_PERMANENTであるならば、最後のパラメータ（fDuration）は無視されます。

Remarks

殆どのeffectはobjectに影響するので、locationで使われることは多くありません。この機能はvisualとareaのeffectを用いるのに使われます。たとえば、その場に唱える対象がいない魔法のvisual effectを用いるのに使用します。

Known Bugs

この機能のタイミングはdarkness constant（曖昧な定数？）の為、無効です。それを1秒または20秒にセットしても、effectは同じ時間行われてしまいます。しかし、ApplyEffectToObjectを使うならば、タイミングは正常に働きます。

Version

1.26

Example

// トリガーのOnEnterに入れる。
// ＰＣの位置に10秒間ダークネスの効果を与えます。
void main() {
  location lPC = GetLocation(GetEnteringPC());
  effect eEffect = EffectVisualEffect(VFX_DUR_DARKNESS);
  ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eEffect, lPC, 10.0);
}

See Also

functions: | ApplyEffectToObject | EffectACDecrease | EffectAppear | EffectAreaOfEffect | EffectSpellResistanceIncrease | EffectStunned | EffectSummonCreature | EffectVisualEffect | ExtraordinaryEffect | MagicalEffect
categories: | Effects Functions | Lighting Effects Functions | Visual Effects Functions
constants: | DURATION_TYPE_* Constants

author: Iskander Merriman, editor: Charles Feduke, additional contributor(s): Karen Modell, JP team: akito


Function - ApplyEffectToObject

Home > Reference > Functions > Effects, Spell Casting Effects, Visual Effects > ApplyEffectToObject

ApplyEffectToObject(int, effect, object, float)

effect（visualまたはactual）をobjectに適用します。

void ApplyEffectToObject(
    int nDurationType,
    effect eEffect,
    object oTarget,
    float fDuration = 0.0f
);

Parameters

nDurationType

DURATION_TYPE_*

eEffect

適用するeffect

oTarget

effectの目標

fDuration

一時的なeffectの持続時間（ディフォルト：0.0f）

Description

objectにeffectを適用します。effectには単なる視覚効果（EffectVisualEffect）、有益な効果（EffectHeal）、広い範囲に影響する効果（EffectAreaOfEffect）、致命的な効果（EffectDeath）、そして、それらの中間的なものと、多くの種類が存在します。

それらが適用できる前にeffectは組みたてられる必要があり、有効なnDurationTypeは組みたてたeffectに依存します。詳しくは適用したいeffectの個々のファンクションを参照してください。

effectには『Extraordinary（特殊）』、『Magical（魔法）』または『Supernatura（超自然）』の副属性を持たせることもできます。よって、『Extraordinary』でeffectを適用すると、魔法によってディスペルされなくなるでしょう。

Remarks

このコマンドが適用されるobjectは使用可能である必要があります。ApplyEffectAtLocationとGetLocationを使ってどんなに避けようとしても、使用可能objectでなければなりません。

Version

1.26

Example

// カンバセーションのActions Takenで使用。
// このＰＣは危うく命を落とすような失言をしました。
void main() {
  object oPC = GetPCSpeaker();
  int iHealth = GetCurrentHitPoints(oPC) -1;
  Effect eOuch = ExtraordinaryEffect(EffectDamage(iHealth, DAMAGE_TYPE_DIVINE));
  ApplyEffectToObject(DURATION_TYPE_INSTANT, eOuch, oPC);
}

See Also

functions: | ApplyEffectAtLocation | EffectAbilityDecrease | EffectAbilityIncrease | EffectACDecrease | EffectACIncrease | EffectAppear | EffectSpellResistanceIncrease | EffectStunned | EffectSummonCreature | EffectSwarm | EffectTrueSeeing | ExtraordinaryEffect | MagicalEffect | SupernaturalEffect | VersusAlignmentEffect
categories: | Effects Functions | Spell Casting Effects Functions | Visual Effects Functions
constants: | DURATION_TYPE_* Constants
events: | OnAcquireItem Event | OnActivateItem Event | OnSpellCastAt Event

author: Iskander Merriman, editor: Charles Feduke, additional contributor(s): Adrian Bates, JP team:akito


Function - ApplyPenalty

Home > Reference > Functions > PC Only > ApplyPenalty

ApplyPenalty(object)

PCの蘇生の際にペナルティを適用します。

void ApplyPenalty(
    object oDead
);

Parameters

oDead

蘇生するPC

Description

プレイヤーの蘇生の際にXPとGPにペナルティを適用します。

Requirements

#include "nw_o0_respawn"

Version

1.22

Example

// この関数のversion1.22用ソース
void ApplyPenalty(object oDead)
{
    int nXP = GetXP(oDead);
    int nPenalty = 50 * GetHitDice(oDead);
    int nHD = GetHitDice(oDead);
    // * 蘇生でレベルを失うことはない
    int nMin = ((nHD * (nHD - 1)) / 2) * 1000;

    int nNewXP = nXP - nPenalty;
    if (nNewXP < nMin)
       nNewXP = nMin;
    SetXP(oDead, nNewXP);
    int nGoldToTake =    FloatToInt(0.10 * GetGold(oDead));
    // * 上限10000gpを奪う
    if (nGoldToTake > 10000)
    {
        nGoldToTake = 10000;
    }
    AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
    DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
    DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));

}

See Also

categories: PC Only Functions

author: Tom Cassiotis, JP team: Rainie


Function - ApplyPrismaticEffect

Home > Reference > Functions > Sound Effects > ApplyPrismaticEffect

ApplyPrismaticEffect(int, object)

クリーチャーにプリズマ効果を与えます。

int ApplyPrismaticEffect(
    int nEffect,
    object oTarget
);

Parameters

nEffect

与えるエフェクト（詳細はdescriptionを見てください）

oTarget

効果を受けるオブジェクト、クリーチャー

Description

適当なセービングスローを伴ってoTargetへプリズマ効果（nEffect）を与えます。

nEffect:
1 - Fire
2 - Acid
3 - Electricity
4 - Poison
5 - Paralyze
6 - Confusion
7 - Death

Remarks

プリズマスプレー呪文を実行するためのサポート関数として使用してください。

Requirements

#include "nw_s0_prisspray"

Version

1.22

See Also

categories: Sound Effects Functions

author: Tom Cassiotis, JP team: Redondo


Function - aSetPLocalInt

Home > Reference > Functions > Local Variables, Module, Party > aSetPLocalInt

aSetPLocalInt(object, string, int)

パーティ全員のローカル変数をセットする。

void aSetPLocalInt(
    object oPC,
    string sLocalName,
    int nValue
);

Parameters

oPC

ＰＣパーティの誰か

sLocalName

保存する変数の名称

nValue

保存する整数値

Description

この関数はＰＣパーティ全員のローカル変数に整数値を設定、保存する。事実上パーティ全体にSetLocalInt （オブジェクト、整数、文字列）を行っている。

Remarks

クエストのフラグセットなどに有効だと思う。

Requirements

#include "nw_j_assassin"

Version

1.28

See Also

functions: | aGetPLocalInt | GetPLocalInt | SetPLocalInt
categories: | Local Variables Functions | Module Functions | Party Functions

author: Michael Nork, editor: Charles Feduke, JP team: ngtaicho


Function - asin

Home > Reference > Functions > Math > asin

asin(float)

アークサイン計算し結果を返す。

float asin(
    float fValue
);

Parameters

fValue

サイン値を意味する浮動小数値。値の範囲は -1.0 ～ 1.0

Description

アークサインを計算し結果を度で返す（ラジアンではない）

返す値は -90 から 90

fValueが-1.0 ～ 1.0にない場合は0を返す

Remarks

サインの逆関数

Version

1.31

See Also

functions: | acos | atan | cos | sin | tan
categories: | Math Functions

author: Charles Feduke, additional contributor(s): Paul Catalano, JP team: geshi, ngtaicho


Function - AssignAOEDebugString

Home > Reference > Functions > Debug > AssignAOEDebugString

AssignAOEDebugString(string)

範囲エフェクト呪文の使用者に喋らせる。

void AssignAOEDebugString(
    string sString
);

Parameters

sString

AoE使用者に喋らせる文字列

Description

範囲エフェクトの使用者にデバッグ文字列を喋らせる。

Remarks

nw_i0_spells.nssの37行目にあります。

Requirements

#include "nw_i0_spells"

Version

1.22

See Also

categories: Debug Functions

author: Tom Cassiotis, editor: Dave Robinson, JP team: Rainie


Function - AssignCommand

Home > Reference > Functions > Action on Object > AssignCommand

AssignCommand(object, action)

クリーチャーにアクションコマンドをするよう命じます。

void AssignCommand(
    object oActionSubject,
    action aActionToAssign
);

Parameters

oActionSubject

アクションを行う対象。

aActionToAssign

行うアクション。

Description

aActionToAssignをoActionSubjectのアクションキューに追加します。
返り値はありませんが、エラーが起きた場合は、ログファイルに"AssignCommand failed."と書き出されます。オブジェクトが存在しない場合は、何も起こりません。

aActionToAssignは、ClearAllActions()関数のようなvoid型の関数である必要があります。

Remarks

AssignCommand関数を使うときによくある間違いは、OBJECT_SELFを使う場合でしょう。OBJECT_SELF は定数なので、"this"ポインタではなく NULL ポインタとなります。OBJECT_SELFをAssignCommand関数や似たような関数で使うと、クリーチャーは自分自身に対して命令しようとしますので、大抵は意図した結果にはならないでしょう。

Version

1.29

See Also

functions: | ActionDoCommand | ActionWait | ClearAllActions | SetCommandable
categories: | Action on Object Functions

author: Charles Feduke, editor: Jeremy Spilinek, additional contributor(s): Edward Wilson, JP team: katsu794


Function - AssignPCDebugString

Home > Reference > Functions > Debug > AssignPCDebugString

AssignPCDebugString(string)

一番近くのPCに文字列を喋らせます。

void AssignPCDebugString(
    string sString
);

Parameters

sString

喋らせるデバッグ文字列

Description

一番近くのPCに文字列を喋らせます。

Remarks

// この関数のv1.30用ソース
void AssignPCDebugString(string sString)
{
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
AssignCommand(oPC, SpeakString(sString));
}

Requirements

#include "nw_i0_2q4luskan"

Version

1.30

See Also

categories: Debug Functions

author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, Rainie


Function - AssociateCheck

Home > Reference > Functions > Combat, Core AI > AssociateCheck

AssociateCheck(object)

objectがヘンチマン（PCの傭兵）かそうでないかを調べます。

int AssociateCheck(
    object oCheck
);

Parameters

oCheck

ヘンチマンかどうかの状態を調べたいobject

Description

これはエリア内の友好的なクリーチャーの数決定の一部として使用される一般的なAIスクリプトの関数です。

Remarks

下記に示すプログラムのように、AssociateCheckはオブジェクト比較を備えたGetAssociate()を含みます。

Requirements

#include "nw_i0_generic"

Version

1.22

Example

// これはnw_i0_generic内のAssociateCheckプログラムである
int AssociateCheck(object oCheck)
{
    object oHench = GetAssociate (ASSOCIATE_TYPE_HENCHMAN);
    if(oCheck != oHench)
    {
        return TRUE;
    }
    return FALSE;
}

See Also

functions: | CheckFriendlyFireOnTarget | GetAssociate
categories: | Combat Functions | Core AI Functions

author: Iskander Merriman, editor: Dave Robinson, JP team: Rainie


Function - atan

Home > Reference > Functions > Math > atan

atan(float)

アークタンジェント計算し結果を返す。

float atan(
    float fValue
);

Parameters

fValue

タンジェント値を意味する浮動小数値。

Description

アークタンジェントを計算し結果を度で返す（ラジアンではない）

返す値は-90.0 から 90.0

Remarks

タンジェントの逆関数

Version

1.31

See Also

functions: | acos | asin | cos | sin | tan
categories: | Math Functions

author: Charles Feduke, additional contributor(s): Paul Catalano, JP team: geshi, ngtaicho


Function - AutoAlignE

Home > Reference > Functions > Alignment > AutoAlignE

AutoAlignE(int, object)

objectのアライメントを示された値だけ相対的にイビル方向に変化させます。

void AutoAlignE(
    int nDC,
    object oTarget
);

Parameters

nDC

動作の難易度を示す相対的な値。（DC_EASY, DC_MEDIUM, DC_HARD）

oTarget

アライメントを変更するクリーチャー

Description

objectのアライメントを示された値だけ相対的にイビル方向に変化させます。

Remarks

これはAdjustAlignment()を含みます。

DC_EASYは3ポイント変化

DC_MEDIUMは7ポイント変化

DC_HARDは10ポイント変化

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Alignment Functions

author: Tom Cassiotis, editor: Dave Robinson, JP team: Rainie


Function - AutoAlignG

Home > Reference > Functions > Alignment > AutoAlignG

AutoAlignG(int, object)

objectのアライメントを示された値だけ相対的にグッド方向に変化させます。

void AutoAlignG(
    int nDC,
    object oTarget
);

Parameters

nDC

動作の難易度を示す相対的な値。（DC_EASY, DC_MEDIUM, DC_HARD）

oTarget

アライメントを変更するクリーチャー

Description

objectのアライメントを示された値だけ相対的にイビル方向に変化させます。

Remarks

これはAdjustAlignment()を含みます。

DC_EASYは3ポイント変化

DC_MEDIUMは7ポイント変化

DC_HARDは10ポイント変化

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Alignment Functions

author: Tom Cassiotis, JP team: Rainie


Function - AutoDC

Home > Reference > Functions > Talents/Skills/Feats > AutoDC

AutoDC(int, int, object)

Determines whether a skill check succeeds.

int AutoDC(
    int nDC,
    int nSkill,
    object oTarget
);

Parameters

nDC

Value to indicate the relative difficulty of the check. (DC_EASY, DC_MEDIUM, DC_HARD)

nSkill

SKILL_*

oTarget

The creature rolling to determine success.

Description

Returns TRUE if oTarget succeeds a check based on nSkill for a crude difficulty category DC.

Remarks

As of patch 1.30, this function will work on non-creatures as well. It uses the hitdice of the caller in a division, but if that hitdice is 0 (as for non-creature), it just divides by 1 instead. Due to the bug noted below, you may be better of using the new GetIsSkillSuccessful function.

Known Bugs

This function, the way it looks in patch 1.30 at least, is quite poorly constructed. It rolls a d20, adds that to the skill rank, and tests that against a number which is nTest+10. Thus, the higher the DC of the AutoDC, the higher nTest should be.

nTest is calculated using a switch statement using the DC, the logic of which is flawed. Easy and medium should work just fine, but then it goes wrong, as the nTest value for hard will always be 7 times higher than superior, 14 times higher than master, and 21 times higher than legendary. Thus, hard is the toughest one of all to beat, and apart from easy and medium, legendary is easiest.

I have contacted Bioware about this, and hopefully it will be fixed in an upcoming patch.

Requirements

#include "nw_i0_plot"

Version

1.30

See Also

functions: | GetIsSkillSuccessful
categories: | Talents/Skills/Feats Functions
constants: | SKILL_* Constants

author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Lilac Soul


Function - BashDoorCheck

Home > Reference > Functions > Combat, Core AI > BashDoorCheck

BashDoorCheck(object)

ヘンチマンが扉を殴り続けさせる為にDetermineCombatRoundの中で使われます。

int BashDoorCheck(
    object oIntruder = OBJECT_INVALID
);

Parameters

oIntruder

(デフォルト: OBJECT_INVALID)

Description

もしそのエリアに敵対者がいなければ、ヘンチマンがドアを殴り続けさせておくために、このチェックはDetermineCombatRound()の中でなされます。

Remarks

もし独自のカスタムAIのためにDetermineCombatRoundを書き直していなければ、恐らくこの関数を必要としません。

Requirements

#include "nw_i0_generic"

Version

1.22

Example

// nw_i0_genericのヘッダより:
/*
    ********************************************
    WARNING THIS SCRIPT IS CHANGED AT YOUR PERIL
    ********************************************

    This is the master generic script and currently
    handles all combat and some plot behavior
    within NWN. If this script is tampered
    with there is a chance of introducing game
    breaking bugs.  But other than that enjoy.
*/
// If you're confident that using or modifying BashDoorCheck
// is the right thing to do, you don't need sample code.

See Also

functions: | DetermineCombatRound
categories: | Combat Functions | Core AI Functions

author: Iskander Merriman, editor: Tom Cassiotis, JP team: Rainie


Function - BeginConversation

Home > Reference > Functions > Action on Object, Conversation > BeginConversation

BeginConversation(string, object)

conversationを即座に開始しようと試みる

int BeginConversation(
    string sResRef = "",
    object oObjectToDialog = OBJECT_INVALID
);

Parameters

sResRef

これが指定されない場合、デフォルトの対話ファイルが使用される（デフォルト：""）

oObjectToDialog

これが指定されない場合、イベントトリガーを引き起こした人が使用される（デフォルト：OBJECT_INVALID）

Description

この機能はOnDialogの（論理的）終了において希望のconversationを開始させる為に通常使用される。

しかしActionStartConversationはより適切かもしれない。

もしsResRefが無指定の場合、このコマンドを実行するobjectのプロパティを参照する。

conversationプロパティがあるならば、そのconversationが使用される。

デフォルトでは、この機能は第2のパラメーターであるイベントを含むトリガーオブジェクトを使用する。

Remarks

実行オブジェクトもしくはoOnjectToDialogのいずれかはPCであるに違いないだろう。

Version

1.22

Example

// NPCのonConversationの中のこのスクリプトは、 NPCが見つけたエリアに
// 依存する異なるconversationファイルを選択する
void main() {
  // エリア名を取得する
  string sAreaName = GetTag(GetArea(OBJECT_SELF));
  // conversation ResRefのための変数を宣言する
  string sConversation;
  // エリアによる正しいconversationを割り当てる
  if ("isk_a_rangersrest" ==  sAreaName)
    sConversation = "rangers_potboy";
  else if ("isk_a_goldengoblin" ==  sAreaName)
    sConversation = "ggoblin_thief";
  else if ("isk_a_sewer1" ==  sAreaName)
    sConversation = "assassin_servant";

  // 適切なconversationを開始する
  BeginConversation(sConversation);
}

See Also

functions: | ActionStartConversation
categories: | Action on Object Functions | Conversation Functions
events: | OnConversation Event

author: Iskander Merriman, editor: Jeremy Spilinek、JP team: Rainie


Function - BlackScreen

Home > Reference > Functions > Cut-Scene > BlackScreen

BlackScreen(object)

画面を暗転させます。

void BlackScreen(
    object oCreature
);

Parameters

oCreature

暗転画像を見せる、プレイヤーによって操作されているクリーチャー

Description

画面を真っ黒に設定します。これはフェード・インのエフェクト(FadeFromBlack関数)に備えて使用することができ、FadeFromBlackを呼ぶかStopFadeを呼ぶことにより取り除くことができます。

Remarks

画面を直接真っ黒にします。スクリーンを徐々に黒くさせたい場合は、FadeToBlackを代わりに使ってください。

oCreatureで指定した対象が使い魔に憑依している場合、憑依中のプレイヤーの画面を黒く出来るかどうかはわかりません。

Version

1.30

Example

// 箱を開けたクリーチャーの世界を真っ暗にし
// 10秒後だんだん明るくなり、その後
// 箱のOnOpenを発動する。

void main()
{
object oPC=GetLastOpenedBy();

BlackScreen(oPC);

DelayCommand(10.0, FadeFromBlack(oPC));

// 適用された暗い画面をさっさと取り除きたい場合は
// 代わりにこの行を使ってもいい。
DelayCommand(10.0, StopFade(oPC));
}

See Also

functions: | FadeFromBlack | FadeToBlack | StopFade
categories: | Cut-Scene Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - BootPC

Home > Reference > Functions > Miscellaneous, PC Only, Server > BootPC

BootPC(object)

マルチプレイヤーサーバーからプレイヤーを強制的に追い出します。

void BootPC(
    object oPlayer
);

Parameters

oPlayer

蹴り出すプレイヤーのPC object

Description

BootPCに対して以下のように告げます－サーバー側から強制退去させられました。

PCはセーブすることができません。

Remarks

PCが即座に再接続した場合、退去した地点から始まるでしょう。

BootPC()はシングルプレイヤーモードでは動作しません。

Version

1.22

Example

// OnEnterに悩ます為に作ったトリガー:
void main() {
  BootPC(GetEnteringObject());
}

See Also

functions: | GetPCPublicCDKey
categories: | Miscellaneous Functions | PC Only Functions | Server Functions

author: Iskander Merriman, editor: Jeremy Spilinek, JP team: Rainie


Function - BringBack

Home > Reference > Functions > Module Specific > BringBack

BringBack()

NPCを生き返らせてロケーションに送ります。

void BringBack();

Description

NPCを生き返らせてロケーションに送ります。

Remarks

死んでいるヘンチマンを生き返らすための補助関数です。

この関数は一般的なスクリプト作成では使用すべきではありません。

Requirements

#include "nw_ch_ac7"

Version

1.22

Example

// バージョン1.24におけるこの関数のソース
void BringBack()
{
    SetLocalObject(OBJECT_SELF,"NW_L_FORMERMASTER", GetMaster());
    // : REMINDER: The delay is here for a reason
    DelayCommand(0.1, RemoveEffects(OBJECT_SELF));
    DelayCommand(0.2, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectResurrection(), OBJECT_SELF));
    DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectHeal(GetMaxHitPoints(OBJECT_SELF)), OBJECT_SELF));
    DelayCommand(5.1, SetIsDestroyable(TRUE, TRUE, TRUE));
    object oWay = GetObjectByTag("NW_DEATH_TEMPLE");
    if (GetIsObjectValid(oWay) == TRUE)
    {
        // * ソース・ストーン・エリアであれば、エリアの入口に生き返ります。
        if (GetTag(GetArea(OBJECT_SELF)) == "M4Q1D2")
        {
            DelayCommand(0.2, JumpToObject(GetObjectByTag("M4QD07_ENTER"), FALSE));
        }
        else
            DelayCommand(0.2, JumpToObject(oWay, FALSE));
    }
    else
        DelayCommand(0.3, ActionSpeakString("UT: No place to go"));

}

See Also

categories: Module Specific Functions

author: Tom Cassiotis, editor: Dave Robinson, JP team: katsu794


Function - CanAfford

Home > Reference > Functions > Module Specific > CanAfford

CanAfford(object)

プレイヤーが鍛冶屋においてアイテムを作成するための十分なゴールドを、インベントリーの中に持っているかどうかを決定します。

int CanAfford(
    object oBuyer
);

Parameters

oBuyer

アイテム作成を望んでいるプレイヤー。

Description

プレイヤーがアイテムを買う余裕がある場合、Trueを返します。

Remarks

nw_o0_itemmaker.nssの274行目にあります。

公式キャンペーンにおいて、鍛冶屋のアイテム作成に対する支払いができるかどうかを確認するために使用されます。

oBuyerがオブジェクトを購入するための十分なゴールドを持っているかどうかを調べるために、HasGold関数を呼び出します。

GetValidItemCost()を呼び出すこによってオブジェクトの値段を調べます。GetValidItemCost()は、オブジェクトの価値を決定するためにOBJECT_SELFのローカル整数"M3Q1_VALIDITEMCOST"を調べます。

この関数は、オブジェクト上で実行するスクリプトから呼ばれる必要があるでしょう。

Requirements

#include "NW_O0_ITEMMAKER"

Version

1.22

See Also

categories: Module Specific Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Ivan Hawkes, JP team: katsu794


Function - CanAffordIt

Home > Reference > Functions > Module Specific > CanAffordIt

CanAffordIt()

この関数は、プレイヤーがポータルを使用するだけのお金を持っているかどうかを調べます。

int CanAffordIt();

Description

この関数は、公式キャンペーンにおいてPCがポータルを使用するだけのお金を持っているかどうかを決定するために使用されます。

この関数は、PCから必要な量のゴールドも取り去ります。この関数は、nw_all_feedback5.nssにあります。

Remarks

公式spキャンペーンで使用されます。

Requirements

#include "nw_all_feedback5"

Version

1.22

See Also

categories: Module Specific Functions

author: Michael Nork, JP team: katsu794


Function - CanSeePlayer

Home > Reference > Functions > Perception > CanSeePlayer

CanSeePlayer()

クリーチャーがPCを目視できるかどうかを調べる。

int CanSeePlayer();

Description

OBJECT_SELFがPCを目視できているならばTRUEを、そうでなければFALSEを返します。

Remarks

この関数はGetNearestCreature()関数の簡易版で、手軽且つプログラムをよりすっきりと書くことができるでしょう。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Perception Functions

author: Tom Cassiotis, JP team: Rainie


Function - ChangeFaction

Home > Reference > Functions > Reputation/Faction > ChangeFaction

ChangeFaction(object, object)

クリーチャーのファクションを別のものに変更します。

action ChangeFaction(
    object oObjectToChangeFaction,
    object oMemberOfFactionToJoin
);

Parameters

oObjectToChangeFaction

ファクションを変更するクリーチャー

oMemberOfFactionToJoin

合流されるファクションのクリーチャー

Description

oObjectToChangeFactionをoMemberOfFactionToJoinのファクションへ合流させます。

Remarks

配置可能オブジェクトはファクションを与えられるが、それらはoMemberOfFactionToJoinとなることはありません。

Version

1.22

Example

// カンバセーションの“テキスト後の処理”で使用します。
// PCがNPCを説得して修道院のファクションへ合流させるとき。
void main() {
  object oNun = GetNearestObjectByTag("sisterOfPerpetualIndulgence");
  ChangeFaction(OBJECT_SELF, oNun);
}

See Also

functions: | ChangeToStandardFaction
categories: | Reputation/Faction Functions

author: Iskander Merriman, editor: Charles Feduke, JP team: Redondo


Function - ChangeToStandardFaction

Home > Reference > Functions > Reputation/Faction > ChangeToStandardFaction

ChangeToStandardFaction(object, int)

クリーチャーのファクションを4つの標準ファクションの中のひとつへ変更します。

void ChangeToStandardFaction(
    object oCreatureToChange,
    int nStandardFaction
);

Parameters

oCreatureToChange

ファクションを変更するクリーチャー

nStandardFaction

STANDARD_FACTION_*

Description

oCreatureToChangeを標準ファクション（敵対、コモナー、商人、護衛）の中のひとつへ変更させます。

Remarks

現在のところ、この関数を非標準ファクションへ適応する方法はありません。かわりにChangeFactionを使用します。

Version

1.22

Example

// NPCの最後のカンバセーションの“テキスト後の処理”で使用します
void main() {
  ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_HOSTILE);
  DetermineCombatRound();
}

See Also

functions: | ChangeFaction
categories: | Reputation/Faction Functions
constants: | STANDARD_FACTION_* Constants

author: Iskander Merriman, editor: Charles Feduke, JP team: Redondo


Function - CheckCharismaHigh

Home > Reference > Functions > Get Data from Creature > CheckCharismaHigh

CheckCharismaHigh()

話しているプレイヤーの魅力の値が15以上どうか判定します。

int CheckCharismaHigh();

Description

会話中のプレイヤーキャラクターの魅力の値が15以上ならばTRUEを返します。

Remarks

この関数はnw_i0_plot.nssの675行目にあります。

この関数は常にGetPCSpeaker()で魅力の値を判定するために使われます。なので会話のないところで使用するとFALSEを返します。

これはプレイヤーにどれくらい魅力があるかによって異なった会話の内容を選択するためにBioWareが使用しました。

Requirements

#include "nw_i0_plot"

Version

1.22

Example

//Add as a starting conditional on a conversation thread for a tavern flirt who will
//hit on anyone with a high enough charisma.

#include "NW_I0_PLOT"

int StartingConditional()
{
    int bGoodLooker = CheckCharismaHigh();
    return bGoodLooker;
}

See Also

functions: | CheckCharismaLow | CheckCharismaMiddle | CheckCharismaNormal | CheckIntelligenceHigh | CheckIntelligenceLow | CheckIntelligenceNormal | CheckWisdomHigh
categories: | Get Data from Creature Functions

author: John Shuell, JP team: marshall


Function - CheckCharismaLow

Home > Reference > Functions > Get Data from Creature > CheckCharismaLow

CheckCharismaLow()

話しているプレイヤーの魅力の値が10未満かどうか判定します。

int CheckCharismaLow();

Description

会話中のプレイヤーキャラクターの魅力の値が10未満ならTRUEを返します。

Remarks

この関数はnw_i0_plot.nssの658行目にあります。

この関数は常にGetPCSpeaker()で魅力の値を判定するために使われます。なので会話のないところで使用するとFALSEを返します。

これはプレイヤーにどれくらい魅力があるかによって異なった会話の内容を選択するためにBioWareが使用しました。

Requirements

#include "nw_i0_plot"

Version

1.26

Example

//Add as a starting conditional on a conversation thread for a negative NPC reaction

#include "NW_I0_PLOT"

int StartingConditional()
{
    int bUglyLooker = CheckCharismaLow();
    return bUglyLooker;
}

See Also

functions: | CheckCharismaHigh | CheckCharismaMiddle | CheckCharismaNormal | CheckIntelligenceHigh | CheckIntelligenceLow | CheckIntelligenceNormal | CheckWisdomHigh
categories: | Get Data from Creature Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Michael Schirf, JP team: marshall


Function - CheckCharismaMiddle

Home > Reference > Functions > Get Data from Creature > CheckCharismaMiddle

CheckCharismaMiddle()

話しているプレイヤーの魅力の値が通常の範囲かどうか判定します。

int CheckCharismaMiddle();

Description

会話中のプレイヤーキャラクターの魅力の値が10～14の範囲ならばTRUEを返します。

Remarks

この関数はnw_i0_plot.nssの622行目にあります。

この関数は常にGetPCSpeaker()で魅力の値を判定するために使われます。なので会話のないところで使用するとFALSEを返します。

これはプレイヤーにどれくらい魅力があるかによって異なった会話の内容を選択するためにBioWareが使用しました。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | CheckCharismaHigh | CheckCharismaLow | CheckCharismaNormal | CheckIntelligenceHigh | CheckIntelligenceLow | CheckIntelligenceNormal | CheckWisdomHigh
categories: | Get Data from Creature Functions

author: John Shuell, JP team: marshall


Function - CheckCharismaNormal

Home > Reference > Functions > Get Data from Creature > CheckCharismaNormal

CheckCharismaNormal()

話しているプレイヤーの魅力の値が10以上どうか判定します。

int CheckCharismaNormal();

Description

会話中のプレイヤーキャラクターの魅力の値が10以上ならばTRUEを返します。

Remarks

この関数はnw_i0_plot.nssの640行目にあります。

この関数は常にGetPCSpeaker()で魅力の値を判定するために使われます。なので会話のないところで使用するとFALSEを返します。

これはプレイヤーにどれくらい魅力があるかによって異なった会話の内容を選択するためにBioWareが使用しました。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | CheckCharismaHigh | CheckCharismaLow | CheckCharismaMiddle | CheckIntelligenceHigh | CheckIntelligenceLow | CheckIntelligenceNormal | CheckWisdomHigh
categories: | Get Data from Creature Functions

author: John Shuell, JP team: marshall


Function - CheckEnemyGroupingOnTarget

Home > Reference > Functions > Combat, Core AI > CheckEnemyGroupingOnTarget

CheckEnemyGroupingOnTarget(object, float)

ターゲット周辺の球体状の範囲内の敵の数を取得します。

int CheckEnemyGroupingOnTarget(
    object oTarget,
    float fDistance = 5.0
);

Parameters

oTarget

敵数をチェックする球体範囲の中心になる対象のobject

fDistance

敵数をチェックする球体状の半径（デフォルト：5.0）

Description

oTargetを中心とした半径fDistanceを持つ球体範囲内の敵対ファクションの総数を返します。これはCheckFriendlyFireOnTargetの反対です。

Remarks

この関数はnw_i0_generic.nssの3463行目にあります。

NPCのAIには非常に使える関数です。1つのクリーチャー周辺の全てのターゲットを１周循環し、呼出objectが敵対と見なす者の数を得ます。

Requirements

#include "nw_i0_generic"

Version

1.22

Example

// NPCに1以上の敵の集団を見渡させ、友好的なクリーチャーが
// 範囲内にないことを確かめます。次に、ファイアボール呪文を
// 持っている場合、それを発射させる
void main()
{
    oTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
    if(GetIsObjectValid(oTarget))
    {
        int nEnemy = CheckEnemyGroupingOnTarget(oTarget);
        int nFriendlies = CheckFriendlyFireOnTarget(oTarget);
        if( nFriendlies < 0 &&  nEnemy > 1)
        {
            ActionCastSpellAtObject(SPELL_FIREBALL,oTarget);
        }
    }
}

See Also

functions: | CheckFriendlyFireOnTarget
categories: | Combat Functions | Core AI Functions

author: Iskander Merriman, editor: John Shuell, JP team: Rainie


Function - CheckFriendlyFireOnTarget

Home > Reference > Functions > Combat, Core AI > CheckFriendlyFireOnTarget

CheckFriendlyFireOnTarget(object, float)

ターゲット周辺の球体状の範囲内の友好的クリーチャーの数を取得します。

int CheckFriendlyFireOnTarget(
    object oTarget,
    float fDistance = 5.0
);

Parameters

oTarget

友好者数をチェックする球体範囲の中心になる対象のobject

fDistance

友好者数をチェックする球体状の半径（デフォルト：5.0）

Description

oTargetを中心とした半径fDistanceを持つ球体範囲内の友好的ファクションの総数を返します。

Remarks

呼出者のヒットダイスの半分に満たない友好的クリーチャーは数えられません。

コアAI内で、保護系や増強系または有害な範囲呪文を使うかどうか決定するために使われています。目標範囲内に友好者がいる間は、ヘンチマンが無差別に有害な範囲呪文を使うことを防ぎます。

Requirements

#include "nw_i0_generic"

Version

1.26

Example

// NPCに1以上の敵の集団を見渡させ、友好的なクリーチャーが
// 範囲内にないことを確かめます。次に、ファイアボール呪文を
// 持っている場合、それを発射させる
void main()
{
    oTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
    if(GetIsObjectValid(oTarget))
    {
        int nEnemy = CheckEnemyGroupingOnTarget(oTarget);
        int nFriendlies = CheckFriendlyFireOnTarget(oTarget);
        if( nFriendlies <= 0 &&  nEnemy >= 1)
        {
            ActionCastSpellAtObject(SPELL_FIREBALL,oTarget);
        }
    }
}

See Also

functions: | AssociateCheck | CheckEnemyGroupingOnTarget | GetAttackTarget | GetAttemptedAttackTarget | GetIsFriend | GetIsReactionTypeFriendly
categories: | Combat Functions | Core AI Functions

author: Iskander Merriman, editor: Charles Feduke, JP team: Rainie


Function - CheckIntelligenceHigh

Home > Reference > Functions > Get Data from Creature > CheckIntelligenceHigh

CheckIntelligenceHigh()

話しているプレイヤーの知力の値が15以上どうか判定します。

int CheckIntelligenceHigh();

Description

会話中のプレイヤーキャラクターの知力の値が15以上ならばTRUEを返します。

Remarks

この関数はnw_i0_plot.nssの728行目にあります。

この関数は常にGetPCSpeaker()で知力の値を判定するために使われます。なので会話のないところで使用するとFALSEを返します。

これはプレイヤーにどれくらい知力があるかによって異なった会話の内容を選択するためにBioWareが使用しました。

Requirements

#include "nw_i0_plot"

Version

1.22

Example

//Add as a starting conditional on a conversation thread for a Wizard who will not bother
//talking to anyone unless they are exceptionally bright.

#include "NW_I0_PLOT"

int StartingConditional()
{
    int bSmart = CheckIntelligenceHigh();
    return bSmart;
}

See Also

functions: | CheckCharismaHigh | CheckCharismaLow | CheckCharismaMiddle | CheckCharismaNormal | CheckIntelligenceLow | CheckIntelligenceNormal | CheckWisdomHigh
categories: | Get Data from Creature Functions

author: John Shuell, JP team: marshall


Function - CheckIntelligenceLow

Home > Reference > Functions > Get Data from Creature > CheckIntelligenceLow

CheckIntelligenceLow()

話しているプレイヤーの知力の値が8以下かどうか判定します。

int CheckIntelligenceLow();

Description

会話中のプレイヤーキャラクターの知力の値が8以下ならばTRUEを返します。

Remarks

この関数はnw_i0_plot.nssの57行目にあります。

これはプレイヤーが知力が低い場合に異なった会話の内容を選択し、やや失礼な言動を取るようにするためにBioWareが使用しました。

Requirements

#include "nw_i0_plot"

Version

1.22

Example

//Add as a starting conditional on a conversation thread for a Quest giving NPC who expects the player to return a stolen item.
//If they talk to him again, without having the diamond and a low intelligence score, he will call them idiots and tell
//them to get back out there and try again.

#include "NW_I0_Plot"

int StartingConditional()
{
    if(GetLocalInt(GetPCSpeaker(), "STEAL_DIAMOND_QUEST") == 1){
        int bQuestNotComplete = !GetIsObjectValid(GetItemPossessedBy(GetPCSpeaker(),"StolenDiamond")) &&
                 CheckIntelligenceLow();
    }else{
        int bQuestNotComplete = FALSE;
    }

    return bQuestNotComplete;
}

See Also

functions: | CheckCharismaHigh | CheckCharismaLow | CheckCharismaMiddle | CheckCharismaNormal | CheckIntelligenceHigh | CheckIntelligenceNormal | CheckWisdomHigh
categories: | Get Data from Creature Functions

author: John Shuell, JP team: marshall


Function - CheckIntelligenceNormal

Home > Reference > Functions > Get Data from Creature > CheckIntelligenceNormal

CheckIntelligenceNormal()

話しているプレイヤーの知力の値が9以上どうか判定します。

int CheckIntelligenceNormal();

Description

会話中のプレイヤーキャラクターの知力の値が9以上ならばTRUEを返します。

Remarks

この関数はnw_i0_plot.nssの709行目にあります。

この関数は常にGetPCSpeaker()で知力の値を判定するために使われます。なので会話のないところで使用するとFALSEを返します。

これはプレイヤーにどれくらい知力があるかによって異なった会話の内容を選択するためにBioWareが使用しました。

Requirements

#include "nw_i0_plot"

Version

1.22

Example

//Add as a starting conditional on a conversation thread for an NPC who refuses to talk to
//low intelligence players.
#include "NW_I0_PLOT"

int StartingConditional()
{
    int bSmart = CheckIntelligenceNormal();
    return bSmart;
}

See Also

functions: | CheckCharismaHigh | CheckCharismaLow | CheckCharismaMiddle | CheckCharismaNormal | CheckIntelligenceHigh | CheckIntelligenceLow | CheckWisdomHigh
categories: | Get Data from Creature Functions

author: John Shuell, JP team: marshall


Function - CheckIsUnlocked

Home > Reference > Functions > Henchmen/Familiars/Summoned > CheckIsUnlocked

CheckIsUnlocked(object)

ドアや配置用オブジェクトが施錠状態であることを示すボイスチャットメッセージを流します。

void CheckIsUnlocked(
    object oLastObject
);

Parameters

oLastObject

施錠状態を報告するドアや配置用オブジェクト

Description

スクリプトの呼出者に、ドアや配置用オブジェクトが施錠状態であることを示すボイスチャットを行わせます。

（Objectの開錠や施錠は行わず、クリーチャーにその他の行動も取らせません）

Remarks

この関数はどのBiowareスクリプトでも使われていません。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

Example

// This is the exact function
void CheckIsUnlocked(object oLastObject)
{
    if(GetLocked(oLastObject))
    {
        ActionDoCommand(PlayVoiceChat(VOICE_CHAT_CUSS));
    }
    else
    {
        ActionDoCommand(PlayVoiceChat(VOICE_CHAT_CANDO));
    }
}

See Also

categories: Henchmen/Familiars/Summoned Functions

author: Tom Cassiotis, editor: John Shuell, JP team: Rainie


Function - CheckPartyForItem

Home > Reference > Functions > Get Data, Inventory, Party > CheckPartyForItem

CheckPartyForItem(object, string)

パーティが指定のアイテムを所持しているかチェックします。

int CheckPartyForItem(
    object oMember,
    string sItem
);

Parameters

oMember

チェックされるパーティのメンバー。

sItem

チェックしたいアイテムのタグ。

Description

sItemというタグのアイテムをoMemberが所属するファクションの誰かが所持しているかどうかチェックします。

もしoMemberのファクションの誰かがsItemを所持していた場合はTRUEを返します。

oMemberのファクションの誰もsItemを所持していない場はFALSEを返します。

Requirements

#include "NW_I0_TOOL"

Version

1.22

Example

// トリガーのOnClickに設定します。
// もしパーティメンバーの誰かが"TravelKey"というタグの鍵を所持していた場合は、
// クリックした人を”WP_Destination”と指定された
// ウェイポイントに転送させます。
// 持っていない場合は、パーティが鍵を持っていないという
// メッセージを表示させます。

#include "nw_i0_tool"

void main()
{
  object oClicker = GetClickingObject();
  object oTarget = GetWaypointByTag("WP_Destination");
  location lDest = GetLocation(oTarget);

  if(CheckPartyForItem(oClicker, "TravelKey"))
  {
    AssignCommand(oClicker, ActionJumpToLocation(lDest));
  }

  else
  {
    SpeakString("あなた達は正しい鍵を持っていません。");
  }

}

See Also

categories: Get Data Functions | Inventory Functions | Party Functions

author: Kristian Markon, editor: Jeremy Spilinek, JP team: NamaYake, geshi


Function - CheckWayPoints

Home > Reference > Functions > Core AI, Get Data from Creature, Movement > CheckWayPoints

CheckWayPoints(object)

NPCが歩くための有効なウェイポイントを持っているかを判断します。

int CheckWayPoints(
    object oWalker = OBJECT_SELF
);

Parameters

oWalker

有効なウェイポイントを探すクリーチャー。(デフォルト：OBJECT_SELF)

Description

この関数はoWalkerのタグを取り、"POST_<タグ>"または"WP_<タグ>_01"という名前に合致するウェイポイントのタグを探します(常にチェックされる)。

もしoWalkerのOnSpawnスクリプト内でNW_FLAG_DAY_NIGHT_POSTINGという生成条件が宣言されていた場合には、"NIGHT_<タグ>"または"WN_<タグ>"も探します。

これらの新しいタグが有効なウェイポイントのタグだった場合には関数はTRUEを返します。

Remarks

CheckWayPointsはウェイポイントを持つNPCをチェックするのに役立つかもしれません。

これはnw_i0_genericの中のSetListeningPatterns()でウェイポイントを持つNPCが夜眠りにつくのに歩いてしまうのを防ぐために使われています。

Requirements

#include "nw_i0_generic"

Version

1.22

Example

// Source for CheckWayPoints():
int CheckWayPoints(object oWalker = OBJECT_SELF)
{
    object oWay1;
    object oWay2;
    object oWay3;
    object oWay4;
    string sTag = GetTag(oWalker);
    if(GetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING))
    {
        oWay2 = GetWaypointByTag("NIGHT_" + sTag);
        oWay4 = GetWaypointByTag("WN_" + sTag + "_01");
    }

    oWay1 = GetWaypointByTag("POST_" + sTag);
    oWay3 = GetWaypointByTag("WP_" + sTag + "_01");

    if(GetIsObjectValid(oWay2) || GetIsObjectValid(oWay4) || GetIsObjectValid(oWay1) || GetIsObjectValid(oWay3))
    {
        return TRUE;
    }
    return FALSE;
}

See Also

functions: | SetListeningPatterns | WalkWayPoints
categories: | Core AI Functions | Get Data from Creature Functions | Movement Functions
constants: | NW_FLAG_* Constants

author: Iskander Merriman, editor: John Shuell, JP team: marshall


Function - CheckWisdomHigh

Home > Reference > Functions > Get Data from Creature > CheckWisdomHigh

CheckWisdomHigh()

話しているプレイヤーの判断力の値が高いかどうか判定します。

int CheckWisdomHigh();

Description

会話中のプレイヤーキャラクターの判断力の値が14以上ならばTRUEを返します。

Remarks

この関数はnw_i0_plot.nssの743行目にあります。

この関数は常にGetPCSpeaker()で判断力の値を判定するために使われます。なので会話のないところで使用するとFALSEを返します。

これはプレイヤーにどれくらい高い判断力があるかによって異なった会話の内容を選択するためにBioWareが使用しました。

スクリプト記述者はNPCとの会話中に特別な洞察を与えるようなことができます。

Requirements

#include "nw_i0_plot"

Version

1.22

Example

//If the player has completed the STEAL_DIAMOND quest and they are of normal Intelligence levels and High Wisdom levels
//Then let them realize the NPC is going to kill them to keep them quiet.  This will give the player a
//chance to react before the encounter begins.
#include "NW_I0_PLOT"

int StartingConditional()
{
    int iResult;

    iResult = GetLocalInt(GetModule(), "STEAL_DIAMOND") >= 10 && CheckIntelligenceNormal() && CheckWisdomHigh();
    return iResult;
}

See Also

functions: | CheckCharismaHigh | CheckCharismaLow | CheckCharismaMiddle | CheckCharismaNormal | CheckIntelligenceHigh | CheckIntelligenceLow | CheckIntelligenceNormal
categories: | Get Data from Creature Functions

author: John Shuell, JP team: marshall


Function - chooseTactics

Home > Reference > Functions > Combat, Core AI > chooseTactics

chooseTactics(object)

職業に特有の戦術を決定します。

int chooseTactics(
    object oIntruder
);

Parameters

oIntruder

戦術で対抗するクリーチャー

Description

以前はDetermineCombatRoundの一部でしたが、この機能性は目的を分かりやすくするためにDetermineCombatRoundから派生しました。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

functions: | DetermineCombatRound
categories: | Combat Functions | Core AI Functions

author: Charles Feduke, JP team: Rainie


Function - ClearAllActions

Home > Reference > Functions > Action on Object, Combat Actions > ClearAllActions

ClearAllActions(int)

アクションキューから全てのアクションを取り除きます。

void ClearAllActions(
    int nClearCombatState = FALSE
);

Parameters

nClearCombatState

全ての他のアクションと共に戦闘を止めさせるかどうか（デフォルト：FALSE）

Description

呼出者のアクションキューから全てのアクションを取り消します。新しい命令をさせる前に、Object(大概はNPC)の以前の指示を取り消すよう使用します。nClearCombatStateにTRUEが設定されていない場合は、この関数の呼出者を含む現在の戦闘は続行される事に注意してください。

Remarks

ClearAllActionsのためのコマンドとアクションの相違は、少し曖昧です。下記のexampleを見てください。

nwscript.nssのヘルプに反して、このコマンドは、クリーチャーのアクションキューだけではなく、いかなるアクションキュー(トリガ含む)にも割り当てることができます。

Version

1.29

Example

// トリガのOnEnterイベント用
#include "nw_i0_generic"
void main() {
  object oPC = GetEnteringObject();
  if (! GetIsPC(oPC)) return;

  DelayCommand( 1.0, ClearAllActions());
  DelayCommand( 2.0, SendMessageToPC(oPC, "Hello")); // 非アクション - 表示させる
  DelayCommand( 3.0, ActionSpeakString("Hello again")); // アクション - 取り消される
  DelayCommand( 4.0, SpeakString("Hello again")); // これもアクション扱い - 取り消される
}

See Also

functions: | ActionDoCommand | AssignCommand | DelayCommand
categories: | Action on Object Functions | Combat Actions Functions

author: Iskander Merriman, editor: Charles Feduke, additional contributor(s): Richard Dobkins, Jassper, JP team: Rainie


Function - ClearAllFactionMembers

Home > Reference > Functions > Prototyped but Unused, Reputation/Faction > ClearAllFactionMembers

ClearAllFactionMembers(object, object)

NPCもしくはNPCグループをPCに対して中立の関係にします。

void ClearAllFactionMembers(
    object oMember,
    object oPlayer
);

Parameters

oMember

oPlayer

Description

Death Script
NW_O0_DEATH.NSS

oMemberのファクションメンバー全てをoPlayerに対して中立な関係に調整します。

Remarks

nw_o0_death.nss: 15

この関数は現在コメントアウトされています（ver.1.29）。

David Gaider氏のスクリプトチュートリアル'Shouts, Factions and Attacking My Enemy'もあわせてご覧ください。

<http://nwn.bioware.com/builders/sctutorial22.html>

Requirements

#include "nw_o0_death"

Version

1.29

See Also

functions: | AdjustFactionReputation | AdjustReputation | GetReputation | GetStandardFactionReputation | SetStandardFactionReputation
categories: | Prototyped but Unused Functions | Reputation/Faction Functions
events: | OnDeath Event | OnPhysicalAttacked Event

author: Jody Fletcher, JP team: Redondo


Function - ClearArena

Home > Reference > Functions > Module Specific > ClearArena

ClearArena(object, string)

この関数は、変数をリセットし、戦闘舞台をクリアします。

void ClearArena(
    object oPC,
    string sArena
);

Parameters

oPC

sArena

Description

この関数は、NWNモジュール第一章の'gauntlet'サブプロットにおいて、変数をリセットし、戦闘舞台をクリアします。

Remarks

nw_o0_respawn.nss: 45

Requirements

#include "nw_o0_respawn"

Version

1.22

See Also

categories: Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - ClearPersonalReputation

Home > Reference > Functions > Reputation/Faction > ClearPersonalReputation

ClearPersonalReputation(object, object)

NPCもしくはクリーチャーがPC、NPC、他のクリーチャーに対して持つ友好や敵対という感情を変更します（クリアします）。

void ClearPersonalReputation(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

oSourceが関係を変更するであろうPC、NPC、もしくはクリーチャー

oSource

oTargetへの関係を変更するNPCもしくはクリーチャー。(デフォルト: OBJECT_SELF)

Description

oSourceがoTargetに対してもつ関係をすべてクリアします。これはファクションの全てのメンバーに対するグローバルエフェクトではなく、ただ具体的なoSourceに影響するものです。

Version

1.22

See Also

functions: | AdjustReputation | GetFactionAverageReputation | GetReputation | GetStandardFactionReputation | SetStandardFactionReputation
categories: | Reputation/Faction Functions

author: Jody Fletcher, JP team: Redondo


Function - CompareLastSpellCast

Home > Reference > Functions > Core AI > CompareLastSpellCast

CompareLastSpellCast(int)

呪文が以前にクリーチャーによって詠唱された呪文と同じ物であるかどうかを決定します。

int CompareLastSpellCast(
    int nSpell
);

Parameters

nSpell

SPELL_*

Description

nSpellが最後に詠唱された呪文と一致すればTRUEを返し、そうでなければFALSEを返します。

SetLastGenericSpellCast()関数と組み合わせて使われます。

Remarks

呪文を最後に詠唱された呪文と比較します。

AIによって内部的に使われるので、同じ呪文の詠唱を保持しておきません。

Requirements

#include "NW_I0_GENERIC"

Version

1.28

See Also

functions: | GetLastGenericSpellCast | SetLastGenericSpellCast
categories: | Core AI Functions
constants: | SPELL_* Constants

author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - CopyItem

Home > Reference > Functions > Item Creation > CopyItem

CopyItem(object, object)

アイテムを複製します。

object CopyItem(
    object oItem,
    object oTargetInventory = OBJECT_INVALID
);

Parameters

oItem

コピーするアイテム

oTargetInventory

アイテムを作成する先のインベントリー（デフォルト：OBJECT_INVALID）

Description

存在するアイテムを複製し、それを返します。アイテムが存在しない場合またはアイテムではない場合、OBJECT_INVALIDを返します。空きのあるコンテナにのみコピーすることができます。ない場合は、コピーせず、アイテムを含んでいるアイテム・コンテナー用にOBJECT_INVALIDを返すでしょう。目標内にアイテムとその他のものと重ねる（スタックする）ことができるならば、スタックされ、そして、スタック後のアイテムが返されます。

Remarks

この関数はCopyObjectができないことを出来るように思えませんが、locationの入力の義務を省略します。

財宝の入った入れ物の中の探し、関数を呼ぶコンテナかクリーチャーの中のアイテムのコピーを作るためにCopyItemを呼ぶ場合のカスタム財宝システムで使うことが出来ます。

Version

1.30

See Also

functions: | CopyObject | CreateItemOnObject
categories: | Item Creation Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - CopyLocals

Home > Reference > Functions > Henchmen/Familiars/Summoned > CopyLocals

CopyLocals(object, object)

レベルの低いヘンチマンから新しいヘンチマンへ、ローカル値をコピーします。

void CopyLocals(
    object oSource,
    object oTarget
);

Parameters

oSource

以前のヘンチマン

oTarget

新しいヘンチマン

Description

レベルの低いヘンチマンから新しいヘンチマンへ、ローカル値をコピーします。

Remarks

Found in: nw_i0_henchman.nss: 378

oSource上で見つかる変数をoTarget上に設定します。これらの変数は、多分SetBeenHired()から別れ、公式キャンペーンでのみ有効で、我々がこの関数を使うためには少し調整が必要だと思われます。

Requirements

#include "nw_i0_henchman"

Version

1.22

Example

// この関数のversion1.28用ソース
void CopyLocals(object oSource, object oTarget)
{
//    AssignCommand(PC(), SpeakString("in here"));
//    AssignCommand(oTarget, SpeakString("I exist"));
    if (GetIsObjectValid(oTarget) == FALSE)
    {
        AssignCommand(PC(), SpeakString("Target invalid"));
    }
    else
    if (GetIsObjectValid(oSource) == FALSE)
    {
        AssignCommand(PC(), SpeakString("Source invalid"));
    }
  SetBeenHired(GetBeenHired(oSource), oTarget);
  SetStoryVar(1, GetStoryVar(1, oSource), oTarget);
  SetStoryVar(2, GetStoryVar(2, oSource), oTarget);
  SetStoryVar(3, GetStoryVar(3, oSource), oTarget);
  SetLocalInt(oTarget, "NW_ASSOCIATE_MASTER", GetLocalInt(oSource, "NW_ASSOCIATE_MASTER"));
//  AssignCommand(PC(),SpeakString(IntToString(GetLocalInt(oSource, "NW_ASSOCIATE_MASTER"))));
//  AssignCommand(PC(),SpeakString(IntToString(GetLocalInt(oTarget, "NW_ASSOCIATE_MASTER"))));

}

See Also

functions: | SetBeenHired
categories: | Henchmen/Familiars/Summoned Functions

author: Lilac Soul, JP team: Rainie


Function - CopyObject

Home > Reference > Functions > Inventory, Item Creation, Miscellaneous > CopyObject

CopyObject(object, location, object, string)

指定したobjectを複製します。

object CopyObject(
    object oSource,
    location locLocation,
    object oOwner = OBJECT_INVALID,
    string sNewTag = ""
);

Parameters

oSource

コピーするobject

locLocation

複製したobjectを置く位置（必須）

oOwner

アイテムの所有者 （インベントリーにアイテムをコピーする場合に使用）（デフォルト：OBJECT_INVALID）

sNewTag

新しいタグ名（デフォルト：""）

Description

指定したobjectを複製します。アイテムがコピーされた場合に、oOwnerがOBJECT_INVALIDでなければ、アイテムは自動的にoOwnerのインベントリーに入ります。コピーされるobjectがクリーチャーであれば、locLocationに配置されます。strNewTagが指定されていれば、複製objectにはそのtagがつけれらます。

アイテムが作成され、oOwnerが指定されている場合、locLocationはインベントリーを持つ所有者のlocationでなければなりません。（例えば、GetLocation(oOwner)）

Remarks

CopyObject()は配置物には動作しません。現在はobjectと複製品の名前を変えることができません。

入れ物の中身をコピーするために繰り返し使用する場合、DestroyObject()はスクリプト終了まで生じさせないことを心に留めておいてください。

Known Bugs

死亡したPCの所持品をコピーして、さらにCopyObjectを入れ物に入っているアイテムに使用して、別の配置物（例えば死体など）にコピーする場合、アイテムは二重に複製されます。

なぜなら、アイテムは親となる入れ物と子となる入れ物の両方に属するからです。この現象を回避するためには、SetLocalIntを使ってそれぞれのアイテムに処理済の値を持たせるとよいでしょう。そしてアイテムが処理済となってい場合にコピーさせます（もちろんコピーされたオブジェクトのインベントリーにあるアイテムは手動で繰り返さなければなりません）。

もし存在しない場所（例えばタグ名を打ち間違えたウェイポイントなど）にコピーしようとした場合は、ゲームがクラッシュすることになるでしょう。

新しいタグ名を使う場合にも問題があります。
GetTagでコピーしたオブジェクトを呼ぶ場合は正常に動きますが、GetObjectByTagで呼ぼうとした場合はコピーを返しません。より正確に言うと、常に全く動きません。

There are problems with the new tag as well. Calling GetTag with the copied object as a parameter works, but calling GetObjectByTag won't return the copy, or at least it won't all the time.

Version

1.31

See Also

functions: | CreateObject
categories: | Inventory Functions | Item Creation Functions | Miscellaneous Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): S. Perreault, Nanodeath, Alex Meduna, Angelo Cossa, JP team: geshi, Rainie


Function - cos

Home > Reference > Functions > Math > cos

cos(float)

コサイン計算し、結果を返す。

float cos(
    float fValue
);

Parameters

fValue

コサイン計算させたい浮動小数値

Description

コサインを計算し値を返す（ラジアン表記ではなく度）

Remarks

斜辺÷底辺(余弧)

参考：

ラジアン＝度÷180×π

度＝ラジアン÷π×180

Version

1.31

See Also

functions: | acos | asin | atan | sin | tan
categories: | Math Functions

author: Charles Feduke, additional contributor(s): Jeff Copus, Paul Catalano, JP team: geshi, ngtaicho


Function - CreateAmmo

Home > Reference > Functions > Item Creation > CreateAmmo

CreateAmmo(object, object, int)

ランダム財宝分配システムの一部として、そのクラスに適した弾薬を出現させます。

void CreateAmmo(
    object oTarget,
    object oAdventurer,
    int nModifier = 0
);

Parameters

oTarget

作成したアイテムを入れる入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

作成する弾薬の量（デフォルト：0）

Description

プレイヤーの職業に応じたランダムの弾薬を作成します。

Remarks

Found in nw_o2_coninclude.nss

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateAnimalPart

Home > Reference > Functions > Item Creation > CreateAnimalPart

CreateAnimalPart(object)

動物の死体上に動物の一部を作成します。

void CreateAnimalPart(
    object oTarget
);

Parameters

oTarget

体の一部を作成する動物

Description

動物を倒した時などに身体の一部を作成します。クエストのトークンなどに便利です。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateArcaneScroll

Home > Reference > Functions > Item Creation > CreateArcaneScroll

CreateArcaneScroll(object, object, int)

財宝の一部としてスクロールを作成します。

void CreateArcaneScroll(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

oAdventurer

nModifier

Description

この関数は、自動財宝作成機能の一部として、宝箱を開けたキャスターのレベルと職業に適したスクロールを作成します。

Remarks

nModifierはoAdventurerのレベルを上げるためです。この関数はnw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateBalor

Home > Reference > Functions > Henchmen/Familiars/Summoned > CreateBalor

CreateBalor()

詠唱者のために闘うベイラーを召還します。

void CreateBalor();

Description

この関数は、詠唱者のために戦うベイラーを召還します。我々の野望を邪魔する鬱陶しいパラディンを壊しちゃう為に有効です。

Remarks

nw_s0_gate.nssで見つかります。

Requirements

#include "nw_s0_gate"

Version

1.22

See Also

categories: Henchmen/Familiars/Summoned Functions

author: Michael Nork, JP team: Rainie


Function - CreateBastardSword

Home > Reference > Functions > Item Creation > CreateBastardSword

CreateBastardSword(object, object)

宝箱の財宝用にバスタードソードを作成します。

void CreateBastardSword(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する宝箱

oAdventurer

プレイヤーオブジェクト

Description

ランダム財宝配分システムの一部として、バスタードソードを出現させます。

Remarks

備考：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateBattleAxe

Home > Reference > Functions > Item Creation > CreateBattleAxe

CreateBattleAxe(object, object)

ランダム財宝分配システムの一部として、クラスに適した魔法の武器を出現させます。

void CreateBattleAxe(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

作成したアイテムを入れる入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWNの財宝分配システム用のアイテムとしてバトルアックスを作成します。

Remarks

備考：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateBook

Home > Reference > Functions > Item Creation > CreateBook

CreateBook(object)

財宝分配システムの一部として、ランダムな本を作成します。

void CreateBook(
    object oTarget
);

Parameters

oTarget

作成したアイテムを入れる入れ物

Description

この関数は財宝分配システムの一部として、ランダムな本を作成します。

Remarks

Found in nw_o2_coninclude.nss

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateClub

Home > Reference > Functions > Item Creation > CreateClub

CreateClub(object, object)

ランダム財宝分配システムの一部としてクラスに適した魔法の武器を出現させます。

void CreateClub(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

oAdventurer

Description

財宝分配システムの一部として、入れ物にクラブを作成します。

Remarks

備考：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateColmarrPotion

Home > Reference > Functions > Item Creation > CreateColmarrPotion

CreateColmarrPotion()

コルマール（NWN公式キャンペーンに出てくるNPC）の機械用にポーションを作成します。

void CreateColmarrPotion();

Description

これはコルマールの機械用にポーションを作成する、特殊なプロット用関数です。

Remarks

nw_i0_2q4luskan.nssの36行目で見つかります。

公式キャンペーンのコルマールの機械用のローカル変数を読み出し、これを使用することでポーションを作成させます。普通のスクリプトを書く際には全く使えませんが、幾つかのレバーの状態に依存して異なるアイテムを作成する方法を学ぶために良い方法として利用できるかもしれません。

Requirements

#include "nw_i0_2q4luskan"

Version

1.28

See Also

categories: Item Creation Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - CreateDagger

Home > Reference > Functions > Item Creation > CreateDagger

CreateDagger(object, object)

財宝分配システムの一部として、魔法のダガーを入れ物に作成するために使用します。

void CreateDagger(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

ランダム財宝分配システムの一部として、クラスに適した魔法の武器を出現させます。

Remarks

入れ物にのみ動作します。
nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

functions: | CreateItemOnObject
categories: | Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateDart

Home > Reference > Functions > Item Creation > CreateDart

CreateDart(object, object)

ランダム財宝分配システムの一部としてクラスに適した魔法の武器を出現させます。

void CreateDart(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

Description

財宝分配システムの一部としてダーツを作成します。

Remarks

備考：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateDireMace

Home > Reference > Functions > Item Creation > CreateDireMace

CreateDireMace(object, object)

ランダム財宝分配システムの一部としてダイアメイスを出現させます。

void CreateDireMace(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

財宝分配システムの一部として入れ物にダイアメイスを出現させます。

Remarks

備考：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateDivineScroll

Home > Reference > Functions > Item Creation > CreateDivineScroll

CreateDivineScroll(object, object, int)

財宝の一部として宝石を作成します。

void CreateDivineScroll(
    object oTarget,
    object oAdventurer,
    int nModifier = 0
);

Parameters

oTarget

oAdventurer

nModifier

財宝の価値を引き上げるスイッチ（デフォルト：0）

Description

この関数はNWN財宝システムの一部として入れ物に宝石を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateDoomEffectsLink

Home > Reference > Functions > Spell Casting Effects > CreateDoomEffectsLink

CreateDoomEffectsLink()

すべてのドゥームエフェクトに対して使われるリンクエフェクトを作ります。

effect CreateDoomEffectsLink();

Description

すべてのドゥームエフェクトに対するリンクエフェクトを返します。

リンクエフェクトは、全てのセービングスローに対して-2ペナルティ、攻撃とダメージ判定に対して-2ずつペナルティ、全てのスキルに対して-2ずつペナルティ、ビジュアルも与えます。

Remarks

nw_i0_spells.nss: 19

Requirements

#include "nw_i0_spells"

Version

1.22

See Also

categories: Spell Casting Effects Functions

author: Tom Cassiotis, JP team: Redondo


Function - CreateDoubleAxe

Home > Reference > Functions > Item Creation > CreateDoubleAxe

CreateDoubleAxe(object, object)

ランダム財宝分配システムの一部として魔法のダブルアックスを出現させます。

void CreateDoubleAxe(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

作成したアイテムを入れる入れ物

oAdventurer

プレイヤーオブジェクト

Description

この関数はNWN財宝システムの一部としてコンテナに、魔法のダブルアックスを作成します。

Remarks

備考：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateFetchItemOn

Home > Reference > Functions > Prototyped but Unused > CreateFetchItemOn

CreateFetchItemOn(object)

この関数は何も行いません。

void CreateFetchItemOn(
    object oPC
);

Parameters

oPC

Description

ソースコードより：

// CreateItemOnObject(GetFetchItem(),oPC);

// * December 13 2001

// * This function no longer does anything

// * we changed this so the NPC starts with the

// * item on him

// * この関数は何も行いません。

// * 我々はNPCがアイテムを持った状態で始まるように変更しました。

Remarks

この関数は、nw_j_fetch.nssの199行目にあります。

実際に、この関数は何も行いません。関数の中は空っぽです。

Requirements

#include "nw_j_fetch"

Version

1.28

See Also

functions: | GetFetchee
categories: | Prototyped but Unused Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - CreateForgeItem

Home > Reference > Functions > Item Creation > CreateForgeItem

CreateForgeItem()

「炉」に魔法のアイテムを出現させるために使います。

void CreateForgeItem();

Description

入れ物のOnSpellCastイベントから呼び出され、アイテムを作成するかまたは悪い効果を発生させます。スクリプトは、プレイヤーが必要な「材料」を持っているかどうか調べます。

Remarks

公式キャンペーンで使われています。nw_o0_itemmaker.nssで見つかります。

Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

functions: | GetForgeMatch
categories: | Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGem

Home > Reference > Functions > Item Creation > CreateGem

CreateGem(object, object, int, int)

NWN財宝分配システムの一部として宝石を作成します。

void CreateGem(
    object oTarget,
    object oAdventurer,
    int nTreasureType,
    int nModifier = 0
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nTreasureType

作成する宝石の種類

nModifier

宝石の価値を引き上げる修正値（デフォルト：0）

Description

少なくとも1gpの価値の宝石を作成します。PCのレベルとnModifierに基づきもっと高くなります。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGenericClassItem

Home > Reference > Functions > Item Creation > CreateGenericClassItem

CreateGenericClassItem(object, object, int)

ウィザード、ソーサラー、クレリック、モンク、ローグそしてバード用の財宝を作成します。

void CreateGenericClassItem(
    object oTarget,
    object oAdventurer,
    int nSpecific
);

Parameters

oTarget

oAdventurer

nSpecific

Description

この関数は、ウィザード、ソーサラー、クレリック、モンク、ローグそしてバードにより適したアイテムを返すだけです。この関数はPCのクラスとレベルを取得し、それから適したCreateGeneric<CLASS>Weaponまたは、CreateSpecific<CLASS>Weaponを呼び出します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGenericDruidWeapon

Home > Reference > Functions > Item Creation > CreateGenericDruidWeapon

CreateGenericDruidWeapon(object, object, int)

Object上または内に、PCのレベルに合うドルイド用武器を作成します。

void CreateGenericDruidWeapon(
    object oTarget,
    object oAdventurer,
    int nModifier = 0
);

Parameters

oTarget

一般的なドルイド用武器を受け取るobject（最もありそうなのはインベントリーを持つ配置物です）

oAdventurer

合計ヒットダイスが武器の適切なレベルを作成するために使われるPC

nModifier

出現させる武器のレベルを決定するPCに与えたい追加のヒットダイスレベル(デフォルト：0)

Description

ドルイドにとって有効な一般武器を、指定したリストから１つ作成します。この一般武器はランダムな数字とoAdventurerの合計レベルに基づきます。

Requirements

#include "NW_O2_CONINCLUDE"

Version

1.22

See Also

functions: | CreateGenericExotic | CreateGenericMonkWeapon | CreateGenericWizardWeapon | CreateItemOnObject
categories: | Item Creation Functions

author: Jody Fletcher, editor: Michael Nork, JP team: Rainie


Function - CreateGenericExotic

Home > Reference > Functions > Item Creation > CreateGenericExotic

CreateGenericExotic(object, object, int)

object上または中に、PCのレベルに合う、適したエキゾチックウェポンを作成します。

void CreateGenericExotic(
    object oTarget,
    object oAdventurer,
    int nModifier = 0
);

Parameters

oTarget

エキゾチックウェポンを受け取るobject。（最もありそうなのはインベントリーを持った配置物です）

oAdventurer

合計ヒットダイスが武器の適切なレベルを作成するために使われるPC

nModifier

出現させる武器のレベルを決定するPCに与えたい追加のヒットダイスレベル(デフォルト：0)

Description

PCにとって有効な一般武器を、指定したリストから１つ作成します。この一般武器はランダムな数字とoAdventurerの合計レベルに基づきます。

Requirements

#include "NW_O2_CONINCLUDE"

Version

1.22

See Also

functions: | CreateGenericDruidWeapon | CreateGenericMonkWeapon | CreateGenericWizardWeapon | CreateItemOnObject
categories: | Item Creation Functions

author: Jody Fletcher, editor: Michael Nork, JP team: Rainie


Function - CreateGenericHeavyArmor

Home > Reference > Functions > Item Creation > CreateGenericHeavyArmor

CreateGenericHeavyArmor(object, object, int)

ランダム財宝分配システムの一部として、一般的な重装鎧を出現させます。

void CreateGenericHeavyArmor(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値（デフォルト：0）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、一般重装鎧を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGenericLightArmor

Home > Reference > Functions > Item Creation > CreateGenericLightArmor

CreateGenericLightArmor(object, object, int)

ランダム財宝分配システムの一部として、一般的な軽装鎧を出現させます。

void CreateGenericLightArmor(
    object oTarget,
    object oAdventurer,
    int nModifier = 0
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値（デフォルト：0）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、一般軽装鎧を作成する。

Remarks

Found in nw_o2_coninclude.nss

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGenericMartial

Home > Reference > Functions > Item Creation > CreateGenericMartial

CreateGenericMartial(object, object, int)

ランダム財宝分配システムの一部として、一般的武器を出現させます

void CreateGenericMartial(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作る入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、一般武器を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGenericMediumArmor

Home > Reference > Functions > Item Creation > CreateGenericMediumArmor

CreateGenericMediumArmor(object, object, int)

ランダム財宝分配システムの一部として、一般的な中装鎧を出現させます。

void CreateGenericMediumArmor(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値（デフォルト：0）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、一般中装鎧を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGenericMiscItem

Home > Reference > Functions > Item Creation > CreateGenericMiscItem

CreateGenericMiscItem(object, object, int)

ランダム財宝分配システムの一部として一般アイテムを出現させます。

void CreateGenericMiscItem(
    object oTarget,
    object oAdventurer,
    int nModifier = 0
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値（デフォルト：0）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、一般アイテムを作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGenericMonkWeapon

Home > Reference > Functions > Item Creation > CreateGenericMonkWeapon

CreateGenericMonkWeapon(object, object, int)

Object上または内に、PCのレベルに合うモンク用武器を作成します

void CreateGenericMonkWeapon(
    object oTarget,
    object oAdventurer,
    int nModifier = 0
);

Parameters

oTarget

一般的なモンク用武器を受け取るobject（最もありそうなのはインベントリーを持つ配置物です）

oAdventurer

合計ヒットダイスが武器の適切なレベルを作成するために使われるPC

nModifier

出現させる武器のレベルを決定するPCに与えたい追加のヒットダイスレベル(デフォルト：0)

Description

モンクにとって有効な一般武器を、指定したリストから１つ作成します。この一般武器はランダムな数字とoAdventurerの合計レベルに基づきます。

Requirements

#include "NW_O2_CONINCLUDE"

Version

1.22

See Also

functions: | CreateGenericDruidWeapon | CreateGenericExotic | CreateGenericWizardWeapon | CreateItemOnObject
categories: | Item Creation Functions

author: Jody Fletcher, editor: Michael Nork, JP team: Rainie


Function - CreateGenericRodStaffWand

Home > Reference > Functions > Item Creation > CreateGenericRodStaffWand

CreateGenericRodStaffWand(object, object, int)

ランダム財宝分配システムの一部として、一般的なロッド、スタッフまたはワンドを出現させます。

void CreateGenericRodStaffWand(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値（デフォルト：0）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、一般的なロッド、スタッフまたはワンドを作成します。

Remarks

Found in nw_o2_coninclude.nss

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGenericSimple

Home > Reference > Functions > Item Creation > CreateGenericSimple

CreateGenericSimple(object, object, int)

ランダム財宝分配システムの一部として、一般的な単純武器を出現させます。

void CreateGenericSimple(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値（デフォルト：0）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、一般単純武器を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGenericWizardWeapon

Home > Reference > Functions > Item Creation > CreateGenericWizardWeapon

CreateGenericWizardWeapon(object, object, int)

Object上または内に、PCのレベルに合うウィザード用武器を作成します。

void CreateGenericWizardWeapon(
    object oTarget,
    object oAdventurer,
    int nModifier = 0
);

Parameters

oTarget

一般的なウィザード用武器を受け取るobject（最もありそうなのはインベントリーを持つ配置物です）

oAdventurer

合計ヒットダイスが武器の適切なレベルを作成するために使われるPC

nModifier

出現させる武器のレベルを決定するPCに与えたい追加のヒットダイスレベル(デフォルト：0)

Description

ウィザードにとって有効な一般武器を、指定したリストから１つ作成します。この一般武器はランダムな数字とoAdventurerの合計レベルに基づきます。

Requirements

#include "NW_O2_CONINCLUDE"

Version

1.22

See Also

functions: | CreateGenericDruidWeapon | CreateGenericExotic | CreateGenericMonkWeapon | CreateItemOnObject
categories: | Item Creation Functions

author: Jody Fletcher, editor: Michael Nork, JP team: Rainie


Function - CreateGold

Home > Reference > Functions > Item Creation > CreateGold

CreateGold(object, object, int, int)

ランダム財宝分配システムの一部として、ゴールドを出現させます。

void CreateGold(
    object oTarget,
    object oAdventurer,
    int nTreasureType,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nTreasureType

作成する財宝の種類

nModifier

PCレベル修正値（デフォルト：0）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベル＋nModifierに基づき、一ゴールドを作成します。

少なくとも1gpが出現します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGreatAxe

Home > Reference > Functions > Item Creation > CreateGreatAxe

CreateGreatAxe(object, object)

ランダム財宝分配システムの一部として、グレートアックスを出現させます。

void CreateGreatAxe(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、グレートアックスを作成します。

Remarks

備考：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateGreatSword

Home > Reference > Functions > Item Creation > CreateGreatSword

CreateGreatSword(object, object)

ランダム財宝分配システムの一部として、グレートソードを出現させます。

void CreateGreatSword(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、グレートソードを作成します。

Remarks

備考：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateHalberd

Home > Reference > Functions > Item Creation > CreateHalberd

CreateHalberd(object, object)

ランダム財宝分配システムの一部として、ハルバードを出現させます。

void CreateHalberd(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ハルバードを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateHandAxe

Home > Reference > Functions > Item Creation > CreateHandAxe

CreateHandAxe(object, object)

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ハンドアックスを作成します。

void CreateHandAxe(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ハンドアックスを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateHealingKit

Home > Reference > Functions > Item Creation > CreateHealingKit

CreateHealingKit(object, object, int)

ランダム財宝分配システムの一部として、治療用具を出現させます。

void CreateHealingKit(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値（デフォルト：0）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、治療用具を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateHeavyCrossbow

Home > Reference > Functions > Item Creation > CreateHeavyCrossbow

CreateHeavyCrossbow(object, object)

ランダム財宝分配システムの一部として、ヘビークロスボウを出現させます。

void CreateHeavyCrossbow(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ヘビークロスボウを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateHeavyFlail

Home > Reference > Functions > Item Creation > CreateHeavyFlail

CreateHeavyFlail(object, object)

ランダム財宝分配システムの一部として、ヘビーフレイルを出現させます。

void CreateHeavyFlail(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ヘビーフレイルを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateItemOnObject

Home > Reference > Functions > Inventory, Item Creation > CreateItemOnObject

CreateItemOnObject(string, object, int)

objectのインベントリーに指定したアイテムを作成します。

object CreateItemOnObject(
    string sItemTemplate,
    object oTarget = OBJECT_SELF,
    int nStackSize = 1
);

Parameters

sItemTemplate

作成するアイテムのブループリントResRef文字列、またはタグ

oTarget

アイテムを作成したいインベントリー。（デフォルト：OBJECT_SELF）

nStackSize

作成するアイテムの数。（デフォルト：1）

Description

この関数は、oTargetのインベントリーにsItemTemplateを持ったアイテムを作成します。カスタムアイテムを作成する場合、sItemTemplateはResRefです。スタンダードアイテムを作成する場合、sItemTemplateはアイテムのタグです。

作成するobjectを返します。エラーの場合、OBJECT_INVALIDを返します。CreateItemOnObjectはアイテムの入れ物にのみ動作します。

Remarks

パラメーターnStackSizeは重ねることのできるアイテム（例：ポーション類）にのみ適応されます。sItemTemplateが重ねることのできないアイテム（例：鎧等）を参照している場合、１つだけしか作成されません。

CreateItemOnObjectは、重ねることのできるアイテムを作成するために呼び出す、重要な作用です。

命令のoTargetがすでに存在しているスタック（束）がある場合、アイテムは存在しているスタックに追加されるように作成されます。この場合、2つの事が起こり得ます。

1. スタックの限界を超えた時、新しいスタックが作成されます。CreateItemOnObjectは有効なobjectを返します。

2. 古いスタックのobjectは99個を超えることはありません。新しいスタックobjectは作成されません。CreateItemOnObjectの返し値はINVALID_OBJECTではありませんが、もし、GetIsObjectValid()を試した場合、FALSEを返すでしょう。

Version

1.29

Example

// 下記スクリプトは配置物objectを最後に使用したobjectのインベントリーに
// 5本のエール瓶を作成します。

object oTarget = GetLastUsedBy();
string sItemTemplate1 = "nw_it_mpotion021";  // スタンダードのエール瓶
int nStackSize = 5; // 5つのアイテムを作成する;
CreateItemOnObject(sItemTemplate1, oTarget, nStackSize);

// 作成するアイテムを変更する場合
string sItemTemplate2 = "nw_ashsw001"; // Standard small shield

// そして、再び命令をする
CreateItemOnObject(sItemTemplate2, oTarget, nStackSize);

// nStackSizeは5であるが、oTargetのインベントリーにはスモールシールドが
// 1つだけ作成される。

See Also

functions | ActionGiveItem | CopyItem | CreateDagger | CreateGenericDruidWeapon | CreateGenericExotic | CreateGenericMonkWeapon | CreateGenericWizardWeapon | dbCreateItemOnObject | GetBaseItemType
categories: | Inventory Functions | Item Creation Functions

author: Dave Withnall, editor: Charles Feduke, additional contributor(s): Kirsten, Chris Becke, JP team: geshi, Rainie


Function - CreateJewel

Home > Reference > Functions > Item Creation > CreateJewel

CreateJewel(object, object, int, int)

ランダム財宝分配システムの一部として、入れ物に宝石を出現させます。

void CreateJewel(
    object oTarget,
    object oAdventurer,
    int nTreasureType,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nTreasureType

財宝の種類

nModifier

PCレベル修正値（デフォルト：0）

Description

入れ物を開けたPCのレベル＋nModifierに基づき、入れ物に宝石をを作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateJunk

Home > Reference > Functions > Item Creation > CreateJunk

CreateJunk(object)

入れ物の財宝用にランダムアイテムを作成します。

void CreateJunk(
    object oTarget
);

Parameters

oTarget

ガラクタを入れるコンテナ

Description

NWN財宝分配システムの一部として、入れ物に下記の内から１つのアイテムをランダムに作成します。
NW_IT_MPOTION021 (エール)
NW_IT_MPOTION023 (ワイン)
NW_IT_MPOTION022" (スピリッツ)
NW_IT_TORCH001 (たいまつ)

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateKama

Home > Reference > Functions > Item Creation > CreateKama

CreateKama(object, object)

ランダム財宝分配システムの一部として、カマを出現させます。

void CreateKama(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、カマを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateKatana

Home > Reference > Functions > Item Creation > CreateKatana

CreateKatana(object, object)

ランダム財宝分配システムの一部として、カタナを出現させます。

void CreateKatana(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、カタナを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateKit

Home > Reference > Functions > Item Creation > CreateKit

CreateKit(object, object, int)

ランダム財宝分配システムの一部として、一般的なキットを出現させます。

void CreateKit(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

作成したアイテムを入れる入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベル＋nModifierに基づいてキットを作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateKukri

Home > Reference > Functions > Item Creation > CreateKukri

CreateKukri(object, object)

ランダム財宝分配システムの一部として、ククリを出現させます。

void CreateKukri(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ククリを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateLightCrossbow

Home > Reference > Functions > Item Creation > CreateLightCrossbow

CreateLightCrossbow(object, object)

ランダム財宝分配システムの一部として、ライトクロスボウを出現させます。

void CreateLightCrossbow(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ライトクロスボウを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateLightFlail

Home > Reference > Functions > Item Creation > CreateLightFlail

CreateLightFlail(object, object)

ランダム財宝分配システムの一部として、ライトフレイルを出現させます。

void CreateLightFlail(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ライトフレイルを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateLightHammer

Home > Reference > Functions > Item Creation > CreateLightHammer

CreateLightHammer(object, object)

ランダム財宝分配システムの一部として、ライトハンマーを出現させます。

void CreateLightHammer(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ライトハンマーを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Norkm, JP team: Rainie


Function - CreateLightMace

Home > Reference > Functions > Item Creation > CreateLightMace

CreateLightMace(object, object)

ランダム財宝分配システムの一部として、ライトメイスを出現させます。

void CreateLightMace(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ライトメイスを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateLockPick

Home > Reference > Functions > Item Creation > CreateLockPick

CreateLockPick(object, object, int)

ランダム財宝分配システムの一部として、盗賊道具を出現させます。

void CreateLockPick(
    object oTarget,
    object oAdventurer,
    int nModifier = 0
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値（デフォルト：0）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、盗賊道具を作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateLongbow

Home > Reference > Functions > Item Creation > CreateLongbow

CreateLongbow(object, object)

ランダム財宝分配システムの一部として、ロングボウを出現させます。

void CreateLongbow(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ロングボウを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateLongSword

Home > Reference > Functions > Item Creation > CreateLongSword

CreateLongSword(object, object)

ランダム財宝分配システムの一部として、ロングソードを出現させます。

void CreateLongSword(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ロングソードを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateMorningstar

Home > Reference > Functions > Item Creation > CreateMorningstar

CreateMorningstar(object, object)

ランダム財宝分配システムの一部として、モーニングスターを出現させます。

void CreateMorningstar(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、モーニングスターを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateObject

Home > Reference > Functions > Item Creation, Miscellaneous > CreateObject

CreateObject(int, string, location, int, string)

与えられた地点に指定した種類のobjectを作成します。

object CreateObject(
    int nObjectType,
    string sTemplate,
    location locLocation,
    int bUseAppearAnimation = FALSE
    string sNewTag = ""
);

Parameters

nObjectType

作成するobjectの種類（OBJECT_TYPE_*；使える物は限定されています。Remarksをみてください）

sTemplate

作成するobjectのブループリントResRef文字列

locLocation

objectを作成する位置

bUseAppearAnimation

それが現われる時、作成されたオブジェクトにアニメーションを使用させます。

sNewTag

新しいタグの名前(デフォルト： "")

Description

この関数はモジュール内の特定の位置に指定したobjectを作成させます。

この関数を使うことで、アイテム類、クリーチャー、配置物または商店等をあるイベントの発生に合わせて出現させることが可能になります。

パッチにより、sTamplateが無効な場合、

クリーチャーを作成しようとしたときはバッジャー（アナグマ）が、アイテムを作成しようとしたときはその他小物が作られます。パッチ1.30で確認したところ、少なくとも何かが作られるようになりました。

Remarks

nObjectTypeパラメーターには下記の定数のみが使用できます。

- OBJECT_TYPE_ITEM

- OBJECT_TYPE_CREATURE

- OBJECT_TYPE_PLACEABLE

- OBJECT_TYPE_STORE
- OBJECT_TYPE_WAYPOINT (パッチ1.30から)

sNewTagで新しいタグを付けていれば（デフォルトは""）、そのタグでオブジェクトが作成されます。

「sTemplate」には注意してください、さもないと貴方が望んでいる以上のアナグマが発生することになります。ResRefはツールセットと貴方のモジュールで、objectのパレットにおいてユニークキー（他に同じ物がない独特の文字列）です。スタンダードの配置物とクリーチャーのResRefが見たければ、画面内に配置したobjectを右クリックして、「プロパティ」オプションで見てください。配置していない、もしくは一番最良の方法は－ブループリントのパレットで「コピーを作成して編集」を使うことです。「コピーを作成して編集」は適切なobjectの詳細設定を見る事ができる為、非常に確実です。そこには例えば「SKELETON001」のようにブループリントResRefが書いてあります。

残念ながら、ツールセットはそういった動作をします。－ ブループリントのコピー(ブループリントを使用して作成されたオブジェクトのコピーではないもの)が、貴方が予期するかもしれないことを示します。よって、貴方のResRefは実際は新しいブループリント用にツールセットに作成された参照文字列（ResRef）です。－ プロパティスクリーンを取り消し、スクリプト･エディタに戻る際に即座に消えるもの。さらに混乱することに、標準のブループリントから作成されるobjectのデフォルトのtagは、ブループリントのResRefと同じで、TagをResRefと間違いへと導きかねません。

リソースのResRefを見つける最も簡単な方法は、「表示」メニューをクリックし、「プレビューウィンドゥの表示」メニューを選択することです。これはプレビューウィンドゥを開き、ResRefだけでなく、名前、Tag、そしてもしあればリソースの詳細なコメント等の詳細を表示します。既に配置しているobjectをクリックするか、ツールセットの様々なパレットからObjectを選択するかでプロパティを見ることができます。

Known Bugs

パッチ1.30より、bUseAppearAnimationがついに動くようになりました。ただし動作に若干おかしなところがあると報告されています。

Biowareによると、マップピン付きのウェイポイントを作る場合に問題があるそうです。

このことについてはパッチ1.31のリリースノートで言及されていないので、この問題が未解決かどうかはわかりません。

エリアのOnEnterイベントで、エリアに入ってきたのが何者であるかを調べないでクリーチャーObjectを作成する場合、NWNはクリーチャーを作りつづける無限ループへと陥ります（なぜなら作られたクリーチャーがそれぞれOnEnterイベントに設定されたスクリプト（（自分自身を作成した）クリーチャーを作成するスクリプト）を呼び出すからです）。

この問題は GetIsPC(GetEnteringObject()) を使うことにより避けることができます。

TRUEの場合にクリーチャーを作成し、FALSEの場合には作られたクリーチャーがイベントの他の部分を実行するようにします。

Version

1.31

Example

// 下記のスクリプトは次のウェイポイントにニワトリを作成する。
// 備考：以下のスクリプトはモジュール内に「Waypoint1」というタグを持つ
// ウェイポイントを使うことを必要とする。
// 「このプログラムを含むスクリプトを絶対にエリアの
//   OnEnter用イベントに用いないこと！！」（Known Bugsを参照）

int nObjectType = OBJECT_TYPE_CREATURE;
string strTemplate = "nw_chicken"; // スタンダードのニワトリ
location locLocation= GetLocation(GetObjectByTag("Waypoint1")); // ウェイポイントの位置を調べる
int bUseAppearAnimation = TRUE;
CreateObject(nObjectType, strTemplate, locLocation, bUseAppearAnimation);

See Also

functions: | ActionCreate | CopyObject | CreateObjectVoid
categories: | Item Creation Functions
constants: | OBJECT_TYPE_* Constants

author: Dave Withnall, editor: Charles Feduke, additional contributor(s): Jit Fong Oon, Jazael, Stephen Fritz, JP team: geshi, Rainie


Function - CreateObjectVoid

Home > Reference > Functions > Item Creation > CreateObjectVoid

CreateObjectVoid(int, string, location, int)

CreateObject()と似ていますが、作成したobjectを返しません。

void CreateObjectVoid(
    int nObjectType,
    string sTemplate,
    location lLoc,
    int bUseAppearAnimation = FALSE
);

Parameters

nObjectType

OBJECT_TYPE_*

sTemplate

作成するobjectのブループリントResRefの文字列。

lLoc

Objectを創造する場所

bUseAppearAnimation

それが現われる時、作成されたオブジェクトにアニメーションを使用させます。（デフォルト：FALSE）

Description

sTemplateで指定したブループリントResRefを持つObject（nObjectTypeで決定される）をlLocに作成します。これは本来のCreateObject()関数と似ていますが、CreateObjectVoid()は、この関数自身によって作成したobjectを返さない点で異なっています。

sTemplateが無効であった場合、下記のobjectが作成されます：
OBJECT_TYPE_ITEM - その他小物

OBJECT_TYPE_CREATURE - アナグマ

OBJECT_TYPE_PLACEABLE - 何も生じない

OBJECT_TYPE_STORE - 何も生じない

Remarks

nObjectTypeパラメーターには下記の定数のみが使用できます：
- OBJECT_TYPE_ITEM
- OBJECT_TYPE_CREATURE
- OBJECT_TYPE_PLACEABLE
- OBJECT_TYPE_STORE

Requirements

#include "nw_i0_2q4luskan"

Version

1.28

See Also

functions: | CreateObject
categories: | Item Creation Functions
constants: | OBJECT_TYPE_* Constants

author: Charles Feduke, JP team: Rainie


Function - CreatePersonalItemOn

Home > Reference > Functions > Get Data from Object > CreatePersonalItemOn

CreatePersonalItemOn(object)

提供されたNPC上に個人アイテムを作成します。

void CreatePersonalItemOn(
    object oAssassin
);

Parameters

oAssassin

個人アイテムを手に入れる暗殺者。

Description

SetPersonalItem()関数によってIDが設定されている個人アイテムを作成します。

Requirements

#include "nw_j_assassin"

Version

1.22

See Also

functions: | GetPersonalItem | PlayerHasPersonalItem | SetPersonalItem
categories: | Get Data from Object Functions

author: Tom Cassiotis, JP team: katsu794


Function - CreatePotion

Home > Reference > Functions > Item Creation > CreatePotion

CreatePotion(object, object, int)

ランダム財宝分配システムの一部として、ランダムなポーションを作成します。

void CreatePotion(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

レベルを参照するプレイヤーキャラクター

nModifier

財宝のレベルを上昇させる修正値

Description

この関数はoAdventurerのレベルとnModifierに基づき、入れ物の中にランダムなポーションを作成します。この関数はNWN財宝分配システムの一部です。

Requirements

#include "nw_o2_coninclude"

Version

1.28

See Also

categories: Item Creation Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): LeegleechN, JP team: Rainie


Function - CreateProtectionFromAlignmentLink

Home > Reference > Functions > Spell Casting Effects, Spells > CreateProtectionFromAlignmentLink

CreateProtectionFromAlignmentLink(int, int)

プロテクションフロムアライメントエフェクトを作ります。

effect CreateProtectionFromAlignmentLink(
    int nAlignment,
    int nPower = 1
);

Parameters

nAlignment

耐性の対象となるアライメント (ALIGNMENT_*)

nPower

プロテクトレベルの倍率 (デフォルト: 1)

Description

リンクエフェクトを作り、指定するアライメントからのプロテクションフロムアライメントのビジュアルアニメーションをします。

nPowerはプロテクション量の倍率です。基本倍率は指定したnAlignmentに対してACディフレクションボーナス+3、セービングスローボーナス+2（nPowerの値が3であれば、ACディフレクションボーナス+9、セービングスローボーナス+6）となります。

また、指定するアライメントの精神効果呪文に対する免疫効果を与えます。

Requirements

#include "nw_i0_spells"

Version

1.29

See Also

categories: | Spell Casting Effects Functions | Spells Functions
constants: | ALIGNMENT_* Constants

author: Charles Feduke, JP team: Redondo


Function - CreateRapier

Home > Reference > Functions > Item Creation > CreateRapier

CreateRapier(object, object)

ランダム財宝分配システムの一部として、レイピアを出現させます。

void CreateRapier(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、レイピアを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateScimitar

Home > Reference > Functions > Item Creation > CreateScimitar

CreateScimitar(object, object)

ランダム財宝分配システムの一部として、シミターを出現させます。

void CreateScimitar(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、シミターを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateScythe

Home > Reference > Functions > Item Creation > CreateScythe

CreateScythe(object, object)

ランダム財宝分配システムの一部として、サイズを出現させます。

void CreateScythe(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、サイズを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateShortbow

Home > Reference > Functions > Item Creation > CreateShortbow

CreateShortbow(object, object)

ランダム財宝分配システムの一部として、ショートボウを出現させます。

void CreateShortbow(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ショートボウを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateShortsword

Home > Reference > Functions > Item Creation > CreateShortsword

CreateShortsword(object, object)

ランダム財宝分配システムの一部として、ショートソードを出現させます。

void CreateShortsword(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ショートソードを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateShuriken

Home > Reference > Functions > Item Creation > CreateShuriken

CreateShuriken(object, object)

ランダム財宝分配システムの一部として、シュリケンを出現させます。

void CreateShuriken(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、シュリケンを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSickle

Home > Reference > Functions > Item Creation > CreateSickle

CreateSickle(object, object)

ランダム財宝分配システムの一部として、シックルを出現させます。

void CreateSickle(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、シックルを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSignPostNPC

Home > Reference > Functions > Module Specific > CreateSignPostNPC

CreateSignPostNPC(string, location)

アクションキューを使用してクリーチャーを生成します。

void CreateSignPostNPC(
    string sTag,
    location lLocal
);

Parameters

sTag

生成するクリーチャーのブループリントresref。

lLocal

クリーチャーを生成するロケーション。

Description

この関数の主な目的は、クリーチャーを生成するためにアクションキューを使用することです。

この関数は基本的に、CreateObject関数をクリーチャーのみ生成できるように単純化したものです。

CreateObject関数以上の主な有益点は、返す型がvoid型なので、ActionDoCommand関数を使用してアクションキューに配置できることです。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

Example

// 以下のスクリプトをクリーチャーのOnDamagedイベントに配置すれば
// クリーチャーは攻撃者から逃げて、
// 攻撃者を倒すために邪悪なイービルチキンの群れを召還するでしょう。

#include "NW_I0_GENERIC"

void main()
{
    string sCreature = "nw_chicken";

    object oAttacker = GetLastDamager();
    location locAttacker = GetLocation(oAttacker);

    ActionMoveAwayFromObject(oAttacker, TRUE, 20.0f);
    ActionDoCommand(CreateSignPostNPC(sCreature, locAttacker));
    ActionDoCommand(CreateSignPostNPC(sCreature, locAttacker));
    ActionDoCommand(CreateSignPostNPC(sCreature, locAttacker));
    ActionDoCommand(CreateSignPostNPC(sCreature, locAttacker));
}

See Also

categories: Module Specific Functions

author: Dave Withnall, editor: Tom Cassiotis, JP team: katsu794


Function - CreateSling

Home > Reference > Functions > Item Creation > CreateSling

CreateSling(object, object)

ランダム財宝分配システムの一部として、スリングを出現させます。

void CreateSling(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、スリングを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpear

Home > Reference > Functions > Item Creation > CreateSpear

CreateSpear(object, object)

ランダム財宝分配システムの一部として、スピアを出現させます。

void CreateSpear(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、スピアを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificDruidWeapon

Home > Reference > Functions > Item Creation > CreateSpecificDruidWeapon

CreateSpecificDruidWeapon(object, object, int)

ランダム財宝分配システムの一部として、特殊なドルイド武器を出現させます。

void CreateSpecificDruidWeapon(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、特殊なドルイド武器を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificExotic

Home > Reference > Functions > Item Creation > CreateSpecificExotic

CreateSpecificExotic(object, object)

ランダム財宝分配システムの一部として、特殊なエキゾチック武器を出現させます。

void CreateSpecificExotic(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、特殊なエキゾチック武器を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificHeavyArmor

Home > Reference > Functions > Item Creation > CreateSpecificHeavyArmor

CreateSpecificHeavyArmor(object, object)

ランダム財宝分配システムの一部として、特殊な重装鎧を出現させます。

void CreateSpecificHeavyArmor(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、特殊な重装鎧を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificLightArmor

Home > Reference > Functions > Item Creation > CreateSpecificLightArmor

CreateSpecificLightArmor(object, object)

ランダム財宝分配システムの一部として、特殊な軽装鎧を出現させます。

void CreateSpecificLightArmor(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、特殊な軽装鎧を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificMartial

Home > Reference > Functions > Item Creation > CreateSpecificMartial

CreateSpecificMartial(object, object)

ランダム財宝分配システムの一部として、特殊な軍用武器を出現させます。

void CreateSpecificMartial(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、特殊な軍用武器を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificMediumArmor

Home > Reference > Functions > Item Creation > CreateSpecificMediumArmor

CreateSpecificMediumArmor(object, object)

ランダム財宝分配システムの一部として、特殊な中装鎧を出現させます。

void CreateSpecificMediumArmor(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、特殊な中装鎧を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificMiscItem

Home > Reference > Functions > Item Creation > CreateSpecificMiscItem

CreateSpecificMiscItem(object, object)

ランダム財宝分配システムの一部として、特殊なアイテムを出現させます。

void CreateSpecificMiscItem(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、特殊なアイテムを作成します。特殊なアイテムは固有の名前を持つアイテムです。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificMonkWeapon

Home > Reference > Functions > Item Creation > CreateSpecificMonkWeapon

CreateSpecificMonkWeapon(object, object, int)

ランダム財宝分配システムの一部として、特殊なモンク武器を出現させます。

void CreateSpecificMonkWeapon(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PC Level Modifier

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、特殊なモンク武器を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificRodStaffWand

Home > Reference > Functions > Item Creation > CreateSpecificRodStaffWand

CreateSpecificRodStaffWand(object, object)

ランダム財宝分配システムの一部として、ロッド、スタッフ、ワンドを出現させます。

void CreateSpecificRodStaffWand(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ロッド、スタッフ、ワンドを作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificSimple

Home > Reference > Functions > Item Creation > CreateSpecificSimple

CreateSpecificSimple(object, object)

ランダム財宝分配システムの一部として、単純武器を出現させます。

void CreateSpecificSimple(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、単純武器を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateSpecificWizardWeapon

Home > Reference > Functions > Item Creation > CreateSpecificWizardWeapon

CreateSpecificWizardWeapon(object, object, int)

ランダム財宝分配システムの一部として、特殊なウィザード武器を出現させます。

void CreateSpecificWizardWeapon(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

Modifier for the PC Level

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、特殊なウィザード用武器を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateStaff

Home > Reference > Functions > Item Creation > CreateStaff

CreateStaff(object, object)

ランダム財宝分配システムの一部として、スタッフを出現させます。

void CreateStaff(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、スタッフを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateTable2Item

Home > Reference > Functions > Item Creation > CreateTable2Item

CreateTable2Item(object, object, int)

Object上にアイテムをランダムに作成します。

void CreateTable2Item(
    object oTarget,
    object oAdventurer,
    int nSpecific = 0
);

Parameters

oTarget

アイテムを受け取るObject（最も適しているのはインベントリーを持った配置物です）

oAdventurer

作成するアイテムを使わせたいPCのクラス

nSpecific

0であれば通常のアイテム、1であれば特殊なアイテムが作成されます。（デフォルト：0）

Description

* 高レベルにおいて、nSpecificが1であれば「固有の名前を持った」特殊なアイテムが出現します。

oAdventurerによって決定されるPCのクラスに基づきます。この関数はObject上にアイテムを作成するために使用する、CreateGenericHeavyArmorやCreateSpecificMartialのようなリストから１つをランダムに呼出します。

Remarks

nw_o2_coninclude.nssの4008行目で見つかります。

備考：PCのクラスはnw_i0_generic内のDetermineClassToUseと全く同じことをする関数であるnDetermineClassToUseを使うことで発見できます。それらの非常に便利な点は、異なる名前が与えられているため、スクリプト内にそれら両方のinclude fileを、duplicate function errorを起こすことなくincludeすることができます。（同じスクリプト内にnw_i0_plotとnw_i0_toolをincludeしてみてください。機能しないはずです。）

次に、見つかったクラスに依存して、アイテムの種類毎の確立が決定され、アイテムを作成する為にd100ロールが行われます。実際のアイテム生成はnw_i0_conincludeの中の他の関数を呼ぶことにより起こります。

Requirements

#include "nw_o2_coninclude"

Version

1.28

See Also

categories: Item Creation Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - CreateThrowingAxe

Home > Reference > Functions > Item Creation > CreateThrowingAxe

CreateThrowingAxe(object, object)

ランダム財宝分配システムの一部として、スローイングアックスを出現させます。

void CreateThrowingAxe(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、スローイングアックスを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateTrapKit

Home > Reference > Functions > Item Creation > CreateTrapKit

CreateTrapKit(object, object, int)

ランダム財宝分配システムの一部として、罠キットを出現させます。

void CreateTrapKit(
    object oTarget,
    object oAdventurer,
    int nModifier
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

nModifier

PCレベル修正値

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、罠キットを作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateTwoBladedSword

Home > Reference > Functions > Item Creation > CreateTwoBladedSword

CreateTwoBladedSword(object, object)

ランダム財宝分配システムの一部として、ツーブレーデッドソードを出現させます。

void CreateTwoBladedSword(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ツーブレーデッドソードを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - CreateWarhammer

Home > Reference > Functions > Item Creation > CreateWarhammer

CreateWarhammer(object, object)

ランダム財宝分配システムの一部として、ワーハンマーを出現させます。

void CreateWarhammer(
    object oTarget,
    object oAdventurer
);

Parameters

oTarget

アイテムを作成する入れ物

oAdventurer

プレイヤーオブジェクト

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、ワーハンマーを作成します。

Remarks

留意点：入れ物にのみ動作します。nw_o2_feat.nssで見つかります。

Requirements

#include "nw_o2_feat"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - d10

Home > Reference > Functions > Miscellaneous > d10

d10(int)

10面ダイスを振ります。

int d10(
    int nNumDice = 1
);

Parameters

nNumDice

振るダイスの数（デフォルト：1）

Description

nNumDice個のd10ダイスを振った合計を返します。

もしnNumdiceが1に満たない場合、1を使います。

Remarks

d10(10面ダイス)で、特定の数字が出る確立は10%です。

Version

1.22

See Also

functions: | d100 | d12 | d2 | d20 | d3 | d4 | d6 | d8 | Random
categories: | Miscellaneous Functions

author: Charles Feduke, JP team: Rainie


Function - d100

Home > Reference > Functions > Miscellaneous > d100

d100(int)

100面ダイスを振ります。

int d100(
    int nNumDice = 1
);

Parameters

nNumDice

振るダイスの数（デフォルト：1）

Description

nNumDice個のd100ダイスを振った合計を返します。これは通常％ダイスとして使われます。

もしnNumdiceが1に満たない場合、1を使います。

Remarks

d100(100面ダイス、または2つの10面ダイス)で、特定の数字が出る確立は1%です。

Version

1.22

See Also

functions: | d10 | d12 | d2 | d20 | d3 | d4 | d6 | d8 | Random
categories: | Miscellaneous Functions

author: Charles Feduke, JP team: Rainie


Function - d12

Home > Reference > Functions > Miscellaneous > d12

d12(int)

12面ダイスを振ります。

int d12(
    int nNumDice = 1
);

Parameters

nNumDice

振るダイスの数（デフォルト：1）

Description

nNumDice個のd12ダイスを振った合計を返します。

もしnNumdiceが1に満たない場合、1を使います。

Remarks

d12(12面ダイス)で、特定の数字が出る確立は約8.3%です。

Version

1.22

See Also

functions: | d10 | d100 | d2 | d20 | d3 | d4 | d6 | d8 | Random
categories: | Miscellaneous Functions

author: Charles Feduke, JP team: Rainie


Function - d2

Home > Reference > Functions > Miscellaneous > d2

d2(int)

2面ダイスを振ります（もしくはコインフリップ）。

int d2(
    int nNumDice = 1
);

Parameters

nNumDice

振るダイスの数（デフォルト：1）

Description

nNumDice個のd2ダイスを振った合計を返します。

もしnNumdiceが1に満たない場合、1を使います。

Remarks

d2(2面ダイス)で、特定の数字が出る確立は50%です。

Version

1.22

See Also

functions: | d10 | d100 | d12 | d20 | d3 | d4 | d6 | d8 | Random
categories: | Miscellaneous Functions

author: Charles Feduke, JP team: Rainie


Function - d20

Home > Reference > Functions > Miscellaneous > d20

d20(int)

20面ダイスを振ります。

int d20(
    int nNumDice = 1
);

Parameters

nNumDice

振るダイスの数（デフォルト：1）

Description

nNumDice個のd20ダイスを振った合計を返します。

もしnNumdiceが1に満たない場合、1を使います。

Remarks

d20(20面ダイス)で、特定の数字が出る確立は5％です。

Version

1.22

See Also

functions: | d10 | d100 | d12 | d2 | d3 | d4 | d6 | d8 | Random
categories: | Miscellaneous Functions

author: Charles Feduke, JP team: Rainie


Function - d3

Home > Reference > Functions > Miscellaneous > d3

d3(int)

3面ダイスを振ります。

int d3(
    int nNumDice = 1
);

Parameters

nNumDice

振るダイスの数（デフォルト：1）

Description

nNumDice個のd3ダイスを振った合計を返します。

もしnNumdiceが1に満たない場合、1を使います。

Remarks

d3(3面ダイス)で、特定の数字が出る確立は約33.3%です。

Version

1.22

See Also

functions: | d10 | d100 | d12 | d2 | d20 | d4 | d6 | d8 | Random
categories: | Miscellaneous Functions

author: Charles Feduke, JP team: Rainie


Function - d4

Home > Reference > Functions > Miscellaneous > d4

d4(int)

4面ダイスを振ります。

int d4(
    int nNumDice = 1
);

Parameters

nNumDice

振るダイスの数（デフォルト：1）

Description

nNumDice個のd4ダイスを振った合計を返します。

もしnNumdiceが1に満たない場合、1を使います。

Remarks

d4(4面ダイス)で、特定の数字が出る確立は25%です。

Version

1.22

See Also

functions: | d10 | d100 | d12 | d2 | d20 | d3 | d6 | d8 | Random
categories: | Miscellaneous Functions

author: Charles Feduke, JP team: Rainie


Function - d6

Home > Reference > Functions > Miscellaneous > d6

d6(int)

6面ダイスを振ります。

int d6(
    int nNumDice = 1
);

Parameters

nNumDice

振るダイスの数（デフォルト：1）

Description

nNumDice個のd6ダイスを振った合計を返します。

もしnNumdiceが1に満たない場合、1を使います。

Remarks

d6(6面ダイス)で、特定の数字が出る確立は16.6%です。

Version

1.22

See Also

functions: | d10 | d100 | d12 | d2 | d20 | d3 | d4 | d8 | Random
categories: | Miscellaneous Functions

author: Charles Feduke, JP team: Rainie


Function - d8

Home > Reference > Functions > Miscellaneous > d8

d8(int)

8面ダイスを振ります。

int d8(
    int nNumDice = 1
);

Parameters

nNumDice

振るダイスの数（デフォルト：1）

Description

nNumDice個のd10ダイスを振った合計を返します。

もしnNumdiceが1に満たない場合、1を使います。

Remarks

d8(8面ダイス)で、特定の数字が出る確立は12.5%です。

Version

1.22

See Also

functions: | d10 | d100 | d12 | d2 | d20 | d3 | d4 | d6 | Random
categories: | Miscellaneous Functions

author: Charles Feduke, JP team: Rainie


Function - dbCreateItemOnObject

Home > Reference > Functions > Debug, Item Creation > dbCreateItemOnObject

dbCreateItemOnObject(string, object, int)

この関数は、NWN宝分配システム用のアイテムを作成します。

void dbCreateItemOnObject(
    string sItemTemplate,
    object oTarget = OBJECT_SELF,
    int nStackSize = 1
);

Parameters

sItemTemplate

作成するアイテムのブループリントのresref（これが空白の文字列であった場合、"Brent"と報告されるでしょう。）

oTarget

アイテムを作成させたいインベントリー（デフォルト：OBJECT_SELF）

nStackSize

作るアイテムの個数（デフォルト：1）

Description

この関数は、デバッグを支援するために作られ、最終的に、NWN宝分配システム用アイテムを現実に作成する機能になりました。

Requirements

#include "nw_o2_coninclude"

Version

1.29

See Also

functions: | CreateItemOnObject
categories: | Debug Functions | Item Creation Functions

author: Michael Nork, editor: Charles Feduke, JP team: Rainie


Function - dbSpeak

Home > Reference > Functions > Debug > dbSpeak

dbSpeak(string)

無効果の実装がされたデバッグ関数。

void dbSpeak(
    string s
);

Parameters

s

Description

この関数は、SpeakString(s:String)を要約する目的でBioWareの開発者によって作成された、違った意味で便利な関数の例です。

Remarks

nw_o0_itemmaker.nss

Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

categories: Debug Functions

author: Michael Nork, JP team: katsu794


Function - DebugPrintTalentID

Home > Reference > Functions > Debug, Talents/Skills/Feats > DebugPrintTalentID

DebugPrintTalentID(talent)

指定された能力（Talent）のID

void DebugPrintTalentID(
    talent tTalent
);

Parameters

tTalent

Description

モジュール内で使用された能力のデバッグを支援するために使われることが多いでしょう。ネヴァーウィンターナイツのフォルダ内の\logsフォルダで見つかるでしょう。

Version

1.22

See Also

functions: | WriteTimestampedLogEntry
categories: | Debug Functions | Talents/Skills/Feats Functions

author: Jody Fletcher, editor: Charles Feduke, JP team: Rainie


Function - DebugSpeak

Home > Reference > Functions > Debug > DebugSpeak

DebugSpeak(string)

デバッギングのために文字列を話します。

void DebugSpeak(
    string sMessage
);

Parameters

sMessage

話すメッセージ。

Description

単にデフォルトのボリュームでSpeakString関数を呼び出すだけです。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | SpeakString
categories: | Debug Functions

author: Tom Cassiotis, JP team: katsu794


Function - DebugSTR

Home > Reference > Functions > Debug > DebugSTR

DebugSTR(string)

Biowareによって作成されたデバッグ関数です。

void DebugSTR(
    string s
);

Parameters

s

話す文字列。

Description

この関数は、多分デバッギングのためにSpeakString関数を要約します。

Remarks

Found in nw_i0_assoc.nss

Requirements

#include "nw_i0_assoc"

Version

1.22

See Also

categories: Debug Functions

author: Michael Nork, JP team: katsu794


Function - DecrementRemainingFeatUses

Home > Reference > Functions > Talents/Skills/Feats > DecrementRemainingFeatUses

DecrementRemainingFeatUses(object, int)

クリーチャーの指定した特技の使用残数を返します。

void DecrementRemainingFeatUses(
    object oCreature,
    int nFeat
);

Parameters

oCreature

特技使用残数を返すクリーチャー

nFeat

FEAT_*

Description

oCreatureで指定したクリーチャーの指定特技（FEAT_* 定数）の1日当たりの使用残数を返します。

Remarks

返すことが出来る使用残数を持つ特技を少なくとも1つ持ってなければなりません。

Version

1.27

See Also

categories: | Talents/Skills/Feats Functions
constants: | FEAT_* Constants

author: Charles Feduke, JP team: Rainie


Function - DecrementRemainingSpellUses

Home > Reference > Functions > Spells > DecrementRemainingSpellUses

DecrementRemainingSpellUses(object, int)

指定したクリーチャーの指定した呪文の使用回数を減少させます。

void DecrementRemainingSpellUses(
    object oCreature,
    int nSpell
);

Parameters

oCreature

指定した呪文の呪文残数を減少させるクリーチャー

nSpell

SPELL_*

Description

あるクリーチャーの1日当たりの１種類の呪文残数を減少させる。この関数を動作させるためにはクリーチャーは少なくとも1つの呪文を所有している必要があります。

Remarks

パッチ1.28以前ではこの関数は適切に働かず、通常どおり呪文をキャストしました。

Version

1.28

See Also

categories: | Spells Functions
constants: | SPELL_* Constants

author: Charles Feduke, JP team: Rainie


Function - DelayCommand

Home > Reference > Functions > Action on Object, Time > DelayCommand

DelayCommand(float, action)

一定時間アクションすることを遅らせます。

void DelayCommand(
    float fSeconds,
    action aActionToDelay
);

Parameters

fSeconds

行動を遅らせる秒数

aActionToDelay

アクションキュー内の遅らせるアクション

Description

aActionToDelayをfSecondsだけ遅らせます。エラーが生じた場合、ログファイルに"DelayCommand failed."と残ります。

Remarks

DelayCommand()は、１日（ゲーム時間）の限界がなくなりました。

KnownBugs

DelayCommandはエリアをまたがって実行することはできません。DelayCommandがあるエリアで開始され、そのエリアがアンロードされ新しいエリアに移動した場合、遅らせられた行動は失われます。

Version

1.31

See Also

functions: | ActionWait | ClearAllActions
categories: | Action on Object Functions | Time Functions

author: Charles Feduke, additional contributor(s): Dieter, JP team: geshi, Rainie


Function - DeleteCampaignVariable

Home > Reference > Functions > Database > DeleteCampaignVariable

DeleteCampaignVariable(string, string, object)

データベースからキャンペーン変数を削除します。

void DeleteCampaignVariable(
    string sCampaignName,
    string sVarName,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

削除する変数のキャンペーン（大文字/小文字は区別されます）

sVarName

削除する変数名

oPlayer

変数を削除するプレイヤー（デフォルト：OBJECT_INVALID）

Description

データベース中の様々な種類のキャンペーン変数を削除します。

Remarks

通常データベースの標準ではデータベースからエントリーは削除されず、フラグのみが削除される事に注意してください。データベースのファイルのサイズがこのコマンドによって小さくなるとは思わないで下さい。データベースを「パック」したければ、ゲームの外部から行う必要があります。

ゲームの外部でデータベース中の削除された変数を元に戻す方法はわかりません。

Version

1.30

See Also

categories: Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - DeleteLocalFloat

Home > Reference > Functions > Local Variables > DeleteLocalFloat

DeleteLocalFloat(object, string)

オブジェクトに保持した浮動小数型のローカル変数を削除（開放）する。

void DeleteLocalFloat(
    object oObject,
    string sVarName
);

Parameters

oObject

変数を保存する対象オブジェクト

sVarName

削除する変数の名称

Description

oObjectに定義されたsVarNameという名前の浮動小数型の項目を削除・開放する。

Version

1.22

Example

// このスクリプトをエリアのOnEnterイベントに設定する。
// 入ってきたオブジェクトがプレイヤーであるかチェックし、
// ＰＣであれば浮動小数型ローカル変数fTimerを削除する。
object oPC = GetEnteringObject();
if (GetIsPC(oPC))
{
  DeleteLocalFloat(oPC, "fDegrees");
}

See Also

categories: Local Variables Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: ngtaicho


Function - DeleteLocalInt

Home > Reference > Functions > Local Variables > DeleteLocalInt

DeleteLocalInt(object, string)

オブジェクトに設定された整数型のローカル変数を削除・開放する。

void DeleteLocalInt(
    object oObject,
    string sVarName
);

Parameters

oObject

変数を保存する対象オブジェクト

sVarName

削除する変数の名称

Description

oObjectに定義されたsVarNameという名称の整数型ローカル変数を削除・開放する。

Version

1.22

Example

// 会話しているプレイヤーの整数型ローカル変数nCounterを削除する。
object oPC = GetPCSpeaker();
DeleteLocalInt(oPC, "nCounter");

See Also

categories: Local Variables Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: ngtaicho


Function - DeleteLocalLocation

Home > Reference > Functions > Local Variables > DeleteLocalLocation

DeleteLocalLocation(object, string)

オブジェクトに保持したロケーション変数を削除・開放する。

void DeleteLocalLocation(
    object oObject,
    string sVarName
);

Parameters

oObject

変数を保存する対象オブジェクト

sVarName

削除する変数の名称

Description

oObjectに定義されたsVarNameという名称のロケーション変数（位置情報）を削除・開放する。

Version

1.22

Example

// エリアのロケーション変数lMarkerを削除・開放する。
object oArea = GetArea(OBJECT_SELF);
DeleteLocalLocation(oArea, "lMarker");

See Also

categories: Local Variables Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: ngtaicho


Function - DeleteLocalObject

Home > Reference > Functions > Local Variables > DeleteLocalObject

DeleteLocalObject(object, string)

オブジェクトに定義されたオブジェクト変数を削除・開放する

void DeleteLocalObject(
    object oObject,
    string sVarName
);

Parameters

oObject

変数を保存する対象オブジェクト

sVarName

削除する変数の名称

Description

oObjectに定義されたsVarNameという名称のオブジェクト変数を削除・開放する。

Version

1.22

Example

// モジュールを終了するときＰＣのローカルオブジェクト変数oFootlovkerを削除・開放する
object oPC = GetExitingObject();
if (GetIsPC(oPC))
{
  DeleteLocalObject(oPC, "oFootlocker");
}

See Also

categories: Local Variables Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: ngtaicho


Function - DeleteLocalString

Home > Reference > Functions > Local Variables > DeleteLocalString

DeleteLocalString(object, string)

オブジェクトに定義された文字列型変数を削除・開放する

void DeleteLocalString(
    object oObject,
    string sVarName
);

Parameters

oObject

変数を保存する対象オブジェクト

sVarName

削除する変数の名称

Description

oObjectに定義されたsVarNameという名称の文字列型変数を削除・開放する

Version

1.22

Example

// sTeamNameという文字列型変数を削除する
DeleteLocalString(OBJECT_SELF, "sTeamName");

See Also

categories: Local Variables Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: ngtaicho


Function - DestroyAllPersonalItems

Home > Reference > Functions > Henchmen/Familiars/Summoned > DestroyAllPersonalItems

DestroyAllPersonalItems(object)

全てのヘンチマンアイテムを破壊します。

void DestroyAllPersonalItems(
    object oPC
);

Parameters

oPC

Description

公式キャンペーン中で、oPCがヘンチマンから受け取った契約の証を全て破壊します。

Remarks

nw_i0_henchman.nssの222行目で見つかります。

公式キャンペーン中で、oPCがヘンチマンから受け取った契約の証を全て破壊します。我々が使うには少し厳しいです。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

functions: | StripAllPersonalItemsFromEveryone
categories: | Henchmen/Familiars/Summoned Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - DestroyCampaignDatabase

Home > Reference > Functions > Database > DestroyCampaignDatabase

DestroyCampaignDatabase(string)

キャンペーンデータベースを削除します。

void DestroyCampaignDatabase(
    string sCampaignName
);

Parameters

sCampaignName

削除するキャンペーンデータベース

Description

HDDからキャンペーンデータベースを削除します。キャンペーンデータベースはコンピューター上の「ごみ箱」には送られません。

Remarks

データベースはNWNがインストールされたフォルダにあるdatabaseフォルダ内のファイルからなります。データベース毎に「database1」や「database2」等と名付けられた独自のファイルを使用します。それらは物理的に異なったファイルですので、１つを削除する事でその他のファイルに影響はありません。

キャンペーンデータベースを削除した後、ファイルを戻す方法がない事に注意してください。

Version

1.30

See Also

categories: Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - DestroyChapterQuestItem

Home > Reference > Functions > Henchmen/Familiars/Summoned > DestroyChapterQuestItem

DestroyChapterQuestItem(int, object)

特定した章のヘンチマン用クエストで必要なアイテムを破壊します。

void DestroyChapterQuestItem(
    int nChapter,
    object oPC
);

Parameters

nChapter

公式キャンペーンの章

oPC

破壊するアイテムを持つプレイヤー

Description

特定した章のヘンチマン用クエストで必要なアイテムを破壊します。

Remarks

nw_i0_henchman.nssの475行目で見つかります。

備考：OBJECT_SELFのタグを使用しますので、Biowareはヘンチマン自身のスクリプトに入れてのみ使用しています。実際に、我々が有効にこの関数を使用する方法がお思いつきません。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

categories: Henchmen/Familiars/Summoned Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - DestroyChapterRewardItem

Home > Reference > Functions > Henchmen/Familiars/Summoned > DestroyChapterRewardItem

DestroyChapterRewardItem(int, object)

特定した章のヘンチマン用クエストの報酬アイテムを破壊します。

void DestroyChapterRewardItem(
    int nChapter,
    object oPC
);

Parameters

nChapter

公式キャンペーンの章

oPC

破壊するアイテムを持つプレイヤー

Description

特定した章のヘンチマン用クエストの報酬アイテムを破壊します。

Remarks

nw_i0_henchman.nssの484行目で見つかります。

備考：OBJECT_SELFのタグを使用しますので、Biowareはヘンチマン自身のスクリプトに入れてのみ使用しています。実際に、我々が有効にこの関数を使用する方法がお思いつきません。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

categories: Henchmen/Familiars/Summoned Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - DestroyObject

Home > Reference > Functions > Action on Object > DestroyObject

DestroyObject(object, float)

オブジェクトを破壊します。

void DestroyObject(
    object oDestroy,
    float fDelay = 0.0f
);

Parameters

oDestroy

破壊するオブジェクト。

fDelay

オブジェクトが破壊されるまでの猶予時間(秒) (デフォルト: 0.0f)

Description

oObjectを破壊します。取消はききません。モジュールやエリアには機能しません。

Remarks

スクリプトがこの関数の呼び出しを完了した後に、オブジェクトの破壊が行われます。

オブジェクトが破壊不能(死の時だけに影響する仕様によると)に設定されている場合は、そのオブジェクトはDestroyObject関数の影響を受けません。それ故に、オブジェクトが死ぬ瞬間にSetIsDestroyable(False)と設定されていることが重要です。

Version

1.28

See Also

functions: | ActionUnequipItem
categories: | Action on Object Functions

author: Charles Feduke, editor: Jody Fletcher, additional contributor(s): Tim Fletcher, JP team: katsu794


Function - DetermineAssociateCombatRound

Home > Reference > Functions > Core AI, Prototyped but Unused > DetermineAssociateCombatRound

DetermineAssociateCombatRound()

この関数は使用できません。

void DetermineAssociateCombatRound();

Description

この関数はnw_i0_assoc.nssの中にあり、そのインクルードファイルが機能しない原因となっています。関数のソースコードはこのようになっています：

void DetermineAssociateCombatRound()
{
int nClass = GetClassByPosition(1);
DetermineCombatRound(nClass);
DebugSTR("I should be fighting");
}

DetermineCombatRound関数は、整数が代入される前にオブジェクトを必要とします。実際に、nw_i0_assocをインクルードするスクリプトをコンパイルしてみると、コンパイルエラーになるでしょう。

Remarks

nw_i0_assoc.nssの23行目にあります。

Known Bugs

機能しません。

Requirements

#include "nw_i0_assoc"

Version

1.28

See Also

functions: | DetermineCombatRound
categories: | Core AI Functions | Prototyped but Unused Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - DetermineClassToUse

Home > Reference > Functions > Combat, Get Data from Creature > DetermineClassToUse

DetermineClassToUse()

NPCのキャラクタークラスを見て、戦闘中にどれを使用するべきであるか決めます。

int DetermineClassToUse();

Description

DetermineCombatRound関数の中で使われたNPCのクラスを返します。

3つのクラススロットをすべて調べて、３つの中でどれが一番高いかを比較して決定します。

Remarks

どのクラスを送るかを任意に選択します。

Requirements

#include "NW_O2_CONINCLUDE"

Version

1.22

See Also

functions: | DetermineCombatRound
categories: | Combat Functions | Get Data from Creature Functions

author: Jody Fletcher, JP team: marshall
Send comments on this top ic.


Function - DetermineCombatRound

Home > Reference > Functions > Combat, Core AI > DetermineCombatRound

DetermineCombatRound(object, int)

特定のラウンドの間にとるNPCの行動を決定します。

void DetermineCombatRound(
    object oIntruder = OBJECT_INVALID,
    int nAIDifficulty = 10
);

Parameters

oIntruder

(デフォルト: OBJECT_INVALID)

nAIDifficulty

使用しません（デフォルト：10）

Description

この関数は一般的に含まれる主要スクリプトから呼出される主要な関数です。この関数は実際にスクリプトを書く代わりに使われます。この関数は、NPCの呪文詠唱能力やその他の可能なアクションを検査します。

Requirements

#include "NW_I0_GENERIC"

Version

1.28

See Also

functions: | ActionAttack | chooseTactics | DetermineAssociateCombatRound | DetermineClassToUse
categories: | Combat Functions | Core AI Functions
events: | OnPhysicalAttacked Event

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Tim Stokman, JP team: Rainie


Function - DetermineEnemies

Home > Reference > Functions > Combat Information, Perception > DetermineEnemies

DetermineEnemies()

知覚している敵対相手の数とそのレベルの総計を返します。

struct DetermineEnemies();

Description

NPCが敵対している相手の種類を４つのカテゴリを使って決定します。４つのカテゴリとは、fighter系、cleric系、mage系、そしてmonster系です。敵対相手のクラスを決定するために、知覚しているクリーチャーの1つ目のクラススロットのみを利用します。

Remarks

fighter系として扱うのは次のクラスです：バーバリアン、ファイター、モンク、パラディン、レンジャー、ローグ、動物、野獣、コモナー、人造、エレメンタル、巨人、人怪、変身生物、蟲

cleric系として扱うのは次のクラスです：クレリック、ドルイド

mage系として扱うのは次のクラスです：バード、ソーサラー、ウィザード、フェイ

monster系として扱うのは次のクラスです：異形、ドラゴン、魔法生物、来訪者

DetermineEnemiesによって使用されるstructはsEnemiesと呼ばれ、このように見えます。（MONTERS_LEVELSの綴り間違いはBiowareのであって、ここが間違ってるわけではありません）：
{
int FIGHTERS;
int FIGHTER_LEVELS;
int CLERICS;
int CLERIC_LEVELS;
int MAGES;
int MAGE_LEVELS;
int MONSTERS;
int MONTERS_LEVELS;
int TOTAL;
int TOTAL_LEVELS;
};

Requirements

#include "NW_I0_GENERIC"

Version

1.28

Example

#include "nw_i0_generic"

void main()
{
struct sEnemies strEnemies=DetermineEnemies();

//相手にファイター系は何人いるか
int nFighters=strEnemies.FIGHTERS;

//その合計レベルは
int nFighterLevels=strEnemies.FIGHTER_LEVELS;

//相手にクレリック系は何人いるか
int nClerics=strEnemies.CLERICS;

//その合計レベルは
int nClericLevels=strEnemies.CLERIC_LEVELS;

//相手に魔法使い系は何人いるか
int nMages=strEnemies.MAGES;

//その合計レベルは
int nMageLevels=strEnemies.MAGE_LEVELS;

//相手にモンスター系は何人いるか
int nMonsters=strEnemies.MONSTERS;

//その合計レベルは
//MONTERSとなっていますが、これはBiowareのスペルミスです。
int nMonsterLevels=strEnemies.MONTERS_LEVELS;

//相手の合計人数は
//（これまでのトータル人数）
int nTotal=strEnemies.TOTAL;

//相手の合計レベルは
int nTotalLevels=strEnemies.TOTAL_LEVELS;

}

See Also

functions: | TalentAdvancedProtectSelf
categories: | Combat Information Functions | Perception Functions

author: Jody Fletcher, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, Rainie


Function - DetermineSpecialBehavior

Home > Reference > Functions > Core AI > DetermineSpecialBehavior

DetermineSpecialBehavior(object)

クリーチャーのデフォルトの行動を無効にして、特別の行動をとらせます。

void DetermineSpecialBehavior(
    object oIntruder = OBJECT_INVALID
);

Parameters

oIntruder

行動を決定するオブジェクト。(デフォルト: OBJECT_INVALID)

Description

クリーチャーに対し、視覚的に感知され敵と見なされた最も近くにいるクリーチャーへ決まった行動をするよう強います。

oIntruderは、クリーチャーがomnivore(NW_FLAG_BEHAVIOR_OMNIVORE設定の行動を持っている)であり、かつ最も近くに敵クリーチャーがはっきり視認されている場合のみテストされています。

基本的にこの関数は、クリーチャーがNW_FLAG_BEHAVIOR_OMNIVORE(omnivore - 植物と動物の両方(そして明らかにPCも)食べる)、NW_FLAG_BEHAVIOR_HERBIVORE(植物だけ食べる)、またはどちらでもない(NW_FLAG_CARNIVOREか行動が設定されていない)のいずれの状態であるか、そして、攻撃する、逃げる、または、歩くかを決定します。

omnivore状態の者は、非ドルイドと非レンジャーを攻撃し、herbivore状態の者は、非ドルイドと非レンジャーから逃げ、その他の全ての者はただ歩くだけです。

通常、OBJECT_SELF上のNW_FLAG_BEHAVIOR_SPECIAL定数を調べる(GetBehaviorState(int)関数を使用します)と、デフォルトのスクリプトでこの関数によって設定された結果が返されます。

DetermineSpecialBehavior関数は、OBJECT_SELFに適用しますので、クリーチャーのOnDamagedスクリプトに配置されるべきであり、例えば、クリーチャーを最後に攻撃した者や、すみかを侵略した者を攻撃させる時に使用されます。

Requirements

#include "NW_I0_GENERIC"

Version

1.28

See Also

functions: | GetBehaviorState | SetBehaviorState
categories: | Core AI Functions
constants: | NW_FLAG_BEHAVIOR_* Constants
events: | OnDamaged Event | OnDisturbed Event

author: Jody Fletcher, editor: Charles Feduke, JP team: katsu794


Function - DimensionHop

Home > Reference > Functions > Combat Actions > DimensionHop

DimensionHop(object)

ある地点から他のクリーチャーの場所へと即座にキャラクターをテレポートします。

void DimensionHop(
    object oTarget
);

Parameters

oTarget

テレポートする地点となるクリーチャー

Description

この関数の呼出者を派手なグラフィックと共にoTargetの場所へとテレポートさせます。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Combat Actions Functions

author: Tom Cassiotis, JP team: Rainie


Function - DoDoorAction

Home > Reference > Functions > Action on Object > DoDoorAction

DoDoorAction(object, int)

対象のドアに指定したアクションをさせます。

void DoDoorAction(
    object oTargetDoor,
    int nDoorAction
);

Parameters

oTargetDoor

アクションさせるドア。

nDoorAction

DOOR_ACTION_*

Description

oTargetDoorに nDoorAction をさせます。

Version

1.22

See Also

categories: | Action on Object Functions
constants: | DOOR_ACTION_* Constants

author: Jody Fletcher, JP team: katsu794


Function - DoFollowMaster

Home > Reference > Functions > Henchmen/Familiars/Summoned > DoFollowMaster

DoFollowMaster()

維持するように指示された距離よりも遠ければ、ヘンチマンを主人に接近させます。

void DoFollowMaster();

Description

維持するように指示された距離よりも遠ければ、ヘンチマンを主人に接近させます。

Remarks

nw_i0_assoc.nssの25行目で見つかります。

この関数を使用して、恐らく正常に動作している間、nw_i0_assocを使用しないでしょう。なぜなら、そのIncludeファイルは、これをIncludeして使用した如何なるスクリプトもコンパイルできないことを意味するエラーを持つ事実があるからです。

Known Bugs

nw_i0_assocからは動作しないでしょう。理由はRemarksに示しました。

Requirements

#include "nw_i0_assoc"

Version

1.28

See Also

functions: | GetBehind
categories: | Henchmen/Familiars/Summoned Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, Rainie


Function - DoGiveXP

Home > Reference > Functions > Experience > DoGiveXP

DoGiveXP(string, int, object, int)

XPを分配する設定規則に従って、PCに指定のXPを与えます。

void DoGiveXP(
    string sJournalTag,
    int nPercentage,
    object oTarget,
    int nQuestAlignment = ALIGNMENT_NEUTRAL
);

Parameters

sJournalTag

経験値を得る為に使用するジャーナルのタグ

nPercentage

与えるXPの比率（100で100%）

oTarget

XPを与える対象

nQuestAlignment

ALIGNMENT_* (デフォルト: ALIGNMENT_NEUTRAL)

Description

XPを分配する設定規則に従って、PCに指定のXPを与えます。

Remarks

経験値を増減させるoTargetのアラインメントに関して、クエストのアラインメントを使用します。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: | Experience Functions
constants: | ALIGNMENT_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - DoLevelUp

Home > Reference > Functions > Henchmen/Familiars/Summoned > DoLevelUp

DoLevelUp(object, object)

ヘンチマンのレベルをPCに近づけるようにNPCをレベルアップさせます。

void DoLevelUp(
    object oPC,
    object oHenchman = OBJECT_SELF
);

Parameters

oPC

レベルアップを導くPC

oHenchman

レベルアップさせるNPC（デフォルト：OBJECT_SELF）

Description

oHenchmanをoPCより1低いレベルにまで上げます。

Remarks

ヘンチマン上に格納された全てのローカル変数は失われません。これらはヘンチマンが破壊され、新しい高レベルのヘンチマンを再出現する前に、PCへとコピーされます。

Requirements

#include "nw_i0_henchman"

Version

1.29

See Also

categories: Henchmen/Familiars/Summoned Functions

author: Charles Feduke, JP team: Rainie


Function - DoOnce

Home > Reference > Functions > Module Specific > DoOnce

DoOnce()

ある事がなされているかどうかを調べます。

int DoOnce();

Description

ローカル変数(NW_L_DOONCE999)が設定されていない場合、TRUEを返し、変数を設定します。変数が設定されている場合、FALSEを返します。

Remarks

この関数がTRUEを返すのは、オブジェクトから呼ばれた時一度だけです。(OBJECT_SELFにローカル変数を設定します。)

この関数を一般的に利用すると失敗するでしょう。使用しないことをお奨めします。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - DoPlaceableObjectAction

Home > Reference > Functions > Action on Object > DoPlaceableObjectAction

DoPlaceableObjectAction(object, int)

配置用オブジェクトに特定のアクションをさせます。

void DoPlaceableObjectAction(
    object oPlaceable,
    int nPlaceableAction
);

Parameters

oPlaceable

nPlaceableAction

PLACEABLE_ACTION_*

Description

oPlaceableに nPlaceableAction をさせます。

Version

1.22

See Also

categories: | Action on Object Functions
constants: | PLACEABLE_ACTION_* Constants

author: Jody Fletcher, JP team: katsu794


Function - DoSinglePlayerAutoSave

Home > Reference > Functions > Module, PC Only > DoSinglePlayerAutoSave

DoSinglePlayerAutoSave()

シングルプレイヤーゲームをセーブさせます。

void DoSinglePlayerAutoSave();

Description

保存されたファイルは、[AutoSave]として自動的に加えられます。モジュールがシングルプレイヤーにプレイされてる時のみ機能します。

Version

1.22

See Also

categories: Module Functions | PC Only Functions

author: Jody Fletcher, JP team: Rainie


Function - DrinkIt

Home > Reference > Functions > Miscellaneous > DrinkIt

DrinkIt(object)

クリーチャーにそれらがアルコールを飲んだことを示す文字列を話させます。

void DrinkIt(
    object oTarget
);

Parameters

oTarget

酔っ払ったメッセージを話させるクリーチャー

Description

クリーチャーにそれらがアルコールを飲んだことを示すstringを話させます。

Remarks

これはビジュアルエフェクトを伴うのですが、現在は単にoTargetに文字列を話させるだけです。

Requirements

#include "nw_s3_alcohol"

Version

1.22

Example

// この関数のv1.24ソース
void DrinkIt(object oTarget)
{
   // AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_FIREFORGET_DRINK));
   AssignCommand(oTarget,ActionSpeakStringByStrRef(10499));
}

See Also

categories: Miscellaneous Functions

author: Tom Cassiotis, JP team: Rainie


Function - DubugPrintTalentID

Home > Reference > Functions > Debug > DubugPrintTalentID

DubugPrintTalentID(talent)

何もしません。

void DubugPrintTalentID(
    talent tTalent
);

Parameters

tTalent

Description

何もしません。

Remarks

nw_i0_generic.nssの144行目にあります。

この関数のコンテンツはコメントアウトされています。この関数はデバッギングにおいて使用されたと思われます。(実際、nw_i0_genericスクリプト内で何回か呼ばれています。)

コメントアウトされる以前において、この関数が行うことはtTalentのidが含まれたログに項目を書き出すことでした。

Requirements

#include "nw_i0_generic"

Version

1.28

See Also

categories: Debug Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - EffectAbilityDecrease

Home > Reference > Functions > Effects > EffectAbilityDecrease

EffectAbilityDecrease(int, int)

指定された能力値を減少させます

effect EffectAbilityDecrease(
    int nAbility,
    int nModifyBy
);

Parameters

nAbility

ABILITY_*

nModifyBy

これは減少させる能力値の量です

Description

objectの指定した能力値からnModifyByで指定された量を減少させます。nModifyByは正数10未満でなくてはなりません。；もし負数ならば何も起こりません。

Version

1.26

Example

// effectを適用するobjectです。
object oTarget = OBJECT_SELF;
// 適用するeffectを作成します。
effect eDrain = EffectAbilityDecrease(ABILITY_STRENGTH, 1);
// 適用するvisualeffectを作成します。
effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
// objectにeffectを適用します。
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oTarget);
// objectにvisualeffectを適用します。
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);

See Also

functions: | ApplyEffectToObject | EffectAbilityIncrease | EffectAttackDecrease | EffectAttackIncrease
categories: | Effects Functions
constants: | ABILITY_* Constants

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Matthew Miller, Jeremy Hinkle, JP team: akito


Function - EffectAbilityIncrease

Home > Reference > Functions > Effects > EffectAbilityIncrease

EffectAbilityIncrease(int, int)

objectの指定した能力値を増大させます

effect EffectAbilityIncrease(
    int nAbilityToIncrease,
    int nModifyBy
);

Parameters

nAbilityToIncrease

ABILITY_*

nModifyBy

増大させる能力値の量

Description

objectの能力値は最高10までの指定された量を修正されます

Version

1.26

See Also

functions: | ApplyEffectToObject | EffectAbilityDecrease | EffectAttackDecrease | EffectAttackIncrease
categories: | Effects Functions
constants: | ABILITY_* Constants

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Jeremy Hinkle, JP team: akito


Function - EffectACDecrease

Home > Reference > Functions > Effects, Spell Casting Effects, Spells, Talents/Skills/Feats > EffectACDecrease

EffectACDecrease(int, int, int)

ACを減少させます。

effect EffectACDecrease(
    int nValue,
    int nModifyType = AC_DODGE_BONUS,
    int nDamageType = AC_VS_DAMAGE_TYPE_ALL
);

Parameters

nValue

AC減少の値

nModifyType

AC_* (Default: AC_DODGE_BONUS)

nDamageType

DAMAGE_TYPE_* (Default: AC_VS_DAMAGE_TYPE_ALL)

Description

このeffectはobjectからボーナスACの指定された量を削除するために設定します。削除されるボーナスACのタイプはnModifyTypeで決まります。

Remarks

このファンクションではnDamageTypeは常にディフォルトを使用するべきです。

Version

1.22

See Also

functions: | ApplyEffectAtLocation | ApplyEffectToObject | EffectACIncrease | EffectAttackDecrease | EffectAttackIncrease
categories: | Effects Functions | Spell Casting Effects Functions | Spells Functions | Talents/Skills/Feats Functions
constants: | AC_* Constants | DAMAGE_TYPE_* Constants

author: Jody Fletcher, JP team: akito


Function - EffectACIncrease

Home > Reference > Functions > Effects, Spell Casting Effects, Spells, Talents/Skills/Feats > EffectACIncrease

EffectACIncrease(int, int, int)

ACボーナスをobjectに与えます。

effect EffectACIncrease(
    int nValue,
    int nModifyType = AC_DODGE_BONUS,
    int nDamageType = AC_VS_DAMAGE_TYPE_ALL
);

Parameters

nValue

AC増加の値

nModifyType

AC_*_BONUS (Default: AC_DODGE_BONUS)

nDamageType

DAMAGE_TYPE_* (Default: AC_VS_DAMAGE_TYPE_ALL)

Description

このeffectは追加のACボーナスをobjectに与えます。増加する量を指定して、ボーナスのタイプを（AC_* Constant Groupから）選びます。

Remarks

このファンクションではnDamageTypeは常にディフォルトを使用するべきです。

Version

1.22

See Also

functions: | ApplyEffectToObject | EffectACDecrease | EffectAttackDecrease | EffectAttackIncrease
categories: | Effects Functions | Spell Casting Effects Functions | Spells Functions | Talents/Skills/Feats Functions
constants: | AC_* Constants | DAMAGE_TYPE_* Constants

author: Jody Fletcher, JP team: akito


Function - EffectAppear

Home > Reference > Functions > Effects > EffectAppear

EffectAppear()

objectが『フライイン』する特殊効果を与えます。（通常は『フェードイン』）

effect EffectAppear();

Description

このeffectを使用すると、objectがカメラビュウの上から出現して、着地するようになります。

Version

1.22

See Also

functions: | ApplyEffectAtLocation | ApplyEffectToObject | EffectAttackDecrease | EffectDisappear | EffectDisappearAppear
categories: | Effects Functions
events: | OnSpawn Event

author: Jody Fletcher, JP team: akito


Function - EffectAreaOfEffect

Home > Reference > Functions > Effects, Spells, Traps > EffectAreaOfEffect

EffectAreaOfEffect(int, string, string, string)

クリーチャーがエリアに干渉した時に、新しいeffectを反映させます。

effect EffectAreaOfEffect(
    int nAreaEffectId,
    string sOnEnterScript = "",
    string sHeartbeatScript = "",
    string sOnExitScript = ""
);

Parameters

nAreaEffectId

Area of EffectのID

sOnEnterScript

クリーチャーがArea of Effectの範囲に入ってきた時に使うスクリプト。（ディフォルト：""）

sHeartbeatScript

Area of EffectのHeartbeatで走らせるスクリプト。（ディフォルト：""）

sOnExitScript

クリーチャーがArea of Effectの範囲から去った時に走らせるスクリプト。（ディフォルト：""）

Description

それが適用されるクリーチャーのエリアにArea Of Effectの効果を作成する。もし、スクリプトが指定されないなら、ディフォルトのものが使われる。

Known Bugs

sOnEnterScript、sHeartbeatScript、sOnExitScriptに無効なスクリプトを使用すると、クラッシュします。もし、Area of Effectに何もさせたくないなら、"****"を使うか、空のスクリプトを指定してください。

Version

1.28

Example

int AOE_BOG_STINK = 1500;

void main()
{
    // Area Of Effectを宣言し、IDを割り振って、何時、誰がそれと作用して、どのスクリプトを走らせるか決めます。
    effect eAOE = EffectAreaOfEffect(AOE_BOG_STINK, "bog_on_enter", "bog_on_hb", "bog_on_exit");
    location lTarget = GetLocation(GetEnteringObject());
    int nDuration = 2;
    // Apply Effectファンクションを使用して、eAOEを適用します。
    ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration));
}

See Also

functions: | ApplyEffectAtLocation
categories: | Effects Functions | Spells Functions | Traps Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Peter Poe, JP team: akito


Function - EffectAttackDecrease

Home > Reference > Functions > Effects > EffectAttackDecrease

EffectAttackDecrease(int, int)

攻撃減少効果を作成します。

effect EffectAttackDecrease(
    int nPenalty,
    int nModifierType = ATTACK_BONUS_MISC
);

Parameters

nPenalty

減らされるボーナスの量

nModifierType

ATTACK_BONUS_* (デフォルト: ATTACK_BONUS_MISC)

Description

このeffectをクリーチャーに適用すると、利き手、逆手、または両手の攻撃ボーナスを一定量、減少させるでしょう。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectAbilityDecrease | EffectAbilityIncrease | EffectACDecrease | EffectACIncrease | EffectAppear | EffectAttackIncrease | EffectDamageDecrease | EffectDamageIncrease | EffectLinkEffects
categories: | Effects Functions
constants: | ATTACK_BONUS_* Constants

author: John Shuell, JP team: akito


Function - EffectAttackIncrease

Home > Reference > Functions > Effects > EffectAttackIncrease

EffectAttackIncrease(int, int)

攻撃増加効果を作成します。

effect EffectAttackIncrease(
    int nBonus,
    int nModifierType = ATTACK_BONUS_MISC
);

Parameters

nBonus

増加するボーナスの量

nModifierType

ATTACK_BONUS_* Constantsで定義された3つのうちの1つを選び、どの手に持った武器が修正されるかを決定します。 (デフォルト: ATTACK_BONUS_MISC)

Description

このeffectがcreatureに適用される時、利き手、逆手、または両手に持った武器の攻撃ボーナスを一定量、増大させます。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectAbilityDecrease | EffectAbilityIncrease | EffectACDecrease | EffectACIncrease | EffectAttackDecrease | EffectDamageDecrease | EffectDamageIncrease | EffectLinkEffects
categories: | Effects Functions
constants: | ATTACK_BONUS_* Constants

author: John Shuell, JP team: akito


Function - EffectBeam

Home > Reference > Functions > Effects, Spell Casting Effects > EffectBeam

EffectBeam(int, object, int, int)

Beamの効果を作成します。

effect EffectBeam(
    int nBeamVisualEffect,
    object oEffector,
    int nBodyPart,
    int bMissEffect = FALSE
);

Parameters

nBeamVisualEffect

使用するビームの映像をVFX_BEAM_* Constantから決定する。

oEffector

ビームはこのcreatureから放たれます。

nBodyPart

creatureのどの部位からビームが放たれるかをBODY_NODE_* Constantから決定する。

bMissEffect

これがTRUEだと、ビームはランダムなベクトルを描き、目標の近くや過ぎた場所に命中します。

Description

このeffectを適用すると、ビーム特性をもった新しいeffectが反映されます。
nBeamVisualEffectが有効ではなかった場合、effectの種類はEFFECT_TYPE_INVALIDEFFECTが反映されます。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

現在、手と胸の２つの部位だけが定義できます。.

Version

1.22

See Also

functions: | EffectLinkEffects
categories: | Effects Functions | Spell Casting Effects Functions
constants: | BODY_NODE_* Constants | EFFECT_TYPE_* Constants | VFX_BEAM_* Constants

author: John Shuell, JP team: akito


Function - EffectBlindness

Home > Reference > Functions > Effects > EffectBlindness

EffectBlindness()

盲目の効果を作成します。

effect EffectBlindness();

Description

このeffectを反映すると、プレイヤーの環境は減光し、彼の視界から全てのオブジェクトを取り去ります。

Remarks

このeffectの影響下にいるとネガティブペナルティを受けることになります。

Version

1.28

See Also

functions: | EffectLinkEffects
categories: | Effects Functions

author: John Shuell, editor: Charles Feduke, JP team: akito


Function - EffectCharmed

Home > Reference > Functions > Effects > EffectCharmed

EffectCharmed()

チャームeffectを作成します

effect EffectCharmed();

Description

このエフェクトを呼び出したオブジェクトに対する目標の好感度（ファクションではない）が50％上昇します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectLinkEffects
categories: | Effects Functions

author: John Shuell, editor: Charles Feduke, JP team: akito


Function - EffectConcealment

Home > Reference > Functions > Effects > EffectConcealment

EffectConcealment(int)

新しいeffectを返します。

effect EffectConcealment(
    int nPercentage
);

Parameters

nPercentage

1～100の値

Description

このeffectは潜伏効果を返します。int nPercentageは単に発見される確率です。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork, JP team: akito


Function - EffectConfused

Home > Reference > Functions > Effects > EffectConfused

EffectConfused()

コンフュージョンのeffectを作成します。

effect EffectConfused();

Description

このファンクションはコンフュージョンのeffectを返します。PCまたはNPCに対して使用します。

Version

1.29

See Also

categories: Effects Functions

author: Michael Nork, editor: Charles Feduke, JP team: akito


Function - EffectCurse

Home > Reference > Functions > Effects > EffectCurse

EffectCurse(int, int, int, int, int, int)

カースのeffectを作成します。

effect EffectCurse(
    int nStrMod = 1,
    int nDexMod = 1,
    int nConMod = 1,
    int nIntMod = 1,
    int nWisMod = 1,
    int nChaMod = 1
);

Parameters

nStrMod

筋力修正 (Default: 1)

nDexMod

敏捷力修正 (Default: 1)

nConMod

耐久力修正 (Default: 1)

nIntMod

知力修正 (Default: 1)

nWisMod

判断力修正 (Default: 1)

nChaMod

魅力修正 (Default: 1)

Description

目標の能力値を減少させるeffectを返します。減少させる量はパラメーターで決定します。

Remarks

修正する値は正数にして下さい。スクリプトはその値を能力値からマイナスするように適用します。

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions

author: John Shuell, JP team: akito


Function - EffectCutsceneDominated

Home > Reference > Functions > Effects > EffectCutsceneDominated

EffectCutsceneDominated()

クリーチャーを支配するeffectを作成します。

effect EffectCutsceneDominated();

Description

クリーチャーを支配するeffectを作成します。抵抗できないことを除けば、EffectDominatedと同一です。

Version

1.28

Example

// 会話を終えると、ヴィジュアルエフェクトで演出をして、lWPへ飛ばします。
// ヴィジュアルエフェクトが終わるまで、oPCはアクションを起こせません。
// サンプルスクリプト提供： akito氏
void main()
{
   object oPC = GetPCSpeaker();
   location lWP = GetLocation(GetObjectByTag("WP_MAZE"));
   ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneDominated(), oPC, 6.3);
   ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL), oPC);
   DelayCommand(6.4, AssignCommand(oPC, ActionJumpToLocation(lWP)));
}

See Also

functions: | EffectDominated
categories: | Effects Functions

author: Charles Feduke, additional contributor(s): Cevrin, JP team: akito


Function - EffectCutsceneParalyze

Home > Reference > Functions > Cut-Scene, Effects > EffectCutsceneParalyze

EffectCutsceneParalyze()

カットシーンで使用するクリーチャーを麻痺するeffectを作成します。

effect EffectCutsceneParalyze();

Description

クリーチャーを麻痺するeffectを返します。抵抗できないことを除けば、このeffectはEffectParalyzeと同一です。

Remarks

この効果は抵抗できないとなっていますが、麻痺に対して無効化能力（Immunity to paralysis）持つクリーチャーは影響を受けません。麻痺に対する無効化能力は）クリーチャーの皮や皮膚の能力（クリーチャーの持ち物として装備されています）であるため、そのようなクリーチャーを麻痺させる必要がある場合は、無効化能力を持つ皮のプロパティを編集しなければなりません。

Version

1.30

See Also

functions: | EffectParalyze
categories: | Cut-Scene Functions | Effects Functions

author: Charles Feduke, editor: Lilac Soul, JP team: akito, geshi


Function - EffectDamage

Home > Reference > Functions > Effects > EffectDamage

EffectDamage(int, int, int)

ダメージを与えるeffectを返します。

effect EffectDamage(
    int nDamageAmount,
    int nDamageType = DAMAGE_TYPE_MAGICAL,
    int nDamagePower = DAMAGE_POWER_NORMAL
);

Parameters

nDamageAmount

ダメージの量。これは瞬間のeffectとして適用されるべきです。

nDamageType

DAMAGE_TYPE_* (デフォルト: DAMAGE_TYPE_MAGICAL)

nDamagePower

(デフォルト: DAMAGE_POWER_NORMAL)

Description

このファンクションは最初のパラメータでダメージの量、２番目でダメージのタイプ、３番目で（セービングスロウの為に）ダメージのパワーを定義します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: | Effects Functions
constants: | DAMAGE_POWER_* Constants | DAMAGE_TYPE_* Constants

author: Michael Nork, JP team: akito


Function - EffectDamageDecrease

Home > Reference > Functions > Effects > EffectDamageDecrease

EffectDamageDecrease(int, int)

ダメージを減少するeffectを返します。

effect EffectDamageDecrease(
    int nPenalty,
    int nDamageType = DAMAGE_TYPE_*
);

Parameters

nPenalty

nDamageType

(Default: DAMAGE_TYPE_*)

Description

このファンクションは（ペナルティとダメージタイプによって明確に）指定したダメージの総計を減らす効果を作成します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectAttackDecrease | EffectAttackIncrease | EffectDamageIncrease | EffectDamageResistance
categories: | Effects Functions
constants: | DAMAGE_TYPE_* Constants

author: Michael Nork, JP team: akito


Function - EffectDamageImmunityDecrease

Home > Reference > Functions > Effects > EffectDamageImmunityDecrease

EffectDamageImmunityDecrease(int, int)

ダメージ抵抗を減らすeffectを作成します。

effect EffectDamageImmunityDecrease(
    int nDamageType,
    int nPercentImmunity
);

Parameters

nDamageType

DAMAGE_TYPE_*

nPercentImmunity

目標のダメージ抵抗を下げる量をパーセントで指定します。

Description

このeffctを適用すると、DAMAGE_TYPEの中から選んだ一定のタイプで決定された目標のダメージ抵抗の量が減ります。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectDamageImmunityIncrease
categories: | Effects Functions
constants: | DAMAGE_TYPE_* Constants

author: John Shuell, JP team: akito


Function - EffectDamageImmunityIncrease

Home > Reference > Functions > Effects > EffectDamageImmunityIncrease

EffectDamageImmunityIncrease(int, int)

ダメージ抵抗を増加させるeffectを作成します。

effect EffectDamageImmunityIncrease(
    int nDamageType,
    int nPercentImmunity
);

Parameters

nDamageType

DAMAGE_TYPE_*

nPercentImmunity

目標のダメージ抵抗を上げる量をパーセントで示す。

Description

このeffctを適用すると、DAMAGE_TYPEの中から選んだ一定のタイプで決定された目標のダメージ抵抗の量が増えます。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectDamageImmunityDecrease
categories: | Effects Functions
constants: | DAMAGE_TYPE_* Constants

author: John Shuell, JP team: akito


Function - EffectDamageIncrease

Home > Reference > Functions > Effects > EffectDamageIncrease

EffectDamageIncrease(int, int)

ダメージ増加effectを作成します。

effect EffectDamageIncrease(
    int nBonus,
    int nDamageType = DAMAGE_TYPE_MAGICAL
);

Parameters

nBonus

DAMAGE_BONUS_*グループで定義した特別なダメージ量。

nDamageType

DAMAGE_TYPE_*グループで定義した増加するダメージのタイプ。 (Default: DAMAGE_TYPE_MAGICAL)

Description

このeffectはnBonusで量、nDamageTypeでダメージのタイプを指定して、目標のダメージの総計を増加させます。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectAttackDecrease | EffectAttackIncrease | EffectDamageDecrease
categories: | Effects Functions
constants: | DAMAGE_BONUS_* Constants | DAMAGE_TYPE_* Constants

author: John Shuell, JP team: akito


Function - EffectDamageReduction

Home > Reference > Functions > Combat, Effects > EffectDamageReduction

EffectDamageReduction(int, int, int)

ダメージ軽減effectを作成します。

effect EffectDamageReduction(
    int nAmount,
    int nDamagePower,
    int nLimit = 0
);

Parameters

nAmount

軽減されるダメージの量

nDamagePower

DAMAGE_POWER_*グループで定義された軽減されるダメージのタイプ

nLimit

effectが消滅する前に吸収できるダメージの最大量。0にすると無限大。(Default: 0)

Description

このeffectを適用すると目標が受けるダメージの量が下がります。このeffectは指定されたまたは無限にダメージ量を散らせます。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectDamageResistance
categories: | Combat Functions | Effects Functions
constants: | DAMAGE_POWER_* Constants

author: John Shuell, JP team: akito


Function - EffectDamageResistance

Home > Reference > Functions > Combat, Effects > EffectDamageResistance

EffectDamageResistance(int, int, int)

目標をあるタイプのダメージにもっと抵抗するeffectを返します。

effect EffectDamageResistance(
    int nDamageType,
    int nAmount,
    int nLimit = 0
);

Parameters

nDamageType

DAMAGE_TYPE_*グループで定義した抵抗するダメージのタイプ

nAmount

目標がダメージを受けるごとに吸収するダメージの量

nLimit

このeffectが消える前に吸収できるダメージの最大量。0にすると無限に吸収します。(Default: 0)

Description

nLimitの上限（nLimitが0なら無限）まで、nDamageTypeタイプのnAmount量を取り去るダメージ抵抗effectを返します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectDamageDecrease | EffectDamageReduction | EffectDamageShield
categories: | Combat Functions | Effects Functions
constants: | DAMAGE_TYPE_* Constants

author: John Shuell, JP team: akito


Function - EffectDamageShield

Home > Reference > Functions > Combat, Effects > EffectDamageShield

EffectDamageShield(int, int, int)

攻撃が成功したものにダメージを与えるダメージシールド（エレメンタルシールド）を目標の回りに作成します。

effect EffectDamageShield(
    int nDamageAmount,
    int nRandomAmount,
    int nDamageType
);

Parameters

nDamageAmount

相手によって攻撃が成功した後に、目標を攻撃した者に適用されるダメージの量。

nRandomAmount

DAMAGE_BONUS_*定数グループで定義されたシールドによって与えられる基本ダメージに加えられる量。

nDamageType

DAMAGE_TYPE_*定数グループで定義された攻撃者に与えられるダメージのタイプ。

Description

ダメージシールド（エレメンタルシールド）effectを目標に適用すると、nDamageTypeで指定したタイプのダメージ(nDamageAmount + nRandomAmount)を、目標と混戦している攻撃が成功した者に返す。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectDamageResistance
categories: | Combat Functions | Effects Functions
constants: | DAMAGE_BONUS_* Constants | DAMAGE_TYPE_* Constants

author: John Shuell, JP team: akito


Function - EffectDarkness

Home > Reference > Functions > Effects > EffectDarkness

EffectDarkness()

新しいeffectを返す。

effect EffectDarkness();

Description

ダークネスeffectを作成します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork, JP team: akito


Function - EffectDazed

Home > Reference > Functions > Effects > EffectDazed

EffectDazed()

新しいeffectを返す。

effect EffectDazed();

Description

デイズeffectを作成します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork, JP team: akito


Function - EffectDeaf

Home > Reference > Functions > Effects > EffectDeaf

EffectDeaf()

新しいeffectを返します。

effect EffectDeaf();

Description

デフネスeffectを作成します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork, JP team: akito


Function - EffectDeath

Home > Reference > Functions > Combat, Effects > EffectDeath

EffectDeath(int, int)

デスeffectを作成します。

effect EffectDeath(
    int nSpectacularDeath = FALSE,
    int nDisplayFeedback = TRUE
);

Parameters

nSpectacularDeath

もしこれがTRUEなら、このeffectを適用したクリーチャーは特異な死に方をします。(Default: FALSE)

nDisplayFeedback

(Default: TRUE)

Description

この新しいeffectが目標に適用されると、それらのヒットポイントは0に設定され、death animationを行い（もしnSpectacularDeathがTRUEなら、NPCの死体は残るようになります。）、そして、そのクリーチャーは命令を受け付けなくなります。--それらは動くことも、攻撃することも、魔法を唱えることも、もう何もできません。

ドアや配置オブジェクトに適用すると、それらは破壊され、shatter animationを行います。

death effectは'死ぬ'ように目標を設定し、それから自身を削除する瞬間のeffectです。（ヒール、リザレクションなどの効果とともに、少数の不可逆なeffectのうちの１つです。）

オブジェクトは死に（破壊され）、永久に消滅します。

クリーチャーを生き返らせたいなら、EffectResurrection()を使う必要があります。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Combat Functions | Effects Functions

author: John Shuell, JP team: akito


Function - EffectDisappear

Home > Reference > Functions > Effects > EffectDisappear

EffectDisappear()

新しいeffectを返します。

effect EffectDisappear();

Description

オブジェクトが"飛び去り"、自身を破壊する消滅effectを作成します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectAppear
categories: | Effects Functions

author: Michael Nork, JP team: akito


Function - EffectDisappearAppear

Home > Reference > Functions > Effects > EffectDisappearAppear

EffectDisappearAppear(location)

新しいeffectを返します。

effect EffectDisappearAppear(
    location lLocation
);

Parameters

lLocation

適用されたオブジェクトが再出現する位置。

Description

  消滅／出現effectを作成します。

  オブジェクトはeffectの持続時間"飛び去り"lLocationで再出現します。

  敵を踏みつけるドラゴンに使用されます。

Known Bugs

  このeffectを使用するには（ApplyEffectToObjectにおいての）持続時間は3.0秒またはそれ以上に設定しなければなりません。（明らかにduration typeはtemporaryでなくてはなりません。）

  より忙しいエリアでは持続時間はより大きい値である必要があるかもしれません。

Version

1.30

See Also

functions: | EffectAppear
categories: | Effects Functions

author: John Shuell, editor: Lilac Soul, additional contributor(s): Ken Cotterill, Allan Floyd, Lilac Soul, JP team: geshi, akito


Function - EffectDisease

Home > Reference > Functions > Effects > EffectDisease

EffectDisease(int)

病気effectを作成します。

effect EffectDisease(
    int nDiseaseType
);

Parameters

nDiseaseType

このeffectに適用するDISEASE_*定数グループから選ばれた病気のタイプ。

Description

目標に適用される時、それらに病気を引き起こす新しいeffect。

病気の種類はDISEASE_* 定数グループから選ばれます。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

Example

/*
    .オブジェクトのOnUsedイベントに置いてください。
    o病気の潜伏期の間、それが使われて1時間毎に、新しい病気に
    dオブジェクトを感染させることを試みさせます。
    h
    .それは、ゲームにおいて定義されたすべての病気を通じてループします
*/

#include "nw_i0_plot"

// 現在と次の病気の名前を報告するために使用します。
string GetDiseaseName(int nCurrentEffect);

void main()
{
     int nCurrentEffect;
     int nNextEffect;
     effect eDisease;
     object oPC;
     string sDisease;

     nCurrentEffect = GetLocalInt(OBJECT_SELF,"nCurrentEffect");
     eDisease = EffectDisease(nCurrentEffect);
     oPC = GetLastUsedBy();
     RemoveEffects(oPC);

     sDisease = GetDiseaseName(nCurrentEffect);
     SendMessageToPC(oPC,"Applying Disease number " + IntToString(nCurrentEffect) + " " + sDisease);
     ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eDisease,oPC,30.0f);
     if( nCurrentEffect == 16)
     {
          nNextEffect=0;
     }else{
          nNextEffect=nCurrentEffect+1;
     }
     SetLocalInt(OBJECT_SELF,"nCurrentEffect",nNextEffect);
     sDisease = GetDiseaseName(nNextEffect);
     SendMessageToPC(oPC,"Advancing 1 hour to End of Incubation Stage in 10 seconds.");
     DelayCommand(10.0, SetTime(1,0,0,0));
     DelayCommand(3600.0, SendMessageToPC(oPC,"Next Disease number " + IntToString(nNextEffect) + " - " + sDisease));
     return;

}

string GetDiseaseName(int nCurrentEffect)
{
     string sDisease = "";

     switch (nCurrentEffect)
     {
        case 0:
            sDisease = "DISEASE_BLINDING_SICKNESS";
        break;
        case 1:
            sDisease = "DISEASE_CACKLE_FEVER";
        break;
        case 2:
            sDisease = "DISEASE_DEVIL_CHILLS";
        break;
        case 3:
            sDisease = "DISEASE_DEMON_FEVER";
        break;
        case 4:
            sDisease = "DISEASE_FILTH_FEVER";
        break;
        case 5:
            sDisease = "DISEASE_MINDFIRE";
        break;
        case 6:
            sDisease = "DISEASE_MUMMY_ROT";
        break;
        case 7:
            sDisease = "DISEASE_RED_ACHE";
        break;
        case 8:
            sDisease = "DISEASE_SHAKES";
        break;
        case 9:
            sDisease = "DISEASE_SLIMY_DOOM";
        break;
        case 10:
            sDisease = "DISEASE_RED_SLAAD_EGGS";
        break;
        case 11:
            sDisease = "DISEASE_GHOUL_ROT";
        break;
        case 12:
            sDisease = "DISEASE_ZOMBIE_CREEP";
        break;
        case 13:
            sDisease = "DISEASE_DREAD_BLISTERS";
        break;
        case 14:
            sDisease = "DISEASE_BURROW_MAGGOTS";
        break;
        case 15:
            sDisease = "DISEASE_SOLDIER_SHAKES";
        break;
        case 16:
            sDisease = "DISEASE_VERMIN_MADNESS";
        break;
     }
     return sDisease;
}

See Also

functions: | EffectPoison
categories: | Effects Functions
constants: | DISEASE_* Constants

author: John Shuell, JP team: akito


Function - EffectDispelMagicAll

Home > Reference > Functions > Effects, Spells > EffectDispelMagicAll

EffectDispelMagicAll(int)

ディスペルマジックeffectを作成します。

effect EffectDispelMagicAll(
    int nCasterLevel
);

Parameters

nCasterLevel

ディスペルする魔法の最高レベル

Description

目標に適用すると、nCasterLevelで設定したレベルかそれ以下の全ての魔法をディスペルする新しいeffectを返します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions | Spells Functions

author: John Shuell, JP team: akito


Function - EffectDispelMagicBest

Home > Reference > Functions > Effects, Spells > EffectDispelMagicBest

EffectDispelMagicBest(int)

ディスペルマジックeffectを作成します。

effect EffectDispelMagicBest(
    int nCasterLevel
);

Parameters

nCasterLevel

ディスペルする魔法の最高レベル。

Description

目標に適用すると、nCasterLevel以下で、最高レベルの魔法をディスペルする新しいeffectを返します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions | Spells Functions

author: John Shuell, JP team: akito


Function - EffectDominated

Home > Reference > Functions > Effects > EffectDominated

EffectDominated()

新しいeffectを返します。

effect EffectDominated();

Description

ドミネイトの効果を作成します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

functions: | EffectCutsceneDominated
categories: | Effects Functions

author: Michael Nork, JP team: akito


Function - EffectEntangle

Home > Reference > Functions > Effects > EffectEntangle

EffectEntangle()

エンタングルeffectを作成します。

effect EffectEntangle();

Description

適用すると、このeffectはクリーチャーの移動を制限し、攻撃に-2、ACに-4の修正を与えます。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork, JP team: akito


Function - EffectEthereal

Home > Reference > Functions > Cut-Scene, Effects > EffectEthereal

EffectEthereal()

サンクチュアリのような効果を作成するが、他のものが見つけようとしてもセービングスローを行えない。

effect EffectEthereal();

Description

EFFECT_TYPE_ETHEREALタイプのeffectを返します。このeffectはちょうどEffectSanctuaryのように働くが、観察者は意志セービングスローを行えず、この効果が適用された目標はエセリアルのようです。

Version

1.30

See Also

functions: | EffectSanctuary
categories: | Cut-Scene Functions | Effects Functions
constants: | EFFECT_TYPE_* Constants

author: Charles Feduke, JP team: akito


Function - EffectFrightened

Home > Reference > Functions > Effects > EffectFrightened

EffectFrightened()

恐怖effectを作成します。

void EffectFrightened();

Description

恐怖効果を作成します。注: オブジェクトが恐怖状態の時は会話することができません。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork, editor: Maximus, JP team: Redondo


Function - EffectHaste

Home > Reference > Functions > Effects > EffectHaste

EffectHaste()

新しいeffectを返します。

effect EffectHaste();

Description

ヘイストの効果を作成します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork, JP team: Redondo


Function - EffectHeal

Home > Reference > Functions > Effects > EffectHeal

EffectHeal(int)

ヒールeffectを作成します。

effect EffectHeal(
    int nDamageToHeal
);

Parameters

nDamageToHeal

癒されるヒットポイント

Description

nDamageToHealのヒットポイントを回復するヒールeffectを返します。これは瞬時のeffectとして適用されるべきです。
もし、nDamageToHealが0よりも小さかったなら、EFFECT_TYPE_INVALIDEFFECTタイプの効果を返します。

Version

1.22

Example

// oUserはeffectを呼び出すオブジェクトを最後に使用したオブジェクトです。
// 下の例は使用可能な配置オブジェクトのOnUsedイベントにおいて使用します。
void main()
{
     object oUser = GetLastUsedBy();
     effect eHeal = EffectHeal(10);
     if (GetIsObjectValid(oUser))
     {
          // 使用者をヒールします
          ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oUser);
     }
}

See Also

categories: | Effects Functions
constants: | EFFECT_TYPE_* Constants

author: Charles Feduke, additional contributor(s): Jorian Night, JP team: Redondo


Function - EffectHitPointChangeWhenDying

Home > Reference > Functions > Effects > EffectHitPointChangeWhenDying

EffectHitPointChangeWhenDying(float)

新しいeffectを返します。

effect EffectHitPointChangeWhenDying(
    float fHitPointChangePerRound
);

Parameters

fHitPointChangePerRound

正数または負数。0は駄目

Description

死んだ時にヒットポイントを変化させるeffectを作成します。
もし、fHitPointChangePerRoundが0ならば、EFFECT_TYPE_INVALIDEFFECTタイプのeffectを返します。

小数点も使用できます。；fHitPointChangePerRoundを-0.2のすることは5ラウンド毎に1HPを失うことを意味します。

Remarks

キャラクターが死んだ時、ヒールされ（その他、何らかの方法でHPが0以上になると）、このeffectは自動的に消滅するでしょう。

Known Bugs

effectタイプが0なので、このエフェクトを捜し出し、破壊しようとすることは難しいです。ヒーリングはこの効果を取り除きます。

Version

1.26

See Also

categories: | Effects Functions
constants: | EFFECT_TYPE_* Constants

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Enigmatic, JP team: akito


Function - EffectImmunity

Home > Reference > Functions > Effects > EffectImmunity

EffectImmunity(int)

耐性effectを作成します。

effect EffectImmunity(
    int nImmunityType
);

Parameters

nImmunityType

IMMUNITY_TYPE_*定数グループから一つ選びます。

Description

目標に適用されるとIMMUNITY_TYPE_*定数グループで見つかる、害のある影響に耐性を持つような33種類の中の1つを新しいeffectを返します。

Remarks

一つのeffectで一つの免疫しか定義できないが、EffectLinkEffectsを使うことで、複数を一つの巨大なeffectとして追加することができます。

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: | Effects Functions
constants: | IMMUNITY_TYPE_* Constants

author: John Shuell, JP team: akito


Function - EffectInvisibility

Home > Reference > Functions > Effects > EffectInvisibility

EffectInvisibility(int)

インヴィジビリティeffectを作成します。

effect EffectInvisibility(
    int nInvisibilityType
);

Parameters

nInvisibilityType

INVISIBILITY_TYPE_*定数で定義されているインヴィジビリティの一つを適用します。

Description

目標に適用すると、INVISIBILITY_TYPE_*定数グループで定義されている3つの重要なレベルの中の1つで不可視にする新しい効果を返します。

もし、nInvisibilityTypeが無効だったなら、EFFECT_TYPE_INVALIDEFFECTの効果を返します。

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Version

1.22

See Also

categories: | Effects Functions
constants: | INVISIBILITY_TYPE_* Constants

author: John Shuell, JP team: akito


Function - EffectKnockdown

Home > Reference > Functions > Effects > EffectKnockdown

EffectKnockdown()

新しいeffectを返します。

effect EffectKnockdown();

Description

打ち倒しeffectを作成します。クリーチャーの足を叩きつけ、effectが削除されるまで座り込みます。これは持続時間を3秒間とした一時的な効果として適用されるべきです。（1秒で崩れ落ち、1秒間座り込み、1秒で立ちあがります。）

Remarks

このeffectはApplyEffectToObject()の中で使用することで効果を表します。使用する場合は、そちらもご覧下さい。

Known Bugs

このeffectのクリーチャーでないオブジェクトに適用するとゲームがクラッシュするバグは、以前のパッチにより修正されております。

Version

1.30

See Also

categories: Effects Functions

author: Michael Nork, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: akito, geshi


Function - EffectLinkEffects

Home > Reference > Functions > Effects > EffectLinkEffects

EffectLinkEffects(effect, effect)

Creates one new effect object from two seperate effect objects.

effect EffectLinkEffects(
    effect eChildEffect,
    effect eParentEffect
);

Parameters

eChildEffect

One of the two effects to link together.

eParentEffect

One of the two effects to link together.

Description

Returns an Effect that combines the two supplied effects, returning eChildEffect as a child of eParentEffect. The returned effect can then be applied to a target and be affected by all linked effects.

Remarks

You can also link effects to other effects even if they were created with EffectLinkEffects.

Note: When applying linked effects if the target is immune to all valid effects all other effects will be removed as well. This means that if you apply a visual effect and a silence effect (in a link) and the target is immune to the silence effect that the visual effect will get removed as well. Visual Effects are not considered "valid" effects for the purposes of determining if an effect will be removed or not and as such should never be packaged *only* with other visual effects in a link.

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

See Also

functions: | EffectAttackDecrease | EffectAttackIncrease | EffectBeam | EffectBlindness | EffectCharmed
categories: | Effects Functions

author: John Shuell


Function - EffectMissChance

Home > Reference > Functions > Effects > EffectMissChance

EffectMissChance(int, int)

Creates a miss chance effect.

effect EffectMissChance(
    int nPercentage,
    int nMissChanceType = MISS_CHANCE_TYPE_NORMAL
);

Parameters

nPercentage

1-100 inclusive

nMissChanceType

MISS_CHANCE_TYPE_* (Default: MISS_CHANCE_TYPE_NORMAL)

Description

Returns a new effect object used to determine the miss chance of hitting a particular target. For example, casting a Displacement spell on a target gives it full concealment, thus a 50% miss chance (meaning all attacks have a 50% chance of missing even on a successful attack roll). Applying this effect to a creature grants that creature the miss chance protection.

Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nPercentage < 1 or nPercentage > 100.

Version

1.30

See Also

categories: | Effects Functions
constants: | EFFECT_TYPE_* Constants | MISS_CHANCE_TYPE_* Constants

author: John Shuell, editor: Lilac Soul, additional contributor(s): Lilac Soul


Function - EffectModifyAttacks

Home > Reference > Functions > Combat Actions, Effects > EffectModifyAttacks

EffectModifyAttacks(int)

追加攻撃するための攻撃修正effectを作成します。

effect EffectModifyAttacks(
    int nAttacks
);

Parameters

nAttacks

（重複するeffectとあわせて）最大5

Description

目標に追加攻撃が適用された時、その新しいeffectを返します。

nAttacksが5より大きい時(5は含まない)、EFFECT_TYPE_INVALIDEFFECTをeffectとして返します。

Remarks

コンストラクタ（プログラム用語です）はobjectの新規のデータ値（instance）を返す特別な方法です。NWNスクリプトにおいて、Objectにつけることの出来るeffect全ては、特殊なエフェクトの新しいデータ値を作成する独自のコンストラクタを持ちます。このeffectはApplyEffectToObject()コマンドを使って使用することが出来ます。詳細はeffectコンストラクタを見てください。

Version

1.22

See Also

categories: | Combat Actions Functions | Effects Functions
constants: | EFFECT_TYPE_* Constants

author: John Shuell, JP team: Rainie


Function - EffectMovementSpeedDecrease

Home > Reference > Functions > Effects, Movement > EffectMovementSpeedDecrease

EffectMovementSpeedDecrease(int)

減速するターゲットにMOVEMENT_SPEED_DECREASEエフェクトをつけます。

effect EffectMovementSpeedDecrease(
    int nPercentChange
);

Parameters

nPercentChange

Description

ターゲットに適用された時、その移動はnPercentChangeパーセントだけ遅くなります。

Remarks

Constructorは、オブジェクトの新しい定義を返す特別な方法です。NWNのスクリプトではobjectに配置できるエフェクト毎が、特定エフェクトの新たな定義を作成される独自のconstructorを持ちます。このエフェクトonjectはApplyEffectToObject()コマンドの中で使用することができます。詳細はエフェクトConstructorを見てください。

Version

1.22

See Also

functions: | EffectMovementSpeedIncrease
categories: | Effects Functions | Movement Functions

author: John Shuell, JP team: Rainie


Function - EffectMovementSpeedIncrease

Home > Reference > Functions > Effects, Movement > EffectMovementSpeedIncrease

EffectMovementSpeedIncrease(int)

移動率を速くするターゲットに対しMOVEMENT_SPEED_INCREASEエフェクトをつけます。

effect EffectMovementSpeedIncrease(
    int nPercentChange
);

Parameters

nPercentChange

移動速度を変更する比率

Description

ターゲットに適用された時、その移動はnPercentChangeパーセントだけ速くなります。

Remarks

Constructorは、オブジェクトの新しい定義を返す特別な方法です。NWNのスクリプトではobjectに配置できるエフェクト毎が、特定エフェクトの新たな定義を作成される独自のconstructorを持ちます。このエフェクトonjectはApplyEffectToObject()コマンドの中で使用することができます。詳細はエフェクトConstructorを見てください。

Version

1.22

See Also

functions: | EffectMovementSpeedDecrease
categories: | Effects Functions | Movement Functions

author: John Shuell, JP team: Rainie


Function - EffectNegativeLevel

Home > Reference > Functions > Effects, Experience > EffectNegativeLevel

EffectNegativeLevel(int)

目標のレベルを減少させる負のレベルエフェクトを作成します。

effect EffectNegativeLevel(
    int nNumLevels
);

Parameters

nNumLevels

適用する負のレベルの数値

Description

目標のレベルをnNumLevelsによって減少させた新たなエフェクトオブジェクトを返します。

nNumLevelsが100より大きい場合、タイプEFFECT_TYPE_INVALIDEFFECTを返します。

Remarks

１レベルの損失が単に負のエフェクトであるので、それは容易にレストレーションのスペルかポーションで回復することができます。

Constructorは、オブジェクトの新しい定義を返す特別な方法です。NWNのスクリプトではobjectに配置できるエフェクト毎が、特定エフェクトの新たな定義を作成される独自のconstructorを持ちます。このエフェクトonjectはApplyEffectToObject()コマンドの中で使用することができます。詳細はエフェクトConstructorを見てください。

Version

1.22

See Also

categories: | Effects Functions | Experience Functions
constants: | EFFECT_TYPE_* Constants

author: John Shuell, JP team: Rainie


Function - EffectParalyze

Home > Reference > Functions > Effects > EffectParalyze

EffectParalyze()

Returns a new effect object.

effect EffectParalyze();

Description

Create a Paralyze effect

Remarks

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

See Also

functions: | EffectCutsceneParalyze | EffectPetrify
categories: | Effects Functions

author: Michael Nork


Function - EffectPetrify

Home > Reference > Functions > Effects > EffectPetrify

EffectPetrify()

Creates an effect that will petrify a creature.

effect EffectPetrify();

Description

Returns an effect that will petrify a creature. The creature receives an EffectParalyze and the stoneskin visual effect is also applied (VFX_DUR_PROT_STONESKIN).

Version

1.30

See Also

functions: | EffectParalyze
categories: | Effects Functions
constants: | VFX_DUR_* Constants

author: Charles Feduke


Function - EffectPoison

Home > Reference > Functions > Effects > EffectPoison

EffectPoison(int)

Create a Poison effect.

effect EffectPoison(
    int nPoisonType
);

Parameters

nPoisonType

The type of poison to use, as defined in the POISON_* constant group.

Description

Returns a new effect object that when applied to the target will cause them to be Poisoned with the nPoisonType type of posion as defined in the POISON_* constant group.

Remarks

Notes: Most Poisons do not do hit point damage. Poison effects do not currently stack, they overwrite each other. If the target makes his Saving Throw for the initial effect, he will by default save against the secondary effect.

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

Example

/*
     Place this in the OnUsed event of an object.
     It will remove all bad effects and then cause
     a new poison to attempt to infect the user of
     the object each time it is used.

     It loops through all poison defined in the game.
*/

//Returns TRUE if any negative effects are found on the target and removes them.
int RemoveEffects(object oTarget);

void main()
{
     int nCurrentEffect;
     int nNextEffect;
     effect ePoison;
     object oPC;
     string sPoison;

     nCurrentEffect = GetLocalInt(OBJECT_SELF,"nCurrentEffect");
     ePoison = EffectPoison(nCurrentEffect);
     oPC = GetLastUsedBy();
     if(RemoveEffects(oPC)){
          SendMessageToPC(oPC,"Negative Effects removed.");
          return;
     }
     SendMessageToPC(oPC,"Applying Poison number " + IntToString(nCurrentEffect));
     ApplyEffectToObject(DURATION_TYPE_TEMPORARY,ePoison,oPC,30.0f);
     if( nCurrentEffect == 43)
     {
          nNextEffect=0;
     }else{
          nNextEffect=nCurrentEffect+1;
     }
     SetLocalInt(OBJECT_SELF,"nCurrentEffect",nNextEffect);
     SendMessageToPC(oPC,"Next Poison number " + IntToString(nNextEffect));
     return;
}

//Returns TRUE if any negative effects are found on the target and removes them.
int RemoveEffects(object oTarget)
{
    //Declare major variables
    effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);
    int bValid = FALSE;

    effect eBad = GetFirstEffect(oTarget);
    //Search for negative effects
    while(GetIsEffectValid(eBad))
    {
        if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
            GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
            GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
            GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL ||
            GetEffectType(eBad) == EFFECT_TYPE_FRIGHTENED ||
            GetEffectType(eBad) == EFFECT_TYPE_DAZED ||
            GetEffectType(eBad) == EFFECT_TYPE_CONFUSED ||
            GetEffectType(eBad) == EFFECT_TYPE_POISON ||
            GetEffectType(eBad) == EFFECT_TYPE_DISEASE
                )
            {
                //Remove effect if it is negative.
                RemoveEffect(oTarget, eBad);
                bValid = TRUE;
            }
        eBad = GetNextEffect(oTarget);
    }
    if(bValid)
         ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget);

    return bValid;
}

See Also

functions: | EffectDisease
categories: | Effects Functions
constants: | POISON_* Constants

author: John Shuell


Function - EffectPolymorph

Home > Reference > Functions > Effects, Spells > EffectPolymorph

EffectPolymorph(int)

目標を異なるクリーチャータイプへ変身させるポリモーフeffectを作成します。

effect EffectPolymorph(
    int nPolymorphSelection
);

Parameters

nPolymorphSelection

目標をポリモーフさせるPOLYMORPH_TYPE_*定数グループで定義されるクリーチャーのタイプ (POLYMORPH_TYPE_*)

Description

POLYMORPH_TYPE_*定数グループに定義されるタイプの内1種類へと対象を変身させたときに、新しいeffectを返します。

Remarks

コンストラクタ（プログラム用語です）はobjectの新規のデータ値（instance）を返す特別な方法です。NWNスクリプトにおいて、Objectにつけることの出来るeffect全ては、特殊なエフェクトの新しいデータ値を作成する独自のコンストラクタを持ちます。このeffectはApplyEffectToObject()コマンドを使って使用することが出来ます。詳細はeffectコンストラクタを見てください。

Shadows of Undrentideでは、あなたの知らない３つの使用可能なポリモーフタイプがあります。なぜならそれらは定数として追加されてないからです。もしpolymorph.2daファイルをみれば、これら３つのポリモーフタイプを見れます：

43 POLYMORPH_TYPE_HEURODIS
44 POLYMORPH_TYPE_JNAH_GIANT_MALE
45 POLYMORPH_TYPE_JNAH_GIANT_FEMALE

私が言った「それらは定数ではない」という意味は、それらはnwscript.nss内に定義されていないのです。全てのPOLYMORPH_TYPE_*定数は通常整数であることに気をとめてください。polymorph.2daファイル内の数列で示されていますので、EffectPolymorph(POLYMORPH_TYPE_HEURODIS)と呼出すことはできず、EffectPolymorph(43)と呼出すことで、望みの結果が得られます。

Known Bugs

深刻なバグではありませんが、EffectPolymorphについて少々悩むことがあります：ラジアルメニュー上のボタンを使うことで、プレイヤーはいつでもポリモーフエフェクトを取り消すことが出来ます。それがそこにない場合、ポリモーフを再適用するハートビートで代替手段を行うことができます。もちろん、殆どのプレイヤーはそのボタンがそこにあることを知りませんので、重要な問題ではないかもしれません。

Version

1.30

See Also

categories: | Effects Functions | Spells Functions
constants: | POLYMORPH_TYPE_* Constants

author: John Shuell, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - EffectRegenerate

Home > Reference > Functions > Effects > EffectRegenerate

EffectRegenerate(int, float)

Create a Regenerate effect.

effect EffectRegenerate(
    int nAmount,
    float fIntervalSeconds
);

Parameters

nAmount

amount of damage to be regenerated per time interval

fIntervalSeconds

length of interval in seconds

Description

Returns a new effect object that when applied, will cause the target to heal at the rate of nAmount every fIntervalSeconds.

Remarks

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

See Also

categories: Effects Functions

author: John Shuell


Function - EffectResurrection

Home > Reference > Functions > Effects > EffectResurrection

EffectResurrection()

Returns a new effect object.

effect EffectResurrection();

Description

Create a Resurrection effect. This should be applied as an instantaneous effect.

Remarks

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork


Function - EffectSanctuary

Home > Reference > Functions > Effects > EffectSanctuary

EffectSanctuary(int)

Creates a sanctuary effect.

effect EffectSanctuary(
    int nDifficultyClass
);

Parameters

nDifficultyClass

Must be a non-zero, positive number.

Description

Create a Sanctuary effect (see SPELL_SANCTUARY).
Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nDifficultyClass is less than or equal to 0.

Version

1.22

See Also

functions: | EffectEthereal
categories: | Effects Functions
constants: | SPELL_* Constants

author: Charles Feduke


Function - EffectSavingThrowDecrease

Home > Reference > Functions > Effects, Saving Throw > EffectSavingThrowDecrease

EffectSavingThrowDecrease(int, int, int)

1種類のセービングスローを低下させる為にセービングスロー減少エフェクトを作成します。

effect EffectSavingThrowDecrease(
    int nSave,
    int nValue,
    int nSaveType = SAVING_THROW_TYPE_ALL
);

Parameters

nSave

SAVING_THROW_*定数グループによって定義される効果を与えるセービングスロータイプ

nValue

セービングスローを低下させる量

nSaveType

SAVING_THROW_TYPE_*定数グループによって定義される特定系統の抵抗タイプ (デフォルト: SAVING_THROW_TYPE_ALL)

Description

nSaveType定義に含まれる全てに対して抵抗する場合、目標のnSaveで指定したセービングスローがnValue値分、低下したとき新しいeffectを返します。

Remarks

注意点：nSaveとnSaveTypeは似たような名前の定数グループで定義されていますが、混乱しないで下さい。

nSaveは、頑健、反応、意思の３つのいわゆる「セービングスロー」を表し、nSaveTypeは毒、炎、酸など特定の系統にのみ使用される抵抗値です。

コンストラクタ（プログラム用語です）はobjectの新規のデータ値（instance）を返す特別な方法です。NWNスクリプトにおいて、Objectにつけることの出来るeffect全ては、特殊なエフェクトの新しいデータ値を作成する独自のコンストラクタを持ちます。このeffectはApplyEffectToObject()コマンドを使って使用することが出来ます。詳細はeffectコンストラクタを見てください。

Version

1.22

See Also

categories: | Effects Functions | Saving Throw Functions
constants: | SAVING_THROW_* Constants | SAVING_THROW_TYPE_* Constants

author: John Shuell, JP team: Rainie


Function - EffectSavingThrowIncrease

Home > Reference > Functions > Effects, Saving Throw > EffectSavingThrowIncrease

EffectSavingThrowIncrease(int, int, int)

1種類のセービングスローを上昇させる為にセービングスロー増加エフェクトを作成します。

effect EffectSavingThrowIncrease(
    int nSave,
    int nValue,
    int nSaveType = SAVING_THROW_TYPE_ALL
);

Parameters

nSave

SAVING_THROW_*定数グループによって定義される効果を与えるセービングスロータイプ

nValue

セービングスローを上昇させる量

nSaveType

SAVING_THROW_TYPE_*定数グループによって定義される特定系統の抵抗タイプ（デフォルト：SAVING_THROW_TYPE_ALL）

Description

nSaveType定義に含まれる全てに対して抵抗する場合、目標のnSaveで指定したセービングスローがnValue値分、上昇したとき新しいeffectを返します。

Remarks

注意点：nSaveとnSaveTypeは似たような名前の定数グループで定義されていますが、混乱しないで下さい。

nSaveは、頑健、反応、意思の３つのいわゆる「セービングスロー」を表し、nSaveTypeは毒、炎、酸など特定の系統にのみ使用される抵抗値です。

コンストラクタ（プログラム用語です）はobjectの新規のデータ値（instance）を返す特別な方法です。NWNスクリプトにおいて、Objectにつけることの出来るeffect全ては、特殊なエフェクトの新しいデータ値を作成する独自のコンストラクタを持ちます。このeffectはApplyEffectToObject()コマンドを使って使用することが出来ます。詳細はeffectコンストラクタを見てください。

Version

1.22

See Also

categories: | Effects Functions | Saving Throw Functions
constants: | SAVING_THROW_* Constants | SAVING_THROW_TYPE_* Constants

author: John Shuell, JP team: geshi, Rainie


Function - EffectSeeInvisible

Home > Reference > Functions > Effects > EffectSeeInvisible

EffectSeeInvisible()

Returns a new effect object.

effect EffectSeeInvisible();

Description

Create a See Invisible effect.

Remarks

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork


Function - EffectSilence

Home > Reference > Functions > Effects > EffectSilence

EffectSilence()

Create a Silence effect

void EffectSilence();

Description

This constructor returns a new silence effect

Remarks

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork


Function - EffectSkillDecrease

Home > Reference > Functions > Effects > EffectSkillDecrease

EffectSkillDecrease(int, int)

Returns an effect to decrease a skill.

effect EffectSkillDecrease(
    int nSkill,
    int nValue
);

Parameters

nSkill

SKILL_*

nValue

The number of points to decrease nSkill by.

Description

Returns an affect to decrease nSkill nValue points.
Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nSkill is invalid.

Remarks

This does not decrease a skill automatically; it only creates an effect that when applied will decrease the specified skill.

Version

1.22

Example

// Example 1 - Apply an effect to oTarget which will reduce
// the hiding skill level by 2 for 60 seconds.

void main()
{
  effect eSkillDec;
  object oTarget = GetLastUsedBy();
  eSkillDec = EffectSkillDecrease(SKILL_HIDE, 2);
  ApplyEffectToObject(DURATION_TYPE_INSTANT,eSkillDec,oTarget,60.0f);
}

See Also

functions: | ApplyEffectToObject | EffectSkillIncrease
categories: | Effects Functions
constants: | EFFECT_TYPE_* Constants | SKILL_* Constants

author: Charles Feduke, editor: Brett Lathrope


Function - EffectSkillIncrease

Home > Reference > Functions > Effects, Talents/Skills/Feats > EffectSkillIncrease

EffectSkillIncrease(int, int)

スキルの上昇を起こすEffectを返します。

effect EffectSkillIncrease(
    int nSkill,
    int nValue
);

Parameters

nSkill

SKILL_*

nValue

スキルを上昇させるレベルの数値

Description

nSKillが有効の場合、スキルをnValueレベル上昇させるeffectを返します。

Remarks

この関数はeffectを作成するだけです。objectに対してeffectを適用することはありません。

Version

1.22

Example

// オブジェクトの隠れ身スキルを３上昇させるeffectを作成する

effect EffectSkillIncrease(SKILL_HIDE, 3);

See Also

functions: | ApplyEffectToObject | EffectSkillDecrease
categories: | Effects Functions | Talents/Skills/Feats Functions
constants: | SKILL_* Constants

author: Brett Lathrope, editor: Charles Feduke, JP team: Rainie


Function - EffectSleep

Home > Reference > Functions > Effects > EffectSleep

EffectSleep()

Returns a sleep effect.

effect EffectSleep();

Description

Returns a sleep effect which can then be applied to an object.

Remarks

EffectSleep only creates the effect, it does not apply it.

Version

1.22

Example

// Example 1 - Create a sleep effect and apply it to a PC for a duration of 3 minutes.

  object oPC = GetLastUsedBy();
  effect eSleepEffect = EffectSleep();
  ApplyEffectToObject(DURATION_TYPE_INSTANT,eSleepEffect,oPC,180.0f);

// Example 2 - Use EffectSleep() directly without an effect
// variable.

  object oPC = GetLastUsedBy();
  ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectSleep(), oPC, 180.0f);

See Also

functions: | ApplyEffectToObject | RemoveAmbientSleep
categories: | Effects Functions

author: Brett Lathrope


Function - EffectSlow

Home > Reference > Functions > Effects, Spell Casting Effects > EffectSlow

EffectSlow()

スローエフェクトを作ります。

effect EffectSlow();

Description

スロー効果のエフェクト型を返します。

Remarks

エフェクト型のみを作ります。これのみではオブジェクトにエフェクトを与える事はありません。

Version

1.22

Example

// 例１ スローエフェクトを作り、PCに与えます。

object oPC = GetLastUsedBy();
effect eSlow = EffectSlow();
ApplyEffectToObject(DURATION_TYPE_INSTANT,eSlow,oPC,30.0f);

// 例２ エフェクト変数を定義せずに直接 EffectSlow() を使って記述します。

object oPC = GetLastUsedBy();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectSlow(),oPC,30.0f);

See Also

functions: | ApplyEffectToObject
categories: | Effects Functions | Spell Casting Effects Functions

author: Brett Lathrope, editor: Charles Feduke, JP team: Redondo


Function - EffectSpellFailure

Home > Reference > Functions > Effects > EffectSpellFailure

EffectSpellFailure(int, int)

Creates an effect that inhibits spells.

effect EffectSpellFailure(
    int nPercent = 100,
    int nSpellSchool = SPELL_SCHOOL_GENERAL
);

Parameters

nPercent

Percent chance of spell failing (0 to 100). (Default: 100)

nSpellSchool

Spell school that is affected (SPELL_SCHOOL_*). (Default: SPELL_SCHOOL_GENERAL)

Description

Returns an effect that has a chance of causing a spell to fail. Spells that are cast and fail are lost. Specific schools of spells may be affected (SPELL_SCHOOL_*) or all schools may be affected (SPELL_SCHOOL_GENERAL). To gurantee that no spell can be successfully cast in an area with this effect, apply the effect with its default parameters.

Remarks

This can be used to create a "magic dead-zone" as per the Time of Troubles (TSR modules FR1 through FR3).

Version

1.30

See Also

categories: | Effects Functions
constants: | SPELL_SCHOOL_* Constants

author: Charles Feduke


Function - EffectSpellImmunity

Home > Reference > Functions > Effects, Spells > EffectSpellImmunity

EffectSpellImmunity(int)

呪文耐性のeffectを返します。

effect EffectSpellImmunity(
    int nImmunityToSpell = SPELL_ALL_SPELLS
);

Parameters

nImmunityToSpell

SPELL_* (Default: SPELL_ALL_SPELLS)

Description

SPELL_*タイプの呪文への呪文耐性のEffectを返します。

nImmunityToSpellが無効であれば、EFFECT_TYPE_INVALIDEFFECTのeffectを返します。

Remarks

effectを返すだけで、適用することはありません。

Known Bugs

以前あったバグは幾つか前のパッチで修正されました。

Version

1.30

Example

// 例.1 － oTargetに60秒間の耐性effectを付ける
// ヴィジュアルエフェクトは使用しない

void main()
{
  effect eImmunityEffect;
  object oTarget = GetLastUsedBy();
  eImmunityEffect = EffectSpellImmunity(SPELL_CONFUSION);
  ApplyEffectToObject(DURATION_TYPE_INSTANT,eImmunityEffect,oTarget,60.0f);
}

See Also

functions: | GetIsImmune
categories: | Effects Functions | Spells Functions
constants: | SPELL_* Constants

author: Brett Lathrope, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - EffectSpellLevelAbsorption

Home > Reference > Functions > Effects > EffectSpellLevelAbsorption

EffectSpellLevelAbsorption(int, int, int)

Returns a Spell Level Absorption effect

effect EffectSpellLevelAbsorption(
    int nMaxSpellLevelAbsorbed,
    int nTotalSpellLevelsAbsorbed = 0,
    int nSpellSchool = SPELL_SCHOOL_GENERAL
);

Parameters

nMaxSpellLevelAbsorbed

maximum spell level that will be absorbed by the effect

nTotalSpellLevelsAbsorbed

maximum number of spell levels that will be absorbed by the effect (Default: 0)

nSpellSchool

SPELL_SCHOOL_* (Default: SPELL_SCHOOL_GENERAL)

Description

Returns a Spell Level Absorption effect.

Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if: nMaxSpellLevelAbsorbed is not between -1 and 9 inclusive, or nSpellSchool is invalid.

Remarks

This function only creates the effect. The effect must then be applied.

Version

1.22

Example

// Example 1 - The following code will create an effect which, when applied, will absorb up to 4 levels of a (maximum) level 6 spell from the school of necromancy.

  effect eSpellAbsorb;
  eSpellAbsorb = EffectSpellLevelAbsorption(6, 4, SPELL_SCHOOL_NECROMANCY);

See Also

functions: | ApplyEffectToObject | GetEffectType | GetFirstEffect | GetNextEffect | RemoveEffect
categories: | Effects Functions
constants: | EFFECT_TYPE_* Constants | SPELL_SCHOOL_* Constants

author: Brett Lathrope


Function - EffectSpellResistanceDecrease

Home > Reference > Functions > Effects > EffectSpellResistanceDecrease

EffectSpellResistanceDecrease(int)

Returns a Spell Resistance Decrease effect.

effect EffectSpellResistanceDecrease(
    int nValue
);

Parameters

nValue

amount of spell resistance decrease

Description

Returns an effect which decreases spell resistance by nValue. If nValue is less than 1, nothing happens.

Remarks

This function only creates the effect, it still must be applied to have any impact on the target.

Version

1.22

Example

// Example 1 - The following example will create an effect
// which, when applied, would decrease the target's spell
// resistance by 2 and last for 40 seconds.

  effect eSpellDecEffect;
  eSpellDecEffect = EffectSpellResistanceDecrease(2);
  ApplyEffectToObject(DURATION_TYPE_INSTANT,eSpellDecEffect,OBJECT_SELF,40.0f);

See Also

functions: | ApplyEffectToObject
categories: | Effects Functions

author: Brett Lathrope


Function - EffectSpellResistanceIncrease

Home > Reference > Functions > Effects > EffectSpellResistanceIncrease

EffectSpellResistanceIncrease(int)

Returns an effect which increases spell resistance.

effect EffectSpellResistanceIncrease(
    int nValue
);

Parameters

nValue

amount of spell resistance increase

Description

Returns an effect which increases spell resistance by nValue. If nValue is less than 1, nothing happens.

Remarks

This function only creates the effect, it still must be applied to have any impact on the target.

Version

1.22

Example

// Example 1 - The following code creates an effect which, when
// applied, will increase the target's spell resistance by 2 and last
// for 40 seconds.

effect eSpellIncEffect;
eSpellIncEffect = EffectSpellResistanceIncrease(2);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eSpellIncEffect,OBJECT_SELF,40.0f);

See Also

functions: | ApplyEffectAtLocation | ApplyEffectToObject
categories: | Effects Functions

author: Brett Lathrope


Function - EffectStunned

Home > Reference > Functions > Effects > EffectStunned

EffectStunned()

Returns a Stunned effect.

effect EffectStunned();

Description

Create a Stun effect.

Remarks

Only creates the effect, the effect must still be applied to a target.

Version

1.22

Example

// Example 1 - Create a stunned effect and apply it to a target
// who last used the calling object.  The effect will last for 40
// seconds.

object oTarget = GetLastUsedBy();
effect eStunned = EffectStunned();
ApplyEffectToObject(DURATION_TYPE_INSTANT,eStunned,oTarget,40.0f);

// Example 2 - Use EffectStunned() directly without an effect
// variable.

object oTarget = GetLastUsedBy();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectStunned(),oTarget,40.0f);

See Also

functions: | ApplyEffectAtLocation | ApplyEffectToObject
categories: | Effects Functions

author: Brett Lathrope


Function - EffectSummonCreature

Home > Reference > Functions > Effects > EffectSummonCreature

EffectSummonCreature(string, int, float)

Creates a summon creature effect.

effect EffectSummonCreature(
    string sCreatureTag,
    int nVisualEffectId = VFX_NONE,
    float fDelaySeconds = 0.0f
);

Parameters

sCreatureTag

Identifies the creature to be summoned by tag name.

nVisualEffectId

VFX_* (Default: VFX_NONE)

fDelaySeconds

There can be delay between the visual effect being played, and the creature being added to the area. (Default: 0.0f)

Description

Returns a Summon Creature effect which will create a creature of type sCreatureResRef using the visual effect of type nVisualEffectID.

fDelay is the delay between when the visual effect starts and the creature appears. This allows the scriptor to create a much more believable effect.

Can only be applied to creature objects (PC or NPC), not to locations or other objects.

Version

1.28

Example

//Example 1 - The following script is for an OnUsed event.  It
// will summon a werewolf and add it to the PC's party.  The
// werewolf effect will last for 30 minutes.

void main(){

  effect eSummon;
  location lLocation;
  object oPC = GetLastUsedBy();
  eSummon = EffectSummonCreature("nw_werewolf",VFX_FNF_GAS_EXPLOSION_EVIL,0.5f);
  ApplyEffectToObject(DURATION_TYPE_INSTANT, eSummon, oPC, 1800.0f);
}

See Also

functions: | ApplyEffectAtLocation | ApplyEffectToObject | SetSummonEffect | SummonAnimalCompanion | SummonFamiliar
categories: | Effects Functions

author: Brett Lathrope, editor: Charles Feduke, additional contributor(s): Enigmatic, Aiko Gieskens


Function - EffectSwarm

Home > Reference > Functions > Effects, Henchmen/Familiars/Summoned > EffectSwarm

EffectSwarm(int, string, string, string, string)

Swarmエフェクトを返します。

effect EffectSwarm(
    int nLooping,
    string sCreatureTemplate1,
    string sCreatureTemplate2 = "",
    string sCreatureTemplate3 = "",
    string sCreatureTemplate4 = ""
);

Parameters

nLooping

これがTRUEの場合、このeffectの持続時間の間、このeffectで作成されたあるクリーチャーが死んだ場合、リスト中の次のものが作成される。リスト中の最後のクリーチャーが死んだ場合、最初に巻き戻って、sCreatureTemplate1が作成される。

sCreatureTemplate1

出現する最初のクリーチャーのブループリント

sCreatureTemplate2

オプション：出現する2番目のクリーチャーのブループリント（デフォルト：""）

sCreatureTemplate3

オプション：出現する3番目のクリーチャーのブループリント（デフォルト：""）

sCreatureTemplate4

オプション：出現する4番目のクリーチャーのブループリント（デフォルト：""）

Description

4つまで定義できるクリーチャーのSwarmエフェクトを返します。

Remarks

このeffectはApplyEffectToLocation()と共には動作しません。

PCに適応されたとき、出現したクリーチャーは、対象PCグループの一員になります。

（PCが既にコントロールする召還クリーチャーがいれば置き換えられる）

BiowareのnLoopingに付いての説明は少しあいまいです。nLoopingすることがFALSEである場合さえ、Effectはクリーチャーが死ぬと次のクリーチャーに移るでしょう。しかしながら、nLoopingがFALSEである場合、その持続時間がまだ終了していなくても、effectは終了し、nLoopingがTRUEである場合は、持続時間が続く限りeffectは最初の1番目のクリーチャーに戻ります。

Known Bugs

以前あったバグは幾つか前のパッチで修正されました。

Version

1.30

Example

// 例 1 - 下記はOnUsedイベント用スクリプトである。
// 引き起こされた場合、PCによって引き起こされたのかを確認し
// 違えばスクリプトを終わる。スクリプトを引き起こしたのがPCであった場合
// Swarmエフェクトが作成され、3分間、PCに適用される。

void main(){

  effect eSwarm;
  object oPC = GetLastUsedBy();
  if (!GetIsPC(oPC)) return;
  eSwarm = EffectSwarm(TRUE,"nw_skeleton", "nw_skelchief", "nw_skeleton", "nw_skeleton");
  ApplyEffectToObject(DURATION_TYPE_INSTANT,eSwarm,oPC,180.0f);
}

See Also

functions: | ApplyEffectToObject | SummonAnimalCompanion | SummonFamiliar
categories: | Effects Functions | Henchmen/Familiars/Summoned Functions

author: Brett Lathrope, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - EffectTemporaryHitpoints

Home > Reference > Functions > Effects > EffectTemporaryHitpoints

EffectTemporaryHitpoints(int)

Create a Temporary Hitpoints effect that raises the Hitpoints of the target.

effect EffectTemporaryHitpoints(
    int nHitPoints
);

Parameters

nHitPoints

A positive integer

Description

Returns a new effect object that when applied to a target will temporarily increase their total Hit Points allowable.

Returns an effect of type EFFECT_TYPE_INVALIDEFFECT if nHitPoints < 0.

Remarks

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

See Also

categories: | Effects Functions
constants: | EFFECT_TYPE_* Constants

author: John Shuell


Function - EffectTimeStop

Home > Reference > Functions > Effects > EffectTimeStop

EffectTimeStop()

Returns a new effect object.

effect EffectTimeStop();

Description

Create a Time Stop effect.

Remarks

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork


Function - EffectTrueSeeing

Home > Reference > Functions > Effects > EffectTrueSeeing

EffectTrueSeeing()

Returns an effect of True Seeing.

effect EffectTrueSeeing();

Description

Creates a True Seeing effect which can then be applied to a creature target.

Remarks

EffectTrueSeeing() only creates the effect, it still must be applied to a creature using ApplyEffectToObject.

Using ApplyEffectAtLocation will result in no effect.

Version

1.22

Example

// Example 1 - An OnUsed script to create a True Seeing effect and then apply the effect to a PC with a duration of 60 seconds.

void main(){
  effect eTrueSeeing = EffectTrueSeeing();
  object oPC = GetLastUsedBy();
  if (!GetIsPC(oPC)) return;
  ApplyEffectToObject(DURATION_TYPE_INSTANT,eTrueSeeing,oPC,60.0f);
}

// Example 2 - Same script as Example 1, but uses
// EffectTrueSeeing without the need of an effect variable.

void main(){
  object oPC = GetLastUsedBy();
  if (!GetIsPC(oPC)) return;
  ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectTrueSeeing(),oPC,60.0f);
}

See Also

functions: | ApplyEffectToObject
categories: | Effects Functions

author: Brett Lathrope


Function - EffectTurned

Home > Reference > Functions > Effects > EffectTurned

EffectTurned()

Returns a new effect object.

effect EffectTurned();

Description

Create a Turned effect.

Remarks

Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.

Version

1.22

See Also

categories: Effects Functions

author: Michael Nork


Function - EffectTurnResistanceDecrease

Home > Reference > Functions > Effects, Spells > EffectTurnResistanceDecrease

EffectTurnResistanceDecrease(int)

クリーチャーによりアンデッド退散の影響を受けやすくさせるように、ターン抵抗減少エフェクトを作成します。

effect EffectTurnResistanceDecrease(
    int nHitDice
);

Parameters

nHitDice

ヒットダイスを減少させる数値（正数）

Description

nHitdice分レベルを減少させたかのようにアンデッド退散抵抗を減少させた時、新しいeffectを返します。

Remarks

コンストラクタ（プログラム用語です）はobjectの新規のデータ値（instance）を返す特別な方法です。NWNスクリプトにおいて、Objectにつけることの出来るeffect全ては、特殊なエフェクトの新しいデータ値を作成する独自のコンストラクタを持ちます。このeffectはApplyEffectToObject()コマンドを使って使用することが出来ます。詳細はeffectコンストラクタを見てください。

Version

1.22

See Also

functions: | EffectTurnResistanceIncrease | GetTurnResistanceHD
categories: | Effects Functions | Spells Functions

author: John Shuell, JP team: Rainie


Function - EffectTurnResistanceIncrease

Home > Reference > Functions > Effects, Spells > EffectTurnResistanceIncrease

EffectTurnResistanceIncrease(int)

クリーチャーによりアンデッド退散の影響を受け難くするように、ターン抵抗増加エフェクトを作成します。

effect EffectTurnResistanceIncrease(
    int nHitDice
);

Parameters

nHitDice

ヒットダイスを増加させる数値（正数）

Description

nHitdice分レベルを増加させたかのようにアンデッド退散抵抗を増加させた時、新しいeffectを返します。

Remarks

コンストラクタ（プログラム用語です）はobjectの新規のデータ値（instance）を返す特別な方法です。NWNスクリプトにおいて、Objectにつけることの出来るeffect全ては、特殊なエフェクトの新しいデータ値を作成する独自のコンストラクタを持ちます。このeffectはApplyEffectToObject()コマンドを使って使用することが出来ます。詳細はeffectコンストラクタを見てください。

Version

1.22

See Also

functions: | EffectTurnResistanceDecrease | GetTurnResistanceHD
categories: | Effects Functions | Spells Functions

author: John Shuell, JP team: Rainie


Function - EffectUltravision

Home > Reference > Functions > Effects > EffectUltravision

EffectUltravision()

Returns an effect of Ultravision

effect EffectUltravision();

Description

Returns an effect of Ultravision which must then be applied to a creature using ApplyEffectToObject().

Version

1.22

Example

// Example 1 - Create an Ultravision effect and apply it to the
// target who last used the calling object.  The effect will last for
// 40 seconds.

object oTarget = GetLastUsedBy();
effect eUltravision = EffectUltravision();
ApplyEffectToObject(DURATION_TYPE_INSTANT,eUltravision,oTarget,40.0f);

// Example 2 - Use EffectUltravision() directly without an effect
// variable.

object oTarget = GetLastUsedBy();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectUltravision(),oTarget,40.0f);

See Also

categories: Effects Functions

author: Brett Lathrope


Function - EffectVisualEffect

Home > Reference > Functions > Effects, Visual Effects > EffectVisualEffect

EffectVisualEffect(int, int)

新しい視覚エフェクトオブジェクトを作ります。

effect EffectVisualEffect(
    int nVisualEffectId,
    int nMissEffect = FALSE
);

Parameters

nVisualEffectId

nMissEffect

TRUEであれば、ターゲットの近く、もしくは通り過ぎた位置にエフェクトを演出するランダムベクトルが作られます。(デフォルト: FALSE)

Description

NWNスクリプトでは、あなたがオブジェクトに置くことを許されたそれぞれのエフェクトは、特定のエフェクトの新しい例を作る自身の構造を持っています。

このエフェクトオブジェクトはApplyEffectToObject()コマンドの中で使われます。

Version

1.22

Example

//新しい視覚エフェクトを作ります
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
//エフェクトを与えます
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDur, oTarget);

See Also

functions: | ApplyEffectAtLocation
categories: | Effects Functions | Visual Effects Functions

author: Michael Nork, JP team: Redondo


Function - EndGame

Home > Reference > Functions > Module > EndGame

EndGame(string)

現在進行中のゲームを終了します。

void EndGame(
    string sEndMovie
);

Parameters

sEndMovie

サブディレクトリ"movies"にあるファイル名（".bik"拡張子は除く）

Description

現在進行中のゲームを終了し、sEndMovieを再生します。そのとき全てのプレイヤーをゲームのメインメニューに返します。sEndMovieは再生するムービーのファイル名である必要があります、それはNWNのインストールフォルダのサブディレクトリ"movies"にあるファイル名（".bik"拡張子は除く）です。存在しないファイル名を指定すると"credits.bik"ムービーが再生されます。

どのムービーでも、完全に再生された後は "credits.bik"が自動的に再生されます。

Version

1.28

Example

//"movies"ディレクトリにあるエンディングムービー
//"Ending.bik"を使用してゲームを終える。
//モジュールのプロパティからOnModuleLoadにセット
//モジュールがロードされたときにムービーを再生します。
void main()
{
     EndGame("Ending");
}

See Also

categories: Module Functions

author: Brett Lathrope, editor: Charles Feduke, additional contributor(s): Mark, Max Aller, JP team: Redondo


Function - EndModule

Home > Reference > Functions > Get Data from Object > EndModule

EndModule()

現在のモジュールが、最後のモジュールであるかどうかを決定するために使用されます。

int EndModule();

Description

現在のモジュールがシリーズにおける最後のモジュールである場合、TRUEを返します。

この関数がTRUEを返すためには、最後のモジュールが、"ENDMODULE"、"ENDMODULE1"、"ENDMODULE2"、"ENDMODULE3"のいずれかのタグを持っていなければなりません。

その他の場合は、FALSEを返します。

Remarks

タグに基づくチェックで、現在のモジュールが公式キャンペーンの最後のモジュール群の中の一つであれば、TRUEを返します。

Bioware社以外の人たちにとっては、ほとんど役に立ちません。

Requirements

#include "nw_i0_henchman"

Version

1.29

See Also

categories: Get Data from Object Functions

author: Lilac Soul, editor: Charles Feduke, JP team: katsu794


Function - EquipAppropriateWeapons

Home > Reference > Functions > Action on Object, Henchmen/Familiars/Summoned > EquipAppropriateWeapons

EquipAppropriateWeapons(object)

クリーチャーに適切な武器を準備させてください。

void EquipAppropriateWeapons(
    object oTarget
);

Parameters

oTarget

調べるクリーチャー

Description

呼出クリーチャーにoTargetが持っている戦闘に最も適した武器を装備させます。例えば、棍棒と魔法のスピア+1を持ったリザードマンがスケルトンと闘っているとして、（殴打武器はスケルトンに対して多くのダメージを与えるので）棍棒を装備するでしょう。同じリザードマンが、人間のコモナーと向い合ったとき、魔法のスピア+1を掴むでしょう。最も強力な遠距離武器を調べ、次に近接武器を調べます。

Requirements

#include "NW_I0_GENERIC"

Version

1.28

See Also

functions: | ActionEquipItem | ActionEquipMostDamagingMelee | ActionEquipMostDamagingRanged
categories: | Action on Object Functions | Henchmen/Familiars/Summoned Functions

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Koen Vanderstraeten, JP team: Rainie


Function - EscapeArea

Home > Reference > Functions > Movement > EscapeArea

EscapeArea(int, string)

クリーチャーをウェイポイントへ脱出させます。

void EscapeArea(
    int bRun = TRUE,
    string sTag = "NW_EXIT"
);

Parameters

bRun

クリーチャーを走らすかどうかを決めます。（デフォルト：TRUE）

sTag

移動するobject（一般的なウェイポイント）のtag（デフォルト："NW_EXIT"）

Description

クリーチャーをタグ名sTagを持つ最も近いウェイポイントに走るまたは歩かせます（bRun）。

また、クリーチャーが中断されるのを防ぎます。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Movement Functions

author: Tom Cassiotis, JP team: Rainie


Function - EscapeViaTeleport

Home > Reference > Functions > Combat Actions > EscapeViaTeleport

EscapeViaTeleport(object)

呪文を詠唱しているように見える間にクリーチャーを離れた場所へとテレポートさせます。

void EscapeViaTeleport(
    object oFleeing
);

Parameters

oFleeing

逃れさせるクリーチャー

Description

呪文を詠唱しているように見える間に、oFleeingを離れた場所へとテレポートさせます。

Remarks

oFleeingが呪文を詠唱するような物と、消え去るような物との2つのビジュアルeffectを起こします。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Combat Actions Functions

author: Tom Cassiotis, JP team: Rainie


Function - EventActivateItem

Home > Reference > Functions > Action on Object > EventActivateItem

EventActivateItem(object, location, object)

使用されたアイテムのイベントタイプを返します。

event EventActivateItem(
    object oItem,
    location lTarget,
    object oTarget
);

Parameters

oItem

lTarget

oTarget

Description

使用されたアイテムのイベントタイプを返します。

Remarks

イベントのみが作成されます。SignalEvent()関数から呼ばれなければなりません。

Version

1.22

See Also

functions: | SignalEvent
categories: | Action on Object Functions

author: Brett Lathrope, JP team: katsu794


Function - EventConversation

Home > Reference > Functions > Action on Object > EventConversation

EventConversation()

カンバセーションのイベントタイプを返します。

event EventConversation();

Description

オブジェクトのOnConverstationイベントを発動するためにSignalEvent()関数が使用する引数として、カンバセーションイベントを返します。

Remarks

EventConverstaion()関数は、イベントのみを作成します。イベントを発動させるためにSignalEvent()関数を使う必要があります。

Version

1.22

Example

// 例 1 - 以下のコードはイベントを作成し、OnConversationイベントを発動させるためにSignalEvent()関数を使っています。

void main()
{
  event evConversation;
  object oNPC = GetLastPerceived();
  if (oNPC != OBJECT_INVALID)
  {
    evConversation = EventConversation();
    SignalEvent(oNPC, evConversation);
  }
}

// 例 2 - イベント変数をキャストせずにEventConversation関数をSignalEvent関数の
// 内部で使う方法です。
// EventConversation()関数の最も典型的な使用方法です。

  SignalEvent(oNPC, EventConversation());

See Also

functions: | GetLastSpeaker | SignalEvent
categories: | Action on Object Functions

author: Brett Lathrope, JP team: katsu794


Function - EventSpellCastAt

Home > Reference > Functions > Spell Casting Effects, Spells > EventSpellCastAt

EventSpellCastAt(object, int, int)

"SpellCastAt"スクリプトを発動するイベントを作ります。

event EventSpellCastAt(
    object oCaster,
    int nSpell,
    int bHarmful = TRUE
);

Parameters

oCaster

呪文の詠唱者

nSpell

SPELL_*

bHarmful

呪文がそのターゲットを傷つけるかどうか決定します。(デフォルト: TRUE)

Description

"SpellCastAt"スクリプトを発動するイベントを返します。nSpellは詠唱される呪文タイプを指定するSPELL_*の定数。

Remarks

実際に呪文を詠唱するか、もしくは呪文詠唱をシュミレートするだけかどうかは分からない。

Version

1.29

See Also

categories: | Spell Casting Effects Functions | Spells Functions
constants: | SPELL_* Constants

author: Charles Feduke, JP team: Redondo


Function - EventUserDefined

Home > Reference > Functions > Action on Object > EventUserDefined

EventUserDefined(int)

nUserDefinedEventNumberのイベントタイプを返します。

event EventUserDefined(
    int nUserDefinedEventNumber
);

Parameters

nUserDefinedEventNumber

Description

EventUserDefined関数は、SignalEvent()関数と共にOnUserDefinedイベントを発動し、そこに割り当てられたスクリプトを実行するために使われます。OnUserDefinedイベントのスクリプトの中でGetUserDefinedEventNumber()関数を使うことによってnUserDefinedEventNumberを取り出すことができます。

nUserDefinedEventNumberは、標準的なイベント番号の１つ(オブジェクトのデフォルトのOnSpawnスクリプトを見て下さい)、あるいはカスタム番号です。

Remarks

EventUserDefined関数は、イベントのみを作成します。イベントを発動させるためには、SignalEvent()関数を使う必要があります。

ユーザ定義イベントの重要性は、NWNがイベントに割り当てたデフォルトのスクリプトを修正せずに、特有の状況を扱ったカスタムコードを実行できるところにあります。

Version

1.22

Example

// 例 1 - 以下のコードは、eSpecialEventとして1234のカスタムユーザイベントを
// 作成します。それから、oNPCのOnUserDefinedイベントを発動し、それにeSpecialEvent
// を渡しています。

  object oNPC;
  event eSpecialEvent;

  eSpecialEvent = EventUserDefined(1234);
  SignalEvent(oNPC,eSpecialEvent);

See Also

functions: | GetUserDefinedEventNumber | SignalEvent
categories: | Action on Object Functions
events: | OnUserDefined Event

author: Brett Lathrope, editor: Jeremy Spilinek, JP team: katsu794


Function - ExecuteScript

Home > Reference > Functions > Miscellaneous > ExecuteScript

ExecuteScript(string, object)

スクリプトを実行させます。

void ExecuteScript(
    string sScript,
    object oTarget
);

Parameters

sScript

実行するスクリプトの名前

oTarget

実行させる対象

Description

イベントによって呼び出された場合、oTargetにsScriptを実行させます。そして呼び出されたScriptの実行を返します。

イベントによって呼び出した時にスクリプトを実行することの利点は、デフォルトのOBJECT_SELFのような変数が、有効なoObjectに初期化されることです。さらに、装備品やインベントリーの参照もoTargetでデフォルト化されます。これは配置物のOnUsedイベントでスクリプトを使う場合に簡単に書け、利用することができます。

モジュール内で、sScriptが有効にコンパイルされているスクリプトが指定されていない場合、何も起きません。

Remarks

sScriptはモジュールのスクリプトリストにあるスクリプト名でなければなりません。

Version

1.22

Example

// 例１－oTargetのイベントの１つで呼び出された時、
// スクリプト名"sc_example"をoTargetに実行させる。
ExecuteScript("sc_example", oTarget);

See Also

categories: Miscellaneous Functions

author: Brett Lathrope, editor: Jochem van 't Hull, JP team: Rainie


Function - ExitAOESpellArea

Home > Reference > Functions > Prototyped but Unused > ExitAOESpellArea

ExitAOESpellArea(object)

oAOEObjectとして指定されたAOE(効果エリア)から、この関数を呼び出したクリーチャーを逃れさせます。

void ExitAOESpellArea(
    object oAOEObject
);

Parameters

oAOEObject

Description

この関数は実験的な物で、深くは考慮されていません。

Remarks

nw_i0_generic.nssの3360行目にあります。

見たところ、この関数は公式キャンペーンでは全く使用されていません。

この関数は、始めに呼び出した者のアクションキューをクリアします。

そして、呼び出した者をoAOEObjectから5m離れた場所に逃れさせます。

そして、呼び出した者に戦闘を続けさせるために、DetermineCombatRound関数を呼び出します。

Requirements

#include "nw_i0_generic"

Version

1.28

See Also

categories: Prototyped but Unused Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - ExploreAreaForPlayer

Home > Reference > Functions > Area > ExploreAreaForPlayer

ExploreAreaForPlayer(object, object)

プレイヤーに対して完全なエリアマップを見せます。

void ExploreAreaForPlayer(
    object oArea,
    object oPlayer
);

Parameters

oArea

マップを見せるエリア

oPlayer

マップを見せるプレイヤー

Description

oPlayerに対してoAreaの完全マップを見せます。

Remarks

マップ上でエリア全てを見せます。これを再び隠す方法はありません。

Version

1.22

Example

// このスクリプトはエリアのOnEnterイベントへセットします
// プレイヤーに対してプレイヤーが行ってない場所であっても
// 完全なマップを見せます

void main()
{
   object oPlayer = GetEnteringObject();
   if (GetIsObjectValid(oPlayer) && GetIsPC(oPlayer))
   {
      object oArea = GetArea(oPlayer);
      ExploreAreaForPlayer(oArea, oPlayer);
   }
}

See Also

categories: Area Functions

author: Brett Lathrope, editor: Charles Feduke, JP team: Redondo


Function - ExportAllCharacters

Home > Reference > Functions > Server > ExportAllCharacters

ExportAllCharacters()

ゲーム内の全てのキャラクターをセーブします。

void ExportAllCharacters();

Description

現在ゲーム内にいるプレイヤーの全てのキャラクターを、それぞれのフォルダにエクスポート（セーブ）を強制します。(例えばLocalVault、ServerVault等)

Remarks

マルチプレイヤー環境のみで有効です。これは複数サーバー間でキャラクターを共用したり、異なるモジュールを収容する個々のサーバーを共通世界にしたりすることができます。要するに、メインNWNサーバー上と、それからnwn.iniファイル中の以下のように記述した行にあるその他全てのサーバー上の「サーバーヴォルト」フォルダ間で、キャラクターを共用します。

SERVERVAULT=.\servervault

と

SERVERVAULT=\\(ip addr of main svr here\servervault

Version

1.26

Example

// Example 1

  ExportAllCharacters();

See Also

functions:ﾂ | ExportSingleCharacter
categories:ﾂ | Server Functions

author: Brett Lathrope, editor: Charles Feduke, additional contributor(s): Dan Scott, JP team: geshi, Rainie


Function - ExportSingleCharacter

Home > Reference > Functions > Miscellaneous, Server > ExportSingleCharacter

ExportSingleCharacter(object)

指定したプレイヤーのキャラクターをそれに対応したフォルダ（例、ローカルヴォルト、サーバーヴォルト）へと書き出します。

void ExportSingleCharacter(
    object oPlayer
);

Parameters

oPlayer

エクスポートするPCのキャラクター

Description

oPlayerをサーバーの設定によって、ローカルヴォルトかサーバーヴォルトのフォルダへ書き出します。シングルプレイヤーの場合、常にローカルヴォルトへと書き出します。

Remarks

ExportAllCharacterはマルチプレイヤーにのみ動作するので、これはシングルプレイヤーで使ってください。

Version

1.31

See Also

functions: | ExportAllCharacters
categories: | Miscellaneous Functions | Server Functions

author: Lilac Soul, JP team: Rainie


Function - ExtraordinaryEffect

Home > Reference > Functions > Effects > ExtraordinaryEffect

ExtraordinaryEffect(effect)

Marks an effect as belonging to the effect subtype Extraordinary.

effect ExtraordinaryEffect(
    effect eEffect
);

Parameters

eEffect

An effect to flag as extraordinary.

Description

This function adds the flag SUBTYPE_EXTRAORDINARY to an effect, marking it as an Extraordinary effect. This allows the engine to apply the effect with the same rules as Extraordinary Abilities (3rd edition DMG page 71, MM page 7).

Remarks

The extent to which the Aurora Engine correctly classifies and applies Extraordinary effects is not yet known.

Version

1.29

Example

// while scripting a Pixie's arrows, you might find:
Effect eSleep = ExtraordinaryEffect(EffectSleep());

See Also

functions: | ApplyEffectAtLocation | ApplyEffectToObject | MagicalEffect | SupernaturalEffect
categories: | Effects Functions
constants: | SUBTYPE_* Constants

author: Iskander Merriman, editor: Charles Feduke, additional contributor(s): Alex Meduna


Function - fabs

Home > Reference > Functions > Math > fabs

fabs(float)

浮動小数値の絶対値を返す

float fabs(
    float fValue
);

Parameters

fValue

絶対値を取りたい浮動小数値

Description

fValueの値の絶対値を返す。数値が負の場合はマイナスを取り除いた正の数値となる。

Version

1.22

See Also

functions: | abs
categories: | Math Functions

author: Charles Feduke, JP team: ngtaicho


Function - FaceNearestPC

Home > Reference > Functions > Conversation > FaceNearestPC

FaceNearestPC()

NPCを一番近くの見えているPCの方に向けます

void FaceNearestPC();

Description

NPCを一番近くの見えているPCの方に向けます

Requirements

#include "nw_i0_2q4luskan"

Version

1.22

Example

// 1.24のソースはこの関数用
void FaceNearestPC()
{
    vector vFace = GetPosition(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN));
    SetFacingPoint(vFace);
}

See Also

categories: Conversation Functions

author: Tom Cassiotis, JP team: Rainie


Function - FadeFromBlack

Home > Reference > Functions > Cut-Scene, PC Only > FadeFromBlack

FadeFromBlack(object, float)

暗転から通常の画像へと画面をフェードインします。

void FadeFromBlack(
    object oCreature,
    float fSpeed = FADE_SPEED_MEDIUM
);

Parameters

oCreature

暗転から通常の画面へとフェードさせるクリーチャー

fSpeed

どれくらいの早さでフェードするかをFADE_SPEED_*定数で決定します。(デフォルト: FADE_SPEED_MEDIUM)

Description

指定されたクリーチャーまたはプレイヤーの画面を暗転から通常画面へとフェードインさせます。

Remarks

カットシーン（演出シーン）や時間が過ぎ去った印象を与えるときに使用するのに素晴らしいです。画面を暗転させた後にのみ呼出すべきです。

Version

1.30

Example

// 単純なカットシーンの例 by Lilac Soul
// OnCutsceneAbortにスクリプトがある場合
// PCのシーンを中止させるためにClearAllActionすることができる。
// それから、Invisibility視覚effectを取り除き
// SetCutsceneModeをFALSEにし、コピーを破壊する。

void RunCutsceneActions();
void CreateCopy(object oPC = OBJECT_SELF);

void main()
{
object oPC=GetEnteringObject();

if (!GetIsPC(oPC)) return;

AssignCommand(oPC, RunCutsceneActions());
}

// oPCがOBJECT_SELFになることができ、関数自身が含まれているので
// AssignCommandに必要がない。
// その他が始まる前に、前の１つを終わらせて置く事が必要な操作を
// 可能にする為にSetCutsceneModeの使用は重宝する。
void RunCutsceneActions()
{
// PCの画面を暗転する。
ActionDoCommand(FadeToBlack(OBJECT_SELF, FADE_SPEED_FAST));

ActionWait(2.0);

ActionDoCommand(SetCutsceneMode(OBJECT_SELF, TRUE));

// 目に見えないPCを動かすことができ、彼が立っていると彼に
// 思わせることができるように、コピーを作成する。
ActionDoCommand(CreateCopy());

// PCを不可視状態にする。
effect eInv=EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);

ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, OBJECT_SELF));

// PCの暗転を通常に戻す
ActionDoCommand(FadeFromBlack(OBJECT_SELF, FADE_SPEED_FAST));

// そして、不可視のPCを「あるところ」へと移動させ
// カメラがちょうど移動したかのように見せる。
// PCのコピーを作成しているので、プレイヤーにそこに立っているか
// のような印象をもたせることが出来る。
// oNPCのようなその他の人の行動を取らせる場合
// PCのアクションキューにNPCのアクションを追加する。
// 注意点：アクションキューには75個以上のアクションは入らない。

// 最終段階の呼出
ActionDoCommand(FadeToBlack(OBJECT_SELF, FADE_SPEED_FAST));

ActionWait(2.0);

ActionDoCommand(SetCutsceneMode(OBJECT_SELF, FALSE));

// コピーを削除する
ActionDoCommand(DestroyObject(GetLocalObject(GetModule(), "pccopy")));

ActionDoCommand(RemoveEffect(OBJECT_SELF, eInv));

ActionDoCommand(FadeFromBlack(OBJECT_SELF, FADE_SPEED_FAST));
}

// PCのコピーを作成する関数
void CreateCopy(object oPC = OBJECT_SELF)
{
object oCopy=CopyObject(oPC, GetLocation(oPC));

// PCのコピーである確認
SetIsTemporaryFriend(oPC, oCopy);

// 後で破壊できるように格納する
SetLocalObject(GetModule(), "pccopy", oCopy);

}

See Also

functions: | BlackScreen | FadeToBlack | SetCutsceneMode | StopFade
categories: | Cut-Scene Functions | PC Only Functions
constants: | FADE_SPEED_* Constants
events: | OnCutsceneAbort Event

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - FadeToBlack

Home > Reference > Functions > Cut-Scene, PC Only > FadeToBlack

FadeToBlack(object, float)

指定したプレイヤーの画面を暗くフェードアウトさせます。

void FadeToBlack(
    object oCreature,
    float fSpeed = FADE_SPEED_MEDIUM
);

Parameters

oCreature

画面をフェードさせる、プレイヤー操作のクリーチャー

fSpeed

暗くフェードしていく速度（FADE_SPEED_*） (デフォルト: FADE_SPEED_MEDIUM)

Description

指定したプレイヤーやクリーチャーの画面を通常の画面から暗くフェードアウトさせます。

Remarks

カットシーンを始めたり、時間の経過した印象を与えるのにすごく便利です。

Version

1.30

Example

//Example of a simple cutscene by Lilac Soul
//If you have a script in OnCutsceneAbort, you can simply
//ClearAllActions on the PC to make the scene stop,
//then remove the invisibility visual effect and
//SetCutsceneMode to false, and destroy the copy.

void RunCutsceneActions();
void CreateCopy(object oPC = OBJECT_SELF);

void main()
{
object oPC=GetEnteringObject();

if (!GetIsPC(oPC)) return;

AssignCommand(oPC, RunCutsceneActions());
}

//Wrapped in its own function so that oPC can be
//OBJECT_SELF so there's no need for AssignCommand
//Making heavy use of ActionDoCommand to be able to control
//that one thing must finish before another starts
void RunCutsceneActions()
{
//Fade out the PC
ActionDoCommand(FadeToBlack(OBJECT_SELF, FADE_SPEED_FAST));

ActionWait(2.0);

ActionDoCommand(SetCutsceneMode(OBJECT_SELF, TRUE));

//Create a copy so we can move the invisible PC around
//and still have him think he's standing where he was
ActionDoCommand(CreateCopy());

//Make PC invisible
effect eInv=EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);

ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, OBJECT_SELF));

//Fade PC back in
ActionDoCommand(FadeFromBlack(OBJECT_SELF, FADE_SPEED_FAST));

//Here then, move the invisible PC around and do whatever
//It will look like the camera is just moving, and the
//player will have the impression of standing still because
//we created a copy of him
//If having others do stuff, like oNPC, you can do this trick
//To have the NPC action added to the PC's action queue
//REMEMBER: NO MORE THAN 75 ACTIONS IN AN ACTION QUEUE!
//ActionDoCommand(AssignCommand(oNPC, ActionSpeakString("Hello")));

//Eventually, we call
ActionDoCommand(FadeToBlack(OBJECT_SELF, FADE_SPEED_FAST));

ActionWait(2.0);

ActionDoCommand(SetCutsceneMode(OBJECT_SELF, FALSE));

//Destroy the copy
ActionDoCommand(DestroyObject(GetLocalObject(GetModule(), "pccopy")));

ActionDoCommand(RemoveEffect(OBJECT_SELF, eInv));

ActionDoCommand(FadeFromBlack(OBJECT_SELF, FADE_SPEED_FAST));
}

//Function for creating a copy of the PC
void CreateCopy(object oPC = OBJECT_SELF)
{
object oCopy=CopyObject(oPC, GetLocation(oPC));

//Make sure the copy likes the PC
SetIsTemporaryFriend(oPC, oCopy);

//Store so we can destroy later!
SetLocalObject(GetModule(), "pccopy", oCopy);

}

See Also

functions: | BlackScreen | FadeFromBlack | SetCutsceneMode | StopFade
categories: | Cut-Scene Functions | PC Only Functions
constants: | FADE_SPEED_* Constants
events: | OnCutsceneAbort Event

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - FakeRestore

Home > Reference > Functions > Private Functions > FakeRestore

FakeRestore(object)

悪い効果を全て取り除き、治癒する

void FakeRestore(
    object oTarget
);

Parameters

oTarget

癒したいターゲット

Description

oTargetにかかった全ての効果を調べ悪い効果を全て取り除き、治癒する。この関数はアクションキューに入れることができる。

Remarks

nw_d1_templeheal.nssの14行目で見つかる。

nw_d1_templehealはインクルードファイルではないため、インクルードできず、その上"void main()"を使っているため、呼び出すことができない。しかし、nw_d1_templehealを自身で作成したスクリプトにコピーし使うことができる。

以下のExampleはその写しである。

Version

1.28

Example

void FakeRestore(object oTarget)
{
    effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION_GREATER);

    effect eBad = GetFirstEffect(oTarget);
    // 悪影響を探す
    while(GetIsEffectValid(eBad))
    {
        if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
            GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
            GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
            GetEffectType(eBad) == EFFECT_TYPE_CURSE ||
            GetEffectType(eBad) == EFFECT_TYPE_DISEASE ||
            GetEffectType(eBad) == EFFECT_TYPE_POISON ||
            GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
            GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
        {
            // 悪影響なら取り除く
            RemoveEffect(oTarget, eBad);
        }
        eBad = GetNextEffect(oTarget);
    }
    if(GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
    {
        // VFXエフェクトの適応
        int nHeal = GetMaxHitPoints(oTarget) - GetCurrentHitPoints(oTarget);
        effect eHeal = EffectHeal(nHeal);
        if (nHeal > 0)
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
    }
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget);
}

See Also

categories: Private Functions Functions

author: Lilac Soul, editor: Charles Feduke, additional contributor(s): Lilac Soul, JP team: ngtaicho


Function - FeetToMeters

Home > Reference > Functions > Math > FeetToMeters

FeetToMeters(float)

フィートをメートルの単位に変換する。

float FeetToMeters(
    float fFeet
);

Parameters

fFeet

（長さの単位）フィート単位の数値（浮動小数値）

Description

fFeetフィートをメートル単位に変換し値を返す。

Remarks

1フィート = 0.3048メートル

Version

1.22

Example

// fMetersに1.066799998がセットされる。

  float fMeters
  fMeters = FeetToMeters(3.5f);

See Also

functions: | YardsToMeters
categories: | Math Functions

author: Brett Lathrope, JP team: ngtaicho


Function - FindSingleRangedTarget

Home > Reference > Functions > Combat Information, Core AI, Math, Targeting > FindSingleRangedTarget

FindSingleRangedTarget()

3メートル以上離れた敵を探す。

object FindSingleRangedTarget();

Description

呼び出したOBJECT_SELFから3メートル以上、30メートル以下の範囲内で一番近い敵を見つける。

Remarks

コアAIで射手が敵をターゲットする際に使われている。

Requirements

#include "nw_i0_generic"

Version

1.28

See Also

categories: Combat Information Functions | Core AI Functions | Math Functions | Targeting Functions

author: John Shuell, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: ngtaicho


Function - FindSubString

Home > Reference > Functions > String > FindSubString

FindSubString(string, string)

sString中のsSubstringの位置を返す

int FindSubString(
    string sString,
    string sSubString
);

Parameters

sString

sSubString

Description

sString中のsSubstringの位置を表す整数値を返す。探索は、大文字小文字を区別する。

sString中にsSubstringがもしあるなら、どこにあるかの0をベースとしたインデックスを返す。

sString中にsSubstringが見つからない場合は、-1を返す。

Version

1.22

Example

// 例1 - 以下は0の値を返す
  int nPostion = FindSubString("testing","test");

// 例2 - 以下は1の値を返す
  int nPostion = FindSubString("testing","est");

// 例3 - 以下は-1の値を返す
  int nPostion = FindSubString("testing","mike");

// 例4 - 以下は-1の値を返す
  int nPostion = FindSubString("testing","Test");

See Also

functions: | GetStringLeft | GetStringLength | GetStringLowerCase | GetStringRight | GetStringUpperCase
categories: | String Functions

author: Brett Lathrope, JP team: weed


Function - FindTarget

Home > Reference > Functions > Private Functions > FindTarget

FindTarget(float)

衛兵の次の攻撃目標を探す

object FindTarget(
    float fMaxDistance
);

Parameters

fMaxDistance

探知する最大距離

Description

この関数は範囲内の最も近い攻撃可能な目標を返す。一人も攻撃目標がいなかった場合はOBJECT_INVALIDを返す。

Remarks

nw_c3_waypoint3.nss の16行目

FakeRestore関数と同様にインクルードファイルではないため、通常の方法では使用できないが、コピーして使うことができる。

呼び出した生物の半径fMaxDistance内の攻撃可能なターゲットのみ探し出し、死体状態の目標は検知しない。

Bioware公式モジュールでは、次の目標が検知されない場合、衛兵はウェイポイントを巡回しなおす。私はまだ公式キャンペーン以外でこの関数が使われているところを見たことがない。

OnCombatRoundEndイベントで使用するのが一番論理的のようだ。

Version

1.28

See Also

categories: Private Functions Functions

author: Lilac Soul, editor: Charles Feduke, additional contributor(s): Lilac Soul, JP team: ngtaicho


Function - FloatingTextStringOnCreature

Home > Reference > Functions > Conversation, PC Only, Visual Effects > FloatingTextStringOnCreature

FloatingTextStringOnCreature(string, object, int)

テキストをターゲットの頭上に簡潔に表示します

void FloatingTextStringOnCreature(
    string sStringToDisplay,
    object oCreatureToFloatAbove,
    int bBroadcastToFaction = TRUE
);

Parameters

sStringToDisplay

表示するメッセージ

oCreatureToFloatAbove

メッセージを表示させるクリーチャー

bBroadcastToFaction

これがTRUEであるならば、oCreatureToFloatAboveと同じファクション且つ30ｍの範囲内のクリーチャーだけがテキストを見ます。（デフォルト：TRUE）

Description

目標となるクリーチャーの頭上の空間にテキストを簡潔に表示させて、フェードアウトさせます。SpeakStringと異なり、テキストの前にクリーチャーの名前を表示しません。しかしながらテキストが見えるかどうかは限定されます（以下のRemarksを見てください）。

bBroadcastToFactionがTRUEでなのであれば、目標のクリーチャーと、またその30ｍ以内の同一ファクションを持つクリーチャーがテキストを視認します。bBroadcastToFactionがFALSEならば、ターゲットクリーチャーのみが視認します。

Remarks

この関数はゲーム効果（探知や周囲の知覚など）でPCや可能ならばパーティに通知するのに、最も役立つように思えますが、PCとクリーチャー間のコミュニケーションを促す方法としてはそうでもありません。例えば、PCが聞き耳チェックを成功した場合、このテキストによって通知することができるでしょう（「ホールへと降りてくる足音を聞いた」など）。他の用途としてはPCが発する擬音（「ポキッ！」、「こほっこほっ！」「ヒック！」等）や簡潔なゲーム出力（立ち聞こえ、日時計の時間、Itemの能力などのシミュレート）などです。.

この関数はどんな種類の配置用オブジェクトの上にも表示できません。またNPCを目標としたテキストはPCには見えることはありません。

看板や、日時計、もしくはテキストを表示する時にPCがobjectの近くにいる間は通知したいPCとしてoCreatureToFloatAboveに割り当てられたその他の配置用オブジェクトから、聞こえるテキストを擬制できます。

Version

1.28

Example

// これは日時計のOnUsed用のスクリプトである
// 日時計は日中のみ機能する
// もし日中なら、日時計はPCの頭上に
// 時間を表示する

void main()
{
     // 使用者を取得し、それがPCであると定義する
     object oPC = GetLastUsedBy();
     // 日中であるかどうかを調べる
     if (GetIsDay())
     {
          // 変数を初期化
          int nHour = GetTimeHour();
          string sTime = IntToString(nHour) + " o'clock";
          // そのPCの頭上にのみ時間を表示する
          FloatingTextStringOnCreature(sTime, oPC, FALSE);
     }
     else
     {
           // 夜間ならば、時間が特定できないとプレイヤーに告げる
          FloatingTextStringOnCreature("There is no sun to cast "  + "a shadow on the sundial.",
               oPC,
               FALSE
          );
     }
}

See Also

functions: | ActionStartConversation | FloatingTextStrRefOnCreature | SpeakString
categories: | Conversation Functions | PC Only Functions | Visual Effects Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Erik Jones, Douglas Appelt, JP team: Rainie


Function - FloatingTextStrRefOnCreature

Home > Reference > Functions > Conversation, PC Only > FloatingTextStrRefOnCreature

FloatingTextStrRefOnCreature(int, object, int)

テキストである文字列のRefをターゲットの頭上に簡潔に表示します

void FloatingTextStrRefOnCreature(
    int nStrRefToDisplay,
    object oCreatureToFloatAbove,
    int bBroadcastToFaction = TRUE
);

Parameters

nStrRefToDisplay

文字列のRef（故にテキストは翻訳されます）

oCreatureToFloatAbove

ターゲットクリーチャーとなるPCまたはNPC

bBroadcastToFaction

これがTRUEであるならば、oCreatureToFloatAboveと同じファクション且つ30ｍの範囲内のクリーチャーだけがテキストを見ます。（デフォルト：TRUE）

Description

目標となるクリーチャーの頭上の空間にテキストとしての文字列Refを簡潔に表示させて、フェードアウトさせます。SpeakStringと異なり、テキストの前にクリーチャーの名前を表示しません。しかしながらテキストが見えるかどうかは限定されます（以下のRemarksを見てください）。

bBroadcastToFactionがTRUEでなのであれば、目標のクリーチャーと、またその30ｍ以内の同一ファクションを持つクリーチャーがテキストを視認します。bBroadcastToFactionがFALSEならば、ターゲットクリーチャーのみが視認します。

Remarks

この関数はゲーム効果（探知や周囲の知覚など）でPCや可能ならばパーティに通知するのに、最も役立つように思えますが、PCとクリーチャー間のコミュニケーションを促す方法としてはそうでもありません。例えば、PCが聞き耳チェックを成功した場合、このテキストによって通知することができるでしょう（「ホールへと降りてくる足音を聞いた」など）。他の用途としてはPCが発する擬音（「ポキッ！」、「こほっこほっ！」「ヒック！」等）や簡潔なゲーム出力（立ち聞こえ、日時計の時間、Itemの能力などのシミュレート）などです。

現在、Str Refに変更を加えるトークテーブルを更新する方法がないように思われます。またデフォルトのStr Refコードの公式のリストも存在しません。

Known Bugs

大したバグではないですが制限があります：

この関数はどんな種類の配置用オブジェクトの上にも表示できません。またNPCを目標としたテキストはPCには見えることはありません。

Version

1.22

See Also

functions: | ActionSpeakStringByStrRef | FloatingTextStringOnCreature
categories: | Conversation Functions | PC Only Functions

author: Ryan Hunt, editor: Jeremy Spilinek, JP team: Rainie


Function - FloatToInt

Home > Reference > Functions > Type Casting/Conversion > FloatToInt

FloatToInt(float)

浮動小数値を整数値に変換する／小数点以下を切り捨てる

int FloatToInt(
    float fFloat
);

Parameters

fFloat

整数型に変えたい浮動小数値

Description

fFloatの浮動小数型の値を整数値に変える。整数型は小数位をサポートしていないため、小数点以下の数値は結果的に切り捨てられる。四捨五入はされない。

Remarks

BioWareの文章には誤って、四捨五入されると記述されている。

Version

1.22

Example

// example courtesy of Ken Vargo
// normalizing angles
// variation of an example introduced by Vane
// when it was realized that FloatToInt acts like
// TRUNC() in MS Excel rather than INT().

int iAddAngles(int iAngleOne, int iAngleTwo);

void main()
{
    int iA1 = GetLocalInt (OBJECT_SELF, "a1");
    int iA2 = GetLocalInt (OBJECT_SELF, "a2");

    int iSum = iAddAngles(iA1, iA2);
    int iNegSum = iAddAngles(0 - iA1, 0 - iA2);
    // this tests the negatives added together
    //(-10 + -10 = -20 = 340 degrees)

    SendMessageToPC(GetFirstPC(), IntToString(iSum));
    SendMessageToPC(GetFirstPC(), IntToString(iNegSum));

    SetLocalInt(OBJECT_SELF, "a1",  iA1 + 10);
    SetLocalInt(OBJECT_SELF, "a2", iA2 + 10);
}

// this function return the normalized sum of two angles
// (will always be a positive angle value b/w 0 and 359).
int iAddAngles(int iAngleOne, int iAngleTwo)
{
    int iAngleSum = (iAngleOne + iAngleTwo);
    int iNormalAngleSum = iAngleSum - (360 * FloatToInt(iAngleSum/360.0));
    if (iNormalAngleSum >= 0)
    {
        return iNormalAngleSum;
    }
    else
    {
        return  360 + iNormalAngleSum;
    }
}

See Also

functions: | FloatToString | IntToFloat
categories: | Type Casting/Conversion Functions

author: Charles Feduke, JP team: ngtaicho


Function - FloatToString

Home > Reference > Functions > Type Casting/Conversion > FloatToString

FloatToString(float, int, int)

浮動小数値を文字列に変換する。

string FloatToString(
    float fFloat,
    int nWidth = 18,
    int nDecimals = 9
);

Parameters

fFloat

文字列に変換したい浮動小数値

nWidth

小数点の左側の桁数の指定。省略された場合は18

nDecimals

小数点以下の桁数の指定。省略された場合は9（最大値）

Description

浮動小数値fFloatの値を文字列に変換して返す。

小数点以上の桁はnWidthによって指定され、fFloatの小数点以上の桁より大きい場合はスペースを挿入する。逆に桁より少ない場合、もしくは0を指定した場合はスペーシングは行わない。

小数点以下の桁はnDecimalsにより四捨五入される。0の場合は小数点以下の数値を四捨五入した形となる。

Remarks

小数点以下４桁以降の精度が狂うので、nDecimalsの指定は3以下にしたほうがいい。

通常使う場合は

FloatToString(fFloat, 0, 3);

この指定が一番使いやすい。

KnowBugs

小数点以下4桁以降の精度が狂う

Version

1.22

Example

// 様々な指定をした場合の結果の違いを検証
void main()
{
    float fFloat = 12345.67898765432;
    float fFloat2 = 12341.2341234;

    string sFloat1 = FloatToString(fFloat);        // 桁数はディフォルトの18,9
    // 結果　"             12345.678710938"
    // ※ 小数点以上の指定の桁数に満たない部分はスペースが挿入されている。
    // ※ 小数点以下4桁以降は精度が狂う

    string sFloat2 = FloatToString(fFloat,0,0);
    // 結果　"12346"
    // ※ 小数点以上、以下の桁数設定が同じ0でも動作が違う。
    // ※ 小数点以下1桁の四捨五入を行っている。

    string sFloat3 = FloatToString(fFloat,3,3);
    // 結果　"12345.679"
    // ※ 小数点以上の桁の切捨て機能はない。
    // ※ 小数点以下4桁の四捨五入を行っている。

    string sFloat2_1 = FloatToString(fFloat2);     // 桁数はディフォルトの18,9
    // 結果　"             12341.234375000"
    // ※ やはり小数点以下4桁以降は精度が狂う

    string sFloat2_2 = FloatToString(fFloat2,0,0);
    // 結果　"12341"
    // ※ 小数点以下1桁の四捨五入を行っている。

    string sFloat2_3 = FloatToString(fFloat2,3,3);    // 結果　"12341.234"
    // ※ 小数点以下4桁の四捨五入を行っている。

}

See Also

functions: | FloatToInt | StringToFloat | StringToInt
categories: | Type Casting/Conversion Functions

author: Charles Feduke, editor: Jochem van 't Hull, JP team: ngtaicho


Function - FortitudeSave

Home > Reference > Functions > Saving Throw > FortitudeSave

FortitudeSave(object, int, int, object)

頑健セーブ判定の結果を返す

int FortitudeSave(
    object oCreature,
    int nDC,
    int nSaveType = SAVING_THROW_TYPE_NONE,
    object oSaveVersus = OBJECT_SELF
);

Parameters

oCreature

nDC

難易度

nSaveType

SAVING_THROW_TYPE_*（デフォルト：SAVING_THROW_TYPE_NONE）

oSaveVersus

（デフォルト：OBJECT_SELF）

Description

与えられた難易度の頑健セーブ判定の結果を返す。
セービングスローに失敗した場合は、0を返す。
セービングスローに成功した場合は、1を返す。
特定のセーブのタイプに対する免疫がターゲットにある場合は、2を返す。

Version

1.22

Example

// 例1 - 単純な使い方
nSaveResult = FortitudeSave(oTarget, nDifficultyCheck);

// 例2 - すべてのパラメータを使った場合
nSaveResult = FortitudeSave(oTarget, nDifficultyCheck, SAVING_THROW_TYPE_COLD, OBJECT_SELF);

See Also

functions: | GetFortitudeSavingThrow | ReflexSave | WillSave
categories: | Saving Throw Functions
constants: | SAVING_THROW_TYPE_* Constants

author: Brett Lathrope, JP team: weed


Function - GenerateBookTreasure

Home > Reference > Functions > Item Creation > GenerateBookTreasure

GenerateBookTreasure(object, object)

この関数はランダム財宝分配システムの一部です。

void GenerateBookTreasure(
    object oLastOpener,
    object oCreateOn = OBJECT_INVALID
);

Parameters

oLastOpener

プレーヤーキャラクター

oCreateOn

財宝用の入れ物（デフォルト：OBJECT_INVALID）

Description

この関数はNWN財宝分配システムの一部として、財宝を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - GenerateBossTreasure

Home > Reference > Functions > Item Creation > GenerateBossTreasure

GenerateBossTreasure(object, object)

ボスレベルの財宝を作成します。

void GenerateBossTreasure(
    object oLastOpener,
    object oCreateOn = OBJECT_INVALID
);

Parameters

oLastOpener

入れ物を開けたPC

oCreateOn

作成した財宝を入れる入れ物（デフォルト：OBJECT_INVALID）

Description

この関数はNWNNWN財宝分配システムの一部で、PCのためにボスレベルの財宝を作成するために使用されます。この方法で生成された財宝は通常PCに（この場合だとoLastOpener）適合してカスタムされます。：すなわち、ロングソードの武器熟練を持った３レベル戦士だとロングソード+1が見つかることでしょう。

Requirements

#include "nw_o2_coninclude"

Version

1.28

See Also

categories: Item Creation Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): LeegleechN, JP team: Rainie


Function - GenerateHighTreasure

Home > Reference > Functions > Item Creation > GenerateHighTreasure

GenerateHighTreasure(object, object)

この関数は高レベルの財宝を作成します。

void GenerateHighTreasure(
    object oLastOpener,
    object oCreateOn = OBJECT_INVALID
);

Parameters

oLastOpener

プレーヤーキャラクター

oCreateOn

出現させた財宝を入れる入れ物（デフォルト：OBJECT_INVALID）

Description

この関数はNWN財宝分配システムの一部です。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - GenerateLowTreasure

Home > Reference > Functions > Item Creation > GenerateLowTreasure

GenerateLowTreasure(object, object)

このスクリプトは入れ物内に価値の低い財宝を作成します。

void GenerateLowTreasure(
    object oLastOpener,
    object oCreateOn = OBJECT_INVALID
);

Parameters

oLastOpener

プレーヤーキャラクター

oCreateOn

作成した財宝を入れるコンテナ（デフォルト：OBJECT_INVALID）

Description

この関数はNWN財宝分配システムの一部です。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - GenerateMediumTreasure

Home > Reference > Functions > Item Creation > GenerateMediumTreasure

GenerateMediumTreasure(object, object)

ランダム財宝分配システムの一部として、財宝を出現させます。

void GenerateMediumTreasure(
    object oLastOpener,
    object oCreateOn = OBJECT_INVALID
);

Parameters

oLastOpener

プレイヤーObject

oCreateOn

作成させた財宝を入れる入れ物（デフォルト：OBJECT_INVALID）

Description

NWN財宝分配システムの一部として、入れ物を開けたPCのレベルに基づき、中程度の価値の財宝を作成します。

Remarks

nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - GenerateNPCTreasure

Home > Reference > Functions > Item Creation > GenerateNPCTreasure

GenerateNPCTreasure(int, object, object)

クリーチャーが落とす適切な財宝を作成するためのランダム財宝用関数として使用されます。

void GenerateNPCTreasure(
    int nTreasureValue = 1,
    object oTreasureGetter = OBJECT_SELF,
    object oKiller = OBJECT_SELF
);

Parameters

nTreasureValue

財宝の価値（デフォルト：1）

oTreasureGetter

財宝を落とすObject（デフォルト：OBJECT_SELF）

oKiller

NPCを倒したObject（デフォルト：OBJECT_SELF）

Description

この関数はNPC上に財宝を作成します。財宝価値の有効な値は、1-4またはLOW、MED、HIGH、BOSSです。

Remarks

OnSpawnスクリプトから呼出されるのが好ましいです。nw_o2_coninclude.nssで見つかります。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - GenerateTreasure

Home > Reference > Functions > Item Creation > GenerateTreasure

GenerateTreasure(int, object, object)

これはNWN財宝分配システムのメイン関数です。

void GenerateTreasure(
    int nTreasureType,
    object oLastOpener,
    object oCreateOn
);

Parameters

nTreasureType

作成する財宝の種類

oLastOpener

入れ物を開けたObject

oCreateOn

作成した財宝を入れる入れ物

Description

この関数はNWNにおいてプレイヤーの全てが非常に貪欲に探し回る財宝を作成します。この関数は次々にCreate<item>関数の１つを呼出し、クラス/種族/熟練・魔法/非魔法・武器/鎧/アイテムを作成します。

Remarks

nw_o2_coninclude.nssで見つかります。Create<Weapons>スクリプトはnw_o2_featです。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Item Creation Functions

author: Michael Nork, JP team: Rainie


Function - Get2DAString

Home > Reference > Functions > Database, Get Data, String > Get2DAString

Get2DAString(string, string, int)

サーバー上にある*.2daファイルから値を得ます。

string Get2DAString(
    string s2DA,
    string sColumn,
    int nRow
);

Parameters

s2DA

サーバーにある*.2daファイルの名前

sColumn

2daの縦の行の名前

nRow

2daの横の列

Description

対象2daファイルから指定した位置にある値を得ます。ファイル・行・列が見つからない場合は空の文字列を返します。2daで"****"の場合は、""（空の文字列）を返します。

Get2DAString は動的にゲームにデータをロードします。つまりゲームを実行中に2daファイルを変更し、2daから新しい値を読み込むことができます。

Remarks

ループ処理として使わないように。実行速度が遅いからです：50列ループさせると数秒かかります。10列ほどならば問題ないでしょう。

2daファイル名の先頭に”des_”から始まる名前を付けないように。

指定する2daファイル名は最大16文字までです。ファイル名が長すぎると警告無しにこの関数は機能しなくなります。

Known Bugs

2daファイル内の一つのフィールドに対しては最大267文字です。これより長くなるとNWNはクラッシュします。

Version

1.31

Example

// return TRUE if weapon does bludgeoning damage
// Uses Get2DAString, avoid to use in loops!
int GetDoesBludgeoningDamage(object oWeapon)
{
  int nBaseType = GetBaseType(oWeapon);
  return (StringToInt(Get2DAString("baseitems","WeaponType",nBaseType) == 2);
  // 2 = bludgeoning
}

See Also

categories: Database Functions | Get Data Functions | String Functions

author: Charles Feduke, additional contributor(s): Georg Zoeller, Bob Flaherty, JP team: geshi


Function - GetAbilityModifier

Home > Reference > Functions > Get Data from Creature > GetAbilityModifier

GetAbilityModifier(int, object)

クリーチャーの指定した能力修正値を取得します。

int GetAbilityModifier(
    int nAbility,
    object oCreature = OBJECT_SELF
);

Parameters

nAbility

ABILITY_*

oCreature

能力修正値を調べたいクリーチャー。(デフォルト：OBJECT_SELF)

Description

指定した能力修正値を返します。

Version

1.22

See Also

categories: | Get Data from Creature Functions
constants: | ABILITY_* Constants

author: Kristian Markon, JP team:marshall


Function - GetAbilityScore

Home > Reference > Functions > Get Data from Creature > GetAbilityScore

GetAbilityScore(object, int)

クリーチャーの指定した能力値を取得します。

int GetAbilityScore(
    object oCreature,
    int nAbilityType
);

Parameters

oCreature

能力値を調べたいクリーチャー

nAbilityType

ABILITY_*

Description

指定した能力値を返します。(もしくは0)

Version

1.22

See Also

functions: | GetCharisma | GetIntelligence | GetWisdom
categories: | Get Data from Creature Functions
constants: | ABILITY_* Constants

author: Kristian Markon, JP team: marshall


Function - GetAC

Home > Reference > Functions > Combat Information > GetAC

GetAC(object, int)

クリーチャーのAC（アーマークラス）を取得します。

int GetAC(
    object oObject,
    int nForFutureUse = 0
);

Parameters

oObject

ACを得るObject

nForFutureUse

将来的に使用されるためにあり、現在は何も使用されません。（デフォルト：0）

Description

oObjectがクリーチャであればACを返します。

oObjectがアイテム、扉または配置用オブジェクトであれば0を返します。

oObjectがクリーチャー、アイテム、扉または配置用オブジェクトのどれでもなければ-1を返します。

Version

1.28

Example

// このスクリプトは、扉や配置用オブジェクトを開ける時に引き起こされた
// 攻撃を演出することが出来る。
// このスクリプトは、d20を振り、その結果を対象人物のACを対抗として
// 調べる。ダイスの結果が対象のAC以上ならば、d10のダメージを与える。
// （解除するための探索ができない非常に卑怯な罠の類である）
main()
{
   object oPC = GetLastOpenedBy();
   int nDieRoll = d20();
   if (nDieRoll >= GetAC(oPC)) {
      effect eDamage = EffectDamage(d10(), DAMAGE_TYPE_PIERCING);
      ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC);
   }
}

See Also

categories: Combat Information Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: Rainie


Function - GetAge

Home > Reference > Functions > Get Data from Creature > GetAge

GetAge(object)

クリーチャーの年齢を取得します。

int GetAge(
    object oCreature
);

Parameters

oCreature

年齢を取得したいクリーチャー。

Description

指定したクリーチャーの年齢を返します。

もし無効なクリーチャーの場合は0を返します。

Version

1.22

Example

int TrustCreature(object oCreature)
{
   if (GetAge(oCreature) >= 30)
      return FALSE; // Over 30  Can't be trusted.

   return TRUE;
}

See Also

functions: | SetCalendar
categories: | Get Data from Creature Functions

author: Tom Cassiotis JP team: marshall


Function - GetAILevel

Home > Reference > Functions > Core AI > GetAILevel

GetAILevel(object)

クリーチャー上で動作してる現在のAI(人工知能)レベルを取り出します。

int GetAILevel(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

AIレベルを調べるクリーチャー。(デフォルト: OBJECT_SELF)

Description

クリーチャー上で動作してる現在のAI_LEVEL_*の値を返します。

AIレベルの違いは、クリーチャーがどれだけ賢く行動するかや、どれくらいのCPU時間と優先度で命令を受け取るかを示します。

何もせずに立っているクリーチャーは一般的にAI_LEVEL_LOWのAIレベルを持っていますが、クリーチャーが戦闘に突入した時には、デフォルトでAI_LEVEL_NORMALのAIレベルを持つことになるでしょう。

Remarks

AI_LEVEL_NORMALのAIレベルを持つクリーチャーが多数いると、プロセッサーに負担がかかり、パフォーマンスの低下が起こるでしょう。

Version

1.30

See Also

functions: | SetAILevel
categories: | Core AI Functions
constants: | AI_LEVEL_* Constants

author: Charles Feduke, JP team: katsu794


Function - GetAlignmentGoodEvil

Home > Reference > Functions > Alignment, Get Data from Creature > GetAlignmentGoodEvil

GetAlignmentGoodEvil(object)

クリーチャーの善悪の属性を取得します。

int GetAlignmentGoodEvil(
    object oCreature
);

Parameters

oCreature

属性を調べたいクリーチャー。

Description

クリーチャーの善悪の属性を意味する、ALIGNMENT_*定数を返します。

指定したオブジェクトが無効だった場合(OBJECT_INVALID)には、-1を返します。

Version

1.28

See Also

functions: | AdjustAlignment | AdjustReputation | GetAlignmentLawChaos | GetLawChaosValue
categories: | Alignment Functions | Get Data from Creature Functions
constants: | ALIGNMENT_* Constants

author: Charles Feduke JP team: marshall


Function - GetAlignmentLawChaos

Home > Reference > Functions > Alignment, Get Data from Creature > GetAlignmentLawChaos

GetAlignmentLawChaos(object)

クリーチャーの秩序と混沌の属性を取得します。

int GetAlignmentLawChaos(
    object oCreature
);

Parameters

oCreature

属性を調べたいクリーチャー

Description

クリーチャーの秩序と混沌の属性を意味する、ALIGNMENT_*定数を返します。

指定したオブジェクトが無効だった場合(OBJECT_INVALID)には、-1を返します。

Version

1.28

See Also

functions: | AdjustAlignment | AdjustReputation | GetAlignmentGoodEvil | GetLawChaosValue | GetReputation
categories: | Alignment Functions | Get Data from Creature Functions
constants: | ALIGNMENT_* Constants

author: Charles Feduke, JP team: marshall


Function - GetAlliedHD

Home > Reference > Functions > Prototyped but Unused > GetAlliedHD

GetAlliedHD()

この関数は試作されたましたが、使用されていません。

int GetAlliedHD();

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Requirements

#include "nw_i0_generic"

Version

1.22

See Also

functions: | GetEnemyHD
categories: | Prototyped but Unused Functions

author: Steve Moseley, editor: Charles Feduke, JP team: katsu794


Function - GetAnimalCompanionCreatureType

Home > Reference > Functions > Get Data from Creature, Henchmen/Familiars/Summoned > GetAnimalCompanionCreatureType

GetAnimalCompanionCreatureType(object)

クリーチャーの使い魔のタイプを取得します。

int GetAnimalCompanionCreatureType(
    object oCreature
);

Parameters

oCreature

使い魔のタイプを調べたいクリーチャー。

Description

指定したクリーチャーの使い魔のタイプを返します。(FAMILIAR_CREATURE_TYPE_*定数)

無効なクリーチャーを指定したか、現在使い魔を持っていない場合にはFAMILIAR_CREATURE_TYPE_NONEを返します。

Remarks

召喚したクリーチャーの情報は返しません。動物の相棒と使い魔が異なることにも注意してください。

Known Bugs

GetAnimalCompanion*関数とGetFamiliar*関数は逆です。

GetAnimalCompanion*関数はソーサラー及びウィザードの使い魔を返し、GetFamiliar*関数はレンジャー及びドルイドの動物の相棒を返します。

Version

1.22

See Also

functions: | GetAnimalCompanionName | GetAssociate | GetFamiliarCreatureType | GetFamiliarName | SummonAnimalCompanion
categories: | Get Data from Creature Functions | Henchmen/Familiars/Summoned Functions
constants: | FAMILIAR_CREATURE_TYPE_* Constants

author: Charles Feduke, editor: Kristian Markon, additional contributor(s): Jody Fletcher, Gene Koo, JP team: marshall


Function - GetAnimalCompanionName

Home > Reference > Functions > Get Data from Creature, Henchmen/Familiars/Summoned > GetAnimalCompanionName

GetAnimalCompanionName(object)

クリーチャーの使い魔の名前を取得します。

string GetAnimalCompanionName(
    object oCreature
);

Parameters

oCreature

使い魔の名前を調べたいクリーチャー。

Description

指定したクリーチャーの使い魔の名前を返します。

無効なクリーチャーを指定したか、現在使い魔を持っていないか、使い魔の名前が空欄の場合には空の文字列("")を返します。

Remarks

召喚したクリーチャーの情報は返しません。動物の相棒と使い魔が異なることにも注意してください。

Known Bugs

GetAnimalCompanion*関数とGetFamiliar*関数は逆です。

GetAnimalCompanion*関数はソーサラー及びウィザードの使い魔を返し、GetFamiliar*関数はレンジャー及びドルイドの動物の相棒を返します。

Version

1.22

See Also

functions: | GetAnimalCompanionCreatureType | GetFamiliarCreatureType | GetFamiliarName | GetHenchman | SummonAnimalCompanion
categories: | Get Data from Creature Functions | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, additional contributor(s): Jody Fletcher, Gene Koo, JP team: marshall


Function - GetAppearanceType

Home > Reference > Functions > Get Data from Creature > GetAppearanceType

GetAppearanceType(object)

指定したクリーチャーの外見を取得します。

int GetAppearanceType(
    object oCreature
);

Parameters

oCreature

外見を表す定数APPEARANCE_TYPE_*を得たいクリーチャー

Description

指定したクリーチャーのAPPEARANCE_TYPE_*値を返します。対象がクリーチャーでない場合や無効なクリーチャーである場合はAPPEARANCE_TYPE_INVALIDを返します。

Remarks

APPEARANCE_TYPE_*値はappearance.2da内のrownumberを参照します。これは身長、移動速度、体格等のようなクリーチャーの特徴を取得するためにこの関数を使って返された値を使用できるということでもあります。

Version

1.30

See Also

categories: | Get Data from Creature Functions
constants: | APPEARANCE_TYPE_* Constants

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - GetArea

Home > Reference > Functions > Area, Get Data > GetArea

GetArea(object)

oTargetが現在いるエリアを返します。

object GetArea(
    object oTarget
);

Parameters

oTarget

ターゲットが現在いるエリア

Description

oTargetが現在いるエリアを返します。oTargetはPCやクリーチャー、配置オブジェクトなどを指定することができます。

エラーの場合は、OBJECT_INVALIDと返します。

Version

1.22

Example

void main()
{
   // オブジェクトoAreaを定義します。
   object oArea;

   // スクリプトを呼び出したものがいるエリアを得ます。
   oArea = GetArea(OBJECT_SELF);
}

See Also

functions: | GetAreaFromLocation
categories: | Area Functions | Get Data Functions

author: Brett Lathrope, editor: Tom Cassiotis, JP team: NamaYake, geshi


Function - GetAreaFromLocation

Home > Reference > Functions > Area, Get Data > GetAreaFromLocation

GetAreaFromLocation(location)

指定されたlocationの存在するエリアを返します。

object GetAreaFromLocation(
    location lLocation = None
);

Parameters

lLocation

locationです（デフォルトではNone)

Description

lLocationからエリアのオブジェクトIDを得ます。

パラメーターとしてlocationではなくobjectを指定するGetArea関数のほうが一般的にはよく使用されます。しかしGetAreaFromLocation関数はlocationを操作するときには役に立ちます。
例えば、新しいlocationがfacing（向き）を必要としている場合と、既存のlocationのposition(位置）が必要な場合です。

Remarks

locationが存在しない場合は関数はOBJECT_INVALIDを返します。

Version

1.22

Example

    // 関数を呼び出したobjectのlocationを得ます。
    location lMyLocation = GetLocation (OBJECT_SELF);

    // areaとposition、facingを得ます。
    object   oArea       = GetAreaFromLocation (lMyLocation);
    vector   vPosition   = GetPositionFromLocation (lMyLocation);
    float    fFacing     = GetFacingFromLocation (lMyLocation);

    // 反対方向を向いた新しいlocationを作ります。
    location lNewLocation = Location (oArea, vPosition, fFacing + 180.0);

See Also

functions: | GetArea | GetLocation
categories: | Area Functions | Get Data Functions

author: Steve Moseley, JP team: NamaYake


Function - GetAreaOfEffectCreator

Home > Reference > Functions > Effects, Get Data from Object > GetAreaOfEffectCreator

GetAreaOfEffectCreator(object)

エフェクトエリアオブジェクトの作成者を得ます。

object GetAreaOfEffectCreator(
    object oAreaOfEffectObject = OBJECT_SELF
);

Parameters

oAreaOfEffectObject

調べたいエフェクトエリア。(デフォルト: OBJECT_SELF)

Description

oAreaOfEffectObjectの作成者を返します。

oAreaOfEffectObjectが無効なエフェクトエリアオブジェクトの場合は、OBJECT_INVALIDを返します。

Remarks

エフェクトエリアは、しばしば多数のエフェクトが結び付けられた呪文として記述されます。

この関数は、エフェクトエリア呪文を定義しているスクリプト中で呼び出すのがベストです。

Version

1.22

See Also

functions: | GetEffectCreator
categories: | Effects Functions | Get Data from Object Functions

author: John Shuell, JP team: katsu794


Function - GetArtifactItem

Home > Reference > Functions > Module Specific > GetArtifactItem

GetArtifactItem()

公式キャンペーンにおけるクエストのためのプロット・アイテムのタグを返します。

string GetArtifactItem();

Description

変数"NW_J_ARTIFACT_ITEM"というプロット・グローバルオブジェクトからアーティファクトアイテムのタグを返します。

Remarks

nw_j_artifact.nssの114行目にあります。

この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

これらの関数全ては比較的ストレートな内容であり、一見して簡単に理解できます。

さらに全く同じ関数で、"ArtifactItems"の代わりに"ComplexItems"に働く、別のスクリプトもあります。

スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。

その他の関数を"See Also"セクションで見てください。

Requirements

#include "nw_j_artifact"

Version

1.22

See Also

functions: | GetComplexItem | GetFetchItem | GetStoryItem | Global | PlayerHasArtifactItem | SetArtifactItem | TakeArtifactItem
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetAssassinHead

Home > Reference > Functions > Miscellaneous > GetAssassinHead

GetAssassinHead()

公式キャンペーンペーンのプロットで使われているAssassins head objectのtagを得ます。

string GetAssassinHead();

Description

公式ストーリーのプロットで使われているAssassins head objectのtagを得ます。

Remarks

nw_j_assassin.nssの315行目でこの関数を見つけることが出来ます。

公式ゲームでのみ有効です。

Requirements

#include "nw_j_assassin"

Version

1.22

See Also

functions: | SetAssassinHead
categories: | Miscellaneous Functions

author: John Shuell, JP team: Rainie


Function - GetAssociate

Home > Reference > Functions > Get Data from Creature, Henchmen/Familiars/Summoned > GetAssociate

GetAssociate(int, object)

object GetAssociate(
    int nAssociateType,
    object oMaster = OBJECT_SELF
);

Parameters

nAssociateType

ASSOCIATE_TYPE_*

oMaster

仲間の情報を調べたいプレイヤーキャラクター。(デフォルト：OBJECT_SELF)

Description

指定したタイプのNPCの仲間がいる場合に、そのobject型を返します。

いない場合にはOBJECT_INVALIDを返します。

Version

1.22

See Also

functions: | AssociateCheck | GetAnimalCompanionCreatureType | GetAssociateCRMax | GetAssociateHealMaster | GetAssociateStartLocation | GetAssociateState | GetFamiliarCreatureType | GetHenchman | GetLastAssociateCommand | GetMaster | RemoveSummonedAssociate | SetAssociateState
categories: | Get Data from Creature Functions | Henchmen/Familiars/Summoned Functions
constants: | ASSOCIATE_TYPE_* Constants

author: Charles Feduke, JP team: marshall


Function - GetAssociateCRMax

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetAssociateCRMax

GetAssociateCRMax()

int GetAssociateCRMax();

Description

最も近くのクリーチャーのファクションに属する最も強いメンバーの様々な能力に基づいたシチュエーションで、ヘンチマンが使用する戦闘呪文を決定します。5から20の間の数値で返されます。

Version

1.22

See Also

functions: | GetAssociate | GetAssociateState
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, JP team: Rainie


Function - GetAssociateHealMaster

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetAssociateHealMaster

GetAssociateHealMaster()

int GetAssociateHealMaster();

Description

仲間のNPCが彼等の雇い主（主人）をヒールするかを決定します。仲間のNW_ASC_HEAL_AT_*設定をマスターの現在のHPが下回ればTRUEを返します。マスターのHPが指定した率を下回っていなければFALSEを返します。

Version

1.22

See Also

functions: | GetAssociate | GetAssociateState | SetAssociateState
categories: | Henchmen/Familiars/Summoned Functions
constants: | NW_ASC_HEAL_AT_* Constants

author: Charles Feduke, JP team: Rainie


Function - GetAssociateStartLocation

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetAssociateStartLocation

GetAssociateStartLocation()

NPCの仲間の開始locationを得ます。

location GetAssociateStartLocation();

Description

NPCの仲間の開始locationを返します。

Remarks

この関数はincludeファイルや公式キャンペーン用スクリプトのどこで使われているのか分かりません。これが行うことは、呼出Objectから得られる"NW_ASSOCIATE_START"というローカル変数をlocation変数として返します。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

Example

// プレイヤーキャラクターがヘンチマンを解雇した時用の
// ActionTakenスクリプトで使用する
void main(){
    ClearAllActions();
    ActionMoveToLocation(GetAssociateStartLocation());
}

See Also

functions: | GetAssociate | SetAssociateStartLocation
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: John Shuell, JP team: Rainie


Function - GetAssociateState

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetAssociateState

GetAssociateState(int)

int GetAssociateState(
    int nCondition
);

Parameters

nCondition

NW_ASC_*

Description

指定したNW_ASC_*、NW_ASC_DISTANCE_*、NW_ASC_HEAL_AT_* またはNW_ASC_AGGRESSIVE_*定数がNPCの仲間に対してセットされた場合、その設定に基づいてTRUEかFALSE（on/off）を返します。

Version

1.22

See Also

functions: | GetAssociate | GetAssociateCRMax | GetAssociateHealMaster | GetFollowDistance | GetHenchman | GetMaster | SetAssociateStartLocation | SetAssociateState
categories: | Henchmen/Familiars/Summoned Functions
constants: | NW_ASC_* Constants

author: Charles Feduke, editor: Tom Cassiotis, JP team: Rainie


Function - GetAttackCompatibility

Home > Reference > Functions > Prototyped but Unused > GetAttackCompatibility

GetAttackCompatibility(talent, int)

この関数は試作されたましたが、使用されていません。

int GetAttackCompatibility(
    talent tUse,
    int nClass
);

Parameters

tUse

nClass

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Version

1.22

See Also

functions: | GetAttackTarget | GetAttemptedAttackTarget
categories: | Prototyped but Unused Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: katsu794


Function - GetAttackTarget

Home > Reference > Functions > Combat Information, Targeting > GetAttackTarget

GetAttackTarget(object)

指定したクリーチャーの現在の攻撃対象である敵を得ます。

object GetAttackTarget(
    object oCreature = OBJECT_SELF
);

Parameters

oCreature

現在戦闘中のクリーチャー（デフォルト：OBJECT_SELF）

Description

そのラウンド中、攻撃をすることを試みている対象を返します。攻撃のActionが取り除かれた場合や、そのターゲットを失った（それが死んだり、見えなくなった時等）場合や、ラウンド終了の場合、クリアされる。

Version

1.26

See Also

functions: | ActionAttack | CheckFriendlyFireOnTarget | GetAttackCompatibility | GetAttemptedAttackTarget | GetIsFighting | GetIsInCombat
categories: | Combat Information Functions | Targeting Functions
events: | OnCombatRoundEnd Event | OnPhysicalAttacked Event

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Jon McCarty, Noel Borstad, JP team: Rainie


Function - GetAttemptedAttackTarget

Home > Reference > Functions > Combat Information, Targeting > GetAttemptedAttackTarget

GetAttemptedAttackTarget()

攻撃を試みたクリーチャーを得ます。

object GetAttemptedAttackTarget();

Description

呼出者が攻撃を試みた目標を得ます。－ これはGetAttackTarget()と共に使用されるべきです。この値は攻撃を行うごとに設定され、戦闘終了時にリセットされます。
呼出者が有効なクリーチャーでない場合は、OBJECT_INVALID を返します。

Remarks

誰かへ攻撃を試みることで設定され、攻撃のアクションが追加されるとこれは設定されるでしょう。objectがそのターゲットを失った場合、デフォルトのラウンド終了スクリプトでは攻撃のアクションは消去されます。

Version

1.26

See Also

functions: | ActionAttack | CheckFriendlyFireOnTarget | GetAttackCompatibility | GetAttackTarget | GetIsFighting | GetIsInCombat
categories: | Combat Information Functions | Targeting Functions
events: | OnPhysicalAttacked Event

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Jon McCarty, Noel Borstad, JP team: geshi, Rainie


Function - GetAttemptedSpellTarget

Home > Reference > Functions > Combat Information, Get Data from Creature, Spells, Targeting > GetAttemptedSpellTarget

GetAttemptedSpellTarget()

呪文を唱えようとした対象となるクリーチャーを判定します。

object GetAttemptedSpellTarget();

Description

呪文を唱えようとした対象をobject型で返します。

この値は呪文が唱えられるたびに設定され、戦闘が終わると解除されます。

有効なクリーチャーを指していない場合にはOBJECT_INVALIDを返します。

Version

1.22

See Also

functions: | ActionCastSpellAtObject
categories: | Combat Information Functions | Get Data from Creature Functions | Spells Functions | Targeting Functions

author: Jody Fletcher, JP team: marshall


Function - GetBackpackMatch

Home > Reference > Functions > Inventory, Item Creation, Module Specific > GetBackpackMatch

GetBackpackMatch(int, object)

新しいアイテムを作成するためにPCが適切なアイテムを運ぶかどうか決めます。

int GetBackpackMatch(
    int nPos,
    object oPC
);

Parameters

nPos

"NW_COMBO_REAGENT_1"文字列アレイ内の位置

oPC

調べるPCのインベントリ

Description

oPCがインベントリー内に必要な材料を持っていればTRUEを返し、適切なベースアイテムはレシピnPosによって作られるアイテムを作成するために合成されます。ベースタイプが鎧であれば、鎧のACが必要ACとベースタイプが適合しているかを見るために、ACを調べます。oPCがレシピに必要なアイテムを持っていない場合には、FALSEを返します。

Remarks

OBJECT_SELF（通常炉のような入れ物）のローカルアレイ文字列を、"NW_COMBO_REAGENT_1"のnPOSをタグのために調べます。このタグはその後、タグによって識別されたアイテムのためにoPCのインベントリーと照合されます。もしアイテムが見つかれば、その後ベースのアイテムを調べます。－ ベースアイテムは、インデックスがnPosによって付けられたローカルの整数アレイ「NW_COMBO_BASETYPE」に位置します。（また、もしベースアイテムが鎧であれば、特定のアーマークラスを備えた基礎アイテムは、インデックスがnPosによって付けられたローカルの整数アレイ「NW_COMBO_AC」の内に求められます。）

材料およびベースアイテムを越えるものを要求するアイテムは「NW_COMBO_REAGENT_1」文字列アレイ、「NW_COMBO_BASETYPE」整数アレイ、そして（適用可能なら）「NW_COMBO_AC」整数アレイに複数のエントリーを持つでしょう。nPosは必要な材料毎に「NW_COMBO_REAGENT_1」に異なる値になります。しかし「NW_COMBO_BASETYPE」と「NW_COMBO_AC」は通常同じ値をとります。（もしアイテムがいくつかの異なるベースタイプを要求しなければです。）

Requirements

#include "nw_o0_itemmaker"

Version

1.28

Example

//::///////////////////////////////////////////////
//:: Can any Axe or Armor comb be made
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
  話をしたプレーヤーキャラクターの持ち物を調べ、
  斧か鎧の材料を持っているか判定します。
*/
//:://////////////////////////////////////////////
//:: Created By: Drew
//:: Created On: November 26, 2001
//:://////////////////////////////////////////////

#include "NW_O0_ITEMMAKER"

int StartingConditional()
{
    int iResult;

iResult = GetBackpackMatch(1, GetPCSpeaker()) ||
GetBackpackMatch(2, GetPCSpeaker()) ||
GetBackpackMatch(3, GetPCSpeaker()) ||
GetBackpackMatch(4, GetPCSpeaker()) ||
GetBackpackMatch(7, GetPCSpeaker()) ||
GetBackpackMatch(8, GetPCSpeaker()) ||
GetBackpackMatch(11, GetPCSpeaker());

    return iResult;
}

See Also

functions: | GetForgeMatch | HasAnyItemOfBaseType
categories: | Inventory Functions | Item Creation Functions | Module Specific Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Jason Dube, JP team: geshi, Rainie


Function - GetBaseAttackBonus

Home > Reference > Functions > Get Data from Creature > GetBaseAttackBonus

GetBaseAttackBonus(object)

指定したクリーチャーの基本攻撃ボーナス(BAB)を取得します。

int GetBaseAttackBonus(
    object oCreature
);

Parameters

oCreature

基本攻撃ボーナスを調べるクリーチャー

Description

指定したクリーチャーの基本攻撃ボーナスを取得します。マルチクラスのクリーチャーの基本攻撃ボーナスは全てのクラスのBABを足した数値が最終結果になります。oCreatureが有効なクリーチャーではない場合は0を返します。

Remarks

この関数はPCにエンカウントさせる敵の強さを測る際や、PCに与える高攻撃ボーナスアイテムのバランスを取る方法として使うと良いでしょう。

Version

1.30

See Also

categories: Get Data from Creature Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - GetBaseItemType

Home > Reference > Functions > Get Data from Object > GetBaseItemType

GetBaseItemType(object)

指定されたアイテムの基本テンプレートを決定します。

int GetBaseItemType(
    object oItem
);

Parameters

oItem

分析するアイテム。

Description

oItemの基本アイテム型(BASE_ITEM_*)を得ます。

oItemが無効なアイテムの場合は、BASE_ITEM_INVALIDを返します。

Version

1.22

See Also

functions: | CreateItemOnObject | GetItemActivated | GetItemACValue | GetItemHasItemProperty | GetItemInSlot | GetLastWeaponUsed
categories: | Get Data from Object Functions
constants: | BASE_ITEM_* Constants
events: | OnAcquireItem Event | OnActivateItem Event | OnUnAcquireItem Event

author: Jody Fletcher, JP team: katsu794


Function - GetBeenHired

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetBeenHired

GetBeenHired(object)

ヘンチマンが既に雇われているかを調べます。

int GetBeenHired(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

調べるヘンチマン（デフォルト：OBJECT_SELF）

Description

ヘンチマンが既に雇われていればTRUEを返します（SetBeenHiredで設定されたローカル変数を調べることで得ます）。そうでない場合や、oTargetが有効ではない場合はFALSEを返します。

Fソースコードのコメントから：

ヘンチマンは一人だけ雇うことが出来ます、常に。

これは、ヘンチマンのローカルに彼等の以前雇われた遍歴も調べる、または設定できます。

Remarks

nw_i0_henchmanの109行目で見つかります。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

functions: | SetBeenHired
categories: | Henchmen/Familiars/Summoned Functions

author: Lilac Soul, JP team: Rainie


Function - GetBehaviorState

Home > Reference > Functions > Core AI > GetBehaviorState

GetBehaviorState(int)

Test whether a creature is in a particular behavior state.

int GetBehaviorState(
    int nCondition
);

Parameters

nCondition

Bitmask of possible behavior state.

Description

Creatures can be created with governing behavior states, as defined by the NW_FLAG_BEHAVIOR_* constants in nw_i0_generic:

//Behavior Constants
int NW_FLAG_BEHAVIOR_SPECIAL = 0x00000001;
int NW_FLAG_BEHAVIOR_CARNIVORE = 0x00000002; //Will always attack regardless of faction
int NW_FLAG_BEHAVIOR_OMNIVORE = 0x00000004; //Will only attack if approached
int NW_FLAG_BEHAVIOR_HERBIVORE = 0x00000008; //Will never attack. Will alway flee.

GetBehaviorState compares nCondition to the creature's behavior state mask, and returns true if they match.

Remarks

This function is described as internal to nw_i0_generic.

Requirements

#include "nw_i0_generic"

Version

1.22

Example

if(GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE)) {
     // Do some special grass-nibbling code.
}

See Also

functions: | DetermineSpecialBehavior | SetBehaviorState
categories: | Core AI Functions
constants: | NW_FLAG_BEHAVIOR_* Constants

author: Iskander Merriman, editor: John Shuell


Function - GetBehind

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetBehind

GetBehind()

呼出者に、その主人であるプレイヤーの後ろへと移動させます。

void GetBehind();

Description

この関数を呼び出したヘンチマンに彼等の主人の後ろへと移動させます。

Remarks

nw_i0_assoc.nssの194行目で見つかります。

言われているような動作を確認していません。BioWareはDoFollowMaster()機能の中でそれを一度だけ使用していますが、その後、コメントアウトされました。

Requirements

#include "nw_i0_assoc"

Version

1.22

See Also

functions: | DoFollowMaster
categories: | Henchmen/Familiars/Summoned Functions

author: John Shuell, JP team: Rainie


Function - GetBlockingDoor

Home > Reference > Functions > Movement > GetBlockingDoor

GetBlockingDoor()

クリーチャーを塞ぐドアを決定します。

object GetBlockingDoor();

Description

この関数の呼出者が遭遇した最後の塞がれたドアを返します。またこの関数は、呼出者が有効なクリーチャーでない場合、OBJECT_INVALIDを返します。

Version

1.22

Example

//::///////////////////////////////////////////////
//:: Default On Heartbeat
//:: NW_C2_DEFAULTE
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
  このスクリプトでは、クリーチャーは閉まっているドア
  を開けようとするか破壊しようとします。
  行動はINT値とSTR値によります。
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 23, 2001
//:://////////////////////////////////////////////

void main()
{
   object oDoor = GetBlockingDoor();

   if(GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5)
   {
      if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_OPEN) && GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 7 )
      {
         DoDoorAction(oDoor, DOOR_ACTION_OPEN);
      }
      else if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_BASH))
      {
         DoDoorAction(oDoor, DOOR_ACTION_BASH);
      }
   }
}

See Also

functions: | ActionCloseDoor
categories: | Movement Functions
events: | OnOpen Event

author: Tom Cassiotis, JP team: geshi, Rainie


Function - GetCalendarDay

Home > Reference > Functions > Get Data, Module, Time > GetCalendarDay

GetCalendarDay()

ゲーム内カレンダーの現在の日付を調べます。

int GetCalendarDay();

Description

現在のゲーム内日付を返します。

範囲は1日～28日です。

Version

1.22

See Also

functions: | GetCalendarMonth | GetCalendarYear | SetCalendar
categories: | Get Data Functions | Module Functions | Time Functions
events: | OnModuleLoad Event

author: Jody Fletcher, JP team: NamaYake, Rainie


Function - GetCalendarMonth

Home > Reference > Functions > Get Data, Module, Time > GetCalendarMonth

GetCalendarMonth()

ゲーム内カレンダーの現在の月を調べます。

int GetCalendarMonth();

Description

現在のカレンダーの月を得ます。

範囲は、1月～12月です。

Version

1.22

See Also

functions: | GetCalendarDay | GetCalendarYear | SetCalendar
categories: | Get Data Functions | Module Functions | Time Functions
events: | OnModuleLoad Event

author: Jody Fletcher, JP team: NamaYake, Rainie


Function - GetCalendarYear

Home > Reference > Functions > Get Data, Module, Time > GetCalendarYear

GetCalendarYear()

ゲーム内の現在の年を調べます。

int GetCalendarYear();

Description

現在のゲーム内年を返します。

範囲は1300年～1400年です。

Remarks

範囲は性格ではないかもしれません。

テストでは0から30000まで使うことが出来ました。

Version

1.22

See Also

functions: | GetCalendarDay | GetCalendarMonth | SetCalendar
categories: | Get Data Functions | Module Functions | Time Functions
events: | OnModuleLoad Event

author: Jody Fletcher, JP team: NamaYake, Rainie


Function - GetCampaignFloat

Home > Reference > Functions > Database > GetCampaignFloat

GetCampaignFloat(string, string, object)

キャンペーンデータベースから整数値を取り出します。

float GetCampaignFloat(
    string sCampaignName,
    string sVarName,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

変数を保管しているキャンペーン名。(大文字/小文字は区別されます)

sVarName

特有の変数名。

oPlayer

変数を伴っているプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースから整数値を返します。

キャンペーン名は大文字/小文字を区別します。変数が見つからない場合は、0を返します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | SetCampaignFloat
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - GetCampaignInt

Home > Reference > Functions > Database > GetCampaignInt

GetCampaignInt(string, string, object)

キャンペーンデータベースから整数値を取り出します。

int GetCampaignInt(
    string sCampaignName,
    string sVarName,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

変数を保管しているキャンペーン名。(大文字/小文字は区別されます)

sVarName

特有の変数名。

oPlayer

変数を伴っているプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースから整数値を返します。

キャンペーン名は大文字/小文字を区別します。変数が見つからない場合は、0を返します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | SetCampaignInt
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - GetCampaignLocation

Home > Reference > Functions > Database > GetCampaignLocation

GetCampaignLocation(string, string, object)

キャンペーンデータベースからロケーション値を取り出します。

location GetCampaignLocation(
    string sCampaignName,
    string sVarName,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

変数を保管しているキャンペーン名。(大文字/小文字は区別されます)

sVarName

特有の変数名。

oPlayer

変数を伴っているプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースからロケーション値を返します。

キャンペーン名は大文字/小文字を区別します。エラー時には、無効なロケーションを返します。これは、GetAreaFromLocation関数がOBJECT_INVALIDを返すということを意味します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | SetCampaignLocation
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - GetCampaignString

Home > Reference > Functions > Database > GetCampaignString

GetCampaignString(string, string, object)

キャンペーンデータベースから文字列値を取り出します。

string GetCampaignString(
    string sCampaignName,
    string sVarName,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

変数を保管しているキャンペーン名。(大文字/小文字は区別されます)

sVarName

特有の変数名。

oPlayer

変数を伴っているプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースから浮動小数値を返します。

キャンペーン名は大文字/小文字を区別します。変数が見つからない場合は、空文字列""を返します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | SetCampaignString
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - GetCampaignVector

Home > Reference > Functions > Database > GetCampaignVector

GetCampaignVector(string, string, object)

キャンペーンデータベースからベクター値を取り出します。

vector GetCampaignVector(
    string sCampaignName,
    string sVarName,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

変数を保管しているキャンペーン名。(大文字/小文字は区別されます)

sVarName

特有の変数名。

oPlayer

変数を伴っているプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースからベクター値を返します。

キャンペーン名は大文字/小文字を区別します。変数が見つからない場合は、0-vector (0.0, 0.0, 0.0)を返します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | SetCampaignVector
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - GetCanCastHealingSpells

Home > Reference > Functions > Talents/Skills/Feats > GetCanCastHealingSpells

GetCanCastHealingSpells(object)

対象が回復呪文を詠唱できるかそうでないかに基づいてTRUEかFALSEを得ます。

int GetCanCastHealingSpells(
    object oTarget
);

Parameters

oTarget

調べたいobject

Description

GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH, 20, oTarget)が有効な能力を返した場合、TRUEを返します。

Remarks

nw_i0_plot.nssの130行目で見つかります。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: | Talents/Skills/Feats Functions
constants: | TALENT_CATEGORY_* Constants

author: John Shuell, JP team: Rainie


Function - GetCanLevelUp

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetCanLevelUp

GetCanLevelUp(object, action)

ヘンチマンNPCがレベルアップするべきかを調べます。

int GetCanLevelUp(
    object oPC,
    action oHenchman = OBJECT_SELF
);

Parameters

oPC

調べる時に比べるPC

oHenchman

レベルをあげるNPC（デフォルト：OBJECT_SELF）

Description

oPCのレベルに比べてNPCもレベルアップするべきならばTRUEを返します。oPCのレベルがoHenchmanのレベルより2以上高ければ、TRUEを、そうでなければFALSEを返します。ヘンチマンの主人とoPCを関連させる必要がないことに注意してください。

Requirements

#include "nw_i0_henchman"

Version

1.29

See Also

categories: Henchmen/Familiars/Summoned Functions

author: Charles Feduke, JP team: Rainie


Function - GetCanSeePC

Home > Reference > Functions > Perception > GetCanSeePC

GetCanSeePC(object)

クリーチャーがPCを目視できるかどうかを決定します。

int GetCanSeePC(
    object oObject = OBJECT_SELF
);

Parameters

oObject

PCを「目視」できるかどうかを調べるObject（デフォルト：OBJECT_SELF）

Description

oObjectがPCを「目視」出来るならばTRUEを、できなければFALSEを返します。

Requirements

#include "nw_i0_2q4luskan"

Version

1.29

See Also

functions: | GetLastPerceptionSeen
categories: | Perception Functions
events: | OnPerception Event

author: Charles Feduke, JP team: Rainie


Function - GetCasterLevel

Home > Reference > Functions > Get Data from Creature > GetCasterLevel

GetCasterLevel(object)

プレイヤーキャラクターまたはクリーチャーの呪文修得レベルを返します。

int GetCasterLevel(
    object oCreature
);

Parameters

oCreature

呪文修得レベルを調べたいPCまたはクリーチャー。

Description

指定したクリーチャーの呪文修得レベルを取得します。

０を返した場合はエラーです。

Remarks

この関数はPCまたはクリーチャーに対してのみ使われます。

Version

1.22

Example

// Example 1 - Gets the casting level of the object that last cast
// a spell, if that object is a PC or Creature.  For fun, the object
// then says its caster level.

void main(){

  // Get the object that last cast a spell.
  object oCreature = GetLastSpellCaster();
  // Get out if it is not a creature (PC or mob)
  if (GetObjectType(oCreature) != OBJECT_TYPE_CREATURE) return;
  // Get the casting level of the creature.
  int nCLevel = GetCasterLevel(oCreature);
  // Just for fun...
  string sLevel = IntToString(nCLevel);
  AssignCommand(oCreature,SpeakString("I'm a level " + sLevel + " caster!",TALKVOLUME_TALK));
}

See Also

functions: | GetCharacterLevel | GetLastSpellCaster
categories: | Get Data from Creature Functions

author: Brett Lathrope, JP team: marshall


Function - GetChallengeRating

Home > Reference > Functions > Get Data from Creature > GetChallengeRating

GetChallengeRating(object)

対象となるクリーチャーの脅威度(CR)を返します。

float GetChallengeRating(
    object oCreature
);

Parameters

oCreature

脅威度を調べたいクリーチャー。

Description

対象となるクリーチャーの脅威度(どのくらい倒し難いか)を返します。

無効なクリーチャーの場合には0.0を返します。

Remarks

脅威度は独立した値です。

言い換えると何かと比較をしているわけではありませんが、かなり正直な値です。

Version

1.22

Example

// Example 1 - Get the challenge rating of the creature that last
// attacked me (whatever creature this script is called by) and
// check it against my challenge rating to see if I should be
// worried or not.

void main(){

  // Make sure script isn't misplace...will only work on creatures.
  if (GetObjectType(OBJECT_SELF) != OBJECT_TYPE_CREATURE) return;
  // Get the creature that last attacked me.
  object oCreature = GetLastAttacker(OBJECT_SELF);
  // Get out if it is not a creature (PC or mob)
  if (GetObjectType(oCreature) != OBJECT_TYPE_CREATURE) return;
  // Get the challenge rating of the creature.
  float fChallenge = GetChallengeRating(oCreature);
  // Get my challenge rating.
  float fMe = GetChallengeRating(OBJECT_SELF);
  // Just for fun...
  if (fMe <= fChallenge)
  {
    SpeakString("Ok, I'm scared!",TALKVOLUME_TALK);
  }
  else
  {
    SpeakString("I'm gonna whoop 'em good!",TALKVOLUME_TALK);
  }
}

See Also

categories: Get Data from Creature Functions

author: Brett Lathrope, JP team: marshall


Function - GetChapter

Home > Reference > Functions > Module Specific > GetChapter

GetChapter()

現在プレイヤーがいる章の番号を返します。

int GetChapter();

Description

現在進行している章番号の整数値を返します。

章の名前はGetName(GetModule())関数の呼び出しによって返さます。そして、連続したifステートメント文の中でモジュール番号が見つかります。

Remarks

この関数はnw_i0_henchman.nssの538行目にあります。

Requirements

#include "nw_i0_henchman"

Version

1.22

See Also

categories: Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetCharacterLevel

Home > Reference > Functions > Combat Information, Get Data from Creature > GetCharacterLevel

GetCharacterLevel(object)

クリーチャーが持っている3つのクラスの合計レベルを返します。

int GetCharacterLevel(
    object oTarget
);

Parameters

oTarget

合計レベルを調べたいクリーチャー。

Description

最大３つまでのクラスレベルの合計を足しこんで１つの値として返します。

GetHitDice関数が使えるようになる前に使用されていました。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

Example

// Example 1 - Gets the total levels of the creature that attacked
// the calling object (must be a PC or Creature) and then gets
// the total levels of the object being attacked.  The two values
// are compared, and a string is spoken based on the result.

#include "NW_I0_GENERIC"

void main(){

  // Make sure script isn't misplace...will only work on creatures.
  if (GetObjectType(OBJECT_SELF) != OBJECT_TYPE_CREATURE) return;
  // Get the creature that last attacked me.
  object oCreature = GetLastAttacker(OBJECT_SELF);
  // Get out if it is not a creature (PC or mob)
  if (GetObjectType(oCreature) != OBJECT_TYPE_CREATURE) return;
  // Get the challenge rating of the creature.
  int nHisLevels = GetCharacterLevel(oCreature);
  // Get my challenge rating.
  int nMyLevels = GetCharacterLevel(OBJECT_SELF);
  // Just for fun...
  if (nMyLevels <= nHisLevels)
  {
    SpeakString("Ok, I'm scared!",TALKVOLUME_TALK);
  }
  else
  {
    SpeakString("I'm gonna whoop 'em good!",TALKVOLUME_TALK);
  }
}

See Also

functions: | GetCasterLevel | GetLevelByClass | GetLevelByPosition
categories: | Combat Information Functions | Get Data from Creature Functions

author: Brett Lathrope, editor: John Shuell, JP team: marshall


Function - GetCharisma

Home > Reference > Functions > Get Data from Creature > GetCharisma

GetCharisma(object)

魅力の能力値を取得します。

int GetCharisma(
    object oTarget
);

Parameters

oTarget

魅力の能力値を調べたいクリーチャー。

Description

指定したクリーチャーの魅力の能力値を返します。

Remarks

この関数はnw_i0_plot.nssの758行目にあります。

非常に簡潔な関数です。

おそらくスクリプト記述者がGetAbilityScore()をいちいち打ち込まなくてもいいように作られたのでしょう。

ただ単にGetAbilityScore( oTarget, ABILITY_CHARISMA )と同じことです。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | GetAbilityScore | GetIntelligence | GetWisdom
categories: | Get Data from Creature Functions

author: John Shuell, JP team: marshall


Function - GetClassByPosition

Home > Reference > Functions > Get Data from Creature > GetClassByPosition

GetClassByPosition(int, object)

クリーチャーの指定した順番のクラスを返します。

順番とはマルチクラスキャラクターの1番目、2番目、または3番目のクラスのことを指します。

int GetClassByPosition(
    int nClassPosition,
    object oCreature = OBJECT_SELF
);

Parameters

nClassPosition

1,2,3のどれか

oCreature

クラスを調べたいクリーチャー。(デフォルト：OBJECT_SELF)

Description

nClassPositionで指定した順番のクラスをCLASS_TYPE_*定数で返します。

クリーチャーは３つまでのクラスを持つことが出来ます。

指定した順番のクラスがなかった場合(例えばシングルクラスの場合はnClassPositionの値は1のみです)、

または無効なクリーチャーを指定した場合はCLASS_TYPE_INVALIDを返します。

Version

1.28

See Also

functions: | GetLevelByPosition
categories: | Get Data from Creature Functions
constants: | CLASS_TYPE_* Constants

author: John Shuell, editor: Charles Feduke, additional contributor(s): John Harris, Lilac Soul, JP team: marshall


Function - GetClickingObject

Home > Reference > Functions > Get Data > GetClickingObject

GetClickingObject()

OnClickに指定して、クリックしたオブジェクトを返します。

object GetClickingObject();

Description

トリガーのOnClickに指定して、最後にクリックしたオブジェクトを得ることが出来ます。

これはＧｅｔＥｎｔｅｒｉｎｇＯｂｊｅｃｔと同じものです。

Version

1.22

Example

// PCが施錠されたドアを開けようと試みたときに、ドアのOnFailToOpenイベントで
// 鍵を持っていないと開かないということを伝えます。
void main()
{
    object oPC = GetClickingObject();

    if (GetIsObjectValid(oPC))
        AssignCommand(oPC, SpeakString("私は鍵を見つける必要があるようだ・・・"));
    else
        SpeakString("指定されたPCは有効でない");
}

See Also

functions: | GetEnteringObject
categories: | Get Data Functions
events: | OnClick Event

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Fred Brent, JP team: geshi, NamaYake


Function - GetCommandable

Home > Reference > Functions > Get Data from Creature > GetCommandable

GetCommandable(object)

指定したobjectのアクションキューにアクションを追加できるかどうかを調べます。

int GetCommandable(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

調べるobject（デフォルト：OBJECT_SELF）

Description

oTagetのアクションが修正可能であればTRUEを返します。

Remarks

GetCommandableはobjectのアクションキューへ命令可能かどうかを調べるために使われます。言い換えれば、objectのアクションキューに対してAssignCommandのような命令で追加・修正できるかどうかを調べます。それらはSetCommandable(FALSE,oTarget)関数を使うことで命令不能状態にする事が出来ます。これは短時間の間PCに行動して欲しくない時や、NPCに何か重要な事をさせる時に非常に有用な関数です。しかし、プログラミングされている呼出すアクション（戦闘時の移動のような物）は失敗するでしょう。

Version

1.26

See Also

functions: | SetCommandable
categories: | Get Data from Creature Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Jason Hyde, JP team: Rainie


Function - GetComplexItem

Home > Reference > Functions > Module Specific > GetComplexItem

GetComplexItem()

公式キャンペーンにおけるクエストのためのプロット・アイテムのタグを返します。

string GetComplexItem();

Description

変数"NW_J_COMPLEX_ITEM"というプロット・グローバルオブジェクトからアーティファクトアイテムのタグを返します。

Remarks

nw_j_complex.nssの114行目にあります。

この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

これらの関数全ては比較的ストレートな内容であり、一見して簡単に理解できます。

さらに全く同じ関数で、"ComplexItems"の代わりに"ArtifactItems"に働く、別のスクリプトもあります。

スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。

その他の関数を"See Also"セクションで見てください。

Requirements

#include "nw_j_complex"

Version

1.22

See Also

functions: | GetArtifactItem | GetFetchItem | GetStoryItem | Global | PlayerHasComplexItem | SetComplexItem | TakeComplexItem
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetCreatureHasTalent

Home > Reference > Functions > Core AI Talent, Get Data from Creature > GetCreatureHasTalent

GetCreatureHasTalent(talent, object)

クリーチャーが特定の特殊能力を持っているかどうかを決定します。

int GetCreatureHasTalent(
    talent tTalent,
    object oCreature = OBJECT_SELF
);

Parameters

tTalent

与えられたクリーチャー上で調べられる特殊能力。

oCreature

特殊能力を持っているかどうかを調べるクリーチャー。(デフォルト: OBJECT_SELF)

Description

oCreatureがtTalentを持っていればTRUE、そうでなければFALSEを返します。

Version

1.22

See Also

functions: | GetCreatureTalentBest | GetCreatureTalentRandom | GetIsTalentValid
categories: | Core AI Talent Functions | Get Data from Creature Functions

author: Tom Cassiotis


Function - GetCreatureSize

Home > Reference > Functions > Get Data from Creature > GetCreatureSize

GetCreatureSize(object)

クリーチャーのサイズを決定します。

int GetCreatureSize(
    object oCreature
);

Parameters

oCreature

サイズを調べたいクリーチャー

Description

oCreatureのサイズ89（CREATURE_SIZE_*）を返します。

Version

1.22

See Also

categories: | Get Data from Creature Functions
constants: | CREATURE_SIZE_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetCreatureTalentBest

Home > Reference > Functions > Core AI, Core AI Talent, Get Data from Creature > GetCreatureTalentBest

GetCreatureTalentBest(int, int, object)

クリーチャーの特殊能力のグループの中から最も優れた特殊能力を決定します。

talent GetCreatureTalentBest(
    int nCategory,
    int nCRMax,
    object oCreature = OBJECT_SELF
);

Parameters

nCategory

TALENT_CATEGORY_*

nCRMax

特殊能力のCRの最大値。

oCreature

特殊能力を持っているクリーチャー。(デフォルト: OBJECT_SELF)

Description

nCategoryの中からoCreatureの持っている最も優れた特殊能力(例：nCRMaxの値を超えない最も近い値)を返します。

Version

1.22

See Also

functions: | GetCreatureHasTalent | GetCreatureTalentRandom | GetIsTalentValid
categories: | Core AI Functions | Core AI Talent Functions | Get Data from Creature Functions
constants: | TALENT_CATEGORY_* Constants

author: Tom Cassiotis, JP team: katsu794


Function - GetCreatureTalentRandom

Home > Reference > Functions > Core AI Talent, Get Data from Creature, Talents/Skills/Feats > GetCreatureTalentRandom

GetCreatureTalentRandom(int, object)

クリーチャーが所有するタレントのグループからランダムなタレントを帰します。

talent GetCreatureTalentRandom(
    int nCategory,
    object oCreature = OBJECT_SELF
);

Parameters

nCategory

TALENT_CATEGORY_*

oCreature

指定したタレントのカテゴリーの中のタレントを潜在的に所有するクリーチャー

Description

nCategory内にあるoCreatureのタレントをランダムで帰します。

Remarks

nCreatureが指定したnCategory内のタレントを１つも所有していなくても可能です。この場合だと、この関数はOBJECT_INVALIDと同じように無効なタレントを帰しますが、このテストの為にGetIsTalentValid()を使用するべきです。

Version

1.22

See Also

functions: | GetCreatureHasTalent | GetCreatureTalentBest | GetIsTalentValid
categories: | Core AI Talent Functions | Get Data from Creature Functions | Talents/Skills/Feats Functions
constants: | TALENT_CATEGORY_* Constants

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Jim Allen, JP team: Rainie


Function - GetCurrentAction

Home > Reference > Functions > Action on Object, Get Data > GetCurrentAction

GetCurrentAction(object)

現在実行しているアクションを返します。

int GetCurrentAction(
    object oObject = OBJECT_SELF
);

Parameters

oObject

アクションを返すオブジェクト(デフォルト: OBJECT_SELF)

Description

oObjectがアクションキューを実行しているときに、現在行っているアクション(ACTION_*)を得ます。

Version

1.22

See Also

categories: | Action on Object Functions | Get Data Functions
constants: | ACTION_* Constants

author: Ryan Hunt, JP team: NamaYake, geshi


Function - GetCurrentHitPoints

Home > Reference > Functions > Get Data from Creature, Get Data from Object > GetCurrentHitPoints

GetCurrentHitPoints(object)

ある者が現在持っているヒットポイントの値を決定します。

int GetCurrentHitPoints(
    object oObject = OBJECT_SELF
);

Parameters

oObject

ヒットポイント値を取り出すオブジェクト。(デフォルト: OBJECT_SELF)

Description

oObjectが持っているヒットポイントの値を返します。また、oObjectが無効なオブジェクトの場合は、0を返します。

Version

1.22

See Also

functions: | GetMaxHitPoints | GetPercentageHPLoss
categories: | Get Data from Creature Functions | Get Data from Object Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetDamageDealtByType

Home > Reference > Functions > Combat Information, Get Data from Creature > GetDamageDealtByType

GetDamageDealtByType(int)

Objectに指定したタイプで与えたダメージ量を返します。

int GetDamageDealtByType(
    int nDamageType
);

Parameters

nDamageType

DAMAGE_TYPE_*

Description

呼出者に与えられたnDamageTypeのタイプのダメージ量を返します。OnDamegedイベントから呼び出された時、この関数はイベントの間引き起こされたダメージだけを返します。この関数はクリーチャーにのみ動作し、配置物オブジェクトから呼出された場合、常に0を返します。

nDamageTypeは、定数グループDAMAGE_TYPE_*からOR化した値を割り当てることができます。

例えば、GetDamageDealtByType(DAMAGE_TYPE_PIERCING | DAMAGE_TYPE_SLASHING)は、刺突と斬撃によって与えられたダメージを返します。

Known Bugs

DAMAGE_TYPE_SLASHING、DAMAGE_TYPE_PIERCING、DAMAGE_TYPE_BLUDGEONING、DAMAGE_TYPE_SONICまたはDAMAGE_TYPE_FIREを使うことは、物理攻撃によって与えられたダメージを返しません（代わりに-1を返します）。それは、それらがEffectDamage()関数と共に使用されるときに限り、前述のタイプによって与えられたダメージを返すでしょう。

Version

1.29

See Also

categories: | Combat Information Functions | Get Data from Creature Functions
constants: | DAMAGE_TYPE_* Constants

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Peter Westergaard, Jassper, Undivine, NetRacer56, Ryan Workman, JP team: Rainie


Function - GetDefensiveCastingMode

Home > Reference > Functions > Combat Information, Get Data from Creature, Spell Casting Effects, Spells > GetDefensiveCastingMode

GetDefensiveCastingMode(object)

クリーチャーのDefencive Casting Mode状態であるかを得ます。

int GetDefensiveCastingMode(
    object oCreature
);

Parameters

oCreature

DEFENSIVE_CASTING_MODE_*状態を得るクリーチャー

Description

クリーチャーが現在どのように呪文を詠唱しようとしてるかを反映する為に、DEFENSIVE_CASTING_MODE_*値を返します。DEFENSIVE_CASTING_MODE_DISABLEDの時、クリーチャーが呪文を詠唱する際、他のクリーチャーの攻撃範囲内では、機会攻撃を受けるでしょう。

Remarks

2つの値のみが存在します：

DEFENSIVE_CASTING_MODE_ACTIVATED
and
DEFENSIVE_CASTING_MODE_DISABLED

Defencive Casting ModeとはSoUで追加された行動で、敵の攻撃範囲内で、機会攻撃を引き起こすことなく呪文を詠唱することを可能にします。しかし、詠唱するためには、DC15を目標とした〈精神集中〉スキルに成功する必要があります。

Version

1.30

See Also

categories: | Combat Information Functions | Get Data from Creature Functions | Spell Casting Effects Functions | Spells Functions
constants: | DEFENSIVE_CASTING_MODE_* Constants

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - GetDeity

Home > Reference > Functions > Get Data from Creature > GetDeity

GetDeity(object)

クリーチャーの守護神（信仰神）を得ます。

string GetDeity(
    object oCreature
);

Parameters

oCreature

守護神を得たいクリーチャー

Description

oCreatureの守護神の名前を返します。oCreatureが無効もしくは守護神欄が空白であれば、空白の文字列（""）を返します。

Version

1.22

See Also

functions: | SetDeity
categories: | Get Data from Creature Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: Rainie


Function - GetDetectMode

Home > Reference > Functions > Get Data from Creature > GetDetectMode

GetDetectMode(object)

クリーチャーの現在の捜索状態を得ます。

int GetDetectMode(
    object oCreature
);

Parameters

oCreature

捜索しているかどうかを調べるクリーチャー

Description

oCreatureが捜索モードであればDETECT_MODE_ACTIVEを、そうでなければDETECT_MODE_PASSIVEを返します。

Known Bugs

時々、DETECT_MODE_PASSIVEを示す0の代わりに2が返される事があります。下記のサンプルプログラムを見てください。

Version

1.29

Example

// トリガーを踏んだ時に隠されたアイテムを発見できるかどうかを調べる
int nDC = 20;       // 捜索の難易度、"20"は例に過ぎない
object oPC = GetEnteringObject();
if ( GetIsPC(oPC) ) {
    int nSearch = GetSkillRank( SKILL_SEARCH, oPC );
    // 捜索モードではない場合、〈捜索〉値の半分を使用する
    if ( GetDetectMode(oPC) == DETECT_MODE_PASSIVE ) {
        nSearch = nSearch / 2;
    }
    // 標準のD&Dスタイルのスキルチェックを使用する
    if ( d20() + nSearch >= nDC ) {
        // 捜索に成功した場合のプログラムをここに置く
    }
}

// GetDetectModeとDETECT_MODE_PASSIVEのバグ修正
// 製作者 by: Slow Slosh
int GetDetectModeBugFix(object oCreature)
{
    int iMode = GetDetectMode(oCreature);
    if(iMode == 2) {iMode = DETECT_MODE_PASSIVE;}
    return iMode;
}

See Also

categories: | Get Data from Creature Functions
constants: | DETECT_MODE_* Constants

author: Drake Coker, editor: Charles Feduke, additional contributor(s): Slow Slosh, JP team: Rainie


Function - GetDialogSoundLength

Home > Reference > Functions > Conversation, Cut-Scene, Sound Effects > GetDialogSoundLength

GetDialogSoundLength(int)

Wave（音声）の長さを、秒で取得ます。

float GetDialogSoundLength(
    int nStrRef
);

Parameters

nStrRef

会話オーディオの参照する文字列番号（StrRef）

Description

音声wave（*.wav）ファイルの長さを、秒で取得します。会話で使う音声にのみ動作します。

Version

1.30

See Also

categories: Conversation Functions | Cut-Scene Functions | Sound Effects Functions

author: Charles Feduke, JP team: Rainie


Function - GetDidDie

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetDidDie

GetDidDie()

プレイヤーが死亡していればTRUEを返します。

int GetDidDie();

Description

プレイヤーが死亡していればTRUEを返し、変数を変更しますので、もう一度呼ばれればFALSEを返します。

Remarks

nw_i0_henchman.nssの79行目で見つかります。

Requirements

#include "nw_i0_henchman"

Version

1.22

See Also

functions: | SetDidDie
categories: | Henchmen/Familiars/Summoned Functions

author: John Shuell, JP team: Rainie


Function - GetDistanceBetween

Home > Reference > Functions > Combat Information, Core AI, Math, Targeting > GetDistanceBetween

GetDistanceBetween(object, object)

２つのオブジェクトの間の距離を測る。

float GetDistanceBetween(
    object oObjectA,
    object oObjectB
);

Parameters

oObjectA

距離を測りたいオブジェクトのひとつ

oObjectB

距離を測りたいオブジェクトのひとつ

Description

２つのオブジェクトの間の距離をメートルで返す。

無効なオブジェクトの計測は、0.0fを返す。

別エリアにオブジェクトがある場合は、エリアを重ね合わせたものとして計測する。

Remarks

他のDistance系関数と違い、エラーは0.0fを返すので注意が必要。

もし片方のオブジェクトが別のエリアにある場合は、それぞれのエリアを左下を基準として重ね合わせたと見なして距離を計測する。例えば形状の違うマップ、エリアＡ、エリアＢの左下の隅から北東に１ｍ離れた場所にそれぞれオブジェクトを配置して計測すると、距離は0.0fになる（エラーではなく距離0.0fメートル）。

Version

1.22

See Also

functions: | GetDistanceBetweenLocations | GetDistanceToObject
categories: | Combat Information Functions | Core AI Functions | Math Functions | Targeting Functions

author: John Shuell, editor: Ryan Hunt, JP team: ngtaicho


Function - GetDistanceBetweenLocations

Home > Reference > Functions > Core AI, Math, Movement, Targeting > GetDistanceBetweenLocations

GetDistanceBetweenLocations(location, location)

ゲーム内の2つの位置（ロケーション）の距離を測ります。

float GetDistanceBetweenLocations(
    location lLocationA,
    location lLocationB
);

Parameters

lLocationA

距離を測りたいlocationの変数

lLocationB

距離を測りたいlocationの変数

Description

２つの位置間の距離をメートルで返します。無効なLocationの計測、別のエリア間のLocationの計測は、-1.0fを返します。

Version

1.26

See Also

functions: | GetDistanceBetween | GetDistanceToObject
categories: | Core AI Functions | Math Functions | Movement Functions | Targeting Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Marcus Lunzenauer, JP team: ngtaicho, Rainie


Function - GetDistanceToObject

Home > Reference > Functions > Combat Information, Core AI, Math, Movement, Targeting > GetDistanceToObject

GetDistanceToObject(object)

スクリプトの呼出者とobjectの間の距離（メーター）です

float GetDistanceToObject(
    object oObject
);

Parameters

oObject

ここまでの距離を測定したい有効なobject

Description

スクリプトの呼出者（スクリプトを実行したオブジェクト）とoObjectで指定されたオブジェクトまでの距離をメーターで返します。

無効なオブジェクトの計測、別のエリア間のオブジェクトの計測は、-1.0fを返します。

Remarks

ゲーム中のobjectがこのスクリプトを呼び出しても、測定された値が得られるでしょう。

Version

1.22

See Also

functions: | GetDistanceBetween | GetDistanceBetweenLocations
categories: | Combat Information Functions | Core AI Functions | Math Functions | Movement Functions | Targeting Functions

author: John Shuell, JP team: ngtaicho, Rainie


Function - GetDroppableFlag

Home > Reference > Functions > Inventory > GetDroppableFlag

GetDroppableFlag(object)

死亡時に落とすアイテムかどうかをチェックします。

int GetDroppableFlag(
    object oItem
);

Parameters

oItem

落とすかどうかをチェックするアイテム。

Description

死亡時に落とすアイテムである場合はTRUEを返します。そうでない場合はFALSEを返します。

Version

1.27

See Also

functions: | SetDroppableFlag
categories: | Inventory Functions

author: Charles Feduke, JP team: NamaYake


Function - GetEffectCreator

Home > Reference > Functions > Effects > GetEffectCreator

GetEffectCreator(effect)

Gets the object that created eEffect.

object GetEffectCreator(
    effect eEffect
);

Parameters

eEffect

An existing effect already applied in game.

Description

Returns the object that created eEffect.
Returns OBJECT_INVALID if eEffect is not a valid effect.

Remarks

You must first create and place the effect you wish to examine into a variable before calling this function. This is useful when you want to specify only effects that were applied by specific creatures or objects. An example may be a trap that causes a strength decrease each round if the player is in its area of effect. If the player leaves that area of effect, the trap will loop through the effects on the player looking for only the effects it created, and remove them.

Version

1.22

See Also

functions: | GetAreaOfEffectCreator | GetEffectDurationType | GetEffectSpellId | GetEffectSubType | GetEffectType
categories: | Effects Functions

author: John Shuell, editor: Ryan Hunt


Function - GetEffectDurationType

Home > Reference > Functions > Effects > GetEffectDurationType

GetEffectDurationType(effect)

Gets the constant that defines the type of effect in eEffect.

int GetEffectDurationType(
    effect eEffect
);

Parameters

eEffect

The effect you wish to compare or examine.

Description

Returns the duration type (DURATION_TYPE_*, either instant, permanent or temporary) of eEffect.
If eEffect is not valid, it will return -1.

Remarks

You must first create and place the effect you wish to examine into a variable before calling this function. Used mostly to remove effects of a certain duration type while looping through effects on an object. Not often used but may come in handy if you need to remove all temporary effects without touching the permanent effects, such as when a player walks into a null magic zone.

Version

1.22

Example

effect eEffect = GetFirstEffect(oTarget);
while (GetIsValidEffect(eEffect))
{
     if (GetEffectDurationType(eEffect) == DURATION_TYPE_TEMPORARY)
     {
          RemoveEffect(oTarget, eEffect);
     }
     eEffect = GetNextEffect(oTarget);
}

See Also

functions: | GetEffectCreator | GetEffectSpellId | GetEffectSubType | GetEffectType | RemoveEffect
categories: | Effects Functions
constants: | DURATION_TYPE_* Constants

author: John Shuell, editor: Kristian Markon


Function - GetEffectSpellId

Home > Reference > Functions > Effects > GetEffectSpellId

GetEffectSpellId(effect)

This will return the constant of the spell that applied the effect (SPELL_*).

int GetEffectSpellId(
    effect eSpellEffect
);

Parameters

eSpellEffect

The effect that you wish to examine.

Description

Returns the constant defining the Spell used to apply this effect on the creature.
Will Return -1 if eSpellEffect was not applied by a spell script.

Remarks

You must first create and place the effect you wish to examine into a variable before calling this function. Very useful if you are looking for all the effects of a particular spell or leaving out effects of certain spells. One example could be when you wish to dispell all effects on a creature except those granted by a wish spell.

Version

1.22

See Also

functions: | GetEffectCreator | GetEffectDurationType | GetEffectSubType | GetEffectType | RemoveEffect
categories: | Effects Functions

author: John Shuell


Function - GetEffectSubType

Home > Reference > Functions > Effects > GetEffectSubType

GetEffectSubType(effect)

Get the subtype (SUBTYPE_*) of the effect.

int GetEffectSubType(
    effect eEffect
);

Parameters

eEffect

The effect you wish to compare or examine.

Description

Returns one of three subtype constants (SUBTYPE_*). An effect applied to an object will default to being of the Magical variety, but by using the other apply effect commands you can place supernatural or extrordinary effects on an object.
Return a 0 on error.

Remarks

You must first create and place the effect you wish to examine into a variable before calling this function. The longest effect type currently is the extraordinary effect, which will resist dispel magic effects and resting.

Version

1.22

See Also

functions: | GetEffectCreator | GetEffectDurationType | GetEffectSpellId | GetEffectType | RemoveEffect
categories: | Effects Functions
constants: | SUBTYPE_* Constants

author: John Shuell


Function - GetEffectType

Home > Reference > Functions > Effects > GetEffectType

GetEffectType(effect)

Get the type constant of the effect.

int GetEffectType(
    effect eEffect
);

Parameters

eEffect

The effect to compare or examine.

Description

Returns the effect type (EFFECT_TYPE_*) of the effect being examined.
Return EFFECT_INVALIDEFFECT if effect is invalid.

Remarks

You must first create and place the effect you wish to examine into a variable before calling this function. Visual effects do not have an effect type, but there is almost one effect type for each regular effect in the game. Useful when you need to check if a player is under the effects of a certain type before doing something else to them with your scripts. A good example would be checking for protection from evil effects before allowing an evil creature to close to them.

Version

1.22

See Also

functions: | EffectSpellLevelAbsorption | GetEffectCreator | GetEffectDurationType | GetEffectSpellId | GetEffectSubType | RemoveEffect
categories: | Effects Functions
constants: | EFFECT_TYPE_* Constants

author: John Shuell


Function - GetEncounterActive

Home > Reference > Functions > Encounter > GetEncounterActive

GetEncounterActive(object)

エンカウンターが生成されているかどうか、アクティブかどうかということに基づいて、TRUEもしくはFALSEを得ます。

int GetEncounterActive(
    object oEncounter = OBJECT_SELF
);

Parameters

oEncounter

調べたいエンカウンター(デフォルト: OBJECT_SELF)

Description

oEncounterが生成されているか、現在アクティブかどうかによってTRUEもしくはFALSEを返します。

Remarks

SetEncounterActive()関数を使うことでエンカウンターのアクティブプロパティを設定することができます。

ファイルを含むBiowareのいくつかのコメントでは、これがエンカウンタートリガの現在の使用と連動しないことがほのめかされています。

Version

1.22

See Also

functions: | GetEncounterDifficulty | GetEncounterSpawnsCurrent | GetEncounterSpawnsMax | SetEncounterActive
categories: | Encounter Functions

author: John Shuell, JP team: Redondo


Function - GetEncounterDifficulty

Home > Reference > Functions > Encounter > GetEncounterDifficulty

GetEncounterDifficulty(object)

エンカウンターの難易度を調べます。

int GetEncounterDifficulty(
    object oEncounter = OBJECT_SELF
);

Parameters

oEncounter

配置されたエンカウンターを示すオブジェクト(デフォルト: OBJECT_SELF)

Description

エンカウンターオブジェクトの難易度定数(ENCOUNTER_DIFFICULTY_*)を返します。

Remarks

難易度はVERY_EASY, EASY, NORMAL, HARD or VERY_HARDです。

Version

1.22

See Also

functions: | GetEncounterActive | GetEncounterSpawnsCurrent | GetEncounterSpawnsMax
categories: | Encounter Functions
constants: | ENCOUNTER_DIFFICULTY_* Constants

author: John Shuell, JP team: Redondo


Function - GetEncounterSpawnsCurrent

Home > Reference > Functions > Encounter > GetEncounterSpawnsCurrent

GetEncounterSpawnsCurrent(object)

現時点まででエンカウンターがスポーン（敵を出現）した回数を調べます。

int GetEncounterSpawnsCurrent(
    object oEncounter = OBJECT_SELF
);

Parameters

oEncounter

調べたいエンカウンター (デフォルト: OBJECT_SELF)

Description

モジュールが開始してからこれまでにoEncounterがスポーンした回数を返します。

Remarks

それほど使う機能ではありません。

Version

1.22

See Also

functions: | GetEncounterActive | GetEncounterDifficulty | GetEncounterSpawnsMax | SetEncounterActive | SetEncounterSpawnsCurrent
categories: | Encounter Functions

author: John Shuell, JP team: Redondo


Function - GetEncounterSpawnsMax

Home > Reference > Functions > Encounter > GetEncounterSpawnsMax

GetEncounterSpawnsMax(object)

oEncounterの最大の出現回数を調べます。

int GetEncounterSpawnsMax(
    object oEncounter
);

Parameters

oEncounter

調べるエンカウンター

Description

ツールセットで作られたときのエンカウンターに設定された最大の出現回数を返します。

Version

1.22

See Also

functions: | GetEncounterActive | GetEncounterDifficulty | GetEncounterSpawnsCurrent | SetEncounterSpawnsMax
categories: | Encounter Functions

author: John Shuell, JP team: Redondo


Function - GetEnemyHD

Home > Reference > Functions > Prototyped but Unused > GetEnemyHD

GetEnemyHD()

この関数は試作されたましたが、使用されていません。

int GetEnemyHD();

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Requirements

#include "nw_i0_generic"

Version

1.22

See Also

functions: | GetAlliedHD | GetNearestSeenOrHeardEnemy | GetTurnResistanceHD
categories: | Prototyped but Unused Functions

author: Steve Moseley, editor: Charles Feduke, JP team: katsu794


Function - GetEnteringObject

Home > Reference > Functions > Action on Object, Area, Encounter, Module, Spells, Traps > GetEnteringObject

GetEnteringObject()

この関数を呼び出したオブジェクトを最後に開けたオブジェクト、あるいは最後に入ったオブジェクトを返します。

object GetEnteringObject();

Description

この関数を呼び出したオブジェクトを最後に開けたオブジェクト、あるいは最後に入ったオブジェクトを返します。

この関数によって返される値は、呼び出したオブジェクトの型に依存します。:

(1) 呼び出したオブジェクトがドア、あるいは配置可能オブジェクトの場合、それを最後に引き起こしたオブジェクトを返します。

(2) 呼び出したブジェクトがトリガー、効果エリア、モジュール、エリア、あるいはエンカウントの場合、そこに最後に入ったオブジェクトを返します。

エラーの時には、無効なオブジェクト(OBJECT_INVALID)を返します。

Version

1.22

Example

// 酔っぱらうように設定された居酒屋の中のトリガーに入る全てのプレイヤーを出迎えます。

void main()
{
    if(GetIsPC(GetEnteringObject()))
    {
        AssignCommand(GetNearestObjectByTag("TavernPatron"),SpeakOneLinerConversation("DrunkGreeting"));
        AssignCommand(GetNearestObjectByTag("TavernPatron"),ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_DRUNK));
    }
}

See Also

functions: | GetClickingObject | GetExitingObject
categories: | Action on Object Functions | Area Functions | Encounter Functions | Module Functions | Spells Functions | Traps Functions
events: | OnClientEnter Event | OnEnter Event | OnOpen Event | OnUsed Event

author: John Shuell, editor: Kristian Markon, JP team: katsu794


Function - GetExitingObject

Home > Reference > Functions > Action on Object, Area, Encounter, Module, Spells, Traps > GetExitingObject

GetExitingObject()

この関数を呼び出したオブジェクトを最後に出ていったオブジェクトを返します。

object GetExitingObject();

Description

この関数を呼び出したオブジェクトを最後に出ていったオブジェクトを返します。この関数はトリガー、効果エリア、モジュール、エリアやエンカウント上で機能します。

エラー時には、OBJECT_INVALIDを返します。

Version

1.22

See Also

functions: | GetEnteringObject
categories: | Action on Object Functions | Area Functions | Encounter Functions | Module Functions | Spells Functions | Traps Functions

author: John Shuell, JP team: katsu794


Function - GetFacing

Home > Reference > Functions > Get Data from Creature, Movement > GetFacing

GetFacing(object)

何かが向いている方向を得るとき使います。

float GetFacing(
    object oTarget
);

Parameters

oTarget

面する方向の値を得るobject

Description

oTargetが向いている方向を0.0から360.0の浮動少数で返します。

エラーの場合は-1.0を返す。

Version

1.30

See Also

functions: | GetFacingFromLocation
categories: | Get Data from Creature Functions | Movement Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Morz, Keith Voss, Lilac Soul, JP team: geshi, Rainie


Function - GetFacingFromLocation

Home > Reference > Functions > Get Data from Object, Math, Movement, Targeting > GetFacingFromLocation

GetFacingFromLocation(location)

location変数から向いている方向の値を得ます。

float GetFacingFromLocation(
    location lLocation
);

Parameters

lLocation

向いている方向を抽出するlocation変数

Description

location変数から方位値を返します。locationは３つの構成要素から成り立ちます：

・エリアのオブジェクトID

・エリア内の位置を表すベクトル

・向きを表す浮動小数点番号

このコマンドはlocation変数から単に方向の値を調べます。

Known Bugs

以前バグと報告されていた内容は修正されています。

Version

1.30

See Also

functions: | GetFacing
categories: | Get Data from Object Functions | Math Functions | Movement Functions | Targeting Functions

author: John Shuell, editor: Kristian Markon, JP team: geshi, ngtaicho, Rainie


Function - GetFactionAverageGoodEvilAlignment

Home > Reference > Functions > Alignment, Get Data from Creature, Reputation/Faction > GetFactionAverageGoodEvilAlignment

GetFactionAverageGoodEvilAlignment(object)

対象のobjectのファクションに属する全てのobjectのグッド/イビル･アライメントの平均値を（0から100の間で）得ます。

int GetFactionAverageGoodEvilAlignment(
    object oFactionMember
);

Parameters

oFactionMember

平均を調べたいファクションに属するクリーチャーもしくはobject

Description

oFactionMemberのファクションのグッド/イビル･アライメントの平均値を0から100内の整数で返します。

エラーの場合は-1を返します。

Remarks

これはモジュール内のobjectのファクションに属する全てのメンバーを検索し、それらのグッド/イービル･アライメントの平均値を0（グッド）から100（イービル）の尺度で算出します。

Version

1.22

See Also

functions: | GetFactionAverageLawChaosAlignment | GetFactionAverageLevel | GetGoodEvilValue | GetLawChaosValue
categories: | Alignment Functions | Get Data from Creature Functions | Reputation/Faction Functions

author: John Shuell, editor: Jeremy Spilinek, JP team: Rainie


Function - GetFactionAverageLawChaosAlignment

Home > Reference > Functions > Alignment, Get Data from Creature, Reputation/Faction > GetFactionAverageLawChaosAlignment

GetFactionAverageLawChaosAlignment(object)

対象のobjectのファクションに属する全てのobjectのロー/カオス･アライメントの平均値を（0から100の間で）得ます。

int GetFactionAverageLawChaosAlignment(
    object oFactionMember
);

Parameters

oFactionMember

平均を調べたいファクションに属するクリーチャーもしくはobject

Description

oFactionMemberのファクションのロー/カオス･アライメントの平均値を0から100内の整数で返します。

エラーの場合は-1を返します

Remarks

これはモジュール内のobjectのファクションに属する全てのメンバーを検索し、それらのグッド/イービル･アライメントの平均値を0（ロー）から100（カオス）の尺度で算出します。

Version

1.22

See Also

functions: | GetFactionAverageGoodEvilAlignment | GetFactionAverageLevel | GetGoodEvilValue | GetLawChaosValue
categories: | Alignment Functions | Get Data from Creature Functions | Reputation/Faction Functions

author: John Shuell, editor: Jeremy Spilinek, JP team: Rainie


Function - GetFactionAverageLevel

Home > Reference > Functions > Get Data from Creature, Reputation/Faction > GetFactionAverageLevel

GetFactionAverageLevel(object)

ファクションメンバーの平均レベルを調べます。

int GetFactionAverageLevel(
    object oFactionMember
);

Parameters

oFactionMember

あなたが調べたいファクションのオブジェクト。

Description

オブジェクトの全てのクリーチャーの平均レベルに一致する整数値を返します。

Version

1.22

Example

void main()
{
    object oPC = GetPCSpeaker();
    int nXP;
    int nLvl = GetFactionAverageLevel(oPC);

    nXP = nLvl * 250;

    RewardPartyXP(nXP, oPC);
}

See Also

functions: | GetFactionAverageGoodEvilAlignment | GetFactionAverageLawChaosAlignment | GetFactionAverageReputation | GetFactionAverageXP | GetFactionGold | GetFactionMostFrequentClass
categories: | Get Data from Creature Functions | Reputation/Faction Functions

author: John Shuell, JP team: Redondo


Function - GetFactionAverageReputation

Home > Reference > Functions > Get Data from Creature, Math, Reputation/Faction > GetFactionAverageReputation

GetFactionAverageReputation(object, object)

対象オブジェクトに対する、ファクショングループの友好度の平均値を返す。

int GetFactionAverageReputation(
    object oSourceFactionMember,
    object oTarget
);

Parameters

oSourceFactionMember

ファクション値（友好度）の平均値を調べたいファクショングループのオブジェクト

oTarget

対象オブジェクト

Description

oTargetを対象として、oSourceFactionMemberの属するファクショングループのファクション値（友好度）の平均値を求める（返り値は 0 ～ 100 の整数値）。

エラー時は-1を返す。

Remarks

ファクショングループのメンバーは、相手のグループに対しそれぞれ違ったファクション値（友好度）を持っている。ゲーム開始時は全員が同じ、モジュールに設定されたディフォルトの友好度を持っているが、ゲームの進行と共に各個人に友好度のバラツキが出てくる。この関数はそのバラツキを平均化させた値を得ることができ、概観を知ることができる。

Version

1.22

Example

void main()
{
// プレーヤーが村の宿屋の主人を怒らせてしまう、だが他の村人は怒らせていない。
 // 宿屋の主人と村人は同じファクションとする。

object oPlayer = GetPCSpeaker();
object oInnKeeper = OBJECT_SELF;
int nFactionRating;

// 宿屋の主人の友好度が下がる
AdjustReputation(oPlayer, oInnKeeper, -1);
// 宿屋の主人のファクショングループ全体の友好度を求める。
nFactionRating = GetFactionAverageReputation(oInnKeeper, oPlayer);

// PCに何が起こったのかを知らせる
SendMessageToPC(oPlayer, "村人の友好度が1ポイント下がった。");
// ＰＣにメッセージと友好度を表示する
SendMessageToPC(oPlayer, "村全体の友好度は " + IntToString(nFactionRating) + " になった。");

}

See Also

functions: | AdjustReputation | ClearPersonalReputation | GetReputation
categories: | Get Data from Creature Functions | Math Functions | Reputation/Faction Functions

author: John Shuell, editor: Kristian Markon、JP team: geshi, ngtaicho


Function - GetFactionAverageXP

Home > Reference > Functions > Get Data from Creature, Math, Party, Reputation/Faction > GetFactionAverageXP

GetFactionAverageXP(object)

ファクションメンバー全員の経験値の平均を返す。

int GetFactionAverageXP(
    object oFactionMember
);

Parameters

oFactionMember

調べたいファクションのオブジェクト

Description

ファクションメンバー全員の経験値の平均を返す。

エラーの場合は-1を返す。

Remarks

ファクションの全体的なレベルを調べる方法のひとつ。

Version

1.22

See Also

functions: | GetFactionAverageLevel
categories: | Get Data from Creature Functions | Math Functions | Party Functions | Reputation/Faction Functions

author: John Shuell, JP team: ngtaicho


Function - GetFactionBestAC

Home > Reference > Functions > Combat Information, Get Data from Creature, Party, Reputation/Faction, Targeting > GetFactionBestAC

GetFactionBestAC(object, int)

ファクション中（パーティ中）で最も高いACを持ったメンバーを得ます。

object GetFactionBestAC(
    object oFactionMember = OBJECT_SELF,
    int bMustBeVisible = TRUE
);

Parameters

oFactionMember

調査したいファクションに属するオブジェクト（デフォルト：OBJECT_SELF）

bMustBeVisible

呼出者から可視である必要があるかどうか（デフォルト：TRUE）

Description

ファクション中（パーティ中）で最もアーマークラスの高いobjectを返します。bMustBeVisibleがTRUEに設定されているならば、返すObjectはこの関数を呼出したobjectから見えている必要があります。

oFactionMemberのファクションが無効であればOBJECT_INVALIDを返します。

Remarks

戦闘に適したAI関数です。魔法で弱体化させるべきメンバーを決定するとき等に使用してください。

Version

1.22

See Also

functions: | GetFactionLeastDamagedMember | GetFactionMostDamagedMember | GetFactionWorstAC
categories: | Combat Information Functions | Get Data from Creature Functions | Party Functions | Reputation/Faction Functions | Targeting Functions

author: John Shuell, editor: Jeremy Spilinek, JP team: Rainie


Function - GetFactionEqual

Home > Reference > Functions > Get Data from Creature, Reputation/Faction > GetFactionEqual

GetFactionEqual(object, object)

二つのオブジェクトが同じファクションであるかどうかを調べます。

int GetFactionEqual(
    object oFirstObject,
    object oSecondObject = OBJECT_SELF
);

Parameters

oFirstObject

比較する最初のオブジェクト

oSecondObject

比較する二つ目のオブジェクト(デフォルト: OBJECT_SELF)

Description

二つのオブジェクトのファクションIDが同じであればTRUEを返します。

Remarks

別の接近してくるオブジェクトが呼び出しオブジェクトと同じファクションであるかを調べるすばらしい方法です。

Version

1.22

See Also

categories: Get Data from Creature Functions | Reputation/Faction Functions

author: John Shuell, JP team: Redondo


Function - GetFactionGold

Home > Reference > Functions > Get Data from Creature, Money, Party, Reputation/Faction > GetFactionGold

GetFactionGold(object)

特定ファクションに属する全てのメンバーが所持するお金の総量を得ます。

int GetFactionGold(
    object oFactionMember
);

Parameters

oFactionMember

調べたいファクションに属するobject

Description

oFactionMemberのファクションが持つ全てのお金の総量を返します。この関数はファクションに属する全てのメンバー（通常はプレイヤーパーティ）を巡り、彼らが運んでいる全ての所持金の合計を返します。

oFactionMemberのファクションが無効であれば、-1を返します。

Remarks

パーティがどれほど裕福であるかを知ることは、どれくらいの割合の所持金を適切に減らせばいいのかという事に重宝します。これはNPCのファクションのインベントリーに対しては不正確で、それらは通常ランダムで配置されます。

Version

1.22

See Also

functions: | GetFactionAverageLevel | GetFactionLeader | GiveGoldToCreature
categories: | Get Data from Creature Functions | Money Functions | Party Functions | Reputation/Faction Functions

author: John Shuell, JP team: Rainie


Function - GetFactionLeader

Home > Reference > Functions > Party, Reputation/Faction > GetFactionLeader

GetFactionLeader(object)

プレイヤーのパーティリーダーを得ます。

object GetFactionLeader(
    object oMemberOfFaction
);

Parameters

oMemberOfFaction

リーダーを知りたいパーティに属しているプレイヤーObject

Description

oMemberOfFactionがメンバーにいるファクション（パーティ）のリーダー（オブジェクト変数）を返します。

oMemberOfFactionが有効なクリーチャーでない場合は返し値はOBJECT_INVALIDになります。

Remarks

プレイヤーパーティのリーダーを得るために使用してください。クリーチャーファクションのリーダーを定義する方法がないように、それに対して使用することは出来ないように思います。

Version

1.28

Example

// モジュールのOnPlayerDeathイベント用
// パーティ内の誰かが死んだことをプレイヤーパーティのリーダーにメッセージを送る
void main()
{
    object oPlayer = GetLastPlayerDied();
    object oLeader = GetFactionLeader(oPlayer);
    string sName = GetName(oPlayer);
    if (GetIsObjectValid(oLeader) == TRUE)
    {
        SendMessageToPC(oLeader, sName + " has died!");
    }
}

See Also

functions: | GetFactionGold
categories: | Party Functions | Reputation/Faction Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Nils Jeppe, JP team: Rainie


Function - GetFactionLeastDamagedMember

Home > Reference > Functions > Combat Information, Get Data from Creature, Party, Perception, Reputation/Faction, Targeting > GetFactionLeastDamagedMember

GetFactionLeastDamagedMember(object, int)

oFactionMemberのファクションに属する中から、最もHPに受けた被害が少ないメンバーを得ます。

object GetFactionLeastDamagedMember(
    object oFactionMember = OBJECT_SELF,
    int bMustBeVisible = TRUE
);

Parameters

oFactionMember

調査したいファクションに属するobject（デフォルト：OBJECT_SELF）

bMustBeVisible

対象が呼出Objectから可視状態である必要があるかどうか（デフォルト：TURE）

Description

oFactionMemberのファクション（もしくはプレイヤーパーティ）に属する中から、最もHPに受けた被害の少ないメンバーを返します。bMustBeVisibleがTRUE（デフォルト）に設定されている場合、最小被害メンバーは探知するobjectから可視でなければなりません。

Remarks

戦闘において、敵が目標を決定する際に非常に有効な関数です。もし戦闘を出来うる限り長く続けたいと思った場合、ダメージを受けても平気な対象へ目標を変更するようにAIへ考えさせることが出来ます。戦闘を引き分けたり、パーティに生き残るチャンスを与えるために全員の傷つき具合を確認する良い方法です。

Version

1.22

See Also

functions: | GetFactionBestAC | GetFactionMostDamagedMember | GetFactionWorstAC
categories: | Combat Information Functions | Get Data from Creature Functions | Party Functions | Perception Functions | Reputation/Faction Functions | Targeting Functions

author: John Shuell, JP team: Rainie


Function - GetFactionMostDamagedMember

Home > Reference > Functions > Combat Information, Core AI, Get Data from Creature, Henchmen/Familiars/Summoned, Party, Perception, Reputation/Faction, Targeting > GetFactionMostDamagedMember

GetFactionMostDamagedMember(object, int)

oFactionMemberのファクションに属する中から、最もHPに受けた被害が多いメンバーを得ます。

object GetFactionMostDamagedMember(
    object oFactionMember = OBJECT_SELF,
    int bMustBeVisible = TRUE
);

Parameters

oFactionMember

調査したいファクションに属するobject（デフォルト：OBJECT_SELF）

bMustBeVisible

対象が呼出Objectから可視状態である必要があるかどうか（デフォルト：TURE）

Description

oFactionMemberのファクション（もしくはプレイヤーパーティ）に属する中から、最もHPに受けた被害の多いメンバーを返します。bMustBeVisibleがTRUE（デフォルト）に設定されている場合、最大被害メンバーは探知するobjectから可視でなければなりません。

Remarks

もう一つの素晴らしいAIルーチンです。これは敵に、パーティやその友好関係にある者（ヘンチマン、使い魔等）から最も傷ついた者を倒させたい場合に有効です。もしくはそのような者に戦闘中や終了後にヒールをするときなどにも良いでしょう。

Version

1.22

See Also

functions: | GetFactionBestAC | GetFactionLeastDamagedMember | GetFactionStrongestMember | GetFactionWeakestMember | GetFactionWorstAC
categories: | Combat Information Functions | Core AI Functions | Get Data from Creature Functions | Henchmen/Familiars/Summoned Functions | Party Functions | Perception Functions | Reputation/Faction Functions | Targeting Functions

author: John Shuell, JP team: Rainie


Function - GetFactionMostFrequentClass

Home > Reference > Functions > Get Data from Creature, Party, Reputation/Faction > GetFactionMostFrequentClass

GetFactionMostFrequentClass(object)

ファクション（パーティ）のメンバー中の最も一般的なタイプのクラスを表わす定数を返します。

int GetFactionMostFrequentClass(
    object oFactionMember
);

Parameters

oFactionMember

調査したいファクションに属するObject

Description

ファクション内の最も多いクラスを返します － CLASS_TYPE_*定数を使用して調べられます。

エラーであれば-1を返します。

Remarks

統計報告や平均見込みを調べることを除いて何に適しているのかは確かではありません。

Version

1.22

See Also

functions: | GetFactionAverageLevel
categories: | Get Data from Creature Functions | Party Functions | Reputation/Faction Functions
constants: | CLASS_TYPE_* Constants

author: John Shuell, JP team: Rainie


Function - GetFactionStrongestMember

Home > Reference > Functions > Get Data from Creature, Party, Reputation/Faction > GetFactionStrongestMember

GetFactionStrongestMember(object, int)

objectのファクション中で最も強いメンバーを得ます。

object GetFactionStrongestMember(
    object oFactionMember = OBJECT_SELF,
    int bMustBeVisible = TRUE
);

Parameters

oFactionMember

調べたいファクションに属するメンバー（デフォルト：OBJECT_SELF）

bMustBeVisible

oFactionMemberから可視である必要があるかどうか（デフォルト：TRUE）

Description

oFactionMemberのファクションのメンバーで最も強いものを返します。bMustBeVisibleがTRUE（デフォルト）に設定されている場合、呼出Objectから現在目視できるメンバーのみが対象になります。
oFactionMemberのファクションが無効であればOBJECT_INVALIDを返します。

Version

1.28

See Also

functions: | GetFactionWeakestMember
categories: | Get Data from Creature Functions | Party Functions | Reputation/Faction Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Dan, JP team: Rainie


Function - GetFactionWeakestMember

Home > Reference > Functions > Combat Information, Get Data from Creature, Party, Reputation/Faction > GetFactionWeakestMember

GetFactionWeakestMember(object, int)

objectのファクション中で最も弱いメンバーを得ます。

object GetFactionWeakestMember(
    object oFactionMember = OBJECT_SELF,
    int bMustBeVisible = TRUE
);

Parameters

oFactionMember

調べたいファクションに属するメンバー（デフォルト：OBJECT_SELF）

bMustBeVisible

oFactionMemberから可視である必要があるかどうか（デフォルト：TRUE）

Description

oFactionMemberのファクションのメンバーで最も弱いものを返します。bMustBeVisibleがTRUE（デフォルト）に設定されている場合、呼出Objectから現在目視できるメンバーのみが対象になります。

oFactionMemberのファクションが無効であればOBJECT_INVALIDを返します。

Remarks

GetFactionStrongestMemberは壊れて機能しないように思います。機能性が非常に類似しているので、この関数も同様にあると今のところ考えることができます。これについて誰か何かを知っているならば、教えてください。

Version

1.22

See Also

functions: | GetFactionStrongestMember
categories: | Combat Information Functions | Get Data from Creature Functions | Party Functions | Reputation/Faction Functions

author: John Shuell, JP team: Rainie


Function - GetFactionWorstAC

Home > Reference > Functions > Combat Information, Get Data from Creature, Party, Reputation/Faction, Targeting > GetFactionWorstAC

GetFactionWorstAC(object, int)

ファクション中（パーティ中）で最も低いACを持ったメンバーを得ます。

object GetFactionWorstAC(
    object oFactionMember = OBJECT_SELF,
    int bMustBeVisible = TRUE
);

Parameters

oFactionMember

調査したいファクションに属するオブジェクト（デフォルト：OBJECT_SELF）

bMustBeVisible

呼出者から可視である必要があるかどうか（デフォルト：TRUE）

Description

ファクション中（パーティ中）で最もアーマークラスの低いobjectを返します。bMustBeVisibleがTRUEに設定されているならば、返すObjectはこの関数を呼出したobjectから見えている必要があります。

oFactionMemberのファクションが無効であればOBJECT_INVALIDを返します。

Remarks

戦闘に適したAI関数です。クリーチャーに最も命中させやすいターゲットを襲わせたり、ヘンチマンの魔法使いに主人のパーティ中、誰が保護魔法が必要なメンバーかを決定させるのに使うことが出来ます。

Version

1.22

See Also

functions: | GetFactionBestAC | GetFactionLeastDamagedMember | GetFactionMostDamagedMember
categories: | Combat Information Functions | Get Data from Creature Functions | Party Functions | Reputation/Faction Functions | Targeting Functions

author: John Shuell, editor: Jeremy Spilinek, JP team: Rainie


Function - GetFamiliarCreatureType

Home > Reference > Functions > Get Data from Creature, Henchmen/Familiars/Summoned > GetFamiliarCreatureType

GetFamiliarCreatureType(object)

PCの動物の相棒のクリーチャータイプを得ます。

int GetFamiliarCreatureType(
    object oCreature
);

Parameters

oCreature

動物の相棒を持ったPC

Description

oCreatureの動物の相棒のクリーチャータイプを返します。（ANIMAL_COMPANION_CREATURE_TYPE_*）

oCreatureが無効、または動物の相棒を現在伴っていなければ、ANIMAL_COMPANION_CREATURE_TYPEを返します。

Remarks

召還したクリーチャーにはなんの情報も返しません。動物の相棒は使い魔と異なることに注意してください。

Known Bugs

GetAnimalCompanion*とGetFamiliar*が入れ替わっています。GetAnimalCompanion*がソーサラーとウィザードの使い魔を返し、GetFamiliar*がレンジャーとドルイドの動物の相棒を返します。

Version

1.29

See Also

functions: | GetAnimalCompanionCreatureType | GetAnimalCompanionName | GetAssociate | GetFamiliarName | GetHenchman | SummonFamiliar
categories: | Get Data from Creature Functions | Henchmen/Familiars/Summoned Functions
constants: | ANIMAL_COMPANION_CREATURE_TYPE_* Constants

author: Charles Feduke, editor: Jody Fletcher, additional contributor(s): Jody Fletcher, Gene Koo, JP team: Rainie


Function - GetFamiliarName

Home > Reference > Functions > Get Data from Creature, Henchmen/Familiars/Summoned > GetFamiliarName

GetFamiliarName(object)

クリーチャーの動物の相棒の名前を得ます。

string GetFamiliarName(
    object oCreature
);

Parameters

oCreature

動物の相棒を連れているPCやNPC

Description

oCreatureの動物の相棒の名前を返します。

oCreatureが無効、または現在動物の相棒を伴っていない、または動物の相棒の名前が空白の場合、""を返します。

Remarks

召還したクリーチャーに対しては何も返しません。動物の相棒は使い魔と異なることに注意してください。

Known Bugs

GetAnimalCompanion*とGetFamiliar*が入れ替わっています。GetAnimalCompanion*がソーサラーとウィザードの使い魔を返し、GetFamiliar*がレンジャーとドルイドの動物の相棒を返します。

Version

1.29

See Also

functions: | GetAnimalCompanionCreatureType | GetAnimalCompanionName | GetFamiliarCreatureType | GetHenchman | SummonFamiliar
categories: | Get Data from Creature Functions | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: Jody Fletcher, additional contributor(s): Jody Fletcher, Gene Koo, JP team: Rainie


Function - GetFetchee

Home > Reference > Functions > Module Specific > GetFetchee

GetFetchee()

呼び出した者からローカルオブジェクトを返します。公式キャンペーンのみで使われます。

object GetFetchee();

Description

ローカル変数"NW_J_FETCH_OWNER"に保管されたオブジェクトを返します。

Remarks

公式キャンペーンのためのインクルードファイル中で他のスクリプトと合わせて使用されます。

Requirements

#include "nw_j_guard"

Version

1.22

See Also

functions: | CreateFetchItemOn | GetFetchItem | GiveFetchItemToPC | PlayerHasFetchItem | SetFetchee | SetFetchItem | TakeFetchItem
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetFetchItem

Home > Reference > Functions > Module Specific > GetFetchItem

GetFetchItem()

公式キャンペーンにおけるクエストのためのプロット・アイテムのタグを返します。

string GetFetchItem();

Description

変数"NW_J_FETCH_ITEM"というプロット・グローバルオブジェクトからアーティファクトアイテムのタグを返します。

Remarks

nw_j_fetch.nssの146行目にあります。

この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

これらの関数全ては比較的ストレートな内容であり、一見して簡単に理解できます。

さらに全く同じ関数で、"Fetch"の代わりに"ArtifactItems"に働く、別のスクリプトもあります。

スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。

その他の関数を"See Also"セクションで見てください。

Requirements

#include "nw_j_fetch"

Version

1.22

See Also

functions: | GetArtifactItem | GetComplexItem | GetFetchee | Global | PlayerHasFetchItem | SetFetchItem | TakeComplexItem | TakeFetchItem
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetFirstEffect

Home > Reference > Functions > Effects > GetFirstEffect

GetFirstEffect(object)

Determines the first active effect on a creature.

effect GetFirstEffect(
    object oCreature
);

Parameters

oCreature

The creature to examine for effects.

Description

Returns the first in-game effect (poisoned, cursed, etc.) on oCreature, and an invalid effect if oCreature does not have any active effects.

Version

1.22

Example

// this code cycles through the effects active on the first PC and
// stores whether s/he is blind or deaf
main()
{
   effect eEffect = GetFirstEffect(GetFirstPC());
   int blind = FALSE;
   int deaf = FALSE;
   int possibleDumb = FALSE;
   while(GetIsEffectValid(eEffect))
   {
      nType = GetEffectType(eEffect);
      if(nType == EFFECT_TYPE_BLINDNESS)
         blind = TRUE;
      else if(nType == EFFECT_TYPE_DEAF)
         deaf = TRUE;
      eEffect = GetNextEffect(GetFirstPC());
   }

   if (deaf == TRUE && blind == TRUE)
      possibleDumb = TRUE;
}

See Also

functions: | EffectSpellLevelAbsorption | GetNextEffect
categories: | Effects Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Marcus Lunzenauer


Function - GetFirstFactionMember

Home > Reference > Functions > Reputation/Faction > GetFirstFactionMember

GetFirstFactionMember(object, int)

クリーチャーが所属するファクションメンバーの最初のメンバーを調べます。

object GetFirstFactionMember(
    object oMemberOfFaction,
    int bPCOnly = TRUE
);

Parameters

oMemberOfFaction

調べたい対象ファクションを決定するクリーチャー

bPCOnly

TRUEであればファクションメンバーがPCのみ、TRUE以外であればNPCとPCを検索に含ます(デフォルト: TRUE)

Description

oMemberOfFactionのファクションの最初のメンバーを返します。もしoMemberOfFactionやoMemberOfFactionのファクションが無効であればOBJECT_INVALIDを返します。

bPCOnlyがFALSEに設定されている場合はPCとNPCを含んで調べます。

Remarks

この機能はGetNextFactionMember()を呼び出すことでoMemberOfFactionファクションのすべてのメンバーに繰り返します。（Example参照）

bPCOnlyがTRUEであればファクションメンバーがPCであるとき値を返します。

Version

1.29

Example

// 最初のPCの全てのパーティメンバーに対して繰り返します
object oPartyMember = GetFirstFactionMember(GetFirstPC(), TRUE);
while (GetIsObjectValid(oPartyMember) == TRUE)
{
   // do something to party member

   oPartyMember = GetNextFactionMember(oPartyMember, TRUE);
}

See Also

functions: | GetNextFactionMember
categories: | Reputation/Faction Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Iceberg, Mike Daneman, Matt Andrew, JP team: Redondo


Function - GetFirstInPersistentObject

Home > Reference > Functions > Miscellaneous > GetFirstInPersistentObject

GetFirstInPersistentObject(object, int, int)

持続型objectの内側である特定タイプの最初のobjectを得ます。

object GetFirstInPersistentObject(
    object oPersistentObject = OBJECT_SELF,
    int nResidentObjectType = OBJECT_TYPE_CREATURE,
    int nPersistentZone = PERSISTENT_ZONE_ACTIVE
);

Parameters

oPersistentObject

objectを含むobject（デフォルト：OBJECT_SELF）

nResidentObjectType

OBJECT_TYPE_* (デフォルト: OBJECT_TYPE_CREATURE)

nPersistentZone

PERSISTENT_ZONE_ACTIVE。〔これはPERSISTENT_ZONE_FOLLOWも使うことが出来ましたが、現在は使用できません。〕（デフォルト： PERSISTENT_ZONE_ACTIVE)

Description

指定したタイプのoPersistentObjectの中にある最初のobjectを返します。また、objectが見つからなければOBJECT_INVALIDを返します。

Remarks

GetNextInPersistentObject()を経て、含有objectの全てを循環するために使用されます。

範囲効果魔法を使用するために、Biowareはスクリプトの中でこの関数を使っています。

Version

1.22

See Also

functions: | GetNextInPersistentObject
categories: | Miscellaneous Functions
constants: | OBJECT_TYPE_* Constants | PERSISTENT_ZONE_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetFirstItemInInventory

Home > Reference > Functions > Inventory > GetFirstItemInInventory

GetFirstItemInInventory(object)

オブジェクトの所持品にある最初のアイテムを調べます。

object GetFirstItemInInventory(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

所持品を持っているオブジェクト。（デフォルトではOBJECT_SELF）

Description

oTargetの所持品にある最初のアイテムを返します（oTargetの所持品のアイテム全て調べ始めます）。

そしてスクリプトを呼び出したのがクリーチャーでなかったり、アイテムや配置物や商店だった場合、もしくはアイテムが見つからなかった場合はOBJECT_INVALIDを返します。

Remarks

次の2番目の例のスクリプトを見てください。これはファクションが必要なだけのアイテムや装備品を持っているかをチェックします。

これは所持品の18個ある装備スロットを全て取得するために、0から17までループさせる必要があります。

Version

1.31

Example

// この関数は最初のPCの所持品のアイテムを全て数え上げます。
//（積み重ねられているアイテムはその合計数を数えます）
main()
{
   int nItems = 0;
   object oItem = GetFirstItemInInventory(GetFirstPC());
   while (GetIsObjectValid(oItem) == TRUE)
   {
      nItems = nItems + GetNumStackedItems(oItem);

      oItem = GetNextItemInInventory(GetFirstPC());
   }
}

/*
 CheckFactionForItemseのサンプル

 この関数では、あなたはファクションのメンバーの所持品か装備品に入っているアイテムの　　数を調べられます。

  Created By: Arlas Gilhith (arlas@cyberlife-studios.de)
  Created On: 29.07.2003
*/
int CheckFactionForItems(object oMemberOfFaction, string sItem,
  int nAmount = 2)
{
    int iCnt = 0;
    int i;
    object oMember = GetFirstFactionMember(oMemberOfFaction, FALSE);
    object oItem;

    // ファクションのメンバーをループさせます
    while (!(oMember == OBJECT_INVALID) && (iCnt < nAmount))
    {
        oItem = GetFirstItemInInventory(oMember);

        // 所持品欄にあるアイテムをチェックします
        while (!(oItem == OBJECT_INVALID) && (iCnt < nAmount))
        {
            if (GetTag(oItem) == sItem)
              iCnt++;
            oItem = GetNextItemInInventory(oMember);
        }

        // 装備欄のアイテムをチェックします
        for (i = 0; i < NUM_INVENTORY_SLOTS; ++i)
        {
            if (!(GetItemInSlot(i, oMember) == OBJECT_INVALID)
              && (GetTag(GetItemInSlot(i, oMember)) == sItem))
                iCnt++;
        }

        oMember = GetNextFactionMember(oMemberOfFaction, FALSE);
    }

    return (iCnt >= nAmount);
}

// この例（カンバセーションでstarting conditionaを使用）では、話者のファクションから
//４つのハチェットを得ました。
int StartingConditional()
{
    return CheckFactionForItems(OBJECT_SELF, "NW_WAXHN001", 4);
}

See Also

functions: | GetNextItemInInventory
categories: | Inventory Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Marc Ermshaus, JP team: NamaYake


Function - GetFirstObjectInArea

Home > Reference > Functions > Area > GetFirstObjectInArea

GetFirstObjectInArea(object)

エリア内の最初のオブジェクトを調べます。

object GetFirstObjectInArea(
    object oArea = OBJECT_INVALID
);

Parameters

oArea

オブジェクトを含むエリア。対象エリア。(デフォルト: OBJECT_INVALID)

Description

oArea内の最初のオブジェクトを返します。オブジェクトがない、もしくは何らかのエラーであればOBJECT_INVALIDを返します。

もし無効なエリアが指定された場合は、呼び出し者のエリアを使います。

Remarks

エンカウンターオブジェクトは発見しません。エンカウンターはそれらのタグによって直接に示されなければなりません。

Known Bugs

DMによって憑依されたクリーチャーは調べません、飛ばされます。

Version

1.29

See Also

functions: | GetNextObjectInArea
categories: | Area Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Enigmatic, Jazael, JP team: Redondo


Function - GetFirstObjectInShape

Home > Reference > Functions > Miscellaneous > GetFirstObjectInShape

GetFirstObjectInShape(int, float, location, int, int, vector)

シェイプ（shape）内の指定タイプ（クリーチャー、ドア等）の最初のobjectを得ます。

object GetFirstObjectInShape(
    int nShape,
    float fSize,
    location lTarget,
    int bLineOfSight = FALSE,
    int nObjectFilter = OBJECT_TYPE_CREATURE,
    vector vOrigin = [0.0,0.0,0.0]
);

Parameters

nShape

SHAPE_*

fSize

シェイプ形状の大きさ（さらなる情報はDescriptionを参照してください）または、RADIUS_SIZE_*。

lTarget

シェイプの始点

bLineOfSight

これは呪文エフェクトが壁を通り抜けないことを確実にするために使用することができます。（デフォルト：FALSE）

nObjectFilter

このobjectタイプの結果を制限します（OBJECT_TYPE_*）。（デフォルト： OBJECT_TYPE_CREATURE)

vOrigin

通常はスペルキャスターの位置です。（Default: [0.0,0.0,0.0]）

Description

指定したnShapeのfSize内の最初のobjectを、objectが含まれていない場合はOBJECT_INVALIDを返します。

nShapeに依存するfSizeの意味は以下のとおり：

If nShape == SHAPE_SPHERE, fSizeは球状範囲です。

If nShape == SHAPE_SPELLCYLINDER, fSizeは円筒状範囲です。

If nShape == SHAPE_CONE, fSizeは広い円錐状範囲です。.

If nShape == SHAPE_CUBE, fsizeは立方体の面のうちの1つの長さの半分です。

例えば、クリーチャーとドアだけを返すためには、nObjectFilterパラメーターの値をOBJECT_TYPE_CREATURE | OBJECT_TYPE_DOORにします。

Known Bugs

この関数はOBJECT_TYPE_PLACEABLEオブジェクトを返しません（キーワードやOBJECT_TYPE_ALLを使っても）。

SHAPE_CONEの形状がCONE（円錐）でないことが数人のユーザーから報告されています。そして実はこの定数はオフィシャルキャンペーン全体を通して、たった一つの関数でしか使われてないことで、それが少しバグが多くしているのかもしれません。

SHAPE_SPELLCONE定数では、ITargetは円錐の角度を表します。ltargetの方向にfSizeだけ離れます。"vOrigin"は無視されます－円錐に始点はありません－－－円錐の始点はOBJECT_SELFの位置になります。

SHAPE_SPELLCYLINDERでは、"fSize"は通常円筒の長さで、円筒の終点はvOriginからlTargetに向かって沿うように"fSize"進んだところです。円筒の幅（直径）は常に約10フィート(?)です

－公式フォーラムでのKorak氏の報告

Version

1.31

Example

// バーニングハンズ呪文を使うBiowareのスクリプトより

// [Snip][Snip]
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, GetSpellTargetLocation(), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);

// 無効なobjectを捕まえるまで、呪文の形状範囲内のターゲットを循環する
while(GetIsObjectValid(oTarget))
{
   if(!GetIsReactionTypeFriendly(oTarget))
   {
      // セービングスロー、ダメージ、エフェクト等を操る
   }
   // 呪文の形状範囲内の次のターゲットを選択する
   oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, GetSpellTargetLocation(), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
// [Snip][Snip]

See Also

functions: | GetNextObjectInShape
categories: | Miscellaneous Functions
constants: | OBJECT_TYPE_* Constants | RADIUS_SIZE_* Constants | SHAPE_* Constants

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Paul Catalano, JP team: geshi, Rainie


Function - GetFirstPC

Home > Reference > Functions > Get Data from Creature > GetFirstPC

GetFirstPC()

最初のPCを得ます。

object GetFirstPC();

Description

PCリスト中の最初のPCを得ます。PC全員を得るためにはGetNextPC()を続けて使います。

Remarks

デバッグ目的で使用されます。モジュールをテストするのが1人だけならば、SentMessageToPC(GetFirstPC(), "Something Happened")を使うことで、最初のPC（のみが）メッセージを受け取ります。

Version

1.22

Example

// この関数はPC全てを調べ、人数を数える
void main()
{
   int nPCs = 0;
   object oPC = GetFirstPC();
   while (GetIsObjectValid(oPC) == TRUE)
   {
      nPCs = nPCs+1; // nPCs++; でも良い
      oPC = GetNextPC();
   }
}

See Also

functions: | GetNextPC
categories: | Get Data from Creature Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: Rainie


Function - GetFleeToExit

Home > Reference > Functions > Core AI, Get Data from Creature > GetFleeToExit

GetFleeToExit()

実行しているオブジェクトが、ActivateFleeToExit関数を使用できる場合、TRUEを返します。

void GetFleeToExit();

Description

この関数は、単にActivateFleeToExit関数を実行できる適切な発生条件が、NPC上に設定されていることを調べるだけです。

NPCが必要とするウェイポイントの存在は調べません。

Requirements

#include "nw_i0_generic"

Version

1.22

Example

// 可能で有れば、去ります。
if (GetFleeToExit()) ActivateFleeToExit();

See Also

functions: | ActivateFleeToExit
categories: | Core AI Functions | Get Data from Creature Functions

author: Iskander Merriman, editor: Tom Cassiotis, JP team: katsu794


Function - GetFollowDistance

Home > Reference > Functions > Core AI > GetFollowDistance

GetFollowDistance()

パートナーがマスターに追従する場合の間隔をメートルで決定します。

float GetFollowDistance();

Description

SetAssociateState関数で設定されたNW_ASC_DISTANCE_*の値に依存するNPCパートナーの追従間隔を返します。

返される値は、2.0, 4.0, または 6.0です。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

functions: | GetAssociateState
categories: | Core AI Functions
constants: | NW_ASC_DISTANCE_* Constants

author: Charles Feduke, editor: John Shuell, JP team: katsu794


Function - GetForgeMatch

Home > Reference > Functions > Module Specific > GetForgeMatch

GetForgeMatch(int)

nPos番目のアイテムが現在の報酬アイテムとマッチしているかどうかを調べます。

int GetForgeMatch(
    int nPos
);

Parameters

nPos

比較するための文字列配列における報酬アイテムのポジション番号。

Description

この関数を呼び出したオブジェクトに固定された文字列"M3Q1_VALIDITEM"が、呼び出したオブジェクトの"NW_COMBO_REWARD"という変数 + nPos の値と同じである場合、TRUEを返します。

Remarks

この関数はnw_o0_itemmaker.nssの295行目にあります。.

どのアイテムが鍛冶屋により成功して作られたかを教える会話スクリプトのために使用されます。

T公式キャンペーン以外では役に立ちません。

Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

functions: | CreateForgeItem | GetBackpackMatch
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetFormerMaster

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetFormerMaster

GetFormerMaster(object)

NPCの主人であるプレイヤーを調べます。

object GetFormerMaster(
    object oHench = OBJECT_SELF
);

Parameters

oHench

以前の主人を知りたいヘンチマン。（デフォルト：OBJECT_SELF）

Description

oHenchの以前の主人だったPCを返します。oHenchが主人を持ったことがなければ、OBJECT_INVALIDを返します。

Remarks

（以前別れた）ヘンチマンと、その以前の主人との間の会話の味付けにこの関数を使えるかもしれません。

Requirements

#include "NW_IO_HENCHMAN"

Version

1.22

See Also

functions: | SetFormerMaster | SetWorkingForPlayer
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: John Shuell, JP team: Rainie


Function - GetFortitudeSavingThrow

Home > Reference > Functions > Saving Throw > GetFortitudeSavingThrow

GetFortitudeSavingThrow(object)

クリーチャー、ドア、配置物の頑健セービングスローのベース値を取得する。

int GetFortitudeSavingThrow(
    object oTarget
);

Parameters

oTarget

クリーチャー、ドア、配置物

Description

oTargetの頑健セービングスローのベース値を返す。 oTargetが不正な場合は0を返す。

Remarks

クリーチャー、ドア、配置物に対してのみ、はたらく。

Version

1.22

See Also

functions: | FortitudeSave | GetReflexSavingThrow | GetWillSavingThrow
categories: | Saving Throw Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: weed


Function - GetGameDifficulty

Home > Reference > Functions > Miscellaneous > GetGameDifficulty

GetGameDifficulty()

ゲーム難易度設定を得ます。

int GetGameDifficulty();

Description

現在のゲーム難易度（GAME_DIFFICULTY_*）を返します。

Remarks

エフェクト効果持続時間やダメージ等の測るためにスクリプトによって使用されることができます。

Version

1.22

See Also

categories: | Miscellaneous Functions
constants: | GAME_DIFFICULTY_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetGender

Home > Reference > Functions > Get Data from Creature > GetGender

GetGender(object)

クリーチャーの性別を調べます。

int GetGender(
    object oCreature
);

Parameters

oCreature

調べるクリーチャー

Description

oCreatureの性別（GENDER_*）を返します。

Version

1.22

See Also

categories: | Get Data from Creature Functions
constants: | GENDER_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetGoingToBeAttackedBy

Home > Reference > Functions > Combat, Core AI, Henchmen/Familiars/Summoned > GetGoingToBeAttackedBy

GetGoingToBeAttackedBy(object)

現在の戦闘ラウンドで他のクリーチャーを攻撃しているクリーチャーを取得します。

object GetGoingToBeAttackedBy(
    object oTarget
);

Parameters

oTarget

攻撃されているクリーチャー

Description

oTargetを攻撃しているクリーチャーを返します。oTargetが有効なクリーチャーではない、またはoTargetが攻撃されていない場合は、OBJECT_INVALIDを返します。

Remarks

全ての戦闘ラウンドの終了時に、この値は消去されます。（このクリーチャーがヘンチマンである時）主人であるクリーチャーから「攻撃しろ」という命令を得た時を除いては、どんな場合でも使用すべきではありません。

Version

1.22

See Also

categories: Combat Functions | Core AI Functions | Henchmen/Familiars/Summoned Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetGold

Home > Reference > Functions > Money > GetGold

GetGold(object)

クリーチャーが所有するゴールドの量を得ます。

int GetGold(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

所有額を調べたいクリーチャー。（デフォルト：OBJECT_SELF）

Description

oTargetの所有金額を返します。

Version

1.22

Example

// 話し手が100gp以上持っていた場合のみ
// Conversationの文章を話す。
int StartingConditional()
{
   int iResult;

   iResult = (GetGold(GetPCSpeaker()) >= 100);
   return iResult;
}

See Also

functions: | GiveGoldToCreature | HasGold
categories: | Money Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: Rainie


Function - GetGoldPieceValue

Home > Reference > Functions > Money > GetGoldPieceValue

GetGoldPieceValue(object)

アイテムの価値を金額に換算して得る。

int GetGoldPieceValue(
    object oItem
);

Parameters

oItem

価値を知りたいアイテム

Description

oItemの価値をゴールドに換算して得る。またoItemが有効なアイテムでなければ0を返す。

Version

1.22

See Also

functions: | GiveGoldToCreature
categories: | Money Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: Rainie


Function - GetGoodEvilValue

Home > Reference > Functions > Alignment > GetGoodEvilValue

GetGoodEvilValue(object)

クリーチャーのグッド/イービルの割合を得ます。

int GetGoodEvilValue(
    object oCreature
);

Parameters

oCreature

調べるクリーチャー

Description

oCreatureのグッド/イービル･アライメントを0から100以内の間の整数で返します。

oCreatureが有効なクリーチャーでない場合は-1を返します。

Remarks

100は最高のグッドで0は最高のイービルを示します。

Version

1.22

Example

// 最初のプレイヤーにグッド/イービル値を告げるメッセージを送る。
void main()
{
    int iGoodEvil = GetGoodEvilValue(GetFirstPC());
    SendMessageToPC(GetFirstPC(),"Your Good/Evil Value == " + IntToString(iGoodEvil));
}

See Also

functions: | GetFactionAverageGoodEvilAlignment | GetFactionAverageLawChaosAlignment | GetLawChaosValue
categories: | Alignment Functions

author: Tom Cassiotis, editor: Jeremy Spilinek, JP team: Rainie


Function - GetGreetingVar

Home > Reference > Functions > Module Specific > GetGreetingVar

GetGreetingVar(int, object)

この関数によって返される変数には、プレイヤーがヘンチマンに話しかけているかどうかが記録されます。

int GetGreetingVar(
    int nChapter,
    object oPC
);

Parameters

nChapter

プレイヤーがいる章。

oPC

調べるプレイヤー。

Description

プレイヤー上の変数名"NW_L_HEN" + henchmans tag + nChapterの値が10である場合、TRUEを返します。

Remarks

nw_i0_henchman.nssの180行目にあります。

この関数を用いて、特定の章においてヘンチマンがプレイヤーに既に話しかけているどうかを知ることができます。

Requirements

#include "nw_i0_henchman"

Version

1.22

See Also

functions: | SetGreetingVar
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetHas2Q4PlotItem

Home > Reference > Functions > Module Specific > GetHas2Q4PlotItem

GetHas2Q4PlotItem(object, int)

オブジェクトが特定のプロット・アイテムを持っているかどうかを調べます。

int GetHas2Q4PlotItem(
    object oItemPossesser,
    int nPlotItemConstant
);

Parameters

oItemPossesser

プロット・アイテムをっているかどうかを調べたいオブジェクト、クリーチャーまたはプレイヤー。

nPlotItemConstant

捜したいプロット・アイテムを参照する定数名。

Description

oItemPossesserがnPlotItemConstant変数によって定義されるアイテムを持っている場合、TRUEを返します。

このスクリプトは、アイテムを調べるためにGetItemPossessedBy()関数を呼び出し、アイテムがインベントリーに存在するかどうかを調べるためにGetIsObjectValid関数を呼び出すカバー関数です。

この関数は、以下の３つの候補アイテムのみを調べます。：
PLOT_2Q4_ITEM_KURTH_BASE_KEY
PLOT_2Q4_ITEM_BARAM_BASE_KEY
PLOT_2Q4_ITEM_ERBS_RING

Remarks

この関数はnw_i0_2q4luskan.nssの24行目に定義されています。

Requirements

#include "nw_i0_2q4luskan"

Version

1.22

See Also

functions: | GetItemPossessedBy
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetHasEffect

Home > Reference > Functions > Effects > GetHasEffect

GetHasEffect(int, object)

Determines whether a creature has an effect.

int GetHasEffect(
    int nEffectType,
    object oTarget = OBJECT_SELF
);

Parameters

nEffectType

The type of effect, from the constant list EFFECT_TYPE_*, we are interested in.

oTarget

The object to investigate. (Default: OBJECT_SELF)

Description

Returns TRUE if oTarget has the effect nEffectType active, otherwise FALSE.

Requirements

#include "NW_I0_GENERIC"

Version

1.28

Example

#include "NW_I0_GENERIC"
main()
{
   int isPoisoned = GetHasEffect(EFFECT_TYPE_POISON, GetFirstPC());
   int isParalyzed = GetHasEffect(EFFECT_TYPE_PARALYZE, GetFirstPC());
}

See Also

categories: | Effects Functions
constants: | EFFECT_TYPE_* Constants

author: Tom Cassiotis, editor: Charles Feduke


Function - GetHasFeat

Home > Reference > Functions > Get Data from Creature, Talents/Skills/Feats > GetHasFeat

GetHasFeat(int, object)

クリーチャーが特定の特技を使用できるかどうかを調べます。

action GetHasFeat(
    int nFeat,
    object oCreature = OBJECT_SELF
);

Parameters

nFeat

FEAT_*

oCreature

特技を調べるクリーチャー（デフォルト：OBJECT_SELF）

Description

oCreatureがnFeatを持っていて、使用可能かどうかを調べます。特技の最高レベルを調べます。

Version

1.27

See Also

categories: | Get Data from Creature Functions | Talents/Skills/Feats Functions
constants: | FEAT_* Constants

author: Iskander Merriman, editor: Charles Feduke, JP team: Rainie


Function - GetHasFeatEffect

Home > Reference > Functions > Talents/Skills/Feats > GetHasFeatEffect

GetHasFeatEffect(int, object)

クリーチャーが特技の影響を受けているかどうかを調べます。

int GetHasFeatEffect(
    int nFeat,
    object oObject = OBJECT_SELF
);

Parameters

nFeat

FEAT_*

oObject

調査するobject（デフォルト：OBJECT_SELF）

Description

oObjectがnFeatにより発生したeffectを持っている場合はTRUEを、そうでなければFALSEを返します。

Version

1.22

See Also

functions: | ActionUseFeat
categories: | Talents/Skills/Feats Functions
constants: | FEAT_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetHasInventory

Home > Reference > Functions > Inventory > GetHasInventory

GetHasInventory(object)

オブジェクトが所持品欄を持っているかどうか調べます。

int GetHasInventory(
    object oObject
);

Parameters

oObject

調べたいクリーチャー、商店もしくは配置物。

Description

TRUEを返した場合、それがクリーチャーや商店ならそれらはアイテムを持っています。配置オブジェクトならそれらはコンテナです。FALSEのときはそれ以外のタイプです。

Version

1.22

See Also

categories: Inventory Functions

author: Tom Cassiotis, JP team: NamaYake


Function - GetHasSkill

Home > Reference > Functions > Talents/Skills/Feats > GetHasSkill

GetHasSkill(int, object)

クリーチャーが指定したスキルを持っているかどうかを調べます。

int GetHasSkill(
    int nSkill,
    object oCreature = OBJECT_SELF
);

Parameters

nSkill

SKILL_*

oCreature

スキルを調べるクリーチャー（デフォルト：OBJECT_SELF）

Description

oCreatureがnSkillを持っていて使用可能ならばTRUEを、そうでなければFALSEを返します。

Remarks

3rd Editionルールに従って、スキルランクがマイナスでも、いくつかの技術(説得など)は誰にでも使用可能です。

Version

1.22

See Also

functions: | ActionUseSkill
categories: | Talents/Skills/Feats Functions
constants: | SKILL_* Constants

author: Tom Cassiotis, editor: Ryan Hunt, additional contributor(s): Drake Coker, JP team: Rainie


Function - GetHasSpell

Home > Reference > Functions > Get Data from Creature, Spells > GetHasSpell

GetHasSpell(int, object)

クリーチャーがある呪文を使用できるかどうかを得ます。

int GetHasSpell(
    int nSpell,
    object oCreature = OBJECT_SELF
);

Parameters

nSpell

SPELL_*

oCreature

ある呪文をテストするクリーチャー（デフォルト：OBJECT_INVALID）

Description

（下記のKnown Bugsを読んで下さい）oCreatureがnSpellを残り何回使用できるかを示す整数を返します。その呪文の残数がなければFALSE（0）を返します。

Remarks

パッチ1.25以前はこの関数はソーサラーとバードに対して適切に動作しませんでした。

Known Bugs

パッチ1.28は、自発的な呪文詠唱に関する問題を修正したことを主張していますが、これがそうではないことの報告を受けています。それが修正したことを確認することができる場合は、Lexiconの担当者と連絡をとるためにこのトピックの下部にあるリンクを使用してください。

この関数で返される値は、呪文を使用する後毎です。しかし常にそれが返されるわけではありません。5、3または2の時に返されます。

Version

1.30

See Also

functions: | HasSpell
categories: | Get Data from Creature Functions | Spells Functions
constants: | SPELL_* Constants

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Keith Voss, Musashi, Bard Jackson, JP team: Rainie


Function - GetHasSpellEffect

Home > Reference > Functions > Spell Casting Effects > GetHasSpellEffect

GetHasSpellEffect(int, object)

オブジェクトがある呪文効果を受けているかどうかを調べます。

int GetHasSpellEffect(
    int nSpell,
    object oObject = OBJECT_SELF
);

Parameters

nSpell

SPELL_*

oObject

調べるオブジェクト(デフォルト: OBJECT_SELF)

Description

oObjectがnSpellを受けていればTRUEを返します。そうでなければFALSEを返します。

Remarks

ターゲットに同じ呪文を詠唱すること避けるために、クリーチャーに掛かった呪文がアクティブであるかどうか調べることができます｡

Version

1.22

See Also

categories: | Spell Casting Effects Functions
constants: | SPELL_* Constants

author: Tom Cassiotis, JP team: Redondo


Function - GetHenchman

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetHenchman

GetHenchman(object)

PCのヘンチマンを調べます。

object GetHenchman(
    object oMaster = OBJECT_SELF
);

Parameters

oMaster

ヘンチマンを調べる目標のPC。（デフォルト：OBJECT_SELF）

Description

oMasterに従うヘンチマンを返します。oMasterがヘンチマンを連れていなければOBJECT_INVALIDを返します。

Version

1.22

See Also

functions: | GetAssociate | GetAssociateState | GetFamiliarName | RemoveHenchman | ResetHenchmenState | SetAssociateState | SetFormerMaster
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: Kristian Markon, JP team: Rainie


Function - GetHitDice

Home > Reference > Functions > Get Data from Creature > GetHitDice

GetHitDice(object)

クリーチャーのヒットダイスを得ます。

int GetHitDice(
    object oCreature
);

Parameters

oCreature

ヒットダイスを得たいクリーチャー

Description

oCreatureのヒットダイスを示す整数値を返します。oCreatureが有効なクリーチャーでない場合は0を返します。

Remarks

PCのキャラクター総合レベルや各クラスレベルの合計を出すのに最も簡単な方法です。

Version

1.22

See Also

functions: | GetLevelByClass | GetLevelByPosition
categories: | Get Data from Creature Functions

author: Tom Cassiotis, editor: Iskander Merriman, JP team: Rainie


Function - GetIdentified

Home > Reference > Functions > Action on Object > GetIdentified

GetIdentified(object)

オブジェクトが鑑定されているかどうかを調べます。

int GetIdentified(
    object oItem
);

Parameters

oItem

調べるアイテム。

Description

oItemが鑑定されていれば TRUE、装でない場合は、FALSE を返します。

Version

1.22

See Also

functions: | SetIdentified
categories: | Action on Object Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: katsu794


Function - GetIdFromTalent

Home > Reference > Functions > Talents/Skills/Feats > GetIdFromTalent

GetIdFromTalent(talent)

タレントの識別IDを得ます。

int GetIdFromTalent(
    talent tTalent
);

Parameters

tTalent

識別IDを得るタレント

Description

SPELL_*、FEAT_*またはSKILL_*から、tTalentの識別IDを返します。

Remarks

クリーチャーのgeneric AIの記述に、GetCreatureTalentBestのような関数があるとき、状況に応じて使用されたタレントを帰しますが、関数の殆どは使用するときに識別IDを必要とします。この関数は「タレント」からそれらのIDに変換します。

Version

1.22

See Also

functions: | GetCreatureTalentBest | GetCreatureTalentRandom | GetTypeFromTalent | TalentAdvancedProtectSelf | TalentBuffSelf
categories: | Talents/Skills/Feats Functions
constants: | SPELL_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetImmortal

Home > Reference > Functions > Cut-Scene, Get Data from Creature > GetImmortal

GetImmortal(object)

クリーチャーが不死性を得ます。

int GetImmortal(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

不死性を得る対象（デフォルト：OBJECT_SELF）

Description

クリーチャーが不死設定かどうかを得ます。

Version

1.30

See Also

categories: Cut-Scene Functions | Get Data from Creature Functions

author: Charles Feduke, JP team: Rainie


Function - GetIntelligence

Home > Reference > Functions > Get Data from Creature > GetIntelligence

GetIntelligence(object)

目標の知力能力値を得ます。

int GetIntelligence(
    object oTarget
);

Parameters

oTarget

知力を調べたいObject

Description

oTargetの知力能力値を返します。

Remarks

この関数はnw_i0_plot.nssの754行目で見つかります。

非常にシンプルな関数で、GetAbilityScore()を使ってわざわざ能力値を指定する必要のないように作られたのでしょう。ただ単にGetAbilityScore( oTarget, ABILITY_INTELLIGENCE )と同じことです。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | GetAbilityScore | GetCharisma | GetWisdom
categories: | Get Data from Creature Functions

author: John Shuell, JP team: Rainie


Function - GetInventoryDisturbItem

Home > Reference > Functions > Inventory > GetInventoryDisturbItem

GetInventoryDisturbItem()

所持品欄にあるOnDisturbedイベントに関わるdisturbアイテムを返します。

object GetInventoryDisturbItem();

Description

オブジェクトのOnDisturbedイベントを起動させるアイテムを返します。このイベントを起動させるのは３つのケースがあります。

一つはアイテムが加わったとき。もう一つはアイテムが奪われたとき。それと所持品欄から盗まれたときです。

エラーのときはOBJECT_INVALIDを返します。このときこの関数はOnDisturbイベントで排他的に扱われ何も起こりません。

（少なくとも理論上、バグリストを順にチェックします）

Known Bugs

disturbアイテムがゴールドである場合はOnDisturbイベントは正確に起動しないことに注意してください。このときこの関数は予期せぬ動作を返すことがあります。

私は下記の小さなスクリプトをコンテナのOnDisturbedイベントで実験してみました。

void main()
{
object oPC=GetLastDisturbed();

object oDisturb=GetInventoryDisturbItem();

SendMessageToPC(oPC, "this: "+GetName(oDisturb));
}

コンテナにゴールドを入れたときにはメッセージは “this: Gold piece”と表示されました。このときはゴールドで起動しました。

コンテナからゴールドをとりだしてみると “this: ”というメッセージが表示されました。

コンテナからゴールドを取り除いてみると、GetInventoryDisturbItem()は OBJECT_INVALIDを返しました。

スタックできるアイテムでもバグが発生します。スタックできるアイテムをアイテムの与える側か受け取る側の別のスタックに加えると、OnDisturbedイベントは起動しません。

（ゴールドは例外です）

Version

1.30

Example

// コンテナのOnDisturbedにセットします。
// 誰かがコンテナからアイテムを取り出すと、その人は
// そのアイテムの値段を請求されるでしょう。 by Lilac Soul
void main()
{
     object oItem=GetInventoryDisturbItem();
     object oPC=GetLastDisturbed();
     int nType=GetInventoryDisturbType();

     switch (nType)
     {
     case INVENTORY_DISTURB_TYPE_REMOVED:
     case INVENTORY_DISTURB_TYPE_STOLEN:

         int nAmount=GetGoldPieceValue(oItem);
         AssignCommand(oPC, TakeGoldFromCreature(nAmount, oPC, TRUE));

         SendMessageToPC(oPC, "窃盗はいけません。お金を払ってください！");
         break;
    }
}

See Also

functions: | GetInventoryDisturbType | GetLastDisturbed
categories: | Inventory Functions
events: | OnDisturbed Event

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: NamaYake


Function - GetInventoryDisturbType

Home > Reference > Functions > Inventory > GetInventoryDisturbType

GetInventoryDisturbType()

所持品のdisturbタイプを調べます。

int GetInventoryDisturbType();

Description

スクリプトを呼び出したものの OnInventoryDisturbedイベントを起動させるdestubタイプ (INVENTORY_DISTURB_TYPE_*)を返します。

Remarks

これはクリーチャーと配置物にのみ有効です。

Known Bugs

disturbアイテムがゴールドである場合はOnDisturbイベントは正確に起動しないことに注意してください。このとき関数は予期せぬ動作を返します。

私は下記の小さなスクリプトをコンテナのOnDisturbイベントで実験してみました。

void main()
{
object oPC=GetLastDisturbed();

object oDisturb=GetInventoryDisturbItem();

SendMessageToPC(oPC, "this: "+GetName(oDisturb));
}

コンテナにゴールドを入れたときにはメッセージは “this: Gold piece”と表示されました。このときはゴールドで起動しました。

コンテナからゴールドをとりだしてみると “this: ”というメッセージが表示されました。

コンテナからゴールドを取り除いてみると、GetInventoryDisturbItem()は OBJECT_INVALIDを返しました。

スタックできるアイテムでもバグが発生します。スタックできるアイテムをアイテムの与える側か受け取る側の別のスタックに加えると、OnDisturbedイベントは起動しません。

（ゴールドは例外です）

Version

1.30

Example

// コンテナのOnDisturbedにセットします。
// 誰かがコンテナからアイテムを取り出すと、その人は
// そのアイテムの値段を請求されるでしょう。 by Lilac Soul
void main()
{
     object oItem=GetInventoryDisturbItem();
     object oPC=GetLastDisturbed();
     int nType=GetInventoryDisturbType();

     switch (nType)
     {
     case INVENTORY_DISTURB_TYPE_REMOVED:
     case INVENTORY_DISTURB_TYPE_STOLEN:

         int nAmount=GetGoldPieceValue(oItem);
         AssignCommand(oPC, TakeGoldFromCreature(nAmount, oPC, TRUE));

         SendMessageToPC(oPC, "窃盗はいけません。お金を払ってください！");
         break;
    }
}

See Also

functions: | GetInventoryDisturbItem
categories: | Inventory Functions
constants: | INVENTORY_DISTURB_TYPE_* Constants

author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Max Aller, Lilac Soul, JP team: NamaYake


Function - GetIsAreaAboveGround

Home > Reference > Functions > Area, Get Data, Get Data from Object > GetIsAreaAboveGround

GetIsAreaAboveGround(object)

Determines whether an area is above ground or not.

int GetIsAreaAboveGround(
    object oArea
);

Parameters

oArea

Area to determine whether is above ground

Description

Returns AREA_ABOVEGROUND if the area oArea is above ground, AREA_UNDERGROUND otherwise.

Returns AREA_INVALID on an error.

Remarks

The above/under-ground status of the area is set in the area's properties under the advanced tab.

Version

1.31

See Also

functions: | GetIsAreaNatural
categories: | Area Functions | Get Data Functions | Get Data from Object Functions

author: Lilac Soul, editor: Charles Feduke


Function - GetIsAreaNatural

Home > Reference > Functions > Area, Get Data, Get Data from Object > GetIsAreaNatural

GetIsAreaNatural(object)

Returns whether an area is natural or not

int GetIsAreaNatural(
    object oArea
);

Parameters

oArea

Area to test whether is natural

Description

Returns AREA_NATURAL if the area oArea is natural, AREA_ARTIFICIAL otherwise.

Returns AREA_INVALID, on an error.

Remarks

The natural / artificial status of the area is set in the area's properties under the advanced tab.

Version

1.31

See Also

functions: | GetIsAreaAboveGround
categories: | Area Functions | Get Data Functions | Get Data from Object Functions

author: Lilac Soul


Function - GetIsDawn

Home > Reference > Functions > Time > GetIsDawn

GetIsDawn()

現在日の出であるかどうかを調べます。

int GetIsDawn();

Description

現在日の出であればTRUEを、１日の他の時間帯であればFALSEを返します。

Remarks

モジュールの詳細設定で日の出開始時刻を設定できるので、日の出に決まった時間はありません。

Version

1.22

See Also

functions: | GetIsDay | GetIsDusk | GetIsNight | GetTimeHour | GetTimeMillisecond | GetTimeMinute | GetTimeSecond
categories: | Time Functions

author: Charles Feduke, editor: Kristian Markon, JP team: Rainie


Function - GetIsDay

Home > Reference > Functions > Time > GetIsDay

GetIsDay()

現在が日中かどうか調べます。

int GetIsDay();

Description

現在が日中であればTRUE、１日の他の時間帯であればFALSEを返します。

Remarks

モジュールの詳細設定で日の出/日の入開始時刻を設定できるので、日中に決まった時間はありません。

Version

1.22

See Also

functions: | GetIsDawn | GetIsDusk | GetIsNight | GetTimeHour | GetTimeMillisecond | GetTimeMinute | GetTimeSecond | SetCalendar
categories: | Time Functions

author: Charles Feduke, editor: Tom Cassiotis, JP team: Rainie


Function - GetIsDead

Home > Reference > Functions > Miscellaneous > GetIsDead

GetIsDead(object)

クリーチャーが死亡または瀕死かどうかを調べます。

int GetIsDead(
    object oCreature
);

Parameters

oCreature

調べるクリーチャー

Description

oCreatureが死亡NPC、死亡PCまたは瀕死のPCであればTRUEを返します、でなければFALSEを返します。

Version

1.22

See Also

categories: Miscellaneous Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetIsDM

Home > Reference > Functions > Get Data from Creature > GetIsDM

GetIsDM(object)

クリーチャーがDMアバターかどうかを調べます。

int GetIsDM(
    object oCreature
);

Parameters

oCreature

DMアバターであるかどうかを調べるクリーチャー

Description

oCreatureがDM（ダンジョンマスター）アバターならばTRUEを、そうでなければFALSEを返します。DMによって操作(憑依)されているクリーチャーもFALSEを返す事に注意してください。憑依されているかを調べるにはGetIsDMPossessed()を使ってください。

Version

1.28

See Also

functions: | GetIsDMPossessed | GetIsPC | GetMaster
categories: | Get Data from Creature Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Jochem van 't Hull, JP team: Rainie


Function - GetIsDMPossessed

Home > Reference > Functions > Get Data, Get Data from Creature > GetIsDMPossessed

GetIsDMPossessed(object)

Returns whether the creature is possessed by a DM

int GetIsDMPossessed(
    object oCreature
);

Parameters

oCreature

Creature to check whether is possessed

Description

Returns TRUE if the creature oCreature is currently possessed by a DM character.

Returns FALSE otherwise.

Note: GetIsDMPossessed() will return FALSE if oCreature is the DM character.

To determine if oCreature is a DM character use GetIsDM()

Remarks

This function appears to do the same as this:

GetIsDM(GetMaster(oCreature));

If you know of any differences between the two, the Lexicon's authors would love to hear from you :)

Version

1.31

See Also

functions: | GetIsDM | GetMaster
categories: | Get Data Functions | Get Data from Creature Functions

author: Lilac Soul


Function - GetIsDoorActionPossible

Home > Reference > Functions > Get Data from Creature > GetIsDoorActionPossible

GetIsDoorActionPossible(object, int)

アクションが扉に対して使用できるかどうかを調べます。

int GetIsDoorActionPossible(
    object oTargetDoor,
    int nDoorAction
);

Parameters

oTargetDoor

調べたい扉

nDoorAction

DOOR_ACTION_*

Description

nDoorActionがoTargetDoorに実行できるならTRUEを、そうでなければFALSEを返します。

Remarks

この関数はヘンチマン用のBioware AIスクリプトで、主人（PC）が扉を開けるのに失敗した場合、異なる行動を試みるために使用されています。例えば、ヘンチマンがノックの呪文を唱える事が出来る場合、スクリプトはノックを詠唱する前に、GetIsDoorActionPossible(oDoor, DOOR_ACTION_KNOCK )を最初にチェックします。

Version

1.22

See Also

categories: | Get Data from Creature Functions
constants: | DOOR_ACTION_* Constants

author: Tom Cassiotis, editor: Kristian Markon, JP team: Rainie


Function - GetIsDusk

Home > Reference > Functions > Time > GetIsDusk

GetIsDusk()

現在日の入であるかどうかを調べます。

int GetIsDusk();

Description

現在日の入であればTRUEを、１日の他の時間帯であればFALSEを返します。

Remarks

モジュールの詳細設定で日の入開始時刻を設定できるので、日の入に決まった時間はありません。

Version

1.22

See Also

functions: | GetIsDawn | GetIsDay | GetIsNight | GetTimeHour | GetTimeMillisecond | GetTimeMinute | GetTimeSecond
categories: | Time Functions

author: Charles Feduke, editor: Tom Cassiotis, JP team: Rainie


Function - GetIsEffectValid

Home > Reference > Functions > Effects > GetIsEffectValid

GetIsEffectValid(effect)

Determines whether an effect is valid.

int GetIsEffectValid(
    effect eEffect
);

Parameters

eEffect

The effect to check for validity.

Description

Returns TRUE if eEffect is a valid effect, otherwise FALSE.

Remarks

Typically used on functions that return effects, like GetFirstEffect or GetNextEffect.

Version

1.22

Example

// Remove the Paralysis effect
effect eFind = GetFirstEffect(oTarget);
while (GetIsEffectValid(eFind))
{
   if(eFind == EffectDazed())
   {
      if (GetEffectType(eFind) == EFFECT_TYPE_PARALYZE)
      {
         RemoveEffect(oTarget, eFind);
      }
   }
   eFind = GetNextEffect(oTarget);
}

See Also

categories: Effects Functions

author: Tom Cassiotis, editor: Kristian Markon


Function - GetIsEncounterCreature

Home > Reference > Functions > Encounter > GetIsEncounterCreature

GetIsEncounterCreature(object)

クリーチャーがエンカウンターから出現したものかどうかを調べます。

int GetIsEncounterCreature(
    object oCreature = OBJECT_SELF
);

Parameters

oCreature

調べるクリーチャー(デフォルト: OBJECT_SELF)

Description

oCreatureがエンカウンターから出現したのであればTRUEを返し、それ以外はFALSEを返します。

Version

1.22

See Also

categories: Encounter Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: Redondo


Function - GetIsEnemy

Home > Reference > Functions > Miscellaneous, Reputation/Faction > GetIsEnemy

GetIsEnemy(object, object)

クリーチャーが別のクリーチャーを敵と考えるかどうか調べます。

int GetIsEnemy(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

敵状態をチェックされる対象クリーチャー

oSource

その見解が尋ねられる主体クリーチャー。（デフォルト：OBJECT_SELF）

Description

oSourceがoTargetを敵としてみなしているならTRUEを返します。

Remarks

この関数は２つのクリーチャー間の個人的評判と同様にファクション関係も考慮します。

Version

1.22

See Also

functions: | GetIsNeutral | GetIsReactionTypeHostile | GetNearestSeenOrHeardEnemy
categories: | Miscellaneous Functions | Reputation/Faction Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: Rainie


Function - GetIsFighting

Home > Reference > Functions > Combat, Core AI > GetIsFighting

GetIsFighting(object)

クリーチャーが戦闘中かどうかを得ます。

int GetIsFighting(
    object oFighting
);

Parameters

oFighting

使用しません。

Description

この関数をスクリプトされたNPCが、他の対象に呪文をかけたり、攻撃することを試みた場合、TRUEを返し、そうでなければFALSEを返します。

Remarks

クリーチャーが戦っているかどうか決めるために、GetAttemptedAttackTarget()およびGetAttemptedSpellTarget()を使用します。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

Example

// この関数用のソースプログラムです

int GetIsFighting(object oFighting)
{
   object oAttack = GetAttemptedAttackTarget();
   object oSpellTarget = GetAttemptedSpellTarget();

   if(GetIsObjectValid(oAttack) || GetIsObjectValid(oSpellTarget))
   {
      return TRUE;
   }
   return FALSE;
}

See Also

functions: | GetAttackTarget | GetAttemptedAttackTarget
categories: | Combat Functions | Core AI Functions

author: Tom Cassiotis, editor: John Shuell, JP team: Rainie


Function - GetIsFriend

Home > Reference > Functions > Reputation/Faction > GetIsFriend

GetIsFriend(object, object)

クリーチャーが別のクリーチャーを友好と考えるかどうか調べます。

int GetIsFriend(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

友好状態をチェックされる対象クリーチャー

oSource

その見解が尋ねられる主体クリーチャー。（デフォルト：OBJECT_SELF）

Description

oSourceがoTargetを友好としてみなしているならTRUEを返します、それ以外はFALSEを返します。

Remarks

この関数は２つのクリーチャー間の個人的評判と同様にファクション関係も考慮します。

Version

1.22

See Also

functions: | CheckFriendlyFireOnTarget | GetIsNeutral | GetIsReactionTypeFriendly | TalentCureCondition
categories: | Reputation/Faction Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: Redondo


Function - GetIsImmune

Home > Reference > Functions > Miscellaneous > GetIsImmune

GetIsImmune(object, int, object)

クリーチャーが指定した耐性を持っているかどうかを調べます。

int GetIsImmune(
    object oCreature,
    int nImmunityType,
    object oVersus = OBJECT_INVALID
);

Parameters

oCreature

耐性をチェックするクリーチャー

nImmunityType

IMMUNITY_TYPE_*

oVersus

これが指定されていれば、oVersusの種族や性格チェックを行います。（デフォルト：OBJECT_INVALID）

Description

oCreatureがnImmunityタイプの耐性や対oVersusを持っていればTRUEを、そうでなければFALSEを返します。

Version

1.22

See Also

functions: | EffectSpellImmunity
categories: | Miscellaneous Functions
constants: | IMMUNITY_TYPE_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetIsInCombat

Home > Reference > Functions > Combat Information > GetIsInCombat

GetIsInCombat(object)

クリーチャーが戦闘中かどうかを得ます。

int GetIsInCombat(
    object oCreature = OBJECT_SELF
);

Parameters

oCreature

調査するクリーチャー（デフォルト：OBJECT_SELF）

Description

oCreatureが戦闘状態であればTRUEを返します。そのファクションのメンバーによって、または対して何らかの攻撃型アクションの後の特定時間（8秒？）です。戦闘状態は戦闘音楽と、休憩の不可もまた決定しますので、どれくらいの長さ続くのか、またどの行動がそれを引き起こすのかを知っておくために、自分自身で試しておくべきでしょう。

Version

1.26

See Also

functions: | GetAttackTarget | GetAttemptedAttackTarget
categories: | Combat Information Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Jon McCarty, Noel Borstad, JP team: Rainie


Function - GetIsListening

Home > Reference > Functions > Get Data from Creature > GetIsListening

GetIsListening(object)

objectが何かを聞いているかどうかを調べます。

int GetIsListening(
    object oObject
);

Parameters

oObject

listening patternを調べたいobject

Description

oObjectが何かを聞いている最中であればTRUEを、そうでなければFALSEを返します。

Version

1.22

See Also

functions: | SetListening | SetListenPattern
categories: | Get Data from Creature Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: Rainie


Function - GetIsMagical

Home > Reference > Functions > Module Specific > GetIsMagical

GetIsMagical(object)

アイテムが魔法のアイテムであるかどうかを調べるために、あらかじめ定義された魔法エフェクトのグループをチェックします。

int GetIsMagical(
    object oItem
);

Parameters

oItem

Description

アイテムが以下の'魔法の'プロパティのいずれかを持っている場合、Trueを返します:
Enhancement Bonus
Enhancement Bonus vs Alignment Group
Enhancement Bonus vs Racial Group
Enhancement Bonus vs Alignment Group
Attack Bonus
Attack Bonus vs Alignment Group
Attack Bonus vs Racial Group
Attack Bonus vs Specific Alignment
Ac Bonus

この関数は、GetItemHasItemProperty()関数を呼び出すために長いIFステートメント文を使用する単純なカバー関数です。

Remarks

この関数は、nw_o0_itemmaker.nssの186行目に定義されています。

この関数はかなり限定的なチェックをするだけで、上で挙げたこと以外には特に機能を持っていません。

Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

functions: | GetItemHasItemProperty | IsValidBaseItem
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetIsNeutral

Home > Reference > Functions > Miscellaneous, Reputation/Faction > GetIsNeutral

GetIsNeutral(object, object)

クリーチャーが別のクリーチャーに対して中立であるかどうかを調べます。

int GetIsNeutral(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

中立状態を調べられる対象のクリーチャー

oSource

その見解が尋ねられる主体クリーチャー（デフォルト：OBJECT_SELF）

Description

oSourceがoTargetを中立と見なせばTRUEを、そうでなければFALSEを返します。

Version

1.22

Example

// 攻撃者が被攻撃者と中立または友好であるなら警告を与える
main()
{
   object oAttacker = GetLastAttacker();
   if(GetIsObjectValid(oAttacker))
   {
      if (GetIsNeutral(OBJECT_SELF,oAttacker) || GetIsFriend(OBJECT_SELF,oAttacker))
      {
         ActionStartConversation(oAttacker,"Warning");
      }
   }
}

See Also

functions: | GetIsEnemy | GetIsFriend | GetIsReactionTypeNeutral
categories: | Miscellaneous Functions | Reputation/Faction Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: Rainie


Function - GetIsNight

Home > Reference > Functions > Time > GetIsNight

GetIsNight()

現在夜間であるかどうかを調べます。

int GetIsNight();

Description

現在夜間であればTRUEを、１日の他の時間帯であればFALSEを返します。

Remarks

モジュールの詳細設定で日の出/日の入開始時刻を設定できるので、夜間に決まった時間はありません。

Version

1.22

See Also

functions: | GetIsDawn | GetIsDay | GetIsDusk | GetTimeHour | GetTimeMillisecond | GetTimeMinute | GetTimeSecond
categories: | Time Functions

author: Charles Feduke, editor: Tom Cassiotis, JP team: Rainie


Function - GetIsObjectValid

Home > Reference > Functions > Action on Object > GetIsObjectValid

GetIsObjectValid(object)

オブジェクトが有効であるかどうかを調べます。

int GetIsObjectValid(
    object oObject
);

Parameters

oObject

有効性を調べるオブジェクト。

Description

oObjectが有効であればTRUE、そうでない場合は、FALSEを返します。

Remarks

この関数は、オブジェクトを返す関数の返り値をチェックするために幅広く使える便利な関数です。NWNの関数にオブジェクトを何度も渡している時に、関数がいつも無効なオブジェクトを返すのであれば、そのオブジェクトはもう存在しないことを示しています。この関数は、そのような条件のテストに使うことができるでしょう。

Version

1.22

See Also

categories: Action on Object Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetIsOpen

Home > Reference > Functions > Get Data from Object > GetIsOpen

GetIsOpen(object)

配置可能オブジェクト、またはドアが現在開いているかどうかを調べます。

int GetIsOpen(
    object oObject
);

Parameters

oObject

調べる配置可能オブジェクト、またはドア。

Description

oObject(配置可能オブジェクト、またはドア)が現在開いていれば、TRUEを返します。

Version

1.22

See Also

categories: Get Data from Object Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: katsu794


Function - GetIsPC

Home > Reference > Functions > Get Data from Creature, PC Only > GetIsPC

GetIsPC(object)

クリーチャーがプレイヤー操作であるかどうかを調べます。

int GetIsPC(
    object oCreature
);

Parameters

oCreature

PCの状態調べるクリーチャー

Description

oCreatureがプレイヤーに操作されたキャラクターであればTRUEを、そうでなければFALSEを返します。

プレイヤーに操作されたキャラクターは以下の物が該当します：PC、DMアバター、PCが憑依した使い魔、DMが憑依したモンスター

Remarks

クリーチャーがPCである（NPCは年齢を持たない）場合にGetAgeも同じように使用できます。GetAgeの項で詳しい情報を見てください。

Version

1.29

See Also

functions: | GetIsDM | GetMaster
categories: | Get Data from Creature Functions | PC Only Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Jochem van 't Hull, George Mathis, JP team: Rainie


Function - GetIsPlaceableObjectActionPossible

Home > Reference > Functions > Action on Object > GetIsPlaceableObjectActionPossible

GetIsPlaceableObjectActionPossible(object, int)

配置用オブジェクトに対して、与えられたアクションが有効かどうかを調べます。

int GetIsPlaceableObjectActionPossible(
    object oPlaceable,
    int nPlaceableAction
);

Parameters

oPlaceable

配置用オブジェクト。

nPlaceableAction

PLACEABLE_ACTION_*

Description

スクリプトの所有者が、最初の引数で与えられた配置用オブジェクトに対して、２番目の引数で与えられたアクションを行うことができる場合は、TRUE、そうでない場合はFALSEを返します。

Remarks

この関数は、アクションを行うクリーチャーが"所有"しているスクリプトに配置されている場合のみ機能します。それ以外の場合は、常に FALSEを返します。この関数は、クリーチャーがそのアクションを行うことが可能かどうかを決定する時の根拠を得るために不可欠です。

Version

1.22

See Also

categories: | Action on Object Functions
constants: | PLACEABLE_ACTION_* Constants

author: Jason Harris, editor: Kristian Markon, JP team: katsu794


Function - GetIsPlayableRacialType

Home > Reference > Functions > Get Data from Creature > GetIsPlayableRacialType

GetIsPlayableRacialType(object)

目標のクリーチャーがプレイ可能な種族であるかどうかを調べます。

int GetIsPlayableRacialType(
    object oCreature
);

Parameters

oCreature

調べるクリーチャー

Description

指定されたクリーチャーがプレイ可能な種族（ドワーフ、エルフ、ノーム、ハーフエルフ、ハーフリング、人間）の一つならTRUEを返します。そうでなければFALSEを返します。

Version

1.22

See Also

categories: Get Data from Creature Functions

author: Jason Harris, editor: Charles Feduke, JP team: Rainie


Function - GetIsPossessedFamiliar

Home > Reference > Functions > Get Data from Creature, Henchmen/Familiars/Summoned > GetIsPossessedFamiliar

GetIsPossessedFamiliar(object)

使い魔の操作状況を得ます。

int GetIsPossessedFamiliar(
    object oCreature
);

Parameters

oCreature

憑依されているかを調べる使い魔

Description

指定した使い魔が現在、その主人によって憑依されていればTRUEを返します。

現在憑依されていない、または指定した使い魔が有効なクリーチャーでなければFALSEを返します。

Remarks

UnpossessFamiliarを呼出す前に、最も使用するでしょう。

Version

1.30

See Also

functions: | UnpossessFamiliar
categories: | Get Data from Creature Functions | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - GetIsPostOrWalking

Home > Reference > Functions > Get Data from Creature > GetIsPostOrWalking

GetIsPostOrWalking(object)

クリーチャーが関連しているウェイポイントを得ます。

int GetIsPostOrWalking(
    object oWalker = OBJECT_SELF
);

Parameters

oWalker

ウェイポイントを調べるクリーチャー（デフォルト：OBJECT_SELF）

Description

objectがpost-またはwalk-指定されたウェイポイントを持っていればTRUEを返します。関連付けられたPOSTは「"POST_"＋クリーチャーのタグ」というタグを持ちます。同じように関連付けられたウェイポイントは「"WP_"＋クリーチャーのタグ＋"_NN"」というタグを持ち、「NN]はクリーチャーの進路の順番を示す数字です。

Remarks

The function name is a bit misleading. The creature need not be actually at its post, or actually walking its waypoints. As long as at 関数の名前は少々的外れなようです。クリーチャーはpostも歩くためのウェイポイントも絶対に必要というわけではないからです。正しいタグを持つウェイポイントが最低一つでも存在していれば、この関数はTRUEを返します。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

categories: Get Data from Creature Functions

author: Jason Harris, editor: John Shuell, JP team: Rainie


Function - GetIsReactionTypeFriendly

Home > Reference > Functions > Reputation/Faction > GetIsReactionTypeFriendly

GetIsReactionTypeFriendly(object, object)

クリーチャーが別のクリーチャーに対して友好的な反応を持っているかどうか調べます。

int GetIsReactionTypeFriendly(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

調査のターゲットとなるクリーチャー

oSource

感情を調べるソースクリーチャー (デフォルト: OBJECT_SELF)

Description

oSourceがoTargetに対して友好的な反応を持っているならばTRUEを返します。それはファクション関係、PVP設定（oSourceとoTargetが両方ともPCである場合）、oSourceのoTargetに対するLike/Dislike設定に基づきます。

Remarks

もしあなたが、二つのオブジェクトがファクションや個人的な評判についてお互いにどのように感じているか知りたいときは、代わりにGetIsFriend()を使ってください。

Version

1.22

See Also

functions: | CheckFriendlyFireOnTarget | GetIsFriend
categories: | Reputation/Faction Functions

author: Jason Harris, editor: Kristian Markon, JP team: Redondo


Function - GetIsReactionTypeHostile

Home > Reference > Functions > Reputation/Faction > GetIsReactionTypeHostile

GetIsReactionTypeHostile(object, object)

クリーチャーが別のクリーチャーに対して敵対的な反応を持っているかどうか調べます。

int GetIsReactionTypeHostile(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

調査のターゲットとなるクリーチャー

oSource

感情を調べるソースクリーチャー (デフォルト: OBJECT_SELF)

Description

oSourceがoTargetに対して敵対的な反応を持っているならばTRUEを返します。それはファクション関係、PVP設定（oSourceとoTargetが両方ともPCである場合）、oSourceのoTargetに対するLike/Dislike設定に基づきます。

Remarks

もしあなたが、二つのオブジェクトがファクションや個人的な評判についてお互いにどのように感じているか知りたいときは、代わりにGetIsFriend()を使ってください。

Version

1.22

See Also

functions: | GetIsEnemy
categories: | Reputation/Faction Functions

author: Jason Harris, editor: Kristian Markon, JP team: Redondo


Function - GetIsReactionTypeNeutral

Home > Reference > Functions > Reputation/Faction > GetIsReactionTypeNeutral

GetIsReactionTypeNeutral(object, object)

クリーチャーが別のクリーチャーに対して中立的な反応を持っているかどうか調べます。

int GetIsReactionTypeNeutral(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

調査のターゲットとなるクリーチャー

oSource

調べるソースとなるクリーチャー (デフォルト: OBJECT_SELF)

Description

oSourceがoTargetに対して中立的な反応を持っているならばTRUEを返します。それはファクション関係、PVP設定（oSourceとoTargetが両方ともPCである場合）、oSourceのoTargetに対するLike/Dislike設定に基づきます。

Remarks

もしあなたが、二つのオブジェクトがファクションや個人的な評判についてお互いにどのように感じているか知りたいときは、代わりにGetIsFriend()を使ってください。

Version

1.22

See Also

functions: | GetIsNeutral
categories: | Reputation/Faction Functions

author: Jason Harris, editor: Kristian Markon, JP team: Redondo


Function - GetIsResting

Home > Reference > Functions > Get Data from Creature > GetIsResting

GetIsResting(object)

クリーチャーが休憩中かどうかを調べます。

int GetIsResting(
    object oCreature = OBJECT_SELF
);

Parameters

oCreature

調べるクリーチャー（デフォルト：OBJECT_SELF）

Description

oCreatureが現在休憩中であればTRUEを、そうでなければFALSEを返します。

Remarks

EffectSleep()のようなエフェクトやANIMATION_LOOPING_SIT_CROSSのようなアニメーションを適用する場合はカウントされない事に注意してください。PCが「休息」機能を使用している場合やNPCがActionRest()命令を受けている場合のみ、この関数はTRUEを返します。

Known Bugs

1.28パッチの段階では、OnPlayerRestイベント以外から呼び出された場合、この関数は常にFALSEを返します。

Version

1.28

See Also

functions: | GetLastRestEventType
categories: | Get Data from Creature Functions

author: Jason Harris, editor: Charles Feduke, JP team: Rainie


Function - GetIsSkillSuccessful

Home > Reference > Functions > Talents/Skills/Feats > GetIsSkillSuccessful

GetIsSkillSuccessful(object, int, int)

スキルロールが成功しているかどうかを調べます。

int GetIsSkillSuccessful(
    object oTarget,
    int nSkill,
    int nDifficulty
);

Parameters

oTarget

スキルを使用するクリーチャー

nSkill

使用するスキル（SKILL_*）

nDifficulty

成功するためのチェックで打ち勝つ難易度。

Description

通常の難易度判定（DC）です。1d20のロール結果＋スキルランクが、nDifficultyで指定した難易度より大きいか、等しければTRUEを返します。

Remarks

AutoDCと違って、呼出者のヒットダイスはこの関数の考慮に入れられませんので、絶対的な難易度を貴方自身が指定しなければなりません。すなわち、対抗する数値はd20+スキル値を使います。パッチv1.30においてAutoDC関数にバグがあるため、この関数を替わりに使用することをお薦めします。

エンカンブランス（重量）のようなその他の要因がこの関数で自動的に計算されるかどうかはわかりません。

Version

1.30

Example

// PCがポーション作成機械を使用できるかどうかを調べる。
// OnUsedイベントに入れる。成功した場合、ランダムなポーションを作成する。

void main()
{
object oPC=GetLastUsedBy();

if (GetIsSkillSuccessful(oPC, SKILL_USE_MAGIC_DEVICE, 30))
   {
   effect eVis=EffectVisualEffect(VFX_FNF_STRIKE_HOLY);
   ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);

   // ランダムなポーションのResRefを得る
   int nNum=Random(23)+1;
   string sNum=IntToString(nNum);
   if (GetStringLength(sNum)==1) sNum="00"+sNum;
   else if (GetStringLength(sNum)==2) sNum="0"+sNum;
   sNum="nw_it_mpotion"+sNum;
   CreateItemOnObject(sNum, oPC, d10());
   }
else
   {
   AssignCommand(oPC, ActionSpeakString("How the heck do you use this thing ! "));
   }
}

See Also

functions: | AutoDC
categories: | Talents/Skills/Feats Functions
constants: | SKILL_* Constants

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - GetIsTalentValid

Home > Reference > Functions > Talents/Skills/Feats > GetIsTalentValid

GetIsTalentValid(talent)

タレントが有効かどうかを調べます。

int GetIsTalentValid(
    talent tTalent
);

Parameters

tTalent

有効性を調べたいタレント

Description

tTalentが有効ならばTRUEを返します。（OBJECT_INVALIDテストと同種です）

Remarks

タレントは呪文、スキル、特技です。この関数はクリーチャーがタレントを所有しているかどうか以外何もしません － 与えられたタレントがゲームに存在するかどうかを単に調べます。

しかしながら、無効なタレントと遭遇するかどうか困難です。タレントオブジェクトは以下の3つの関数のうちの1つによって構築されます。TalentFeat(FEAT_*)、TalentSkill(SKILL_*)、そしてTalentSpell(SPELL_*)です。スクリプト・コンパイラは、したがってコンパイラ・エラーとして潜在的な無効のタレントほとんど全てにフラグを立てることができます。

「GetFirstTalent()」や「GetNextTalent()」のような関数があった場合、GetIsTalentValidはwhile-loopの条件を置くのに役立つでしょう。

GetCreatureTalentRandom()関数は与えられたタレントグループから任意のタレントを返し、そのクリーチャーが任意に生成されたタレントを所有しない場合、無効のタレントを返すでしょう。

Version

1.22

Example

void main()
{
     talent tFireBall = TalentSpell(SPELL_FIREBALL); // 有効
     talent tHeal = TalentSkill(SKILL_HEAL); // 有効
     talent tJuggle = TalentSkill(SKILL_JUGGLE); // 無効、しかしコンパイルできる
     talent tMissle = TalentFeat(SPELL_MAGIC_MISSLE);  // 無効、しかしコンパイルできない

     if (!GetIsTalentValid(tMissle))
          SendMessageToAllDMs("tMissle is not a valid talent");

     // OBJECT_SELFにとってランダムに有効なタレントを調べる
     if (!GetIsTalentValid(
          GetCreatureTalentRandom(TALENT_CATEGORY_BENEFICIAL_PROTECTION_SINGLE)
          ))
     {
          SendMessageToAllDMs("Creature calling this script does not have a self protection talent.");
     }
}

See Also

functions: | GetCreatureHasTalent | GetCreatureTalentBest | GetCreatureTalentRandom
categories: | Talents/Skills/Feats Functions

author: Jason Harris, editor: Charles Feduke, additional contributor(s): James Allen, JP team: Rainie


Function - GetIsTrapped

Home > Reference > Functions > Get Data from Object > GetIsTrapped

GetIsTrapped(object)

オブジェクトに罠が仕掛けられているかどうかを調べます。

int GetIsTrapped(
    object oObject
);

Parameters

oObject

調べる配置可能オブジェクト、ドア、またはトリガー。

Description

oObjectに罠が仕掛けられていて、罠がアクティブ(例：罠がすでに作動または解除されていない)であれば、TRUEを返します。

Remarks

注意：配置可能オブジェクト、ドア、またはトリガーのみに罠を仕掛けることができます。

oObjectが配置可能オブジェクト、ドア、またはトリガーでない場合は、FALSEを返すでしょう。

Version

1.22

See Also

functions: | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot
categories: | Get Data from Object Functions

author: Jason Harris, editor: Kristian Markon, JP team: katsu794


Function - GetIsValidCombination

Home > Reference > Functions > Item Creation > GetIsValidCombination

GetIsValidCombination(int, object)

合成によって新しいアイテムを作成する為に、コンテナ内のアイテムが有効であるかどうかを調べます。

int GetIsValidCombination(
    int bDeleteItem,
    object oContainer = OBJECT_INVALID
);

Parameters

bDeleteItem

oContainer内のアイテムを削除するかどうかを決定します。

oContainer

合成に必要な材料を調べる入れ物（デフォルト：OBJECT_INVALID）

Description

oContainer内にあるアイテムが新しいアイテムを作成する為に必要な材料として有効であればTRUEを返し、そうでなければFALSEを返します。bDeleteItemがTRUEであれば、oContainer内のアイテムは合成に成功した場合に限り、削除されます。

Remarks

oContainerがOBJECT_INVALIDのであった場合、このスクリプトは"NW_L_MYFORGE"というタグを持ったObjectを入れ物の代わりとして使用します。

bDeleteItemがTRUEの場合、使用されたならば、oContainer内のアイテムは削除されるだけでなく、作成されたアイテムは同一のPCによって今後得られることはありません。

Requirements

#include "nw_o0_itemmaker"

Version

1.29

See Also

categories: Item Creation Functions

author: Charles Feduke, JP team: Rainie


Function - GetIsWeaponEffective

Home > Reference > Functions > Get Data from Object > GetIsWeaponEffective

GetIsWeaponEffective(object, int)

スクリプトの所有者が装備している武器が、与えられたオブジェクトにダメージを与えることができるかどうかを調べます。

int GetIsWeaponEffective(
    object oVersus = OBJECT_INVALID,
    int bOffHand = FALSE
);

Parameters

oVersus

武器に対して調べるオブジェクト。(デフォルト: OBJECT_INVALID)

bOffHand

利き腕以外に装備している武器を調べます。(デフォルト: FALSE)

Description

スクリプトの所有者が装備している武器で、与えられたオブジェクトにダメージを与えることができる場合は、TRUEを返します。

bOffHandにTRUEが設定されていると、利き腕以外に装備している武器が調べられます。

Remarks

この関数は、調べられる武器を装備しているクリーチャーによって所有されているスクリプトから呼ばれなければなりません。

oVersus引数は、クリーチャーである必要はありません。

例えば、チェストを引数として使用すると通常はTRUEを返すでしょうが、チェストのプロットフラグがチェックされている場合は、 FALSEを返すでしょう。

また、実際に武器が存在している必要もありません。

武器を装備していない場合は、クリーチャーの素手の攻撃がテストされます。

Version

1.22

See Also

categories: Get Data from Object Functions

author: Jason Harris, editor: Kristian Markon, JP team: katsu794


Function - GetItemActivated

Home > Reference > Functions > Action on Object > GetItemActivated

GetItemActivated()

モジュールのOnActivateItemイベントを発動させるために使用されたアイテムを取り出します。

object GetItemActivated();

Description

使用されたオブジェクトを返します。使用されたアイテムを得るために、この関数をモジュールのOnActivateItemスロットのスクリプトで使用します。

Remarks

この関数は、モジュールのOnActivateItemスロット(編集 -> モジュールのプロパティ -> イベントタブを選択)でしか使用できません。

"アイテム"は、所持品内のオブジェクトを参照していることに注意して下さい。OnActivateItem関数を罠やスイッチといったような配置用オブジェクトを参照するように使うことはできません。これらの場合は、配置用オブジェクトのOnUsedイベントを使うか、罠のOnEnterイベントを使います。

アイテムにスクリプトを割り当てることはできないので、カスタムアイテムのスクリプトを作成するためには、モジュールのOnActivateItemイベントを使う方法以外はありません。最も一般的な使い方は、GetItemActivated()関数を呼び出して、それからモジュール内の様々なカスタムアイテムを使用した場合の動作について、連続したif文を使ってスクリプトを書きます。(下の例を参照)

Version

1.22

Example

//モジュールのOnActivateItemスロットのスクリプトに配置します。
void main()
{
    object oItem = GetItemActivated();
    string sTag = GetTag( oItem );

    if ( sTag == "WAND_RANDOM_SPELL" )
    {
        //ランダム呪文ワンドの動作に関するコード
    }
    else if ( sTag == "ROD_HEALGOOD" )
    {
        //グッドのクリーチャーのみをヒーリングするワンドの動作に関するコード
    }
    //などなど...
}

See Also

functions: | GetBaseItemType | GetItemActivatedTargetLocation
categories: | Action on Object Functions
events: | OnActivateItem Event

author: Jason Harris, editor: Kristian Markon, JP team: katsu794


Function - GetItemActivatedTarget

Home > Reference > Functions > Action on Object > GetItemActivatedTarget

GetItemActivatedTarget()

使用されたアイテムのターゲットを調べます。

object GetItemActivatedTarget();

Description

使用されたアイテムのターゲットをオブジェクトとして返します。使用されたアイテムのターゲットを得るために、この関数をモジュールのOnActivateItemスロットのスクリプトで使用します。

Remarks

この関数は、モジュールのOnActivateItemスロットでしか使用できません。 なぜなら、そのスロットだけが使用されたアイテムを意味ある形で参照できるからです。

"アイテム"は、所持品内のオブジェクトを参照していることに注意して下さい。OnActivateItem関数を罠やスイッチといったような配置用オブジェクトを参照するように使うことはできません。これらの場合は、配置用オブジェクトのOnUsedイベントを使うか、罠のOnEnterイベントを使います。

Version

1.22

Example

//グッドのクリーチャーだけをヒーリングするヒーリング・ロッド。モジュールの
//OnActivateItemスロットに配置します。
void main()
{
    oItem = GetItemActivated();

    if ( GetTag( oItem ) == "ROD_HEALGOOD" )
    {
        oTarget = GetItemActivatedTarget();
        if ( GetAlignmentGoodEvil( oTarget ) == ALIGNMENT_GOOD )
        {
            effect eHeal = EffectHeal( 10 );
            ApplyEffectToObect( DURATION_TYPE_INSTANT, eHeal, oTarget );
        }
    }
}

See Also

functions: | GetItemActivatedTargetLocation
categories: | Action on Object Functions
events: | OnActivateItem Event

author: Jason Harris, editor: Kristian Markon, JP team: katsu794


Function - GetItemActivatedTargetLocation

Home > Reference > Functions > Action on Object > GetItemActivatedTargetLocation

GetItemActivatedTargetLocation()

使用されたアイテムのターゲットのロケーションを調べます。

location GetItemActivatedTargetLocation();

Description

使用されたアイテムのターゲットのロケーションを調べます。使用されたアイテムのターゲットのロケーションを得るために、この関数をモジュールのOnActivateItemスロットのスクリプトで使用します。

ターゲットオブジェクトのロケーションが必要な場合や、アイテムがオブジェクトと同様に空のロケーションをターゲットにできる場合(例えば、"エフェクトエリア"の呪文の効果を持ったアイテム)には、GetItemActivatedTarget()関数の代わりにこの関数を使います。

Remarks

この関数は、モジュールのOnActivateItemスロットでしか使用できません。 なぜなら、そのスロットだけが使用されたアイテムを意味ある形で参照できるからです。

"アイテム"は、所持品内のオブジェクトを参照していることに注意して下さい。OnActivateItem関数を罠やスイッチといったような配置用オブジェクトを参照するように使うことはできません。これらの場合は、配置用オブジェクトのOnUsedイベントを使うか、罠のOnEnterイベントを使います。

Version

1.22

See Also

functions: | GetItemActivated | GetItemActivatedTarget
categories: | Action on Object Functions
events: | OnActivateItem Event

author: Jason Harris, editor: Kristian Markon, JP team: katsu794


Function - GetItemActivator

Home > Reference > Functions > Action on Object > GetItemActivator

GetItemActivator()

アイテムを使用したクリーチャーを取り出します。

object GetItemActivator();

Description

アイテムを使用したオブジェクトを返します。アイテムを使用したクリーチャーを得るために、この関数をモジュールのOnActivateItemスロットのスクリプトで使用します。

Remarks

この関数は、モジュールのOnActivateItemスロットでしか使用できません。 なぜなら、そのスロットだけが使用されたアイテムを意味ある形で参照できるからです。

"アイテム"は、所持品内のオブジェクトを参照していることに注意して下さい。OnActivateItem関数を罠やスイッチといったような配置用オブジェクトを参照するように使うことはできません。これらの場合は、配置用オブジェクトのOnUsedイベントを使うか、罠のOnEnterイベントを使います。

Version

1.22

See Also

categories: Action on Object Functions

author: Jason Harris, editor: Kristian Markon, JP team: katsu794


Function - GetItemACValue

Home > Reference > Functions > Get Data from Object > GetItemACValue

GetItemACValue(object)

アイテムのアーマークラス(AC)を得ます。

int GetItemACValue(
    object oItem
);

Parameters

oItem

ACを決定するアイテム。

Description

oItemのアーマークラス(AC)を返します。

oItemが無効なアイテムの場合や、oItemがアーマー値を持っていない場合は、0を返します。

Version

1.22

See Also

functions: | GetBaseItemType
categories: | Get Data from Object Functions

author: Jason Harris, editor: Kristian Markon, JP team: katsu794


Function - GetItemCharges

Home > Reference > Functions > Get Data from Object > GetItemCharges

GetItemCharges(object)

与えられたアイテムの残りの使用回数を取り出します。

int GetItemCharges(
    object oItem
);

Parameters

oItem

残りの使用回数を照会するオブジェクト。

Description

与えられたアイテムの残りの使用回数を返します。

アイテムではない場合、無効なオブジェクトの場合、またはアイテムの残りの使用回数が無い場合は0を返します。

Version

1.30

See Also

categories: Get Data from Object Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - GetItemHasItemProperty

Home > Reference > Functions > Get Data from Object > GetItemHasItemProperty

GetItemHasItemProperty(object, int)

アイテムが与えられたプロパティを持っているかどうかを調べます。

int GetItemHasItemProperty(
    object oItem,
    int nProperty
);

Parameters

oItem

チェックするアイテム。

nProperty

ITEM_PROPERTY_*

Description

oItemがnPropertyを持っている場合、TRUEを返します。

oItemが無効なアイテムの場合、またはoItemがnPropertyを持っていない場合はFALSEを返します。

Version

1.22

See Also

functions: | GetBaseItemType | GetIsMagical
categories: | Get Data from Object Functions
constants: | ITEM_PROPERTY_* Constants

author: Jason Harris, editor: Kristian Markon, JP team: katsu794


Function - GetItemInInventory

Home > Reference > Functions > Inventory > GetItemInInventory

GetItemInInventory()

不明

object GetItemInInventory();

Description

不明

Version

1.24

See Also

categories: Inventory Functions

author: Charles Feduke, JP team: NamaYake


Function - GetItemInSlot

Home > Reference > Functions > Inventory > GetItemInSlot

GetItemInSlot(int, object)

クリーチャーの所持品欄の指定されたスロットにあるアイテムを調べます。

object GetItemInSlot(
    int nInventorySlot,
    object oCreature = OBJECT_SELF
);

Parameters

nInventorySlot

INVENTORY_SLOT_*

oCreature

対象のクリーチャー（デフォルトではOBJECT_SELF)

Description

oCreatureの所持品欄の指定されたスロット(nInventorySlot）にあるオブジェクトを返します。

oCreatureが有効なクリーチャーでない場合やnInventorySlotにアイテムがなかった場合はOBJECT_INVALIDを返します。

Version

1.22

See Also

functions: | ActionUnequipItem | GetBaseItemType
categories: | Inventory Functions
constants: | INVENTORY_SLOT_* Constants

author: Jason Harris, editor: Kristian Markon, JP team: NamaYake


Function - GetItemPosition

Home > Reference > Functions > Module Specific > GetItemPosition

GetItemPosition(object)

作成可能なアイテムの基本型リストが格納された配列の中における変数の位置を返します。

int GetItemPosition(
    object oMagicalItem
);

Parameters

oMagicalItem

捜すための基本型を表すアイテム。

Description

"NW_COMBO_BASETYPE"というローカルな配列の中におけるoMagicalItemの基本型の位置を返します。

基本型がアーマーの場合、ACの値をもとにアーマーを検索します。

Remarks

nw_o0_itemmaker.nssの147行目にあります。

この関数は、公式キャンペーンのためのアイテム作成スクリプトにおいて使用されます。

Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

categories: Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetItemPossessedBy

Home > Reference > Functions > Inventory > GetItemPossessedBy

GetItemPossessedBy(object, string)

クリーチャーの所持品欄に指定されたタグのアイテムがあるか調べます。

object GetItemPossessedBy(
    object oCreature,
    string sItemTag
);

Parameters

oCreature

対象のクリーチャー

sItemTag

調べるアイテムのタグ

Description

sItemというタグをoCreatureが所持している場合はそのアイテムを返します。

oCreatureが無効なオブジェクトだった場合または指定されたアイテムを持っていなかった場合はOBJECT_INVALIDを返します。

Version

1.22

See Also

functions: | GetHas2Q4PlotItem | HasItem
categories: | Inventory Functions

author: Jason Harris, editor: Kristian Markon, JP team: NamaYake


Function - GetItemPossessor

Home > Reference > Functions > Get Data from Creature, Inventory > GetItemPossessor

GetItemPossessor(object)

指定されたアイテムを所持しているクリーチャーかオブジェクトを調べます。

object GetItemPossessor(
    object oItem
);

Parameters

oItem

対象のアイテム

Description

所持品欄にoItemがあるオブジェクトを返します。

いずれのクリーチャーの所持品欄にもアイテムが見つからなかった場合OBJECT_INVALIDを返します。

Remarks

同じタグを持ったアイテムが複数存在する場合、事態はちょっと複雑になります。

もしアイテムを所有する一番近くにいるクリーチャーを得ようとしても、GetNearestObjectByTag()関数はクリーチャーの所持品欄にあるオブジェクトには働きませんのでアイテムの識別はできません。

ゲーム中にあるすべての同じタグのアイテムを循環させるために「nNth」を指定してGetObjectByTag()関数を使用しなければなりません。

次に、各アイテムの所有者を決定するGetItemPossessor()関数とどのクリーチャーが最も近いか決めるGetDistanceToObject()関数を使用してください。

Version

1.28

See Also

categories: Get Data from Creature Functions | Inventory Functions

author: Jason Harris, editor: Charles Feduke, JP team: NamaYake


Function - GetItemStackSize

Home > Reference > Functions > Get Data from Object, Inventory > GetItemStackSize

GetItemStackSize(object)

スタックしているアイテムのスタック数を調べます。

int GetItemStackSize(
    object oItem
);

Parameters

oItem

スタック数を調べたいアイテム。

Description

oObjectの所持しているアイテムのスタック数を調べます。同じ名前のアイテムのみスタックできます。

例えば、同じ名前の二つの宝石はスタックできます。しかし剣は矢はスタックできません。オブジェクトが無効な場合は0を返します。

Remarks

oItemが無効なオブジェクトの場合や、アイテムでない場合（例えばクリーチャーや配置物だった場合）は0を返します。

この関数はアイテムがスタックできるかどうかを調べるためにも使用できます。下記の例をご覧ください。

Version

1.30

Example

//oItemがスタックできるときはTRUEを返します。
int GetIsStackableItem(object oItem)
{
//checkchestというタグの宝箱を作っておきます。

object oCopy=CopyItem(oItem, GetObjectByTag("checkchest"));

//スタック数を２にします。
SetItemStackSize(oCopy, 2);

//２つスタックしているかどうかチェックします。
int bStack=GetItemStackSize(oCopy)==2;

//コピーを破棄します。
DestroyObject(oCopy);

//bStackの返す値がTRUEのときはアイテムはスタック可能です。
return bStack;
}

See Also

functions: | GetModuleItemAcquiredStackSize | SetItemStackSize
categories: | Get Data from Object Functions | Inventory Functions

author: Charles Feduke, editor: Lilac Soul, JP team: NamaYake


Function - GetJournalQuestExperience

Home > Reference > Functions > Conversation, Experience, Journal, PC Only > GetJournalQuestExperience

GetJournalQuestExperience(string)

ジャーナルカテゴリーで設定した経験値の量を返します。

int GetJournalQuestExperience(
    string szPlotID
);

Parameters

szPlotID

ジャーナルカテゴリーのタグ

Description

日記上のクエストに経験値を与えるコマンドとして使用します。日記エディタ内のカテゴリーの「XP」欄に入力した経験値の量を返します。

日記エディタの日記上のクエストにXPの数値を設定できますがAddJournalQuestEntry()では、クエスト完了時でも、このXPを与えることはできません。代わりにGetJournalQuestExperience()を使用してください。

Remarks

パーティの経験値を割り当てたい場合は、 Biowareのnw_i0_toolに含まれるRewardPartyXP()を使っても良いでしょう。

スクリプトになれるまでは、カンバーセーション･エディタのスクリプトウィザードでめんどうな作業をやってしまっても良いでしょう。

Version

1.22

Example

// oPCという単体のPCに対して、ジャーナルカテゴリータグが
// "isk_jrnl_bbbbk"であるクエストの経験値を全て与える
GiveXpToCreature(oPC, GetJournalQuestExperience("isk_jrnl_bbbbk");

// クエストはPCにobjectを集める事を要求して
// 得たobjectの総数を格納する
// 最大値に比例してPCにどれくらい与えるかを計算する
// (NUM_HORSESHOES)
int iFound = GetLocalInt(oPC, "iFound");
int iXP = iFound  * GetJournalQuestExperience("shoe_hunt") / NUM_HORSESHOES;

See Also

functions: | AddJournalQuestEntry | GiveXPToCreature
categories: | Conversation Functions | Experience Functions | Journal Functions | PC Only Functions

author: Iskander Merriman, editor: Kristian Markon, JP team: Rainie


Function - GetLastAssociateCommand

Home > Reference > Functions > Get Data from Creature, Henchmen/Familiars/Summoned > GetLastAssociateCommand

GetLastAssociateCommand(object)

仲間に与えられた最後の命令を得ます。

int GetLastAssociateCommand(
    object oAssociate = OBJECT_SELF
);

Parameters

oAssociate

最後に与えられた命令を返したいNPCの仲間。（デフォルト：OBJECT_SELF）

Description

oAssociateに与えられた最後の命令（ASSOCIATE_COMMAND_*）を返します。

Version

1.22

See Also

functions: | GetAssociate
categories: | Get Data from Creature Functions | Henchmen/Familiars/Summoned Functions
constants: | ASSOCIATE_COMMAND_* Constants

author: Charles Feduke, editor: Kristian Markon, JP team: Rainie


Function - GetLastAttacker

Home > Reference > Functions > Combat Information, Get Data from Object > GetLastAttacker

GetLastAttacker(object)

攻撃されたばかりのクリーチャー、扉または配置用オブジェクトを得ます。

object GetLastAttacker(
    object oAttackee = OBJECT_SELF
);

Parameters

oAttackee

攻撃されるObject（デフォルト：OBJECT_SELF）

Description

oAttackeeを攻撃した者を返します。これはクリーチャー、扉、配置用オブジェクトの「OnPhysicalAttackedイベントのみ」で使うべきです。
エラーの場合はOBJECT_INVALIDを返します。

Remarks

備考：この関数がどうしてOnPhysicalAttackedのみから呼出すべきなのかはわかりません。全てのイベントから呼出すよう試してみましたが、クリーチャーが持たない幾つかのイベントでさえ、全て素晴らしく動作しました。oAttackeeへの攻撃を止めた後でさえです。

Version

1.30

See Also

functions: | GetLastHostileActor | GetLastKiller | GetLastWeaponUsed | GetTotalDamageDealt
categories: | Combat Information Functions | Get Data from Object Functions
events: | OnPhysicalAttacked Event

author: Jason Harris, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, Rainie


Function - GetLastAttackMode

Home > Reference > Functions > Combat Information > GetLastAttackMode

GetLastAttackMode(object)

クリーチャーの戦闘モードを得ます。

int GetLastAttackMode(
    object oCreature = OBJECT_SELF
);

Parameters

oCreature

攻撃しているクリーチャー（デフォルト：OBJECT_SELF）

Description

oCreatureの最後に攻撃した戦闘モード（COMBAT_MODE_*）を返します。クリーチャーが戦闘していない場合、COMBAT_MODE_INVALIDを返します。

Remarks

これはoCreatureが戦闘状態のときのみ動作します。

Version

1.22

See Also

categories: | Combat Information Functions
constants: | COMBAT_MODE_* Constants

author: Jason Harris, editor: Kristian Markon, JP team: Rainie


Function - GetLastAttackType

Home > Reference > Functions > Combat Information > GetLastAttackType

GetLastAttackType(object)

クリーチャの最後の攻撃の攻撃タイプを得ます。

int GetLastAttackType(
    object oCreature = OBJECT_SELF
);

Parameters

oCreature

攻撃しているクリーチャー（デフォルト：OBJECT_SELF）

Description

oCreatureの最後の攻撃のタイプ（SPECIAL_ATTACK_*）を返します。もしクリーチャーが戦闘をしていない、または最後の攻撃で特別な戦闘モードが使用されなければ、SPECIAL_ATTACK_INVALIDを返します。

Remarks

これはoCreatureが戦闘をしているときのみ動作します。

Version

1.22

See Also

categories: | Combat Information Functions
constants: | SPECIAL_ATTACK_* Constants

author: Jason Harris, editor: Kristian Markon, JP team: Rainie


Function - GetLastClosedBy

Home > Reference > Functions > Action on Object > GetLastClosedBy

GetLastClosedBy()

どのクリーチャーがドア、あるいは配置用オブジェクトを閉めたか調べます。

object GetLastClosedBy();

Description

最後にドアあるいは配置用オブジェクトを閉めたオブジェクトを得るために、OnCloseスロットのスクリプトで使います。最後にドアあるいは配置用オブジェクトを閉めたクリーチャーを返します。スクリプトを呼び出したオブジェクトが有効なドアや配置用オブジェクトでない場合は、OBJECT_INVALIDを返します。

Remarks

この関数はドアや配置用オブジェクトのOnCloseスロットのスクリプトから呼ばれる必要があります。そうでない場合は、常にOBJECT_INVALIDを返すでしょう。

Version

1.22

See Also

categories: | Action on Object Functions
events: | OnClose Event

author: Jason Harris, editor: Jeremy Spilinek, JP team: katsu794


Function - GetLastDamager

Home > Reference > Functions > Combat Information > GetLastDamager

GetLastDamager()

最後にダメージを受けたクリーチャーや配置Objectを得ます。

object GetLastDamager();

Description

最後に呼出者を傷つけたObjectを返します。

呼出者が有効なObjectでない場合、または呼出者が被害を受けていなければ、OBJECT_INVALIDを返します。

Remarks

殆どの他のGetLast*関数と違って、GetLastDamagedはOnDamagedイベントスクリプトに「制限されません」。見たところでは、それは、ダメージを受けたクリーチャーによって「所有される」全てのスクリプトから呼出すことができます。

Version

1.22

See Also

functions: | GetLastHostileActor | GetLastKiller
categories: | Combat Information Functions

author: Jason Harris, JP team: Rainie


Function - GetLastDisarmed

Home > Reference > Functions > Action on Object > GetLastDisarmed

GetLastDisarmed()

トリガー、ドア、または配置用オブジェクトの罠を誰が最後に解除したかを調べます。

object GetLastDisarmed();

Description

トリガー、ドア、または配置用オブジェクトの罠を最後に解除したオブジェクトを返します。関数を呼び出した者が、無効な配置用オブジェクト、トリガー、またはドアである場合、あるいは、関数を呼び出した者に罠が仕掛けられていない場合はOBJECT_INVALIDを返します。

Remarks

他のいくつかの"GetLast"関数とは違って、GetLastDisarmed関数は罠が仕掛けられたオブジェクトのスクリプトから呼ばれるでしょう。

Version

1.22

See Also

categories: Action on Object Functions

author: Jason Harris, JP team: katsu794


Function - GetLastDisturbed

Home > Reference > Functions > Inventory > GetLastDisturbed

GetLastDisturbed()

オブジェクトもしくはクリーチャーの所持品欄に最後にdisturbしたのが誰かを調べます。

object GetLastDisturbed();

Description

オブジェクトもしくはクリーチャーの所持品欄に最後にdisturbしたオブジェクトを返します。

所持品欄にdisturbしたものがいなかったりオブジェクトが所持品欄を持っていなかった場合はOBJECT_INVALIDを返します。

この関数で"disturb"された状態というのは、それが所有するアイテムが取り上げられたり加えられたりして変化した場合のことをいいます。

単に所持品欄を見られただけでは何も起こりません。

またこれは所持品欄が閉じられるのを待ちません。何かを取ったり加えたりするとただちにGetLastDisturbed()関数はそのプレイヤーもしくはクリーチャーを返します。

Remarks

この関数は所持品欄を調べられているオブジェクトのイベントスクリプトで使用されるでしょう。

Known Bugs

disturbアイテムがゴールドである場合はOnDisturbイベントは正確に起動しないことに注意してください。このとき関数は予期せぬ動作を返します。

私は下記の小さなスクリプトをコンテナのOnDisturbイベントで実験してみました。

void main()
{
object oPC=GetLastDisturbed();

object oDisturb=GetInventoryDisturbItem();

SendMessageToPC(oPC, "this: "+GetName(oDisturb));
}

コンテナにゴールドを入れたときにはメッセージは “this: Gold piece”と表示されました。このときはゴールドで起動しました。

コンテナからゴールドをとりだしてみると “this: ”というメッセージが表示されました。

コンテナからゴールドを取り除いてみると、GetInventoryDisturbItem()は OBJECT_INVALIDを返しました。

スタックできるアイテムでもバグが発生します。スタックできるアイテムをアイテムの与える側か受け取る側の別のスタックに加えると、OnDisturbedイベントは起動しません。

（ゴールドは例外です）

Version

1.30

See Also

functions: | GetInventoryDisturbItem | GetLastHostileActor | GetLastOpenedBy
categories: | Inventory Functions

author: Jason Harris, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: NamaYake


Function - GetLastGenericSpellCast

Home > Reference > Functions > Core AI > GetLastGenericSpellCast

GetLastGenericSpellCast()

この関数を呼び出したクリーチャーが最後に詠唱した呪文を取り出します。

int GetLastGenericSpellCast();

Description

SetLastGenericSpellCast()関数によって保管された、最後に詠唱された呪文に対するSPELL_*定数を返します。

setLastGenericSpellCast()関数とCompareLastSpellCast()関数と合わせて使用されます。

Remarks

ローカル変数名"NW_GENERIC_LAST_SPELL"を使用します。

BioWareのコアAIシステムによって使われるので、同じ呪文の詠唱を保持しておきません。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

functions: | CompareLastSpellCast | GetLastSpell | SetLastGenericSpellCast
categories: | Core AI Functions
constants: | SPELL_* Constants

author: Tom Cassiotis, editor: John Shuell, JP team: katsu794


Function - GetLastHostileActor

Home > Reference > Functions > Combat, Core AI, Get Data from Object, Henchmen/Familiars/Summoned, Targeting > GetLastHostileActor

GetLastHostileActor(object)

objectに対し最後に敵対行為を実行した、プロットクリーチャーではない生存者を得ます。

object GetLastHostileActor(
    object oVictim = OBJECT_SELF
);

Parameters

oVictim

返したい現在敵であるobject（デフォルト：OBJECT_SELF）

Description

GetLastAttacker()、GetLastDamager()、GetLastSpellCaster()（敵対呪文時）またはGetLastDisturbed()（クリーチャーがすりした場合）と同様の呼ばれた最後のObjectを返します。注意：返り値は、単に常に次のとおりかもしれません:*。 プロットキャラクターであるクリーチャー*はこの値に設定*をたないでしょう。AoE objectが、それらがこの値として登録されている場合、AoEの呼出者を返すでしょう。そうでなければINVALID_OBJECT_ID*を返します。トラップはtrap.*であるクリーチャーを返しません。この値は他のクリーチャーでないobject.*に上書きされることはありません。この値は死亡/破壊されたクリーチャーを返すことはありません。

Remarks

非常に使える関数です。明確な行動の種類を限定せずに敵対行為を行ったobjectを知りたいと思うことが時々あるだろう。様々な攻撃者を得る関数を一つにひっくるめた関数です。クリーチャーではない物を返さないので、殆どは戦闘目標を決定するために使用されます。（言い換えれば、罠を仕掛けた箱を表すobjectや罠等は返しません。）また、プロット設定のクリーチャーの場合も返しません。それはこの関数が、元はプロットNPCが他のNPCによって狙われないようにするAIの中で排他的に使用されていたことからきています。

Version

1.22

See Also

functions: | GetLastAttacker | GetLastDamager | GetLastDisturbed | GetLastKiller | GetLastSpellCaster | GetLastWeaponUsed | GetTotalDamageDealt | RespondToShout
categories: | Combat Functions | Core AI Functions | Get Data from Object Functions | Henchmen/Familiars/Summoned Functions | Targeting Functions

author: John Shuell, JP team: Rainie


Function - GetLastKiller

Home > Reference > Functions > Combat Information, Get Data from Creature > GetLastKiller

GetLastKiller()

呼出者を殺したObjectを得ます。

object GetLastKiller();

Description

呼出Objectを殺したObjectを返します。

Remarks

単純で分かりやすいです。パラメーターを入力する必要なく、殺されたObjectはこの関数を単に呼ぶことができます。

Version

1.22

See Also

functions: | GetLastAttacker | GetLastDamager | GetLastHostileActor | GetLastOpener
categories: | Combat Information Functions | Get Data from Creature Functions

author: John Shuell, JP team: Rainie


Function - GetLastLocked

Home > Reference > Functions > Get Data from Object > GetLastLocked

GetLastLocked()

関数を呼び出す者に最後に鍵をかけたオブジェクトを得ます。

object GetLastLocked();

Description

関数を呼び出す者に最後に鍵をかけたオブジェクトを返します。

関数を呼び出すオブジェクトが無効なドアや配置可能オブジェクトの場合は、OBJECT_INVALIDを返します。

Version

1.22

See Also

functions: | GetLastUnlocked
categories: | Get Data from Object Functions

author: John Shuell, JP team: katsu794


Function - GetLastOpenedBy

Home > Reference > Functions > Get Data from Object > GetLastOpenedBy

GetLastOpenedBy()

関数を呼び出す者を最後に開けたクリーチャーを得ます。

object GetLastOpenedBy();

Description

関数を呼び出す者を最後に開けたクリーチャーを得ます。

関数を呼び出すオブジェクトが無効なドアや配置可能オブジェクトの場合は、OBJECT_INVALIDを返します。

Remarks

GetLastDisturbed関数の代わりに使用可能です。この関数で、ドアや他の配置可能オブジェクトを開けたオブジェクトへの参照を簡単に得ることができます。

Version

1.22

See Also

functions: | GetLastDisturbed | GetLastOpener | GetLastUsedBy
categories: | Get Data from Object Functions

author: John Shuell, JP team: katsu794


Function - GetLastOpener

Home > Reference > Functions > Inventory > GetLastOpener

GetLastOpener()

最後にコンテナを開くか破壊するかしてこのスクリプトを呼び出したクリーチャーを調べます。

object GetLastOpener();

Description

最後にコンテナを開くか破壊したクリーチャーを返します。

Remarks

この関数はnw_o2_coninclude.nssの159行目で見つかります。

最初にGetLastOpenedBy()関数がチェックした後有効なオブジェクトが居なかった場合、GetLastKiller()関数がチェックされます。

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

functions: | GetLastKiller | GetLastOpenedBy
categories: | Inventory Functions

author: John Shuell, JP team: NamaYake


Function - GetLastPCRested

Home > Reference > Functions > Core AI, Miscellaneous, PC Only > GetLastPCRested

GetLastPCRested()

最後に休憩したPCを返します。

object GetLastPCRested();

Description

モジュール内で最後に休憩を取ったPCを返します。この関数はモジュールのOnPlayerRestスクリプトにのみ有効で、カスタムで休憩の反応を作る場合、使用することができます。

Version

1.22

See Also

functions: | GetLastRestEventType
categories: | Core AI Functions | Miscellaneous Functions | PC Only Functions
events: | OnPlayerRest Event

author: Iskander Merriman, editor: Jeremy Spilinek, JP team: Rainie


Function - GetLastPCToCancelCutscene

Home > Reference > Functions > Cut-Scene, PC Only > GetLastPCToCancelCutscene

GetLastPCToCancelCutscene()

カットシーンから戻った最後のプレイヤーを得ます。

object GetLastPCToCancelCutscene();

Description

カットシーンを取り消した最後のプレイヤーを返します。

Remarks

この関数は、カットシーン（SetCutsceneModeによって設定される）中のプレイヤーがESCキーを押した時に発動するOnCutsceneAbortイベントのみで使用するべきです。

そのボタンを押したプレイヤーは、その時にこの関数によって返されます。

カットシーンの中断は通常OnCutSceneAbortイベントの中にのみスクリプト化されることに注意してください。－ あなたがスクリプトにそれを入れなければ、単にESCを押すことは、少なくともPCをSetCutsceneModeから出さないでしょう。

Version

1.30

See Also

functions: | SetCutsceneMode
categories: | Cut-Scene Functions | PC Only Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - GetLastPerceived

Home > Reference > Functions > Perception > GetLastPerceived

GetLastPerceived()

OnPerceptionイベントで最後に知覚したクリーチャーを決定します。

object GetLastPerceived();

Description

これはOnPerceptionスクリプトで使用し、知覚したObjectを得るために使用します。

知覚したObject、または呼出者が有効なクリーチャーでなければOBJECT_INVALIDを返します。

Version

1.22

Example

// 知覚した敵を攻撃するOnPerceptionスクリプト
main()
{
   object oNoticed = GetLastPerceived();
   if(GetIsObjectValid(oNoticed))
   {
      if (GetLastPerceptionSeen() && GetIsEnemy(oNoticed))
      {
         ClearAllActions();
         ActionAttack(oNoticed);
      }
   }
}

See Also

categories: Perception Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: Rainie


Function - GetLastPerceptionHeard

Home > Reference > Functions > Perception > GetLastPerceptionHeard

GetLastPerceptionHeard()

「聴覚」によって知覚した最後のObjectを決定します。

int GetLastPerceptionHeard();

Description

これはOnPerceptionスクリプトで使用し、objectが「聴覚」によって知覚したかどうかを決定するために使用します。

最後の知覚されたオブジェクトが聞かれた場合TRUEを、そうでなければFALSEを返します。

Version

1.22

See Also

categories: Perception Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetLastPerceptionInaudible

Home > Reference > Functions > Core AI, Perception > GetLastPerceptionInaudible

GetLastPerceptionInaudible()

もはや聞くことができない最後の知覚されたオブジェクトを得ます。

int GetLastPerceptionInaudible();

Description

これはOnPerceptionスクリプトで使用し、知覚されたオブジェクトは聞き取れなくなったかどうかを決定します。

Remarks

「聞き耳」チェックに成功した衛兵に、PCが「忍び足」に成功して、足音を聞くことが出来なくなった際に頭を掻かせるような、素晴らしい衛兵用スクリプト関数になるかもしれません。

Version

1.22

See Also

categories: Core AI Functions | Perception Functions

author: John Shuell, JP team: Rainie


Function - GetLastPerceptionSeen

Home > Reference > Functions > Perception > GetLastPerceptionSeen

GetLastPerceptionSeen()

「目視」で知覚した最後のObjectを決定します。

int GetLastPerceptionSeen();

Description

これはObjectを「目視」で知覚したかどうかを決定するために、OnPerceptionスクリプトで使用します。

Objectを「目視」で知覚した場合TRUEを、そうでなければFALSEを返します。

Version

1.29

Example

// 目視した敵を攻撃するOnPerception用スクリプト
void main()
{
     object oNoticed = GetLastPerceived();
     if(GetIsObjectValid(oNoticed))
     {
          if (GetLastPerceptionSeen() && GetIsEnemy(oNoticed))
          {
               ClearAllActions();
               ActionAttack(oNoticed);
          }
     }
}

See Also

functions: | GetCanSeePC
categories: | Perception Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Alex Meduna, JP team: Rainie


Function - GetLastPerceptionVanished

Home > Reference > Functions > Perception > GetLastPerceptionVanished

GetLastPerceptionVanished()

最後に知覚したクリーチャーが消失したかどうかを決定します。

int GetLastPerceptionVanished();

Description

これは最後に知覚したObjectが（ゲームからも永遠に）消失したかどうかを決定するためにOnPerception用スクリプトとして使用します。

最後に知覚したObjectが消失した場合TRUEを、そうでなければFALSEを返します。

Version

1.22

See Also

categories: Perception Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetLastPlayerDied

Home > Reference > Functions > PC Only > GetLastPlayerDied

GetLastPlayerDied()

最後に死んだPCを得ます。

object GetLastPlayerDied();

Description

最後に死んだプレイヤーを得る為の、モジュールのOnPlayerDeath()スクリプトにこの関数を使用してください。

最後に死んだPCを返します。

Remarks

死のペナルティや、復活時の状態、評判初期化等を改造する為にOnPlayerDeath()で使ってください

Version

1.22

Example

// BiowareのDavid Gaider氏のスクリプトFAQより

// I'm creating a custom 'ClearAll FactionMembers' command, here
// first declaring the api for the new command, then what it does
// I could reasonably have put this in a seperate script and
// used #include to put it into this script (and others), as well
void ClearAllFactionMembers (object oMember, object oPlayer)
{
    object oClear = GetFirstFactionMember (oMember, FALSE);
    while (GetIsObjectValid(oClear) == TRUE)
    {
        ClearPersonalReputation (oPlayer, oClear);
        oClear = GetNextFactionMember (oMember, FALSE);
    }
}
// here's the main body of my script
void main()
{
    // identify the player
    object oPlayer = GetLastPlayerDied();
    // identify a member of the faction. I'm assuming these members are alive.
    // Otherwise, I would have to try several things to turn up a member that is
    // first valid and then do the if command
    object oGoblin = GetObjectByTag("GOBLIN1");
    if (GetIsObjectValid(oGoblin))
    {
        // adjust the faction relation back up by 100
        AdjustReputation (oPlayer, oGoblin, 100);
        // run my custom command to cycle through the faction
        ClearAllFactionMembers (oGoblin, oPlayer);
    }
}

See Also

functions: | GetLastPlayerDying
categories: | PC Only Functions
events: | OnDeath Event

author: Tom Cassiotis, JP team: Rainie


Function - GetLastPlayerDying

Home > Reference > Functions > PC Only > GetLastPlayerDying

GetLastPlayerDying()

現在瀕死にある最後のプレイヤーを検索します。

void GetLastPlayerDying();

Description

現在0から-10ヒットポイント間(つまり瀕死状態)にある最後のプレイヤーを返します。

Version

1.28

See Also

functions: | GetLastPlayerDied
categories: | PC Only Functions

author: Charles Feduke, additional contributor(s): Ricardo, JP team: Rainie


Function - GetLastRespawnButtonPresser

Home > Reference > Functions > Miscellaneous, PC Only > GetLastRespawnButtonPresser

GetLastRespawnButtonPresser()

最後に蘇生ボタンをクリックしたPCを得ます。

object GetLastRespawnButtonPresser();

Description

最後に蘇生ボタンを押したプレイヤーを表すobjectを返します。これはモジュールスクリプトのOnRespawnButtonPressedに対して使ってください。

Remarks

これは復活スクリプトを改造する事を可能にする関数です。それで、誰が最後に再度蘇生を望み、それを行ったかを知ることができます。

Version

1.22

See Also

categories: | Miscellaneous Functions | PC Only Functions
events: | OnPlayerDeath Event | OnPlayerRespawn Event

author: John Shuell, JP team: Rainie


Function - GetLastRestEventType

Home > Reference > Functions > Get Data, PC Only > GetLastRestEventType

GetLastRestEventType()

前回PCがとった休息（レスト）時の状態を調べます。

int GetLastRestEventType();

Description

前回の休息時のタイプ(REST_EVENTTYPE_REST_*)を調べます。

(モジュールのＯｎＰＣＲｅｓｔｅｄでの設定に従います)

Version

1.22

See Also

functions: | ActionRest | GetIsResting | GetLastPCRested
categories: | Get Data Functions | PC Only Functions
constants: | REST_EVENTTYPE_* Constants
events: | OnPlayerRest Event

author: Jody Fletcher, JP team: geshi, NamaYake


Function - GetLastSpeaker

Home > Reference > Functions > Conversation > GetLastSpeaker

GetLastSpeaker()

最後に会話したクリーチャーを取得します

object GetLastSpeaker();

Description

PCが会話している相手の人物を所得する為にこの関数をconversationスクリプトで使用してください

呼び出されたのが有効なクリーチャーでない場合は、OBJECT_INVALIDを返します

Remarks

会話中に呼び出された場合（例えば、NPCが話した後のPCの会話文で”StartingConditional”スクリプトの一部として）、この関数は最後に会話したNPCを返しません。OBJECT_INVALIDを返します。

値はNPCとの会話がすべて終了した後にセットされます。会話中ではありません。
したがって、現在会話中のNPCのタグを得るためにこの関数を使うことはできません。

Version

1.31

See Also

functions: | ActionPauseConversation | ActionResumeConversation | ActionStartConversation | EventConversation | GetPCSpeaker | IsInConversation
categories: | Conversation Functions
events: | OnConversation Event

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Thomas Clark, JP team: geshi, Rainie


Function - GetLastSpell

Home > Reference > Functions > Get Data, Spells > GetLastSpell

GetLastSpell()

最後に唱えられた呪文を調べます。

int GetLastSpell();

Description

これは "Spell Cast" スクリプトで使います。

唱えられたスペルのＩＤを返します。

Version

1.22

See Also

functions: | GetLastGenericSpellCast | GetLastSpellCaster | GetLastSpellHarmful | GetSpellId | GetSpellSaveDC
categories: | Get Data Functions | Spells Functions
events: | OnSpellCastAt Event

author: Jody Fletcher, JP team: geshi, NamaYake


Function - GetLastSpellCaster

Home > Reference > Functions > Get Data, Spells > GetLastSpellCaster

GetLastSpellCaster()

最後に呪文を唱えたものを調べます。

object GetLastSpellCaster();

Description

これは "Spell Cast" スクリプトに使います。最後に呪文を使ったものを返します。

呪文を唱えるものはクリーチャー、配置用オブジェクト、ドアです。

呪文を使ったものがクリーチャーや配置用オブジェクト、ドアでない場合は、ＯＢＪＥＣＴ＿ＩＮＶＡＬＩＤを返します。

Version

1.22

See Also

functions: | GetCasterLevel | GetLastHostileActor | GetLastSpell | GetLastSpellHarmful
categories: | Get Data Functions | Spells Functions
events: | OnSpellCastAt Event

author: Jody Fletcher, JP team: geshi, NamaYake


Function - GetLastSpellHarmful

Home > Reference > Functions > Get Data from Object, Spells > GetLastSpellHarmful

GetLastSpellHarmful()

最後に詠唱された呪文が有害なものかどうかを得ます。

int GetLastSpellHarmful();

Description

これは受けた呪文が有害なものかどうかを決定するためにOnSpellCastAtイベントに入れて使用します。

Remarks

推測：敵対設定がspells.2daの中で、ある呪文に対して1にセットされる場合、TRUEを返します。

Version

1.22

Example

// 受けた呪文が有害な物であれば悲鳴をあげ、そうでなければお礼を述べる
if(GetLastSpellHarmful())
{
    SpeakString("痛い！");
}
else
{
    SpeakString("ありがとう！");
}

See Also

functions: | GetLastSpell | GetLastSpellCaster
categories: | Get Data from Object Functions | Spells Functions
events: | OnSpellCastAt Event

author: Jochem van 't Hull, editor: Jody Fletcher, JP team: Rainie


Function - GetLastTrapDetected

Home > Reference > Functions > Get Data, Traps > GetLastTrapDetected

GetLastTrapDetected(object)

PCによって最後に発見された罠を調べます。

object GetLastTrapDetected(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

最後に罠を発見したクリーチャー(デフォルト: OBJECT_SELF)

Description

ｏＴａｒｇｅｔによって最後に発見された罠を返します。

エラーの場合はOBJECT_INVALIDと返します。

Version

1.22

See Also

functions: | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot | SetTrapDetectedBy | SetTrapDisabled
categories: | Get Data Functions | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: geshi, NamaYake


Function - GetLastUnlocked

Home > Reference > Functions > Get Data from Object > GetLastUnlocked

GetLastUnlocked()

誰がオブジェクトや配置可能オブジェクトの鍵を開けたかを決定します。

object GetLastUnlocked();

Description

関数を呼び出す者の鍵を最後に開けたオブジェクトを返します。

関数を呼び出す者が無効なドアや配置可能オブジェクトである場合は、OBJECT_INVALIDを返します。

Version

1.22

See Also

functions: | GetLastLocked | GetLocked | SetLocked
categories: | Get Data from Object Functions
events: | OnLock Event | OnUnlock Event

author: John Shuell, editor: Jody Fletcher, JP team: katsu794


Function - GetLastUsedBy

Home > Reference > Functions > Get Data from Object > GetLastUsedBy

GetLastUsedBy()

この関数を呼び出す配置可能オブジェクトを最後に使用したオブジェクトを得ます。

object GetLastUsedBy();

Description

この関数を呼び出す配置可能オブジェクトやドアオブジェクトを最後に使用したオブジェクトを返します。

配置可能オブジェクトやドアオブジェクト以外にこの関数が呼び出される場合は、OBJECT_INVALIDを返します。

Remarks

GetLastOpenedBy関数によく似た関数ですが、開けることができる配置可能オブジェクトではなく、使うことができる配置可能オブジェクトから呼び出すことができます。

Version

1.22

See Also

functions: | GetLastOpenedBy | GetLastWeaponUsed
categories: | Get Data from Object Functions
events: | OnDisturbed Event | OnUsed Event

author: Jody Fletcher, editor: John Shuell, JP team: katsu794


Function - GetLastWeaponUsed

Home > Reference > Functions > Combat Information, Get Data from Creature > GetLastWeaponUsed

GetLastWeaponUsed(object)

oCreatureが攻撃で使用した最後の武器を得ます。

object GetLastWeaponUsed(
    object oCreature
);

Parameters

oCreature

調べたいクリーチャー

Description

oCreatureが戦闘で使用した最後の武器Objectを返します。

oCreatureが攻撃をしていない、もしくは装備する武器を持っていない場合、OBJECT_INVALIDを返します。

Remarks

武器タイプ対するボーナス/耐性をスクリプトで書く際や、あるいはクリーチャーかオブジェクトに対して使用される武器に対するアクションを実行するために使用することができます。

GetLastWeaponUsed()はobjectを返しますが、objectからさらに情報を得る必要があります。例えば、そのobjectが持つタグを探す場合は、GetTag()関数を使ってタグを得ることが出来ます（調べるのが特別な武器である時などに便利）。「なんらかのハンドアックス」を探すときのように、アイテムの基本タイプを得ることも出来ます。

Version

1.22

Example

object oWeapon = GetLastWeaponUsed(oPC)
int iWeapType = GetBaseItemType(oWeapon);
if (iWeapType == BASE_ITEM_HANDAXE)

See Also

functions: | GetBaseItemType | GetLastAttacker | GetLastHostileActor | GetLastUsedBy | GetTag
categories: | Combat Information Functions | Get Data from Creature Functions
events: | OnDamaged Event | OnUsed Event

author: John Shuell, editor: Maximus, additional contributor(s): Rhone11, JP team: Rainie


Function - GetLawChaosValue

Home > Reference > Functions > Alignment, Get Data from Creature > GetLawChaosValue

GetLawChaosValue(object)

objectのロー/カオス値を得る。

int GetLawChaosValue(
    object oCreature
);

Parameters

oCreature

ロー/カオス値を調べたいobject

Description

oCreatureのアラインメントにおけるロー/カオス値を示す整数値を返します（100=ロー、0＝カオス）。

有効なクリーチャーでない場合は-1を返します。

Known Bugs

以前報告されていたバグはパッチにより修正されています。

Version

1.30

Example

// 最初のプレイヤーに、そのロー/カオス値を告げるメッセージを送ります。
void main()
{
    int iChaosLaw = GetLawChaosValue(GetFirstPC());
    SendMessageToPC(GetFirstPC(),"Your Law/Chaos Value == " + IntToString(iChaosLaw));
}

See Also

functions: | GetAlignmentGoodEvil | GetAlignmentLawChaos | GetFactionAverageGoodEvilAlignment | GetFactionAverageLawChaosAlignment | GetGoodEvilValue
categories: | Alignment Functions | Get Data from Creature Functions

author: GoLeM, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, Rainie


Function - GetLevelByClass

Home > Reference > Functions > Get Data from Creature, Party > GetLevelByClass

GetLevelByClass(int, object)

Objectの持つ指定したクラスのレベルを得ます。

int GetLevelByClass(
    int nClassType,
    object oCreature = OBJECT_SELF
);

Parameters

nClassType

CLASS_TYPE_*定数を使用し、調べるクラス

oCreature

クラスを調べるObject（デフォルト：OBJECT_INVALID）

Description

oCreatureが持つCLASS_TYPE_*によって記述されるクラスを整数値で返します。整数値は1から20で表されるクラスレベルです。そのクラスレベルがない場合は値は0です。例えば、配置オブジェクトの椅子はクラスを持ちませんので、何を要求しても0が返されることになります。

Version

1.22

Example

// PCのパラディンクラスのレベルを調べる（CLASS_TYPE_PALADIN）
void main()
{
    int i;
    i = GetLevelByClass(CLASS_TYPE_PALADIN,GetFirstPC());
    SendMessageToPC(GetFirstPC(),"Your Level in Paladin == " + IntToString(i));
}

See Also

functions: | GetCharacterLevel | GetHitDice | GetLevelByPosition
categories: | Get Data from Creature Functions | Party Functions
constants: | CLASS_TYPE_* Constants

author: GoLeM, editor: Kristian Markon, JP team: Rainie


Function - GetLevelByPosition

Home > Reference > Functions > Get Data from Creature, Party > GetLevelByPosition

GetLevelByPosition(int, object)

クラステーブルからObjectのクラスレベルを得ます。

int GetLevelByPosition(
    int nClassPosition,
    object oCreature = OBJECT_SELF
);

Parameters

nClassPosition

値を得るクラス・テーブル中の列。範囲は1から3です。

oCreature

値を得るObject（デフォルト：OBJECT_INVALID）

Description

oCreatureのクラステーブルのnClassPositionで設定したポジションのレベルを整数値で返します。（例えば、oCreatureの「nClassPosition」番目のクラスレベルを返す）

oCreatureがクラステーブルを持たない場合（例、配置用オブジェクトやトリガ）または対象のポジションのクラスを持っていない場合（例、非マルチクラスのキャラクターの2番目のポジション）、関数はクラスを持っていないことを示す0を返します。

Version

1.22

Example

// プレイヤーの1番目のクラスレベルを返す
void main()
{
    int i;
    i = GetLevelByPosition(1,GetFirstPC());
    SendMessageToPC(GetFirstPC(),"Your first class is level == " + IntToString(i));
}

See Also

functions: | GetCharacterLevel | GetClassByPosition | GetHitDice | GetLevelByClass
categories: | Get Data from Creature Functions | Party Functions

author: GoLeM, editor: Kristian Markon, JP team: Rainie


Function - GetListenPatternNumber

Home > Reference > Functions > Conversation, Core AI, Henchmen/Familiars/Summoned, Party > GetListenPatternNumber

GetListenPatternNumber()

OnConversationで実行中のconversationパターンを調べます。

int GetListenPatternNumber();

Description

実行されたlistenパターンに記述された整数を返します。これは有効な整数値（-1より大きい）で表れされます。この関数はOnConversationの中でのみ使う事ができます。

listenパターンはSetListenPattern関数を使って設定し、それからObjectが聞いたかどうかをチェックします。関数SetListenPatternが数値10を持った文字列ATTACKを持っていたら、文字列ATTACKが叫ばされたとき(そのために、OnConversationのイベントは起きます)、関数GetListenPatternNumberは10を返すでしょう。

多数のパターンが一致した場合、最も高い数値が返されます。

Remarks

この関数は、NPCがグループでのアクション（例. 衛兵の攻撃）やその他のアクション（例. 追尾）を実行するのを支援する為に主に使われるように思います。

Version

1.22

Example

// NPCにこれらの機能を付与する
// ゲームに入る

// WOOTと叫ぶと、メッセージ「YEAH IT WORKS」を呼び出す

// OnSpawn
void main()
{
    SetListening(OBJECT_SELF,TRUE);
    SetListenPattern(OBJECT_SELF,"WOOT",2001);
}

// OnConversation
void main()
{
    int nMatch = GetListenPatternNumber();
    if(nMatch == 2001)
        SpeakString("YEAH IT WORKS");
}

See Also

functions: | GetMatchedSubstring | GetMatchedSubstringsCount | SetListening | SetListeningPatterns | SetListenPattern
categories: | Conversation Functions | Core AI Functions | Henchmen/Familiars/Summoned Functions | Party Functions

author: GoLeM, editor: Jochem van 't Hull, JP team: Rainie


Function - GetLocalArrayInt

Home > Reference > Functions > Local Variables > GetLocalArrayInt

GetLocalArrayInt(object, string, int)

オブジェクト上の配列から整数を得る動作をシミュレートする

int GetLocalArrayInt(
    object oidObject,
    string sVarName,
    int nVarNum
);

Parameters

oidObject

整数配列が保存されるオブジェクト

sVarName

配列の名称

nVarNum

値を検索する配列の位置、インデックス、添え字

Description

oidObjectに保管したsVarNameという整数型配列の中のnVarNumの位置にある値を返す

Remarks

nw_o0_itemmaker.nssの中の600行目にこの機能がある。

これは配列のシミュレーションであるが、１つのようにアクセスしたり、ループさせることもできる。

この配列シミュレーター関数で変数を作った場合、実際は"sVarNamen+VarNum"という名称の変数が作成されている。

GetLocalArrayInt(OBJECT_SELF, "MyArray", 1);

GetLocalInt （OBJECT_SELF,"MyArray1"）

上記２つの関数はまったく同じ動作をする。

仮に300までの配列を作ったとすると、事実上は300個の変数を作ったことになる。

この配列シミュレーター関数を使用すれば、乱雑さを軽減することができるかも知れない。

Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

functions: | GetLocalInt | SetLocalArrayInt
categories: | Local Variables Functions

author: John Shuell, JP team: ngtaicho


Function - GetLocalArrayString

Home > Reference > Functions > Local Variables > GetLocalArrayString

GetLocalArrayString(object, string, int)

オブジェクトに保存された文字列型配列の値を得る動作をシミュレートする

string GetLocalArrayString(
    object oidObject,
    string sVarName,
    int nVarNum
);

Parameters

oidObject

文字列型配列が保存されるオブジェクト

sVarName

配列の名称

nVarNum

値を検索する配列の位置、インデックス、添え字

Description

oidObjectに保管したsVarNameという文字列型配列の中のnVarNumの位置にある値を返す

Remarks

nw_o0_itemmaker.nssの中の563行目にこの機能がある。

これは配列のシミュレーションであるが、１つのようにアクセスしたり、ループさせることもできる。

この配列シミュレーター関数で変数を作った場合、実際は"sVarNamen + VarNum"という名称の変数が作成されている。

GetLocalArrayString(OBJECT_SELF, "MyArray", 1);

GetLocalString（OBJECT_SELF,"MyArray1"）

上記２つの関数はまったく同じ動作をする。

仮に300までの配列を作ったとすると、事実上は300個の変数を作ったことになる。

この配列シミュレーター関数を使用すれば、乱雑さを軽減することができるかも知れない。

Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

functions: | GetLocalString | SetLocalArrayString
categories: | Local Variables Functions

author: John Shuell, JP team: ngtaicho


Function - GetLocalFloat

Home > Reference > Functions > Get Data, Get Data from Creature, Get Data from Object, Local Variables > GetLocalFloat

GetLocalFloat(object, string)

オブジェクトに保存された浮動小数値を得る

float GetLocalFloat(
    object oObject,
    string sVarName
);

Parameters

oObject

Float型変数を保存しているオブジェクト。

sVarName

変数の名称

Description

oObjectに保存されたsVarNameという名称のFloat型変数が持っている値を返します。

oObjectはゲーム世界のどのオブジェクトでも指定できます。
変数名は理論上どのような文字列でも問題ありませんが、NW_*で始まるタグを使用するのは避けましょう。これらのタグはゲームシステムの深い部分で既に使用されている可能性があります。

変数sVarNameの値を調節する方法はSetLocalFloat関数を使用するのが主流なので、GetLocalFloat関数とSetLocalFloat関数はセットでよく使用されます。

エラーの場合、関数は0.0ｆを返します。

Remarks

変数名は理論上どんな名前でもよいが、誤動作の可能性を避けるため、"N"と"X"ではじまるものは避けた方が無難。

Version

1.22

Example

// "Data"に保管されたFloat型変数を返す
void main()
{
    float a = GetLocalFloat(OBJECT_SELF,"Data");
    SendMessageToPC(GetFirstPC(),FloatToString(a));
}

See Also

functions: | SetLocalFloat
categories: | Get Data Functions | Get Data from Creature Functions | Get Data from Object Functions | Local Variables Functions

author: GoLeM, editor: Kristian Markon, JP team: ngtaicho, NamaYake


Function - GetLocalInt

Home > Reference > Functions > Get Data, Get Data from Creature, Get Data from Object > GetLocalInt

GetLocalInt(object, string)

オブジェクトに保存されているint型変数の値を調べます。

int GetLocalInt(
    object oObject,
    string sVarName
);

Parameters

oObject

int型変数を保管しているオブジェクト。

sVarName

変数の名称。

Description

oObjectが保存しているsVarNameという名前のint型変数が持っている値を返します。

oObjectはゲーム世界のどのオブジェクトでも指定できます。

変数名は理論上どのような文字列でも問題ありませんが、NW_*で始まるタグを使用するのは避けましょう。これらのタグはゲームシステムの深い部分で既に使用されている可能性があります。

変数sVarNameの値を調節する方法はSetLocalInt関数を使用するのが主流なので、GetLocalIntt関数とSetLocalInt関数はセットでよく使用されます。

エラーの場合、関数は0を返します。

Version

1.22

Example

// "Data"という名前で保存されている整数を返します。
void main()
{
    int a = GetLocalInt(OBJECT_SELF,"Data");
    SendMessageToPC(GetFirstPC(), IntToString(a));
}

See Also

functions: | GetLocalArrayInt | SetLocalInt
categories: | Get Data Functions | Get Data from Creature Functions | Get Data from Object Functions

author: GoLeM, editor: Charles Feduke, additional contributor(s): Drake Coker, JP team: NamaYake


Function - GetLocalLocation

Home > Reference > Functions > Get Data, Get Data from Creature, Get Data from Object, Local Variables > GetLocalLocation

GetLocalLocation(object, string)

オブジェクトに保存されているlocation型変数のローカル変数の値を返す

location GetLocalLocation(
    object oObject,
    string sVarName
);

Parameters

oObject

location型変数が保管されているオブジェクト

sVarName

変数の名称

Description

oObjectが保存しているsVarNameという名前のlocation型変数が持っている値を返します。

oObjectはゲーム世界のどのオブジェクトでも指定できます。

変数名は理論上どのような文字列でも問題ありませんが、NW_*で始まるタグを使用するのは避けましょう。これらのタグはゲームシステムの深い部分で既に使用されている可能性があります。

変数sVarNameの値を調節する方法はSetLocalLocation関数を使用するのが主流なので、GetLocalLocation関数とSetLocalLocation関数はセットでよく使用されます。

この関数にはエラーはありません。

Remarks

変数名は理論上どんな名前でもよいが、誤動作の可能性を避けるため、"N"と"X"ではじまるものは避けた方が無難。

エラーの場合、無意味なデータが返るため、進行上エラーを引き起こす可能性があるので注意。

ロケーション変数を使って、元にいた位置にポータルで戻るといったことができそう。（ウェイポイントではなく）

Version

1.22

Example

// "Data"という名前の変数に保存されたlocationにPCを送ります。
void main()
{
    location a = GetLocalLocation(OBJECT_SELF,"Data");
    AssignCommand(GetFirstPC(),ActionMoveToLocation(a,TRUE));
}

See Also

functions: | SetLocalLocation
categories: | Get Data Functions | Get Data from Creature Functions | Get Data from Object Functions | Local Variables Functions

author: GoLeM, editor: Kristian Markon, JP team: NamaYake, ngtaicho


Function - GetLocalObject

Home > Reference > Functions > Get Data, Get Data from Creature, Get Data from Object, Local Variables > GetLocalObject

GetLocalObject(object, string)

オブジェクトに保存されているobject型変数の値を返す

object GetLocalObject(
    object oObject,
    string sVarName
);

Parameters

oObject

object型変数が保管されているオブジェクト

sVarName

変数の名称

Description

戻り値

オブジェクト情報

oObjectが保存しているsVarNameという名前のobject型変数が持っている値を返します。

oObjectはゲーム世界のどのオブジェクトでも指定できます。

変数名は理論上どのような文字列でも問題ありませんが、NW_*で始まるタグを使用するのは避けましょう。これらのタグはゲームシステムの深い部分で既に使用されている可能性があります。

変数sVarNameの値を調節する方法はSetLocalObject関数を使用するのが主流なので、GetLocalObject関数とSetLocalObject関数はセットでよく使用されます。

エラーの場合、関数はOBJECT_INVALIDを返します。

Remarks

変数名は理論上どんな名前でもよいが、誤動作の可能性を避けるため、"N"と"X"ではじまるものは避けた方が無難。

身包みはがされた装備を取り戻す、なんてことに使えそう。

Version

1.22

Example

// "Data"という名前で保存されたobjectにPCを移動させます。
void main()
{
    object a = GetLocalObject(OBJECT_SELF,"Data");
    AssignCommand(GetFirstPC(),ActionMoveToObject(a,TRUE,1.0));
}

See Also

functions: | SetLocalObject
categories: | Get Data Functions | Get Data from Creature Functions | Get Data from Object Functions | Local Variables Functions

author: GoLeM, editor: Kristian Markon, JP team: NamaYake, ngtaicho


Function - GetLocalPlotIntFromCharacter

Home > Reference > Functions > Module Specific > GetLocalPlotIntFromCharacter

GetLocalPlotIntFromCharacter(object)

クリーチャーの一般的なプロットフラグを取り出します。

int GetLocalPlotIntFromCharacter(
    object oNPC
);

Parameters

oNPC

プロットタグを取り出すクリーチャー。

Description

oNPCの"PLOT2Q4"という変数に格納されているプロットフラグを表す整数値 + GetTag(oNPC)の値を返します。

Remarks

nw_i0_2q4luskan.nssの30行目にあります。

Requirements

#include "nw_i0_2q4luskan"

Version

1.28

See Also

functions: | SetLocalPlotIntOnCharacter
categories: | Module Specific Functions

author: John Shuell, editor: Charles Feduke, JP team: katsu794


Function - GetLocalString

Home > Reference > Functions > Get Data, Get Data from Creature, Get Data from Object, Local Variables > GetLocalString

GetLocalString(object, string)

オブジェクトに保存されたstring型の文字列を得る

string GetLocalString(
    object oObject,
    string sVarName
);

Parameters

oObject

string型文字列を保管したオブジェクト

sVarName

変数の名称

Description

返り値

文字列

oObjectが保存しているsVarNameという名前のstring型変数が持っている値を返します。

oObjectはゲーム世界のどのオブジェクトでも指定できます。

変数名は理論上どのような文字列でも問題ありませんが、NW_*で始まるタグを使用するのは避けましょう。これらのタグはゲームシステムの深い部分で既に使用されている可能性があります。

変数sVarNameの値を調節する方法はSetLocalString関数を使用するのが主流なので、GetLocalString関数とSetLocalString関数はセットでよく使用されます。

エラーの場合、関数は" "(null値)を返します。

Remarks

変数名は理論上どんな名前でもよいが、誤動作の可能性を避けるため、"N"と"X"ではじまるものは避けた方が無難。

Version

1.22

Example

// "Data"という名前で保存されていたString型文字列を返します。
void main()
{
    string a = GetLocalString(OBJECT_SELF,"Data");
    SendMessageToPC(GetFirstPC(),a);
}

See Also

functions: | GetLocalArrayString | SetLocalString
categories: | Get Data Functions | Get Data from Creature Functions | Get Data from Object Functions | Local Variables Functions

author: GoLeM, editor: Kristian Markon, JP team: NamaYake, ngtaicho


Function - GetLocation

Home > Reference > Functions > Get Data, Targeting > GetLocation

GetLocation(object)

オブジェクトの位置を調べます。

location GetLocation(
    object oObject
);

Parameters

oObject

位置を調べたいオブジェクト。

Description

オブジェクトがいる位置を返します。オブジェクトはいかなるobjectでも指定できます。

Version

1.22

Example

// NPCのいる位置に対して、プレイヤーに（実際には視覚エフェクトだけの）ファイアボールの呪文を唱えさせます。
void main()
{
    location l = GetLocation(GetObjectByTag("NPC"));
    AssignCommand(GetFirstPC(),
        ActionCastFakeSpellAtLocation(SPELL_FIREBALL, l));
}

See Also

functions: | GetAreaFromLocation | GetStartingLocation | Location
categories: | Get Data Functions | Targeting Functions

author: GoLeM, editor: Charles Feduke, JP team: NamaYake


Function - GetLocked

Home > Reference > Functions > Get Data, Get Data from Object > GetLocked

GetLocked(object)

オブジェクトが施錠されているかどうかを調べます。

int GetLocked(
    object oTarget
);

Parameters

oTarget

チェックするオブジェクト

Description

oTargetが施錠されているかどうかでTRUEかFALSEの値を返します。

oTargetが施錠されていればTRUEを返します。

oTargetが施錠されていなければFALSEを返します。

エラーの値を返すことはありません。

Version

1.22

Example

// "chest"が施錠されているかどうかをチェックします。
void main()
{
    object a;
    a = GetObjectByTag("chest");
    if(GetLocked(a))    //Is the chest locked
        SendMessageToPC(GetFirstPC(),"This is Locked");
    if(!GetLocked(a))   //Is the chest Unlocked
        SendMessageToPC(GetFirstPC(),"This is Unlocked");
}

See Also

functions: | GetLastUnlocked | GetLockedObject | GetLockKeyRequired | GetLockLockable
categories: | Get Data Functions | Get Data from Object Functions

author: GoLeM, editor: Kristian Markon, JP team: NamaYake


Function - GetLockedObject

Home > Reference > Functions > Get Data, Henchmen/Familiars/Summoned > GetLockedObject

GetLockedObject(object)

最大10個のオブジェクトの中から、施錠されている入れ物のオブジェクトを探し出します。

object GetLockedObject(
    object oMaster
);

Parameters

oMaster

捜索の中心となるオブジェクト。

Description

同心円状の１０オブジェクト以内にある、施錠されている入れ物状のオブジェクトを返します。

同心円状の１０オブジェクト以内に施錠されているオブジェクトがなかった場合、関数はOBJECT_INBALIDを返します。

Requirements

#include "nw_i0_generic"

Version

1.22

Example

// 10オブジェクト以内に施錠されているオブジェクトがあるか探します。
#include "nw_i0_generic"
void main()
{
    object a = GetLockedObject(OBJECT_SELF);
    if(a != OBJECT_INVALID)
        SendMessageToPC(GetFirstPC(),"YEAH I FOUND ONE");
}

See Also

functions: | GetLocked | GetLockKeyRequired | GetLockLockable
categories: | Get Data Functions | Henchmen/Familiars/Summoned Functions

author: GoLeM, editor: John Shuell, JP team: NamaYake


Function - GetLockKeyRequired

Home > Reference > Functions > Action on Object, Get Data, Get Data from Object > GetLockKeyRequired

GetLockKeyRequired(object)

オブジェクトを開錠するために固有の鍵が必要かどうかをチェックする。

int GetLockKeyRequired(
    object oObject
);

Parameters

oObject

チェックするオブジェクト。

Description

オブジェクトを開錠するために固有の鍵が必要かどうかをTRUEかFALSEの値で返します。

オブジェクトを開錠するために固有の鍵が必要な場合は、TRUEを返します。

オブジェクトを開錠するために固有の鍵が必要ない場合は、FALSEを返します。

エラーの値を返すことはありません。

Version

1.22

Example

// ドアを開錠するために、固有の鍵が必要かどうかを調べます。
void main()
{
    object a;
    a = GetObjectByTag("door");
    if(GetLockKeyRequired(a))    //鍵が必要？
        SendMessageToPC(GetFirstPC(),"鍵が必要です。");
}

See Also

functions: | GetLocked | GetLockedObject | GetLockKeyTag | GetLockLockable
categories: | Action on Object Functions | Get Data Functions | Get Data from Object Functions

author: GoLeM, editor: Kristian Markon, JP team: NamaYake


Function - GetLockKeyTag

Home > Reference > Functions > Get Data, Get Data from Object > GetLockKeyTag

GetLockKeyTag(object)

施錠を開くための鍵のタグを調べます。

string GetLockKeyTag(
    object oObject
);

Parameters

oObject

対象となる施錠されたオブジェクト。

Description

施錠されたoObjectを開くための鍵のタグをstring型文字列で返します。

Remarks

以前、この関数は壊れていると報告されていましたが、現在では修正されています。

Version

1.30

See Also

functions: | GetLockKeyRequired | GetLockLockable | GetTrapKeyTag
categories: | Get Data Functions | Get Data from Object Functions

author: GoLeM, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, NamaYake


Function - GetLockLockable

Home > Reference > Functions > Get Data, Get Data from Object > GetLockLockable

GetLockLockable(object)

オブジェクトが施錠可能かどうかを調べます。

int GetLockLockable(
    object oObject
);

Parameters

oObject

対象のオブジェクト。

Description

oObjectが施錠可能かどうかを、TRUEかFALES値で返します。

施錠可能な場合はTRUEを返します。

施錠不可能な場合はFALSEを返します。

この関数はエラーの値を返すことはありません。

Version

1.22

Example

// オブジェクトが施錠可能かどうかを調べます。
void main()
{
    object a;
    a = GetObjectByTag("door");
    if(GetLockLockable(a))    // 施錠可能か？
        SendMessageToPC(GetFirstPC(),"これは施錠可能です。");
}

See Also

functions: | GetLocked | GetLockedObject | GetLockKeyRequired | GetLockKeyTag
categories: | Get Data Functions | Get Data from Object Functions

author: GoLeM, editor: Kristian Markon, JP team: NamaYake


Function - GetLockLockDC

Home > Reference > Functions > Get Data, Get Data from Object > GetLockLockDC

GetLockLockDC(object)

施錠に必要なDCを調べる。

int GetLockLockDC(
    object oObject
);

Parameters

oObject

施錠するオブジェクト。

Description

施錠に必要なDCを、int型整数で返します。

オブジェクトが施錠するためのDCを持っていなかった場合、関数は0を返します。

Version

1.22

Example

// "door"の施錠DCを調べます。
void main()
{
    object a;
    a = GetObjectByTag("door");
    SendMessageToPC(GetFirstPC(),IntToString(GetLockLockDC(a)));
}

See Also

functions: | GetLockUnlockDC
categories: | Get Data Functions | Get Data from Object Functions

author: GoLeM, editor: Kristian Markon, JP team: NamaYake


Function - GetLockUnlockDC

Home > Reference > Functions > Get Data, Get Data from Object > GetLockUnlockDC

GetLockUnlockDC(object)

開錠に必要なDCを調べます。

int GetLockUnlockDC(
    object oObject
);

Parameters

oObject

施錠されているオブジェクト。

Description

開錠に必要なDCを、int型整数で返します。

オブジェクトが開錠のためのDCを持っていない場合、関数は0を返します。

Version

1.22

Example

// "door"の開錠のためのDCを調べます。
void main()
{
    object a;
    a = GetObjectByTag("door");
    SendMessageToPC(GetFirstPC(),IntToString(GetLockUnlockDC(a)));
}

See Also

functions: | GetLockLockDC
categories: | Get Data Functions | Get Data from Object Functions

author: GoLeM, editor: Kristian Markon, JP team: NamaYake


Function - GetMachineState

Home > Reference > Functions > Module Specific > GetMachineState

GetMachineState(int)

あるレバーの状態を返します。

int GetMachineState(
    int nCondition
);

Parameters

nCondition

TRUEを返すためにはTRUEとしなければなりません。

Description

タグが"2Q4_ColmarrEng"であるオブジェクト上に"NW_2Q4_COLMARR_MACHINE_STATE_LEVER"というローカル整数値が存在し、かつnCondition変数がTRUEである場合、TRUEを返します。

Remarks

nw_i0_2q4luskan.nssの40行目にあります。

Requirements

#include "nw_i0_2q4luskan"

Version

1.22

See Also

functions: | SetMachineState
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetMaster

Home > Reference > Functions > Get Data from Creature, Henchmen/Familiars/Summoned > GetMaster

GetMaster(object)

クリーチャーの操作者を調べます。

object GetMaster(
    object oAssociate = OBJECT_SELF
);

Parameters

oAssociate

主人を調べたいクリーチャー（デフォルト：OBJECT_SELF）

Description

指定したクリーチャー（使い魔）の主人のPC、またはクリーチャーを操作しているDMを返します。

Version

1.28

See Also

functions: | GetAssociate | GetAssociateState | GetIsDM | GetIsDMPossessed | GetIsPC | SetAssociateState | SetFormerMaster
categories: | Get Data from Creature Functions | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, additional contributor(s): Jochem van 't Hull, JP team: Rainie


Function - GetMatchCompatibility

Home > Reference > Functions > Core AI Talent, Talents/Skills/Feats > GetMatchCompatibility

GetMatchCompatibility(talent, string, int)

要求される方法で選択されるクラスから、クリーチャーが特殊能力を使用できるかどうかを調べます。

int GetMatchCompatibility(
    talent tUse,
    string sClass,
    int nType
);

Parameters

tUse

調べる特殊能力。

sClass

調べるクラス。

nType

使用する方法。(変数)NW_TALENT_*

Description

特殊能力tUseが、入力されるsClassに対するNPCの保護に有効であるかどうかによって、ブーリアン値true/falseを返します。

ランダムな行動を作り出すために使用されます。

Remarks

通常は、GetMatchCompatibility()関数よりも、NPCが持っている特殊能力だけを返すことができるGetCreatureTalentRandom()関数の方が好んで呼ばれます。GetMatchCompatibility関数は、特殊能力が特定のクラスに対して有効かどうかを調べます。

Requirements

#include "NW_I0_GENERIC"

Version

1.26

Example

// NPCのAIコード(すべてのケースについてはテストされていません。）
// いくつかのコードはnw_i0_genericから取ってきていますが、それを自分の手柄にしてはいません。
#include "nw_i0_generic"
void main()
{
    talent tUse;
    struct sEnemies sCount = DetermineEnemies();
    int bValid = FALSE;
    int nCnt;
    string sClass = GetMostDangerousClass(sCount);

    while(GetIsTalentValid(tUse) && nCnt < 10)
    {
        tUse = GetCreatureTalentRandom(TALENT_CATEGORY_BENEFICIAL_PROTECTION_SELF);
        if(GetIsTalentValid(tUse) && GetMatchCompatibility(tUse, sClass, NW_TALENT_PROTECT))
        {
            bValid = TRUE;
            nCnt = 11;
        }
        nCnt++;
    }

    if(bValid == TRUE)
        SendMessageToPC(GetFirstPC(),"NPC CAN USE TALENT");
}

See Also

functions: | GetMostDangerousClass | MatchCombatProtections | MatchElementalProtections | MatchSpellProtections | TalentAdvancedProtectSelf
categories: | Core AI Talent Functions | Talents/Skills/Feats Functions

author: GoLeM, editor: Charles Feduke, additional contributor(s): Genji, JP team: katsu794


Function - GetMatchedSubstring

Home > Reference > Functions > Conversation, Henchmen/Familiars/Summoned > GetMatchedSubstring

GetMatchedSubstring(int)

ListenPatternで指定された文字列と一致した文字列を返します。

string GetMatchedSubstring(
    int nString
);

Parameters

nString

一致した文字列のインデックス。0から始まります。

Description

ListenPatternで指定された文字列と一致した文字列を返します。

一致した文字列はnStringでインデックス化されて返されます（後述）。

この関数はSetListenPatternで文字列を指定する際ワイルドカードで指定された場合に、OnConversationでのみ有効となります。

（例えば：SetListenPattern(OBJECT_SELF, "FOO**", 500)では"FOO", "FOOTER" "FOOBAR, それに"FOOT"が一致します。

文字列は大文字・小文字の区別はなく"FoOBaR""fooBAR"も同様に一致します。）

例として、SetListenPattern(OBJECT_SELF, "FOO**", 500)と指定し、NPCは”foobar”と聞いたとします：

まず文字列が一致しているかどうか比較されます。

GetListenPatternNumber()で500が返されます。

次に一致した文字列が決定されます。

GetMatichedSubstringsCount()で2が返されます。

インデックスは0から始まります（Cの配列と同様です）。

例えば：

GetMatchedSubstring(0) で "foo" を返します
GetMatchedSubstring(1) で "bar" を返します

また他の例として、SetListenPattern(OBJECT_SELF, "**foo**bar**", 500)と指定し、NPCが”foofoofoobarbarbar”と聞いたとします：

GetMatchedSubstring(0) で "" を返します
GetMatchedSubstring(1) で "foo" を返します
GetMatchedSubstring(2) で "foofoo" を返します
GetMatchedSubstring(3) で "bar" を返します
GetMatchedSubstring(4) で "barbar" を返します

Remarks

使い方を教えてくださったTemple氏に感謝します。

NWCJに登録されている「謎かけ墓地」で多く使われています（sPassword = GetMatchedSubstring(0);として答えを求めています）。

Version

1.22

Example

// このスクリプトではNPCは「woot」という言葉を聞いたら返答します。
// OnSpawnに入れます
void main()
{
    SetListening(OBJECT_SELF,TRUE);
    SetListenPattern(OBJECT_SELF,"Woot**",2001);
}

// OnConversationに入れます
void main()
{
    int i = 0;
    int nMatch = GetListenPatternNumber();
    if(nMatch == 2001)
        SpeakString("YEAH IT WORKS");

    nMatch = GetMatchedSubstringsCount();
    SpeakString(IntToString(nMatch));
    while(i<nMatch)
    {
        SpeakString(IntToString(i) + ". " + GetMatchedSubstring(i));
        i++;
    }
}

See Also

functions: | GetListenPatternNumber | GetMatchedSubstringsCount | SetListening | SetListeningPatterns | SetListenPattern
categories: | Conversation Functions | Henchmen/Familiars/Summoned Functions
events: | OnConversation Event

author: GoLeM, editor: Kristian Markon, JP team: geshi


Function - GetMatchedSubstringsCount

Home > Reference > Functions > Conversation, Henchmen/Familiars/Summoned > GetMatchedSubstringsCount

GetMatchedSubstringsCount()

ListenPatternで指定した文字列と一致した文字列の数を返します。

int GetMatchedSubstringsCount();

Description

SetListenPatternでワイルドカードで指定した文字列と一致した文字列の数を返します。

返される値は有効な整数値です；一致したものがない場合は1を返します。

このファンクションはOnConversationでのみ有効です。

例えば、SetListenPattern(OBJECT_SELF, "FOO**", 500)では"FOO", "FOOTER" "FOOBAR, それに"FOOT"が一致します。

文字列は大文字・小文字の区別はなく"FoOBaR""fooBAR"も同様に一致します。）

この場合、NPCが"foobar"と聞くと、GetMatchedSubstringsCountはサブ文字列を調べ、2を返します（"foo"とbar"）。そして返された(2)でGetMatchedSubstringを使って一致したサブ文字列を得ることが出来ます。

Remarks

使い方を教えてくださったTemple氏に感謝します。

Version

1.22

Example

// このスクリプトはNPCがwootと聞いたら返答するようにします
// OnSpawn
void main()
{
    SetListening(OBJECT_SELF,TRUE);
    SetListenPattern(OBJECT_SELF,"Woot**",2001);
}

// OnConversation
void main()
{
    int i = 0;
    int nMatch = GetListenPatternNumber();
    if(nMatch == 2001)
        SpeakString("YEAH IT WORKS");

    nMatch = GetMatchedSubstringsCount();
    SpeakString(IntToString(nMatch));
    while(i<nMatch)
    {
        SpeakString(IntToString(i) + ". " + GetMatchedSubstring(i));
        i++;
    }
}

See Also

functions: | GetListenPatternNumber | GetMatchedSubstring | SetListening | SetListeningPatterns | SetListenPattern
categories: | Conversation Functions | Henchmen/Familiars/Summoned Functions
events: | OnConversation Event

author: GoLeM, editor: Kristian Markon, JP team: geshi


Function - GetMaxHitPoints

Home > Reference > Functions > Get Data from Creature > GetMaxHitPoints

GetMaxHitPoints(object)

objectの最大ヒットポイント（HP）を得ます。

int GetMaxHitPoints(
    object oObject = OBJECT_SELF
);

Parameters

oObject

最大HPを調べたいObject(デフォルト：OBJECT_SELF)

Description

objectの総合ヒットポイント（HP）を示す整数値を返します。エラーが生じた場合、この関数は0を返します（例：objectがHPを持たない場合）。呪文のエフェクトや類似した道具によって達しているヒットポイントは数えられません。例えば、PCが呪文ヴァーチューを使用し、HPが1増えていたとしてもこれは計算されません。（例：通常が52/52のHPで、ヴァーチュー使用で53/52になったとしても、返される値は52です。）

Version

1.27

Example

// PCの最大HPを調べ、最初のPCに伝える
void main()
{
    int i = GetMaxHitPoints(GetFirstPC());
    SendMessageToPC(GetFirstPC(),IntToString(i));
}

See Also

functions: | GetCurrentHitPoints | GetPercentageHPLoss | GetTotalDamageDealt
categories: | Get Data from Creature Functions

author: GoLeM, editor: Charles Feduke, JP team: Rainie


Function - GetMetaMagicFeat

Home > Reference > Functions > Get Data from Creature, Spell Casting Effects, Spells > GetMetaMagicFeat

GetMetaMagicFeat()

最後に使われた呪文に使われているメタマジックのタイプを調べます。

int GetMetaMagicFeat();

Description

最後に使われた呪文に使われているMETAMAGIC_*定数を返します。

この値は別の呪文が詠唱されるまで同じ値として残ります。

詠唱者が無効なオブジェクトであれば-1の値を返します。

Version

1.22

Example

// OnHeartbeatに設定。あなたがメタマジックを使うとそのメッセージをあなたに送ります
void main()
{
    if(GetMetaMagicFeat() == METAMAGIC_ANY)
        SendMessageToPC(OBJECT_SELF,"YOU USED METAMAGIC ON LAST SPELL");

}

See Also

categories: | Get Data from Creature Functions | Spell Casting Effects Functions | Spells Functions
constants: | METAMAGIC_* Constants

author: GoLeM, editor: Kristian Markon, JP team: Redondo


Function - GetModule

Home > Reference > Functions > Module > GetModule

GetModule()

モジュールを表すオブジェクトを調べます。

object GetModule();

Description

モジュールオブジェクトを返します。エラーがあればOBJECT_INVALIDを返します。グローバル（モジュールレベルの）変数を作るときにGetLocal*やSetLocal*関数と一緒に使用されます。

Remarks

もし、OBJECT_INVALIDが返されたときはゲームがクラッシュしてしまったのかどうか？これを調べることはできませんでした。

Version

1.22

Example

// モジュールのタグを最初のPCへ送ります。
void main()
{
    SendMessageToPC(GetFirstPC(),GetTag(GetModule()));
}

See Also

functions: | GetModuleName
categories: | Module Functions

author: GoLeM, editor: Charles Feduke, JP team: Redondo


Function - GetModuleItemAcquired

Home > Reference > Functions > Inventory, Module > GetModuleItemAcquired

GetModuleItemAcquired()

OnAcquiredItemイベントで求められるアイテムを調べます。

object GetModuleItemAcquired();

Description

OnAcquiredItemイベントで求められるオブジェクトを返します。

エラー時には、関数はOBJECT_INVALIDを返します。これは通常起こってはいけませんが、しかしあなたがイベントを手動で起こすことは可能です。

Version

1.22

Example

// OnAcquiredItemイベントで求められるアイテムの名前を調べます。
void main()
{
    object a = GetModuleItemAcquired();
    if(a == OBJECT_INVALID)
        SendMessageToPC(GetFirstPC(),"OOPS A CRASH ME THINKS");
    else
        SendMessageToPC(GetFirstPC(),GetTag(a));
}

See Also

functions: | GetModuleItemAcquiredFrom | GetModuleItemLost | GetModuleItemLostBy
categories: | Inventory Functions | Module Functions
events: | OnAcquireItem Event | OnUnAcquireItem Event

author: GoLeM, editor: Kristian Markon, JP team: NamaYake


Function - GetModuleItemAcquiredBy

Home > Reference > Functions > Inventory, Module > GetModuleItemAcquiredBy

GetModuleItemAcquiredBy()

モジュールで指定されたアイテムを獲得したオブジェクトを調べます。

object GetModuleItemAcquiredBy();

Description

モジュールで指定されたアイテムを獲得したオブジェクト（クリーチャーかアイテム、配置物）を返します。

これはOnAcquireItemイベントで指示されたスクリプトでのみ働きます。

Version

1.30

See Also

functions: | GetModuleItemAcquiredFrom | GetModuleItemAcquiredStackSize
categories: | Inventory Functions | Module Functions
events: | OnAcquireItem Event

author: Charles Feduke, JP team: NamaYake


Function - GetModuleItemAcquiredFrom

Home > Reference > Functions > Inventory, Module > GetModuleItemAcquiredFrom

GetModuleItemAcquiredFrom()

OnAcquiredItemイベントで指定されたアイテムを最後に所持していたオーナーを調べます。

object GetModuleItemAcquiredFrom();

Description

OnAcquiredItemイベントで指定されたアイテムを最後に所持していたオブジェクトを（たとえアイテムが受渡しの最中で地面に置かれていても）返します。

Remarks

GetModuleItemAcquiredがエラーコンポーネントを持っていると、この関数の実行も失敗します。

OnAcquiredItemイベントを手動で起こすとこの関数におけるエラーを起こすことがあることに注意してください。

Version

1.29

Example

// OnAcquiredItemイベントで指定されたアイテムを入手したり手放したりした
// クリーチャーの名前を調べます。
void main()
{
    object a = GetModuleItemAcquired();
    if(a == OBJECT_INVALID)
        SendMessageToPC(GetFirstPC(),"OOPS A CRASH ME THINKS");
    else {
        SendMessageToPC(GetFirstPC(),GetTag(a));
        a = GetModuleItemAcquiredFrom();
        if(a == OBJECT_INVALID)
            SendMessageToPC(GetFirstPC(),"And was picked up off the ground");
        else
            SendMessageToPC(GetFirstPC(),"And was taken off " + GetTag(a));
        }
}

See Also

functions: | GetModuleItemAcquired | GetModuleItemAcquiredBy | GetModuleItemLost | GetModuleItemLostBy
categories: | Inventory Functions | Module Functions
events: | OnAcquireItem Event | OnUnAcquireItem Event

author: GoLeM, editor: Charles Feduke, additional contributor(s): Eric Zaat, JP team: NamaYake


Function - GetModuleItemAcquiredStackSize

Home > Reference > Functions > Inventory, Module > GetModuleItemAcquiredStackSize

GetModuleItemAcquiredStackSize()

モジュールで指定されたacqureidアイテムのスタックサイズを調べます。

int GetModuleItemAcquiredStackSize();

Description

この関数はOnItemAcquiredイベントで指定されたスクリプトの中でのみ働きます。

モジュールで指定されたacqureidアイテムのスタックサイズを返します。

Version

1.30

See Also

functions: | GetItemStackSize | GetModuleItemAcquiredBy
categories: | Inventory Functions | Module Functions
events: | OnAcquireItem Event

author: Charles Feduke, JP team: NamaYake


Function - GetModuleItemLost

Home > Reference > Functions > Inventory, Module > GetModuleItemLost

GetModuleItemLost()

OnUnAcquiredItemイベントで指定され落としたオブジェクトを調べます。

object GetModuleItemLost();

Description

OnUnAcquieredItemイベントで指定され失ったオブジェクトを返します。

エラーの場合関数はOBJECT_INVALIDを返します。イベントはアイテムによって引き起こされるので通常このようなことは起こりません。しかしあなたが手動でイベントを起こす場合にはエラーに注意してください。

Version

1.22

Example

// OnUnAcquiredItemイベントで指定され最後に失ったオブジェクトを調べます。
void main()
{
    object a = GetModuleItemLost();
    if(a == OBJECT_INVALID)
        SendMessageToPC(GetFirstPC(),"OOPS A CRASH ME THINKS");
    else
        SendMessageToPC(GetFirstPC(),GetTag(a));
}

See Also

functions: | GetModuleItemAcquired | GetModuleItemAcquiredFrom | GetModuleItemLostBy
categories: | Inventory Functions | Module Functions
events: | OnAcquireItem Event | OnUnAcquireItem Event

author: GoLeM, editor: Kristian Markon, JP team: NamaYake


Function - GetModuleItemLostBy

Home > Reference > Functions > Inventory, Module > GetModuleItemLostBy

GetModuleItemLostBy()

OnUnAcquieredItemイベントで指定されたアイテムを失ったクリーチャーを調べます。

object GetModuleItemLostBy();

Description

OnUnAquieredItemイベントを引き起こすアイテムを落としたオブジェクトを返します。

エラーのときはOBJECT_INVALIDを返します。これはアイテムを落とすことによって引き起こされるので通常はエラーは起こりませんが、あなたが手動でイベントを起こす場合はこのエラーに注意してください。

Remarks

OnUnacquireItemイベントはDestroyObject関数で破壊したオブジェクトでも発動することはご存知ですよね？

この場合関数で返されるオブジェクトはOBJECT_INVALIDとはなりません。しかしそれはどんな使用法も正確に機能しませんし、既存のオブジェクトではありません。

OBJECT_INVALIDをチェックするなら代わりに、ユーザーは常にGetIsObjectValid関数（OBJECT_INVALIDならFALSEを返す）を使用するべきです。

Version

1.28

Example

// アイテムを落としたクリーチャーの名前を調べます。
void main()
{
    object a = GetModuleItemLost();
    if(a == OBJECT_INVALID)
        SendMessageToPC(GetFirstPC(),"OOPS A CRASH ME THINKS");
    else {
        SendMessageToPC(GetFirstPC(),GetTag(a));
        a = GetModuleItemLostBy();
        if(a == OBJECT_INVALID)
            SendMessageToPC(GetFirstPC(),"OOPS A CRASH ME THINKS");
        else
            SendMessageToPC(GetFirstPC(),"And was dropped by " + GetTag(a));
        }
}

See Also

functions: | GetModuleItemAcquired | GetModuleItemAcquiredFrom | GetModuleItemLost
categories: | Inventory Functions | Module Functions
events: | OnAcquireItem Event | OnUnAcquireItem Event

author: GoLeM, editor: Charles Feduke, additional contributor(s): Charles Mead, Timothy Dang, Matthew Green, David Kondrad, JP team: NamaYake


Function - GetModuleName

Home > Reference > Functions > Module > GetModuleName

GetModuleName()

モジュール名を調べます。

string GetModuleName();

Description

サーバの言語でモジュール名（文字）を返します。もしサーバの言語が禁止されていたら“”を返します。

Version

1.22

Example

// モジュール名を得ます
void main()
{
    SendMessageToPC(GetFirstPC(),GetModuleName());
}

See Also

functions: | GetModule
categories: | Module Functions

author: GoLeM, editor: Kristian Markon, JP team: Redondo


Function - GetMostDangerousClass

Home > Reference > Functions > Combat Information, Core AI, Targeting > GetMostDangerousClass

GetMostDangerousClass(struct)

NPCに対する最も脅威なグループタイプを決定するために、４つの基本形を使用します。

string GetMostDangerousClass(
    struct sEnemiesCount
);

Parameters

sEnemiesCount

４つの基本的なクラスグループの分類とそれぞれの全体レベルを含んだ構造体。

Description

全体レベルの合計が最も大きな、４つの基本クラスグループの１つを表す文字列を返します。ファイターグループは、残りのクラスグループよりも少し脅威的であると考えられ、わずかな優位が与えられます。

Remarks

以下の４つの候補クラスから１つを返します。
FIGHTER
MAGE
CLERIC
MONSTER

この関数は、４つの基本クラスのそれぞれのsEnemies構造体内の合計レベル数を比較し、最もレベルが高いものを返すでしょう。ファイターグループには、決定が行われる前にレベルに3%の増加量が与えられます。

Version

1.22

See Also

functions: | GetMatchCompatibility | TalentAdvancedProtectSelf
categories: | Combat Information Functions | Core AI Functions | Targeting Functions

author: John Shuell, JP team: katsu794


Function - GetMovementRate

Home > Reference > Functions > Get Data from Creature > GetMovementRate

GetMovementRate(object)

指定クリーチャーの移動速度を返します。

int GetMovementRate(
    object oCreature
);

Parameters

oCreature

移動速度率を返します。

Description

PCとNPCの移動率を返します。使用される戻り値は以下の通りです。

0 = PCの移動速度またはoCreatureが無効

1 = 移動不可

2 = 大変遅い

3 = 遅い

4 = 通常

5 = 速い

6 = 大変速い

7 = クリーチャーデフォルト（appearance.2daで定義されている）

8 = DMの移動速度

Remarks

PCが歩いているか走っているかを調べる事はできません。PCは常に0の値が返されます。

Version

1.22

See Also

categories: Get Data from Creature Functions

author: Drake Coker, JP team: Rainie


Function - GetMyArea

Home > Reference > Functions > Area > GetMyArea

GetMyArea(object)

あるオブジェクトのエリアに関するタグを調べます。

string GetMyArea(
    object oThing = OBJECT_SELF
);

Parameters

oThing

エリアタグを調べるオブジェクト (デフォルト: OBJECT_SELF)

Description

oThingが含まれるエリアのタグ文字を返します。

Requirements

#include "nw_i0_henchman"

Version

1.29

See Also

categories: Area Functions

author: Charles Feduke, JP team: Redondo


Function - GetMyMaster

Home > Reference > Functions > Miscellaneous > GetMyMaster

GetMyMaster()

呼出objectに一番近いプレイヤーキャラクターを得ます。

object GetMyMaster();

Description

この関数を使用したobjectから一番近くのPCを返します。

Remarks

この関数はnw_i0_plot.nssの157行目で見つかります。

この関数が単に一番近いPCを返すというのは正しくないかもしれません。ヘンチマン、召還クリーチャーや使い魔には何もしません。実際、それは公式キャンペーンの中でBioWareによって使用されません。プログラムの読み取りを惑わすことに注意して使用してください。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Miscellaneous Functions

author: John Shuell, JP team: Rainie


Function - GetName

Home > Reference > Functions > Get Data from Object > GetName

GetName(object)

オブジェクトの名前を取り出します。

string GetName(
    object oObject
);

Parameters

oObject

名前を捜すオブジェクト。

Description

oObjectの姓名を返します。

クリーチャーの場合、連結された一つの文字列として姓名を一緒に返します。

Remarks

GetName()関数は、モジュールとエリアの名前を返します。(1.25以前では、空の文字列を返しました。)

Version

1.25

See Also

categories: Get Data from Object Functions

author: Kristian Markon, editor: Charles Feduke, additional contributor(s): Simon Damberger, JP team: katsu794


Function - GetNearestCreature

Home > Reference > Functions > Get Data from Creature > GetNearestCreature

GetNearestCreature(int, int, object, int, int, int, int, int)

対象のオブジェクトに対して最も近いクリーチャーを決定します。

object GetNearestCreature(
    int nFirstCriteriaType,
    int nFirstCriteriaValue,
    object oTarget = OBJECT_SELF,
    int nNth = 1,
    int nSecondCriteriaType = -1,
    int nSecondCriteriaValue = -1,
    int nThirdCriteriaType = -1,
    int nThirdCriteriaValue = -1
);

Parameters

nFirstCriteriaType

CREATURE_TYPE_* (詳細については、下のdescriptionを見てください)

nFirstCriteriaValue

CLASS_TYPE_*, SPELL_*, PERCEPTION_*, PLAYER_CHAR_IS_PC, PLAYER_CHAR_NOT_PC , RACIAL_TYPE_* , REPUTATION_TYPE_*, TRUE OR FALSE (値はnFirstCriteriaTypeに依存します。詳細については、下のfunction descriptionを見てください)

oTarget

我々は、oTargetに一番近い指定されたクリーチャーを見つけようとしています。(デフォルト: OBJECT_SELF)

nNth

一番近いクリーチャーを見つける必要がない場合、N番目に近いクリーチャーを見つけることができます。(デフォルト: 1)

nSecondCriteriaType

探しているクリーチャーのタイプをさらに詳しく指定するために、nFirstCriteriaTypeと同じ方法で使用されます。(デフォルト: -1)

nSecondCriteriaValue

探しているクリーチャーのタイプをさらに詳しく指定するために、nFirstCriteriaValueと同じ方法で使用されます。(デフォルト: -1)

nThirdCriteriaType

探しているクリーチャーのタイプをさらに詳しく指定するために、nFirstCriteriaTypeと同じ方法で使用されます。(デフォルト: -1)

nThirdCriteriaValue

探しているクリーチャーのタイプをさらに詳しく指定するために、nFirstCriteriaValueと同じ方法で使用されます。(デフォルト: -1)

Description

指定されたすべての基準を条件とするoTargetに最も近いクリーチャーを得ます。

エラー時には、OBJECT_INVALIDを返します。

この関数は、与えられた基準にマッチするN番目(デフォルトは1、または最も近い)に近いクリーチャーを選択します。デフォルトでは、oTARGETはOBJECT_SELFと等しいですが、別のオブジェクトを設定するかもしれません。最初の基準セット(nFirstCriteriaType と nFirstCriteriaValue)は指定する必要があります。２番目と３番目の基準セットはオプションです。

基準パラメーターは、タイプと値の対になっており、あらかじめ定められたグループ値のみ受け付けます。例えば、nFirstCriteriaTypeの値がCREATURE_TYPE_CLASSの場合、nFirstCriteriaValueはCLASS_TYPE_*の形式をとる必要があります。よってこの例の場合、パラメーター(CREATURE_TYPE_CLASS, CLASS_TYPE_CLERIC)とすると、クラスがクレリックである最も近いクリーチャーを返すでしょう。定められたタイプ/値のペアの完全なリストについては、descriptionの終わりを見てください。

２番目と３番目のタイプ/値の基準ペアを用いることで、探しているクリーチャーの型をさらに詳しく指定することができます。例えば、(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, CREATURE_TYPE_IS_ALIVE, TRUE, CREATURE_TYPE_RACIAL_TYPE, RACIAL_TYPE_DWARF)と指定すると、まず始めの条件としてプレイヤーキャラクターであり、２番目の条件として生きていて、３番目の条件としてドワーフである最も近いクリーチャーを返すでしょう。

以下のリストは、使用されそうな基準タイプとそれらのタイプに関連づけられた値を表しています。

CREATURE_TYPE_CLASS CLASS_TYPE_*
CREATURE_TYPE_DOES_NOT_HAVE_SPELL_EFFECT SPELL_*
CREATURE_TYPE_HAS_SPELL_EFFECT SPELL_*
CREATURE_TYPE_IS_ALIVE TRUE OR FALSE
CREATURE_TYPE_PERCEPTION PERCEPTION_*
CREATURE_TYPE_PLAYER_CHAR PLAYER_CHAR_IS_PC OR PLAYER_CHAR_NOT_PC
CREATURE_TYPE_RACIAL_TYPE RACIAL_TYPE_*
CREATURE_TYPE_REPUTATION REPUTATION_TYPE_*

使用可能な基準値の定数リストの全体を見るためには、上の値の１つの一部分(例 SPELL_)をオーロラエディターのフィルターに入力し、定数ボタンを選択してください。

Known Bugs

パッチ1.28より前において、この関数は、初めの基準をCREATURE_TYPE_IS_ALIVEのみに指定した場合、常にOBJECT_INVALIDを返しました。

Version

1.28

See Also

functions: | GetNearestCreatureToLocation | GetNearestSeenOrHeardEnemy
categories: | Get Data from Creature Functions
constants: | CLASS_TYPE_* Constants | CREATURE_TYPE_* Constants | PLAYER_CHAR_* Constants | SPELL_* Constants

author: Jason Simpson, editor: Charles Feduke, additional contributor(s): Gene Koo, JP team: katsu794


Function - GetNearestCreatureToLocation

Home > Reference > Functions > Get Data > GetNearestCreatureToLocation

GetNearestCreatureToLocation(int, int, location, int, int, int, int, int)

与えられたlocationから、条件に合致し、最も近い位置にいるクリーチャーを調べます。

object GetNearestCreatureToLocation(
    int nFirstCriteriaType,
    int nFirstCriteriaValue,
    location lLocation,
    int nNth = 1,
    int nSecondCriteriaType = -1,
    int nSecondCriteriaValue = -1,
    int nThirdCriteriaType = -1,
    int nThirdCriteriaValue = -1
);

Parameters

nFirstCriteriaType

CREATURE_TYPE_* (より詳細なCREATURE_TYPE_*を参照してください。)

nFirstCriteriaValue

CLASS_TYPE_*, SPELL_*, PERCEPTION_*, PLAYER_CHAR_IS_PC, PLAYER_CHAR_NOT_PC , RACIAL_TYPE_* , REPUTATION_TYPE_*, TRUE OR FALSE (ここの値はnFirstCriteriaTypeで指示されたタイプに依存します。より詳細な説明が書かれたページを参照してください。

lLocation

lLocationの近くにいるクリーチャーから、指示された条件に合致するクリーチャーを探していきます。

nNth

必ずしも一番近くにいるクリーチャーを探す必要はありません。：N番目に近いクリーチャーを探すこともできます。（デフォルトでは１番目です）

nSecondCriteriaType

これはnFirstCriteriaTypeと同じ方法で、探すクリーチャーにさらに条件をつけ加えることができます。（デフォルトでは-1）

nSecondCriteriaValue

これはnFirstCriteriaValueと同じ方法で、探すクリーチャーにさらに条件をつけ加えることができます。（デフォルトでは-1）

nThirdCriteriaType

これはnFirstCriteriaTypeと同じ方法で、探すクリーチャーにさらに条件をつけ加えることができます。（デフォルトでは-1）

nThirdCriteriaValue

これはnFirstCriteriaValueと同じ方法で、探すクリーチャーにさらに条件をつけ加えることができます。（デフォルトでは-1）

Description

全ての条件に合致する、lLocationの一番近くにいるクリーチャーを得ます。

エラー時にはOBJECT_INVALIDを返します。

関数は指示された条件に合致し、与えられたlocationからN番目に近い（デフォルトでは１番目、もしくは最も近い）位置にいるクリーチャーを選びます。

デフォルトではoTARGETがOBJECT_SELFとなってしまう場合でも、他のオブジェクトを選んでしまうかもしれません。

最初に指示する条件 (nFirstCriteriaTypeとnFirstCriteriaValue)は、パラメーターとして不可欠です。

二番目と三番目に指示する条件は、オプション的なものであり、オブジェクトを探すときにより条件を絞り込みたいときに使います。

指示されるパラメーターはタイプと値がペアになっています。そして用意されている定数のみ使用できます。

例えば、nFirstCriteriaTypeにCREATURE_TYPE_CLASSを指示すると、nFirstCriteriaValueはCLASS_TYPE_*のフォームをとる定数になります。

この例で、 (CREATURE_TYPE_CLASS, CLASS_TYPE_CLERIC, lLoc1)というパラメーターを指示したとします。すると関数は、ｌLoc1の最も近くにいる、クラスがクレリックであるオブジェクトを返します。

さらに条件をつけ加えて、例えば (CREATURE_TYPE_CLASS, CLASS_TYPE_CLERIC, lLoc1, CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, CREATURE_TYPE_RACIAL_TYPE, RACIAL_TYPE_DWARF)としてみます。

    すると関数は、ｌLoc1の最も近くにいる、クラスがクレリックで、さらにプレイヤーキャラクターで、しかも種族がドワーフであるオブジェクトを見つけてきます。

下記のリストが、条件として指示できるタイプと値です。

CREATURE_TYPE_CLASS CLASS_TYPE_*
CREATURE_TYPE_DOES_NOT_HAVE_SPELL_EFFECT SPELL_*
CREATURE_TYPE_HAS_SPELL_EFFECT SPELL_*
CREATURE_TYPE_IS_ALIVE TRUE OR FALSE
CREATURE_TYPE_PERCEPTION PERCEPTION_*
CREATURE_TYPE_PLAYER_CHAR PLAYER_CHAR_IS_PC OR PLAYER_CHAR_NOT_PC
CREATURE_TYPE_RACIAL_TYPE RACIAL_TYPE_*
CREATURE_TYPE_REPUTATION REPUTATION_TYPE_*

条件として指示できる定数全てを見るには、オーロラツールセットのスクリプトエディタのフィルタに値の一部（例えば　SPELL_）を入力し定数ボタンを押してみれば、そのグループに属する定数全てを見ることができます。

Version

1.22

See Also

functions: | GetNearestCreature
categories: | Get Data Functions
constants: | CLASS_TYPE_* Constants | CREATURE_TYPE_* Constants | PLAYER_CHAR_* Constants | SPELL_* Constants

author: Jason Simpson, JP team: NamaYake


Function - GetNearestObject

Home > Reference > Functions > Get Data from Object > GetNearestObject

GetNearestObject(int, object, int)

選択された対象に対して、与えられた基準にマッチする最も近いオブジェクトを得ます。

object GetNearestObject(
    int nObjectType = OBJECT_TYPE_ALL,
    object oTarget = OBJECT_SELF,
    int nNth = 1
);

Parameters

nObjectType

OBJECT_TYPE_* (デフォルト: OBJECT_TYPE_ALL)

oTarget

(デフォルト: OBJECT_SELF)

nNth

(デフォルト: 1)

Description

指定されたタイプを持っているoTargetにN番目に近いオブジェクトを得ます。

エラー時には、OBJECT_INVALIDを返します。

この関数は、指定されたタイプにマッチするオブジェクトにN番目に近い(デフォルトは1、いちばん近い)オブジェクトを得ます。

デフォルトでは、タイプはOBJECT_TYPE_ALLに設定されています。従って、OBJECT_TYPE_*のタイプを指定すると、関数はN番目に近い有効なオブジェクトを返すでしょう。(有効なオブジェクトタイプの全てのリストについては、descriptionの最後を見て下さい。)

また、oTARGETもデフォルトではOBJECT_SELFになってますが、おそらく別のオブジェクトが設定されるかもしれません。

例えば、以下のスクリプトは、オブジェクトoPCに３番目に近いドアを、オブジェクトoNearestDoorに設定するでしょう。

object oNearestDoor = GetNearestObject(OBJECT_TYPE_DOOR, oPC, 3)

利用可能なオブジェクトタイプ定数のリスト：
OBJECT_TYPE_ALL (デフォルト)
OBJECT_TYPE_AREA_OF_EFFECT
OBJECT_TYPE_CREATURE
OBJECT_TYPE_DOOR
OBJECT_TYPE_ITEM
OBJECT_TYPE_PLACEABLE
OBJECT_TYPE_STORE
OBJECT_TYPE_TRIGGER
OBJECT_TYPE_WAYPOINT

Version

1.22

Example

// このスクリプトは、"BAR_MAID"のタグを持っているバーのメイドのためのものです。
// バーのメイドは３番目に近いドアを見つけ、そこへ歩こうと試みるでしょう。

void main
{
     // オブジェクトを初期化します。
     object oBarMaid = GetObjectByTag("BAR_MAID");
     object oDoor = GetNearestObject(OBJECT_TYPE_DOOR, oBarMaid, 3)
     // バーのメイドは、３番目に近いドアへ歩きます。
     ActionForceMoveToObject(oDoor)
}

See Also

functions: | GetNearestObjectByTag | GetNearestObjectToLocation
categories: | Get Data from Object Functions
constants: | OBJECT_TYPE_* Constants

author: Jason Simpson, editor: Jeremy Spilinek, JP team: katsu794


Function - GetNearestObjectByTag

Home > Reference > Functions > Get Data from Object > GetNearestObjectByTag

GetNearestObjectByTag(string, object, int)

オブジェクトのタグ値を調べることによって、対象に対して最も近いオブジェクトを返します。

object GetNearestObjectByTag(
    string sTag,
    object oTarget = OBJECT_SELF,
    int nNth = 1
);

Parameters

sTag

oTarget

(デフォルト: OBJECT_SELF)

nNth

(デフォルト: 1)

Description

タグ値としてsTagを持っているoTargetに、N番目に近いオブジェクトを返します。

エラー時には、OBJECT_INVALIDを返します。

関数は、与えられたタグ文字列にマッチするオブジェクトに対して、N番目(デフォルトは1、いちばん近い)に近いオブジェクトを選択します。

oTARGETは、デフォルトではOBJECT_SELFになってますが、おそらく別のオブジェクトが設定されるかもしれません。

この関数に必要なパラメーターは、タグ値の文字列だけです。

例えば、GetNearestObjectByTag(sFoo)は、タグ文字列としてsFooを持っているこの関数を呼び出すオブジェクトに最も近いオブジェクトを返すでしょう。

GetNearestObjectByTag(sFoo, oStatue1, 3)とすることで、タグ文字列としてsFooを持っているオブジェクトoStatue1に３番目に近いオブジェクトを取り出すこともできます。

注意：
要求されるパラメーターsTagは、文字列値でなければなりません。

以下の２通りの方法から１つを使うことができます。1)関数呼び出しの外部で値を設定する。(例 string sFoo = “myObjectsTagName”)、または、2)関数のパラメーターに直接タグ名を入力するために、ダブルクォーテーションを使用する。 (例 GetNearestObjectByTag(“myObjectTagName”) )

Remarks

GetNearestObjectByTag()関数が取り出す最も近いオブジェクトは、oTargetが占めているエリア内におけるオブジェクトのみです。

Version

1.22

Example

// エリア内において、関数を呼び出すオブジェクトと同じタグを持っている最も近いオブジェクトを取り出します。

void main()
{
     string sTag=GetTag(OBJECT_SELF);
     object oNearestObject=GetNearestObjectByTag(sTag);
}

See Also

functions: | GetNearestObject | GetObjectByTag
categories: | Get Data from Object Functions

author: Jason Simpson, editor: Sarev0k, JP team: katsu794


Function - GetNearestObjectToLocation

Home > Reference > Functions > Get Data from Object > GetNearestObjectToLocation

GetNearestObjectToLocation(int, location, int)

与えられたロケーションに対して、指定されたタイプで最も近いオブジェクトを返します。

object GetNearestObjectToLocation(
    int nObjectType,
    location lLocation,
    int nNth = 1
);

Parameters

nObjectType

OBJECT_TYPE_*

lLocation

nNth

(デフォルト: 1)

Description

lLocationに対して、指定されたタイプでN番目に近いオブジェクトを返します。

エラー時には、OBJECT_INVALIDを返します。

この関数は、与えられたロケーションに対して、特定タイプのオブジェクトでN番目(デフォルトは1、最も近い)に近いオブジェクトを選択します。

デフォルトでは、タイプはOBJECT_TYPE_ALLに設定されています。従って、OBJECT_TYPE_*のタイプを指定すると、関数は与えられたロケーションに対してN番目に近い有効なオブジェクトを返すでしょう。(有効なオブジェクトタイプの全てのリストについては、descriptionの最後を見て下さい。)

利用可能なオブジェクトタイプ定数のリスト：
OBJECT_TYPE_ALL (デフォルト)
OBJECT_TYPE_AREA_OF_EFFECT
OBJECT_TYPE_CREATURE
OBJECT_TYPE_DOOR
OBJECT_TYPE_ITEM
OBJECT_TYPE_ITEM
OBJECT_TYPE_PLACEABLE
OBJECT_TYPE_STORE
OBJECT_TYPE_TRIGGER
OBJECT_TYPE_WAYPOINT

Version

1.22

See Also

functions: | GetNearestObject | GetObjectByTag
categories: | Get Data from Object Functions
constants: | OBJECT_TYPE_* Constants

author: Jason Simpson, JP team: katsu794


Function - GetNearestPC

Home > Reference > Functions > Get Data > GetNearestPC

GetNearestPC()

クリーチャーの最も近くにいるプレイヤーキャラクターを調べます。

object GetNearestPC();

Description

関数を呼び出したものの最も近くにいるプレイヤーキャラクターを返します。エラー時にはOBJECT_INVALIDを返します。

Remarks

これはGetNearestCreature()関数から一部の機能だけを抽出した関数です。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Get Data Functions

author: Tom Cassiotis, JP team: NamaYake


Function - GetNearestSeenOrHeardEnemy

Home > Reference > Functions > Get Data, Perception, Targeting > GetNearestSeenOrHeardEnemy

GetNearestSeenOrHeardEnemy()

見ることのできる最も近くにいるクリーチャーを調べます。また音が聞こえる最も近くにいるクリーチャーを調べます。

object GetNearestSeenOrHeardEnemy();

Description

見ることのできる最も近くのクリーチャーを返します。その後、最も近くにいる音のする対象をチェックします。

Version

1.22

See Also

functions: | GetEnemyHD | GetIsEnemy | GetNearestCreature | SetListening
categories: | Get Data Functions | Perception Functions | Targeting Functions
events: | OnPerception Event

author: Jody Fletcher, JP team: NamaYake


Function - GetNearestTrapToObject

Home > Reference > Functions > Traps > GetNearestTrapToObject

GetNearestTrapToObject(object, int)

クリーチャーやオブジェクトから最も近くにある罠を調べます。

object GetNearestTrapToObject(
    object oTarget = OBJECT_SELF,
    int nTrapDetected = TRUE
);

Parameters

oTarget

罠をサーチするもとになるオブジェクト。(デフォルト: OBJECT_SELF)

nTrapDetected

ここがTRUEの場合、oTargetによって既に発見されている罠を返します。(デフォルト: TRUE)

Description

oTargetから最も近くにある罠を返します。注釈:実際に返されるトラップオブジェクトは、oTargetのエリア内にある罠の仕掛けられたトリガー、配置可能オブジェクト、ドアなどです。

Version

1.22

See Also

functions: | GetTrapBaseType | GetTrapDetectable | GetTrapFlagged | GetTrapKeyTag
categories: | Traps Functions

author: Jody Fletcher, JP team: katsu794


Function - GetNextEffect

Home > Reference > Functions > Effects > GetNextEffect

GetNextEffect(object)

Determines the next active effect on a creature.

effect GetNextEffect(
    object oCreature
);

Parameters

oCreature

The creature to examine for effects

Description

Returns the next in-game effect (poisoned, cursed, etc) on oCreature, and an invalid effect if oCreature does not have any active effects.

Remarks

You must first call GetFirstEffect with the same parameter before using this function for proper operation.

Version

1.26

Example

// this code cycles through the effects active on the first PC and
// stores whether s/he is blind or deaf;
main()
{
   effect eEffect = GetFirstEffect(GetFirstPC());
   int blind = FALSE;
   int deaf = FALSE;
   int possibleDumb = FALSE;
   while(GetIsEffectValid(eEffect))
   {
      int nType = GetEffectType(eEffect);
      if(nType == EFFECT_TYPE_BLINDNESS)
         blind = TRUE;
      else if(nType == EFFECT_TYPE_DEAF)
         deaf = TRUE;
      eEffect = GetNextEffect(GetFirstPC());
   }

   if (deaf == TRUE && blind == TRUE)
      possibleDumb = TRUE;
}

See Also

functions: | EffectSpellLevelAbsorption | GetFirstEffect
categories: | Effects Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Marcus Lunzenauer, Jotham


Function - GetNextFactionMember

Home > Reference > Functions > Reputation/Faction > GetNextFactionMember

GetNextFactionMember(object, int)

あるクリーチャーが所属するファクションの次のメンバーを得ます。

object GetNextFactionMember(
    object oMemberOfFaction,
    int bPCOnly = TRUE
);

Parameters

oMemberOfFaction

調べたいファクションを決定するためのクリーチャー

bPCOnly

TRUEであればファクションメンバーがPCのみ、TRUE以外であればNPCとPCを検索に含ます(デフォルト: TRUE)

Description

oMemberOfFactionが所属するファクションの次のメンバーを返します。もしoMemberOfFactionやoMemberOfFactionのファクションが無効であればOBJECT_INVALIDを返します。

Remarks

この関数を使う前に同じパラメータを持ったGetFirstFactionMemberを呼び出す必要があります。

Version

1.29

Example

// 最初のPCのパーティメンバー全てに対して繰り返します
object oPartyMember = GetFirstFactionMember(GetFirstPC(), TRUE);
while (GetIsObjectValid(oPartyMember) == TRUE)
{
   // do something to party member
   oPartyMember = GetNextFactionMember(oPartyMember, TRUE);
}

See Also

functions: | GetFirstFactionMember
categories: | Reputation/Faction Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Tom Smallwood, Mike Daneman, JP team: Redondo


Function - GetNextInPersistentObject

Home > Reference > Functions > Miscellaneous > GetNextInPersistentObject

GetNextInPersistentObject(object, int, int)

持続型objectの内側にある特定タイプの次のobjectを得ます。

object GetNextInPersistentObject(
    object oPersistentObject = OBJECT_SELF,
    int nResidentObjectType = OBJECT_TYPE_CREATURE,
    int nPersistentZone = PERSISTENT_ZONE_ACTIVE
);

Parameters

oPersistentObject

objectを含むobject（デフォルト：OBJECT_SELF）

nResidentObjectType

OBJECT_TYPE_* (デフォルト: OBJECT_TYPE_CREATURE)

nPersistentZone

PERSISTENT_ZONE_ACTIVE. [これはPERSISTENT_ZONE_FOLLOWも使うことが出来ましたが、現在は使用できません] (デフォルト: PERSISTENT_ZONE_ACTIVE)

Description

指定したタイプのoPersistentObjectの中にある次のobjectを返します。また、objectが見つからなければOBJECT_INVALIDを返します。

Remarks

適切な実行用の同一のパラメーターを備えたGetFirstInPersistentObject()を、最初に呼ばなければなりません。

範囲効果魔法を使用するために、Biowareはスクリプトの中でこの関数を使っています。

Version

1.22

See Also

functions: | GetFirstInPersistentObject
categories: | Miscellaneous Functions
constants: | OBJECT_TYPE_* Constants | PERSISTENT_ZONE_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetNextItemInInventory

Home > Reference > Functions > Inventory > GetNextItemInInventory

GetNextItemInInventory(object)

オブジェクトの所持品欄にある最初のアイテムを調べます。

object GetNextItemInInventory(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

所持品欄をもつオブジェクト。（デフォルトではOBJECT_SELF)

Description

oTargetの所持品欄にある次のアイテムを返すか、スクリプトを呼び出したのがクリーチャーでなかったりアイテムや配置物や商店であった場合、またはアイテムが見つからなかった場合はOBJECT_INVALIDを返します。

Remarks

この関数が呼び出される前に、対象に対してGetFirstItemInInventory()関数が呼び出されていないといけません。

Version

1.22

Example

// この関数は最初のPCの所持品欄にあるアイテムの合計数を数え上げます。
// （スタックしているアイテムはその総数を数えます）
void main()
{
   int nItems = 0;
   object oItem = GetFirstItemInInventory(GetFirstPC());
   while (GetIsObjectValid(oItem) == TRUE)
   {
      nItems = nItems + GetNumStackedItems(oItem);
      oItem = GetNextItemInInventory(GetFirstPC());
   }
}

See Also

functions: | GetFirstItemInInventory
categories: | Inventory Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: NamaYake


Function - GetNextObjectInArea

Home > Reference > Functions > Area > GetNextObjectInArea

GetNextObjectInArea(object)

エリア内の次のオブジェクトを調べます。

object GetNextObjectInArea(
    object oArea = OBJECT_INVALID
);

Parameters

oArea

オブジェクトを含むエリア。対象エリア。(デフォルト: OBJECT_INVALID)

Description

oArea内の次のオブジェクトを返します。オブジェクトがない、もしくは何らかのエラーであればOBJECT_INVALIDを返します。

もし無効なエリアが指定された場合は、呼び出し者のエリアを使います。

Remarks

この関数を使う前に、同じパラメータを伴ったGetFirstObjectInAreaを呼び出す必要があります。

エンカウンターオブジェクトは発見しません。エンカウンターはそれらのタグによって直接に示されなければなりません。

Known Bugs

DMによって憑依されたクリーチャーは調べません、飛ばされます。

Version

1.29

See Also

functions: | GetFirstObjectInArea
categories: | Area Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Enigmatic, Jazael, JP team: Redondo


Function - GetNextObjectInShape

Home > Reference > Functions > Miscellaneous > GetNextObjectInShape

GetNextObjectInShape(int, float, location, int, int, vector)

シェイプ（shape）内の指定タイプ（クリーチャー、ドア等）の次のobjectを得ます。

object GetNextObjectInShape(
    int nShape,
    float fSize,
    location lTarget,
    int bLineOfSight = FALSE,
    int nObjectFilter = OBJECT_TYPE_CREATURE,
    vector vOrigin = [0.0,0.0,0.0]
);

Parameters

nShape

SHAPE_*

fSize

シェイプ形状の大きさ（さらなる情報はDescriptionを参照してください）または、RADIUS_SIZE_*。

lTarget

シェイプの始点

bLineOfSight

これは返されたobjectの視線チェックをするかどうかを操作します。（これは呪文エフェクトが壁を通り抜けないことを確実にするために使用することができます。）（デフォルト：FALSE）

nObjectFilter

OBJECT_TYPE_* (デフォルト: OBJECT_TYPE_CREATURE)

vOrigin

これは筒状と円錐状、またはエフェクトの始点を指定する時にのみ使用されます。

Description

指定したnShapeのfSize内の次のobjectを、objectがそれ以上含まれていない場合はOBJECT_INVALIDを返します。

fSize
- If nShape == SHAPE_SPHERE, これは球状範囲です。

- If nShape == SHAPE_SPELLCYLINDER,これは円筒状範囲です。

- If nShape == SHAPE_CONE, これは広い円錐状範囲です。.

- If nShape == SHAPE_CUBE, これは立方体の面のうちの1つの長さの半分です。

nObjectFilter
例えば、クリーチャーとドアだけを返すためには、このパラメーターの値をOBJECT_TYPE_CREATURE | OBJECT_TYPE_DOORにします。これは望まないオブジェクト・タイプを、ビット単位の「or」を使ってろ過することを可能にします。

Remarks

この関数を使う前に同じパラメータを使ったGetFirstObjectInShapeを呼び出す必要があります。

Known Bugs

SHAPE_CONEの形状がCONE（円錐）でないことが数人のユーザーから報告されています。そして実はこの定数はオフィシャルキャンペーン全体を通して、たった一つの関数でしか使われてないことで、それが少しバグが多くしているのかもしれません。

SHAPE_SPELLCONE定数では、ITargetは円錐の角度を表します。ltargetの方向にfSizeだけ離れます。"vOrigin"は無視されます－円錐に始点はありません－－－円錐の始点はOBJECT_SELFの位置になります。

SHAPE_SPELLCYLINDERでは、"fSize"は通常円筒の長さで、円筒の終点はvOriginからlTargetに向かって沿うように"fSize"進んだところです。円筒の幅（直径）は常に約10フィート(?)です

－公式フォーラムでのKorak氏の報告

Version

1.22

Example

// バーニングハンズ呪文を使うBiowareのスクリプトより

// [Snip][Snip]
oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, 10.0, GetSpellTargetLocation(), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);

// 無効なobjectを捕まえるまで、呪文の形状範囲内のターゲットを循環する
while(GetIsObjectValid(oTarget))
{
   if(!GetIsReactionTypeFriendly(oTarget))
   {
      // セービングスロー、ダメージ、エフェクト等を操る
   }
   // 呪文の形状範囲内の次のターゲットを選択する
   oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, 10.0, GetSpellTargetLocation(), TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
}
// [Snip][Snip]

See Also

functions: | GetFirstObjectInShape
categories: | Miscellaneous Functions
constants: | OBJECT_TYPE_* Constants | SHAPE_* Constants

author: Tom Cassiotis, editor: John Shuell, JP team: Rainie


Function - GetNextPC

Home > Reference > Functions > Get Data from Creature > GetNextPC

GetNextPC()

プレイヤーリスト上の次のPCを得ます。

object GetNextPC();

Description

プレイヤーリスト上から、前回GetFirstPC()、またはGetNextPC()で返された次のPCを返します。それ以上PCがいなければOBJECT_INVALIDを返します。

Remarks

この関数を使う前には、GetFirstPCを呼び出さなくてはなりません。

Version

1.22

Example

// この関数はPC全てを調べ、人数を数える
main()
{
   int nPCs = 0;
   object oPC = GetFirstPC();
   while (GetIsObjectValid(oPC) == TRUE)
   {
      nPCs = nPCs+1; // nPCs++;

      oPC = GetNextPC();
   }
}

See Also

functions: | GetFirstPC
categories: | Get Data from Creature Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetNPCWarningStatus

Home > Reference > Functions > Core AI > GetNPCWarningStatus

GetNPCWarningStatus()

別のオブジェクトに対するNPCの心の状態を決定します。

int GetNPCWarningStatus();

Description

攻撃したか、もしくはしていないクリーチャーに対するNPCの心の状態を得るために、SetNPCWarningStatus()関数で設定された整数を返します。

Remarks

この関数が呼ばれる前にSetNPCWarningStatus()関数が呼ばれるべきです。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

Example

// この関数は、NPCの警戒状態をランダムに取り出す方法の実例です。
#include "NW_I0_GENERIC"

void main()
{
     SetNPCWarningStatus(Random(2));
     if(GetNPCWarningStatus()==FALSE)
     {
          ActionSpeakString("Hello Friend");
     }
}

See Also

functions: | SetNPCWarningStatus
categories: | Core AI Functions

author: Sarev0k, editor: Tom Cassiotis, JP team: katsu794


Function - GetNumberOfItems

Home > Reference > Functions > Module Specific > GetNumberOfItems

GetNumberOfItems(int)

財宝を作成するためのアイテムの数を決定します。

int GetNumberOfItems(
    int nTreasureType
);

Parameters

nTreasureType

TREASURE_*

Description

型がnTreasureTypeである財宝を作成するためのアイテムの数を返します。

Remarks

GetNumberOfItems()関数は、BioWare社のモジュール上で動作する財宝生成スクリプトの中で使用されます。

Requirements

#include "nw_o2_coninclude"

Version

1.28

See Also

categories: | Module Specific Functions
constants: | TREASURE_* Constants

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Rodney Sherrill, JP team: katsu794


Function - GetNumberOfMeleeAttackers

Home > Reference > Functions > Get Data > GetNumberOfMeleeAttackers

GetNumberOfMeleeAttackers()

対象のオブジェクトから同心円状５メートル以内にいる敵の数を調べます。

int GetNumberOfMeleeAttackers();

Description

対象のオブジェクトを攻撃していて、同心円状の５メートル以内にいる敵の数を返します。

Remarks

GetNumberOfMeleeAttackers()関数は、スクリプトを呼び出しているオブジェクトを格闘武器で攻撃している攻撃者たちの数を返します。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

Example

// 攻撃者の数に基づいて、セリフを喋らせる方法を例示します。
#include "NW_I0_GENERIC"

void main()
{
   if(GetNumberOfMeleeAttackers()>8)
   {
      ActionSpeakString("ちくしょう！　この数じゃ敵わないぞ！");
   }
}

See Also

functions: | GetNumberOfRangedAttackers
categories: | Get Data Functions

author: Sarev0k, editor: Tom Cassiotis, JP team: NamaYake


Function - GetNumberOfRangedAttackers

Home > Reference > Functions > Get Data > GetNumberOfRangedAttackers

GetNumberOfRangedAttackers()

対象のオブジェクトから同心円状５メートル以上遠くにいる敵の数を調べます。

int GetNumberOfRangedAttackers();

Description

対象のオブジェクトを攻撃していて、同心円状の５メートル以上遠くにいる敵の数を返します。

Remarks

GetNumberOfRangedAttackers()関数は、スクリプトを呼び出しているオブジェクトを飛び道具で攻撃している攻撃者たちの数を返します。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

Example

// 攻撃者の数に基づいて、セリフを喋らせる方法を例示します。
#include "NW_I0_GENERIC"

void main()
{
     if(GetNumberOfRangedAttackers()>8)
     {
           ActionSpeakString("ちくしょう！　矢の雨あられでクギづけだ！");
     }
}

See Also

functions: | GetNumberOfMeleeAttackers
categories: | Get Data Functions

author: Sarev0k, editor: Tom Cassiotis, JP team: NamaYake


Function - GetNumItems

Home > Reference > Functions > Get Data from Creature, Inventory > GetNumItems

GetNumItems(object, string)

対象が運んでいるアイテムの数を調べます。

int GetNumItems(
    object oTarget,
    string sItem
);

Parameters

oTarget

所持品欄をチェックするクリーチャー。

sItem

調べたいアイテムのタグ。

Description

oTargetの所持品欄にあるsItemというタグのアイテムをスタックしているものも全て含めての数を返します。

Remarks

この関数はnw_i0_plot.nssの780行目で見つかります。

これはスタックしていないアイテムと同じように、スタック中の個々のアイテムも数えます。

Requirements

#include "nw_i0_plot"

Version

1.26

See Also

functions: | GetNumStackedItems
categories: | Get Data from Creature Functions | Inventory Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Funny, JP team: NamaYake


Function - GetNumStackedItems

Home > Reference > Functions > Inventory > GetNumStackedItems

GetNumStackedItems(object)

所持品にあるアイテムのスタックしている数を調べます。

int GetNumStackedItems(
    object oItem
);

Parameters

oItem

所持品欄にあって、どれだけスタックしているのか調べたいアイテム。

Description

所持品欄にあるoItemという積み重ねられているアイテムの数を返します。

Version

1.22

Example

// NPCの持っている矢の数を調べ、それが尽きたときセリフを喋らせます。

void main()
{
     //NPCの持っている矢を調べます。
     object arrows = GetObjectByTag("MY_ARROWS");

     if(GetNumStackedItems(arrows)==0)
     {
          ActionSpeakString("My arrow supply is depleted!");
     }
}

See Also

functions: | GetNumItems
categories: | Inventory Functions

author: Sarev0k, editor: Tom Cassiotis, JP team: NamaYake


Function - GetObjectByTag

Home > Reference > Functions > Get Data from Object > GetObjectByTag

GetObjectByTag(string, int)

与えられたタグに基づきオブジェクトを取り出します。

object GetObjectByTag(
    string sTag,
    int nNth = 0
);

Parameters

sTag

捜すオブジェクトのタグ。

nNth

要求されタグを持っているN番目のオブジェクト。(デフォルト: 0)

Description

指定されたタグを持っているnN番目のオブジェクトを返します。また、オブジェクトが発見できなかった場合は、OBJECT_INVALIDを返します。

Remarks

nNthパラメーターは、現在のエリア内において、スクリプトを実行しているオブジェクトに対してnNth番目に近いオブジェクトを返すために決定されます。

現在のエリア外では、最後（最も新しく）にモジュールに追加されたエリアに対し、以下の階層構造に従ってスキャンが開始されるでしょう。

OBJECT_TYPE_STORE (128)
OBJECT_TYPE_PLACEABLE (64)
OBJECT_TYPE_WAYPOINT (32)
OBJECT_TYPE_AREA_OF_EFFECT (16) (sounds)
OBJECT_TYPE_DOOR (8)
OBJECT_TYPE_TRIGGER (4)
OBJECT_TYPE_ITEM (2)
OBJECT_TYPE_CREATURE (1)

Known Bugs

以前に記述したバグは、いくつか前のパッチでフィックスされました。

Version

1.29

Example

// GetObjectByTag()関数でオブジェクトを取り出す方法とそれに呪文エフェクトを適用する方法を説明します。

void main()
{
     // NPCのBobに対して、周りが暗闇に見えるようにします。
     ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDarkness(), GetObjectByTag("NPC_BOB"));
}

See Also

functions: | ActionJumpToObject | GetNearestObjectByTag | GetNearestObjectToLocation | GetTag
categories: | Get Data from Object Functions

author: Sarev0k, editor: Charles Feduke, additional contributor(s): David Scott, Glenn Berden, JP team: katsu794


Function - GetObjectHeard

Home > Reference > Functions > Perception > GetObjectHeard

GetObjectHeard(object, object)

Objectが別のObjectを聞くことができるかどうか決めます。

int GetObjectHeard(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

聞かれるかもしれないObject

oSource

聞くことを行っているObject（デフォルト：OBJECT_SELF）

Description

oSourceがoTargetを聞くかどうかを決めます。

Version

1.22

See Also

categories: Perception Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetObjectNeedsHealing

Home > Reference > Functions > Get Data from Creature > GetObjectNeedsHealing

GetObjectNeedsHealing(object, int)

クリーチャーの元々のHPからの損傷具合を調べ、治療が必要としているかを調べます。

int GetObjectNeedsHealing(
    object oMostDamagedMember,
    int nPercent
);

Parameters

oMostDamagedMember

ダメージを調べるクリーチャー

nPercent

クリーチャーが治療を必要とする割合（1-100）

Description

oMostDamagedMemberのHPが、元のHPのnPercent以下ならばTRUEを返します。

Remarks

この関数は以下の複数のスクリプトファイルで見つかります：nw_cd_lv123, nw_cd_lv203, nw_cd_lv23, nw_cd_lv73

Requirements

#include "nw_cd_lv123"

Version

1.22

See Also

categories: Get Data from Creature Functions

author: Tom Cassiotis, JP team: geshi, Rainie


Function - GetObjectSeen

Home > Reference > Functions > Perception > GetObjectSeen

GetObjectSeen(object, object)

Objectが別のObjectを見るかどうか決めます。

int GetObjectSeen(
    object oTarget,
    object oSource = OBJECT_SELF
);

Parameters

oTarget

見られるかもしれないObject

oSource

見ることを行っているObject（デフォルト：OBJECT_SELF）

Description

oSourceがoTargetを見るかどうかを決めます。oSourceがoTargetを見ればTRUEを、そうでなければFALSEを返します。oTargetが配置用Objectであれば、この関数は常にFALSEを返します。

Version

1.28

See Also

categories: Perception Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): David Etheredge, JP team: Rainie


Function - GetObjectType

Home > Reference > Functions > Get Data from Object > GetObjectType

GetObjectType(object)

オブジェクトが何のタイプであるかを決定します。

int GetObjectType(
    object oTarget
);

Parameters

oTarget

タイプを見つけるオブジェクト。

Description

oTargetのオブジェクトタイプ(OBJECT_TYPE_*)を返します。oTargetが無効なオブジェクトの場合は、-1を返します。

Version

1.22

See Also

categories: | Get Data from Object Functions
constants: | OBJECT_TYPE_* Constants

author: Tom Cassiotis, JP team: katsu794


Function - GetPCIPAddress

Home > Reference > Functions > PC Only, Server > GetPCIPAddress

GetPCIPAddress(object)

PCのIPアドレスを取得します。

string GetPCIPAddress(
    object oPlayer
);

Parameters

oPlayer

IPアドレスを返したいプレイヤー

Description

サーバーに接続しているoPlayerからIPアドレスを取得し返します。

Version

1.28

Example

// PCのIPアドレスに基づいた文章を表示します。
void main()
{
   if(GetPCIPAddress(OBJECT_SELF)=="127.0.0.1")
   {
      ActionSpeakString("All hail the host!");
   }
   else
   {
      ActionSpeakString("I cower before the almighty host");
   }
}

See Also

categories: PC Only Functions | Server Functions

author: Sarev0k, editor: Charles Feduke, JP team: Rainie


Function - GetPCLevellingUp

Home > Reference > Functions > PC Only > GetPCLevellingUp

GetPCLevellingUp()

最後にレベルアップしたPCを参照し返します。

object GetPCLevellingUp();

Description

レベルアップした最後のPCを返します。

Version

1.22

Example

// レベルアップしたPCに呪文の効果を適用し表現します

void main()
{
     // PCをペンギンに変えてしまう。
     ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectPolymorph(POLYMORPH_TYPE_PENGUIN), GetPCLevellingUp());
}

See Also

categories: PC Only Functions

author: Sarev0k, JP team: Rainie


Function - GetPCPlayerName

Home > Reference > Functions > PC Only > GetPCPlayerName

GetPCPlayerName(object)

PCのプレイヤーのログイン名を返します。

string GetPCPlayerName(
    object oPlayer
);

Parameters

oPlayer

ログイン名を返したいプレイヤーの操作しているPC

Description

oPlayerを操作しているプレイヤーのログインアカウント名を返します。

Version

1.28

Example

// ログインしてきたプレイヤーのログイン名に基づいて文章を表示します。

void main()
{
     // GetEnteringObject()がPCであることを確かめる
     if (GetIsPC(GetEnteringObject())
     {
          string strLoginName = GetPCPlayerName(GetEnteringPC());
          ActionSpeakString("Welcome back " + strLoginName + "!");
          // PCの操作者のログインアカウント名が「Galryx」であれば
          // 表示される文字列は"Welcome Back Galryx!"です
     }
}

See Also

categories: PC Only Functions

author: Sarev0k, editor: Charles Feduke, additional contributor(s): Sam Featherston, JP team: Rainie


Function - GetPCPublicCDKey

Home > Reference > Functions > PC Only > GetPCPublicCDKey

GetPCPublicCDKey(object)

PCのCDキーの公式番号を得ます。

string GetPCPublicCDKey(
    object oPlayer
);

Parameters

oPlayer

CDキーを所得したいプレイヤー

Description

マルチプレイヤー時に使用するoPlayerのCDキーの公式番号を返します。

Remarks

世界観に混乱を引き起こす有害なプレイヤーに対抗するBootPC()のような関数と一緒に使うのが望ましいです。

Version

1.22

Example

// CDキーに基づいてサーバーからプレイヤーを追い出す

void main()
{
     // GetEnteringObject()がPCかどうかを確認する
     if(GetIsPC(GetEnteringObject())==TRUE)
     {
          if(GetPCPublicCDKey(GetEnteringObject())=="s7sf97dsf9ds79f79ds")
          {
               BootPC(GetEnteringObject());
          }
     }
}

See Also

functions: | BootPC
categories: | PC Only Functions

author: Sarev0k, editor: Tom Cassiotis, JP team: Rainie


Function - GetPCSpeaker

Home > Reference > Functions > Conversation, PC Only > GetPCSpeaker

GetPCSpeaker()

現在、NPCと会話中のPCを取得します

object GetPCSpeaker();

Description

現在、NPCと会話中のPCを取得します

Remarks

この関数は会話の一部として呼び出されたスクリプトにのみ使用でき、常に会話中のPCを返します。

Version

1.28

Example

// "Actions Taken"スクリプトはNPCのconversationで
// PCに対してクエスト変数を設定する
void main() {
  object oPC = GetPCSpeaker();
  SetLocalInt( oPC, "golden_duck", 100);
}
// --- 例'Actions Taken'の終了

// StartingConditionalはNPC conversationである
// "Text Appears When"用スクリプトである
// このスクリプトが付属する会話の選択肢（node、ノード）は、
// PCの変数である"golden_duck"が100に設定されたときのみ表示されます。
int StartingConditional() {
  object oPC = GetPCSpeaker();
  int nDuckState = GetLocalInt( oPC, "golden_duck");
  if (100 == nDuckState) return TRUE;
  return FALSE;
}

See Also

functions: | ActionStartConversation | GetLastSpeaker
categories: | Conversation Functions | PC Only Functions
events: | OnConversation Event

author: Iskander Merriman, editor: Charles Feduke, JP team: Rainie


Function - GetPercentageHPLoss

Home > Reference > Functions > Get Data from Object > GetPercentageHPLoss

GetPercentageHPLoss(object)

クリーチャーが彼らのHPの最大値に対して、どれ位のパーセンテージで負傷しているかを決定します。

int GetPercentageHPLoss(
    object oWounded
);

Parameters

oWounded

相対的な負傷レベルを得るクリーチャー(または、オブジェクト)。

Description

oWoundedの残りのHPをパーセンテージで表す、0から100の整数を返します。

例えば、クリーチャーがHPの最大値40対して30HP残っているとすると、この関数は75を返すでしょう。

Remarks

この関数が行うことは、その名前と幾分違うことに注意して下さい。

最大値100HPのオブジェクトがあり、HPが現在1に減っているとすると、ロスは99%であり、関数はこの値を返すと思うでしょう。しかし、1を返します。

シャドウ・オブ・アンドレンタイドにおいて、この関数はインクルードファイルx0_i0_assoc.nssに移動されていることにも注意して下さい。

他のインクルードファイルを利用して幾分か複雑なルートを通せば、SoUにおいても、いまだに#include "nw_i0_generic"を使用してこの関数を呼び出すことができます。

Requirements

#include "NW_I0_GENERIC"

Version

1.30

Example

// GetPercentageHPLoss()の返す値が25%より少ない時に、NPCがテキストを表示します。

#include "NW_I0_GENERIC"
void main()
{
   if(GetPercentageHPLoss(OBJECT_SELF)<25)
   {
      ActionSpeakString("HELP! I am wounded!");
   }
}

See Also

functions: | GetCurrentHitPoints | GetMaxHitPoints
categories: | Get Data from Object Functions

author: Sarev0k, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - GetPersonalItem

Home > Reference > Functions > Module Specific > GetPersonalItem

GetPersonalItem()

暗殺者のためのパーソナルアイテムの認識タグとなる文字列を取り出します。

string GetPersonalItem();

Description

SetPersonalItem関数によってセットされた暗殺者のためのパーソナルアイテムの認識タグとなる文字列セットを返します。

このアイテムは、後にPCが暗殺者によって殺されていることを証明するために使用することができます。

Remarks

この関数は一般的なスクリプトではほとんど役に立ちませんが、報酬に関するスクリプトの書き方としては良い例です。

Requirements

#include "nw_j_assassin"

Version

1.22

See Also

functions: | CreatePersonalItemOn | GivePlayerPersonalItem | PlayerHasPersonalItem | SetPersonalItem
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetPlaceableIllumination

Home > Reference > Functions > Effects > GetPlaceableIllumination

GetPlaceableIllumination(object)

Retrieves the current state of a placeables illumination.

int GetPlaceableIllumination(
    object oPlaceable = OBJECT_SELF
);

Parameters

oPlaceable

(Default: OBJECT_SELF)

Description

Returns TRUE if oPlaceable's illumination is on and returns FALSE if otherwise.

Version

1.22

Example

// Demonstrates how to turn on and off a placeable's illumination based on the time of day.
// Designed to be used in the OnHeartbeat event of the placeable object.

void main()
{
  if(GetTimeHour()==20)
  {
    // Sets the placables illumination state to the oposite of what it allready is
    SetPlaceableIllumination(OBJECT_SELF, !GetPlaceableIllumination());
    // Required for users to see static lighting changes
    RecomputeStaticLighting(GetArea(OBJECT_SELF));
  }
  else if(GetTimeHour()==6)
  {
    // Sets the placables illumination state to the oposite of what it allready is
    SetPlaceableIllumination(OBJECT_SELF, !GetPlaceableIllumination());
    // Required for users to see static lighting changes
    RecomputeStaticLighting(GetArea(OBJECT_SELF));
  }
}

See Also

functions: | RecomputeStaticLighting | SetPlaceableIllumination
categories: | Effects Functions

author: Tom Cassiotis, editor: Sarev0k


Function - GetPLocalInt

Home > Reference > Functions > Local Variables, Module, Party > GetPLocalInt

GetPLocalInt(object, string)

パーティ内のあるPCが持っているローカル変数の値を得ます。

int GetPLocalInt(
    object oPC,
    string sLocalName
);

Parameters

oPC

ローカル変数を探知するパーティのPC

sLocalName

値を得るローカル変数名

Description

殆どのプロットの為に、パーティのプレイヤー全てを一つのものとして検査します。

これはBioWareプロットをより便利にするでしょう。

Remarks

絶対に必要だとは限りませんが、SetPLocalIntが使用されるべきです。SetPLocalIntは全てのパーティメンバーにローカル変数を設定します。

これら２つの関数でマルチプレイヤーゲームが、出て行くプレイヤーや途中参加の新しいプレイヤーを上手く扱えるようになります。

GetPLocalIntはGetPartyLocalIntを短縮したものです。

aGetPLocalInt(object, string)と同じ物になります。

Requirements

#include "nw_i0_plot"

Version

1.28

See Also

functions: | aGetPLocalInt | aSetPLocalInt | SetPLocalInt
categories: | Local Variables Functions | Module Functions | Party Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: Rainie


Function - GetPlotFlag

Home > Reference > Functions > Get Data from Object > GetPlotFlag

GetPlotFlag(object)

オブジェクトがプロットアイテムとしてフラグ付けされているかどうかを決定します。

int GetPlotFlag(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

プロットアイテムかどうかを決定するオブジェクト。(デフォルト: OBJECT_SELF)

Description

oTargetがプロットオブジェクトであれば、TRUEを返し、そうでない場合は、FALSEを返します。

Remarks

プロットフラグはアイテムやクリーチャーにかなり影響を与えます。

プロットフラグは、アイテムやクリーチャーを破壊や死から守るように意図されています。

また、クリーチャーのAIにも影響を与えます。

例えば、プロットフラグを持っているクリーチャーは、たとえ別のクリーチャーを敵と見なしていても、そのクリーチャーを攻撃することはないでしょう。

プロットオブジェクトは、どんなダメージを受けませんし、売られることも失われることもありません。

Version

1.22

See Also

functions: | SetPlotFlag
categories: | Get Data from Object Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetPlotGiver

Home > Reference > Functions > Module Specific > GetPlotGiver

GetPlotGiver()

暗殺者のターゲット(犠牲者)を取り出します。

object GetPlotGiver();

Description

SetPlotGiver()関数によって設定された暗殺者のターゲットを表すオブジェクトを返します。

Remarks

この関数は、一般的なスクリプト作成においてはほとんど役に立ちません。

Requirements

#include "nw_j_assassin"

Version

1.22

See Also

functions: | PlotGiverDead | SetPlotGiver
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetPlotJournal

Home > Reference > Functions > Module Specific > GetPlotJournal

GetPlotJournal()

日記項目名の文字列を取り出します。

string GetPlotJournal();

Description

SetPlotJournal()関数によって格納された日記項目の認識タグを表す文字列を返します。

Remarks

この関数は、一般的なスクリプト作成においてはほとんど役に立ちません。

Requirements

#include "nw_j_rescue"

Version

1.22

See Also

functions: | SetPlotGiver | SetPlotJournal
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetPlotRingTag

Home > Reference > Functions > Module Specific > GetPlotRingTag

GetPlotRingTag()

プロットリングのタグを取り出します。

string GetPlotRingTag();

Description

SetPlotRing()によって設定されたプロットリングを表すタグを返します。

Remarks

この関数は一般的なスクリプト作成においてはほとんど役に立ちません。

Requirements

#include "nw_j_rescue"

Version

1.22

See Also

functions: | SetPlotRing
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetPlotTag

Home > Reference > Functions > Module Specific > GetPlotTag

GetPlotTag()

特定のクエストに対するプロット・タグを取り出します。

string GetPlotTag();

Description

クエストに対するプロット(または、日記)タグを返します。

Remarks

GetPlotTag関数は、特定のクエストをコントロールするBioWare社のスクリプトの一つです。

この関数は一般的なスクリプト作成ではほとんど役に立ちません。

Requirements

#include "nw_j_artifact"

Version

1.22

See Also

functions: | Global | TakeArtifactItem | TakeComplexItem | TakeStoryItem
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetPlotToken

Home > Reference > Functions > Module Specific > GetPlotToken

GetPlotToken()

プロット・トークン番号を取り出します。

int GetPlotToken();

Description

SetPlotToken()関数を使用して設定されたプロット・トークン番号を返します。

Remarks

この関数は一般的なスクリプト作成ではほとんど役に立ちません。

Requirements

#include "nw_j_assassin"

Version

1.22

See Also

functions: | SetPlotToken
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetPosition

Home > Reference > Functions > Get Data from Object > GetPosition

GetPosition(object)

クリーチャーやオブジェクトのポジションを決定します。

vector GetPosition(
    object oTarget
);

Parameters

oTarget

Description

oTargetのポジション(ベクター)を返します。

oTargetが無効なオブジェクトである場合や、その他のエラーの場合は、この関数はベクター(0.0f, 0.0f, 0.0f)を返します。

Version

1.22

See Also

functions: | Location | SetFacingPoint
categories: | Get Data from Object Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetPositionFromLocation

Home > Reference > Functions > Miscellaneous > GetPositionFromLocation

GetPositionFromLocation(location)

locationをベクトルに変換します。

vector GetPositionFromLocation(
    location lLocation
);

Parameters

lLocation

Description

lLocationの位置ベクトルを返します。

Version

1.22

See Also

functions: | SetFacingPoint
categories: | Miscellaneous Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetPrisoner

Home > Reference > Functions > Module Specific > GetPrisoner

GetPrisoner()

囚人オブジェクトを取り出します。

object GetPrisoner();

Description

救出クエストにおいて囚人を表すオブジェクトを返します。

Remarks

この関数は一般的なスクリプト作成においてはほとんど役に立ちません。

Requirements

#include "nw_j_rescue"

Version

1.22

See Also

functions: | SetPrisoner
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetRacialType

Home > Reference > Functions > Get Data from Creature > GetRacialType

GetRacialType(object)

クリーチャーの種族を得ます。

int GetRacialType(
    object oCreature
);

Parameters

oCreature

調べたいクリーチャー

Description

oCreatureの種族タイプ（RACIAL_TYPE_*）を返します。oCreatureが無効な場合はRACIAL_TYPE_INVALIDを返します。

Version

1.22

See Also

categories: | Get Data from Creature Functions
constants: | RACIAL_TYPE_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetRacialTypeCount

Home > Reference > Functions > Core AI > GetRacialTypeCount

GetRacialTypeCount(int)

20メートル以内にいる、ある種族のクリーチャーの数を決定します。

int GetRacialTypeCount(
    int nRacialType
);

Parameters

nRacialType

RACIAL_TYPE_*

Description

20メートル以内にいる指定の種族タイプのクリーチャーの数を返します。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

categories: | Core AI Functions
constants: | RACIAL_TYPE_* Constants

author: Tom Cassiotis, JP team: katsu794


Function - GetRandomDelay

Home > Reference > Functions > Math, Time > GetRandomDelay

GetRandomDelay(float, float)

２つの値の間でランダムな数値の遅延時間を出します。

float GetRandomDelay(
    float fMinimumTime = 0.4,
    float fMaximumTime = 1.1
);

Parameters

fMinimumTime

最小遅延時間(ディフォルト: 0.4)

fMaximumTime

最大遅延時間(ディフォルト: 1.1)

Description

fMinimumTimeとfMaximumTime（デフォルトはそれぞれ0.4と1.1）の２つの値の間の乱数を発生させる。最小遅延時間が最大遅延時間より大きいなど、エラーの場合は0.0fを返す。

Remarks

遅延処理に使用されている。

Requirements

#include "nw_i0_spells"

Version

1.29

See Also

functions: | Random
categories: | Math Functions | Time Functions

author: Charles Feduke, JP team: ngtaicho, Rainie


Function - GetRange

Home > Reference > Functions > Module Specific > GetRange

GetRange(int, int)

HDが範囲カテゴリーに当てはまるかどうかを決定します。

int GetRange(
    int nCategory,
    int nHD
);

Parameters

nCategory

nHDが当てはまるかどうかを調べるカテゴリー(1から6の値)。

nHD

調べるHD。

Description

nHDが、指定されたnCategoryに対して適切なレベル範囲にマッチする場合、TRUEを返し、そうでなければFALSEを返します。

例えば、レベル1からレベル5のキャラクターは、カテゴリー1に該当すると考えられます。

Remarks

BioWare社は、財宝生成、罠キットを含むモジュールにおいて多くの局面調整をサポートするためにこの関数を使用します。

範囲 1: 0-5 HD
範囲 2: 6-8 HD
範囲 3: 9-10 HD
範囲 4: 11-13 HD
範囲 5: 14-16 HD
範囲 6: 17-100 HD

Requirements

#include "nw_o2_coninclude"

Version

1.22

See Also

categories: Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetRangedAttackGroup

Home > Reference > Functions > Prototyped but Unused > GetRangedAttackGroup

GetRangedAttackGroup(int)

この関数は試作されたましたが、使用されていません。

object GetRangedAttackGroup(
    int bAllowFriendlyFire = FALSE
);

Parameters

bAllowFriendlyFire

(Default: FALSE)

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Version

1.22

See Also

categories: Prototyped but Unused Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: katsu794


Function - GetReactionAdjustment

Home > Reference > Functions > Alignment, Money, Reputation/Faction > GetReactionAdjustment

GetReactionAdjustment(object)

店価格を調整する影響値を得ます。

float GetReactionAdjustment(
    object oTarget
);

Parameters

oTarget

Description

店価格を調整する影響値を得ます。デフォルトのファクション修正値は2.0（およそ200%の値上げ率）に設定されていますが、目標が来訪者と友好的な場合、1.0に設定されます。

その後、それは、来訪者と目標の間のロー/カオスレベルを比較し、それらの間の数値の違いを得ます。それは、グッド/イビルでも同様なことをし、両方の違いをともに加えます。

その後、スクリプトは最終の反応調整を出すために次の定式を適用します：

（10 + アライメント間の数値の差 - 目標のカリスマ修正値ｘ10）ｘファクション修正値

Remarks

この関数はnw_i0_plot.nssの875行目で見つけることができます。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Alignment Functions | Money Functions | Reputation/Faction Functions

author: John Shuell, JP team: Rainie


Function - GetReflexAdjustedDamage

Home > Reference > Functions > Saving Throw > GetReflexAdjustedDamage

GetReflexAdjustedDamage(int, object, int, int, object)

セービングスローが適用された後の、適用されるダメージを決める。

int GetReflexAdjustedDamage(
    int nDamage,
    object oTarget,
    int nDC,
    int nSaveType = SAVING_THROW_TYPE_NONE,
    object oSaveVersus = OBJECT_SELF
);

Parameters

nDamage

調整されない場合に適用されるであろう、全ダメージ

oTarget

ダメージの対象

nDC

ダメージを避ける（または減らす）ために必要な難易度。この値のためにGetSpellSaveDC関数を使うことができる。

nSaveType

SAVING_THROW_TYPE_* (デフォルト：SAVING_THROW_TYPE_NONE)

oSaveVersus

潜在的なダメージの源(デフォルト：OBJECT_SELF)

Description

反応と回避のセービングスローでnDamageが調整された後で、oTargetが受け取るのはnDamageのどれくらいかを返す。

Remarks

D&Dのルールで規定されているように、反応と回避のセーブを考慮することによってカスタムな罠や特別な能力のような新しい効果をシミュレートするスクリプトの中で、この関数を使うことができる。

Version

1.22

See Also

functions: | GetSpellSaveDC
categories: | Saving Throw Functions
constants: | SAVING_THROW_TYPE_* Constants

author: Tom Cassiotis, JP team weed


Function - GetReflexSavingThrow

Home > Reference > Functions > Saving Throw > GetReflexSavingThrow

GetReflexSavingThrow(object)

クリーチャー、ドア、配置物の反応セービングスローのベース値を取得する。

int GetReflexSavingThrow(
    object oTarget
);

Parameters

oTarget

セービングスローを取得する先である、クリーチャー、ドア、配置物

Description

oTargetの反応セーブのベース値を返す（クリーチャー、ドア、配置物に対してのみ、はたらく）。oTargetが不正な場合は0を返す。

Version

1.22

See Also

functions: | GetFortitudeSavingThrow
categories: | Saving Throw Functions

author: Tom Cassiotis, JP team: weed


Function - GetReputation

Home > Reference > Functions > Reputation/Faction > GetReputation

GetReputation(object, object)

あるクリーチャーが別のクリーチャーに対してどのように感じるか調べます。

int GetReputation(
    object oSource,
    object oTarget
);

Parameters

oSource

oTargetの感情の対象となるクリーチャー（もしくはオブジェクト）

oTarget

我々がどのような感情を持っているか知りたいクリーチャー（もしくはオブジェクト）

Description

oSourceがoTargetに対してどのように感じているか、0から100の整数値を返します。

oSourceやoTargetが無効オブジェクトであれば-1を返します。

Remarks

この関数により返される値の翻訳：

0-10 oSourceはoTargetに対して敵対

11-89 oSourceはoTargetに対して中立

90-100 oSourceはoTargetに対して友好

Version

1.22

See Also

functions: | ClearAllFactionMembers | ClearPersonalReputation | GetFactionAverageReputation
categories: | Reputation/Faction Functions

author: Tom Cassiotis, JP team: Redondo


Function - GetResRef

Home > Reference > Functions > Get Data from Object > GetResRef

GetResRef(object)

オブジェクトのResRefを返します。

string GetResRef(
    object oObject
);

Parameters

oObject

ResRefを返すオブジェクト。

Description

oObjectのResRef(リソース参照)を返します。

ResRefは、おおよそパレット上でオブジェクトが何であるかを識別します。

例えば、オブジェクトを作成する時には、タグではなくResRefを使用しなければなりません。

従って、GetResRef関数を使用してオブジェクトのコピーを作成するとこができます。(しかし、現在はCopyObject関数があるので、この関数を使う必要もないでしょう。)

エラー時には、空文字列("")を返します。

Known Bugs

ゲーム内においては、スタックされたアイテムが分けられた場合、新しいスタックの一つがresrefを持ちます。他のスタックのresrefは、空文字列を持つでしょう。

また、それらを再スタックすると空の方のスタックのResRefが追加されるので、スタックできるアイテムを取り扱う時には、ResRefが無い状態で終わる可能性が十分あります。

Version

1.29

Example

// クリーチャーをタグ"wp_respawn"のウェイポイントに再生成するためには、
// このスクリプトをクリーチャーのOnDeathイベントに加えて下さい。
// パレット上のクリーチャーは、死んでいるクリーチャーと同じである必要があることに注意して下さい。
// 実際には、再生成するクリーチャーは、新たにパレットから作成されます。Lilac Soul
void main()
{
     string sRes=GetResRef(OBJECT_SELF);
     object oTarget=GetWaypointByTag("wp_respawn");
     location lLoc=GetLocation(oTarget);
     CreateObject(OBJECT_TYPE_CREATURE, sRes, lLoc);
}

See Also

categories: Get Data from Object Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Harald Schuster, JP team: katsu794


Function - GetRingGivenTo

Home > Reference > Functions > Module Specific > GetRingGivenTo

GetRingGivenTo()

リングが与えられたPCを取り出します。

object GetRingGivenTo();

Description

SetRingGivenTo関数によってリングを与えられたPCを返します。

Remarks

この関数は一般的なスクリプト作成においてはほとんど役に立ちません。

Requirements

#include "nw_j_rescue"

Version

1.22

See Also

functions: | GiveRingToPlayer | PlayerHasRing | SetRingGivenTo
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetRunState

Home > Reference > Functions > Prototyped but Unused > GetRunState

GetRunState()

この関数は試作されたましたが、使われていません。

int GetRunState();

Description

この関数は試作されたましたが、使われていません。

Requirements

#include "nw_ch_fighter1"

Version

1.22

See Also

categories: Prototyped but Unused Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetScaledDuration

Home > Reference > Functions > Spells > GetScaledDuration

GetScaledDuration(int, object)

ゲーム難易度設定に基づく効果時間短縮をさせます。

int GetScaledDuration(
    int nActualDuration,
    object oTarget
);

Parameters

nActualDuration

通常の呪文効果時間

oTarget

呪文の対象

Description

難易度設定に基づいて計算される効果時間短縮を示す整数を返します。

Remarks

この関数はターゲットがPCで、ゲーム難易度（GAME_DIFFICULT_*）がノーマルかそれ以下の場合に限り、呪文効果を短縮します。これが呪文が有益かどうか、またそれによって呼出者の恐らく意図しない有益な呪文を短縮しないことに注意してください。

nw_i0_spells.nssの31行目で見つかります。

Requirements

#include "nw_i0_spells"

Version

1.22

See Also

categories: Spells Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetScaledEffect

Home > Reference > Functions > Spells > GetScaledEffect

GetScaledEffect(effect, object)

ゲーム難易度に基づく新しいエフェクトを作成します。

effect GetScaledEffect(
    effect eStandard,
    object oTarget
);

Parameters

eStandard

エフェクト

oTarget

エフェクトの対象

Description

oTargetがPCまたはPCに従うヘンチマンの場合、ゲーム難易度（GAME_DIFFICULTY_*）に基づくeStandardを置き換えるために意図されたエフェクトを返します。

Remarks

具体的には：
1) effectが恐怖で、ゲーム難易度がベリーイージーの場合、攻撃ロールのペナルティーは-2に置き換えられます。

2) effectが恐怖で、ゲーム難易度がイージーの場合、攻撃ロールのペナルティーは-4に置き換えられます。

3) ゲーム難易度がベリーイージーの場合、麻痺、朦朧、混乱のeffectは幻惑effectに置き換えられます。

4) ゲーム難易度の設定に関わらず、魅了と支配のeffectは幻惑effectに置き換えられます。

Requirements

#include "nw_i0_spells"

Version

1.22

See Also

categories: | Spells Functions
constants: | GAME_DIFFICULTY_* Constants

author: Tom Cassiotis, JP team: geshi, Rainie


Function - GetSittingCreature

Home > Reference > Functions > Get Data from Object > GetSittingCreature

GetSittingCreature(object)

特定のオブジェクトにどのクリーチャーが座っているかを決定します。

object GetSittingCreature(
    object oChair
);

Parameters

oChair

クリーチャーが座っているかどうかを調べるオブジェクト。

Description

oChairに現在座っているクリーチャーを返します。

oChairが無効な配置可能オブジェクトである場合、またはoChairに誰も座っていない場合には、OBJECT_INVALIDを返します。

Version

1.22

See Also

categories: Get Data from Object Functions

author: Tom Cassiotis, JP team: katsu794


Function - GetSkillRank

Home > Reference > Functions > Talents/Skills/Feats > GetSkillRank

GetSkillRank(int, object)

クリーチャーの指定したスキルの値を得ます。

int GetSkillRank(
    int nSkill,
    object oTarget = OBJECT_SELF
);

Parameters

nSkill

SKILL_*

oTarget

nSKillの値を調べるクリーチャー（デフォルト：OBJECT_SELF）

Description

oTargetの持つnSkillの値を返します。

nSkillが未修得のとき、この関数は0を返します。oTargetがnSkillを所有してなければ-1を返します。

Version

1.22

Example

// このスクリプトはプレイヤーがマスターバードと
// 芸の比べあいを挑むカンバーセーションに組み込む。

// オブジェクト初期化
object oPlayer = GetPCSpeaker();
// スキルチェック
int iPPerCheck = d20(1) + GetSkillRank(SKILL_PERFORM, oPlayer);
int iMPerCheck = d20(1) + GetSkillRank(SKILL_PERFORM, OBJECT_SELF);
// 2つのスキルチェックを比べる
if (iPPerCheck > iMPerCheck)
{
     // プレイヤーが勝った際の
    // 報酬プログラムをここに置く
}
else
{
     // プレイヤーが負けた際の
    // 失敗プログラムをここに置く
}

See Also

functions: | ActionUseSkill
categories: | Talents/Skills/Feats Functions
constants: | SKILL_* Constants

author: Tom Cassiotis, editor: Jeremy Spilinek, JP team: Rainie


Function - GetSpawnInCondition

Home > Reference > Functions > Core AI, Get Data from Creature > GetSpawnInCondition

GetSpawnInCondition(int)

クリーチャーが、BioWareのコアAIシステムによって設定されたある特定の状態を持っているかどうかを決定します。

int GetSpawnInCondition(
    int nCondition
);

Parameters

nCondition

NW_FLAG_*

Description

この関数を呼び出したオブジェクト(OBJECT_SELF)に、nConditionが設定されている場合はTRUEを返し、そうでない場合はFALSEを返します。

Remarks

生成状態は、クリーチャーにある特定のことをさせるためにBioWareのコアAIスクリプト上で動作するOnSpawnスクリプト中に設定できるクリーチャーの行動です。

デフォルトのOnSpawnスクリプト中のSetSpawnInConditon()の行はコメントアウトして、別名で保存することが賢明といえます。

NW_FLAG_*が何をするかについては、個々の定数に関する解説を見て下さい。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

functions: | PlayMobileAmbientAnimations | SetSpawnInCondition
categories: | Core AI Functions | Get Data from Creature Functions
constants: | NW_FLAG_* Constants
events: | OnSpawn Event

author: Charles Feduke, editor: Tom Cassiotis, JP team: katsu794


Function - GetSpellBreachProtection

Home > Reference > Functions > Spells > GetSpellBreachProtection

GetSpellBreachProtection(int)

17個のリストから次の防御魔法を返します。

int GetSpellBreachProtection(
    int nLastChecked
);

Parameters

nLastChecked

チェックする最後の防御魔法の指定

Description

17個のリストから次の防御魔法を返します。基本的に17個の呪文識別アレイを擬似化しています。

1 = グレーター･スペル･マントル

2 = プレモニション

3 = スペル･マントル

4 = シャドー･シールド

5 = グレーター･ストーン･スキン

6 = エセリアル･ヴィゼッジ

7 = グローブ･オブ･インヴァルネラビリティ

8 = エナジー･バッファー

9 = マイナー･グローブ･オブ･インヴァルネラビリティ

10 = ストーン･スキン

11 = レッサー･スペル･マントル

12 = エレメンタル･シールド

13 = プロテクション･フロム･エレメンツ

14 = レジスト･エレメンツ

15 = ゴーストリー･ヴィゼッジ

16 = エンデュア･エレメンツ

17 = メイジ･アーマー

Remarks

nw_i0_spells.nssの35行目で見つかります。
RemoveProtections()と関連して使用し、GetSpellBreachProtection()はモルデンカイネンズ･ディスジャンクションと同じように強い呪文を妨害し、弱体化させるために使用されます。

GetSpellBreachProtection()はそれ自体で使用されることは多くなく、この関数は稀でしょう。

Requirements

#include "nw_i0_spells"

Version

1.22

See Also

functions: | RemoveProtections
categories: | Spells Functions
constants: | SPELL_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - GetSpellCastItem

Home > Reference > Functions > Spells > GetSpellCastItem

GetSpellCastItem()

呪文スクリプトを呼び出したobjectを得ます。

object GetSpellCastItem();

Description

実行されている呪文を詠唱したObjectを返します。

Remarks

厳格には呪文、または呪文能力effectを処理するスクリプトに入れて使用します。この関数は既存の呪文や呪文能力（Biowareによってスクリプト化された物やscripts.bifで見つかるスクリプト）を編集していなければ使用すべきではありません。

呪文のスクリプトを書き換え、モジュール内（またはHakパック）に保存することで、Biowareの呪文や呪文の能力（例、フレイム・ストライク用のファイル:NW_S0_FLMSTRIKE）を書き換えることが出来ます。

現在、（筆者の知る限り）既存の呪文や呪文能力を上書きすることができるだけで、新しく呪文を追加する方法はありません。

Version

1.22

See Also

categories: Spells Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetSpellEffectDelay

Home > Reference > Functions > Spells > GetSpellEffectDelay

GetSpellEffectDelay(location, object)

effectの遅延時間を得ます。

float GetSpellEffectDelay(
    location locSpellTargetLocation,
    object oTarget
);

Parameters

locSpellTargetLocation

呪文effectの開始位置（通常はGetLocation(OBJECT_SELF)）

oTarget

呪文effectの目標

Description

effectが適用されるまでの遅延時間を秒で返します。

Remarks

nw_i0_spells.nss: 25

Requirements

#include "nw_i0_spells"

Version

1.22

See Also

categories: Spells Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetSpellId

Home > Reference > Functions > Spells > GetSpellId

GetSpellId()

呪文の識別を得ます。

int GetSpellId();

Description

スクリプトで実行中の呪文のID（SPELL_*）を返します。

プログラムの再利用の為に呪文のeffectを扱う複数の呪文が同一スクリプトに割り当てられていますが、書付は動作中の特定呪文によってわずかに変化します。

例えば、ポリモーフセルフのスクリプト（スクリプト名 NW_S0_POLYSELF）は、変身するモンスターによって異なる呪文から呼出されます。

Remarks

厳格には、呪文や呪文の能力を扱うスクリプトの中で使用し、この関数は既存の呪文や呪文能力（Biowareによってスクリプト化された物やscripts.bifで見つかるスクリプト）を編集していなければ使用すべきではありません。

呪文のスクリプトを書き換え、モジュール内（またはHakパック）に保存することで、Biowareの呪文や呪文の能力（例、フレイム・ストライク用のファイル:NW_S0_FLMSTRIKE）を書き換えることが出来ます。

現在、（筆者の知る限り）既存の呪文や呪文能力を上書きすることができるだけで、新しく呪文を追加する方法はありません。

Version

1.24

Example

//::///////////////////////////////////////////////
//:: Polymorph Self
//:: NW_S0_PolySelf.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    The PC is able to changed their form to one of
    several forms.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 21, 2002
//:://////////////////////////////////////////////

void main()
{
    //Declare major variables
    int nSpell = GetSpellId();
    object oTarget = GetSpellTargetObject();
    effect eVis = EffectVisualEffect(VFX_IMP_POLYMORPH);
    effect ePoly;
    int nPoly;
    int nMetaMagic = GetMetaMagicFeat();
    int nDuration = GetCasterLevel(OBJECT_SELF);
    //Enter Metamagic conditions
    if (nMetaMagic == METAMAGIC_EXTEND)
    {
        nDuration = nDuration *2; //Duration is +100%
    }

    //Determine Polymorph subradial type
    if(nSpell == 387)
    {
        nPoly = POLYMORPH_TYPE_GIANT_SPIDER;
    }
    else if (nSpell == 388)
    {
        nPoly = POLYMORPH_TYPE_TROLL;
    }
    else if (nSpell == 389)
    {
        nPoly = POLYMORPH_TYPE_UMBER_HULK;
    }
    else if (nSpell == 390)
    {
        nPoly = POLYMORPH_TYPE_PIXIE;
    }
    else if (nSpell == 391)
    {
        nPoly = POLYMORPH_TYPE_ZOMBIE;
    }
    ePoly = EffectPolymorph(nPoly);
    //Fire cast spell at event for the specified target
    SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_POLYMORPH_SELF, FALSE));

    //Apply the VFX impact and effects
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, oTarget, TurnsToSeconds(nDuration));
}

See Also

functions: | GetLastSpell
categories: | Spells Functions
constants: | SPELL_* Constants

author: Tom Cassiotis, editor: Charles Feduke, JP team: Rainie


Function - GetSpellSaveDC

Home > Reference > Functions > Saving Throw, Spell Casting Effects, Spells > GetSpellSaveDC

GetSpellSaveDC()

詠唱呪文をセーブするのに必要なDCを調べます。

int GetSpellSaveDC();

Description

呪文をセーブするのに必要なDCの数値を返します。

（10 + 呪文レベル + 関連アビリティボーナス）

これは呪文の影響を受けるクリーチャーが特定の効果に対してセービングスローを行うために、クリーチャーもしくは効果範囲オブジェクトによって呼び出されます。

Version

1.22

See Also

functions: | GetLastSpell | GetReflexAdjustedDamage
categories: | Saving Throw Functions | Spell Casting Effects Functions | Spells Functions

author: Tom Cassiotis, JP team: Redondo


Function - GetSpellTargetLocation

Home > Reference > Functions > Spells > GetSpellTargetLocation

GetSpellTargetLocation()

呪文の目標のlocationを得ます。

location GetSpellTargetLocation();

Description

呼出者の最後の呪文の目標のlocationを返します。

Remarks

厳格には、呪文や呪文の能力を扱うスクリプトの中で使用し、この関数は既存の呪文や呪文能力（Biowareによってスクリプト化された物やscripts.bifで見つかるスクリプト）を編集していなければ使用すべきではありません。

呪文のスクリプトを書き換え、モジュール内（またはHakパック）に保存することで、Biowareの呪文や呪文の能力（例、フレイム・ストライク用のファイル:NW_S0_FLMSTRIKE）を書き換えることが出来ます。

現在、（筆者の知る限り）既存の呪文や呪文能力を上書きすることができるだけで、新しく呪文を追加する方法はありません。

Version

1.22

See Also

categories: Spells Functions

author: Tom Cassiotis, JP team: Rainie


Function - GetSpellTargetObject

Home > Reference > Functions > Spells > GetSpellTargetObject

GetSpellTargetObject()

呼出者の最後の呪文の目標objectを得ます。

object GetSpellTargetObject();

Description

OBJECT_SELFの最後に詠唱した呪文の目標objectを返します。有効な目標ではない場合、OBJECT_INVALIDを返します。OBJECT_SELFが呪文を詠唱できなければ、エラーを引き起こします。

Version

1.28

See Also

categories: Spells Functions

author: Charles Feduke, additional contributor(s): Glenn Berden, JP team: Rainie


Function - GetStandardFactionReputation

Home > Reference > Functions > Reputation/Faction > GetStandardFactionReputation

GetStandardFactionReputation(int, object)

クリーチャーのファクション値を調べます。（与えられた標準ファクショングループ内について）。

int GetStandardFactionReputation(
    int nStandardFaction,
    object oCreature = OBJECT_SELF
);

Parameters

nStandardFaction

STANDARD_FACTION_*

oCreature

ファクション値を調べるターゲット(デフォルト: OBJECT_SELF)

Description

nStandardFactionで示される標準ファクショングループ内のoCreatureのファクション値を0から100の数値で返します。

Version

1.22

See Also

functions: | ClearAllFactionMembers | ClearPersonalReputation | SetStandardFactionReputation
categories: | Reputation/Faction Functions
constants: | STANDARD_FACTION_* Constants

author: Daniel Beckman, JP team: Redondo


Function - GetStartingLocation

Home > Reference > Functions > Module > GetStartingLocation

GetStartingLocation()

モジュールのスタート位置を調べます。

location GetStartingLocation();

Description

モジュール内のプレイヤーのスタート位置を返します。

Remarks

1.25パッチではGetStartLocationが有効な関数となっています。この関数（GetStartingLocation）が不適当なのかそれとも両方とも有効なのかはわかりません。

※バージョン1.32ではGetStartingLocation()のみ存在します。

Version

1.25

Example

// 対象をモジュールのスタート位置へ転送します
void main()
{
    location lStartingLoc = GetStartingLocation();
    ActionJumpToLocation(lStartingLoc);
}

See Also

functions: | ActionJumpToLocation | GetLocation
categories: | Module Functions

author: Daniel Beckman, editor: Charles Feduke, JP team: Redondo


Function - GetStartLocation

Home > Reference > Functions > Module > GetStartLocation

GetStartLocation()

モジュールのスタート位置を調べます。

location GetStartLocation();

Description

モジュール内のプレイヤーのスタート位置を返します。

Remarks

1.25パッチではGetStartLocationが有効な関数となっています。この関数（GetStartingLocation）が不適当なのかそれとも両方とも有効なのかはわかりません。

※バージョン1.32ではこの関数は存在しないようです。GetStartingLocationを使用してください。

Version

1.25

See Also

categories: Module Functions

author: Charles Feduke, JP team: Redondo


Function - GetStealthMode

Home > Reference > Functions > Get Data from Creature > GetStealthMode

GetStealthMode(object)

指定したクリーチャーが隠密（ステルス）モードかどうかを調べます。

int GetStealthMode(
    object oCreature
);

Parameters

oCreature

隠密を使用しているかどうかを調べるクリーチャー

Description

oCreatureが隠密を使用していればSTEALTH_MODE_ACTIVATEDを、使用していなければSTEALTH_MODE_DISABLEDを返します。

Version

1.23

Example

// トリガーのOnEnterイベントに使用する
object oPC = GetEnteringObject();
if ( GetIsPC(oPC) ) {
    // 通常時に起こる事をここに置く、しかし指定されたクリーチャーが
    // 隠密を使用していれば避ける機会を与える
    if ( GetStealthMode( oPC ) == STEALTH_MODE_ACTIVATED ) {
        int nDC = 15;    // 避ける為に必要な難易度
        int nQuiet = GetSkillRank( SKILL_MOVE_SILENTLY, oPC );
        if ( (nQuiet >= 0) && (d20() + nQuiet >= nDC) ) {
            // プレイヤーは無事に避けることが出来る
            return;
         }
    }
    // 隠密をしていなかった場合に起こる、何か良くない出来事を置く。
}

See Also

categories: Get Data from Creature Functions

author: Drake Coker, editor: Charles Feduke, JP team: Rainie


Function - GetStolenFlag

Home > Reference > Functions > Inventory > GetStolenFlag

GetStolenFlag(object)

アイテムが盗まれたものかどうかを調べます。

int GetStolenFlag(
    object oItem
);

Parameters

oItem

盗まれたものかどうかを調べるアイテム。

Description

それが盗まれたアイテムであった場合TRUEを返します。

Version

1.27

See Also

categories: Inventory Functions

author: Charles Feduke, additional contributor(s): Mark Harshfield, JP team: NamaYake


Function - GetStoryItem

Home > Reference > Functions > Module Specific > GetStoryItem

GetStoryItem()

公式キャンペーンからのプロット・アイテムを表す文字列を返します。

string GetStoryItem();

Description

"NW_J_STORY_ITEM"という変数内の、"NW_J_STORY_MYGLOBALS"という名前のローカルオブジェクト変数に保管された文字列を返します。

Remarks

nw_j_story.nssの114行目にあります。

公式キャンペーン以外では利用されません。

Requirements

#include "nw_j_story"

Version

1.22

See Also

functions: | GetArtifactItem | GetComplexItem | Global | SetStoryItem | TakeComplexItem | TakeStoryItem
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetStringByStrRef

Home > Reference > Functions > String > GetStringByStrRef

GetStringByStrRef(int, int)

Determines translated string by string reference.

string GetStringByStrRef(
    int nStrRef,
    int nGender = GENDER_MALE
);

Parameters

nStrRef

Target string reference.

nGender

Gender of the string for some languages (Default: GENDER_MALE)

Description

Returns a translated string from the talk table using the string reference indicated by nStrRef.

nStrRef can be any of the following constants:

Combat:
COMBAT_ATTACK
COMBAT_CHARGE
COMBAT_FLANK
COMBAT_RETREAT
COMBAT_2ME
COMBAT_EATHALFLING
COMBAT_GIANTCHOP
COMBAT_EATGNOME
COMBAT_MORADINHAMMER
COMBAT_KEELRANGER
COMBAT_GRAPTHARHAMMER
COMBAT_MEKILLYOU
COMBAT_SPOOOON

Movement:
MOVE_FOLLOW
MOVE_STAYCLOSE
MOVE_HALFLINGSCOUT
MOVE_WAITHERE
MOVE_MARCHINGORDER
MOVE_SPREADOUT
MOVE_QUIETLYNOW
MOVE_SEARCHPATTERN
MOVE_YOULEADBEHINDYOU
MOVE_FASTERFASTER

Roleplay:
ROLEPLAY_HOTHERE
ROLEPLAY_SHOWGOODS
ROLEPLAY_WYRMHALFLING
ROLEPLAY_TALKORDIE
ROLEPLAY_TALKPRIVATELY
ROLEPLAY_ONLYDRESSES
ROLEPLAY_THROWHALFLING
ROLEPLAY_ADVENTURESWAG
ROLEPLAY_PLAGUE
ROLEPLAY_BRUENOR
ROLEPLAY_BARBLEED
ROLEPLAY_NOOBER

Spellcasting:
CASTING_VEILOFMYSTRA
CASTING_SUMMONBADGER
CASTING_SHRINK
CASTING_KUOTOABOOM

Remarks

Referenced strings from the talk table are automatically translated into the operating system's default language.

Currently, there doesn’t seem to be a way to update the talk table to add custom string references.

With patch 1.31, a gender option has been added to the function, with a default value of GENDER_MALE. This is useful as some languages will have different strings depending on the gender of the speaker. It is unknown if providing a GENDER_FEMALE value for a language which doesn't support that will provide the same result as with GENDER_MALE, or if the function errors.

Version

1.31

See Also

categories: | String Functions
constants: | GENDER_* Constants

author: Daniel Beckman, editor: Lilac Soul, additional contributor(s): NWVault via Crag Hack, Lilac Soul


Function - GetStringLeft

Home > Reference > Functions > String > GetStringLeft

GetStringLeft(string, int)

文字列の中からサブ文字列を取得する

string GetStringLeft(
    string sString,
    int nCount
);

Parameters

sString

ターゲットの文字列

nCount

サブ文字列の長さ

Description

sStringの左端からnCountの文字を含むサブ文字列を返す。エラーの際は空の文字列を返す。

Remarks

負の値のnCountは不正とみなされ、空の文字列が返されるだろう。

Version

1.22

Example

void main()
{
     // "Hello"と言う
    string sMessage = "Hello World!";
    SpeakString(GetStringLeft(sMessage, 5));
}

See Also

functions: | GetStringRight | GetSubString
categories: | String Functions

author: Kristian Markon, editor: Daniel Beckman, JP team: weed


Function - GetStringLength

Home > Reference > Functions > String > GetStringLength

GetStringLength(string)

文字列の長さを測る

int GetStringLength(
    string sString
);

Parameters

sString

長さを測りたいターゲットの文字列

Description

sStringの長さを返す。エラー時は-1を返す。

Version

1.22

Example

void main()
{
    string sStr = "Hello World";
    int nLen = GetStringLength(sStr);
}

See Also

categories: String Functions

author: Daniel Beckman, JP Team: weed


Function - GetStringLowerCase

Home > Reference > Functions > String > GetStringLowerCase

GetStringLowerCase(string)

文字列を小文字に変換する

string GetStringLowerCase(
    string sString
);

Parameters

sString

小文字に変換するターゲットの文字列

Description

小文字に変換されたsStringを返す。エラー時は空の文字列を返す。

Version

1.22

Example

void main()
{
    // ""hello world!"と言う

    string sMessage = "HELLO WORLD!";
    SpeakString(GetStringLowerCase(sMessage));
}

See Also

functions: | GetStringUpperCase
categories: | String Functions

author: Kristian Markon, editor: Daniel Beckman, JP Team: weed


Function - GetStringRight

Home > Reference > Functions > String > GetStringRight

GetStringRight(string, int)

文字列の中からサブ文字列を取得する

string GetStringRight(
    string sString,
    int nCount
);

Parameters

sString

ターゲットの文字列

nCount

サブ文字列の長さ

Description

sStringの右端からnCount個の文字を含むサブ文字列を返す。エラー時は空の文字列を返す

Remarks

負の値のnCountは不正とみなされ、空の文字列が返されるだろう。

Version

1.22

Example

void main()
{
     // "World!"と言う
    string sMessage = "Hello World!";
    SpeakString(GetStringRight(sMessage, 6));
}

See Also

functions: | GetStringLeft | GetSubString
categories: | String Functions

author: Kristian Markon, editor: Daniel Beckman, JP Team: weed


Function - GetStringUpperCase

Home > Reference > Functions > String > GetStringUpperCase

GetStringUpperCase(string)

文字列を大文字に変換する。

string GetStringUpperCase(
    string sString
);

Parameters

sString

大文字に変換するターゲットの文字列

Description

小文字に変換されたsStringを返す。エラー時は空の文字列を返す。

Version

1.22

Example

void main()
{
    // HELLO WORLD!"と言う
    string sMessage = "hello world!";
    SpeakString(GetStringUpperCase(sMessage));
}

See Also

functions: | GetStringLowerCase
categories: | String Functions

author: Kristian Markon, editor: Daniel Beckman, JP Team: weed


Function - GetStrRefSoundDuration

Home > Reference > Functions > Sound Effects > GetStrRefSoundDuration

GetStrRefSoundDuration(int)

文字リファレンスの接続する付随する音の所要時間を調べます。

float GetStrRefSoundDuration(
    int nStrRef
);

Parameters

nStrRef

対象の文字リファレンス

Description

文字リファレンスnStrRefに付随する音の所要時間（秒）を返します。所要時間がない、もしくは文字リファレンス音がなければ0.0を返します。

Version

1.22

See Also

categories: Sound Effects Functions

author: Daniel Beckman, JP team: Redondo


Function - GetSubRace

Home > Reference > Functions > Get Data from Creature > GetSubRace

GetSubRace(object)

クリーチャーのサブ種族を得ます。

string GetSubRace(
    object oCreature
);

Parameters

oCreature

目標のクリーチャー

Description

oCreatureのサブ種族名を返します。oCreatureが無効であったり、サブ種族を持っていない場合は空白の文字列を返します。

Version

1.22

Example

void main()
{
    // このクリーチャー自身のサブ種族を告げる
    string sSubRace = GetSubRace(OBJECT_SELF);
    SpeakString(sSubRace);
}

See Also

functions: | SetSubRace
categories: | Get Data from Creature Functions

author: Daniel Beckman, editor: Charles Feduke, JP team: Rainie


Function - GetSubString

Home > Reference > Functions > String > GetSubString

GetSubString(string, int, int)

文字列の中からサブ文字列を取得する

string GetSubString(
    string sString,
    int nOffset,
    int nCount
);

Parameters

sString

ターゲットの文字列

nOffset

文字のオフセット

nCount

サブ文字列の文字の数

Description

sStringのサブ文字列（nCountの文字数で、nOffsetのオフセットから始まる）を返す。 エラー時は、空の文字列を返す。

Remarks

パラメータnOffsetは、文字列の最初の文字を示すのに、0から始まる。 1は2番目の文字、2は3番目の文字といったようにである。

Version

1.22

Example

void main()
{
    string sString = "Hello World!";

    // "Hello"と言う
    SpeakString(GetSubString(sString, 0, 5));

    // "World!"と言う
    SpeakString(GetSubString(sString, 6, 6));
}

See Also

functions: | GetStringLeft | GetStringRight
categories: | String Functions

author: Kristian Markon, editor: Daniel Beckman, JP Team: weed


Function - GetTag

Home > Reference > Functions > Get Data from Object > GetTag

GetTag(object)

objectのタグを取得します

string GetTag(
    object oObject
);

Parameters

oObject

対象のobject

Description

oObjectのタグを返します。oObjectが有効でない場合は空白の文字列を返します。

Version

1.22

Example

void main()
{
    string sTag = GetTag(OBJECT_SELF);
    object oSelf = GetObjectByTag(sTag);
}

See Also

functions: | GetLastWeaponUsed | GetObjectByTag
categories: | Get Data from Object Functions

author: Daniel Beckman, editor: Lilac Soul, JP team: geshi, Rainie


Function - GetTileMainLight1Color

Home > Reference > Functions > Area, Get Data from Object, Lighting Effects > GetTileMainLight1Color

GetTileMainLight1Color(location)

タイルの主照明１の色を調べます。

int GetTileMainLight1Color(
    location lTile
);

Parameters

lTile

タイルの位置

Description

lTileにあるタイルの主照明１の色 (TILE_MAIN_LIGHT_COLOR_*)を返します。

Remarks

これは直感的な計算関数のうちのひとつです。位置によって指定された具体的なタイルについて影響します。また、タイルを決めるために用いられた位置（location）はオブジェクトを決めるために用いられた位置（location）と異なり、タイル内の位置の整数部分によって決められます。

または、タイルがゼロから数える整数行列に基づいているのを思い出せば、3×3エリアの左下のタイルはメンバベクトルx と y = 0という位置オブジェクトで表されます。

Version

1.26

Example

// 最初に、タイルがどのエリアにあるかを与えます
string sArea = "My Area Name";

// 次に、特定のタイルの識別に使う新しいベクトルを作ります
vector vTile = Vector(0.0, 0.0, 0.0);

// 次に、指定するタイルの位置を作ります、この場合は
// エリア内の0,0です
location lTile = Location(GetObjectByTag(sAreaTag, 0), vTile, 0.0);

// 位置lTileを使って、知りたいタイルの色を得ます
int iLight = GetTileMainLight1Color (lTile);

// ---
// 最初に、タイルがどのエリアにあるかを与えます
string sArea = "My Area Name";

// 次に、特定のタイルの識別に使う新しいベクトルを作ります

// 次に、指定するタイルの位置を作ります、この場合は
// エリア内の2列目、下から3番目のタイルです（左下から0を含んで数えます）

// 位置lTileを使って、知りたいタイルの色を得ます

See Also

functions: | GetTileMainLight2Color | GetTileSourceLight1Color | GetTileSourceLight2Color | RecomputeStaticLighting
categories: | Area Functions | Get Data from Object Functions | Lighting Effects Functions
constants: | TILE_MAIN_LIGHT_COLOR_* Constants

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Roy Fisher, JP team: Redondo


Function - GetTileMainLight2Color

Home > Reference > Functions > Area, Lighting Effects > GetTileMainLight2Color

GetTileMainLight2Color(location)

タイルの主照明２の色を調べます。

int GetTileMainLight2Color(
    location lTile
);

Parameters

lTile

タイルの位置

Description

lTileにあるタイルの主照明２の色 (TILE_MAIN_LIGHT_COLOR_*)を返します。

Remarks

これは直感的な計算関数のうちのひとつです。位置によって指定された具体的なタイルについて影響します。また、タイルを決めるために用いられた位置（location）はオブジェクトを決めるために用いられた位置（location）と異なり、タイル内の位置の整数部分によって決められます。

または、タイルがゼロから数える整数行列に基づいているのを思い出せば、3×3エリアの左下のタイルはメンバベクトルx と y = 0という位置オブジェクトで表されます。

例はGetTileMainLight1Colorを参考。

Version

1.26

See Also

functions: | GetTileMainLight1Color | GetTileSourceLight1Color | GetTileSourceLight2Color | RecomputeStaticLighting
categories: | Area Functions | Lighting Effects Functions
constants: | TILE_MAIN_LIGHT_COLOR_* Constants

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Michael Nork, JP team: Redondo


Function - GetTileSourceLight1Color

Home > Reference > Functions > Lighting Effects > GetTileSourceLight1Color

GetTileSourceLight1Color(location)

タイルの光源１の色を調べます。

int GetTileSourceLight1Color(
    location lTile
);

Parameters

lTile

タイルの位置

Description

lTileにあるタイルの光源１の色 (TILE_SOURCE_LIGHT_COLOR_*)を返します。

Remarks

これは直感的な計算関数のうちのひとつです。位置によって指定された具体的なタイルについて影響します。また、タイルを決めるために用いられた位置（location）はオブジェクトを決めるために用いられた位置（location）と異なり、タイル内の位置の整数部分によって決められます。

または、タイルがゼロから数える整数行列に基づいているのを思い出せば、3×3エリアの左下のタイルはメンバベクトルx と y = 0という位置オブジェクトで表されます。

例はGetTileMainLight1Colorを参考。

Version

1.22

See Also

functions: | GetTileMainLight1Color | GetTileMainLight2Color | GetTileSourceLight2Color | RecomputeStaticLighting
categories: | Lighting Effects Functions

author: Tom Cassiotis, editor: Michael Nork, additional contributor(s): Michael Nork, JP team: Redondo


Function - GetTileSourceLight2Color

Home > Reference > Functions > Lighting Effects > GetTileSourceLight2Color

GetTileSourceLight2Color(location)

タイルの光源２の色を調べます。

int GetTileSourceLight2Color(
    location lTile
);

Parameters

lTile

タイルの位置

Description

lTileにあるタイルの光源２の色 (TILE_SOURCE_LIGHT_COLOR_*)を返します。

Remarks

これは直感的な計算関数のうちのひとつです。位置によって指定された具体的なタイルについて影響します。また、タイルを決めるために用いられた位置（location）はオブジェクトを決めるために用いられた位置（location）と異なり、タイル内の位置の整数部分によって決められます。

または、タイルがゼロから数える整数行列に基づいているのを思い出せば、3×3エリアの左下のタイルはメンバベクトルx と y = 0という位置オブジェクトで表されます。

例はGetTileMainLight1Colorを参考。

Version

1.22

See Also

functions: | GetTileMainLight1Color | GetTileMainLight2Color | GetTileSourceLight1Color | RecomputeStaticLighting
categories: | Lighting Effects Functions

author: Tom Cassiotis, editor: Michael Nork, additional contributor(s): Michael Nork, JP team: Redondo


Function - GetTimeHour

Home > Reference > Functions > Time > GetTimeHour

GetTimeHour()

現在の時間を取得します。

int GetTimeHour();

Description

現在の時間を、0から23の間の整数で返します。

Version

1.26

Example

void main()
{
    int nHour = GetTimeHour();
    if (nHour != GetLocalInt(OBJECT_SELF, "nLastHour"))
    {
        SpeakString("Hour is: " + IntToString(nHour));
        SetLocalInt(OBJECT_SELF, "nLastHour", nHour);
    }
    return;
}

See Also

functions: | GetIsDawn | GetIsDay | GetIsDusk | GetIsNight | GetTimeMillisecond | GetTimeMinute | GetTimeSecond | HoursToSeconds | SetTime
categories: | Time Functions

author: Charles Feduke, additional contributor(s): Dana C., Michael Janicki, JP team: Rainie


Function - GetTimeMillisecond

Home > Reference > Functions > Time > GetTimeMillisecond

GetTimeMillisecond()

現在のミリ秒を取得します。

int GetTimeMillisecond();

Description

現在のミリ秒を、0から999の整数で取得します。

Version

1.26

See Also

functions: | GetIsDawn | GetIsDay | GetIsDusk | GetIsNight | GetTimeHour | GetTimeMinute | GetTimeSecond | SetTime
categories: | Time Functions

author: Charles Feduke, additional contributor(s): Artur Biesiadowski, Dana C., JP team: Rainie


Function - GetTimeMinute

Home > Reference > Functions > Time > GetTimeMinute

GetTimeMinute()

現在の分を取得します。

int GetTimeMinute();

Description

現在の分を、0から59（設定可能な最大値）の間の整数で返します。

Remarks

デフォルトのゲーム時間での1時間は、実時間で2分ですので、この関数は０か１のどちらかを返します。モジュールの詳細設定の時／分の数字で設定が可能です。

Version

1.26

See Also

functions: | GetIsDawn | GetIsDay | GetIsDusk | GetIsNight | GetTimeHour | GetTimeMillisecond | GetTimeSecond | SetTime
categories: | Time Functions

author: Charles Feduke, additional contributor(s): Dana C., JP team: Rainie


Function - GetTimeSecond

Home > Reference > Functions > Time > GetTimeSecond

GetTimeSecond()

現在の秒を取得します。

int GetTimeSecond();

Description

現在の秒を、1から59の間の整数で返します。

Version

1.26

See Also

functions: | GetIsDawn | GetIsDay | GetIsDusk | GetIsNight | GetTimeHour | GetTimeMillisecond | GetTimeMinute | HoursToSeconds | RoundsToSeconds | SetTime | TurnsToSeconds
categories: | Time Functions

author: Charles Feduke, additional contributor(s): Dana C., JP team: Rainie


Function - GetTotalDamageDealt

Home > Reference > Functions > Combat Information, Get Data from Creature > GetTotalDamageDealt

GetTotalDamageDealt()

呼出者に与えられた総合ダメージ量を得ます。

int GetTotalDamageDealt();

Description

呼出者に与えられたダメージの総合値を返します。この関数はクリーチャーにのみ動作し、配置用オブジェクトから呼出された場合、常に0を返します。

Remarks

名前からすると、Objectが与えたダメージの量を調べているかのように見えるので勘違いしやすい。そうではなく。これはobject「へ」与えられ、そして一番最後に与えられたダメージだけを返します。

Version

1.28

See Also

functions: | GetLastAttacker | GetLastHostileActor | GetMaxHitPoints
categories: | Combat Information Functions | Get Data from Creature Functions
events: | OnDamaged Event

author: John Shuell, editor: Charles Feduke, additional contributor(s): Chuck Sanderson, Jassper, JP team: Rainie


Function - GetToughestAttacker

Home > Reference > Functions > Prototyped but Unused > GetToughestAttacker

GetToughestAttacker()

この関数は試作されたましたが、使用されていません。

object GetToughestAttacker();

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Version

1.22

See Also

categories: Prototyped but Unused Functions

author: Charles Feduke, JP team: katsu794


Function - GetToughestMeleeAttacker

Home > Reference > Functions > Prototyped but Unused > GetToughestMeleeAttacker

GetToughestMeleeAttacker()

この関数は試作されたましたが、使用されていません。

object GetToughestMeleeAttacker();

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Version

1.22

See Also

categories: Prototyped but Unused Functions

author: Charles Feduke, JP team: katsu794


Function - GetTransitionTarget

Home > Reference > Functions > Get Data from Object, Movement > GetTransitionTarget

GetTransitionTarget(object)

移動先となる対象を得ます。

object GetTransitionTarget(
    object oTransition
);

Parameters

oTransition

目標を返すトランジションobject

Description

トリガーやドアの目的地（ウェイポイントまたはドア）を返します。

oTransitionが有効なトリガーやドアでなければ、OBJECT_INVALIDを返します。

Version

1.22

See Also

categories: Get Data from Object Functions | Movement Functions

author: Charles Feduke, additional contributor(s): Jeremy Sager, JP team: Rainie


Function - GetTrapBaseType

Home > Reference > Functions > Traps > GetTrapBaseType

GetTrapBaseType(object)

罠の型(例:霜、スパイクなど)を調べます。

int GetTrapBaseType(
    object oTrapObject
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

Description

oTrapObjectの基本型(TRAP_BASE_TYPE_*)を返します。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetNearestTrapToObject | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot | SetTrapDetectedBy | SetTrapDisabled
categories: | Traps Functions
constants: | TRAP_BASE_TYPE_* Constants
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: katsu794


Function - GetTrapCreator

Home > Reference > Functions > Traps > GetTrapCreator

GetTrapCreator(object)

罠を仕掛けたクリーチャーを返します。

object GetTrapCreator(
    object oTrapObject
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

Description

oTrapObjectを作成したクリーチャーを返します。

oTrapObjectがツールセットによって作成されていた場合は、OBJECT_INVALIDを返します。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetTrapBaseType | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot | SetTrapDetectedBy | SetTrapDisabled
categories: | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: katsu794


Function - GetTrapDetectable

Home > Reference > Functions > Traps > GetTrapDetectable

GetTrapDetectable(object)

ツールセットによって作成された罠が、発見可能な罠として設定されているかどうかを調べます。

int GetTrapDetectable(
    object oTrapObject
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

Description

発見可能な罠の場合、TRUEを返します。ツールセットのモジュール作成中のみの設定です。ゲーム中で仕掛けられる全ての罠は発見可能な設定になっています。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetNearestTrapToObject | GetTrapBaseType | GetTrapCreator | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot | SetTrapDetectedBy | SetTrapDisabled
categories: | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: katsu794


Function - GetTrapDetectDC

Home > Reference > Functions > Traps > GetTrapDetectDC

GetTrapDetectDC(object)

罠を発見するために必要なDCを調べます。

int GetTrapDetectDC(
    object oTrapObject
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

Description

oTrapObjectを発見するために必要なDCの値を調べます。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot | SetTrapDetectedBy | SetTrapDisabled
categories: | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: katsu794


Function - GetTrapDetectedBy

Home > Reference > Functions > Traps > GetTrapDetectedBy

GetTrapDetectedBy(object, object)

罠がクリーチャーによって発見されているかどうかを調べます。

int GetTrapDetectedBy(
    object oTrapObject,
    object oCreature
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

oCreature

調べるクリーチャー。

Description

罠がoCreatureによって発見されている場合、TRUEを返します。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot | SetTrapDetectedBy
categories: | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: katsu794


Function - GetTrapDisarmable

Home > Reference > Functions > Traps > GetTrapDisarmable

GetTrapDisarmable(object)

罠が解除可能であるかどうかを調べます。

int GetTrapDisarmable(
    object oTrapObject
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

Description

罠が解除可能である場合、TRUEを返します。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot | SetTrapDetectedBy | SetTrapDisabled
categories: | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: katsu794


Function - GetTrapDisarmDC

Home > Reference > Functions > Traps > GetTrapDisarmDC

GetTrapDisarmDC(object)

罠を解除するために必要なDCの値を調べます。

int GetTrapDisarmDC(
    object oTrapObject
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

Description

oTrapObjectを解除するために必要なDCの値を調べます。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot | SetTrapDetectedBy
categories: | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: katsu794


Function - GetTrapFlagged

Home > Reference > Functions > Perception, Traps > GetTrapFlagged

GetTrapFlagged(object)

罠が全てのクリーチャーに見えるように設定されているかどうかを調べます。

int GetTrapFlagged(
    object oTrapObject
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

Description

罠がゲーム中の全てのクリーチャーに見えるようにフラグ付けされている場合、TRUEを返します。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetNearestTrapToObject | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapKeyTag | GetTrapOneShot | SetTrapDetectedBy | SetTrapDisabled
categories: | Perception Functions | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: katsu794


Function - GetTrapKeyTag

Home > Reference > Functions > Traps > GetTrapKeyTag

GetTrapKeyTag(object)

罠を解除するために必要な認識キー(タグ)を調べます。

string GetTrapKeyTag(
    object oTrapObject
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

Description

oTrapObjectを解除するタグを返します。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetLockKeyTag | GetNearestTrapToObject | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapOneShot | SetTrapDetectedBy | SetTrapDisabled
categories: | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, editor: Charles Feduke, JP team: katsu794


Function - GetTrapOneShot

Home > Reference > Functions > Traps > GetTrapOneShot

GetTrapOneShot(object)

罠の作動が一回限りとして設定されているかどうかを調べます。

int GetTrapOneShot(
    object oTrapObject
);

Parameters

oTrapObject

配置可能オブジェクト、ドアやトリガー。

Description

罠の作動が一回限りとして設定されている場合、TRUEを返します。ゲーム中でPCやNPCによって仕掛けられる全ての罠は、自動的に一回限りの作動として設定されます。

Version

1.22

See Also

functions: | GetIsTrapped | GetLastTrapDetected | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | SetTrapDetectedBy | SetTrapDisabled
categories: | Traps Functions
events: | OnDisarm Event | OnTrapTriggered Event

author: Jody Fletcher, JP team: katsu794


Function - GetTurnResistanceHD

Home > Reference > Functions > Get Data from Creature > GetTurnResistanceHD

GetTurnResistanceHD(object)

アンデッドクリーチャーが持つターンへの抵抗のヒットダイス数値を得ます。

int GetTurnResistanceHD(
    object oUndead = OBJECT_SELF
);

Parameters

oUndead

調べるアンデッドクリーチャー（デフォルト：OBJECT_SELF）

Description

oUndeadが持っているターンへの抵抗のヒットダイス数値を得ます。これはアンデッドクリーチャーにのみ動作します。

Version

1.22

See Also

functions: | EffectTurnResistanceDecrease | EffectTurnResistanceIncrease | GetEnemyHD
categories: | Get Data from Creature Functions

author: Jody Fletcher, JP team: Rainie


Function - GetTypeFromTalent

Home > Reference > Functions > Spells, Talents/Skills/Feats > GetTypeFromTalent

GetTypeFromTalent(talent)

要求された才能（Talent）の根本のカテゴリを得ます。

int GetTypeFromTalent(
    talent tTalent
);

Parameters

tTalent

Talentの種類

Description

tTalentの種類（TALENT_TYPE_*）を返します。これは才能（Talent）の根本の（例：呪文、特技そしてスキル）カテゴリです。

Remarks

tTalentの特殊な呪文、特技そしてスキルを返す時はGetIdFromTalentを使ってください。

Version

1.22

See Also

functions: | GetIdFromTalent | TalentAdvancedProtectSelf | TalentBuffSelf
categories: | Spells Functions | Talents/Skills/Feats Functions
constants: | TALENT_TYPE_* Constants

author: Jody Fletcher, JP team: Rainie


Function - GetUniform

Home > Reference > Functions > Module Specific > GetUniform

GetUniform()

衛兵の制服のタグを返します。

string GetUniform();

Description

プレイヤーが制服を着ているかどうかを調べるために、衛兵の制服のタグを返します。

Remarks

この関数は、nw_j_guard.nssの114行目にあります。

Requirements

#include "nw_j_guard"

Version

1.22

See Also

functions: | PlayerWearsUniform | SetUniform
categories: | Module Specific Functions

author: John Shuell, JP team: geshi, katsu794


Function - GetUseableFlag

Home > Reference > Functions > Get Data from Object > GetUseableFlag

GetUseableFlag(object)

配置可能オブジェクトが使用可能かどうかを決定します。

int GetUseableFlag(
    object oObject = OBJECT_SELF
);

Parameters

oObject

使用可能かどうかを調べるオブジェクト。(デフォルト: OBJECT_SELF)

Description

配置可能オブジェクトoObjectが使用可能であれば、TRUEを返し、そうでない場合は、FALSEを返します。

Version

1.29

See Also

categories: Get Data from Object Functions

author: Charles Feduke, additional contributor(s): Donny Wilbanks, JP team: katsu794


Function - GetUserDefinedEventNumber

Home > Reference > Functions > Miscellaneous > GetUserDefinedEventNumber

GetUserDefinedEventNumber()

指定のユーザー定義イベントの番号を得ます。

int GetUserDefinedEventNumber();

Description

これはユーザー定義スクリプト内で使い、イベント番号を得ます。

Version

1.22

See Also

functions: | EventUserDefined
categories: | Miscellaneous Functions

author: Jody Fletcher, JP team: Rainie


Function - GetValidItem

Home > Reference > Functions > Module Specific > GetValidItem

GetValidItem()

公式キャンペーンの中で鍛冶屋が作成できるアイテム名を返します。

string GetValidItem();

Description

この関数を呼び出したオブジェクトのローカル文字列"M3Q1_VALIDITEM"から文字列を返します。

Remarks

nw_o0_itemmaker.nssの254行目。

公式キャンペーンの中で鍛冶屋があるアイテムを作成可能かを確認するために使用されます。

Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

functions: | SetValidItem | SetValidItemCost | SetValidItemCostToken
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - GetValidItemCost

Home > Reference > Functions > Module Specific > GetValidItemCost

GetValidItemCost()

鍛冶屋においてアイテムを作成する費用を決定するために使用されます。

int GetValidItemCost();

Description

呼び出したオブジェクトのローカル変数"M3Q1_VALIDITEMCOST"から整数値を返します。

Remarks

この関数は、nw_o0_itemmaker.nssの258行目にあります。

オブジェクトの費用を決定するために、OBJECT_SELF上のローカル整数値"M3Q1_VALIDITEMCOST"を調べます。

この関数は、オブジェクト上で実行しているスクリプトから呼び出される必要があります。

Requirements

#include "NW_O0_ITEMMAKER"

Version

1.22

See Also

functions: | SetValidItem | SetValidItemCost | SetValidItemCostToken
categories: | Module Specific Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Ivan Hawkes, JP team: katsu794


Function - GetValidWeapon

Home > Reference > Functions > Private Functions > GetValidWeapon

GetValidWeapon(object, string)

存在しない

string GetValidWeapon(
    object oLastOpener,
    string s
);

Parameters

oLastOpener

未定義

s

未定義

Description

nw_o2_classweap.nssの169行目に使われているが、コメントアウトされている。

Remarks

この関数は以前はnw_o2_classweap.nssがオリジナルだと記述されていました。しかし現在（パッチ1.28時）では存在しておらず、他のBiowareによる一般的なスクリプト（コメントアウトされていました）にも書かれていません。

Version

1.28

See Also

categories: Private Functions Functions

author: Lilac Soul, editor: Charles Feduke, JP team: geshi, ngtaicho


Function - GetVictim

Home > Reference > Functions > Module Specific > GetVictim

GetVictim(action)

公式キャンペーンにおいて、暗殺者の犠牲者を明示します。

object GetVictim(
    action a
);

Parameters

a

Description

SetVictimコマンドにより、暗殺者上のローカルオブジェクト("NW_J_ASSASSIN_VICTIM")として保管された犠牲者オブジェクトを返します。

Remarks

nw_j_assassin.nssの366行目にあります。

この関数はVictimDead関数(同じくnw_j_assassin.nssの中にあります。）によって呼ばれます。VictimDead関数は"NW_J_ASSASSIN_VICTIM"に保管されたオブジェクトが有効でない場合(例：殺されている場合)、TRUEを返します。

この関数はBioware社のクエスト報酬システムの一部です。

システムをかなり詳細なところまで理解している人以外にとっては、ほとんど役に立たないでしょう。

Requirements

#include "nw_j_assassin"

Version

1.29

See Also

functions: | SetVictim | VictimDead | VictimDeadButNoItems
categories: | Module Specific Functions

author: Lilac Soul, editor: Jody Fletcher, additional contributor(s): Lilac Soul, JP team: katsu794


Function - GetWaypointByTag

Home > Reference > Functions > Get Data > GetWaypointByTag

GetWaypointByTag(string)

固有のタグを持ったウェイポイントを得ます。

object GetWaypointByTag(
    string sWaypointTag
);

Parameters

sWaypointTag

ウェイポイントのタグ。

Description

sWaypointTagというタグを持ったウェイポイントを、オブジェクトとして返します。
ウェイポイントが見つからない場合はOBJECT_INVALIDを返します。

Version

1.22

Example

// トリガーのOnClickイベントに適用しておきます。
// クリックした人をWP_Destinationというウェイポイントを目的地にしてワープさせます。

void main()
{
  object oClicker = GetClickingObject();
  object oTarget = GetWaypointByTag("WP_Destination");
  location lDest = GetLocation(oTarget);

  AssignCommand(oClicker, ActionJumpToLocation(lDest));
}

See Also

categories: Get Data Functions

author: Kristian Markon, editor: Jeremy Spilinek, JP team: NamaYake


Function - GetWeaponFocus

Home > Reference > Functions > Prototyped but Unused > GetWeaponFocus

GetWeaponFocus(object)

コメントアウトされたスクリプト関数で、Prefers関数に置き換えられてます。

void GetWeaponFocus(
    object oLastOpener
);

Parameters

oLastOpener

コンテナ最後に開けたPC。

Description

見たところ、この関数はコンテナを最後に開けたPCの武器のフォーカスを返すために使用されようとしていたみたいです。

今は、武器のタイプとoPCをパラメーターとして受け取るPrefers関数がこの動作をすることは明らかです。

Requirements

#include "nw_o2_classweap"

Version

1.28

See Also

functions: | Prefers
categories: | Prototyped but Unused Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): LeegleechN, JP team: katsu794


Function - GetWeaponRanged

Home > Reference > Functions > Get Data from Object > GetWeaponRanged

GetWeaponRanged(object)

与えられたアイテムが射程がある武器であるかどうかを調べます。

int GetWeaponRanged(
    object oItem
);

Parameters

oItem

調べるアイテム。

Description

oItemが射程がある武器であれば、TRUEを返します。

Version

1.22

See Also

categories: Get Data from Object Functions

author: Kristian Markon, JP team: katsu794


Function - GetWeather

Home > Reference > Functions > Area, Get Data, Get Data from Object > GetWeather

GetWeather(object)

指定エリアの天候状態を得ます。

int GetWeather(
    object oArea
);

Parameters

oArea

天候状態を調べるエリア

Description

戻り値： WEATHER_CLEAR, WEATHER_RAIN, WEATHER_SNOW, WEATHER_INVALID

注：室内エリアを指定した場合は、常にWEATHER_CLEARを返します。

Version

1.31

See Also

functions: | SetWeather
categories: | Area Functions | Get Data Functions | Get Data from Object Functions
constants: | WEATHER_* Constants

author: Lilac Soul, JP team: geshi


Function - GetWeight

Home > Reference > Functions > Get Data from Creature, Get Data from Object, Inventory > GetWeight

GetWeight(object)

個々のアイテムの重量もしくは、単一のクリーチャーによって運ばれている全てのオブジェクトの重量を調べます。

int GetWeight(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

重量を調べたい対象。（デフォルトではOBJECT_SELF)

Description

個々のアイテムの重量を返します。

クリーチャーに対して使用した場合はクリーチャーが運んでいる全てのアイテムの重量を返します。（実際のクリーチャー自身の重量ではありません）

Remarks

返される数字はポンドではなく、その十倍の値です。

PCに８２ポンドの重さのアイテムを運ばせてテストしたとき、彼女の重量は818ポンドと表示されて驚きました！

関数は指定のアイテムがなかった場合や所持品欄にアイテムがなかった場合には0を返します。

所持品欄に何もアイテムを持っていないクリーチャーは0を返します。またドアや無効なアイテム、所持品欄を持たない配置物なども同じです。

Version

1.30

See Also

categories: Get Data from Creature Functions | Get Data from Object Functions | Inventory Functions

author: Charles Feduke, editor: Lilac Soul, JP team: NamaYake


Function - GetWillSavingThrow

Home > Reference > Functions > Saving Throw > GetWillSavingThrow

GetWillSavingThrow(object)

クリーチャー、ドア、配置物の意志セービングスローのベース値を取得する。

int GetWillSavingThrow(
    object oTarget
);

Parameters

oTarget

セービングスローを取得する先のクリーチャー、ドア、配置物

Description

oTargetの意志セーブのベース値を返す（クリーチャー、ドア、配置物に対してのみ、はたらく）。oTargetが不正な場合は0を返す。

Version

1.22

See Also

functions: | GetFortitudeSavingThrow
categories: | Saving Throw Functions

author: Tom Cassiotis, JP team: weed


Function - GetWisdom

Home > Reference > Functions > Get Data from Creature > GetWisdom

GetWisdom(object)

ターゲットの判断力の能力値を得ます。

int GetWisdom(
    object oTarget
);

Parameters

oTarget

判断力を調べたいobject

Description

oTargetの判断力の値を返します。

Remarks

nw_i0_plot.nss の750 行目にあります。

非常にシンプルな関数で、GetAbilityScore()を使ってわざわざ能力値を指定する必要のないように作られたのでしょう。ただ単にGetAbilityScore( oTarget, ABILITY_WISDOM )と同じことです。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | GetAbilityScore | GetCharisma | GetIntelligence
categories: | Get Data from Creature Functions

author: John Shuell, JP team: Rainie


Function - GetWorkingForPlayer

Home > Reference > Functions > Henchmen/Familiars/Summoned > GetWorkingForPlayer

GetWorkingForPlayer(object)

ヘンチマンがプレイヤーに従っているかを調べます。

int GetWorkingForPlayer(
    object oPC
);

Parameters

oPC

ヘンチマンが働いているかを調べるPC

Description

oPC上のローカル整数"NW_L_HIRED"+ヘンチマンのタグ（OBJECT_SELF）が10に設定されていればTRUEを、そうでなければFALSEを返します。

Remarks

nw_i0_henchman.nssの120行目で見つかります。

私が分かる限り、問題のローカルの整数は、ヘンチマンが以前oPCに対して働いていれば、今はいなくても、10を返すでしょう。

この関数はヘンチマンを識別するためにOBJECT_SELFを使うことにも注意してください。よって、ヘンチマン自身のスクリプトに組み込む必要があります。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

functions: | SetWorkingForPlayer
categories: | Henchmen/Familiars/Summoned Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - GetXP

Home > Reference > Functions > Experience, Get Data from Creature > GetXP

GetXP(object)

特定のクリーチャーが持つXPを調べます。

int GetXP(
    object oCreature
);

Parameters

oCreature

目標のクリーチャー

Description

oCreatureの経験点（XP）の値を返します。

Version

1.22

See Also

functions: | SetXP
categories: | Experience Functions | Get Data from Creature Functions

author: Kristian Markon, JP team: Rainie


Function - Give2Q4PlotItem

Home > Reference > Functions > Item Creation, Module Specific > Give2Q4PlotItem

Give2Q4PlotItem(int)

話し掛けたPCにラスカンのプロットアイテムを与えます。

void Give2Q4PlotItem(
    int nPlotItemConstant
);

Parameters

nPlotItemConstant

Description

nPlotItemConstantの値に基づいて、話し掛けたPCにラスカンのプロットアイテムの３つの内１つを与えます。：クルスの本拠地の鍵、バラムの本拠地の鍵、またはアーブの指輪。キャラクターに渡すべきアイテムです。

Remarks

nw_i0_2q4luskan.nssの22行目で見つかります。

オフィシャルキャンペーン以外で使用するのは非常に困難です。もし、なんらかの理由があって使うことに決めたのならば、GetPCSpeakerとしてアイテムを得るPCを定義し、このように会話から単に呼ぶことができることに注意してください。

Requirements

#include "nw_i0_2q4luskan"

Version

1.28

See Also

categories: Item Creation Functions | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - GiveChapterRewardItem

Home > Reference > Functions > Henchmen/Familiars/Summoned, Module Specific > GiveChapterRewardItem

GiveChapterRewardItem(int, object)

プレイヤーに報酬アイテムを与えます。

void GiveChapterRewardItem(
    int nChapter,
    object oPC
);

Parameters

nChapter

公式キャンペーンの章

oPC

与えるPC

Description

nChapterの値に基づいて、ヘンチマンの報酬アイテムの１つをoPCに与えます。nChapterの値に基づいてXPの量も与えられます。

Remarks

nw_i0_henchman.nssの496行目で見つかります。

通常のスクリプトには使用できないでしょう。nChapterが1、2または3の時だけXPは与えられます。私の推測では、他のnChapterの値がどれもがアイテムは与えられません。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

categories: Henchmen/Familiars/Summoned Functions | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - GiveFetchItemToPC

Home > Reference > Functions > Item Creation, Module Specific > GiveFetchItemToPC

GiveFetchItemToPC(object)

拾ったアイテムをPCに与えます。

void GiveFetchItemToPC(
    object oPC
);

Parameters

oPC

アイテムを得るPC

Description

oPCが現在拾ったアイテムを持っていなければ、彼または彼女にそれを作成します。

Remarks

nw_j_fetch.nssの220行目で見つかります。

現在拾ったアイテムはローカル変数に収納され、その後、この関数によって調べられます。

アイテムはActionGiveItemを使ってoPCに与えられますので、この関数は通常アイテムを所有し、アクションキューを使用できる者によってのみ呼出されます。

Requirements

#include "nw_j_fetch"

Version

1.28

See Also

functions: | GetFetchee
categories: | Item Creation Functions | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - GiveGoldToCreature

Home > Reference > Functions > Action on Object, Money > GiveGoldToCreature

GiveGoldToCreature(object, int)

指定した額のゴールドをクリーチャーに与える。

void GiveGoldToCreature(
    object oCreature,
    int nGP
);

Parameters

oCreature

儲けを受け取るクリーチャー

nGP

oCreatureに与えるゴールドの金額

Description

oCreatureにnGPゴールド与えます。

Version

1.22

See Also

functions: | GetFactionGold | GetGold | GetGoldPieceValue | RewardPartyGP | TakeGoldFromCreature
categories: | Action on Object Functions | Money Functions

author: Jody Fletcher, JP team: Rainie


Function - GiveNumItems

Home > Reference > Functions > Inventory > GiveNumItems

GiveNumItems(object, string, int)

対象に指定された数のアイテムを与えます。

void GiveNumItems(
    object oTarget,
    string sItem,
    int nNumItems
);

Parameters

oTarget

sItem

nNumItems

Description

スクリプトを呼び出したオブジェクトの所持品欄をループし、oTargetにsItemをnNumItems個与えます。

Remarks

この関数はnw_i0_plot.nssの813行目で見つかります。

関数はいずれの公式のスクリプトやファイルでもBioWare社によって使用されたことはありません。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | TakeNumItems
categories: | Inventory Functions

author: John Shuell, JP team: NamaYake


Function - GivePersonalItem

Home > Reference > Functions > Henchmen/Familiars/Summoned > GivePersonalItem

GivePersonalItem(object, object)

ヘンチマンに自分のパーソナルアイテム（契約の証）をプレイヤーに与えさせます。

void GivePersonalItem(
    object oPC,
    object oHench = OBJECT_SELF
);

Parameters

oPC

アイテムを受け取るPC

oHench

パーソナルアイテムを与えさせるヘンチマン（デフォルト：OBJECT_SELF）

Description

oPCがヘンチマンのパーソナルアイテムを持っていない時、oPCにそれを作成します。

Remarks

nw_i0_henchman.nssの272行目で見つかります。

パーソナルアイテムのタグは、ヘンチマンのタグ+"PERS"であるでしょう。ResRefはその小文字版でしょう。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

functions: | StripAllPersonalItemsFromEveryone
categories: | Henchmen/Familiars/Summoned Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - GivePlayerPersonalItem

Home > Reference > Functions > Item Creation, Module Specific > GivePlayerPersonalItem

GivePlayerPersonalItem(object)

暗殺の被害者の個人アイテムをプレイヤーに与えます。

void GivePlayerPersonalItem(
    object oPC
);

Parameters

oPC

アイテムを受け取るプレイヤー

Description

暗殺の被害者の個人アイテムをプレイヤーに与えます。個人アイテムのタグはあらかじめ収納されたローカル文字列から取得されます。

Remarks

nw_j_assassin.nssの224行目で見つかります。

これはBiowareの暗殺クエストシステムの一部です。それがあなたのために作動するために、非常に最後の詳細を恐らく採用しなければならないでしょう。これは暗殺クエストを行なう最良の方法ではないかもしれません。よって、「Biowareの方法」を正確に行わない場合、この（又は類似した）関数を使用することは恐らく都合が悪いでしょう。

Requirements

#include "nw_j_assassin"

Version

1.28

See Also

functions: | GetPersonalItem | SetPersonalItem
categories: | Item Creation Functions | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - GiveRingToPlayer

Home > Reference > Functions > Miscellaneous > GiveRingToPlayer

GiveRingToPlayer(object)

プロットの指輪を作り、プレイヤーのインベントリーに入れます。

void GiveRingToPlayer(
    object oPC
);

Parameters

oPC

指輪を受け取るPC

Description

プロット進行の為の指輪を作り出し、oPCのインベントリーに入れる。

この関数はSetRingGivenTo()を呼び出して、後のためにPCの情報を保存し、また会話に使うためにPCの名前をカスタムトークンに保存します。

Remarks

この関数はあまり役には立たないでしょう。

Requirements

#include "nw_j_rescue"

Version

1.22

See Also

functions: | GetRingGivenTo | SetRingGivenTo
categories: | Miscellaneous Functions

author: Tom Cassiotis, JP team: geshi, Rainie


Function - GiveXPToCreature

Home > Reference > Functions > Action on Object, Experience > GiveXPToCreature

GiveXPToCreature(object, int)

特定のクリーチャーに経験点を与えます。

void GiveXPToCreature(
    object oCreature,
    int nXpAmount
);

Parameters

oCreature

経験値を与える特定のクリーチャー

nXpAmount

与える経験点

Description

マルチクラスのペナルティを調整し、oCreatureにnXpAmountを与えます。

Version

1.29

See Also

functions: | AddJournalQuestEntry | GetJournalQuestExperience | RewardPartyXP | SetXP
categories: | Action on Object Functions | Experience Functions

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Alec Usticke, JP team: Rainie


Function - Global

Home > Reference > Functions > Get Data, Local Variables > Global

Global()

クエストに関する状況の情報を持ったobjectに格納されたローカルのobjectを返します。

object Global();

Description

NW_J_xxxx_MYGLOBALSの名を持つ呼出objectに、ローカルに格納されたオブジェクトを返します。xxxxはこの関数を呼び出す前に含まれるスクリプトによって決定されます。それが定義されるスクリプトのリストに関しては、Remarksを参照してください。このobjectはクエストに関連する情報および状態をすべて収容するために使用されます。SetPlotTag(sTag)、GetPlotTag()、SetxxxxItem(sTag)そしてGetxxxxItem()に使用されます。xxxxをCOMPLEX、STORYまたはARTIFACTと置き換えるだけです。

Remarks

関数は次のファイルで見つけることができます:
nw_j_artifact.nss: 29
nw_j_story.nss: 29
nw_j_complex.nss: 29

この関数の設定は関連したクエストを持っているNPCの情報を備えたストーリー・プロットアイテム周辺に集約されるように思います。この特殊な関数は利用可能な7つの他の関数から2つを単に利用します。これらの関数の全ては比較的率直に働き、一目で理解することが容易です。

Requirements

#include "nw_j_artifact"

Version

1.22

See Also

functions: | GetArtifactItem | GetComplexItem | GetFetchItem | GetPlotTag | GetStoryItem | SetArtifactItem | SetComplexItem | SetGlobal | SetPlotTag | SetStoryItem | TakeStoryItem
categories: | Get Data Functions | Local Variables Functions

author: John Shuell, JP team: Rainie


Function - gplotAppraiseOpenStore

Home > Reference > Functions > Miscellaneous > gplotAppraiseOpenStore

gplotAppraiseOpenStore(object, object, int, int)

鑑定スキルを用いた店を開きます。

void gplotAppraiseOpenStore(
    object oStore,
    object oPC,
    int nBonusMarkUp = 0,
    int nBonusMarkDown = 0
);

Parameters

oStore

開く店オブジェクト。

oPC

店を開く対象のPC。

nBonusMarkUp

パーセントで表した値上げ値。(デフォルト: 0)

nBonusMarkDown

パーセントで表した値下げ値。(デフォルト: 0)

Description

さらなる値下げ、または値上げをするための鑑定スキルチェックを考慮に入れた上で、oPCに対してoStoreを開きます。

Remarks

鑑定スキルチェックの結果により、値上げと値下げのために足し算または引き算を行う場合を除いて、関数に与えられたパラメーターで、OpenStore関数を呼び出します。

Known Bugs

これは少しもバグとはいえないですが、もしバージョン1.30より前のバージョンで編集されているnw_i0_plotファイルが入っているシステムを使用している場合、この関数は利用できないでしょう。

Requirements

#include "nw_i0_plot"

Version

1.30

See Also

functions: | OpenStore
categories: | Miscellaneous Functions

author: Lilac Soul, JP team: katsu794


Function - GreaterRestore

Home > Reference > Functions > Private Functions > GreaterRestore

GreaterRestore(object)

無効な関数

void GreaterRestore(
    object oHench
);

Parameters

oHench

リストアしたい生物

Description

実行はできるが、何もされない。

Remarks

nw_ch_ac7.nss の３９行目で使用。

この関数は使用中じゃないというマークを付けられている。

BioWare公式モジュールではこの関数のかわりにnw_i0_plot の RemoveEffects が使われている。

Version

1.28

See Also

functions: | RemoveEffects
categories: | Private Functions Functions

author: Lilac Soul, editor: Charles Feduke, JP team: ngtaicho


Function - HasAnyItemOfBaseType

Home > Reference > Functions > Inventory, Item Creation > HasAnyItemOfBaseType

HasAnyItemOfBaseType(int, int, object)

プレイヤーのインベントリーを循環し、特定のベースアイテムタイプを持つアイテムを探します。ベースアイテムタイプが鎧であれば、ACが適合するかどうか確認します。

int HasAnyItemOfBaseType(
    int nBaseType,
    int nAC,
    object oPC
);

Parameters

nBaseType

BASE_ITEM_*定数グループによって定義されたアイテムの種類

nAC

ベースアイテムが鎧の場合、ACがこれと等しい時のみTRUEを返します

oPC

インベントリーをチェックするプレイヤー

Description

oPCがインベントリー内に（BASE_ITEM_*定数グループで定義される）nBaseTypeのベースタイプのアイテムを持っていればTRUEを返します。アイテムが鎧タイプならば、ACがnACに適合する場合のみTRUEを返します。

Remarks

キャラクターがアイテム生成シナリオに必要なアイテムを持っているかどうか伝えるためにBackPackMatchによって使用されてます。

Requirements

#include "nw_o0_itemmaker"

Version

1.22

See Also

functions: | GetBackpackMatch
categories: | Inventory Functions | Item Creation Functions
constants: | BASE_ITEM_* Constants

author: John Shuell, JP team: Rainie


Function - HasChapterQuestItem

Home > Reference > Functions > Private Functions > HasChapterQuestItem

HasChapterQuestItem(int, object)

PCが章ごとに特有のクエストアイテムを持っているか調べる。

int HasChapterQuestItem(
    int nChapter,
    object oPC
);

Parameters

nChapter

公式キャンペーンの第何章かの指定

oPC

チェックしたいPC

Description

oPCを調べ、公式キャンペーンnChapter章のヘンクマンのクエストアイテムを持っていれば"TRUE"、持っていなければ"FALSE"を返す

Remarks

nw_i0_henchman.nss の465行目

ほとんどBioware以外誰にも役立たない

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

categories: Private Functions Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: ngtaicho


Function - HasChapterRewardItem

Home > Reference > Functions > Henchmen/Familiars/Summoned, Module Specific > HasChapterRewardItem

HasChapterRewardItem(int, object)

プレイヤーが章の褒章アイテムを持っているか調べます。

int HasChapterRewardItem(
    int nChapter,
    object oPC
);

Parameters

nChapter

公式キャンペーンの章

oPC

アイテムを持っているか調べるプレイヤー

Description

oPCが公式キャンペーン中のnChapter番号の章のヘンチマン報酬アイテムを持っていればTRUEを返し、エラーの場合や持っていない場合はFALSEを返します。

Remarks

nw_i0_henchman.nssの515行目で見つかります。

BioWare以外の人が使うのは難しいでしょう。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

categories: Henchmen/Familiars/Summoned Functions | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - HasGold

Home > Reference > Functions > Inventory, Money > HasGold

HasGold(int, object)

プレイヤーがある一定の金額以上を持っているかどうかを知る。

int HasGold(
    int nAmount,
    object oGoldHolder
);

Parameters

nAmount

調べる金額

oGoldHolder

いくらゴールドを持っているか知る人物

Description

oGoldHolderがnAmountかそれ以上の金額を持っていればTRUEを返します、なければFALSEを返すでしょう。

Remarks

これはGetGold()を含む関数です。

インベントリーを調べる際にお金を取り除くことはありません。

Requirements

#include "NW_I0_PLOT"

Version

1.22

Example

// この例は話し掛けたPCが何かを購入するために必要な250gp以上の
// 持っているかどうかを調べるチェックである

#include "NW_I0_PLOT"

// 購入に必要な金額を持っているかどうか？
if (HasGold (250, GetPCSpeaker()))
{
    // 何かをここで起こす
}
else
{
    // 貧乏なら、NPCに侮蔑させる
}

See Also

functions: | GetGold
categories: | Inventory Functions | Money Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Ivan Hawkes, JP team: Rainie


Function - HasItem

Home > Reference > Functions > Inventory > HasItem

HasItem(object, string)

クリーチャーがアイテムを持っているかどうか調べます。

int HasItem(
    object oCreature,
    string sTag
);

Parameters

oCreature

アイテムを持っているかどうか調べるクリーチャー。

sTag

調べたいアイテムのタグ。

Description

sTagというタグのアイテムをoCreatureが持っていた場合はTRUEを返します。そうでない場合はFALSEを返します。

Remarks

これはGetItemPossessedBy()関数をシンプルに含んでいます。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | GetItemPossessedBy
categories: | Inventory Functions

author: Tom Cassiotis, JP team: NamaYake


Function - HasPersonalItem

Home > Reference > Functions > Henchmen/Familiars/Summoned, Module Specific > HasPersonalItem

HasPersonalItem(object)

プレイヤーがヘンチマンのパーソナルアイテムを持っているかを調べます。

int HasPersonalItem(
    object oPC
);

Parameters

oPC

アイテムを調べるプレイヤー

Description

oPCがヘンチマンの契約の証、または公式キャンペーンの1･2章のどちらかのヘンチマンからの報酬アイテムのどちらかを持っていればTRUEを返します。oPCがどちらも持っていない時やエラーの場合はFALSEを返します。

Remarks

nw_i0_henchman.nssの283行目で見つかります。

BioWareの人を除いて使うのは難しいでしょう。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

functions: | StripAllPersonalItemsFromEveryone
categories: | Henchmen/Familiars/Summoned Functions | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - HasSpell

Home > Reference > Functions > Get Data from Creature, Module Specific, Spells > HasSpell

HasSpell(int)

呼出者がある呪文を持っているかをチェックします。

int HasSpell(
    int nSpell
);

Parameters

nSpell

チェックする呪文(SPELL_*)

Description

呼出者が呪文nSpellを持っているかを調べます。 (SPELL_*)

Remarks

nw_c8_lv123.nssの32行目で見つかります。

（GetHasSpellのように）スペルブック中にその呪文があるかをチェックするのではなく、呼出者のローカル整数を調べ、呪文がまだ詠唱されていないことを意味すること推測されることを表す0であればTRUEを返します。これは奇妙に見えますが、nw_c8_lv123をみるとそうです（使用されている実例を見つけることができませんでした）。それは多分バードのために使用されます。パッチv1.25以前では、GetHasSpellがバードに正確に動作していませんでしたので、この関数は同じような機能として代わりにあるのでしょう。

この関数は使用しないように薦めます。代わりにGetHasSpellだけを使いましょう。もしこれを使うのならば、これはIncludeファイルの中に無い事に注意してください。だから、通常の方法でincludeだけではできません。

Version

1.28

See Also

functions: | GetHasSpell
categories: | Get Data from Creature Functions | Module Specific Functions | Spells Functions
constants: | SPELL_* Constants

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - HoursToSeconds

Home > Reference > Functions > Time > HoursToSeconds

HoursToSeconds(int)

この関数はゲームでの時間（Hour(s)）を実秒での数値に換算します。

float HoursToSeconds(
    int nHours
);

Parameters

nHours

秒に換算する時間(Hour(s))

Description

nHoursを秒に変換します。この結果は、モジュールの詳細設定で設定する１時間が相当する分数（時／分）に依存します。（デフォルトではゲーム内の1時間は実時間の2分に相当するよう設定してあるので、nHoursが1の場合、デフォルト設定では120（秒）を返すでしょう。）

Version

1.28

Example

float fSeconds = HoursToSeconds(1);

See Also

functions: | GetTimeHour | GetTimeSecond | SetTime
categories: | Time Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - InsertString

Home > Reference > Functions > String > InsertString

InsertString(string, string, int)

この関数は、宛先の文字列のnPositionで示された場所に文字列を挿入する

string InsertString(
    string sDestination,
    string sString,
    int nPosition
);

Parameters

sDestination

挿入される文字列

sString

挿入する文字列

nPosition

挿入するインデックス位置

Description

この間数は文字列を別の文字列の中に挿入する

Remarks

1.26より前のバージョンでは、この間数は挿入する代わりに上書きする。

Version

1.26

Example

string s1 = “Bacon and spam”;
string s2 = “, ham ”;
string s3 = InsertString(s1, s2, 6);
//s3 = "Bacon, ham and spam"

See Also

categories: String Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Iceberg, JP Team: weed


Function - IntToFloat

Home > Reference > Functions > Math, Type Casting/Conversion > IntToFloat

IntToFloat(int)

整数を浮動小数型に変換する。

float IntToFloat(
    int nInteger
);

Parameters

nInteger

浮動小数型に変換する整数値

Description

整数を浮動小数型に変換する。例えば 123 を変換すると 123.00 になる。

Remarks

浮動小数型のサイズが(3.4028183957828877e+38)、整数型が(2147483647)なので、桁は失なわれることはない。

Known Bugs

4千万以上の整数を変換した時に変換後の数値とズレが生じる。整数の最大値(2147483647)、最小値(-2147483647)に近い値は、変換のズレが多い。

テストの結果

2147483647 = 2147483648.00

2147482647 = 2147482624.00

2147473647 = 2147473664.00

2147383647 = 2147383680.00

2146483647 = 2146483584.00

2137483647 = 2137483648.00

2047483647 = 2047483648.00

1147483647 = 1147483648.00

147483647 = 147483648.00

47483647 = 47483648.00

4千万以上の非常に大きな数値の場合に起こるものなので、多くのスクリプトはそんなに問題にはならないだろう。

Version

1.30

Example

int foo = 300;
float bar =  IntToFloat(foo);

See Also

functions: | FloatToInt | IntToHexString | IntToString
categories: | Math Functions | Type Casting/Conversion Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, ngtaicho


Function - IntToHexString

Home > Reference > Functions > Math, Type Casting/Conversion > IntToHexString

IntToHexString(int)

10進数の整数を16進表記の文字列に変換する

string IntToHexString(
    int nInteger
);

Parameters

nInteger

16進数に変換したい10進数の整数値.

Description

10進数の整数を16進表記の文字列に変換する。10進数123をIntToHexStringで変換すると、結果は"0x0000007b"になる。

Remarks

もしあなたの初めて学んだ記数法が16進数で使いこなせるなら、とても楽なことでしょう。

私たち一般の人間は10進法に縛り付けられているからです。

Version

1.30

Example

int foo = 300;
string bar =  IntToHexString(foo);
// 結果　"0x0000012c"

See Also

functions: | IntToFloat | IntToString
categories: | Math Functions | Type Casting/Conversion Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, ngtaicho


Function - IntToString

Home > Reference > Functions > Type Casting/Conversion > IntToString

IntToString(int)

整数値を文字列に変換する

string IntToString(
    int nInteger
);

Parameters

nInteger

文字列にしたい整数値

Description

nIntegerの整数値を文字列に変換する。123が変換されると"123"となる。

Remarks

デバッグなどで有効に使える。この値をオブジェクトに喋らせたり、ログに書き込んだりして数値の確認をすることができる。

もしくは、PCに変動価格を教える事に使ったり、重量の増減をアナウンスしたりすることができそうだ。

Version

1.28

Example

// 数値を喋るサンプル
void main()
{
int foo = 300;
string bar =  IntToString(foo);
SpeakString("値は" + bar + "です。");
}

See Also

functions: | IntToFloat | IntToHexString | StringToInt
categories: | Type Casting/Conversion Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, ngtaicho


Function - IsBusy

Home > Reference > Functions > Henchmen/Familiars/Summoned > IsBusy

IsBusy()

仲間が忙しいかどうか調べます。

int IsBusy();

Description

仲間が戦闘中または別の動作中で忙しいかどうかを調べます。

Remarks

これは、他のassociate関数によって設定されたローカル整数を調べます。SetIsBusyはヘンチマンを（開錠中のような）ビジー状態に設定するために使うことが出来ます。

Requirements

#include "nw_i0_assoc"

Version

1.22

Example

// 1.24 source for this function
int IsBusy()
{
    // * if no valid attack targets then I am not in combat
    if (GetIsObjectValid(GetAttackTarget()) == FALSE && GetIsObjectValid(GetAttemptedAttackTarget()) == FALSE && GetLocalInt(OBJECT_SELF,"NW_ASSOCAMIBUSY") == FALSE)
    {
        return FALSE;
    }
    return TRUE;
}

See Also

functions: | SetIsBusy
categories: | Henchmen/Familiars/Summoned Functions

author: Tom Cassiotis, JP team: Rainie


Function - IsInConversation

Home > Reference > Functions > Conversation > IsInConversation

IsInConversation(object)

オブジェクトが会話中かどうか決めます。

int IsInConversation(
    object oTarget
);

Parameters

oTarget

チェックするobject

Description

この関数は、目標の会話状態に基づいて、TRUEもしくはFALSEを返します。

目標の会話状態に基づいた行動を条件付きで実行させるような場合にこの関数を使用してください。

Version

1.22

Example

if (IsInConversation(OBJECT_SELF))
{
   // ここで会話中の行動を指定します
}
else
{
   // ここで会話中で無いときの行動を指定します
}

See Also

functions: | GetLastSpeaker
categories: | Conversation Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: geshi, Rainie


Function - IsMisc

Home > Reference > Functions > Get Data from Object > IsMisc

IsMisc(object)

アイテムの基本タイプがある基本タイプの中の一つであれば、trueを返します。

int IsMisc(
    object oItem
);

Parameters

oItem

基本タイプを調べるアイテム。

Description

oItemの基本タイプが、BASE_ITEM_GEM、BASE_ITEM_MISCLARGE、BASE_ITEM_MISCMEDIUM、BASE_ITEM_MISCTALL、BASE_ITEM_MISCSMALL、BASE_ITEM_MISCTHINのいずれかである場合、TRUEを返します。

他の基本タイプである場合やエラー時には、FALSEを返します。

Remarks

nw_o0_itemmaker.nssの120行目にあります。

Requirements

#include "nw_o0_itemmaker"

Version

1.28

See Also

categories: | Get Data from Object Functions
constants: | BASE_ITEM_* Constants

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - IsRecall

Home > Reference > Functions > Module Specific > IsRecall

IsRecall()

リコール・ストーンを使用してプレイヤーを呼び戻します。

int IsRecall();

Description

リコール・ストーンを使用して、プレイヤーを最も近い寺院に送り戻すよう試みます。

Remarks

この関数はBioWare社のモジュールを作動させるために特別に書かれたものです。

使用しないことをお奨めします。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - IsValidBaseItem

Home > Reference > Functions > Get Data from Object, Item Creation > IsValidBaseItem

IsValidBaseItem(object, int)

ベースアイテムタイプがアレイ内の物と一致するか、またアイテムが魔法の道具かどうかについて見るために調べます。

int IsValidBaseItem(
    object oItem,
    int nIndex
);

Parameters

oItem

適合するかどうかを調べるアイテム

nIndex

適合を調べるアレイの位置

Description

炉精製アイテムで使用されます。oItemがアレイ内の物とベースアイテムタイプが一致するかどうかと魔法の物であるかどうかを調べます。

Remarks

nw_o0_itemmaker.nssの212行目で見つかります。

アイテムが魔法の物であるかどうかを見る為に調べることは、ある制限を持つGetIsMagical関数でも行うことができます。そちらのdescriptionを見る事をお奨めします。

Requirements

#include "nw_o0_itemmaker"

Version

1.28

See Also

functions: | GetIsMagical
categories: | Get Data from Object Functions | Item Creation Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - JumpToLocation

Home > Reference > Functions > Action on Object, Movement > JumpToLocation

JumpToLocation(location)

これはlLocationに基づく位置に瞬時にジャンプ移動させるコマンドです。

void JumpToLocation(
    location locDestination
);

Parameters

locDestination

Description

これはcommand型ですので、AssignCommand(object oObject, JumpToLocation(locLocation));で呼び出された時のみ有効です。このコマンドは参照したobjectのコマンドキューの先頭に挿入され、指定された位置へ直ちにobjectをジャンプさせます。そのアクションはアクション・キューの先頭に加えられます。

Remarks

例えこのコマンドがアクション・キューの一番上にくるとはいえ、最初にClearAllActions()で、意図した目標のアクションの全てを取り除いておく事とはよい考えかもしれません。

PCがlocationにジャンプすることでエリアやトリガーを離れた場合、去ったobjectのOnExitイベントが発動します。

死んでいるクリーチャーには機能しません；この関数を適切に機能させる為には０以上のHPを持っている必要があります。

Version

1.29

Example

void main()
{
   object oPC = GetFirstPC();
   object oArea = GetArea(OBJECT_SELF);
   vector vPosition = Vector(20.0, 20.0, 0.0);
   float fAngle = 90.0;
   location locTarget = Location(oArea, vPosition, fAngle);
   AssignCommand(oPC, JumpToLocation(locTarget));
}

See Also

functions: | ActionJumpToLocation | ActionJumpToObject | JumpToObject
categories: | Action on Object Functions | Movement Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Barry, Enigmatic, Chris MacKenzie, JP team: Rainie


Function - JumpToObject

Home > Reference > Functions > Action on Object, Movement > JumpToObject

JumpToObject(object, int)

呼び出したObjectを、目標に最も近い有効な位置へテレポートします。

void JumpToObject(
    object oToJumpTo,
    int nWalkStraightLineToPoint = TRUE
);

Parameters

oToJumpTo

ジャンプする目標となるObject。

nWalkStraightLineToPoint

未使用。（デフォルト：TRUE）

Description

呼び出されたobjectは、oTarget（あるいはできるだけ近い場所）の位置へ即座に再配置されます。

アクションは全く視覚エフェクトがありません。

Remarks

全ての出現・ジャンプ型のコマンドのように、対象のobjectをoToJumpToに最も近い有効な位置に配置します。

PCがlocationにジャンプすることでエリアやトリガーを離れた場合、去ったobjectのOnExitイベントが発動します。

死んでいるクリーチャーには機能しません；この関数を適切に機能させる為には０以上のHPを持っている必要があります。

Version

1.29

See Also

functions: | ActionJumpToObject | JumpToLocation
categories: | Action on Object Functions | Movement Functions

author: Charles Feduke, additional contributor(s): Keven Knuth, Enigmatic, JP team: Rainie


Function - JumpToWeakestEnemy

Home > Reference > Functions > Combat, Combat Actions, Private Functions > JumpToWeakestEnemy

JumpToWeakestEnemy(object)

最もダメージを受けている敵にジャンプする

void JumpToWeakestEnemy(
    object oTarget
);

Parameters

oTarget

敵を見つけるファクションのメンバー

Description

最もダメージを受けているoTargetの仲間（同じファクションのメンバー）の場所にジャンプする。目標が４ｍ以内にいる場合や、目標が見えていない場合はジャンプしない。（これによって別エリアにジャンプする危険がない）

これを使い、アンデッドの召集などに応用することができる。

Remarks

nw_c2_dimdoorはインクルードファイルではないため、通常の方法では使用できないが、コピーして使うことができる。

このスクリプトはブリンクドッグに使われている。使用方法はブリンクドッグのOnSpawnとOnUserDefinedスクリプトを参考にしよう。

Version

1.28

See Also

categories: Combat Functions | Combat Actions Functions | Private Functions Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: ngtaicho


Function - LevelUpHenchman

Home > Reference > Functions > Henchmen/Familiars/Summoned > LevelUpHenchman

LevelUpHenchman(object, int, int)

デフォルトの設定で使われている

int LevelUpHenchman(
    object oCreature,
    int nClass = CLASS_TYPE_INVALID,
    int bReadyAllSpells = FALSE
);

Parameters

oCreature

レベルを上げるクリーチャー

nClass

CLASS_TYPE_* (デフォルト: CLASS_TYPE_INVALID)

bReadyAllSpells

休憩を必要とせずに全ての記憶できる呪文をスロットを埋めるかどうかを決めます。

（デフォルト：FALSE）

Description

関数が成功した場合は新しいレベルを返し、失敗した場合は0を返します。CLASS_TYPE_INVALID以外の他のCLASS_TYPE_*定数を指定することで、レベルアップする新しいクラスを指定することが出来ます（CLASS_TYPE_INVALIDが指定される場合、クリーチャーは元々のクラスを上げます）。バーバリアンとパラディンのように、マルチクラスとして選べないものが指定された場合、元々のクラスのレベルを上げます。

Remarks

クリーチャーが既にマルチクラスをしている場合、どのクラスがレベルアップするかわかりません。

この関数を使ってクリーチャーに3つ以上のクラスをマルチさせることは出来ません。

この関数を扱ったことがあります。私はSoU公式キャンペーンからDornaを自分のテストモジュールにインポートした際、素晴らしい動作をしました。彼女をレベルアップさせることが出来ましたが、彼女の初期レベルを1から10へとツールセットを使って手動で変更した場合、彼女をレベルアップさせることが出来ませんでした。Dornaをレベル10から11ローグへとレベルさせるような動作をLevelUpHenchman関数でさせる為には、標準のパッケージで与えられるレベル1から10までの全ての特技やスキル等を持っている必要があるように思えます。ツールセットで手動で彼女をレベルアップさせることはそういった動作をしないため、多分動作しないのでしょう。もしどなたか、LevelUpHenchmanについて詳しく知っている方がいるならば、名乗り出てください :)

Version

1.30

See Also

categories: | Henchmen/Familiars/Summoned Functions
constants: | CLASS_TYPE_* Constants

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - Location

Home > Reference > Functions > Area > Location

Location(object, vector, float)

Locationデータ構造の値を設定します。

location Location(
    object oArea,
    vector vPosition,
    float fOrientation
);

Parameters

oArea

モジュール内のあるエリア

vPosition

x-y-z座標を指定するオブジェクト（ベクトル）

fOrientation

-180から180の間の角度

Description

コンストラクタは、その型の新しいインスタンスを作成することを目的とした特別な型の関数です。

コンストラクタは、特別な組み立て行為や初期化が行われる場所でもあります。

返される型は指定された型の新しいオブジェクトですので、この場合、返されるのはロケーション型の新しいオブジェクトです。

新しい位置オブジェクトを構成するために、スクリプトには３つのものが必要です。

・位置を参照するエリア（モジュールのあるエリア）

・この位置のx,y,z座標を含む新しいベクトル

・0.0から360.0までのオブジェクトの向きを表す小数。0.0は東、90.0は北、180.0は西、270.0は南です。

Remarks

オブジェクトの作成はしばしば、実行できる最も高コストな（CPUについて）命令のひとつとなります。経験則は、「あなたが必要とするより多くのオブジェクトを作成しない」です。

Version

1.22

Example

//我々がいるエリアを定める
object oArea = GetArea(OBJECT_SELF);
//どこにいるかを定める
vector vPosition = GetPosition(OBJECT_SELF);
//向く方角を特定する
float fOrientation = GetFacing(OBJECT_SELF);
//これら情報から新しい位置を作る
location myLocation = Location( oArea, vPosition, fOrientation);

See Also

functions: | ActionJumpToLocation | GetLocation | GetPosition | Vector
categories: | Area Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): George Kuff, JP team: katsu794, Redondo


Function - log

Home > Reference > Functions > Math > log

log(float)

浮動小数値の常用対数を計算する。

float log(
    float fValue
);

Parameters

fValue

常用対数を求めたい浮動小数値

Description

fValueの常用対数を求め計算結果を返す。

対数は目に見える光エネルギー、電磁気のフィールド力、音の強さのなどのような可変的な量の認知レベルを描写するために使われる指数である。

Remarks

対数は、矢の飛行を計算したり、はるか遠くの音を聞いたりするなどに使われる。

Version

1.26

Example

float foo = log(32.0);

See Also

functions: | pow | sqrt
categories: | Math Functions

author: Charles Feduke, editor: Tom Cassiotis, additional contributor(s): Honour Mai, JP team: ngtaicho


Function - MagicalEffect

Home > Reference > Functions > Effects > MagicalEffect

MagicalEffect(effect)

This function sets the effects sub type to magical.

effect MagicalEffect(
    effect eEffect
);

Parameters

eEffect

Description

Effects are one of three SUBTYPE_* (EXTRAODINARY, MAGICAL, SUPERNATURAL). This function sets the specified effects subtype to SUBTYPE_MAGICAL. Acts as a mutator for an effects subtype.

Remarks

SUBTYPTE_MAGICAL is the default subtype for all effects. See 3rd Edition DMG page 71 or MM page 7 for a description of ability classifications.

Version

1.22

Example

//Create a new polymorph effect.
Effect ePolymorph = EffectPolymorph (POLYMORPH_TYPE_PENGUIN);
//Pick your target
object oPC = GetFirstPC();
//Make it a magical effect…
ePolymorph = MagicalEffect(ePolymorph);
//Apply the affect…
ApplyEffectToObject (DURATION_TYPE_TEMPORARY, ePolymorph, oPC, 300.0);

See Also

functions: | ApplyEffectAtLocation | ApplyEffectToObject | ExtraordinaryEffect | SupernaturalEffect
categories: | Effects Functions
constants: | SUBTYPE_* Constants

author: Michael Nork, editor: Iskander Merriman


Function - main

Home > Reference > Functions > Module Specific > main

main()

[無視して下さい。Lexiconから削除されるべき関数です。]

void main();

Description

[無視して下さい。Lexiconから削除されるべき関数です。]

Version

1.22

See Also

categories: Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - MakeDrunk

Home > Reference > Functions > Action on Object, Effects > MakeDrunk

MakeDrunk(object, int)

クリーチャーを酔わせます。

void MakeDrunk(
    object oTarget,
    int nPoints
);

Parameters

oTarget

酔わせるクリーチャー。

nPoints

減少させるインテリジェンスのポイント値

Description

oTargetに２つのアニメーションの内の１つ(ANIMATION_LOOPING_PAUSE_DRUNK または ANIMATION_LOOPING_TALK_LAUGHING)をさせます。そして、彼 / 彼女のインテリジェンスを60秒間nPoints減少した状態にします。

Remarks

nw_s3_alcohol.nssの20行目にあります。

クリーチャーだけがインテリジェンスを持っているので、それらのアニメーションをすることができます。よって、この関数はクリーチャーのみに動作します。 (明らかです) しかし、全てのクリーチャーが全てのアニメーションをできるわけではないので、アニメーションが全てのクリーチャーに機能するとはいいきれません。NPCタイプの全てのクリーチャーには機能するでしょう。

Requirements

#include "nw_s3_alcohol"

Version

1.28

Example

//nw_s3_alcohol内のバージョン 1.28 のソース
void MakeDrunk(object oTarget, int nPoints)
{
    if (Random(100) + 1 < 40)
        AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING));
    else
        AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_DRUNK));

    effect eDumb = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nPoints);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDumb, oTarget, 60.0);
 //   AssignCommand(oTarget, SpeakString(IntToString(GetAbilityScore(oTarget,ABILITY_INTELLIGENCE))));
}

See Also

categories: | Action on Object Functions | Effects Functions
constants: | ANIMATION_* Constants

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - MakeWay

Home > Reference > Functions > Module Specific, Private Functions > MakeWay

MakeWay(int)

ウェイポイントに沿って歩くためのタグを作る。

string MakeWay(
    int nNumber
);

Parameters

nNumber

歩こうとするウェイポイントのナンバー

Description

単純にストリングを返す："way" + IntToString(nNumber) + GetTag(OBJECT_SELF).

タグが"cr_karl"でnNumberが1の場合、"way1cr_karl"を返す

Remarks

nw_c3_waypoint1.nss の27行目

インクルードファイルではないため、通常の方法では使用できないが、コピーして使うことができる。

この関数は歩いている次のウェイポイントのタグを決定するために使われる。

nw_i0_genericのWalkWayPoints関数のほうが使いやすい。

Version

1.28

See Also

functions: | SetWayPointTo1
categories: | Module Specific Functions | Private Functions Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: ngtaicho


Function - MatchCombatProtections

Home > Reference > Functions > Core AI Talent > MatchCombatProtections

MatchCombatProtections(talent)

特殊能力が保護戦闘呪文であるかどうかを返します。

int MatchCombatProtections(
    talent tUse
);

Parameters

tUse

調べる特殊能力。

Description

関数に与えられた特殊能力が７つの保護戦闘呪文の中の１つであれば、TRUEを返します。そうでない場合は、FALSEを返します。

Remarks

nw_i0_generic.nssの4939行目にあります。

コアAI関数GetMatchCompatibilityの中においては、与えられたクラスがファイターである場合、GetMatchCompatibility関数がtrueもしくはfalseのいずれを返すべきかを決定するために、MatchCombatProtections関数を呼び出します。

Requirements

#include "nw_i0_generic"

Version

1.28

See Also

functions: | GetMatchCompatibility
categories: | Core AI Talent Functions

author: Michael Nork, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - MatchElementalProtections

Home > Reference > Functions > Core AI Talent > MatchElementalProtections

MatchElementalProtections(talent)

特殊能力が保護呪文であるかどうかを返します。

int MatchElementalProtections(
    talent tUse
);

Parameters

tUse

調べる特殊能力。

Description

関数に与えられた特殊能力が４つの基本的な保護呪文の中の１つであれば、TRUEを返します。

そうでない場合は、FALSEを返します。

Remarks

nw_i0_generic.nssの4977行目にあります。

コアAI関数GetMatchCompatibilityの中においては、与えられたクラスがメイジ、クレリック、またはモンスターである場合、GetMatchCompatibility関数がtrueもしくはfalseのいずれを返すべきかを決定するために、MatchElementalProtections関数を呼び出します。

Requirements

#include "nw_i0_generic"

Version

1.28

See Also

functions: | GetMatchCompatibility
categories: | Core AI Talent Functions

author: Michael Nork, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - MatchFortAttacks

Home > Reference > Functions > Prototyped but Unused > MatchFortAttacks

MatchFortAttacks(talent)

この関数は試作されたましたが、使用されていません。

int MatchFortAttacks(
    talent tUse
);

Parameters

tUse

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Version

1.22

See Also

categories: Prototyped but Unused Functions

author: Michael Nork, editor: Charles Feduke, JP team: katsu794


Function - MatchReflexAttacks

Home > Reference > Functions > Prototyped but Unused > MatchReflexAttacks

MatchReflexAttacks(talent)

この関数は試作されたましたが、使用されていません。

int MatchReflexAttacks(
    talent tUse
);

Parameters

tUse

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Version

1.22

See Also

categories: Prototyped but Unused Functions

author: Michael Nork, editor: Charles Feduke, JP team: katsu794


Function - MatchSpellProtections

Home > Reference > Functions > Core AI Talent > MatchSpellProtections

MatchSpellProtections(talent)

特殊能力が保護呪文であるかどうかを返します。

int MatchSpellProtections(
    talent tUse
);

Parameters

tUse

調べる特殊能力。

Description

関数に与えられた特殊能力が１１個の保護呪文の中の１つであれば、TRUEを返します。

そうでない場合は、FALSEを返します。

Remarks

nw_i0_generic.nssの4956行目にあります。

コアAI関数GetMatchCompatibilityの中においては、与えられたクラスがメイジである場合、GetMatchCompatibility関数がtrueもしくはfalseのいずれを返すべきかを決定するために、MatchSpellProtections関数を呼び出します。

Requirements

#include "nw_i0_generic"

Version

1.28

See Also

functions: | GetMatchCompatibility
categories: | Core AI Talent Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - MoveTo2Q4PlotPoint

Home > Reference > Functions > Movement > MoveTo2Q4PlotPoint

MoveTo2Q4PlotPoint(int)

呼出者にウェイポイントを歩かせます。

void MoveTo2Q4PlotPoint(
    int nPlotPointIndex
);

Parameters

nPlotPointIndex

移動するウェイポイントの路線の数

Description

nPlotPointIndex、その他の使う文字列を作成し、そして文字列のtagを持つウェイポイントがあるならばチェックします。もしある場合、呼出者はそれらの辿って歩くよう強いられます。

Remarks

Found in nw_i0_2q4luskan.nss line 26

Requirements

#include "nw_i0_2q4luskan"

Version

1.28

See Also

categories: Movement Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - MusicBackgroundChangeDay

Home > Reference > Functions > Area, Music Effects > MusicBackgroundChangeDay

MusicBackgroundChangeDay(object, int)

指定されたエリアの日中のBGMを変更します。

void MusicBackgroundChangeDay(
    object oArea,
    int nTrack
);

Parameters

oArea

BGMを変更するエリア

nTrack

変更するトラックナンバー

Description

この関数はエリアの日中のBGMを変更します。

Remarks

これはまた、BGMがオフであればオンにします。

nTrackに対しての定数はありません；代わりにResources > Sounds & Music > Musicからトラックナンバーを参照して下さい。

Version

1.29

Example

// これはobjectのいるエリアの日中のBGMを
// 'Theme Morag'へ変更します
Object oArea = GetArea(OBJECT_SELF)
MusicBackgroundChangeDay(oArea, 55);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Tyson McCann, JP team: Redondo


Function - MusicBackgroundChangeNight

Home > Reference > Functions > Area, Music Effects > MusicBackgroundChangeNight

MusicBackgroundChangeNight(object, int)

指定されたエリアの夜間のBGMを変更する。

void MusicBackgroundChangeNight(
    object oArea,
    int nTrack
);

Parameters

oArea

BGMを変更するエリア

nTrack

変更するトラックナンバー

Description

この関数はエリアの夜間のBGMを変更します。

Remarks

これはまた、BGMがオフであればオンにします。

nTrackに対しての定数はありません；代わりにResources > Sounds & Music > Musicからトラックナンバーを参照して下さい。

Version

1.29

Example

// これはobjectのいるエリアの夜間のBGMを
// 'City Night'へ変更します
Object oArea = GetArea(OBJECT_SELF);
MusicBackgroundChangeNight (oArea, 21);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Tyson McCann, JP team: Redondo


Function - MusicBackgroundGetBattleTrack

Home > Reference > Functions > Area, Music Effects > MusicBackgroundGetBattleTrack

MusicBackgroundGetBattleTrack(object)

エリアの戦闘時BGMのトラックを調べます。

int MusicBackgroundGetBattleTrack(
    object oArea
);

Parameters

oArea

BGMのトラックを調べるエリア

Description

この関数は現在セットされている戦闘時BGMのトラックの数値を返します。

Remarks

返されるトラックの値に対しての定数はありません；代わりにResources > Sounds & Music > Musicからトラックナンバーを参照して下さい。

Version

1.29

Example

object oArea = GetArea(OBJECT_SELF);
int iBattleTrack = MusicBackgroundGetBattleTrack(oArea);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Tyson McCann, JP team: Redondo


Function - MusicBackgroundGetDayTrack

Home > Reference > Functions > Area, Music Effects > MusicBackgroundGetDayTrack

MusicBackgroundGetDayTrack(object)

エリアの日中のBGMのトラックを調べます。

int MusicBackgroundGetDayTrack(
    object oArea
);

Parameters

oArea

BGMのトラックを調べるエリア

Description

この関数は現在セットされている日中のBGMのトラックの数値を返します。

Remarks

返されるトラックの値に対しての定数はありません；代わりにResources > Sounds & Music > Musicからトラックナンバーを参照して下さい。

Version

1.29

Example

object oArea = GetArea(OBJECT_SELF);
int iBattleTrack = MusicBackgroundGetDayTrack (oArea);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Tyson McCann, JP team: Redondo


Function - MusicBackgroundGetNightTrack

Home > Reference > Functions > Area, Music Effects > MusicBackgroundGetNightTrack

MusicBackgroundGetNightTrack(object)

エリアの夜間のBGMのトラックを調べます。

int MusicBackgroundGetNightTrack(
    object oArea
);

Parameters

oArea

BGMのトラックを調べるエリア

Description

この関数は現在セットされている夜間のBGMのトラックの数値を返します。

Remarks

返されるトラックの値に対しての定数はありません；代わりにResources > Sounds & Music > Musicからトラックナンバーを参照して下さい。

Version

1.29

Example

object oArea = GetArea(OBJECT_SELF);
int iBattleTrack = MusicBackgroundGetNightTrack(oArea);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Tyson McCann, JP team: Redondo


Function - MusicBackgroundPlay

Home > Reference > Functions > Music Effects > MusicBackgroundPlay

MusicBackgroundPlay(object)

現在選択されているBGMの演奏をスタートします。

void MusicBackgroundPlay(
    object oArea
);

Parameters

oArea

対象とするエリア

Description

この関数は指定するエリアで現在選択されている（昼/夜、決められた）BGMの演奏をスタートします。

Version

1.22

Example

object oArea = GetArea(OBJECT_SELF);
MusicBackgroundPlay (oArea);

See Also

categories: Music Effects Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: Redondo


Function - MusicBackgroundSetDelay

Home > Reference > Functions > Area, Music Effects > MusicBackgroundSetDelay

MusicBackgroundSetDelay(object, int)

BGMの遅れ（ミリ秒で）を変更します。

void MusicBackgroundSetDelay(
    object oArea,
    int nDelay
);

Parameters

oArea

対象とするエリア

nDelay

遅れ（ミリ秒）

Description

テストによるとこのスクリプトの機能は不可解である。現在のところ、no-op関数であると思われる。

Known Bugs

BGMへの顕著な影響が見られない。

Version

1.22

Example

MusicBackgroundSetDelay(GetArea(OBJECT_SELF), 500);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: Redondo


Function - MusicBackgroundStop

Home > Reference > Functions > Area, Music Effects > MusicBackgroundStop

MusicBackgroundStop(object)

現在選択されているBGMの演奏をストップします。

void MusicBackgroundStop(
    object oArea
);

Parameters

oArea

対象とするエリア

Description

BGMの演奏を終えます。

Version

1.22

Example

object oArea = GetArea(OBJECT_SELF);
MusicBackgroundStop(oArea);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: Redondo


Function - MusicBattleChange

Home > Reference > Functions > Area, Music Effects > MusicBattleChange

MusicBattleChange(object, int)

指定されたエリアの戦闘時BGMを変更する。

void MusicBattleChange(
    object oArea,
    int nTrack
);

Parameters

oArea

対象とするエリア

nTrack

変更するトラックナンバー

Description

この関数はエリアの戦闘時BGMを変更します。

Remarks

nTrackに対しての定数はありません；代わりにResources > Sounds & Music > Musicからトラックナンバーを参照して下さい。

Version

1.29

Example

// 現在のエリアの戦闘BGMを'Forest Combat 2'へ変更します
object oArea = GetArea(OBJECT_SELF);
MusicBattleChange(oArea, 36);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Charles Feduke, additional contributor(s): Tyson McCann, JP team: Redondo


Function - MusicBattlePlay

Home > Reference > Functions > Area, Music Effects > MusicBattlePlay

MusicBattlePlay(object)

現在選択されている戦闘時BGMの演奏をスタートします。

void MusicBattlePlay(
    object oArea
);

Parameters

oArea

対象とするエリア

Description

この関数は指定するエリアで現在選択されている戦闘時BGMの演奏をスタートします。

Version

1.22

Example

object oArea = GetArea(OBJECT_SELF);
MusicBattlePlay(oArea);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: Redondo


Function - MusicBattleStop

Home > Reference > Functions > Area, Music Effects > MusicBattleStop

MusicBattleStop(object)

現在の戦闘時BGMの演奏をストップします。

void MusicBattleStop(
    object oArea
);

Parameters

oArea

対象とするエリア

Description

エリアの戦闘時BGMの演奏を終えます。

Version

1.22

Example

// エリアのOnEnterに設定すると
// 戦闘時BGMをストップする
object oArea = GetArea(OBJECT_SELF);
MusicBattleStop(oArea);

See Also

categories: Area Functions | Music Effects Functions

author: Michael Nork, editor: Jeff Lindsey, JP team: Redondo


Function - MyPrintString

Home > Reference > Functions > Debug > MyPrintString

MyPrintString(string)

ゲーム中のデバッギングに使われます。(コメントによってON/OFFを行います。)

void MyPrintString(
    string sString
);

Parameters

sString

出力する文字列。

Description

PrintString関数がコメントアウトされている箇所において、PrintString関数のカバーを行う関数です。

Remarks

多分この関数は、Biowareによってデバッギングのために使用されますが、デバッグ出力をしたい時にPrintString関数の呼び出しのコメントアウトを外します。(便利な理由は、シンボルに対するコンパイラ命令が、NWNScriptにおいてサポートされていないからです。)

PrintString関数の呼び出しは、デフォルトではコメントアウトされています。

この関数に何かをさせるためには、コメントアウトを外さなければなりません。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

functions: | PrintString
categories: | Debug Functions

author: Charles Feduke, editor: Michael Nork, additional contributor(s): Drake Coker, JP team: katsu794


Function - MyResistSpell

Home > Reference > Functions > Spell Casting Effects, Spells, Visual Effects > MyResistSpell

MyResistSpell(object, object, float)

適用可能なとき呪文抵抗のアニメーションを調べ、実行します。

int MyResistSpell(
    object oCaster,
    object oTarget,
    float fDelay = 0.0f
);

Parameters

oCaster

呪文の詠唱者

oTarget

呪文のターゲット

fDelay

ビジュアルエフェクトを与えるまでの遅れ（もし0.5よりも大きければ、0.1まで減らされます）。(デフォルト: 0.0f)

Description

呪文抵抗、グローブ呪文、マントル呪文のための適切なビジュアルエフェクトをつくり、抵抗呪文とおなじ値を返します。

Requirements

#include "nw_i0_spells"

Version

1.29

See Also

functions: | ResistSpell
categories: | Spell Casting Effects Functions | Spells Functions | Visual Effects Functions

author: Charles Feduke, JP team: Redondo


Function - MySavingThrow

Home > Reference > Functions > Spell Casting Effects, Spells, Visual Effects > MySavingThrow

MySavingThrow(int, object, int, int, object, float)

セービングスローによる呪文相殺を調べます。

int MySavingThrow(
    int nSavingThrow,
    object oTarget,
    int nDC,
    int nSaveType = SAVING_THROW_TYPE_NONE,
    object oSaveVersus = OBJECT_SELF,
    float fDelay = 0.0f
);

Parameters

nSavingThrow

SAVING_THROW_*

oTarget

呪文のターゲット

nDC

呪文セーブの難度。DC。

nSaveType

SAVING_THROW_TYPE_* (デフォルト: SAVING_THROW_TYPE_NONE)

oSaveVersus

セーブを行う相手となるクリーチャーもしくはオブジェクト(デフォルト: OBJECT_SELF)

fDelay

セーブが作られるまでの遅れ。(デフォルト: 0.0f)

Description

クリーチャーのセービングスローによってビジュアルエフェクトをともなって呪文相殺と失敗を調べます。

適切なセービングスローは、nSavingThrowにより指定されるセーブを使って、設定されたDCに対して行われます。

セービングが成功すると、指定したセーブのビジュアルエフェクトを見せます（例、SAVING_THROW_REFLEXはクリーチャーの動きを見せます）。

セービングが失敗する、もしくはセーブが許されなかったとき呪文の効果が適用されます（これは、呪文のタイプにより示されるようにどのような即時の死亡アニメーションでも含みます）

クリーチャーが詠唱している呪文に免疫があるときセーブに失敗しても、効果は全然適用されません。呪文抵抗ビジュアルキューは行われます。

セービングスローがされたときのみTRUEを返し、それ以外はFALSEを返します（呪文抵抗で影響を受けるクリーチャーが呪文を避ける場合もFALSEを返します）。

Remarks

デフォルトSAVING_THROW_TYPE_NONEのnSaveTypeは、セーブが全然されないということを意味しているのではありません；呪文が、あてはまる他のSAVING_THROW_TYPE_*定数を持っていないことを意味してします。

Requirements

#include "nw_i0_spells"

Version

1.29

See Also

categories: | Spell Casting Effects Functions | Spells Functions | Visual Effects Functions
constants: | SAVING_THROW_* Constants | SAVING_THROW_TYPE_* Constants

author: Charles Feduke, JP team: Redondo


Function - nDetermineClassToUse

Home > Reference > Functions > Item Creation > nDetermineClassToUse

nDetermineClassToUse(object)

ランダム財宝生成システムにおいて、PCの三つのクラスのうちどのクラスを参照するか決定します。

int nDetermineClassToUse(
    object oCharacter
);

Parameters

oCharacter

財宝の種類を選択するために参照するPC

Description

この関数は、いくつかの任意の機会に使用され、出現させる財宝を決定するためにPCの3つのクラスを得ます。

Remarks

アイテム作成に関するincludeファイル（nw_i0_coninclude）の中で使用され、この関数はnw_i0_generic内のDetermineClassToUseとパラメーターを除いて全く同じ動作をし、この関数はさらに容易にPCに対して用いることができることを意味します。

Requirements

#include "NW_O2_CONINCLUDE"

Version

1.28

See Also

categories: Item Creation Functions

author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, Rainie


Function - NextTag

Home > Reference > Functions > Module Specific, Private Functions > NextTag

NextTag(object)

次に歩くウェイポイントのタグを得る。

void NextTag(
    object oWayTarget
);

Parameters

oWayTarget

ここで指定するウェイポイントを基点に、次のウェイポイントを探す。

Description

呼び出しオブジェクトからoWayTargetが3メートル以下にある場合、次のウェイポイントのタグをローカル変数に保存する。

Remarks

nw_c3_waypoint1.nss の 26 行目

インクルードファイルではないため、通常の方法では使用できないが、コピーして使うことができる。

nw_i0_genericのWalkWayPointよりも旧式の関数なため、使用をおすすめできない。使うならWalkWayPoint関数を使おう。

Version

1.28

See Also

functions: | SetWayPointTo1
categories: | Module Specific Functions | Private Functions Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: ngtaicho


Function - nNumberOfCombos

Home > Reference > Functions > Item Creation > nNumberOfCombos

nNumberOfCombos()

合成可能な数を返します。

int nNumberOfCombos();

Description

呼出者のローカル変数から取得した、合成可能な数を返します。

Remarks

nw_o0_itemmaker.nssの83行目で見つかります。

アイテム作成システムの中心部分です。そのシステムの正確な複製を使用しない何者にもほとんど役立ちません。

Requirements

#include "nw_o0_itemmaker"

Version

1.28

See Also

categories: Item Creation Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - ObjectToString

Home > Reference > Functions > Debug > ObjectToString

ObjectToString(object)

オブジェクトを16進の文字列に変換します。

string ObjectToString(
    object oObject
);

Parameters

oObject

文字列に変換するオブジェクト。

Description

デバッグメッセージ内で使用するために、oObjectを16進の文字列に変換します。

Version

1.22

See Also

categories: Debug Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: katsu794


Function - OpenInventory

Home > Reference > Functions > Henchmen/Familiars/Summoned, Inventory > OpenInventory

OpenInventory(object, object)

プレイヤーの所持品パネルを開きます。

void OpenInventory(
    object oCreature,
    object oPlayer
);

Parameters

oCreature

所持品欄を見るクリーチャー。

oPlayer

所持品パネルを見られるプレイヤー。

Description

クリーチャーの所持品パネルを開きます。DMはいずれのプレイヤーの所持品欄も見ることができます。

プレイヤーは自身の所持品欄か、ヘンチマン、使い魔、動物の相棒の所持品欄を見ることができます。

Remarks

前述のカテゴリーのうちの一つに入らない所持品欄を開こうとしても働きません。

この関数はSoUのヘンチマン・システムで使用されています。

プレイヤーが"open henchman inventory"ボタンを押すと、ヘンチマンが聞くシャウトが送られます。

これはOnConversationスクリプトの中の、 x0_inc_henaiで bkRespondToHenchmenShoutという関数の中で使用されています。それは結局OpenInventoryを呼び出します。

Version

1.30

See Also

categories: Henchmen/Familiars/Summoned Functions | Inventory Functions

author: Charles Feduke, editor: Lilac Soul, JP team: NamaYake


Function - OpenNearestLock

Home > Reference > Functions > Henchmen/Familiars/Summoned, Prototyped but Unused > OpenNearestLock

OpenNearestLock()

動作しません。

void OpenNearestLock();

Description

理論的に考えると、この関数は、可能であれば呼び出した者(ヘンチマン)に一番近くの施錠された物を開けさせることが出来ます。

Remarks

nw_i0_assoc.nssの24行目にあります。

この関数を含んでいるincludeファイルにおけるエラーにより、これを使用することができません。

しかしながら、違うスクリプトにはコピーできるかもしれません。

Requirements

#include "nw_i0_assoc"

Version

1.28

See Also

functions: | SpeakQuickChat
categories: | Henchmen/Familiars/Summoned Functions | Prototyped but Unused Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794, Rainie


Function - OpenStore

Home > Reference > Functions > Miscellaneous > OpenStore

OpenStore(object, object, int, int)

売買の為にPCに対して商店を開きます。

void OpenStore(
    object oStore,
    object oPC,
    int nBonusMarkUp = 0,
    int nBonusMarkDown = 0
);

Parameters

oStore

開ける商店object

oPC

商店を提供するプレイヤー

nBonusMarkUp

値上げ率の数字（デフォルト：0）

nBonusMarkDown

値下げ率の数字（デフォルト：0）

Description

oPCにoStoreを開きます。自由選択のパラメーターとして値段の値上げと値下げができます。nBonusMarkUpが10の値をとる場合、値段は通常価格の110%になるでしょう。

Version

1.22

Example

// BiowareのDavid GaiderのスクリプトFAQより:

// 店主はエルフに対して全ての値段を2倍にする。
// （彼らが好きではないのでしょう）
void main()
{
  object oStore = GetObjectByTag("STORE_TAG_HERE");
  if (GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ELF)
  {
    OpenStore(oStore, GetPCSpeaker(), 100);
  }
  else OpenStore(oStore, GetPCSpeaker());
}

See Also

functions:ﾂ | gplotAppraiseOpenStore
categories:ﾂ | Miscellaneous Functions

author: Tom Cassiotis, editor: Kristian Markon, JP team: geshi, Rainie


Function - PC

Home > Reference > Functions > Henchmen/Familiars/Summoned > PC

PC()

文字列を表示するためのデバッグ関数です。エリア内の最初のPCを返します。

object PC();

Description

文字列を表示するためのデバッグ関数です。エリア内の最初のPCを返します。

Remarks

nw_i0_henchman.nss

Requirements

#include "nw_i0_henchman"

Version

1.22

See Also

categories: Henchmen/Familiars/Summoned Functions

author: Michael Nork, JP team: Rainie


Function - PCAcceptedPlot

Home > Reference > Functions > Module Specific > PCAcceptedPlot

PCAcceptedPlot(object)

プレイヤーが暗殺者プロットを受け入れた場合、TRUEを返します。

int PCAcceptedPlot(
    object oPC
);

Parameters

oPC

調べるPC。

Description

oPCのパーティー全員のローカル変数を調べます。

パーティーの中の誰かの変数がTRUEに設定されている場合、TRUEを返します。

そうでない場合、またはoPCが有効なオブジェクトでない場合、FALSEを返します。

Remarks

nw_j_assassin.nssの283行目にあります。

このローカル変数が何処に設定されるかは余り確かではありません。

おそらくPCが暗殺者プロットを受け入れた時に発動するスクリプトによってでしょう。

Bioware社のこの関数を使用する良い理由は見つかりません。

自分自身がどの様に、そしていつ作動するのかを正確に知っているシステムを作成した方がいいでしょう。

Requirements

#include "nw_j_assassin"

Version

1.28

See Also

categories: Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PlayAnimation

Home > Reference > Functions > Effects > PlayAnimation

PlayAnimation(int, float, float)

Play an animation.

void PlayAnimation(
    int nAnimation,
    float fSpeed = 1.0,
    float fSeconds = 0.0
);

Parameters

nAnimation

ANIMATION_*

fSpeed

The speed of the animation. (Default: 1.0)

fSeconds

Duration of the animation in seconds (this is not used for fire and forget animations). (Default: 0.0)

Description

Play nAnimation immediately on the object that called this function. Most animations apply to creatures, but not all creatures can be made to perform each animation. ANIMATION_PLACEABLES_* work on placeables.

The fSpeed parameter can be used to speed up or slow down the animation. 1.0 is normal speed.

The fSeconds parameter is only used with looping animations (ANIMATION_LOOPING_*) and determines how long the creature will perform that animation. A common parameter for looping animations is 6.0, as it means that the creature spends a full round doing that animation.

ANIMATION_FIREFORGET_* animations do not need fSeconds to be provided.

Version

1.22

See Also

functions: | ActionPlayAnimation
categories: | Effects Functions
constants: | ANIMATION_* Constants

author: Tom Cassiotis, editor: Jochem van 't Hull


Function - PlayCharacterTheme

Home > Reference > Functions > Music Effects > PlayCharacterTheme

PlayCharacterTheme(int)

キャラクターに対してBGMを演奏します

void PlayCharacterTheme(
    int nTheme
);

Parameters

nTheme

Description

OBJECT_SELFに対して昼夜の時間を考慮してBGMを演奏します。

Remarks

エリア指定のないMusicBackgroundChange()のようなものです

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | PlayOldTheme
categories: | Music Effects Functions

author: Tom Cassiotis, JP team: Redondo


Function - PlayConversationAnimation

Home > Reference > Functions > Action on Object, Conversation, Visual Effects > PlayConversationAnimation

PlayConversationAnimation(int, object)

実行物をPCの方を向かせ、アニメーションさせます

void PlayConversationAnimation(
    int nAnimationConstant,
    object oTarget
);

Parameters

nAnimationConstant

実行させるアニメーション（ANIMATION_*）

oTarget

正面向かさせるobject

Description

まず最初に、実行物はoTargetの方を向きます。oTargetが有効なobjectではない場合、その代わりとして一番近くのPCの方を向きます。それから、実行者はnAnimationConstantをアニメーションします。もしこれがループするアニメーションであるなら、2秒間だけ実行されます。

Remarks

宿屋のスクリプトや2人のNPCを会話させあう場合のようなスクリプトに非常に適しています。

Requirements

#include "nw_i0_2q4luskan"

Version

1.29

Example

//"drunk_man"というタグを付けたNPCの周辺にトリガーをペイントする
#include "nw_i0_2q4luskan"

void main()
{
//「酔っ払い」に近寄ったのは誰か？
object oTarget=GetEnteringObject();

//トリガーの中心の「酔っ払い」
object oDrunk=GetObjectByTag("drunk_man");

//入ってきたobjectが「酔っ払い」である場合、実行しない
if (oTarget==oDrunk) return;

//３種のアニメーションからランダムに１つを選択する
int nAnimation;
switch (d3())
{
case 1: nAnimation=ANIMATION_LOOPING_TALK_LAUGHING; break;
case 2: nAnimation=ANIMATION_LOOPING_PAUSE_DRUNK; break;
case 3: nAnimation=ANIMATION_FIREFORGET_DRINK; break;
}

//oDrunkをoTargetに向け、酔っ払ったような行動を取らせる
AssignCommand(oDrunk, PlayConversationAnimation(nAnimation, oTarget));

}

See Also

categories: | Action on Object Functions | Conversation Functions | Visual Effects Functions
constants: | ANIMATION_* Constants

author: Lilac Soul, editor: Charles Feduke, JP team: Rainie


Function - PlayDragonBattleCry

Home > Reference > Functions > Sound Effects > PlayDragonBattleCry

PlayDragonBattleCry()

ドラゴンの戦闘時の雄たけびを作ります。

void PlayDragonBattleCry();

Description

二つの雄たけびからランダムに選択されます、50/50。

Remarks

Found in nw_i0_spells.nss on line 39

説明によると雄たけびがドラゴンの年齢に基づくと述べられていますが、そうではなく、d100ロールが使われています。ドラゴンの雄たけび再生はそのロールだけに基づいています。

Requirements

#include "nw_i0_spells"

Version

1.28

See Also

categories: Sound Effects Functions

author: Lilac Soul, JP team: Redondo


Function - PlayerHasArtifactItem

Home > Reference > Functions > Module Specific > PlayerHasArtifactItem

PlayerHasArtifactItem(object)

PCがアーティファクトアイテムを持っているかどうかを調べます。

int PlayerHasArtifactItem(
    object oPC
);

Parameters

oPC

アイテムを持っているかどうかを調べるプレイヤー。

Description

oPCがアーティファクトアイテムを持っている場合、TRUEを返します。アイテムはGetArtifactItem()関数によって検索されます。エラーも含めその他の場合は、FALSEを返します。

Remarks

nw_j_artifact.nssの130行目にあります。

John Shuellの言葉：この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

これらの関数全ては比較的ストレートな内容であり、一見して簡単に理解できます。

さらに全く同じ関数で、"ArtifactItems"の代わりに"ComplexItems"に働く、別のスクリプトもあります。

スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。

Requirements

#include "nw_j_artifact"

Version

1.28

See Also

functions: | GetArtifactItem | SetArtifactItem | TakeArtifactItem | TakeComplexItem
categories: | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PlayerHasComplexItem

Home > Reference > Functions > Module Specific > PlayerHasComplexItem

PlayerHasComplexItem(object)

PCが合成アイテムを持っているかどうかを調べます。

int PlayerHasComplexItem(
    object oPC
);

Parameters

oPC

アイテムを持っているかどうかを調べるプレイヤー。

Description

oPCが合成アイテムを持っている場合、TRUEを返します。アイテムはGetComplexItem()関数によって検索されます。エラーも含めその他の場合は、FALSEを返します。

Remarks

nw_j_complex.nssの130行目にあります。

John Shuellの言葉：この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

これらの関数全ては比較的ストレートな内容であり、一見して簡単に理解できます。

さらに全く同じ関数で、"ComplexItems"の代わりに"ArtifactItems"に働く、別のスクリプトもあります。

スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。

Requirements

#include "nw_j_complex"

Version

1.28

See Also

functions: | GetComplexItem | SetComplexItem | TakeArtifactItem | TakeComplexItem
categories: | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PlayerHasFetchItem

Home > Reference > Functions > Module Specific > PlayerHasFetchItem

PlayerHasFetchItem(object)

PCが拾ったアイテムを持っているかどうかを調べます。

int PlayerHasFetchItem(
    object oPC
);

Parameters

oPC

アイテムを持っているかどうかを調べるプレイヤー。

Description

oPCが拾ったアイテムを持っている場合、TRUEを返します。アイテムはGetFetchItem()関数によって取り出されます。エラーも含めその他の場合は、FALSEを返します。

Remarks

nw_j_fetch.nssの162行目にあります。

John Shuellの言葉：この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

これらの関数全ては比較的ストレートな内容であり、一見して簡単に理解できます。

さらに全く同じ関数で、"Fetch"の代わりに"ArtifactItems"に働く、別のスクリプトもあります。

スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。

Requirements

#include "nw_j_fetch"

Version

1.28

See Also

functions: | GetFetchee | GetFetchItem
categories: | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PlayerHasHead

Home > Reference > Functions > Module Specific > PlayerHasHead

PlayerHasHead(object)

PCが暗殺の犠牲者の頭部を持っているかどうかを調べます。

int PlayerHasHead(
    object oPC
);

Parameters

oPC

頭を持っているかどうかを調べるプレイヤー。

Description

oPCが犠牲者の頭部を持っている場合、TRUEを返します。犠牲者の頭部はGetAssassinHead()関数によって取り出されます。エラーも含めその他の場合、FALSEを返します。

Remarks

nw_j_assassin.nssの332行目にあります。

日常のスクリプト作成ではほとんど役に立ちません。

Requirements

#include "nw_j_assassin"

Version

1.28

See Also

functions: | SetAssassinHead
categories: | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PlayerHasPersonalItem

Home > Reference > Functions > Module Specific > PlayerHasPersonalItem

PlayerHasPersonalItem(object)

PCが暗殺者の犠牲者のパーソナルアイテムを持っているかどうかを調べます。

int PlayerHasPersonalItem(
    object oPC
);

Parameters

oPC

アイテムを持っているかどうかを調べるプレイヤー。

Description

oPCが犠牲者のパーソナルアイテムを持っている場合、TRUEを返します。アイテムはGetPersonalItem()関数によって検索されます。エラーを含めその他の場合は、FALSEを返します。

Remarks

nw_j_assassin.nssの206行目にあります。

Bioware社のクエスト報酬システムの一部ですので、一般的なスクリプト作成ではほとんど役に立ちません。

Requirements

#include "nw_j_assassin"

Version

1.28

See Also

functions: | CreatePersonalItemOn | GetPersonalItem | SetPersonalItem
categories: | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PlayerHasRing

Home > Reference > Functions > Module Specific > PlayerHasRing

PlayerHasRing(object)

救出プロットにおいて使用されるリングをPCが持っているかどうかを調べます。

int PlayerHasRing(
    object oPC
);

Parameters

oPC

アイテムを持っているかどうかを調べるプレイヤー。

Description

PCが救出プロット・リングを持っている場合TRUEを返します。救出プロット・リングはGetPlotRingTag()関数によって返されます。エラーも含めその他の場合、FALSEを返します。

Remarks

nw_j_rescue.nssの202行目にあります。

この関数を考慮してみると、oPCをリングを調べるためのオブジェクトとして使用すると思われますが、実際にはoPCを使用していません。代わりに、PC speaker上のリングを調べます。これはこの関数が会話においてのみ使用可能であることを意味します。そうでない場合は、常にFALSEを返します。

この関数がBioware社のクエスト報酬システムの一部であることを考えると、一般的なスクリプト作成においてはほとんど利用価値がないことがすぐに分かります。

しかしながら、学ぶには良い題材かもしれません。

Requirements

#include "nw_j_rescue"

Version

1.28

See Also

functions: | GetRingGivenTo | SetRingGivenTo
categories: | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PlayerHasStoryItem

Home > Reference > Functions > Module Specific > PlayerHasStoryItem

PlayerHasStoryItem(object)

PCがストーリーアイテムを持っているかどうかを調べます。

int PlayerHasStoryItem(
    object oPC
);

Parameters

oPC

アイテムを持っているかどうかを調べるプレイヤー。

Description

oPCがGetStoryItem()関数によって得られたストーリーアイテムを持っている場合、TRUEを返します。エラーも含めその他の場合、FALSEを返します。

Remarks

nw_j_story.nssの130行目にあります。

この関数はBiowareのクエスト報酬システムの一部ですので、一般的なスクリプト作成にはほとんど役に立ちません。

Requirements

#include "nw_j_story"

Version

1.28

See Also

functions: | TakeComplexItem | TakeStoryItem
categories: | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PlayerWearsUniform

Home > Reference > Functions > Get Data from Object, Module Specific > PlayerWearsUniform

PlayerWearsUniform(object)

PCがある特定の服を装備しているかどうかを調べます。

int PlayerWearsUniform(
    object oPC
);

Parameters

oPC

服装を調べるプレイヤー。

Description

oPCが装備している服が適切なタグを持っている場合、TRUEを返します。タグはGetUniform()関数によって決定されます。エラーも含め、その他の場合はFALSEを返します。

Remarks

nw_j_guard.nssの130行目にあります。

Bioware社の使用方法では、Bioware社以外の残りの方々にとってはほとんど役に立ちませんが、プレイヤーが適切な服装をしていない場合に攻撃をする警備隊を作成する方法を学ぶには、良い手段だと言えるでしょう。

Requirements

#include "nw_j_rescue"

Version

1.28

See Also

functions: | GetUniform | SetUniform
categories: | Get Data from Object Functions | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PlayImmobileAmbientAnimations

Home > Reference > Functions > Core AI > PlayImmobileAmbientAnimations

PlayImmobileAmbientAnimations()

クリーチャーが、より真に迫って立っている様に見えるように、いくつかのアニメーションを実演させます。

void PlayImmobileAmbientAnimations();

Description

この関数を呼び出したクリーチャーが立っている間、クリーチャーにアニメーション効果を割り当てます。

この関数は、像の様にただ立っているだけでなく、よりリアルなクリーチャーを生み出すために使用されます。

Remarks

この関数は、コアAIシステムの一部であり、クリーチャーのOnSpawnスクリプトで静止環境アニメーションが設定された場合に自動的に呼び出されます。

つまり以下を意味します：SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS)

動き回る環境アニメーションをクリーチャーに割り当てるためには、以下のようにします：SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS)

Version

1.22

See Also

functions: | SetSpawnInCondition
categories: | Core AI Functions

author: Tom Cassiotis, JP team: katsu794


Function - PlayMobileAmbientAnimations

Home > Reference > Functions > Core AI > PlayMobileAmbientAnimations

PlayMobileAmbientAnimations()

クリーチャーが、より真に迫って見えるように、いくつかのアニメーションを実演させます。

action PlayMobileAmbientAnimations();

Description

この関数を呼び出したクリーチャーにアニメーション効果を割り当てます。

クリーチャーを他のクリーチャーの方へ移動させて、会話をするように見せかけたり、ぶらぶら歩かせたりします。

Remarks

この関数は、コアAIシステムの一部であり、クリーチャーのOnSpawnスクリプトで環境アニメーションが設定された場合に自動的に呼び出されます。

つまり以下を意味します：SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS)

動き回らない環境アニメーションをクリーチャーに割り当てるためには、以下のようにします：SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS)

Version

1.22

See Also

functions: | GetSpawnInCondition
categories: | Core AI Functions

author: Tom Cassiotis, JP team: katsu794


Function - PlayOldTheme

Home > Reference > Functions > Music Effects > PlayOldTheme

PlayOldTheme()

選ばれた最後のテーマBGMを演奏する。

void PlayOldTheme();

Description

PlayCharacterTheme()によって選ばれた最後のテーマBGMをOBJECT_SELFに対して演奏する。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | PlayCharacterTheme
categories: | Music Effects Functions

author: Tom Cassiotis, JP team: Redondo


Function - PlaySound

Home > Reference > Functions > Sound Effects > PlaySound

PlaySound(string)

クライアントマシン上で音を再生します。

void PlaySound(
    string sSoundName
);

Parameters

sSoundName

再生する音の名前

Description

sSoundName音を再生します。

Remarks

PlaySoundは直ちに実行され、音の再生が終わるのを待ちません。もしトリガ使用して音を再生したいのであれば、SoundObjectPlayを見てください、再生にはオブジェクトが必要です。

Version

1.22

Example

// オブジェクトのOnUsedイベントへ設定します。鐘の音を鳴らします。

main()
{
    PlaySound("as_cv_gongring2");
}

See Also

functions: | SoundObjectPlay
categories: | Sound Effects Functions

author: Tom Cassiotis, editor: Maximus, JP team: Redondo


Function - PlaySoundByStrRef

Home > Reference > Functions > Sound Effects > PlaySoundByStrRef

PlaySoundByStrRef(int, int)

文字リファレンス(StrRef)に関連する音を再生します。

void PlaySoundByStrRef(
    int nStrRef,
    int nRunAsAction = TRUE
);

Parameters

nStrRef

再生する音の文字リファレンス数値

nRunAsAction

アクションキューに積み重ねて再生するかどうかを決めます。(デフォルト: TRUE)

Description

StrRefに関連する音を再生します。音はスクリプトを実行したオブジェクトから単体音として発せられます。nRunAsActionがFALSEであれば音はすぐに再生されます。

Remarks

音に関するStrRefの値はNWNインストールディレクトリのdialog.tlkファイルの中にあります。

Version

1.30

See Also

categories: Sound Effects Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Redondo


Function - PlaySuccessVisual

Home > Reference > Functions > Visual Effects > PlaySuccessVisual

PlaySuccessVisual(object)

ターゲットに、上達した能力スコアに関して視覚エフェクトを与えます。

void PlaySuccessVisual(
    object oVisual
);

Parameters

oVisual

視覚エフェクトを与えるオブジェクト

Description

単にoVisualに対して、上達した能力スコアに関するVFX(VFX_IMP_IMPROVE_ABILITY_SCORE) を与えます。

Remarks

Found in nw_o0_itemmaker.nss line 100

アイテムが鍛えられたときに使われます。

Requirements

#include "nw_o0_itemmaker"

Version

1.28

See Also

categories: | Visual Effects Functions
constants: | VFX_IMP_* Constants

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Redondo


Function - PlayVoiceChat

Home > Reference > Functions > Effects > PlayVoiceChat

PlayVoiceChat(int, object)

Plays a voice chat.

void PlayVoiceChat(
    int nVoiceChatID,
    object oTarget = OBJECT_SELF
);

Parameters

nVoiceChatID

VOICE_CHAT_*

oTarget

The creature to voice the specified saying. (Default: OBJECT_SELF)

Description

Makes oTarget plays a voice chat.

Version

1.22

See Also

categories: | Effects Functions
constants: | VOICE_CHAT_* Constants

author: Tom Cassiotis


Function - PlotGiverDead

Home > Reference > Functions > Module Specific > PlotGiverDead

PlotGiverDead()

暗殺者プロットの提供者が死んでいるかいないかを返します。

int PlotGiverDead();

Description

単純にSetPlotGiver関数によって格納されたオブジェクトが有効であるかどうかを調べます。有効でない場合、オブジェクトが死んでいることを意味します。そうでない場合は、FALSEを返します。

Remarks

nw_j_assassin.nssの440行目にあります。

一般的なスクリプト作成においては、まったく役に立ちません。

Requirements

#include "nw_j_assassin"

Version

1.28

See Also

functions: | GetPlotGiver
categories: | Module Specific Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - PopUpDeathGUIPanel

Home > Reference > Functions > PC Only > PopUpDeathGUIPanel

PopUpDeathGUIPanel(object, int, int, int, string)

改変できる死亡時パネルを表示します。

action PopUpDeathGUIPanel(
    object oPC,
    int bRespawnButtonEnabled = TRUE,
    int bWaitForHelpButtonEnabled = TRUE,
    int nHelpStringReference = 0,
    string sHelpString = ""
);

Parameters

oPC

パネルを表示させるプレイヤー

bRespawnButtonEnabled

これがTRUEであれば、「蘇生」ボタンが使用可能になります。（デフォルト：TRUE）

bWaitForHelpButtonEnabled

これがTRUEであれば、「助けを待つ」ボタンが使用可能になります。（デフォルト：TRUE）

nHelpStringReference

表示する説明の文字列リファレンス（デフォルト：0）

sHelpString

表示する説明の文字列（デフォルト：""）

Description

「蘇生」や「助けを待つ」ボタンを死亡パネルから表示を消すことができます。「助けを待つ」ボタンはマルチプレー時にのみ有効です。

Remarks

Biowareの死亡ダイアログはPopUpGUIPanel()関数を使用して表示しています。

Version

1.31

See Also

functions: | PopUpGUIPanel
categories: | PC Only Functions
events: | OnDeath Event

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Ross Meeks, JP team: geshi, Rainie


Function - PopUpGUIPanel

Home > Reference > Functions > Miscellaneous > PopUpGUIPanel

PopUpGUIPanel(object, int)

プレイヤーにGUI（Graphical User Interface）パネルを表示させます。

void PopUpGUIPanel(
    object oPC,
    int nGUIPanel
);

Parameters

oPC

GUIを表示させるプレイヤー

nGUIPanel

GUI_PANEL_*

Description

oPCを操作するクライアントにGUIパネルを出現させます。

oPCがプレイヤーキャラクターでない場合や、nGUIPanelが無効な値であった場合は何も起こりません。

Remarks

現在は、プレイヤー死亡パネルただ一つしかGUIパネルは存在しません。

Version

1.22

See Also

functions: | PopUpDeathGUIPanel
categories: | Miscellaneous Functions
constants: | GUI_PANEL_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - pow

Home > Reference > Functions > Math > pow

pow(float, float)

べき乗を求める。

float pow(
    float fValue,
    float fExponent
);

Parameters

fValue

べき乗計算する元の数値（浮動小数値）

fExponent

べき指数。何乗するかの数値（浮動小数値）

Description

fValueをfExponent回乗算して結果を返す。

Version

1.22

See Also

functions: | log | sqrt
categories: | Math Functions

author: Charles Feduke, editor: Tom Cassiotis, JP team: ngtaicho


Function - Prefers

Home > Reference > Functions > Core AI, Item Creation > Prefers

Prefers(int, object)

冒険者が武器タイプを使用することを好むかどうか得ます。

int Prefers(
    int nFeatWeaponType,
    object oAdventurer
);

Parameters

nFeatWeaponType

武器タイプを区別するために特技定数を使用します

oAdventurer

それらの優先権をチェックするPC。

Description

oAdventurerが武器タイプ「nFeatWeaponType」を使用することを好むならばTRUEを返します。そうでなければFALSEを返します。

判断される基準はoAdventurerが武器習熟を持っているかどうかです。

Remarks

この関数は、プレイヤーキャラクター用に財宝を作成するためにNWN財宝作成システムで使用されています。

Requirements

#include "nw_o2_feat"

Version

1.28

See Also

functions: | GetWeaponFocus
categories: | Core AI Functions | Item Creation Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: Rainie


Function - PrintFloat

Home > Reference > Functions > Debug > PrintFloat

PrintFloat(float, int, int)

ログファイルに浮動小数値を記録します。

void PrintFloat(
    float fFloat,
    int nWidth = 18,
    int nDecimals = 9
);

Parameters

fFloat

出力する浮動小数値。

nWidth

使用する全体の文字数。(デフォルト: 18)

nDecimals

10進法部分に使われる文字数。(デフォルト: 9)

Description

フォーマットされた浮動小数値(fFloat)をログファイルに出力します。

Version

1.22

See Also

functions: | PrintInteger | PrintString | PrintVector
categories: | Debug Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: katsu794


Function - PrintInteger

Home > Reference > Functions > Debug > PrintInteger

PrintInteger(int)

整数をログファイルに記録します。

void PrintInteger(
    int nInteger
);

Parameters

nInteger

ログファイルに出力する数字。

Description

nIntegerをログファイルに出力します。

Version

1.22

See Also

functions: | PrintFloat | PrintString | PrintVector
categories: | Debug Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: katsu794


Function - PrintObject

Home > Reference > Functions > Debug > PrintObject

PrintObject(object)

オブジェクトのID番号をログファイルにプリントします。

void PrintObject(
    object oObject
);

Parameters

oObject

ID番号をログファイルに出力するオブジェクト。

Description

oObjectのID番号をログファイルに出力します。

Version

1.26

See Also

categories: Debug Functions

author: Charles Feduke, additional contributor(s): Jeff Chase, JP team: katsu794


Function - PrintString

Home > Reference > Functions > Debug, Miscellaneous, String > PrintString

PrintString(string)

メッセージをログファイルに記録する。

void PrintString(
    string sString
);

Parameters

sString

記録をとるメッセージ

Description

文字列メッセージ（sString）をログファイルに書く

Version

1.22

Example

// 様々なテストの基礎をカバーする、サンプルデバッグコール
void debug(string sMessage)
{
     SendMessageToPC(GetFirstPC(), sMessage);
     SendMessageToAllDMs(sMessage);
     PrintString(sMessage);
}

See Also

functions: | MyPrintString | PrintFloat | PrintInteger | PrintVector | SendMessageToAllDMs | SendMessageToPC
categories: | Debug Functions | Miscellaneous Functions | String Functions

author: Iskander Merriman, editor: Jeff Lindsey, JP Team: weed


Function - PrintVector

Home > Reference > Functions > Debug > PrintVector

PrintVector(vector, int)

ベクター値をログファイルに記録します。

void PrintVector(
    vector vVector,
    int bPrepend
);

Parameters

vVector

出力するベクター値。

bPrepend

TRUEを指定すると、メッセージの前に"PRINTVECTOR:"が接続されるでしょう。

Description

vVectorをログファイルに出力します。bPrependがTRUEであれば、文字列"PRINTVECTOR:"がベクター値の前に接続されるでしょう。

Version

1.22

See Also

functions: | PrintFloat | PrintInteger | PrintString
categories: | Debug Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: katsu794


Function - Raise

Home > Reference > Functions > PC Only > Raise

Raise(object)

死亡からPCを復活させます。

void Raise(
    object oPlayer
);

Parameters

oPlayer

蘇生させるPC

Description

死亡からoPlayerを蘇生させ、全ての負のエフェクトを取り除き、ビジュアルエフェクトを与えます。

Requirements

#include "nw_o0_death"

Version

1.22

Example

// この関数のver1.24用ソース
void Raise(object oPlayer)
{
        effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);

        effect eBad = GetFirstEffect(oPlayer);
        ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
        ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);

        // 負のエフェクトを調べる
        while(GetIsEffectValid(eBad))
        {
            if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
                GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
                GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
                GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
                GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
                {
                    // 負のエフェクトを取り除く
                    RemoveEffect(oPlayer, eBad);
                }
            eBad = GetNextEffect(oPlayer);
        }
        // 指定した目標に効果を発動させる
        SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
}

See Also

categories: PC Only Functions

author: Tom Cassiotis, JP team: geshi, Rainie


Function - Random

Home > Reference > Functions > Math > Random

Random(int)

擬似乱数を発生させる。

int Random(
    int nMaxInteger
);

Parameters

nMaxInteger

乱数の上限値を指定する（最大65535）

Description

0から(nMaxInteger - 1)までの整数の乱数を発生させ返す（返り値はnMaxInteger未満になる）。

remarks

返り値の最大数は(nMaxInteger - 1)になる。

Version

1.28

Example

// 0、1、2、3のどれかの数値を返す。

nValue = Random(4);

// 1～30の乱数を発生させる。

nValue = Random(30) + 1;

// -10～10の乱数を発生させる。

nValue = Random(21) -10;    // 0が存在するため20ではなく21

See Also

functions: | d10 | d100 | d12 | d2 | d20 | d3 | d4 | d6 | d8 | GetRandomDelay
categories: | Math Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): John Harris, Mark Schuit, JP team: ngtaicho


Function - RandomName

Home > Reference > Functions > Miscellaneous > RandomName

RandomName()

無作為な名前を作成します。

string RandomName();

Description

無作為な名前を作成します。

Remarks

実際にスクリプトからNPCに、名前を設定する方法がありません。

Version

1.22

See Also

categories: Miscellaneous Functions

author: Tom Cassiotis, JP team: Rainie


Function - RecomputeStaticLighting

Home > Reference > Functions > Effects > RecomputeStaticLighting

RecomputeStaticLighting(object)

Recomputes the lighting in an area based on current static lighting conditions.

action RecomputeStaticLighting(
    object oArea
);

Parameters

oArea

The area that needs its static lighting conditions recomputed.

Description

All clients in oArea will recompute the static lighting.

This can be used to update the lighting after changing any tile lights or if placeables with lights have been added/deleted.

Remarks

// From David Gaider's Scripting FAQ
For placeable objects that are sources of illumination (such as the lamp post), it is not enough to just use its ANIMATION_PLACEABLE_DEACTIVATE or ANIMATION_PLACEABLE_ACTIVATE. That just affects the glowing part of the animation, itself. You must also use the SetPlaceableIllumination command set to TRUE and tell the area it's in to RecomputeStaticLighting.

Version

1.22

Example

// From David Gaider's Scripting FAQ
// will turn the lightable object on and off when selected
// placed in its OnUsed event
void main()
{
   if (GetLocalInt (OBJECT_SELF,"NW_L_AMION") == 0)
   {
      SetLocalInt (OBJECT_SELF,"NW_L_AMION",1);
      PlayAnimation (ANIMATION_PLACEABLE_ACTIVATE);
      SetPlaceableIllumination (OBJECT_SELF, TRUE);
      RecomputeStaticLighting(GetArea(OBJECT_SELF));
   }
   else
   {
      SetLocalInt (OBJECT_SELF,"NW_L_AMION",0);
      PlayAnimation (ANIMATION_PLACEABLE_DEACTIVATE);
      SetPlaceableIllumination (OBJECT_SELF, FALSE);
      RecomputeStaticLighting(GetArea(OBJECT_SELF));
   }
}

See Also

functions: | GetPlaceableIllumination | GetTileMainLight1Color | GetTileMainLight2Color | GetTileSourceLight1Color | GetTileSourceLight2Color | SetPlaceableIllumination
categories: | Effects Functions

author: Tom Cassiotis


Function - ReflexSave

Home > Reference > Functions > Saving Throw > ReflexSave

ReflexSave(object, int, int, object)

反応セーブ判定を実行する。

int ReflexSave(
    object oCreature,
    int nDC,
    int nSaveType = SAVING_THROW_TYPE_NONE,
    object oSaveVersus = OBJECT_SELF
);

Parameters

oCreature

セービングスローを振らなければならないクリーチャー

nDC

セービングスローの難易度

nSaveType

SAVING_THROW_TYPE_* (デフォルト：SAVING_THROW_TYPE_NONE)

oSaveVersus

セービングスローを引き起こす主体(デフォルト：OBJECT_SELF)

Description

与えられた難易度で反応セーブ判定を行う。

セービングスローに失敗した場合は、0を返す。
セービングスローに成功した場合は、1を返す。
特定のセーブのタイプに対する免疫がターゲットにある場合は、2を返す。

Version

1.22

See Also

functions: | FortitudeSave | WillSave
categories: | Saving Throw Functions
constants: | SAVING_THROW_TYPE_* Constants

author: Tom Cassiotis, JP team: weed


Function - RemoveAmbientSleep

Home > Reference > Functions > Core AI > RemoveAmbientSleep

RemoveAmbientSleep()

聴覚チェックが成功した場合に睡眠効果を取り除きます。

void RemoveAmbientSleep();

Description

この実用的な関数は、仮の睡眠(睡眠効果を作り出した者)が設定されたクリーチャーを目覚めさせることができます。

この関数を呼び出したクリーチャーが、DC 15の聴覚チェック(ヴィズダム修正あり)ロールに成功した場合に、睡眠効果が取り除かれます。

Remarks

クリーチャーのOnSpawnイベントにSleepEffectを適用することで、"眠気がする"睡眠(睡眠呪文とは反対)をシュミレートすることができます。よって、睡眠効果の作成者はクリーチャー(OBJECT_SELF)ということになります。

この関数は、コアAIの中で、助けを求めているパーティーメンバーを助けるための適切な聴覚チェックを行うために使用することができます。

睡眠に関しての詳細情報については、David Gaider氏のスクリプト作成FAQも見て下さい。

Requirements

#include "NW_I0_GENERIC"

Version

1.29

See Also

functions: | EffectSleep
categories: | Core AI Functions
events: | OnPlayerRest Event | OnRested Event

author: Tom Cassiotis, editor: Jody Fletcher, JP team: katsu794


Function - RemoveEffect

Home > Reference > Functions > Effects > RemoveEffect

RemoveEffect(object, effect)

Removes an effect from a creature or object.

void RemoveEffect(
    object oCreature,
    effect eEffect
);

Parameters

oCreature

The object to remove an effect from.

eEffect

The effect to remove.

Description

Removes eEffect from oCreature.

Version

1.22

Example

// Bioware's utility function to remove the sleep effect
// on a successful DC 15 listen check.
void RemoveAmbientSleep()
{
   if(GetHasEffect(EFFECT_TYPE_SLEEP))
   {
      effect eSleep = GetFirstEffect(OBJECT_SELF);
      while(GetIsEffectValid(eSleep))
      {
         if(GetEffectCreator(eSleep) == OBJECT_SELF)
         {
            int nRoll = d20();
            nRoll += GetSkillRank(SKILL_LISTEN);
            nRoll += GetAbilityModifier(ABILITY_WISDOM);
            if(nRoll > 15)
            {
               RemoveEffect(OBJECT_SELF, eSleep);
            }
         }
         eSleep = GetNextEffect(OBJECT_SELF);
      }
   }
}

See Also

functions: | EffectSpellLevelAbsorption | GetEffectDurationType | GetEffectSpellId | GetEffectSubType | GetEffectType
categories: | Effects Functions

author: Tom Cassiotis


Function - RemoveEffects

Home > Reference > Functions > PC Only > RemoveEffects

RemoveEffects(object)

クリーチャーから全ての負のエフェクトを取り除きます。

void RemoveEffects(
    object oDead
);

Parameters

oDead

負のエフェクトを取り除くクリーチャー

Description

oDeadから全ての負のエフェクトを取り除きます。

Remarks

生前に悩んだ全ての負のエフェクトを取り除き、死んだキャラクターを戻す時に使います。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | GreaterRestore
categories: | PC Only Functions

author: Tom Cassiotis, JP team: Rainie


Function - RemoveFromParty

Home > Reference > Functions > Party > RemoveFromParty

RemoveFromParty(object)

パーティからPCを外します。

void RemoveFromParty(
    object oPC
);

Parameters

oPC

現在パーティに属していれば外すパーティ

Description

現在のパーティからoPCを外します。これはPCにのみ動作します。

Remarks

PCからヘンチマンのNPCを外す場合はRemoveHenchman()を使ってください。パッチ1.28の時点で、サーバー設定が「1つのパーティーのみ」にセットされている場合、パーティーからプレーヤーを追い出しません。

Version

1.28

See Also

functions: | AddToParty | RemoveHenchman
categories: | Party Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: Rainie


Function - RemoveHenchman

Home > Reference > Functions > Henchmen/Familiars/Summoned > RemoveHenchman

RemoveHenchman(object, object)

PCである雇い主からヘンチマンを外します。

void RemoveHenchman(
    object oMaster,
    object oHenchman = OBJECT_SELF
);

Parameters

oMaster

ヘンチマンが従っている雇い主PC

oHenchman

外すヘンチマン（デフォルト：OBJECT_SELF）

Description

oMasterの雇われ役からoHenchmanを外し、彼等の元々のファクションに戻します。

Version

1.22

See Also

functions: | GetHenchman | RemoveFromParty | RemoveSummonedAssociate | ResetHenchmenState
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: Tom Cassiotis, JP team: Rainie


Function - RemoveJournalQuestEntry

Home > Reference > Functions > Journal > RemoveJournalQuestEntry

RemoveJournalQuestEntry(string, object, int, int)

PCの日記画面からジャーナルクエストエントリーを取り除きます。

action RemoveJournalQuestEntry(
    string sPlotID,
    object oCreature,
    int bAllPartyMembers = TRUE,
    int bAllPlayers = FALSE
);

Parameters

sPlotID

ツールセットの日記エディタにおけるプロット識別番号。

oCreature

プレーヤー

bAllPartyMembers

TRUEの場合、パーティ全員のジャーナルからエントリーを取り除きます。
(Default: TRUE)

bAllPlayers

TRUEの場合、モジュール内の全てのプレーヤーのジャーナルからエントリーを取り除きます。
(Default: FALSE)

Description

この関数はプレイヤーの日記画面の「クエスト」タブ及び「完了したクエスト」タブから、(sPlotID)で指定したカテゴリーに属する全てのエントリーを取り除きます。プレイヤーにフィードバックを与えません。

Version

1.22

See Also

functions: | AddJournalQuestEntry
categories: | Journal Functions

author: Jody Fletcher, editor: Charles Feduke, JP team: geshi, Rainie


Function - RemoveProtections

Home > Reference > Functions > Spells > RemoveProtections

RemoveProtections(int, object, int)

指定したタイプの全ての防御魔法を取り除きます。

int RemoveProtections(
    int nSpellID,
    object oTarget,
    int nCount
);

Parameters

nSpellID

SPELL_ID_*

oTarget

防御魔法を取り除かれるObject

nCount

Not used

Description

指定したタイプの全ての防御呪文が取り除かれます。

１つもしくはそれ以上の防御呪文が取り除かれた場合1を、そうでなければ0を返します。

Remarks

nw_i0_spells.nssの33行目で見つかります。

Requirements

#include "nw_i0_spells"

Version

1.22

See Also

functions: | GetSpellBreachProtection
categories: | Spells Functions
constants: | SPELL_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - RemoveSpecificEffect

Home > Reference > Functions > Effects > RemoveSpecificEffect

RemoveSpecificEffect(int, object)

Removes effects from a creature.

void RemoveSpecificEffect(
    int nEffectTypeID,
    object oTarget
);

Parameters

nEffectTypeID

EFFECT_TYPE_*

oTarget

Target to remove the effects from

Description

Loops through all of oTarget’s effects, and removes those with the effect type specified in nEffectTypeID.

Remarks

Found in nw_i0_spells.nss line 23

In the documentation to the function, it is hinted that it is to be used for creatures exiting an AOE (area of effect) to remove effects from that AOE. It is apparently not used for this. The only place I could find that it is called from is from the script nw_s0_remeffect, where it is used to remove a series of bad effects.

Actually, this is a very nice little wrapper function that saves us a bit of work when wanting to remove effects from objects.

Requirements

#include "nw_i0_spells"

Version

1.28

Example

#include "nw_i0_spells"

void main()
{
//Unpolymorph a polymorphed PC through conversation

object oPC=GetPCSpeaker();

RemoveSpecificEffect(EFFECT_TYPE_POLYMORPH, oPC);
}

See Also

categories: | Effects Functions
constants: | EFFECT_TYPE_* Constants

author: Lilac Soul, additional contributor(s): Lilac Soul


Function - RemoveSpellEffects

Home > Reference > Functions > Spells > RemoveSpellEffects

RemoveSpellEffects(int, object, object)

クリーチャー上の呪文によるeffectを取り除きます。

void RemoveSpellEffects(
    int nSpellID,
    object oCaster,
    object oTarget
);

Parameters

nSpellID

取り除かれるeffectの呪文

oCaster

呪文の詠唱者

oTarget

呪文のeffectが取り除かれる対象

Description

RemoveSpellEffectsはoTarget上のeffectを検索し、呪文nSpell_IDによって引き起こされ、oCasterによって詠唱されたeffectを取り除きます。

Remarks

nw_i0_spells.nssの21行目で見つかります。

Requirements

#include "nw_i0_spells"

Version

1.22

See Also

categories: Spells Functions

author: Tom Cassiotis, JP team: Rainie


Function - RemoveSummonedAssociate

Home > Reference > Functions > Henchmen/Familiars/Summoned > RemoveSummonedAssociate

RemoveSummonedAssociate(object, object)

仲間のNPCをPCの使役から取り除きます。

void RemoveSummonedAssociate(
    object oMaster,
    object oAssociate = OBJECT_SELF
);

Parameters

oMaster

仲間を取り除く主人PC。

oAssociate

oMasterの使役から取り除く仲間。(デフォルト: OBJECT_SELF)

Description

この関数は、召喚されている仲間に対してPCが持っている"高等な"アビリティを取り除きます。(例 私を癒せ、後に従え、など)

その時、召喚されている仲間はPCに対してニュートラルな状態になり、PCが休息する時に静かに消えます。

Remarks

オーロラツールセットにおいて、仲間は彼らの当初のファクションに戻るだろうと示されています。

召喚されている仲間は、時々PCの後に従って行き、その他の場合は動かなくなってPCを視野内に保つようになります。

PCから取り除かれ、ニュートラルなファクションを持った召喚されている仲間は、なおもPCに敵対しているクリーチャーを攻撃するでしょう。

Version

1.22

See Also

functions: | GetAssociate | RemoveHenchman
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: Jody Fletcher, JP team: katsu794


Function - ResetHenchmenState

Home > Reference > Functions > Henchmen/Familiars/Summoned > ResetHenchmenState

ResetHenchmenState()

Henchman becomes available for other instructions by PC.

void ResetHenchmenState();

Description

Sets the henchman to commandable, deletes local variables having to do with doors and clears the henchman's queued actions.

Local variables concerning doors focuses on current door (if any) the henchmen has targeted to bash and the doors hit points.

Remarks

This is a short and sweet function that clears the henchmen and makes them ready for new orders.

Requirements

#include "NW_I0_GENERIC"

Version

1.29

See Also

functions: | GetHenchman | RemoveHenchman
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: Jody Fletcher


Function - ResistSpell

Home > Reference > Functions > Spells > ResistSpell

ResistSpell(object, object)

詠唱者とその目標の間で呪文抵抗チェックを実行します。

int ResistSpell(
    object oCaster,
    object oTarget
);

Parameters

oCaster

呪文の詠唱者

oTarget

呪文の目標

Description

oTargetがoCasterによる最後の呪文に抵抗した場合TRUEを、oCasterかoTargetのどちらかが無効なObjectの場合FALSEを返します。

Version

1.22

See Also

functions: | ActionCastFakeSpellAtObject | ActionCastSpellAtObject | MyResistSpell
categories: | Spells Functions

author: Jody Fletcher, editor: Charles Feduke, JP team: Rainie


Function - RespondToShout

Home > Reference > Functions > Core AI > RespondToShout

RespondToShout(object, int, object)

Sets NPC to respond to numerous alerts sent by PC or other NPCs.

void RespondToShout(
    object oShouter,
    int nShoutIndex,
    object oIntruder = OBJECT_INVALID
);

Parameters

oShouter

Object which something has occurred to.

nShoutIndex

Consistent reaction requested.

oIntruder

Placeable who disturbed oShouter. (Default: OBJECT_INVALID)

Description

Allows the listener to react in a manner consistent with the given shout but only to one combat shout per round. The intruder object is for cases where a placeable needs to pass a LastOpenedBy object or a AttackMyAttacker needs to make his attacker the enemy of everyone.

Version

1.22

See Also

functions: | GetLastHostileActor
categories: | Core AI Functions
events: | OnDisturbed Event | OnPhysicalAttacked Event | OnSpellCastAt Event | OnUnlock Event

author: Jody Fletcher, editor: Tom Cassiotis


Function - RestoreCameraFacing

Home > Reference > Functions > Miscellaneous, PC Only > RestoreCameraFacing

RestoreCameraFacing()

カメラのモードと向きを修復します。

void RestoreCameraFacing();

Description

StoreCameraFacingが最後に呼出された状態へと、カメラのモードと向きを修復します。RestoreCameraFacingは一度のみ使用でき、StoreCameraFacingの前の呼び出しへと相当するに違いありません。

Remarks

StoreCameraFacingとRestoreCameraFacingは、カメラを扱いたいことに関するパラメータがないことに注意してください。だからPCに行わせたいカメラの動きを呼出すAssignCommandと共にこれらを呼出す必要があります。

ameraFacing呼出によって収納されたカメラの向きとモードを「1度だけ」元に戻すことが出来ます。PCがカットシーン中でないときにRestoreCameraFacingを呼出します。それがバグか意図した動作なのかはわかりません。

SetCutsceneModeがTRUEに設定されれば、PCのカメラの向きは自動的に保存され、FALSEに設定されれば、カメラの向きは自動的に回復されるように思います。これは、あなたがカメラ・モードや向きの全ての材料の種類をカットシーンで、それについて後で心配する必要なしに行うことができることを意味します。しかしながら、あなたがcutsceneの中でPCを動かせば、回復されたカメラの向きはもはやよい角度などではないかもしれません。この場合、PCがカットシーンから出たとき、SetCameraFacingを常に呼出すことが出来ます。

Version

1.30

See Also

functions: | SetCameraFacing | SetCameraMode | SetCutsceneMode | StoreCameraFacing
categories: | Miscellaneous Functions | PC Only Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - RetrieveCampaignObject

Home > Reference > Functions > Database > RetrieveCampaignObject

RetrieveCampaignObject(string, string, location, object, object)

キャンペーンデータベースに保管されているオブジェクトを取り出します。

object RetrieveCampaignObject(
    string sCampaignName,
    string sVarName,
    location locLocation,
    object oOwner = OBJECT_INVALID,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

値を取り出すキャンペーン名。(大文字/小文字は区別されます)

sVarName

変数名。

locLocation

オブジェクトを作成するロケーション。

oOwner

オブジェクトを内部に作成しようとする所有者。

oPlayer

データベース内に保管されていたオブジェクトに関連づけられているプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースに保管されているオブジェクトを返します。

キャンペーン名は、大文字/小文字が区別されます。

所有者を指定した場合は、所有者のレポジトリ(倉庫)にオブジェクトを作成しようとするでしょう。

所有者がアイテムを扱えない場合(または、所有者がクリーチャーの場合)は、アイテムは地面に作成されるでしょう。

Remarks

他にどの所有者タイプがアイテムを扱えないかは知られていません。

有効な所有者が指定される際にロケーションが重要であるかどうかは分かりません。(GetLocation(oOwner)関数で十分です。)

オブジェクト上のローカル変数を保管する際には、その変数はデータベース内には保管されないようです。

Version

1.30

See Also

functions: | StoreCampaignObject
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - RewardGP

Home > Reference > Functions > Money > RewardGP

RewardGP(int, object, int)

プレイヤーと可能であればそのパーティメンバーに報酬としてゴールドを与えます。

void RewardGP(
    int nGP,
    object oTarget,
    int bAllParty = TRUE
);

Parameters

nGP

報酬の金額

oTarget

ゴールドを受け取るPC

bAllParty

oTargetがメンバーであるパーティ全体がゴールドを受け取るかどうか。（デフォルト：TRUE）

Description

oTargetに、もしbAllPartyがTRUEであればパーティメンバー全員に、報酬としてnGPゴールドを与える

Remarks

これは受け取る全ての人たちに同量のGPを与えます。よって、nGPが50で、3人のPCがいるならば、総額150gp与えられるでしょう。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Money Functions

author: Tom Cassiotis, JP team: Rainie


Function - RewardPartyGP

Home > Reference > Functions > Action on Object, Money > RewardPartyGP

RewardPartyGP(int, object, int)

PCとPCのパーティ全体にゴールドを与えます。

void RewardPartyGP(
    int nGP,
    object oTarget,
    int bAllParty = TRUE
);

Parameters

nGP

与える金額

oTarget

報酬を受け取るターゲット（プレイヤー）

bAllParty

TRUEであればoTargetのパーティメンバー全員はnGPゴールド受け取ります。（デフォルト：TRUE）

Description

* （もしbAllPartyがTRUEであれば）パーティメンバー全員にGPを与えます。

* 個々のプレイヤーはnGP額受け取るでしょう。

Remarks

nw_i0_tool.nssの170行目で見つかります。

助力したパーティ全体に報酬を与える成果としてよりむしろ、PCがクエスト提供者に話し掛ける時、パーティ全体に報酬を与える場合便利です。GiveGoldToCreatureを単純に含みます。bAllPartyがTRUEの場合、oTargetのパーティの全員はnGPゴールドを得ます。FALSEならばoTargetだけがゴールドを受け取ります。

Requirements

#include "nw_i0_tool"

Version

1.28

Example

void main()
{
object oPC = GetPCSpeaker();

RewardPartyGP(1000, oPC);
// PCのパーティ全員に1000gpを与える

// または

RewardPartyGP(1000, oPC, FALSE);
// oPCにのみ1000gpを与えるか？ まさにGiveGoldToCreature(oPC, 1000);と同等
}

See Also

functions: | GiveGoldToCreature
categories: | Action on Object Functions | Money Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - RewardPartyXP

Home > Reference > Functions > Experience, Party, PC Only > RewardPartyXP

RewardPartyXP(int, object, int)

PCと（任意で）全てのパーティメンバーに経験値を与えます。

action RewardPartyXP(
    int nXP,
    object oTarget,
    int bAllParty = TRUE
);

Parameters

nXP

与えるXPの量

oTarget

XPを与えるobject

bAllParty

TRUEであれば全てのパーティメンバーにXPが与えられる（デフォルト：TRUE）

Description

bAllPartyがFALSEである場合、これはGiveXPToCreature(XP、oTarget)と等しいです。

bAllPartyがTRUEである場合、この関数はoTargetのpartyを循環し、全てのパーティメンバーにXPを与えます。

Remarks

XPは各々のパーティメンバーに等しく配られます。分配するわけではありません。

Requirements

#include "nw_i0_tool"

Version

1.29

Example

#include "nw_i0_generic"
#include "nw_i0_tool"

// エリアOnEnter用
// 恐らく、参加者がある難しいエンカウンターに遭遇する、
// もしくは重大な悪知恵によってのみ獲得される
//
// 会話エディタで設定したXPを
// 全てのPCとその仲間に与える
void main()
{
     object oPC = GetEnteringObject();
     if (! GetIsPC(oPC)) return;
     RewardPartyXP(GetJournalQuestExperience("hard_to_reach"), oPC, TRUE);
}

See Also

functions: | AddJournalQuestEntry | GiveXPToCreature
categories: | Experience Functions | Party Functions | PC Only Functions

author: Iskander Merriman, editor: Jody Fletcher, JP team: Rainie


Function - RewardXP

Home > Reference > Functions > Experience > RewardXP

RewardXP(string, int, object, int, int)

PCまたはそのパーティに設定規則に従って、指定のXPを与えます。

void RewardXP(
    string sJournalTag,
    int nPercentage,
    object oTarget,
    int nQuestAlignment = ALIGNMENT_NEUTRAL,
    int bAllParty = TRUE
);

Parameters

sJournalTag

XP潜在値を設定した、クエスト完了時ジャーナルのタグ

nPercentage

与えるXPの比率（100で100%）

oTarget

XPを与える対象となる、PCと可能ならばそのパーティ

nQuestAlignment

ALIGNMENT_* (デフォルト: ALIGNMENT_NEUTRAL)

bAllParty

全てのパーティメンバーが経験値を受け取るかどうか（デフォルト：TRUE）

Description

sJournalTagタグを持ったジャーナルで示されるXPを、キャラクターのアラインメントとnQuestAlignmentが示すクエストのアラインメントを考慮にいれ、oTargetとbAllPartyがTRUEの場合はそのパーティにXPを与えます。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: | Experience Functions
constants: | ALIGNMENT_* Constants

author: Tom Cassiotis, JP team: Rainie


Function - RoundsToSeconds

Home > Reference > Functions > Time, Type Casting/Conversion > RoundsToSeconds

RoundsToSeconds(int)

ラウンド数を秒数に変換する。

float RoundsToSeconds(
    int nRounds
);

Parameters

nRounds

秒数に変換したいラウンド数（整数値）

Description

nRoundsで表されたラウンド数を秒数に変換し返す。

1ラウンド＝6.0秒で計算される。

Version

1.22

See Also

functions: | GetTimeSecond | TurnsToSeconds
categories: | Time Functions | Type Casting/Conversion Functions

author: Charles Feduke, editor: Jeff Lindsey, JP team: ngtaicho, Rainie


Function - RunCircuit

Home > Reference > Functions > Core AI, Movement > RunCircuit

RunCircuit(int, int, int, float)

連続したウェイポイント間をNPCが移動する進路を探知し、来た道を戻らせます。

action RunCircuit(
    int nTens,
    int nNum,
    int nRun = FALSE,
    float fPause = 1.0
);

Parameters

nTens

ウェイポイントの10の位を設定します。

nNum

ウェイポイントの一桁の位を設定します。

nRun

NPCの移動速度を決定するスイッチです。（デフォルト：FALSE）

fPause

ウェイポイントに着いた後の休止する時間（デフォルト：1.0）

Description

この関数は、WP_XXX_<nTens><nNum>から始まる全ての有効なウェイポイント上をクリーチャーに移動させます。ウェイポイント上を順に移動し、再びWP_XXX_01まで遡っていきます。

Remarks

NPCのデフォルトのOnSpawnスクリプトにはWalkWayPoints()関数が使われています。

Requirements

#include "NW_I0_GENERIC"

Version

1.26

See Also

functions: | RunNextCircuit | WalkWayPoints
categories: | Core AI Functions | Movement Functions

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Donny Wilbanks, JP team: Rainie


Function - RunDrownImpact

Home > Reference > Functions > Effects, Private Functions, Spell Casting Effects > RunDrownImpact

RunDrownImpact(int, object)

ウォーターエレメンタルが相手の肺に水を満たし、溺死させることを可能にする。

void RunDrownImpact(
    int nSecondsRemaining,
    object oTarget
);

Parameters

nSecondsRemaining

残り秒数（6の倍数でないと意味がない）

oTarget

水に浸かる生物

Description

この関数は回帰的呼び出しで、この関数自体を呼び出す。

oTargetはラウンドごとに頑健セービングスローを行い、セービングスロー失敗の場合、呼び出し人のレベル、４レベルごとに１～４のダメージが与えられる。

Remarks

この関数はSoUを未導入の場合のみ使えます。
SoUではRunDrownImpact関数はDrownと呼ばれる関数に置き換えられています。この効果は単純に溺れた者（頑健セーブに失敗）にEffectDeathを適用するだけです。

nw_s1_pulsdrwn.nss の 17 行目

インクルードファイルではないため、通常の方法では使用できないが、コピーして使うことができる。

バグがあるため、nw_s1_pulsdrwnのスクリプトを使ったほうがいい。

Known Bugs

テストすると、非常に不完全な作りということがわかる。

実際の流れは以下のようになる。

１、nSecondsRemaining÷６の余りが0の場合はダメージを与える。

２、余りが0以外の時はnSecondsRemainingに0がセットされる。

３、nSecondsRemainingから1引かれる。

４、nSecondsRemainingが１より大きい場合、１秒ディレイして、この関数自身を呼び出す。

５、１以下なら終了

テスト

nSecondsRemainingが6、12、18・・・など6の倍数の場合

  ・６で割った余りが０のため、１回ダメージを与える

  ・nSecondsRemainingがマイナスされ、5、11、17・・・になる。

  ・２以上のため最初に戻る。

  ・６で割った余りが５になるため、nSecondsRemainingは0になる。

  ・nSecondsRemainingがマイナスされ-1になる。

  ・１以下なので終了

nSecondsRemainingが1、2、3、4、5、7、8、9・・・など6の倍数以外の場合

  ・６で割った余りが０でないので、nSecondsRemainingは0になる。

  ・nSecondsRemainingがマイナスされ-1になる。

  ・１以下なので終了

結果：どんな数を指定しても2回目のダメージは存在しない。

Version

1.28

Example

void RunDrownImpact(int nSecondsRemaining, object oTarget)
{
    int nCount = GetHitDice(OBJECT_SELF) + 10;
    int nDice = nCount/4;
    if (GetIsDead(oTarget) == FALSE)
    {
       if (nSecondsRemaining % 6 == 0)
       {
            if(!MySavingThrow(SAVING_THROW_FORT, oTarget, nCount))
            {
                //　ダメージを算出
                int nDamage = d4(nDice);
                //　メタマジックを調べる
                effect eDam = EffectDamage(nDamage);
                effect eVis = EffectVisualEffect(VFX_IMP_POISON_S);
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
            }
//　ここはコメントアウトしている方がよい
    /*        else
            {
                nSecondsRemaining = 0;
            }  */
       }
       --nSecondsRemaining;
       if (nSecondsRemaining > 0)
       {
          DelayCommand(1.0f,RunDrownImpact(nSecondsRemaining,oTarget));
       }
   }
}

See Also

categories: Effects Functions | Private Functions Functions | Spell Casting Effects Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, ngtaicho


Function - RunMelfAcidImpact

Home > Reference > Functions > Effects, Private Functions, Spells > RunMelfAcidImpact

RunMelfAcidImpact(int, object)

メルフズ・アシッドアローによるラウンドごとのダメージ処理

void RunMelfAcidImpact(
    int nSecondsRemaining,
    object oTarget
);

Parameters

nSecondsRemaining

残り秒数

oTarget

アシッドダメージを受ける目標物

Description

この関数は回帰的呼び出し関数である。

nSecondsRemainingが0になるまで、ラウンドごとにダメージを与える。

Remarks

nw_s0_acidarrow.nss の 21 行目

インクルードファイルではないため、通常の方法では使用できないが、コピーして使うことができる。

この関数の代わりにnw_s0_acidarrowを使ったほうがいい。

Version

1.28

See Also

categories: Effects Functions | Private Functions Functions | Spells Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: ngtaicho


Function - RunNextCircuit

Home > Reference > Functions > Core AI, Movement > RunNextCircuit

RunNextCircuit(int, float)

NPCにウェイポイントの始点へ移動させる。

void RunNextCircuit(
    int nRun = FALSE,
    float fPause = 1.0
);

Parameters

nRun

ウェイポイント移動中に歩かせるか、走らせるか。（デフォルト：FALSE）

fPause

ウェイポイントに着いた時の休止時間（デフォルト：1.0）

Description

ウェイポイントの始点”WP_XXX_01”へNPCを戻させるために、CoreAIで使われています。

Version

1.22

See Also

functions: | RunCircuit
categories: | Core AI Functions | Movement Functions

author: Jody Fletcher, editor: Charles Feduke, JP team: Rainie


Function - SearchForPlayer

Home > Reference > Functions > Combat, Combat Information, Private Functions > SearchForPlayer

SearchForPlayer()

一番近いPCを探し攻撃する。

void SearchForPlayer();

Description

一番近いPCはGetNearestCreature命令で得られる。もしPCが見つからなかった場合は、頭をかき、30％の確立で１行のみの会話を発する。もしPCを発見した場合は攻撃を開始する。

Remarks

nw_c2_recruit1.nss の 16 行目

インクルードファイルではないため、通常の方法では使用できないが、コピーして使うことができる。

Version

1.28

See Also

categories: Combat Functions | Combat Information Functions | Private Functions Functions

author: Lilac Soul, JP team: ngtaicho


Function - SendMessageToAllDMs

Home > Reference > Functions > Server, String > SendMessageToAllDMs

SendMessageToAllDMs(string)

サーバー上のすべてのダンジョンマスターにメッセージを送る。

void SendMessageToAllDMs(
    string szMessage
);

Parameters

szMessage

サーバー上のすべてのDMに送るメッセージ

Description

szMessageを現在サーバーに入っているDMに送る。

Remarks

「シャウト」タイプのチャットメッセージ（sMessage）をすべてのDMに送る 。メッセージはSERVER:（紫）と頭につけられて現れる。

Known Bugs

メッセージは、「DMメッセージ」チャットウィンドウの中では表示されない

Version

1.30

Example

// 様々なテストの基礎をカバーする、サンプルデバッグコール
void debug( string sMessage ) {
  SendMessageToPC( GetFirstPC(), sMessage );
  SendMessageToAllDMs( sMessage );
  PrintString( sMessage );
}

See Also

functions: | PrintString | SendMessageToPC
categories: | Server Functions | String Functions

author: Iskander Merriman, editor: Jeff Lindsey, JP Team: geshi, weed


Function - SendMessageToPC

Home > Reference > Functions > Debug, PC Only, String > SendMessageToPC

SendMessageToPC(object, string)

特定のPCにメッセージを送る。

void SendMessageToPC(
    object oPlayer,
    string sMessage
);

Parameters

oPlayer

メッセージを送る先のPCを特定する。

sMessage

そのPCに送られるメッセージ。

Description

「戦闘メッセージ」文字列（sMessage）をoPlayerに送る。メッセージは黄色のテキストとして戦闘メッセージを表示するチャットウィンドウに現れる。

Remarks

スクリプトのデバッグに使いやすいツールである。 これによって、変数の値やスクリプト中の場所等を表示させることができる。

SendMessageToPC()命令が同時に多すぎると、メッセージは欠落しはじめ、いくつかのメッセージはまったく表示されなくなってしまう。

すべての種類の色でメッセージを表示させることが可能である。 これは非常に簡単だが、スクリプトを書く以外のことが少し必要になる。やり方についてのドキュメント付きの小さなデモ・モジュールを、下記URLからダウンロードすることができる：
http://nwvault.ign.com/Files/scripts/data/1041698002718.shtml

Version

1.29

Example

// 様々なテストの基礎をカバーする、サンプルデバッグコール
void debug( string sMessage ) {
  SendMessageToPC( GetFirstPC(), sMessage );
  SendMessageToAllDMs( sMessage );
  PrintString( sMessage );
}

See Also

functions: | PrintString | SendMessageToAllDMs
categories: | Debug Functions | PC Only Functions | String Functions

author: Iskander Merriman, editor: Lilac Soul, additional contributor(s): John Platte, Lilac Soul, JP team: weed


Function - SetAILevel

Home > Reference > Functions > Core AI, Cut-Scene > SetAILevel

SetAILevel(object, int)

クリーチャーのAI（人工知能）レベルを設定します。

void SetAILevel(
    object oTarget,
    int nAILevel
);

Parameters

oTarget

AIの影響を受けるターゲット

nAILevel

課すべきAIレベル（AI_LEVEL_*）

Description

クリーチャーのAIレベルを設定します。デフォルトでは、最も良いAIレベルを使用するようになっています。しかし、この関数を使うことによって、デフォルトの値を書き換えることになります。この関数はプレイヤーには機能しません。カットシーン（演出シーン）でAI_LEVEL_HIGHを指定することはクリーチャーに多くのCPU負荷を消費させることになります。

Version

1.30

See Also

functions: | GetAILevel
categories: | Core AI Functions | Cut-Scene Functions
constants: | AI_LEVEL_* Constants

author: Charles Feduke, JP team: Rainie


Function - SetAreaTransitionBMP

Home > Reference > Functions > Miscellaneous, Module > SetAreaTransitionBMP

SetAreaTransitionBMP(int, string)

PCがモジュール内の2つの異なるエリアを移動するときのロード画面を設定します。

void SetAreaTransitionBMP(
    int nPredefinedAreaTransition,
    string sCustomAreaTransitionBMP = ""
);

Parameters

nPredefinedAreaTransition

AREA_TRANSITION_*

sCustomAreaTransitionBMP

エリアトランジションのBMPのファイル名。（デフォルト：""）

Description

エリアトランジションのBMPを設定します；これはOnAreaTransitionClickイベントでのみ使用できます。このアクションは、AssignCommandでエリアトランジションをクリックされた場合実行されます。

前もって定義されたエリアトランジションのBMPを使います、AREA_TRANSITION_*を使ってください。

ユーザーに定義されたエリアトランジションBMPを使いたい場合、AREA_TRANSITION_USER_DEFINEDを使って、2番目のパラメーターでファイルネームを指定します。

Version

1.22

See Also

categories: | Miscellaneous Functions | Module Functions
constants: | AREA_TRANSITION_* Constants
events: | OnAreaTransitionClick Event

author: Charles Feduke, editor: Jody Fletcher, JP team: Rainie


Function - SetArtifactItem

Home > Reference > Functions > Local Variables, Module Specific > SetArtifactItem

SetArtifactItem(string)

アーティファクトアイテムのタグを保管する。

void SetArtifactItem(
    string sTag
);

Parameters

sTag

アーティファクトアイテムのタグ

Description

GetArtifactItem関数とPlayerHasArtifactItem関数と一緒に使い、

後で使用できるようにアーティファクトアイテムのタグを文字列変数に保管する。

Remarks

nw_j_artifact.nssの97行目にある。

バイオウエア社公式モジュールで使用されるクエストと報酬システムの一部のため、流用は難しい。

Requirements

#include "nw_j_artifact"

Version

1.28

See Also

functions: | GetArtifactItem | Global | PlayerHasArtifactItem | TakeArtifactItem
categories: | Local Variables Functions | Module Specific Functions

author: Lilac Soul, JP team: ngtaicho


Function - SetAssassinHead

Home > Reference > Functions > Local Variables, Module Specific > SetAssassinHead

SetAssassinHead(string)

アサシンの犠牲者の頭のタグをローカル情報に保存する。

void SetAssassinHead(
    string sTag
);

Parameters

sTag

犠牲者の頭のタグ

Description

GetAssassinHead関数、PlayerHasHead関数とセットで使用される。アサシンの犠牲者の頭のタグをローカル情報に保管する。

Remarks

nw_j_assassin.nssの299行目で見つかる。

バイオウエア社公式モジュールで使用されるクエストと報酬システムの一部のため、流用は難しい。

誰かの顔を手土産に持っていったり、家の前に飾られたりするクエストの一部かも。

Requirements

#include "nw_j_assassin"

Version

1.28

See Also

functions: | GetAssassinHead | PlayerHasHead | SetDoubleCrosserName
categories: | Local Variables Functions | Module Specific Functions

author: Lilac Soul, editor: Jody Fletcher, JP team: ngtaicho


Function - SetAssociateListenPatterns

Home > Reference > Functions > Henchmen/Familiars/Summoned > SetAssociateListenPatterns

SetAssociateListenPatterns(object)

仲間(ヘンチマン、召喚される者、使い魔)に対して、命令を受ける準備をさせます。

void SetAssociateListenPatterns(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

命令できるように初期化する仲間。(デフォルト: OBJECT_SELF)

Description

標準的なASSOCIATE_COMMAND_* コマンドを聞かせるために、oTargetを初期化します。

Version

1.22

See Also

functions: | SetAssociateState | SetListeningPatterns
categories: | Henchmen/Familiars/Summoned Functions
constants: | ASSOCIATE_COMMAND_* Constants

author: Charles Feduke, editor: Jody Fletcher, JP team: katsu794


Function - SetAssociateStartLocation

Home > Reference > Functions > Core AI, Henchmen/Familiars/Summoned > SetAssociateStartLocation

SetAssociateStartLocation()

NPC仲間のスタートロケーションをNPCが現在いるロケーションに設定します。

action SetAssociateStartLocation();

Description

NPC仲間(OBJECT_SELF)のスタートロケーションをNPCが現在いるロケーションに設定します。

Remarks

この関数は、スタートロケーションを設定したいNPC仲間のイベント中で使用されなければなりません。

プレイヤーがヘンチマンのサービスを取り戻したい場合に、共通のロケーションにヘンチマンを簡単に戻すことができます。

Requirements

#include "NW_I0_GENERIC"

Version

1.29

See Also

functions: | GetAssociateStartLocation | GetAssociateState | SetAssociateState
categories: | Core AI Functions | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: Jody Fletcher, JP team: katsu794


Function - SetAssociateState

Home > Reference > Functions > Henchmen/Familiars/Summoned > SetAssociateState

SetAssociateState(int, int)

仲間の行動を変化させます。

void SetAssociateState(
    int nCondition,
    int bValid = TRUE
);

Parameters

nCondition

NW_ASC_*

bValid

NW_ASC_*の値をTRUEまたはFALSE(オン/オフ)にフラグ付けします。(デフォルト: TRUE)

Description

NPC仲間におけるNW_ASC_*, NW_ASC_DISTANCE_*, NW_ASC_HEAL_AT_*, NW_ASC_AGGRESSIVE_*の定数設定の１つを、オン(TRUE)または、オフ(FALSE)に変化させます。

これらの設定は、ビット演算を使用して計算され、NPC仲間のローカル変数"NW_ASSOCIATE_MASTER"に保管されます。

Requirements

#include "NW_I0_GENERIC"

Version

1.29

See Also

functions: | GetAssociate | GetAssociateHealMaster | GetAssociateState | GetHenchman | GetMaster | SetAssociateListenPatterns | SetAssociateStartLocation
categories: | Henchmen/Familiars/Summoned Functions
constants: | NW_ASC_* Constants

author: Charles Feduke, editor: Jody Fletcher, JP team: katsu794


Function - SetBeenHired

Home > Reference > Functions > Henchmen/Familiars/Summoned > SetBeenHired

SetBeenHired(int, object)

ヘンチマンが前に雇われたことがあるかどうかを設定します。

void SetBeenHired(
    int bHired = TRUE,
    object oTarget = OBJECT_SELF
);

Parameters

bHired

ヘンチマンが雇われたかどうか。(デフォルト: TRUE)

oTarget

ヘンチマン。(デフォルト: OBJECT_SELF)

Description

ソースコードより：

ヘンチマンは常に一人だけ雇うことができます。

この関数は、ヘンチマンが今までに雇われているかどうかを記録しているローカル変数を調べ、または設定します。

Remarks

nw_i0_henchman.nssの105行目にあります。

基本的に、この関数はヘンチマンのローカル変数を設定するだけです。その変数でヘンチマンが今までに雇われているかどうかが分かります。

Requirements

#include "nw_i0_henchman"

Version

1.28

See Also

functions: | CopyLocals | GetBeenHired
categories: | Henchmen/Familiars/Summoned Functions

author: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - SetBehaviorState

Home > Reference > Functions > Core AI, Targeting > SetBehaviorState

SetBehaviorState(int, int)

NPCの行動を設定します。

void SetBehaviorState(
    int nCondition,
    int bValid = TRUE
);

Parameters

nCondition

NW_FLAG_BEHAVIOR_*

bValid

nCondition行動の状態(オン/オフ)(デフォルト:TRUE)

Description

bValidを使用してNPCの行動のオン/オフを切り替えます。

行動は、NW_FLAG_BEHAVIOR_* 定数リストに従います。

Known Bugs

SetBehaviorState関数のbValid値が自動的に切り替わるのが見られるという、いくつかの報告があります。

Requirements

#include "NW_I0_GENERIC"

Version

1.28

See Also

functions: | DetermineSpecialBehavior | GetBehaviorState
categories: | Core AI Functions | Targeting Functions
constants: | NW_FLAG_BEHAVIOR_* Constants
events: | OnPerception Event | OnSpawn Event

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Kai, JP team: katsu794


Function - SetCalendar

Home > Reference > Functions > Time > SetCalendar

SetCalendar(int, int, int)

モジュールでの暦の日付を設定します。

void SetCalendar(
    int nYear,
    int nMonth,
    int nDay
);

Parameters

nYear

設定する暦の指定年（1340～32001）

nMonth

設定する暦の指定月（1～12）

nDay

設定する暦の指定日（1-28）

Description

モジュールにおける現在の年、月、日を設定します。

Remarks

月または日の最大より大きい値が指定された場合、それらはその単位を埋めた後、過剰分は次の単位を進めるために使用されます。例えば、指定が1350年33月10日であったなら、暦は1352年9月10日に設定されるでしょう。

但し、下記のKnown Bugsを見てください

Known Bugs

以前報告された、1340年以前に設定できないというバグは修正されました。There is still a bug with advancing the time when setting the month to higher than 13, though it doesn’t always set the month to 12.

また、nMonthに12を超える値を設定した場合、過剰は年を進めますが、その際、13進法（0-12）で年月が進むように思います。即ちまるで0月が存在するかのようにです。例えば、nYearを1350、nMonthを14と設定した場合、1351年1月となり、28と設定した場合は28-(13x2)で、2年後である1352年2月となります。また0月となるようにnMonthを13の倍数で設定した場合、その0月が存在するはずの年代の6月になります。例えばnYearを1350、nMonthを13と設定したならば、1351年6月になるでしょう。(ver1.29現在)

このバグを回避するために、nMonthは1から12の数値で指定するのが無難です。

Version

1.30

See Also

functions: | GetAge | GetCalendarDay | GetCalendarMonth | GetCalendarYear | SetTime | SetWeather
categories: | Time Functions
events: | OnModuleLoad Event

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Jon Dewey, JP team: geshi, Rainie


Function - SetCameraFacing

Home > Reference > Functions > Miscellaneous, PC Only > SetCameraFacing

SetCameraFacing(float, float, float, int)

プレイヤーのカメラが向いている方向を変更します。

void SetCameraFacing(
    float fDirection,
    float fDistance = -1.0,
    float fPitch = -1.0,
    int nTransitionType = CAMERA_TRANSITION_TYPE_SNAP
);

Parameters

fDirection

東からの回転度です。（0.0f）

fDistance

カメラの距離（ズーム）(デフォルト: -1.0)

fPitch

カメラのピッチ（アングル）(デフォルト: -1.0)

nTransitionType

カメラ回転の滑らかさを決定します。（CAMERA_TRANSITION_TYPE_*定数の一つ）(デフォルト: CAMERA_TRANSITION_TYPE_SNAP)

Description

fDirectionは真東から逆時計周りで表された角度です（0.0f=東、90.0f=北、180.0f=西、270.0f=南）。

どのパラメーターにおいても -1.0ｆ の場合は無視され、変わりに現在のカメラの値が使われます。これはプレイヤーがエリアトランジションから出現した後、カメラが面する方法を変更するために使用することができます。

nTransitionType：CAMERA_TRANSITION_TYPE_* については、

SNAPは直ぐにカメラを新しい位置へと移ります。

他のタイプではカメラは移動しながら新しい位置へ向かいます。

ピッチと距離は現在のカメラモードでの正しい値である必要があります：

トップダウン： 距離=5～20、 ピッチ=1～50

ドライビングモード： 距離=6（変更できません）、 ピッチ=1～62

追跡モード： 距離=5～20、 ピッチ=1～50

Remarks

パラメーターはパッチ1.30とSoUで変更されました。

このことによって以前のパッチでデフォルトの値以外でこの関数を使っていた場合に問題が起こります。例えば：

SetCameraFacing(45.0, CAMERA_TRANSITION_TYPE_CRAWL);

上記の例は、1.30以降では全く意味をなしません。整数値の前に3つの不動賞数値が必要となったからです。Biowareは既にパラメーターが既に1つあるところに2つ追加して、以前のバージョンとの互換性をなくしたことはなかなか興味深いことです。

Version

1.28

See Also

functions: | RestoreCameraFacing | SetCameraMode | SetCutsceneMode | StoreCameraFacing
categories: | Miscellaneous Functions | PC Only Functions
constants: | CAMERA_TRANSITION_TYPE_* Constants
events: | OnAreaTransitionClick Event

author: Jody Fletcher, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: geshi, Rainie


Function - SetCameraMode

Home > Reference > Functions > Miscellaneous > SetCameraMode

SetCameraMode(object, int)

画面のプレイヤーの展望視点を変更します。

void SetCameraMode(
    object oPlayer,
    int nCameraMode
);

Parameters

oPlayer

モード変更をさせるPC

nCameraMode

CAMERA_MODE_*

Description

oPlayerのカメラモードを設定します。

oPlayerがプレイヤー操作ではなかったり、nCameraModeが無効であった場合、何も起こりません。

Version

1.22

See Also

functions: | RestoreCameraFacing | SetCameraFacing | SetCutsceneMode | StoreCameraFacing
categories: | Miscellaneous Functions
constants: | CAMERA_MODE_* Constants

author: Jody Fletcher, JP team: geshi, Rainie


Function - SetCampaignFloat

Home > Reference > Functions > Database > SetCampaignFloat

SetCampaignFloat(string, string, float, object)

キャンペーンデータベースに浮動小数値を設定します。

void SetCampaignFloat(
    string sCampaignName,
    string sVarName,
    float fFloat,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

キャンペーン名。(大文字/小文字は区別されます)

sVarName

変数名。

fFloat

設定する値。

oPlayer

変数を関連づけるプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースに浮動小数値を設定します。

キャンペーン名は大文字/小文字を区別します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | GetCampaignFloat
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - SetCampaignInt

Home > Reference > Functions > Database > SetCampaignInt

SetCampaignInt(string, string, int, object)

キャンペーンデータベースに整数値を設定します。

void SetCampaignInt(
    string sCampaignName,
    string sVarName,
    int nInt,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

キャンペーン名。(大文字/小文字は区別されます)

sVarName

変数名。

nInt

設定する値。

oPlayer

変数を関連づけるプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースに整数値を設定します。

キャンペーン名は大文字/小文字を区別します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | GetCampaignInt
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - SetCampaignLocation

Home > Reference > Functions > Database > SetCampaignLocation

SetCampaignLocation(string, string, location, object)

キャンペーンデータベースにロケーション値を設定します。

void SetCampaignLocation(
    string sCampaignName,
    string sVarName,
    location locLocation,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

キャンペーン名。(大文字/小文字は区別されます)

sVarName

変数名。

locLocation

設定する値。

oPlayer

変数を関連づけるプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースにロケーション値を設定します。

キャンペーン名は大文字/小文字を区別します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | GetCampaignLocation
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - SetCampaignString

Home > Reference > Functions > Database > SetCampaignString

SetCampaignString(string, string, string, object)

キャンペーンデータベースに文字列値を設定します。

void SetCampaignString(
    string sCampaignName,
    string sVarName,
    string sString,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

キャンペーン名。(大文字/小文字は区別されます)

sVarName

変数名。

sString

設定する値。

oPlayer

変数を関連づけるプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースに文字列値を設定します。

キャンペーン名は大文字/小文字を区別します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | GetCampaignString
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - SetCampaignVector

Home > Reference > Functions > Database > SetCampaignVector

SetCampaignVector(string, string, vector, object)

キャンペーンデータベースにベクター値を設定します。

void SetCampaignVector(
    string sCampaignName,
    string sVarName,
    vector vVector,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

キャンペーン名。(大文字/小文字は区別されます)

sVarName

変数名。

vVector

設定する値。

oPlayer

変数を関連づけるプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースにベクター値を設定します。

キャンペーン名は大文字/小文字を区別します。

Remarks

oPlayerとしてオブジェクトが指定されている場合、同じ名前の変数を複数もっている可能性があります。

しかしながら、それについては厳しくテストされていないので、とにかく特有の変数名を使うのが良い方法かもしれません。

さらに、NWNにおけるデータベースアクセス速度は遅いです。

変数はローカルに保管するのが良い方法です。そうすると、必要な時だけデータベースへの転送、データベースからの読み取りが行われます。

データベース内の変数は、セーブデータに依存していないことを憶えておくことも重要です。

プレイヤーが前のセーブデータに戻った場合でも、データベースには直近の変数が保管されているでしょう。

このことがプレイヤーの手助けになる可能性は少ないので、プレイヤーのゲーム感全体を損ねる可能性があると言えます。

したがって、データベースの本当の力は恐らく以下のとおりでしょう：

一定の基地としてPWに変数を保管する能力を持っているので、多くの情報を失わずに済みます。(例えば、変数のバックアップを毎時間行うことができるなど)

また、２つもしくはそれ以上のモジュール間で簡単に情報を転送することができます。例えば、公式キャンペーン中のタイプ設定がそうです。

Known Bugs

1.30のパッチには、プレイヤーの特定のデータ保管に関する問題がありました。(けれども、シャドウ・オブ・アンドレンタイドにおいてのみです)

1.31のパッチにおけるフィックスで、SoU 1.30とSoU 1.31間におけるプレイヤーの特定のデータベースアクセスに関する互換性は損なわれるでしょう。

Version

1.30

See Also

functions: | GetCampaignVector
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - SetCommandable

Home > Reference > Functions > Miscellaneous > SetCommandable

SetCommandable(int, object)

NPCに新しい指示を使用可能にさせます。

void SetCommandable(
    int bCommandable,
    object oTarget = OBJECT_SELF
);

Parameters

bCommandable

させるかさせないかをTRUE/FALSEで設定します。

oTarget

命令許可を設定するobject（デフォルト：OBJECT_SELF）

Description

oTargetのアクションキューを修正するかどうかを設定します。

Version

1.26

Example

// これは最初にoUserのアクションキューをクリアにし
// その後、アニメーションを行わせ
// そのアクションキューを修正できるように取り除きます。
// 4.8秒後に、それらのアクションキューにそれらが望む、
// 又はAIに記された行動を再び戻す命令を与えます。

object oUser = GetLastUsedBy();
AssignCommand(oUser,ClearAllActions());
AssignCommand(oUser,ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0,5.0));
DelayCommand(0.2,SetCommandable(FALSE,oUser));
DelayCommand(4.8,SetCommandable(TRUE,oUser));

See Also

functions: | AssignCommand | GetCommandable
categories: | Miscellaneous Functions

author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Jason Hyde, JP team: Rainie


Function - SetComplexItem

Home > Reference > Functions > Local Variables, Module Specific > SetComplexItem

SetComplexItem(string)

合成アイテムのタグをローカル情報に保存する

void SetComplexItem(
    string sTag
);

Parameters

sTag

合成アイテムのタグ

Description

GetComplexItem関数、PlayerHasComplexItem関数と一緒に使用される。

合成アイテムのタグをローカル情報に保存する。

Remarks

nw_j_complex.nssの97行目にある。

バイオウエア社公式モジュールで使用されるクエストと報酬システムの一部のため、流用は難しい。

Requirements

#include "nw_j_complex"

Version

1.28

See Also

functions: | GetComplexItem | Global | PlayerHasComplexItem | TakeArtifactItem | TakeComplexItem
categories: | Local Variables Functions | Module Specific Functions

author: Lilac Soul, JP team: ngtaicho


Function - SetCustomToken

Home > Reference > Functions > Conversation > SetCustomToken

SetCustomToken(int, string)

カスタムトークンの値を設定します。

action SetCustomToken(
    int nCustomTokenNumber,
    string sTokenValue
);

Parameters

nCustomTokenNumber

カスタムトークンの番号です。

sTokenValue

カスタムトークンの値です。

Description

conversationで使われるカスタムトークンの値を設定します。

どのスクリプトのカスタムトークンでも設定できます。しかしながら、条件を含ませておくStartingConditionalスクリプトのトークンを設定を考えるべきかもしれません。

カスタムトークンはそれぞれのカンバセーションに固有のものです。

もしも同じカンバセーションを異なったNPC（や配置物など）で使う場合、カンバセーションで使われるカスタムトークンがそのカンバセーションに付属するスクリプトで設定されている限り、トークンの番号が重なってしまうことを気にする必要はありません。

Remarks

カスタムトークン０－９はBiowareによって使われており、使用出来ないはずです。

設定した同じカスタムトークンを設定したスクリプトの構成を、再利用するのは危険です。これを避ける為には、conversationの直前にカスタムトークンを設定してください（conversatonの内の新しいトークンを作成せず、会話の初めにそれらをすべて作成します）。

カスタムトークンを使用するには、conversationのどこかに<CUSTOMxxxx>を配置します。xxxxはnCustomTokenNumberで与えられた値です。<CUSTOM100>のようにです。

Version

1.30

Example

// ここに作成したカスタムトークンは、<CUSTOM100>
// のタイピングにより、会話の中で使用する事ができる
int StartingConditional()
{
   SetCustomToken(100, GetName(GetPCSpeaker()));
   return TRUE;
}

See Also

categories: Conversation Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Vincent Bairan, Andy Lange, JP team: geshi, Rainie


Function - SetCutsceneMode

Home > Reference > Functions > Cut-Scene, PC Only > SetCutsceneMode

SetCutsceneMode(object, int)

カットシーンのモードを設定します。

void SetCutsceneMode(
    object oCreature,
    int nInCutscene = TRUE
);

Parameters

oCreature

カットシーンに巻き込むプレイヤーによって操作されているクリーチャー

nInCutscene

モードのトグルでTRUEならばカットシーンモードを有効にし、FALSEであれば無効にします。（デフォルト：TRUE）

Description

oInCutsceneが有効の時、カットシーンモードはプレイヤーの操作やGUIの使用、カメラの操作を使用不能にします。無効の時は、操作は回復します。

Remarks

もしFadeToBlack、FadeFromBlackおよびEffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY)と共に適切に使用されれば、SetCutsceneModeはムービーのようなカットシーンを扱うことが出来ます。

SetCutsceneModeがTRUEに設定されれば、PCのカメラの向きは自動的に保存され、FALSEに設定されれば、カメラの向きは自動的に回復されるように思います。これは、あなたがカメラ・モードや向きの全ての材料の種類をカットシーンで、それについて後で心配する必要なしに行うことができることを意味します。しかしながら、あなたがcutsceneの中でPCを動かせば、回復されたカメラの向きはもはやよい角度などではないかもしれません。この場合、PCがカットシーンから出たとき、SetCameraFacingを常に呼出すことが出来ます。

Version

1.30

Example

//Example of a simple cutscene by Lilac Soul
//If you have a script in OnCutsceneAbort, you can simply
//ClearAllActions on the PC to make the scene stop,
//then remove the invisibility visual effect and
//SetCutsceneMode to false, and destroy the copy.

void RunCutsceneActions();
void CreateCopy(object oPC = OBJECT_SELF);

void main()
{
object oPC=GetEnteringObject();

if (!GetIsPC(oPC)) return;

AssignCommand(oPC, RunCutsceneActions());
}

//Wrapped in its own function so that oPC can be
//OBJECT_SELF so there's no need for AssignCommand
//Making heavy use of ActionDoCommand to be able to control
//that one thing must finish before another starts
void RunCutsceneActions()
{
//Fade out the PC
ActionDoCommand(FadeToBlack(OBJECT_SELF, FADE_SPEED_FAST));

ActionWait(2.0);

ActionDoCommand(SetCutsceneMode(OBJECT_SELF, TRUE));

//Create a copy so we can move the invisible PC around
//and still have him think he's standing where he was
ActionDoCommand(CreateCopy());

//Make PC invisible
effect eInv=EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);

ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, OBJECT_SELF));

//Fade PC back in
ActionDoCommand(FadeFromBlack(OBJECT_SELF, FADE_SPEED_FAST));

//Here then, move the invisible PC around and do whatever
//It will look like the camera is just moving, and the
//player will have the impression of standing still because
//we created a copy of him
//If having others do stuff, like oNPC, you can do this trick
//To have the NPC action added to the PC's action queue
//REMEMBER: NO MORE THAN 75 ACTIONS IN AN ACTION QUEUE!
//ActionDoCommand(AssignCommand(oNPC, ActionSpeakString("Hello")));

//Eventually, we call
ActionDoCommand(FadeToBlack(OBJECT_SELF, FADE_SPEED_FAST));

ActionWait(2.0);

ActionDoCommand(SetCutsceneMode(OBJECT_SELF, FALSE));

//Destroy the copy
ActionDoCommand(DestroyObject(GetLocalObject(GetModule(), "pccopy")));

ActionDoCommand(RemoveEffect(OBJECT_SELF, eInv));

ActionDoCommand(FadeFromBlack(OBJECT_SELF, FADE_SPEED_FAST));
}

//Function for creating a copy of the PC
void CreateCopy(object oPC = OBJECT_SELF)
{
object oCopy=CopyObject(oPC, GetLocation(oPC));

//Make sure the copy likes the PC
SetIsTemporaryFriend(oPC, oCopy);

//Store so we can destroy later!
SetLocalObject(GetModule(), "pccopy", oCopy);

}

See Also

functions: | FadeFromBlack | FadeToBlack | GetLastPCToCancelCutscene | RestoreCameraFacing | SetCameraFacing | SetCameraMode | StoreCameraFacing
categories: | Cut-Scene Functions | PC Only Functions
events: | OnCutsceneAbort Event

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - SetDeity

Home > Reference > Functions > Miscellaneous > SetDeity

SetDeity(object, string)

クリーチャーまたはPCの信仰神を設定します。

void SetDeity(
    object oCreature,
    string sDeity
);

Parameters

oCreature

信仰を割り当てるクリーチャー。

sDeity

oCreatureが信仰する神。

Description

oCreatureの信仰神の名前をsDeityに設定します。

Remarks

この関数によって、クリーチャー以外のオブジェクトに神を与えた場合はどうなるかは不明です。

Version

1.31

See Also

functions: | GetDeity
categories: | Miscellaneous Functions

author: Lilac Soul, JP team: katsu794


Function - SetDidDie

Home > Reference > Functions > Henchmen/Familiars/Summoned > SetDidDie

SetDidDie(int)

ヘンチマンが今死んでいるかどうかを保管します。

void SetDidDie(
    int bDie
);

Parameters

bDie

保管する値。(TRUE か FALSE)

Description

この関数を呼び出す者(ヘンチマン)のローカル整数"NW_L_HEN_I_DIED"にbDieで指定される値を設定します。

Remarks

nw_i0_henchman.nssの75行目にあります。

この関数は、公式キャンペーンにおいてヘンチマンが今死んでいるかどうかを設定するために使用されます。次に主人(現在は前の主人)がヘンチマンに話しかけると、'生き返った'という会話セリフが得られます。

この関数は、実際にはヘンチマンのOnDeathスクリプトからは呼び出されません。全く同じことを行うSetLocalInt(OBJECT_SELF, “"NW_L_HEN_I_DIED", TRUE)を動かしているだけです。

この関数が使用されるのは、今のところGetDidDieコマンド内の一箇所においてです。

GetDidDieコマンドがTRUEを返す場合、プレイヤーが、ヘンチマンが次に死ぬ時までに'私は今死んでいます'という挨拶をヘンチマンから受け取らないことを確認するために、SetDidDie(FALSE)も同様に呼び出します。

Requirements

#include "nw_i0_henchman"

Version

1.22

See Also

functions: | GetDidDie
categories: | Henchmen/Familiars/Summoned Functions

author: Lilac Soul, JP team: katsu794


Function - SetDoubleCrosserName

Home > Reference > Functions > Module Specific > SetDoubleCrosserName

SetDoubleCrosserName(object)

公式キャンペーンのプロット中で、NPCを裏切るPCの名前を記録します。

void SetDoubleCrosserName(
    object oPC
);

Parameters

oPC

PCの名前。

Description

公式キャンペーンの暗殺者プロット・ライン中で、NPCを裏切るPCの名前のプロット・トークンを設定します。

Remarks

このスクリプトは、nw_j_assassin.nssの490行目にあります。

この関数はBioware社のクエスト報酬システムの一部です。

システムをかなり詳細なところまで理解している人以外にとっては、ほとんど役に立たないでしょう。

Requirements

#include "nw_j_assassin"

Version

1.29

See Also

functions: | SetAssassinHead
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetDroppableFlag

Home > Reference > Functions > Miscellaneous > SetDroppableFlag

SetDroppableFlag(object, int)

アイテムに対して落とすことができるかできないかをマーク付けします。

void SetDroppableFlag(
    object oItem,
    int bDroppable
);

Parameters

oItem

落とすことができるかをフラグ付けするアイテム。

bDroppable

落とすことができるアイテムかどうかを決定します。(落とすことができる場合はTRUE、そうでない場合はFALSE)

Description

アイテムに対して落とすことができるアイテム、あるいは落とすことができないアイテムとしてのフラグを設定します。

Remarks

実用的な関数です。

例えば、あるアイテムを持っている敵の群れがいて、それらの中の何人かだけにそのアイテムを落とさせたいが、その対象をランダムに決定したい場合、アイテムを落とすべきかどうかをランダムに決定する要素を持ったクリーチャーのOnSpawnまたはOnDeathのいずれかにおいて、SetDroppableFlag関数を呼び出すことができます。

Version

1.30

Example

//タグが"some_boots"であるアイテムを持ったクリーチャーの群れがいます。
//殺された時に、統計的に彼らの25%にそのブーツを落とさせたいとします。
//OnDeathまたはOnSpawnのいずれかで動作します。

void main()
{
object oItem=GetItemPossessedBy(OBJECT_SELF, "some_boots");

//落とすためのチャンスは25%
int bDroppable=d100()>75;

SetDroppableFlag(oItem, bDroppable);
}

See Also

functions: | GetDroppableFlag
categories: | Miscellaneous Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - SetEncounterActive

Home > Reference > Functions > Encounter > SetEncounterActive

SetEncounterActive(int, object)

エンカウンターのアクティブ、もしくは非アクティブを設定します。

void SetEncounterActive(
    int bNewValue,
    object oEncounter = OBJECT_SELF
);

Parameters

bNewValue

アクティブにしたければTRUE、非アクティブにしたければFALSE

oEncounter

アクティブ、非アクティブを設定するエンカウンター(デフォルト: OBJECT_SELF)

Description

oEncounterのアクティブ状態をnNewValueへ設定します。

エンカウンターが消耗されたときは、エンカウンターは自身を“非アクティブ”に設定するでしょう。

エンカウンターが“連続”再出現に設定されているならば、エンカウンターは再出現の時間を過ぎるごとに自身を“アクティブ”に設定するでしょう。

SetEncounterActive関数を使って、エンカウンターをアクティブにする時を正確にコントロールしたいのであれば、あなたはエンカウンターに"Single Shot"設定を使う必要があります。

Remarks

From Victor Morales:

私はSetEncounterActive関数を一日の異なる時間ごとにクリーチャーを出現するために、使っています。例えば、夜の時間に墓でアンデッドだけ出現させたかったのです。

もし、エンカウンターのアクティブフラグが（ツールセットのエンカウンターGUIで作成された時に）FALSEに設定されていれば、SetEncounterActiveは最初、正確にクリーチャーを出現させるでしょう。クリーチャーはOnEnterイベントが有効チェックされる前に出現するように設定されているようです。加えて、一度アクティブフラグが設定されるとエンカウンターがトリガされる次の時まで元の状態へ戻ることはないでしょう。

私は夜に正確に出現するアンデッドを得ましたが、しかしそれは彼らが一度出現した場合だけでした - つまり日が変わって、日中の時間に少なくとも一回以上出現した場合です。そのときにトリガは再び正確に動作しました。

私はOnEnterでフラグをアクティブに設定し、クリーチャーが出現し、OnExitで非アクティブに再設定するようにしました。しかし、それも前の動作と同じでした。

Version

1.28

See Also

functions: | GetEncounterActive | GetEncounterSpawnsCurrent
categories: | Encounter Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Victor Morales, Paul Haynes, JP team: Redondo


Function - SetEncounterDifficulty

Home > Reference > Functions > Encounter > SetEncounterDifficulty

SetEncounterDifficulty(int, object)

エンカウンターの難易度を設定します。

void SetEncounterDifficulty(
    int nEncounterDifficulty,
    object oEncounter = OBJECT_SELF
);

Parameters

nEncounterDifficulty

ENCOUNTER_DIFFICULTY_*

oEncounter

難易度を変更するエンカウンター(デフォルト: OBJECT_SELF)

Description

oEncounterの難易度を設定します。

Version

1.22

See Also

categories: | Encounter Functions
constants: | ENCOUNTER_DIFFICULTY_* Constants

author: Tom Cassiotis, JP team: Redondo


Function - SetEncounterSpawnsCurrent

Home > Reference > Functions > Encounter > SetEncounterSpawnsCurrent

SetEncounterSpawnsCurrent(int, object)

エンカウンターが出現した回数を設定します。

void SetEncounterSpawnsCurrent(
    int nNewValue,
    object oEncounter = OBJECT_SELF
);

Parameters

nNewValue

設定する新しいエンカウンター出現回数

oEncounter

値を変更するエンカウンター(デフォルト: OBJECT_SELF)

Description

oEncounterが現時点まで出現した回数を設定します。

Version

1.22

See Also

functions: | GetEncounterSpawnsCurrent
categories: | Encounter Functions

author: Tom Cassiotis, JP team: Redondo


Function - SetEncounterSpawnsMax

Home > Reference > Functions > Encounter > SetEncounterSpawnsMax

SetEncounterSpawnsMax(int, object)

oEncounterの最大の出現回数を設定します。

void SetEncounterSpawnsMax(
    int nNewValue,
    object oEncounter = OBJECT_SELF
);

Parameters

nNewValue

新しい最大出現回数の値

oEncounter

値を変更するエンカウンター(デフォルト: OBJECT_SELF)

Description

oEncounterが出現することができる最大回数を設定します。

Version

1.22

See Also

functions: | GetEncounterSpawnsMax
categories: | Encounter Functions

author: Tom Cassiotis, JP team: Redondo


Function - SetFacing

Home > Reference > Functions > Movement > SetFacing

SetFacing(float)

objectにある方向を向くよう設定します。

void SetFacing(
    float fDirection
);

Parameters

fDirection

向くべき方向を表わす浮動少数番号。追加の詳細はdescriptionを見てください。

Description

この関数の呼出者はfDirectionの方を向きます。

方向用に幾つかあらかじめ決められた定数があります。

DIRECTION_EAST = 0.0

DIRECTION_NORTH = 90.0

DIRECTION_WEST = 180.0

DIRECTION_SOUTH = 270.0

Known Bugs

座っているクリーチャーを向かせることには問題を含んでいます。

Version

1.22

Example

// 無作為な方向を向かせる為に、
// クリーチャーのOnSpawnに使用する
main()
{
   // 0から360までのランダムな方向を得る
   float fDirection = IntToFloat(Random(361));

   SetFacing(fDirection);
}

See Also

categories: | Movement Functions
constants: | DIRECTION_* Constants

author: Tom Cassiotis, editor: Jeff Lindsey, JP team: Rainie


Function - SetFacingPoint

Home > Reference > Functions > Movement > SetFacingPoint

SetFacingPoint(vector)

objectにベクトルの方向を設定します。

void SetFacingPoint(
    vector vTarget
);

Parameters

vTarget

objectに向かせるベクトル。

Description

呼出者はvTargetの方向を向きます。

関数GetPositionとGetPositionFromLocationは、この関数でパラメーターとして使用することができるベクトルを得れます。

Version

1.22

See Also

functions: | GetPosition | GetPositionFromLocation
categories: | Movement Functions

author: Tom Cassiotis, JP team: Rainie


Function - SetFetchee

Home > Reference > Functions > Module Specific > SetFetchee

SetFetchee(object)

公式キャンペーンにおいて、NPCに対して使いを走らせているPCを設定します。

void SetFetchee(
    object oFetchee
);

Parameters

oFetchee

Description

ローカル変数(NW_J_FETCH_OWNER)に、アイテムを取ってくる仕事を与えられているPCの名前を設定します。

Remarks

nw_j_fetch.nssの242行目にあります。

この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

これらの関数全ては比較的ストレートな内容であり、一見して簡単に理解できます。

さらに全く同じ関数で、"Fetch"の代わりに"ArtifactItems"に働く、別のスクリプトもあります。

スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。

その他の関数を"See Also"セクションで見てください。

Requirements

#include "nw_j_fetch"

Version

1.29

See Also

functions: | GetFetchee
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetFetchItem

Home > Reference > Functions > Module Specific > SetFetchItem

SetFetchItem(string)

公式キャンペーンにおいて、どのアイテムをPCが拾うことを必要としているかを指定します。

void SetFetchItem(
    string sTag
);

Parameters

sTag

Description

PCが手に入れることを課されているオブジェクトのタグを、ローカル変数NW_J_FETCH_ITEMに設定します。

Remarks

nw_j_fetch.nssの129行目にあります。

この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

これらの関数全ては比較的ストレートな内容であり、一見して簡単に理解できます。

さらに全く同じ関数で、"Fetch"の代わりに"ArtifactItems"に働く、別のスクリプトもあります。

スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。

その他の関数を"See Also"セクションで見てください。

Requirements

#include "nw_j_fetch"

Version

1.29

See Also

functions: | GetFetchee | GetFetchItem
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetFormerMaster

Home > Reference > Functions > Henchmen/Familiars/Summoned > SetFormerMaster

SetFormerMaster(object, object)

PCをNPCヘンチマンの前の主人としてマーク付けします。

void SetFormerMaster(
    object oPC,
    object oHench
);

Parameters

oPC

oHenchの前の主人としてマーク付けするPC。

oHench

マーク付けするヘンチマンNPC仲間。

Description

ヘンチマンNPC仲間上のローカルオブジェクト変数に、前の主人としてのPCの値を設定します。

Remarks

この関数はNPCをパーソナライズしたい場合に有用な関数であり、会話スレッドや行動においてNPCの最後の主人であったPCに焦点をあてることができます。

Requirements

#include "NW_IO_HENCHMAN"

Version

1.29

See Also

functions: | GetFormerMaster | GetHenchman | GetMaster | SetWorkingForPlayer
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: Jody Fletcher, JP team: katsu794


Function - SetGlobal

Home > Reference > Functions > Local Variables > SetGlobal

SetGlobal(object, object)

クエスト関連の情報を保存するオブジェクトを設定する。

void SetGlobal(
    object oTarget,
    object oGlobal
);

Parameters

oTarget

クエスト関連の情報を保存するオブジェクト

oGlobal

Global()関数で作成されるクエスト情報が保持されたオブジェクト

Description

Global()関数を使って作られたクエスト関連の情報を保持するオブジェクトを、oTargetに作成する。

Remarks

クエスト関連の情報を保存して、単純なクエストを書くことを簡単にするために使われる一連のスクリプトの一部。

この特殊な関数は様々なファイルで定義されている。

nw_j_complex.nss：44行目

nw_j_story.nss：47行目

nw_j_theft.nss：44行目

nw_j_fetch.nss：47行目

nw_j_artifact.nss：47行目

nw_j_assassin.nss：107行目

nw_j_guard.nss：47行目

nw_j_rescue.nss：64行目

Requirements

#include "nw_j_artifact"

Version

1.22

See Also

functions: | Global | TakeArtifactItem | TakeComplexItem | TakeStoryItem
categories: | Local Variables Functions

author: John Shuell, JP team: ngtaicho


Function - SetGreetingVar

Home > Reference > Functions > Module Specific > SetGreetingVar

SetGreetingVar(int, object)

この変数には、プレイヤーがヘンチマンに話しかけているかどうかが記録されます。

void SetGreetingVar(
    int nChapter,
    object oPC
);

Parameters

nChapter

プレイヤーがいる章。

oPC

変数を設定するプレイヤー。

Description

プレイヤー上の変数名"NW_L_HEN" + henchmans tag + nChapterの整数値を10に設定します。

Remarks

nw_i0_henchman.nssの176行目にあります。

この関数を用いて、特定の章においてヘンチマンがプレイヤーに既に話しかけているどうかを知ることができます。

Requirements

#include "nw_i0_henchman"

Version

1.22

See Also

functions: | GetGreetingVar
categories: | Module Specific Functions

author: John Shuell, JP team: katsu794


Function - SetIdentified

Home > Reference > Functions > Get Data from Object > SetIdentified

SetIdentified(object, int)

オブジェクトが識別されているかどうかを設定します。

void SetIdentified(
    object oItem,
    int bIdentified
);

Parameters

oItem

識別フラグを変更するアイテム。

bIdentified

オブジェクトが識別されている場合は、TRUE、そうでない場合は、FALSE。

Description

oItemが識別されているかどうかを設定します。

bIdentifiedがTRUEとなっている場合は、アイテムは識別されているものとしてマークされるでしょう。そうでなければ、識別されていないものとしてマークされるでしょう。

Version

1.22

See Also

functions: | GetIdentified
categories: | Get Data from Object Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetImmortal

Home > Reference > Functions > Miscellaneous > SetImmortal

SetImmortal(object, int)

Sets a creature as immortal.

void SetImmortal(
    object oCreature,
    int bImmortal
);

Parameters

oCreature

クリーチャーを不死に設定します。

bImmortal

死ぬ運命に影響を与えるクリーチャー。

Description

クリーチャーを不死(TRUE)または、不死ではない(FALSE)に設定します。

Known Bugs

1.30のパッチにおいて、SetImmortal関数はダメージによる死に対してのみ保護を行うようであるという点でバグがあることが確認されています。

不死のクリーチャーにEffectDeath関数を適用することでクリーチャーを殺すことができますし、アビリティによるダメージによっても同様に死にます。(例 コンスティテューションを減少させる毒の場合、結果的に、クリーチャーは0より少ないHPを持つことになります。)

また、不死に設定できるのはクリーチャーのみであり、配置可能オブジェクトは不死にできないようです。

これはバグではないかもしれませんが、何か意図があるに違いありません。

Version

1.30

See Also

functions: | SetPlotFlag
categories: | Miscellaneous Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - SetIsBusy

Home > Reference > Functions > Henchmen/Familiars/Summoned > SetIsBusy

SetIsBusy(int)

仲間を忙しい状態にします。

void SetIsBusy(
    int bIsBusy
);

Parameters

bIsBusy

忙しい状態にする場合はTRUE、そうでない場合は、FALSE。

Description

仲間を忙しい状態に、または忙しくない状態にします。

Remarks

この関数は、仲間が忙しいかどうかを決定するIsBusy関数と合わせて機能します。

この関数は、ただ仲間上のローカル整数を設定するだけです。

Requirements

#include "nw_i0_assoc"

Version

1.22

See Also

functions: | IsBusy
categories: | Henchmen/Familiars/Summoned Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetIsDestroyable

Home > Reference > Functions > Action on Object > SetIsDestroyable

SetIsDestroyable(int, int, int)

オブジェクトが破壊可能であるかどうかを設定します。

void SetIsDestroyable(
    int bDestroyable,
    int bRaiseable = TRUE,
    int bSelectableWhenDead = FALSE
);

Parameters

bDestroyable

FALSEの場合は、身体は消えずに死体が残ります。

bRaiseable

TRUEの場合は、レザレクションで復活することができます。(デフォルト: TRUE)

bSelectableWhenDead

TRUEの場合は、死体を選択できます。(デフォルト: FALSE)

Description

Sets the destroyable status of the caller.

bDestroyableがFALSEの場合は、身体は消えずに死体が残ります。そうでなければ、身体は消えます。

bRaiseableがTRUEの場合は、レザレクションで復活することができます。

bSelectableWhenDeadがTRUEの場合は、この関数を呼び出した者が死んだとき、プレイヤーがマウスを死体の上に移動するとそのクリーチャーの名前が表示されます。

Remarks

bSelectableWhenDeadがTRUEに設定されている場合、それは死体をクリックして戦利品を得ることができるという意味ではありません。クリーチャーが所持品を落とすのは、消滅した時だけです。

オブジェクトが破壊不能(死の時だけに影響する仕様によると)に設定されている場合は、そのオブジェクトはDestroyObject関数の影響を受けません。それ故に、オブジェクトが死ぬ瞬間にSetIsDestroyable(False)と設定されていることが重要です。

Version

1.28

See Also

categories: Action on Object Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Tim Fletcher, JP team: katsu794


Function - SetIsEnemy

Home > Reference > Functions > Reputation/Faction > SetIsEnemy

SetIsEnemy(object)

クリーチャーを敵対関係にさせます。

void SetIsEnemy(
    object oTarget
);

Parameters

oTarget

Description

この関数の呼び出した者に対するoTargetの関係を-100にします。これは呼び出した者にoTargetを攻撃させることになります。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

categories: Reputation/Faction Functions

author: Tom Cassiotis, editor: Jody Fletcher, JP team: Redondo


Function - SetIsTemporaryEnemy

Home > Reference > Functions > Reputation/Faction > SetIsTemporaryEnemy

SetIsTemporaryEnemy(object, object, int, float)

無限時間もしくは一定時間、クリーチャーが別のクリーチャーを敵対と見なすようにします。

void SetIsTemporaryEnemy(
    object oTarget,
    object oSource = OBJECT_SELF,
    int bDecays = FALSE,
    float fDurationInSeconds = 180.0f
);

Parameters

oTarget

関係を変化されるオブジェクト

oSource

意見を変えるクリーチャー(デフォルト: OBJECT_SELF)

bDecays

TRUEであれば、敵意はfDurationInSecondsを越えるとなくなります。そのほかの場合は無限時間に敵意を持ちます。(デフォルト: FALSE)

fDurationInSeconds

bDecaysがTRUEの場合のみ使用します。これは敵意を持つ時間を表します。(デフォルト: 180.0f)

Description

個人的な関係調整を使用してoSourceがoTargetの一時的な敵であるようにします。

Note: bDecaysがTRUEであれば、fDurationInSeconds以上は個人的な評判量は減少します。敵意は（ファクション関係 ＋ 個人的な全評判）がREPUTATION_TYPE_ENEMY以下である間、続くでしょう。

Remarks

ファクションがクリーチャーを敵対と見なすような場合は、この関数の代わりにAdjustReputationを使うべきです。

David Gaider's (Bioware) Scripting FAQ より:
COMMON PROBLEMS: あなたが戦闘させたいクリーチャーがコモナーのレベルを持っていないことを確かめてください。コモナーはgeneric AIによって敵から逃げるように、そして近くにレベル10以上のコモナーが居るときは群れになるように設定されています。

また、OnSpawnスクリプト内で'Special Behaviors'を使用（special behaviorコマンド行をコメントアウト）するなかで'Herbivore'行動を使用していないかどうかを確かめてください。草食動物（Herbivores）は決して戦闘を行わず、いつも逃げてしまいます。

David Gaider (Bioware) による別の投稿より:
プロットフラグを持っているクリーチャーは敵になりません。それは破壊不可能なNPCが偶然、PCについて何かにより設定されて、PCを追いかけることを防ぐためです。

もしあなたが破壊不可能なNPCにPCを攻撃させたいならば、NPCを敵に変える前に、特別にプロットフラグを取り除いてそれを行う必要があります。

Version

1.22

Example

//::///////////////////////////////////////////////
//:: Attack on End of Conversation
//:: NW_D1_AttOnEnd02
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
   このスクリプトはNPCを現在会話中の人物へ
   攻撃させます。キャラクタ単体を敵にするだけで
   ファクション全体ではありません。n*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Nov 7, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
void main()
{
    SetIsTemporaryEnemy(GetPCSpeaker());
    DetermineCombatRound();
}

See Also

functions: | AdjustReputation
categories: | Reputation/Faction Functions
constants: | REPUTATION_TYPE_* Constants

author: Tom Cassiotis, JP team: Redondo


Function - SetIsTemporaryFriend

Home > Reference > Functions > Reputation/Faction > SetIsTemporaryFriend

SetIsTemporaryFriend(object, object, int, float)

無限時間もしくは一定時間、クリーチャーが別のクリーチャーを友好と見なすようにします。

void SetIsTemporaryFriend(
    object oTarget,
    object oSource = OBJECT_SELF,
    int bDecays = FALSE,
    float fDurationInSeconds = 180.0f
);

Parameters

oTarget

関係を変化されるオブジェクト

oSource

意見を変えるクリーチャー(デフォルト: OBJECT_SELF)

bDecays

TRUEであれば、友好の立場はfDurationInSecondsを越えるとなくなります。そのほかの場合は無限時間に友好を持ちます。(デフォルト: FALSE)

fDurationInSeconds

bDecaysがTRUEの場合のみ使用します。これは友好である時間を表します。(デフォルト: 180.0f)

Description

個人的な関係調整を使用してoSourceがoTargetへ一時的に友好であるようにします。

Note: bDecaysがTRUEであれば、fDurationInSeconds以上は個人的な評判量は減少します。友好は（ファクション関係 ＋ 個人的な全評判）がREPUTATION_TYPE_FRIENDと等しい間、続くでしょう。

Version

1.22

See Also

categories: | Reputation/Faction Functions
constants: | REPUTATION_TYPE_* Constants

author: Tom Cassiotis, JP team: Redondo


Function - SetIsTemporaryNeutral

Home > Reference > Functions > Reputation/Faction > SetIsTemporaryNeutral

SetIsTemporaryNeutral(object, object, int, float)

無限時間もしくは一定時間、クリーチャーが別のクリーチャーを中立と見なすようにします。

void SetIsTemporaryNeutral(
    object oTarget,
    object oSource = OBJECT_SELF,
    int bDecays = FALSE,
    float fDurationInSeconds = 180.0f
);

Parameters

oTarget

関係を変化されるオブジェクト

oSource

意見を変えるクリーチャー(デフォルト: OBJECT_SELF)

bDecays

TRUEであれば、中立はfDurationInSecondsを越えるとなくなります。そのほかの場合は無限時間に中立を持ちます。(デフォルト: FALSE)

fDurationInSeconds

bDecaysがTRUEの場合のみ使用します。これは中立である時間を表します。(デフォルト: 180.0f)

Description

個人的な関係調整を使用してoSourceがoTargetへ一時的に中立であるようにします。

Note: bDecaysがTRUEであれば、fDurationInSeconds以上になると個人的な評判量は減少します。中立は（ファクション関係 ＋ 個人的な全評判）がREPUTATION_TYPE_ENEMY以上、REPUTATION_TYPE_FRIEND以下である間、続くでしょう。

Version

1.22

See Also

categories: | Reputation/Faction Functions
constants: | REPUTATION_TYPE_* Constants

author: Tom Cassiotis, JP team: Redondo


Function - SetItemCharges

Home > Reference > Functions > Action on Object, Inventory > SetItemCharges

SetItemCharges(object, int)

与えられたアイテムに残っているチャージ数をセットします。

void SetItemCharges(
    object oItem,
    int nCharges
);

Parameters

oItem

チャージ数をセットするアイテム。

nCharges

セットするチャージ数。（0にすると破壊されます）

Description

与えられたアイテムに残っているチャージ数をセットします。

nChargesが0より小さい値だった場合、チャージ数に0がセットされます。（そしてアイテムは破壊されます）

値がチャージ数の最大値よりも大きかった場合には、そのタイプのアイテムが持つことのできる最大のチャージ数がセットされます。

チャージ数が0に達したとき、アイテムは自動的に破壊されます。

Remarks

この関数はまた通常チャージ数を持たないアイテムにも働きます。

あなたがそのようなアイテムに10チャージを与えれば、そのアイテムの詳細画面でそれが確認できるでしょう。

通常チャージ数を持たないアイテムに、0チャージをセットすればそのアイテムを破壊することもできます。

oItemが有効なアイテムでない場合は何も起こりません。

Version

1.30

See Also

categories: Action on Object Functions | Inventory Functions

author: Charles Feduke, editor: Lilac Soul, JP team: NamaYake


Function - SetItemStackSize

Home > Reference > Functions > Action on Object, Inventory > SetItemStackSize

SetItemStackSize(object, int)

与えられたスタックのアイテム数をセットします。

void SetItemStackSize(
    object oItem,
    int nSize
);

Parameters

oItem

スタックのサイズをセットするアイテム。

nSize

新しいスタックサイズ。

Description

与えられたスタックのアイテム数をセットします。

セットした数字が1より小さい場合には、スタックサイズには1がセットされます。（SetItemCharges関数のように破壊されることはありません）

セットした数字がそのタイプのアイテムの最大スタック数よりも大きかった場合は、そのタイプのアイテムの最大スタック数がセットされます。

Remarks

スタックから単一のアイテム（例えばポーションのように）を取り出すこと以外に、この関数はアイテムがスタック可能かどうかを調べることもできます。下記のサンプルスクリプトをご覧下さい。

Version

1.30

Example

//oItemがスタックできるときはTRUEを返します。
int GetIsStackableItem(object oItem)
{
//checkchestというタグの宝箱を作っておきます。

object oCopy=CopyItem(oItem, GetObjectByTag("checkchest"));

//スタック数を２にします。
SetItemStackSize(oCopy, 2);

//２つスタックしているかどうかチェックします。
int bStack=GetItemStackSize(oCopy)==2;

//コピーを破棄します。
DestroyObject(oCopy);

//bStackの返す値がTRUEのときはアイテムはスタック可能です。
return bStack;
}

See Also

functions: | GetItemStackSize
categories: | Action on Object Functions | Inventory Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: NamaYake


Function - SetLastGenericSpellCast

Home > Reference > Functions > Core AI > SetLastGenericSpellCast

SetLastGenericSpellCast(int)

最後に詠唱された呪文のIDを保管するローカル変数を設定します。

void SetLastGenericSpellCast(
    int nSpell
);

Parameters

nSpell

SPELL_*

Description

BioWareのコアAIシステムが同じ呪文の詠唱を保持しないので、最後に詠唱された呪文に対するローカル変数を設定します。

GetLastGenericSpellCast()関数、CompareLastSpellCast()関数と合わせて使用されます。

Remarks

ローカル変数名"NW_GENERIC_LAST_SPELL"を使用します。

この関数は、NPCのアクションをよりダイナミックに見せるためのコアAIプログラミングの一部です。

Requirements

#include "NW_I0_GENERIC"

Version

1.29

See Also

functions: | CompareLastSpellCast | GetLastGenericSpellCast
categories: | Core AI Functions
constants: | SPELL_* Constants

author: Tom Cassiotis, editor: Jody Fletcher, JP team: katsu794


Function - SetListening

Home > Reference > Functions > Core AI, Henchmen/Familiars/Summoned > SetListening

SetListening(object, int)

オブジェクトが聞くべきかどうかを設定します。

void SetListening(
    object oObject,
    int bValue
);

Parameters

oObject

聞く状態を設定するオブジェクト。

bValue

オブジェクトが聞くべきと設定する場合はTRUE、そうでない場合はFALSE。

Description

oObjectが聞くべきかどうかを設定します。

Version

1.22

Example

///////////////////////////////////////////////////////////////////////////////
//:: ウェイポイント間を歩くガード
//::
//:: NW_C3_Waypoint9.nss
//::
//:: Copyright (c) 2000 Bioware Corp.
///////////////////////////////////////////////////////////////////////////////
/*   聞く文字列を設定し、行動サイクルを開始させます。
*/
///////////////////////////////////////////////////////////////////////////////
//:: Created By: Aidan Scanlan   On: Sept 12, 2001
///////////////////////////////////////////////////////////////////////////////

void main()
{
   SetListening(OBJECT_SELF,TRUE);
   SetListenPattern(OBJECT_SELF,"NW_I_WAS_ATTACKED",0);
   SetListenPattern(OBJECT_SELF,"NW_ATTACK_MY_TARGET",1);
   //叫ぶ者は"NW_L_TargetOfAttack"を自身に保管しているターゲットオブジェクトを持っていなければなりません。
   SetListenPattern(OBJECT_SELF,"NW_MOVE_TO_LOCATION",2);
   //叫ぶ者は"NW_L_LocationToMoveTo"を自身に保管しているロケーションを持っていなければなりません。
   SetListenPattern(OBJECT_SELF,"NW_FIRE_IN_THE_HOLE",3);
   //叫ぶ者は"NW_L_LocationOfSpell"を自身に保管しているロケーションを持っていなければなりません。
   SetListenPattern(OBJECT_SELF,"NW_UNLEASH_HELL",4);
   DelayCommand(1.0f,SignalEvent(OBJECT_SELF,EventUserDefined(1)));
}

See Also

functions: | GetIsListening | GetListenPatternNumber | GetMatchedSubstring | GetMatchedSubstringsCount | GetNearestSeenOrHeardEnemy | SetListenPattern
categories: | Core AI Functions | Henchmen/Familiars/Summoned Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetListeningPatterns

Home > Reference > Functions > Core AI > SetListeningPatterns

SetListeningPatterns()

AIを適切に機能させるためにリスニングパターンを用意します。

void SetListeningPatterns();

Description

NPCが聞くデフォルトの叫びを設定します。

Remarks

NPCが何の特殊能力を持っているか、または何のクラスであるかを決定することで、適切な聴力チェックを設定します。

この関数で、様々なモデルに対して睡眠、出現、消滅といった全てのアニメーションを設定するのも良いでしょう。

Version

1.22

See Also

functions: | CheckWayPoints | GetListenPatternNumber | GetMatchedSubstring | GetMatchedSubstringsCount | SetAssociateListenPatterns
categories: | Core AI Functions

author: Charles Feduke, editor: Tom Cassiotis, JP team: katsu794


Function - SetListenPattern

Home > Reference > Functions > Core AI, Henchmen/Familiars/Summoned > SetListenPattern

SetListenPattern(object, string, int)

オブジェクトが特定のパターンを聞くように設定します。

void SetListenPattern(
    object oObject,
    string sPattern,
    int nNumber = 0
);

Parameters

oObject

特定のことを聞くオブジェクト。

sPattern

聞くセリフのパターン。詳細は、Remarksセクションを見て下さい。

nNumber

特定パターンのインデックス。(デフォルト: 0)

Description

oObjectにsPatternを聞くよう設定します。

注意:実際にオブジェクトに聞くよう設定するためには、SetListening関数を呼ばなければなりません。

Remarks

異なったことを聞かせるために、幾度かこの関数を呼ぶことができます。

Biowareは、この関数をAIを手助けするために使用しており、雄叫びを通してコマンドを送ったり、パーティーメンバーに適切な反応をさせたりします。

BiowareのNoel氏より:

** 空文字またはそれ以上のの文字にマッチします。

*w １文字またはそれ以上の空白スペース

*n １文字またはそれ以上の数字

*p １文字またはそれ以上の句読点

*a １文字またはそれ以上のアルファベット

| は or を表します。

( ) は、囲んで使うことができます。

- "**"を聞くようにクリーチャー設定すると、どんな文字列にもマッチします。

- "**funk**"を聞くようにクリーチャーに設定すると、"funk"を含むどんな文字列にもマッチします。

- "**(bash|open|unlock)**(chest|door)**"は、"open the door please"や"he just bashed that chest!"の様な文字列にマッチします。

Version

1.26

See Also

functions: | GetIsListening | GetListenPatternNumber | GetMatchedSubstring | GetMatchedSubstringsCount | SetListening
categories: | Core AI Functions | Henchmen/Familiars/Summoned Functions
events: | OnConversation Event

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Max Aller, JP team: katsu794


Function - SetLocalArrayInt

Home > Reference > Functions > Local Variables > SetLocalArrayInt

SetLocalArrayInt(object, string, int, int)

オブジェクトに設定された配列に数値をセットする動作をシミュレートする

void SetLocalArrayInt(
    object oidObject,
    string sVarName,
    int nVarNum,
    int nValue
);

Parameters

oidObject

配列を保存するオブジェクト

sVarName

配列の名称

nVarNum

配列上に保存する位置、インデックス、添え字

nValue

配列に保存する数値

Description

これは配列のシミュレーションであるが、１つのようにアクセスしたり、ループさせることもできる。

この配列シミュレーター関数で変数を作った場合、実際は"sVarNamen+VarNum"という名称の変数が作成されている。

SetLocalArrayInt(oPC, "myarray", 1, 10);

SetLocalInt(oPC, "myarray1", 10);

上記２つの関数はまったく同じ動作をする。

Remarks

nw_o0_itemmaker.nssの22行目に見つかる。

実際に配列は有効です。なぜなら：

a)コードの乱雑さを軽減することができる

b)変数名を個々に作るよりも、楽に連続して作ってまとめることができる

Known Bugs

SetLocalString(オブジェクト, 文字列, 文字列)と同じバグがある。

Requirements

#include "nw_o0_itemmaker"

Version

1.28

Example

//Sets 10 variables quickly on the PC, using a for loop.
//myarray1 is set to 1, myarray2 is set to 2, etc.

#include "nw_o0_itemmaker"

void main()
{
     object oPC = GetPCSpeaker();

     int nLoop;
     for (nLoop=1; nLoop<=10; nLoop++)
     {
          SetLocalArrayInt(oPC, "myarray", nLoop, nLoop);
     }
}

See Also

functions: | GetLocalArrayInt | GetLocalInt | SetLocalInt
categories: | Local Variables Functions

author: Lilac Soul, editor: Charles Feduke, additional contributor(s): Graziano Lenzi, JP team: geshi, ngtaicho


Function - SetLocalArrayString

Home > Reference > Functions > Local Variables > SetLocalArrayString

SetLocalArrayString(object, string, int, string)

オブジェクトに設定された配列に文字列をセットする動作をシミュレートする

void SetLocalArrayString(
    object oidObject,
    string sVarName,
    int nVarNum,
    string nValue
);

Parameters

oidObject

配列を保存するオブジェクト

sVarName

配列の名称

nVarNum

配列上に保存する位置、インデックス、添え字

nValue

配列に保存する文字列

Description

これは配列のシミュレーションであるが、１つのようにアクセスしたり、ループさせることもできる。

この配列シミュレーター関数で変数を作った場合、実際は"sVarNamen+VarNum"という名称の変数が作成されている。

SetLocalArrayString(oPC, "myarray", 1, "hello");

SetLocalString(oPC, "myarray1", "hello");

上記２つの関数はまったく同じ動作をする。

Remarks

nw_o0_itemmaker.nssの20行目に見つかる。

実際に配列は有効です。なぜなら：

a)コードの乱雑さを軽減することができる

b)変数名を個々に作るよりも、楽に連続して作ってまとめることができる

Known Bugs

SetLocalString(オブジェクト, 文字列, 文字列)と同じバグがあるらしい。

Requirements

#include "nw_o0_itemmaker"

Version

1.28

Example

// 10個の変数をPCにすばやくセットするループ
// myarray1に"number 1"をセット、
// myarray2に"number 2"をセット・・・

#include "nw_o0_itemmaker"

void main()
{
object oPC=GetPCSpeaker();

int nLoop;
for (nLoop=1; nLoop<=10; nLoop++)
   {
   SetLocalArrayString(oPC, "myarray", nLoop, "number "+IntToString(nLoop));
   }
}

See Also

functions: | GetLocalArrayString | SetLocalString
categories: | Local Variables Functions

author: Lilac Soul, editor: Charles Feduke, additional contributor(s): Graziano Lenzi, JP team: geshi, ngtaicho


Function - SetLocalFloat

Home > Reference > Functions > Local Variables > SetLocalFloat

SetLocalFloat(object, string, float)

オブジェクトに浮動小数型ローカル変数を保存する。

void SetLocalFloat(
    object oObject,
    string sVarName,
    float fValue
);

Parameters

oObject

ローカル変数を保存するオブジェクト

sVarName

保存する変数の名称（ファイル名みたいなもの）

fValue

保存する浮動小数値

Description

oObjectで指定されたオブジェクトにsVarNameという名前の整数型保管領域を確保し、fValueの値を保存する。同じオブジェクトの中に同じ名称で再度保存した場合、前の値は失われ、上書きされてしまう。

Remarks

これらの関数は一見、ローカル変数に値を代入する命令に見えるかも知れませんが、実際にはファイルの入出力に近いものと言えます。

SetLocalFloat(オブジェクト, ローカル変数名, 浮動小数値)

これを

SetLocalFloat(記憶媒体, ファイル名, データ)

という感じで見たほうがわかりいいかも知れません。

オブジェクト（記憶媒体）が違えば、ローカル変数名（ファイル名）が同じでも別の値が保持できますし、浮動小数値（データ）が入った変数名と、ローカル変数名（ファイル名）は一致させる必要もありません。

Known Bugs

クリエイト関数で作成された直後のSetLocal関数はタイミングによって失敗する可能性を秘めている。詳しくはSetLocalString関数の説明にて。

Version

1.28

Example

// SetLocalFloat構文の例
void main()
{
     object oThis = OBJECT_SELF;
     string sKey = “foo”;
     float fValue = 20.0;
     SetLocalFloat(oThis, sKey, fValue);
}

See Also

functions: | GetLocalFloat
categories: | Local Variables Functions

author: Daniel Beckman, editor: Charles Feduke, additional contributor(s): Graziano Lenzi, JP team: ngtaicho


Function - SetLocalInt

Home > Reference > Functions > Local Variables > SetLocalInt

SetLocalInt(object, string, int)

オブジェクトに整数型ローカル変数を保存する。

void SetLocalInt(
    object oObject,
    string sVarName,
    int nValue
);

Parameters

oObject

ローカル変数を保存するオブジェクト

sVarName

保存する変数の名称（ファイル名みたいなもの）

nValue

保存する整数値

Description

oObjectで指定されたオブジェクトにsVarNameという名前の整数型保管領域を確保し、nValueの値を保存する。同じオブジェクトの中に同じ名称で再度保存した場合、前の値は失われ、上書きされてしまう。

Remarks

これらの関数は一見、ローカル変数に値を代入する命令に見えるかも知れませんが、実際にはファイルの入出力に近いものと言えます。

SetLocalInt(オブジェクト, ローカル変数名, 整数値)

これを

SetLocalInt(記憶媒体, ファイル名, データ)

という感じで見たほうがわかりいいかも知れません。

オブジェクト（記憶媒体）が違えば、ローカル変数名（ファイル名）が同じでも別の値が保持できますし、整数値（データ）が入った変数名と、ローカル変数名（ファイル名）は一致させる必要もありません

Known Bugs

クリエイト関数で作成された直後のSetLocal関数はタイミングによって失敗する可能性を秘めている。詳しくはSetLocalString関数の説明にて。

Version

1.28

Example

void main()
{
     object oThis = OBJECT_SELF;
     string sKey = “foo”;
     int iValue = 2;
     // "foo"という保存場所に2の値を保管する。
     // この値は後に GetLocalInt を使って読み出すことができる。
     SetLocalInt(oThis, sKey, iValue);
}

See Also

functions: | GetLocalInt | SetLocalArrayInt
categories: | Local Variables Functions

author: Daniel Beckman, editor: Charles Feduke, additional contributor(s): Xepherys, Graziano Lenzi, JP team: ngtaicho


Function - SetLocalLocation

Home > Reference > Functions > Local Variables > SetLocalLocation

SetLocalLocation(object, string, location)

オブジェクトにロケーション型ローカル変数を保存する。

void SetLocalLocation(
    object oObject,
    string sVarName,
    location lValue
);

Parameters

oObject

ローカル変数を保存するオブジェクト

sVarName

保存する変数の名称（ファイル名みたいなもの）

lValue

保存するロケーション情報

Description

oObjectで指定されたオブジェクトにsVarNameという名前のロケーション型保管領域を確保し、lValueの値を保存する。同じオブジェクトの中に同じ名称で再度保存した場合、前の値は失われ、上書きされてしまう。

Remarks

これらの関数は一見、ローカル変数に値を代入する命令に見えるかも知れませんが、実際にはファイルの入出力に近いものと言えます。

SetLocalLocation(オブジェクト, ローカル変数名, ロケーション情報)

これを

SetLocalLocation(記憶媒体, ファイル名, データ)

という感じで見たほうがわかりいいかも知れません。

オブジェクト（記憶媒体）が違えば、ローカル変数名（ファイル名）が同じでも別の値が保持できますし、ロケーション情報（データ）が入った変数名と、ローカル変数名（ファイル名）は一致させる必要もありません。

Known Bugs

クリエイト関数で作成された直後のSetLocal関数はタイミングによって失敗する可能性を秘めている。詳しくはSetLocalString関数の説明にて。

Version

1.28

Example

// SetLocalLocation関数の簡単な構文例
void main()
{
     object oThis = OBJECT_SELF;
     string sKey = “foo”;
     object oArea = GetArea(OBJECT_SELF);
     vector vPosition = Vector(0.0, 0.0, 0.0)
     location lValue = Location(oArea, vPosition, 0.0);
     SetLocalLocation(oThis, sKey, lValue);
}

See Also

functions: | GetLocalLocation
categories: | Local Variables Functions

author: Daniel Beckman, editor: Charles Feduke, additional contributor(s): Steve U., Graziano Lenzi, JP team: ngtaicho


Function - SetLocalObject

Home > Reference > Functions > Local Variables > SetLocalObject

SetLocalObject(object, string, object)

オブジェクトにオブジェクト型ローカル変数を保存する。

void SetLocalObject(
    object oObject,
    string sVarName,
    object oValue
);

Parameters

oObject

ローカル変数を保存するオブジェクト

sVarName

保存する変数の名称（ファイル名みたいなもの）

oValue

保存するオブジェクト情報

Description

oObjectで指定されたオブジェクトにsVarNameという名前のオブジェクト型保管領域を確保し、oValueの値を保存する。同じオブジェクトの中に同じ名称で再度保存した場合、前の値は失われ、上書きされてしまう。

Remarks

これらの関数は一見、ローカル変数に値を代入する命令に見えるかも知れませんが、実際にはファイルの入出力に近いものと言えます。

SetLocalObject(オブジェクト, ローカル変数名, オブジェクト情報)

これを

SetLocalObject(記憶媒体, ファイル名, データ)

という感じで見たほうがわかりいいかも知れません。

オブジェクト（記憶媒体）が違えば、ローカル変数名（ファイル名）が同じでも別の値が保持できますし、オブジェクト情報（データ）が入った変数名と、ローカル変数名（ファイル名）は一致させる必要もありません。

Known Bugs

クリエイト関数で作成された直後のSetLocal関数はタイミングによって失敗する可能性を秘めている。詳しくはSetLocalString関数の説明にて。

Version

1.28

Example

// モジュール内に"npc_henchment"とタグをつけられている
// オブジェクトがいると想定する。
void main()
{
     object oThis = OBJECT_SELF;
     object oObject = GetObjectByTag("npc_henchment");
     SetLocalObject(oThis, "hench", oObject);
}

See Also

functions: | GetLocalObject
categories: | Local Variables Functions

author: Daniel Beckman, editor: Charles Feduke, additional contributor(s): Xepherys, Graziano Lenzi, JP team: ngtaicho


Function - SetLocalPlotIntOnCharacter

Home > Reference > Functions > Module Specific > SetLocalPlotIntOnCharacter

SetLocalPlotIntOnCharacter(object, int)

特殊プロット整数値をクリーチャーに設定します。

void SetLocalPlotIntOnCharacter(
    object oNPC,
    int nPlotStateIndex
);

Parameters

oNPC

プロット整数値を設定するクリーチャー、またはPC。

nPlotStateIndex

設定するプロット状態整数値。

Description

oNPC上に、"PLOT2Q4"という名前の変数 + GetTag(oNPC)の値となるローカル整数値を設定します。

この関数は、movement/stateのプロット値を記録するために使用されます。

Remarks

nw_i0_2q4luskan.nssの28行目にあります。

Requirements

#include "nw_i0_2q4luskan"

Version

1.28

See Also

functions: | GetLocalPlotIntFromCharacter
categories: | Module Specific Functions

author: Charles Feduke, JP team: katsu794


Function - SetLocalString

Home > Reference > Functions > Local Variables > SetLocalString

SetLocalString(object, string, string)

オブジェクトに文字列型ローカル変数を保存する。

void SetLocalString(
    object oObject,
    string sVarName,
    string sValue
);

Parameters

oObject

ローカル変数を保存するオブジェクト

sVarName

保存する変数の名称（ファイル名みたいなもの）

sValue

保存する文字列

Description

oObjectで指定されたオブジェクトにsVarNameという名前の整数型保管領域を確保し、sValueの値を保存する。同じオブジェクトの中に同じ名称で再度保存した場合、前の値は失われ、上書きされてしまう。

Remarks

これらの関数は一見、ローカル変数に値を代入する命令に見えるかも知れませんが、実際にはファイルの入出力に近いものと言えます。

SetLocalString(オブジェクト, ローカル変数名, 文字列)

これを

SetLocalString(記憶媒体, ファイル名, データ)

という感じで見たほうがわかりいいかも知れません。

オブジェクト（記憶媒体）が違えば、ローカル変数名（ファイル名）が同じでも別の値が保持できますし、文字列（データ）が入った変数名と、ローカル変数名（ファイル名）は一致させる必要もありません。

Known Bugs

クリエイト関数で作成された直後のSet関数はタイミングによって失敗する可能性を秘めている。クリエイト関数で作られたばかりのオブジェクト、あるいはクリーチャーにこの関数を使用する場合、

SetLocalString(object, string, string)

のかわりに

ActionDoCommand(SetLocalString(object, string, string))

を使ってアクションキュー（行動待ち行列）に入れておいたほうが確実に関数が実行される。これは恐らく、オブジェクト／クリーチャー発生開始してすぐは直接の関数を受け付けない時間が存在するか、クリエート直後に設定の初期化が行われているためと思われる。

クリエート直後はActionDoCommand(SetLocal系関数)というふうにパターン化して使用しよう。

※このバグはSetLocal系の全ての関数に存在します。

Version

1.28

Example

// 後に下のGetLocal関数で読み出すことができる文字列を
// OBJECT_SELFにセットする
// string sValue = GetLocalString(OBJECT_SELF, "foo");
void main()
{
     object oThis = OBJECT_SELF;
     string sKey = “foo”;
     string sValue = “some string”;
     SetLocalString(oThis, sKey, sValue);
}

/* 以下の２つの例はnObjectType、sTemplate、lLocationが
    既に設定されているものとします。
    CreateObject(int, string, location, int)も参考にして下さい。
*/

// 不確実
// クリエイトオブジェクトされたものに反映されない可能性がある。
object oTarget = CreateObject(nObjectType, sTemplate, lLocation, FALSE);
SetLocalString(oTarget, "STRING_NAME", "This is my string value");

// 確実
// クリエイトオブジェクトされたものに確実に反映される
object oTarget = CreateObject(nObjectType, sTemplate, lLocation, FALSE);
action aSetString = ActionDoCommand(
     SetLocalString(oTarget, "STRING_NAME", "This is my string")
     );
AssignCommand(oTarget, aSetString);

See Also

functions: | GetLocalString | SetLocalArrayString
categories: | Local Variables Functions

author: Daniel Beckman, editor: Charles Feduke, additional contributor(s): Xepherys, Graziano Lenzi, JP team: ngtaicho


Function - SetLocked

Home > Reference > Functions > Action on Object > SetLocked

SetLocked(object, int)

ドア、あるいは配置用オブジェクトを施錠、または解錠します。

action SetLocked(
    object oTarget,
    int bLocked
);

Parameters

oTarget

施錠するドア、または配置用オブジェクト。

bLocked

TRUEであれば、施錠、FALSEであれば、解錠。

Description

解錠スキルのチェックせずにオブジェクトや配置用オブジェクトを施錠、解錠するためにオブジェクトやクリーチャーによって使用されます。

Remarks

ActionLockObject関数とActionUnlockObject関数のいづれかを使えば、クリーチャーの適切なスキルチェックを行うことができます。ドアの'施錠可能'チェックボックスがチェックされていることも確認して下さい。

Version

1.22

Example

// タグがDOOR_TAGのオブジェクトを解錠します。
void main()
{
   object oDoor = GetObjectByTag("DOOR_TAG");
   SetLocked(oDoor, FALSE);
}

See Also

functions: | ActionCloseDoor | ActionLockObject | ActionOpenDoor | ActionUnlockObject | GetLastUnlocked
categories: | Action on Object Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetMachineState

Home > Reference > Functions > Module Specific > SetMachineState

SetMachineState(int, int)

PCが公式キャンペーン中のラスカンの町において特定の装置を使用する時に、装置操作の設定・非設定を行います。

void SetMachineState(
    int nCondition,
    int bValid
);

Parameters

nCondition

bValid

Description

レバーが押された後に、装置に新しい状態を設定します。

装置状態を変化させることができるかどうかを決定するローカル変数(2Q4_ColmarrEng)の状態を得た後に、ローカル変数(NW_2Q4_COLMARR_MACHINE_LEVER_STATE)を必要な値に変更します。

Remarks

この関数は、公式キャンペーンモジュールの一部です。nw_i0_2q4luskan.nssの38行目にあります。

Requirements

#include "nw_i0_2q4luskan"

Version

1.29

See Also

functions: | GetMachineState
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetMapPinEnabled

Home > Reference > Functions > Miscellaneous > SetMapPinEnabled

SetMapPinEnabled(object, int)

マップノートを使用可能にします。

void SetMapPinEnabled(
    object oMapPin,
    int nEnabled
);

Parameters

oMapPin

マップに表示可能にさせるマップノート

nEnabled

TRUEまたはFALSE

Description

表示済みのマップ上にマップノートを使用可能または不可能にします。

Version

1.28

See Also

categories: Miscellaneous Functions

author: Charles Feduke, additional contributor(s): Drake Coker, JP team: Rainie


Function - SetNPCWarningStatus

Home > Reference > Functions > Core AI > SetNPCWarningStatus

SetNPCWarningStatus(int)

NPCの警戒ステータス状態を保管します。

void SetNPCWarningStatus(
    int bStatus = TRUE
);

Parameters

bStatus

警戒ステータスの値(デフォルト: TRUE)

Description

この関数は、クリーチャー上のローカル変数(NW_GENERIC_WARNING_STATUS)をbStatusに設定します。

値は、GetNPCWarningStatus()関数により取り出されます。

Remarks

BioWareはこの関数を使用していません。また、他の人が興味を持つべきでもありません。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

functions: | GetNPCWarningStatus
categories: | Core AI Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetPanelButtonFlash

Home > Reference > Functions > Server > SetPanelButtonFlash

SetPanelButtonFlash(object, int, int)

プレイヤークライアントのパネルボタンを点滅させたり、やめさせたりします。

void SetPanelButtonFlash(
    object oPlayer,
    int nButton,
    int bEnableFlash
);

Parameters

oPlayer

目標のプレイヤー

nButton

パネルボタン定数（PANEL_BUTTON_*）

bEnableFlash

TRUEかFLASEで点滅の開始と終了です。

Description

oPlayerのクライアントにあるパネルボタンｎButtonを点滅させたり止めたりします。パラメーターbEnableFlashをTRUEかFALSEにすることで、パネルボタンを点滅させたり止めさせたりできます。

Remarks

点滅しているパネルボタンはマウスでパネルボタンをプレイヤーが１度クリックするか、または該当するキーでパネルを開けば点滅は止まります。bEnableFlashパラメーターをFALSEにセットすることは通常不要です。

Version

1.22

Example

void main()
{
    object oPlayer = GetFirstPC();

    // 新たなクエストを示すためにジャーナルパネルボタンを点滅させる
    SetPanelButtonFlash(oPlayer, PANEL_BUTTON_JOURNAL, TRUE);

    // パネルボタンの点滅を止める
    SetPanelButtonFlash(oPlayer, PANEL_BUTTON_JOURNAL, FALSE);

}

See Also

categories: | Server Functions
constants: | PANEL_BUTTON_* Constants

author: Daniel Beckman, JP team: Rainie


Function - SetPCDislike

Home > Reference > Functions > Reputation/Faction > SetPCDislike

SetPCDislike(object, object)

プレイヤーがクリーチャー（もしくはオブジェクト）を“dislike”（嫌い）であるようにします。

void SetPCDislike(
    object oPlayer,
    object oTarget
);

Parameters

oPlayer

態度を設定するPC

oTarget

PCが“dislike”になるクリーチャー（PCもクリーチャーが“dislike”になる）

Description

oPlayerとoTargetはお互いに“dislike”になります。

“Like”は中立であり、oTargetに対して非敵対をとります。

“Party”は友好であり、oTargetに対して友好です。

“Dislike”はあなたをある人物の敵とします。マウス上では他の敵NPCと同様の赤いオーラを伴うでしょう（マウスがソードの攻撃コマンドとなったり・・等など）。もしいくつかのあなたの指揮下にあるNPC（仲間、動物、召喚など）があなたが“dislike”なプレイヤーを見たら、彼らは直ちに攻撃することでしょう。

また、二つの状況をメモしてします。あなたが別のプレイヤーを“dislike”ならば、相手も自動的にあなたのことを“dislike”になるでしょう。“dislike”の状況が適所にある時にあなたが誰かが“like”ならば、相手はあなたが自動的に“like”になるでしょう。

Version

1.28

See Also

functions: | SetPCLike
categories: | Reputation/Faction Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Karl Frauendienst, JP team: Redondo


Function - SetPCLike

Home > Reference > Functions > Reputation/Faction > SetPCLike

SetPCLike(object, object)

クリーチャーがPCを“like”（好き）であるようにします。

void SetPCLike(
    object oPlayer,
    object oTarget
);

Parameters

oPlayer

oTargetを“like”になるプレイヤー

oTarget

PCが“like”になるクリーチャー（PCもクリーチャーがlikeになる）

Description

oPlayerとoTargetはお互い“like”になります。

“like”は中立で、oTargetに対して非敵対で、その逆もしかり。

Version

1.29

See Also

functions: | SetPCDislike
categories: | Reputation/Faction Functions

author: Charles Feduke, additional contributor(s): Harald Schuster, JP team: Redondo


Function - SetPersonalItem

Home > Reference > Functions > Module Specific > SetPersonalItem

SetPersonalItem(string)

暗殺者のパーソナルアイテムの認識タグを格納します。

void SetPersonalItem(
    string sTag
);

Parameters

sTag

Description

パーソナルアイテムの認識タグを表すNPC暗殺者のローカル変数に、sTagを格納します。

PCが暗殺者によって殺されていることを証明するために、検索アイテムの作成やPCの能力を踏まえて検索を行います。

Requirements

#include "nw_j_assassin"

Version

1.22

See Also

functions: | CreatePersonalItemOn | GetPersonalItem | GivePlayerPersonalItem | PlayerHasPersonalItem
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetPlaceableIllumination

Home > Reference > Functions > Lighting Effects > SetPlaceableIllumination

SetPlaceableIllumination(object, int)

配置可能な照明のオン、オフを設定します。

void SetPlaceableIllumination(
    object oPlaceable = OBJECT_SELF,
    int bIlluminate = TRUE
);

Parameters

oPlaceable

オン、オフの対象となる照明オブジェクト(デフォルト: OBJECT_SELF)

bIlluminate

TRUEであれば、oPlaceableの照明はオンに変えられます。FALSEであれば、、oPlaceableの照明はオフに変えられます。(デフォルト: TRUE)

Description

照明オブジェクトoPlaceableの状態を設定します。

Remarks

プレイヤーに対して視覚的にこの変化を見せるために、この関数を呼び出した後にRecomputeStaticLighting()を呼び出す必要があります。SetPlaceableIllumination()は照明変化を一時的に蓄え、いったんRecomputeStaticLighting()が呼ばれたら、その時に変化はプレーヤーに発せられます。従って、まずあなたが設定したい全ての照明に対してSetPlaceableIllumination()を呼び出し、全ての配置照明を設定した後でRecomputeStaticLighting()を一度呼び出す方法がベストです。

Version

1.22

See Also

functions: | GetPlaceableIllumination | RecomputeStaticLighting
categories: | Lighting Effects Functions

author: Tom Cassiotis, JP team: Redondo


Function - SetPLocalInt

Home > Reference > Functions > Local Variables, Module, Party > SetPLocalInt

SetPLocalInt(object, string, int)

PCパーティーに格納する変数を設定します。

void SetPLocalInt(
    object oPC,
    string sLocalName,
    int nValue
);

Parameters

oPC

パーティ内のPC

sLocalName

変数名

nValue

持たせる変数の値

Description

oPCが所属しているパーティーに属する全てのPCに対して、nValueの値を持ったsLocalNameというローカルの整数を設定します。

Remarks

PCのパーティ全体の整数を探査するマルチプレイヤーを便利にする方法です。aSetPLocalInt(object, string, int)と同じです。

Requirements

#include "nw_i0_plot"

Version

1.28

See Also

functions: | aGetPLocalInt | aSetPLocalInt | GetPLocalInt
categories: | Local Variables Functions | Module Functions | Party Functions

author: Charles Feduke, additional contributor(s): Tom Cassiotis, JP team: Rainie


Function - SetPlotFlag

Home > Reference > Functions > Miscellaneous > SetPlotFlag

SetPlotFlag(object, int)

objectをプロット状態に設定します。

void SetPlotFlag(
    object oTarget,
    int bPlotFlag
);

Parameters

oTarget

目標のobject

bPlotFlag

TRUEかFALSEの値

Description

bPlotFlagのブーリアン値（するか否かの値）でオブジェクトoTargetのプロットフラグを設定します。パラメーターbPlotFlagは、TRUEかFALSEどちらかで可能にします。

Remarks

このオブジェクトにTRUEの印を付けることは、殺されるか破壊されることをできなくするプロット・フラグを立てます;NPCやクリーチャーそしてobjectをプロットに関連させるために必要な関数です。

Version

1.22

Example

void main()
{
    // objectを殺されなくする
    SetPlotFlag(OBJECT_SELF, TRUE);
}

See Also

functions: | GetPlotFlag | SetImmortal
categories: | Miscellaneous Functions

author: Daniel Beckman, JP team: geshi, Rainie


Function - SetPlotGiver

Home > Reference > Functions > Module Specific > SetPlotGiver

SetPlotGiver(object)

暗殺者の犠牲者を格納します。

void SetPlotGiver(
    object oVictim
);

Parameters

oVictim

暗殺者のターゲットとなる犠牲者。

Description

グローバルオブジェクトのローカル変数に、暗殺者のターゲットを表すoVictimを格納します。

Remarks

GetPlotGiver()によってoVictimを検索することができます。

しかしながら、これらの関数は一般的なスクリプト作成においてはほとんど役に立ちません。

Requirements

#include "nw_j_assassin"

Version

1.22

See Also

functions: | GetPlotGiver | GetPlotJournal
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetPlotJournal

Home > Reference > Functions > Module Specific > SetPlotJournal

SetPlotJournal(string)

公式キャンペーンの救出ミッション中において、現在のプロットの状態を設定します。

void SetPlotJournal(
    string sTag
);

Parameters

sTag

Description

この関数はグローバルオブジェクトを使用して、公式キャンペーンの救出ミッションにおける現在の状態を決定するために、ローカル変数NW_J_RESCUE_JOURNALを設定します。

Remarks

nw_j_rescue.nssの42行目にあります。

Requirements

#include "nw_j_rescue"

Version

1.29

See Also

functions: | GetPlotJournal
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetPlotRing

Home > Reference > Functions > Module Specific > SetPlotRing

SetPlotRing(string)

プロットリングを表すタグを保管します。

void SetPlotRing(
    string sTag
);

Parameters

sTag

プロットリングのタグ。

Description

後にGetPlotRingTag()関数によって検索可能なプロットリングを表すsTagをローカル変数に保管します。

Remarks

この関数は一般的なスクリプト作成においてはほとんど役に立ちません。

Requirements

#include "nw_j_rescue"

Version

1.22

See Also

functions: | GetPlotRingTag
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetPlotTag

Home > Reference > Functions > Module Specific > SetPlotTag

SetPlotTag(string)

公式キャンペーンにおけるアーティファクト・プロット・ラインに使われるアイテム名を指定します。

void SetPlotTag(
    string sTag
);

Parameters

sTag

アイテム名。

Description

アーティファクト・プロットで検索されているアイテムのタグであるローカル変数(NW_J_ARTIFACT_PLOT_TAG)を設定します。

Remarks

nw_j_artifact.nssの65行目に書かれています。

この関数はBioware社のクエスト報酬システムの一部です。

システムをかなり詳細なところまで理解している人以外にとっては、ほとんど役に立たないでしょう。

Requirements

#include "nw_j_artifact"

Version

1.29

See Also

functions: | Global | TakeArtifactItem | TakeComplexItem | TakeStoryItem
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetPlotToken

Home > Reference > Functions > Module Specific > SetPlotToken

SetPlotToken(int)

プロット・トークンを値に保管します。

void SetPlotToken(
    int nID
);

Parameters

nID

プロット・トークンの値。

Description

後にGetPlotToken()関数を使用して検索するために、nIDをローカル変数に保管します。

Requirements

#include "nw_j_assassin"

Version

1.22

See Also

functions: | GetPlotToken
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetPrisoner

Home > Reference > Functions > Module Specific > SetPrisoner

SetPrisoner(object)

ローカル変数に囚人オブジェクトを保管します。

void SetPrisoner(
    object oPrisoner
);

Parameters

oPrisoner

囚人を表すオブジェクト。

Description

後にGetPrisoner()関数で値を取り出すせるように、ローカル変数にoPrisonerを保管します。

Remarks

この関数は一般的なスクリプト作成においてはほとんど役に立ちません。

Requirements

#include "nw_j_rescue"

Version

1.22

See Also

functions: | GetPrisoner
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetRingGivenTo

Home > Reference > Functions > Module Specific > SetRingGivenTo

SetRingGivenTo(object)

リングを与えられたPCを保管します。

void SetRingGivenTo(
    object oPC
);

Parameters

oPC

Description

誰にリングが与えられたかを表すために、ローカル変数にoPCを保管します。

Remarks

この関数は一般的なスクリプト作成においてはほとんど役に立ちません。

Requirements

#include "nw_j_rescue"

Version

1.22

See Also

functions: | GetRingGivenTo | GiveRingToPlayer | PlayerHasRing
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - SetSpawnInCondition

Home > Reference > Functions > Core AI > SetSpawnInCondition

SetSpawnInCondition(int, int)

BioWareによって提供されているデフォルトAIスクリプトに影響を与えるカスタムフラグを設定します。

void SetSpawnInCondition(
    int nCondition,
    int bValid = TRUE
);

Parameters

nCondition

NW_FLAG_*

bValid

指定された状態をTRUE または FALSE(オン/オフ)に切り替えます。(デフォルト: TRUE)

Description

nConditionによって指定された発生フラグ(NW_FLAG_*)をbValidに設定します。

NW_FLAG_*の詳細なフラグリストとそれらがクリーチャーのAIに与える影響を確認して下さい。

Remarks

この関数はbit arithmaticを使用し、値はこの関数を呼び出したクリーチャー(OBJECT_SELF)に対するローカル整数として保管されます。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

functions: | GetSpawnInCondition | PlayImmobileAmbientAnimations
categories: | Core AI Functions
constants: | NW_FLAG_* Constants

author: Charles Feduke, editor: Tom Cassiotis, JP team: katsu794


Function - SetSpawnInLocals

Home > Reference > Functions > Module Specific > SetSpawnInLocals

SetSpawnInLocals(int)

SetSpawnInCondition関数を補助するために、クリーチャー上にローカル変数を設定します。

void SetSpawnInLocals(
    int nCondition
);

Parameters

nCondition

NW_FLAG_*

Description

条件(NW_FLAG_*)動作おけるクリーチャーの生成を行うためのBioWare社のコアAI補助関数です。

Remarks

この関数の呼び出しを必要とするべきではありません。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

categories: | Module Specific Functions
constants: | NW_FLAG_* Constants

author: Tom Cassiotis, JP team: katsu794


Function - SetStandardFactionReputation

Home > Reference > Functions > Reputation/Faction > SetStandardFactionReputation

SetStandardFactionReputation(int, int, object)

クリーチャーのファクション値を設定します（与えられた標準ファクショングループ内について）。

void SetStandardFactionReputation(
    int nStandardFaction,
    int nNewReputation,
    object oCreature = OBJECT_SELF
);

Parameters

nStandardFaction

STANDARD_FACTION_*

nNewReputation

新しいファクション値。必ず0から100の間の値です。

oCreature

ファクション値を設定するターゲットクリーチャー(デフォルト: OBJECT_SELF)

Description

nStandardFactionで表される標準ファクション内のoCreatureのファクション値をnNewReputationによって示される新しいファクション値に設定します。パラメータnNewReputationは0から100の間である必要があります。

Version

1.22

See Also

functions: | ClearAllFactionMembers | ClearPersonalReputation | GetStandardFactionReputation
categories: | Reputation/Faction Functions
constants: | STANDARD_FACTION_* Constants

author: Daniel Beckman, JP team: Redondo


Function - SetStoryItem

Home > Reference > Functions > Module Specific > SetStoryItem

SetStoryItem(string)

公式キャンペーンで使用されるアイテム名を保管します。

void SetStoryItem(
    string sTag
);

Parameters

sTag

保管するアイテム名。

Description

ローカル変数(NW_J_STORY_ITEM)にアイテムのタグを保管します。

Remarks

nw_j_story.nssの97行目にあります。

この関数はBioware社のクエスト報酬システムの一部です。

システムのかなり詳細な部分まで記憶していない人にとっては、ほとんど立ちません。

Requirements

#include "nw_j_story"

Version

1.29

See Also

functions: | GetStoryItem | Global | TakeComplexItem | TakeStoryItem
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetStoryVar

Home > Reference > Functions > Module Specific > SetStoryVar

SetStoryVar(int, int, object)

公式キャンペーンにおいて、PCの効果があるヘンチマンの現在のストーリーラインを記録します。

void SetStoryVar(
    int nChapter,
    int nVal,
    object oTarget = OBJECT_SELF
);

Parameters

nChapter

公式モジュールの現在の章。

nVal

ヘンチマンのストーリーラインにおいて、現在PCが到達している場所。

oTarget

ヘンチマン。(デフォルト:OBJECT_SELF)

Description

この関数は、公式モジュールのストーリーライン中ののPCの行動を通して、ヘンチマンが持つかもしれない特定のストーリーの状態を記録します。

この関数は、(NW_L_HENSTORYC)で始まり、ゲーム中の現在の章で加えられるローカル変数に、ヘンチマンのストーリーの現在の状態を記入します。

Remarks

このスクリプトは、nw_i0_henchman.nssの152行目にあります。

この関数はBioware社のクエスト報酬システムの一部です。

システムをかなり詳細なところまで理解している人以外にとっては、ほとんど役に立たないでしょう。

Requirements

#include "nw_i0_henchman"

Version

1.29

See Also

categories: Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetSubRace

Home > Reference > Functions > Miscellaneous > SetSubRace

SetSubRace(object, string)

クリーチャーまたはPCのサブ種族を、設定または変更します。

void SetSubRace(
    object oCreature,
    string sSubRace
);

Parameters

oCreature

サブ種族を設定するクリーチャー。

sSubRace

設定するサブ種族名。

Description

oCreatureのサブ種族名をsSubRaceに設定します。

Remarks

サブ種族を属することができるクリーチャー以外の場合はどうなるか不明です。

Version

1.31

See Also

functions: | GetSubRace
categories: | Miscellaneous Functions

author: Lilac Soul, JP team: katsu794


Function - SetSummonEffect

Home > Reference > Functions > Core AI, Henchmen/Familiars/Summoned, Private Functions, Visual Effects > SetSummonEffect

SetSummonEffect(int)

呪文詠唱に基づいてスペシャル視覚エフェクトと指定のクリーチャーを定めます。

effect SetSummonEffect(
    int nSpellID
);

Parameters

nSpellID

Description

サモン・クリーチャー・シリーズのスクリプト
NW_S0_Summon

サモンモンスター呪文レベルに基づいて、スペシャルエフェクトと何のクリーチャーが召喚されるかを定めます。

Remarks

Script: nw_s0_summon.nss: Line: 16

これはincludeファイルではないので通常の方法ではincludeできません。

このスクリプトは動物の領域を持ったクレリックやそれを持たないほかの詠唱者の間に特別な違い与えます（動物の領域の例、クリーチャーは呪文レベルごとに一つ高いレベルとなります）。

これはサモンクリーチャーエフェクトを返します。nSpellIDや詠唱者がFEAT_ANIMAL_DOMAIN_POWERの特技を持っているかどうかに基づいて、召喚されるクリーチャーのresrefやディスプレイされるエフェクトを定めます。それらはEffectSummonCreature(sSummon, nFNF_Effect)のようなもので、ここではsSummonがクリーチャーのresref、nFNF_Effectがディスプレイされるエフェクトです。

spells.2daファイルの中を見ると、あなたはこのスクリプトが９つのサモンクリーチャー呪文全てによって呼び出されるのが分かるでしょう。メインの関数が詠唱される全ての呪文のIDを調べ、それをこの関数へ与えており、それゆえ、この関数は召喚クリーチャーがどれかということを調べる目的に関して９つのサモン呪文を識別しています。

もしあながたサモン呪文を編集したいのであれば、nw_s0_summonXと呼ばれる（ここではXはサモンクリーチャー呪文の識別子ですが）個々のスクリプトではなく、このスクリプトということになるでしょう。私の分かる範囲で言えることですが、nw_s0_summon1-9スクリプトは実際には使われていないようです。

Requirements

#include "nw_s0_summon"

Version

1.29

See Also

functions: | EffectSummonCreature
categories: | Core AI Functions | Henchmen/Familiars/Summoned Functions | Private Functions Functions | Visual Effects Functions

author: Jody Fletcher, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Redondo


Function - SetSummonHelpIfAttacked

Home > Reference > Functions > Core AI > SetSummonHelpIfAttacked

SetSummonHelpIfAttacked()

攻撃されているNPCを助けるエンカウントを作成します。

void SetSummonHelpIfAttacked();

Description

この関数は、攻撃されているNPCのために闘うガードを発生させるために、エンカウントと並んで機能します。

Remarks

この関数は、発生フラグNW_FLAG_SET_WARNINGSがTRUEに設定されてる場合に、BioWareのコアAIスクリプトによって呼び出されます。

エンカウント・タグが"ENC_" + NPCのTAGに設定されていることを確認して下さい。

Known Bugs

この関数に対するコメント:
// 現在、現時点のエンカウント・トリガーの実装とともには動作しません。

この関数はエンカウントをアクティブにします。

この関数は作られた当初、実際にエンカウント内にクリーチャーを発生させるために、SetEncounterActive関数を使用するつもりであったと考えられます。それは、本来のSetEncounterActive関数の機能のさせ方ではありません。

しかしながら、この関数はデフォルトのOnPhysicalAttackedスクリプト内から呼ばれ、この関数が呼ばれた後にエンカウントはアクティブになるでしょう。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

categories: Core AI Functions

author: Tom Cassiotis, editor: Lilac Soul, JP team: katsu794


Function - SetTileMainLightColor

Home > Reference > Functions > Lighting Effects > SetTileMainLightColor

SetTileMainLightColor(location, int, int)

タイルの主照明の色を設定します。

void SetTileMainLightColor(
    location lTileLocation,
    int nMainLight1Color,
    int nMainLight2Color
);

Parameters

lTileLocation

タイルの位置を指定します。

nMainLight1Color

TILE_MAIN_LIGHT_COLOR_*

nMainLight2Color

TILE_MAIN_LIGHT_COLOR_*

Description

lTileLocationにあるタイルの主照明の色を設定します。

Remarks

プレイヤーに対して視覚的に変化を見せるために、この関数を呼び出した後でRecomputeStaticLighting()を呼び出す必要があります。

Version

1.22

See Also

categories: | Lighting Effects Functions
constants: | TILE_MAIN_LIGHT_COLOR_* Constants

author: Tom Cassiotis, JP team: Redondo


Function - SetTileSourceLightColor

Home > Reference > Functions > Lighting Effects > SetTileSourceLightColor

SetTileSourceLightColor(location, int, int)

タイルの光源の色を設定します。

void SetTileSourceLightColor(
    location lTileLocation,
    int nSourceLight1Color,
    int nSourceLight2Color
);

Parameters

lTileLocation

タイルの位置を指定します。

nSourceLight1Color

TILE_SOURCE_LIGHT_COLOR_*

nSourceLight2Color

TILE_SOURCE_LIGHT_COLOR_*

Description

lTileLocationにあるタイルの光源の色を設定します。

Remarks

プレイヤーに対して視覚的に変化を見せるために、この関数を呼び出した後でRecomputeStaticLighting()を呼び出す必要があります。

Version

1.25

See Also

categories: Lighting Effects Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: Redondo


Function - SetTime

Home > Reference > Functions > Time > SetTime

SetTime(int, int, int, int)

現在のゲーム時間を設定します。

void SetTime(
    int nHour,
    int nMinute,
    int nSecond,
    int nMillisecond
);

Parameters

nHour

0から23までの新規の時間（Hour）の値

nMinute

0から1までの新規の分（Minute）の値（またはモジュールのプロパティで1時間に相当する分を変えている場合は、0からもっと高い数値になります）

nSecond

0から59までの新規の秒の値

nMillisecond

0から999までの新規のミリ秒の値

Description

時間は先に勧めることしかできません； 前に戻ろうとすると、翌日の指定された時間になります。たとえば、今15時のところを3時にセットしようとします。この場合、翌日（つまり日が1増えます）の3時にセットされます。

ゲーム内の時間を指定した時間に設定します。時間は先に進める事だけできます；時間を遡って設定した場合は日付が進み、指定した時間に設定されます。例えば、現在の時間が15時の時に、3時と設定した場合は、1日進み、3時に設定されるでしょう。時、分、秒、ミリ秒を最大値を超えた値にした場合、上の単位を進めます。例えば、62時250分10秒10ミリ秒は暦の日付を2日進め、時間は14時10分10秒10ミリ秒にするでしょう。

Version

1.30

See Also

functions: | GetTimeHour | GetTimeMillisecond | GetTimeMinute | GetTimeSecond | HoursToSeconds | SetCalendar
categories: | Time Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Jon Dewey, Lilac Soul, JP team: geshi, Rainie


Function - SetTrapDetectedBy

Home > Reference > Functions > Traps > SetTrapDetectedBy

SetTrapDetectedBy(object, object)

クリーチャーに罠を発見させます。

int SetTrapDetectedBy(
    object oTrap,
    object oDetector
);

Parameters

oTrap

配置可能オブジェクト、ドアやトリガー。

oDetector

クリーチャー

Description

oDetectorにoTrapを発見させます。

Remarks

この関数はキャラクターに罠を発見させたい場合に利用できます。

Version

1.22

Example

// onUsedイベント状態のオブジェクトに使用します。
// タグが"Chest1"であるオブジェクト上の罠をユーザに発見させます。
void main()
{
    object oTrap = GetObjectByTag("Chest1");
    object oDetector = GetLastUsedBy();
    SetTrapDetectedBy(oTrap, oDetector);
}

See Also

functions: | GetLastTrapDetected | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDetectedBy | GetTrapDisarmable | GetTrapDisarmDC | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot
categories: | Traps Functions

author: Chaz Mead, JP team: katsu794


Function - SetTrapDisabled

Home > Reference > Functions > Traps > SetTrapDisabled

SetTrapDisabled(object)

オブジェクト上の罠を解除します。

void SetTrapDisabled(
    object oTrap
);

Parameters

oTrap

配置可能オブジェクト、ドアやトリガー。

Description

oTrapを解除します。

Remarks

この関数を利用して、レバーを引くことで罠を解除するといったメカニズムを作成することができます。

Version

1.22

Example

// タグが"Chest1"であるオブジェクト上の罠を解除します。
void main()
{
    object oTrap = GetObjectByTag("Chest1");
    SetTrapDisabled(oTrap);
}

See Also

functions: | GetLastTrapDetected | GetTrapBaseType | GetTrapCreator | GetTrapDetectable | GetTrapDetectDC | GetTrapDisarmable | GetTrapFlagged | GetTrapKeyTag | GetTrapOneShot
categories: | Traps Functions

author: Chaz Mead, editor: Jochem van 't Hull, JP team: katsu794


Function - SetUniform

Home > Reference > Functions > Module Specific > SetUniform

SetUniform(string)

公式キャンペーンの中でのプレイヤーの服の名前を指定します。

void SetUniform(
    string sTag
);

Parameters

sTag

防具の認識タグ。

Description

プレイヤーが公式キャンペーンにおいて、防具プロットを保持し続けるために使用しなければならない服のタグを保存します。

Remarks

このスクリプトは、nw_j_guard.nssの97行目にあります。

この関数はBioware社のクエスト報酬システムの一部です。

システムをかなり詳細なところまで理解している人以外にとっては、ほとんど役に立たないでしょう。

Requirements

#include "nw_j_guard"

Version

1.29

See Also

functions: | GetUniform | PlayerWearsUniform
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetValidItem

Home > Reference > Functions > Module Specific > SetValidItem

SetValidItem(int)

公式キャンペーン中の鍛冶屋プロットのために存在する有効なアイテムが、PCのインベントリーのどの位置にあるかを指定します。

void SetValidItem(
    int nPos
);

Parameters

nPos

有効なアイテムのインベントリーにおける位置。

Description

GetCombo関数がPCが適切なアイテムを持っていることを決定した後、この関数は、インベントリー内のそれぞれの位置を走査することによって、アイテムの位置を決定します。

インベントリーにおける位置が確認されると、ローカル変数(M3Q1_VALIDITEM)にnPosが保管されます。

Remarks

このスクリプトは、nw_o0_itemmaker.nssの241行目にあります。

この関数はBioware社のクエスト報酬システムの一部です。

システムをかなり詳細なところまで理解している人以外にとっては、ほとんど役に立たないでしょう。

Requirements

#include "nw_o0_itemmaker"

Version

1.29

See Also

functions: | GetValidItem | GetValidItemCost | SetValidItemCost | SetValidItemCostToken
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetValidItemCost

Home > Reference > Functions > Module Specific > SetValidItemCost

SetValidItemCost(int)

公式キャンペーンの鍛冶屋プロット中で、結合されたアイテムの価値を示すゴールドの量を指定します。

void SetValidItemCost(
    int nPos
);

Parameters

nPos

ゴールドの量。

Description

OBJECT_SELFのローカル文字列配列をクロスリファレンスすることによって、ゴールドの量を決定します。

ローカル変数(NW_COMBO_REWARD_GOLD)にゴールドの量を設定します。

Remarks

このスクリプトは、nw_o0_itemmaker.nssの245行目にあります。

この関数はBioware社のクエスト報酬システムの一部です。

システムをかなり詳細なところまで理解している人以外にとっては、ほとんど役に立たないでしょう。

Requirements

#include "nw_o0_itemmaker"

Version

1.29

See Also

functions: | GetValidItem | GetValidItemCost | SetValidItem | SetValidItemCostToken
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetValidItemCostToken

Home > Reference > Functions > Module Specific > SetValidItemCostToken

SetValidItemCostToken(int)

公式キャンペーンの鍛冶屋プロット・ライン中で、魔法のアイテムを作成するために必要なゴールドの追加量を指定します。

void SetValidItemCostToken(
    int nPos
);

Parameters

nPos

ゴールドの追加量。

Description

魔法のアイテムを作成するための追加費用（鍛冶屋に支払われます）を表すローカル変数(NW_COMBO_REWARD_COST)に、カスタム・トークン777を設定します。

Remarks

このスクリプトは、nw_o0_itemmaker.nssの249行目にあります。

この関数はBioware社のクエスト報酬システムの一部です。

システムをかなり詳細なところまで理解している人以外にとっては、ほとんど役に立たないでしょう。

Requirements

#include "nw_o0_itemmaker"

Version

1.29

See Also

functions: | GetValidItem | GetValidItemCost | SetValidItem | SetValidItemCost
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetVictim

Home > Reference > Functions > Module Specific > SetVictim

SetVictim(object)

暗殺されるNPCの名前を指定します。

void SetVictim(
    object oVictim
);

Parameters

oVictim

暗殺される特定の犠牲者。

Description

ローカル変数(NW_J_ASSASSIN_VICTIM)に攻撃目標のオブジェクトを設定します。

Remarks

このスクリプトは、nw_j_assassin.nssの349行目にあります。

この関数はBioware社のクエスト報酬システムの一部です。

システムをかなり詳細なところまで理解している人以外にとっては、ほとんど役に立たないでしょう。

Requirements

#include "nw_j_assassin"

Version

1.29

See Also

functions: | GetVictim | VictimDead | VictimDeadButNoItems
categories: | Module Specific Functions

author: Jody Fletcher, JP team: katsu794


Function - SetWayPointTo1

Home > Reference > Functions > Core AI > SetWayPointTo1

SetWayPointTo1()

NPCに対し彼らの当初のウェイポイントに戻るように伝えます。

void SetWayPointTo1();

Description

この関数は、緊迫感のあるイベントに使用するために設計されています。

ウェイポイントの出発点がどこかを決定し、そこへ行き、他の向かわせるウェイポイントを捜します。

ウェイポイントの終わりに来ると、他の方向へ戻り始めます。

Remarks

このスクリプトは、nw_c3_waypoint1.nssの25行目にあります。

Requirements

#include "nw_c3_waypoint1"

Version

1.29

See Also

functions: | MakeWay | NextTag
categories: | Core AI Functions
events: | OnHeartbeat Event

author: Jody Fletcher, JP team: katsu794


Function - SetWeather

Home > Reference > Functions > Area, Visual Effects > SetWeather

SetWeather(object, int)

エリアもしくはモジュール全体の天候を設定します。

void SetWeather(
    object oTarget,
    int nWeather
);

Parameters

oTarget

これがGetModule()であれば、全ての屋外エリアは天候定数WEATHER_*によって修正されます。これがエリアであれば、oTargetが屋外である場合のみ天候を設定します。

nWeather

WEATHER_*

Description

oTargetに関する天候を設定します。

- WEATHER_USE_AREA_SETTINGSはエリアをランダム天候（エリアデフォルト）へ戻します。

- WEATHER_CLEAR、WEATHER_RAIN、WEATHER_SNOWは天候を適当な降水量へ＊止めることなく＊移行します。

Remarks

1.31パッチで、BioWareはGetWeather関数を準備しており、それは天候を操作することをとても簡単にします。1.31パッチを使っていないモジュールビルダー（慣れていない人）は手動でエリアの天候トラックを保つ必要があるでしょう。

Version

1.31

Example

// 雪天候にするスクリプト（モジュール全体）
void main()
{
    object oModule = GetModule();
    SetWeather(oModule, WEATHER_SNOW);
}

See Also

functions: | GetWeather | SetCalendar
categories: | Area Functions | Visual Effects Functions
constants: | WEATHER_* Constants

author: Chaz Mead, editor: Lilac Soul, additional contributor(s): Sean Fuller, Lilac Soul, JP team: Redondo


Function - SetWorkingForPlayer

Home > Reference > Functions > Henchmen/Familiars/Summoned, Local Variables > SetWorkingForPlayer

SetWorkingForPlayer(object)

ヘンチマン（仲間になるNPC）が属するPCを設定します。

void SetWorkingForPlayer(
    object oPC
);

Parameters

oPC

ヘンチマンを属させるプレイヤー

Description

（NW_L_HIRED＋ヘンチマンのtag）から10までのローカル変数を設定します。

Remarks

Script: nw_i0_henchman.nss: Line: 116

Requirements

#include "nw_i0_henchman"

Version

1.29

See Also

functions: | GetFormerMaster | GetWorkingForPlayer | SetFormerMaster
categories: | Henchmen/Familiars/Summoned Functions | Local Variables Functions

author: Jody Fletcher, JP team: Rainie


Function - SetXP

Home > Reference > Functions > Experience > SetXP

SetXP(object, int)

クリーチャーの経験値を特定の値に設定します。

void SetXP(
    object oCreature,
    int nXpAmount
);

Parameters

oCreature

対象のクリーチャー

nXpAmount

XPの量

Description

oCreatureの経験値をnXpAmountの値に設定します。

Remarks

GiveXPToCreature()関数は、XP修正のもっと自然な方法です。しかし、クリーチャーがどれだけXPを持つといいのかを正確に知っているならば、SetXP()がかなり有効でしょう。

この機能はXPにペナルティーを与える場合や、％によって修正する状況に特に役立つことができます。

Version

1.22

Example

// PCをOnEnter時にLv2にする
void main()
{
    int iXP;
    object oCreature = GetEnteringObject();
    iXP = GetXP(oCreature);
    if (iXP < 1000)
    {
        SetXP(oCreature, 1000);
    }
}

See Also

functions: | GetXP | GiveXPToCreature
categories: | Experience Functions

author: Chaz Mead, editor: Ryan Hunt, JP team: Rainie


Function - ShadowBolt

Home > Reference > Functions > Spell Casting Effects, Spells, Talents/Skills/Feats, Visual Effects > ShadowBolt

ShadowBolt(object, int)

ダメージを持った稲妻をNPCに向かって詠唱するために、グレーターシャドーコンジュレーション呪文と一緒に使われます。

void ShadowBolt(
    object oTarget,
    int nMetaMagic
);

Parameters

oTarget

シャドーボルトを詠唱するターゲット

nMetaMagic

稲妻の強化する特技

Description

ターゲットoTargetとメタマジック情報nMetaMagicを必要とします。（呪文威力最大化や呪文威力強化などの）強化メタマジックである場合、ダメージ量（3d6）を調べます。（ハーフダメージのために）反応セーブを調べます。

視覚FXとダメージFXを作りoTargetに与えます。

Remarks

Script: nw_s0_grshconj.nss: Line: 17

Requirements

#include "nw_s0_grshconj"

Version

1.29

See Also

categories: | Spell Casting Effects Functions | Spells Functions | Talents/Skills/Feats Functions | Visual Effects Functions
events: | OnSpellCastAt Event

author: Jody Fletcher, JP team: Redondo


Function - ShoutDisturbed

Home > Reference > Functions > Action on Object, Reputation/Faction, Targeting > ShoutDisturbed

ShoutDisturbed()

コンテナ（入れ物）を破壊もしくは開けたPCに対して、コンテナファクションのNPCを敵対にします。

void ShoutDisturbed();

Description

コンテナが破壊されたか、もしくはただ開けられただけかどうかのチェックをします。その違いはPCを認識する方法だけです(LastAttacker / LastOpener)。

この関数は球体形状範囲のすべてのコンテナファクションのクリーチャーへ“shout”を送ります。それは範囲内のファクションメンバーを一時的にPCに対して敵対とします。

Remarks

Script: nw_o2_coninclude.nss: Line: 4484

Requirements

#include "nw_o2_coninclude"

Version

1.29

See Also

categories: | Action on Object Functions | Reputation/Faction Functions | Targeting Functions
events: | OnDeath Event | OnDisturbed Event | OnOpen Event

author: Jody Fletcher, JP team: Redondo


Function - SignalEvent

Home > Reference > Functions > Miscellaneous > SignalEvent

SignalEvent(object, event)

objectに指定したイベントを発動させます。

void SignalEvent(
    object oObject,
    event evToRun
);

Parameters

oObject

イベントを発動させるobject

evToRun

objectに発動させるイベント。イベント関数のうちの1つを使用して構築されるに違いありません。

Description

oObjectにevToRunを発動させます。オブジェクトが他のオブジェクト中のイベントを発動することを可能にします。実行することができるイベントは、オブジェクトのスクリプトでユーザに定義されたイベントと同様にBiowareによって提供されるデフォルトのイベントも含んでいます。イベントパラメーターevToRunは、多くのイベント関数のうちの1つによって作成された実際のイベントであるに違いありません。

Version

1.28

See Also

functions: | EventActivateItem | EventConversation | EventUserDefined
categories: | Miscellaneous Functions

author: John Shuell, editor: Charles Feduke, additional contributor(s): Darrell Knapp, JP team: Rainie


Function - sin

Home > Reference > Functions > Math > sin

sin(float)

サイン計算し結果を返す。

float sin(
    float fValue
);

Parameters

fValue

サイン計算させたい浮動小数値（ラジアン表記ではなく度）

Description

サインを計算し値を返す。

返す値は-1.0 から 1.0

この関数と同様 ”SeeAlso” にある数学関連関数は、オブジェクト間の角度や距離を計算するのに使う。

Remarks

斜辺÷高さ（正弧）

Version

1.31

Example

// 浮動小数値のサインを計算する

void main()
{
     float fAngleToObject;
     fAngleToObject == sin(5.0);  // fAngleToObjectの値は0.5になる。
}

See Also

functions: | acos | asin | atan | cos | tan
categories: | Math Functions

author: Charles Feduke, editor: Bill Castello, additional contributor(s): Bill Castello, JP team: geshi, ngtaicho


Function - SoundObjectPlay

Home > Reference > Functions > Sound Effects > SoundObjectPlay

SoundObjectPlay(object)

サウンドオブジェクトを再生します。

void SoundObjectPlay(
    object oSound
);

Parameters

oSound

再生するサウンドオブジェクト

Description

モジュール内に作られ、置かれたサウンドオブジェクトを再生します。

Remarks

PlaySound()とSoundObjectPlay()の機能は異なります。SoundObjectPlay()は沢山の音源から成るサウンドオブジェクトを再生します。対して、PlaySound()はひとつの音源を再生します。サウンドオブジェクトには位置や繰り返しといったプロパティを加えることができます。 それゆえ、SoundObjectPlay()はOnEnterイベントに関連させたりしてエリアの雑音をコントロールするには有効かもしれません。

Note: オブジェクトのサウンドリストはデフォルトでランダムで再生するように設定されます。そこで、もしあなたが再生したい幾つかのサウンドリストを持っているならば、サウンドオブジェクトのプロパティのアドバンストタブへ進み、再生順序を変更するとよいでしょう。

もし同時に再生したいのであれば、複数のサウンドオブジェクトを作る必要があります。

Version

1.22

Example

// 一般トリガのOnEnterイベントへセット
// サウンドウィザードで作られ、多くの酒場の音から成るサウンドオブジェクトを再生します

void main()
{

    object oSound = GetObjectByTag("TavernGroup");

    SoundObjectPlay(oSound);

}

See Also

functions: | AmbientSoundChangeDay | PlaySound | SoundObjectSetVolume | SoundObjectStop
categories: | Sound Effects Functions

author: Kristian Markon, editor: Maximus, JP team: Redondo


Function - SoundObjectSetPosition

Home > Reference > Functions > Action on Object, Sound Effects, Spell Casting Effects > SoundObjectSetPosition

SoundObjectSetPosition(object, vector)

プレイヤーに対してサウンドオブジェクトの位置を設定します。

void SoundObjectSetPosition(
    object oSound,
    vector vPosition
);

Parameters

oSound

設定されるサウンド

vPosition

サウンドの起源となるベクトル

Description

モジュール内に置かれたサウンドオブジェクトの位置を変更します。例えば、プレイヤーが箱を開けたとき、うめき声サウンドがプレイヤーに置かれるなど。

Remarks

ゲーム内で環境音を使うユーザにとっては、大変効果的です。

Version

1.22

Example

// assumes CryptMoans Sound is placed nearby
// this script placed in the OnDisturbed section of the chest
//
//  puts the sound of moaning crypt noises right on the person
//  that disturbs the contents of the chest -  sccccaaaarrrrryyyy

void main()
{
     vector vPlayer = GetPosition(GetLastDisturbed());
     // location in vector format
     object mySound = GetObjectByTag("CryptMoans");
     SoundObjectSetPosition(mySound, vPlayer);
}

See Also

functions: | SoundObjectSetVolume
categories: | Action on Object Functions | Sound Effects Functions | Spell Casting Effects Functions

author: Bill Castello, editor: Jeremy Spilinek, JP team: Redondo


Function - SoundObjectSetVolume

Home > Reference > Functions > Action on Object, Sound Effects > SoundObjectSetVolume

SoundObjectSetVolume(object, int)

配置サウンドオブジェクトの音量を設定します。雰囲気作りに効果を発揮します。

void SoundObjectSetVolume(
    object oSound,
    int nVolume
);

Parameters

oSound

音量を設定したいサウンドオブジェクト

nVolume

0から127の間の整数

Description

モジュール内に配置された任意のサウンドオブジェクト音量を設定します。nVolumeの値は0から127の間の数値です（0はサウンドオブジェクトをオフにします）。

Remarks

この関数は雰囲気を作るのに役立ちます。ひとつの使用法としては、まず音量（距離20-30）をとても小さくしておき、プレイヤーがサウンドオブジェクトに近づいたときに音量を最大にするというものです。

Version

1.22

Example

//地下のうめき声サウンドを音量を小さく（もしくはオフに）して配置します
//               -遺体を配置オブジェクトメニューから配置します
//                 （必要であればタグをCorpse1のようにしておきます）
//               -このスクリプトは遺体のスクリプトのOnDisturbedにセットします。
//
// ダンジョンでプレイヤーが遺体を荒らしたときに遺体がうめきを喋る例。

void main()
{
//get the SoundObject tag
object mySound = GetObjectByTag("CryptMoans");

     //Natter at the player for looting the poor corpse
     ActionSpeakString("Why do you disturb my rest...",TALKVOLUME_TALK);

     //Turn moaning to Maximum, make the player jump :)
     SoundObjectSetVolume(mySound, 127);
}

See Also

functions: | SoundObjectPlay | SoundObjectSetPosition | SoundObjectStop
categories: | Action on Object Functions | Sound Effects Functions

author: Bill Castello, editor: Jeremy Spilinek, JP team: Redondo


Function - SoundObjectStop

Home > Reference > Functions > Sound Effects > SoundObjectStop

SoundObjectStop(object)

再生中のサウンドをストップします。

void SoundObjectStop(
    object oSound
);

Parameters

oSound

Description

SoundObjectPlay()によって再生されていたoSoundは停止されます。

Version

1.22

See Also

functions: | SoundObjectPlay | SoundObjectSetVolume
categories: | Sound Effects Functions

author: Tom Cassiotis, JP team: Redondo


Function - SpawnHenchman

Home > Reference > Functions > Henchmen/Familiars/Summoned > SpawnHenchman

SpawnHenchman()

PCに対して、公式キャンペーンのそれぞれの章におけるレベルに適切なヘンチマンを作成します。

void SpawnHenchman();

Description

PCがいる章に対する適切なヘンチマンのレベルを決定します。

それぞれのヘンチマンを、(NW_HENCHMAN_BAR)における指定のスポットに生成します。

チャプター1E、チャプター2E、チャプター4のそれぞれの章において、レベル3、レベル7、レベル10でヘンチマンをスタートさせることで、ヘンチマンの適切なレベルを保証します。

Remarks

nw_i0_henchman.nssの592行目にあります。

Requirements

#include "NW_I0_HENCHMAN"

Version

1.29

See Also

categories: | Henchmen/Familiars/Summoned Functions
events: | OnClientEnter Event

author: Jody Fletcher, JP team: katsu794


Function - SpawnScriptDebugger

Home > Reference > Functions > Debug > SpawnScriptDebugger

SpawnScriptDebugger()

実行しているスクリプトのデバッギングのために、スクリプトデバッガーを起動します。

void SpawnScriptDebugger();

Description

この関数が呼び出されると、スクリプトデバッガーが実行されます。

スクリプトがデバッギング情報と一緒にコンパイルされていない場合、この関数は何も行いません。

この関数を実行させるためには、デバッグ情報と一緒にスクリプトをコンパイルする必要があります。

これを行うためには、ツールセットのツールメニューを開いてオプションを選択し、それからスクリプトエディタを選びます。そして、"スクリプトをコンパイルする時にデバッグ情報を作成する"をチェックします。

SpawnScriptDebugger関数を使用したいスクリプトは、先のオプションがチェックされた後にコンパイルしなければなりません。そうでなければ、それらのスクリプトを手作業で再コンパイルするか、それ用のモジュールを作成するかです。

Remarks

デバッガーによって多くのことが可能になります。スクリプトにおける変数の変化をステップ毎に記録したり、スクリプトで使用されているそれぞれのオブジェクトのオブジェクトidを見ることもできます。

descriptionに詳述している事は別にして、この関数をゲーム内で試す時に効果を得るためには、まだ必要な事があります。

NWNがインストールされているディレクトリ内のutilsフォルダに移動し、DebugServerという名前のプログラムを実行して下さい。

画面下部のタスクバーにプログラムが追加されること以外には何も起きないでしょう。

Neverwinter Nightsをウィンドウモードで起動していることを確認して下さい。

そのためには、インストールされているディレクトリ内にあるnwn.iniファイル中に以下の２行が記述されている必要があります。

FullScreen=0

AllowWindowedMode=1

また、デスクトップの解像度がNWNの解像度より高いことも確認しなければなりません。

例えば、デスクトップの解像度を1024X768に設定し、NWNの解像度を800X600に設定します。

何が起こっているかを道筋に沿って見ることができるサンプルスクリプトを以下に作成しました。

基本的には、それぞれのオブジェクトのオブジェクトidの確認や、変数に割り当てられている値の記録などができます。

このサンプルスクリプトは、スクリプト内で何が起こっているかをステップ毎に確認することができる貴重なスクリプトです。

SpawnScriptDebugger関数を使用しないときには、スクリプトから削除するかコメントアウトすることを確実に行って下さい。

その状態でスクリプトを実行し、かつDebugServerが起動していなければ、SpawnScriptDebugger関数によって数秒の間ゲームが遅くなるということもなくなるでしょう。

また、DebugServerが起動していて、デバッグのためのコンパイルがされていないスクリプト内にSpawnScriptDebugger関数がある場合、デバッグセッションが開始され、すぐに終了するでしょう。

デバッグメッセージスクリーンがフラッシュするのに気付くでしょうが、それがそうです。

終いには、デバッグスクリーンの情報を読みとることもできませんが、utilsフォルダー内で、デバッグ情報がまとめられたLOGという名前のテキストファイルを見つけることができるでしょう。

Version

1.30

Example

//このスクリプトを機能させるためには、上に書いた指示に従って下さい。
//上に詳述したように、デバッグ情報と一緒にコンパイルしなければなりません。

void main()
{
//デバッガーを起動します。
SpawnScriptDebugger();

//デバッガー内で、PC上のいくつかの情報が得られるでしょう。
object oPC=GetFirstPC();

SendMessageToPC(oPC, "Hello");

//デバッガー内で、sNameの値を見ることができるでしょう。
string sName=GetName(OBJECT_SELF);

SendMessageToPC(oPC, sName);

}

See Also

categories: Debug Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - SpeakOneLinerConversation

Home > Reference > Functions > Conversation > SpeakOneLinerConversation

SpeakOneLinerConversation(string, object)

１行のconversationを話させます

void SpeakOneLinerConversation(
    string sDialogResRef = "",
    object oTokenTarget = OBJECT_TYPE_INVALID
);

Parameters

sDialogResRef

(Default: "")

oTokenTarget

文字列に特定のクリーチャーのトークンがあるのならば指定しなければなりません

(デフォルト：OBJECT_TYPE_INVALID)

Description

実行objectの会話ダイアログに、選択肢のない会話行を即座に話させます。conversationに2番目以降のパーティはいないので、oTokenTargetは１行に含まれるトークンを設定する為に使用することができます。

Version

1.22

See Also

categories: | Conversation Functions
constants: | OBJECT_TYPE_* Constants

author: Jeff Lindsey, JP team: Rainie


Function - SpeakQuickChat

Home > Reference > Functions > Henchmen/Familiars/Summoned, String > SpeakQuickChat

SpeakQuickChat(string)

ヘンチマンの頭上にテキスト行を送ります。

void SpeakQuickChat(
    string sVoice
);

Parameters

sVoice

話させるテキスト

Description

この関数はOpenNearestLockの使用の際のデバッグでのみ使用します。関数はヘンチマンの頭上に"FAKEQUICKCHAT:Task, Can do"（「偽のクイックチャット:タスクは正常に動作しています」）と言わせます。

Remarks

nw_i0_assoc.nssの19行目で見つかります。

Requirements

#include "nw_i0_assoc"

Version

1.22

See Also

functions: | OpenNearestLock
categories: | Henchmen/Familiars/Summoned Functions | String Functions

author: Jody Fletcher, JP team: Rainie


Function - SpeakString

Home > Reference > Functions > Conversation > SpeakString

SpeakString(string, int)

onjectに会話を強制します

void SpeakString(
    string sStringToSpeak,
    int nTalkVolume = TALKVOLUME_TALK
);

Parameters

sStringToSpeak

会話させるテキストです

nTalkVolume

TALKVOLUME_* (デフォルト: TALKVOLUME_TALK)

Description

実行者は直接sStringToSpeakを話します

nTalkVolumeは文字列を会話する声の大きさを決定します

Remarks

実行者は一般トリガーにはなれません。それがそうである場合、何も起こりません。

もしトリガーでテキストを表示させたい場合は、（例えば、FloatingTextStringOnCreatureで）PCの頭上に、もしくはテキストを話すことができる静的ではない透明な配置物を作ってトリガーにテキストを表示させます。

この関数はアクションキューにアクションを追加するActionSpeakStringとは異なります。

Version

1.22

See Also

functions: | ActionSpeakString | ActionSpeakStringByStrRef | DebugSpeak | FloatingTextStringOnCreature
categories: | Conversation Functions
constants: | TALKVOLUME_* Constants

author: Charles Feduke, additional contributor(s): Drake Coker, JP team: Rainie


Function - SpeakStringByStrRef

Home > Reference > Functions > Conversation > SpeakStringByStrRef

SpeakStringByStrRef(int, int)

objectにStrRefから変換される文字列を即座に話させます。

void SpeakStringByStrRef(
    int nStrRef,
    int nTalkVolume = TALKVOLUME_TALK
);

Parameters

nStrRef

会話で参照するstringの参照番号（StrRef）

nTalkVolume

指定の文字列を話す際のボリューム（TALKVOLUME_*） (デフォルト: TALKVOLUME_TALK)

Description

objectにResrefから変換される文字列を即座に話させます。これはアクションではないので、直接起こり、objectが操作不能状態でも妨げられません。

Remarks

StrRefの値はNWNがインストールされているフォルダにあるdialog.tlkファイルで見つけることが出来ます。

Version

1.30

See Also

categories: | Conversation Functions
constants: | TALKVOLUME_* Constants

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - SpellDelay

Home > Reference > Functions > Spell Casting Effects, Spells > SpellDelay

SpellDelay(object, int)

円錐がターゲットに達するまでスペシャルFXやダメージFXを与える遅れを調べます。

float SpellDelay(
    object oTarget,
    int nShape
);

Parameters

oTarget

呪文のターゲット

nShape

使うことはない

Description

詠唱者のレベル、ターゲットとの距離、メタマジック、SRのような基本呪文情報を蓄積し、効果の遅れを与えるために20ずつターゲットと詠唱者の距離は分割されます。円錐内の全ての他のターゲットに対して繰り返します。

Remarks

Script: nw_s0_conecold.nss: Line: 19

Requirements

#include "nw_s0_conecold"

Version

1.29

See Also

categories: Spell Casting Effects Functions | Spells Functions

author: Jody Fletcher, JP team: Redondo


Function - sqrt

Home > Reference > Functions > Math > sqrt

sqrt(float)

平方根を求める

float sqrt(
    float fValue
);

Parameters

fValue

平方根を求めたい数値（浮動小数値）

Description

fValueの平方根を計算した結果を返す。

Remarks

fValueの値が0以下の場合は0を返す（仮想の数値をサポートしていない）。

Version

1.22

See Also

functions: | log | pow
categories: | Math Functions

author: Charles Feduke, JP team: ngtaicho


Function - StartAttackLoop

Home > Reference > Functions > Prototyped but Unused > StartAttackLoop

StartAttackLoop()

この関数は試作されたましたが、使用されていません。

talent StartAttackLoop();

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Version

1.22

See Also

categories: Prototyped but Unused Functions

author: Charles Feduke, JP team: katsu794


Function - StartingConditional

Home > Reference > Functions > Conversation > StartingConditional

StartingConditional()

これはカンバセーション･エディタ用のテンプレート関数です。

int StartingConditional();

Description

カンバセーション･エディタの「テキスト表示の条件」タブで、StartingConditional():intスクリプトを作成する為に、この関数は利用されます。

Remarks

書かれたスクリプトがコンパイルできない通り、これはテンプレートでのみ有効です。
nw_d2_racesnh.nss

Requirements

#include "nw_d2_racesnh.nss"

Version

1.22

See Also

categories: Conversation Functions

author: Michael Nork, JP team: Rainie


Function - StartNewModule

Home > Reference > Functions > Module > StartNewModule

StartNewModule(string)

存在するプレイヤーを新しいモジュールへ移動させます。

action StartNewModule(
    string sModuleName
);

Parameters

sModuleName

新しくスタートするモジュール名

Description

現在ロードしているモジュールをシャットダウンして新しいモジュールをスタートします（接続している全てのプレイヤーを新しいスタート地点へ移動させます）

Version

1.22

Example

void main()
{
    StartNewModule("module000");
}

See Also

categories: Module Functions

author: Tom Cassiotis, JP team: Redondo


Function - StartProtectionLoop

Home > Reference > Functions > Core AI Talent > StartProtectionLoop

StartProtectionLoop()

使用する保護特殊能力を見つけます。

talent StartProtectionLoop();

Description

スクリプトからこの関数を呼び出すクリーチャーのために有益な保護特殊能力を探す実用的な関数です。

Remarks

この関数は始めに、
TALENT_CATEGORY_BENEFICIAL_PROTECTION_SELF
に関して
GetCreatureTalentRandom関数を呼び出します。

それから、
TALENT_CATEGORY_BENEFICIAL_PROTECTION_SINGLE
に関して呼び出しを行い、

最後に
TALENT_CATEGORY_BENEFICIAL_PROTECTION_AREAEFFECT
に関して呼び出しを行います。

Requirements

#include "NW_I0_GENERIC"

Version

1.29

See Also

functions: | TalentAdvancedProtectSelf | TalentUseProtectionOnSelf | TalentUseProtectionOthers
categories: | Core AI Talent Functions

author: Tom Cassiotis, editor: Jody Fletcher, JP team: katsu794


Function - StopFade

Home > Reference > Functions > Cut-Scene > StopFade

StopFade(object)

現在フェードアウト中、または暗転中であれば、取り除きます。

void StopFade(
    object oCreature
);

Parameters

oCreature

暗転画面やフェードアウトエフェクトを取り除くクリーチャー

Description

プレイヤーが操作するoCreatureのモニターから暗転やフェードアウトエフェクトを取り除きます。

Remarks

プレイヤーの画面が現在フェードアウト中であれば、フェードをやめ、画面を通常（黒ではなく）へと戻します。画面が現在暗転中であれば、通常へと設定を戻します。共にこの効果は即座に起こります。暗転エフェクトをゆっくりと取り除きたければ、FadeFromBlack関数を使ってください。

Version

1.30

Example

// 箱を開けたクリーチャーの世界を真っ暗にし
// 10秒後だんだん明るくなり、その後
// 箱のOnOpenを発動する。

void main()
{
object oPC=GetLastOpenedBy();

BlackScreen(oPC);

DelayCommand(10.0, FadeFromBlack(oPC));

// 適用された暗い画面をさっさと取り除きたい場合は
// 代わりにこの行を使ってもいい。
DelayCommand(10.0, StopFade(oPC));
}

See Also

functions: | BlackScreen | FadeFromBlack | FadeToBlack
categories: | Cut-Scene Functions
events: | OnCutsceneAbort Event

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - StoreCameraFacing

Home > Reference > Functions > Miscellaneous, PC Only > StoreCameraFacing

StoreCameraFacing()

カメラの位置と向きを保存し、後で回復できるようにします。

void StoreCameraFacing();

Description

カメラの位置と向きを保存し、後でRestoreCameraFacingを使って回復できるようにします。

Remarks

StoreCameraFacingとRestoreCameraFacingは、カメラを扱いたいことに関するパラメータがないことに注意してください。だからPCに行わせたいカメラの動きを呼出すAssignCommandと共にこれらを呼出す必要があります。

RestoreCameraFacingは、StoreCameraFacing呼出によって収納されたカメラの向きとモードを「1度だけ」元に戻すことが出来ます。PCがカットシーン中でないときにRestoreCameraFacingを呼出します。それがバグか意図した動作なのかはわかりません。

SetCutsceneModeがTRUEに設定されれば、PCのカメラの向きは自動的に保存され、FALSEに設定されれば、カメラの向きは自動的に回復されるように思います。これは、あなたがカメラ・モードや向きの全ての材料の種類をカットシーンで、それについて後で心配する必要なしに行うことができることを意味します。しかしながら、あなたがcutsceneの中でPCを動かせば、回復されたカメラの向きはもはやよい角度などではないかもしれません。この場合、PCがカットシーンから出たとき、SetCameraFacingを常に呼出すことが出来ます。

Version

1.30

See Also

functions: | RestoreCameraFacing | SetCameraFacing | SetCameraMode | SetCutsceneMode
categories: | Miscellaneous Functions | PC Only Functions

author: Charles Feduke, editor: Lilac Soul, JP team: Rainie


Function - StoreCampaignObject

Home > Reference > Functions > Database > StoreCampaignObject

StoreCampaignObject(string, string, object, object)

キャンペーンデータベースにアイテムやクリーチャーを保管します。

int StoreCampaignObject(
    string sCampaignName,
    string sVarName,
    object oObject,
    object oPlayer = OBJECT_INVALID
);

Parameters

sCampaignName

キャンペーン名。(大文字/小文字は区別されます)

sVarName

特有の変数名。

oObject

保管するオブジェクト。

oPlayer

オブジェクト値に関連付けられているプレイヤー。(デフォルト: OBJECT_INVALID)

Description

キャンペーンデータベースにアイテムやクリーチャーを保管します。

キャンペーン名は大文字/小文字が区別されます。

関数呼び出しが成功すると1を返し、失敗すると0を返します。

この関数を使用して保管できるのは、アイテムかクリーチャーのみです。

Remarks

oPlayerが指定されることにより、sVarNameが特有の名前である必要があるかどうかは分かりません。

オブジェクト上にローカルで保管された変数は、オブジェクトと一緒には保管されないようです。

Version

1.30

See Also

functions: | RetrieveCampaignObject
categories: | Database Functions

author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: katsu794


Function - StringToFloat

Home > Reference > Functions > Type Casting/Conversion > StringToFloat

StringToFloat(string)

文字列から浮動小数値に変換する。

float StringToFloat(
    string sNumber
);

Parameters

sNumber

浮動小数値に変換する文字列

Description

文字列から浮動小数値に変換する。

エラーの場合は0.0fを返す。

Version

1.22

Example

// StringToFloatの実験
void main()
{
    string sFloat1 = "1234.567";   // ノーマル
    string sFloat2 = "1234.567f";  // floatマークつき
    string sFloat3 = "1234";       // 小数点以下がない場合
    string sFloat4 = ".567";       // 小数のみ
    string sFloat5 = "12.34.567";  // 小数点が２個あった場合
    string sFloat6 = "abcd.ef";    // 数字ではない場合

    float fFloat1 = StringToFloat(sFloat1); // 結果：1234.567
    float fFloat2 = StringToFloat(sFloat2); // 結果：1234.567
    float fFloat3 = StringToFloat(sFloat3); // 結果：1234.0
    float fFloat4 = StringToFloat(sFloat4); // 結果：0.567
    float fFloat5 = StringToFloat(sFloat5); // 結果：12.34
    float fFloat6 = StringToFloat(sFloat6); // 結果：0.0f

See Also

functions: | FloatToString | StringToInt
categories: | Type Casting/Conversion Functions

author: Charles Feduke, JP team: ngtaicho


Function - StringToInt

Home > Reference > Functions > Type Casting/Conversion > StringToInt

StringToInt(string)

文字列を整数値に変換する。

int StringToInt(
    string sNumber
);

Parameters

sNumber

整数値に変換する文字列

Description

文字列を整数値に変換し返す。

エラーの場合、0を返す。

Version

1.22

See Also

functions: | FloatToString | IntToString | StringToFloat
categories: | Type Casting/Conversion Functions

author: Charles Feduke, JP team: ngtaicho


Function - StripAllPersonalItemsFromEveryone

Home > Reference > Functions > Henchmen/Familiars/Summoned, Inventory > StripAllPersonalItemsFromEveryone

StripAllPersonalItemsFromEveryone()

公式キャンペーンで使用されているヘンチマンを雇うためのアイテムを取り除きます。

void StripAllPersonalItemsFromEveryone();

Description

エリアにいる全てのPCを調べ、いずれかのヘンチマンを雇うためのアイテムを取り除きます。

PCが現在ヘンチマンを雇っていれば、それらのアイテムを入れ替えます。

これは公式キャンペーンのチャプター1章、2章、3章でのみ使用されています。

Remarks

Script: nw_i0_henchman.nss: Line: 313

Requirements

#include "nw_i0_henchman"

Version

1.29

See Also

functions: | DestroyAllPersonalItems | GivePersonalItem | HasPersonalItem
categories: | Henchmen/Familiars/Summoned Functions | Inventory Functions

author: Jody Fletcher, JP team: NamaYake


Function - StripEffects

Home > Reference > Functions > Spell Casting Effects, Spells, Visual Effects > StripEffects

StripEffects(int, object)

モルデンカイネンズ ディスジャンクションが詠唱されたとき複数の呪文効果を解除します。

void StripEffects(
    int nNumber,
    object oTarget
);

Parameters

nNumber

解除する呪文効果の数

oTarget

詠唱のターゲット

Description

範囲詠唱、もしくは単体詠唱により、2もしくは6つの防御呪文を取り除きます。ロケーションやオブジェクトを選びターゲット（ターゲットたち）に掛かっている防御呪文を解除を解除します。

Remarks

Script: nw_s0_morddisj.nss: Line: 16

Requirements

#include "nw_s0_morddisj"

Version

1.29

See Also

categories: | Spell Casting Effects Functions | Spells Functions | Visual Effects Functions
events: | OnSpellCastAt Event

author: Jody Fletcher, JP team: Redondo


Function - SummonAnimalCompanion

Home > Reference > Functions > Henchmen/Familiars/Summoned > SummonAnimalCompanion

SummonAnimalCompanion(object)

void SummonAnimalCompanion(
    object oMaster = OBJECT_SELF
);

Parameters

oMaster

動物の仲間を召喚するクリーチャー。(デフォルト: OBJECT_SELF)

Description

oMasterの動物の仲間を召喚します

oMasterが動物の仲間を持っていない場合は、何も起こりません。

Version

1.22

See Also

functions: | EffectSummonCreature | EffectSwarm | GetAnimalCompanionCreatureType | GetAnimalCompanionName
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, JP team: katsu794


Function - SummonFamiliar

Home > Reference > Functions > Henchmen/Familiars/Summoned > SummonFamiliar

SummonFamiliar(object)

void SummonFamiliar(
    object oMaster = OBJECT_SELF
);

Parameters

oMaster

使い魔を召喚するクリーチャー。(デフォルト: OBJECT_SELF)

Description

ウィザードかソーサラーの使い魔を召喚します。

oMasterが使い魔を持っていない場合は、何も起きません。

Version

1.22

See Also

functions: | EffectSummonCreature | EffectSwarm | GetFamiliarCreatureType | GetFamiliarName
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, JP team: katsu794


Function - SupernaturalEffect

Home > Reference > Functions > Core AI, Effects > SupernaturalEffect

SupernaturalEffect(effect)

Modifies an effect to make it a Supernatural effect.

effect SupernaturalEffect(
    effect eEffect
);

Parameters

eEffect

An effect to categorise as being SUBTYPE_SUPERNATURAL.

Description

Sets the subtype of eEffect to SUBTYPE_SUPERNATURAL and returns the modified eEffect, now a Supernatural effect. This allows the engine to apply the effect with the same rules as Supernatural Abilities (3rd edition DMG page 71, MM page 7).

Remarks

The extent to which the Aurora Engine follows the 3rd Edition rules for Supernatural effects and abilities is unmeasured.

Version

1.22

See Also

functions: | ApplyEffectToObject | ExtraordinaryEffect | MagicalEffect
categories: | Core AI Functions | Effects Functions
constants: | SUBTYPE_* Constants

author: Iskander Merriman


Function - SurrenderToEnemies

Home > Reference > Functions > Combat Actions, Reputation/Faction > SurrenderToEnemies

SurrenderToEnemies()

10メートル（1タイル）半径内の全てのクリーチャーのアクションを止め、3分間近くの敵との関係を好転させます。PCやオブジェクトに対して使用しないでください。

void SurrenderToEnemies();

Description

NPCにおいて使用すると10メートル半径内の全てのクリーチャーの行動を止め、およそ3分間、範囲内の敵NPCをPCに対して中立にします。PCやオブジェクトに使用しても何も起きません。

Version

1.22

Example

// NPCにプレイヤーを攻撃させ、次に降伏させます。
// プレイヤーは自動攻撃をストップさせます。
void main()
{
     object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
     DelayCommand(2.0, SurrenderToEnemies());
     ActionAttack(oPC, TRUE);
}

See Also

functions: | AdjustReputation
categories: | Combat Actions Functions | Reputation/Faction Functions

author: John Shuell, JP team: Redondo


Function - TakeArtifactItem

Home > Reference > Functions > Inventory, Miscellaneous > TakeArtifactItem

TakeArtifactItem(object)

プレイヤーのインベントリーからプロットに関連するアイテムを取り除きます。

void TakeArtifactItem(
    object oPC
);

Parameters

oPC

アイテムを取り除くPC

Description

呼出object上のNW_J_ARTIFACT_MYGLOBALSと呼ばれるローカルobjectからアーティファクトのtag名を取得し、その後、そのtag名を持つ全てのアイテムを目標のインベントリーと装備品から検索し、破壊します。

Remarks

この関数はnw_j_artifact.nssの146行目で発見できます。

この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。特にこの関数は利用可能な7つの他の関数から2つを単に利用します。この関数の全ては比較的ストレートで、全体を理解するのに簡単です。

さらに全く同じ関数で、アーティファクトの代わりに"ComplexItems"に働く、別のスクリプトもあります。スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。その他の関数を"See Also"セクションで見てください。

Version

1.22

Example

// クエストを発信するNPCのOnSpawn
#include "NW_J_ARTIFACT"
    SetGlobal(OBJECT_SELF,OBJECT_SELF);
    SetArtifactItem("ART_ITEM01");
    SetPlotTag("NW_ARTI_PLOT"); // このクエストの報酬になる経験値を持ったジャーナルエントリーに合わせる

// プレーヤーがアイテムを返して報酬を受け取る
#include "NW_I0_PLOT"
#include "NW_J_ARTIFACT"

int StartingConditional()
{
    if (PlayerHasArtifactItem(GetPCSpeaker()) == TRUE)
    {
        ActionPauseConversation();
        TakeArtifactItem(GetPCSpeaker()); // プレイヤーのインベントリーからアイテムを壊す
        RewardXP(GetPlotTag(),100,GetPCSpeaker());
        ActionResumeConversation();
    }
    return FALSE;
}

See Also

functions: | GetArtifactItem | GetComplexItem | GetPlotTag | PlayerHasArtifactItem | PlayerHasComplexItem | SetArtifactItem | SetComplexItem | SetGlobal | SetPlotTag | TakeComplexItem | TakeStoryItem
categories: | Inventory Functions | Miscellaneous Functions

author: John Shuell, JP team: geshi, Rainie


Function - TakeComplexItem

Home > Reference > Functions > Inventory > TakeComplexItem

TakeComplexItem(object)

プレイヤーの所持品からプロットに関係するアイテムを取り除きます。

void TakeComplexItem(
    object oPC
);

Parameters

oPC

アイテムを取り除くプレイヤー。

Description

関数を呼び出したクリーチャーのNW_J_COMPLEX_MYGLOBALSというローカルオブジェクトからコンプレックスアイテムのタグネームを得ます。そして対象の全ての所持品と装備品を調べ、返されたタグと比較しそれを破壊します。

Remarks

関数はnw_j_complex.nssの146行目で見つかります。

この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

特にこの関数は利用可能な7つの他の関数から2つを単に利用します。

この関数の全ては比較的ストレートで、全体を理解するのに簡単です。

リンクの"See Also"をご覧下さい。

さらに全く同じ関数で、コンプレックスアイテムの代わりに"アーティファクト"に働く、別のスクリプトもあります。

スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。

その他の関数を"See Also"セクションで見てください。

Version

1.22

Example

// クエストを発信するNPCのOnSpawn
#include "NW_J_COMPLEX"
    SetGlobal(OBJECT_SELF,OBJECT_SELF);
    SetComplexItem("COMP_ITEM03");
    SetPlotTag("NW_LOCK_PLOT"); //このクエストの報酬になる経験値を持ったジャーナルエントリーに合わせる。

//アイテムを返したプレイヤーにNPCのカンバセーション表示の条件で報酬を与えます。
#include "NW_I0_PLOT"
#include "NW_J_COMPLEX"

int StartingConditional()
{
    if (PlayerHasComplexItem(GetPCSpeaker()) == TRUE)
    {
        ActionPauseConversation();
        TakeComplexItem(GetPCSpeaker()); //プレイヤーの所持品欄からアイテムを破壊します。
        RewardXP(GetPlotTag(),100,GetPCSpeaker());
        ActionResumeConversation();
    }
    return FALSE;
}

See Also

functions: | GetComplexItem | GetFetchItem | GetPlotTag | GetStoryItem | PlayerHasComplexItem | SetComplexItem | SetGlobal | SetPlotTag | SetStoryItem | TakeArtifactItem | TakeFetchItem | TakeStoryItem
categories: | Inventory Functions

author: John Shuell, JP team: NamaYake


Function - TakeFetchItem

Home > Reference > Functions > Inventory, Miscellaneous > TakeFetchItem

TakeFetchItem(object)

プレイヤーのインベントリーからプロットに関連するアイテムを取り除きます。

void TakeFetchItem(
    object oPC
);

Parameters

oPC

アイテムを取り除くPC

Description

呼出object上のNW_J_FETCH_MYGLOBALSと呼ばれるローカルobjectからクエストobjectのtag名を取得し、その後、そのtag名を持つ全てのアイテムを目標のインベントリーと装備品から検索し、破壊します。

Remarks

この関数はnw_j_fetch.nssの178行目で発見できます。

この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。特にこの関数は利用可能な7つの他の関数から2つを単に利用します。この関数の全ては比較的ストレートで、全体を理解するのに簡単です。

さらに全く同じ関数で、アーティファクトの代わりに"ComplexItems"と"FetchItems"に働く、別のスクリプトもあります。スクリプトは同一ですが、その後、それらを理解しやすくコーディングし、機能性を追加するために分けられました。その他の関数を"See Also"セクションで見てください。

Version

1.22

Example

// クエストを発信するNPCのOnSpawn
#include "NW_J_FETCH"
    SetGlobal(OBJECT_SELF,OBJECT_SELF);
    SetFetchItem("APPLE01");
    SetPlotTag("GATHER_APPLES"); // このクエストの報酬になる経験値を持ったジャーナルエントリーに合わせる

// プレーヤーがアイテムを返して報酬を受け取る
#include "NW_I0_PLOT"
#include "NW_J_FETCH"

int StartingConditional()
{
    if (PlayerHasFetchItem(GetPCSpeaker()) == TRUE)
    {
        ActionPauseConversation();

        //Dプレイヤーのインベントリーから「apple」を取り除きます
        TakeFetchItem(GetPCSpeaker());
        RewardXP(GetPlotTag(),100,GetPCSpeaker());

        // このプレイヤーが再び行なわないようにクエストを終了した印をつける
        SetLocalInt(GetModule(),GetPlotTag()+GetName(GetPCSpeaker()),1);

        ActionResumeConversation();
    }
    return FALSE;
}

See Also

functions: | GetFetchee | GetFetchItem | TakeComplexItem | TakeStoryItem
categories: | Inventory Functions | Miscellaneous Functions

author: John Shuell, JP team: geshi, Rainie


Function - TakeGold

Home > Reference > Functions > Inventory, Money > TakeGold

TakeGold(int, object, int)

ターゲットのインベントリーからある金額を取り去り、また任意にゲームからも取り除きます。

void TakeGold(
    int nAmount,
    object oGoldHolder,
    int bDestroy = TRUE
);

Parameters

nAmount

取り去る金額

oGoldHolder

ゴールドを取りさるobject

bDestroy

奪ったゴールドをゲームから取り除くかどうか？（デフォルト：TRUE）

Description

oGoldHolderからnAmountゴールド取り除き、ゲーム内からも取り除きます。呼出者に金を与えるために任意に取り出すことができます。

Remarks

この関数はnw_i0_plot.nssの44行目で見つかります。

この関数はnw_i0_tool.nssの55行目で見つかります。

パラメーターを使ってただ奪うだけの至極単純な関数で、TakeGoldFromCreature()で使うのと同様のパラメーターです。２つの異なるファイルでも同じように定義されています。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | TakeGoldFromCreature | TakeNumItems
categories: | Inventory Functions | Money Functions

author: John Shuell, JP team: Rainie


Function - TakeGoldFromCreature

Home > Reference > Functions > Money > TakeGoldFromCreature

TakeGoldFromCreature(int, object, int)

クリーチャーから指定した金額を取り除きます。

void TakeGoldFromCreature(
    int nAmount,
    object oCreatureToTakeFrom,
    int bDestroy = FALSE
);

Parameters

nAmount

取り除く金額

oCreatureToTakeFrom

もしこれが有効なクリーチャーでなければ、何も起こりません。

bDestroy

これがTRUEであれば、呼出者はゴールドを得ません。その代わりに、ゴールドは破壊され、ゲームから消滅します。（デフォルト：FALSE）

Description

oCreatureToTakeFromからnAmountゴールドを取り除きます。

Remarks

bDestroyに対するデフォルト値はFALSEですが、最も一般的な使用法はTRUEです。実際、BiowareはデフォルトのbDestroyをTRUEにした以外は同様のパラメーターを持つTakeGold関数（NW_I0_TOOL内）をつくりました。（そしてこの関数を下位呼出にしました）

Version

1.22

Example

// これはBiowareの復活プログラムである
// * プレイヤーは復活の際にXPとGPにペナルティが課せられる
void ApplyPenalty(object oDead)
{
    int nXP = GetXP(oDead);
    int nPenalty = 50 * GetHitDice(oDead);
    int nHD = GetHitDice(oDead);
    // * 復活の際にレベルまで失うことはありません
    int nMin = ((nHD * (nHD - 1)) / 2) * 1000;

    int nNewXP = nXP - nPenalty;
    if (nNewXP < nMin)
       nNewXP = nMin;
    SetXP(oDead, nNewXP);
    int nGoldToTake =    FloatToInt(0.10 * GetGold(oDead));
    // * 奪われるゴールドの上限は10000gpです
    if (nGoldToTake > 10000)
    {
        nGoldToTake = 10000;
    }
    AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
    DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
    DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));

}

See Also

functions: | GiveGoldToCreature | TakeGold | TakeNumItems
categories: | Money Functions

author: Tom Cassiotis, JP team: geshi, Rainie


Function - TakeNumItems

Home > Reference > Functions > Inventory > TakeNumItems

TakeNumItems(object, string, int)

対象から指定したアイテムを指定数取り上げます。

void TakeNumItems(
    object oTarget,
    string sItem,
    int nNumItems
);

Parameters

oTarget

アイテムを取りあげる対象のオブジェクト。

sItem

取り除くアイテムのタグ。

nNumItems

オブジェクトの所持品欄にある取り除くアイテムの最大数。

Description

oTargetの所持品欄をsItemというタグのオブジェクトを探してループします。そしてそれらをスクリプトを呼び出したオブジェクトの所持品欄に置きます。

ループはnNumItems回数か、所持品欄から指定のオブジェクトを全て取り除くかするまで続きます。

Remarks

この関数はnw_i0_plot.nssの847行目で見つかります。

Requirements

#include "nw_i0_plot"

Version

1.22

See Also

functions: | GiveNumItems | TakeGold | TakeGoldFromCreature
categories: | Inventory Functions

author: John Shuell, JP team: NamaYake


Function - TakeStoryItem

Home > Reference > Functions > Inventory > TakeStoryItem

TakeStoryItem(object)

プレイヤーの所持品欄にあるプロットに関係するアイテムを取り除きます。

void TakeStoryItem(
    object oPC
);

Parameters

oPC

アイテムを取り除くプレイヤー。

Description

関数を呼び出したクリーチャーのNW_J_COMPLEX_MYGLOBALSというローカルオブジェクトからコンプレックスアイテムのタグネームを得ます。そして対象の全ての所持品と装備品を調べ、返されたタグと比較しそれを破壊します。

Remarks

関数はnw_j_complex.nssの146行目で見つかります。

この関数の設定は、NPCのクエストに関連したプロット・アイテムに関連する情報の蓄積に集中されます。

特にこの関数は利用可能な7つの他の関数から2つを単に利用します。

この関数の全ては比較的ストレートで、全体を理解するのに簡単です。

リンクの"See Also"をご覧下さい。

Version

1.22

Example

// クエストを発信するNPCのOnSpawn
#include "NW_J_STORY"
    SetGlobal(OBJECT_SELF,OBJECT_SELF);
    SetStoryItem("STORY_ITEM02");
    SetPlotTag("NW_DRAGONHUNT_PLOT"); //このクエストの報酬になる経験値を持ったジャーナルエントリーに合わせる。

//アイテムを返したプレイヤーにNPCのカンバセーション表示の条件で報酬を与えます。
#include "NW_I0_PLOT"
#include "NW_J_STORY"

int StartingConditional()
{
    if (PlayerHasStoryItem(GetPCSpeaker()) == TRUE)
    {
        ActionPauseConversation();
        TakeStoryItem(GetPCSpeaker()); //プレイヤーの所持品欄からアイテムを破壊します。
        RewardXP(GetPlotTag(),100,GetPCSpeaker());
        ActionResumeConversation();
    }
    return FALSE;
}

See Also

functions: | GetPlotTag | GetStoryItem | Global | PlayerHasStoryItem | SetGlobal | SetPlotTag | SetStoryItem | TakeArtifactItem | TakeComplexItem | TakeFetchItem
categories: | Inventory Functions

author: John Shuell, JP team: NamaYake


Function - TalentAdvancedBuff

Home > Reference > Functions > Combat Actions, Core AI Talent, Spells, Talents/Skills/Feats > TalentAdvancedBuff

TalentAdvancedBuff(float)

NPC/Creatureが呪文や特殊能力を持っている場合、優先順位リストを使用して彼等自身を強化させます。

int TalentAdvancedBuff(
    float fDistance
);

Parameters

fDistance

呼出Object上に強化呪文を詠唱するかどうかを見なす際の、最も近いNPCへの安全な距離

Description

最も近いNPCがfDistanceより近い、または等しい場合、クリーチャーに彼等へ強化呪文をかけさせます。

Remarks

最も近いPCがfDistanceより近い、または等しい場合、クリーチャーに彼等へ強化呪文をかけさせます。呪文は以下の呪文グループから選択されます。呼出したオブジェクトがカテゴリーに詠唱準備ができている少なくとも1つの呪文を持っている場合、各グループからの1つの呪文は優先権の以下の順序で、詠唱されるでしょう。

Combat Protection Spells
Premonition
Greater Stoneskin
Stoneskin
Visage Protection Spells
Shadow Shield
Ethereal Visage
Ghostly Visage

Mantle Protection Spells
Greater Mantle
Mantle
Lesser Breach
Globe Spells
Globe Of Invulnerability
Minor Globe Of Invulnerability
Misc Protection Spells
Elemental Shield
Elemental Protection Spells
Protection From Elements
Resist Elements
Endure Elements
Mental Protection Spells
Mind Blank
Lesser Mind Blank
Clarity
Summon Allies
Summon Creature IX
Summon Creature VIII
Summon Creature VII
Summon Creature VI
Summon Creature V
Summon Creature IV
Summon Creature III
Summon Creature II
Summon Creature I

Requirements

#include "nw_i0_generic"

Version

1.22

Example

// 40ユニット以内の距離に見えているPCを強化するために、クリーチャーの
// OnPerceivedユーザー定義イベントに入れる。そのNPCがそうするための呪文を
// 持っていない場合、PCを強化する為に近くのOrcシャーマンに呼ぶだろう
void main()
{
    int nUser = GetUserDefinedEventNumber();

    if(nUser == 1002) //PERCEIVE
    {
        int EVENT_BUFF_ALLY = 5000;

        if(GetIsPC(GetLastPerceived())){
            if(!TalentAdvancedBuff(40.0)){
                object oOrcShaman = GetObjectByTag("OrcShaman");
                if(GetDistanceToObject(oOrcShaman) <= 30.0){
                    SignalEvent(oOrcShaman, EventUserDefined(EVENT_BUFF_ALLY));
                }
            }
        }
    }
}

See Also

categories: Combat Actions Functions | Core AI Talent Functions | Spells Functions | Talents/Skills/Feats Functions

author: John Shuell, JP team: Rainie


Function - TalentAdvancedProtectSelf

Home > Reference > Functions > Combat Actions, Core AI Talent, Talents/Skills/Feats > TalentAdvancedProtectSelf

TalentAdvancedProtectSelf()

AIは速やかに近くの敵を検索し、それが面する敵のタイプに対して、それ自体上に最も有益な防御系タレントを得ます。

int TalentAdvancedProtectSelf();

Description

近くの敵のタイプから守るのに最も適した防御系タレントを発見し、適用に成功した場合、呼出関数に知らせるブーリアンを返します。

Remarks

使用するタレント（呪文、特技、アイテム）を決定するためにこの関数が行う段階の詳細：

近くにいる全ての敵のリストを作成し、それらをそれぞれの基礎クラス（Fighter系、Mage系、Monster系、Cleric系）に分け、それぞれのカテゴリー毎のレベルを合計する。

個々のレベル総計の比較により、最も差し迫ったカテゴリーに基づく脅威を決定します。

TALENT_CATEGORY_BENEFICIAL_PROTECTION_SELFからランダムなタレントを得ます。

そのタレントが、最も脅威と見なした基礎クラスに対して有効かどうかを調べます。

そうでなければ、TALENT_CATEGORY_BENEFICIAL_PROTECTION_SINGLEからランダムなタレントを得ます。

そのタレントが、最も脅威と見なした基礎クラスに対して有効かどうかを調べます。

そうでなければ、TALENT_CATEGORY_BENEFICIAL_PROTECTION_AREAEFFECTからランダムなタレントを得ます。

そのタレントが、最も脅威と見なした基礎クラスに対して有効かどうかを調べます。

そうでなければ、最初に戻りTALENT_CATEGORY_BENEFICIAL_PROTECTION_SELFからその他のタレントを得ます。

この手続きを10回繰り返し、自身を防御するタレントを探します。

見つかったものが呪文であった場合、詠唱前にそのeffectを既に得ているかどうかを調べます。

そうでなければ、自身にその呪文を詠唱します。

見つかったものが特技であった場合、その特技を持っているかどうか調べます。

持っていれば、特技を使用します。

見つかったものが呪文でも特技でもない場合、それを使用します。

タレントが、どの上記に示されたTALENT_CATEGORYグループ定数に分類されているかは確かめられません。

Requirements

#include "nw_i0_generic"

Version

1.22

See Also

functions: | StartProtectionLoop | TalentHealingSelf | TalentUseEnhancementOnSelf | TalentUseProtectionOnSelf | TalentUseProtectionOthers
categories: | Combat Actions Functions | Core AI Talent Functions | Talents/Skills/Feats Functions

author: John Shuell, JP team: Rainie


Function - TalentBardSong

Home > Reference > Functions > Core AI Talent, Talents/Skills/Feats > TalentBardSong

TalentBardSong()

AIがバードソング特技を持っている場合それを使うかどうかを決めます。

int TalentBardSong();

Description

クリーチャーがバードソング特技を持ち、それを使う場合、呼出ObjectにTRUEを返します。

Remarks

この関数のSoUバージョンはx0_i0_talentに入っています。しかしながらnw_i0_genericをIncludeしても未だに動作するでしょう。

この関数の呼出者がバードソングによるeffectを既に受けている場合（nwscript.nssの対応する定数値なしで、spells.2daの411行目から参照されます）、関数は自動的にFALSEを返すでしょう。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

categories: Core AI Talent Functions | Talents/Skills/Feats Functions

author: John Shuell, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie


Function - TalentBuffSelf

Home > Reference > Functions > Core AI Talent, Inventory, Talents/Skills/Feats > TalentBuffSelf

TalentBuffSelf()

増強や防御のポーションの為に使います。

int TalentBuffSelf();

Description

クリーチャーが最良の増強・防御用ポーションを見つけることができ、それを使用することができる場合、TRUEを返します。そうでなければFALSEを返すでしょう。

Remarks

この関数の段階の詳細は以下：

クリーチャーが持つ最良の防御用ポーションを探します。

クリーチャーが防御用ポーションを持っていなければ、続いて最良の増強用のポーションを探します。

選択されたポーションと同一のeffectが既にクリーチャーに適用されていないか確認します。

全てよければ、ポーションを飲みます。

Requirements

#include "nw_i0_generic"

Version

1.22

See Also

functions: | TalentEnhanceOthers | TalentHealingSelf | TalentUseEnhancementOnSelf
categories: | Core AI Talent Functions | Inventory Functions | Talents/Skills/Feats Functions

author: John Shuell, JP team: Rainie


Function - TalentCureCondition

Home > Reference > Functions > Core AI Talent, Spells, Talents/Skills/Feats > TalentCureCondition

TalentCureCondition()

最も近い友好関係の対象の病気、毒、呪い、盲目、聴覚喪失を治療します。

int TalentCureCondition();

Description

全ての近くの友好的なクリーチャーを検索し、ある状態不能を取り除く為に詠唱する呪文を決定します。

Remarks

打破していく段階は以下のとおり：

最も近い友好的な目標を探す。

全ての状態不能を判断する。

目標が

レベルドレイン状態、または

病気と毒状態、または

病気のみの状態、または

呪いと毒状態、または

呪いと病気状態、または

盲目と聴覚喪失と毒状態、または

呪いと盲目と聴覚喪失状態、または

盲目と聴覚喪失と病気状態、

そして、クリーチャーがグレーター･レストレーションまたはレストレーションを持っているか？

クリーチャーが持っている2つのレストレーションのうち、適した方を唱える。

そうでなければ、目標が病気のみの状態、または病気と毒状態でクリーチャーがニュートラライズ･ポイズンを持っている場合、それを唱える。

そうでなければ、目標が病気のみの状態でクリーチャーがリムーブ･デイジーズを持っていれば、それを唱える。

そうでなければ、目標がカース状態だけで、クリーチャーがリムーブ･カースを持っていれば、それを唱える。

そうでなければ、目標が盲目状態のみまたは聴覚喪失状態のみで、クリーチャーがリムーブ･ブラインドネスやリムーブ･ディーフネスを持っていれば、それを唱える。

次に最も近い友好関係のターゲットを探し、プロセスを最初から行う。

Version

1.22

See Also

functions: | TalentHeal | TalentHealingSelf
categories: | Core AI Talent Functions | Spells Functions | Talents/Skills/Feats Functions
constants: | RADIUS_SIZE_* Constants

author: John Shuell, JP team: Rainie


Function - TalentDragonCombat

Home > Reference > Functions > Combat Actions, Core AI Talent, Talents/Skills/Feats > TalentDragonCombat

TalentDragonCombat(object)

戦闘で、ドラゴンが選択するタレントを得ます。

int TalentDragonCombat(
    object oIntruder = OBJECT_INVALID
);

Parameters

oIntruder

攻撃やタレントを使用するためのクリーチャー（デフォルト：OBJECT_INVALID）

Description

延々とブレス攻撃をしないように戦闘で使用するために選択する（ランダムな）ドラゴンのタレントを扱います。

Remarks

この関数の手順は以下の通りです：

関数に渡された対象が未だ有効であるかどうかを調べます。

そうでなければ、新しい対象を探します。

ドラゴンがもうブレス攻撃を使えるかどうか調べます（ドラゴンが他の2つの攻撃タイプが実行された後だけ、使用することができます）。

ドラゴンが可能ならば、ブレス攻撃を使います。

さらに2回以上攻撃するまでブレスを使えなくします。

もし彼がブレスを使うことが出来なければ、続いて、TALENT_CATEGORY_HARMFUL_MELEEタレントグループからランダムなタレントを選択します。

選ばれたタレントが「武器落し」の特技で、対象が落とすべき武器を持っていなければ、対象を普通に攻撃します。

そうでなければ、対象に対して選択したタレントを使用します。

ブレス攻撃を使用できる段階へと1つ近づけます。

Requirements

#include "nw_i0_generic"

Version

1.22

See Also

categories: Combat Actions Functions | Core AI Talent Functions | Talents/Skills/Feats Functions

author: John Shuell, JP team: Rainie


Function - TalentEnhanceOthers

Home > Reference > Functions > Core AI Talent > TalentEnhanceOthers

TalentEnhanceOthers()

同じパーティーの他の仲間を支援するためのベストな能力、呪文やスキルを決定するためにNPCやクリーチャーによって使用されます。

int TalentEnhanceOthers();

Description

現在のラウンドにおいて、同じパーティー(グループ)におけるNPCのマスター(ヘンチマンである場合)や他の者を高める(磨く)ための特殊能力を返します。

エフェクトエリア呪文を詠唱する能力を調べたり、グループがすでにAOEエフェクトと同様のエフェクトの配下にあるかどうかを調べます。

呪文が使われない場合は、能力を調べます。

Requirements

#include "nw_io_generic"

Version

1.22

See Also

functions: | TalentBuffSelf | TalentUseProtectionOthers
categories: | Core AI Talent Functions

author: Jody Fletcher, editor: John Shuell, JP team: katsu794


Function - TalentFeat

Home > Reference > Functions > Talents/Skills/Feats, Type Casting/Conversion > TalentFeat

TalentFeat(int)

D&Dの特技（feat）に対応する、才能（talent）を作成する

talent TalentFeat(
    int nFeat
);

Parameters

nFeat

FEAT_*

Description

特技（feat）から外れている才能（talent）を作成する。これはＡＩが動作を決定する際に、色々な才能（talent）能力と関連して使われる。

Requirements

#include "nw_io_generic"

Version

1.22

See Also

functions: | TalentSkill | TalentSpell
categories: | Talents/Skills/Feats Functions | Type Casting/Conversion Functions
constants: | FEAT_* Constants

author: Jody Fletcher, editor: John Shuell, JP team: geshi, ngtaicho


Function - TalentFlee

Home > Reference > Functions > Action on Object, Combat Actions, Core AI Talent, Talents/Skills/Feats > TalentFlee

TalentFlee(object)

呼出objectを他のobjectから離れさせます。

int TalentFlee(
    object oIntruder = OBJECT_INVALID
);

Parameters

oIntruder

離れられるクリーチャータイプのobject（デフォルト：OBJECT_INVALID）

Description

ActionMoveAwayFromObject()関数を使うことで、呼出ObjectをoIntruderから離れさせます。oIntruderが死んでいるか、そうでなければ、もはや利用可能でない場合、呼出Objectは代わりに最も近くにいる敵から逃れようとします。

この関数は、逃亡状態が引き起こされれば、TRUEを返し、そうでなければFALSEを返します。

Remarks

oIntruderが有効なObjectで、呼出Objectの逃亡範囲（10.0f）の外側にいれば、TalentFlee()の呼出は何も効果を持ちません。

Requirements

#include "NW_I0_GENERIC"

Version

1.22

See Also

functions: | ActionMoveAwayFromObject
categories: | Action on Object Functions | Combat Actions Functions | Core AI Talent Functions | Talents/Skills/Feats Functions

author: Troels Therkelsen, editor: Michael Nork, JP team: Rainie


Function - TalentHeal

Home > Reference > Functions > Core AI Talent > TalentHeal

TalentHeal(int)

クリーチャーの主人(ヘンチマン)や仲間のパーティーメンバーがダメージを受けているかどうかを決定し、ダメージを受けている場合、回復する能力があれば回復しようと試みます。

int TalentHeal(
    int nForce = FALSE
);

Parameters

nForce

クリーチャーに主人であるPCだけを回復させるときはTRUEを選択します。(デフォルト: FALSE)

Description

GetAssociateHealMaster関数がTRUE(主人を回復する)を返すか、または、nForceがTRUEに設定されている場合に、クリーチャーに主人(ヘンチマン)や仲間のパーティーメンバーを回復させます。

その時に、仲間のパーティーメンバーの中で最もダメージを受けているメンバーを調べ、HPの最大値の1/2を下回っているかどうかを確認します。

現在のクリーチャーが回復呪文を詠唱できるかどうかを決定し、また、そのパーティーメンバーがアンデットではないことも確認します。

Requirements

#include "NW_I0_GENERIC"

Version

1.29

See Also

functions: | TalentCureCondition | TalentHealingSelf
categories: | Core AI Talent Functions

author: Jody Fletcher, JP team: katsu794


Function - TalentHealingSelf

Home > Reference > Functions > Core AI Talent, Talents/Skills/Feats > TalentHealingSelf

TalentHealingSelf()

NPCまたはクリーチャーが負傷状態かどうか調べ、もしそうであれば、呪文かポーションのどちらかを使用して治療させます。

int TalentHealingSelf();

Description

クリーチャーの現在のHPが最大HPより半分以下になっていれば、自身を治療させます。

クリーチャーが治療能力を持っている、なければポーション(持っていれば)を使用するかどうか決めます。

Requirements

#include "nw_io_generic"

Version

1.29

See Also

functions: | TalentAdvancedProtectSelf | TalentBuffSelf | TalentCureCondition | TalentHeal | TalentUseProtectionOnSelf
categories: | Core AI Talent Functions | Talents/Skills/Feats Functions

author: Jody Fletcher, JP team: Rainie


Function - TalentMeleeAttack

Home > Reference > Functions > Combat Actions, Core AI > TalentMeleeAttack

TalentMeleeAttack(object)

全てのNPCが近接戦闘をしている間のアクション方針を決定します。

int TalentMeleeAttack(
    object oIntruder = OBJECT_INVALID
);

Parameters

oIntruder

(デフォルト: OBJECT_INVALID)

Description

クリーチャーのメインの攻撃ルーチンです。対する目標と呼出クリーチャーが同一エリアにいるかを調べ、次に3段階のチェックを行います。全ての段階で目標となるクリーチャーが有効で、死んでおらず、OBJECT_SELFと同一エリアにいるかを調べます。

3つの段階は以下：

1）攻撃してきたクリーチャーを攻撃する事を決定する。

2）OBJECT_SELFを攻撃している新しい目標を攻撃する事を決定する。

3）見た、もしくは聞くことで認知した新しい敵対ファクションのものを攻撃する事を決定する。

これらの段階のどれにも当てはなる目標がない場合、攻撃は行われません。目標が得られた場合、目標のACとOBJECT_SELFの現在のレベルを調べます。

この関数は次に、NPCのクラスレベル（HD）に0.75をかけた後、現在のストレングス修正値を加えます。（Remarksを見てください）

敵対クリーチャーのACから上記結果を引いた値（nDiff）が10を下回った場合、関数はOBJECT_SELFが敵対者を弱体化させる能力（またはその他の特技）を持っているかを調べ、持っていれば、その攻撃を行います。nDiffが10を上回った場合、通常の近接攻撃を試みます。

Remarks

スクリプト内では、75%の乗数はNPCのHDの100%にストレングス修正値を足す事のコメント行の近くに書いてあります。

Requirements

#include "nw_io_generic"

Version

1.29

See Also

functions: | TalentMeleeAttacked | TalentRangedAttackers | TalentRangedEnemies | TalentSneakAttack | TalentSpellAttack
categories: | Combat Actions Functions | Core AI Functions
events: | OnCombatRoundEnd Event | OnPhysicalAttacked Event

author: Jody Fletcher, JP team: Rainie


Function - TalentMeleeAttacked

Home > Reference > Functions > Combat Actions, Core AI > TalentMeleeAttacked

TalentMeleeAttacked(object)

Determines best course of action for NPC spell-caster when in melee combat.

int TalentMeleeAttacked(
    object oIntruder = OBJECT_INVALID
);

Parameters

oIntruder

(Default: OBJECT_INVALID)

Description

Function runs through list of TOUCH, RANGED and AREA EFFECT talents that OBJECT_SELF may have, tried to determine the best one, failing that, determines a random talent attack of the above type.

IF OBJECT_SELF currently in combat with more than 1 foe, checks AREA EFFECT, TOUCH and RANGED talents (in that order.) with same checks for validity.

Remarks

ISSUE 1: The check in this function to use a random ability after failing to use best will fail in the following case.

The creature is unable to affect the target with the spell and has only 1 spell of that type.

This can be eliminated with a check in the else to the effect of : else if(!CompareLastSpellCast(GetIdFromTalent(tUse)))

This check was not put in in version 1.0 due to time constraints.

ISSUE 2: Given the Spell Attack is the drop out check the else statements in this talent should be cut.

Requirements

#include "nw_io_generic"

Version

1.29

See Also

functions: | TalentMeleeAttack | TalentRangedAttackers | TalentRangedEnemies | TalentSpellAttack
categories: | Combat Actions Functions | Core AI Functions
events: | OnCombatRoundEnd Event | OnPhysicalAttacked Event

author: Jody Fletcher


Function - TalentPersistentAbilities

Home > Reference > Functions > Core AI Talent, Talents/Skills/Feats > TalentPersistentAbilities

TalentPersistentAbilities()

現在のクリーチャーがオーラを投影する能力を持っているかどうか、そしてもし持っていれば活性化するかを決めます。

int TalentPersistentAbilities();

Description

OBJECT_SELFが活性化できる持続性のオーラを持っているかどうかを調べます。オーラタレントが呪文のeffectでない限り（例：生来の特技/タレント）、オーラを活性化します。

Requirements

#include "nw_io_generic"

Version

1.29

See Also

categories: Core AI Talent Functions | Talents/Skills/Feats Functions

author: Jody Fletcher, JP team: Rainie


Function - TalentRangedAttackers

Home > Reference > Functions > Combat, Core AI Talent, Talents/Skills/Feats > TalentRangedAttackers

TalentRangedAttackers(object)

射程ある攻撃法で攻撃されている間の、呪文詠唱者であるNPCの行動方針を決定します。

int TalentRangedAttackers(
    object oIntruder = OBJECT_INVALID
);

Parameters

oIntruder

(デフォルト: OBJECT_INVALID)

Description

現在接近戦状態でない限り、射程ある攻撃者を狙います。現在の射程のある攻撃者が単独で、OBJECT_SELFとTargetが5メートル以上離れている場合、適切な範囲攻撃（指定）のためにOBJECT_SELFを調べます。

１以上の攻撃者がいた場合、範囲攻撃（無指定）能力を調べます。もし両方の範囲攻撃チェックが無効であった場合、遠距離攻撃能力をチェックします。

Requirements

#include "nw_io_generic"

Version

1.29

See Also

functions: | TalentMeleeAttack | TalentMeleeAttacked | TalentRangedEnemies | TalentSpellAttack
categories: | Combat Functions | Core AI Talent Functions | Talents/Skills/Feats Functions
events: | OnCombatRoundEnd Event | OnPhysicalAttacked Event

author: Jody Fletcher, JP team: Rainie


Function - TalentRangedEnemies

Home > Reference > Functions > Talents/Skills/Feats > TalentRangedEnemies

TalentRangedEnemies(object)

そのようなタレントの使用が成功した場合TRUEを、そうでなければFALSEを返します。

int TalentRangedEnemies(
    object oIntruder = OBJECT_INVALID
);

Parameters

oIntruder

（デフォルト：OBJECT_INVALID）

Description

そのようなタレントの使用が成功した場合TRUEを、そうでなければFALSEを返します。

Remarks

BiowareのデフォルトAIの一部です。非SoU環境ではこの関数はnw_i0_genericに入っています。SoU環境では、x0_i0_talentに入っています。SoUユーザーであっても、nw_i0_genericをIncludeをしても同様に動作します。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

functions: | TalentMeleeAttack | TalentMeleeAttacked | TalentRangedAttackers | TalentSpellAttack
categories: | Talents/Skills/Feats Functions

author: Lilac Soul, JP team: Rainie


Function - TalentSeeInvisible

Home > Reference > Functions > Core AI, Spell Casting Effects, Spells, Talents/Skills/Feats > TalentSeeInvisible

TalentSeeInvisible()

NPCが特技もしくは呪文によりインビジブルクリーチャーを可視するアビリティがあるかどうか調べます。

int TalentSeeInvisible();

Description

固有の特技としてインビジブルオブジェクトと見ることができるか、もしくは探知呪文によってインビジブルオブジェクトを見ることができるかどうかを調べます。

Version

1.29

See Also

categories: Core AI Functions | Spell Casting Effects Functions | Spells Functions | Talents/Skills/Feats Functions

author: Jody Fletcher, JP team: Redondo


Function - TalentSkill

Home > Reference > Functions > Talents/Skills/Feats > TalentSkill

TalentSkill(int)

スキルのタレントを作成します。

talent TalentSkill(
    int nSkill
);

Parameters

nSkill

SKILL_*

Description

スキルのタレントを作成します。

Remarks

SKILL_*定数はskills.2daの数字列を反映します。

Version

1.30

Example

//呼出者に最も近い非PCを挑発させるC

void main()
{
//使用するスキルを決定
talent tTaunt=TalentSkill(SKILL_TAUNT);

object oCreature=GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC);

ActionUseTalentOnObject(tTaunt, oCreature);
}

See Also

functions: | TalentFeat | TalentSpell
categories: | Talents/Skills/Feats Functions
constants: | SKILL_* Constants

author: Lilac Soul, JP team: Rainie


Function - TalentSneakAttack

Home > Reference > Functions > Talents/Skills/Feats > TalentSneakAttack

TalentSneakAttack()

急所攻撃のタレントの使用が成功すればTRUEを、そうでなければFALSEを返します。

int TalentSneakAttack();

Description

急所攻撃のタレントの使用が成功すればTRUEを、そうでなければFALSEを返します。

Remarks

BiowareのデフォルトAIの一部です。非SoU環境ではこの関数はnw_i0_genericに入っています。SoU環境では、x0_i0_talentに入っています。SoUユーザーであっても、nw_i0_genericをIncludeをしても同様に動作します。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

functions: | TalentMeleeAttack
categories: | Talents/Skills/Feats Functions

author: Lilac Soul, JP team: Rainie


Function - TalentSpell

Home > Reference > Functions > Talents/Skills/Feats > TalentSpell

TalentSpell(int)

呪文のタレントを作成します。

talent TalentSpell(
    int nSpell
);

Parameters

nSpell

SPELL_*

Description

呪文のタレントを作成します。

Version

1.30

Example

//呼出者に最も近い非PCを治療させる

void main()
{
//使用するスキルを決定
talent tTaunt=TalentSpell(SPELL_HEAL);

object oCreature=GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC);

ActionUseTalentOnObject(tTaunt, oCreature);
}

See Also

functions: | TalentFeat | TalentSkill
categories: | Talents/Skills/Feats Functions
constants: | SPELL_* Constants

author: Lilac Soul, JP team: Rainie


Function - TalentSpellAttack

Home > Reference > Functions > Talents/Skills/Feats > TalentSpellAttack

TalentSpellAttack(object)

呪文攻撃のタレントが成功した場合TRUEを、そうでなければFALSEを返します。

int TalentSpellAttack(
    object oIntruder
);

Parameters

oIntruder

Description

呪文攻撃のタレントが成功した場合TRUEを、そうでなければFALSEを返します。

Remarks

BiowareのデフォルトAIの一部です。非SoU環境ではこの関数はnw_i0_genericに入っています。SoU環境では、x0_i0_talentに入っています。SoUユーザーであっても、nw_i0_genericをIncludeをしても同様に動作します。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

functions: | TalentMeleeAttack | TalentMeleeAttacked | TalentRangedAttackers | TalentRangedEnemies
categories: | Talents/Skills/Feats Functions
events: | OnSpellCastAt Event

author: Lilac Soul, JP team: Rainie


Function - TalentSummonAllies

Home > Reference > Functions > Talents/Skills/Feats > TalentSummonAllies

TalentSummonAllies()

仲間の召還のタレントの使用に成功すればTRUEを、そうでなければFALSEを返します。

int TalentSummonAllies();

Description

仲間の召還のタレントの使用に成功すればTRUEを、そうでなければFALSEを返します。

Remarks

BiowareのデフォルトAIの一部です。非SoU環境ではこの関数はnw_i0_genericに入っています。SoU環境では、x0_i0_talentに入っています。SoUユーザーであっても、nw_i0_genericをIncludeをしても同様に動作します。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

categories: Talents/Skills/Feats Functions

author: Lilac Soul, JP team: Rainie


Function - TalentUseEnhancementOnSelf

Home > Reference > Functions > Core AI Talent > TalentUseEnhancementOnSelf

TalentUseEnhancementOnSelf()

ある特殊能力の使用の成功時にTRUEを返し、そうでない場合はFALSEを返します。

int TalentUseEnhancementOnSelf();

Description

使用する特殊能力を決定するためにGetCreatureTalentBest関数を呼び出し、そして、TryTalent関数によって返される値を返します。

Remarks

この関数はBiowareのAI関数の一部であり、SoUなしの場合はnw_i0_genericの中にあり、SoUにおいてはx0_i0_talentの中にあります。

しかしながら、SoUにおいてはnw_i0_genericをインクルードするだけで十分でしょう。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

functions: | TalentAdvancedProtectSelf | TalentBuffSelf
categories: | Core AI Talent Functions

author: Lilac Soul, JP team: katsu794


Function - TalentUseProtectionOnSelf

Home > Reference > Functions > Core AI Talent > TalentUseProtectionOnSelf

TalentUseProtectionOnSelf()

ある特殊能力の使用の成功時にTRUEを返し、そうでない場合はFALSEを返します。

int TalentUseProtectionOnSelf();

Description

使用する特殊能力を決定するためにGetCreatureTalentBest関数を呼び出し、そして、TryTalent関数によって返される値を返します。

Remarks

この関数はBiowareのAI関数の一部であり、SoUなしの場合はnw_i0_genericの中にあり、SoUにおいてはx0_i0_talentの中にあります。

しかしながら、SoUにおいてはnw_i0_genericをインクルードするだけで十分でしょう。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

functions: | StartProtectionLoop | TalentAdvancedProtectSelf | TalentHealingSelf
categories: | Core AI Talent Functions

author: Lilac Soul, JP team: katsu794


Function - TalentUseProtectionOthers

Home > Reference > Functions > Core AI Talent > TalentUseProtectionOthers

TalentUseProtectionOthers()

ある特殊能力の使用の成功時にTRUEを返し、そうでない場合はFALSEを返します。

int TalentUseProtectionOthers();

Description

使用する特殊能力を決定するためにGetCreatureTalentBest関数を呼び出し、そして、TryTalent関数によって返される値を返します。

Remarks

この関数はBiowareのAI関数の一部であり、SoUなしの場合はnw_i0_genericの中にあり、SoUにおいてはx0_i0_talentの中にあります。

しかしながら、SoUにおいてはnw_i0_genericをインクルードするだけで十分でしょう。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

functions: | StartProtectionLoop | TalentAdvancedProtectSelf | TalentEnhanceOthers
categories: | Core AI Talent Functions

author: Lilac Soul, JP team: katsu794


Function - TalentUseTurning

Home > Reference > Functions > Talents/Skills/Feats > TalentUseTurning

TalentUseTurning()

アンデッド退散のタレントに成功すればTRUEを、そうでなければFALSEを返します。

int TalentUseTurning();

Description

アンデッド退散のタレントに成功すればTRUEを、そうでなければFALSEを返します。

Remarks

BiowareのデフォルトAIの一部です。非SoU環境ではこの関数はnw_i0_genericに入っています。SoU環境では、x0_i0_talentに入っています。SoUユーザーであっても、nw_i0_genericをIncludeをしても同様に動作します。

Requirements

#include "nw_i0_generic"

Version

1.30

See Also

categories: Talents/Skills/Feats Functions

author: Lilac Soul, JP team: Rainie


Function - tan

Home > Reference > Functions > Math > tan

tan(float)

タンジェント計算し結果を返す。

float tan(
    float fValue
);

Parameters

fValue

タンジェント計算させたい浮動小数値（ラジアン表記ではなく度）

Description

タンジェントを計算し値を返す。

Remarks

底辺÷高さ（正接）

tanθ＝sinθ/cosθ

Version

1.31

See Also

functions: | acos | asin | atan | cos | sin
categories: | Math Functions

author: Charles Feduke, editor: John Shuell, additional contributor(s): Steven Mitcham, Paul Catalano, JP team: geshi, ngtaicho


Function - TestStringAgainstPattern

Home > Reference > Functions > String > TestStringAgainstPattern

TestStringAgainstPattern(string, string)

与えられたテキストが特定のパターンにマッチするか否かを返す。

int TestStringAgainstPattern(
    string sPattern,
    string sStringToTest
);

Parameters

sPattern

探すパターンをあらわす文字列（詳細はRemarks sectionを参照）

sStringToTest

パターンによってチェックされる文字列

Description

sStringToTestがsPatternにマッチする場合はTRUEを返し、さもなくばFALSEを返す。

Remarks

Noel (Bioware)によると：
** 0個以上の文字にマッチする
*w 1個以上の空白（whitespace）
*n 1個以上の数字（numeric）
*p 1個以上の句読点（punctuation）
*a 1個以上のアルファベット
| は「または（or）」
( と ) がブロックとして使える

- クリーチャーに「**」を聞くようにすると、すべての文字列にマッチする。
- 「**funk**」を聞くようにすると、「funk」という語を含むすべての文字列にマッチする。
- 「**(bash|open|unlock)**(chest|door)」は、「open the door please」とか「he just bashed that chest!」というような文字列にマッチする。

Version

1.22

See Also

categories: String Functions

author: Tom Cassiotis, JP team: weed


Function - TouchAttackMelee

Home > Reference > Functions > Combat Actions > TouchAttackMelee

TouchAttackMelee(object, int)

int TouchAttackMelee(
    object oTarget,
    int bDisplayFeedback = TRUE
);

Parameters

oTarget

The target of the touch melee attack.

bDisplayFeedback

Display graphical feedback on the attack. (Default: TRUE)

Description

The caller will perform a Melee Touch Attack on oTarget. This is not an action, and it assumes the caller is already within range of oTarget.
Returns 0 on a miss, 1 on a hit, and 2 on a critical hit.

Version

1.22

See Also

categories: Combat Actions Functions

author: Charles Feduke


Function - TouchAttackRanged

Home > Reference > Functions > Combat Actions > TouchAttackRanged

TouchAttackRanged(object, int)

Executes and determines the results of a ranged touch attack.

int TouchAttackRanged(
    object oTarget,
    int bDisplayFeedback = TRUE
);

Parameters

oTarget

Target of the ranged touch attack.

bDisplayFeedback

Display visual feedback. (Default: TRUE)

Description

The caller will perform a ranged touch attack on oTarget.

Returns 0 on a miss, 1 on a hit and 2 on a critical hit (please note the Known Bugs section below).

Remarks

Generally used to script special abilities such as laying on hands on undead (requires a touch attack to work).

Known Bugs

On a natural 20, it returns 2: a critical
On a natural 1, it returns 0: a miss

Any other roll will return 1: a normal hit
(regardless of AC or modifiers)

Version

1.31

Example

// Here is a Bioware scrtip as an example. This implements
// the special ability of a Steam Mephit, which btw can be
// given to any creature by editing the Special Abilities tab.
// (nw_s1_mephsteam.nss)

//::///////////////////////////////////////////////
//:: Steam Mephit Breath
//:: NW_S1_MephSteam
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Steam Mephit shoots out a bolt of steam
    that causes 1d4 damage and reduces AC by 4
    and Attack by 2
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: May 11, 2001
//:://////////////////////////////////////////////

void main()
{
   // Declare major variables
   object oTarget = GetSpellTargetObject();
   int nHD = GetHitDice(OBJECT_SELF);
   effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
   effect eBolt, eAttack, eAC;
   effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);

   //Roll damage
   int nDamage = d4();
   //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion.
   nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetSpellSaveDC(),SAVING_THROW_TYPE_FIRE);
   //Make a ranged touch attack
   int nTouch = TouchAttackRanged(oTarget);
   if(nDamage == 0) {nTouch = 0;}
   if(nTouch > 0)
   {
      if(nTouch == 2)
      {
         nDamage *= 2;
      }
      //Fire cast spell at event for the specified target
      SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_MEPHIT_STEAM_BREATH));

      //Set damage, AC mod and attack mod effects
      eBolt = EffectDamage(nDamage, DAMAGE_TYPE_FIRE);
      eAC = EffectACDecrease(4);
      eAttack = EffectAttackDecrease(2);
      effect eLink = EffectLinkEffects(eAC, eAttack);
      eLink = EffectLinkEffects(eLink, eDur);

      //Apply the VFX impact and effects
      ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(3));
      ApplyEffectToObject(DURATION_TYPE_INSTANT, eBolt, oTarget);
      ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
   }
}

See Also

categories: Combat Actions Functions

author: Tom Cassiotis, editor: Charles Feduke, additional contributor(s): Brahm Dorst


Function - TrimLevel

Home > Reference > Functions > Spells > TrimLevel

TrimLevel(int, int)

ある秘術呪文スクロールの有効な上限を返します。

int TrimLevel(
    int nScroll,
    int nLevel
);

Parameters

nScroll

nLevel

Description

ある秘術呪文スクロールの有効な上限を返します。

Requirements

#include "nw_o2_coninclude"

Version

1.22

Example

// 1.24 source for this funciton
int TrimLevel(int nScroll, int nLevel)
{   int nMax = 5;
    switch (nLevel)
    {
        case 0: nMax = 4; break;
        case 1: nMax = 13; break;
        case 2: nMax = 21; break;
        case 3: nMax = 15; break;
        case 4: nMax = 17; break;
        case 5: nMax = 13; break;
        case 6: nMax = 14; break;
        case 7: nMax = 8; break;
        case 8: nMax = 9; break;
        case 9: nMax = 12; break;
    }
    if (nScroll > nMax) nScroll = nMax;
        return nScroll;
}

See Also

categories: Spells Functions

author: Tom Cassiotis, JP team: Rainie


Function - TurnsToSeconds

Home > Reference > Functions > Time, Type Casting/Conversion > TurnsToSeconds

TurnsToSeconds(int)

ターン数を秒数に変換する

float TurnsToSeconds(
    int nTurns
);

Parameters

nTurns

秒数に変換したいターン数（整数値）

Description

nTurnsで表されたターン数を秒数に変換し返す。

1ターン60.0秒で計算される。

Remarks

ApplyEffectToObjectはエフェクトの効果時間を秒単位で設定するが、それをターン単位にしたい場合にこの関数が使用される。ゲーム内のほとんどの呪文効果の設定に使われている。

Version

1.22

Example

// NPCの簡単なカスタム呪文。呪文はキャスターのレベル毎に1ターンの効果時間。

void main(){
    int nDurationOfSpell = GetCasterLevel(OBJECT_SELF);
    effect eBonusToApply = EffectAttackIncrease(1);
    object oTargetOfSpell = GetSpellTargetObject();
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonusToApply, oTargetOfSpell, TurnsToSeconds(nDurationOfSpell));
}

See Also

functions: | GetTimeSecond | RoundsToSeconds
categories: | Time Functions | Type Casting/Conversion Functions

author: Charles Feduke, editor: Jeff Lindsey, additional contributor(s): John Shuell, JP team: ngtaicho, Rainie


Function - UniversalSpellMatch

Home > Reference > Functions > Prototyped but Unused > UniversalSpellMatch

UniversalSpellMatch(talent)

この関数は試作されたましたが、使用されていません。

int UniversalSpellMatch(
    talent tUse
);

Parameters

tUse

Description

この関数はBiowareのどのスクリプトにも使用されていなく、文書化もされていません。

Version

1.22

See Also

categories: Prototyped but Unused Functions

author: Tom Cassiotis, editor: Charles Feduke, JP team: katsu794


Function - UnpossessFamiliar

Home > Reference > Functions > Henchmen/Familiars/Summoned > UnpossessFamiliar

UnpossessFamiliar(object)

支配者から憑依している使い魔を取り除きます。

void UnpossessFamiliar(
    object oCreature
);

Parameters

oCreature

取り除く使い魔、または取り除く使い魔を支配しているプレイヤーキャラクター。

Description

この関数は、プレイヤーキャラクターから彼らの使い魔を取り除きます。

この関数は、DMに支配されているクリーチャーには機能しません。

Remarks

始めに、使い魔の召喚を解除するにもかかわらず使い魔が憑依されていない状態になっていないかどうかを確認するために、GetIsPossessedFamiliar関数を呼び出します。

Version

1.30

See Also

functions: | GetIsPossessedFamiliar
categories: | Henchmen/Familiars/Summoned Functions

author: Charles Feduke, editor: Lilac Soul, JP team: katsu794


Function - Vector

Home > Reference > Functions > Movement > Vector

Vector(float, float, float)

vector Vector(
    float fX = 0.0f,
    float fY = 0.0f,
    float fZ = 0.0f
);

Parameters

fX

３点のx地点。（デフォルト：0.0f）

fY

３点のy地点。（デフォルト：0.0f）

fZ

３点のz地点。（デフォルト：0.0f）

Description

fX、fYそしてfZの値で決定されるベクトルを返します。

Version

1.22

See Also

functions: | ActionJumpToLocation | AngleToVector | Location | VectorMagnitude | VectorNormalize | VectorToAngle
categories: | Movement Functions

author: Charles Feduke, JP team: Rainie


Function - VectorMagnitude

Home > Reference > Functions > Movement > VectorMagnitude

VectorMagnitude(vector)

ベクトルの大きさを得ます。

float VectorMagnitude(
    vector vVector
);

Parameters

vVector

Description

（２点の間の距離から得られる）ベクトルの大きさを返します。

Version

1.22

See Also

functions: | Vector
categories: | Movement Functions

author: Tom Cassiotis, JP team: Rainie


Function - VectorNormalize

Home > Reference > Functions > Movement > VectorNormalize

VectorNormalize(vector)

ベクトルを標準化します。

vector VectorNormalize(
    vector vVector
);

Parameters

vVector

Description

vVectorは単位ベクトルであることを強いります；すなわち、１の長さを持っている事。

Version

1.22

See Also

functions: | Vector
categories: | Movement Functions

author: Tom Cassiotis, JP team: Rainie


Function - VectorToAngle

Home > Reference > Functions > Type Casting/Conversion > VectorToAngle

VectorToAngle(vector)

ベクトル変数を角度に変換する。

float VectorToAngle(
    vector vVector
);

Parameters

vVector

角度に変換したいベクトル

Description

与えられたvVectorを、基準となるベクトル(0, 0, 0)と比較し、角度に換えられた値を返す。

Version

1.26

See Also

functions: | AngleToVector | Vector
categories: | Type Casting/Conversion Functions

author: Charles Feduke, editor: John Shuell, additional contributor(s): Cheiron, Keith Voss, JP team: ngtaicho


Function - VerifyCombatMeleeTalent

Home > Reference > Functions > Core AI > VerifyCombatMeleeTalent

VerifyCombatMeleeTalent(talent, object)

Determines whether a combat talent could be used on an object.

int VerifyCombatMeleeTalent(
    talent tUse,
    object oTarget
);

Parameters

tUse

The talent to check if it could be used.

oTarget

The target of the talent.

Description

Returns TRUE if tUse can be used on oTarget, otherwise FALSE.

Remarks

This is a utility function that makes sure that certain talents are not used on Elementals, Undead or Constructs. Specifically it examines the feat sap or stunning fist aren't used on creatures that are not succeptible to those attacks.

Requirements

#include "NW_I0_GENERIC"

Version

1.29

See Also

categories: Core AI Functions

author: Tom Cassiotis, editor: Jody Fletcher


Function - VerifyDisarm

Home > Reference > Functions > Core AI > VerifyDisarm

VerifyDisarm(talent, object)

Determines whether a creature could possibly be disarmed.

int VerifyDisarm(
    talent tUse,
    object oTarget
);

Parameters

tUse

Should be the feat "Disarm" (FEAT_DISARM).

oTarget

The creature that would be the target of a disarm attempt.

Description

Checks that the melee talent being used is Disarm and if so then if the target has a weapon.

This should return TRUE if:
- we are not trying to use disarm
- we are using disarm appropriately

This should return FALSE if:
- we are trying to use disarm on an inappropriate target
- we are using disarm too frequently

Remarks

This has nothing to do with disarming traps.

In Shadows of Undrentide, this function has been moved to X0_I0_MATCH. You can still use it by just including nw_i0_generic, though.

Known Bugs

This isn’t really a bug, but if a talent other than the disarm talent is fed to the function, it will return TRUE.

Requirements

#include "NW_I0_GENERIC"

Version

1.30

See Also

categories: | Core AI Functions
constants: | FEAT_* Constants

author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Lilac Soul


Function - VersusAlignmentEffect

Home > Reference > Functions > Alignment, Effects, Spell Casting Effects, Spells > VersusAlignmentEffect

VersusAlignmentEffect(effect, int, int)

指定のアライメントに対してeEffectを設定します。

effect VersusAlignmentEffect(
    effect eEffect,
    int nLawChaos = ALIGNMENT_ALL,
    int nGoodEvil = ALIGNMENT_ALL
);

Parameters

eEffect

nLawChaos

ALIGNMENT_LAWFUL/ALIGNMENT_CHAOTIC/ALIGNMENT_ALL (デフォルト: ALIGNMENT_ALL)

nGoodEvil

ALIGNMENT_GOOD/ALIGNMENT_EVIL/ALIGNMENT_ALL (デフォルト: ALIGNMENT_ALL)

Description

指定のアライメントのみに対応するような方法に修正された効果を返します。使用する軸に定義されたALIGNMENT_定数を使用してください。

Remarks

これはある特定のアライメントまたはアライメントのグループに対して(あるいは、によって)使用される魔法のエフェクトや特殊アイテムを創る際にとても便利です。それがパラメーターとして2つのALIGNMENT_定数を求めることに注意してください。カオティックイービルに対してのみ影響して欲しい場合、最初のアライメントパラメーターにALIGNMENT_CHAOTICを、そして2個目のパラメーターにALIGNMENT_EVILを設定します。もし、全てのグッド属性のクリーチャーに影響して欲しい場合は、最初のパラメーターにALIGNMENT_ALL（それらがこのエフェクトにカオティックかローな場合は重要ではないので）を設定し、2番目のパラメーターはALIGNMENT_GOODとします。

Version

1.22

Example

// 目標のアライメントがカオティックイービルの場合のみ、
// 魔法の対象の全てのダメージタイプに対する
// アーマークラスの回避ボーナスを1上昇させる。

void main(){
    effect eBonusToApply = EffectACIncrease(1, AC_DODGE_BONUS, AC_VS_DAMAGE_TYPE_ALL);
    eBonusToApply = VersusAlignmentEffect(eBonusToApply, ALIGNMENT_CHAOTIC, ALIGNMENT_EVIL);
    object oTargetOfSpell = GetSpellTargetObject();
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonusToApply, oTargetOfSpell, 60.0);
}

See Also

functions: | ApplyEffectToObject | VersusRacialTypeEffect | VersusTrapEffect
categories: | Alignment Functions | Effects Functions | Spell Casting Effects Functions | Spells Functions
constants: | ALIGNMENT_* Constants

author: John Shuell, editor: Jeremy Spilinek, JP team: Rainie


Function - VersusRacialTypeEffect

Home > Reference > Functions > Effects, Spells, Targeting > VersusRacialTypeEffect

VersusRacialTypeEffect(effect, int)

対特定種族タイプのeEffectを設定します。

effect VersusRacialTypeEffect(
    effect eEffect,
    int nRacialType
);

Parameters

eEffect

nRacialType

RACIAL_TYPE_*

Description

クリーチャーのみの特殊な種族に対するような修正のeffectを返します。使用する種族を定義するためにRACIAL_TYPE_*を使用してください。

Remarks

或いは特定クリーチャーの種族に対抗するための呪文effectや特殊なアイテムを作成する際に、非常に手軽な関数です。それがパラメーターとしてRACIAL_TYPE_定数を使用することに注目してください。エルフのみに効果を与えたい場合、パラメーターをRACIAL_TYPE_ELFに設定してください。巨人タイプのクリーチャーであれば、RACIAL_TYPE_GIANTを設定します。

Version

1.22

Example

// ドラゴンのみに対して追加ダメージを与える剣

void main(){
    effect eBonusToApply = EffectDamageIncrease(20, DAMAGE_TYPE_MAGICAL);
    eBonusToApply = VersusRacialTypeEffect(eBonusToApply, RACIAL_TYPE_DRAGON);
    object oTargetOfSpell = GetSpellTargetObject();
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eBonusToApply, oTargetOfSpell);
}

See Also

functions: | VersusAlignmentEffect | VersusTrapEffect
categories: | Effects Functions | Spells Functions | Targeting Functions
constants: | RACIAL_TYPE_* Constants

author: John Shuell, JP team: Rainie


Function - VersusTrapEffect

Home > Reference > Functions > Effects, Talents/Skills/Feats, Traps > VersusTrapEffect

VersusTrapEffect(effect)

トラップに対してのみ発動される修正エフェクトを指定します。

effect VersusTrapEffect(
    effect eEffect
);

Parameters

eEffect

修正したいエフェクト

Description

トラップに対してeEffectによる修正を指定します。

Remarks

特定のアラインメントに対抗するエフェクト（プロテクション・フロム・イービル等）の働きと同様に、この関数によってトラップに対してのみ適応される、反応セーブや敏捷力、捜索や視認スキルの修正を指定します。

Version

1.22

See Also

functions: | VersusAlignmentEffect | VersusRacialTypeEffect
categories: | Effects Functions | Talents/Skills/Feats Functions | Traps Functions

author: John Shuell, JP team: geshi


Function - VictimDead

Home > Reference > Functions > Module Specific > VictimDead

VictimDead()

犠牲者が死んでいるかどうかを決定します。

int VictimDead();

Description

暗殺者プロットの犠牲者が死んでいる場合、TRUEを返し、そうでない場合、 FALSEを返します。

Remarks

NWNの暗殺者プロットを作動させるために使用されます。

Requirements

#include "nw_j_assassin"

Version

1.22

Example

// バージョン1.24におけるこの関数のソース

//::///////////////////////////////////////////////
//:: VictimDead
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
     m暗殺者プロットの犠牲者が死んでいる場合、TRUEを返します。
*/
//:://////////////////////////////////////////////
//:: Created By:   Brent
//:: Created On:   December 2001
//:://////////////////////////////////////////////

int VictimDead()
{
        if (!GetIsObjectValid(GetVictim()))
        {
            return TRUE;
        }
            return FALSE;
}

See Also

functions: | GetVictim | SetVictim
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - VictimDeadButNoItems

Home > Reference > Functions > Module Specific > VictimDeadButNoItems

VictimDeadButNoItems(object)

犠牲者は死んでいるが、oPCがその頭部あるいは個人アイテムのいずれも持っていないかどうかを決定します。そうでなけばFALSEを返します。

int VictimDeadButNoItems(
    object oPC
);

Parameters

oPC

状態を調べる犠牲者。

Description

犠牲者oPCが死んでいて、oPCがその頭部あるいは個人アイテムのいずれも持っていない場合、TRUEを返します。そうでなければFALSEを返します。

Remarks

NWNの暗殺者プロットを作動させるために使用されます。

Requirements

#include "nw_j_assassin"

Version

1.22

See Also

functions: | GetVictim | SetVictim
categories: | Module Specific Functions

author: Tom Cassiotis, JP team: katsu794


Function - WalkWayPoints

Home > Reference > Functions > Core AI, Movement > WalkWayPoints

WalkWayPoints(int, float)

NPCクリーチャーに予め設定した一連のウェイポイントを歩かせます。

void WalkWayPoints(
    int nRun = FALSE,
    float fPause = 1.0
);

Parameters

nRun

NPCが歩くか走るかを決定します。（デフォルト：FALSE）

fPause

個々のウェイポイントで休止する時間（秒）。（デフォルト：1.0）

Description

呼出者を前もって設定した特別なtagをつけたウェイポイントを歩かせ（nRunがTRUEなら走る）、個々のウェイポイントで立ち止まります。

Remarks

歩くウェイポイントのtagの書式は「"WP_”+ NPCのtag名 +"_0#"」でなければなりません。（例：WP_CITYGUARD_01）。#はNPCが歩くウェイポイントの順番です。そしてもう一つ、「"POST_"+ NPCのtag名」だと、NPCは戦闘終了後、このウェイポイントに戻ってきます。ウェイポイントの名前は大文字・小文字を区別します。

クリーチャーがウェイポイントを歩いている際に、なんらかの理由があって（すなわち敵と遭遇等）それをやめたとしても、その後、最も近いウェイポイントに戻って再び歩き始めます。これを回避するために、独自のWalkWayPoint関数を作成しなければなりません。もし独自のWalkWayPoint関数を作成するならば、標準的な先頭に"WP_"がついた名前を持ったウェイポイントを命名することはできません。

Known Bugs

SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS)かSetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS)のどちらか一方を持ったキャラクターにフラグを立てる場合、walkwaypointsは問題を持っています。

初めは素晴らしく動作しますが、キャラクターが他の何かをする場合に歩くことをやめます。WalkWayPoints();命令を与えた時、再び同じように歩かせることができません。

Requirements

#include "NW_I0_GENERIC"

Version

1.28

See Also

functions: | ActionRandomWalk | CheckWayPoints | RunCircuit
categories: | Core AI Functions | Movement Functions

author: Ryan Hunt, editor: Charles Feduke, additional contributor(s): Ivan Hawkes, Diwall, Graziano Lenzi, JP team: Rainie


Function - WillSave

Home > Reference > Functions > Saving Throw > WillSave

WillSave(object, int, int, object)

意志セーブ判定を実行する。

int WillSave(
    object oCreature,
    int nDC,
    int nSaveType = SAVING_THROW_TYPE_NONE,
    object oSaveVersus = OBJECT_SELF
);

Parameters

oCreature

セービングスローを振らなければならないクリーチャー

nDC

セービングスローの難易度

nSaveType

SAVING_THROW_TYPE_* (デフォルト：SAVING_THROW_TYPE_NONE)

oSaveVersus

セービングスローを引き起こす主体(デフォルト：OBJECT_SELF)

Description

与えられた難易度で反応セーブ判定を行う。

セービングスローに失敗した場合は、0を返す。
セービングスローに成功した場合は、1を返す。
特定のセーブのタイプに対する免疫がターゲットにある場合は、2を返す。

Version

1.22

See Also

functions: | FortitudeSave | ReflexSave
categories: | Saving Throw Functions
constants: | SAVING_THROW_TYPE_* Constants

author: Tom Cassiotis, JP team: weed


Function - WriteTimestampedLogEntry

Home > Reference > Functions > Debug > WriteTimestampedLogEntry

WriteTimestampedLogEntry(string)

文字列の前に時刻表示を付けてログファイルに記録します。

void WriteTimestampedLogEntry(
    string sLogEntry
);

Parameters

sLogEntry

Description

sLogEntryを日付表示項目と共にログファイルに書き出します。

Version

1.22

Example

// この関数の呼び出すと、"[Fri Jul 12 12:08:03] Test"がログファイルに書き出されるでしょう。
WriteTimestampedLogEntry("Test");

See Also

functions: | DebugPrintTalentID
categories: | Debug Functions

author: Tom Cassiotis, JP team: katsu794


Function - YardsToMeters

Home > Reference > Functions > Type Casting/Conversion > YardsToMeters

YardsToMeters(float)

ヤード単位の距離をメートルに変換する

float YardsToMeters(
    float fYards
);

Parameters

fYards

メートル単位に変換したいヤード数（浮動小数値）

Description

fYardsで表されたヤード単位の距離をメートルに変換する

1ヤード＝0.9143999817メートルで計算される。

※ 桁が大きいと0.9144で計算される

Version

1.22

Example

// 結果は 3.200399876 メートルになる
function fExample()
{
     float fMeters = YardsToMeters(3.5);
     return fMeters;
}

See Also

functions: | FeetToMeters
categories: | Type Casting/Conversion Functions

author: Brett Lathrope, editor: Charles Feduke, JP team: ngtaicho


LexiconJP-BBS | About | Reference | Lyceum | Resources | Contributors


Category - Functions

NWN C-Script Functions

ファンクション

カテゴリー別

カテゴリー一覧

implies Lexicon authored
implies BioWare original (to do)

abs
acos
ActionAttack
ActionCastFakeSpellAtLocation
ActionCastFakeSpellAtObject
ActionCastSpellAtLocation
ActionCastSpellAtObject
ActionCloseDoor
ActionCounterSpell
ActionCreate
ActionDoCommand
ActionEquipItem
ActionEquipMostDamagingMelee
ActionEquipMostDamagingRanged
ActionEquipMostEffectiveArmor
ActionForceFollowObject
ActionForceMoveToLocation
ActionForceMoveToObject
ActionGiveItem
ActionInteractObject
ActionJumpToLocation
ActionJumpToObject
ActionLockObject
ActionMoveAwayFromLocation
ActionMoveAwayFromObject
ActionMoveToLocation
ActionMoveToObject
ActionOpenDoor
ActionPauseConversation
ActionPickUpItem
ActionPlayAnimation
ActionPutDownItem
ActionRandomWalk
ActionRest
ActionResumeConversation
ActionSit
ActionSpeakString
ActionSpeakStringByStrRef
ActionStartConversation
ActionTakeItem
ActionUnequipItem
ActionUnlockObject
ActionUseFeat
ActionUseSkill
ActionUseTalentAtLocation
ActionUseTalentOnObject
ActionWait
ActivateFleeToExit
ActivatePortal
ActivePortal
AddHenchman
AddJournalQuestEntry
AddToParty
AdjustAlignment
AdjustFactionReputation
AdjustReputation
aGetPLocalInt
AmbientSoundChangeDay
AmbientSoundChangeNight
AmbientSoundPlay
AmbientSoundSetDayVolume
AmbientSoundSetNightVolume
AmbientSoundStop
AngleToVector
ApplyEffectAtLocation
ApplyEffectToObject
ApplyPenalty
ApplyPrismaticEffect
aSetPLocalInt
asin
AssignAOEDebugString
AssignCommand
AssignPCDebugString
AssociateCheck
atan
AutoAlignE
AutoAlignG
AutoDC

BashDoorCheck
BeginConversation
BlackScreen
BootPC
BringBack

CanAfford
CanAffordIt
CanSeePlayer
ChangeFaction
ChangeToStandardFaction
CheckCharismaHigh
CheckCharismaLow
CheckCharismaMiddle
CheckCharismaNormal
CheckEnemyGroupingOnTarget
CheckFriendlyFireOnTarget
CheckIntelligenceHigh
CheckIntelligenceLow
CheckIntelligenceNormal
CheckIsUnlocked
CheckPartyForItem
CheckWayPoints
CheckWisdomHigh
chooseTactics
ClearAllActions
ClearAllFactionMembers
ClearArena
ClearPersonalReputation
CompareLastSpellCast
CopyItem
CopyLocals
CopyObject
cos
CreateAmmo
CreateAnimalPart
CreateArcaneScroll
CreateBalor
CreateBastardSword
CreateBattleAxe
CreateBook
CreateClub
CreateColmarrPotion
CreateDagger
CreateDart
CreateDireMace
CreateDivineScroll
CreateDoomEffectsLink
CreateDoubleAxe
CreateFetchItemOn
CreateForgeItem
CreateGem
CreateGenericClassItem
CreateGenericDruidWeapon
CreateGenericExotic
CreateGenericHeavyArmor
CreateGenericLightArmor
CreateGenericMartial
CreateGenericMediumArmor
CreateGenericMiscItem
CreateGenericMonkWeapon
CreateGenericRodStaffWand
CreateGenericSimple
CreateGenericWizardWeapon
CreateGold
CreateGreatAxe
CreateGreatSword
CreateHalberd
CreateHandAxe
CreateHealingKit
CreateHeavyCrossbow
CreateHeavyFlail
CreateItemOnObject
CreateJewel
CreateJunk
CreateKama
CreateKatana
CreateKit
CreateKukri
CreateLightCrossbow
CreateLightFlail
CreateLightHammer
CreateLightMace
CreateLockPick
CreateLongbow
CreateLongSword
CreateMorningstar
CreateObject
CreateObjectVoid
CreatePersonalItemOn
CreatePotion
CreateProtectionFromAlignmentLink
CreateRapier
CreateScimitar
CreateScythe
CreateShortbow
CreateShortsword
CreateShuriken
CreateSickle
CreateSignPostNPC
CreateSling
CreateSpear
CreateSpecificDruidWeapon
CreateSpecificExotic
CreateSpecificHeavyArmor
CreateSpecificLightArmor
CreateSpecificMartial
CreateSpecificMediumArmor
CreateSpecificMiscItem
CreateSpecificMonkWeapon
CreateSpecificRodStaffWand
CreateSpecificSimple
CreateSpecificWizardWeapon
CreateStaff
CreateTable2Item
CreateThrowingAxe
CreateTrapKit
CreateTwoBladedSword
CreateWarhammer

d10
d100
d12
d2
d20
d3
d4
d6
d8
dbCreateItemOnObject
dbSpeak
DebugPrintTalentID
DebugSpeak
DebugSTR
DecrementRemainingFeatUses
DecrementRemainingSpellUses
DelayCommand
DeleteCampaignVariable
DeleteLocalFloat
DeleteLocalInt
DeleteLocalLocation
DeleteLocalObject
DeleteLocalString
DestroyAllPersonalItems
DestroyCampaignDatabase
DestroyChapterQuestItem
DestroyChapterRewardItem
DestroyObject
DetermineAssociateCombatRound
DetermineClassToUse
DetermineCombatRound
DetermineEnemies
DetermineSpecialBehavior
DimensionHop
DoDoorAction
DoFollowMaster
DoGiveXP
DoLevelUp
DoOnce
DoPlaceableObjectAction
DoSinglePlayerAutoSave
DrinkIt
DubugPrintTalentID

EffectAbilityDecrease
EffectAbilityIncrease
EffectACDecrease
EffectACIncrease
EffectAppear
EffectAreaOfEffect
EffectAttackDecrease
EffectAttackIncrease
EffectBeam
EffectBlindness
EffectCharmed
EffectConcealment
EffectConfused
EffectCurse
EffectCutsceneDominated
EffectCutsceneParalyze
EffectDamage
EffectDamageDecrease
EffectDamageImmunityDecrease
EffectDamageImmunityIncrease
EffectDamageIncrease
EffectDamageReduction
EffectDamageResistance
EffectDamageShield
EffectDarkness
EffectDazed
EffectDeaf
EffectDeath
EffectDisappear
EffectDisappearAppear
EffectDisease
EffectDispelMagicAll
EffectDispelMagicBest
EffectDominated
EffectEntangle
EffectEthereal
EffectFrightened
EffectHaste
EffectHeal
EffectHitPointChangeWhenDying
EffectImmunity
EffectInvisibility
EffectKnockdown
EffectLinkEffects
EffectMissChance
EffectModifyAttacks
EffectMovementSpeedDecrease
EffectMovementSpeedIncrease
EffectNegativeLevel
EffectParalyze
EffectPetrify
EffectPoison
EffectPolymorph
EffectRegenerate
EffectResurrection
EffectSanctuary
EffectSavingThrowDecrease
EffectSavingThrowIncrease
EffectSeeInvisible
EffectSilence
EffectSkillDecrease
EffectSkillIncrease
EffectSleep
EffectSlow
EffectSpellFailure
EffectSpellImmunity
EffectSpellLevelAbsorption
EffectSpellResistanceDecrease
EffectSpellResistanceIncrease
EffectStunned
EffectSummonCreature
EffectSwarm
EffectTemporaryHitpoints
EffectTimeStop
EffectTrueSeeing
EffectTurned
EffectTurnResistanceDecrease
EffectTurnResistanceIncrease
EffectUltravision
EffectVisualEffect
EndGame
EndModule
EquipAppropriateWeapons
EscapeArea
EscapeViaTeleport
EventActivateItem
EventConversation
EventSpellCastAt
EventUserDefined
ExecuteScript
ExitAOESpellArea
ExploreAreaForPlayer
ExportAllCharacters
ExportSingleCharacter
ExtraordinaryEffect

fabs
FaceNearestPC
FadeFromBlack
FadeToBlack
FakeRestore
FeetToMeters
FindSingleRangedTarget
FindSubString
FindTarget
FloatingTextStringOnCreature
FloatingTextStrRefOnCreature
FloatToInt
FloatToString
FortitudeSave

GenerateBookTreasure
GenerateBossTreasure
GenerateHighTreasure
GenerateLowTreasure
GenerateMediumTreasure
GenerateNPCTreasure
GenerateTreasure
Get2DAString
GetAbilityModifier
GetAbilityScore
GetAC
GetAge
GetAILevel
GetAlignmentGoodEvil
GetAlignmentLawChaos
GetAlliedHD
GetAnimalCompanionCreatureType
GetAnimalCompanionName
GetAppearanceType
GetArea
GetAreaFromLocation
GetAreaOfEffectCreator
GetArtifactItem
GetAssassinHead
GetAssociate
GetAssociateCRMax
GetAssociateHealMaster
GetAssociateStartLocation
GetAssociateState
GetAttackCompatibility
GetAttackTarget
GetAttemptedAttackTarget
GetAttemptedSpellTarget
GetBackpackMatch
GetBaseAttackBonus
GetBaseItemType
GetBeenHired
GetBehaviorState
GetBehind
GetBlockingDoor
GetCalendarDay
GetCalendarMonth
GetCalendarYear
GetCampaignFloat
GetCampaignInt
GetCampaignLocation
GetCampaignString
GetCampaignVector
GetCanCastHealingSpells
GetCanLevelUp
GetCanSeePC
GetCasterLevel
GetChallengeRating
GetChapter
GetCharacterLevel
GetCharisma
GetClassByPosition
GetClickingObject
GetCommandable
GetComplexItem
GetCreatureHasTalent
GetCreatureSize
GetCreatureTalentBest
GetCreatureTalentRandom
GetCurrentAction
GetCurrentHitPoints
GetDamageDealtByType
GetDefensiveCastingMode
GetDeity
GetDetectMode
GetDialogSoundLength
GetDidDie
GetDistanceBetween
GetDistanceBetweenLocations
GetDistanceToObject
GetDroppableFlag
GetEffectCreator
GetEffectDurationType
GetEffectSpellId
GetEffectSubType
GetEffectType
GetEncounterActive
GetEncounterDifficulty
GetEncounterSpawnsCurrent
GetEncounterSpawnsMax
GetEnemyHD
GetEnteringObject
GetExitingObject
GetFacing
GetFacingFromLocation
GetFactionAverageGoodEvilAlignment
GetFactionAverageLawChaosAlignment
GetFactionAverageLevel
GetFactionAverageReputation
GetFactionAverageXP
GetFactionBestAC
GetFactionEqual
GetFactionGold
GetFactionLeader
GetFactionLeastDamagedMember
GetFactionMostDamagedMember
GetFactionMostFrequentClass
GetFactionStrongestMember
GetFactionWeakestMember
GetFactionWorstAC
GetFamiliarCreatureType
GetFamiliarName
GetFetchee
GetFetchItem
GetFirstEffect
GetFirstFactionMember
GetFirstInPersistentObject
GetFirstItemInInventory
GetFirstObjectInArea
GetFirstObjectInShape
GetFirstPC
GetFleeToExit
GetFollowDistance
GetForgeMatch
GetFormerMaster
GetFortitudeSavingThrow
GetGameDifficulty
GetGender
GetGoingToBeAttackedBy
GetGold
GetGoldPieceValue
GetGoodEvilValue
GetGreetingVar
GetHas2Q4PlotItem
GetHasEffect
GetHasFeat
GetHasFeatEffect
GetHasInventory
GetHasSkill
GetHasSpell
GetHasSpellEffect
GetHenchman
GetHitDice
GetIdentified
GetIdFromTalent
GetImmortal
GetIntelligence
GetInventoryDisturbItem
GetInventoryDisturbType
GetIsAreaAboveGround
GetIsAreaNatural
GetIsDawn
GetIsDay
GetIsDead
GetIsDM
GetIsDMPossessed
GetIsDoorActionPossible
GetIsDusk
GetIsEffectValid
GetIsEncounterCreature
GetIsEnemy
GetIsFighting
GetIsFriend
GetIsImmune
GetIsInCombat
GetIsListening
GetIsMagical
GetIsNeutral
GetIsNight
GetIsObjectValid
GetIsOpen
GetIsPC
GetIsPlaceableObjectActionPossible
GetIsPlayableRacialType
GetIsPossessedFamiliar
GetIsPostOrWalking
GetIsReactionTypeFriendly
GetIsReactionTypeHostile
GetIsReactionTypeNeutral
GetIsResting
GetIsSkillSuccessful
GetIsTalentValid
GetIsTrapped
GetIsValidCombination
GetIsWeaponEffective
GetItemActivated
GetItemActivatedTarget
GetItemActivatedTargetLocation
GetItemActivator
GetItemACValue
GetItemCharges
GetItemHasItemProperty
GetItemInInventory
GetItemInSlot
GetItemPosition
GetItemPossessedBy
GetItemPossessor
GetItemStackSize
GetJournalQuestExperience
GetLastAssociateCommand
GetLastAttacker
GetLastAttackMode
GetLastAttackType
GetLastClosedBy
GetLastDamager
GetLastDisarmed
GetLastDisturbed
GetLastGenericSpellCast
GetLastHostileActor
GetLastKiller
GetLastLocked
GetLastOpenedBy
GetLastOpener
GetLastPCRested
GetLastPCToCancelCutscene
GetLastPerceived
GetLastPerceptionHeard
GetLastPerceptionInaudible
GetLastPerceptionSeen
GetLastPerceptionVanished
GetLastPlayerDied
GetLastPlayerDying
GetLastRespawnButtonPresser
GetLastRestEventType
GetLastSpeaker
GetLastSpell
GetLastSpellCaster
GetLastSpellHarmful
GetLastTrapDetected
GetLastUnlocked
GetLastUsedBy
GetLastWeaponUsed
GetLawChaosValue
GetLevelByClass
GetLevelByPosition
GetListenPatternNumber
GetLocalArrayInt
GetLocalArrayString
GetLocalFloat
GetLocalInt
GetLocalLocation
GetLocalObject
GetLocalPlotIntFromCharacter
GetLocalString
GetLocation
GetLocked
GetLockedObject
GetLockKeyRequired
GetLockKeyTag
GetLockLockable
GetLockLockDC
GetLockUnlockDC
GetMachineState
GetMaster
GetMatchCompatibility
GetMatchedSubstring
GetMatchedSubstringsCount
GetMaxHitPoints
GetMetaMagicFeat
GetModule
GetModuleItemAcquired
GetModuleItemAcquiredBy
GetModuleItemAcquiredFrom
GetModuleItemAcquiredStackSize
GetModuleItemLost
GetModuleItemLostBy
GetModuleName
GetMostDangerousClass
GetMovementRate
GetMyArea
GetMyMaster
GetName
GetNearestCreature
GetNearestCreatureToLocation
GetNearestObject
GetNearestObjectByTag
GetNearestObjectToLocation
GetNearestPC
GetNearestSeenOrHeardEnemy
GetNearestTrapToObject
GetNextEffect
GetNextFactionMember
GetNextInPersistentObject
GetNextItemInInventory
GetNextObjectInArea
GetNextObjectInShape
GetNextPC
GetNPCWarningStatus
GetNumberOfItems
GetNumberOfMeleeAttackers
GetNumberOfRangedAttackers
GetNumItems
GetNumStackedItems
GetObjectByTag
GetObjectHeard
GetObjectNeedsHealing
GetObjectSeen
GetObjectType
GetPCIPAddress
GetPCLevellingUp
GetPCPlayerName
GetPCPublicCDKey
GetPCSpeaker
GetPercentageHPLoss
GetPersonalItem
GetPlaceableIllumination
GetPLocalInt
GetPlotFlag
GetPlotGiver
GetPlotJournal
GetPlotRingTag
GetPlotTag
GetPlotToken
GetPosition
GetPositionFromLocation
GetPrisoner
GetRacialType
GetRacialTypeCount
GetRandomDelay
GetRange
GetRangedAttackGroup
GetReactionAdjustment
GetReflexAdjustedDamage
GetReflexSavingThrow
GetReputation
GetResRef
GetRingGivenTo
GetRunState
GetScaledDuration
GetScaledEffect
GetSittingCreature
GetSkillRank
GetSpawnInCondition
GetSpellBreachProtection
GetSpellCastItem
GetSpellEffectDelay
GetSpellId
GetSpellSaveDC
GetSpellTargetLocation
GetSpellTargetObject
GetStandardFactionReputation
GetStartingLocation
GetStartLocation
GetStealthMode
GetStolenFlag
GetStoryItem
GetStringByStrRef
GetStringLeft
GetStringLength
GetStringLowerCase
GetStringRight
GetStringUpperCase
GetStrRefSoundDuration
GetSubRace
GetSubString
GetTag
GetTileMainLight1Color
GetTileMainLight2Color
GetTileSourceLight1Color
GetTileSourceLight2Color
GetTimeHour
GetTimeMillisecond
GetTimeMinute
GetTimeSecond
GetTotalDamageDealt
GetToughestAttacker
GetToughestMeleeAttacker
GetTransitionTarget
GetTrapBaseType
GetTrapCreator
GetTrapDetectable
GetTrapDetectDC
GetTrapDetectedBy
GetTrapDisarmable
GetTrapDisarmDC
GetTrapFlagged
GetTrapKeyTag
GetTrapOneShot
GetTurnResistanceHD
GetTypeFromTalent
GetUniform
GetUseableFlag
GetUserDefinedEventNumber
GetValidItem
GetValidItemCost
GetValidWeapon
GetVictim
GetWaypointByTag
GetWeaponFocus
GetWeaponRanged
GetWeather
GetWeight
GetWillSavingThrow
GetWisdom
GetWorkingForPlayer
GetXP
Give2Q4PlotItem
GiveChapterRewardItem
GiveFetchItemToPC
GiveGoldToCreature
GiveNumItems
GivePersonalItem
GivePlayerPersonalItem
GiveRingToPlayer
GiveXPToCreature
Global
gplotAppraiseOpenStore
GreaterRestore

HasAnyItemOfBaseType
HasChapterQuestItem
HasChapterRewardItem
HasGold
HasItem
HasPersonalItem
HasSpell
HoursToSeconds

InsertString
IntToFloat
IntToHexString
IntToString
IsBusy
IsInConversation
IsMisc
IsRecall
IsValidBaseItem

JumpToLocation
JumpToObject
JumpToWeakestEnemy

LevelUpHenchman
Location
log

MagicalEffect
main
MakeDrunk
MakeWay
MatchCombatProtections
MatchElementalProtections
MatchFortAttacks
MatchReflexAttacks
MatchSpellProtections
MoveTo2Q4PlotPoint
MusicBackgroundChangeDay
MusicBackgroundChangeNight
MusicBackgroundGetBattleTrack
MusicBackgroundGetDayTrack
MusicBackgroundGetNightTrack
MusicBackgroundPlay
MusicBackgroundSetDelay
MusicBackgroundStop
MusicBattleChange
MusicBattlePlay
MusicBattleStop
MyPrintString
MyResistSpell
MySavingThrow

nDetermineClassToUse
NextTag
nNumberOfCombos

ObjectToString
OpenInventory
OpenNearestLock
OpenStore

PC
PCAcceptedPlot
PlayAnimation
PlayCharacterTheme
PlayConversationAnimation
PlayDragonBattleCry
PlayerHasArtifactItem
PlayerHasComplexItem
PlayerHasFetchItem
PlayerHasHead
PlayerHasPersonalItem
PlayerHasRing
PlayerHasStoryItem
PlayerWearsUniform
PlayImmobileAmbientAnimations
PlayMobileAmbientAnimations
PlayOldTheme
PlaySound
PlaySoundByStrRef
PlaySuccessVisual
PlayVoiceChat
PlotGiverDead
PopUpDeathGUIPanel
PopUpGUIPanel
pow
Prefers
PrintFloat
PrintInteger
PrintObject
PrintString
PrintVector

Raise
Random
RandomName
RecomputeStaticLighting
ReflexSave
RemoveAmbientSleep
RemoveEffect
RemoveEffects
RemoveFromParty
RemoveHenchman
RemoveJournalQuestEntry
RemoveProtections
RemoveSpecificEffect
RemoveSpellEffects
RemoveSummonedAssociate
ResetHenchmenState
ResistSpell
RespondToShout
RestoreCameraFacing
RetrieveCampaignObject
RewardGP
RewardPartyGP
RewardPartyXP
RewardXP
RoundsToSeconds
RunCircuit
RunDrownImpact
RunMelfAcidImpact
RunNextCircuit

SearchForPlayer
SendMessageToAllDMs
SendMessageToPC
SetAILevel
SetAreaTransitionBMP
SetArtifactItem
SetAssassinHead
SetAssociateListenPatterns
SetAssociateStartLocation
SetAssociateState
SetBeenHired
SetBehaviorState
SetCalendar
SetCameraFacing
SetCameraMode
SetCampaignFloat
SetCampaignInt
SetCampaignLocation
SetCampaignString
SetCampaignVector
SetCommandable
SetComplexItem
SetCustomToken
SetCutsceneMode
SetDeity
SetDidDie
SetDoubleCrosserName
SetDroppableFlag
SetEncounterActive
SetEncounterDifficulty
SetEncounterSpawnsCurrent
SetEncounterSpawnsMax
SetFacing
SetFacingPoint
SetFetchee
SetFetchItem
SetFormerMaster
SetGlobal
SetGreetingVar
SetIdentified
SetImmortal
SetIsBusy
SetIsDestroyable
SetIsEnemy
SetIsTemporaryEnemy
SetIsTemporaryFriend
SetIsTemporaryNeutral
SetItemCharges
SetItemStackSize
SetLastGenericSpellCast
SetListening
SetListeningPatterns
SetListenPattern
SetLocalArrayInt
SetLocalArrayString
SetLocalFloat
SetLocalInt
SetLocalLocation
SetLocalObject
SetLocalPlotIntOnCharacter
SetLocalString
SetLocked
SetMachineState
SetMapPinEnabled
SetNPCWarningStatus
SetPanelButtonFlash
SetPCDislike
SetPCLike
SetPersonalItem
SetPlaceableIllumination
SetPLocalInt
SetPlotFlag
SetPlotGiver
SetPlotJournal
SetPlotRing
SetPlotTag
SetPlotToken
SetPrisoner
SetRingGivenTo
SetSpawnInCondition
SetSpawnInLocals
SetStandardFactionReputation
SetStoryItem
SetStoryVar
SetSubRace
SetSummonEffect
SetSummonHelpIfAttacked
SetTileMainLightColor
SetTileSourceLightColor
SetTime
SetTrapDetectedBy
SetTrapDisabled
SetUniform
SetValidItem
SetValidItemCost
SetValidItemCostToken
SetVictim
SetWayPointTo1
SetWeather
SetWorkingForPlayer
SetXP
ShadowBolt
ShoutDisturbed
SignalEvent
sin
SoundObjectPlay
SoundObjectSetPosition
SoundObjectSetVolume
SoundObjectStop
SpawnHenchman
SpawnScriptDebugger
SpeakOneLinerConversation
SpeakQuickChat
SpeakString
SpeakStringByStrRef
SpellDelay
sqrt
StartAttackLoop
StartingConditional
StartNewModule
StartProtectionLoop
StopFade
StoreCameraFacing
StoreCampaignObject
StringToFloat
StringToInt
StripAllPersonalItemsFromEveryone
StripEffects
SummonAnimalCompanion
SummonFamiliar
SupernaturalEffect
SurrenderToEnemies

TakeArtifactItem
TakeComplexItem
TakeFetchItem
TakeGold
TakeGoldFromCreature
TakeNumItems
TakeStoryItem
TalentAdvancedBuff
TalentAdvancedProtectSelf
TalentBardSong
TalentBuffSelf
TalentCureCondition
TalentDragonCombat
TalentEnhanceOthers
TalentFeat
TalentFlee
TalentHeal
TalentHealingSelf
TalentMeleeAttack
TalentMeleeAttacked
TalentPersistentAbilities
TalentRangedAttackers
TalentRangedEnemies
TalentSeeInvisible
TalentSkill
TalentSneakAttack
TalentSpell
TalentSpellAttack
TalentSummonAllies
TalentUseEnhancementOnSelf
TalentUseProtectionOnSelf
TalentUseProtectionOthers
TalentUseTurning
tan
TestStringAgainstPattern
TouchAttackMelee
TouchAttackRanged
TrimLevel
TurnsToSeconds

UniversalSpellMatch
UnpossessFamiliar

Vector
VectorMagnitude
VectorNormalize
VectorToAngle
VerifyCombatMeleeTalent
VerifyDisarm
VersusAlignmentEffect
VersusRacialTypeEffect
VersusTrapEffect
VictimDead
VictimDeadButNoItems

WalkWayPoints
WillSave
WriteTimestampedLogEntry

YardsToMeters


Category - Functions

NWN C-Script Function Categories

ファンクション　カテゴリー別

アルファベット順

カテゴリー一覧

変数

01.Local Variables (28)
02.Math (23)

03.String (15)

04.Type Casting/Conversion (13)

関数

05.Function (49)

06.Private Functions (12)

オブジェクト

07.Action on Object (78)

08.Targeting (19)

データ取得

09.Get Data (32)

10.Get Data from Creature (100)

11.Get Data from Object (55)

プレーヤーキャラクター関連

12.Alignment (11)

13.Conversation (24)

14.Experience (9)

15.Journal (3)

16.Money (10)

17.PC Only (30)

アイテム

18.Inventory (51)

19.Item Creation (100)

キャラクター

20.Henchmen/Familiars/Summoned (68)

21.Party (21)

22.Reputation/Faction (41)

行動･技能

23.Movement (34)

24.Perception (14)

25.Saving Throw (10)

26.Spells (49)

27.Talents/Skills/Feats (42)

AI

28.Core AI (67)

29.Core AI Talent (23)

戦闘

30.Combat (19)

31.Combat Actions (19)

32.Combat Information (26)

効果

33.Cut-Scene (11)

34.Effects (107)

35.Lighting Effects (8)

36.Music Effects (13)

37.Sound Effects (16)

38.Spell Casting Effects (25)

39.Visual Effects (15)

場所に関係するもの

40.Area (33)

41.Encounter (12)

42.Module (24)

43.Module Specific (82)

44.Traps (18)

その他

45.Database (15)

46.Debug (18)

47.Miscellaneous (52)

48.Prototyped but Unused (17)

49.Server (7)

50.Time (19)


Category - Functions

NWN C-Script Function Categories

ファンクション　カテゴリー一覧

アルファベット順

カテゴリー別
Action on Object (78)
Alignment (11)
Area (33)
Combat (19)
Combat Actions (19)
Combat Information (26)
Conversation (24)
Core AI (67)
Core AI Talent (23)
Cut-Scene (11)
Database (15)
Debug (18)
Effects (107)
Encounter (12)
Experience (9)
Function (49)
Get Data (37)
Get Data from Creature (100)
Get Data from Object (55)
Henchmen/Familiars/Summoned (68)
Inventory (51)
Item Creation (100)
Journal (3)
Lighting Effects (8)
Local Variables (28)
Math (23)
Miscellaneous (52)
Module (24)
Module Specific (82)
Money (10)
Movement (34)
Music Effects (13)
Party (21)
PC Only (30)
Perception (14)
Private Functions (12)
Prototyped but Unused (17)
Reputation/Faction (41)
Saving Throw (10)
Server (7)
Sound Effects (16)
Spell Casting Effects (25)
Spells (49)
String (15)
Talents/Skills/Feats (42)
Targeting (19)
Time (19)
Traps (18)
Type Casting/Conversion (13)
Visual Effects (15)


Primer - Code Block Deliminator

Home > Lyceum > Primer > Basics > Code Block Deliminator

Code Block Deliminator

The code block deliminator breaks code up into different sections of statements; variables declared within these sections are scoped - that is are in memory and can be accessed - and can be accessed only in the section where they are declared or sections that appear within that section (child sections). A code block begins with a left curly brace ("{") and ends with a right curly brace ("}").

Functions, loops, structs, and conditionals all make use of code block deliminators. Conditional statements and loops (do, while, and for) do not require a code block deliminator if their total number of statements (or logical lines) do not exceed one. It is also possible to use anonymous code blocks for variable scoping only.

void main()
{ // start of the main code block
     {
          // inside of an anonmous code block
          int n = 13;
     }
     // the integer n is no longer scoped
     int x = 0;
     // a single line loop doesn't require code block deliminators
     // but still may be used
     while (x < 10)
          x++;
     for (x = 10; x <= 30; x++)
     {
          // this for loop has multiple statements
          PrintInteger(x);
          if (x > 25)
               PrintString("x is greater than 25.");
          else
               PrintString("x is less than or equal to 25.");
     }
} // end of the main code block

author: Charles Feduke