diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-06-12 02:09:55 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-06-12 02:09:55 +0000 |
commit | 8f5a2dddd09352b8618fbec8c4f4d9934601bec2 (patch) | |
tree | f24984dda14c0d6edd4bf1160caedc080dbf005d /src/map/pc.c | |
parent | 9cf756c11d39101b139ed585e4d5891768a20a45 (diff) | |
download | hercules-8f5a2dddd09352b8618fbec8c4f4d9934601bec2.tar.gz hercules-8f5a2dddd09352b8618fbec8c4f4d9934601bec2.tar.bz2 hercules-8f5a2dddd09352b8618fbec8c4f4d9934601bec2.tar.xz hercules-8f5a2dddd09352b8618fbec8c4f4d9934601bec2.zip |
Added new bonus as per kenpachi's request: bonus2 bUseSPrateSkill,n,x; // Reduced increases/reduced the SP consumption of skilln by x%. (supports skill names)
e.g. bonus2 bUseSPrateSkill,"AL_BLESSING",50; -> increases AL_BLESSING sp usage by 50% (e.g. if its 50 it goes to 75)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16273 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 1d7e2c9d5..b7f4a965e 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3046,6 +3046,21 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) if(sd->state.lr_flag != 2) sd->hp_gain_race_attack[type2] = cap_value(sd->hp_gain_race_attack[type2] + val, 0, INT16_MAX); break; + case SP_SP_RATE_SKILL: //bonus2 bUseSPrateSkill,n,x; + if(sd->state.lr_flag == 2) + break; + ARR_FIND(0, ARRAYLENGTH(sd->sprateskill), i, sd->sprateskill[i].id == 0 || sd->sprateskill[i].id == type2); + if (i == ARRAYLENGTH(sd->sprateskill)) { + ShowDebug("run_script: bonus2 bUseSPrateSkill reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->sprateskill), type2, val); + break; + } + if (sd->sprateskill[i].id == type2) + sd->sprateskill[i].val += val; + else { + sd->sprateskill[i].id = type2; + sd->sprateskill[i].val = val; + } + break; default: ShowWarning("pc_bonus2: unknown type %d %d %d!\n",type,type2,val); break; @@ -6083,6 +6098,16 @@ int pc_skillatk_bonus(struct map_session_data *sd, int skill_num) return bonus; } +inline int pc_sp_rate_skill(struct map_session_data *sd, int skill_num) { + int i, bonus = 100; + + ARR_FIND(0, ARRAYLENGTH(sd->sprateskill), i, sd->sprateskill[i].id == skill_num); + if( i < ARRAYLENGTH(sd->sprateskill) ) + bonus += sd->sprateskill[i].val; + + return bonus; +} + int pc_skillheal_bonus(struct map_session_data *sd, int skill_num) { int i, bonus = sd->bonus.add_heal_rate; |