diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-09 19:48:50 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-09 19:48:50 +0000 |
commit | b84f8eb92e9a6d93e34dc4a6b8127f92998b36f1 (patch) | |
tree | 185ea70bdb0bc99e15f09fec3d7e36951ab64793 | |
parent | 6b2019eb1d741abd4dad3f52534cbeeb3bdf2615 (diff) | |
download | hercules-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
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | src/map/pc.c | 29 |
2 files changed, 17 insertions, 13 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 4639fc6b4..3a2d3fe72 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/09
+ * Fixed pc_damage_sp not properly substracting SP. [Skotlex]
* Made Magic Crasher a BF_WEAPON attack. [Skotlex]
* Made skill_unit_range a per-level setting. meteor and Lov now have their
unit range for bosses adjusted in the skill_unit_db rather than
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にダメ?ジを?える
|