diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-06 18:38:51 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-06 18:38:51 +0000 |
commit | e7096ca70629c5fd5f824cec8e2d4307e8578913 (patch) | |
tree | ae574e1de73431050206ac7d01f3f04caaec7c41 /src/map/map.c | |
parent | 86914c88410c49b2b84084f2165fc9b581f2986e (diff) | |
download | hercules-e7096ca70629c5fd5f824cec8e2d4307e8578913.tar.gz hercules-e7096ca70629c5fd5f824cec8e2d4307e8578913.tar.bz2 hercules-e7096ca70629c5fd5f824cec8e2d4307e8578913.tar.xz hercules-e7096ca70629c5fd5f824cec8e2d4307e8578913.zip |
- Added define clif_deadsit to send the dead state into player packets if the player is in trick dead state.
- Venom Splasher always hits (but splash damage targets can still avoid it)
- Using autoloot with no arguments now toggles it between @autoloot 0 and @autoloot 100%
- Falcon Assault now takes Blitz Beat lv5 as base damage.
- Fixed pc_makesavestatus not updating status.option correctly.
- Corrected Waterball so that higher levels can do insane amount of hits.
- Altered slave behaviour. No more random walking, will stay within 2 cells of their master.
- Reverted the Summon Slave behaviour to not adjust level based on number of current slaves.
- Coma no longer sends SP to 1.
- Updated Meteor so that when level 11 or more is casted, the area over which meteors fall is tripled.
- Dark elemental characters are now inmune to Curse.
- Fixed sc_data saving to sql buffer building method. Thanks to its_sparky.
- Changed the map zone reading from using pow to a bit shift.
- Experience has now been changed to unsigned int, and is read as such from the dbs.
- Increased HT_DETECTING seek range to 7x7
- Added function map_foreachinrange which actually checks distance of nearing objects (unlike for each in area which uses a square area), may come handy for future code.
- Corrected Venom Splasher: Being hit does not cancels it, works at 75% or less of target's HP, being hit normally while under the count has a chance of causing poison. Damage is +400% + 50*lv%
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5204 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/map/map.c b/src/map/map.c index f69af6d7c..3b0c59e28 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -640,6 +640,79 @@ 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]
+ *------------------------------------------
+ */
+
+int map_foreachinrange(int (*func)(struct block_list*,va_list),int m,struct block_list *center, int range,int type,...) {
+ va_list ap;
+ int bx,by;
+ 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;
+
+ if (m < 0)
+ return 0;
+ va_start(ap,type);
+ x0 = center->x-range;
+ x1 = center->x+range;
+ y0 = center->y-range;
+ y1 = center->y+range;
+
+ if (x0 < 0) x0 = 0;
+ if (y0 < 0) y0 = 0;
+ if (x1 >= map[m].xs) x1 = map[m].xs-1;
+ if (y1 >= map[m].ys) y1 = map[m].ys-1;
+
+ if (type&~BL_MOB)
+ for (by = y0 / BLOCK_SIZE; by <= y1 / BLOCK_SIZE; by++) {
+ for(bx=x0/BLOCK_SIZE;bx<=x1/BLOCK_SIZE;bx++){
+ bl = map[m].block[bx+by*map[m].bxs];
+ c = map[m].block_count[bx+by*map[m].bxs];
+ 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)
+ && bl_list_count<BL_LIST_MAX)
+ bl_list[bl_list_count++]=bl;
+ }
+ }
+ }
+ if(type&BL_MOB)
+ for(by=y0/BLOCK_SIZE;by<=y1/BLOCK_SIZE;by++){
+ for(bx=x0/BLOCK_SIZE;bx<=x1/BLOCK_SIZE;bx++){
+ bl = map[m].block_mob[bx+by*map[m].bxs];
+ c = map[m].block_mob_count[bx+by*map[m].bxs];
+ for(i=0;i<c && bl;i++,bl=bl->next){
+ if(bl
+ && bl->x>=x0 && bl->x<=x1 && bl->y>=y0 && bl->y<=y1
+ && check_distance_bl(center, bl, range)
+ && bl_list_count<BL_LIST_MAX)
+ bl_list[bl_list_count++]=bl;
+ }
+ }
+ }
+
+ if(bl_list_count>=BL_LIST_MAX) {
+ if(battle_config.error_log)
+ ShowWarning("map_foreachinrange: block count too many!\n");
+ }
+
+ map_freeblock_lock(); // メモリからの解放を禁止する
+
+ for(i=blockcount;i<bl_list_count;i++)
+ if(bl_list[i]->prev) // 有?かどうかチェック
+ returnCount += func(bl_list[i],ap);
+
+ map_freeblock_unlock(); // 解放を許可する
+
+ va_end(ap);
+ bl_list_count = blockcount;
+ return returnCount; //[Skotlex]
+}
+
+/*==========================================
* map m (x0,y0)-(x1,y1)?の全objに?して
* funcを呼ぶ
* type!=0 ならその種類のみ
|