summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeyorp <Freeyorp101@hotmail.com>2009-12-29 12:34:38 +1300
committerJared Adams <jaxad0127@gmail.com>2009-12-28 23:51:15 +0000
commit7eb9c3fcb6b4148c53a3201992c19e0e8d603e7f (patch)
treef1705dbac68961c45f11e277053ca751bd88424b
parent0875a0ce6752c4ae1256307351577e293f00796f (diff)
downloadtmwa-7eb9c3fcb6b4148c53a3201992c19e0e8d603e7f.tar.gz
tmwa-7eb9c3fcb6b4148c53a3201992c19e0e8d603e7f.tar.bz2
tmwa-7eb9c3fcb6b4148c53a3201992c19e0e8d603e7f.tar.xz
tmwa-7eb9c3fcb6b4148c53a3201992c19e0e8d603e7f.zip
Also pass a variable @itemId when running equip scripts
-rw-r--r--src/map/pc.c60
1 files changed, 36 insertions, 24 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 49018e7..1e9029a 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1461,14 +1461,16 @@ int pc_calcstatus (struct map_session_data *sd, int first)
int c = sd->status.inventory[index].card[j];
if (c > 0)
{
- argrec_t arg;
- arg.name = "@slotId";
- arg.v.i = i;
+ argrec_t arg[2];
+ arg[0].name = "@slotId";
+ arg[0].v.i = i;
+ arg[1].name = "@itemId";
+ arg[1].v.i = sd->inventory_data[index]->nameid;
if (i == 8
&& sd->status.inventory[index].equip == 0x20)
sd->state.lr_flag = 1;
run_script_l (itemdb_equipscript (c), 0, sd->bl.id,
- 0, 1, &arg);
+ 0, 2, arg);
sd->state.lr_flag = 0;
}
}
@@ -1485,11 +1487,13 @@ int pc_calcstatus (struct map_session_data *sd, int first)
{ // �J�[�h
int c = sd->status.inventory[index].card[j];
if (c > 0) {
- argrec_t arg;
- arg.name = "@slotId";
- arg.v.i = i;
+ argrec_t arg[2];
+ arg[0].name = "@slotId";
+ arg[0].v.i = i;
+ arg[1].name = "@itemId";
+ arg[1].v.i = sd->inventory_data[index]->nameid;
run_script_l (itemdb_equipscript (c), 0, sd->bl.id,
- 0, 1, &arg);
+ 0, 2, arg);
}
}
}
@@ -1546,19 +1550,23 @@ int pc_calcstatus (struct map_session_data *sd, int first)
sd->attackrange_ += sd->inventory_data[index]->range;
sd->state.lr_flag = 1;
{
- argrec_t arg;
- arg.name = "@slotId";
- arg.v.i = i;
+ argrec_t arg[2];
+ arg[0].name = "@slotId";
+ arg[0].v.i = i;
+ arg[1].name = "@itemId";
+ arg[1].v.i = sd->inventory_data[index]->nameid;
run_script_l (sd->inventory_data[index]->equip_script, 0,
- sd->bl.id, 0, 1, &arg);
+ sd->bl.id, 0, 2, arg);
}
sd->state.lr_flag = 0;
}
else
{ //�񓁗������ȊO
- argrec_t arg;
- arg.name = "@slotId";
- arg.v.i = i;
+ argrec_t arg[2];
+ arg[0].name = "@slotId";
+ arg[0].v.i = i;
+ arg[1].name = "@itemId";
+ arg[1].v.i = sd->inventory_data[index]->nameid;
sd->watk += sd->inventory_data[index]->atk;
sd->watk2 += (r = sd->status.inventory[index].refine) * // ���B�U����
refinebonus[wlv][0];
@@ -1572,19 +1580,21 @@ int pc_calcstatus (struct map_session_data *sd, int first)
}
sd->attackrange += sd->inventory_data[index]->range;
run_script_l (sd->inventory_data[index]->equip_script, 0,
- sd->bl.id, 0, 1, &arg);
+ sd->bl.id, 0, 2, arg);
}
}
else if (sd->inventory_data[index]->type == 5)
{
- argrec_t arg;
- arg.name = "@slotId";
- arg.v.i = i;
+ argrec_t arg[2];
+ arg[0].name = "@slotId";
+ arg[0].v.i = i;
+ arg[1].name = "@itemId";
+ arg[1].v.i = sd->inventory_data[index]->nameid;
sd->watk += sd->inventory_data[index]->atk;
refinedef +=
sd->status.inventory[index].refine * refinebonus[0][0];
run_script_l (sd->inventory_data[index]->equip_script, 0,
- sd->bl.id, 0, 1, &arg);
+ sd->bl.id, 0, 2, arg);
}
}
}
@@ -1602,12 +1612,14 @@ int pc_calcstatus (struct map_session_data *sd, int first)
index = sd->equip_index[10];
if (sd->inventory_data[index])
{ //�܂�����������Ă��Ȃ�
- argrec_t arg;
- arg.name = "@slotId";
- arg.v.i = i;
+ argrec_t arg[2];
+ arg[0].name = "@slotId";
+ arg[0].v.i = i;
+ arg[1].name = "@itemId";
+ arg[1].v.i = sd->inventory_data[index]->nameid;
sd->state.lr_flag = 2;
run_script_l (sd->inventory_data[index]->equip_script, 0, sd->bl.id,
- 0, 1, &arg);
+ 0, 2, arg);
sd->state.lr_flag = 0;
sd->arrow_atk += sd->inventory_data[index]->atk;
}