浏览代码

* Documented 'transform' script command. (follow-up 9c438ce)
* Fixed errors in 'getmonsterinfo' sample script. (bugreport:8200)
http://rathena.org/board/tracker/issue-8200-getmonsterinfo-sample/
* Added correct refine rates above +10. (Hercules 6577a59)
* Merged extra 'downrefitem' argument. (Hercules)

Signed-off-by: Euphy <euphy.raliel@rathena.org>

Euphy 11 年之前
父节点
当前提交
4527b66a5d
共有 7 个文件被更改,包括 37 次插入47 次删除
  1. 5 6
      db/re/refine_db.txt
  2. 4 4
      doc/sample/getmonsterinfo.txt
  3. 12 20
      doc/script_commands.txt
  4. 6 10
      npc/re/merchants/refine.txt
  5. 1 1
      src/map/clif.c
  6. 1 1
      src/map/map.c
  7. 8 5
      src/map/script.c

+ 5 - 6
db/re/refine_db.txt

@@ -27,15 +27,14 @@
 // Chance:
 // 100 = 100%
 //
-// Note: Chances for +11 and higher are not verified - 10% is a rumor from iRO wiki.
 // A note about renewal Armors, there may or may not be another bonus, according to iRO wiki: Every upgrade gives floor[( 3 + current upgrade ) / 4] equipment DEF)
 
-0,0,0,0,100:100,100:100,100:100,100:100,60:200,40:200,40:200,20:200,20:300,10:300,100:300,100:300,100:400,100:400,90:400,60:400,60:500,30:500,30:500,10:500
+0,0,0,0,100:100,100:100,100:100,100:100,60:200,40:200,40:200,20:200,20:300,10:300,8:300,8:300,8:400,8:400,7:400,7:400,7:500,7:500,5:500,5:500
 // Level 1 weapons
-1,200,8,300,100:0,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,100:0,100:0,100:0,100:0,100:0,100:300,100:300,90:300,60:300,20:300
+1,200,8,300,100:0,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,18:0,18:0,18:0,18:0,18:0,17:300,17:300,17:300,15:300,15:300
 // Level 2 weapons
-2,300,7,500,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,20:0,100:0,100:0,100:0,100:0,100:0,100:600,90:600,60:600,30:600,20:600
+2,300,7,500,100:0,100:0,100:0,100:0,100:0,100:0,60:0,40:0,20:0,20:0,18:0,18:0,18:0,18:0,18:0,17:600,17:600,17:600,15:600,15:600
 // Level 3 weapons
-3,500,6,800,100:0,100:0,100:0,100:0,100:0,60:0,50:0,20:0,20:0,20:0,100:0,100:0,100:0,100:0,100:0,90:900,75:900,30:900,30:900,20:900
+3,500,6,800,100:0,100:0,100:0,100:0,100:0,60:0,50:0,20:0,20:0,20:0,18:0,18:0,18:0,18:0,18:0,17:900,17:900,17:900,15:900,15:900
 // Level 4 weapons
-4,700,5,1400,100:0,100:0,100:0,100:0,60:0,40:0,40:0,20:0,20:0,10:0,100:0,100:0,100:0,100:0,90:0,60:1200,60:1200,30:1200,30:1200,10:1200
+4,700,5,1400,100:0,100:0,100:0,100:0,60:0,40:0,40:0,20:0,20:0,10:0,8:0,8:0,8:0,8:0,8:0,7:1200,7:1200,7:1200,5:1200,5:1200

+ 4 - 4
doc/sample/getmonsterinfo.txt

@@ -3,7 +3,7 @@
 //===== By: ==================================================
 //= Lupus
 //===== Current Version: =====================================
-//= 20121003
+//= 20131106
 //===== Description: ========================================= 
 //= Demonstrates the 'getmonsterinfo' command.
 //============================================================
@@ -11,13 +11,13 @@
 prontera,156,179,6	script	test_getmonsterinfo	117,{
 	mes "Please enter a monster ID.";
 	input .@value;
-	if(getmonsterinfo(.@value,MOB_LV)<0 || getmonsterinfo(.@value,MOB_NAME)=="Dummy") {
+	if (getmonsterinfo(.@value, MOB_LV) < 0 || getmonsterinfo (.@value, MOB_NAME) == "null") {
 		mes "Invalid monster ID.";
 		close;
 	}
 	mes "Monster ID: "+.@value+" '"+getmonsterinfo(.@value,MOB_NAME)+"'";
 	mes "Current Monster info:";
-	for(set .@id,0; .@id<23; set .@id,.@id+1)
-		mes " getmonsterinfo("+.@value+","+@id+") = "+getmonsterinfo(.@value,@id);
+	for(set .@i,0; .@i<23; set .@i,.@i+1)
+		mes " getmonsterinfo("+.@value+","+.@i+") = "+getmonsterinfo(.@value,.@i);
 	close;
 }

+ 12 - 20
doc/script_commands.txt

@@ -4534,10 +4534,6 @@ Whatever the type is, it will also show a failure effect on screen.
 This command repairs a broken piece of equipment, using the same list of broken 
 items as available through 'getbrokenid'.
 
-The official scripts seem to use the repair command as a function instead: 
-'repair(<number>)' but it returns nothing on the stack. Probably only Valaris, 
-who made it, can answer why is it so.
-
 ---------------------------------------
 
 *repairall;
@@ -4557,10 +4553,6 @@ character and put appropriate messages into their chat window. It will also give
 the character fame points if a weapon reached +10 this way, even though these 
 will only take effect for blacksmith who will later forge a weapon.
 
-The official scripts seems to use the 'successrefitem' command as a function 
-instead: 'successrefitem(<number>)' but it returns nothing on the stack. 
-This is since jAthena, so probably nobody knows for sure why is it so.
-
 ---------------------------------------
 
 *failedrefitem <equipment slot>;
@@ -4570,22 +4562,14 @@ invoking character. The item will be destroyed. This will also display a 'refine
 failure' effect on the character and put appropriate messages into their chat 
 window.
 
-The official scripts seems to use the 'failedrefitem' command as a function 
-instead: 'failedrefitem(<number>)' but it returns nothing on the stack. This is 
-since jAthena, so probably nobody knows for sure why is it so.
-
 ---------------------------------------
 
-*downrefitem <equipment slot>;
+*downrefitem <equipment slot>{,<count>};
 
 This command will downgrade an item in the specified equipment slot of the invoking
-character by -1. For a list of equipment slots see 'getequipid'. This command will
-also display a 'refine failure' effect on the character and put appropriate
-messages into their chat window.
-
-The official scripts seems to use the 'downrefitem' command as a function 
-instead: 'downrefitem(<number>)' but it returns nothing on the stack. This is 
-since jAthena, so probably nobody knows for sure why is it so.
+character by -1, or a count if given. For a list of equipment slots see 'getequipid'.
+This command will also display a 'refine failure' effect on the character and put 
+appropriate messages into their chat window.
 
 ---------------------------------------
 
@@ -5135,6 +5119,14 @@ disguise 1002; // Disguise character as a Poring.
 next;
 undisguise; // Return to normal character sprite.
 
+---------------------------------------
+
+*transform <monster name/ID>,<duration>,<sc type>{,<val1>,<val2>,<val3>,<val4>};
+
+This command will turn a player into a monster for a given duration and grants an
+SC attribute effect while transformed. Note that players cannot be transformed
+during War of Emperium or if already disguised.
+
 ---------------------------------------
 \\
 4,3 Marriage-related commands

+ 6 - 10
npc/re/merchants/refine.txt

@@ -3,7 +3,7 @@
 //===== By: ==================================================
 //= rAthena Dev Team
 //===== Current Version: =====================================
-//= 1.3
+//= 1.4
 //===== Compatible With: =====================================
 //= rAthena SVN
 //===== Description: =========================================
@@ -15,6 +15,7 @@
 //= 1.2 Added official success calculation, thanks to Helvetica.
 //=     The safe/multiple refine feature is now functional. [Euphy]
 //= 1.3 Updated to match the latest official script. [Euphy]
+//= 1.4 Added correct safe refines. [Haruna]
 //============================================================
 
 // +11 and above Refiners
@@ -103,12 +104,7 @@ function	script	refinenew	{
 		set .@type$,"weapon";
 		set .@material,6224; //Bradium
 		set .@price,100000;
-		switch(getequipweaponlv(.@part)) {
-			case 1: set .@safe,17; break;
-			case 2: set .@safe,16; break;
-			case 3: set .@safe,15; break;
-			case 4: set .@safe,14; break;
-		}
+		set .@safe,10;
 		mes "["+ getarg(0) +"]";
 		mes "Hmm a weapon, is that ok?";
 		mes "If you want to refine this weapon,";
@@ -117,7 +113,7 @@ function	script	refinenew	{
 		set .@type$,"armor";
 		set .@material,6223; //Carnium
 		set .@price,100000;
-		set .@safe,14;
+		set .@safe,10;
 		mes "["+ getarg(0) +"]";
 		mes "Hmm an armor, is that ok?";
 		mes "If you want to refine this armor,";
@@ -189,7 +185,7 @@ function	script	refinenew	{
 			if (rand(100) < 80) {
 				mes "["+ getarg(0) +"]";
 				mes "Clang! Clang! Clang! Clang!";
-				downrefitem .@part;
+				downrefitem .@part,3; // Failed refine attempts decrease the item's refine level by 3
 				next;
 				emotion (!rand(5))?e_cash:e_omg;
 				mes "["+ getarg(0) +"]";
@@ -298,7 +294,7 @@ function	script	refinenew	{
 			if (rand(100) < 80) {
 				mes "["+ getarg(0) +"]";
 				mes "Clang! Clang! Clang! Clang!";
-				downrefitem .@part;
+				downrefitem .@part,3; // Failed refine attempts decrease the item's refine level by 3
 				next;
 				emotion (!rand(5))?e_cash:e_omg;
 				mes "["+ getarg(0) +"]";

+ 1 - 1
src/map/clif.c

@@ -17654,7 +17654,7 @@ void packetdb_readdb(void)
                         if( j < ARRAYLENGTH(clif_ack_func)) {
                                 int fidx = clif_ack_func[j].funcidx;
                                 packet_db_ack[packet_ver][fidx] = cmd;
-                                ShowInfo("Added %s, <=> %X i=%d for v=%d\n",clif_ack_func[j].name,cmd,fidx,packet_ver);
+                                //ShowInfo("Added %s, <=> %X i=%d for v=%d\n",clif_ack_func[j].name,cmd,fidx,packet_ver);
                         }
                 }
                 

+ 1 - 1
src/map/map.c

@@ -3599,7 +3599,7 @@ int map_sql_init(void)
 	ShowInfo("Connecting to the Map DB Server....\n");
 	if( SQL_ERROR == Sql_Connect(mmysql_handle, map_server_id, map_server_pw, map_server_ip, map_server_port, map_server_db) )
 		exit(EXIT_FAILURE);
-	ShowStatus("connect success! (Map Server Connection)\n");
+	ShowStatus("Connect success! (Map Server Connection)\n");
 
 	if( strlen(default_codepage) > 0 )
 		if ( SQL_ERROR == Sql_SetEncoding(mmysql_handle, default_codepage) )

+ 8 - 5
src/map/script.c

@@ -7760,13 +7760,15 @@ BUILDIN_FUNC(failedrefitem)
  *------------------------------------------*/
 BUILDIN_FUNC(downrefitem)
 {
-	int i = -1,num,ep;
+	int i = -1,num,ep,down = 1;
 	TBL_PC *sd;
 
-	num = script_getnum(st,2);
 	sd = script_rid2sd(st);
 	if( sd == NULL )
 		return 0;
+	num = script_getnum(st,2);
+	if( script_hasdata(st, 3) )
+		down = script_getnum(st, 3);
 
 	if (num > 0 && num <= ARRAYLENGTH(equip))
 		i = pc_checkequip(sd,equip[num-1]);
@@ -7776,10 +7778,11 @@ BUILDIN_FUNC(downrefitem)
 		//Logs items, got from (N)PC scripts [Lupus]
 		log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]);
 
-		sd->status.inventory[i].refine++;
 		pc_unequipitem(sd,i,2); // status calc will happen in pc_equipitem() below
+		sd->status.inventory[i].refine -= down;
+		sd->status.inventory[i].refine = cap_value( sd->status.inventory[i].refine, 0, MAX_REFINE);
 
-		clif_refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 2);
+		clif_refine(sd->fd,2,i,sd->status.inventory[i].refine);
 		clif_delitem(sd,i,1,3);
 
 		//Logs items, got from (N)PC scripts [Lupus]
@@ -18178,7 +18181,7 @@ struct script_function buildin_func[] = {
 	BUILDIN_DEF(getequippercentrefinery,"i"),
 	BUILDIN_DEF(successrefitem,"i"),
 	BUILDIN_DEF(failedrefitem,"i"),
-	BUILDIN_DEF(downrefitem,"i"),
+	BUILDIN_DEF(downrefitem,"i?"),
 	BUILDIN_DEF(statusup,"i"),
 	BUILDIN_DEF(statusup2,"ii"),
 	BUILDIN_DEF(bonus,"iv"),