no, need copy only extrac condition check. And if condition true, just before return, call hookStop().
This call will prevent calling default function and any post hooks. I will show example only with pre hook function, without registration code.
void clif_parse_BankDepositPre(int *fdPtr, struct map_session_data **sdPtr)
{
int fd = *fdPtr;
struct map_session_data *sd = *sdPtr;
if ((pc_cant_act2(sd)) || (sd->state.vending) || (sd->npc_id) || (pc_istrading(sd)) || (sd->chat_id != 0)) {
clif->messagecolor_self(fd, 0xFF0000, "You are not able to deposit while acting.");
hookStop();
return;
}
}