hi, i made a skill to send the clone generated by the player to attack a target. (order to attack a target).
I did a custom function, where I return the clone ID on the map.
And so, give him an order.
But, I do not know if it is correct to go this way, or if there is any other necessary procedure
case CLONE_ATTACK:{int c =0;int clone_id =0;int maxcount =1;map->foreachinmap(skill->check_condition_clone, sd->bl.m, BL_MOB, sd->bl.id,&c ,&clone_id );// clone search on the map//ShowWarning("clone_id: %d\n", clone_id); //debugif( c < maxcount ){//if no clones are found
clif->skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION,0,0);map->freeblock_unlock();return0;}struct block_list* mbl =map->id2bl(clone_id);//takes the clone id and converts it to a blstruct unit_data *ud = unit->bl2ud(mbl);//take the bl and convert it to a unit//nullpo_ret(mbl);//nullpo_ret(ud); if(ud){
unit->set_target(ud, bl->id);//set a target
unit->attack(mbl, bl->id, ud->state.attack_continue);// Execute normal attack}}
hi, i made a skill to send the clone generated by the player to attack a target. (order to attack a target).
I did a custom function, where I return the clone ID on the map.
And so, give him an order.
But, I do not know if it is correct to go this way, or if there is any other necessary procedure
suggestions?
@EDIT: Solved
Edited by Tio AkimaShare this post
Link to post
Share on other sites