summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c476
1 files changed, 238 insertions, 238 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 00f4b0b..fdc1df2 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -91,8 +91,8 @@ int scriptlabel_final (void *k, void *d, va_list ap)
}
static char pos[11][100] =
- { "��", "��", "����", "�E��", "���[�u", "�C", "�A�N�Z�T���[1",
- "�A�N�Z�T���[2", "��2", "��3", "�������Ă��Ȃ�"
+ { "頭", "体", "左手", "右手", "ローブ", "靴", "アクセサリー1",
+ "アクセサリー2", "頭2", "頭3", "装着していない"
};
static struct Script_Config
@@ -108,7 +108,7 @@ static int parse_cmd_if = 0;
static int parse_cmd;
/*==========================================
- * ���[�J���v���g�^�C�v�錾 (�K�v�ȕ��̂�)
+ * ローカルプロトタイプ宣言 (必要な物のみ)
*------------------------------------------
*/
unsigned char *parse_subexpr (unsigned char *, int);
@@ -754,7 +754,7 @@ enum
};
/*==========================================
- * �������̃n�b�V�����v�Z
+ * 文字列のハッシュを計算
*------------------------------------------
*/
static int calc_hash (const unsigned char *p)
@@ -769,10 +769,10 @@ static int calc_hash (const unsigned char *p)
}
/*==========================================
- * str_data�̒��ɖ��O�����邩�����
+ * str_dataの中に名前があるか検索する
*------------------------------------------
*/
-// �����̂ł����Δԍ��A��������-1
+// 既存のであれば番号、無ければ-1
static int search_str (const unsigned char *p)
{
int i;
@@ -789,10 +789,10 @@ static int search_str (const unsigned char *p)
}
/*==========================================
- * str_data�ɖ��O���o�^
+ * str_dataに名前を登録
*------------------------------------------
*/
-// �����̂ł����Δԍ��A�������Γo�^���ĐV�K�ԍ�
+// 既存のであれば番号、無ければ登録して新規番号
static int add_str (const unsigned char *p)
{
int i;
@@ -852,7 +852,7 @@ static int add_str (const unsigned char *p)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�T�C�Y�̊m�F�Ɗg��
+ * スクリプトバッファサイズの確認と拡張
*------------------------------------------
*/
static void check_script_buf (int size)
@@ -867,7 +867,7 @@ static void check_script_buf (int size)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�ɂP�o�C�g��������
+ * スクリプトバッファに1バイト書き込む
*------------------------------------------
*/
static void add_scriptb (int a)
@@ -877,7 +877,7 @@ static void add_scriptb (int a)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�Ƀf�[�^�^�C�v�������
+ * スクリプトバッファにデータタイプを書き込む
*------------------------------------------
*/
static void add_scriptc (int a)
@@ -891,7 +891,7 @@ static void add_scriptc (int a)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�ɐ����������
+ * スクリプトバッファに整数を書き込む
*------------------------------------------
*/
static void add_scripti (int a)
@@ -905,10 +905,10 @@ static void add_scripti (int a)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�Ƀ��x��/�ϐ�/�֐��������
+ * スクリプトバッファにラベル/変数/関数を書き込む
*------------------------------------------
*/
-// �ő�16M�܂�
+// 最大16Mまで
static void add_scriptl (int l)
{
int backpatch = str_data[l].backpatch;
@@ -922,7 +922,7 @@ static void add_scriptl (int l)
add_scriptb (str_data[l].label >> 16);
break;
case C_NOP:
- // ���x���̉”\���������̂�backpatch�p�f�[�^���ߍ���
+ // ラベルの可能性があるのでbackpatch用データ埋め込み
add_scriptc (C_NAME);
str_data[l].backpatch = script_pos;
add_scriptb (backpatch);
@@ -933,7 +933,7 @@ static void add_scriptl (int l)
add_scripti (str_data[l].val);
break;
default:
- // �����̗p�r�Ɗm�肵�Ă��̂Ő�����̂܂�
+ // もう他の用途と確定してるので数字をそのまま
add_scriptc (C_NAME);
add_scriptb (l);
add_scriptb (l >> 8);
@@ -943,7 +943,7 @@ static void add_scriptl (int l)
}
/*==========================================
- * ���x���������
+ * ラベルを解決する
*------------------------------------------
*/
void set_label (int l, int pos)
@@ -964,7 +964,7 @@ void set_label (int l, int pos)
}
/*==========================================
- * �X�y�[�X/�R�����g�ǂݔ��΂�
+ * スペース/コメント読み飛ばし
*------------------------------------------
*/
static unsigned char *skip_space (unsigned char *p)
@@ -993,22 +993,22 @@ static unsigned char *skip_space (unsigned char *p)
}
/*==========================================
- * �P�P���X�L�b�v
+ * 1単語スキップ
*------------------------------------------
*/
static unsigned char *skip_word (unsigned char *p)
{
// prefix
if (*p == '$')
- p++; // MAP�I���L�ϐ��p
+ p++; // MAP鯖内共有変数用
if (*p == '@')
- p++; // �ꎞ�I�ϐ��p(like weiss)
+ p++; // 一時的変数用(like weiss)
if (*p == '#')
- p++; // account�ϐ��p
+ p++; // account変数用
if (*p == '#')
- p++; // ���[���haccount�ϐ��p
+ p++; // ワールドaccount変数用
if (*p == 'l')
- p++; // �ꎞ�I�ϐ��p(like weiss)
+ p++; // 一時的変数用(like weiss)
while (isalnum (*p) || *p == '_' || *p >= 0x81)
if (*p >= 0x81 && p[1])
@@ -1020,7 +1020,7 @@ static unsigned char *skip_word (unsigned char *p)
// postfix
if (*p == '$')
- p++; // �������ϐ�
+ p++; // 文字列変数
return p;
}
@@ -1029,7 +1029,7 @@ static unsigned char *startptr;
static int startline;
/*==========================================
- * �G���[���b�Z�[�W�o��
+ * エラーメッセージ出力
*------------------------------------------
*/
static void disp_error_message (const char *mes, const unsigned char *pos)
@@ -1069,7 +1069,7 @@ static void disp_error_message (const char *mes, const unsigned char *pos)
}
/*==========================================
- * ���̉���
+ * 項の解析
*------------------------------------------
*/
unsigned char *parse_simpleexpr (unsigned char *p)
@@ -1139,14 +1139,14 @@ unsigned char *parse_simpleexpr (unsigned char *p)
}
p2 = skip_word (p);
c = *p2;
- *p2 = 0; // ���O��add_str����
+ *p2 = 0; // 名前をadd_strする
l = add_str (p);
- parse_cmd = l; // warn_*_mismatch_paramnum�̂��߂ɕK�v
- if (l == search_str ("if")) // warn_cmd_no_comma�̂��߂ɕK�v
+ parse_cmd = l; // warn_*_mismatch_paramnumのために必要
+ if (l == search_str ("if")) // warn_cmd_no_commaのために必要
parse_cmd_if++;
/*
- // �p�~�\����l14/l15,�����уv���t�B�b�N�X���̌x��
+ // 廃止予定のl14/l15,およびプレフィックスlの警告
if( strcmp(str_buf+str_data[l].str,"l14")==0 ||
strcmp(str_buf+str_data[l].str,"l15")==0 ){
disp_error_message("l14 and l15 is DEPRECATED. use @menu instead of l15.",p);
@@ -1185,7 +1185,7 @@ unsigned char *parse_simpleexpr (unsigned char *p)
}
/*==========================================
- * ���̉���
+ * 式の解析
*------------------------------------------
*/
unsigned char *parse_subexpr (unsigned char *p, int limit)
@@ -1305,7 +1305,7 @@ unsigned char *parse_subexpr (unsigned char *p, int limit)
}
/*==========================================
- * ���̕]��
+ * 式の評価
*------------------------------------------
*/
unsigned char *parse_expr (unsigned char *p)
@@ -1334,7 +1334,7 @@ unsigned char *parse_expr (unsigned char *p)
}
/*==========================================
- * �s�̉���
+ * 行の解析
*------------------------------------------
*/
unsigned char *parse_line (unsigned char *p)
@@ -1347,9 +1347,9 @@ unsigned char *parse_line (unsigned char *p)
if (*p == ';')
return p;
- parse_cmd_if = 0; // warn_cmd_no_comma�̂��߂ɕK�v
+ parse_cmd_if = 0; // warn_cmd_no_commaのために必要
- // �ŏ��͊֐���
+ // 最初は関数名
p2 = p;
p = parse_simpleexpr (p);
p = skip_space (p);
@@ -1368,7 +1368,7 @@ unsigned char *parse_line (unsigned char *p)
p = parse_expr (p);
p = skip_space (p);
- // �������؂���,����
+ // 引数区切りの,処理
if (*p == ',')
p++;
else if (*p != ';' && script_config.warn_cmd_no_comma
@@ -1406,7 +1406,7 @@ unsigned char *parse_line (unsigned char *p)
}
/*==========================================
- * �g�ݍ��݊֐��̒lj�
+ * 組み込み関数の追加
*------------------------------------------
*/
static void add_buildin_func (void)
@@ -1422,7 +1422,7 @@ static void add_buildin_func (void)
}
/*==========================================
- * �萔�f�[�^�x�[�X�̓ǂݍ���
+ * 定数データベースの読み込み
*------------------------------------------
*/
static void read_constdb (void)
@@ -1459,7 +1459,7 @@ static void read_constdb (void)
}
/*==========================================
- * �X�N���v�g�̉���
+ * スクリプトの解析
*------------------------------------------
*/
unsigned char *parse_script (unsigned char *src, int line)
@@ -1491,7 +1491,7 @@ unsigned char *parse_script (unsigned char *src, int line)
}
}
- // �O���plabel db�̏�����
+ // 外部用label dbの初期化
if (scriptlabel_db != NULL)
strdb_final (scriptlabel_db, scriptlabel_final);
scriptlabel_db = strdb_init (50);
@@ -1510,7 +1510,7 @@ unsigned char *parse_script (unsigned char *src, int line)
for (p++; p && *p && *p != '}';)
{
p = skip_space (p);
- // label������ꏈ��
+ // labelだけ特殊処理
tmpp = skip_space (skip_word (p));
if (*tmpp == ':')
{
@@ -1526,13 +1526,13 @@ unsigned char *parse_script (unsigned char *src, int line)
exit (1);
}
set_label (l, script_pos);
- strdb_insert (scriptlabel_db, p, script_pos); // �O���plabel db�o�^
+ strdb_insert (scriptlabel_db, p, script_pos); // 外部用label db登録
*skip_word (p) = c;
p = tmpp + 1;
continue;
}
- // ���͑S���ꏏ����
+ // 他は全部一緒くた
p = parse_line (p);
p = skip_space (p);
add_scriptc (C_EOL);
@@ -1548,7 +1548,7 @@ unsigned char *parse_script (unsigned char *src, int line)
script_size = script_pos;
script_buf = (char *) aRealloc (script_buf, script_pos + 1);
- // ����̃��x��������
+ // 未解決のラベルを解決
for (i = LABEL_START; i < str_num; i++)
{
if (str_data[i].type == C_NOP)
@@ -1583,13 +1583,13 @@ unsigned char *parse_script (unsigned char *src, int line)
}
//
-// ��s�n
+// 実行系
//
enum
{ STOP = 1, END, RERUNLINE, GOTO, RETFUNC };
/*==========================================
- * rid����sd�ւ̉���
+ * ridからsdへの解決
*------------------------------------------
*/
struct map_session_data *script_rid2sd (struct script_state *st)
@@ -1603,7 +1603,7 @@ struct map_session_data *script_rid2sd (struct script_state *st)
}
/*==========================================
- * �ϐ��̓ǂݎ���
+ * 変数の読み取り
*------------------------------------------
*/
int get_val (struct script_state *st, struct script_data *data)
@@ -1691,7 +1691,7 @@ int get_val (struct script_state *st, struct script_data *data)
}
/*==========================================
- * �ϐ��̓ǂݎ���2
+ * 変数の読み取り2
*------------------------------------------
*/
void *get_val2 (struct script_state *st, int num)
@@ -1707,7 +1707,7 @@ void *get_val2 (struct script_state *st, int num)
}
/*==========================================
- * �ϐ��ݒ��p
+ * 変数設定用
*------------------------------------------
*/
static int set_reg (struct map_session_data *sd, int num, char *name, void *v)
@@ -1733,7 +1733,7 @@ static int set_reg (struct map_session_data *sd, int num, char *name, void *v)
}
else
{
- // ���l
+ // 数値
int val = (int) v;
if (str_data[num & 0x00ffffff].type == C_PARAM)
{
@@ -1763,7 +1763,7 @@ static int set_reg (struct map_session_data *sd, int num, char *name, void *v)
}
/*==========================================
- * �������ւ̕ϊ�
+ * 文字列への変換
*------------------------------------------
*/
char *conv_str (struct script_state *st, struct script_data *data)
@@ -1780,7 +1780,7 @@ char *conv_str (struct script_state *st, struct script_data *data)
}
else if (data->type == C_NAME)
{
- // �e���|�����B�{�������͂�
+ // テンポラリ。本来無いはず
data->type = C_CONSTSTR;
data->u.str = str_buf + str_data[data->u.num].str;
#endif
@@ -1789,7 +1789,7 @@ char *conv_str (struct script_state *st, struct script_data *data)
}
/*==========================================
- * ���l�֕ϊ�
+ * 数値へ変換
*------------------------------------------
*/
int conv_num (struct script_state *st, struct script_data *data)
@@ -1808,7 +1808,7 @@ int conv_num (struct script_state *st, struct script_data *data)
}
/*==========================================
- * �X�^�b�N�֐��l���v�b�V��
+ * スタックへ数値をプッシュ
*------------------------------------------
*/
void push_val (struct script_stack *stack, int type, int val)
@@ -1831,7 +1831,7 @@ void push_val (struct script_stack *stack, int type, int val)
}
/*==========================================
- * �X�^�b�N�֕��������v�b�V��
+ * スタックへ文字列をプッシュ
*------------------------------------------
*/
void push_str (struct script_stack *stack, int type, unsigned char *str)
@@ -1854,7 +1854,7 @@ void push_str (struct script_stack *stack, int type, unsigned char *str)
}
/*==========================================
- * �X�^�b�N�֕������v�b�V��
+ * スタックへ複製をプッシュ
*------------------------------------------
*/
void push_copy (struct script_stack *stack, int pos)
@@ -1875,7 +1875,7 @@ void push_copy (struct script_stack *stack, int pos)
}
/*==========================================
- * �X�^�b�N�����|�b�v
+ * スタックからポップ
*------------------------------------------
*/
void pop_stack (struct script_stack *stack, int start, int end)
@@ -1897,7 +1897,7 @@ void pop_stack (struct script_stack *stack, int start, int end)
}
//
-// ���ߍ��݊֐�
+// 埋め込み関数
//
/*==========================================
*
@@ -1933,7 +1933,7 @@ int buildin_goto (struct script_state *st)
}
/*==========================================
- * ���[�U�[���`�֐��̌Ăяo��
+ * ユーザー定義関数の呼び出し
*------------------------------------------
*/
int buildin_callfunc (struct script_state *st)
@@ -1947,10 +1947,10 @@ int buildin_callfunc (struct script_state *st)
for (i = st->start + 3, j = 0; i < st->end; i++, j++)
push_copy (st->stack, i);
- push_val (st->stack, C_INT, j); // �����̐����v�b�V��
- push_val (st->stack, C_INT, st->defsp); // ���݂̊�X�^�b�N�|�C���^���v�b�V��
- push_val (st->stack, C_INT, (int) st->script); // ���݂̃X�N���v�g���v�b�V��
- push_val (st->stack, C_RETINFO, st->pos); // ���݂̃X�N���v�g�ʒu���v�b�V��
+ push_val (st->stack, C_INT, j); // 引数の数をプッシュ
+ push_val (st->stack, C_INT, st->defsp); // 現在の基準スタックポインタをプッシュ
+ push_val (st->stack, C_INT, (int) st->script); // 現在のスクリプトをプッシュ
+ push_val (st->stack, C_RETINFO, st->pos); // 現在のスクリプト位置をプッシュ
st->pos = 0;
st->script = scr;
@@ -1966,7 +1966,7 @@ int buildin_callfunc (struct script_state *st)
}
/*==========================================
- * �T�u���[�e�B���̌Ăяo��
+ * サブルーティンの呼び出し
*------------------------------------------
*/
int buildin_callsub (struct script_state *st)
@@ -1976,10 +1976,10 @@ int buildin_callsub (struct script_state *st)
for (i = st->start + 3, j = 0; i < st->end; i++, j++)
push_copy (st->stack, i);
- push_val (st->stack, C_INT, j); // �����̐����v�b�V��
- push_val (st->stack, C_INT, st->defsp); // ���݂̊�X�^�b�N�|�C���^���v�b�V��
- push_val (st->stack, C_INT, (int) st->script); // ���݂̃X�N���v�g���v�b�V��
- push_val (st->stack, C_RETINFO, st->pos); // ���݂̃X�N���v�g�ʒu���v�b�V��
+ push_val (st->stack, C_INT, j); // 引数の数をプッシュ
+ push_val (st->stack, C_INT, st->defsp); // 現在の基準スタックポインタをプッシュ
+ push_val (st->stack, C_INT, (int) st->script); // 現在のスクリプトをプッシュ
+ push_val (st->stack, C_RETINFO, st->pos); // 現在のスクリプト位置をプッシュ
st->pos = pos;
st->defsp = st->start + 4 + j;
@@ -1988,7 +1988,7 @@ int buildin_callsub (struct script_state *st)
}
/*==========================================
- * �����̏���
+ * 引数の所得
*------------------------------------------
*/
int buildin_getarg (struct script_state *st)
@@ -2015,13 +2015,13 @@ int buildin_getarg (struct script_state *st)
}
/*==========================================
- * �T�u���[�`��/���[�U�[���`�֐��̏I��
+ * サブルーチン/ユーザー定義関数の終了
*------------------------------------------
*/
int buildin_return (struct script_state *st)
{
if (st->end > st->start + 2)
- { // �߂��l�L��
+ { // 戻り値有り
push_copy (st->stack, st->start + 2);
}
st->state = RETFUNC;
@@ -2107,8 +2107,8 @@ int buildin_menu (struct script_state *st)
st->state = END;
}
else
- { // goto����
- // ragemu�݊��̂���
+ { // goto動作
+ // ragemu互換のため
pc_setreg (sd, add_str ("l15"), sd->npc_menu);
pc_setreg (sd, add_str ("@menu"), sd->npc_menu);
sd->state.menu_or_input = 0;
@@ -2220,7 +2220,7 @@ int buildin_warp (struct script_state *st)
pc_randomwarp (sd, 3);
else if (strcmp (str, "SavePoint") == 0)
{
- if (map[sd->bl.m].flag.noreturn) // ���֎~
+ if (map[sd->bl.m].flag.noreturn) // 蝶禁止
return 0;
pc_setpos (sd, sd->status.save_point.map,
@@ -2228,7 +2228,7 @@ int buildin_warp (struct script_state *st)
}
else if (strcmp (str, "Save") == 0)
{
- if (map[sd->bl.m].flag.noreturn) // ���֎~
+ if (map[sd->bl.m].flag.noreturn) // 蝶禁止
return 0;
pc_setpos (sd, sd->status.save_point.map,
@@ -2240,7 +2240,7 @@ int buildin_warp (struct script_state *st)
}
/*==========================================
- * �G���A�w�胏�[�v
+ * エリア指定ワープ
*------------------------------------------
*/
int buildin_areawarp_sub (struct block_list *bl, va_list ap)
@@ -2363,9 +2363,9 @@ int buildin_input (struct script_state *st)
sd->state.menu_or_input = 0;
if (postfix == '$')
{
- // ������
+ // 文字列
if (st->end > st->start + 2)
- { // ����1��
+ { // 引数1個
set_reg (sd, num, name, (void *) sd->npc_str);
}
else
@@ -2384,14 +2384,14 @@ int buildin_input (struct script_state *st)
buildin_close (st); //** close
}
- // ���l
+ // 数値
if (st->end > st->start + 2)
- { // ����1��
+ { // 引数1個
set_reg (sd, num, name, (void *) sd->npc_amount);
}
else
{
- // ragemu�݊��̂���
+ // ragemu互換のため
pc_setreg (sd, add_str ("l14"), sd->npc_amount);
}
}
@@ -2420,11 +2420,11 @@ int buildin_if (struct script_state *st)
if (!sel)
return 0;
- // �֐������R�s�[
+ // 関数名をコピー
push_copy (st->stack, st->start + 3);
- // �ԂɈ����}�[�J��������
+ // 間に引数マーカを入れて
push_val (st->stack, C_ARG, 0);
- // �c���̈������R�s�[
+ // 残りの引数をコピー
for (i = st->start + 4; i < st->end; i++)
{
push_copy (st->stack, i);
@@ -2435,7 +2435,7 @@ int buildin_if (struct script_state *st)
}
/*==========================================
- * �ϐ��ݒ�
+ * 変数設定
*------------------------------------------
*/
int buildin_set (struct script_state *st)
@@ -2457,13 +2457,13 @@ int buildin_set (struct script_state *st)
if (postfix == '$')
{
- // ������
+ // 文字列
char *str = conv_str (st, &(st->stack->stack_data[st->start + 3]));
set_reg (sd, num, name, (void *) str);
}
else
{
- // ���l
+ // 数値
int val = conv_num (st, &(st->stack->stack_data[st->start + 3]));
set_reg (sd, num, name, (void *) val);
}
@@ -2472,7 +2472,7 @@ int buildin_set (struct script_state *st)
}
/*==========================================
- * �z���ϐ��ݒ�
+ * 配列変数設定
*------------------------------------------
*/
int buildin_setarray (struct script_state *st)
@@ -2505,7 +2505,7 @@ int buildin_setarray (struct script_state *st)
}
/*==========================================
- * �z���ϐ��N���A
+ * 配列変数クリア
*------------------------------------------
*/
int buildin_cleararray (struct script_state *st)
@@ -2538,7 +2538,7 @@ int buildin_cleararray (struct script_state *st)
}
/*==========================================
- * �z���ϐ��R�s�[
+ * 配列変数コピー
*------------------------------------------
*/
int buildin_copyarray (struct script_state *st)
@@ -2574,7 +2574,7 @@ int buildin_copyarray (struct script_state *st)
}
/*==========================================
- * �z���ϐ��̃T�C�Y����
+ * 配列変数のサイズ所得
*------------------------------------------
*/
static int getarraysize (struct script_state *st, int num, int postfix)
@@ -2609,7 +2609,7 @@ int buildin_getarraysize (struct script_state *st)
}
/*==========================================
- * �z���ϐ������v�f�폜
+ * 配列変数から要素削除
*------------------------------------------
*/
int buildin_deletearray (struct script_state *st)
@@ -2649,7 +2649,7 @@ int buildin_deletearray (struct script_state *st)
}
/*==========================================
- * �w���v�f���\���l(�L�[)�������
+ * 指定要素を表す値(キー)を所得する
*------------------------------------------
*/
int buildin_getelementofarray (struct script_state *st)
@@ -2713,7 +2713,7 @@ int buildin_cutin (struct script_state *st)
}
/*==========================================
- * �J�[�h�̃C���X�g���\������
+ * カードのイラストを表示する
*------------------------------------------
*/
int buildin_cutincard (struct script_state *st)
@@ -2789,7 +2789,7 @@ int buildin_countitem (struct script_state *st)
}
/*==========================================
- * �d�ʃ`�F�b�N
+ * 重量チェック
*------------------------------------------
*/
int buildin_checkweight (struct script_state *st)
@@ -2864,7 +2864,7 @@ int buildin_getitem (struct script_state *st)
}
//Violet Box, Blue Box, etc - random item pick
if (nameid < 0)
- { // �����_��
+ { // ランダム
nameid = itemdb_searchrandomid (-nameid);
flag = 1;
}
@@ -2877,10 +2877,10 @@ int buildin_getitem (struct script_state *st)
item_tmp.identify = 1;
else
item_tmp.identify = !itemdb_isequip3 (nameid);
- if (st->end > st->start + 5) //�A�C�e�����w�肵��ID�ɓn��
+ if (st->end > st->start + 5) //アイテムを指定したIDに渡す
sd = map_id2sd (conv_num
(st, &(st->stack->stack_data[st->start + 5])));
- if (sd == NULL) //�A�C�e�����n�����肪���Ȃ�����炨�A��
+ if (sd == NULL) //アイテムを渡す相手がいなかったらお帰り
return 0;
if ((flag = pc_additem (sd, &item_tmp, amount)))
{
@@ -2929,14 +2929,14 @@ int buildin_getitem2 (struct script_state *st)
c2 = conv_num (st, &(st->stack->stack_data[st->start + 8]));
c3 = conv_num (st, &(st->stack->stack_data[st->start + 9]));
c4 = conv_num (st, &(st->stack->stack_data[st->start + 10]));
- if (st->end > st->start + 11) //�A�C�e�����w�肵��ID�ɓn��
+ if (st->end > st->start + 11) //アイテムを指定したIDに渡す
sd = map_id2sd (conv_num
(st, &(st->stack->stack_data[st->start + 11])));
- if (sd == NULL) //�A�C�e�����n�����肪���Ȃ�����炨�A��
+ if (sd == NULL) //アイテムを渡す相手がいなかったらお帰り
return 0;
if (nameid < 0)
- { // �����_��
+ { // ランダム
nameid = itemdb_searchrandomid (-nameid);
flag = 1;
}
@@ -3022,7 +3022,7 @@ int buildin_makeitem (struct script_state *st)
m = map_mapname2mapid (mapname);
if (nameid < 0)
- { // �����_��
+ { // ランダム
nameid = itemdb_searchrandomid (-nameid);
flag = 1;
}
@@ -3109,7 +3109,7 @@ int buildin_delitem (struct script_state *st)
}
/*==========================================
- *�L�����֌W�̃p�����[�^�擾
+ *キャラ関係のパラメータ取得
*------------------------------------------
*/
int buildin_readparam (struct script_state *st)
@@ -3136,7 +3136,7 @@ int buildin_readparam (struct script_state *st)
}
/*==========================================
- *�L�����֌W��ID�擾
+ *キャラ関係のID取得
*------------------------------------------
*/
int buildin_getcharid (struct script_state *st)
@@ -3167,7 +3167,7 @@ int buildin_getcharid (struct script_state *st)
}
/*==========================================
- *�w��ID��PT���擾
+ *指定IDのPT名取得
*------------------------------------------
*/
char *buildin_getpartyname_sub (int party_id)
@@ -3204,7 +3204,7 @@ int buildin_getpartyname (struct script_state *st)
}
/*==========================================
- *�w��ID��PT�l���ƃ����o�[ID�擾
+ *指定IDのPT人数とメンバーID取得
*------------------------------------------
*/
int buildin_getpartymember (struct script_state *st)
@@ -3234,7 +3234,7 @@ int buildin_getpartymember (struct script_state *st)
}
/*==========================================
- *�w��ID�̃M���h���擾
+ *指定IDのギルド名取得
*------------------------------------------
*/
char *buildin_getguildname_sub (int guild_id)
@@ -3265,7 +3265,7 @@ int buildin_getguildname (struct script_state *st)
}
/*==========================================
- *�w��ID��GuildMaster���擾
+ *指定IDのGuildMaster名取得
*------------------------------------------
*/
char *buildin_getguildmaster_sub (int guild_id)
@@ -3319,7 +3319,7 @@ int buildin_getguildmasterid (struct script_state *st)
}
/*==========================================
- * �L�����N�^�̖��O
+ * キャラクタの名前
*------------------------------------------
*/
int buildin_strcharinfo (struct script_state *st)
@@ -3397,7 +3397,7 @@ int buildin_getequipid (struct script_state *st)
}
/*==========================================
- * ����������i���B���j���[�p�j
+ * 装備名文字列(精錬メニュー用)
*------------------------------------------
*/
int buildin_getequipname (struct script_state *st)
@@ -3492,7 +3492,7 @@ int buildin_repair (struct script_state *st)
}
/*==========================================
- * �����`�F�b�N
+ * 装備チェック
*------------------------------------------
*/
int buildin_getequipisequiped (struct script_state *st)
@@ -3516,7 +3516,7 @@ int buildin_getequipisequiped (struct script_state *st)
}
/*==========================================
- * �����i���B�”\�`�F�b�N
+ * 装備品精錬可能チェック
*------------------------------------------
*/
int buildin_getequipisenableref (struct script_state *st)
@@ -3545,7 +3545,7 @@ int buildin_getequipisenableref (struct script_state *st)
}
/*==========================================
- * �����i�Ӓ��`�F�b�N
+ * 装備品鑑定チェック
*------------------------------------------
*/
int buildin_getequipisidentify (struct script_state *st)
@@ -3565,7 +3565,7 @@ int buildin_getequipisidentify (struct script_state *st)
}
/*==========================================
- * �����i���B�x
+ * 装備品精錬度
*------------------------------------------
*/
int buildin_getequiprefinerycnt (struct script_state *st)
@@ -3585,7 +3585,7 @@ int buildin_getequiprefinerycnt (struct script_state *st)
}
/*==========================================
- * �����i����LV
+ * 装備品武器LV
*------------------------------------------
*/
int buildin_getequipweaponlv (struct script_state *st)
@@ -3605,7 +3605,7 @@ int buildin_getequipweaponlv (struct script_state *st)
}
/*==========================================
- * �����i���B������
+ * 装備品精錬成功率
*------------------------------------------
*/
int buildin_getequippercentrefinery (struct script_state *st)
@@ -3626,7 +3626,7 @@ int buildin_getequippercentrefinery (struct script_state *st)
}
/*==========================================
- * ���B����
+ * 精錬成功
*------------------------------------------
*/
int buildin_successrefitem (struct script_state *st)
@@ -3654,7 +3654,7 @@ int buildin_successrefitem (struct script_state *st)
}
/*==========================================
- * ���B���s
+ * 精錬失敗
*------------------------------------------
*/
int buildin_failedrefitem (struct script_state *st)
@@ -3669,10 +3669,10 @@ int buildin_failedrefitem (struct script_state *st)
{
sd->status.inventory[i].refine = 0;
pc_unequipitem (sd, i, 0);
- // ���B���s�G�t�F�N�g�̃p�P�b�g
+ // 精錬失敗エフェクトのパケット
clif_refine (sd->fd, sd, 1, i, sd->status.inventory[i].refine);
pc_delitem (sd, i, 1, 0);
- // ���̐l�ɂ��s���ʒm
+ // 他の人にも失敗を通知
clif_misceffect (&sd->bl, 2);
}
@@ -3713,7 +3713,7 @@ int buildin_statusup2 (struct script_state *st)
}
/*==========================================
- * �����i�ɂ����\�͒l�{�[�i�X
+ * 装備品による能力値ボーナス
*------------------------------------------
*/
int buildin_bonus (struct script_state *st)
@@ -3730,7 +3730,7 @@ int buildin_bonus (struct script_state *st)
}
/*==========================================
- * �����i�ɂ����\�͒l�{�[�i�X
+ * 装備品による能力値ボーナス
*------------------------------------------
*/
int buildin_bonus2 (struct script_state *st)
@@ -3748,7 +3748,7 @@ int buildin_bonus2 (struct script_state *st)
}
/*==========================================
- * �����i�ɂ����\�͒l�{�[�i�X
+ * 装備品による能力値ボーナス
*------------------------------------------
*/
int buildin_bonus3 (struct script_state *st)
@@ -3767,7 +3767,7 @@ int buildin_bonus3 (struct script_state *st)
}
/*==========================================
- * �X�L������
+ * スキル所得
*------------------------------------------
*/
int buildin_skill (struct script_state *st)
@@ -3806,7 +3806,7 @@ int buildin_setskill (struct script_state *st)
}
/*==========================================
- * �M���h�X�L���擾
+ * ギルドスキル取得
*------------------------------------------
*/
int buildin_guildskill (struct script_state *st)
@@ -3827,7 +3827,7 @@ int buildin_guildskill (struct script_state *st)
}
/*==========================================
- * �X�L�����x������
+ * スキルレベル所得
*------------------------------------------
*/
int buildin_getskilllv (struct script_state *st)
@@ -4001,7 +4001,7 @@ int buildin_checkcart (struct script_state *st)
}
/*==========================================
- * �J�[�g���t����
+ * カートを付ける
*------------------------------------------
*/
int buildin_setcart (struct script_state *st)
@@ -4038,7 +4038,7 @@ int buildin_checkfalcon (struct script_state *st)
}
/*==========================================
- * �����t����
+ * 鷹を付ける
*------------------------------------------
*/
int buildin_setfalcon (struct script_state *st)
@@ -4075,7 +4075,7 @@ int buildin_checkriding (struct script_state *st)
}
/*==========================================
- * �y�R�y�R����
+ * ペコペコ乗り
*------------------------------------------
*/
int buildin_setriding (struct script_state *st)
@@ -4089,7 +4089,7 @@ int buildin_setriding (struct script_state *st)
}
/*==========================================
- * �Z�[�u�|�C���g�̕ۑ�
+ * セーブポイントの保存
*------------------------------------------
*/
int buildin_savepoint (struct script_state *st)
@@ -4217,7 +4217,7 @@ int buildin_gettimestr (struct script_state *st)
}
/*==========================================
- * �J�v���q�ɂ��J��
+ * カプラ倉庫を開く
*------------------------------------------
*/
int buildin_openstorage (struct script_state *st)
@@ -4246,7 +4246,7 @@ int buildin_guildopenstorage (struct script_state *st)
}
/*==========================================
- * �A�C�e���ɂ����X�L������
+ * アイテムによるスキル発動
*------------------------------------------
*/
int buildin_itemskill (struct script_state *st)
@@ -4259,7 +4259,7 @@ int buildin_itemskill (struct script_state *st)
lv = conv_num (st, &(st->stack->stack_data[st->start + 3]));
str = conv_str (st, &(st->stack->stack_data[st->start + 4]));
- // �r�����ɃX�L���A�C�e���͎g�p�ł��Ȃ�
+ // 詠唱中にスキルアイテムは使用できない
if (sd->skilltimer != -1)
return 0;
@@ -4270,7 +4270,7 @@ int buildin_itemskill (struct script_state *st)
}
/*==========================================
- * NPC�Ōo���l�グ��
+ * NPCで経験値上げる
*------------------------------------------
*/
int buildin_getexp (struct script_state *st)
@@ -4289,7 +4289,7 @@ int buildin_getexp (struct script_state *st)
}
/*==========================================
- * �����X�^�[����
+ * モンスター発生
*------------------------------------------
*/
int buildin_monster (struct script_state *st)
@@ -4312,7 +4312,7 @@ int buildin_monster (struct script_state *st)
}
/*==========================================
- * �����X�^�[����
+ * モンスター発生
*------------------------------------------
*/
int buildin_areamonster (struct script_state *st)
@@ -4337,7 +4337,7 @@ int buildin_areamonster (struct script_state *st)
}
/*==========================================
- * �����X�^�[�폜
+ * モンスター削除
*------------------------------------------
*/
int buildin_killmonster_sub (struct block_list *bl, va_list ap)
@@ -4397,7 +4397,7 @@ int buildin_killmonsterall (struct script_state *st)
}
/*==========================================
- * �C�x���g��s
+ * イベント実行
*------------------------------------------
*/
int buildin_doevent (struct script_state *st)
@@ -4409,7 +4409,7 @@ int buildin_doevent (struct script_state *st)
}
/*==========================================
- * NPC���̃C�x���g��s
+ * NPC主体イベント実行
*------------------------------------------
*/
int buildin_donpcevent (struct script_state *st)
@@ -4421,7 +4421,7 @@ int buildin_donpcevent (struct script_state *st)
}
/*==========================================
- * �C�x���g�^�C�}�[�lj�
+ * イベントタイマー追加
*------------------------------------------
*/
int buildin_addtimer (struct script_state *st)
@@ -4435,7 +4435,7 @@ int buildin_addtimer (struct script_state *st)
}
/*==========================================
- * �C�x���g�^�C�}�[�폜
+ * イベントタイマー削除
*------------------------------------------
*/
int buildin_deltimer (struct script_state *st)
@@ -4447,7 +4447,7 @@ int buildin_deltimer (struct script_state *st)
}
/*==========================================
- * �C�x���g�^�C�}�[�̃J�E���g�l�lj�
+ * イベントタイマーのカウント値追加
*------------------------------------------
*/
int buildin_addtimercount (struct script_state *st)
@@ -4461,7 +4461,7 @@ int buildin_addtimercount (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[������
+ * NPCタイマー初期化
*------------------------------------------
*/
int buildin_initnpctimer (struct script_state *st)
@@ -4479,7 +4479,7 @@ int buildin_initnpctimer (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[�J�n
+ * NPCタイマー開始
*------------------------------------------
*/
int buildin_startnpctimer (struct script_state *st)
@@ -4496,7 +4496,7 @@ int buildin_startnpctimer (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[���~
+ * NPCタイマー停止
*------------------------------------------
*/
int buildin_stopnpctimer (struct script_state *st)
@@ -4513,7 +4513,7 @@ int buildin_stopnpctimer (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[���񏊓�
+ * NPCタイマー情報所得
*------------------------------------------
*/
int buildin_getnpctimer (struct script_state *st)
@@ -4544,7 +4544,7 @@ int buildin_getnpctimer (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[�l�ݒ�
+ * NPCタイマー値設定
*------------------------------------------
*/
int buildin_setnpctimer (struct script_state *st)
@@ -4563,7 +4563,7 @@ int buildin_setnpctimer (struct script_state *st)
}
/*==========================================
- * �V�̐��A�i�E���X
+ * 天の声アナウンス
*------------------------------------------
*/
int buildin_announce (struct script_state *st)
@@ -4585,7 +4585,7 @@ int buildin_announce (struct script_state *st)
}
/*==========================================
- * �V�̐��A�i�E���X�i����}�b�v�j
+ * 天の声アナウンス(特定マップ)
*------------------------------------------
*/
int buildin_mapannounce_sub (struct block_list *bl, va_list ap)
@@ -4617,7 +4617,7 @@ int buildin_mapannounce (struct script_state *st)
}
/*==========================================
- * �V�̐��A�i�E���X�i����G���A�j
+ * 天の声アナウンス(特定エリア)
*------------------------------------------
*/
int buildin_areaannounce (struct script_state *st)
@@ -4644,7 +4644,7 @@ int buildin_areaannounce (struct script_state *st)
}
/*==========================================
- * ���[�U�[������
+ * ユーザー数所得
*------------------------------------------
*/
int buildin_getusers (struct script_state *st)
@@ -4666,7 +4666,7 @@ int buildin_getusers (struct script_state *st)
}
/*==========================================
- * �}�b�v�w�胆�[�U�[������
+ * マップ指定ユーザー数所得
*------------------------------------------
*/
int buildin_getmapusers (struct script_state *st)
@@ -4684,7 +4684,7 @@ int buildin_getmapusers (struct script_state *st)
}
/*==========================================
- * �G���A�w�胆�[�U�[������
+ * エリア指定ユーザー数所得
*------------------------------------------
*/
int buildin_getareausers_sub (struct block_list *bl, va_list ap)
@@ -4715,7 +4715,7 @@ int buildin_getareausers (struct script_state *st)
}
/*==========================================
- * �G���A�w���h���b�v�A�C�e��������
+ * エリア指定ドロップアイテム数所得
*------------------------------------------
*/
int buildin_getareadropitem_sub (struct block_list *bl, va_list ap)
@@ -4789,7 +4789,7 @@ int buildin_getareadropitem (struct script_state *st)
}
/*==========================================
- * NPC�̗L����
+ * NPCの有効化
*------------------------------------------
*/
int buildin_enablenpc (struct script_state *st)
@@ -4801,7 +4801,7 @@ int buildin_enablenpc (struct script_state *st)
}
/*==========================================
- * NPC�̖�����
+ * NPCの無効化
*------------------------------------------
*/
int buildin_disablenpc (struct script_state *st)
@@ -4839,7 +4839,7 @@ int buildin_disablearena (struct script_state *st) // Added by RoVeRT
}
/*==========================================
- * �B���Ă���NPC�̕\��
+ * 隠れているNPCの表示
*------------------------------------------
*/
int buildin_hideoffnpc (struct script_state *st)
@@ -4851,7 +4851,7 @@ int buildin_hideoffnpc (struct script_state *st)
}
/*==========================================
- * NPC���n�C�f�B���O
+ * NPCをハイディング
*------------------------------------------
*/
int buildin_hideonnpc (struct script_state *st)
@@ -4863,7 +4863,7 @@ int buildin_hideonnpc (struct script_state *st)
}
/*==========================================
- * ���Ԉُ��ɂ�����
+ * 状態異常にかかる
*------------------------------------------
*/
int buildin_sc_start (struct script_state *st)
@@ -4873,7 +4873,7 @@ int buildin_sc_start (struct script_state *st)
type = conv_num (st, &(st->stack->stack_data[st->start + 2]));
tick = conv_num (st, &(st->stack->stack_data[st->start + 3]));
val1 = conv_num (st, &(st->stack->stack_data[st->start + 4]));
- if (st->end > st->start + 5) //�w�肵���L���������Ԉُ��ɂ���
+ if (st->end > st->start + 5) //指定したキャラを状態異常にする
bl = map_id2bl (conv_num
(st, &(st->stack->stack_data[st->start + 5])));
else
@@ -4886,7 +4886,7 @@ int buildin_sc_start (struct script_state *st)
}
/*==========================================
- * ���Ԉُ��ɂ�����(�m���w��)
+ * 状態異常にかかる(確率指定)
*------------------------------------------
*/
int buildin_sc_start2 (struct script_state *st)
@@ -4897,7 +4897,7 @@ int buildin_sc_start2 (struct script_state *st)
tick = conv_num (st, &(st->stack->stack_data[st->start + 3]));
val1 = conv_num (st, &(st->stack->stack_data[st->start + 4]));
per = conv_num (st, &(st->stack->stack_data[st->start + 5]));
- if (st->end > st->start + 6) //�w�肵���L���������Ԉُ��ɂ���
+ if (st->end > st->start + 6) //指定したキャラを状態異常にする
bl = map_id2bl (conv_num
(st, &(st->stack->stack_data[st->start + 6])));
else
@@ -4911,7 +4911,7 @@ int buildin_sc_start2 (struct script_state *st)
}
/*==========================================
- * ���Ԉُ킪����
+ * 状態異常が直る
*------------------------------------------
*/
int buildin_sc_end (struct script_state *st)
@@ -4945,7 +4945,7 @@ int buildin_sc_check (struct script_state *st)
}
/*==========================================
- * ���Ԉُ��ϐ����v�Z�����m�����Ԃ�
+ * 状態異常耐性を計算した確率を返す
*------------------------------------------
*/
int buildin_getscrate (struct script_state *st)
@@ -4956,7 +4956,7 @@ int buildin_getscrate (struct script_state *st)
type = conv_num (st, &(st->stack->stack_data[st->start + 2]));
rate = conv_num (st, &(st->stack->stack_data[st->start + 3]));
- if (st->end > st->start + 4) //�w�肵���L�����̑ϐ����v�Z����
+ if (st->end > st->start + 4) //指定したキャラの耐性を計算する
bl = map_id2bl (conv_num
(st, &(st->stack->stack_data[st->start + 6])));
else
@@ -5012,7 +5012,7 @@ int buildin_resetlvl (struct script_state *st)
}
/*==========================================
- * �X�e�[�^�X���Z�b�g
+ * ステータスリセット
*------------------------------------------
*/
int buildin_resetstatus (struct script_state *st)
@@ -5024,7 +5024,7 @@ int buildin_resetstatus (struct script_state *st)
}
/*==========================================
- * �X�L�����Z�b�g
+ * スキルリセット
*------------------------------------------
*/
int buildin_resetskill (struct script_state *st)
@@ -5058,7 +5058,7 @@ int buildin_changebase (struct script_state *st)
return 0;
// if(vclass==22) {
-// pc_unequipitem(sd,sd->equip_index[9],0); // �����O
+// pc_unequipitem(sd,sd->equip_index[9],0); // 装備外
// }
sd->view_class = vclass;
@@ -5067,7 +5067,7 @@ int buildin_changebase (struct script_state *st)
}
/*==========================================
- * ���ʕϊ�
+ * 性別変換
*------------------------------------------
*/
int buildin_changesex (struct script_state *st)
@@ -5095,7 +5095,7 @@ int buildin_changesex (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�쐬
+ * npcチャット作成
*------------------------------------------
*/
int buildin_waitingroom (struct script_state *st)
@@ -5113,20 +5113,20 @@ int buildin_waitingroom (struct script_state *st)
get_val (st, data);
if (data->type == C_INT)
{
- // �VAthena�d�l(��Athena�d�l�ƌ݊�������)
+ // 新Athena仕様(旧Athena仕様と互換性あり)
ev = conv_str (st, &(st->stack->stack_data[st->start + 4]));
trigger = conv_num (st, &(st->stack->stack_data[st->start + 5]));
}
else
{
- // eathena�d�l
+ // eathena仕様
trigger = conv_num (st, &(st->stack->stack_data[st->start + 4]));
ev = conv_str (st, &(st->stack->stack_data[st->start + 5]));
}
}
else
{
- // ��Athena�d�l
+ // 旧Athena仕様
if (st->end > st->start + 4)
ev = conv_str (st, &(st->stack->stack_data[st->start + 4]));
}
@@ -5136,7 +5136,7 @@ int buildin_waitingroom (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�폜
+ * npcチャット削除
*------------------------------------------
*/
int buildin_delwaitingroom (struct script_state *st)
@@ -5152,7 +5152,7 @@ int buildin_delwaitingroom (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�S���R���o��
+ * npcチャット全員蹴り出す
*------------------------------------------
*/
int buildin_waitingroomkickall (struct script_state *st)
@@ -5174,7 +5174,7 @@ int buildin_waitingroomkickall (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�C�x���g�L����
+ * npcチャットイベント有効化
*------------------------------------------
*/
int buildin_enablewaitingroomevent (struct script_state *st)
@@ -5196,7 +5196,7 @@ int buildin_enablewaitingroomevent (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�C�x���g������
+ * npcチャットイベント無効化
*------------------------------------------
*/
int buildin_disablewaitingroomevent (struct script_state *st)
@@ -5218,7 +5218,7 @@ int buildin_disablewaitingroomevent (struct script_state *st)
}
/*==========================================
- * npc�`���b�g���ԏ���
+ * npcチャット状態所得
*------------------------------------------
*/
int buildin_getwaitingroomstate (struct script_state *st)
@@ -5276,7 +5276,7 @@ int buildin_getwaitingroomstate (struct script_state *st)
}
/*==========================================
- * �`���b�g�����o�[(�K���l��)���[�v
+ * チャットメンバー(規定人数)ワープ
*------------------------------------------
*/
int buildin_warpwaitingpc (struct script_state *st)
@@ -5300,7 +5300,7 @@ int buildin_warpwaitingpc (struct script_state *st)
for (i = 0; i < n; i++)
{
- struct map_session_data *sd = cd->usersd[0]; // ���X�g�擪��PC��X�ɁB
+ struct map_session_data *sd = cd->usersd[0]; // リスト先頭のPCを次々に。
mapreg_setreg (add_str ("$@warpwaitingpc") + (i << 24), sd->bl.id);
@@ -5308,7 +5308,7 @@ int buildin_warpwaitingpc (struct script_state *st)
pc_randomwarp (sd, 3);
else if (strcmp (str, "SavePoint") == 0)
{
- if (map[sd->bl.m].flag.noteleport) // �e���|�֎~
+ if (map[sd->bl.m].flag.noteleport) // テレポ禁止
return 0;
pc_setpos (sd, sd->status.save_point.map,
@@ -5322,7 +5322,7 @@ int buildin_warpwaitingpc (struct script_state *st)
}
/*==========================================
- * RID�̃A�^�b�`
+ * RIDのアタッチ
*------------------------------------------
*/
int buildin_attachrid (struct script_state *st)
@@ -5333,7 +5333,7 @@ int buildin_attachrid (struct script_state *st)
}
/*==========================================
- * RID�̃f�^�b�`
+ * RIDのデタッチ
*------------------------------------------
*/
int buildin_detachrid (struct script_state *st)
@@ -5343,7 +5343,7 @@ int buildin_detachrid (struct script_state *st)
}
/*==========================================
- * ���݃`�F�b�N
+ * 存在チェック
*------------------------------------------
*/
int buildin_isloggedin (struct script_state *st)
@@ -5550,7 +5550,7 @@ int buildin_pvpon (struct script_state *st)
return 0;
for (i = 0; i < fd_max; i++)
- { //�l�������[�v
+ { //人数分ループ
if (session[i] && (pl_sd = session[i]->session_data)
&& pl_sd->state.auth)
{
@@ -5587,7 +5587,7 @@ int buildin_pvpoff (struct script_state *st)
return 0;
for (i = 0; i < fd_max; i++)
- { //�l�������[�v
+ { //人数分ループ
if (session[i] && (pl_sd = session[i]->session_data)
&& pl_sd->state.auth)
{
@@ -5641,7 +5641,7 @@ int buildin_gvgoff (struct script_state *st)
}
/*==========================================
- * NPC�G���[�V����
+ * NPCエモーション
*------------------------------------------
*/
@@ -6010,7 +6010,7 @@ int buildin_setcastledata (struct script_state *st)
}
/* =====================================================================
- * �M���h�������v������
+ * ギルド情報を要求する
* ---------------------------------------------------------------------
*/
int buildin_requestguildinfo (struct script_state *st)
@@ -6027,7 +6027,7 @@ int buildin_requestguildinfo (struct script_state *st)
}
/* =====================================================================
- * �J�[�h�̐��𓾂�
+ * カードの数を得る
* ---------------------------------------------------------------------
*/
int buildin_getequipcardcnt (struct script_state *st)
@@ -6040,7 +6040,7 @@ int buildin_getequipcardcnt (struct script_state *st)
sd = script_rid2sd (st);
i = pc_checkequip (sd, equip[num - 1]);
if (sd->status.inventory[i].card[0] == 0x00ff)
- { // ���������̓J�[�h�Ȃ�
+ { // 製造武器はカードなし
push_val (st->stack, C_INT, 0);
return 0;
}
@@ -6060,7 +6060,7 @@ int buildin_getequipcardcnt (struct script_state *st)
}
/* ================================================================
- * �J�[�h�����O������
+ * カード取り外し成功
* ----------------------------------------------------------------
*/
int buildin_successremovecards (struct script_state *st)
@@ -6074,7 +6074,7 @@ int buildin_successremovecards (struct script_state *st)
sd = script_rid2sd (st);
i = pc_checkequip (sd, equip[num - 1]);
if (sd->status.inventory[i].card[0] == 0x00ff)
- { // ���������͏������Ȃ�
+ { // 製造武器は処理しない
return 0;
}
do
@@ -6092,7 +6092,7 @@ int buildin_successremovecards (struct script_state *st)
0, item_tmp.card[3] = 0;
if ((flag = pc_additem (sd, &item_tmp, 1)))
- { // ���ĂȂ��Ȃ��h���b�v
+ { // 持てないならドロップ
clif_additem (sd, 0, 0, flag);
map_addflooritem (&item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y,
NULL, NULL, NULL, 0);
@@ -6102,7 +6102,7 @@ int buildin_successremovecards (struct script_state *st)
while (c--);
if (cardflag == 1)
- { // �J�[�h�����菜�����A�C�e������
+ { // カードを取り除いたアイテム所得
flag = 0;
item_tmp.id = 0, item_tmp.nameid = sd->status.inventory[i].nameid;
item_tmp.equip = 0, item_tmp.identify = 1, item_tmp.refine =
@@ -6112,7 +6112,7 @@ int buildin_successremovecards (struct script_state *st)
0, item_tmp.card[3] = 0;
pc_delitem (sd, i, 1, 0);
if ((flag = pc_additem (sd, &item_tmp, 1)))
- { // ���ĂȂ��Ȃ��h���b�v
+ { // もてないならドロップ
clif_additem (sd, 0, 0, flag);
map_addflooritem (&item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y,
NULL, NULL, NULL, 0);
@@ -6124,8 +6124,8 @@ int buildin_successremovecards (struct script_state *st)
}
/* ================================================================
- * �J�[�h�����O�����s slot,type
- * type=0: ���������A1:�J�[�h�����A2:������A3:��������
+ * カード取り外し失敗 slot,type
+ * type=0: 両方損失、1:カード損失、2:武具損失、3:損失無し
* ----------------------------------------------------------------
*/
int buildin_failedremovecards (struct script_state *st)
@@ -6140,7 +6140,7 @@ int buildin_failedremovecards (struct script_state *st)
sd = script_rid2sd (st);
i = pc_checkequip (sd, equip[num - 1]);
if (sd->status.inventory[i].card[0] == 0x00ff)
- { // ���������͏������Ȃ�
+ { // 製造武器は処理しない
return 0;
}
do
@@ -6152,7 +6152,7 @@ int buildin_failedremovecards (struct script_state *st)
cardflag = 1;
if (typefail == 2)
- { // �����̂ݑ����Ȃ��A�J�[�h�͎󂯎��点��
+ { // 武具のみ損失なら、カードは受け取らせる
item_tmp.id = 0, item_tmp.nameid =
sd->status.inventory[i].card[c - 1];
item_tmp.equip = 0, item_tmp.identify = 1, item_tmp.refine =
@@ -6175,13 +6175,13 @@ int buildin_failedremovecards (struct script_state *st)
{
if (typefail == 0 || typefail == 2)
- { // �����
+ { // 武具損失
pc_delitem (sd, i, 1, 0);
clif_misceffect (&sd->bl, 2);
return 0;
}
if (typefail == 1)
- { // �J�[�h�̂ݑ����i�������Ԃ��j
+ { // カードのみ損失(武具を返す)
flag = 0;
item_tmp.id = 0, item_tmp.nameid = sd->status.inventory[i].nameid;
item_tmp.equip = 0, item_tmp.identify = 1, item_tmp.refine =
@@ -6429,7 +6429,7 @@ int buildin_guardianinfo (struct script_state *st)
}
/*==========================================
- * ID����Item��
+ * IDからItem名
*------------------------------------------
*/
int buildin_getitemname (struct script_state *st)
@@ -6501,7 +6501,7 @@ int buildin_getpartnerid (struct script_state *st)
}
/*==========================================
- * PC�̏����i�����ǂݎ���
+ * PCの所持品情報読み取り
*------------------------------------------
*/
int buildin_getinventorylist (struct script_state *st)
@@ -6707,9 +6707,9 @@ int buildin_clearitem (struct script_state *st)
}
/*==========================================
- * NPC�N���X�`�F���W
- * class�͕ς��肽��class
- * type�͒ʏ�0�Ȃ̂��ȁH
+ * NPCクラスチェンジ
+ * classは変わりたいclass
+ * typeは通常0なのかな?
*------------------------------------------
*/
int buildin_classchange (struct script_state *st)
@@ -6781,7 +6781,7 @@ int buildin_misceffect (struct script_state *st)
}
/*==========================================
- * �T�E���h�G�t�F�N�g
+ * サウンドエフェクト
*------------------------------------------
*/
int buildin_soundeffect (struct script_state *st)
@@ -7250,10 +7250,10 @@ int buildin_fakenpcname (struct script_state *st)
}
//
-// ��s��main
+// 実行部main
//
/*==========================================
- * �R�}���h�̓ǂݎ���
+ * コマンドの読み取り
*------------------------------------------
*/
static int unget_com_data = -1;
@@ -7281,7 +7281,7 @@ int get_com (unsigned char *script, int *pos)
}
/*==========================================
- * �R�}���h�̃v�b�V���o�b�N
+ * コマンドのプッシュバック
*------------------------------------------
*/
void unget_com (int c)
@@ -7295,7 +7295,7 @@ void unget_com (int c)
}
/*==========================================
- * ���l�̏���
+ * 数値の所得
*------------------------------------------
*/
int get_num (unsigned char *script, int *pos)
@@ -7312,7 +7312,7 @@ int get_num (unsigned char *script, int *pos)
}
/*==========================================
- * �X�^�b�N�����l�������o��
+ * スタックから値を取り出す
*------------------------------------------
*/
int pop_val (struct script_state *st)
@@ -7329,7 +7329,7 @@ int pop_val (struct script_state *st)
#define isstr(c) ((c).type==C_STR || (c).type==C_CONSTSTR)
/*==========================================
- * ��Z���Z�q
+ * 加算演算子
*------------------------------------------
*/
void op_add (struct script_state *st)
@@ -7350,7 +7350,7 @@ void op_add (struct script_state *st)
st->stack->stack_data[st->stack->sp].u.num;
}
else
- { // ss�̗\��
+ { // ssの予定
char *buf;
buf =
(char *)
@@ -7369,7 +7369,7 @@ void op_add (struct script_state *st)
}
/*==========================================
- * �񍀉��Z�q(������)
+ * 二項演算子(文字列)
*------------------------------------------
*/
void op_2str (struct script_state *st, int op, int sp1, int sp2)
@@ -7412,7 +7412,7 @@ void op_2str (struct script_state *st, int op, int sp1, int sp2)
}
/*==========================================
- * �񍀉��Z�q(���l)
+ * 二項演算子(数値)
*------------------------------------------
*/
void op_2num (struct script_state *st, int op, int i1, int i2)
@@ -7475,7 +7475,7 @@ void op_2num (struct script_state *st, int op, int i1, int i2)
}
/*==========================================
- * �񍀉��Z�q
+ * 二項演算子
*------------------------------------------
*/
void op_2 (struct script_state *st, int op)
@@ -7510,7 +7510,7 @@ void op_2 (struct script_state *st, int op)
}
/*==========================================
- * �P�����Z�q
+ * 単項演算子
*------------------------------------------
*/
void op_1num (struct script_state *st, int op)
@@ -7533,7 +7533,7 @@ void op_1num (struct script_state *st, int op)
}
/*==========================================
- * �֐��̎�s
+ * 関数の実行
*------------------------------------------
*/
int run_func (struct script_state *st)
@@ -7612,11 +7612,11 @@ int run_func (struct script_state *st)
if (st->state == RETFUNC)
{
- // ���[�U�[���`�֐������̕��A
+ // ユーザー定義関数からの復帰
int olddefsp = st->defsp;
int i;
- pop_stack (st->stack, st->defsp, start_sp); // ���A�Ɏז��ȃX�^�b�N�폜
+ pop_stack (st->stack, st->defsp, start_sp); // 復帰に邪魔なスタック削除
if (st->defsp < 4
|| st->stack->stack_data[st->defsp - 1].type != C_RETINFO)
{
@@ -7625,12 +7625,12 @@ int run_func (struct script_state *st)
st->state = END;
return 0;
}
- i = conv_num (st, &(st->stack->stack_data[st->defsp - 4])); // �����̐�����
- st->pos = conv_num (st, &(st->stack->stack_data[st->defsp - 1])); // �X�N���v�g�ʒu�̕���
- st->script = (char *) conv_num (st, &(st->stack->stack_data[st->defsp - 2])); // �X�N���v�g�𕜌�
- st->defsp = conv_num (st, &(st->stack->stack_data[st->defsp - 3])); // ��X�^�b�N�|�C���^�𕜌�
+ i = conv_num (st, &(st->stack->stack_data[st->defsp - 4])); // 引数の数所得
+ st->pos = conv_num (st, &(st->stack->stack_data[st->defsp - 1])); // スクリプト位置の復元
+ st->script = (char *) conv_num (st, &(st->stack->stack_data[st->defsp - 2])); // スクリプトを復元
+ st->defsp = conv_num (st, &(st->stack->stack_data[st->defsp - 3])); // 基準スタックポインタを復元
- pop_stack (st->stack, olddefsp - 4 - i, olddefsp); // �v���Ȃ��Ȃ���X�^�b�N(�����ƕ��A�p�f�[�^)�폜
+ pop_stack (st->stack, olddefsp - 4 - i, olddefsp); // 要らなくなったスタック(引数と復帰用データ)削除
st->state = GOTO;
}
@@ -7639,7 +7639,7 @@ int run_func (struct script_state *st)
}
/*==========================================
- * �X�N���v�g�̎�s���C������
+ * スクリプトの実行メイン部分
*------------------------------------------
*/
int run_script_main (unsigned char *script, int pos, int rid, int oid,
@@ -7765,7 +7765,7 @@ int run_script_main (unsigned char *script, int pos, int rid, int oid,
if (st->state != END)
{
- // �ĊJ���邽�߂ɃX�^�b�N�������ۑ�
+ // 再開するためにスタック情報を保存
struct map_session_data *sd = map_id2sd (st->rid);
if (sd /* && sd->npc_stackbuf==NULL */ )
{
@@ -7787,7 +7787,7 @@ int run_script_main (unsigned char *script, int pos, int rid, int oid,
}
/*==========================================
- * �X�N���v�g�̎�s
+ * スクリプトの実行
*------------------------------------------
*/
int run_script (unsigned char *script, int pos, int rid, int oid)
@@ -7808,7 +7808,7 @@ int run_script_l (unsigned char *script, int pos, int rid, int oid,
if (sd && sd->npc_stackbuf && sd->npc_scriptroot == (char *) rootscript)
{
- // �O���̃X�^�b�N�𕜋A
+ // 前回のスタックを復帰
script = sd->npc_script;
stack.sp = sd->npc_stack;
stack.sp_max = sd->npc_stackmax;
@@ -7822,7 +7822,7 @@ int run_script_l (unsigned char *script, int pos, int rid, int oid,
}
else
{
- // �X�^�b�N������
+ // スタック初期化
stack.sp = 0;
stack.sp_max = 64;
stack.stack_data =
@@ -7848,7 +7848,7 @@ int run_script_l (unsigned char *script, int pos, int rid, int oid,
}
/*==========================================
- * �}�b�v�ϐ��̕ύX
+ * マップ変数の変更
*------------------------------------------
*/
int mapreg_setreg (int num, int val)
@@ -7863,7 +7863,7 @@ int mapreg_setreg (int num, int val)
}
/*==========================================
- * �������^�}�b�v�ϐ��̕ύX
+ * 文字列型マップ変数の変更
*------------------------------------------
*/
int mapreg_setregstr (int num, const char *str)
@@ -7887,7 +7887,7 @@ int mapreg_setregstr (int num, const char *str)
}
/*==========================================
- * �i���I�}�b�v�ϐ��̓ǂݍ���
+ * 永続的マップ変数の読み込み
*------------------------------------------
*/
static int script_load_mapreg ()
@@ -7934,7 +7934,7 @@ static int script_load_mapreg ()
}
/*==========================================
- * �i���I�}�b�v�ϐ��̏�������
+ * 永続的マップ変数の書き込み
*------------------------------------------
*/
static int script_save_mapreg_intsub (void *key, void *data, va_list ap)
@@ -8057,7 +8057,7 @@ int script_config_read (char *cfgName)
}
/*==========================================
- * �I��
+ * 終了
*------------------------------------------
*/
static int mapreg_db_final (void *key, void *data, va_list ap)
@@ -8108,7 +8108,7 @@ int do_final_script ()
}
/*==========================================
- * ������
+ * 初期化
*------------------------------------------
*/
int do_init_script ()