Browse Source

Update 'RequirementRemoved' field on 'skill_copyable_db.txt', following 'RequiredEquipment' field on skill_require_db.txt

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Cydh Ramdh 11 năm trước cách đây
mục cha
commit
02d44bf822
5 tập tin đã thay đổi với 60 bổ sung48 xóa
  1. 7 3
      db/pre-re/skill_require_db.txt
  2. 7 3
      db/re/skill_require_db.txt
  3. 24 23
      db/skill_copyable_db.txt
  4. 19 17
      src/map/skill.c
  5. 3 2
      src/map/skill.h

+ 7 - 3
db/pre-re/skill_require_db.txt

@@ -23,9 +23,13 @@
 //  peco = Requires riding a peco
 //
 // 'RequiredStatuses'
-//  Fill the value only with SC_STATUS (see db/const.txt for more details)
-//  Usage for multiple status requirements: SC_STATUS1:SC_STATUS2:SC_STATUS3 (max. is MAX_SKILL_STATUS_REQUIRE)
-//  Use any number or SC_ALL will disable status requirements
+//	Fill the value only with SC_STATUS (see db/const.txt for more details)
+//	Usage for multiple status requirements: SC_STATUS1:SC_STATUS2:SC_STATUS3
+//	Max. multiple value is 3 (skill.h: MAX_SKILL_STATUS_REQUIRE)
+//	Use any number or SC_ALL will disable status requirements
+// 'RequiredEquipment'
+//	Specified equipment to be equipped. For multiple values, use : as delimiter.
+//	Max. multiple value is 10 (skill.h: MAX_SKILL_EQUIP_REQUIRE)
 
 //****
 // SM Swordman

+ 7 - 3
db/re/skill_require_db.txt

@@ -23,9 +23,13 @@
 //  peco = Requires riding a peco
 //
 // 'RequiredStatuses'
-//  Fill the value only with SC_STATUS (see db/const.txt for more details)
-//  Usage for multiple status requirements: SC_STATUS1:SC_STATUS2:SC_STATUS3 (max. is MAX_SKILL_STATUS_REQUIRE)
-//  Use any number or SC_ALL will disable status requirements
+//	Fill the value only with SC_STATUS (see db/const.txt for more details)
+//	Usage for multiple status requirements: SC_STATUS1:SC_STATUS2:SC_STATUS3
+//	Max. multiple value is 3 (skill.h: MAX_SKILL_STATUS_REQUIRE)
+//	Use any number or SC_ALL will disable status requirements
+// 'RequiredEquipment'
+//	Specified equipment to be equipped. For multiple values, use : as delimiter.
+//	Max. multiple value is 10 (skill.h: MAX_SKILL_EQUIP_REQUIRE)
 
 //****
 // SM Swordman

+ 24 - 23
db/skill_copyable_db.txt

@@ -10,31 +10,32 @@
 //    SkillName,Option{,JobAllowed{,RequirementRemoved}}
 // ====================================================
 // Option is using bitmask of skill that can be copied by:
-//    1 = Plagiarism
-//    2 = Reproduce
+//	1 = Plagiarism
+//	2 = Reproduce
 // JobAllowed, the skill only can be copied by:
-//    (0 or the default value makes all jobs can copy the skill)
-//    1    = Rogue
-//    2    = Stalker
-//    4    = Shadow Chaser
-//    8    = Trans. Shadow Chaser
-//    16   = Baby Rouge
-//    32   = Baby Shadow Chaser
+//	(0 or the default value makes all jobs can copy the skill)
+//	1	= Rogue
+//	2	= Stalker
+//	4	= Shadow Chaser
+//	8	= Trans. Shadow Chaser
+//	16	= Baby Rouge
+//	32	= Baby Shadow Chaser
 // RequirementRemoved, decide which requirement(s) that will be removed while checking.
-//    0    = makes the requirement(s) same like original requirement(s)
-//    1    = hp
-//    2    = maxhptrigger
-//    4    = sp
-//    8    = hprate
-//    16   = sprate
-//    32   = zeny
-//    64   = weapon type
-//    128  = ammo (with the amount)
-//    256  = state
-//    512  = statuses
-//    1024 = spirit sphere
-//    2048 = items (with the amount)
-//    (see 'skill_require_db.txt' for requirement(s) detail)
+//	   0 = makes the requirement(s) same like original requirement(s)
+//	   1 = hp
+//	   2 = maxhptrigger
+//	   4 = sp
+//	   8 = hprate
+//	  16 = sprate
+//	  32 = zeny
+//	  64 = weapon type
+//	 128 = ammo (with the amount)
+//	 256 = state
+//	 512 = statuses
+//	1024 = spirit sphere
+//	2048 = items (with the amount)
+//  4096 = equipments
+// (see 'skill_require_db.txt' for requirement(s) detail)
 // ====================================================
 // Example of advanced usage:
 //AS_SONICBLOW,2,63,64

+ 19 - 17
src/map/skill.c

@@ -14035,7 +14035,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
 	}
 
 	//check if equiped item
-	for (i = 0; i < 10; i++) {
+	for (i = 0; i < MAX_SKILL_EQUIP_REQUIRE; i++) {
 		int reqeqit = require.eqItem[i];
 		if(!reqeqit) break; //no more required item get out of here
 		if (!pc_checkequip2(sd,reqeqit)) {
@@ -14606,18 +14606,19 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
 	//Check if player is using the copied skill [Cydh]
 	if (sd->status.skill[idx].flag == SKILL_FLAG_PLAGIARIZED) {
 		uint16 req_opt = skill_db[idx].copyable.req_opt;
-		if (req_opt&0x001) req.hp = 0;
-		if (req_opt&0x002) req.mhp = 0;
-		if (req_opt&0x004) req.sp = 0;
-		if (req_opt&0x008) req.hp_rate = 0;
-		if (req_opt&0x010) req.sp_rate = 0;
-		if (req_opt&0x020) req.zeny = 0;
-		if (req_opt&0x040) req.weapon = 0;
-		if (req_opt&0x080) { req.ammo = 0; req.ammo_qty = 0; }
-		if (req_opt&0x100) req.state = ST_NONE;
-		if (req_opt&0x200) { memset(req.status,SC_NONE,sizeof(req.status)); }
-		if (req_opt&0x400) req.spiritball = 0;
-		if (req_opt&0x800) { memset(req.itemid,0,sizeof(req.itemid)); memset(req.amount,0,sizeof(req.amount)); }
+		if (req_opt&0x0001) req.hp = 0;
+		if (req_opt&0x0002) req.mhp = 0;
+		if (req_opt&0x0004) req.sp = 0;
+		if (req_opt&0x0008) req.hp_rate = 0;
+		if (req_opt&0x0010) req.sp_rate = 0;
+		if (req_opt&0x0020) req.zeny = 0;
+		if (req_opt&0x0040) req.weapon = 0;
+		if (req_opt&0x0080) { req.ammo = 0; req.ammo_qty = 0; }
+		if (req_opt&0x0100) req.state = ST_NONE;
+		if (req_opt&0x0200) memset(req.status,SC_NONE,sizeof(req.status));
+		if (req_opt&0x0400) req.spiritball = 0;
+		if (req_opt&0x0800) { memset(req.itemid,0,sizeof(req.itemid)); memset(req.amount,0,sizeof(req.amount)); }
+		if (req_opt&0x1000) memset(req.eqItem,0,sizeof(req.eqItem));
 	}
 
 	return req;
@@ -18576,7 +18577,7 @@ static bool skill_parse_row_requiredb(char* split[], int columns, int current)
 	p = strtok(split[11],":");
 	for( i = 0; i < MAX_SKILL_STATUS_REQUIRE && p != NULL; i++ ) {
 		int status = SC_NONE;
-		script_get_constant(trim(p), &status);
+		script_get_constant(trim(p),&status);
 		if (status > SC_NONE) {
 			skill_db[idx].require.status[skill_db[idx].require.status_count] = (enum sc_type)status;
 			skill_db[idx].require.status_count++;
@@ -18594,9 +18595,9 @@ static bool skill_parse_row_requiredb(char* split[], int columns, int current)
 	//require equiped
 	memset(skill_db[idx].require.eqItem,0,sizeof(skill_db[idx].require.eqItem));
 	p = strtok(split[33],":");
-	for( i = 0; i < 10 && p != NULL; i++ ) {
+	for( i = 0; i < MAX_SKILL_EQUIP_REQUIRE && p != NULL; i++ ) {
 		int itid = atoi(p);
-		p = strtok(NULL,":"); //for easy continue don,t read p after this
+		p = strtok(NULL,":"); //for easy continue don't read 'p' after this
 		if(itid <= 0) continue; //silent
 		if(itemdb_exists(itid)== NULL) {
 			ShowWarning("Invalid reqIt=%d specified for skillid=%d\n",itid,skill_id);
@@ -18820,7 +18821,8 @@ static bool skill_parse_row_copyabledb(char* split[], int column, int current) {
 	skill_db[idx].copyable.reproduce = (option&2) ? true : false;
 
 	skill_db[idx].copyable.joballowed = (atoi(split[2])) ? cap_value(atoi(split[2]),1,63) : 63;
-	skill_db[idx].copyable.req_opt = cap_value(atoi(split[3]),0,4095);
+	
+	skill_db[idx].copyable.req_opt = cap_value(atoi(split[3]),0,(0x2000)-1);
 
 	return true;
 }

+ 3 - 2
src/map/skill.h

@@ -105,6 +105,7 @@ enum e_skill_display {
 
 #define MAX_SKILL_ITEM_REQUIRE	10
 #define MAX_SKILL_STATUS_REQUIRE 3
+#define MAX_SKILL_EQUIP_REQUIRE 10
 struct skill_condition {
 	int hp,
 		mhp,
@@ -119,7 +120,7 @@ struct skill_condition {
 		spiritball,
 		itemid[MAX_SKILL_ITEM_REQUIRE],
 		amount[MAX_SKILL_ITEM_REQUIRE],
-		eqItem[10]; //max eq_item
+		eqItem[MAX_SKILL_EQUIP_REQUIRE]; //max eq_item
 	uint8 status_count;
 	enum sc_type status[MAX_SKILL_STATUS_REQUIRE];
 };
@@ -138,7 +139,7 @@ struct s_skill_require {
 		spiritball[MAX_SKILL_LEVEL],
 		itemid[MAX_SKILL_ITEM_REQUIRE],
 		amount[MAX_SKILL_ITEM_REQUIRE],
-		eqItem[10]; //max eq_item
+		eqItem[MAX_SKILL_EQUIP_REQUIRE]; //max eq_item
 	uint8 status_count;
 	enum sc_type status[MAX_SKILL_STATUS_REQUIRE];
 };