summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-01 18:34:05 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-01 18:34:05 +0000
commit293439505d1fef24ca1596ee034d1897dc30ae0b (patch)
treeba15f0339f0421d1ec7cbef1fdde4905adf37554 /src/map/pc.c
parent2f3928c61a4b13eeb29a0a66802b7d334f319af3 (diff)
downloadhercules-293439505d1fef24ca1596ee034d1897dc30ae0b.tar.gz
hercules-293439505d1fef24ca1596ee034d1897dc30ae0b.tar.bz2
hercules-293439505d1fef24ca1596ee034d1897dc30ae0b.tar.xz
hercules-293439505d1fef24ca1596ee034d1897dc30ae0b.zip
- Corrected homunculus's aspd being halved after using some aspd adjusting skill.
- Cleaned up the resetskill function (even though the functionality is the same as before) - Corrected item 1459 (unused Partizan with no slots) being wlv3 instead of 2 (as the other two partizans) - Changed the name of the four second versions of homunculi to not have a 2. (so you get a 'lif' and not a 'lif2' - Removed flag graffiti from abracadabra - Updated the stun times of Bash, Npc-StunAttack and meteor Assault to 5 secs as reported by Ultra Mage (still pending more data to see if all others need updating as well) - Removed the log info message 'created homunc...', and the 'loaded homunc' message will only show if the save_log is enabled. - Some cleanups git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9760 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c62
1 files changed, 33 insertions, 29 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 9b4b9698d..ecd82369c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4717,48 +4717,52 @@ int pc_resetstate(struct map_session_data* sd)
*/
int pc_resetskill(struct map_session_data* sd, int flag)
{
- int i, skill, inf2, skill_point=0;
+ int i, lv, inf2, skill_point=0;
nullpo_retr(0, sd);
if (pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd))
clif_status_load(&sd->bl, SI_DEVIL, 0); //Remove perma blindness due to skill-reset. [Skotlex]
for (i = 1; i < MAX_SKILL; i++) {
- if ((skill = sd->status.skill[i].lv) > 0) {
- inf2 = skill_get_inf2(i);
- if ((!(inf2&INF2_QUEST_SKILL) || battle_config.quest_skill_learn) &&
- !(inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL))) //Avoid reseting wedding/linker skills.
- {
- if (!sd->status.skill[i].flag)
- skill_point += skill;
- else if (sd->status.skill[i].flag > 2 && sd->status.skill[i].flag != 13)
- skill_point += (sd->status.skill[i].flag - 2);
- if (!(flag&2)) {
- sd->status.skill[i].lv = 0;
- sd->status.skill[i].flag = 0;
- }
- }
- else if (battle_config.quest_skill_reset && (inf2&INF2_QUEST_SKILL) && !(flag&2))
- {
+ lv= sd->status.skill[i].lv;
+ if (lv < 1) continue;
+
+ inf2 = skill_get_inf2(i);
+
+ if(inf2&(INF2_WEDDING_SKILL|INF2_SPIRIT_SKILL)) //Avoid reseting wedding/linker skills.
+ continue;
+
+ if (inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn)
+ { //Only handle quest skills in a special way when you can't learn them manually
+ if (battle_config.quest_skill_reset && !(flag&2))
+ { //Wipe them
sd->status.skill[i].lv = 0;
sd->status.skill[i].flag = 0;
}
- } else {
+ continue;
+ }
+ if (!sd->status.skill[i].flag)
+ skill_point += lv;
+ else if (sd->status.skill[i].flag > 2 && sd->status.skill[i].flag != 13)
+ skill_point += (sd->status.skill[i].flag - 2);
+
+ if (!(flag&2)) {
sd->status.skill[i].lv = 0;
+ sd->status.skill[i].flag = 0;
}
}
- if (!(flag&2)) {
- if (sd->status.skill_point > USHRT_MAX - skill_point)
- sd->status.skill_point = USHRT_MAX;
- else
- sd->status.skill_point += skill_point;
-
- if (flag&1) {
- clif_updatestatus(sd,SP_SKILLPOINT);
- clif_skillinfoblock(sd);
- status_calc_pc(sd,0);
- }
+ if (flag&2 || !skill_point) return skill_point;
+
+ if (sd->status.skill_point > USHRT_MAX - skill_point)
+ sd->status.skill_point = USHRT_MAX;
+ else
+ sd->status.skill_point += skill_point;
+
+ if (flag&1) {
+ clif_updatestatus(sd,SP_SKILLPOINT);
+ clif_skillinfoblock(sd);
+ status_calc_pc(sd,0);
}
return skill_point;
}