diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-02 01:19:38 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-02 01:19:38 +0000 |
commit | 9ff2e37797269dc742b5f394b94f14fea533fce2 (patch) | |
tree | 1a63a36d2274bf1a35d052c1866c166bda544828 /src/map | |
parent | e8c89d85b61e53646b8a243618a27bd4b06cb7f1 (diff) | |
download | hercules-9ff2e37797269dc742b5f394b94f14fea533fce2.tar.gz hercules-9ff2e37797269dc742b5f394b94f14fea533fce2.tar.bz2 hercules-9ff2e37797269dc742b5f394b94f14fea533fce2.tar.xz hercules-9ff2e37797269dc742b5f394b94f14fea533fce2.zip |
- Modified trap related code so it behaves as explained by Playtester: Traps trigger on everyone in their 'effect range' (skill_db's splash) for every target that lies within its trigger range at trigger time (range and interval in the skill_unit_db).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11634 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/skill.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index f24073eda..362a7ca2e 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7475,17 +7475,8 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns break; case UNT_LANDMINE: - skill_attack(BF_MISC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0); - sg->unit_id = UNT_USED_TRAPS; - clif_changetraplook(&src->bl, UNT_FIREPILLAR_ACTIVE); - sg->limit=DIFF_TICK(tick,sg->tick)+1500; - break; - case UNT_CLAYMORETRAP: case UNT_BLASTMINE: - //Hold number of targets (required for damage calculation) - type = map_foreachinrange(skill_count_target,&src->bl, - skill_get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag, &src->bl); case UNT_SHOCKWAVE: case UNT_SANDMAN: case UNT_FLASHER: @@ -7493,8 +7484,8 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns map_foreachinrange(skill_trap_splash,&src->bl, skill_get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag, &src->bl,tick,type); - sg->unit_id = UNT_USED_TRAPS; - clif_changetraplook(&src->bl, UNT_USED_TRAPS); + clif_changetraplook(&src->bl, sg->unit_id==UNT_LANDMINE?UNT_FIREPILLAR_ACTIVE:UNT_USED_TRAPS); + src->range = -1; //Disable range so it does not invoke a for each in area again. sg->limit=DIFF_TICK(tick,sg->tick)+1500; break; @@ -9715,11 +9706,9 @@ int skill_trap_splash (struct block_list *bl, va_list ap) struct skill_unit *unit; struct skill_unit_group *sg; struct block_list *ss; - int i,count; src = va_arg(ap,struct block_list *); unit = (struct skill_unit *)src; tick = va_arg(ap,int); - count = va_arg(ap,int); nullpo_retr(0, sg = unit->group); nullpo_retr(0, ss = map_id2bl(sg->src_id)); @@ -9735,13 +9724,8 @@ int skill_trap_splash (struct block_list *bl, va_list ap) break; case UNT_BLASTMINE: case UNT_CLAYMORETRAP: - //Special property: Each target is hit N times (N = number of targets on splash area) - if (!count) count = 1; - for(i=0;i<count;i++) - skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,0); - break; case UNT_FREEZINGTRAP: - skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,0); + skill_attack(skill_get_type(sg->skill_id),ss,src,bl,sg->skill_id,sg->skill_lv,tick,0); break; case UNT_GROUNDDRIFT_WIND: if(skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,sg->val1)) @@ -10233,6 +10217,9 @@ int skill_unit_timer_sub (struct block_list* bl, va_list ap) else map_foreachinrange(skill_unit_timer_sub_onplace, bl, unit->range, group->bl_flag, bl,tick); + if(unit->range == -1) //Unit disabled, but it should not be deleted yet. + group->unit_id = UNT_USED_TRAPS; + if( !unit->alive ) { if( dissonance ) skill_dance_switch(unit, 1); |