summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-17 21:33:54 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-17 21:33:54 +0000
commitf06d3b26ad08bb054b6593fac39042cb20649c36 (patch)
tree53861eeb70d343a9d429f35d1cf29b1139c828b1 /src/map/map.c
parentff4c178309e0e18939d4077283a689e356311ce8 (diff)
downloadhercules-f06d3b26ad08bb054b6593fac39042cb20649c36.tar.gz
hercules-f06d3b26ad08bb054b6593fac39042cb20649c36.tar.bz2
hercules-f06d3b26ad08bb054b6593fac39042cb20649c36.tar.xz
hercules-f06d3b26ad08bb054b6593fac39042cb20649c36.zip
- Added NK value 3: No damage + area of effect skill (NK_SPLASH_NO_DAMAGE)
- Removed the double-cast specific code and made it use skill_addtimerskill instead. - Modified party_foreachsamemap so that it returns to addition of the return value of the functions invoked. Type has been changed for "range", when 0, it scans all party members in the map. - Updated most skill/battle code to use map_foreachinrange rather than map_foreachinarea. - map_foreachinrange does not performs an exact range check anymore. However the relevant code is commented and anyone can enable it. - Updated most skills to use skill_get_splash instead of hardcoded ranges. - Added function skill_get_casttype which returns the type of function that should be invoked for that skill: skill_castend_pos, skill_castend_nodamage_id or skill_castend_damage_id. - self skills are sent to skill_castend_nodamage_id regardless of nk (nk should signal if the skill causes damage above everything, it is used on autospell/effects). - Due to the previous change, self skills where the target and src are different, and don't have an nk of no damage, they are sent to castend_damage_id (assumed target auto-selected skills) - Applied the relevant updates to db/skill_db.txt, db/skill_unit_db also got updated, as trap ranges should all be 1, the splash damage range is defined now in skill_db - Cleaned up the implementation of the code related to Gangster's paradise and TK_HP/SPtime git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5313 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/map/map.c b/src/map/map.c
index d7cfa11db..cc43f3705 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -628,18 +628,18 @@ struct skill_unit *map_find_skill_unit_oncell(struct block_list *target,int x,in
}
/*==========================================
- * Adapted from foreachinarea to use real ranges around a character area. [Skotlex]
+ * Adapted from foreachinarea for an easier invocation. [Skotlex]
*------------------------------------------
*/
-int map_foreachinrange(int (*func)(struct block_list*,va_list),int m,struct block_list *center, int range,int type,...) {
+int map_foreachinrange(int (*func)(struct block_list*,va_list),struct block_list *center, int range,int type,...) {
va_list ap;
- int bx,by;
+ int bx,by,m;
int returnCount =0; //total sum of returned values of func() [Skotlex]
struct block_list *bl=NULL;
int blockcount=bl_list_count,i,c;
int x0,x1,y0,y1;
-
+ m = center->m;
if (m < 0)
return 0;
va_start(ap,type);
@@ -661,7 +661,9 @@ int map_foreachinrange(int (*func)(struct block_list*,va_list),int m,struct bloc
for(i=0;i<c && bl;i++,bl=bl->next){
if(bl && bl->type&type
&& bl->x>=x0 && bl->x<=x1 && bl->y>=y0 && bl->y<=y1
- && check_distance_bl(center, bl, range)
+ //For speed purposes, it does not checks actual range by default.
+ //Feel free to uncomment if you want a more "exact" approach.
+// && check_distance_bl(center, bl, range)
&& bl_list_count<BL_LIST_MAX)
bl_list[bl_list_count++]=bl;
}