소스 검색

Added/improved SG's maps and monsters reset script and GM commands (#5359)

Daegaladh 4 년 전
부모
커밋
1c123a517e
6개의 변경된 파일78개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 0
      conf/msg_conf/map_msg.conf
  2. 8 0
      doc/atcommands.txt
  3. 14 0
      doc/script_commands.txt
  4. 23 1
      src/map/atcommand.cpp
  5. 2 1
      src/map/pc.cpp
  6. 28 0
      src/map/script.cpp

+ 3 - 0
conf/msg_conf/map_msg.conf

@@ -1723,5 +1723,8 @@
 1513: Currently in WoE hours, unable to delegate Guild leader
 1514: You have to wait for a while before delegating a new Guild leader
 
+// @hatereset
+1515: Reset 'Hatred' monsters.
+
 //Custom translations
 import: conf/msg_conf/import/map_msg_eng_conf.txt

+ 8 - 0
doc/atcommands.txt

@@ -920,6 +920,14 @@ Resets stats (@streset), skills (@skreset), or both (@reset).
 @feelreset
 
 Resets a Star Gladiator's marked maps.
+Only works on Star Gladiator and Star Emperor classes.
+
+---------------------------------------
+
+@hatereset
+
+Resets a Star Gladiator's marked monsters.
+Only works on Star Gladiator and Star Emperor classes.
 
 ---------------------------------------
 

+ 14 - 0
doc/script_commands.txt

@@ -5676,6 +5676,20 @@ Used in reset NPC's (duh!)
 
 ---------------------------------------
 
+*resetfeel({<char_id>});
+
+This command will reset the Star Gladiator's designated maps on the invoking character.
+Only works on Star Gladiator and Star Emperor classes.
+
+---------------------------------------
+
+*resethate({<char_id>});
+
+This command will reset the Star Gladiator's designated monsters on the invoking character.
+Only works on Star Gladiator and Star Emperor classes.
+
+---------------------------------------
+
 *sc_start <effect type>,<ticks>,<value 1>{,<rate>,<flag>{,<GID>}};
 *sc_start2 <effect type>,<ticks>,<value 1>,<value 2>{,<rate>,<flag>{,<GID>}};
 *sc_start4 <effect type>,<ticks>,<value 1>,<value 2>,<value 3>,<value 4>{,<rate>,<flag>{,<GID>}};

+ 23 - 1
src/map/atcommand.cpp

@@ -8753,16 +8753,37 @@ ACMD_FUNC(request)
 }
 
 /*==========================================
- * Feel (SG save map) Reset [HiddenDragon]
+ * Feel (SG designated maps) Reset [HiddenDragon]
  *------------------------------------------*/
 ACMD_FUNC(feelreset)
 {
+	if ((sd->class_&MAPID_UPPERMASK) != MAPID_STAR_GLADIATOR) {
+		clif_displaymessage(sd->fd,msg_txt(sd,35));	// You can't use this command with this class.
+		return -1;
+	}
+
 	pc_resetfeel(sd);
 	clif_displaymessage(fd, msg_txt(sd,1324)); // Reset 'Feeling' maps.
 
 	return 0;
 }
 
+/*==========================================
+ * Hate (SG designated monsters) Reset
+ *------------------------------------------*/
+ACMD_FUNC(hatereset)
+{
+	if ((sd->class_&MAPID_UPPERMASK) != MAPID_STAR_GLADIATOR) {
+		clif_displaymessage(sd->fd,msg_txt(sd,35));	// You can't use this command with this class.
+		return -1;
+	}
+
+	pc_resethate(sd);
+	clif_displaymessage(fd, msg_txt(sd,1515)); // Reset 'Hatred' monsters.
+
+	return 0;
+}
+
 /*==========================================
  * AUCTION SYSTEM
  *------------------------------------------*/
@@ -10523,6 +10544,7 @@ void atcommand_basecommands(void) {
 		ACMD_DEF(homshuffle),
 		ACMD_DEF(showmobs),
 		ACMD_DEF(feelreset),
+		ACMD_DEF(hatereset),
 		ACMD_DEF(auction),
 		ACMD_DEF(mail),
 		ACMD_DEF2("noks", ksprotection),

+ 2 - 1
src/map/pc.cpp

@@ -9293,8 +9293,9 @@ bool pc_jobchange(struct map_session_data *sd,int job, char upper)
 	}
 
 	if( (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR && (b_class&MAPID_UPPERMASK) != MAPID_STAR_GLADIATOR) {
-		/* going off star glad lineage, reset feel to not store no-longer-used vars in the database */
+		/* going off star glad lineage, reset feel and hate to not store no-longer-used vars in the database */
 		pc_resetfeel(sd);
+		pc_resethate(sd);
 	}
 
 	// Reset body style to 0 before changing job to avoid

+ 28 - 0
src/map/script.cpp

@@ -12155,6 +12155,32 @@ BUILDIN_FUNC(resetskill)
 	return SCRIPT_CMD_SUCCESS;
 }
 
+/**
+ * Reset SG designated maps
+ * resetfeel({<char_id>});
+ **/
+BUILDIN_FUNC(resetfeel)
+{
+	TBL_PC *sd;
+	if (!script_charid2sd(2,sd) || (sd->class_&MAPID_UPPERMASK) != MAPID_STAR_GLADIATOR)
+		return SCRIPT_CMD_FAILURE;
+	pc_resetfeel(sd);
+	return SCRIPT_CMD_SUCCESS;
+}
+
+/**
+ * Reset SG designated monsters
+ * resethate({<char_id>});
+ **/
+BUILDIN_FUNC(resethate)
+{
+	TBL_PC *sd;
+	if (!script_charid2sd(2,sd) || (sd->class_&MAPID_UPPERMASK) != MAPID_STAR_GLADIATOR)
+		return SCRIPT_CMD_FAILURE;
+	pc_resethate(sd);
+	return SCRIPT_CMD_SUCCESS;
+}
+
 /**
  * Counts total amount of skill points.
  * skillpointcount({<char_id>})
@@ -25062,6 +25088,8 @@ struct script_function buildin_func[] = {
 	BUILDIN_DEF(resetlvl,"i?"),
 	BUILDIN_DEF(resetstatus,"?"),
 	BUILDIN_DEF(resetskill,"?"),
+	BUILDIN_DEF(resetfeel,"?"),
+	BUILDIN_DEF(resethate,"?"),
 	BUILDIN_DEF(skillpointcount,"?"),
 	BUILDIN_DEF(changebase,"i?"),
 	BUILDIN_DEF(changesex,"?"),