summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index ad27ef0e3..7451fbf41 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -3789,7 +3789,7 @@ static int skill_check_condition_mercenary(struct block_list *bl, int skill_id,
if (itemid[i] < 1) continue; // No item
index[i] = pc->search_inventory(sd, itemid[i]);
if (index[i] == INDEX_NOT_FOUND || sd->status.inventory[index[i]].amount < amount[i]) {
- clif->skill_fail(sd, skill_id, USESKILL_FAIL_NEED_ITEM, amount[i], itemid[i] << 16);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_NEED_ITEM, amount[i], itemid[i]);
return 0;
}
}
@@ -6530,10 +6530,6 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list *
clif->skill_nodamage (src,src,skill_id,skill_lv,1);
// Initiate 10% of your damage becomes fire element.
sc_start4(src,src,SC_SUB_WEAPONPROPERTY,100,3,20,0,0,skill->get_time2(skill_id, skill_lv));
- if( sd )
- skill->blockpc_start(sd, skill_id, skill->get_time(skill_id, skill_lv));
- else if( bl->type == BL_MER )
- skill->blockmerc_start(BL_UCAST(BL_MER, bl), skill_id, skill->get_time(skill_id, skill_lv));
break;
case TK_JUMPKICK:
@@ -7205,7 +7201,7 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list *
// custom hack to make the mob display the skill, because these skills don't show the skill use text themselves
//NOTE: mobs don't have the sprite animation that is used when performing this skill (will cause glitches)
char temp[70];
- snprintf(temp, sizeof(temp), "%s : %s !!", md->name, skill->get_desc(skill_id));
+ snprintf(temp, sizeof(temp), msg_txt(882), md->name, skill->get_desc(skill_id)); // %s : %s !!
clif->disp_overhead(&md->bl, temp, AREA_CHAT_WOC, NULL);
}
break;
@@ -8758,12 +8754,20 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list *
int r = rnd()%100;
int target = (skill_lv-1)%5;
int hp;
- if(r<per[target][0]) //Self
+ if (r < per[target][0]) { //Self
bl = src;
- else if(r<per[target][1]) //Master
+ } else if (r < per[target][1]) { //Master
bl = battle->get_master(src);
- else //Enemy
- bl = map->id2bl(battle->get_target(src));
+ } else if ((per[target][1] - per[target][0]) < per[target][0]
+ && bl == battle->get_master(src)) {
+ /**
+ * Skill rolled for enemy, but there's nothing the Homunculus is attacking.
+ * So bl has been set to its master in unit->skilluse_id2.
+ * If it's more likely that it will heal itself,
+ * we let it heal itself.
+ */
+ bl = src;
+ }
if (!bl) bl = src;
hp = skill->calc_heal(src, bl, skill_id, 1+rnd()%skill_lv, true);
@@ -14669,7 +14673,7 @@ static int skill_check_condition_castbegin(struct map_session_data *sd, uint16 s
if (map->foreachinrange(mob->count_sub, &sd->bl, skill->get_splash(skill_id, skill_lv), BL_MOB,
MOBID_EMPELIUM, MOBID_S_EMPEL_1, MOBID_S_EMPEL_2)) {
char output[128];
- sprintf(output, "You're too close to a stone or emperium to do this skill"); /* TODO official response? or message.conf it */
+ sprintf(output, "%s", msg_txt(883)); /* TODO official response */ // You are too close to a stone or emperium to do this skill
clif->messagecolor_self(sd->fd, COLOR_RED, output);
return 0;
}
@@ -15116,7 +15120,7 @@ static int skill_check_condition_castend(struct map_session_data *sd, uint16 ski
return 0;
} else if( sd->status.inventory[i].amount < require.ammo_qty ) {
char e_msg[100];
- sprintf(e_msg,"Skill Failed. [%s] requires %dx %s.",
+ sprintf(e_msg, msg_txt(884), // Skill Failed. [%s] requires %dx %s.
skill->get_desc(skill_id),
require.ammo_qty,
itemdb_jname(sd->status.inventory[i].nameid));
@@ -21105,7 +21109,7 @@ static bool skill_read_skilldb(const char *filename)
nullpo_retr(false, filename);
- sprintf(filepath,"db/%s",filename);
+ libconfig->format_db_path(filename, filepath, sizeof(filepath));
if (!libconfig->load_file(&skilldb, filepath)) {
return false; // Libconfig error report.