Browse Source

- Updated a bit the pet_db.txt, added info for Xmas Goblin and Rice Cake. Since little is known about them, most of the info is custom!
- Fixed @whogm not updating count for GMs which you can only see their name.
- Added unit_data.state.speed_changed, now when an object changes speed, the old move-packet will be used on the next movement, which should update the object's speed from that point and on-wards. This is done since there appears to be no way to tell the client a given object's speed has changed.


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

skotlex 18 năm trước cách đây
mục cha
commit
d404a449a1
7 tập tin đã thay đổi với 58 bổ sung2 xóa
  1. 4 0
      Changelog-Trunk.txt
  2. 3 0
      db/Changelog.txt
  3. 3 1
      db/pet_db.txt
  4. 1 0
      src/map/atcommand.c
  5. 45 0
      src/map/clif.c
  6. 1 0
      src/map/map.h
  7. 1 1
      src/map/status.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2007/04/11
+	* Now when an object changes speed, the old move-packet will be used on the
+	  next movement, which should update the object's speed from that point and
+	  on-wards. This is done since there appears to be no way to tell the client
+	  a given object's speed has changed.
 	* Modified spirit of Wizard so that the consumption of 'Fragments' when
 	  blocking bounced spells will only consume 1 Fragment per skill casted,
 	  regardless of how many hits were reflected.

+ 3 - 0
db/Changelog.txt

@@ -19,6 +19,9 @@
 	-----
 
 ========================
+04/11
+	* Added dummy information to the pet_db.txt for the Rice Cake and Xmas
+	  Goblin pets. [Skotlex]
 04/10
 	* Fixed aspd value of Fuuma Shuriken [Playtester]
 04/08

+ 3 - 1
db/pet_db.txt

@@ -30,7 +30,7 @@
 //but only one of each.
 
 //NOTE: The max value (100%) of attack_rate, defense_rate & change_target_rate is 10000.
-// MobID,Name,JName,ItemID,EggID,AcceID,FoodID,Fullness,HungryDelay,R_Hungry,R_Full,Intimate,Die,Capture,Speed,S_Performance,talk_convert_class,attack_rate,defence_attack_rate,change_target_rate,pet_script
+// MobID,Name,JName,LureID,EggID,AcceID,FoodID,Fullness,HungryDelay,R_Hungry,R_Full,Intimate,Die,Capture,Speed,S_Performance,talk_convert_class,attack_rate,defence_attack_rate,change_target_rate,pet_script
 1002,PORING,Poring,619,9001,10013,531,80,20,50,100,250,20,2000,400,1,0,350,400,800,{ petloot 10; }
 1011,CHONCHON,ChonChon,624,9006,10002,537,80,10,30,100,250,20,1500,200,1,0,500,500,250,{ petskillbonus bAgi,4,10,50; }
 1014,SPORE,Spore,630,9012,10017,537,80,20,30,100,250,20,1500,200,0,0,350,500,500,{ petrecovery SC_Poison,60; }
@@ -57,4 +57,6 @@
 1170,SOHEE,Sohee,638,9020,10016,537,80,20,10,100,250,20,500,300,0,0,100,1000,200,{ petheal 400,60,33,100; }
 1188,BON_GUN,Bon Gun,659,9025,10020,537,80,20,10,100,250,20,500,200,1,0,600,200,400,{ petskillattack2 190,555,1,1,1; }
 1200,ZHERLTHSH,Zherlthsh,660,9026,0,929,80,20,10,100,250,20,50,200,0,0,1000,100,500,{ petskillattack 136,1,0,3; }
+1245,GOBLINE_XMAS,Christmas Goblin,12225,9029,0,911,80,15,20,100,250,20,500,100,0,0,300,300,800,{ petskillattack 10,5,5,5; }
 1275,ALICE,Alice,661,9027,0,504,80,20,10,100,250,20,100,200,0,0,100,1000,200,{ petskillsupport 28,5,60,25,100; }
+1815,EVENT_RICECAKE,Rice Cake,0,9028,0,550,80,20,10,100,250,20,2000,150,0,0,500,500,200,{ petskillsupport 257,3,240,50,100; }

+ 1 - 0
src/map/atcommand.c

@@ -1879,6 +1879,7 @@ int atcommand_whogm(const int fd, struct map_session_data* sd, const char* comma
 		if (pl_GM_level > GM_level) {
 			sprintf(atcmd_output, "Name: %s (GM)", pl_sd->status.name);
 			clif_displaymessage(fd, atcmd_output);
+			count++;
 			continue;
 		}
 

+ 45 - 0
src/map/clif.c

@@ -1519,6 +1519,43 @@ int clif_walkok(struct map_session_data *sd)
 	return 0;
 }
 
+static void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *ud) {
+	unsigned char buf[256];
+	int len;
+	
+	len = clif_set007b(bl,vd,ud,buf);
+	clif_send(buf,len,bl,AREA_WOS);
+	if (disguised(bl))
+		clif_setdisguise((TBL_PC*)bl, buf, len, 0);
+		
+	if(vd->cloth_color)
+		clif_refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
+
+	switch(bl->type)
+	{
+	case BL_PC:
+		{
+			TBL_PC *sd = ((TBL_PC*)bl);
+//			clif_movepc(sd);
+			if(sd->state.size==2) // tiny/big players [Valaris]
+				clif_specialeffect(&sd->bl,423,AREA);
+			else if(sd->state.size==1)
+				clif_specialeffect(&sd->bl,421,AREA);
+		}
+		break;
+	case BL_MOB:
+		{
+			TBL_MOB *md = ((TBL_MOB*)bl);
+			if(md->special_state.size==2) // tiny/big mobs [Valaris]
+				clif_specialeffect(&md->bl,423,AREA);
+			else if(md->special_state.size==1)
+				clif_specialeffect(&md->bl,421,AREA);
+		}
+		break;
+	}
+	return;
+}
+
 /// Move the unit (does nothing if the client has no info about the unit)
 /// Note: unit must not be self
 void clif_move(struct unit_data *ud)
@@ -1530,6 +1567,14 @@ void clif_move(struct unit_data *ud)
 	if (!vd || vd->class_ == INVISIBLE_CLASS)
 		return; //This performance check is needed to keep GM-hidden objects from being notified to bots.
 	
+	if (ud->state.speed_changed) {
+		// Since we don't know how to update the speed of other objects,
+		// use the old walk packet to update the data.
+		ud->state.speed_changed = 0;
+		clif_move2(bl, vd, ud);
+		return;
+	}
+
 	WBUFW(buf,0)=0x86;
 	WBUFL(buf,2)=bl->id;
 	WBUFPOS2(buf,6,bl->x,bl->y,ud->to_x,ud->to_y,8,8);

+ 1 - 0
src/map/map.h

@@ -332,6 +332,7 @@ struct unit_data {
 		unsigned attack_continue : 1 ;
 		unsigned walk_easy : 1 ;
 		unsigned running : 1;
+		unsigned speed_changed : 1;
 	} state;
 };
 

+ 1 - 1
src/map/status.c

@@ -3004,7 +3004,7 @@ void status_calc_bl(struct block_list *bl, unsigned long flag)
 		//because if you step on something while walking, the moment this
 		//piece of code triggers the walk-timer is set on -1) [Skotlex]
 	  	if (ud)
-			ud->state.change_walk_target = 1;
+			ud->state.change_walk_target = ud->state.speed_changed = 1;
 	}
 
 	if(flag&SCB_CRI && b_status->cri) {