summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-23 16:06:01 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-23 16:06:01 +0000
commit179bc795036bed253d82ab406db0cbf39cf28908 (patch)
treeb0e3124b6e13c6f48647812981cdcc152d1933c0 /src/map/skill.c
parentc61ca3727be3a366a593248a862f37063937fda2 (diff)
downloadhercules-179bc795036bed253d82ab406db0cbf39cf28908.tar.gz
hercules-179bc795036bed253d82ab406db0cbf39cf28908.tar.bz2
hercules-179bc795036bed253d82ab406db0cbf39cf28908.tar.xz
hercules-179bc795036bed253d82ab406db0cbf39cf28908.zip
- Modified the meaning of the third column in the skill_require_db. Instead of MaxHP, this is now called MaxHPTrigger. This column (which was previously unused by all skills) signals the limit HP% that you can have to be able to use the skill. For example, setting it to 20 means the skill is unusable if you have more than 20% life (not that this is merely a threshold setting, it won't actually substract HP when used!)
- Adjusted LK_BERSERK so you can only use it when you have 20% or less life. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9045 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index de0f9518b..27ad7d4c2 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -7887,8 +7887,12 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
itemid[i] = skill_db[j].itemid[i];
amount[i] = skill_db[j].amount[i];
}
- if(mhp > 0)
- hp += (status->max_hp * mhp)/100;
+ if(mhp > 0 && 100 * status->hp / status->max_hp > mhp) {
+ //mhp is the max-hp-requirement, that is,
+ //you must have this % or less of HP to cast it.
+ clif_skill_fail(sd,skill,2,0);
+ return 0;
+ }
if(hp_rate > 0)
hp += (status->hp * hp_rate)/100;
else