summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-29 20:51:07 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-29 20:51:07 +0000
commit085ec7da7865711d855bb4664afc7a4b820ce37c (patch)
tree1e7689fef3143c9a76e55254181d1dc9bd2efd56 /src/map/pc.c
parent571ce8ac8aed5b8373cdb722cc54589e28f4c4b1 (diff)
downloadhercules-085ec7da7865711d855bb4664afc7a4b820ce37c.tar.gz
hercules-085ec7da7865711d855bb4664afc7a4b820ce37c.tar.bz2
hercules-085ec7da7865711d855bb4664afc7a4b820ce37c.tar.xz
hercules-085ec7da7865711d855bb4664afc7a4b820ce37c.zip
- pc_resetskill flag can now be &2, it only returns the total amount of skill points spent, it doesn't does a reset.
- added script command skillpointcount. Returns total amount of skill points a char has (the value returned is the same that SkillPoint would have after invoking a skill reset) - Modified Defender. Speed reduction is 35-5*lv%, damage reduction on devoted chars is 5+5*lv%. These values are custom, but should be closer to "reality" than what we have. - When you have the wrong ammo type equipped, the equip arrows first message will be sent, as suggested by Haplo git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6384 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index a524ca669..a4db9bcfa 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4370,7 +4370,8 @@ int pc_resetstate(struct map_session_data* sd)
/*==========================================
* /resetskill
- * if flag is 1, perform block resync and status_calc call.
+ * if flag&1, perform block resync and status_calc call.
+ * if flag&2, just count total amount of skill points used by player, do not really reset.
*------------------------------------------
*/
int pc_resetskill(struct map_session_data* sd, int flag)
@@ -4391,10 +4392,12 @@ int pc_resetskill(struct map_session_data* sd, int 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);
- sd->status.skill[i].lv = 0;
- sd->status.skill[i].flag = 0;
+ 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))
+ else if (battle_config.quest_skill_reset && (inf2&INF2_QUEST_SKILL) && !(flag&2))
{
sd->status.skill[i].lv = 0;
sd->status.skill[i].flag = 0;
@@ -4404,18 +4407,19 @@ int pc_resetskill(struct map_session_data* sd, int flag)
}
}
- if (sd->status.skill_point > USHRT_MAX - skill_point)
- sd->status.skill_point = USHRT_MAX;
- else
- sd->status.skill_point += skill_point;
+ 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) {
- clif_updatestatus(sd,SP_SKILLPOINT);
- clif_skillinfoblock(sd);
- status_calc_pc(sd,0);
+ if (flag&1) {
+ clif_updatestatus(sd,SP_SKILLPOINT);
+ clif_skillinfoblock(sd);
+ status_calc_pc(sd,0);
+ }
}
-
- return 0;
+ return skill_point;
}
/*==========================================