summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-01 07:15:33 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-01 07:15:33 +0000
commitcdb790a155ac008b78cd3cceb823cc1f79f6735c (patch)
treee4b84c5672ef53f6604ac8d706b801220a8be0d8 /src/map/script.c
parent6803e755d6805fe86345558a76f7d7b24dbbacc3 (diff)
downloadhercules-cdb790a155ac008b78cd3cceb823cc1f79f6735c.tar.gz
hercules-cdb790a155ac008b78cd3cceb823cc1f79f6735c.tar.bz2
hercules-cdb790a155ac008b78cd3cceb823cc1f79f6735c.tar.xz
hercules-cdb790a155ac008b78cd3cceb823cc1f79f6735c.zip
* Added script command 'setbattleflag'.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5407 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index c0c3b9040..2bee93f63 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -403,6 +403,7 @@ int buildin_petstat(struct script_state *st); // [Lance] Pet Stat Rq: Dubby
int buildin_callshop(struct script_state *st); // [Skotlex]
int buildin_equip(struct script_state *st);
int buildin_autoequip(struct script_state *st);
+int buildin_setbattleflag(struct script_state *st);
void push_val(struct script_stack *stack,int type,int val);
int run_func(struct script_state *st);
@@ -706,6 +707,7 @@ struct {
{buildin_callshop,"callshop","si"}, // [Skotlex]
{buildin_equip,"equip","i"},
{buildin_autoequip,"autoequip","ii"},
+ {buildin_setbattleflag,"setbattleflag","ss"},
{buildin_setitemscript,"setitemscript","is"}, //Set NEW item bonus script. Lupus
{buildin_disguise,"disguise","i"}, //disguise player. Lupus
{buildin_undisguise,"undisguise","i"}, //undisguise player. Lupus
@@ -9421,12 +9423,26 @@ int buildin_autoequip(struct script_state *st){
return 0;
}
+int buildin_setbattleflag(struct script_state *st){
+ char *flag, *value;
+
+ flag = conv_str(st,& (st->stack->stack_data[st->start+2]));
+ value = conv_str(st,& (st->stack->stack_data[st->start+3]));
+
+ if (battle_set_value(flag, value) == 0)
+ ShowWarning("buildin_setbattleflag: unknown battle_config flag '%s'",flag);
+ else
+ ShowInfo("buildin_setbattleflag: battle_config flag '%s' is now set to '%s'.",flag,value);
+
+ return 0;
+}
+
//=======================================================
// strlen [Valaris]
//-------------------------------------------------------
int buildin_getstrlen(struct script_state *st) {
- char *str = str=conv_str(st,& (st->stack->stack_data[st->start+2]));
+ char *str = conv_str(st,& (st->stack->stack_data[st->start+2]));
int len = (str) ? (int)strlen(str) : 0;
push_val(st->stack,C_INT,len);