summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-12 02:09:55 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-12 02:09:55 +0000
commit8f5a2dddd09352b8618fbec8c4f4d9934601bec2 (patch)
treef24984dda14c0d6edd4bf1160caedc080dbf005d /src/map/script.c
parent9cf756c11d39101b139ed585e4d5891768a20a45 (diff)
downloadhercules-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/script.c')
-rw-r--r--src/map/script.c103
1 files changed, 51 insertions, 52 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 5bd55e106..d1ff921c5 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -7320,63 +7320,62 @@ BUILDIN_FUNC(bonus)
return 0; // no player attached
type = script_getnum(st,2);
- switch( type )
- {
- case SP_AUTOSPELL:
- case SP_AUTOSPELL_WHENHIT:
- case SP_AUTOSPELL_ONSKILL:
- case SP_SKILL_ATK:
- case SP_SKILL_HEAL:
- case SP_SKILL_HEAL2:
- case SP_ADD_SKILL_BLOW:
- case SP_CASTRATE:
- case SP_ADDEFF_ONSKILL:
- // these bonuses support skill names
- val1 = ( script_isstring(st,3) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
- break;
- default:
- val1 = script_getnum(st,3);
- break;
+ switch( type ) {
+ case SP_AUTOSPELL:
+ case SP_AUTOSPELL_WHENHIT:
+ case SP_AUTOSPELL_ONSKILL:
+ case SP_SKILL_ATK:
+ case SP_SKILL_HEAL:
+ case SP_SKILL_HEAL2:
+ case SP_ADD_SKILL_BLOW:
+ case SP_CASTRATE:
+ case SP_ADDEFF_ONSKILL:
+ case SP_SP_RATE_SKILL:
+ // these bonuses support skill names
+ val1 = ( script_isstring(st,3) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
+ break;
+ default:
+ val1 = script_getnum(st,3);
+ break;
}
- switch( script_lastdata(st)-2 )
- {
- case 1:
- pc_bonus(sd, type, val1);
- break;
- case 2:
- val2 = script_getnum(st,4);
- pc_bonus2(sd, type, val1, val2);
- break;
- case 3:
- val2 = script_getnum(st,4);
- val3 = script_getnum(st,5);
- pc_bonus3(sd, type, val1, val2, val3);
- break;
- case 4:
- if( type == SP_AUTOSPELL_ONSKILL && script_isstring(st,4) )
- val2 = skill_name2id(script_getstr(st,4)); // 2nd value can be skill name
- else
+ switch( script_lastdata(st)-2 ) {
+ case 1:
+ pc_bonus(sd, type, val1);
+ break;
+ case 2:
val2 = script_getnum(st,4);
-
- val3 = script_getnum(st,5);
- val4 = script_getnum(st,6);
- pc_bonus4(sd, type, val1, val2, val3, val4);
- break;
- case 5:
- if( type == SP_AUTOSPELL_ONSKILL && script_isstring(st,4) )
- val2 = skill_name2id(script_getstr(st,4)); // 2nd value can be skill name
- else
+ pc_bonus2(sd, type, val1, val2);
+ break;
+ case 3:
val2 = script_getnum(st,4);
+ val3 = script_getnum(st,5);
+ pc_bonus3(sd, type, val1, val2, val3);
+ break;
+ case 4:
+ if( type == SP_AUTOSPELL_ONSKILL && script_isstring(st,4) )
+ val2 = skill_name2id(script_getstr(st,4)); // 2nd value can be skill name
+ else
+ val2 = script_getnum(st,4);
- val3 = script_getnum(st,5);
- val4 = script_getnum(st,6);
- val5 = script_getnum(st,7);
- pc_bonus5(sd, type, val1, val2, val3, val4, val5);
- break;
- default:
- ShowDebug("buildin_bonus: unexpected number of arguments (%d)\n", (script_lastdata(st) - 1));
- break;
+ val3 = script_getnum(st,5);
+ val4 = script_getnum(st,6);
+ pc_bonus4(sd, type, val1, val2, val3, val4);
+ break;
+ case 5:
+ if( type == SP_AUTOSPELL_ONSKILL && script_isstring(st,4) )
+ val2 = skill_name2id(script_getstr(st,4)); // 2nd value can be skill name
+ else
+ val2 = script_getnum(st,4);
+
+ val3 = script_getnum(st,5);
+ val4 = script_getnum(st,6);
+ val5 = script_getnum(st,7);
+ pc_bonus5(sd, type, val1, val2, val3, val4, val5);
+ break;
+ default:
+ ShowDebug("buildin_bonus: unexpected number of arguments (%d)\n", (script_lastdata(st) - 1));
+ break;
}
return 0;