summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-11-17 15:11:25 +0100
committerGitHub <noreply@github.com>2019-11-17 15:11:25 +0100
commitebbed2342dbb7324295217ac7cf46f5e9da2fc0b (patch)
treed99f8aba2b104153be9f3bf8962f76ae6d833561
parent174c5d284f5cd57e0125535ea31554038379690e (diff)
parent22b946b2db0374164697ba57b64abb11551b0ff3 (diff)
downloadhercules-ebbed2342dbb7324295217ac7cf46f5e9da2fc0b.tar.gz
hercules-ebbed2342dbb7324295217ac7cf46f5e9da2fc0b.tar.bz2
hercules-ebbed2342dbb7324295217ac7cf46f5e9da2fc0b.tar.xz
hercules-ebbed2342dbb7324295217ac7cf46f5e9da2fc0b.zip
Merge pull request #2567 from MishimaHaruna/steal-fixes
Fix some issues in the Steal skill
-rw-r--r--src/map/mob.c8
-rw-r--r--src/map/mob.h1
-rw-r--r--src/map/pc.c6
3 files changed, 12 insertions, 3 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index ca1ce3585..dce084a23 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2236,6 +2236,14 @@ static void mob_log_damage(struct mob_data *md, struct block_list *src, int dama
md->dmglog[minpos].flag= flag;
md->dmglog[minpos].dmg = damage;
}
+#if (PACKETVER >= 20120404 && PACKETVER < 20131223)
+ // Show HP bar to all chars who hit the mob (fixes TF_STEAL not showing HP bar right away but only when target leaves/re-enters sight range)
+ if (battle_config.show_monster_hp_bar != 0 && (md->status.mode & MD_BOSS) == 0) {
+ struct map_session_data *sd = map->charid2sd(char_id);
+ if (sd != NULL && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE)) // check if in range
+ clif->monster_hp_bar(md, sd);
+ }
+#endif
}
return;
}
diff --git a/src/map/mob.h b/src/map/mob.h
index 9b0f6ffe0..6c3aa938b 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -40,7 +40,6 @@ struct hplugin_data_store;
//The number of drops all mobs have and the max drop-slot that the steal skill will attempt to steal from.
#define MAX_MOB_DROP 10
#define MAX_MVP_DROP 3
-#define MAX_STEAL_DROP 7
//Min time between AI executions
#define MIN_MOBTHINKTIME 100
diff --git a/src/map/pc.c b/src/map/pc.c
index a8ff661e8..56a00b5ce 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5583,15 +5583,17 @@ static int pc_steal_item(struct map_session_data *sd, struct block_list *bl, uin
// Try dropping one item, in the order from first to last possible slot.
// Droprate is affected by the skill success rate.
- for (i = 0; i < MAX_STEAL_DROP; i++) {
+ for (i = 0; i < MAX_MOB_DROP; i++) {
if (md->db->dropitem[i].nameid == 0)
continue;
if ((data = itemdb->exists(md->db->dropitem[i].nameid)) == NULL)
continue;
+ if (data->type == IT_CARD)
+ continue;
if (rnd() % 10000 < apply_percentrate(md->db->dropitem[i].p, rate, 100))
break;
}
- if (i == MAX_STEAL_DROP)
+ if (i == MAX_MOB_DROP)
return 0;
itemid = md->db->dropitem[i].nameid;