check equip in battle.c

Tio Akima

New member
Messages
349
Points
0
Age
36
Discord
TioAkima#0636
Github
Tio Akima
Emulator
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 ..

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