iraciz Posted January 20, 2015 Share Posted January 20, 2015 Well, I wonder if by any mean is it is possible to cast the skill more than once on the same enemy, and increase the steal money trigger not 1 but 3 times. I mean cast the skill 3 times and steal the money 3 times before the flag! thanks in advance /*========================================== * Stole zeny from bl (mob) * return * 0 = fail * 1 = success *------------------------------------------*/ int pc_steal_coin(struct map_session_data *sd,struct block_list *target) { int rate,skill; struct mob_data *md; if(!sd || !target || target->type != BL_MOB) return 0; md = (TBL_MOB*)target; if( md->state.steal_coin_flag || md->sc.data[SC_STONE] || md->sc.data[SC_FREEZE] || md->status.mode&MD_BOSS ) return 0; if( mob_is_treasure(md) ) return 0; // FIXME: This formula is either custom or outdated. skill = pc_checkskill(sd,RG_STEALCOIN)*10; rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2; if(rnd()%1000 < rate) { int amount = md->level*100 + rnd()%100; pc_getzeny(sd, amount, LOG_TYPE_STEAL, NULL); md->state.steal_coin_flag = 1; return 1; } return 0; } Quote Link to comment Share on other sites More sharing options...
Kichi Posted February 6, 2015 Share Posted February 6, 2015 /*========================================== * Stole zeny from bl (mob) * return * 0 = fail * 1 = success *------------------------------------------*/ int pc_steal_coin(struct map_session_data *sd,struct block_list *target) { int rate,skill; struct mob_data *md; if(!sd || !target || target->type != BL_MOB) return 0; md = (TBL_MOB*)target; if( md->state.steal_coin_flag || md->sc.data[SC_STONE] || md->sc.data[SC_FREEZE] || md->status.mode&MD_BOSS ) return 0; if( mob_is_treasure(md) ) return 0; // FIXME: This formula is either custom or outdated. skill = pc_checkskill(sd,RG_STEALCOIN)*10; rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2; if(rnd()%1000 < rate) { int amount = md->level*100 + rnd()%100; pc_getzeny(sd, amount, LOG_TYPE_STEAL, NULL); //md->state.steal_coin_flag = 1; return 1; } return 0; } 1 Quote Link to comment Share on other sites More sharing options...
iraciz Posted January 20, 2015 Author Share Posted January 20, 2015 (edited) · Hidden by Emistry, January 21, 2015 - Merged + Hidden duplicated contents. Hidden by Emistry, January 21, 2015 - Merged + Hidden duplicated contents. Well, I wonder if by any mean is it is possible to cast the skill more than once on the same enemy, and increase the steal money trigger not 1 but 3 times. I mean cast the skill 3 times and steal the money 3 times before the flag! thanks in advance /*==========================================* Stole zeny from bl (mob)* return* 0 = fail* 1 = success*------------------------------------------*/int pc_steal_coin(struct map_session_data *sd,struct block_list *target){ int rate,skill; struct mob_data *md; if(!sd || !target || target->type != BL_MOB) return 0; md = (TBL_MOB*)target; if( md->state.steal_coin_flag || md->sc.data[SC_STONE] || md->sc.data[SC_FREEZE] || md->status.mode&MD_BOSS ) return 0; if( mob_is_treasure(md) ) return 0; // FIXME: This formula is either custom or outdated. skill = pc_checkskill(sd,RG_STEALCOIN)*10; rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2; if(rnd()%1000 < rate) { int amount = md->level*100 + rnd()%100; pc_getzeny(sd, amount, LOG_TYPE_STEAL, NULL); md->state.steal_coin_flag = 1; return 1; } return 0;} Edited January 20, 2015 by iraciz Link to comment
iraciz Posted February 6, 2015 Author Share Posted February 6, 2015 this is awesome, thankyou so much. Quote Link to comment Share on other sites More sharing options...
Well, I wonder if by any mean is it is possible to cast the skill more than once on the same enemy, and increase the steal money trigger not 1 but 3 times. I mean cast the skill 3 times and steal the money 3 times before the flag! thanks in advance
/*========================================== * Stole zeny from bl (mob) * return * 0 = fail * 1 = success *------------------------------------------*/ int pc_steal_coin(struct map_session_data *sd,struct block_list *target) { int rate,skill; struct mob_data *md; if(!sd || !target || target->type != BL_MOB) return 0; md = (TBL_MOB*)target; if( md->state.steal_coin_flag || md->sc.data[SC_STONE] || md->sc.data[SC_FREEZE] || md->status.mode&MD_BOSS ) return 0; if( mob_is_treasure(md) ) return 0; // FIXME: This formula is either custom or outdated. skill = pc_checkskill(sd,RG_STEALCOIN)*10; rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2; if(rnd()%1000 < rate) { int amount = md->level*100 + rnd()%100; pc_getzeny(sd, amount, LOG_TYPE_STEAL, NULL); md->state.steal_coin_flag = 1; return 1; } return 0; }Link to comment
Share on other sites