summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-15 21:45:19 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-15 21:45:19 +0000
commite2d3ae9dc682afc1ac34a536006ef79370040b04 (patch)
tree44e74037c0f5645b1e8d56ae6b2c9fdb602e9e05 /src/map/pc.c
parent065f2203b8aa2140e55c0ef62ad0ad2e5ea4d088 (diff)
downloadhercules-e2d3ae9dc682afc1ac34a536006ef79370040b04.tar.gz
hercules-e2d3ae9dc682afc1ac34a536006ef79370040b04.tar.bz2
hercules-e2d3ae9dc682afc1ac34a536006ef79370040b04.tar.xz
hercules-e2d3ae9dc682afc1ac34a536006ef79370040b04.zip
- 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
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c29
1 files changed, 20 insertions, 9 deletions
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]