Przeglądaj źródła

* Added script command 'setbattleflag'.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5407 54d463be-8e91-2dee-dedb-b68131a5f0ec
Lance 19 lat temu
rodzic
commit
c2273620ad
2 zmienionych plików z 18 dodań i 1 usunięć
  1. 1 0
      Changelog-Trunk.txt
  2. 17 1
      src/map/script.c

+ 1 - 0
Changelog-Trunk.txt

@@ -7,6 +7,7 @@ GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALAR
 2006/03/01
 	* Corrected a few Compiling Warnings [Codemaster]
 	* Added the ability to select GM loading via Login (default) or Char [Codemaster]
+	* Added script command 'setbattleflag'. [Lance]
 2006/02/28
 	* Rewrote LAN support code. Changed configuration file name
 	  lan_support.conf to subnet_athena.conf, changed it syntax. [LuzZza]

+ 17 - 1
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);