Sfoglia il codice sorgente

- Corrected char deletion not working (column is called homun_id, not hom_id...)
- Collapsed config settings produce_item_name_input, produce_potion_name_input, making_arrow_name_input, holywater_name_input, cdp_name_input into a single config produce_item_name_input which uses bitmasks to determine what it affects.
- Updated arrow_decrement to have 3 possible values: Disabled, Enabled, and Enabled as well as giving arrow requirements to skills that do not have them when used with ranged weapons (auto-guess for plagiarized/item-granted skills)
- Minor cleanings


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

skotlex 18 anni fa
parent
commit
50a03b0751

+ 10 - 0
Changelog-Trunk.txt

@@ -3,6 +3,16 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2007/01/30
+	* Corrected char deletion not working (column is called homun_id, not
+	  hom_id...)
+	* Collapsed config settings produce_item_name_input,
+	  produce_potion_name_input, making_arrow_name_input, holywater_name_input,
+	  cdp_name_input into a single config produce_item_name_input which uses
+	  bitmasks to determine what it affects.
+	* Updated arrow_decrement to have 3 possible values: Disabled, Enabled, and
+	  Enabled + Autoguess (gives arrow consumption as appropiate to
+	  plagiarized/acquired skills).
 2007/01/29
 	* Corrected the homunculus deletion functions so that the homunculus is
 	  deleted together with the character.

+ 9 - 0
conf-tmpl/Changelog.txt

@@ -1,5 +1,14 @@
 Date	Added
 
+2007/01/29
+	* Collapsed config settings produce_item_name_input,
+	  produce_potion_name_input, making_arrow_name_input, holywater_name_input,
+	  cdp_name_input into a single config produce_item_name_input which uses
+	  bitmasks to determine what it affects. See battle/item.conf for details.
+	* Updated arrow_decrement to have 3 possible values: Disabled, Enabled, and
+	  Enabled + Autoguess (gives arrow consumption as appropiate to
+	  plagiarized/acquired skills). eA previously had a hardcoded '2' setting,
+	  now it's 1 by default as it should be. [Skotlex]
 2007/01/28
 	* Fixed the description of @summon
 	* Fixed @nuke's position (I edited the wrong file by accident)

+ 6 - 2
conf-tmpl/battle/battle.conf

@@ -164,5 +164,9 @@ equip_skill_break_rate: 100
 // NOTE: The official setting is yes, even thought it degrades performance a bit.
 delay_battle_damage: yes
 
-// Are arrows are consumed when used on a bow? (Note 1)
-arrow_decrement: yes
+// Are arrows/ammo consumed when used on a bow/gun?
+// 0 - No, 1 - Yes
+// 2 - Yes even for skills that do not specify arrow consumption when said 
+//     skill is weapon-based and used with ranged weapons (auto-guesses which 
+//     skills should consume ammo when it's acquired via a card or plagiarize)
+arrow_decrement: 1

+ 8 - 14
conf-tmpl/battle/items.conf

@@ -39,20 +39,14 @@ weapon_produce_rate: 100
 // Prepare Potion success rate. (Note 2)
 potion_produce_rate: 100
 
-// Do produced items have the maker's name on them? (Note 1)
-produce_item_name_input: yes
-
-// Do produced potions have the maker's name on them? (Note 1)
-produce_potion_name_input: yes
-
-// Do crafted arrows have the maker's name on them? (Note 1)
-making_arrow_name_input: no
-
-// Do created holy waters have the maker's name on it? (Note 1)
-holywater_name_input: no
-
-// Do created poison bottles have the maker's name on it? (Note 1)
-cdp_name_input: no
+// Do produced items have the maker's name on them? (Note 4)
+// 0x01: Produced Weapons
+// 0x02: Produced Potions
+// 0x04: Produced Arrows
+// 0x08: Produced Holy Water
+// 0x10: Produced Deadly Potions
+// 0x80: Other produced items.
+produce_item_name_input: 0x03
 
 // Is a monster summoned via dead branch aggressive? (Note 1)
 dead_branch_active: yes

+ 2 - 1
src/char_sql/char.c

@@ -32,6 +32,7 @@
 #include "db.h"
 #include "malloc.h"
 #include "int_guild.h"
+#include "int_homun.h"
 #include "char.h"
 
 #ifndef TXT_SQL_CONVERT
@@ -1457,7 +1458,7 @@ int delete_char_sql(int char_id, int partner_id)
 	char char_name[NAME_LENGTH], t_name[NAME_LENGTH*2]; //Name needs be escaped.
 	int account_id, party_id, guild_id, hom_id, char_base_level;
 	
-	sprintf(tmp_sql, "SELECT `name`,`account_id`,`party_id`,`guild_id`,`base_level`,`hom_id` FROM `%s` WHERE `char_id`='%d'",char_db, char_id);
+	sprintf(tmp_sql, "SELECT `name`,`account_id`,`party_id`,`guild_id`,`base_level`,`homun_id` FROM `%s` WHERE `char_id`='%d'",char_db, char_id);
 
 	if (mysql_query(&mysql_handle, tmp_sql)) {
 		ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));

+ 1 - 0
src/char_sql/int_homun.c

@@ -236,6 +236,7 @@ int mapif_delete_homunculus(int fd)
 {
 	RFIFOHEAD(fd);
 	mapif_homunculus_deleted(fd, inter_delete_homunculus(RFIFOL(fd,2)));
+	return 1;
 }
 
 int mapif_rename_homun_ack(int fd, int account_id, int char_id, unsigned char flag, char *name){

+ 1 - 9
src/map/battle.c

@@ -3640,10 +3640,6 @@ static const struct battle_data_short {
 	{ "party_skill_penalty",               &battle_config.party_skill_penalty		},
 	{ "monster_class_change_full_recover", &battle_config.monster_class_change_full_recover },
 	{ "produce_item_name_input",           &battle_config.produce_item_name_input	},
-	{ "produce_potion_name_input",         &battle_config.produce_potion_name_input},
-	{ "making_arrow_name_input",           &battle_config.making_arrow_name_input	},
-	{ "holywater_name_input",              &battle_config.holywater_name_input		},
-	{ "cdp_name_input",                    &battle_config.cdp_name_input		},
 	{ "display_skill_fail",                &battle_config.display_skill_fail	},
 	{ "chat_warpportal",                   &battle_config.chat_warpportal			},
 	{ "mob_warp",                          &battle_config.mob_warp	},
@@ -4056,11 +4052,7 @@ void battle_set_defaults() {
 	battle_config.land_skill_limit = BL_ALL;
 	battle_config.party_skill_penalty = 1;
 	battle_config.monster_class_change_full_recover = 1;
-	battle_config.produce_item_name_input = 1;
-	battle_config.produce_potion_name_input = 1;
-	battle_config.making_arrow_name_input = 1;
-	battle_config.holywater_name_input = 1;
-	battle_config.cdp_name_input = 1;
+	battle_config.produce_item_name_input = 0x3;
 	battle_config.display_skill_fail = 0;
 	battle_config.chat_warpportal = 0;
 	battle_config.mob_warp = 0;

+ 0 - 4
src/map/battle.h

@@ -254,10 +254,6 @@ extern struct Battle_Config {
 	unsigned short party_skill_penalty;
 	unsigned short monster_class_change_full_recover;
 	unsigned short produce_item_name_input;
-	unsigned short produce_potion_name_input;
-	unsigned short making_arrow_name_input;
-	unsigned short holywater_name_input;
-	unsigned short cdp_name_input;
 	unsigned short display_skill_fail;
 	unsigned short chat_warpportal;
 	unsigned short mob_warp;

+ 15 - 5
src/map/skill.c

@@ -7822,6 +7822,7 @@ static int skill_check_condition_mob_master_sub (struct block_list *bl, va_list
 int skill_isammotype (TBL_PC *sd, int skill)
 {
 	return (
+		battle_config.arrow_decrement==2 &&
 		(sd->status.weapon == W_BOW || (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE)) &&
 		skill != HT_PHANTASMIC &&
 		skill_get_type(skill) == BF_WEAPON &&
@@ -10603,20 +10604,29 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 		} else {
 			//Flag is only used on the end, so it can be used here. [Skotlex]
 			switch (skill_id) {
+				case BS_DAGGER:
+				case BS_SWORD:
+				case BS_TWOHANDSWORD:
+				case BS_AXE:
+				case BS_MACE:
+				case BS_KNUCKLE:
+				case BS_SPEAR:
+					flag = battle_config.produce_item_name_input&0x1;
+					break;
 				case AM_PHARMACY:
 				case AM_TWILIGHT1:
 				case AM_TWILIGHT2:
 				case AM_TWILIGHT3:
-					flag = battle_config.produce_potion_name_input;
+					flag = battle_config.produce_item_name_input&0x2;
 					break;
 				case AL_HOLYWATER:
-					flag = battle_config.holywater_name_input;
+					flag = battle_config.produce_item_name_input&0x8;
 					break;
 				case ASC_CDP:
-					flag = battle_config.cdp_name_input;
+					flag = battle_config.produce_item_name_input&0x10;
 					break;
 				default:
-					flag = battle_config.produce_item_name_input;
+					flag = battle_config.produce_item_name_input&0x80;
 					break;
 			}
 			if (flag) {
@@ -10763,7 +10773,7 @@ int skill_arrow_create (struct map_session_data *sd, int nameid)
 		tmp_item.identify = 1;
 		tmp_item.nameid = skill_arrow_db[index].cre_id[i];
 		tmp_item.amount = skill_arrow_db[index].cre_amount[i];
-		if(battle_config.making_arrow_name_input) {
+		if(battle_config.produce_item_name_input&0x4) {
 			tmp_item.card[0]=CARD0_CREATE;
 			tmp_item.card[1]=0;
 			tmp_item.card[2]=GetWord(sd->status.char_id,0); // CharId