From 5a6c73fcc0948c1b570b5df99b191514d06337dd Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 15 Feb 2006 03:51:59 +0000 Subject: - Some cleaning of the slave moving code. - Fixed the icon for Provoke not showing. - Fixed skill_timerskills (type was not being stored, water-ball at least got broken, doing only 1 hit always) - pc_setinventorydata won't try to set data for positions with no item. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5283 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 2 +- src/map/mob.c | 44 ++++++++++++++++++++------------------------ src/map/pc.c | 2 +- src/map/skill.c | 7 ++++--- src/map/status.c | 2 +- 5 files changed, 27 insertions(+), 30 deletions(-) (limited to 'src/map') diff --git a/src/map/battle.c b/src/map/battle.c index a5b711bab..244cbe960 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3098,7 +3098,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, int boss = status_get_mode(target)&MD_BOSS; int rate = 0; if (sd->weapon_coma_ele[ele] > 0) - rate+=sd->weapon_coma_ele[ele]; + rate += sd->weapon_coma_ele[ele]; if (sd->weapon_coma_race[race] > 0) rate += sd->weapon_coma_race[race]; if (sd->weapon_coma_race[boss?10:11] > 0) diff --git a/src/map/mob.c b/src/map/mob.c index 1c9ec49f3..40bf82cb6 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1420,34 +1420,30 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick) return 0; } - // Although there is the master, since it is somewhat far, it approaches. - if((!md->target_id || md->state.targettype == NONE_ATTACKABLE) && mob_can_move(md) && - md->master_distdb->range3 && (md->walkpath.path_pos>=md->walkpath.path_len || md->walkpath.path_len==0)){ + // Approach master if within view range, chase back to Master's area also if standing on top of the master. + if(md->master_distdb->range3 && (md->master_dist>MOB_SLAVEDISTANCE || md->master_dist == 0) && + mob_can_move(md) && md->state.state == MS_IDLE) + { int i=0,dx,dy,ret; - if(md->master_dist>MOB_SLAVEDISTANCE || md->master_dist == 0) - { //Chase back to Master's area also if standing on top of the master. - do { - if(i<=5){ - dx=bl->x - md->bl.x; - dy=bl->y - md->bl.y; + do { + if(i<=5){ + dx=bl->x - md->bl.x; + dy=bl->y - md->bl.y; - if(dx<0) dx+=rand()%MOB_SLAVEDISTANCE +1; - else if(dx>0) dx-=rand()%MOB_SLAVEDISTANCE +1; - - if(dy<0) dy+=rand()%MOB_SLAVEDISTANCE +1; - else if(dy>0) dy-=rand()%MOB_SLAVEDISTANCE +1; + if(dx<0) dx+=rand()%MOB_SLAVEDISTANCE +1; + else if(dx>0) dx-=rand()%MOB_SLAVEDISTANCE +1; + if(dy<0) dy+=rand()%MOB_SLAVEDISTANCE +1; + else if(dy>0) dy-=rand()%MOB_SLAVEDISTANCE +1; - }else{ - ret = MOB_SLAVEDISTANCE*2+1; - dx=bl->x - md->bl.x + rand()%ret - MOB_SLAVEDISTANCE; - dy=bl->y - md->bl.y + rand()%ret - MOB_SLAVEDISTANCE; - } + }else{ + ret = MOB_SLAVEDISTANCE*2+1; + dx=bl->x - md->bl.x + rand()%ret - MOB_SLAVEDISTANCE; + dy=bl->y - md->bl.y + rand()%ret - MOB_SLAVEDISTANCE; + } - ret=mob_walktoxy(md,md->bl.x+dx,md->bl.y+dy,0); - i++; - } while(ret && i<10); - md->next_walktime=tick+1000; - } + ret=mob_walktoxy(md,md->bl.x+dx,md->bl.y+dy,0); + i++; + } while(ret && i<10); } } else if (bl->m != md->bl.m && map_flag_gvg(md->bl.m)) { //Delete the summoned mob if it's in a gvg ground and the master is elsewhere. [Skotlex] diff --git a/src/map/pc.c b/src/map/pc.c index e4085c48f..fe435d73f 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -490,7 +490,7 @@ int pc_setinventorydata(struct map_session_data *sd) for(i=0;istatus.inventory[i].nameid; - sd->inventory_data[i] = itemdb_search(id); + sd->inventory_data[i] = id?itemdb_search(id):NULL; } return 0; } diff --git a/src/map/skill.c b/src/map/skill.c index b1836c6bc..24298fb82 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2330,7 +2330,7 @@ int skill_addtimerskill(struct block_list *src,unsigned int tick,int target,int } for(i=0;i=max) return 1; - + sts[i].timer = add_timer(tick, skill_timerskill, src->id, i); sts[i].src_id = src->id; sts[i].target_id = target; @@ -2339,6 +2339,7 @@ int skill_addtimerskill(struct block_list *src,unsigned int tick,int target,int sts[i].map = src->m; sts[i].x = x; sts[i].y = y; + sts[i].type = type; sts[i].flag = flag; if (count) (*count)++; @@ -2532,11 +2533,11 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s case NPC_HOLYATTACK: case NPC_DARKNESSATTACK: case NPC_TELEKINESISATTACK: + case NPC_UNDEADATTACK: case NPC_BREAKARMOR: + case NPC_BREAKWEAPON: case NPC_BREAKHELM: case NPC_BREAKSHIELD: - case NPC_BREAKWEAPON: - case NPC_UNDEADATTACK: case LK_AURABLADE: /* オ?ラブレ?ド */ case LK_SPIRALPIERCE: /* スパイラルピア?ス */ case LK_HEADCRUSH: /* ヘッドクラッシュ */ diff --git a/src/map/status.c b/src/map/status.c index 856e0d4f5..f7f88aaa9 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -75,7 +75,7 @@ void initChangeTables(void) { if (StatusIconChangeTable[sc]==SI_BLANK) StatusIconChangeTable[sc] = icon; set_sc(SM_BASH, SC_STUN, SI_BLANK); - set_sc(SM_PROVOKE, SC_PROVOKE, SI_BLANK); + set_sc(SM_PROVOKE, SC_PROVOKE, SI_PROVOKE); set_sc(SM_MAGNUM, SC_WATK_ELEMENT, SI_BLANK); set_sc(SM_ENDURE, SC_ENDURE, SI_ENDURE); set_sc(MG_SIGHT, SC_SIGHT, SI_BLANK); -- cgit v1.2.3-70-g09d2