summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c521
1 files changed, 282 insertions, 239 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 5bf6fa5..adc9d36 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", "�������Ă��Ȃ�"
+ { "��", "��", "����", "�E��", "���[�u", "�C", "�A�N�Z�T���[1",
+ "�A�N�Z�T���[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�ȕ��̂�)
+ * ���[�J���v���g�^�C�v�錾 (�K�v�ȕ��̂�)
*------------------------------------------
*/
unsigned char *parse_subexpr (unsigned char *, int);
@@ -183,6 +183,8 @@ int buildin_getgdskilllv (struct script_state *st);
int buildin_basicskillcheck (struct script_state *st);
int buildin_getgmlevel (struct script_state *st);
int buildin_end (struct script_state *st);
+int buildin_getopt2 (struct script_state *st);
+int buildin_setopt2 (struct script_state *st);
int buildin_checkoption (struct script_state *st);
int buildin_setoption (struct script_state *st);
int buildin_setcart (struct script_state *st);
@@ -470,6 +472,10 @@ struct
{
buildin_end, "end", ""},
{
+ buildin_getopt2, "getopt2", "i"},
+ {
+ buildin_setopt2, "setopt2", "i"},
+ {
buildin_end, "break", ""},
{
buildin_checkoption, "checkoption", "i"},
@@ -745,7 +751,7 @@ enum
};
/*==========================================
- * ������̃n�b�V�����v�Z
+ * �������̃n�b�V�����v�Z
*------------------------------------------
*/
static int calc_hash (const unsigned char *p)
@@ -760,10 +766,10 @@ static int calc_hash (const unsigned char *p)
}
/*==========================================
- * str_data�̒��ɖ��O�����邩��������
+ * str_data�̒��ɖ��O�����邩�����
*------------------------------------------
*/
-// �����̂ł���Δԍ��A�������-1
+// �����̂ł����Δԍ��A��������-1
static int search_str (const unsigned char *p)
{
int i;
@@ -780,10 +786,10 @@ static int search_str (const unsigned char *p)
}
/*==========================================
- * str_data�ɖ��O��o�^
+ * str_data�ɖ��O���o�^
*------------------------------------------
*/
-// �����̂ł���Δԍ��A������Γo�^���ĐV�K�ԍ�
+// �����̂ł����Δԍ��A�������Γo�^���ĐV�K�ԍ�
static int add_str (const unsigned char *p)
{
int i;
@@ -843,7 +849,7 @@ static int add_str (const unsigned char *p)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�T�C�Y�̊m�F�Ɗg��
+ * �X�N���v�g�o�b�t�@�T�C�Y�̊m�F�Ɗg��
*------------------------------------------
*/
static void check_script_buf (int size)
@@ -858,7 +864,7 @@ static void check_script_buf (int size)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�ɂP�o�C�g��������
+ * �X�N���v�g�o�b�t�@�ɂP�o�C�g��������
*------------------------------------------
*/
static void add_scriptb (int a)
@@ -868,7 +874,7 @@ static void add_scriptb (int a)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�Ƀf�[�^�^�C�v����������
+ * �X�N���v�g�o�b�t�@�Ƀf�[�^�^�C�v�������
*------------------------------------------
*/
static void add_scriptc (int a)
@@ -882,7 +888,7 @@ static void add_scriptc (int a)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�ɐ�������������
+ * �X�N���v�g�o�b�t�@�ɐ����������
*------------------------------------------
*/
static void add_scripti (int a)
@@ -896,10 +902,10 @@ static void add_scripti (int a)
}
/*==========================================
- * �X�N���v�g�o�b�t�@�Ƀ��x��/�ϐ�/�֐�����������
+ * �X�N���v�g�o�b�t�@�Ƀ��x��/�ϐ�/�֐��������
*------------------------------------------
*/
-// �ő�16M�܂�
+// �ő�16M�܂�
static void add_scriptl (int l)
{
int backpatch = str_data[l].backpatch;
@@ -913,7 +919,7 @@ static void add_scriptl (int l)
add_scriptb (str_data[l].label >> 16);
break;
case C_NOP:
- // ���x���̉”\��������̂�backpatch�p�f�[�^���ߍ���
+ // ���x���̉”\���������̂�backpatch�p�f�[�^���ߍ���
add_scriptc (C_NAME);
str_data[l].backpatch = script_pos;
add_scriptb (backpatch);
@@ -924,7 +930,7 @@ static void add_scriptl (int l)
add_scripti (str_data[l].val);
break;
default:
- // �������̗p�r�Ɗm�肵�Ă�̂Ő��������̂܂�
+ // �����̗p�r�Ɗm�肵�Ă��̂Ő�����̂܂�
add_scriptc (C_NAME);
add_scriptb (l);
add_scriptb (l >> 8);
@@ -934,7 +940,7 @@ static void add_scriptl (int l)
}
/*==========================================
- * ���x������������
+ * ���x���������
*------------------------------------------
*/
void set_label (int l, int pos)
@@ -955,7 +961,7 @@ void set_label (int l, int pos)
}
/*==========================================
- * �X�y�[�X/�R�����g�ǂݔ�΂�
+ * �X�y�[�X/�R�����g�ǂݔ��΂�
*------------------------------------------
*/
static unsigned char *skip_space (unsigned char *p)
@@ -984,22 +990,22 @@ static unsigned char *skip_space (unsigned char *p)
}
/*==========================================
- * �P�P��X�L�b�v
+ * �P�P���X�L�b�v
*------------------------------------------
*/
static unsigned char *skip_word (unsigned char *p)
{
// prefix
if (*p == '$')
- p++; // MAP�I�����L�ϐ��p
+ p++; // MAP�I���L�ϐ��p
if (*p == '@')
- p++; // �ꎞ�I�ϐ��p(like weiss)
+ p++; // �ꎞ�I�ϐ��p(like weiss)
if (*p == '#')
- p++; // account�ϐ��p
+ p++; // account�ϐ��p
if (*p == '#')
- p++; // ���[���haccount�ϐ��p
+ p++; // ���[���haccount�ϐ��p
if (*p == 'l')
- p++; // �ꎞ�I�ϐ��p(like weiss)
+ p++; // �ꎞ�I�ϐ��p(like weiss)
while (isalnum (*p) || *p == '_' || *p >= 0x81)
if (*p >= 0x81 && p[1])
@@ -1011,7 +1017,7 @@ static unsigned char *skip_word (unsigned char *p)
// postfix
if (*p == '$')
- p++; // ������ϐ�
+ p++; // �������ϐ�
return p;
}
@@ -1020,7 +1026,7 @@ static unsigned char *startptr;
static int startline;
/*==========================================
- * �G���[���b�Z�[�W�o��
+ * �G���[���b�Z�[�W�o��
*------------------------------------------
*/
static void disp_error_message (const char *mes, const unsigned char *pos)
@@ -1060,7 +1066,7 @@ static void disp_error_message (const char *mes, const unsigned char *pos)
}
/*==========================================
- * ���̉��
+ * ���̉���
*------------------------------------------
*/
unsigned char *parse_simpleexpr (unsigned char *p)
@@ -1130,14 +1136,14 @@ unsigned char *parse_simpleexpr (unsigned char *p)
}
p2 = skip_word (p);
c = *p2;
- *p2 = 0; // ���O��add_str����
+ *p2 = 0; // ���O��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�̂��߂ɕK�v
+ if (l == search_str ("if")) // warn_cmd_no_comma�̂��߂ɕK�v
parse_cmd_if++;
/*
- // �p�~�\���l14/l15,����уv���t�B�b�N�X���̌x��
+ // �p�~�\����l14/l15,�����уv���t�B�b�N�X���̌x��
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);
@@ -1176,7 +1182,7 @@ unsigned char *parse_simpleexpr (unsigned char *p)
}
/*==========================================
- * ���̉��
+ * ���̉���
*------------------------------------------
*/
unsigned char *parse_subexpr (unsigned char *p, int limit)
@@ -1296,7 +1302,7 @@ unsigned char *parse_subexpr (unsigned char *p, int limit)
}
/*==========================================
- * ���̕]��
+ * ���̕]��
*------------------------------------------
*/
unsigned char *parse_expr (unsigned char *p)
@@ -1325,7 +1331,7 @@ unsigned char *parse_expr (unsigned char *p)
}
/*==========================================
- * �s�̉��
+ * �s�̉���
*------------------------------------------
*/
unsigned char *parse_line (unsigned char *p)
@@ -1338,9 +1344,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�̂��߂ɕK�v
- // �ŏ��͊֐���
+ // �ŏ��͊֐���
p2 = p;
p = parse_simpleexpr (p);
p = skip_space (p);
@@ -1359,7 +1365,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
@@ -1397,7 +1403,7 @@ unsigned char *parse_line (unsigned char *p)
}
/*==========================================
- * �g�ݍ��݊֐��̒lj�
+ * �g�ݍ��݊֐��̒lj�
*------------------------------------------
*/
static void add_buildin_func (void)
@@ -1413,7 +1419,7 @@ static void add_buildin_func (void)
}
/*==========================================
- * �萔�f�[�^�x�[�X�̓ǂݍ���
+ * �萔�f�[�^�x�[�X�̓ǂݍ���
*------------------------------------------
*/
static void read_constdb (void)
@@ -1450,7 +1456,7 @@ static void read_constdb (void)
}
/*==========================================
- * �X�N���v�g�̉��
+ * �X�N���v�g�̉���
*------------------------------------------
*/
unsigned char *parse_script (unsigned char *src, int line)
@@ -1482,7 +1488,7 @@ unsigned char *parse_script (unsigned char *src, int line)
}
}
- // �O���plabel db�̏�����
+ // �O���plabel db�̏�����
if (scriptlabel_db != NULL)
strdb_final (scriptlabel_db, scriptlabel_final);
scriptlabel_db = strdb_init (50);
@@ -1501,7 +1507,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 == ':')
{
@@ -1517,13 +1523,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); // �O���plabel db�o�^
*skip_word (p) = c;
p = tmpp + 1;
continue;
}
- // ���͑S���ꏏ����
+ // ���͑S���ꏏ����
p = parse_line (p);
p = skip_space (p);
add_scriptc (C_EOL);
@@ -1539,7 +1545,7 @@ unsigned char *parse_script (unsigned char *src, int line)
script_size = script_pos;
script_buf = (char *) aRealloc (script_buf, script_pos + 1);
- // �������̃��x��������
+ // ����̃��x��������
for (i = LABEL_START; i < str_num; i++)
{
if (str_data[i].type == C_NOP)
@@ -1574,13 +1580,13 @@ unsigned char *parse_script (unsigned char *src, int line)
}
//
-// ���s�n
+// ��s�n
//
enum
{ STOP = 1, END, RERUNLINE, GOTO, RETFUNC };
/*==========================================
- * rid����sd�ւ̉���
+ * rid����sd�ւ̉���
*------------------------------------------
*/
struct map_session_data *script_rid2sd (struct script_state *st)
@@ -1594,7 +1600,7 @@ struct map_session_data *script_rid2sd (struct script_state *st)
}
/*==========================================
- * �ϐ��̓ǂݎ��
+ * �ϐ��̓ǂݎ���
*------------------------------------------
*/
int get_val (struct script_state *st, struct script_data *data)
@@ -1682,7 +1688,7 @@ int get_val (struct script_state *st, struct script_data *data)
}
/*==========================================
- * �ϐ��̓ǂݎ��2
+ * �ϐ��̓ǂݎ���2
*------------------------------------------
*/
void *get_val2 (struct script_state *st, int num)
@@ -1698,7 +1704,7 @@ void *get_val2 (struct script_state *st, int num)
}
/*==========================================
- * �ϐ��ݒ�p
+ * �ϐ��ݒ��p
*------------------------------------------
*/
static int set_reg (struct map_session_data *sd, int num, char *name, void *v)
@@ -1724,7 +1730,7 @@ static int set_reg (struct map_session_data *sd, int num, char *name, void *v)
}
else
{
- // ���l
+ // ���l
int val = (int) v;
if (str_data[num & 0x00ffffff].type == C_PARAM)
{
@@ -1754,7 +1760,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)
@@ -1771,7 +1777,7 @@ char *conv_str (struct script_state *st, struct script_data *data)
}
else if (data->type == C_NAME)
{
- // �e���|�����B�{�������͂�
+ // �e���|�����B�{�������͂�
data->type = C_CONSTSTR;
data->u.str = str_buf + str_data[data->u.num].str;
#endif
@@ -1780,7 +1786,7 @@ char *conv_str (struct script_state *st, struct script_data *data)
}
/*==========================================
- * ���l�֕ϊ�
+ * ���l�֕ϊ�
*------------------------------------------
*/
int conv_num (struct script_state *st, struct script_data *data)
@@ -1799,7 +1805,7 @@ int conv_num (struct script_state *st, struct script_data *data)
}
/*==========================================
- * �X�^�b�N�֐��l���v�b�V��
+ * �X�^�b�N�֐��l���v�b�V��
*------------------------------------------
*/
void push_val (struct script_stack *stack, int type, int val)
@@ -1822,7 +1828,7 @@ void push_val (struct script_stack *stack, int type, int val)
}
/*==========================================
- * �X�^�b�N�֕�������v�b�V��
+ * �X�^�b�N�֕��������v�b�V��
*------------------------------------------
*/
void push_str (struct script_stack *stack, int type, unsigned char *str)
@@ -1845,7 +1851,7 @@ void push_str (struct script_stack *stack, int type, unsigned char *str)
}
/*==========================================
- * �X�^�b�N�֕������v�b�V��
+ * �X�^�b�N�֕������v�b�V��
*------------------------------------------
*/
void push_copy (struct script_stack *stack, int pos)
@@ -1866,7 +1872,7 @@ void push_copy (struct script_stack *stack, int pos)
}
/*==========================================
- * �X�^�b�N����|�b�v
+ * �X�^�b�N�����|�b�v
*------------------------------------------
*/
void pop_stack (struct script_stack *stack, int start, int end)
@@ -1888,7 +1894,7 @@ void pop_stack (struct script_stack *stack, int start, int end)
}
//
-// ���ߍ��݊֐�
+// ���ߍ��݊֐�
//
/*==========================================
*
@@ -1924,7 +1930,7 @@ int buildin_goto (struct script_state *st)
}
/*==========================================
- * ���[�U�[��`�֐��̌Ăяo��
+ * ���[�U�[���`�֐��̌Ăяo��
*------------------------------------------
*/
int buildin_callfunc (struct script_state *st)
@@ -1938,10 +1944,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); // �����̐����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��
st->pos = 0;
st->script = scr;
@@ -1957,7 +1963,7 @@ int buildin_callfunc (struct script_state *st)
}
/*==========================================
- * �T�u���[�e�B���̌Ăяo��
+ * �T�u���[�e�B���̌Ăяo��
*------------------------------------------
*/
int buildin_callsub (struct script_state *st)
@@ -1967,10 +1973,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); // �����̐����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��
st->pos = pos;
st->defsp = st->start + 4 + j;
@@ -1979,7 +1985,7 @@ int buildin_callsub (struct script_state *st)
}
/*==========================================
- * �����̏���
+ * �����̏���
*------------------------------------------
*/
int buildin_getarg (struct script_state *st)
@@ -2006,13 +2012,13 @@ int buildin_getarg (struct script_state *st)
}
/*==========================================
- * �T�u���[�`��/���[�U�[��`�֐��̏I��
+ * �T�u���[�`��/���[�U�[���`�֐��̏I��
*------------------------------------------
*/
int buildin_return (struct script_state *st)
{
if (st->end > st->start + 2)
- { // �߂�l�L��
+ { // �߂��l�L��
push_copy (st->stack, st->start + 2);
}
st->state = RETFUNC;
@@ -2098,8 +2104,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;
@@ -2211,7 +2217,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,
@@ -2219,7 +2225,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,
@@ -2231,7 +2237,7 @@ int buildin_warp (struct script_state *st)
}
/*==========================================
- * �G���A�w�胏�[�v
+ * �G���A�w�胏�[�v
*------------------------------------------
*/
int buildin_areawarp_sub (struct block_list *bl, va_list ap)
@@ -2354,9 +2360,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
@@ -2375,14 +2381,14 @@ int buildin_input (struct script_state *st)
buildin_close (st); //** close
}
- // ���l
+ // ���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);
}
}
@@ -2411,11 +2417,11 @@ int buildin_if (struct script_state *st)
if (!sel)
return 0;
- // �֐������R�s�[
+ // �֐������R�s�[
push_copy (st->stack, st->start + 3);
- // �ԂɈ����}�[�J������
+ // �ԂɈ����}�[�J��������
push_val (st->stack, C_ARG, 0);
- // �c��̈������R�s�[
+ // �c���̈������R�s�[
for (i = st->start + 4; i < st->end; i++)
{
push_copy (st->stack, i);
@@ -2426,7 +2432,7 @@ int buildin_if (struct script_state *st)
}
/*==========================================
- * �ϐ��ݒ�
+ * �ϐ��ݒ�
*------------------------------------------
*/
int buildin_set (struct script_state *st)
@@ -2448,13 +2454,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
+ // ���l
int val = conv_num (st, &(st->stack->stack_data[st->start + 3]));
set_reg (sd, num, name, (void *) val);
}
@@ -2463,7 +2469,7 @@ int buildin_set (struct script_state *st)
}
/*==========================================
- * �z��ϐ��ݒ�
+ * �z���ϐ��ݒ�
*------------------------------------------
*/
int buildin_setarray (struct script_state *st)
@@ -2496,7 +2502,7 @@ int buildin_setarray (struct script_state *st)
}
/*==========================================
- * �z��ϐ��N���A
+ * �z���ϐ��N���A
*------------------------------------------
*/
int buildin_cleararray (struct script_state *st)
@@ -2529,7 +2535,7 @@ int buildin_cleararray (struct script_state *st)
}
/*==========================================
- * �z��ϐ��R�s�[
+ * �z���ϐ��R�s�[
*------------------------------------------
*/
int buildin_copyarray (struct script_state *st)
@@ -2565,7 +2571,7 @@ int buildin_copyarray (struct script_state *st)
}
/*==========================================
- * �z��ϐ��̃T�C�Y����
+ * �z���ϐ��̃T�C�Y����
*------------------------------------------
*/
static int getarraysize (struct script_state *st, int num, int postfix)
@@ -2600,7 +2606,7 @@ int buildin_getarraysize (struct script_state *st)
}
/*==========================================
- * �z��ϐ�����v�f�폜
+ * �z���ϐ������v�f�폜
*------------------------------------------
*/
int buildin_deletearray (struct script_state *st)
@@ -2640,7 +2646,7 @@ int buildin_deletearray (struct script_state *st)
}
/*==========================================
- * �w��v�f��\���l(�L�[)����������
+ * �w���v�f���\���l(�L�[)�������
*------------------------------------------
*/
int buildin_getelementofarray (struct script_state *st)
@@ -2704,7 +2710,7 @@ int buildin_cutin (struct script_state *st)
}
/*==========================================
- * �J�[�h�̃C���X�g��\������
+ * �J�[�h�̃C���X�g���\������
*------------------------------------------
*/
int buildin_cutincard (struct script_state *st)
@@ -2780,7 +2786,7 @@ int buildin_countitem (struct script_state *st)
}
/*==========================================
- * �d�ʃ`�F�b�N
+ * �d�ʃ`�F�b�N
*------------------------------------------
*/
int buildin_checkweight (struct script_state *st)
@@ -2855,7 +2861,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;
}
@@ -2868,10 +2874,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) //�A�C�e�����w�肵��ID�ɓn��
sd = map_id2sd (conv_num
(st, &(st->stack->stack_data[st->start + 5])));
- if (sd == NULL) //�A�C�e����n�����肪���Ȃ������炨�A��
+ if (sd == NULL) //�A�C�e�����n�����肪���Ȃ�����炨�A��
return 0;
if ((flag = pc_additem (sd, &item_tmp, amount)))
{
@@ -2920,14 +2926,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) //�A�C�e�����w�肵��ID�ɓn��
sd = map_id2sd (conv_num
(st, &(st->stack->stack_data[st->start + 11])));
- if (sd == NULL) //�A�C�e����n�����肪���Ȃ������炨�A��
+ if (sd == NULL) //�A�C�e�����n�����肪���Ȃ�����炨�A��
return 0;
if (nameid < 0)
- { // �����_��
+ { // �����_��
nameid = itemdb_searchrandomid (-nameid);
flag = 1;
}
@@ -3013,7 +3019,7 @@ int buildin_makeitem (struct script_state *st)
m = map_mapname2mapid (mapname);
if (nameid < 0)
- { // �����_��
+ { // �����_��
nameid = itemdb_searchrandomid (-nameid);
flag = 1;
}
@@ -3100,7 +3106,7 @@ int buildin_delitem (struct script_state *st)
}
/*==========================================
- *�L�����֌W�̃p�����[�^�擾
+ *�L�����֌W�̃p�����[�^�擾
*------------------------------------------
*/
int buildin_readparam (struct script_state *st)
@@ -3127,7 +3133,7 @@ int buildin_readparam (struct script_state *st)
}
/*==========================================
- *�L�����֌W��ID�擾
+ *�L�����֌W��ID�擾
*------------------------------------------
*/
int buildin_getcharid (struct script_state *st)
@@ -3158,7 +3164,7 @@ int buildin_getcharid (struct script_state *st)
}
/*==========================================
- *�w��ID��PT���擾
+ *�w��ID��PT���擾
*------------------------------------------
*/
char *buildin_getpartyname_sub (int party_id)
@@ -3195,7 +3201,7 @@ int buildin_getpartyname (struct script_state *st)
}
/*==========================================
- *�w��ID��PT�l���ƃ����o�[ID�擾
+ *�w��ID��PT�l���ƃ����o�[ID�擾
*------------------------------------------
*/
int buildin_getpartymember (struct script_state *st)
@@ -3225,7 +3231,7 @@ int buildin_getpartymember (struct script_state *st)
}
/*==========================================
- *�w��ID�̃M���h���擾
+ *�w��ID�̃M���h���擾
*------------------------------------------
*/
char *buildin_getguildname_sub (int guild_id)
@@ -3256,7 +3262,7 @@ int buildin_getguildname (struct script_state *st)
}
/*==========================================
- *�w��ID��GuildMaster���擾
+ *�w��ID��GuildMaster���擾
*------------------------------------------
*/
char *buildin_getguildmaster_sub (int guild_id)
@@ -3310,7 +3316,7 @@ int buildin_getguildmasterid (struct script_state *st)
}
/*==========================================
- * �L�����N�^�̖��O
+ * �L�����N�^�̖��O
*------------------------------------------
*/
int buildin_strcharinfo (struct script_state *st)
@@ -3388,7 +3394,7 @@ int buildin_getequipid (struct script_state *st)
}
/*==========================================
- * ������������i���B���j���[�p�j
+ * ����������i���B���j���[�p�j
*------------------------------------------
*/
int buildin_getequipname (struct script_state *st)
@@ -3483,7 +3489,7 @@ int buildin_repair (struct script_state *st)
}
/*==========================================
- * �����`�F�b�N
+ * �����`�F�b�N
*------------------------------------------
*/
int buildin_getequipisequiped (struct script_state *st)
@@ -3507,7 +3513,7 @@ int buildin_getequipisequiped (struct script_state *st)
}
/*==========================================
- * �����i���B�”\�`�F�b�N
+ * �����i���B�”\�`�F�b�N
*------------------------------------------
*/
int buildin_getequipisenableref (struct script_state *st)
@@ -3536,7 +3542,7 @@ int buildin_getequipisenableref (struct script_state *st)
}
/*==========================================
- * �����i�Ӓ�`�F�b�N
+ * �����i�Ӓ��`�F�b�N
*------------------------------------------
*/
int buildin_getequipisidentify (struct script_state *st)
@@ -3556,7 +3562,7 @@ int buildin_getequipisidentify (struct script_state *st)
}
/*==========================================
- * �����i���B�x
+ * �����i���B�x
*------------------------------------------
*/
int buildin_getequiprefinerycnt (struct script_state *st)
@@ -3576,7 +3582,7 @@ int buildin_getequiprefinerycnt (struct script_state *st)
}
/*==========================================
- * �����i����LV
+ * �����i����LV
*------------------------------------------
*/
int buildin_getequipweaponlv (struct script_state *st)
@@ -3596,7 +3602,7 @@ int buildin_getequipweaponlv (struct script_state *st)
}
/*==========================================
- * �����i���B������
+ * �����i���B������
*------------------------------------------
*/
int buildin_getequippercentrefinery (struct script_state *st)
@@ -3617,7 +3623,7 @@ int buildin_getequippercentrefinery (struct script_state *st)
}
/*==========================================
- * ���B����
+ * ���B����
*------------------------------------------
*/
int buildin_successrefitem (struct script_state *st)
@@ -3645,7 +3651,7 @@ int buildin_successrefitem (struct script_state *st)
}
/*==========================================
- * ���B���s
+ * ���B���s
*------------------------------------------
*/
int buildin_failedrefitem (struct script_state *st)
@@ -3660,10 +3666,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
+ // ���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
+ // ���̐l�ɂ��s���ʒm
clif_misceffect (&sd->bl, 2);
}
@@ -3704,7 +3710,7 @@ int buildin_statusup2 (struct script_state *st)
}
/*==========================================
- * �����i�ɂ��\�͒l�{�[�i�X
+ * �����i�ɂ����\�͒l�{�[�i�X
*------------------------------------------
*/
int buildin_bonus (struct script_state *st)
@@ -3721,7 +3727,7 @@ int buildin_bonus (struct script_state *st)
}
/*==========================================
- * �����i�ɂ��\�͒l�{�[�i�X
+ * �����i�ɂ����\�͒l�{�[�i�X
*------------------------------------------
*/
int buildin_bonus2 (struct script_state *st)
@@ -3739,7 +3745,7 @@ int buildin_bonus2 (struct script_state *st)
}
/*==========================================
- * �����i�ɂ��\�͒l�{�[�i�X
+ * �����i�ɂ����\�͒l�{�[�i�X
*------------------------------------------
*/
int buildin_bonus3 (struct script_state *st)
@@ -3758,7 +3764,7 @@ int buildin_bonus3 (struct script_state *st)
}
/*==========================================
- * �X�L������
+ * �X�L������
*------------------------------------------
*/
int buildin_skill (struct script_state *st)
@@ -3797,7 +3803,7 @@ int buildin_setskill (struct script_state *st)
}
/*==========================================
- * �M���h�X�L���擾
+ * �M���h�X�L���擾
*------------------------------------------
*/
int buildin_guildskill (struct script_state *st)
@@ -3818,7 +3824,7 @@ int buildin_guildskill (struct script_state *st)
}
/*==========================================
- * �X�L�����x������
+ * �X�L�����x������
*------------------------------------------
*/
int buildin_getskilllv (struct script_state *st)
@@ -3893,6 +3899,43 @@ int buildin_end (struct script_state *st)
}
/*==========================================
+ * [Freeyorp] Return the current opt2
+ *------------------------------------------
+ */
+
+int buildin_getopt2 (struct script_state *st)
+{
+ struct map_session_data *sd;
+
+ sd = script_rid2sd (st);
+
+ push_val (st->stack, C_INT, sd->opt2);
+
+ return 0;
+}
+
+/*==========================================
+ * [Freeyorp] Sets opt2
+ *------------------------------------------
+ */
+
+int buildin_setopt2 (struct script_state *st)
+{
+ int new;
+ struct map_session_data *sd;
+
+ new = conv_num (st, &(st->stack->stack_data[st->start + 2]));
+ sd = script_rid2sd (st);
+ if (!(new ^ sd->opt2))
+ return 0;
+ sd->opt2 = new;
+ clif_changeoption (&sd->bl);
+ pc_calcstatus (sd, 0);
+
+ return 0;
+}
+
+/*==========================================
*
*------------------------------------------
*/
@@ -3955,7 +3998,7 @@ int buildin_checkcart (struct script_state *st)
}
/*==========================================
- * �J�[�g��t����
+ * �J�[�g���t����
*------------------------------------------
*/
int buildin_setcart (struct script_state *st)
@@ -3992,7 +4035,7 @@ int buildin_checkfalcon (struct script_state *st)
}
/*==========================================
- * ���t����
+ * �����t����
*------------------------------------------
*/
int buildin_setfalcon (struct script_state *st)
@@ -4029,7 +4072,7 @@ int buildin_checkriding (struct script_state *st)
}
/*==========================================
- * �y�R�y�R���
+ * �y�R�y�R����
*------------------------------------------
*/
int buildin_setriding (struct script_state *st)
@@ -4043,7 +4086,7 @@ int buildin_setriding (struct script_state *st)
}
/*==========================================
- * �Z�[�u�|�C���g�̕ۑ�
+ * �Z�[�u�|�C���g�̕ۑ�
*------------------------------------------
*/
int buildin_savepoint (struct script_state *st)
@@ -4159,7 +4202,7 @@ int buildin_gettimestr (struct script_state *st)
}
/*==========================================
- * �J�v���q�ɂ��J��
+ * �J�v���q�ɂ��J��
*------------------------------------------
*/
int buildin_openstorage (struct script_state *st)
@@ -4188,7 +4231,7 @@ int buildin_guildopenstorage (struct script_state *st)
}
/*==========================================
- * �A�C�e���ɂ��X�L������
+ * �A�C�e���ɂ����X�L������
*------------------------------------------
*/
int buildin_itemskill (struct script_state *st)
@@ -4201,7 +4244,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�ł��Ȃ�
+ // �r�����ɃX�L���A�C�e���͎g�p�ł��Ȃ�
if (sd->skilltimer != -1)
return 0;
@@ -4212,7 +4255,7 @@ int buildin_itemskill (struct script_state *st)
}
/*==========================================
- * NPC�Ōo���l�グ��
+ * NPC�Ōo���l�グ��
*------------------------------------------
*/
int buildin_getexp (struct script_state *st)
@@ -4231,7 +4274,7 @@ int buildin_getexp (struct script_state *st)
}
/*==========================================
- * �����X�^�[����
+ * �����X�^�[����
*------------------------------------------
*/
int buildin_monster (struct script_state *st)
@@ -4254,7 +4297,7 @@ int buildin_monster (struct script_state *st)
}
/*==========================================
- * �����X�^�[����
+ * �����X�^�[����
*------------------------------------------
*/
int buildin_areamonster (struct script_state *st)
@@ -4279,7 +4322,7 @@ int buildin_areamonster (struct script_state *st)
}
/*==========================================
- * �����X�^�[�폜
+ * �����X�^�[�폜
*------------------------------------------
*/
int buildin_killmonster_sub (struct block_list *bl, va_list ap)
@@ -4339,7 +4382,7 @@ int buildin_killmonsterall (struct script_state *st)
}
/*==========================================
- * �C�x���g���s
+ * �C�x���g��s
*------------------------------------------
*/
int buildin_doevent (struct script_state *st)
@@ -4351,7 +4394,7 @@ int buildin_doevent (struct script_state *st)
}
/*==========================================
- * NPC��̃C�x���g���s
+ * NPC���̃C�x���g��s
*------------------------------------------
*/
int buildin_donpcevent (struct script_state *st)
@@ -4363,7 +4406,7 @@ int buildin_donpcevent (struct script_state *st)
}
/*==========================================
- * �C�x���g�^�C�}�[�lj�
+ * �C�x���g�^�C�}�[�lj�
*------------------------------------------
*/
int buildin_addtimer (struct script_state *st)
@@ -4377,7 +4420,7 @@ int buildin_addtimer (struct script_state *st)
}
/*==========================================
- * �C�x���g�^�C�}�[�폜
+ * �C�x���g�^�C�}�[�폜
*------------------------------------------
*/
int buildin_deltimer (struct script_state *st)
@@ -4389,7 +4432,7 @@ int buildin_deltimer (struct script_state *st)
}
/*==========================================
- * �C�x���g�^�C�}�[�̃J�E���g�l�lj�
+ * �C�x���g�^�C�}�[�̃J�E���g�l�lj�
*------------------------------------------
*/
int buildin_addtimercount (struct script_state *st)
@@ -4403,7 +4446,7 @@ int buildin_addtimercount (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[������
+ * NPC�^�C�}�[������
*------------------------------------------
*/
int buildin_initnpctimer (struct script_state *st)
@@ -4421,7 +4464,7 @@ int buildin_initnpctimer (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[�J�n
+ * NPC�^�C�}�[�J�n
*------------------------------------------
*/
int buildin_startnpctimer (struct script_state *st)
@@ -4438,7 +4481,7 @@ int buildin_startnpctimer (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[��~
+ * NPC�^�C�}�[���~
*------------------------------------------
*/
int buildin_stopnpctimer (struct script_state *st)
@@ -4455,7 +4498,7 @@ int buildin_stopnpctimer (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[��񏊓�
+ * NPC�^�C�}�[���񏊓�
*------------------------------------------
*/
int buildin_getnpctimer (struct script_state *st)
@@ -4486,7 +4529,7 @@ int buildin_getnpctimer (struct script_state *st)
}
/*==========================================
- * NPC�^�C�}�[�l�ݒ�
+ * NPC�^�C�}�[�l�ݒ�
*------------------------------------------
*/
int buildin_setnpctimer (struct script_state *st)
@@ -4505,7 +4548,7 @@ int buildin_setnpctimer (struct script_state *st)
}
/*==========================================
- * �V�̐��A�i�E���X
+ * �V�̐��A�i�E���X
*------------------------------------------
*/
int buildin_announce (struct script_state *st)
@@ -4527,7 +4570,7 @@ int buildin_announce (struct script_state *st)
}
/*==========================================
- * �V�̐��A�i�E���X�i����}�b�v�j
+ * �V�̐��A�i�E���X�i����}�b�v�j
*------------------------------------------
*/
int buildin_mapannounce_sub (struct block_list *bl, va_list ap)
@@ -4559,7 +4602,7 @@ int buildin_mapannounce (struct script_state *st)
}
/*==========================================
- * �V�̐��A�i�E���X�i����G���A�j
+ * �V�̐��A�i�E���X�i����G���A�j
*------------------------------------------
*/
int buildin_areaannounce (struct script_state *st)
@@ -4586,7 +4629,7 @@ int buildin_areaannounce (struct script_state *st)
}
/*==========================================
- * ���[�U�[������
+ * ���[�U�[������
*------------------------------------------
*/
int buildin_getusers (struct script_state *st)
@@ -4608,7 +4651,7 @@ int buildin_getusers (struct script_state *st)
}
/*==========================================
- * �}�b�v�w�胆�[�U�[������
+ * �}�b�v�w�胆�[�U�[������
*------------------------------------------
*/
int buildin_getmapusers (struct script_state *st)
@@ -4626,7 +4669,7 @@ int buildin_getmapusers (struct script_state *st)
}
/*==========================================
- * �G���A�w�胆�[�U�[������
+ * �G���A�w�胆�[�U�[������
*------------------------------------------
*/
int buildin_getareausers_sub (struct block_list *bl, va_list ap)
@@ -4657,7 +4700,7 @@ int buildin_getareausers (struct script_state *st)
}
/*==========================================
- * �G���A�w��h���b�v�A�C�e��������
+ * �G���A�w���h���b�v�A�C�e��������
*------------------------------------------
*/
int buildin_getareadropitem_sub (struct block_list *bl, va_list ap)
@@ -4709,7 +4752,7 @@ int buildin_getareadropitem (struct script_state *st)
}
/*==========================================
- * NPC�̗L����
+ * NPC�̗L����
*------------------------------------------
*/
int buildin_enablenpc (struct script_state *st)
@@ -4721,7 +4764,7 @@ int buildin_enablenpc (struct script_state *st)
}
/*==========================================
- * NPC�̖�����
+ * NPC�̖�����
*------------------------------------------
*/
int buildin_disablenpc (struct script_state *st)
@@ -4759,7 +4802,7 @@ int buildin_disablearena (struct script_state *st) // Added by RoVeRT
}
/*==========================================
- * �B��Ă���NPC�̕\��
+ * �B���Ă���NPC�̕\��
*------------------------------------------
*/
int buildin_hideoffnpc (struct script_state *st)
@@ -4771,7 +4814,7 @@ int buildin_hideoffnpc (struct script_state *st)
}
/*==========================================
- * NPC���n�C�f�B���O
+ * NPC���n�C�f�B���O
*------------------------------------------
*/
int buildin_hideonnpc (struct script_state *st)
@@ -4783,7 +4826,7 @@ int buildin_hideonnpc (struct script_state *st)
}
/*==========================================
- * ��Ԉُ�ɂ�����
+ * ���Ԉُ��ɂ�����
*------------------------------------------
*/
int buildin_sc_start (struct script_state *st)
@@ -4793,7 +4836,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) //�w�肵���L���������Ԉُ��ɂ���
bl = map_id2bl (conv_num
(st, &(st->stack->stack_data[st->start + 5])));
else
@@ -4806,7 +4849,7 @@ int buildin_sc_start (struct script_state *st)
}
/*==========================================
- * ��Ԉُ�ɂ�����(�m���w��)
+ * ���Ԉُ��ɂ�����(�m���w��)
*------------------------------------------
*/
int buildin_sc_start2 (struct script_state *st)
@@ -4817,7 +4860,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) //�w�肵���L���������Ԉُ��ɂ���
bl = map_id2bl (conv_num
(st, &(st->stack->stack_data[st->start + 6])));
else
@@ -4831,7 +4874,7 @@ int buildin_sc_start2 (struct script_state *st)
}
/*==========================================
- * ��Ԉُ킪����
+ * ���Ԉُ킪����
*------------------------------------------
*/
int buildin_sc_end (struct script_state *st)
@@ -4865,7 +4908,7 @@ int buildin_sc_check (struct script_state *st)
}
/*==========================================
- * ��Ԉُ�ϐ����v�Z�����m����Ԃ�
+ * ���Ԉُ��ϐ����v�Z�����m�����Ԃ�
*------------------------------------------
*/
int buildin_getscrate (struct script_state *st)
@@ -4876,7 +4919,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) //�w�肵���L�����̑ϐ����v�Z����
bl = map_id2bl (conv_num
(st, &(st->stack->stack_data[st->start + 6])));
else
@@ -4932,7 +4975,7 @@ int buildin_resetlvl (struct script_state *st)
}
/*==========================================
- * �X�e�[�^�X���Z�b�g
+ * �X�e�[�^�X���Z�b�g
*------------------------------------------
*/
int buildin_resetstatus (struct script_state *st)
@@ -4944,7 +4987,7 @@ int buildin_resetstatus (struct script_state *st)
}
/*==========================================
- * �X�L�����Z�b�g
+ * �X�L�����Z�b�g
*------------------------------------------
*/
int buildin_resetskill (struct script_state *st)
@@ -4978,7 +5021,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); // �����O
// }
sd->view_class = vclass;
@@ -4987,7 +5030,7 @@ int buildin_changebase (struct script_state *st)
}
/*==========================================
- * ���ʕϊ�
+ * ���ʕϊ�
*------------------------------------------
*/
int buildin_changesex (struct script_state *st)
@@ -5015,7 +5058,7 @@ int buildin_changesex (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�쐬
+ * npc�`���b�g�쐬
*------------------------------------------
*/
int buildin_waitingroom (struct script_state *st)
@@ -5033,20 +5076,20 @@ int buildin_waitingroom (struct script_state *st)
get_val (st, data);
if (data->type == C_INT)
{
- // �VAthena�d�l(��Athena�d�l�ƌ݊�������)
+ // �VAthena�d�l(��Athena�d�l�ƌ݊�������)
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�d�l
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�d�l
if (st->end > st->start + 4)
ev = conv_str (st, &(st->stack->stack_data[st->start + 4]));
}
@@ -5056,7 +5099,7 @@ int buildin_waitingroom (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�폜
+ * npc�`���b�g�폜
*------------------------------------------
*/
int buildin_delwaitingroom (struct script_state *st)
@@ -5072,7 +5115,7 @@ int buildin_delwaitingroom (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�S���R��o��
+ * npc�`���b�g�S���R���o��
*------------------------------------------
*/
int buildin_waitingroomkickall (struct script_state *st)
@@ -5094,7 +5137,7 @@ int buildin_waitingroomkickall (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�C�x���g�L����
+ * npc�`���b�g�C�x���g�L����
*------------------------------------------
*/
int buildin_enablewaitingroomevent (struct script_state *st)
@@ -5116,7 +5159,7 @@ int buildin_enablewaitingroomevent (struct script_state *st)
}
/*==========================================
- * npc�`���b�g�C�x���g������
+ * npc�`���b�g�C�x���g������
*------------------------------------------
*/
int buildin_disablewaitingroomevent (struct script_state *st)
@@ -5138,7 +5181,7 @@ int buildin_disablewaitingroomevent (struct script_state *st)
}
/*==========================================
- * npc�`���b�g��ԏ���
+ * npc�`���b�g���ԏ���
*------------------------------------------
*/
int buildin_getwaitingroomstate (struct script_state *st)
@@ -5196,7 +5239,7 @@ int buildin_getwaitingroomstate (struct script_state *st)
}
/*==========================================
- * �`���b�g�����o�[(�K��l��)���[�v
+ * �`���b�g�����o�[(�K���l��)���[�v
*------------------------------------------
*/
int buildin_warpwaitingpc (struct script_state *st)
@@ -5220,7 +5263,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]; // ���X�g�擪��PC��X�ɁB
mapreg_setreg (add_str ("$@warpwaitingpc") + (i << 24), sd->bl.id);
@@ -5228,7 +5271,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) // �e���|�֎~
return 0;
pc_setpos (sd, sd->status.save_point.map,
@@ -5242,7 +5285,7 @@ int buildin_warpwaitingpc (struct script_state *st)
}
/*==========================================
- * RID�̃A�^�b�`
+ * RID�̃A�^�b�`
*------------------------------------------
*/
int buildin_attachrid (struct script_state *st)
@@ -5253,7 +5296,7 @@ int buildin_attachrid (struct script_state *st)
}
/*==========================================
- * RID�̃f�^�b�`
+ * RID�̃f�^�b�`
*------------------------------------------
*/
int buildin_detachrid (struct script_state *st)
@@ -5263,7 +5306,7 @@ int buildin_detachrid (struct script_state *st)
}
/*==========================================
- * ���݃`�F�b�N
+ * ���݃`�F�b�N
*------------------------------------------
*/
int buildin_isloggedin (struct script_state *st)
@@ -5470,7 +5513,7 @@ int buildin_pvpon (struct script_state *st)
return 0;
for (i = 0; i < fd_max; i++)
- { //�l�������[�v
+ { //�l�������[�v
if (session[i] && (pl_sd = session[i]->session_data)
&& pl_sd->state.auth)
{
@@ -5507,7 +5550,7 @@ int buildin_pvpoff (struct script_state *st)
return 0;
for (i = 0; i < fd_max; i++)
- { //�l�������[�v
+ { //�l�������[�v
if (session[i] && (pl_sd = session[i]->session_data)
&& pl_sd->state.auth)
{
@@ -5561,7 +5604,7 @@ int buildin_gvgoff (struct script_state *st)
}
/*==========================================
- * NPC�G���[�V����
+ * NPC�G���[�V����
*------------------------------------------
*/
@@ -5930,7 +5973,7 @@ int buildin_setcastledata (struct script_state *st)
}
/* =====================================================================
- * �M���h����v������
+ * �M���h�������v������
* ---------------------------------------------------------------------
*/
int buildin_requestguildinfo (struct script_state *st)
@@ -5947,7 +5990,7 @@ int buildin_requestguildinfo (struct script_state *st)
}
/* =====================================================================
- * �J�[�h�̐��𓾂�
+ * �J�[�h�̐��𓾂�
* ---------------------------------------------------------------------
*/
int buildin_getequipcardcnt (struct script_state *st)
@@ -5960,7 +6003,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�Ȃ�
+ { // ���������̓J�[�h�Ȃ�
push_val (st->stack, C_INT, 0);
return 0;
}
@@ -5980,7 +6023,7 @@ int buildin_getequipcardcnt (struct script_state *st)
}
/* ================================================================
- * �J�[�h���O������
+ * �J�[�h�����O������
* ----------------------------------------------------------------
*/
int buildin_successremovecards (struct script_state *st)
@@ -5994,7 +6037,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
@@ -6012,7 +6055,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
+ { // ���ĂȂ��Ȃ��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);
@@ -6022,7 +6065,7 @@ int buildin_successremovecards (struct script_state *st)
while (c--);
if (cardflag == 1)
- { // �J�[�h����菜�����A�C�e������
+ { // �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 =
@@ -6032,7 +6075,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
+ { // ���ĂȂ��Ȃ��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);
@@ -6044,8 +6087,8 @@ int buildin_successremovecards (struct script_state *st)
}
/* ================================================================
- * �J�[�h���O�����s slot,type
- * type=0: ���������A1:�J�[�h�����A2:������A3:��������
+ * �J�[�h�����O�����s slot,type
+ * type=0: ���������A1:�J�[�h�����A2:������A3:��������
* ----------------------------------------------------------------
*/
int buildin_failedremovecards (struct script_state *st)
@@ -6060,7 +6103,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
@@ -6072,7 +6115,7 @@ int buildin_failedremovecards (struct script_state *st)
cardflag = 1;
if (typefail == 2)
- { // ����̂ݑ����Ȃ�A�J�[�h�͎󂯎�点��
+ { // �����̂ݑ����Ȃ��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 =
@@ -6095,13 +6138,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
+ { // �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 =
@@ -6349,7 +6392,7 @@ int buildin_guardianinfo (struct script_state *st)
}
/*==========================================
- * ID����Item��
+ * ID����Item��
*------------------------------------------
*/
int buildin_getitemname (struct script_state *st)
@@ -6421,7 +6464,7 @@ int buildin_getpartnerid (struct script_state *st)
}
/*==========================================
- * PC�̏����i���ǂݎ��
+ * PC�̏����i�����ǂݎ���
*------------------------------------------
*/
int buildin_getinventorylist (struct script_state *st)
@@ -6597,9 +6640,9 @@ int buildin_clearitem (struct script_state *st)
}
/*==========================================
- * NPC�N���X�`�F���W
- * class�͕ς�肽��class
- * type�͒ʏ�0�Ȃ̂��ȁH
+ * NPC�N���X�`�F���W
+ * class�͕ς��肽��class
+ * type�͒ʏ�0�Ȃ̂��ȁH
*------------------------------------------
*/
int buildin_classchange (struct script_state *st)
@@ -6617,7 +6660,7 @@ int buildin_classchange (struct script_state *st)
}
/*==========================================
- * NPC���甭������G�t�F�N�g
+ * NPC���甭�������G�t�F�N�g
*------------------------------------------
*/
int buildin_misceffect (struct script_state *st)
@@ -6646,7 +6689,7 @@ int buildin_misceffect (struct script_state *st)
}
/*==========================================
- * �T�E���h�G�t�F�N�g
+ * �T�E���h�G�t�F�N�g
*------------------------------------------
*/
int buildin_soundeffect (struct script_state *st)
@@ -7116,10 +7159,10 @@ int buildin_fakenpcname (struct script_state *st)
}
//
-// ���s��main
+// ��s��main
//
/*==========================================
- * �R�}���h�̓ǂݎ��
+ * �R�}���h�̓ǂݎ���
*------------------------------------------
*/
static int unget_com_data = -1;
@@ -7147,7 +7190,7 @@ int get_com (unsigned char *script, int *pos)
}
/*==========================================
- * �R�}���h�̃v�b�V���o�b�N
+ * �R�}���h�̃v�b�V���o�b�N
*------------------------------------------
*/
void unget_com (int c)
@@ -7161,7 +7204,7 @@ void unget_com (int c)
}
/*==========================================
- * ���l�̏���
+ * ���l�̏���
*------------------------------------------
*/
int get_num (unsigned char *script, int *pos)
@@ -7178,7 +7221,7 @@ int get_num (unsigned char *script, int *pos)
}
/*==========================================
- * �X�^�b�N����l�����o��
+ * �X�^�b�N�����l�������o��
*------------------------------------------
*/
int pop_val (struct script_state *st)
@@ -7195,7 +7238,7 @@ int pop_val (struct script_state *st)
#define isstr(c) ((c).type==C_STR || (c).type==C_CONSTSTR)
/*==========================================
- * ���Z���Z�q
+ * ��Z���Z�q
*------------------------------------------
*/
void op_add (struct script_state *st)
@@ -7216,7 +7259,7 @@ void op_add (struct script_state *st)
st->stack->stack_data[st->stack->sp].u.num;
}
else
- { // ss�̗\��
+ { // ss�̗\��
char *buf;
buf =
(char *)
@@ -7235,7 +7278,7 @@ void op_add (struct script_state *st)
}
/*==========================================
- * �񍀉��Z�q(������)
+ * �񍀉��Z�q(������)
*------------------------------------------
*/
void op_2str (struct script_state *st, int op, int sp1, int sp2)
@@ -7278,7 +7321,7 @@ void op_2str (struct script_state *st, int op, int sp1, int sp2)
}
/*==========================================
- * �񍀉��Z�q(���l)
+ * �񍀉��Z�q(���l)
*------------------------------------------
*/
void op_2num (struct script_state *st, int op, int i1, int i2)
@@ -7341,7 +7384,7 @@ void op_2num (struct script_state *st, int op, int i1, int i2)
}
/*==========================================
- * �񍀉��Z�q
+ * �񍀉��Z�q
*------------------------------------------
*/
void op_2 (struct script_state *st, int op)
@@ -7376,7 +7419,7 @@ void op_2 (struct script_state *st, int op)
}
/*==========================================
- * �P�����Z�q
+ * �P�����Z�q
*------------------------------------------
*/
void op_1num (struct script_state *st, int op)
@@ -7399,7 +7442,7 @@ void op_1num (struct script_state *st, int op)
}
/*==========================================
- * �֐��̎��s
+ * �֐��̎�s
*------------------------------------------
*/
int run_func (struct script_state *st)
@@ -7478,11 +7521,11 @@ int run_func (struct script_state *st)
if (st->state == RETFUNC)
{
- // ���[�U�[��`�֐�����̕��A
+ // ���[�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); // ���A�Ɏז��ȃX�^�b�N�폜
if (st->defsp < 4
|| st->stack->stack_data[st->defsp - 1].type != C_RETINFO)
{
@@ -7491,12 +7534,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])); // �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���^�𕜌�
- pop_stack (st->stack, olddefsp - 4 - i, olddefsp); // �v��Ȃ��Ȃ����X�^�b�N(�����ƕ��A�p�f�[�^)�폜
+ pop_stack (st->stack, olddefsp - 4 - i, olddefsp); // �v���Ȃ��Ȃ���X�^�b�N(�����ƕ��A�p�f�[�^)�폜
st->state = GOTO;
}
@@ -7505,7 +7548,7 @@ int run_func (struct script_state *st)
}
/*==========================================
- * �X�N���v�g�̎��s���C������
+ * �X�N���v�g�̎�s���C������
*------------------------------------------
*/
int run_script_main (unsigned char *script, int pos, int rid, int oid,
@@ -7631,7 +7674,7 @@ int run_script_main (unsigned char *script, int pos, int rid, int oid,
if (st->state != END)
{
- // �ĊJ���邽�߂ɃX�^�b�N����ۑ�
+ // �ĊJ���邽�߂ɃX�^�b�N�������ۑ�
struct map_session_data *sd = map_id2sd (st->rid);
if (sd /* && sd->npc_stackbuf==NULL */ )
{
@@ -7653,7 +7696,7 @@ int run_script_main (unsigned char *script, int pos, int rid, int oid,
}
/*==========================================
- * �X�N���v�g�̎��s
+ * �X�N���v�g�̎�s
*------------------------------------------
*/
int run_script (unsigned char *script, int pos, int rid, int oid)
@@ -7674,7 +7717,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
+ // �O���̃X�^�b�N�𕜋A
script = sd->npc_script;
stack.sp = sd->npc_stack;
stack.sp_max = sd->npc_stackmax;
@@ -7688,7 +7731,7 @@ int run_script_l (unsigned char *script, int pos, int rid, int oid,
}
else
{
- // �X�^�b�N������
+ // �X�^�b�N������
stack.sp = 0;
stack.sp_max = 64;
stack.stack_data =
@@ -7714,7 +7757,7 @@ int run_script_l (unsigned char *script, int pos, int rid, int oid,
}
/*==========================================
- * �}�b�v�ϐ��̕ύX
+ * �}�b�v�ϐ��̕ύX
*------------------------------------------
*/
int mapreg_setreg (int num, int val)
@@ -7729,7 +7772,7 @@ int mapreg_setreg (int num, int val)
}
/*==========================================
- * ������^�}�b�v�ϐ��̕ύX
+ * �������^�}�b�v�ϐ��̕ύX
*------------------------------------------
*/
int mapreg_setregstr (int num, const char *str)
@@ -7753,7 +7796,7 @@ int mapreg_setregstr (int num, const char *str)
}
/*==========================================
- * �i���I�}�b�v�ϐ��̓ǂݍ���
+ * �i���I�}�b�v�ϐ��̓ǂݍ���
*------------------------------------------
*/
static int script_load_mapreg ()
@@ -7800,7 +7843,7 @@ static int script_load_mapreg ()
}
/*==========================================
- * �i���I�}�b�v�ϐ��̏�������
+ * �i���I�}�b�v�ϐ��̏�������
*------------------------------------------
*/
static int script_save_mapreg_intsub (void *key, void *data, va_list ap)
@@ -7923,7 +7966,7 @@ int script_config_read (char *cfgName)
}
/*==========================================
- * �I��
+ * �I��
*------------------------------------------
*/
static int mapreg_db_final (void *key, void *data, va_list ap)
@@ -7974,7 +8017,7 @@ int do_final_script ()
}
/*==========================================
- * ������
+ * ������
*------------------------------------------
*/
int do_init_script ()