summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-26 14:28:19 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-26 14:28:19 +0000
commit7923c32b8ebfbebd09dc0d783e93fef51a4ec38b (patch)
tree9ab81fa169eb48e71e208f080e5f776f066cad51 /src/map/skill.c
parent8ca00fc7e0e1457b1cb1537e2caeefa150344360 (diff)
downloadhercules-7923c32b8ebfbebd09dc0d783e93fef51a4ec38b.tar.gz
hercules-7923c32b8ebfbebd09dc0d783e93fef51a4ec38b.tar.bz2
hercules-7923c32b8ebfbebd09dc0d783e93fef51a4ec38b.tar.xz
hercules-7923c32b8ebfbebd09dc0d783e93fef51a4ec38b.zip
* Fixed a bug in gettick cache when compiling in Windows
- Changed "read_map_from_bitmap" to "read_map_from_cache" in map_athena, "map_bitmap_path" to "map_cache_file" - Fixed item effects not showing when only one was used - Fixed a bug in Safety Wall - Allow only either Storm Gust or Lord of Vermillion to cause damage if stacked together - Added path_search_long, map_find_skill_unit_oncell git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@998 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c126
1 files changed, 78 insertions, 48 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 000025e08..2546e56e0 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5795,11 +5795,11 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,
map_foreachinarea(skill_landprotector,src->m,ux,uy,ux,uy,BL_SKILL,skillid,&alive);
if(skillid==WZ_ICEWALL && alive){
- val2=map_getcell(src->m,ux,uy,CELL_CHKTYPE);
+ val2=map_getcell(src->m,ux,uy,CELL_GETTYPE);
if(val2==5 || val2==1)
alive=0;
else {
- map_setcell(src->m,ux,uy,CELL_SETNOPASS);
+ map_setcell(src->m,ux,uy,5);
clif_changemapcell(src->m,ux,uy,5,0);
}
}
@@ -5865,9 +5865,11 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
struct skill_unit_group_tickset *ts;
struct map_session_data *srcsd=NULL;
int diff,goflag,splash_count=0;
+ struct status_change *sc_data;
nullpo_retr(0, src);
nullpo_retr(0, bl);
+ sc_data = status_get_sc_data(bl);
if( bl->prev==NULL || !src->alive || (bl->type == BL_PC && pc_isdead((struct map_session_data *)bl) ) )
return 0;
@@ -5880,9 +5882,9 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
if(srcsd && srcsd->chatID)
return 0;
- if( bl->type!=BL_PC && bl->type!=BL_MOB )
+ if( bl->type != BL_PC && bl->type != BL_MOB )
return 0;
- nullpo_retr(0, ts=skill_unitgrouptickset_search( bl, sg->group_id));
+ nullpo_retr(0, ts = skill_unitgrouptickset_search(bl, sg));
diff=DIFF_TICK(tick,ts->tick);
goflag=(diff>sg->interval || diff<0);
if (sg->skill_id == CR_GRANDCROSS && !battle_config.gx_allhit) // 重なっていたら3HITしない
@@ -5894,8 +5896,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
if(!goflag)
return 0;
ts->tick=tick;
- ts->group_id=sg->group_id;
-
+
switch(sg->unit_id){
case 0x83: /* サンクチュアリ */
{
@@ -5938,7 +5939,6 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
case 0x85: /* ニュ?マ */
{
struct skill_unit *unit2;
- struct status_change *sc_data=status_get_sc_data(bl);
int type=SC_PNEUMA;
if(sc_data) {
if (sc_data[type].timer==-1)
@@ -5952,19 +5952,9 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int
}
break;
case 0x7e: /* セイフティウォ?ル */
- {
- struct skill_unit *unit2;
- struct status_change *sc_data=status_get_sc_data(bl);
- int type=SC_SAFETYWALL;
- if(sc_data) {
- if (sc_data[type].timer==-1)
- status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0);
- else if((unit2=(struct skill_unit *)sc_data[type].val2) && unit2 != src ){
- if(sg->val1 < unit2->group->val1 )
- status_change_start(bl,type,sg->skill_lv,(int)src,0,0,0,0);
- ts->tick-=sg->interval;
- }
- }
+ if (sc_data) {
+ status_change_start(bl,SC_SAFETYWALL,sg->skill_lv,(int)src,0,0,0,0);
+ ts->tick-=sg->interval;
}
break;
@@ -6452,7 +6442,7 @@ int skill_unit_onout(struct skill_unit *src,struct block_list *bl,unsigned int t
printf("skill_unit_onout: Unknown skill unit id=%d block=%d\n",sg->unit_id,bl->id);
break;*/
}
- skill_unitgrouptickset_delete(bl,sg->group_id);
+ skill_unitgrouptickset_delete(bl,sg);
return 0;
}
/*==========================================
@@ -6510,7 +6500,7 @@ int skill_unit_ondelete(struct skill_unit *src,struct block_list *bl,unsigned in
printf("skill_unit_ondelete: Unknown skill unit id=%d block=%d\n",sg->unit_id,bl->id);
break;*/
}
- skill_unitgrouptickset_delete(bl,sg->group_id);
+ skill_unitgrouptickset_delete(bl,sg);
return 0;
}
/*==========================================
@@ -6543,8 +6533,6 @@ int skill_unit_onlimit(struct skill_unit *src,unsigned int tick)
break;
case 0x8d: /* アイスウォ?ル */
- if(map_read_flag == READ_FROM_BITMAP)
- map_setcell(src->bl.m,src->bl.x,src->bl.y,CELL_SETPASS);
map_setcell(src->bl.m,src->bl.x,src->bl.y,src->val2);
clif_changemapcell(src->bl.m,src->bl.x,src->bl.y,src->val2,1);
break;
@@ -9059,31 +9047,63 @@ int skill_clear_unitgroup(struct block_list *src)
return 0;
}
+/*
+ * 珞ヌォケォュォェェヘヌェュェキェゾェホヤムツ
+ */
+int skill_unit_overlap_type(int skill_id)
+{
+ switch (skill_id) {
+ case WZ_STORMGUST:
+ case WZ_VERMILION:
+ return 1; // ェノェチェ鬪ォ鰥ーェォェ鬮タォ?ォクェ磑ェアェ
+ default:
+ return 0; // ?ローェォェ鬮タォ?ォクェ磑ェアェ
+ }
+}
+
/*==========================================
* スキルユニットグル?プの被影響tick?索
*------------------------------------------
*/
struct skill_unit_group_tickset *skill_unitgrouptickset_search(
- struct block_list *bl,int group_id)
+ struct block_list *bl, struct skill_unit_group *sg)
{
- int i,j=0,k,s=group_id%MAX_SKILLUNITGROUPTICKSET;
- struct skill_unit_group_tickset *set=NULL;
+ int i,j=-1,k,s,id;
+ struct skill_unit_group_tickset *set;
nullpo_retr(0, bl);
- if(bl->type==BL_PC){
- set=((struct map_session_data *)bl)->skillunittick;
- }else{
- set=((struct mob_data *)bl)->skillunittick;
- }
- if(set==NULL)
+ if (bl->type == BL_PC)
+ set = ((struct map_session_data *)bl)->skillunittick;
+ else if (bl->type == BL_MOB)
+ set = ((struct mob_data *)bl)->skillunittick;
+ else
return 0;
- for(i=0;i<MAX_SKILLUNITGROUPTICKSET;i++)
- if( set[(k=(i+s)%MAX_SKILLUNITGROUPTICKSET)].group_id == group_id )
+
+ if (skill_unit_overlap_type(sg->skill_id))
+ id = s = sg->skill_id;
+ else
+ id = s = sg->group_id;
+
+ for (i=0; i<MAX_SKILLUNITGROUPTICKSET; i++) {
+ k = (i+s) % MAX_SKILLUNITGROUPTICKSET;
+ if (set[k].id == id)
return &set[k];
- else if( set[k].group_id==0 )
+ else if (j == -1 && set[k].id == 0)
j=k;
+ }
+
+ if (j == -1) {
+ if(battle_config.error_log) {
+ sprintf (tmp_output, "skill_unitgrouptickset_search: tickset is full\n");
+ ShowWarning (tmp_output);
+ }
+ for (i = 0; i<MAX_SKILLUNITGROUPTICKSET; i++)
+ set[k].id = 0;
+ j = id % MAX_SKILLUNITGROUPTICKSET;
+ }
+ set[j].id = id;
return &set[j];
}
@@ -9091,26 +9111,36 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search(
* スキルユニットグル?プの被影響tick削除
*------------------------------------------
*/
-int skill_unitgrouptickset_delete(struct block_list *bl,int group_id)
+int skill_unitgrouptickset_delete(
+ struct block_list *bl, struct skill_unit_group *sg)
{
- int i,s=group_id%MAX_SKILLUNITGROUPTICKSET;
- struct skill_unit_group_tickset *set=NULL,*ts;
+ int i, k, s, id;
+ struct skill_unit_group_tickset *set=NULL;
nullpo_retr(0, bl);
-
- if(bl->type==BL_PC){
+ if (bl->type == BL_PC)
set=((struct map_session_data *)bl)->skillunittick;
- }else{
+ else if (bl->type == BL_MOB)
set=((struct mob_data *)bl)->skillunittick;
- }
-
- if(set!=NULL){
+ else
+ return 0;
- for(i=0;i<MAX_SKILLUNITGROUPTICKSET;i++)
- if( (ts=&set[(i+s)%MAX_SKILLUNITGROUPTICKSET])->group_id == group_id )
- ts->group_id=0;
+ if (skill_unit_overlap_type(sg->skill_id))
+ id = s = sg->skill_id;
+ else
+ id = s = sg->group_id;
+ for(i=0; i<MAX_SKILLUNITGROUPTICKSET; i++) {
+ k = (i+s) % MAX_SKILLUNITGROUPTICKSET;
+ if (set[k].id == id) {
+ set[k].id = 0;
+ break;
+ }
}
+// if (i == MAX_SKILLUNITGROUPTICKSET && battle_config.error_log) {
+// printf("skill_unitgrouptickset_delete: tickset not found\n");
+// }
+
return 0;
}