From ae57ff81700dbe6714ef107b34510457e9c9c5b6 Mon Sep 17 00:00:00 2001 From: glighta Date: Mon, 12 Nov 2012 00:06:25 +0000 Subject: -Add Homon-S skills, 1st implementation (all done except Eleanors) --Upd Skill conf to set land-limit for homonculus by default (ground skill limit) --Mv MH_HEILIGE_STANGE and MH_ANGRIFFS_MODUS skill from Eleanor to Bayeri -Enforce all zeny transaction to use pc_payzeny and pc_getzeny handlers, (auto log and clif) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16914 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/homunculus.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/map/homunculus.c') diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 081e7078e..0bb41ebe4 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -81,6 +81,46 @@ int hom_class2mapid(int hom_class) } } +int hom_addspiritball(TBL_HOM *hd, int max) { + nullpo_ret(hd); + + if (max > MAX_SKILL_LEVEL) + max = MAX_SKILL_LEVEL; + if (hd->spiritball < 0) + hd->spiritball = 0; + + if (hd->spiritball && hd->spiritball >= max) { + hd->spiritball = max; + } + else + hd->spiritball++; + + clif_spiritball(&hd->bl); + + return 0; +} + +int hom_delspiritball(TBL_HOM *hd, int count, int type) { + nullpo_ret(hd); + + if (hd->spiritball <= 0) { + hd->spiritball = 0; + return 0; + } + if (count <= 0) + return 0; + if (count > MAX_SKILL_LEVEL) + count = MAX_SKILL_LEVEL; + if (count > hd->spiritball) + count = hd->spiritball; + + hd->spiritball -= count; + if (!type) + clif_spiritball(&hd->bl); + + return 0; +} + void merc_damage(struct homun_data *hd) { clif_hominfo(hd->master,hd,0); } -- cgit v1.2.3-60-g2f50