Jump to content
  • 0
Tio Akima

check equip in battle.c

Question

Hello guys
I'm trying to check if the player is donning a certain equipment by hitting a particular MOB.

I can not do the check, someone can help me ..

I'm trying something like this.
in file battle.c

Within function battle_check_target()

        int hand1,hand2 = 0;
        int item_id = 1201;

if(src->type==BL_PC){
        sd = BL_UCCAST(BL_PC,src);
        hand1 = pc->checkequip(sd,script->equip[8]);
        hand2 = pc->checkequip(sd,script->equip[9]);
    }

Condition when hitting mob

if(BL_UCCAST(BL_MOB, t_bl)->class_ == 1002 && (hand1 == item_id || hand2 == item_id)){
state |= BCT_ENEMY; //Natural enemy. 
}

But ... The equipment check is not correct, can anyone help me?

I believe the logic is this ..

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
2 hours ago, Easycore said:

hand1 = sd->status.inventory[sd->equip_index[EQI_HAND_L]].nameid;
hand2 = sd->status.inventory[sd->equip_index[EQI_HAND_R]].nameid;

 

Thankyou Easycore It worked!
Solved!

Share this post


Link to post
Share on other sites

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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.