summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-07-13 23:53:23 +0200
committerGitHub <noreply@github.com>2016-07-13 23:53:23 +0200
commit2f8399e6f7d75e67717daa747908b8d38c1e805b (patch)
treee022df04c788e538ea1cfaa3ba19951ab32b4ab7
parent0d5a0c3df4291f8e272c24e57a16582555506238 (diff)
parent3630d991b0b1b2ac6beafdf8d0870375b7816f8f (diff)
downloadhercules-2f8399e6f7d75e67717daa747908b8d38c1e805b.tar.gz
hercules-2f8399e6f7d75e67717daa747908b8d38c1e805b.tar.bz2
hercules-2f8399e6f7d75e67717daa747908b8d38c1e805b.tar.xz
hercules-2f8399e6f7d75e67717daa747908b8d38c1e805b.zip
Merge pull request #1360 from 4144/skillcasting
Simplify clif_skillcasting.
-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 );