Browse Source

* Added @changelook command for spriters to test view ID's
* Added a check to Pneuma to prevent crashing

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1004 54d463be-8e91-2dee-dedb-b68131a5f0ec

(no author) 20 năm trước cách đây
mục cha
commit
8454119e3f
4 tập tin đã thay đổi với 35 bổ sung2 xóa
  1. 2 0
      Changelog.txt
  2. 30 0
      src/map/atcommand.c
  3. 1 0
      src/map/atcommand.h
  4. 2 2
      src/map/skill.c

+ 2 - 0
Changelog.txt

@@ -1,6 +1,8 @@
 Date	Added
 
 01/27
+        * Added @changelook command for spriters to test view ID's [celest]
+        * Added a check to Pneuma to prevent crashing [celest]
         * Tweaked garbage collection code after feedback from users
         [SVN 1002: MouseJstr]
 	* Fixed TRADE exploits (it cures proxy hack / vending+trade hack) thanks to Freya [Lupus]

+ 30 - 0
src/map/atcommand.c

@@ -252,6 +252,7 @@ ACMD_FUNC(charkillableid2);  // by Dino9021
 ACMD_FUNC(sound);
 ACMD_FUNC(undisguiseall);
 ACMD_FUNC(disguiseall);
+ACMD_FUNC(changelook);
 
 /*==========================================
  *AtCommandInfo atcommand_info[]�\‘¢‘̂̒è‹`
@@ -524,6 +525,7 @@ static AtCommandInfo atcommand_info[] = {
 	{ AtCommand_Sound,		"@sound",	40,	atcommand_sound },
 	{ AtCommand_UndisguiseAll,		"@undisguiseall",	99,	atcommand_undisguiseall },
 	{ AtCommand_DisguiseAll,		"@disguiseall",	99,	atcommand_disguiseall },
+	{ AtCommand_ChangeLook,		"@changelook",	99,	atcommand_changelook },
 
 // add new commands before this line
 	{ AtCommand_Unknown,             NULL,                1, NULL }
@@ -7503,6 +7505,34 @@ atcommand_grind2(const int fd, struct map_session_data* sd,
 	return 0;
 }
 
+/*==========================================
+ * @changelook by [Celest]
+ *------------------------------------------
+ */
+int
+atcommand_changelook(const int fd, struct map_session_data* sd,
+	const char* command, const char* message)
+{
+	int i, j = 0, k = 0;
+	int pos[6] = { LOOK_HEAD_TOP,LOOK_HEAD_MID,LOOK_HEAD_BOTTOM,LOOK_WEAPON,LOOK_SHIELD,LOOK_SHOES };
+
+	if((i = sscanf(message, "%d %d", &j, &k)) < 1) {
+		clif_displaymessage(fd, "Usage: @changelook [<position>] <view id> -- [] = optional");
+		clif_displaymessage(fd, "Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield");
+		return -1;
+	} else if (i == 2) {
+		if (j < 1) j = 1;
+		else if (j > 6) j = 6;	// 6 = Shoes - for beta clients only perhaps
+		j = pos[j - 1];
+	} else if (i == 1) {	// position not defined, use HEAD_TOP as default
+		k = j;	// swap
+		j = LOOK_HEAD_TOP;
+	}
+
+	clif_changelook(&sd->bl,j,k);
+
+	return 0;
+}
 
 /*==========================================
  * It is made to rain.

+ 1 - 0
src/map/atcommand.h

@@ -235,6 +235,7 @@ enum AtCommandType {
 	AtCommand_Sound,
 	AtCommand_UndisguiseAll,
 	AtCommand_DisguiseAll,
+	AtCommand_ChangeLook,
 
 	// end
 	AtCommand_Unknown,

+ 2 - 2
src/map/skill.c

@@ -5943,8 +5943,8 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
 			if(sc_data) {
 				if (sc_data[type].timer==-1)
 					status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0);
-				else if((unit2=(struct skill_unit *)sc_data[type].val2) && unit2 != src ){
-					if(DIFF_TICK(sg->tick,unit2->group->tick)>0 )
+				else if((unit2 = (struct skill_unit *)sc_data[type].val2) && unit2 != src){
+					if(unit2->group && DIFF_TICK(sg->tick,unit2->group->tick) > 0)
 						status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0);
 					ts->tick-=sg->interval;
 				}