Okay, nothing that I can't do.
Try this, if doesn't work, post here the errors.
int unit_attack(struct block_list *src,int target_id,int continuous)
{
struct block_list *target;
struct unit_data *ud;
struct mob_data* md;
nullpo_ret(ud = unit_bl2ud(src));
target = map_id2bl(target_id);
md = BL_CAST(BL_MOB, target);
if( target==NULL || status_isdead(target) )
{
unit_unattackable(src);
return 1;
}
if( src->type == BL_PC )
{
TBL_PC* sd = (TBL_PC*)src;
if( target->type == BL_NPC )
{ // monster npcs [Valaris]
npc_click(sd,(TBL_NPC*)target); // submitted by leinsirk10 [Celest]
return 0;
}
if( pc_is90overweight(sd) )
{ // overweight - stop attacking
unit_stop_attack(src);
return 0;
}
if (pc_isequipped(sd, 23310) && md->mob_id != 1002) {
clif_displaymessage(sd->fd, "You can only attack a crystal while on mining form.");
unit_stop_attack(src);
return 0;
}
}
}