summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-03-02 20:16:51 -0300
committershennetsind <ind@henn.et>2013-03-02 20:16:51 -0300
commitea001385e0b98e63cfde00158fd5b7739aaa659e (patch)
tree2c1ec751af1f6349bdf045f4eebe9fea061c2cef /src/map/map.c
parent3654f06f8563a7ee3df6f01552bdee9902d47fd2 (diff)
downloadhercules-ea001385e0b98e63cfde00158fd5b7739aaa659e.tar.gz
hercules-ea001385e0b98e63cfde00158fd5b7739aaa659e.tar.bz2
hercules-ea001385e0b98e63cfde00158fd5b7739aaa659e.tar.xz
hercules-ea001385e0b98e63cfde00158fd5b7739aaa659e.zip
Hercules Renewal: skill.c
http://hercules.ws/board/topic/237-hercules-renewal/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 8cd8bee95..dbe3937e8 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -366,7 +366,7 @@ int map_delblock(struct block_list* bl)
/*==========================================
* Moves a block a x/y target position. [Skotlex]
- * Pass flag as 1 to prevent doing skill_unit_move checks
+ * Pass flag as 1 to prevent doing skill->unit_move checks
* (which are executed by default on BL_CHAR types)
*------------------------------------------*/
int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
@@ -386,14 +386,14 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
if (bl->type&BL_CHAR) {
sc = status_get_sc(bl);
- skill_unit_move(bl,tick,2);
+ skill->unit_move(bl,tick,2);
status_change_end(bl, SC_CLOSECONFINE, INVALID_TIMER);
status_change_end(bl, SC_CLOSECONFINE2, INVALID_TIMER);
// status_change_end(bl, SC_BLADESTOP, INVALID_TIMER); //Won't stop when you are knocked away, go figure...
status_change_end(bl, SC_TATAMIGAESHI, INVALID_TIMER);
status_change_end(bl, SC_MAGICROD, INVALID_TIMER);
if (sc->data[SC_PROPERTYWALK] &&
- sc->data[SC_PROPERTYWALK]->val3 >= skill_get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) )
+ sc->data[SC_PROPERTYWALK]->val3 >= skill->get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) )
status_change_end(bl,SC_PROPERTYWALK,INVALID_TIMER);
} else
if (bl->type == BL_NPC)
@@ -412,7 +412,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
if (bl->type&BL_CHAR) {
- skill_unit_move(bl,tick,3);
+ skill->unit_move(bl,tick,3);
if( bl->type == BL_PC && ((TBL_PC*)bl)->shadowform_id ) {//Shadow Form Target Moving
struct block_list *d_bl;
@@ -425,19 +425,19 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
if (sc && sc->count) {
if (sc->data[SC_DANCING])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_DANCING]->val2), bl->m, x1-x0, y1-y0);
+ skill->unit_move_unit_group(skill->id2group(sc->data[SC_DANCING]->val2), bl->m, x1-x0, y1-y0);
else {
if (sc->data[SC_CLOAKING])
- skill_check_cloaking(bl, sc->data[SC_CLOAKING]);
+ skill->check_cloaking(bl, sc->data[SC_CLOAKING]);
if (sc->data[SC_WARM])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_WARM]->val4), bl->m, x1-x0, y1-y0);
+ skill->unit_move_unit_group(skill->id2group(sc->data[SC_WARM]->val4), bl->m, x1-x0, y1-y0);
if (sc->data[SC_BANDING])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_BANDING]->val4), bl->m, x1-x0, y1-y0);
+ skill->unit_move_unit_group(skill->id2group(sc->data[SC_BANDING]->val4), bl->m, x1-x0, y1-y0);
if (sc->data[SC_NEUTRALBARRIER_MASTER])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_NEUTRALBARRIER_MASTER]->val2), bl->m, x1-x0, y1-y0);
+ skill->unit_move_unit_group(skill->id2group(sc->data[SC_NEUTRALBARRIER_MASTER]->val2), bl->m, x1-x0, y1-y0);
else if (sc->data[SC_STEALTHFIELD_MASTER])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_STEALTHFIELD_MASTER]->val2), bl->m, x1-x0, y1-y0);
+ skill->unit_move_unit_group(skill->id2group(sc->data[SC_STEALTHFIELD_MASTER]->val2), bl->m, x1-x0, y1-y0);
if( sc->data[SC__SHADOWFORM] ) {//Shadow Form Caster Moving
struct block_list *d_bl;
@@ -446,10 +446,10 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
}
if (sc->data[SC_PROPERTYWALK]
- && sc->data[SC_PROPERTYWALK]->val3 < skill_get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2)
+ && sc->data[SC_PROPERTYWALK]->val3 < skill->get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2)
&& map_find_skill_unit_oncell(bl,bl->x,bl->y,SO_ELECTRICWALK,NULL,0) == NULL
&& map_find_skill_unit_oncell(bl,bl->x,bl->y,SO_FIREWALK,NULL,0) == NULL
- && skill_unitsetting(bl,sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2,x0, y0,0)) {
+ && skill->unitsetting(bl,sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2,x0, y0,0)) {
sc->data[SC_PROPERTYWALK]->val3++;
}
@@ -458,13 +458,13 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
/* Guild Aura Moving */
if( bl->type == BL_PC && ((TBL_PC*)bl)->state.gmaster_flag ) {
if (sc->data[SC_LEADERSHIP])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_LEADERSHIP]->val4), bl->m, x1-x0, y1-y0);
+ skill->unit_move_unit_group(skill->id2group(sc->data[SC_LEADERSHIP]->val4), bl->m, x1-x0, y1-y0);
if (sc->data[SC_GLORYWOUNDS])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_GLORYWOUNDS]->val4), bl->m, x1-x0, y1-y0);
+ skill->unit_move_unit_group(skill->id2group(sc->data[SC_GLORYWOUNDS]->val4), bl->m, x1-x0, y1-y0);
if (sc->data[SC_SOULCOLD])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_SOULCOLD]->val4), bl->m, x1-x0, y1-y0);
+ skill->unit_move_unit_group(skill->id2group(sc->data[SC_SOULCOLD]->val4), bl->m, x1-x0, y1-y0);
if (sc->data[SC_HAWKEYES])
- skill_unit_move_unit_group(skill_id2group(sc->data[SC_HAWKEYES]->val4), bl->m, x1-x0, y1-y0);
+ skill->unit_move_unit_group(skill->id2group(sc->data[SC_HAWKEYES]->val4), bl->m, x1-x0, y1-y0);
}
}
} else
@@ -3591,7 +3591,7 @@ int cleanup_sub(struct block_list *bl, va_list ap)
map_clearflooritem(bl);
break;
case BL_SKILL:
- skill_delunit((struct skill_unit *) bl);
+ skill->delunit((struct skill_unit *) bl);
break;
}
@@ -3653,7 +3653,7 @@ void do_final(void)
do_final_pet();
do_final_mob();
do_final_msg();
- do_final_skill();
+ skill->final();
do_final_status();
do_final_unit();
do_final_battleground();
@@ -3920,6 +3920,7 @@ int do_init(int argc, char *argv[])
}
battle_defaults();
+ skill_defaults();
battle->config_read(BATTLE_CONF_FILENAME);
msg_config_read(MSG_CONF_NAME);
@@ -3960,7 +3961,7 @@ int do_init(int argc, char *argv[])
do_init_clif();
do_init_script();
do_init_itemdb();
- do_init_skill();
+ skill->init();
do_init_mob();
do_init_pc();
do_init_status();