Prechádzať zdrojové kódy

* Summoned monsters will not give exp and items
* Added the 6 new Yuno fields
* Added some Freya's optimisations in clif_parse
* Added clif_update_mobhp
* Set alive_timer to -1 when quitting, not 0

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

celest 20 rokov pred
rodič
commit
050d122cdc
6 zmenil súbory, kde vykonal 55 pridanie a 13 odobranie
  1. 6 0
      Changelog.txt
  2. 2 2
      Dev/bugs.txt
  3. 9 0
      conf-tmpl/maps_athena.conf
  4. 32 8
      src/map/clif.c
  5. 1 0
      src/map/clif.h
  6. 5 3
      src/map/mob.c

+ 6 - 0
Changelog.txt

@@ -1,5 +1,11 @@
 Date	Added
 12/27
+        * Summoned monsters will not give exp and items [celest]
+        * Added the 6 new Yuno fields to maps_athena.conf [celest]
+        * Added some Freya's optimisations in clif_parse [celest]
+        * Added clif_update_mobhp - monsters' hp viewing now updates properly [celest]
+        * Set alive_timer to -1 when quitting, not 0, or the map server might assume
+          its still active [celest]
 	* Changed the *_override_grffile to no by default, because many were having issues with it [Ajarn]
 
 12/26

+ 2 - 2
Dev/bugs.txt

@@ -16,8 +16,8 @@ Assigned:	Celest
 Progess:	~90% (Notes: not sure if it causes problems, need more testing =p)
 
 Problem:	Monster hp view only shows but does not go down with a hit.
-Assigned:	N/A
-Progess:	0%
+Assigned:	Celest
+Progess:	100% (Yep... would be better to use party hp view)
 Note:		Could it be fixed using the party hp view?
 
 Problem:	When u spawn ~300 mobs (and more or less) then do @killmonster then some mobs freeze on the screen (have no names, don't move, etc)

+ 9 - 0
conf-tmpl/maps_athena.conf

@@ -532,6 +532,15 @@ map: ayo_dun02.gat
 map: que_god01.gat
 map: que_god02.gat
 
+// --- Ep? - Schwarzwald Republic ---
+// -- 2004-12-28sdata_k.gpf --
+map: yuno_fild05.gat
+map: yuno_fild07.gat
+map: yuno_fild08.gat
+map: yuno_fild09.gat
+map: yuno_fild11.gat
+map: yuno_fild12.gat
+
 // Ragnarok World Championship 2004
 // Requires: RWC 2004 Client
 // or Akaru's SuperGRF 1.64 or newer

+ 32 - 8
src/map/clif.c

@@ -5816,6 +5816,30 @@ int clif_hpmeter(struct map_session_data *sd)
 	
 	return 0;
 }
+/*==================================================
+ * Update monster hp view if it has changed [Celest]
+ *--------------------------------------------------
+ */
+int clif_update_mobhp(struct mob_data *md)
+{
+	unsigned char buf[102];
+	char mobhp[50];
+
+	nullpo_retr(0, md);
+		
+	WBUFW(buf,0) = 0x95;
+	WBUFL(buf,2) = md->bl.id;
+
+	memcpy(WBUFP(buf,6), md->name, 24);
+	sprintf(mobhp, "hp: %d/%d", md->hp, mob_db[md->class].max_hp);
+	WBUFW(buf, 0) = 0x195;
+	memcpy(WBUFP(buf,30), mobhp, 24);
+	WBUFL(buf,54) = 0;
+	WBUFL(buf,78) = 0;
+	clif_send(buf,packet_len_table[0x195],&md->bl,AREA);
+	
+	return 0;
+}
 /*==========================================
  * パーティ場所移動(未使用)
  *------------------------------------------
@@ -7676,7 +7700,7 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) {
 	bl = map_id2bl(account_id);
 	if (bl == NULL)
 		return;
-
+	
 	WFIFOW(fd,0) = 0x95;
 	WFIFOL(fd,2) = account_id;
 
@@ -10232,22 +10256,22 @@ static int clif_parse(int fd) {
 	// 接続が切れてるので後始末
 	if (!chrif_isconnect() || session[fd]->eof) { // char鯖に繋がってない間は接続禁止 (!chrif_isconnect())
 		if (sd && sd->state.auth) {
-			if (chrif_isconnect())
-				clif_quitsave(fd, sd);
+			clif_quitsave(fd, sd); // the function doesn't send to inter-server/char-server if it is not connected [Yor]
 			if (sd->status.name != NULL)
 				sprintf(tmp_output,"%sCharacter '"CL_WHITE"%s"CL_RESET"' logged off.\n", (pc_isGM(sd))?"GM ":"",sd->status.name); // Player logout display [Valaris]
 			else
 				sprintf(tmp_output,"%sCharacter with Account ID '"CL_WHITE"%d"CL_RESET"' logged off.\n", (pc_isGM(sd))?"GM ":"", sd->bl.id); // Player logout display [Yor]
 		} else if (sd) { // not authentified! (refused by char-server or disconnect before to be authentified)
 			sprintf(tmp_output,"Player not authenticated with Account ID '"CL_WHITE"%d"CL_RESET"' logged off.\n", sd->bl.id); // Player logout display [Yor]
-			if (chrif_isconnect())
-				clif_quitsave(fd, sd);
-			sd = 0;
+//			if (chrif_isconnect())
+//				clif_quitsave(fd, sd);
+			map_deliddb(&sd->bl); // account_id has been included in the DB before auth answer [Yor]
+//			sd = 0;
 		}
 		ShowInfo(tmp_output);
 		close(fd);
-		if (sd) // 追加
-			map_deliddb(&sd->bl); // 追加
+//		if (sd) // 追加
+//			map_deliddb(&sd->bl); // 追加
 		delete_session(fd);
 		return 0;
 	}

+ 1 - 0
src/map/clif.h

@@ -174,6 +174,7 @@ int clif_wis_message(int fd,char *nick,char *mes,int mes_len);
 int clif_wis_end(int fd,int flag);
 
 int clif_solved_charname(struct map_session_data *sd,int char_id);
+int clif_update_mobhp(struct mob_data *md);
 
 int clif_use_card(struct map_session_data *sd,int idx);
 int clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int flag);

+ 5 - 3
src/map/mob.c

@@ -536,7 +536,7 @@ static int mob_walk(struct mob_data *md,unsigned int tick,int data)
 
 		if(md->walkpath.path_pos>=md->walkpath.path_len)
 			clif_fixmobpos(md);	// とまったときに位置の再送信
-	}
+	}	
 	return 0;
 }
 
@@ -2303,6 +2303,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
 	}
 
 	if(md->hp>0){
+		if (battle_config.show_mob_hp)
+			clif_update_mobhp (md);
 		return 0;
 	}
 
@@ -2394,7 +2396,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
 		if(sd && md && battle_config.pk_mode==1 && (mob_db[md->class].lv - sd->status.base_level >= 20)) {
 			job_exp*=1.15; // pk_mode additional exp if monster >20 levels [Valaris]
 		}
-		if(md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1) { // for summoned creatures [Valaris]
+		if(md->master_id || (md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1)) { // for summoned creatures [Valaris]
 			base_exp = 0;
 			job_exp = 0;
 		}
@@ -2454,7 +2456,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
 			struct delay_item_drop *ditem;
 			int drop_rate;
 
-			if(md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1)	// Added [Valaris]
+			if(md->master_id || (md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1))	// Added [Valaris]
 				break;	// End
 
 			if(mob_db[md->class].dropitem[i].nameid <= 0)