According to this function in "unit.c" , what is the proper way to make a Blastmine Trap can be knocked back in GVG ?
/**
* Checks if unit can be knocked back / stopped by skills.
* @param bl: Object to check
* @param flag
* 0x1 - Offensive (not set: self skill, e.g. Backslide)
* 0x2 - Knockback type (not set: Stop type, e.g. Ankle Snare)
* 0x4 - Boss attack
* @return reason for immunity
* UB_KNOCKABLE - can be knocked back / stopped
* UB_NO_KNOCKBACK_MAP - at WOE/BG map
* UB_MD_KNOCKBACK_IMMUNE - target is MD_KNOCKBACK_IMMUNE
* UB_TARGET_BASILICA - target is in Basilica area
* UB_TARGET_NO_KNOCKBACK - target has 'special_state.no_knockback'
* UB_TARGET_TRAP - target is trap that cannot be knocked back
*/
enum e_unit_blown unit_blown_immune(struct block_list* bl, uint8 flag)
{
**** Say i would like to add a --- >CASE HT_BLASTMINE: TO return UB_KNOCKABLE -- HERE before GVG
if ((flag&0x1)
&& (map_flag_gvg2(bl->m) || map[bl->m].flag.battleground)
&& ((flag&0x2) || !(battle_config.skill_trap_type&0x1)))
return UB_NO_KNOCKBACK_MAP; // No knocking back in WoE / BG
switch (bl->type) {
case BL_MOB:
// Immune can't be knocked back
if (((flag&0x1) && status_bl_has_mode(bl,MD_KNOCKBACK_IMMUNE))
&& ((flag&0x2) || !(battle_config.skill_trap_type&0x2)))
return UB_MD_KNOCKBACK_IMMUNE;
break;
case BL_PC: {
struct map_session_data *sd = BL_CAST(BL_PC, bl);
// Basilica caster can't be knocked-back by normal monsters.
if( !(flag&0x4) && &sd->sc && sd->sc.data[SC_BASILICA] && sd->sc.data[SC_BASILICA]->val4 == sd->bl.id)
return UB_TARGET_BASILICA;
// Target has special_state.no_knockback (equip)
if( (flag&(0x1|0x2)) && sd->special_state.no_knockback )
return UB_TARGET_NO_KNOCKBACK;
}
break;
case BL_SKILL: {
struct skill_unit* su = (struct skill_unit *)bl;
// Trap cannot be knocked back
if (su && su->group && skill_get_unit_flag(su->group->skill_id)&UF_NOKNOCKBACK)
return UB_TARGET_TRAP;
}
break;
}
//Object can be knocked back / stopped
return UB_KNOCKABLE;
}
Question
SeaweedTH
According to this function in "unit.c" , what is the proper way to make a Blastmine Trap can be knocked back in GVG ?
/**
* Checks if unit can be knocked back / stopped by skills.
* @param bl: Object to check
* @param flag
* 0x1 - Offensive (not set: self skill, e.g. Backslide)
* 0x2 - Knockback type (not set: Stop type, e.g. Ankle Snare)
* 0x4 - Boss attack
* @return reason for immunity
* UB_KNOCKABLE - can be knocked back / stopped
* UB_NO_KNOCKBACK_MAP - at WOE/BG map
* UB_MD_KNOCKBACK_IMMUNE - target is MD_KNOCKBACK_IMMUNE
* UB_TARGET_BASILICA - target is in Basilica area
* UB_TARGET_NO_KNOCKBACK - target has 'special_state.no_knockback'
* UB_TARGET_TRAP - target is trap that cannot be knocked back
*/
enum e_unit_blown unit_blown_immune(struct block_list* bl, uint8 flag)
{
**** Say i would like to add a --- >CASE HT_BLASTMINE: TO return UB_KNOCKABLE -- HERE before GVG
if ((flag&0x1)
&& (map_flag_gvg2(bl->m) || map[bl->m].flag.battleground)
&& ((flag&0x2) || !(battle_config.skill_trap_type&0x1)))
return UB_NO_KNOCKBACK_MAP; // No knocking back in WoE / BG
switch (bl->type) {
case BL_MOB:
// Immune can't be knocked back
if (((flag&0x1) && status_bl_has_mode(bl,MD_KNOCKBACK_IMMUNE))
&& ((flag&0x2) || !(battle_config.skill_trap_type&0x2)))
return UB_MD_KNOCKBACK_IMMUNE;
break;
case BL_PC: {
struct map_session_data *sd = BL_CAST(BL_PC, bl);
// Basilica caster can't be knocked-back by normal monsters.
if( !(flag&0x4) && &sd->sc && sd->sc.data[SC_BASILICA] && sd->sc.data[SC_BASILICA]->val4 == sd->bl.id)
return UB_TARGET_BASILICA;
// Target has special_state.no_knockback (equip)
if( (flag&(0x1|0x2)) && sd->special_state.no_knockback )
return UB_TARGET_NO_KNOCKBACK;
}
break;
case BL_SKILL: {
struct skill_unit* su = (struct skill_unit *)bl;
// Trap cannot be knocked back
if (su && su->group && skill_get_unit_flag(su->group->skill_id)&UF_NOKNOCKBACK)
return UB_TARGET_TRAP;
}
break;
}
//Object can be knocked back / stopped
return UB_KNOCKABLE;
}
Link to comment
Share on other sites
0 answers 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.