Parcourir la source

* Follow up 3064821: Attempt show EXP, Drop, & Death Penalty info (clif_display_pinfo) if VIP_ENABLE. NOTE, still need correct behavior/values for each rate details.
* Updated map_msg_idn.conf

Signed-off-by: Cahyadi Ramadhan Togihon <house.bad@gmail.com>

Cahyadi Ramadhan Togihon il y a 11 ans
Parent
commit
a3f0aedf53
5 fichiers modifiés avec 208 ajouts et 61 suppressions
  1. 5 6
      conf/msg_conf/map_msg.conf
  2. 34 8
      conf/msg_conf/map_msg_idn.conf
  3. 2 2
      db/packet_db.txt
  4. 18 15
      src/map/atcommand.c
  5. 149 30
      src/map/clif.c

+ 5 - 6
conf/msg_conf/map_msg.conf

@@ -403,7 +403,7 @@
 383: You cannot create a savepoint in an instance.
 384: You cannot create a memo in an instance.
 //emblem chk
-385: You're not allowed to change emblem during woe
+385: You're not allowed to change emblem during WOE
 386: The chosen emblem was detected invalid
 387: The chosen emblem was detected invalid as it contain too much transparency (limit=%d)
 //388-389 free
@@ -450,7 +450,6 @@
 430: unblock
 431: unban
 432: change the sex of
-
 433: This character has been banned until 
 434: Char-server has been asked to %s the character '%.*s'.
 435: Please enter a player name (usage: @charunblock <char name>).
@@ -704,10 +703,10 @@
 702: Time parameter format is +/-<value> to alter. y/a = Year, m = Month, d/j = Day, h = Hour, n/mn = Minute, s = Second.
 703: GM has removed your VIP time.
 704: Player is no longer VIP.
-705: %s is VIP for %d years, %d months, %d days, %d hours and %d minutes.
-706: This player is now VIP for %d years, %d months, %d days, %d hours and %d minutes.
-707: You are VIP until
-708: Player '%s' is now VIP until : 
+705: Your VIP status is valid for %d years, %d months, %d days, %d hours and %d minutes.
+706: Player '%s' is now VIP for %d years, %d months, %d days, %d hours and %d minutes.
+707: You are VIP until: %s
+708: The player is now VIP until: %s
 //709-899 free
 
 //------------------------------------

+ 34 - 8
conf/msg_conf/map_msg_idn.conf

@@ -103,10 +103,10 @@
 82: Harap berikan nama atau nomor dari daftar yang disediakan:
 83: Monster 'Emperium' tidak dapat dipanggil.
 84: Semua status telah diubah!
-85: Waktu salah untuk perintah ban.
+85: Waktu salah untuk perintah %s (waktu = %d).
 86: Maaf, nama pemain harus setidaknya terdiri dari 4 karakter.
 87: Maaf, nama pemain tidak dapat lebih banyak dari 23 karakter.
-88: Mengirim permintaan ke login server.
+88: Mengirim permintaan ke %s server.
 89: Mode malam telah diaktifkan.
 90: Mode siang telah diaktifkan.
 91: Base Level karakter tidak dapat lebih tinggi.
@@ -366,7 +366,8 @@
 347: | Lv:%d/%d | Job: %s
 //Kamu mungkin menghilangkan 2 '%d' terakhir, hasilnya tidak akan koordinat pemain, hanya nama map.
 348: | Lokasi: %s %d %d
-
+// @fullstrip
+349: Harap masukkan nama pemain (penggunaan: @fullstrip <nama/ID pemain>).
 // @duel (bagian 1)
 350: Duel: Kamu tidak dapat menggunakan @invite. Kamu bukan duelist.
 351: Duel: Batas pemain sudah terlampaui.
@@ -400,8 +401,12 @@
 381: Penggunaan skill gagal. [%s] membutuhkan %dx %s.
 382: Kamu terlalu dekat dengan batu atau emperium untuk menggunakan skill ini.
 383: Kamu tidak dapat membuat save point di instance
-384: Kamu tidak dapat membuat memo di isntance
-//385-389 kosong
+384: Kamu tidak dapat membuat memo di instance
+//emblem chk
+385: Kamu tidak diizinkan untuk mengubah emblem ketika WOE.
+386: Emblem yang dipilih tidak bisa digunakan
+387: Emblem yang dipilih tidak bisa digunakan karena terlalu banyak transparency (batas=%d)
+//388-389 kosong
 //NoAsk
 390: Penolakan otomatis diaktifkan.
 391: Penolakan otomatis ditidakaktifkan.
@@ -435,8 +440,8 @@
 419: Server sedang macet karena populasi yang berlebihan.
 420: Akunmu sudah tidak diizinkan 
 421: Akunmu sudah dihapus keseluruhan.
-423: Akunmu telah dibuang hingga 
-424: Login-server meminta untuk %s pemain '%.*s'.
+423: Akunmu telah dibuang hingga %s
+424: %s meminta untuk %s pemain '%.*s'.
 425: Pemain '%.*s' tidak ada.
 426: Level GM-mu tidak diizinkan untuk %s pemain '%.*s'.
 427: Login-server sedang offline. Tidak mungkin untuk %s pemain '%.*s'.
@@ -445,6 +450,9 @@
 430: unblock
 431: unban
 432: mengubah jenis kelamin dari 
+433: Karakter ini diban hingga 
+434: Char-server meminta untuk %s pemain '%.*s'.
+435: Harap masukkan nama pemain (penggunaan: @charunblock <nama pemain>).
 
 // Pesan-pesan untuk Homunculus
 450: Kamu sudah memiliki homunculus
@@ -688,6 +696,18 @@
 694: Hanbok
 695: Rebellion
 
+// @vip
+700: Penggunaan: @vip <waktu> <nama pemain>
+701: Waktu yang dimasukkan salah.
+702: Format waktu yang digunakan +/-<nilai> untuk mengubah. y/a = Tahun, m = Bulan, d/j = Hari, h = Jam, n/mn = Menit, s = Detik.
+703: GM telah menghilangkan waktu VIP anda.
+704: Pemain sudah tidak VIP.
+705: Status VIP anda berlaku dalam %d tahun, %d bulan, %d hari, %d jam dan %d menit.
+706: Pemain '%s' saat ini VIP untuk %d tahun, %d bulan, %d hari, %d jam dan %d menit.
+707: VIP anda berlaku hingga: %s
+708: Status VIP pemain aktif hingga: %s
+//709-899 free
+
 
 //------------------------------------
 // Pesan dalam perintah atcommand
@@ -836,7 +856,7 @@
 
 // @charban
 1022: Harap masukkan waktu hukuman dan nama pemain. (Penggunaan: @charban/@ban/@banish/@charbanish <waktu> <nama karakter>).
-1023: Kamu tidak diperbolehkan untuk mengurangi waktu hukuman.
+1023: Kamu tidak diperbolehkan untuk mengubah waktu hukuman.
 
 // @charunblock
 1024: Harap masukkan nama pemain. (Penggunaan: @charunblock <nama karakter>).
@@ -1505,5 +1525,11 @@
 1495: Kamu tidak dapat mengambil uang sebanyak itu.
 1496: Fitur banking tidak sedang aktif.
 
+// Monster Transformation
+1497: Berubaaaaaaaaaah-!! Wujud %s!!
+1498: Tidat dapat berubah menjadi monster ketika sedang disguise.
+1499: Karakter tidak dapat disguise ketika sedang berwujud monster.
+1500: Perubahan menjadi monster tidak diizinkan dalam Guild Wars.
+
 //Bila ada terjemahan lain
 //import: conf/msg_conf/import/map_msg_idn_conf.txt

+ 2 - 2
db/packet_db.txt

@@ -1761,7 +1761,7 @@ packet_ver: 30
 0x0977,14 //Monster HP Bar
 0x0916,26,guildinvite2,2
 0x091d,18,bookingregreq,2:4:6
-//0x08cb,10,ZC_PERSONAL_INFOMATION,2:4:6:8:10:11:13:15 // Disabled until further information is found.
+0x08cb,10,ZC_PERSONAL_INFOMATION,2:4:6:8:10:11:13:15 //Still need further information
 
 //2012-04-18aRagexeRE [Special Thanks to Judas!]
 packet_ver:31
@@ -1856,7 +1856,7 @@ packet_ver: 34
 0x0977,14 //Monster HP Bar
 0x0978,6,reqworldinfo,2
 0x0979,50 //ackworldinfo
-//0x097b,16,ZC_PERSONAL_INFOMATION,2:4:8:12:16:17:21:25 // Disabled until further information is found.
+0x097b,16,ZC_PERSONAL_INFOMATION,2:4:8:12:16:17:21:25 //Still need further information
 //0x0981,12,ZC_PERSONAL_INFOMATION_CHN,2:4:6:8:12:13:15:17:10 // Disabled until further information is found.
 0x0990,31 //additem
 0x0991,-1 //inv itemlist normal

+ 18 - 15
src/map/atcommand.c

@@ -9184,31 +9184,34 @@ ACMD_FUNC(vip) {
 		clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level don't authorise you to do this action on this player.
 		return -1;
 	}
-
-	pl_sd->vip.time += viptime;
-
-	if (pl_sd->vip.time <= 0) {
+	
+	if (viptime <= 0) {
 		pl_sd->vip.time = 0;
 		pl_sd->vip.enabled = 0;
-		clif_displaymessage(pl_sd->fd, msg_txt(sd,703)); // GM has removed your VIP time.
+		clif_displaymessage(pl_sd->fd, msg_txt(pl_sd,703)); // GM has removed your VIP time.
 		clif_displaymessage(fd, msg_txt(sd,704)); // Player is no longer VIP.
 	} else {
 		int year,month,day,hour,minute,second;
 		char timestr[21];
 		time_t now=time(NULL);
+
+		pl_sd->vip.time += viptime;
 		split_time(pl_sd->vip.time*60,&year,&month,&day,&hour,&minute,&second);
-		sprintf(atcmd_output,msg_txt(sd,705),pl_sd->status.name,year,month,day,hour,minute); // %s is VIP for %d years, %d months, %d days, %d hours and %d minutes.
-		clif_displaymessage(pl_sd->fd, atcmd_output);
-		sprintf(atcmd_output,msg_txt(sd,706),year,month,day,hour,minute); // This player is now VIP for %d years, %d months, %d days, %d hours and %d minutes.
-		clif_displaymessage(fd, atcmd_output);
+
+		sprintf(atcmd_output,msg_txt(pl_sd,705),year,month,day,hour,minute); // Your VIP status is valid for %d years, %d months, %d days, %d hours and %d minutes.
+		clif_displaymessage(pl_sd->fd,atcmd_output);
 		timestamp2string(timestr,20,now+pl_sd->vip.time*60,"%Y-%m-%d %H:%M");
-		sprintf(atcmd_output,"%s : %s",msg_txt(sd,707),timestr); // You are VIP until : %s
-		clif_displaymessage(pl_sd->fd, atcmd_output);
-		sprintf(atcmd_output, msg_txt(sd,708), pl_sd->status.name); // Player '%s' is now VIP until : %s
-		strcat(atcmd_output, timestr);
-		clif_displaymessage(fd, atcmd_output);
+		sprintf(atcmd_output,msg_txt(pl_sd,707),timestr); // You are VIP until : %s
+		clif_displaymessage(pl_sd->fd,atcmd_output);
+
+		if (pl_sd != sd) {
+			sprintf(atcmd_output,msg_txt(sd,706),pl_sd->status.name,year,month,day,hour,minute); // Player '%s' is now VIP for %d years, %d months, %d days, %d hours and %d minutes.
+			clif_displaymessage(fd,atcmd_output);
+			sprintf(atcmd_output,msg_txt(sd,708),timestr); // The player is now VIP until : %s
+			clif_displaymessage(fd,atcmd_output);
+		}
 	}
-	chrif_req_vipActive(pl_sd, viptime, 3);
+	chrif_req_vipActive(pl_sd, viptime, 3); //! FIXME, someone said, player will be kicked out after player get VIP status.
 
 	return 0;
 }

+ 149 - 30
src/map/clif.c

@@ -16944,65 +16944,184 @@ void clif_update_rankingpoint(struct map_session_data *sd, int rankingtype, int
 
 /**
  * Transmit personal information to player. (rates)
- *  08cb <packet len>.W <exp>.W <death>.W <drop>.W <DETAIL_EXP_INFO>7B (ZC_PERSONAL_INFOMATION)
- * <InfoType>.B <Exp>.W <Death>.W <Drop>.W (DETAIL_EXP_INFO 0x8cb) 
- * 097b <packet len>.W <exp>.L <death>.L <drop>.L <DETAIL_EXP_INFO>13B (ZC_PERSONAL_INFOMATION2)
- * 0981 <packet len>.W <exp>.W <death>.W <drop>.W <activity rate>.W <DETAIL_EXP_INFO>13B (ZC_PERSONAL_INFOMATION_CHN)
+ * 0x08cb <packet len>.W <exp>.W <death>.W <drop>.W <DETAIL_EXP_INFO>7B (ZC_PERSONAL_INFOMATION)
+ * <InfoType>.B <Exp>.W <Death>.W <Drop>.W (DETAIL_EXP_INFO 0x08cb) 
+ * 0x097b <packet len>.W <exp>.L <death>.L <drop>.L <DETAIL_EXP_INFO>13B (ZC_PERSONAL_INFOMATION2)
+ * 0x0981 <packet len>.W <exp>.W <death>.W <drop>.W <activity rate>.W <DETAIL_EXP_INFO>13B (ZC_PERSONAL_INFOMATION_CHN)
  * <InfoType>.B <Exp>.L <Death>.L <Drop>.L (DETAIL_EXP_INFO 0x97b|0981)
- * InfoType: 0 PCRoom, 1 Premium, 2 Server, 3 TPlus
+ * FIXME!
+ * - Find/decide for details of EXP, Drop, and Death penalty rates
+ * - For now, we're assuming values for DETAIL_EXP_INFO are:
+ *   0 - map adjustment (bexp mapflag), 1 - Premium/VIP adjustment, 2 - Server rate adjustment, 3 - None
 */
+#ifdef VIP_ENABLE
 void clif_display_pinfo(struct map_session_data *sd, int cmdtype) {
 	if (sd) {
 		struct s_packet_db* info;
 		int16 len, szdetails = 13, maxinfotype = PINFO_MAX;
-		int cmd = 0, fd, i = 0, details_prem_penalty = 0;
-		int tot_baseexp = 0, total_penalty = 0, tot_drop = 0, factor = 1000;
-		int details_bexp[PINFO_MAX]= {map[sd->bl.m].adjust.bexp,battle_config.vip_base_exp_increase,battle_config.base_exp_rate,0 }; //TODO move me ?
-		int details_penalty[PINFO_MAX]= {0,0,battle_config.death_penalty_base,0 };
-		int details_drop[PINFO_MAX]= {0,battle_config.vip_drop_increase,battle_config.item_rate_common,0 };
+		int cmd = 0, fd, i = 0;
+		int tot_baseexp = 100, tot_penalty = 100, tot_drop = 100, factor = 1000;
+		int details_bexp[PINFO_MAX];
+		int details_drop[PINFO_MAX];
+		int details_penalty[PINFO_MAX];
+		int penalty_const;
+		
+		/**
+		 * Set for EXP
+		 */
+		//0:PCRoom
+		details_bexp[0] = map[sd->bl.m].adjust.bexp;
+		if (details_bexp[0] == 100 || details_bexp[0] == 0)
+			details_bexp[0] = 0;
+		else {
+			if (details_bexp[0] < 100) {
+				details_bexp[0] = 100 - details_bexp[0];
+				details_bexp[0] = 0 - details_bexp[0];
+			}
+			else
+				details_bexp[0] = details_bexp[0] - 100;
+		}
+		//1:Premium
+		if (pc_isvip(sd)) {
+			details_bexp[1] = battle_config.vip_base_exp_increase;
+			if (details_bexp[1] < 0)
+				details_bexp[1] = 0 - details_bexp[1];
+		}
+		else
+			details_bexp[1] = 0;
+		//2:Server
+		details_bexp[2] = battle_config.base_exp_rate;
+		if (details_bexp[2] == 100)
+			details_bexp[2] = 0;
+		else {
+			if (details_bexp[2] < 100) {
+				details_bexp[2] = 100 - details_bexp[2];
+				details_bexp[2] = 0 - details_bexp[2];
+			}
+			else
+				details_bexp[2] = details_bexp[2] - 100;
+		}
+		//3:TPLUS
+		details_bexp[3] = 0;
+		/* End - EXP set*/
+
+		/**
+		 * Set for Drop rate
+		 */
+		//0:PCRoom
+		details_drop[0] = 0;
+		//1:Premium
+		details_drop[1] = battle_config.vip_drop_increase;
+		if (pc_isvip(sd)) {
+			if (details_drop[1] < 0)
+				details_drop[1] = 0 - details_drop[1];
+		}
+		else
+			details_drop[1] = 0;
+		//2:Server
+		details_drop[2] = battle_config.item_rate_common;
+		if (details_drop[2] == 100)
+			details_drop[2] = 0;
+		else {
+			if (details_drop[2] < 100) {
+				details_drop[2] = 100 - details_drop[2];
+				details_drop[2] = 0 - details_drop[2];
+			}
+			else
+				details_drop[2] = details_drop[2] - 100;
+		}
+		//3:TPLUS
+		details_drop[3] = 0;
+		/* End - Drop set*/
+
+		/**
+		 * Set for Penalty rate
+		 */
+		//! FIXME: Current penalty system, makes this announcement hardly to gives info + or - rate
+		penalty_const = battle_config.death_penalty_base * battle_config.vip_exp_penalty_base_normal;
+		//0:PCRoom
+		details_penalty[0] = 0;
+		//1:Premium
+		if (pc_isvip(sd)) {
+			details_penalty[1] = battle_config.vip_exp_penalty_base * 10000 / penalty_const;
+			if (details_penalty[1] == 100)
+				details_penalty[1] = 0;
+			else {
+				if (details_penalty[1] < 100) {
+					details_penalty[1] = 100 - details_penalty[1];
+					details_penalty[1] = 0 - details_penalty[1];
+				}
+				else
+					details_penalty[1] = details_penalty[1] - 100;
+			}
+		}
+		else
+			details_penalty[1] = 0;
+		//2:Server
+		details_penalty[2] = battle_config.vip_exp_penalty_base_normal * 10000 / penalty_const;
+		if (details_penalty[2] == 100)
+			details_penalty[2] = 0;
+		else {
+			if (details_penalty[2] < 100) {
+				details_penalty[2] = 100 - details_penalty[2];
+				details_penalty[2] = 0 - details_penalty[2];
+			}
+			else
+				details_penalty[2] = details_penalty[2] - 100;
+		}
+		//3:TPLUS
+		details_penalty[3] = 0;
+		/* End - Penalty set*/
 
 		cmd = packet_db_ack[sd->packet_ver][cmdtype];
 		info = &packet_db[sd->packet_ver][cmd];
 		len = info->len; //this is the base len without details
 		if(!len) return; //version as packet disable
 
-		if (cmdtype == ZC_PERSONAL_INFOMATION && len == 10) { //8cb version
+		if (cmdtype == ZC_PERSONAL_INFOMATION && cmd == 0x08cb) { //0x08cb version
 			szdetails = 7;
-			maxinfotype = 3;
 			factor = 1;
 		}
-
-		// Need to alter penalty data for VIP whether the system is enabled or not.
-		details_prem_penalty = battle_config.death_penalty_base;
-#ifdef VIP_ENABLE
-		details_prem_penalty = battle_config.death_penalty_base * (battle_config.vip_exp_penalty_base_normal - 1);
-		if (pc_isvip(sd)) details_prem_penalty = battle_config.death_penalty_base * (battle_config.vip_exp_penalty_base - 1);
-		details_prem_penalty = max(0,details_prem_penalty);
-#endif
-		details_penalty[PINFO_PREMIUM] = details_prem_penalty;
+		else if (cmd == 0x097b) {
+			tot_baseexp *= factor;
+			tot_drop *= factor;
+			tot_penalty *= factor;
+		}
+		
 		fd = sd->fd;
 		WFIFOHEAD(fd,len+maxinfotype*szdetails);
 		WFIFOW(fd,0) = cmd;
 
 		for (i = 0; i < maxinfotype; i++) {
 			WFIFOB(fd,info->pos[4]+(i*szdetails)) = i; //infotype //0 PCRoom, 1 Premium, 2 Server, 3 TPlus
-			WFIFOW(fd,info->pos[5]+(i*szdetails)) = 0;
+
+			WFIFOL(fd,info->pos[5]+(i*szdetails)) = details_bexp[i]*factor;
+			WFIFOL(fd,info->pos[6]+(i*szdetails)) = details_penalty[i]*factor;
+			WFIFOL(fd,info->pos[7]+(i*szdetails)) = details_drop[i]*factor;
+
 			tot_baseexp += details_bexp[i]*factor;
-			WFIFOW(fd,info->pos[6]+(i*szdetails)) = details_penalty[i]*factor;
-			total_penalty += details_penalty[i]*factor;
-			WFIFOW(fd,info->pos[7]+(i*szdetails)) = details_drop[i]*factor;
-			tot_drop += details_drop[i]*factor;
+			tot_drop += details_penalty[i]*factor;
+			tot_penalty += details_drop[i]*factor;
+
 			len += szdetails;
 		}
 		WFIFOW(fd,info->pos[0])  = len; //packetlen
-		WFIFOW(fd,info->pos[1])  = tot_baseexp;
-		WFIFOW(fd,info->pos[2])  = total_penalty; //6 8
-		WFIFOW(fd,info->pos[3])  = tot_drop; //8 12
+		if (cmd == 0x08cb) { //0x08cb version
+			WFIFOW(fd,info->pos[1])  = tot_baseexp;
+			WFIFOW(fd,info->pos[2])  = tot_drop;
+			WFIFOW(fd,info->pos[3])  = tot_penalty;
+		}
+		else { //2013-08-07aRagexe uses 0x097b
+			WFIFOL(fd,info->pos[1])  = tot_baseexp;
+			WFIFOL(fd,info->pos[2])  = tot_drop;
+			WFIFOL(fd,info->pos[3])  = tot_penalty;
+		}
 		if (cmdtype == ZC_PERSONAL_INFOMATION_CHN) 
 			WFIFOW(fd,info->pos[8])  = 0; //activity rate case of event ??
 		WFIFOSET(fd,len);
 	}
 }
+#endif
 
 void clif_parse_GMFullStrip(int fd, struct map_session_data *sd) {
 	char cmd[30];
@@ -17186,7 +17305,7 @@ void packetdb_readdb(void)
 	int max_cmd=-1;
 	int skip_ver = 0;
 	int warned = 0;
-	char *str[64],*p,*str2[64],*p2,w1[64],w2[64];
+	char *str[64],*p,*str2[64],*p2,w1[256],w2[256];
 	int packet_len_table[MAX_PACKET_DB] = {
 	   10,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,