فهرست منبع

- Changed wedding costumes to use setoption rather than changebase.
- Modified setoption so that flag 1 or no flag adds an option, and flag 0 removes it.
- Updated script_commands with the new behaviour.


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

skotlex 19 سال پیش
والد
کامیت
ae5d5020c0
6فایلهای تغییر یافته به همراه20 افزوده شده و 18 حذف شده
  1. 5 0
      Changelog-Trunk.txt
  2. 2 0
      db/const.txt
  3. 2 2
      db/item_db.txt
  4. 2 1
      doc/script_commands.txt
  5. 2 2
      sql-files/item_db.sql
  6. 7 13
      src/map/script.c

+ 5 - 0
Changelog-Trunk.txt

@@ -4,6 +4,11 @@ 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.
 
 2006/05/10
+	* Changed wedding costumes to use setoption rather than changebase.
+	  [Skotlex]
+	* Modified setoption so that flag 1 or no flag adds an option, and flag 0
+	  removes it. [Skotlex]
+	* Updated script_commands with the new behaviour. [Skotlex]
 	* Updated mob_db2.txt and mob_db2.sql to have only 10 drop slots rather
 	  than 15. [Skotlex]
 	* Users are now able to use their own dnsbl servers (login_athena) [Zido]

+ 2 - 0
db/const.txt

@@ -78,6 +78,8 @@ Job_Star_Gladiator	4047
 Job_Star_Gladiator2	4048
 Job_Soul_Linker	4049
 
+Option_Wedding	0x1000
+
 bc_all	0
 bc_map	1
 bc_area	2

+ 2 - 2
db/item_db.txt

@@ -996,7 +996,7 @@
 2335,Thief_Clothes,Thief Clothes,5,74000,,100,,6,,0,0x02021040,7,2,16,,0,1,0,{ bonus bAgi,1; },{},{}
 2336,Thief_Clothes_,Thief Clothes,5,74000,,100,,6,,1,0x00021040,7,2,16,,0,1,0,{ bonus bAgi,1; },{},{}
 2337,Ninja_Suit,Ninja Suit,5,,10,1500,,7,,0,0x00021040,7,2,16,,50,1,0,{ bonus bAgi,1; bonus bMdef,3; },{},{}
-2338,Wedding_Dress,Wedding Dress,5,43000,,500,,0,,0,0xFFFFFFFE,7,0,16,,0,1,0,{ bonus bMdef,15; },{ changebase Job_Wedding; },{ changebase Class; }
+2338,Wedding_Dress,Wedding Dress,5,43000,,500,,0,,0,0xFFFFFFFE,7,0,16,,0,1,0,{ bonus bMdef,15; },{ setoption Option_Wedding,1; },{ setoption Option_Wedding,0; }
 2339,Pantie,Pantie,5,1000,,100,,4,,0,0xFFFFFFFF,7,2,16,,0,1,0,{},{},{}
 2340,Novice_Breastplate,Novice Breastplate,5,89000,,500,,4,,1,0x00000001,7,2,16,,10,1,0,{},{},{}
 2341,Legion_Plate_Armor,Legion Plate Armor,5,94000,,5500,,11,,0,0x00004000,7,2,16,,70,1,0,{},{},{}
@@ -1789,7 +1789,7 @@
 7167,Strange_Steel_Piece,Strange Steel Piece,3,,215,10,,,,,,,,,,,,,{},{},{}
 7168,Giant_Butterfly_Wing,Giant Butterfly Wing,3,,307,10,,,,,,,,,,,,,{},{},{}
 7169,Ba_Gua,Ba_Gua,3,,1400,10,,,,,,,,,,,,,{},{},{}
-7170,Tuxedo,Tuxedo,5,43000,,10,,0,,0,0xFFFFFFFE,7,1,16,,0,1,0,{},{ changebase Job_Wedding; },{ changebase Class; }
+7170,Tuxedo,Tuxedo,5,43000,,10,,0,,0,0xFFFFFFFE,7,1,16,,0,1,0,{},{ setoption Option_Wedding,1; },{ setoption Option_Wedding,0; }
 7171,Leopard_Skin,Leopard Skin,3,,141,10,,,,,,,,,,,,,{},{},{}
 7172,Leopard_Claw,Leopard Claw,3,,145,10,,,,,,,,,,,,,{},{},{}
 7173,Bun_Buster_Bag,Bun Buster Bag,3,,10,10,,,,,,,,,,,,,{},{},{}

+ 2 - 1
doc/script_commands.txt

@@ -2699,7 +2699,8 @@ Option numbers are bitmasks - add up option numbers to check for all of them
 being present at the same time in one go.
 
 'setoption' will set options on the invoking character. There are no second and 
-third versions of this command, so you can only change the values in the last list (cloak, cart, ruwach, etc). if flag is 1, the option will be added to what the character currently has; if 2, the option is removed; otherwise (or if omitted) the option is set to what is passed (that is, all other set option values are removed).
+third versions of this command, so you can only change the values in the last
+list (cloak, cart, ruwach, etc). if flag is 1 (default when omitted), the option will be added to what the character currently has; if 0, the option is removed. 
 
 This is definitely not a complete list of available option flag numbers. Ask a 
 core developer for the full list.

+ 2 - 2
sql-files/item_db.sql

@@ -1024,7 +1024,7 @@ REPLACE INTO `item_db` VALUES (2334,'Mage_Coat','Mage Coat','5',NULL,'10','600',
 REPLACE INTO `item_db` VALUES (2335,'Thief_Clothes','Thief Clothes','5','74000',NULL,'100',NULL,'6',NULL,'0',0x02021040,'7','2','16',NULL,'0','1','0',' bonus bAgi,1; ',NULL,NULL);
 REPLACE INTO `item_db` VALUES (2336,'Thief_Clothes_','Thief Clothes','5','74000',NULL,'100',NULL,'6',NULL,'1',0x00021040,'7','2','16',NULL,'0','1','0',' bonus bAgi,1; ',NULL,NULL);
 REPLACE INTO `item_db` VALUES (2337,'Ninja_Suit','Ninja Suit','5',NULL,'10','1500',NULL,'7',NULL,'0',0x00021040,'7','2','16',NULL,'50','1','0',' bonus bAgi,1; bonus bMdef,3; ',NULL,NULL);
-REPLACE INTO `item_db` VALUES (2338,'Wedding_Dress','Wedding Dress','5','43000',NULL,'500',NULL,'0',NULL,'0',0xFFFFFFFE,'7','0','16',NULL,'0','1','0',' bonus bMdef,15; ',' changebase Job_Wedding; ','changebase Class;');
+REPLACE INTO `item_db` VALUES (2338,'Wedding_Dress','Wedding Dress','5','43000',NULL,'500',NULL,'0',NULL,'0',0xFFFFFFFE,'7','0','16',NULL,'0','1','0',' bonus bMdef,15; ',' setoption Option_Wedding,1; ',' setoption Option_Wedding,0; ');
 REPLACE INTO `item_db` VALUES (2339,'Pantie','Pantie','5','1000',NULL,'100',NULL,'4',NULL,'0',0xFFFFFFFF,'7','2','16',NULL,'0','1','0',NULL,NULL,NULL);
 REPLACE INTO `item_db` VALUES (2340,'Novice_Breastplate','Novice Breastplate','5','89000',NULL,'500',NULL,'4',NULL,'1',0x00000001,'7','2','16',NULL,'10','1','0',NULL,NULL,NULL);
 REPLACE INTO `item_db` VALUES (2341,'Legion_Plate_Armor','Legion Plate Armor','5','94000',NULL,'5500',NULL,'11',NULL,'0',0x00004000,'7','2','16',NULL,'70','1','0',NULL,NULL,NULL);
@@ -1817,7 +1817,7 @@ REPLACE INTO `item_db` VALUES (7166,'Soft_Silk','Soft Silk','3',NULL,'600','10',
 REPLACE INTO `item_db` VALUES (7167,'Strange_Steel_Piece','Strange Steel Piece','3',NULL,'215','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db` VALUES (7168,'Giant_Butterfly_Wing','Giant Butterfly Wing','3',NULL,'307','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db` VALUES (7169,'Ba_Gua','Ba_Gua','3',NULL,'1400','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db` VALUES (7170,'Tuxedo','Tuxedo','5','43000',NULL,'10',NULL,'0',NULL,'0',0xFFFFFFFE,'7','1','16',NULL,'0','1','0',NULL,' changebase Job_Wedding; ','changebase Class;');
+REPLACE INTO `item_db` VALUES (7170,'Tuxedo','Tuxedo','5','43000',NULL,'10',NULL,'0',NULL,'0',0xFFFFFFFE,'7','1','16',NULL,'0','1','0',NULL,' setoption Option_Wedding,1; ',' setoption Option_Wedding,0; ');
 REPLACE INTO `item_db` VALUES (7171,'Leopard_Skin','Leopard Skin','3',NULL,'141','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db` VALUES (7172,'Leopard_Claw','Leopard Claw','3',NULL,'145','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db` VALUES (7173,'Bun_Buster_Bag','Bun Buster Bag','3',NULL,'10','10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

+ 7 - 13
src/map/script.c

@@ -5079,7 +5079,7 @@ int buildin_setoption(struct script_state *st)
 {
 	int type;
 	struct map_session_data *sd;
-	int flag=0;
+	int flag=1;
 	
 	type=conv_num(st,& (st->stack->stack_data[st->start+2]));
 	if(st->end>st->start+3 )
@@ -5087,19 +5087,13 @@ int buildin_setoption(struct script_state *st)
 	
 	sd=script_rid2sd(st);
 	if (!sd) return 0;
-	
-	switch (flag) {
-		case 1: //Add option
-			pc_setoption(sd,sd->sc.option|type);
-			break;
-		case 2: //Remove option
-			pc_setoption(sd,sd->sc.option&~type);
-			break;
-		default:	//Set option
-			pc_setoption(sd,type);
-			break;
-	}
 
+	if (flag) {//Add option
+		if (type&OPTION_WEDDING && !battle_config.wedding_modifydisplay)
+			type&=~OPTION_WEDDING; //Do not show the wedding sprites
+		pc_setoption(sd,sd->sc.option|type);
+	} else//Remove option
+		pc_setoption(sd,sd->sc.option&~type);
 	return 0;
 }