summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-04 13:34:31 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-05-04 13:34:31 +0000
commit13371ff777f3509d8e5e02f2080f4692abacd57e (patch)
tree6be2277762d2d0728ee47bffa58e18d103a30562 /src/map/skill.c
parent37c603ec06e864e0daff41ac5fe67fc005561d70 (diff)
downloadhercules-13371ff777f3509d8e5e02f2080f4692abacd57e.tar.gz
hercules-13371ff777f3509d8e5e02f2080f4692abacd57e.tar.bz2
hercules-13371ff777f3509d8e5e02f2080f4692abacd57e.tar.xz
hercules-13371ff777f3509d8e5e02f2080f4692abacd57e.zip
* Players now are allowed to copy the skills the level which is beyond the skill_db max. [Inkfish]
* Fixed some behaviors for Waterball (bugreport:3024) [Inkfish] - High level Waterball used by players doesn't increase the number of balls. - Monsters can't pull water from cells with Magnetic Earth. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13730 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c68
1 files changed, 38 insertions, 30 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 8549759c0..098f6c327 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1747,9 +1747,6 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if ((type = pc_checkskill(tsd,RG_PLAGIARISM)) < lv)
lv = type;
- //kRO Update makes it impossible to copy skills beyond the skill_db max.
- if ((type = skill_get_max(skillid)) < lv)
- lv = type;
tsd->cloneskill_id = skillid;
tsd->status.skill[skillid].id = skillid;
@@ -2828,35 +2825,46 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
break;
case WZ_WATERBALL:
skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
- {
- int range = skilllv/2;
- int size = 2*range + 1;
- int count = 0;
-
- if( src->type == BL_PC )
- {// count the number of water cells in range
- struct skill_unit* unit;
+ {
+ int range = skilllv/2;
+ int size = 2*range + 1;
+ int count = 0;
int x, y;
- for( y = src->y - range; y <= src->y + range; ++y )
- for( x = src->x - range; x <= src->x + range; ++x )
- {
- if( map_getcell(src->m,x,y,CELL_CHKWATER) )
- count++; // natural water cell
- else
- if( (unit = map_find_skill_unit_oncell(src,x,y,SA_DELUGE,NULL)) != NULL
- || (unit = map_find_skill_unit_oncell(src,x,y,NJ_SUITON,NULL)) != NULL )
- {
- count++; // skill-induced water cell
- skill_delunit(unit); // consume cell
- }
+
+ if( src->type == BL_PC )
+ {// count the number of water cells in range
+ struct skill_unit* unit;
+ int maxlv = skill_get_max(skillid);
+
+ if( skilllv > maxlv )
+ range = maxlv / 2;
+
+ for( y = src->y - range; y <= src->y + range; ++y )
+ for( x = src->x - range; x <= src->x + range; ++x )
+ {
+ if( map_getcell(src->m,x,y,CELL_CHKWATER) )
+ count++; // natural water cell
+ else
+ if( (unit = map_find_skill_unit_oncell(src,x,y,SA_DELUGE,NULL)) != NULL
+ || (unit = map_find_skill_unit_oncell(src,x,y,NJ_SUITON,NULL)) != NULL )
+ {
+ count++; // skill-induced water cell
+ skill_delunit(unit); // consume cell
+ }
+ }
+ }
+ else
+ { // non-players bypass the water requirement
+ count = size*size;
+ for( y = src->y - range; y <= src->y + range; ++y )
+ for( x = src->x - range; x <= src->x + range; ++x )
+ if( map_find_skill_unit_oncell(src,x,y,SA_LANDPROTECTOR,NULL) != NULL )
+ count--;
}
- }
- else // non-players bypass the water requirement
- count = size*size;
- if( count > 1 ) // queue the remaining count - 1 timerskill Waterballs
- skill_addtimerskill(src,tick+150,bl->id,0,0,skillid,skilllv,count-1,flag);
- }
+ if( count > 1 ) // queue the remaining count - 1 timerskill Waterballs
+ skill_addtimerskill(src,tick+150,bl->id,0,0,skillid,skilllv,count-1,flag);
+ }
break;
case PR_BENEDICTIO:
@@ -5339,7 +5347,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
clif_skill_nodamage(src,bl,skillid,skilllv,1);
for(i = 0; i < g->max_member; i++, j++) {
if (j>8) j=0;
- if ((dstsd = g->member[i].sd) != NULL && sd != dstsd && !pc_isdead(dstsd) && !dstsd->state.autotrade) {
+ if ((dstsd = g->member[i].sd) != NULL && sd != dstsd && !dstsd->state.autotrade) {
if (map[dstsd->bl.m].flag.nowarp && !map_flag_gvg2(dstsd->bl.m))
continue;
if(map_getcell(src->m,src->x+dx[j],src->y+dy[j],CELL_CHKNOREACH))