diff options
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 2393cf97b..923149dd2 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2916,10 +2916,10 @@ int pc_show_steal(struct block_list *bl,va_list ap) *
*------------------------------------------
*/
-//** pc.c: Small Steal Item fix by fritz
+//** pc.c:
int pc_steal_item(struct map_session_data *sd,struct block_list *bl)
{
- int i,skill,itemid,flag;
+ int i,j,skill,itemid,flag;
struct mob_data *md;
struct item tmp_item;
@@ -2928,17 +2928,13 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl) md=(struct mob_data *)bl;
-
- if(1 || md->state.steal_flag>battle_config.skill_steal_max_tries || status_get_mode(bl)&MD_BOSS || md->master_id ||
+ if(md->state.steal_flag>battle_config.skill_steal_max_tries || status_get_mode(bl)&MD_BOSS || md->master_id ||
(md->class_>=1324 && md->class_<1364) || // prevent stealing from treasure boxes [Valaris]
map[md->bl.m].flag.nomobloot || // check noloot map flag [Lorky]
md->sc.data[SC_STONE].timer != -1 || md->sc.data[SC_FREEZE].timer != -1 //status change check
)
return 0;
- if(md->state.steal_flag < battle_config.skill_steal_max_tries)
- md->state.steal_flag++;
-
skill = battle_config.skill_steal_type == 1
? (sd->paramc[4] - md->db->dex)/2 + pc_checkskill(sd,TF_STEAL)*6 + 10
: sd->paramc[4] - md->db->dex + pc_checkskill(sd,TF_STEAL)*3 + 10;
@@ -2946,10 +2942,12 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl) if (skill < 1)
return 0;
+ if(md->state.steal_flag < battle_config.skill_steal_max_tries)
+ md->state.steal_flag++; //increase steal tries number
+
for(i = 0; i<MAX_MOB_DROP; i++)//Pick one mobs drop slot.
{
itemid = md->db->dropitem[i].nameid;
-
if(itemid <= 0 || (itemid>4000 && itemid<5000 && pc_checkskill(sd,TF_STEAL) <= 5))
continue;
if(rand() % 10000 > ((md->db->dropitem[i].p * skill) / 100 + sd->add_steal_rate))
@@ -2958,6 +2956,8 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl) if (i == MAX_MOB_DROP)
return 0;
+ md->state.steal_flag = 255; //you can't steal from this mob any more
+
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = itemid;
tmp_item.amount = 1;
@@ -2995,7 +2995,6 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl) }
return 1;
}
-
/*==========================================
*
*------------------------------------------
|