summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-17 14:16:11 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-17 14:16:11 +0000
commit9fe15c754250e48684ab93cf4b061eec2c512ec5 (patch)
tree236f1f15ec566d74704ebecdd957f3db69e3caf8 /src/map/pc.c
parentfe36467baa9508d99e166ca8c07509551215469c (diff)
downloadhercules-9fe15c754250e48684ab93cf4b061eec2c512ec5.tar.gz
hercules-9fe15c754250e48684ab93cf4b061eec2c512ec5.tar.bz2
hercules-9fe15c754250e48684ab93cf4b061eec2c512ec5.tar.xz
hercules-9fe15c754250e48684ab93cf4b061eec2c512ec5.zip
- Corrected atcommand @homstats so it shows the correct minimum/maximum possible values.
- Simplified the hom level up function, now decimal stats are no longer stored. This should correct eA's homunculus on average being much stronger than Aegis's. - Modified the homun db read code so it forces the "max" value to be higher than the "min". - Cleaned up pc_allskillup, @allskills should work correctly now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9664 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 665056fb7..97a2c5ca8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4528,37 +4528,38 @@ int pc_allskillup(struct map_session_data *sd)
nullpo_retr(0, sd);
for(i=0;i<MAX_SKILL;i++){
- sd->status.skill[i].id=0;
- if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ // cardスキルなら、
- sd->status.skill[i].lv=(sd->status.skill[i].flag==1)?0:sd->status.skill[i].flag-2; // 本?のlvに
- sd->status.skill[i].flag=0; // flagは0にしておく
+ if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){
+ sd->status.skill[i].lv=(sd->status.skill[i].flag==1)?0:sd->status.skill[i].flag-2;
+ sd->status.skill[i].flag=0;
+ if (!sd->status.skill[i].lv)
+ sd->status.skill[i].id=0;
}
}
- if (battle_config.gm_allskill > 0 && pc_isGM(sd) >= battle_config.gm_allskill){
- // 全てのスキル
+ //pc_calc_skilltree takes care of setting the ID to valid skills. [Skotlex]
+ if (battle_config.gm_allskill > 0 && pc_isGM(sd) >= battle_config.gm_allskill)
+ { //Get ALL skills except npc/guild ones. [Skotlex]
+ //and except SG_DEVIL [Komurka]
for(i=0;i<MAX_SKILL;i++){
- if(!(skill_get_inf2(i)&(INF2_NPC_SKILL|INF2_GUILD_SKILL))) //Get ALL skills except npc/guild ones. [Skotlex]
- if (i!=SG_DEVIL) //and except SG_DEVIL [Komurka]
- sd->status.skill[i].lv=skill_get_max(i); //Nonexistant skills should return a max of 0 anyway.
+ if(!(skill_get_inf2(i)&(INF2_NPC_SKILL|INF2_GUILD_SKILL)) && i!=SG_DEVIL)
+ sd->status.skill[i].lv=skill_get_max(i); //Nonexistant skills should return a max of 0 anyway.
}
}
- else {
+ else
+ {
int inf2;
for(i=0;i < MAX_SKILL_TREE && (id=skill_tree[sd->status.class_][i].id)>0;i++){
inf2 = skill_get_inf2(id);
- if(sd->status.skill[id].id==0 &&
- (!(inf2&INF2_QUEST_SKILL) || battle_config.quest_skill_learn) &&
- !(inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL)) &&
- (id!=SG_DEVIL))
- {
- sd->status.skill[id].id = id; // celest
- sd->status.skill[id].lv = skill_tree_get_max(id, sd->status.class_); // celest
- }
+ if (
+ (inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn) ||
+ (inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL)) ||
+ id==SG_DEVIL
+ )
+ continue; //Cannot be learned normally.
+ sd->status.skill[id].lv = skill_tree_get_max(id, sd->status.class_); // celest
}
}
status_calc_pc(sd,0);
-
return 0;
}