Jump to content
  • 0

Mobs immune to skills


Question

Posted

Hi,

i want to have a mob, that will get no damage by skills.

I tried this: http://www.eathena.w...ndpost&p=927155

And I tried using parts of the function battle_calc_gvg_damage (in src/map/battle.c):

int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv)
{
struct map_session_data *sd = NULL;
struct status_change *sc;
struct status_change_entry *sce;
int div_ = d->div_, flag = d->flag;
//## Mob-Skillimmune START
int class_ = status_get_class(bl);
//## Mob-Skillimmune END
	nullpo_ret(bl);
	if( !damage )
			return 0;
//## Mob-Skillimmune START
  if (class_ == 2993 && flag&BF_SKILL)
		  return 0;
//## Mob-Skillimmune END
if( mob_ksprotected(src, bl) )
 return 0;

But the special mob (ID 2993) gets still damage from skills like Jupitel Thunder.

Does anyone have a idea to make this mob immune to all skills?

8 answers to this question

Recommended Posts

Posted

Thanks for this tip.

With a poring (ID 1002) it works well, too.

I think it will not work with mobs that are made as a sprite-copy via db/mob_avail.txt. So I will change my special mob to a real mob with real sprite.

Posted

yeah goddameit right. Your code fine but you get the wrong class_ here; put a breakpoint on it and you'll see that it wasn't the id you expect.

You should have take ((TBL_MOB*)bl)->class_ instead.

Also don't have the code here but if I recall there already a place who parse skills to see wheater or not inflict dammage (check on MOBID_EMPERIUM)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...