I have found this code in unit.c and I was wondering how to apply the delay motion to the mvp and all the other Monsters?
I want them to Not completely stop by hit lock, But at least!, make them snipeable without reaching the player too quick.
In battle/monster.conf the conf monster_damage_delay_rate: 100 is useless, Since it only is applied to the very first hit.
So don't give me taht answer,
The code bellow I brought has the clue, unfortunately I don't know c+
what I understood is that, the damage delay is applied, but after that delay there is a timer that make the mobs invincible or immune to this delay, meaning that for a certain period after receiving damage, they will move under attacks towards you without stopping.
What I want to do, is make this immunity time shorter, because the longer imume to damage induced walk delay, the must cells they snap towards you.
Damage delay 200 ms, good, and after that, 100 ms ignore the damage delay, So when they are under fire they can aproach you step by step, and not by snaping 4 o 5 cells at a time, but without locking them, you got me?
can anyone help me to set that?
/**
* Applies a walk delay to a unit
* @param bl: Object to apply walk delay to
* @param tick: Current tick
* @param delay: Amount of time to set walk delay
* @param type: Type of delay
* 0: Damage induced delay; Do not change previous delay
* 1: Skill induced delay; Walk delay can only be increased, not decreased
* @return Success(1); Fail(0);
*/int unit_set_walkdelay(struct block_list *bl, t_tick tick, t_tick delay,int type){struct unit_data *ud = unit_bl2ud(bl);if(delay <=0||!ud)return0;if(type){//Bosses can ignore skill induced walkdelay (but not damage induced)if(bl->type == BL_MOB && status_has_mode(status_get_status_data(bl),MD_STATUS_IMMUNE))return0;//Make sure walk delay is not decreasedif(DIFF_TICK(ud->canmove_tick, tick+delay)>0)return0;}else{// Don't set walk delays when already trapped.if(!unit_can_move(bl)){
unit_stop_walking(bl,4);//Unit might still be moving even though it can't movereturn0;}//Immune to being stopped for double the flinch timeif(DIFF_TICK(ud->canmove_tick, tick-delay)>0)return0;}
ud->canmove_tick = tick + delay;if(ud->walktimer != INVALID_TIMER){// Stop walking, if chasing, readjust timers.if(delay ==1)// Minimal delay (walk-delay) disabled. Just stop walking.
unit_stop_walking(bl,0);else{// Resume running after can move again [Kevin]if(ud->state.running)
add_timer(ud->canmove_tick, unit_resume_running, bl->id,(intptr_t)ud);else{
unit_stop_walking(bl,4);if(ud->target)
add_timer(ud->canmove_tick+1, unit_walktobl_sub, bl->id, ud->target);}}}return1;}
Question
iraciz
I have found this code in unit.c and I was wondering how to apply the delay motion to the mvp and all the other Monsters?
I want them to Not completely stop by hit lock, But at least!, make them snipeable without reaching the player too quick.
In battle/monster.conf the conf monster_damage_delay_rate: 100 is useless, Since it only is applied to the very first hit.
So don't give me taht answer,
The code bellow I brought has the clue, unfortunately I don't know c+
what I understood is that, the damage delay is applied, but after that delay there is a timer that make the mobs invincible or immune to this delay, meaning that for a certain period after receiving damage, they will move under attacks towards you without stopping.
What I want to do, is make this immunity time shorter, because the longer imume to damage induced walk delay, the must cells they snap towards you.
Damage delay 200 ms, good, and after that, 100 ms ignore the damage delay, So when they are under fire they can aproach you step by step, and not by snaping 4 o 5 cells at a time, but without locking them, you got me?
can anyone help me to set that?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.