diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-24 15:31:28 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-03-24 15:31:28 +0000 |
commit | 85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7 (patch) | |
tree | 3954f54f4adce21db6566710b1b02555b4d241a3 /src/map/skill.c | |
parent | 0e67259ca839671dac06dd804d6867ebe33df74a (diff) | |
download | hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.tar.gz hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.tar.bz2 hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.tar.xz hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.zip |
* Added 'map_charid2id'
* Changed monster damage logging to save char ID's
* Implemented 'event_script_type'
* Set Emsolute Develop as a learnable skill
* Updated 'require_glory_guild'
* Allow monsters to cast skills near themselves even when monster_nofootset is set to 'yes'
* Print number of online users in online.txt/.html even if there's only 1 user
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1282 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index d5bd61a4c..688f84c99 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1693,9 +1693,9 @@ static int skill_check_unit_range2_sub( struct block_list *bl,va_list ap ) return 0; } -int skill_check_unit_range2(int m,int x,int y,int skillid, int skilllv) +int skill_check_unit_range2(struct block_list *bl, int m,int x,int y,int skillid, int skilllv) { - int c = 0, range; + int c = 0, range, type; switch (skillid) { // to be expanded later case WZ_ICEWALL: @@ -1714,8 +1714,15 @@ int skill_check_unit_range2(int m,int x,int y,int skillid, int skilllv) break; } - map_foreachinarea(skill_check_unit_range2_sub,m, - x-range,y-range,x+range,y+range,0,&c,skillid); + // if the caster is a monster/NPC, only check for players + // otherwise just check everything + if (bl->type == BL_PC) + type = 0; + else type = BL_PC; + + map_foreachinarea(skill_check_unit_range2_sub, m, + x - range, y - range, x + range, y + range, + type, &c, skillid); return c; } @@ -6000,7 +6007,7 @@ int skill_castend_pos( int tid, unsigned int tick, int id,int data ) break;*/ if (battle_config.pc_skill_nofootset && skill_get_unit_flag(sd->skillid)&UF_NOFOOTSET && - skill_check_unit_range2(sd->bl.m,sd->skillx,sd->skilly,sd->skillid,sd->skilllv)) { + skill_check_unit_range2(&sd->bl,sd->bl.m,sd->skillx,sd->skilly,sd->skillid,sd->skilllv)) { clif_skill_fail(sd,sd->skillid,0,0); sd->canact_tick = tick; sd->canmove_tick = tick; @@ -7022,7 +7029,7 @@ int skill_use_id( struct map_session_data *sd, int target_id, clif_skill_fail(sd,sd->skillid,0,0); return 0; } - if (skill_check_unit_range2(sd->bl.m,sd->bl.x,sd->bl.y,sd->skillid,sd->skilllv)) { + if (skill_check_unit_range2(&sd->bl,sd->bl.m,sd->bl.x,sd->bl.y,sd->skillid,sd->skilllv)) { clif_skill_fail(sd,sd->skillid,0,0); return 0; } |