summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-27 15:07:55 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-27 15:07:55 +0000
commit344be8d138d359fd0be0ee72820a7982a9a8d39f (patch)
tree28b8a495326928bdd81c03fbb29f3863c21c3ae7 /src
parentd5daeaf65b0892f5fd6dfc8cce13cc131d434b80 (diff)
downloadhercules-344be8d138d359fd0be0ee72820a7982a9a8d39f.tar.gz
hercules-344be8d138d359fd0be0ee72820a7982a9a8d39f.tar.bz2
hercules-344be8d138d359fd0be0ee72820a7982a9a8d39f.tar.xz
hercules-344be8d138d359fd0be0ee72820a7982a9a8d39f.zip
- Merged some splash changes from stable. Sharp-Shooting will now display a skill animation.
- The no_spawn_on_player setting will now also work for static mobs, but only if the setting is set to 100 or higher. - Some small cleanups. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8887 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/map.c12
-rw-r--r--src/map/mob.c10
-rw-r--r--src/map/skill.c5
3 files changed, 19 insertions, 8 deletions
diff --git a/src/map/map.c b/src/map/map.c
index c57902f32..e7e2ad7b7 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1072,7 +1072,7 @@ int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y
// S
//////////////////////////////////////////////////////////////
// Methodology:
-// My trigonometrics and math is a little rusty... so the approach I am writing
+// My trigonometrics and math are a little rusty... so the approach I am writing
// here is basicly do a double for to check for all targets in the square that
// contains the initial and final positions (area range increased to match the
// radius given), then for each object to test, calculate the distance to the
@@ -1082,9 +1082,10 @@ int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y
// http://astronomy.swin.edu.au/~pbourke/geometry/pointline/
// (they have a link to a C implementation, too)
// This approach is a lot like #2 commented on this function, which I have no
-// idea why it was commented. I won't use doubles/floats, but pure int math for speed purposes
-// The range considered is always the same no matter how close/far the target is because that's
-// how SharpShooting works currently in kRO.
+// idea why it was commented. I won't use doubles/floats, but pure int math for
+// speed purposes. The range considered is always the same no matter how
+// close/far the target is because that's how SharpShooting works currently in
+// kRO.
//Generic map_foreach* variables.
va_list ap;
@@ -1218,7 +1219,8 @@ int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y
map_freeblock_lock();
for(i=blockcount;i<bl_list_count;i++)
- returnCount += func(bl_list[i],ap);
+ if(bl_list[i]->prev) //This check is done in case some object gets killed due to further skill processing.
+ returnCount += func(bl_list[i],ap);
map_freeblock_unlock();
diff --git a/src/map/mob.c b/src/map/mob.c
index 1a0d5c38b..da0e28ea5 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -619,6 +619,11 @@ int mob_setdelayspawn(struct mob_data *md)
return 0;
}
+static int mob_count_sub(struct block_list *bl,va_list ap)
+{
+ return 1;
+}
+
/*==========================================
* Mob spawning. Initialization is also variously here.
*------------------------------------------
@@ -655,6 +660,11 @@ int mob_spawn (struct mob_data *md)
add_timer(tick+5000,mob_delayspawn,md->bl.id,0);
return 1;
}
+ } else if (battle_config.no_spawn_on_player>99 &&
+ map_foreachinrange(mob_count_sub, &md->bl, AREA_SIZE, BL_PC))
+ { //retry again later (players on sight)
+ add_timer(tick+5000,mob_delayspawn,md->bl.id,0);
+ return 1;
}
}
malloc_set(&md->state, 0, sizeof(md->state));
diff --git a/src/map/skill.c b/src/map/skill.c
index f1ff94fcd..b5c01bf1d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2031,13 +2031,12 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
case NPC_SPLASHATTACK:
case TF_DOUBLE:
case GS_CHAINACTION:
- case SN_SHARPSHOOTING:
dmg.dmotion = clif_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,dmg.type,dmg.damage2);
break;
default:
//Disabling skill animation doesn't works on multi-hit.
dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion,
- damage, dmg.div_, skillid, flag&SD_LEVEL?-1:skilllv,
+ damage, dmg.div_, skillid, flag&SD_LEVEL?-1:skilllv,
(flag&SD_ANIMATION && dmg.div_ < 2?5:type));
break;
}
@@ -4038,8 +4037,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case NJ_HYOUSYOURAKU:
case NJ_RAIGEKISAI:
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
case WZ_FROSTNOVA:
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
skill_area_temp[1] = 0;
map_foreachinrange(skill_attack_area, src,
skill_get_splash(skillid, skilllv), BL_CHAR,