summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-03 03:05:43 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-03 03:05:43 +0000
commitf68bd7c915dc631d452b6ea2ac21cdf75bc26fe4 (patch)
treeff8a979363dccf37f3bfb66be4f24cf2d89027e4 /src/map/pc.c
parent350416fff4bb9e8bc50b5f8205d04f772e848a92 (diff)
downloadhercules-f68bd7c915dc631d452b6ea2ac21cdf75bc26fe4.tar.gz
hercules-f68bd7c915dc631d452b6ea2ac21cdf75bc26fe4.tar.bz2
hercules-f68bd7c915dc631d452b6ea2ac21cdf75bc26fe4.tar.xz
hercules-f68bd7c915dc631d452b6ea2ac21cdf75bc26fe4.zip
- Fixed pc_calc_skilltree ignoring prerequisites / joblvl requirements.
- Re-applied change r9593 that got accidentally reverted by r9595. - Added the official behavior of monsters regaining full hp when they morph. - Added support for text/comments at the end of monster spawn lines (<tab> required) - Silenced the debug message in socket.c that's been freaking people out. - Modified the useless error message in atcommand_effect. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9608 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index eba537d9f..f0eb54ad6 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -918,6 +918,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
if (sd->status.skill[i].flag != 13) //Don't touch plagiarized skills
sd->status.skill[i].id=0; //First clear skills.
}
+
for(i=0;i<MAX_SKILL;i++){
if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ //Restore original level of skills after deleting earned skills.
sd->status.skill[i].lv=(sd->status.skill[i].flag==1)?0:sd->status.skill[i].flag-2;
@@ -946,41 +947,43 @@ int pc_calc_skilltree(struct map_session_data *sd)
}
return 0;
}
+
do {
- flag=0;
- for(i=0;i < MAX_SKILL_TREE && (id=skill_tree[c][i].id)>0;i++){
- int j,f=1;
+ flag = 0;
+ for(i = 0; i < MAX_SKILL_TREE && (id = skill_tree[c][i].id) > 0; i++) {
+ int j, f;
+
if(sd->status.skill[id].id)
continue; //Skill already known.
+
+ f = 1;
if(!battle_config.skillfree) {
- for(j=0;j<5;j++) {
- if( skill_tree[c][i].need[j].id &&
- pc_checkskill(sd,skill_tree[c][i].need[j].id) <
- skill_tree[c][i].need[j].lv) {
- f=0;
+ for(j = 0; j < 5; j++) {
+ if( skill_tree[c][i].need[j].id && pc_checkskill(sd,skill_tree[c][i].need[j].id) < skill_tree[c][i].need[j].lv) {
+ f = 0; // one or more prerequisites wasn't satisfied
break;
}
}
if (sd->status.job_level < skill_tree[c][i].joblv)
- f=0;
+ 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 Skills is not maxed out (can happen because of skill reset)
+ f = 0; // Do not unlock normal skills when Basic Skill is not maxed out (can happen because of skill reset)
}
- if(skill_get_inf2(id)&INF2_SPIRIT_SKILL)
- { //Spirit skills cannot be learned, they will only show up on your tree when you get buffed.
- if (sd->sc.count && sd->sc.data[SC_SPIRIT].timer != -1)
- { //Enable Spirit Skills. [Skotlex]
- sd->status.skill[id].id=id;
- sd->status.skill[id].lv=1;
- sd->status.skill[id].flag=1; //So it is not saved, and tagged as a "bonus" skill.
- flag=1;
+
+ if (f) {
+ sd->status.skill[id].id = id;
+
+ if(skill_get_inf2(id)&INF2_SPIRIT_SKILL && sd->sc.count && sd->sc.data[SC_SPIRIT].timer != -1)
+ { //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.
}
- } else if (f){
- sd->status.skill[id].id=id;
- flag=1;
+
+ flag = 1; // skill list has changed, perform another pass
}
}
} while(flag);
+
if ((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc_famerank(sd->status.char_id, MAPID_TAEKWON)) {
//Grant all Taekwon Tree, but only as bonus skills in case they drop from ranking. [Skotlex]
for(i=0;i < MAX_SKILL_TREE && (id=skill_tree[c][i].id)>0;i++){