Jump to content
  • 0

RG_STEALCOIN more than once


Question

Posted

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;
}

3 answers to this question

Recommended Posts

Posted

 

/*==========================================

* 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;

}

  • Upvote 1
Posted (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 by iraciz

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...