diff options
author | shennetsind <ind@henn.et> | 2013-01-27 11:58:05 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-01-27 11:58:05 -0200 |
commit | 18b2468b7d2680ddb5fcc0a11466b5893a16fdf4 (patch) | |
tree | 130a59334a2504d314119049784099d9af785043 | |
parent | 7911e5e5cde7ad1ffcd9e367110a656b9432ad50 (diff) | |
download | hercules-18b2468b7d2680ddb5fcc0a11466b5893a16fdf4.tar.gz hercules-18b2468b7d2680ddb5fcc0a11466b5893a16fdf4.tar.bz2 hercules-18b2468b7d2680ddb5fcc0a11466b5893a16fdf4.tar.xz hercules-18b2468b7d2680ddb5fcc0a11466b5893a16fdf4.zip |
Fixed Bug #6644
Basilica can only be placed when there are no other units (no mobs/players) within the range of which the basilica will spawn.
http://hercules.ws/board/tracker/issue-6644-basilica-bugged/
Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r-- | src/map/skill.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 03f0d50bb..8e0bbabeb 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -9553,7 +9553,14 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data) return 0; } - +/* skill count without self */ +static int skill_count_wos(struct block_list *bl,va_list ap) { + struct block_list* src = va_arg(ap, struct block_list*); + if( src->id != bl->id ) { + return 1; + } + return 0; +} /*========================================== * *------------------------------------------*/ @@ -9771,8 +9778,13 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui case HP_BASILICA: if( sc->data[SC_BASILICA] ) status_change_end(src, SC_BASILICA, INVALID_TIMER); // Cancel Basilica - else - { // Create Basilica. Start SC on caster. Unit timer start SC on others. + else { // Create Basilica. Start SC on caster. Unit timer start SC on others. + if( map_foreachinrange(skill_count_wos, src, 2, BL_MOB|BL_PC, src) ) { + if( sd ) + clif_skill_fail(sd,skill_id,USESKILL_FAIL,0); + return 1; + } + skill_clear_unitgroup(src); if( skill_unitsetting(src,skill_id,skill_lv,x,y,0) ) sc_start4(src,type,100,skill_lv,0,0,src->id,skill_get_time(skill_id,skill_lv)); |