I know that pc_checkskill works on players to find out what level of a skill they have learned (if at all), and I'm looking for a similar function for mobs. If one doesn't exist, does anyone know the path the src would check? Is it something like "mob_skill[skill_id].skill_lv"? I tried coding:
int skill_checklevel(struct block_list *src, uint16 skill_id) {
if (src->type == BL_MOB){
struct mob_data *md = (struct mob_data*)src;
struct mob_skill *ms;
int i;
int level = 0;
nullpo_ret(ms = md->db->skill);
for (i = 0; i < MAX_MOBSKILL; i++){
if(ms[i].skill_id == skill_id){
level = ms[i].skill_lv;
break;
}
else{
level = 0;
}
}
return level;
}
}
And it didn't work. I've also tried a few other variations, and they didn't work either. If I knew the path the src followed, I could probably figure it out, but I haven't yet. I want to be able to make passive boosts for mobs based on skill level known, but have been stumped.
Question
Humble_Bee
I know that pc_checkskill works on players to find out what level of a skill they have learned (if at all), and I'm looking for a similar function for mobs. If one doesn't exist, does anyone know the path the src would check? Is it something like "mob_skill[skill_id].skill_lv"? I tried coding:
int skill_checklevel(struct block_list *src, uint16 skill_id) { if (src->type == BL_MOB){ struct mob_data *md = (struct mob_data*)src; struct mob_skill *ms; int i; int level = 0; nullpo_ret(ms = md->db->skill); for (i = 0; i < MAX_MOBSKILL; i++){ if(ms[i].skill_id == skill_id){ level = ms[i].skill_lv; break; } else{ level = 0; } } return level; } }
And it didn't work. I've also tried a few other variations, and they didn't work either. If I knew the path the src followed, I could probably figure it out, but I haven't yet. I want to be able to make passive boosts for mobs based on skill level known, but have been stumped.
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.