summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2015-05-31 12:06:28 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2015-05-31 12:06:28 +0800
commita5a86059b8e70420f0a78d6a377b5702cdfe6792 (patch)
treebb9910dd32b6a299a1b25f71bcc33371a4506fa7 /src/map/pc.c
parentaaa82f2f8fb70858048d1e199b40bbb797b9604d (diff)
downloadhercules-a5a86059b8e70420f0a78d6a377b5702cdfe6792.tar.gz
hercules-a5a86059b8e70420f0a78d6a377b5702cdfe6792.tar.bz2
hercules-a5a86059b8e70420f0a78d6a377b5702cdfe6792.tar.xz
hercules-a5a86059b8e70420f0a78d6a377b5702cdfe6792.zip
Fixed Bug#8673
-http://hercules.ws/board/tracker/issue-8673-gt-energy-gain/?gopid=25265#entry25265 -Fixed some skills related to spiritball, should now work like official. Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 5fc6469f3..4c97a4fef 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -174,6 +174,24 @@ int pc_spiritball_timer(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
+/**
+* Get the possible number of spiritball that a player can call.
+* @param sd the affected player structure
+* @param min the minimum number of spiritball regardless the level of MO_CALLSPIRITS
+* @retval total number of spiritball
+**/
+int pc_getmaxspiritball(struct map_session_data *sd, int min) {
+ nullpo_ret(sd);
+ int result = pc->checkskill(sd, MO_CALLSPIRITS);
+ if ( min && result < min )
+ result = min;
+ else if ( sd->sc.data[SC_RAISINGDRAGON] )
+ result += sd->sc.data[SC_RAISINGDRAGON]->val1;
+ if ( result > MAX_SPIRITBALL )
+ result = MAX_SPIRITBALL;
+ return result;
+}
+
int pc_addspiritball(struct map_session_data *sd,int interval,int max)
{
int tid, i;
@@ -11247,6 +11265,7 @@ void pc_defaults(void) {
pc->addfame = pc_addfame;
pc->famerank = pc_famerank;
pc->set_hate_mob = pc_set_hate_mob;
+ pc->getmaxspiritball = pc_getmaxspiritball;
pc->readdb = pc_readdb;
pc->map_day_timer = map_day_timer; // by [yor]