summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-01-11 13:09:12 -0700
committerFate <fate-tmw@googlemail.com>2009-01-11 13:09:12 -0700
commitc6daaedc955ab781f117ccdb8c906b924ce9be59 (patch)
treea47a3710ba7c44f139f3c9078855245e167fdfae /src/map/script.c
parent611af5c39ad2154348e649af5a459af957f1448c (diff)
downloadtmwa-c6daaedc955ab781f117ccdb8c906b924ce9be59.tar.gz
tmwa-c6daaedc955ab781f117ccdb8c906b924ce9be59.tar.bz2
tmwa-c6daaedc955ab781f117ccdb8c906b924ce9be59.tar.xz
tmwa-c6daaedc955ab781f117ccdb8c906b924ce9be59.zip
Added setskill script command to set skill levels permanently.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 1685d21..f4da2b8 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -157,6 +157,7 @@ int buildin_bonus(struct script_state *st);
int buildin_bonus2(struct script_state *st);
int buildin_bonus3(struct script_state *st);
int buildin_skill(struct script_state *st);
+int buildin_setskill(struct script_state *st);
int buildin_guildskill(struct script_state *st);
int buildin_getskilllv(struct script_state *st);
int buildin_getgdskilllv(struct script_state *st);
@@ -364,6 +365,7 @@ struct {
{buildin_bonus2,"bonus2","iii"},
{buildin_bonus3,"bonus3","iiii"},
{buildin_skill,"skill","ii*"},
+ {buildin_setskill,"setskill","ii"}, // [Fate]
{buildin_guildskill,"guildskill","ii"},
{buildin_getskilllv,"getskilllv","i"},
{buildin_getgdskilllv,"getgdskilllv","ii"},
@@ -3176,6 +3178,26 @@ int buildin_skill(struct script_state *st)
return 0;
}
+
+/*==========================================
+ * [Fate] Sets the skill level permanently
+ *------------------------------------------
+ */
+int buildin_setskill(struct script_state *st)
+{
+ int id,level,flag=1;
+ struct map_session_data *sd;
+
+ id=conv_num(st,& (st->stack->stack_data[st->start+2]));
+ level=conv_num(st,& (st->stack->stack_data[st->start+3]));
+ sd=script_rid2sd(st);
+
+ sd->status.skill[id].id = level? id : 0;
+ sd->status.skill[id].lv = level;
+ sd->status.skill[id].flag = 0;
+ clif_skillinfoblock(sd);
+}
+
/*==========================================
* ギルドスキル取得
*------------------------------------------