// How many times you could try to steal from a mob.
// Note: It helps to avoid stealing exploit on monsters with few rare items
// Use 0 to disable (Max allowed value is 255)
skill_steal_max_tries: 0
// How can i make it work that i can use steal until mob dies. You can obtain same items again and again. I dont know but i think there is this thing called "skill_steal_max success" that is located somewhere i cannot find that also limit the skill to be used only once per monster. And someone told me i need to make the conf to the "conf/import/battle.conf". I am planning to make a new skill from it.
Thank you so much, total noob here
//from "pc.c"
* Steal an item from bl (mob).
* Return:
* 0 = fail
* 1 = succes
*------------------------------------------*/
static int pc_steal_item(struct map_session_data *sd, struct block_list *bl, uint16 skill_lv)
{
int i,itemid,flag;
int rate;
struct status_data *sd_status, *md_status;
struct mob_data *md = BL_CAST(BL_MOB, bl);
struct item tmp_item;
struct item_data *data = NULL;
if (sd == NULL || md == NULL)
return 0;
if(md->state.steal_flag == UCHAR_MAX || ( md->sc.opt1 && md->sc.opt1 != OPT1_BURNING && md->sc.opt1 != OPT1_CRYSTALIZE ) ) //already stolen from / status change check
return 0;
sd_status= status->get_status_data(&sd->bl);
md_status= status->get_status_data(bl);
if (md->master_id || md_status->mode&MD_BOSS || mob_is_treasure(md) ||
map->list[bl->m].flag.nomobloot || // check noloot map flag [Lorky]
(battle_config.skill_steal_max_tries && //Reached limit of steal attempts. [Lupus]
md->state.steal_flag++ >= battle_config.skill_steal_max_tries)
) { //Can't steal from
md->state.steal_flag = UCHAR_MAX;
return 0;
}
// base skill success chance (percentual)
rate = (sd_status->dex - md_status->dex)/2 + skill_lv*6 + 4 + sd->bonus.add_steal_rate;
if( rate < 1 )
return 0;
// 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_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_MOB_DROP)
return 0;
itemid = md->db->dropitem[i].nameid;
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = itemid;
tmp_item.amount = 1;
tmp_item.identify = itemdb->isidentified2(data);
flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_PICKDROP_PLAYER);
//TODO: Should we disable stealing when the item you stole couldn't be added to your inventory? Perhaps players will figure out a way to exploit this behaviour otherwise?
//md->state.steal_flag = UCHAR_MAX; //you can't steal from this mob any more
if(flag) { //Failed to steal due to overweight
clif->additem(sd,0,0,flag);
return 0;
}
if(battle_config.show_steal_in_same_party)
party->foreachsamemap(pc->show_steal,sd,AREA_SIZE,sd,tmp_item.nameid);
//Logs items, Stolen from mobs [Lupus]
logs->pick_mob(md, LOG_TYPE_STEAL, -1, &tmp_item, data);
return 1;
}
Question
namerpus18
Notes
//=========================================================================
//** Do i need to change this value to 255?
//from "skill.c"
// How many times you could try to steal from a mob. // Note: It helps to avoid stealing exploit on monsters with few rare items // Use 0 to disable (Max allowed value is 255) skill_steal_max_tries: 0
//==========================================================================
//*==========================================
// How can i make it work that i can use steal until mob dies. You can obtain same items again and again. I dont know but i think there is this thing called "skill_steal_max success" that is located somewhere i cannot find that also limit the skill to be used only once per monster. And someone told me i need to make the conf to the "conf/import/battle.conf". I am planning to make a new skill from it.
Thank you so much, total noob here
//from "pc.c"
* Steal an item from bl (mob). * Return: * 0 = fail * 1 = succes *------------------------------------------*/ static int pc_steal_item(struct map_session_data *sd, struct block_list *bl, uint16 skill_lv) { int i,itemid,flag; int rate; struct status_data *sd_status, *md_status; struct mob_data *md = BL_CAST(BL_MOB, bl); struct item tmp_item; struct item_data *data = NULL; if (sd == NULL || md == NULL) return 0; if(md->state.steal_flag == UCHAR_MAX || ( md->sc.opt1 && md->sc.opt1 != OPT1_BURNING && md->sc.opt1 != OPT1_CRYSTALIZE ) ) //already stolen from / status change check return 0; sd_status= status->get_status_data(&sd->bl); md_status= status->get_status_data(bl); if (md->master_id || md_status->mode&MD_BOSS || mob_is_treasure(md) || map->list[bl->m].flag.nomobloot || // check noloot map flag [Lorky] (battle_config.skill_steal_max_tries && //Reached limit of steal attempts. [Lupus] md->state.steal_flag++ >= battle_config.skill_steal_max_tries) ) { //Can't steal from md->state.steal_flag = UCHAR_MAX; return 0; } // base skill success chance (percentual) rate = (sd_status->dex - md_status->dex)/2 + skill_lv*6 + 4 + sd->bonus.add_steal_rate; if( rate < 1 ) return 0; // 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_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_MOB_DROP) return 0; itemid = md->db->dropitem[i].nameid; memset(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = itemid; tmp_item.amount = 1; tmp_item.identify = itemdb->isidentified2(data); flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_PICKDROP_PLAYER); //TODO: Should we disable stealing when the item you stole couldn't be added to your inventory? Perhaps players will figure out a way to exploit this behaviour otherwise? //md->state.steal_flag = UCHAR_MAX; //you can't steal from this mob any more if(flag) { //Failed to steal due to overweight clif->additem(sd,0,0,flag); return 0; } if(battle_config.show_steal_in_same_party) party->foreachsamemap(pc->show_steal,sd,AREA_SIZE,sd,tmp_item.nameid); //Logs items, Stolen from mobs [Lupus] logs->pick_mob(md, LOG_TYPE_STEAL, -1, &tmp_item, data); return 1; }
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.