summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-01-28 18:42:25 -0200
committershennetsind <ind@henn.et>2013-01-28 18:42:25 -0200
commitcba3bef47e8758ab1db43bd5ee3b6fcc5f9a498b (patch)
tree2416bbe65b1bc89542aa0691344670c97505b37e /src
parent9f75e121fd20aaa20e337c8664ba9a57fe90fe21 (diff)
downloadhercules-cba3bef47e8758ab1db43bd5ee3b6fcc5f9a498b.tar.gz
hercules-cba3bef47e8758ab1db43bd5ee3b6fcc5f9a498b.tar.bz2
hercules-cba3bef47e8758ab1db43bd5ee3b6fcc5f9a498b.tar.xz
hercules-cba3bef47e8758ab1db43bd5ee3b6fcc5f9a498b.zip
New skill config
After due consideration we thought it'd be in the best interest of the community to provide a switch to this official feature since it drastically change the way traps can be used Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c4
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.c4
-rw-r--r--src/map/unit.c6
5 files changed, 15 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index d04eb1aa8..24aa335af 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -5864,6 +5864,10 @@ static const struct _battle_data {
{ "homunculus_max_level", &battle_config.hom_max_level, 99, 0, MAX_LEVEL, },
{ "homunculus_S_max_level", &battle_config.hom_S_max_level, 150, 0, MAX_LEVEL, },
{ "mob_size_influence", &battle_config.mob_size_influence, 0, 0, 1, },
+ /**
+ * Hercules
+ **/
+ { "skill_trap_type", &battle_config.skill_trap_type, 0, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
diff --git a/src/map/battle.h b/src/map/battle.h
index 1c1b1d38c..0943b1aa3 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -483,6 +483,7 @@ extern struct Battle_Config
int atcommand_mobinfo_type;
int mob_size_influence; // Enable modifications on earned experience, drop rates and monster status depending on monster size. [mkbu95]
+ int skill_trap_type;
} battle_config;
void do_init_battle(void);
diff --git a/src/map/skill.c b/src/map/skill.c
index 5f3036565..06982bea7 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11445,7 +11445,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
const struct TimerData* td = tsc->data[type]?get_timer(tsc->data[type]->timer):NULL;
if( td )
sec = DIFF_TICK(td->tick, tick);
- if( sg->unit_id == UNT_MANHOLE ) {
+ if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type ) {
unit_movepos(bl, src->bl.x, src->bl.y, 0, 0);
clif_fixpos(bl);
}
diff --git a/src/map/status.c b/src/map/status.c
index 8167e9949..0379d05d2 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -8646,6 +8646,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_PARALYSIS:
unit_stop_walking(bl,1);
break;
+ case SC_ANKLE:
+ if( battle_config.skill_trap_type )
+ unit_stop_walking(bl,1);
+ break;
case SC_HIDING:
case SC_CLOAKING:
case SC_CLOAKINGEXCEED:
diff --git a/src/map/unit.c b/src/map/unit.c
index 5d2a6c794..148a35782 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -350,6 +350,8 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
map_random_dir(bl, &ud->to_x, &ud->to_y);
if(ud->walktimer != INVALID_TIMER) {
+ if( !battle_config.skill_trap_type && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
+ return 0;
// When you come to the center of the grid because the change of destination while you're walking right now
// Call a function from a timer unit_walktoxy_sub
ud->state.change_walk_target = 1;
@@ -425,6 +427,8 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
map_random_dir(bl, &ud->to_x, &ud->to_y);
if(ud->walktimer != INVALID_TIMER) {
+ if( !battle_config.skill_trap_type && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
+ return 0;
ud->state.change_walk_target = 1;
set_mobstate(bl, flag&2);
return 1;
@@ -931,7 +935,7 @@ int unit_can_move(struct block_list *bl) {
)
return 0;
- if( sc->data[SC_ANKLE] && !unit_is_walking(bl) ) // Ankle only stops you after you're done moving
+ if( sc->data[SC_ANKLE] && ( battle_config.skill_trap_type || !unit_is_walking(bl) ) ) // Ankle only stops you after you're done moving
return 0;
if (sc->opt1 > 0 && sc->opt1 != OPT1_STONEWAIT && sc->opt1 != OPT1_BURNING && (sc->opt1 != OPT1_CRYSTALIZE && bl->type != BL_MOB))