summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-13 23:00:09 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-14 00:27:39 +0300
commit3630d991b0b1b2ac6beafdf8d0870375b7816f8f (patch)
treee022df04c788e538ea1cfaa3ba19951ab32b4ab7 /src
parent0d5a0c3df4291f8e272c24e57a16582555506238 (diff)
downloadhercules-3630d991b0b1b2ac6beafdf8d0870375b7816f8f.tar.gz
hercules-3630d991b0b1b2ac6beafdf8d0870375b7816f8f.tar.bz2
hercules-3630d991b0b1b2ac6beafdf8d0870375b7816f8f.tar.xz
hercules-3630d991b0b1b2ac6beafdf8d0870375b7816f8f.zip
Simplify clif_skillcasting and rename to clif_useskill.
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c5
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/unit.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 3069e95ad..897249836 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4931,7 +4931,7 @@ void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf)
/// is disposable:
/// 0 = yellow chat text "[src name] will use skill [skill name]."
/// 1 = no text
-void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime)
+void clif_useskill(struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime)
{
#if PACKETVER < 20091124
const int cmd = 0x13e;
@@ -4939,6 +4939,7 @@ void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x,
const int cmd = 0x7fb;
#endif
unsigned char buf[32];
+ int property = skill->get_ele(skill_id, skill_lv);
WBUFW(buf,0) = cmd;
WBUFL(buf,2) = src_id;
@@ -19354,7 +19355,7 @@ void clif_defaults(void) {
clif->skill_poseffect = clif_skill_poseffect;
clif->skill_estimation = clif_skill_estimation;
clif->skill_warppoint = clif_skill_warppoint;
- clif->skillcasting = clif_skillcasting;
+ clif->useskill = clif_useskill;
clif->produce_effect = clif_produceeffect;
clif->devotion = clif_devotion;
clif->spiritball = clif_spiritball;
diff --git a/src/map/clif.h b/src/map/clif.h
index 2e324d28c..8b75a32f3 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -825,7 +825,7 @@ struct clif_interface {
void (*skill_poseffect) (struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick);
void (*skill_estimation) (struct map_session_data *sd,struct block_list *dst);
void (*skill_warppoint) (struct map_session_data* sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
- void (*skillcasting) (struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime);
+ void (*useskill) (struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime);
void (*produce_effect) (struct map_session_data* sd,int flag,int nameid);
void (*devotion) (struct block_list *src, struct map_session_data *tsd);
void (*spiritball) (struct block_list *bl);
diff --git a/src/map/unit.c b/src/map/unit.c
index ac1e3e9b5..3a3e56dd3 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1574,7 +1574,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
unit->stop_walking(src, STOPWALKING_FLAG_FIXPOS);// even though this is not how official works but this will do the trick. bugreport:6829
// in official this is triggered even if no cast time.
- clif->skillcasting(src, src->id, target_id, 0,0, skill_id, skill->get_ele(skill_id, skill_lv), casttime);
+ clif->useskill(src, src->id, target_id, 0,0, skill_id, skill_lv, casttime);
if( casttime > 0 || temp )
{
if (sd != NULL && target->type == BL_MOB) {
@@ -1769,7 +1769,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
unit->stop_walking(src, STOPWALKING_FLAG_FIXPOS);
// in official this is triggered even if no cast time.
- clif->skillcasting(src, src->id, 0, skill_x, skill_y, skill_id, skill->get_ele(skill_id, skill_lv), casttime);
+ clif->useskill(src, src->id, 0, skill_x, skill_y, skill_id, skill_lv, casttime);
if( casttime > 0 ) {
unit->setdir(src, map->calc_dir(src, skill_x, skill_y));
ud->skilltimer = timer->add( tick+casttime, skill->castend_pos, src->id, 0 );