summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-09-03 13:32:38 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-09-03 13:32:38 +0000
commit3d23d29e1f63a526338a35a05d384b7571f12553 (patch)
tree52a5b0a94b4fa85a3cc46dc86040eb70d4e0bdd4 /src/map/clif.c
parent66201d936391f0cabdfc1e47f6ca7fd6b692820e (diff)
downloadhercules-3d23d29e1f63a526338a35a05d384b7571f12553.tar.gz
hercules-3d23d29e1f63a526338a35a05d384b7571f12553.tar.bz2
hercules-3d23d29e1f63a526338a35a05d384b7571f12553.tar.xz
hercules-3d23d29e1f63a526338a35a05d384b7571f12553.zip
- Starting Mercenary Skill implementation.
- MS_BASH Completed. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13189 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c59
1 files changed, 43 insertions, 16 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index f1f1417fc..f6014fe3a 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9172,30 +9172,50 @@ static void clif_parse_UseSkillToId_homun(struct homun_data *hd, struct map_sess
{
int lv;
- if (!hd)
+ if( !hd )
return;
-
- if (skillnotok_hom(skillnum, hd)) //[orn]
+ if( skillnotok_hom(skillnum, hd) )
return;
-
- if (hd->bl.id != target_id &&
- skill_get_inf(skillnum)&INF_SELF_SKILL)
- target_id = hd->bl.id; //What good is it to mess up the target in self skills? Wished I knew... [Skotlex]
-
- if (hd->ud.skilltimer != -1) {
- if (skillnum != SA_CASTCANCEL)
- return;
- } else if (DIFF_TICK(tick, hd->ud.canact_tick) < 0)
+ if( hd->bl.id != target_id && skill_get_inf(skillnum)&INF_SELF_SKILL )
+ target_id = hd->bl.id;
+ if( hd->ud.skilltimer != -1 )
+ {
+ if( skillnum != SA_CASTCANCEL ) return;
+ }
+ else if( DIFF_TICK(tick, hd->ud.canact_tick) < 0 )
return;
lv = merc_hom_checkskill(hd, skillnum);
- if (skilllv > lv)
+ if( skilllv > lv )
skilllv = lv;
-
- if (skilllv)
+ if( skilllv )
unit_skilluse_id(&hd->bl, target_id, skillnum, skilllv);
}
+static void clif_parse_UseSkillToId_mercenary(struct mercenary_data *md, struct map_session_data *sd, unsigned int tick, short skillnum, short skilllv, int target_id)
+{
+ int lv;
+
+ if( !md )
+ return;
+ if( skillnotok_mercenary(skillnum, md) )
+ return;
+ if( md->bl.id != target_id && skill_get_inf(skillnum)&INF_SELF_SKILL )
+ target_id = md->bl.id;
+ if( md->ud.skilltimer != INVALID_TIMER )
+ {
+ if( skillnum != SA_CASTCANCEL ) return;
+ }
+ else if( DIFF_TICK(tick, md->ud.canact_tick) < 0 )
+ return;
+
+ lv = mercenary_checkskill(md, skillnum);
+ if( skilllv > lv )
+ skilllv = lv;
+ if( skilllv )
+ unit_skilluse_id(&md->bl, target_id, skillnum, skilllv);
+}
+
/*==========================================
* スキル使用(ID指定)
*------------------------------------------*/
@@ -9216,11 +9236,18 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
if (tmp&INF_GROUND_SKILL || !tmp)
return; //Using a ground/passive skill on a target? WRONG.
- if (skillnum >= HM_SKILLBASE && skillnum < HM_SKILLBASE+MAX_HOMUNSKILL) {
+ if( skillnum >= HM_SKILLBASE && skillnum < HM_SKILLBASE+MAX_HOMUNSKILL )
+ {
clif_parse_UseSkillToId_homun(sd->hd, sd, tick, skillnum, skilllv, target_id);
return;
}
+ if( skillnum >= MC_SKILLBASE && skillnum < MC_SKILLBASE+MAX_MERCSKILL )
+ {
+ clif_parse_UseSkillToId_mercenary(sd->md, sd, tick, skillnum, skilllv, target_id);
+ return;
+ }
+
// Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex]
sd->idletime = last_tick;