summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-09 19:48:50 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-09 19:48:50 +0000
commitb84f8eb92e9a6d93e34dc4a6b8127f92998b36f1 (patch)
tree185ea70bdb0bc99e15f09fec3d7e36951ab64793 /src
parent6b2019eb1d741abd4dad3f52534cbeeb3bdf2615 (diff)
downloadhercules-b84f8eb92e9a6d93e34dc4a6b8127f92998b36f1.tar.gz
hercules-b84f8eb92e9a6d93e34dc4a6b8127f92998b36f1.tar.bz2
hercules-b84f8eb92e9a6d93e34dc4a6b8127f92998b36f1.tar.xz
hercules-b84f8eb92e9a6d93e34dc4a6b8127f92998b36f1.zip
- Now you can't raise levels on an acquired skill when that skill is currently an acquired skill.
- Fixed pc_damage_sp not properly substracting SP. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5537 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/pc.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 549f7678c..58879802b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4910,14 +4910,16 @@ int pc_skillup(struct map_session_data *sd,int skill_num)
{
nullpo_retr(0, sd);
- if( skill_num>=10000 ){
+ if( skill_num>=GD_SKILLBASE){
guild_skillup(sd,skill_num,0);
return 0;
}
-
- if( sd->status.skill_point>0 &&
- sd->status.skill[skill_num].id!=0 &&
- //sd->status.skill[skill_num].lv < skill_get_max(skill_num) ) - celest
+ 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]
sd->status.skill[skill_num].lv < skill_tree_get_max(skill_num, sd->status.class_) )
{
sd->status.skill[skill_num].lv++;
@@ -5197,6 +5199,7 @@ static int pc_respawn(int tid,unsigned int tick,int id,int data)
/*==========================================
* Damages a player's SP, returns remaining SP. [Skotlex]
* damage is absolute damage, rate is % damage (100 = 100%)
+ * if rate is positive, it is % of current sp, if negative, it is % of max
* Returns remaining SP, or -1 if the player did not have enough SP to substract from.
*------------------------------------------
*/
@@ -5205,20 +5208,20 @@ int pc_damage_sp(struct map_session_data *sd, int damage, int rate)
if (!sd->status.sp)
return 0;
- if (rate)
- damage += (rate*(sd->status.sp-damage)/sd->status.max_sp)/100;
+ if (rate > 0)
+ damage += (rate*sd->status.sp)/100;
+ else if (rate < 0)
+ damage -= (rate*sd->status.max_sp)/100;
+
if (sd->status.sp >= damage){
sd->status.sp -= damage;
clif_updatestatus(sd,SP_SP);
return sd->status.sp;
}
- if (sd->status.sp) {
- sd->status.sp = 0;
- clif_updatestatus(sd,SP_SP);
- return -1;
- }
- return 0;
+ sd->status.sp = 0;
+ clif_updatestatus(sd,SP_SP);
+ return -1;
}
/*==========================================
* pcにダメ?ジを?える