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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

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