Selaa lähdekoodia

Fixed Cart Cannon skillratio, fixed #360. Thank @MrAntares

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Cydh Ramdh 10 vuotta sitten
vanhempi
commit
0b427a87e8
3 muutettua tiedostoa jossa 8 lisäystä ja 4 poistoa
  1. 2 2
      src/map/battle.c
  2. 2 0
      src/map/mob.c
  3. 4 2
      src/map/mob.h

+ 2 - 2
src/map/battle.c

@@ -3861,13 +3861,13 @@ static int battle_calc_attack_skill_ratio(struct Damage wd, struct block_list *s
 					strbonus = 130;
 				skillratio = 50 * skill_lv;
 				if(sd && sd->cart_weight)
-					skillratio += sd->cart_weight / 10 / (150 - strbonus) + pc_checkskill(sd,GN_REMODELING_CART) * 50;
+					skillratio += (int)(sd->cart_weight / 10. / (150. - strbonus)) + pc_checkskill(sd,GN_REMODELING_CART) * 50;
 			}
 			break;
 		case GN_CARTCANNON:
 			// ATK [{( Cart Remodeling Skill Level x 50 ) x ( INT / 40 )} + ( Cart Cannon Skill Level x 60 )] %
 			skillratio = 60 * skill_lv;
-			if( sd ) skillratio += (pc_checkskill(sd, GN_REMODELING_CART) * 50) * (status_get_int(src) / 40);
+			if( sd ) skillratio += pc_checkskill(sd, GN_REMODELING_CART) * 50 * status_get_int(src) / 40;
 			break;
 		case GN_SPORE_EXPLOSION:
 			skillratio = (100 * skill_lv) + (200 + status_get_int(src));

+ 2 - 0
src/map/mob.c

@@ -4189,6 +4189,7 @@ static bool mob_parse_row_mobskilldb(char** str, int columns, int current)
 		char str[32];
 		int id;
 	} cond1[] = {
+		// enum e_mob_skill_condition
 		{ "always",            MSC_ALWAYS            },
 		{ "myhpltmaxrate",     MSC_MYHPLTMAXRATE     },
 		{ "myhpinrate",        MSC_MYHPINRATE        },
@@ -4226,6 +4227,7 @@ static bool mob_parse_row_mobskilldb(char** str, int columns, int current)
 		{	"hiding",		SC_HIDING		},
 		{	"sight",		SC_SIGHT		},
 	}, target[] = {
+		// enum e_mob_skill_target
 		{	"target",	MST_TARGET	},
 		{	"randomtarget",	MST_RANDOM	},
 		{	"self",		MST_SELF	},

+ 4 - 2
src/map/mob.h

@@ -174,7 +174,7 @@ struct mob_data {
 	int deletetimer;
 	int master_id,master_dist;
 
-	int8 skill_idx;// key of array
+	int8 skill_idx; // Index of last used skill from db->skill[]
 	unsigned int skilldelay[MAX_MOBSKILL];
 	char npc_event[EVENT_NAME_LENGTH];
 	/**
@@ -188,7 +188,7 @@ struct mob_data {
 	int tomb_nid;
 };
 
-enum {
+enum e_mob_skill_target {
 	MST_TARGET	=	0,
 	MST_RANDOM,	//Random Target!
 	MST_SELF,
@@ -203,7 +203,9 @@ enum {
 	MST_AROUND3,
 	MST_AROUND4,
 	MST_AROUND	=	MST_AROUND4,
+};
 
+enum e_mob_skill_condition {
 	MSC_ALWAYS	=	0x0000,
 	MSC_MYHPLTMAXRATE,
 	MSC_MYHPINRATE,