From e2d3ae9dc682afc1ac34a536006ef79370040b04 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 15 Jan 2007 21:45:19 +0000 Subject: - The NPC elemental attacks will display a skill animation again. - Mob instant cast skills will use their adelay now. - Spirit of Wizard won't work on Ganbantein - The pc normalize job function will consider you as novice if you don't have maxed out basic skill. - Cleaned up pc_calc_skilltree and related functions so that the id is left as 0 when you can't raise the skill even if you meet the prerequisites. This is to prevent raising quest/soul/marriage skills through packets. - Slaves should lock unto their master's target even if they are not attacking yet (eg: in chase mode) - Updated the Summon Slave skill to use the slave distance define as valid distance to spawn from master. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9656 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index 6b2ac287a..a9f0f4d67 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -959,7 +959,7 @@ int pc_calc_skilltree(struct map_session_data *sd) do { flag = 0; for(i = 0; i < MAX_SKILL_TREE && (id = skill_tree[c][i].id) > 0; i++) { - int j, f; + int j, f, inf2; if(sd->status.skill[id].id) continue; //Skill already known. @@ -974,19 +974,25 @@ int pc_calc_skilltree(struct map_session_data *sd) } if (sd->status.job_level < skill_tree[c][i].joblv) f = 0; // job level requirement wasn't satisfied - else if (pc_checkskill(sd, NV_BASIC) < 9 && id != NV_BASIC && !(skill_get_inf2(id)&INF2_QUEST_SKILL)) - f = 0; // Do not unlock normal skills when Basic Skill is not maxed out (can happen because of skill reset) } if (f) { + inf2 = skill_get_inf2(id); + + if(!sd->status.skill[id].lv && ( + (inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn) || + inf2&INF2_WEDDING_SKILL || + (inf2&INF2_SPIRIT_SKILL && !(sd->sc.count && sd->sc.data[SC_SPIRIT].timer != -1)) + )) + continue; //Cannot be learned via normal means. Note this check DOES allows raising already known skills. + sd->status.skill[id].id = id; - if(skill_get_inf2(id)&INF2_SPIRIT_SKILL && sd->sc.count && sd->sc.data[SC_SPIRIT].timer != -1) + if(inf2&INF2_SPIRIT_SKILL) { //Spirit skills cannot be learned, they will only show up on your tree when you get buffed. sd->status.skill[id].lv = 1; // need to manually specify a skill level sd->status.skill[id].flag = 1; //So it is not saved, and tagged as a "bonus" skill. } - flag = 1; // skill list has changed, perform another pass } } @@ -1046,9 +1052,14 @@ static void pc_check_skilltree(struct map_session_data *sd, int skill) { if (sd->status.job_level < skill_tree[c][i].joblv) continue; - if(skill_get_inf2(id)&INF2_SPIRIT_SKILL) - //Spirit skills cannot be learned - continue; + j = skill_get_inf2(id); + if(!sd->status.skill[id].lv && ( + (j&INF2_QUEST_SKILL && !battle_config.quest_skill_learn) || + j&INF2_WEDDING_SKILL || + (j&INF2_SPIRIT_SKILL && !(sd->sc.count && sd->sc.data[SC_SPIRIT].timer != -1)) + )) + continue; //Cannot be learned via normal means. + sd->status.skill[id].id=id; flag=1; } @@ -4484,7 +4495,7 @@ int pc_skillup(struct map_session_data *sd,int skill_num) if (skill_num < 0 || skill_num >= MAX_SKILL) return 0; - + if(sd->status.skill_point>0 && sd->status.skill[skill_num].id && sd->status.skill[skill_num].flag==0 && //Don't allow raising while you have granted skills. [Skotlex] -- cgit v1.2.3-60-g2f50