Tio Akima 74 Posted August 17, 2017 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 .. Quote Share this post Link to post Share on other sites
0 Easycore 31 Posted August 17, 2017 hand1 = sd->status.inventory[sd->equip_index[EQI_HAND_L]].nameid; hand2 = sd->status.inventory[sd->equip_index[EQI_HAND_R]].nameid; 1 Tio Akima reacted to this Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted August 17, 2017 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! Quote Share this post Link to post Share on other sites
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